summaryrefslogtreecommitdiffstats
path: root/libvpx
diff options
context:
space:
mode:
Diffstat (limited to 'libvpx')
-rw-r--r--libvpx/.mailmap10
-rw-r--r--libvpx/AUTHORS35
-rw-r--r--libvpx/CHANGELOG50
-rw-r--r--libvpx/README3
-rw-r--r--libvpx/args.h12
-rw-r--r--libvpx/build/arm-msvs/obj_int_extract.bat8
-rw-r--r--libvpx/build/make/Android.mk6
-rw-r--r--libvpx/build/make/Makefile14
-rwxr-xr-xlibvpx/build/make/ads2armasm_ms.pl3
-rwxr-xr-xlibvpx/build/make/ads2gas.pl2
-rwxr-xr-xlibvpx/build/make/ads2gas_apple.pl37
-rwxr-xr-xlibvpx/build/make/configure.sh104
-rwxr-xr-xlibvpx/build/make/gen_msvs_proj.sh12
-rwxr-xr-xlibvpx/build/make/gen_msvs_sln.sh7
-rwxr-xr-xlibvpx/build/make/gen_msvs_vcxproj.sh60
-rw-r--r--libvpx/build/make/obj_int_extract.c24
-rwxr-xr-xlibvpx/build/make/rtcd.pl414
-rwxr-xr-xlibvpx/build/make/rtcd.sh363
-rw-r--r--libvpx/build/make/thumb.pm6
-rw-r--r--libvpx/build/x86-msvs/obj_int_extract.bat5
-rwxr-xr-xlibvpx/configure34
-rw-r--r--libvpx/docs.mk1
-rw-r--r--libvpx/examples.mk214
-rw-r--r--libvpx/examples/decode_to_md5.c139
-rw-r--r--libvpx/examples/decode_to_md5.txt48
-rw-r--r--libvpx/examples/decode_with_drops.c154
-rw-r--r--libvpx/examples/decode_with_drops.txt73
-rw-r--r--libvpx/examples/decode_with_partial_drops.c328
-rw-r--r--libvpx/examples/decode_with_partial_drops.txt238
-rw-r--r--libvpx/examples/decoder_tmpl.c104
-rw-r--r--libvpx/examples/decoder_tmpl.txt62
-rw-r--r--libvpx/examples/encoder_tmpl.c186
-rw-r--r--libvpx/examples/encoder_tmpl.txt74
-rw-r--r--libvpx/examples/error_resilient.txt25
-rw-r--r--libvpx/examples/example_xma.c (renamed from libvpx/example_xma.c)8
-rw-r--r--libvpx/examples/force_keyframe.txt28
-rwxr-xr-xlibvpx/examples/gen_example_code.sh85
-rwxr-xr-xlibvpx/examples/gen_example_doxy.php224
-rwxr-xr-xlibvpx/examples/gen_example_text.sh84
-rw-r--r--libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.cfg.php218
-rw-r--r--libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.class.php1119
-rw-r--r--libvpx/examples/includes/ASCIIMathPHP-2.0/htmlMathML.js86
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/.gitattributes1
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/Changes26
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/MANIFEST26
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/Makefile.PL8
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/Toc.pm549
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/Toc.pod1710
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/TocGenerator.pm1793
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/TocInsertor.pm1066
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/TocUpdator.pm693
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm92
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm5
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/extend.t87
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/format.t157
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/generate.t200
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/insert.t336
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t768
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/options.t194
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t709
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t176
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t97
-rw-r--r--libvpx/examples/includes/HTML-Toc-0.91/t/update.t114
-rw-r--r--libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/License.text36
-rw-r--r--libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/PHP Markdown Extra Readme.text731
-rw-r--r--libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/markdown.php2909
-rw-r--r--libvpx/examples/includes/PHP-SmartyPants-1.5.1e/PHP SmartyPants Readme.txt394
-rw-r--r--libvpx/examples/includes/PHP-SmartyPants-1.5.1e/smartypants.php860
-rw-r--r--libvpx/examples/includes/geshi/contrib/aliased.php124
-rw-r--r--libvpx/examples/includes/geshi/contrib/cssgen.php456
-rw-r--r--libvpx/examples/includes/geshi/contrib/cssgen2.php59
-rw-r--r--libvpx/examples/includes/geshi/contrib/example.php217
-rw-r--r--libvpx/examples/includes/geshi/contrib/langcheck.php666
-rw-r--r--libvpx/examples/includes/geshi/docs/BUGS29
-rw-r--r--libvpx/examples/includes/geshi/docs/CHANGES682
-rw-r--r--libvpx/examples/includes/geshi/docs/COPYING340
-rw-r--r--libvpx/examples/includes/geshi/docs/README33
-rw-r--r--libvpx/examples/includes/geshi/docs/THANKS163
-rw-r--r--libvpx/examples/includes/geshi/docs/TODO71
-rw-r--r--libvpx/examples/includes/geshi/docs/api/__filesource/fsource_geshi_core_geshi.php.html4616
-rw-r--r--libvpx/examples/includes/geshi/docs/api/blank.html13
-rw-r--r--libvpx/examples/includes/geshi/docs/api/classtrees_geshi.html24
-rw-r--r--libvpx/examples/includes/geshi/docs/api/elementindex.html867
-rw-r--r--libvpx/examples/includes/geshi/docs/api/elementindex_geshi.html864
-rw-r--r--libvpx/examples/includes/geshi/docs/api/errors.html20
-rw-r--r--libvpx/examples/includes/geshi/docs/api/geshi/core/GeSHi.html2676
-rw-r--r--libvpx/examples/includes/geshi/docs/api/geshi/core/_geshi.php.html478
-rw-r--r--libvpx/examples/includes/geshi/docs/api/index.html24
-rw-r--r--libvpx/examples/includes/geshi/docs/api/li_geshi.html46
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/banner.css33
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass.pngbin620 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass_logo.pngbin1232 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/AbstractMethod.pngbin696 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass.pngbin848 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass_logo.pngbin1615 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateMethod.pngbin874 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Class.pngbin570 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Class_logo.pngbin1600 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Constant.pngbin752 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Constructor.pngbin865 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Destructor.pngbin956 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Function.pngbin596 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Global.pngbin712 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/I.pngbin148 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Index.pngbin584 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Interface.pngbin1083 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Interface_logo.pngbin1600 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/L.pngbin153 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Lminus.pngbin219 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Lplus.pngbin224 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Method.pngbin661 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Page.pngbin592 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Page_logo.pngbin1369 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass.pngbin790 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass_logo.pngbin1836 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/PrivateMethod.pngbin918 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/PrivateVariable.pngbin772 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/StaticMethod.pngbin661 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/StaticVariable.pngbin688 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/T.pngbin152 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Tminus.pngbin207 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Tplus.pngbin222 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/Variable.pngbin688 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/blank.pngbin144 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/class_folder.pngbin633 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/empty.pngbin90 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/file.pngbin462 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/folder.pngbin492 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/function_folder.pngbin605 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/next_button.pngbin657 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/next_button_disabled.pngbin543 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/package.pngbin668 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/package_folder.pngbin564 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/previous_button.pngbin644 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/previous_button_disabled.pngbin541 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/private_class_logo.pngbin1836 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/tutorial.pngbin431 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/tutorial_folder.pngbin572 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/images/up_button.pngbin668 -> 0 bytes
-rw-r--r--libvpx/examples/includes/geshi/docs/api/media/stylesheet.css145
-rw-r--r--libvpx/examples/includes/geshi/docs/api/packages.html29
-rw-r--r--libvpx/examples/includes/geshi/docs/api/todolist.html42
-rw-r--r--libvpx/examples/includes/geshi/docs/geshi-doc.html4051
-rw-r--r--libvpx/examples/includes/geshi/docs/geshi-doc.txt1740
-rw-r--r--libvpx/examples/includes/geshi/docs/phpdoc.ini90
-rw-r--r--libvpx/examples/includes/geshi/geshi.php4619
-rw-r--r--libvpx/examples/includes/geshi/geshi/abap.php1419
-rw-r--r--libvpx/examples/includes/geshi/geshi/actionscript.php197
-rw-r--r--libvpx/examples/includes/geshi/geshi/actionscript3.php467
-rw-r--r--libvpx/examples/includes/geshi/geshi/ada.php133
-rw-r--r--libvpx/examples/includes/geshi/geshi/apache.php206
-rw-r--r--libvpx/examples/includes/geshi/geshi/applescript.php157
-rw-r--r--libvpx/examples/includes/geshi/geshi/apt_sources.php144
-rw-r--r--libvpx/examples/includes/geshi/geshi/asm.php225
-rw-r--r--libvpx/examples/includes/geshi/geshi/asp.php164
-rw-r--r--libvpx/examples/includes/geshi/geshi/autoit.php1171
-rw-r--r--libvpx/examples/includes/geshi/geshi/avisynth.php194
-rw-r--r--libvpx/examples/includes/geshi/geshi/bash.php282
-rw-r--r--libvpx/examples/includes/geshi/geshi/basic4gl.php341
-rw-r--r--libvpx/examples/includes/geshi/geshi/bf.php114
-rw-r--r--libvpx/examples/includes/geshi/geshi/blitzbasic.php185
-rw-r--r--libvpx/examples/includes/geshi/geshi/bnf.php110
-rw-r--r--libvpx/examples/includes/geshi/geshi/boo.php217
-rw-r--r--libvpx/examples/includes/geshi/geshi/c.php188
-rw-r--r--libvpx/examples/includes/geshi/geshi/c_mac.php212
-rw-r--r--libvpx/examples/includes/geshi/geshi/caddcl.php126
-rw-r--r--libvpx/examples/includes/geshi/geshi/cadlisp.php186
-rw-r--r--libvpx/examples/includes/geshi/geshi/cfdg.php124
-rw-r--r--libvpx/examples/includes/geshi/geshi/cfm.php299
-rw-r--r--libvpx/examples/includes/geshi/geshi/cil.php196
-rw-r--r--libvpx/examples/includes/geshi/geshi/cobol.php244
-rw-r--r--libvpx/examples/includes/geshi/geshi/cpp-qt.php315
-rw-r--r--libvpx/examples/includes/geshi/geshi/cpp.php226
-rw-r--r--libvpx/examples/includes/geshi/geshi/csharp.php249
-rw-r--r--libvpx/examples/includes/geshi/geshi/css.php212
-rw-r--r--libvpx/examples/includes/geshi/geshi/d.php272
-rw-r--r--libvpx/examples/includes/geshi/geshi/dcs.php185
-rw-r--r--libvpx/examples/includes/geshi/geshi/delphi.php289
-rw-r--r--libvpx/examples/includes/geshi/geshi/diff.php196
-rw-r--r--libvpx/examples/includes/geshi/geshi/div.php126
-rw-r--r--libvpx/examples/includes/geshi/geshi/dos.php198
-rw-r--r--libvpx/examples/includes/geshi/geshi/dot.php164
-rw-r--r--libvpx/examples/includes/geshi/geshi/eiffel.php395
-rw-r--r--libvpx/examples/includes/geshi/geshi/email.php209
-rw-r--r--libvpx/examples/includes/geshi/geshi/fortran.php160
-rw-r--r--libvpx/examples/includes/geshi/geshi/freebasic.php141
-rw-r--r--libvpx/examples/includes/geshi/geshi/genero.php463
-rw-r--r--libvpx/examples/includes/geshi/geshi/gettext.php97
-rw-r--r--libvpx/examples/includes/geshi/geshi/glsl.php205
-rw-r--r--libvpx/examples/includes/geshi/geshi/gml.php506
-rw-r--r--libvpx/examples/includes/geshi/geshi/gnuplot.php296
-rw-r--r--libvpx/examples/includes/geshi/geshi/groovy.php1011
-rw-r--r--libvpx/examples/includes/geshi/geshi/haskell.php198
-rw-r--r--libvpx/examples/includes/geshi/geshi/hq9plus.php104
-rw-r--r--libvpx/examples/includes/geshi/geshi/html4strict.php203
-rw-r--r--libvpx/examples/includes/geshi/geshi/idl.php123
-rw-r--r--libvpx/examples/includes/geshi/geshi/ini.php128
-rw-r--r--libvpx/examples/includes/geshi/geshi/inno.php212
-rw-r--r--libvpx/examples/includes/geshi/geshi/intercal.php122
-rw-r--r--libvpx/examples/includes/geshi/geshi/io.php138
-rw-r--r--libvpx/examples/includes/geshi/geshi/java.php983
-rw-r--r--libvpx/examples/includes/geshi/geshi/java5.php1031
-rw-r--r--libvpx/examples/includes/geshi/geshi/javascript.php150
-rw-r--r--libvpx/examples/includes/geshi/geshi/kixtart.php329
-rw-r--r--libvpx/examples/includes/geshi/geshi/klonec.php282
-rw-r--r--libvpx/examples/includes/geshi/geshi/klonecpp.php310
-rw-r--r--libvpx/examples/includes/geshi/geshi/latex.php209
-rw-r--r--libvpx/examples/includes/geshi/geshi/lisp.php144
-rw-r--r--libvpx/examples/includes/geshi/geshi/locobasic.php130
-rw-r--r--libvpx/examples/includes/geshi/geshi/lolcode.php152
-rw-r--r--libvpx/examples/includes/geshi/geshi/lotusformulas.php318
-rw-r--r--libvpx/examples/includes/geshi/geshi/lotusscript.php191
-rw-r--r--libvpx/examples/includes/geshi/geshi/lscript.php387
-rw-r--r--libvpx/examples/includes/geshi/geshi/lsl2.php898
-rw-r--r--libvpx/examples/includes/geshi/geshi/lua.php137
-rw-r--r--libvpx/examples/includes/geshi/geshi/m68k.php143
-rw-r--r--libvpx/examples/includes/geshi/geshi/make.php151
-rw-r--r--libvpx/examples/includes/geshi/geshi/matlab.php227
-rw-r--r--libvpx/examples/includes/geshi/geshi/mirc.php173
-rw-r--r--libvpx/examples/includes/geshi/geshi/modula3.php135
-rw-r--r--libvpx/examples/includes/geshi/geshi/mpasm.php164
-rw-r--r--libvpx/examples/includes/geshi/geshi/mxml.php145
-rw-r--r--libvpx/examples/includes/geshi/geshi/mysql.php475
-rw-r--r--libvpx/examples/includes/geshi/geshi/nsis.php351
-rw-r--r--libvpx/examples/includes/geshi/geshi/objc.php358
-rw-r--r--libvpx/examples/includes/geshi/geshi/ocaml-brief.php112
-rw-r--r--libvpx/examples/includes/geshi/geshi/ocaml.php174
-rw-r--r--libvpx/examples/includes/geshi/geshi/oobas.php135
-rw-r--r--libvpx/examples/includes/geshi/geshi/oracle11.php614
-rw-r--r--libvpx/examples/includes/geshi/geshi/oracle8.php496
-rw-r--r--libvpx/examples/includes/geshi/geshi/pascal.php152
-rw-r--r--libvpx/examples/includes/geshi/geshi/per.php302
-rw-r--r--libvpx/examples/includes/geshi/geshi/perl.php213
-rw-r--r--libvpx/examples/includes/geshi/geshi/php-brief.php202
-rw-r--r--libvpx/examples/includes/geshi/geshi/php.php1094
-rw-r--r--libvpx/examples/includes/geshi/geshi/pic16.php141
-rw-r--r--libvpx/examples/includes/geshi/geshi/pixelbender.php176
-rw-r--r--libvpx/examples/includes/geshi/geshi/plsql.php256
-rw-r--r--libvpx/examples/includes/geshi/geshi/povray.php199
-rw-r--r--libvpx/examples/includes/geshi/geshi/powershell.php279
-rw-r--r--libvpx/examples/includes/geshi/geshi/progress.php479
-rw-r--r--libvpx/examples/includes/geshi/geshi/prolog.php143
-rw-r--r--libvpx/examples/includes/geshi/geshi/providex.php299
-rw-r--r--libvpx/examples/includes/geshi/geshi/python.php237
-rw-r--r--libvpx/examples/includes/geshi/geshi/qbasic.php151
-rw-r--r--libvpx/examples/includes/geshi/geshi/rails.php406
-rw-r--r--libvpx/examples/includes/geshi/geshi/rebol.php196
-rw-r--r--libvpx/examples/includes/geshi/geshi/reg.php233
-rw-r--r--libvpx/examples/includes/geshi/geshi/robots.php98
-rw-r--r--libvpx/examples/includes/geshi/geshi/ruby.php226
-rw-r--r--libvpx/examples/includes/geshi/geshi/sas.php290
-rw-r--r--libvpx/examples/includes/geshi/geshi/scala.php122
-rw-r--r--libvpx/examples/includes/geshi/geshi/scheme.php170
-rw-r--r--libvpx/examples/includes/geshi/geshi/scilab.php295
-rw-r--r--libvpx/examples/includes/geshi/geshi/sdlbasic.php165
-rw-r--r--libvpx/examples/includes/geshi/geshi/smalltalk.php160
-rw-r--r--libvpx/examples/includes/geshi/geshi/smarty.php192
-rw-r--r--libvpx/examples/includes/geshi/geshi/sql.php140
-rw-r--r--libvpx/examples/includes/geshi/geshi/tcl.php194
-rw-r--r--libvpx/examples/includes/geshi/geshi/teraterm.php317
-rw-r--r--libvpx/examples/includes/geshi/geshi/text.php84
-rw-r--r--libvpx/examples/includes/geshi/geshi/thinbasic.php868
-rw-r--r--libvpx/examples/includes/geshi/geshi/tsql.php378
-rw-r--r--libvpx/examples/includes/geshi/geshi/typoscript.php300
-rw-r--r--libvpx/examples/includes/geshi/geshi/vb.php133
-rw-r--r--libvpx/examples/includes/geshi/geshi/vbnet.php201
-rw-r--r--libvpx/examples/includes/geshi/geshi/verilog.php173
-rw-r--r--libvpx/examples/includes/geshi/geshi/vhdl.php144
-rw-r--r--libvpx/examples/includes/geshi/geshi/vim.php185
-rw-r--r--libvpx/examples/includes/geshi/geshi/visualfoxpro.php456
-rw-r--r--libvpx/examples/includes/geshi/geshi/visualprolog.php129
-rw-r--r--libvpx/examples/includes/geshi/geshi/whitespace.php121
-rw-r--r--libvpx/examples/includes/geshi/geshi/winbatch.php369
-rw-r--r--libvpx/examples/includes/geshi/geshi/xml.php157
-rw-r--r--libvpx/examples/includes/geshi/geshi/xorg_conf.php124
-rw-r--r--libvpx/examples/includes/geshi/geshi/xpp.php436
-rw-r--r--libvpx/examples/includes/geshi/geshi/z80.php144
-rw-r--r--libvpx/examples/includes/vp8_doc_tools.php207
-rw-r--r--libvpx/examples/postproc.c140
-rw-r--r--libvpx/examples/postproc.txt67
-rw-r--r--libvpx/examples/resize_util.c120
-rw-r--r--libvpx/examples/set_maps.c243
-rw-r--r--libvpx/examples/simple_decoder.c158
-rw-r--r--libvpx/examples/simple_decoder.txt96
-rw-r--r--libvpx/examples/simple_encoder.c252
-rw-r--r--libvpx/examples/simple_encoder.txt105
-rw-r--r--libvpx/examples/twopass_encoder.c230
-rw-r--r--libvpx/examples/twopass_encoder.txt87
-rw-r--r--libvpx/examples/vp8_multi_resolution_encoder.c (renamed from libvpx/vp8_multi_resolution_encoder.c)22
-rw-r--r--libvpx/examples/vp8_set_maps.txt96
-rw-r--r--libvpx/examples/vp8cx_set_ref.c187
-rw-r--r--libvpx/examples/vp8cx_set_ref.txt73
-rw-r--r--libvpx/examples/vp9_spatial_scalable_encoder.c (renamed from libvpx/vp9_spatial_scalable_encoder.c)296
-rw-r--r--libvpx/examples/vpx_temporal_scalable_patterns.c659
-rw-r--r--libvpx/ivfdec.c112
-rw-r--r--libvpx/ivfdec.h (renamed from libvpx/vp9/encoder/vp9_dct.h)22
-rw-r--r--libvpx/ivfenc.c53
-rw-r--r--libvpx/ivfenc.h35
-rw-r--r--libvpx/libs.mk39
-rw-r--r--libvpx/md5_utils.h14
-rw-r--r--libvpx/nestegg/.gitignore40
-rw-r--r--libvpx/nestegg/AUTHORS1
-rw-r--r--libvpx/nestegg/Makefile.am51
-rw-r--r--libvpx/nestegg/configure.ac124
-rw-r--r--libvpx/nestegg/docs/Doxyfile.in1551
-rw-r--r--libvpx/nestegg/docs/Makefile.am38
-rw-r--r--libvpx/nestegg/m4/as-ac-expand.m443
-rw-r--r--libvpx/nestegg/m4/ax_create_stdint_h.m4695
-rw-r--r--libvpx/nestegg/m4/pkg.m4157
-rw-r--r--libvpx/nestegg/nestegg-uninstalled.pc.in13
-rw-r--r--libvpx/nestegg/nestegg.pc.in13
-rw-r--r--libvpx/rate_hist.c282
-rw-r--r--libvpx/rate_hist.h40
-rw-r--r--libvpx/test/acm_random.h5
-rw-r--r--libvpx/test/active_map_test.cc92
-rw-r--r--libvpx/test/aq_segment_test.cc119
-rw-r--r--libvpx/test/borders_test.cc3
-rw-r--r--libvpx/test/clear_system_state.h2
-rw-r--r--libvpx/test/codec_factory.h12
-rw-r--r--libvpx/test/config_test.cc1
-rw-r--r--libvpx/test/convolve_test.cc6
-rw-r--r--libvpx/test/cpu_speed_test.cc9
-rw-r--r--libvpx/test/cq_test.cc11
-rw-r--r--libvpx/test/datarate_test.cc400
-rw-r--r--libvpx/test/dct16x16_test.cc46
-rw-r--r--libvpx/test/dct32x32_test.cc29
-rw-r--r--libvpx/test/decode_perf_test.cc105
-rw-r--r--libvpx/test/decode_test_driver.cc9
-rw-r--r--libvpx/test/decode_test_driver.h17
-rw-r--r--libvpx/test/encode_test_driver.h17
-rw-r--r--libvpx/test/error_resilience_test.cc65
-rw-r--r--libvpx/test/external_frame_buffer_test.cc466
-rw-r--r--libvpx/test/fdct4x4_test.cc47
-rw-r--r--libvpx/test/fdct8x8_test.cc52
-rw-r--r--libvpx/test/i420_video_source.h2
-rw-r--r--libvpx/test/idct8x8_test.cc2
-rw-r--r--libvpx/test/idct_test.cc2
-rw-r--r--libvpx/test/intrapred_test.cc19
-rw-r--r--libvpx/test/ivf_video_source.h6
-rw-r--r--libvpx/test/keyframe_test.cc1
-rw-r--r--libvpx/test/md5_helper.h2
-rw-r--r--libvpx/test/partial_idct_test.cc193
-rw-r--r--libvpx/test/pp_filter_test.cc2
-rw-r--r--libvpx/test/register_state_check.h63
-rw-r--r--libvpx/test/resize_test.cc16
-rw-r--r--libvpx/test/sad_test.cc26
-rw-r--r--libvpx/test/set_roi.cc4
-rw-r--r--libvpx/test/sixtap_predict_test.cc33
-rw-r--r--libvpx/test/subtract_test.cc9
-rw-r--r--libvpx/test/superframe_test.cc1
-rw-r--r--libvpx/test/svc_test.cc109
-rw-r--r--libvpx/test/test-data.sha146
-rw-r--r--libvpx/test/test.mk285
-rw-r--r--libvpx/test/test_libvpx.cc22
-rw-r--r--libvpx/test/test_vector_test.cc174
-rw-r--r--libvpx/test/test_vectors.cc168
-rw-r--r--libvpx/test/test_vectors.h31
-rw-r--r--libvpx/test/tile_independence_test.cc16
-rw-r--r--libvpx/test/util.h1
-rw-r--r--libvpx/test/variance_test.cc19
-rw-r--r--libvpx/test/video_source.h4
-rw-r--r--libvpx/test/vp8_boolcoder_test.cc10
-rw-r--r--libvpx/test/vp8_decrypt_test.cc8
-rw-r--r--libvpx/test/vp8_fdct4x4_test.cc21
-rw-r--r--libvpx/test/vp9_boolcoder_test.cc6
-rw-r--r--libvpx/test/vp9_lossless_test.cc56
-rw-r--r--libvpx/test/vp9_subtract_test.cc6
-rw-r--r--libvpx/test/vp9_thread_test.cc4
-rw-r--r--libvpx/test/webm_video_source.h18
-rw-r--r--libvpx/test/y4m_video_source.h111
-rw-r--r--libvpx/third_party/libmkv/EbmlBufferWriter.c2
-rw-r--r--libvpx/third_party/libmkv/Makefile18
-rw-r--r--libvpx/third_party/libmkv/WebMElement.c23
-rw-r--r--libvpx/third_party/libmkv/WebMElement.h27
-rw-r--r--libvpx/third_party/libwebm/AUTHORS.TXT4
-rw-r--r--libvpx/third_party/libwebm/LICENSE.TXT30
-rw-r--r--libvpx/third_party/libwebm/PATENTS.TXT22
-rw-r--r--libvpx/third_party/libwebm/README.webm7
-rw-r--r--libvpx/third_party/libwebm/RELEASE.TXT34
-rw-r--r--libvpx/third_party/libwebm/mkvmuxer.cpp3245
-rw-r--r--libvpx/third_party/libwebm/mkvmuxer.hpp1403
-rw-r--r--libvpx/third_party/libwebm/mkvmuxertypes.hpp30
-rw-r--r--libvpx/third_party/libwebm/mkvmuxerutil.cpp713
-rw-r--r--libvpx/third_party/libwebm/mkvmuxerutil.hpp151
-rw-r--r--libvpx/third_party/libwebm/mkvparser.cpp9617
-rw-r--r--libvpx/third_party/libwebm/mkvparser.hpp1079
-rw-r--r--libvpx/third_party/libwebm/mkvreader.cpp128
-rw-r--r--libvpx/third_party/libwebm/mkvreader.hpp38
-rw-r--r--libvpx/third_party/libwebm/mkvwriter.cpp97
-rw-r--r--libvpx/third_party/libwebm/mkvwriter.hpp51
-rw-r--r--libvpx/third_party/libwebm/webmids.hpp141
-rw-r--r--libvpx/third_party/nestegg/0001-include-paths.diff41
-rw-r--r--libvpx/third_party/nestegg/0002-ne_read_simple-uninitialized_variable.diff21
-rw-r--r--libvpx/third_party/nestegg/AUTHORS3
-rw-r--r--libvpx/third_party/nestegg/INSTALL (renamed from libvpx/nestegg/INSTALL)0
-rw-r--r--libvpx/third_party/nestegg/LICENSE (renamed from libvpx/nestegg/LICENSE)0
-rw-r--r--libvpx/third_party/nestegg/README (renamed from libvpx/nestegg/README)0
-rw-r--r--libvpx/third_party/nestegg/README.webm24
-rw-r--r--libvpx/third_party/nestegg/TODO (renamed from libvpx/nestegg/TODO)0
-rw-r--r--libvpx/third_party/nestegg/halloc/README (renamed from libvpx/nestegg/halloc/README)0
-rw-r--r--libvpx/third_party/nestegg/halloc/halloc.h (renamed from libvpx/nestegg/halloc/halloc.h)0
-rw-r--r--libvpx/third_party/nestegg/halloc/src/align.h (renamed from libvpx/nestegg/halloc/src/align.h)0
-rw-r--r--libvpx/third_party/nestegg/halloc/src/halloc.c (renamed from libvpx/nestegg/halloc/src/halloc.c)2
-rw-r--r--libvpx/third_party/nestegg/halloc/src/hlist.h (renamed from libvpx/nestegg/halloc/src/hlist.h)0
-rw-r--r--libvpx/third_party/nestegg/halloc/src/macros.h (renamed from libvpx/nestegg/halloc/src/macros.h)0
-rw-r--r--libvpx/third_party/nestegg/include/nestegg/nestegg.h (renamed from libvpx/nestegg/include/nestegg/nestegg.h)76
-rw-r--r--libvpx/third_party/nestegg/src/nestegg.c (renamed from libvpx/nestegg/src/nestegg.c)721
-rw-r--r--libvpx/third_party/nestegg/test/test.c (renamed from libvpx/nestegg/test/test.c)54
-rwxr-xr-xlibvpx/tools/cpplint.py1372
-rw-r--r--libvpx/tools/diff.py3
-rw-r--r--libvpx/tools_common.c211
-rw-r--r--libvpx/tools_common.h89
-rw-r--r--libvpx/video_common.h (renamed from libvpx/vp9/encoder/vp9_psnr.h)16
-rw-r--r--libvpx/video_reader.c83
-rw-r--r--libvpx/video_reader.h52
-rw-r--r--libvpx/video_writer.c80
-rw-r--r--libvpx/video_writer.h47
-rw-r--r--libvpx/vp8/common/alloccommon.h12
-rw-r--r--libvpx/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm8
-rw-r--r--libvpx/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm4
-rw-r--r--libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm8
-rw-r--r--libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm8
-rw-r--r--libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm8
-rw-r--r--libvpx/vp8/common/arm/bilinearfilter_arm.h14
-rw-r--r--libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm357
-rw-r--r--libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm130
-rw-r--r--libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm135
-rw-r--r--libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm183
-rw-r--r--libvpx/vp8/common/arm/neon/bilinearpredict_neon.c696
-rw-r--r--libvpx/vp8/common/arm/neon/copymem16x16_neon.asm59
-rw-r--r--libvpx/vp8/common/arm/neon/copymem8x4_neon.asm34
-rw-r--r--libvpx/vp8/common/arm/neon/copymem8x8_neon.asm43
-rw-r--r--libvpx/vp8/common/arm/neon/copymem_neon.c59
-rw-r--r--libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.asm54
-rw-r--r--libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.c42
-rw-r--r--libvpx/vp8/common/arm/neon/dequant_idct_neon.asm131
-rw-r--r--libvpx/vp8/common/arm/neon/dequant_idct_neon.c142
-rw-r--r--libvpx/vp8/common/arm/neon/dequantizeb_neon.asm34
-rw-r--r--libvpx/vp8/common/arm/neon/dequantizeb_neon.c27
-rw-r--r--libvpx/vp8/common/blockd.h14
-rw-r--r--libvpx/vp8/common/coefupdateprobs.h12
-rw-r--r--libvpx/vp8/common/common.h14
-rw-r--r--libvpx/vp8/common/default_coef_probs.h12
-rw-r--r--libvpx/vp8/common/entropy.h12
-rw-r--r--libvpx/vp8/common/entropymode.h12
-rw-r--r--libvpx/vp8/common/entropymv.h12
-rw-r--r--libvpx/vp8/common/extend.h12
-rw-r--r--libvpx/vp8/common/filter.h12
-rw-r--r--libvpx/vp8/common/findnearmv.h12
-rw-r--r--libvpx/vp8/common/header.h12
-rw-r--r--libvpx/vp8/common/invtrans.h12
-rw-r--r--libvpx/vp8/common/loopfilter.h12
-rw-r--r--libvpx/vp8/common/modecont.h12
-rw-r--r--libvpx/vp8/common/mv.h12
-rw-r--r--libvpx/vp8/common/onyx.h10
-rw-r--r--libvpx/vp8/common/onyxc_int.h12
-rw-r--r--libvpx/vp8/common/onyxd.h6
-rw-r--r--libvpx/vp8/common/postproc.c5
-rw-r--r--libvpx/vp8/common/postproc.h12
-rw-r--r--libvpx/vp8/common/ppflags.h12
-rw-r--r--libvpx/vp8/common/pragmas.h12
-rw-r--r--libvpx/vp8/common/quant_common.h13
-rw-r--r--libvpx/vp8/common/reconinter.h12
-rw-r--r--libvpx/vp8/common/reconintra4x4.h12
-rw-r--r--libvpx/vp8/common/rtcd_defs.pl541
-rw-r--r--libvpx/vp8/common/rtcd_defs.sh542
-rw-r--r--libvpx/vp8/common/setupintrarecon.h12
-rw-r--r--libvpx/vp8/common/swapyv12buffer.h12
-rw-r--r--libvpx/vp8/common/systemdependent.h12
-rw-r--r--libvpx/vp8/common/threading.h12
-rw-r--r--libvpx/vp8/common/treecoder.h12
-rw-r--r--libvpx/vp8/common/variance.h12
-rw-r--r--libvpx/vp8/common/vp8_entropymodedata.h12
-rw-r--r--libvpx/vp8/common/x86/filter_x86.h14
-rw-r--r--libvpx/vp8/common/x86/loopfilter_mmx.asm4
-rw-r--r--libvpx/vp8/common/x86/loopfilter_sse2.asm4
-rw-r--r--libvpx/vp8/decoder/dboolhuff.h14
-rw-r--r--libvpx/vp8/decoder/decodeframe.c (renamed from libvpx/vp8/decoder/decodframe.c)11
-rw-r--r--libvpx/vp8/decoder/decodemv.h14
-rw-r--r--libvpx/vp8/decoder/decoderthreading.h14
-rw-r--r--libvpx/vp8/decoder/detokenize.h14
-rw-r--r--libvpx/vp8/decoder/ec_types.h14
-rw-r--r--libvpx/vp8/decoder/error_concealment.h14
-rw-r--r--libvpx/vp8/decoder/onyxd_int.h14
-rw-r--r--libvpx/vp8/decoder/treereader.h14
-rw-r--r--libvpx/vp8/encoder/arm/neon/denoising_neon.c167
-rw-r--r--libvpx/vp8/encoder/bitstream.h12
-rw-r--r--libvpx/vp8/encoder/block.h12
-rw-r--r--libvpx/vp8/encoder/boolhuff.h12
-rw-r--r--libvpx/vp8/encoder/dct_value_cost.h13
-rw-r--r--libvpx/vp8/encoder/dct_value_tokens.h13
-rw-r--r--libvpx/vp8/encoder/defaultcoefcounts.h13
-rw-r--r--libvpx/vp8/encoder/denoising.h10
-rw-r--r--libvpx/vp8/encoder/encodeframe.h12
-rw-r--r--libvpx/vp8/encoder/encodeintra.h12
-rw-r--r--libvpx/vp8/encoder/encodemb.h12
-rw-r--r--libvpx/vp8/encoder/encodemv.h12
-rw-r--r--libvpx/vp8/encoder/firstpass.c16
-rw-r--r--libvpx/vp8/encoder/firstpass.h12
-rw-r--r--libvpx/vp8/encoder/lookahead.h12
-rw-r--r--libvpx/vp8/encoder/mcomp.h12
-rw-r--r--libvpx/vp8/encoder/modecosts.h12
-rw-r--r--libvpx/vp8/encoder/mr_dissim.h12
-rw-r--r--libvpx/vp8/encoder/onyx_if.c91
-rw-r--r--libvpx/vp8/encoder/onyx_int.h12
-rw-r--r--libvpx/vp8/encoder/pickinter.h12
-rw-r--r--libvpx/vp8/encoder/psnr.c31
-rw-r--r--libvpx/vp8/encoder/psnr.h17
-rw-r--r--libvpx/vp8/encoder/quantize.h12
-rw-r--r--libvpx/vp8/encoder/ratectrl.c9
-rw-r--r--libvpx/vp8/encoder/ratectrl.h11
-rw-r--r--libvpx/vp8/encoder/rdopt.c9
-rw-r--r--libvpx/vp8/encoder/rdopt.h12
-rw-r--r--libvpx/vp8/encoder/segmentation.h12
-rw-r--r--libvpx/vp8/encoder/temporal_filter.c1
-rw-r--r--libvpx/vp8/encoder/tokenize.c12
-rw-r--r--libvpx/vp8/encoder/tokenize.h14
-rw-r--r--libvpx/vp8/encoder/treewriter.h12
-rw-r--r--libvpx/vp8/vp8_common.mk22
-rw-r--r--libvpx/vp8/vp8_cx_iface.c6
-rw-r--r--libvpx/vp8/vp8_dx_iface.c1
-rw-r--r--libvpx/vp8/vp8cx.mk2
-rw-r--r--libvpx/vp8/vp8cx_arm.mk1
-rw-r--r--libvpx/vp8/vp8dx.mk2
-rw-r--r--libvpx/vp8_scalable_patterns.c694
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct16x16_1_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct16x16_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct16x16_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct32x32_1_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct32x32_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm)10
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct4x4_1_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct4x4_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct4x4_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct8x8_1_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_idct8x8_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_idct8x8_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_iht4x4_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_iht4x4_add_neon.asm)0
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_iht8x8_add_neon.asm (renamed from libvpx/vp9/common/arm/neon/vp9_short_iht8x8_add_neon.asm)2
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.asm199
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.c52
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_loopfilter_neon.asm70
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_mb_lpf_neon.asm33
-rw-r--r--libvpx/vp9/common/arm/neon/vp9_reconintra_neon.asm634
-rw-r--r--libvpx/vp9/common/generic/vp9_systemdependent.c19
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_common_dspr2.h18
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c34
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c4
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c12
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c26
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c34
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c77
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h8
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h8
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h8
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c24
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c12
-rw-r--r--libvpx/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c10
-rw-r--r--libvpx/vp9/common/vp9_alloccommon.c178
-rw-r--r--libvpx/vp9/common/vp9_alloccommon.h11
-rw-r--r--libvpx/vp9/common/vp9_blockd.c155
-rw-r--r--libvpx/vp9/common/vp9_blockd.h328
-rw-r--r--libvpx/vp9/common/vp9_common.h21
-rw-r--r--libvpx/vp9/common/vp9_common_data.c32
-rw-r--r--libvpx/vp9/common/vp9_common_data.h12
-rw-r--r--libvpx/vp9/common/vp9_convolve.c263
-rw-r--r--libvpx/vp9/common/vp9_convolve.h8
-rw-r--r--libvpx/vp9/common/vp9_debugmodes.c6
-rw-r--r--libvpx/vp9/common/vp9_default_coef_probs.h699
-rw-r--r--libvpx/vp9/common/vp9_entropy.c633
-rw-r--r--libvpx/vp9/common/vp9_entropy.h116
-rw-r--r--libvpx/vp9/common/vp9_entropymode.c61
-rw-r--r--libvpx/vp9/common/vp9_entropymode.h71
-rw-r--r--libvpx/vp9/common/vp9_entropymv.c25
-rw-r--r--libvpx/vp9/common/vp9_entropymv.h36
-rw-r--r--libvpx/vp9/common/vp9_enums.h31
-rw-r--r--libvpx/vp9/common/vp9_filter.c21
-rw-r--r--libvpx/vp9/common/vp9_filter.h33
-rw-r--r--libvpx/vp9/common/vp9_findnearmv.c85
-rw-r--r--libvpx/vp9/common/vp9_findnearmv.h72
-rw-r--r--libvpx/vp9/common/vp9_frame_buffers.c81
-rw-r--r--libvpx/vp9/common/vp9_frame_buffers.h53
-rw-r--r--libvpx/vp9/common/vp9_idct.c129
-rw-r--r--libvpx/vp9/common/vp9_idct.h11
-rw-r--r--libvpx/vp9/common/vp9_loopfilter.c503
-rw-r--r--libvpx/vp9/common/vp9_loopfilter.h47
-rw-r--r--libvpx/vp9/common/vp9_loopfilter_filters.c128
-rw-r--r--libvpx/vp9/common/vp9_mv.h16
-rw-r--r--libvpx/vp9/common/vp9_mvref_common.c151
-rw-r--r--libvpx/vp9/common/vp9_mvref_common.h53
-rw-r--r--libvpx/vp9/common/vp9_onyx.h232
-rw-r--r--libvpx/vp9/common/vp9_onyxc_int.h207
-rw-r--r--libvpx/vp9/common/vp9_postproc.c135
-rw-r--r--libvpx/vp9/common/vp9_postproc.h12
-rw-r--r--libvpx/vp9/common/vp9_ppflags.h8
-rw-r--r--libvpx/vp9/common/vp9_pragmas.h8
-rw-r--r--libvpx/vp9/common/vp9_pred_common.c352
-rw-r--r--libvpx/vp9/common/vp9_pred_common.h91
-rw-r--r--libvpx/vp9/common/vp9_prob.c61
-rw-r--r--libvpx/vp9/common/vp9_prob.h93
-rw-r--r--libvpx/vp9/common/vp9_quant_common.c9
-rw-r--r--libvpx/vp9/common/vp9_quant_common.h11
-rw-r--r--libvpx/vp9/common/vp9_reconinter.c371
-rw-r--r--libvpx/vp9/common/vp9_reconinter.h88
-rw-r--r--libvpx/vp9/common/vp9_reconintra.c133
-rw-r--r--libvpx/vp9/common/vp9_reconintra.h13
-rw-r--r--libvpx/vp9/common/vp9_rtcd_defs.pl778
-rw-r--r--libvpx/vp9/common/vp9_rtcd_defs.sh744
-rw-r--r--libvpx/vp9/common/vp9_sadmxn.h38
-rw-r--r--libvpx/vp9/common/vp9_scale.c141
-rw-r--r--libvpx/vp9/common/vp9_scale.h38
-rw-r--r--libvpx/vp9/common/vp9_scan.c164
-rw-r--r--libvpx/vp9/common/vp9_scan.h184
-rw-r--r--libvpx/vp9/common/vp9_seg_common.c10
-rw-r--r--libvpx/vp9/common/vp9_seg_common.h18
-rw-r--r--libvpx/vp9/common/vp9_systemdependent.h53
-rw-r--r--libvpx/vp9/common/vp9_textblit.h8
-rw-r--r--libvpx/vp9/common/vp9_tile_common.c55
-rw-r--r--libvpx/vp9/common/vp9_tile_common.h12
-rw-r--r--libvpx/vp9/common/vp9_treecoder.c64
-rw-r--r--libvpx/vp9/common/vp9_treecoder.h125
-rw-r--r--libvpx/vp9/common/x86/vp9_asm_stubs.c693
-rw-r--r--libvpx/vp9/common/x86/vp9_idct_intrin_sse2.c2416
-rw-r--r--libvpx/vp9/common/x86/vp9_loopfilter_intrin_avx2.c2
-rw-r--r--libvpx/vp9/common/x86/vp9_loopfilter_intrin_sse2.c880
-rw-r--r--libvpx/vp9/common/x86/vp9_loopfilter_mmx.asm14
-rw-r--r--libvpx/vp9/common/x86/vp9_postproc_x86.h8
-rw-r--r--libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c543
-rw-r--r--libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c490
-rw-r--r--libvpx/vp9/common/x86/vp9_subpixel_8t_ssse3.asm89
-rw-r--r--libvpx/vp9/common/x86/vp9_subpixel_bilinear_sse2.asm448
-rw-r--r--libvpx/vp9/common/x86/vp9_subpixel_bilinear_ssse3.asm422
-rw-r--r--libvpx/vp9/decoder/vp9_decodeframe.c (renamed from libvpx/vp9/decoder/vp9_decodframe.c)517
-rw-r--r--libvpx/vp9/decoder/vp9_decodeframe.h (renamed from libvpx/vp9/decoder/vp9_decodframe.h)14
-rw-r--r--libvpx/vp9/decoder/vp9_decodemv.c317
-rw-r--r--libvpx/vp9/decoder/vp9_decodemv.h11
-rw-r--r--libvpx/vp9/decoder/vp9_decoder.c (renamed from libvpx/vp9/decoder/vp9_onyxd_if.c)168
-rw-r--r--libvpx/vp9/decoder/vp9_decoder.h111
-rw-r--r--libvpx/vp9/decoder/vp9_detokenize.c147
-rw-r--r--libvpx/vp9/decoder/vp9_detokenize.h15
-rw-r--r--libvpx/vp9/decoder/vp9_dsubexp.c41
-rw-r--r--libvpx/vp9/decoder/vp9_dsubexp.h10
-rw-r--r--libvpx/vp9/decoder/vp9_dthread.c275
-rw-r--r--libvpx/vp9/decoder/vp9_dthread.h60
-rw-r--r--libvpx/vp9/decoder/vp9_onyxd.h69
-rw-r--r--libvpx/vp9/decoder/vp9_onyxd_int.h60
-rw-r--r--libvpx/vp9/decoder/vp9_read_bit_buffer.c41
-rw-r--r--libvpx/vp9/decoder/vp9_read_bit_buffer.h47
-rw-r--r--libvpx/vp9/decoder/vp9_reader.c (renamed from libvpx/vp9/decoder/vp9_dboolhuff.c)34
-rw-r--r--libvpx/vp9/decoder/vp9_reader.h (renamed from libvpx/vp9/decoder/vp9_dboolhuff.h)70
-rw-r--r--libvpx/vp9/decoder/vp9_thread.c110
-rw-r--r--libvpx/vp9/decoder/vp9_thread.h123
-rw-r--r--libvpx/vp9/decoder/vp9_treereader.h30
-rw-r--r--libvpx/vp9/encoder/vp9_bitstream.c855
-rw-r--r--libvpx/vp9/encoder/vp9_bitstream.h14
-rw-r--r--libvpx/vp9/encoder/vp9_block.h53
-rw-r--r--libvpx/vp9/encoder/vp9_cost.c (renamed from libvpx/vp9/encoder/vp9_boolhuff.c)52
-rw-r--r--libvpx/vp9/encoder/vp9_cost.h55
-rw-r--r--libvpx/vp9/encoder/vp9_craq.c267
-rw-r--r--libvpx/vp9/encoder/vp9_craq.h48
-rw-r--r--libvpx/vp9/encoder/vp9_dct.c479
-rw-r--r--libvpx/vp9/encoder/vp9_encodeframe.c2557
-rw-r--r--libvpx/vp9/encoder/vp9_encodeframe.h11
-rw-r--r--libvpx/vp9/encoder/vp9_encodeintra.c28
-rw-r--r--libvpx/vp9/encoder/vp9_encodeintra.h20
-rw-r--r--libvpx/vp9/encoder/vp9_encodemb.c497
-rw-r--r--libvpx/vp9/encoder/vp9_encodemb.h45
-rw-r--r--libvpx/vp9/encoder/vp9_encodemv.c229
-rw-r--r--libvpx/vp9/encoder/vp9_encodemv.h22
-rw-r--r--libvpx/vp9/encoder/vp9_extend.c (renamed from libvpx/vp9/common/vp9_extend.c)2
-rw-r--r--libvpx/vp9/encoder/vp9_extend.h (renamed from libvpx/vp9/common/vp9_extend.h)14
-rw-r--r--libvpx/vp9/encoder/vp9_firstpass.c2270
-rw-r--r--libvpx/vp9/encoder/vp9_firstpass.h95
-rw-r--r--libvpx/vp9/encoder/vp9_lookahead.c11
-rw-r--r--libvpx/vp9/encoder/vp9_lookahead.h11
-rw-r--r--libvpx/vp9/encoder/vp9_mbgraph.c82
-rw-r--r--libvpx/vp9/encoder/vp9_mbgraph.h26
-rw-r--r--libvpx/vp9/encoder/vp9_mcomp.c1573
-rw-r--r--libvpx/vp9/encoder/vp9_mcomp.h122
-rw-r--r--libvpx/vp9/encoder/vp9_modecosts.c43
-rw-r--r--libvpx/vp9/encoder/vp9_modecosts.h17
-rw-r--r--libvpx/vp9/encoder/vp9_onyx_if.c3331
-rw-r--r--libvpx/vp9/encoder/vp9_onyx_int.h866
-rw-r--r--libvpx/vp9/encoder/vp9_picklpf.c206
-rw-r--r--libvpx/vp9/encoder/vp9_picklpf.h12
-rw-r--r--libvpx/vp9/encoder/vp9_pickmode.c351
-rw-r--r--libvpx/vp9/encoder/vp9_pickmode.h31
-rw-r--r--libvpx/vp9/encoder/vp9_psnr.c29
-rw-r--r--libvpx/vp9/encoder/vp9_quantize.c201
-rw-r--r--libvpx/vp9/encoder/vp9_quantize.h12
-rw-r--r--libvpx/vp9/encoder/vp9_ratectrl.c1338
-rw-r--r--libvpx/vp9/encoder/vp9_ratectrl.h166
-rw-r--r--libvpx/vp9/encoder/vp9_rdopt.c2952
-rw-r--r--libvpx/vp9/encoder/vp9_rdopt.h43
-rw-r--r--libvpx/vp9/encoder/vp9_resize.c576
-rw-r--r--libvpx/vp9/encoder/vp9_resize.h68
-rw-r--r--libvpx/vp9/encoder/vp9_sad.c324
-rw-r--r--libvpx/vp9/encoder/vp9_sad_c.c615
-rw-r--r--libvpx/vp9/encoder/vp9_segmentation.c42
-rw-r--r--libvpx/vp9/encoder/vp9_segmentation.h26
-rw-r--r--libvpx/vp9/encoder/vp9_ssim.c6
-rw-r--r--libvpx/vp9/encoder/vp9_subexp.c108
-rw-r--r--libvpx/vp9/encoder/vp9_subexp.h17
-rw-r--r--libvpx/vp9/encoder/vp9_svc_layercontext.c127
-rw-r--r--libvpx/vp9/encoder/vp9_svc_layercontext.h68
-rw-r--r--libvpx/vp9/encoder/vp9_temporal_filter.c163
-rw-r--r--libvpx/vp9/encoder/vp9_temporal_filter.h13
-rw-r--r--libvpx/vp9/encoder/vp9_tokenize.c253
-rw-r--r--libvpx/vp9/encoder/vp9_tokenize.h23
-rw-r--r--libvpx/vp9/encoder/vp9_treewriter.c60
-rw-r--r--libvpx/vp9/encoder/vp9_treewriter.h80
-rw-r--r--libvpx/vp9/encoder/vp9_vaq.c65
-rw-r--r--libvpx/vp9/encoder/vp9_vaq.h14
-rw-r--r--libvpx/vp9/encoder/vp9_variance.c (renamed from libvpx/vp9/encoder/vp9_variance_c.c)0
-rw-r--r--libvpx/vp9/encoder/vp9_variance.h9
-rw-r--r--libvpx/vp9/encoder/vp9_write_bit_buffer.h16
-rw-r--r--libvpx/vp9/encoder/vp9_writer.c35
-rw-r--r--libvpx/vp9/encoder/vp9_writer.h (renamed from libvpx/vp9/encoder/vp9_boolhuff.h)42
-rw-r--r--libvpx/vp9/encoder/x86/vp9_dct32x32_avx2.c2710
-rw-r--r--libvpx/vp9/encoder/x86/vp9_dct_avx2.c2592
-rw-r--r--libvpx/vp9/encoder/x86/vp9_dct_sse2.c398
-rw-r--r--libvpx/vp9/encoder/x86/vp9_mcomp_x86.h8
-rw-r--r--libvpx/vp9/encoder/x86/vp9_quantize_ssse3.asm5
-rw-r--r--libvpx/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c539
-rw-r--r--libvpx/vp9/encoder/x86/vp9_variance_avx2.c268
-rw-r--r--libvpx/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c213
-rw-r--r--libvpx/vp9/encoder/x86/vp9_variance_mmx.c1
-rw-r--r--libvpx/vp9/encoder/x86/vp9_variance_sse2.c4
-rw-r--r--libvpx/vp9/exports_enc2
-rw-r--r--libvpx/vp9/vp9_common.mk48
-rw-r--r--libvpx/vp9/vp9_cx_iface.c551
-rw-r--r--libvpx/vp9/vp9_dx_iface.c232
-rw-r--r--libvpx/vp9/vp9_iface_common.h4
-rw-r--r--libvpx/vp9/vp9cx.mk35
-rw-r--r--libvpx/vp9/vp9dx.mk17
-rw-r--r--libvpx/vpx/exports_dec1
-rw-r--r--libvpx/vpx/exports_enc3
-rw-r--r--libvpx/vpx/internal/vpx_codec_internal.h45
-rw-r--r--libvpx/vpx/internal/vpx_psnr.h34
-rw-r--r--libvpx/vpx/src/svc_encodeframe.c328
-rw-r--r--libvpx/vpx/src/vpx_decoder.c20
-rw-r--r--libvpx/vpx/src/vpx_encoder.c49
-rw-r--r--libvpx/vpx/src/vpx_psnr.c24
-rw-r--r--libvpx/vpx/svc_context.h21
-rw-r--r--libvpx/vpx/vp8.h6
-rw-r--r--libvpx/vpx/vp8cx.h39
-rw-r--r--libvpx/vpx/vp8dx.h18
-rw-r--r--libvpx/vpx/vpx_codec.h10
-rw-r--r--libvpx/vpx/vpx_codec.mk4
-rw-r--r--libvpx/vpx/vpx_decoder.h58
-rw-r--r--libvpx/vpx/vpx_encoder.h56
-rw-r--r--libvpx/vpx/vpx_frame_buffer.h80
-rw-r--r--libvpx/vpx/vpx_image.h15
-rw-r--r--libvpx/vpx/vpx_integer.h8
-rw-r--r--libvpx/vpx_mem/include/vpx_mem_intrnl.h6
-rw-r--r--libvpx/vpx_mem/include/vpx_mem_tracker.h6
-rw-r--r--libvpx/vpx_mem/memory_manager/include/cavl_if.h4
-rw-r--r--libvpx/vpx_mem/memory_manager/include/cavl_impl.h4
-rw-r--r--libvpx/vpx_mem/memory_manager/include/heapmm.h3
-rw-r--r--libvpx/vpx_mem/memory_manager/include/hmm_cnfg.h4
-rw-r--r--libvpx/vpx_mem/memory_manager/include/hmm_intrnl.h6
-rw-r--r--libvpx/vpx_mem/vpx_mem.h6
-rw-r--r--libvpx/vpx_ports/arm.h12
-rw-r--r--libvpx/vpx_ports/asm_offsets.h6
-rw-r--r--libvpx/vpx_ports/config.h6
-rw-r--r--libvpx/vpx_ports/emmintrin_compat.h6
-rw-r--r--libvpx/vpx_ports/mem.h6
-rw-r--r--libvpx/vpx_ports/mem_ops.h4
-rw-r--r--libvpx/vpx_ports/mem_ops_aligned.h6
-rw-r--r--libvpx/vpx_ports/vpx_once.h6
-rw-r--r--libvpx/vpx_ports/vpx_ports.mk1
-rw-r--r--libvpx/vpx_ports/vpx_timer.h6
-rw-r--r--libvpx/vpx_ports/x86.h59
-rw-r--r--libvpx/vpx_ports/x86_cpuid.c49
-rw-r--r--libvpx/vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm123
-rw-r--r--libvpx/vpx_scale/generic/yv12config.c59
-rw-r--r--libvpx/vpx_scale/generic/yv12extend.c29
-rw-r--r--libvpx/vpx_scale/mips/dspr2/yv12extend_dspr2.c15
-rw-r--r--libvpx/vpx_scale/vpx_scale.h6
-rw-r--r--libvpx/vpx_scale/vpx_scale.mk5
-rw-r--r--libvpx/vpx_scale/vpx_scale_rtcd.pl34
-rw-r--r--libvpx/vpx_scale/vpx_scale_rtcd.sh34
-rw-r--r--libvpx/vpx_scale/yv12config.h98
-rw-r--r--libvpx/vpxdec.c948
-rw-r--r--libvpx/vpxenc.c1035
-rw-r--r--libvpx/vpxenc.h56
-rw-r--r--libvpx/vpxstats.c13
-rw-r--r--libvpx/vpxstats.h8
-rw-r--r--libvpx/warnings.c115
-rw-r--r--libvpx/warnings.h33
-rw-r--r--libvpx/webmdec.c198
-rw-r--r--libvpx/webmdec.h48
-rw-r--r--libvpx/webmenc.h8
-rw-r--r--libvpx/y4menc.c27
-rw-r--r--libvpx/y4menc.h33
-rw-r--r--libvpx/y4minput.c48
-rw-r--r--libvpx/y4minput.h14
799 files changed, 59937 insertions, 103236 deletions
diff --git a/libvpx/.mailmap b/libvpx/.mailmap
index ba1279b..fb82a24 100644
--- a/libvpx/.mailmap
+++ b/libvpx/.mailmap
@@ -1,8 +1,18 @@
Adrian Grange <agrange@google.com>
+Alexis Ballier <aballier@gentoo.org> <alexis.ballier@gmail.com>
+Hangyu Kuang <hkuang@google.com>
+Jim Bankoski <jimbankoski@google.com>
+John Koleszar <jkoleszar@google.com>
Johann Koenig <johannkoenig@google.com>
+Johann Koenig <johannkoenig@google.com> <johann.koenig@duck.com>
+Johann Koenig <johannkoenig@google.com> <johannkoenig@dhcp-172-19-7-52.mtv.corp.google.com>
+Pascal Massimino <pascal.massimino@gmail.com>
+Sami Pietilä <samipietila@google.com>
Tero Rintaluoma <teror@google.com> <tero.rintaluoma@on2.com>
+Timothy B. Terriberry <tterribe@xiph.org> Tim Terriberry <tterriberry@mozilla.com>
Tom Finegan <tomfinegan@google.com>
Ralph Giles <giles@xiph.org> <giles@entropywave.com>
Ralph Giles <giles@xiph.org> <giles@mozilla.com>
Alpha Lam <hclam@google.com> <hclam@chromium.org>
Deb Mukherjee <debargha@google.com>
+Yaowu Xu <yaowu@google.com> <yaowu@xuyaowu.com>
diff --git a/libvpx/AUTHORS b/libvpx/AUTHORS
index 0937d5d..a9aa481 100644
--- a/libvpx/AUTHORS
+++ b/libvpx/AUTHORS
@@ -2,62 +2,97 @@
# by tools/gen_authors.sh.
Aaron Watry <awatry@gmail.com>
+Abo Talib Mahfoodh <ab.mahfoodh@gmail.com>
Adrian Grange <agrange@google.com>
+Ahmad Sharif <asharif@google.com>
+Alexander Voronov <avoronov@graphics.cs.msu.ru>
Alex Converse <alex.converse@gmail.com>
Alexis Ballier <aballier@gentoo.org>
Alok Ahuja <waveletcoeff@gmail.com>
Alpha Lam <hclam@google.com>
+A.Mahfoodh <ab.mahfoodh@gmail.com>
+Ami Fischman <fischman@chromium.org>
Andoni Morales Alastruey <ylatuya@gmail.com>
Andres Mejia <mcitadel@gmail.com>
Aron Rosenberg <arosenberg@logitech.com>
Attila Nagy <attilanagy@google.com>
+changjun.yang <changjun.yang@intel.com>
+chm <chm@rock-chips.com>
+Christian Duvivier <cduvivier@google.com>
+Daniel Kang <ddkang@google.com>
Deb Mukherjee <debargha@google.com>
+Dmitry Kovalev <dkovalev@google.com>
+Dragan Mrdjan <dmrdjan@mips.com>
+Erik Niemeyer <erik.a.niemeyer@gmail.com>
Fabio Pedretti <fabio.ped@libero.it>
Frank Galligan <fgalligan@google.com>
Fredrik Söderquist <fs@opera.com>
Fritz Koenig <frkoenig@google.com>
Gaute Strokkenes <gaute.strokkenes@broadcom.com>
Giuseppe Scrivano <gscrivano@gnu.org>
+Guillaume Martres <gmartres@google.com>
Guillermo Ballester Valor <gbvalor@gmail.com>
+Hangyu Kuang <hkuang@google.com>
Henrik Lundin <hlundin@google.com>
+Hui Su <huisu@google.com>
+Ivan Maltz <ivanmaltz@google.com>
James Berry <jamesberry@google.com>
James Zern <jzern@google.com>
Jan Kratochvil <jan.kratochvil@redhat.com>
+Janne Salonen <jsalonen@google.com>
Jeff Faust <jfaust@google.com>
Jeff Muizelaar <jmuizelaar@mozilla.com>
+Jeff Petkau <jpet@chromium.org>
Jim Bankoski <jimbankoski@google.com>
+Jingning Han <jingning@google.com>
Johann Koenig <johannkoenig@google.com>
John Koleszar <jkoleszar@google.com>
Joshua Bleecher Snyder <josh@treelinelabs.com>
+Joshua Litt <joshualitt@google.com>
Justin Clift <justin@salasaga.org>
Justin Lebar <justin.lebar@gmail.com>
KO Myung-Hun <komh@chollian.net>
Lou Quillio <louquillio@google.com>
Luca Barbato <lu_zero@gentoo.org>
Makoto Kato <makoto.kt@gmail.com>
+Mans Rullgard <mans@mansr.com>
Marco Paniconi <marpan@google.com>
+Mark Mentovai <mark@chromium.org>
Martin Ettl <ettl.martin78@googlemail.com>
+Martin Storsjo <martin@martin.st>
+Matthew Heaney <matthewjheaney@chromium.org>
Michael Kohler <michaelkohler@live.com>
+Mike Frysinger <vapier@chromium.org>
Mike Hommey <mhommey@mozilla.com>
Mikhal Shemer <mikhal@google.com>
+Morton Jonuschat <yabawock@gmail.com>
+Parag Salasakar <img.mips1@gmail.com>
Pascal Massimino <pascal.massimino@gmail.com>
Patrik Westin <patrik.westin@gmail.com>
Paul Wilkins <paulwilkins@google.com>
Pavol Rusnak <stick@gk2.sk>
+Paweł Hajdan <phajdan@google.com>
Philip Jägenstedt <philipj@opera.com>
Priit Laes <plaes@plaes.org>
Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
Rafaël Carré <funman@videolan.org>
Ralph Giles <giles@xiph.org>
+Rob Bradford <rob@linux.intel.com>
Ronald S. Bultje <rbultje@google.com>
+Sami Pietilä <samipietila@google.com>
+Scott Graham <scottmg@chromium.org>
Scott LaVarnway <slavarnway@google.com>
+Shimon Doodkin <helpmepro1@gmail.com>
Stefan Holmer <holmer@google.com>
+Suman Sunkara <sunkaras@google.com>
Taekhyun Kim <takim@nvidia.com>
Takanori MATSUURA <t.matsuu@gmail.com>
+Tamar Levy <tamar.levy@intel.com>
Tero Rintaluoma <teror@google.com>
Thijs Vermeir <thijsvermeir@gmail.com>
Timothy B. Terriberry <tterribe@xiph.org>
Tom Finegan <tomfinegan@google.com>
+Vignesh Venkatasubramanian <vigneshv@google.com>
Yaowu Xu <yaowu@google.com>
Yunqing Wang <yunqingwang@google.com>
Google Inc.
diff --git a/libvpx/CHANGELOG b/libvpx/CHANGELOG
index ef64a96..97c9a7b 100644
--- a/libvpx/CHANGELOG
+++ b/libvpx/CHANGELOG
@@ -1,3 +1,53 @@
+2013-11-15 v1.3.0 "Forest"
+ This release introduces the VP9 codec in a backward-compatible way.
+ All existing users of VP8 can continue to use the library without
+ modification. However, some VP8 options do not map to VP9 in the same manner.
+
+ The VP9 encoder in this release is not feature complete. Users interested in
+ the encoder are advised to use the git master branch and discuss issues on
+ libvpx mailing lists.
+
+ - Upgrading:
+ This release is ABI and API compatible with Duclair (v1.0.0). Users
+ of older releases should refer to the Upgrading notes in this document
+ for that release.
+
+ - Enhancements:
+ Get rid of bashisms in the main build scripts
+ Added usage info on command line options
+ Add lossless compression mode
+ Dll build of libvpx
+ Add additional Mac OS X targets: 10.7, 10.8 and 10.9 (darwin11-13)
+ Add option to disable documentation
+ configure: add --enable-external-build support
+ make: support V=1 as short form of verbose=yes
+ configure: support mingw-w64
+ configure: support hardfloat armv7 CHOSTS
+ configure: add support for android x86
+ Add estimated completion time to vpxenc
+ Don't exit on decode errors in vpxenc
+ vpxenc: support scaling prior to encoding
+ vpxdec: support scaling output
+ vpxenc: improve progress indicators with --skip
+ msvs: Don't link to winmm.lib
+ Add a new script for producing vcxproj files
+ Produce Visual Studio 10 and 11 project files
+ Produce Windows Phone project files
+ msvs-build: use msbuild for vs >= 2005
+ configure: default configure log to config.log
+ Add encoding option --static-thresh
+
+ - Speed:
+ Miscellaneous speed optimizations for VP8 and VP9.
+
+ - Quality:
+ In general, quality is consistent with the Eider release.
+
+ - Bug Fixes:
+ This release represents approximately a year of engineering effort,
+ and contains multiple bug fixes. Please refer to git history for details.
+
+
2012-12-21 v1.2.0
This release acts as a checkpoint for a large amount of internal refactoring
and testing. It also contains a number of small bugfixes, so all users are
diff --git a/libvpx/README b/libvpx/README
index d7cb11a..ce9c1c6 100644
--- a/libvpx/README
+++ b/libvpx/README
@@ -64,6 +64,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
armv7-linux-gcc
armv7-none-rvct
armv7-win32-vs11
+ armv7-win32-vs12
mips32-linux-gcc
ppc32-darwin8-gcc
ppc32-darwin9-gcc
@@ -91,6 +92,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86-win32-vs9
x86-win32-vs10
x86-win32-vs11
+ x86-win32-vs12
x86_64-darwin9-gcc
x86_64-darwin10-gcc
x86_64-darwin11-gcc
@@ -104,6 +106,7 @@ COMPILING THE APPLICATIONS/LIBRARIES:
x86_64-win64-vs9
x86_64-win64-vs10
x86_64-win64-vs11
+ x86_64-win64-vs12
universal-darwin8-gcc
universal-darwin9-gcc
universal-darwin10-gcc
diff --git a/libvpx/args.h b/libvpx/args.h
index ad591af..04e0acd 100644
--- a/libvpx/args.h
+++ b/libvpx/args.h
@@ -9,10 +9,14 @@
*/
-#ifndef ARGS_H
-#define ARGS_H
+#ifndef ARGS_H_
+#define ARGS_H_
#include <stdio.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct arg {
char **argv;
const char *name;
@@ -48,4 +52,8 @@ unsigned int arg_parse_uint(const struct arg *arg);
int arg_parse_int(const struct arg *arg);
struct vpx_rational arg_parse_rational(const struct arg *arg);
int arg_parse_enum_or_int(const struct arg *arg);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // ARGS_H_
diff --git a/libvpx/build/arm-msvs/obj_int_extract.bat b/libvpx/build/arm-msvs/obj_int_extract.bat
index 7fd16a3..267ed61 100644
--- a/libvpx/build/arm-msvs/obj_int_extract.bat
+++ b/libvpx/build/arm-msvs/obj_int_extract.bat
@@ -7,8 +7,12 @@ REM in the file PATENTS. All contributing project authors may
REM be found in the AUTHORS file in the root of the source tree.
echo on
+REM Arguments:
+REM %1 - Relative path to the directory containing the vp8 and vpx_scale
+REM source directories.
+REM %2 - Path to obj_int_extract.exe.
cl /I "./" /I "%1" /nologo /c /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP "%1/vp8/encoder/vp8_asm_enc_offsets.c"
-obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm"
+%2\obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm"
cl /I "./" /I "%1" /nologo /c /DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP "%1/vpx_scale/vpx_scale_asm_offsets.c"
-obj_int_extract.exe rvds "vpx_scale_asm_offsets.obj" > "vpx_scale_asm_offsets.asm"
+%2\obj_int_extract.exe rvds "vpx_scale_asm_offsets.obj" > "vpx_scale_asm_offsets.asm"
diff --git a/libvpx/build/make/Android.mk b/libvpx/build/make/Android.mk
index 1ff0884..48a0dd7 100644
--- a/libvpx/build/make/Android.mk
+++ b/libvpx/build/make/Android.mk
@@ -135,10 +135,14 @@ CODEC_SRCS_UNIQUE = $(sort $(CODEC_SRCS))
# Pull out C files. vpx_config.c is in the immediate directory and
# so it does not need libvpx/ prefixed like the rest of the source files.
+# The neon files with intrinsics need to have .neon appended so the proper
+# flags are applied.
CODEC_SRCS_C = $(filter %.c, $(CODEC_SRCS_UNIQUE))
-LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c, $(CODEC_SRCS_C))
+LOCAL_NEON_SRCS_C = $(filter %_neon.c, $(CODEC_SRCS_C))
+LOCAL_CODEC_SRCS_C = $(filter-out vpx_config.c %_neon.c, $(CODEC_SRCS_C))
LOCAL_SRC_FILES += $(foreach file, $(LOCAL_CODEC_SRCS_C), libvpx/$(file))
+LOCAL_SRC_FILES += $(foreach file, $(LOCAL_NEON_SRCS_C), libvpx/$(file).neon)
# Pull out assembly files, splitting NEON from the rest. This is
# done to specify that the NEON assembly files use NEON assembler flags.
diff --git a/libvpx/build/make/Makefile b/libvpx/build/make/Makefile
index 030c1b5..dd7fb4a 100644
--- a/libvpx/build/make/Makefile
+++ b/libvpx/build/make/Makefile
@@ -94,6 +94,16 @@ clean::
rm -f $(OBJS-yes) $(OBJS-yes:.o=.d) $(OBJS-yes:.asm.s.o=.asm.s)
rm -f $(CLEAN-OBJS)
+.PHONY: clean
+distclean: clean
+ if [ -z "$(target)" ]; then \
+ rm -f Makefile; \
+ rm -f config.log config.mk; \
+ rm -f vpx_config.[hc] vpx_config.asm; \
+ else \
+ rm -f $(target)-$(TOOLCHAIN).mk; \
+ fi
+
.PHONY: dist
dist:
.PHONY: install
@@ -307,7 +317,7 @@ endef
ifneq ($(target),)
include $(SRC_PATH_BARE)/$(target:-$(TOOLCHAIN)=).mk
endif
-ifeq ($(filter clean,$(MAKECMDGOALS)),)
+ifeq ($(filter %clean,$(MAKECMDGOALS)),)
# Older versions of make don't like -include directives with no arguments
ifneq ($(filter %.d,$(OBJS-yes:.o=.d)),)
-include $(filter %.d,$(OBJS-yes:.o=.d))
@@ -390,7 +400,7 @@ ifneq ($(call enabled,DIST-SRCS),)
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_def.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_proj.sh
DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_sln.sh
- DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/yasm.rules
+ DIST-SRCS-$(CONFIG_MSVS) += build/make/gen_msvs_vcxproj.sh
DIST-SRCS-$(CONFIG_MSVS) += build/x86-msvs/obj_int_extract.bat
DIST-SRCS-$(CONFIG_MSVS) += build/arm-msvs/obj_int_extract.bat
DIST-SRCS-$(CONFIG_RVCT) += build/make/armlink_adapter.sh
diff --git a/libvpx/build/make/ads2armasm_ms.pl b/libvpx/build/make/ads2armasm_ms.pl
index 1def539..2a2c470 100755
--- a/libvpx/build/make/ads2armasm_ms.pl
+++ b/libvpx/build/make/ads2armasm_ms.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
##
## Copyright (c) 2013 The WebM project authors. All Rights Reserved.
##
@@ -32,6 +32,7 @@ while (<STDIN>)
s/ldrneb/ldrbne/i;
s/ldrneh/ldrhne/i;
+ s/^(\s*)ENDP.*/$&\n$1ALIGN 4/;
print;
}
diff --git a/libvpx/build/make/ads2gas.pl b/libvpx/build/make/ads2gas.pl
index 9c41901..7272424 100755
--- a/libvpx/build/make/ads2gas.pl
+++ b/libvpx/build/make/ads2gas.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
##
## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
##
diff --git a/libvpx/build/make/ads2gas_apple.pl b/libvpx/build/make/ads2gas_apple.pl
index fdafa98..a82f3eb 100755
--- a/libvpx/build/make/ads2gas_apple.pl
+++ b/libvpx/build/make/ads2gas_apple.pl
@@ -17,6 +17,13 @@
#
# Usage: cat inputfile | perl ads2gas_apple.pl > outputfile
#
+
+my $chromium = 0;
+
+foreach my $arg (@ARGV) {
+ $chromium = 1 if ($arg eq "-chromium");
+}
+
print "@ This file was created from a .asm file\n";
print "@ using the ads2gas_apple.pl script.\n\n";
print "\t.set WIDE_REFERENCE, 0\n";
@@ -47,7 +54,7 @@ while (<STDIN>)
s/@/,:/g;
# Comment character
- s/;/@/g;
+ s/;/ @/g;
# Hexadecimal constants prefaced by 0x
s/#&/#0x/g;
@@ -68,16 +75,16 @@ while (<STDIN>)
s/:SHR:/ >> /g;
# Convert ELSE to .else
- s/ELSE/.else/g;
+ s/\bELSE\b/.else/g;
# Convert ENDIF to .endif
- s/ENDIF/.endif/g;
+ s/\bENDIF\b/.endif/g;
# Convert ELSEIF to .elseif
- s/ELSEIF/.elseif/g;
+ s/\bELSEIF\b/.elseif/g;
# Convert LTORG to .ltorg
- s/LTORG/.ltorg/g;
+ s/\bLTORG\b/.ltorg/g;
# Convert IF :DEF:to .if
# gcc doesn't have the ability to do a conditional
@@ -157,7 +164,7 @@ while (<STDIN>)
s/^([a-zA-Z_0-9\$]+)/$1:/ if !/EQU/;
# ALIGN directive
- s/ALIGN/.balign/g;
+ s/\bALIGN\b/.balign/g;
# Strip ARM
s/\sARM/@ ARM/g;
@@ -177,7 +184,7 @@ while (<STDIN>)
s/(.*)EQU(.*)/.set $1, $2/;
# Begin macro definition
- if (/MACRO/)
+ if (/\bMACRO\b/)
{
# Process next line down, which will be the macro definition
$_ = <STDIN>;
@@ -208,7 +215,21 @@ while (<STDIN>)
# For macros, use \ to reference formal params
# s/\$/\\/g; # End macro definition
- s/MEND/.endm/; # No need to tell it where to stop assembling
+ s/\bMEND\b/.endm/; # No need to tell it where to stop assembling
next if /^\s*END\s*$/;
+
+ # Clang used by Chromium differs slightly from clang in XCode in what it
+ # will accept in the assembly.
+ if ($chromium) {
+ s/qsubaddx/qsax/i;
+ s/qaddsubx/qasx/i;
+ s/ldrneb/ldrbne/i;
+ s/ldrneh/ldrhne/i;
+ s/(vqshrun\.s16 .*, \#)0$/${1}8/i;
+
+ # http://llvm.org/bugs/show_bug.cgi?id=16022
+ s/\.include/#include/;
+ }
+
print;
}
diff --git a/libvpx/build/make/configure.sh b/libvpx/build/make/configure.sh
index b43a4ec..2fbcfe5 100755
--- a/libvpx/build/make/configure.sh
+++ b/libvpx/build/make/configure.sh
@@ -41,7 +41,7 @@ log(){
log_file(){
log BEGIN $1
- pr -n -t $1 >>$logfile
+ cat -n $1 >>$logfile
log END $1
}
@@ -327,7 +327,7 @@ EOF
check_cflags() {
log check_cflags "$@"
- check_cc "$@" <<EOF
+ check_cc -Werror "$@" <<EOF
int x;
EOF
}
@@ -337,11 +337,11 @@ check_cxxflags() {
# Catch CFLAGS that trigger CXX warnings
case "$CXX" in
- *g++*) check_cxx -Werror "$@" <<EOF
+ *c++-analyzer|*clang++|*g++*) check_cxx -Werror "$@" <<EOF
int x;
EOF
;;
- *) check_cxx "$@" <<EOF
+ *) check_cxx -Werror "$@" <<EOF
int x;
EOF
;;
@@ -378,6 +378,19 @@ EOF
fi
}
+# tests for -m$1 toggling the feature given in $2. If $2 is empty $1 is used.
+check_gcc_machine_option() {
+ local opt="$1"
+ local feature="$2"
+ [ -n "$feature" ] || feature="$opt"
+
+ if enabled gcc && ! disabled "$feature" && ! check_cflags "-m$opt"; then
+ RTCD_OPTIONS="${RTCD_OPTIONS}--disable-$feature "
+ else
+ soft_enable "$feature"
+ fi
+}
+
write_common_config_banner() {
print_webm_license config.mk "##" ""
echo '# This file automatically generated by configure. Do not edit!' >> config.mk
@@ -405,8 +418,8 @@ true
}
write_common_target_config_mk() {
- local CC=${CC}
- local CXX=${CXX}
+ local CC="${CC}"
+ local CXX="${CXX}"
enabled ccache && CC="ccache ${CC}"
enabled ccache && CXX="ccache ${CXX}"
print_webm_license $1 "##" ""
@@ -925,41 +938,26 @@ EOF
;;
darwin*)
- if [ -z "${sdk_path}" ]; then
- SDK_PATH=`xcode-select -print-path 2> /dev/null`
- SDK_PATH=${SDK_PATH}/Platforms/iPhoneOS.platform/Developer
- else
- SDK_PATH=${sdk_path}
- fi
- TOOLCHAIN_PATH=${SDK_PATH}/usr/bin
- CXX=${TOOLCHAIN_PATH}/g++
- CC=${TOOLCHAIN_PATH}/gcc
- AR=${TOOLCHAIN_PATH}/ar
- LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2
- AS=${TOOLCHAIN_PATH}/as
- STRIP=${TOOLCHAIN_PATH}/strip
- NM=${TOOLCHAIN_PATH}/nm
+
+ XCRUN_FIND="xcrun --sdk iphoneos -find"
+ CXX="$(${XCRUN_FIND} clang++)"
+ CC="$(${XCRUN_FIND} clang)"
+ AR="$(${XCRUN_FIND} ar)"
+ LD="$(${XCRUN_FIND} ld)"
+ AS="$(${XCRUN_FIND} as)"
+ STRIP="$(${XCRUN_FIND} strip)"
+ NM="$(${XCRUN_FIND} nm)"
+ RANLIB="$(${XCRUN_FIND} ranlib)"
AS_SFX=.s
# ASFLAGS is written here instead of using check_add_asflags
# because we need to overwrite all of ASFLAGS and purge the
# options that were put in above
- ASFLAGS="-version -arch ${tgt_isa} -g"
-
- add_cflags -arch ${tgt_isa}
- add_ldflags -arch_only ${tgt_isa}
-
- if [ -z "${alt_libc}" ]; then
- alt_libc=${SDK_PATH}/SDKs/iPhoneOS6.0.sdk
- fi
+ ASFLAGS="-arch ${tgt_isa} -g"
- add_cflags "-isysroot ${alt_libc}"
-
- # Add the paths for the alternate libc
- for d in usr/include; do
- try_dir="${alt_libc}/${d}"
- [ -d "${try_dir}" ] && add_cflags -I"${try_dir}"
- done
+ alt_libc="$(xcrun --sdk iphoneos --show-sdk-path)"
+ add_cflags -arch ${tgt_isa} -isysroot ${alt_libc}
+ add_ldflags -arch ${tgt_isa} -ios_version_min 7.0
for d in lib usr/lib usr/lib/system; do
try_dir="${alt_libc}/${d}"
@@ -1093,7 +1091,7 @@ EOF
msvs_arch_dir=x86-msvs
vc_version=${tgt_cc##vs}
case $vc_version in
- 7|8|9)
+ 7|8|9|10)
echo "${tgt_cc} does not support avx/avx2, disabling....."
RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx --disable-avx2 "
soft_disable avx
@@ -1104,30 +1102,16 @@ EOF
esac
soft_enable runtime_cpu_detect
- soft_enable mmx
- soft_enable sse
- soft_enable sse2
- soft_enable sse3
- soft_enable ssse3
# We can't use 'check_cflags' until the compiler is configured and CC is
# populated.
- if enabled gcc && ! disabled sse4_1 && ! check_cflags -msse4; then
- RTCD_OPTIONS="${RTCD_OPTIONS}--disable-sse4_1 "
- else
- soft_enable sse4_1
- fi
-
- if enabled gcc && ! disabled avx && ! check_cflags -mavx; then
- RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx "
- else
- soft_enable avx
- fi
-
- if enabled gcc && ! disabled avx2 && ! check_cflags -mavx2; then
- RTCD_OPTIONS="${RTCD_OPTIONS}--disable-avx2 "
- else
- soft_enable avx2
- fi
+ check_gcc_machine_option mmx
+ check_gcc_machine_option sse
+ check_gcc_machine_option sse2
+ check_gcc_machine_option sse3
+ check_gcc_machine_option ssse3
+ check_gcc_machine_option sse4 sse4_1
+ check_gcc_machine_option avx
+ check_gcc_machine_option avx2
case "${AS}" in
auto|"")
@@ -1214,8 +1198,8 @@ EOF
fi
# default use_x86inc to yes if pic is no or 64bit or we are not on darwin
- echo " checking here for x86inc \"${tgt_isa}\" \"$pic\" "
- if [ ${tgt_isa} = x86_64 -o ! "$pic" = "yes" -o "${tgt_os#darwin}" = "${tgt_os}" ]; then
+ if [ ${tgt_isa} = x86_64 -o ! "$pic" = "yes" -o \
+ "${tgt_os#darwin}" = "${tgt_os}" ]; then
soft_enable use_x86inc
fi
diff --git a/libvpx/build/make/gen_msvs_proj.sh b/libvpx/build/make/gen_msvs_proj.sh
index fc5011b..5936370 100755
--- a/libvpx/build/make/gen_msvs_proj.sh
+++ b/libvpx/build/make/gen_msvs_proj.sh
@@ -155,8 +155,8 @@ generate_filter() {
tag Tool \
Name="VCCustomBuildTool" \
Description="Assembling \$(InputFileName)" \
- CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)$objf" \
- Outputs="\$(IntDir)$objf" \
+ CommandLine="$(eval echo \$asm_${cfg}_cmdline) -o \$(IntDir)\\$objf" \
+ Outputs="\$(IntDir)\\$objf" \
close_tag FileConfiguration
done
@@ -170,7 +170,7 @@ generate_filter() {
tag Tool \
Name="VCCLCompilerTool" \
- ObjectFile="\$(IntDir)$objf" \
+ ObjectFile="\$(IntDir)\\$objf" \
close_tag FileConfiguration
done
@@ -371,7 +371,7 @@ generate_vcproj() {
vpx)
tag Tool \
Name="VCPreBuildEventTool" \
- CommandLine="call obj_int_extract.bat $src_path_bare" \
+ CommandLine="call obj_int_extract.bat $src_path_bare $plat_no_ws\\\$(ConfigurationName)" \
tag Tool \
Name="VCCLCompilerTool" \
@@ -412,7 +412,6 @@ generate_vcproj() {
obj_int_extract)
tag Tool \
Name="VCLinkerTool" \
- OutputFile="${name}.exe" \
GenerateDebugInformation="true" \
;;
*)
@@ -479,7 +478,7 @@ generate_vcproj() {
vpx)
tag Tool \
Name="VCPreBuildEventTool" \
- CommandLine="call obj_int_extract.bat $src_path_bare" \
+ CommandLine="call obj_int_extract.bat $src_path_bare $plat_no_ws\\\$(ConfigurationName)" \
tag Tool \
Name="VCCLCompilerTool" \
@@ -522,7 +521,6 @@ generate_vcproj() {
obj_int_extract)
tag Tool \
Name="VCLinkerTool" \
- OutputFile="${name}.exe" \
GenerateDebugInformation="true" \
;;
*)
diff --git a/libvpx/build/make/gen_msvs_sln.sh b/libvpx/build/make/gen_msvs_sln.sh
index 0c269b1..ffa3706 100755
--- a/libvpx/build/make/gen_msvs_sln.sh
+++ b/libvpx/build/make/gen_msvs_sln.sh
@@ -255,7 +255,7 @@ for opt in "$@"; do
;;
--ver=*) vs_ver="$optval"
case $optval in
- [789]|10|11)
+ [789]|10|11|12)
;;
*) die Unrecognized Visual Studio Version in $opt
;;
@@ -297,12 +297,15 @@ case "${vs_ver:-8}" in
11) sln_vers="12.00"
sln_vers_str="Visual Studio 2012"
;;
+ 12) sln_vers="12.00"
+ sln_vers_str="Visual Studio 2013"
+ ;;
esac
case "${vs_ver:-8}" in
[789])
sfx=vcproj
;;
- 10|11)
+ 10|11|12)
sfx=vcxproj
;;
esac
diff --git a/libvpx/build/make/gen_msvs_vcxproj.sh b/libvpx/build/make/gen_msvs_vcxproj.sh
index 4875915..7c8871b 100755
--- a/libvpx/build/make/gen_msvs_vcxproj.sh
+++ b/libvpx/build/make/gen_msvs_vcxproj.sh
@@ -28,12 +28,13 @@ Options:
--lib Generate a project for creating a static library
--dll Generate a project for creating a dll
--static-crt Use the static C runtime (/MT)
+ --enable-werror Treat warnings as errors (/WX)
--target=isa-os-cc Target specifier (required)
--out=filename Write output to a file [stdout]
--name=project_name Name of the project (required)
--proj-guid=GUID GUID to use for the project
--module-def=filename File containing export definitions (for DLLs)
- --ver=version Version (10,11) of visual studio to generate for
+ --ver=version Version (10,11,12) of visual studio to generate for
--src-path-bare=dir Path to root of source tree
-Ipath/to/include Additional include directories
-DFLAG[=value] Preprocessor macros to define
@@ -156,6 +157,10 @@ generate_filter() {
objf=$(echo ${f%.*}.obj | sed -e 's/^[\./]\+//g' -e 's,/,_,g')
if ([ "$pat" == "asm" ] || [ "$pat" == "s" ]) && $asm_use_custom_step; then
+ # Avoid object file name collisions, i.e. vpx_config.c and
+ # vpx_config.asm produce the same object file without
+ # this additional suffix.
+ objf=${objf%.obj}_asm.obj
open_tag CustomBuild \
Include=".\\$f"
for plat in "${platforms[@]}"; do
@@ -174,6 +179,10 @@ generate_filter() {
Include=".\\$f"
# Separate file names with Condition?
tag_content ObjectFileName "\$(IntDir)$objf"
+ # Check for AVX and turn it on to avoid warnings.
+ if [[ $f =~ avx.?\.c$ ]]; then
+ tag_content AdditionalOptions "/arch:AVX"
+ fi
close_tag ClCompile
elif [ "$pat" == "h" ] ; then
tag ClInclude \
@@ -225,10 +234,12 @@ for opt in "$@"; do
;;
--static-crt) use_static_runtime=true
;;
+ --enable-werror) werror=true
+ ;;
--ver=*)
vs_ver="$optval"
case "$optval" in
- 10|11)
+ 10|11|12)
;;
*) die Unrecognized Visual Studio Version in $opt
;;
@@ -269,7 +280,7 @@ guid=${guid:-`generate_uuid`}
asm_use_custom_step=false
uses_asm=${uses_asm:-false}
case "${vs_ver:-11}" in
- 10|11)
+ 10|11|12)
asm_use_custom_step=$uses_asm
;;
esac
@@ -383,6 +394,20 @@ generate_vcxproj() {
tag_content PlatformToolset v110
fi
fi
+ if [ "$vs_ver" = "12" ]; then
+ if [ "$plat" = "ARM" ]; then
+ # Setting the wp80 toolchain automatically sets the
+ # WINAPI_FAMILY define, which is required for building
+ # code for arm with the windows headers. Alternatively,
+ # one could add AppContainerApplication=true in the Globals
+ # section and add PrecompiledHeader=NotUsing and
+ # CompileAsWinRT=false in ClCompile and SubSystem=Console
+ # in Link.
+ tag_content PlatformToolset v120_wp80
+ else
+ tag_content PlatformToolset v120
+ fi
+ fi
tag_content CharacterSet Unicode
if [ "$config" = "Release" ]; then
tag_content WholeProgramOptimization true
@@ -412,6 +437,14 @@ generate_vcxproj() {
Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'"
tag_content OutDir "\$(SolutionDir)$plat_no_ws\\\$(Configuration)\\"
tag_content IntDir "$plat_no_ws\\\$(Configuration)\\${name}\\"
+ if [ "$proj_kind" == "lib" ]; then
+ if [ "$config" == "Debug" ]; then
+ config_suffix=d
+ else
+ config_suffix=""
+ fi
+ tag_content TargetName "${name}${lib_sfx}${config_suffix}"
+ fi
close_tag PropertyGroup
done
done
@@ -420,9 +453,13 @@ generate_vcxproj() {
for config in Debug Release; do
open_tag ItemDefinitionGroup \
Condition="'\$(Configuration)|\$(Platform)'=='$config|$plat'"
- if [ "$name" = "vpx" ]; then
+ if [ "$name" == "vpx" ]; then
+ hostplat=$plat
+ if [ "$hostplat" == "ARM" ]; then
+ hostplat=Win32
+ fi
open_tag PreBuildEvent
- tag_content Command "call obj_int_extract.bat $src_path_bare"
+ tag_content Command "call obj_int_extract.bat $src_path_bare $hostplat\\\$(Configuration)"
close_tag PreBuildEvent
fi
open_tag ClCompile
@@ -430,7 +467,6 @@ generate_vcxproj() {
opt=Disabled
runtime=$debug_runtime
curlibs=$debug_libs
- confsuffix=d
case "$name" in
obj_int_extract)
debug=DEBUG
@@ -443,7 +479,6 @@ generate_vcxproj() {
opt=MaxSpeed
runtime=$release_runtime
curlibs=$libs
- confsuffix=""
tag_content FavorSizeOrSpeed Speed
debug=NDEBUG
fi
@@ -460,14 +495,14 @@ generate_vcxproj() {
tag_content PreprocessorDefinitions "WIN32;$debug;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE$extradefines;%(PreprocessorDefinitions)"
tag_content RuntimeLibrary $runtime
tag_content WarningLevel Level3
- # DebugInformationFormat
+ if ${werror:-false}; then
+ tag_content TreatWarningAsError true
+ fi
close_tag ClCompile
case "$proj_kind" in
exe)
open_tag Link
- if [ "$name" = "obj_int_extract" ]; then
- tag_content OutputFile "${name}.exe"
- else
+ if [ "$name" != "obj_int_extract" ]; then
tag_content AdditionalDependencies "$curlibs"
tag_content AdditionalLibraryDirectories "$libdirs;%(AdditionalLibraryDirectories)"
fi
@@ -481,9 +516,6 @@ generate_vcxproj() {
close_tag Link
;;
lib)
- open_tag Lib
- tag_content OutputFile "\$(OutDir)${name}${lib_sfx}${confsuffix}.lib"
- close_tag Lib
;;
esac
close_tag ItemDefinitionGroup
diff --git a/libvpx/build/make/obj_int_extract.c b/libvpx/build/make/obj_int_extract.c
index feed9d9..819ce9d 100644
--- a/libvpx/build/make/obj_int_extract.c
+++ b/libvpx/build/make/obj_int_extract.c
@@ -21,6 +21,7 @@ typedef enum {
OUTPUT_FMT_PLAIN,
OUTPUT_FMT_RVDS,
OUTPUT_FMT_GAS,
+ OUTPUT_FMT_C_HEADER,
} output_fmt_t;
int log_msg(const char *fmt, ...) {
@@ -43,9 +44,12 @@ int print_macho_equ(output_fmt_t mode, uint8_t* name, int val) {
case OUTPUT_FMT_RVDS:
printf("%-40s EQU %5d\n", name, val);
return 0;
- case OUTPUT_FMT_GAS:
+ case OUTPUT_FMT_GAS:
printf(".set %-40s, %5d\n", name, val);
return 0;
+ case OUTPUT_FMT_C_HEADER:
+ printf("#define %-40s %5d\n", name, val);
+ return 0;
default:
log_msg("Unsupported mode: %d", mode);
return 1;
@@ -321,7 +325,7 @@ bail:
return 1;
}
-char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx) {
+const char *parse_elf_string_table(elf_obj_t *elf, int s_idx, int idx) {
if (elf->bits == 32) {
Elf32_Shdr shdr;
@@ -491,6 +495,13 @@ int parse_elf(uint8_t *buf, size_t sz, output_fmt_t mode) {
sym.st_name),
val);
break;
+ case OUTPUT_FMT_C_HEADER:
+ printf("#define %-40s %5d\n",
+ parse_elf_string_table(&elf,
+ shdr.sh_link,
+ sym.st_name),
+ val);
+ break;
default:
printf("%s = %d\n",
parse_elf_string_table(&elf,
@@ -655,7 +666,11 @@ int parse_coff(uint8_t *buf, size_t sz) {
}
strcpy(sectionlist[i], sectionname);
- if (!strcmp(sectionname, ".rdata")) sectionrawdata_ptr = get_le32(ptr + 20);
+ // check if it's .rdata and is not a COMDAT section.
+ if (!strcmp(sectionname, ".rdata") &&
+ (get_le32(ptr + 36) & 0x1000) == 0) {
+ sectionrawdata_ptr = get_le32(ptr + 20);
+ }
ptr += 40;
}
@@ -762,6 +777,7 @@ int main(int argc, char **argv) {
fprintf(stderr, "Output Formats:\n");
fprintf(stderr, " gas - compatible with GNU assembler\n");
fprintf(stderr, " rvds - compatible with armasm\n");
+ fprintf(stderr, " cheader - c/c++ header file\n");
goto bail;
}
@@ -771,6 +787,8 @@ int main(int argc, char **argv) {
mode = OUTPUT_FMT_RVDS;
else if (!strcmp(argv[1], "gas"))
mode = OUTPUT_FMT_GAS;
+ else if (!strcmp(argv[1], "cheader"))
+ mode = OUTPUT_FMT_C_HEADER;
else
f = argv[1];
diff --git a/libvpx/build/make/rtcd.pl b/libvpx/build/make/rtcd.pl
new file mode 100755
index 0000000..18ee80d
--- /dev/null
+++ b/libvpx/build/make/rtcd.pl
@@ -0,0 +1,414 @@
+#!/usr/bin/env perl
+
+no strict 'refs';
+use warnings;
+use Getopt::Long;
+Getopt::Long::Configure("auto_help");
+
+my %ALL_FUNCS = ();
+my @ALL_ARCHS;
+my @ALL_FORWARD_DECLS;
+my @REQUIRES;
+
+my %opts = ();
+my %disabled = ();
+my %required = ();
+
+my @argv;
+foreach (@ARGV) {
+ $disabled{$1} = 1, next if /--disable-(.*)/;
+ $required{$1} = 1, next if /--require-(.*)/;
+ push @argv, $_;
+}
+
+# NB: use GetOptions() instead of GetOptionsFromArray() for compatibility.
+@ARGV = @argv;
+GetOptions(
+ \%opts,
+ 'arch=s',
+ 'sym=s',
+ 'config=s',
+);
+
+foreach my $opt (qw/arch config/) {
+ if (!defined($opts{$opt})) {
+ warn "--$opt is required!\n";
+ Getopt::Long::HelpMessage('-exit' => 1);
+ }
+}
+
+foreach my $defs_file (@ARGV) {
+ if (!-f $defs_file) {
+ warn "$defs_file: $!\n";
+ Getopt::Long::HelpMessage('-exit' => 1);
+ }
+}
+
+open CONFIG_FILE, $opts{config} or
+ die "Error opening config file '$opts{config}': $!\n";
+
+my %config = ();
+while (<CONFIG_FILE>) {
+ next if !/^CONFIG_/;
+ chomp;
+ my @pair = split /=/;
+ $config{$pair[0]} = $pair[1];
+}
+close CONFIG_FILE;
+
+#
+# Routines for the RTCD DSL to call
+#
+sub vpx_config($) {
+ return (defined $config{$_[0]}) ? $config{$_[0]} : "";
+}
+
+sub specialize {
+ my $fn=$_[0];
+ shift;
+ foreach my $opt (@_) {
+ eval "\$${fn}_${opt}=${fn}_${opt}";
+ }
+}
+
+sub add_proto {
+ my $fn = splice(@_, -2, 1);
+ $ALL_FUNCS{$fn} = \@_;
+ specialize $fn, "c";
+}
+
+sub require {
+ foreach my $fn (keys %ALL_FUNCS) {
+ foreach my $opt (@_) {
+ my $ofn = eval "\$${fn}_${opt}";
+ next if !$ofn;
+
+ # if we already have a default, then we can disable it, as we know
+ # we can do better.
+ my $best = eval "\$${fn}_default";
+ if ($best) {
+ my $best_ofn = eval "\$${best}";
+ if ($best_ofn && "$best_ofn" ne "$ofn") {
+ eval "\$${best}_link = 'false'";
+ }
+ }
+ eval "\$${fn}_default=${fn}_${opt}";
+ eval "\$${fn}_${opt}_link='true'";
+ }
+ }
+}
+
+sub forward_decls {
+ push @ALL_FORWARD_DECLS, @_;
+}
+
+#
+# Include the user's directives
+#
+foreach my $f (@ARGV) {
+ open FILE, "<", $f or die "cannot open $f: $!\n";
+ my $contents = join('', <FILE>);
+ close FILE;
+ eval $contents or warn "eval failed: $@\n";
+}
+
+#
+# Process the directives according to the command line
+#
+sub process_forward_decls() {
+ foreach (@ALL_FORWARD_DECLS) {
+ $_->();
+ }
+}
+
+sub determine_indirection {
+ vpx_config("CONFIG_RUNTIME_CPU_DETECT") eq "yes" or &require(@ALL_ARCHS);
+ foreach my $fn (keys %ALL_FUNCS) {
+ my $n = "";
+ my @val = @{$ALL_FUNCS{$fn}};
+ my $args = pop @val;
+ my $rtyp = "@val";
+ my $dfn = eval "\$${fn}_default";
+ $dfn = eval "\$${dfn}";
+ foreach my $opt (@_) {
+ my $ofn = eval "\$${fn}_${opt}";
+ next if !$ofn;
+ my $link = eval "\$${fn}_${opt}_link";
+ next if $link && $link eq "false";
+ $n .= "x";
+ }
+ if ($n eq "x") {
+ eval "\$${fn}_indirect = 'false'";
+ } else {
+ eval "\$${fn}_indirect = 'true'";
+ }
+ }
+}
+
+sub declare_function_pointers {
+ foreach my $fn (sort keys %ALL_FUNCS) {
+ my @val = @{$ALL_FUNCS{$fn}};
+ my $args = pop @val;
+ my $rtyp = "@val";
+ my $dfn = eval "\$${fn}_default";
+ $dfn = eval "\$${dfn}";
+ foreach my $opt (@_) {
+ my $ofn = eval "\$${fn}_${opt}";
+ next if !$ofn;
+ print "$rtyp ${ofn}($args);\n";
+ }
+ if (eval "\$${fn}_indirect" eq "false") {
+ print "#define ${fn} ${dfn}\n";
+ } else {
+ print "RTCD_EXTERN $rtyp (*${fn})($args);\n";
+ }
+ print "\n";
+ }
+}
+
+sub set_function_pointers {
+ foreach my $fn (sort keys %ALL_FUNCS) {
+ my @val = @{$ALL_FUNCS{$fn}};
+ my $args = pop @val;
+ my $rtyp = "@val";
+ my $dfn = eval "\$${fn}_default";
+ $dfn = eval "\$${dfn}";
+ if (eval "\$${fn}_indirect" eq "true") {
+ print " $fn = $dfn;\n";
+ foreach my $opt (@_) {
+ my $ofn = eval "\$${fn}_${opt}";
+ next if !$ofn;
+ next if "$ofn" eq "$dfn";
+ my $link = eval "\$${fn}_${opt}_link";
+ next if $link && $link eq "false";
+ my $cond = eval "\$have_${opt}";
+ print " if (${cond}) $fn = $ofn;\n"
+ }
+ }
+ }
+}
+
+sub filter {
+ my @filtered;
+ foreach (@_) { push @filtered, $_ unless $disabled{$_}; }
+ return @filtered;
+}
+
+#
+# Helper functions for generating the arch specific RTCD files
+#
+sub common_top() {
+ my $include_guard = uc($opts{sym})."_H_";
+ print <<EOF;
+#ifndef ${include_guard}
+#define ${include_guard}
+
+#ifdef RTCD_C
+#define RTCD_EXTERN
+#else
+#define RTCD_EXTERN extern
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+
+process_forward_decls();
+print "\n";
+declare_function_pointers("c", @ALL_ARCHS);
+
+print <<EOF;
+void $opts{sym}(void);
+
+EOF
+}
+
+sub common_bottom() {
+ print <<EOF;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif
+EOF
+}
+
+sub x86() {
+ determine_indirection("c", @ALL_ARCHS);
+
+ # Assign the helper variable for each enabled extension
+ foreach my $opt (@ALL_ARCHS) {
+ my $opt_uc = uc $opt;
+ eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
+ }
+
+ common_top;
+ print <<EOF;
+#ifdef RTCD_C
+#include "vpx_ports/x86.h"
+static void setup_rtcd_internal(void)
+{
+ int flags = x86_simd_caps();
+
+ (void)flags;
+
+EOF
+
+ set_function_pointers("c", @ALL_ARCHS);
+
+ print <<EOF;
+}
+#endif
+EOF
+ common_bottom;
+}
+
+sub arm() {
+ determine_indirection("c", @ALL_ARCHS);
+
+ # Assign the helper variable for each enabled extension
+ foreach my $opt (@ALL_ARCHS) {
+ my $opt_uc = uc $opt;
+ eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
+ }
+
+ common_top;
+ print <<EOF;
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+#include "vpx_ports/arm.h"
+static void setup_rtcd_internal(void)
+{
+ int flags = arm_cpu_caps();
+
+ (void)flags;
+
+EOF
+
+ set_function_pointers("c", @ALL_ARCHS);
+
+ print <<EOF;
+}
+#endif
+EOF
+ common_bottom;
+}
+
+sub mips() {
+ determine_indirection("c", @ALL_ARCHS);
+ common_top;
+
+ print <<EOF;
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+static void setup_rtcd_internal(void)
+{
+EOF
+
+ set_function_pointers("c", @ALL_ARCHS);
+
+ print <<EOF;
+#if HAVE_DSPR2
+#if CONFIG_VP8
+void dsputil_static_init();
+dsputil_static_init();
+#endif
+#if CONFIG_VP9
+void vp9_dsputil_static_init();
+vp9_dsputil_static_init();
+#endif
+#endif
+}
+#endif
+EOF
+ common_bottom;
+}
+
+sub unoptimized() {
+ determine_indirection "c";
+ common_top;
+ print <<EOF;
+#include "vpx_config.h"
+
+#ifdef RTCD_C
+static void setup_rtcd_internal(void)
+{
+EOF
+
+ set_function_pointers "c";
+
+ print <<EOF;
+}
+#endif
+EOF
+ common_bottom;
+}
+
+#
+# Main Driver
+#
+
+&require("c");
+if ($opts{arch} eq 'x86') {
+ @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
+ x86;
+} elsif ($opts{arch} eq 'x86_64') {
+ @ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
+ @REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/);
+ &require(@REQUIRES);
+ x86;
+} elsif ($opts{arch} eq 'mips32') {
+ @ALL_ARCHS = filter(qw/mips32/);
+ open CONFIG_FILE, $opts{config} or
+ die "Error opening config file '$opts{config}': $!\n";
+ while (<CONFIG_FILE>) {
+ if (/HAVE_DSPR2=yes/) {
+ @ALL_ARCHS = filter(qw/mips32 dspr2/);
+ last;
+ }
+ }
+ close CONFIG_FILE;
+ mips;
+} elsif ($opts{arch} eq 'armv5te') {
+ @ALL_ARCHS = filter(qw/edsp/);
+ arm;
+} elsif ($opts{arch} eq 'armv6') {
+ @ALL_ARCHS = filter(qw/edsp media/);
+ arm;
+} elsif ($opts{arch} eq 'armv7') {
+ @ALL_ARCHS = filter(qw/edsp media neon/);
+ arm;
+} else {
+ unoptimized;
+}
+
+__END__
+
+=head1 NAME
+
+rtcd -
+
+=head1 SYNOPSIS
+
+Usage: rtcd.pl [options] FILE
+
+See 'perldoc rtcd.pl' for more details.
+
+=head1 DESCRIPTION
+
+Reads the Run Time CPU Detections definitions from FILE and generates a
+C header file on stdout.
+
+=head1 OPTIONS
+
+Options:
+ --arch=ARCH Architecture to generate defs for (required)
+ --disable-EXT Disable support for EXT extensions
+ --require-EXT Require support for EXT extensions
+ --sym=SYMBOL Unique symbol to use for RTCD initialization function
+ --config=FILE File with CONFIG_FOO=yes lines to parse
diff --git a/libvpx/build/make/rtcd.sh b/libvpx/build/make/rtcd.sh
deleted file mode 100755
index 2967b5a..0000000
--- a/libvpx/build/make/rtcd.sh
+++ /dev/null
@@ -1,363 +0,0 @@
-#!/bin/sh
-self=$0
-
-usage() {
- cat <<EOF >&2
-Usage: $self [options] FILE
-
-Reads the Run Time CPU Detections definitions from FILE and generates a
-C header file on stdout.
-
-Options:
- --arch=ARCH Architecture to generate defs for (required)
- --disable-EXT Disable support for EXT extensions
- --require-EXT Require support for EXT extensions
- --sym=SYMBOL Unique symbol to use for RTCD initialization function
- --config=FILE File with CONFIG_FOO=yes lines to parse
-EOF
- exit 1
-}
-
-die() {
- echo "$@" >&2
- exit 1
-}
-
-die_argument_required() {
- die "Option $opt requires argument"
-}
-
-for opt; do
- optval="${opt#*=}"
- case "$opt" in
- --arch) die_argument_required;;
- --arch=*) arch=${optval};;
- --disable-*) eval "disable_${opt#--disable-}=true";;
- --require-*) REQUIRES="${REQUIRES}${opt#--require-} ";;
- --sym) die_argument_required;;
- --sym=*) symbol=${optval};;
- --config=*) config_file=${optval};;
- -h|--help)
- usage
- ;;
- -*)
- die "Unrecognized option: ${opt%%=*}"
- ;;
- *)
- defs_file="$defs_file $opt"
- ;;
- esac
- shift
-done
-for f in $defs_file; do [ -f "$f" ] || usage; done
-[ -n "$arch" ] || usage
-
-# Import the configuration
-[ -f "$config_file" ] && eval $(grep CONFIG_ "$config_file")
-
-#
-# Routines for the RTCD DSL to call
-#
-prototype() {
- rtyp=""
- case "$1" in
- unsigned) rtyp="$1 "; shift;;
- esac
- rtyp="${rtyp}$1"
- fn="$2"
- args="$3"
-
- eval "${2}_rtyp='$rtyp'"
- eval "${2}_args='$3'"
- ALL_FUNCS="$ALL_FUNCS $fn"
- specialize $fn c
-}
-
-specialize() {
- fn="$1"
- shift
- for opt in "$@"; do
- eval "${fn}_${opt}=${fn}_${opt}"
- done
-}
-
-require() {
- for fn in $ALL_FUNCS; do
- for opt in "$@"; do
- ofn=$(eval "echo \$${fn}_${opt}")
- [ -z "$ofn" ] && continue
-
- # if we already have a default, then we can disable it, as we know
- # we can do better.
- best=$(eval "echo \$${fn}_default")
- best_ofn=$(eval "echo \$${best}")
- [ -n "$best" ] && [ "$best_ofn" != "$ofn" ] && eval "${best}_link=false"
- eval "${fn}_default=${fn}_${opt}"
- eval "${fn}_${opt}_link=true"
- done
- done
-}
-
-forward_decls() {
- ALL_FORWARD_DECLS="$ALL_FORWARD_DECLS $1"
-}
-
-#
-# Include the user's directives
-#
-for f in $defs_file; do
- . $f
-done
-
-#
-# Process the directives according to the command line
-#
-process_forward_decls() {
- for fn in $ALL_FORWARD_DECLS; do
- eval $fn
- done
-}
-
-determine_indirection() {
- [ "$CONFIG_RUNTIME_CPU_DETECT" = "yes" ] || require $ALL_ARCHS
- for fn in $ALL_FUNCS; do
- n=""
- rtyp="$(eval "echo \$${fn}_rtyp")"
- args="$(eval "echo \"\$${fn}_args\"")"
- dfn="$(eval "echo \$${fn}_default")"
- dfn=$(eval "echo \$${dfn}")
- for opt in "$@"; do
- ofn=$(eval "echo \$${fn}_${opt}")
- [ -z "$ofn" ] && continue
- link=$(eval "echo \$${fn}_${opt}_link")
- [ "$link" = "false" ] && continue
- n="${n}x"
- done
- if [ "$n" = "x" ]; then
- eval "${fn}_indirect=false"
- else
- eval "${fn}_indirect=true"
- fi
- done
-}
-
-declare_function_pointers() {
- for fn in $ALL_FUNCS; do
- rtyp="$(eval "echo \$${fn}_rtyp")"
- args="$(eval "echo \"\$${fn}_args\"")"
- dfn="$(eval "echo \$${fn}_default")"
- dfn=$(eval "echo \$${dfn}")
- for opt in "$@"; do
- ofn=$(eval "echo \$${fn}_${opt}")
- [ -z "$ofn" ] && continue
- echo "$rtyp ${ofn}($args);"
- done
- if [ "$(eval "echo \$${fn}_indirect")" = "false" ]; then
- echo "#define ${fn} ${dfn}"
- else
- echo "RTCD_EXTERN $rtyp (*${fn})($args);"
- fi
- echo
- done
-}
-
-set_function_pointers() {
- for fn in $ALL_FUNCS; do
- n=""
- rtyp="$(eval "echo \$${fn}_rtyp")"
- args="$(eval "echo \"\$${fn}_args\"")"
- dfn="$(eval "echo \$${fn}_default")"
- dfn=$(eval "echo \$${dfn}")
- if $(eval "echo \$${fn}_indirect"); then
- echo " $fn = $dfn;"
- for opt in "$@"; do
- ofn=$(eval "echo \$${fn}_${opt}")
- [ -z "$ofn" ] && continue
- [ "$ofn" = "$dfn" ] && continue;
- link=$(eval "echo \$${fn}_${opt}_link")
- [ "$link" = "false" ] && continue
- cond="$(eval "echo \$have_${opt}")"
- echo " if (${cond}) $fn = $ofn;"
- done
- fi
- echo
- done
-}
-
-filter() {
- filtered=""
- for opt in "$@"; do
- [ -z $(eval "echo \$disable_${opt}") ] && filtered="$filtered $opt"
- done
- echo $filtered
-}
-
-#
-# Helper functions for generating the arch specific RTCD files
-#
-common_top() {
- outfile_basename=$(basename ${symbol:-rtcd})
- include_guard=$(echo $outfile_basename | tr '[a-z]' '[A-Z]' | \
- tr -c '[A-Z0-9]' _)H_
- cat <<EOF
-#ifndef ${include_guard}
-#define ${include_guard}
-
-#ifdef RTCD_C
-#define RTCD_EXTERN
-#else
-#define RTCD_EXTERN extern
-#endif
-
-$(process_forward_decls)
-
-$(declare_function_pointers c $ALL_ARCHS)
-
-void ${symbol:-rtcd}(void);
-EOF
-}
-
-common_bottom() {
- cat <<EOF
-#endif
-EOF
-}
-
-x86() {
- determine_indirection c $ALL_ARCHS
-
- # Assign the helper variable for each enabled extension
- for opt in $ALL_ARCHS; do
- uc=$(echo $opt | tr '[a-z]' '[A-Z]')
- eval "have_${opt}=\"flags & HAS_${uc}\""
- done
-
- cat <<EOF
-$(common_top)
-
-#ifdef RTCD_C
-#include "vpx_ports/x86.h"
-static void setup_rtcd_internal(void)
-{
- int flags = x86_simd_caps();
-
- (void)flags;
-
-$(set_function_pointers c $ALL_ARCHS)
-}
-#endif
-$(common_bottom)
-EOF
-}
-
-arm() {
- determine_indirection c $ALL_ARCHS
-
- # Assign the helper variable for each enabled extension
- for opt in $ALL_ARCHS; do
- uc=$(echo $opt | tr '[a-z]' '[A-Z]')
- eval "have_${opt}=\"flags & HAS_${uc}\""
- done
-
- cat <<EOF
-$(common_top)
-#include "vpx_config.h"
-
-#ifdef RTCD_C
-#include "vpx_ports/arm.h"
-static void setup_rtcd_internal(void)
-{
- int flags = arm_cpu_caps();
-
- (void)flags;
-
-$(set_function_pointers c $ALL_ARCHS)
-}
-#endif
-$(common_bottom)
-EOF
-}
-
-
-mips() {
- determine_indirection c $ALL_ARCHS
- cat <<EOF
-$(common_top)
-#include "vpx_config.h"
-
-#ifdef RTCD_C
-static void setup_rtcd_internal(void)
-{
-$(set_function_pointers c $ALL_ARCHS)
-#if HAVE_DSPR2
-#if CONFIG_VP8
-void dsputil_static_init();
-dsputil_static_init();
-#endif
-#if CONFIG_VP9
-void vp9_dsputil_static_init();
-vp9_dsputil_static_init();
-#endif
-#endif
-}
-#endif
-$(common_bottom)
-EOF
-}
-
-unoptimized() {
- determine_indirection c
- cat <<EOF
-$(common_top)
-#include "vpx_config.h"
-
-#ifdef RTCD_C
-static void setup_rtcd_internal(void)
-{
-$(set_function_pointers c)
-}
-#endif
-$(common_bottom)
-EOF
-
-}
-#
-# Main Driver
-#
-require c
-case $arch in
- x86)
- ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2)
- x86
- ;;
- x86_64)
- ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2)
- REQUIRES=${REQUIRES:-mmx sse sse2}
- require $(filter $REQUIRES)
- x86
- ;;
- mips32)
- ALL_ARCHS=$(filter mips32)
- dspr2=$([ -f "$config_file" ] && eval echo $(grep HAVE_DSPR2 "$config_file"))
- HAVE_DSPR2="${dspr2#*=}"
- if [ "$HAVE_DSPR2" = "yes" ]; then
- ALL_ARCHS=$(filter mips32 dspr2)
- fi
- mips
- ;;
- armv5te)
- ALL_ARCHS=$(filter edsp)
- arm
- ;;
- armv6)
- ALL_ARCHS=$(filter edsp media)
- arm
- ;;
- armv7)
- ALL_ARCHS=$(filter edsp media neon)
- arm
- ;;
- *)
- unoptimized
- ;;
-esac
diff --git a/libvpx/build/make/thumb.pm b/libvpx/build/make/thumb.pm
index e1f34c1..483c253 100644
--- a/libvpx/build/make/thumb.pm
+++ b/libvpx/build/make/thumb.pm
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/env perl
##
## Copyright (c) 2013 The WebM project authors. All Rights Reserved.
##
@@ -24,7 +24,7 @@ sub FixThumbInstructions($$)
# with left shift, addition and a right shift (to restore the
# register to the original value). Currently the right shift
# isn't necessary in the code base since the values in these
- # registers aren't used, but doing the shift for consitency.
+ # registers aren't used, but doing the shift for consistency.
# This converts instructions such as "add r12, r12, r5, lsl r4"
# into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4".
s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g;
@@ -51,7 +51,7 @@ sub FixThumbInstructions($$)
# Convert register post indexing to a separate add instruction.
# This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]",
- # "add r0, r2".
+ # "addne r0, r0, r2".
s/^(\s*)((ldr|str)(ne)?[bhd]?)(\s+)(\w+),(\s*\w+,)?\s*\[(\w+)\],\s*(\w+)/$1$2$5$6,$7 [$8]\n$1add$4$5$8, $8, $9/g;
# Convert a conditional addition to the pc register into a series of
diff --git a/libvpx/build/x86-msvs/obj_int_extract.bat b/libvpx/build/x86-msvs/obj_int_extract.bat
index 4e9b0ec..44d095d 100644
--- a/libvpx/build/x86-msvs/obj_int_extract.bat
+++ b/libvpx/build/x86-msvs/obj_int_extract.bat
@@ -7,6 +7,9 @@ REM in the file PATENTS. All contributing project authors may
REM be found in the AUTHORS file in the root of the source tree.
echo on
+REM Arguments:
+REM %1 - Relative path to the directory containing the vp8 source directory.
+REM %2 - Path to obj_int_extract.exe.
cl /I "./" /I "%1" /nologo /c "%1/vp8/encoder/vp8_asm_enc_offsets.c"
-obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm"
+%2\obj_int_extract.exe rvds "vp8_asm_enc_offsets.obj" > "vp8_asm_enc_offsets.asm"
diff --git a/libvpx/configure b/libvpx/configure
index 729c986..ff350cc 100755
--- a/libvpx/configure
+++ b/libvpx/configure
@@ -24,14 +24,14 @@ Advanced options:
${toggle_examples} examples
${toggle_docs} documentation
${toggle_unit_tests} unit tests
+ ${toggle_decode_perf_tests} build decoder perf tests with unit tests
--libc=PATH path to alternate libc
--as={yasm|nasm|auto} use specified assembler [auto, yasm preferred]
- --sdk-path=PATH path to root of sdk (iOS, android builds only)
+ --sdk-path=PATH path to root of sdk (android builds only)
${toggle_fast_unaligned} don't use unaligned accesses, even when
supported by hardware [auto]
${toggle_codec_srcs} in/exclude codec library source code
${toggle_debug_libs} in/exclude debug version of libraries
- ${toggle_md5} support for output of checksum data
${toggle_static_msvcrt} use static MSVCRT (VS builds only)
${toggle_vp8} VP8 codec support
${toggle_vp9} VP9 codec support
@@ -51,6 +51,7 @@ Advanced options:
${toggle_postproc_visualizer} macro block / block level visualizers
${toggle_multi_res_encoding} enable multiple-resolution encoding
${toggle_temporal_denoising} enable temporal denoising and disable the spatial denoiser
+ ${toggle_webm_io} enable input from and output to WebM container
Codecs:
Codecs can be selectively enabled or disabled individually, or by family:
@@ -100,6 +101,7 @@ all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8
all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8
all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8
all_platforms="${all_platforms} armv7-win32-vs11"
+all_platforms="${all_platforms} armv7-win32-vs12"
all_platforms="${all_platforms} mips32-linux-gcc"
all_platforms="${all_platforms} ppc32-darwin8-gcc"
all_platforms="${all_platforms} ppc32-darwin9-gcc"
@@ -127,6 +129,7 @@ all_platforms="${all_platforms} x86-win32-vs8"
all_platforms="${all_platforms} x86-win32-vs9"
all_platforms="${all_platforms} x86-win32-vs10"
all_platforms="${all_platforms} x86-win32-vs11"
+all_platforms="${all_platforms} x86-win32-vs12"
all_platforms="${all_platforms} x86_64-darwin9-gcc"
all_platforms="${all_platforms} x86_64-darwin10-gcc"
all_platforms="${all_platforms} x86_64-darwin11-gcc"
@@ -140,6 +143,7 @@ all_platforms="${all_platforms} x86_64-win64-vs8"
all_platforms="${all_platforms} x86_64-win64-vs9"
all_platforms="${all_platforms} x86_64-win64-vs10"
all_platforms="${all_platforms} x86_64-win64-vs11"
+all_platforms="${all_platforms} x86_64-win64-vs12"
all_platforms="${all_platforms} universal-darwin8-gcc"
all_platforms="${all_platforms} universal-darwin9-gcc"
all_platforms="${all_platforms} universal-darwin10-gcc"
@@ -157,6 +161,18 @@ for t in ${all_targets}; do
[ -f ${source_path}/${t}.mk ] && enable_feature ${t}
done
+if ! perl --version >/dev/null; then
+ die "Perl is required to build"
+fi
+
+
+if [ "`cd ${source_path} && pwd`" != "`pwd`" ]; then
+ # test to see if source_path already configured
+ if [ -f ${source_path}/vpx_config.h ]; then
+ die "source directory already configured; run 'make distclean' there first"
+ fi
+fi
+
# check installed doxygen version
doxy_version=$(doxygen --version 2>/dev/null)
doxy_major=${doxy_version%%.*}
@@ -180,7 +196,6 @@ enable_feature install_libs
enable_feature static
enable_feature optimizations
enable_feature fast_unaligned #allow unaligned accesses, if supported by hw
-enable_feature md5
enable_feature spatial_resampling
enable_feature multithread
enable_feature os_support
@@ -250,7 +265,6 @@ HAVE_LIST="
"
EXPERIMENT_LIST="
multiple_arf
- non420
alpha
"
CONFIG_LIST="
@@ -275,7 +289,6 @@ CONFIG_LIST="
mem_manager
mem_tracker
mem_checks
- md5
dequant_tokens
dc_recon
@@ -299,6 +312,8 @@ CONFIG_LIST="
postproc_visualizer
os_support
unit_tests
+ webm_io
+ decode_perf_tests
multi_res_encoding
temporal_denoising
experimental
@@ -331,7 +346,6 @@ CMDLINE_SELECT="
fast_unaligned
codec_srcs
debug_libs
- md5
dequant_tokens
dc_recon
@@ -352,6 +366,8 @@ CMDLINE_SELECT="
small
postproc_visualizer
unit_tests
+ webm_io
+ decode_perf_tests
multi_res_encoding
temporal_denoising
experimental
@@ -670,9 +686,10 @@ process_toolchain() {
VCPROJ_SFX=vcproj
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_proj.sh
;;
- 10|11)
+ 10|11|12)
VCPROJ_SFX=vcxproj
gen_vcproj_cmd=${source_path}/build/make/gen_msvs_vcxproj.sh
+ enabled werror && gen_vcproj_cmd="${gen_vcproj_cmd} --enable-werror"
;;
esac
all_targets="${all_targets} solution"
@@ -687,6 +704,9 @@ process_toolchain() {
enabled postproc || die "postproc_visualizer requires postproc to be enabled"
fi
+ # Enable WebM IO by default.
+ soft_enable webm_io
+
# Enable unit tests by default if we have a working C++ compiler.
case "$toolchain" in
*-vs*)
diff --git a/libvpx/docs.mk b/libvpx/docs.mk
index cfe57ed..797b466 100644
--- a/libvpx/docs.mk
+++ b/libvpx/docs.mk
@@ -30,6 +30,7 @@ TXT_DOX = $(call enabled,TXT_DOX)
EXAMPLE_PATH += $(SRC_PATH_BARE) #for CHANGELOG, README, etc
+EXAMPLE_PATH += $(SRC_PATH_BARE)/examples
doxyfile: $(if $(findstring examples, $(ALL_TARGETS)),examples.doxy)
doxyfile: libs.doxy_template libs.doxy
diff --git a/libvpx/examples.mk b/libvpx/examples.mk
index 16f3c8f..87be5a8 100644
--- a/libvpx/examples.mk
+++ b/libvpx/examples.mk
@@ -15,54 +15,63 @@ LIBYUV_SRCS += third_party/libyuv/include/libyuv/basic_types.h \
third_party/libyuv/source/scale.c \
third_party/libyuv/source/cpu_id.c
-# List of examples to build. UTILS are files that are taken from the source
-# tree directly, and GEN_EXAMPLES are files that are created from the
-# examples folder.
+# List of examples to build. UTILS are tools meant for distribution
+# while EXAMPLES demonstrate specific portions of the API.
UTILS-$(CONFIG_DECODERS) += vpxdec.c
vpxdec.SRCS += md5_utils.c md5_utils.h
+vpxdec.SRCS += vpx_ports/mem_ops.h
+vpxdec.SRCS += vpx_ports/mem_ops_aligned.h
vpxdec.SRCS += vpx_ports/vpx_timer.h
vpxdec.SRCS += vpx/vpx_integer.h
vpxdec.SRCS += args.c args.h
+vpxdec.SRCS += ivfdec.c ivfdec.h
vpxdec.SRCS += tools_common.c tools_common.h
-vpxdec.SRCS += nestegg/halloc/halloc.h
-vpxdec.SRCS += nestegg/halloc/src/align.h
-vpxdec.SRCS += nestegg/halloc/src/halloc.c
-vpxdec.SRCS += nestegg/halloc/src/hlist.h
-vpxdec.SRCS += nestegg/halloc/src/macros.h
-vpxdec.SRCS += nestegg/include/nestegg/nestegg.h
-vpxdec.SRCS += nestegg/src/nestegg.c
+vpxdec.SRCS += y4menc.c y4menc.h
vpxdec.SRCS += $(LIBYUV_SRCS)
+ifeq ($(CONFIG_WEBM_IO),yes)
+ vpxdec.SRCS += third_party/nestegg/halloc/halloc.h
+ vpxdec.SRCS += third_party/nestegg/halloc/src/align.h
+ vpxdec.SRCS += third_party/nestegg/halloc/src/halloc.c
+ vpxdec.SRCS += third_party/nestegg/halloc/src/hlist.h
+ vpxdec.SRCS += third_party/nestegg/halloc/src/macros.h
+ vpxdec.SRCS += third_party/nestegg/include/nestegg/nestegg.h
+ vpxdec.SRCS += third_party/nestegg/src/nestegg.c
+ vpxdec.SRCS += webmdec.c webmdec.h
+endif
vpxdec.GUID = BA5FE66F-38DD-E034-F542-B1578C5FB950
vpxdec.DESCRIPTION = Full featured decoder
UTILS-$(CONFIG_ENCODERS) += vpxenc.c
-vpxenc.SRCS += args.c args.h y4minput.c y4minput.h
+vpxenc.SRCS += args.c args.h y4minput.c y4minput.h vpxenc.h
+vpxenc.SRCS += ivfdec.c ivfdec.h
+vpxenc.SRCS += ivfenc.c ivfenc.h
+vpxenc.SRCS += rate_hist.c rate_hist.h
vpxenc.SRCS += tools_common.c tools_common.h
-vpxenc.SRCS += webmenc.c webmenc.h
+vpxenc.SRCS += warnings.c warnings.h
vpxenc.SRCS += vpx_ports/mem_ops.h
vpxenc.SRCS += vpx_ports/mem_ops_aligned.h
vpxenc.SRCS += vpx_ports/vpx_timer.h
vpxenc.SRCS += vpxstats.c vpxstats.h
-vpxenc.SRCS += third_party/libmkv/EbmlIDs.h
-vpxenc.SRCS += third_party/libmkv/EbmlWriter.c
-vpxenc.SRCS += third_party/libmkv/EbmlWriter.h
vpxenc.SRCS += $(LIBYUV_SRCS)
+ifeq ($(CONFIG_WEBM_IO),yes)
+ vpxenc.SRCS += third_party/libmkv/EbmlIDs.h
+ vpxenc.SRCS += third_party/libmkv/EbmlWriter.c
+ vpxenc.SRCS += third_party/libmkv/EbmlWriter.h
+ vpxenc.SRCS += webmenc.c webmenc.h
+endif
vpxenc.GUID = 548DEC74-7A15-4B2B-AFC3-AA102E7C25C1
vpxenc.DESCRIPTION = Full featured encoder
-UTILS-$(CONFIG_VP8_ENCODER) += vp8_scalable_patterns.c
-vp8_scalable_patterns.GUID = 0D6A210B-F482-4D6F-8570-4A9C01ACC88C
-vp8_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder
-UTILS-$(CONFIG_VP9_ENCODER) += vp9_spatial_scalable_encoder.c
+EXAMPLES-$(CONFIG_VP9_ENCODER) += vp9_spatial_scalable_encoder.c
vp9_spatial_scalable_encoder.SRCS += args.c args.h
+vp9_spatial_scalable_encoder.SRCS += ivfenc.c ivfenc.h
+vp9_spatial_scalable_encoder.SRCS += tools_common.c tools_common.h
+vp9_spatial_scalable_encoder.SRCS += video_common.h
+vp9_spatial_scalable_encoder.SRCS += video_writer.h video_writer.c
+vp9_spatial_scalable_encoder.SRCS += vpxstats.c vpxstats.h
vp9_spatial_scalable_encoder.GUID = 4A38598D-627D-4505-9C7B-D4020C84100D
vp9_spatial_scalable_encoder.DESCRIPTION = Spatial Scalable Encoder
-# Clean up old ivfenc, ivfdec binaries.
-ifeq ($(CONFIG_MSVS),yes)
-CLEAN-OBJS += $(foreach p,$(VS_PLATFORMS),$(p)/Release/ivfenc.exe)
-CLEAN-OBJS += $(foreach p,$(VS_PLATFORMS),$(p)/Release/ivfdec.exe)
-else
-CLEAN-OBJS += ivfenc{.c.o,.c.d,.dox,.exe,}
-CLEAN-OBJS += ivfdec{.c.o,.c.d,.dox,.exe,}
+ifeq ($(CONFIG_SHARED),no)
+EXAMPLES-$(CONFIG_VP9_ENCODER) += resize_util.c
endif
# XMA example disabled for now, not used in VP8
@@ -70,52 +79,93 @@ endif
#example_xma.GUID = A955FC4A-73F1-44F7-135E-30D84D32F022
#example_xma.DESCRIPTION = External Memory Allocation mode usage
-GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += simple_decoder.c
-simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
-simple_decoder.DESCRIPTION = Simplified decoder loop
-GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += postproc.c
-postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
-postproc.DESCRIPTION = Decoder postprocessor control
-GEN_EXAMPLES-$(CONFIG_VP8_DECODER) += decode_to_md5.c
-decode_to_md5.SRCS += md5_utils.h md5_utils.c
-decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
-decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
-
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += simple_encoder.c
+EXAMPLES-$(CONFIG_ENCODERS) += vpx_temporal_scalable_patterns.c
+vpx_temporal_scalable_patterns.SRCS += ivfenc.c ivfenc.h
+vpx_temporal_scalable_patterns.SRCS += tools_common.c tools_common.h
+vpx_temporal_scalable_patterns.SRCS += video_common.h
+vpx_temporal_scalable_patterns.SRCS += video_writer.h video_writer.c
+vpx_temporal_scalable_patterns.GUID = B18C08F2-A439-4502-A78E-849BE3D60947
+vpx_temporal_scalable_patterns.DESCRIPTION = Temporal Scalability Encoder
+EXAMPLES-$(CONFIG_VP8_DECODER) += simple_decoder.c
+simple_decoder.GUID = D3BBF1E9-2427-450D-BBFF-B2843C1D44CC
+simple_decoder.SRCS += ivfdec.h ivfdec.c
+simple_decoder.SRCS += tools_common.h tools_common.c
+simple_decoder.SRCS += video_common.h
+simple_decoder.SRCS += video_reader.h video_reader.c
+simple_decoder.SRCS += vpx_ports/mem_ops.h
+simple_decoder.SRCS += vpx_ports/mem_ops_aligned.h
+simple_decoder.DESCRIPTION = Simplified decoder loop
+EXAMPLES-$(CONFIG_VP8_DECODER) += postproc.c
+postproc.SRCS += ivfdec.h ivfdec.c
+postproc.SRCS += tools_common.h tools_common.c
+postproc.SRCS += video_common.h
+postproc.SRCS += video_reader.h video_reader.c
+postproc.SRCS += vpx_ports/mem_ops.h
+postproc.SRCS += vpx_ports/mem_ops_aligned.h
+postproc.GUID = 65E33355-F35E-4088-884D-3FD4905881D7
+postproc.DESCRIPTION = Decoder postprocessor control
+EXAMPLES-$(CONFIG_VP8_DECODER) += decode_to_md5.c
+decode_to_md5.SRCS += md5_utils.h md5_utils.c
+decode_to_md5.SRCS += ivfdec.h ivfdec.c
+decode_to_md5.SRCS += tools_common.h tools_common.c
+decode_to_md5.SRCS += video_common.h
+decode_to_md5.SRCS += video_reader.h video_reader.c
+decode_to_md5.SRCS += vpx_ports/mem_ops.h
+decode_to_md5.SRCS += vpx_ports/mem_ops_aligned.h
+decode_to_md5.GUID = 59120B9B-2735-4BFE-B022-146CA340FE42
+decode_to_md5.DESCRIPTION = Frame by frame MD5 checksum
+EXAMPLES-$(CONFIG_VP8_ENCODER) += simple_encoder.c
+simple_encoder.SRCS += ivfenc.h ivfenc.c
+simple_encoder.SRCS += tools_common.h tools_common.c
+simple_encoder.SRCS += video_common.h
+simple_encoder.SRCS += video_writer.h video_writer.c
simple_encoder.GUID = 4607D299-8A71-4D2C-9B1D-071899B6FBFD
simple_encoder.DESCRIPTION = Simplified encoder loop
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += twopass_encoder.c
+EXAMPLES-$(CONFIG_VP8_ENCODER) += twopass_encoder.c
+twopass_encoder.SRCS += ivfenc.h ivfenc.c
+twopass_encoder.SRCS += tools_common.h tools_common.c
+twopass_encoder.SRCS += video_common.h
+twopass_encoder.SRCS += video_writer.h video_writer.c
twopass_encoder.GUID = 73494FA6-4AF9-4763-8FBB-265C92402FD8
twopass_encoder.DESCRIPTION = Two-pass encoder loop
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += force_keyframe.c
-force_keyframe.GUID = 3C67CADF-029F-4C86-81F5-D6D4F51177F0
-force_keyframe.DESCRIPTION = Force generation of keyframes
ifeq ($(CONFIG_DECODERS),yes)
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += decode_with_drops.c
+EXAMPLES-$(CONFIG_VP8_ENCODER) += decode_with_drops.c
+decode_with_drops.SRCS += ivfdec.h ivfdec.c
+decode_with_drops.SRCS += tools_common.h tools_common.c
+decode_with_drops.SRCS += video_common.h
+decode_with_drops.SRCS += video_reader.h video_reader.c
+decode_with_drops.SRCS += vpx_ports/mem_ops.h
+decode_with_drops.SRCS += vpx_ports/mem_ops_aligned.h
endif
decode_with_drops.GUID = CE5C53C4-8DDA-438A-86ED-0DDD3CDB8D26
decode_with_drops.DESCRIPTION = Drops frames while decoding
ifeq ($(CONFIG_VP8_DECODER),yes)
-GEN_EXAMPLES-$(CONFIG_ERROR_CONCEALMENT) += decode_with_partial_drops.c
+EXAMPLES-$(CONFIG_ERROR_CONCEALMENT) += decode_with_partial_drops.c
endif
decode_with_partial_drops.GUID = 61C2D026-5754-46AC-916F-1343ECC5537E
decode_with_partial_drops.DESCRIPTION = Drops parts of frames while decoding
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += error_resilient.c
-error_resilient.GUID = DF5837B9-4145-4F92-A031-44E4F832E00C
-error_resilient.DESCRIPTION = Error Resiliency Feature
-
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8_set_maps.c
-vp8_set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
-vp8_set_maps.DESCRIPTION = VP8 set active and ROI maps
-GEN_EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
+EXAMPLES-$(CONFIG_ENCODERS) += set_maps.c
+set_maps.SRCS += ivfenc.h ivfenc.c
+set_maps.SRCS += tools_common.h tools_common.c
+set_maps.SRCS += video_common.h
+set_maps.SRCS += video_writer.h video_writer.c
+set_maps.GUID = ECB2D24D-98B8-4015-A465-A4AF3DCC145F
+set_maps.DESCRIPTION = Set active and ROI maps
+EXAMPLES-$(CONFIG_VP8_ENCODER) += vp8cx_set_ref.c
+vp8cx_set_ref.SRCS += ivfenc.h ivfenc.c
+vp8cx_set_ref.SRCS += tools_common.h tools_common.c
+vp8cx_set_ref.SRCS += video_common.h
+vp8cx_set_ref.SRCS += video_writer.h video_writer.c
vp8cx_set_ref.GUID = C5E31F7F-96F6-48BD-BD3E-10EBF6E8057A
vp8cx_set_ref.DESCRIPTION = VP8 set encoder reference frame
-# C file is provided, not generated automatically.
-UTILS-$(CONFIG_MULTI_RES_ENCODING) += vp8_multi_resolution_encoder.c
-vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
-vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
-vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
+
+ifeq ($(CONFIG_MULTI_RES_ENCODING),yes)
+EXAMPLES-$(CONFIG_VP8_DECODER) += vp8_multi_resolution_encoder.c
+vp8_multi_resolution_encoder.SRCS += $(LIBYUV_SRCS)
+vp8_multi_resolution_encoder.GUID = 04f8738e-63c8-423b-90fa-7c2703a374de
+vp8_multi_resolution_encoder.DESCRIPTION = VP8 Multiple-resolution Encoding
+endif
# Handle extra library flags depending on codec configuration
@@ -157,17 +207,17 @@ INTERNAL_LDFLAGS += $(addprefix -L,$(LIB_PATH))
# Expand list of selected examples to build (as specified above)
UTILS = $(call enabled,UTILS)
-GEN_EXAMPLES = $(call enabled,GEN_EXAMPLES)
-ALL_EXAMPLES = $(UTILS) $(GEN_EXAMPLES)
+EXAMPLES = $(addprefix examples/,$(call enabled,EXAMPLES))
+ALL_EXAMPLES = $(UTILS) $(EXAMPLES)
UTIL_SRCS = $(foreach ex,$(UTILS),$($(ex:.c=).SRCS))
-ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(ex:.c=).SRCS))
+ALL_SRCS = $(foreach ex,$(ALL_EXAMPLES),$($(notdir $(ex:.c=)).SRCS))
CODEC_EXTRA_LIBS=$(sort $(call enabled,CODEC_EXTRA_LIBS))
# Expand all example sources into a variable containing all sources
-# for that example (not just them main one specified in UTILS/GEN_EXAMPLES)
+# for that example (not just them main one specified in UTILS/EXAMPLES)
# and add this file to the list (for MSVS workspace generation)
-$(foreach ex,$(ALL_EXAMPLES),$(eval $(ex:.c=).SRCS += $(ex) examples.mk))
+$(foreach ex,$(ALL_EXAMPLES),$(eval $(notdir $(ex:.c=)).SRCS += $(ex) examples.mk))
# If this is a universal (fat) binary, then all the subarchitectures have
@@ -204,14 +254,6 @@ $(foreach bin,$(BINS-yes),\
)
-# Rules to generate the GEN_EXAMPLES sources
-.PRECIOUS: %.c
-CLEAN-OBJS += $(GEN_EXAMPLES)
-%.c: examples/%.txt
- @echo " [EXAMPLE] $@"
- @$(SRC_PATH_BARE)/examples/gen_example_code.sh $< > $@
-
-
# The following pairs define a mapping of locations in the distribution
# tree to locations in the source/build trees.
INSTALL_MAPS += src/%.c %.c
@@ -249,50 +291,42 @@ $(1): $($(1:.$(VCPROJ_SFX)=).SRCS) vpx.$(VCPROJ_SFX)
--out=$$@ $$(INTERNAL_CFLAGS) $$(CFLAGS) \
$$(INTERNAL_LDFLAGS) $$(LDFLAGS) -l$$(CODEC_LIB) $$^
endef
-PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES:.c=.$(VCPROJ_SFX))
+ALL_EXAMPLES_BASENAME := $(notdir $(ALL_EXAMPLES))
+PROJECTS-$(CONFIG_MSVS) += $(ALL_EXAMPLES_BASENAME:.c=.$(VCPROJ_SFX))
INSTALL-BINS-$(CONFIG_MSVS) += $(foreach p,$(VS_PLATFORMS),\
- $(addprefix bin/$(p)/,$(ALL_EXAMPLES:.c=.exe)))
+ $(addprefix bin/$(p)/,$(ALL_EXAMPLES_BASENAME:.c=.exe)))
$(foreach proj,$(call enabled,PROJECTS),\
$(eval $(call vcproj_template,$(proj))))
-
-
#
# Documentation Rules
#
-%.dox: examples/%.txt
- @echo " [DOXY] $@"
- @$(SRC_PATH_BARE)/examples/gen_example_text.sh $< | \
- $(SRC_PATH_BARE)/examples/gen_example_doxy.php \
- example_$(@:.dox=) $(@:.dox=.c) > $@
-
%.dox: %.c
@echo " [DOXY] $@"
- @echo "/*!\page example_$(@:.dox=) $(@:.dox=)" > $@
- @echo " \includelineno $(notdir $<)" >> $@
+ @echo "/*!\page example_$(@F:.dox=) $(@F:.dox=)" > $@
+ @echo " \includelineno $(<F)" >> $@
@echo "*/" >> $@
samples.dox: examples.mk
@echo " [DOXY] $@"
@echo "/*!\page samples Sample Code" > $@
@echo " This SDK includes a number of sample applications."\
- "each sample documents a feature of the SDK in both prose"\
- "and the associated C code. In general, later samples"\
- "build upon prior samples, so it is best to work through the"\
- "list in order. The following samples are included: ">>$@
- @$(foreach ex,$(GEN_EXAMPLES:.c=),\
+ "Each sample documents a feature of the SDK in both prose"\
+ "and the associated C code."\
+ "The following samples are included: ">>$@
+ @$(foreach ex,$(sort $(notdir $(EXAMPLES:.c=))),\
echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
@echo >> $@
@echo " In addition, the SDK contains a number of utilities."\
"Since these utilities are built upon the concepts described"\
"in the sample code listed above, they are not documented in"\
- "pieces like the samples are. Thir sourcre is included here"\
+ "pieces like the samples are. Their source is included here"\
"for reference. The following utilities are included:" >> $@
- @$(foreach ex,$(UTILS:.c=),\
+ @$(foreach ex,$(sort $(UTILS:.c=)),\
echo " - \subpage example_$(ex) $($(ex).DESCRIPTION)" >> $@;)
@echo "*/" >> $@
CLEAN-OBJS += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
-DOCS-yes += examples.doxy samples.dox $(ALL_EXAMPLES:.c=.dox)
+DOCS-yes += examples.doxy samples.dox
examples.doxy: samples.dox $(ALL_EXAMPLES:.c=.dox)
@echo "INPUT += $^" > $@
diff --git a/libvpx/examples/decode_to_md5.c b/libvpx/examples/decode_to_md5.c
new file mode 100644
index 0000000..28d1ad5
--- /dev/null
+++ b/libvpx/examples/decode_to_md5.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// Frame-by-frame MD5 Checksum
+// ===========================
+//
+// This example builds upon the simple decoder loop to show how checksums
+// of the decoded output can be generated. These are used for validating
+// decoder implementations against the reference implementation, for example.
+//
+// MD5 algorithm
+// -------------
+// The Message-Digest 5 (MD5) is a well known hash function. We have provided
+// an implementation derived from the RSA Data Security, Inc. MD5 Message-Digest
+// Algorithm for your use. Our implmentation only changes the interface of this
+// reference code. You must include the `md5_utils.h` header for access to these
+// functions.
+//
+// Processing The Decoded Data
+// ---------------------------
+// Each row of the image is passed to the MD5 accumulator. First the Y plane
+// is processed, then U, then V. It is important to honor the image's `stride`
+// values.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+
+#include "vpx/vp8dx.h"
+#include "vpx/vpx_decoder.h"
+
+#include "./md5_utils.h"
+#include "./tools_common.h"
+#include "./video_reader.h"
+#include "./vpx_config.h"
+
+static void get_image_md5(const vpx_image_t *img, unsigned char digest[16]) {
+ int plane, y;
+ MD5Context md5;
+
+ MD5Init(&md5);
+
+ for (plane = 0; plane < 3; ++plane) {
+ const unsigned char *buf = img->planes[plane];
+ const int stride = img->stride[plane];
+ const int w = plane ? (img->d_w + 1) >> 1 : img->d_w;
+ const int h = plane ? (img->d_h + 1) >> 1 : img->d_h;
+
+ for (y = 0; y < h; ++y) {
+ MD5Update(&md5, buf, w);
+ buf += stride;
+ }
+ }
+
+ MD5Final(digest, &md5);
+}
+
+static void print_md5(FILE *stream, unsigned char digest[16]) {
+ int i;
+
+ for (i = 0; i < 16; ++i)
+ fprintf(stream, "%02x", digest[i]);
+}
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv) {
+ int frame_cnt = 0;
+ FILE *outfile = NULL;
+ vpx_codec_ctx_t codec;
+ VpxVideoReader *reader = NULL;
+ const VpxVideoInfo *info = NULL;
+ const VpxInterface *decoder = NULL;
+
+ exec_name = argv[0];
+
+ if (argc != 3)
+ die("Invalid number of arguments.");
+
+ reader = vpx_video_reader_open(argv[1]);
+ if (!reader)
+ die("Failed to open %s for reading.", argv[1]);
+
+ if (!(outfile = fopen(argv[2], "wb")))
+ die("Failed to open %s for writing.", argv[2]);
+
+ info = vpx_video_reader_get_info(reader);
+
+ decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
+ if (!decoder)
+ die("Unknown input codec.");
+
+ printf("Using %s\n", vpx_codec_iface_name(decoder->interface()));
+
+ if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0))
+ die_codec(&codec, "Failed to initialize decoder");
+
+ while (vpx_video_reader_read_frame(reader)) {
+ vpx_codec_iter_t iter = NULL;
+ vpx_image_t *img = NULL;
+ size_t frame_size = 0;
+ const unsigned char *frame = vpx_video_reader_get_frame(reader,
+ &frame_size);
+ if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
+ die_codec(&codec, "Failed to decode frame");
+
+ while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
+ unsigned char digest[16];
+
+ get_image_md5(img, digest);
+ print_md5(outfile, digest);
+ fprintf(outfile, " img-%dx%d-%04d.i420\n",
+ img->d_w, img->d_h, ++frame_cnt);
+ }
+ }
+
+ printf("Processed %d frames.\n", frame_cnt);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec.");
+
+ vpx_video_reader_close(reader);
+
+ fclose(outfile);
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/decode_to_md5.txt b/libvpx/examples/decode_to_md5.txt
deleted file mode 100644
index ea0eb69..0000000
--- a/libvpx/examples/decode_to_md5.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-@TEMPLATE decoder_tmpl.c
-Frame-by-frame MD5 Checksum
-===========================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This example builds upon the simple decoder loop to show how checksums
-of the decoded output can be generated. These are used for validating
-decoder implementations against the reference implementation, for example.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-MD5 algorithm
--------------
-The Message-Digest 5 (MD5) is a well known hash function. We have provided
-an implementation derived from the RSA Data Security, Inc. MD5 Message-Digest
-Algorithm for your use. Our implmentation only changes the interface of this
-reference code. You must include the `md5_utils.h` header for access to these
-functions.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_INCLUDES
-#include "md5_utils.h"
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_INCLUDES
-
-
-Processing The Decoded Data
----------------------------
-Each row of the image is passed to the MD5 accumulator. First the Y plane
-is processed, then U, then V. It is important to honor the image's `stride`
-values.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_DX
-unsigned char md5_sum[16];
-MD5Context md5;
-int i;
-
-MD5Init(&md5);
-
-for(plane=0; plane < 3; plane++) {
- unsigned char *buf =img->planes[plane];
-
- for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
- MD5Update(&md5, buf, (plane ? (img->d_w + 1) >> 1 : img->d_w));
- buf += img->stride[plane];
- }
-}
-
-MD5Final(md5_sum, &md5);
-for(i=0; i<16; i++)
- fprintf(outfile, "%02x",md5_sum[i]);
-fprintf(outfile, " img-%dx%d-%04d.i420\n", img->d_w, img->d_h,
- frame_cnt);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_DX
diff --git a/libvpx/examples/decode_with_drops.c b/libvpx/examples/decode_with_drops.c
new file mode 100644
index 0000000..af1aa63
--- /dev/null
+++ b/libvpx/examples/decode_with_drops.c
@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// Decode With Drops Example
+// =========================
+//
+// This is an example utility which drops a series of frames, as specified
+// on the command line. This is useful for observing the error recovery
+// features of the codec.
+//
+// Usage
+// -----
+// This example adds a single argument to the `simple_decoder` example,
+// which specifies the range or pattern of frames to drop. The parameter is
+// parsed as follows:
+//
+// Dropping A Range Of Frames
+// --------------------------
+// To drop a range of frames, specify the starting frame and the ending
+// frame to drop, separated by a dash. The following command will drop
+// frames 5 through 10 (base 1).
+//
+// $ ./decode_with_drops in.ivf out.i420 5-10
+//
+//
+// Dropping A Pattern Of Frames
+// ----------------------------
+// To drop a pattern of frames, specify the number of frames to drop and
+// the number of frames after which to repeat the pattern, separated by
+// a forward-slash. The following command will drop 3 of 7 frames.
+// Specifically, it will decode 4 frames, then drop 3 frames, and then
+// repeat.
+//
+// $ ./decode_with_drops in.ivf out.i420 3/7
+//
+//
+// Extra Variables
+// ---------------
+// This example maintains the pattern passed on the command line in the
+// `n`, `m`, and `is_range` variables:
+//
+//
+// Making The Drop Decision
+// ------------------------
+// The example decides whether to drop the frame based on the current
+// frame number, immediately before decoding the frame.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+
+#include "vpx/vp8dx.h"
+#include "vpx/vpx_decoder.h"
+
+#include "./tools_common.h"
+#include "./video_reader.h"
+#include "./vpx_config.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <infile> <outfile> <N-M|N/M>\n", exec_name);
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv) {
+ int frame_cnt = 0;
+ FILE *outfile = NULL;
+ vpx_codec_ctx_t codec;
+ const VpxInterface *decoder = NULL;
+ VpxVideoReader *reader = NULL;
+ const VpxVideoInfo *info = NULL;
+ int n = 0;
+ int m = 0;
+ int is_range = 0;
+ char *nptr = NULL;
+
+ exec_name = argv[0];
+
+ if (argc != 4)
+ die("Invalid number of arguments.");
+
+ reader = vpx_video_reader_open(argv[1]);
+ if (!reader)
+ die("Failed to open %s for reading.", argv[1]);
+
+ if (!(outfile = fopen(argv[2], "wb")))
+ die("Failed to open %s for writing.", argv[2]);
+
+ n = strtol(argv[3], &nptr, 0);
+ m = strtol(nptr + 1, NULL, 0);
+ is_range = (*nptr == '-');
+ if (!n || !m || (*nptr != '-' && *nptr != '/'))
+ die("Couldn't parse pattern %s.\n", argv[3]);
+
+ info = vpx_video_reader_get_info(reader);
+
+ decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
+ if (!decoder)
+ die("Unknown input codec.");
+
+ printf("Using %s\n", vpx_codec_iface_name(decoder->interface()));
+
+ if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0))
+ die_codec(&codec, "Failed to initialize decoder.");
+
+ while (vpx_video_reader_read_frame(reader)) {
+ vpx_codec_iter_t iter = NULL;
+ vpx_image_t *img = NULL;
+ size_t frame_size = 0;
+ int skip;
+ const unsigned char *frame = vpx_video_reader_get_frame(reader,
+ &frame_size);
+ if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
+ die_codec(&codec, "Failed to decode frame.");
+
+ ++frame_cnt;
+
+ skip = (is_range && frame_cnt >= n && frame_cnt <= m) ||
+ (!is_range && m - (frame_cnt - 1) % m <= n);
+
+ if (!skip) {
+ putc('.', stdout);
+
+ while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL)
+ vpx_img_write(img, outfile);
+ } else {
+ putc('X', stdout);
+ }
+
+ fflush(stdout);
+ }
+
+ printf("Processed %d frames.\n", frame_cnt);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec.");
+
+ printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
+ info->frame_width, info->frame_height, argv[2]);
+
+ vpx_video_reader_close(reader);
+ fclose(outfile);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/decode_with_drops.txt b/libvpx/examples/decode_with_drops.txt
deleted file mode 100644
index fb77a7e..0000000
--- a/libvpx/examples/decode_with_drops.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-@TEMPLATE decoder_tmpl.c
-Decode With Drops Example
-=========================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example utility which drops a series of frames, as specified
-on the command line. This is useful for observing the error recovery
-features of the codec.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-Usage
------
-This example adds a single argument to the `simple_decoder` example,
-which specifies the range or pattern of frames to drop. The parameter is
-parsed as follows:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-if(argc!=4)
- die("Usage: %s <infile> <outfile> <N-M|N/M>\n", argv[0]);
-{
- char *nptr;
- n = strtol(argv[3], &nptr, 0);
- m = strtol(nptr+1, NULL, 0);
- is_range = *nptr == '-';
- if(!n || !m || (*nptr != '-' && *nptr != '/'))
- die("Couldn't parse pattern %s\n", argv[3]);
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-
-
-Dropping A Range Of Frames
---------------------------
-To drop a range of frames, specify the starting frame and the ending
-frame to drop, separated by a dash. The following command will drop
-frames 5 through 10 (base 1).
-
- $ ./decode_with_drops in.ivf out.i420 5-10
-
-
-Dropping A Pattern Of Frames
-----------------------------
-To drop a pattern of frames, specify the number of frames to drop and
-the number of frames after which to repeat the pattern, separated by
-a forward-slash. The following command will drop 3 of 7 frames.
-Specifically, it will decode 4 frames, then drop 3 frames, and then
-repeat.
-
- $ ./decode_with_drops in.ivf out.i420 3/7
-
-
-Extra Variables
----------------
-This example maintains the pattern passed on the command line in the
-`n`, `m`, and `is_range` variables:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_VARS
-int n, m, is_range;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_VARS
-
-
-Making The Drop Decision
-------------------------
-The example decides whether to drop the frame based on the current
-frame number, immediately before decoding the frame.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
-if((is_range && frame_cnt >= n && frame_cnt <= m)
- ||(!is_range && m - (frame_cnt-1)%m <= n)) {
- putc('X', stdout);
- continue;
-}
-putc('.', stdout);
-fflush(stdout);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
diff --git a/libvpx/examples/decode_with_partial_drops.c b/libvpx/examples/decode_with_partial_drops.c
new file mode 100644
index 0000000..d7132de
--- /dev/null
+++ b/libvpx/examples/decode_with_partial_drops.c
@@ -0,0 +1,328 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// Decode With Partial Drops Example
+// =========================
+//
+// This is an example utility which drops a series of frames (or parts of
+// frames), as specified on the command line. This is useful for observing the
+// error recovery features of the codec.
+//
+// Usage
+// -----
+// This example adds a single argument to the `simple_decoder` example,
+// which specifies the range or pattern of frames to drop. The parameter is
+// parsed as follows.
+//
+// Dropping A Range Of Frames
+// --------------------------
+// To drop a range of frames, specify the starting frame and the ending
+// frame to drop, separated by a dash. The following command will drop
+// frames 5 through 10 (base 1).
+//
+// $ ./decode_with_partial_drops in.ivf out.i420 5-10
+//
+//
+// Dropping A Pattern Of Frames
+// ----------------------------
+// To drop a pattern of frames, specify the number of frames to drop and
+// the number of frames after which to repeat the pattern, separated by
+// a forward-slash. The following command will drop 3 of 7 frames.
+// Specifically, it will decode 4 frames, then drop 3 frames, and then
+// repeat.
+//
+// $ ./decode_with_partial_drops in.ivf out.i420 3/7
+//
+// Dropping Random Parts Of Frames
+// -------------------------------
+// A third argument tuple is available to split the frame into 1500 bytes pieces
+// and randomly drop pieces rather than frames. The frame will be split at
+// partition boundaries where possible. The following example will seed the RNG
+// with the seed 123 and drop approximately 5% of the pieces. Pieces which
+// are depending on an already dropped piece will also be dropped.
+//
+// $ ./decode_with_partial_drops in.ivf out.i420 5,123
+//
+// Extra Variables
+// ---------------
+// This example maintains the pattern passed on the command line in the
+// `n`, `m`, and `is_range` variables:
+//
+// Making The Drop Decision
+// ------------------------
+// The example decides whether to drop the frame based on the current
+// frame number, immediately before decoding the frame.
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define VPX_CODEC_DISABLE_COMPAT 1
+#include "./vpx_config.h"
+#include "vpx/vp8dx.h"
+#include "vpx/vpx_decoder.h"
+#define interface (vpx_codec_vp8_dx())
+#include <time.h>
+
+
+#define IVF_FILE_HDR_SZ (32)
+#define IVF_FRAME_HDR_SZ (12)
+
+static unsigned int mem_get_le32(const unsigned char *mem) {
+ return (mem[3] << 24)|(mem[2] << 16)|(mem[1] << 8)|(mem[0]);
+}
+
+static void die(const char *fmt, ...) {
+ va_list ap;
+
+ va_start(ap, fmt);
+ vprintf(fmt, ap);
+ if(fmt[strlen(fmt)-1] != '\n')
+ printf("\n");
+ exit(EXIT_FAILURE);
+}
+
+static void die_codec(vpx_codec_ctx_t *ctx, const char *s) {
+ const char *detail = vpx_codec_error_detail(ctx);
+
+ printf("%s: %s\n", s, vpx_codec_error(ctx));
+ if(detail)
+ printf(" %s\n",detail);
+ exit(EXIT_FAILURE);
+}
+
+struct parsed_header
+{
+ char key_frame;
+ int version;
+ char show_frame;
+ int first_part_size;
+};
+
+int next_packet(struct parsed_header* hdr, int pos, int length, int mtu)
+{
+ int size = 0;
+ int remaining = length - pos;
+ /* Uncompressed part is 3 bytes for P frames and 10 bytes for I frames */
+ int uncomp_part_size = (hdr->key_frame ? 10 : 3);
+ /* number of bytes yet to send from header and the first partition */
+ int remainFirst = uncomp_part_size + hdr->first_part_size - pos;
+ if (remainFirst > 0)
+ {
+ if (remainFirst <= mtu)
+ {
+ size = remainFirst;
+ }
+ else
+ {
+ size = mtu;
+ }
+
+ return size;
+ }
+
+ /* second partition; just slot it up according to MTU */
+ if (remaining <= mtu)
+ {
+ size = remaining;
+ return size;
+ }
+ return mtu;
+}
+
+void throw_packets(unsigned char* frame, int* size, int loss_rate,
+ int* thrown, int* kept)
+{
+ unsigned char loss_frame[256*1024];
+ int pkg_size = 1;
+ int pos = 0;
+ int loss_pos = 0;
+ struct parsed_header hdr;
+ unsigned int tmp;
+ int mtu = 1500;
+
+ if (*size < 3)
+ {
+ return;
+ }
+ putc('|', stdout);
+ /* parse uncompressed 3 bytes */
+ tmp = (frame[2] << 16) | (frame[1] << 8) | frame[0];
+ hdr.key_frame = !(tmp & 0x1); /* inverse logic */
+ hdr.version = (tmp >> 1) & 0x7;
+ hdr.show_frame = (tmp >> 4) & 0x1;
+ hdr.first_part_size = (tmp >> 5) & 0x7FFFF;
+
+ /* don't drop key frames */
+ if (hdr.key_frame)
+ {
+ int i;
+ *kept = *size/mtu + ((*size % mtu > 0) ? 1 : 0); /* approximate */
+ for (i=0; i < *kept; i++)
+ putc('.', stdout);
+ return;
+ }
+
+ while ((pkg_size = next_packet(&hdr, pos, *size, mtu)) > 0)
+ {
+ int loss_event = ((rand() + 1.0)/(RAND_MAX + 1.0) < loss_rate/100.0);
+ if (*thrown == 0 && !loss_event)
+ {
+ memcpy(loss_frame + loss_pos, frame + pos, pkg_size);
+ loss_pos += pkg_size;
+ (*kept)++;
+ putc('.', stdout);
+ }
+ else
+ {
+ (*thrown)++;
+ putc('X', stdout);
+ }
+ pos += pkg_size;
+ }
+ memcpy(frame, loss_frame, loss_pos);
+ memset(frame + loss_pos, 0, *size - loss_pos);
+ *size = loss_pos;
+}
+
+int main(int argc, char **argv) {
+ FILE *infile, *outfile;
+ vpx_codec_ctx_t codec;
+ int flags = 0, frame_cnt = 0;
+ unsigned char file_hdr[IVF_FILE_HDR_SZ];
+ unsigned char frame_hdr[IVF_FRAME_HDR_SZ];
+ unsigned char frame[256*1024];
+ vpx_codec_err_t res;
+ int n, m, mode;
+ unsigned int seed;
+ int thrown=0, kept=0;
+ int thrown_frame=0, kept_frame=0;
+ vpx_codec_dec_cfg_t dec_cfg = {0};
+
+ (void)res;
+ /* Open files */
+ if(argc < 4 || argc > 6)
+ die("Usage: %s <infile> <outfile> [-t <num threads>] <N-M|N/M|L,S>\n",
+ argv[0]);
+ {
+ char *nptr;
+ int arg_num = 3;
+ if (argc == 6 && strncmp(argv[arg_num++], "-t", 2) == 0)
+ dec_cfg.threads = strtol(argv[arg_num++], NULL, 0);
+ n = strtol(argv[arg_num], &nptr, 0);
+ mode = (*nptr == '\0' || *nptr == ',') ? 2 : (*nptr == '-') ? 1 : 0;
+
+ m = strtol(nptr+1, NULL, 0);
+ if((!n && !m) || (*nptr != '-' && *nptr != '/' &&
+ *nptr != '\0' && *nptr != ','))
+ die("Couldn't parse pattern %s\n", argv[3]);
+ }
+ seed = (m > 0) ? m : (unsigned int)time(NULL);
+ srand(seed);thrown_frame = 0;
+ printf("Seed: %u\n", seed);
+ printf("Threads: %d\n", dec_cfg.threads);
+ if(!(infile = fopen(argv[1], "rb")))
+ die("Failed to open %s for reading", argv[1]);
+ if(!(outfile = fopen(argv[2], "wb")))
+ die("Failed to open %s for writing", argv[2]);
+
+ /* Read file header */
+ if(!(fread(file_hdr, 1, IVF_FILE_HDR_SZ, infile) == IVF_FILE_HDR_SZ
+ && file_hdr[0]=='D' && file_hdr[1]=='K' && file_hdr[2]=='I'
+ && file_hdr[3]=='F'))
+ die("%s is not an IVF file.", argv[1]);
+
+ printf("Using %s\n",vpx_codec_iface_name(interface));
+ /* Initialize codec */
+ flags = VPX_CODEC_USE_ERROR_CONCEALMENT;
+ res = vpx_codec_dec_init(&codec, interface, &dec_cfg, flags);
+ if(res)
+ die_codec(&codec, "Failed to initialize decoder");
+
+
+ /* Read each frame */
+ while(fread(frame_hdr, 1, IVF_FRAME_HDR_SZ, infile) == IVF_FRAME_HDR_SZ) {
+ int frame_sz = mem_get_le32(frame_hdr);
+ vpx_codec_iter_t iter = NULL;
+ vpx_image_t *img;
+
+
+ frame_cnt++;
+ if(frame_sz > sizeof(frame))
+ die("Frame %d data too big for example code buffer", frame_sz);
+ if(fread(frame, 1, frame_sz, infile) != frame_sz)
+ die("Frame %d failed to read complete frame", frame_cnt);
+
+ /* Decide whether to throw parts of the frame or the whole frame
+ depending on the drop mode */
+ thrown_frame = 0;
+ kept_frame = 0;
+ switch (mode)
+ {
+ case 0:
+ if (m - (frame_cnt-1)%m <= n)
+ {
+ frame_sz = 0;
+ }
+ break;
+ case 1:
+ if (frame_cnt >= n && frame_cnt <= m)
+ {
+ frame_sz = 0;
+ }
+ break;
+ case 2:
+ throw_packets(frame, &frame_sz, n, &thrown_frame, &kept_frame);
+ break;
+ default: break;
+ }
+ if (mode < 2)
+ {
+ if (frame_sz == 0)
+ {
+ putc('X', stdout);
+ thrown_frame++;
+ }
+ else
+ {
+ putc('.', stdout);
+ kept_frame++;
+ }
+ }
+ thrown += thrown_frame;
+ kept += kept_frame;
+ fflush(stdout);
+ /* Decode the frame */
+ if(vpx_codec_decode(&codec, frame, frame_sz, NULL, 0))
+ die_codec(&codec, "Failed to decode frame");
+
+ /* Write decoded data to disk */
+ while((img = vpx_codec_get_frame(&codec, &iter))) {
+ unsigned int plane, y;
+
+ for(plane=0; plane < 3; plane++) {
+ unsigned char *buf =img->planes[plane];
+
+ for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
+ (void) fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
+ outfile);
+ buf += img->stride[plane];
+ }
+ }
+ }
+ }
+ printf("Processed %d frames.\n",frame_cnt);
+ if(vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec");
+
+ fclose(outfile);
+ fclose(infile);
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/decode_with_partial_drops.txt b/libvpx/examples/decode_with_partial_drops.txt
deleted file mode 100644
index 7b0d3d2..0000000
--- a/libvpx/examples/decode_with_partial_drops.txt
+++ /dev/null
@@ -1,238 +0,0 @@
-@TEMPLATE decoder_tmpl.c
-Decode With Partial Drops Example
-=========================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example utility which drops a series of frames (or parts of frames),
-as specified on the command line. This is useful for observing the error
-recovery features of the codec.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_INCLUDES
-#include <time.h>
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_INCLUDES
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELPERS
-struct parsed_header
-{
- char key_frame;
- int version;
- char show_frame;
- int first_part_size;
-};
-
-int next_packet(struct parsed_header* hdr, int pos, int length, int mtu)
-{
- int size = 0;
- int remaining = length - pos;
- /* Uncompressed part is 3 bytes for P frames and 10 bytes for I frames */
- int uncomp_part_size = (hdr->key_frame ? 10 : 3);
- /* number of bytes yet to send from header and the first partition */
- int remainFirst = uncomp_part_size + hdr->first_part_size - pos;
- if (remainFirst > 0)
- {
- if (remainFirst <= mtu)
- {
- size = remainFirst;
- }
- else
- {
- size = mtu;
- }
-
- return size;
- }
-
- /* second partition; just slot it up according to MTU */
- if (remaining <= mtu)
- {
- size = remaining;
- return size;
- }
- return mtu;
-}
-
-void throw_packets(unsigned char* frame, int* size, int loss_rate,
- int* thrown, int* kept)
-{
- unsigned char loss_frame[256*1024];
- int pkg_size = 1;
- int pos = 0;
- int loss_pos = 0;
- struct parsed_header hdr;
- unsigned int tmp;
- int mtu = 1500;
-
- if (*size < 3)
- {
- return;
- }
- putc('|', stdout);
- /* parse uncompressed 3 bytes */
- tmp = (frame[2] << 16) | (frame[1] << 8) | frame[0];
- hdr.key_frame = !(tmp & 0x1); /* inverse logic */
- hdr.version = (tmp >> 1) & 0x7;
- hdr.show_frame = (tmp >> 4) & 0x1;
- hdr.first_part_size = (tmp >> 5) & 0x7FFFF;
-
- /* don't drop key frames */
- if (hdr.key_frame)
- {
- int i;
- *kept = *size/mtu + ((*size % mtu > 0) ? 1 : 0); /* approximate */
- for (i=0; i < *kept; i++)
- putc('.', stdout);
- return;
- }
-
- while ((pkg_size = next_packet(&hdr, pos, *size, mtu)) > 0)
- {
- int loss_event = ((rand() + 1.0)/(RAND_MAX + 1.0) < loss_rate/100.0);
- if (*thrown == 0 && !loss_event)
- {
- memcpy(loss_frame + loss_pos, frame + pos, pkg_size);
- loss_pos += pkg_size;
- (*kept)++;
- putc('.', stdout);
- }
- else
- {
- (*thrown)++;
- putc('X', stdout);
- }
- pos += pkg_size;
- }
- memcpy(frame, loss_frame, loss_pos);
- memset(frame + loss_pos, 0, *size - loss_pos);
- *size = loss_pos;
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HELPERS
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-/* Initialize codec */
-flags = VPX_CODEC_USE_ERROR_CONCEALMENT;
-res = vpx_codec_dec_init(&codec, interface, &dec_cfg, flags);
-if(res)
- die_codec(&codec, "Failed to initialize decoder");
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-
-Usage
------
-This example adds a single argument to the `simple_decoder` example,
-which specifies the range or pattern of frames to drop. The parameter is
-parsed as follows:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-if(argc < 4 || argc > 6)
- die("Usage: %s <infile> <outfile> [-t <num threads>] <N-M|N/M|L,S>\n",
- argv[0]);
-{
- char *nptr;
- int arg_num = 3;
- if (argc == 6 && strncmp(argv[arg_num++], "-t", 2) == 0)
- dec_cfg.threads = strtol(argv[arg_num++], NULL, 0);
- n = strtol(argv[arg_num], &nptr, 0);
- mode = (*nptr == '\0' || *nptr == ',') ? 2 : (*nptr == '-') ? 1 : 0;
-
- m = strtol(nptr+1, NULL, 0);
- if((!n && !m) || (*nptr != '-' && *nptr != '/' &&
- *nptr != '\0' && *nptr != ','))
- die("Couldn't parse pattern %s\n", argv[3]);
-}
-seed = (m > 0) ? m : (unsigned int)time(NULL);
-srand(seed);thrown_frame = 0;
-printf("Seed: %u\n", seed);
-printf("Threads: %d\n", dec_cfg.threads);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-
-
-Dropping A Range Of Frames
---------------------------
-To drop a range of frames, specify the starting frame and the ending
-frame to drop, separated by a dash. The following command will drop
-frames 5 through 10 (base 1).
-
- $ ./decode_with_partial_drops in.ivf out.i420 5-10
-
-
-Dropping A Pattern Of Frames
-----------------------------
-To drop a pattern of frames, specify the number of frames to drop and
-the number of frames after which to repeat the pattern, separated by
-a forward-slash. The following command will drop 3 of 7 frames.
-Specifically, it will decode 4 frames, then drop 3 frames, and then
-repeat.
-
- $ ./decode_with_partial_drops in.ivf out.i420 3/7
-
-Dropping Random Parts Of Frames
--------------------------------
-A third argument tuple is available to split the frame into 1500 bytes pieces
-and randomly drop pieces rather than frames. The frame will be split at
-partition boundaries where possible. The following example will seed the RNG
-with the seed 123 and drop approximately 5% of the pieces. Pieces which
-are depending on an already dropped piece will also be dropped.
-
- $ ./decode_with_partial_drops in.ivf out.i420 5,123
-
-
-Extra Variables
----------------
-This example maintains the pattern passed on the command line in the
-`n`, `m`, and `is_range` variables:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_VARS
-int n, m, mode;
-unsigned int seed;
-int thrown=0, kept=0;
-int thrown_frame=0, kept_frame=0;
-vpx_codec_dec_cfg_t dec_cfg = {0};
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EXTRA_VARS
-
-
-Making The Drop Decision
-------------------------
-The example decides whether to drop the frame based on the current
-frame number, immediately before decoding the frame.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
-/* Decide whether to throw parts of the frame or the whole frame
- depending on the drop mode */
-thrown_frame = 0;
-kept_frame = 0;
-switch (mode)
-{
-case 0:
- if (m - (frame_cnt-1)%m <= n)
- {
- frame_sz = 0;
- }
- break;
-case 1:
- if (frame_cnt >= n && frame_cnt <= m)
- {
- frame_sz = 0;
- }
- break;
-case 2:
- throw_packets(frame, &frame_sz, n, &thrown_frame, &kept_frame);
- break;
-default: break;
-}
-if (mode < 2)
-{
- if (frame_sz == 0)
- {
- putc('X', stdout);
- thrown_frame++;
- }
- else
- {
- putc('.', stdout);
- kept_frame++;
- }
-}
-thrown += thrown_frame;
-kept += kept_frame;
-fflush(stdout);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
diff --git a/libvpx/examples/decoder_tmpl.c b/libvpx/examples/decoder_tmpl.c
deleted file mode 100644
index 3e55352..0000000
--- a/libvpx/examples/decoder_tmpl.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-/*
-@*INTRODUCTION
- */
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define VPX_CODEC_DISABLE_COMPAT 1
-#include "./vpx_config.h"
-#include "vpx/vp8dx.h"
-#include "vpx/vpx_decoder.h"
-#define interface (vpx_codec_vp8_dx())
-@EXTRA_INCLUDES
-
-
-#define IVF_FILE_HDR_SZ (32)
-#define IVF_FRAME_HDR_SZ (12)
-
-static unsigned int mem_get_le32(const unsigned char *mem) {
- return (mem[3] << 24)|(mem[2] << 16)|(mem[1] << 8)|(mem[0]);
-}
-
-static void die(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- vprintf(fmt, ap);
- if(fmt[strlen(fmt)-1] != '\n')
- printf("\n");
- exit(EXIT_FAILURE);
-}
-
-@DIE_CODEC
-
-@HELPERS
-
-int main(int argc, char **argv) {
- FILE *infile, *outfile;
- vpx_codec_ctx_t codec;
- int flags = 0, frame_cnt = 0;
- unsigned char file_hdr[IVF_FILE_HDR_SZ];
- unsigned char frame_hdr[IVF_FRAME_HDR_SZ];
- unsigned char frame[256*1024];
- vpx_codec_err_t res;
-@@@@EXTRA_VARS
-
- (void)res;
- /* Open files */
-@@@@USAGE
- if(!(infile = fopen(argv[1], "rb")))
- die("Failed to open %s for reading", argv[1]);
- if(!(outfile = fopen(argv[2], "wb")))
- die("Failed to open %s for writing", argv[2]);
-
- /* Read file header */
- if(!(fread(file_hdr, 1, IVF_FILE_HDR_SZ, infile) == IVF_FILE_HDR_SZ
- && file_hdr[0]=='D' && file_hdr[1]=='K' && file_hdr[2]=='I'
- && file_hdr[3]=='F'))
- die("%s is not an IVF file.", argv[1]);
-
- printf("Using %s\n",vpx_codec_iface_name(interface));
-@@@@DEC_INIT
-
- /* Read each frame */
- while(fread(frame_hdr, 1, IVF_FRAME_HDR_SZ, infile) == IVF_FRAME_HDR_SZ) {
- int frame_sz = mem_get_le32(frame_hdr);
- vpx_codec_iter_t iter = NULL;
- vpx_image_t *img;
-
-
- frame_cnt++;
- if(frame_sz > sizeof(frame))
- die("Frame %d data too big for example code buffer", frame_sz);
- if(fread(frame, 1, frame_sz, infile) != frame_sz)
- die("Frame %d failed to read complete frame", frame_cnt);
-
-@@@@@@@@PRE_DECODE
-@@@@@@@@DECODE
-
- /* Write decoded data to disk */
-@@@@@@@@GET_FRAME
- unsigned int plane, y;
-
-@@@@@@@@@@@@PROCESS_DX
- }
- }
- printf("Processed %d frames.\n",frame_cnt);
-@@@@DESTROY
-
- fclose(outfile);
- fclose(infile);
- return EXIT_SUCCESS;
-}
diff --git a/libvpx/examples/decoder_tmpl.txt b/libvpx/examples/decoder_tmpl.txt
deleted file mode 100644
index 3d230a5..0000000
--- a/libvpx/examples/decoder_tmpl.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INCLUDES
-#define VPX_CODEC_DISABLE_COMPAT 1
-#include "vpx/vpx_decoder.h"
-#include "vpx/vp9dx.h"
-#define interface (vpx_codec_vp8_dx())
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INCLUDES
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
-static void die_codec(vpx_codec_ctx_t *ctx, const char *s) {
- const char *detail = vpx_codec_error_detail(ctx);
-
- printf("%s: %s\n", s, vpx_codec_error(ctx));
- if(detail)
- printf(" %s\n",detail);
- exit(EXIT_FAILURE);
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-if(argc!=3)
- die("Usage: %s <infile> <outfile>\n", argv[0]);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-/* Initialize codec */
-if(vpx_codec_dec_init(&codec, interface, NULL, flags))
- die_codec(&codec, "Failed to initialize decoder");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE
-/* Decode the frame */
-if(vpx_codec_decode(&codec, frame, frame_sz, NULL, 0))
- die_codec(&codec, "Failed to decode frame");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET_FRAME
-while((img = vpx_codec_get_frame(&codec, &iter))) {
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET_FRAME
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_DX
-for(plane=0; plane < 3; plane++) {
- unsigned char *buf =img->planes[plane];
-
- for(y=0; y < (plane ? (img->d_h + 1) >> 1 : img->d_h); y++) {
- (void) fwrite(buf, 1, (plane ? (img->d_w + 1) >> 1 : img->d_w),
- outfile);
- buf += img->stride[plane];
- }
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_DX
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-if(vpx_codec_destroy(&codec))
- die_codec(&codec, "Failed to destroy codec");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
diff --git a/libvpx/examples/encoder_tmpl.c b/libvpx/examples/encoder_tmpl.c
deleted file mode 100644
index e2b65ec..0000000
--- a/libvpx/examples/encoder_tmpl.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-/*
-@*INTRODUCTION
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#define VPX_CODEC_DISABLE_COMPAT 1
-#include "vpx/vpx_encoder.h"
-#include "vpx/vp8cx.h"
-#define interface (vpx_codec_vp8_cx())
-#define fourcc 0x30385056
-@EXTRA_INCLUDES
-
-#define IVF_FILE_HDR_SZ (32)
-#define IVF_FRAME_HDR_SZ (12)
-
-static void mem_put_le16(char *mem, unsigned int val) {
- mem[0] = val;
- mem[1] = val>>8;
-}
-
-static void mem_put_le32(char *mem, unsigned int val) {
- mem[0] = val;
- mem[1] = val>>8;
- mem[2] = val>>16;
- mem[3] = val>>24;
-}
-
-static void die(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- vprintf(fmt, ap);
- if(fmt[strlen(fmt)-1] != '\n')
- printf("\n");
- exit(EXIT_FAILURE);
-}
-
-@DIE_CODEC
-
-static int read_frame(FILE *f, vpx_image_t *img) {
- size_t nbytes, to_read;
- int res = 1;
-
- to_read = img->w*img->h*3/2;
- nbytes = fread(img->planes[0], 1, to_read, f);
- if(nbytes != to_read) {
- res = 0;
- if(nbytes > 0)
- printf("Warning: Read partial frame. Check your width & height!\n");
- }
- return res;
-}
-
-static void write_ivf_file_header(FILE *outfile,
- const vpx_codec_enc_cfg_t *cfg,
- int frame_cnt) {
- char header[32];
-
- if(cfg->g_pass != VPX_RC_ONE_PASS && cfg->g_pass != VPX_RC_LAST_PASS)
- return;
- header[0] = 'D';
- header[1] = 'K';
- header[2] = 'I';
- header[3] = 'F';
- mem_put_le16(header+4, 0); /* version */
- mem_put_le16(header+6, 32); /* headersize */
- mem_put_le32(header+8, fourcc); /* headersize */
- mem_put_le16(header+12, cfg->g_w); /* width */
- mem_put_le16(header+14, cfg->g_h); /* height */
- mem_put_le32(header+16, cfg->g_timebase.den); /* rate */
- mem_put_le32(header+20, cfg->g_timebase.num); /* scale */
- mem_put_le32(header+24, frame_cnt); /* length */
- mem_put_le32(header+28, 0); /* unused */
-
- (void) fwrite(header, 1, 32, outfile);
-}
-
-
-static void write_ivf_frame_header(FILE *outfile,
- const vpx_codec_cx_pkt_t *pkt)
-{
- char header[12];
- vpx_codec_pts_t pts;
-
- if(pkt->kind != VPX_CODEC_CX_FRAME_PKT)
- return;
-
- pts = pkt->data.frame.pts;
- mem_put_le32(header, pkt->data.frame.sz);
- mem_put_le32(header+4, pts&0xFFFFFFFF);
- mem_put_le32(header+8, pts >> 32);
-
- (void) fwrite(header, 1, 12, outfile);
-}
-
-int main(int argc, char **argv) {
- FILE *infile, *outfile;
- vpx_codec_ctx_t codec;
- vpx_codec_enc_cfg_t cfg;
- int frame_cnt = 0;
- vpx_image_t raw;
- vpx_codec_err_t res;
- long width;
- long height;
- int frame_avail;
- int got_data;
- int flags = 0;
-@@@@TWOPASS_VARS
-
- /* Open files */
-@@@@USAGE
- width = strtol(argv[1], NULL, 0);
- height = strtol(argv[2], NULL, 0);
- if(width < 16 || width%2 || height <16 || height%2)
- die("Invalid resolution: %ldx%ld", width, height);
- if(!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, width, height, 1))
- die("Faile to allocate image", width, height);
- if(!(outfile = fopen(argv[4], "wb")))
- die("Failed to open %s for writing", argv[4]);
-
- printf("Using %s\n",vpx_codec_iface_name(interface));
-
-@@@@ENC_DEF_CFG
-
-@@@@ENC_SET_CFG
-@@@@ENC_SET_CFG2
-
- write_ivf_file_header(outfile, &cfg, 0);
-
-@@@@TWOPASS_LOOP_BEGIN
-
- /* Open input file for this encoding pass */
- if(!(infile = fopen(argv[3], "rb")))
- die("Failed to open %s for reading", argv[3]);
-
-@@@@@@@@ENC_INIT
-
- frame_avail = 1;
- got_data = 0;
- while(frame_avail || got_data) {
- vpx_codec_iter_t iter = NULL;
- const vpx_codec_cx_pkt_t *pkt;
-
-@@@@@@@@@@@@PER_FRAME_CFG
-@@@@@@@@@@@@ENCODE_FRAME
- got_data = 0;
- while( (pkt = vpx_codec_get_cx_data(&codec, &iter)) ) {
- got_data = 1;
- switch(pkt->kind) {
-@@@@@@@@@@@@@@@@PROCESS_FRAME
-@@@@@@@@@@@@@@@@PROCESS_STATS
- default:
- break;
- }
- printf(pkt->kind == VPX_CODEC_CX_FRAME_PKT
- && (pkt->data.frame.flags & VPX_FRAME_IS_KEY)? "K":".");
- fflush(stdout);
- }
- frame_cnt++;
- }
- printf("\n");
- fclose(infile);
-@@@@TWOPASS_LOOP_END
-
- printf("Processed %d frames.\n",frame_cnt-1);
-@@@@DESTROY
-
- /* Try to rewrite the file header with the actual frame count */
- if(!fseek(outfile, 0, SEEK_SET))
- write_ivf_file_header(outfile, &cfg, frame_cnt-1);
- fclose(outfile);
- return EXIT_SUCCESS;
-}
diff --git a/libvpx/examples/encoder_tmpl.txt b/libvpx/examples/encoder_tmpl.txt
deleted file mode 100644
index 9f8f4af..0000000
--- a/libvpx/examples/encoder_tmpl.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INCLUDES
-#define VPX_CODEC_DISABLE_COMPAT 1
-#include "vpx/vpx_encoder.h"
-#include "vpx/vp9cx.h"
-#define interface (vpx_codec_vp8_cx())
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INCLUDES
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
-static void die_codec(vpx_codec_ctx_t *ctx, const char *s) {
- const char *detail = vpx_codec_error_detail(ctx);
-
- printf("%s: %s\n", s, vpx_codec_error(ctx));
- if(detail)
- printf(" %s\n",detail);
- exit(EXIT_FAILURE);
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-if(argc!=5)
- die("Usage: %s <width> <height> <infile> <outfile>\n", argv[0]);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_DEF_CFG
-/* Populate encoder configuration */
-res = vpx_codec_enc_config_default(interface, &cfg, 0);
-if(res) {
- printf("Failed to get config: %s\n", vpx_codec_err_to_string(res));
- return EXIT_FAILURE;
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_DEF_CFG
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_SET_CFG
-/* Update the default configuration with our settings */
-cfg.rc_target_bitrate = width * height * cfg.rc_target_bitrate
- / cfg.g_w / cfg.g_h;
-cfg.g_w = width;
-cfg.g_h = height;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_SET_CFG
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INIT
-/* Initialize codec */
-if(vpx_codec_enc_init(&codec, interface, &cfg, 0))
- die_codec(&codec, "Failed to initialize encoder");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INIT
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-frame_avail = read_frame(infile, &raw);
-if(vpx_codec_encode(&codec, frame_avail? &raw : NULL, frame_cnt,
- 1, flags, VPX_DL_REALTIME))
- die_codec(&codec, "Failed to encode frame");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
-case VPX_CODEC_CX_FRAME_PKT:
- write_ivf_frame_header(outfile, pkt);
- (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
- outfile);
- break;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
-
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-vpx_img_free(&raw);
-if(vpx_codec_destroy(&codec))
- die_codec(&codec, "Failed to destroy codec");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
diff --git a/libvpx/examples/error_resilient.txt b/libvpx/examples/error_resilient.txt
deleted file mode 100644
index e9d0949..0000000
--- a/libvpx/examples/error_resilient.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-@TEMPLATE encoder_tmpl.c
-Error Resiliency Features
-=========================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example demonstrating how to enable the error resiliency
-features of the codec.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Configuration
--------------
-Error resiliency is controlled by the g_error_resilient member of the
-configuration structure.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_SET_CFG2
-
-/* Enable error resilient mode */
-cfg.g_error_resilient = 1;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_SET_CFG2
-
-
-Observing The Effects
----------------------
-Use the `decode_with_drops` example to decode with frames 5-10 dropped.
-Compare the output for a file encoded with this example versus one
-encoded with the `simple_encoder` example.
diff --git a/libvpx/example_xma.c b/libvpx/examples/example_xma.c
index 7aa8798..c960c28 100644
--- a/libvpx/example_xma.c
+++ b/libvpx/examples/example_xma.c
@@ -27,7 +27,7 @@ static int verbose = 0;
static const struct {
const char *name;
- const vpx_codec_iface_t *iface;
+ vpx_codec_iface_t *iface;
} ifaces[] = {
#if CONFIG_VP9_DECODER
{"vp9", &vpx_codec_vp8_dx_algo},
@@ -142,7 +142,8 @@ int main(int argc, char **argv) {
/* Initialize the decoder in XMA mode. */
if (vpx_codec_dec_init(&decoder, iface, &cfg, VPX_CODEC_USE_XMA)) {
- printf("Failed to initialize decoder in XMA mode: %s\n", vpx_codec_error(&decoder));
+ printf("Failed to initialize decoder in XMA mode: %s\n",
+ vpx_codec_error(&decoder));
return EXIT_FAILURE;
}
@@ -169,7 +170,8 @@ int main(int argc, char **argv) {
else
mmap.priv = malloc(mmap.sz + align);
- mmap.base = (void *)((((uintptr_t)mmap.priv) + align) & ~(uintptr_t)align);
+ mmap.base = (void *)((((uintptr_t)mmap.priv) + align) &
+ ~(uintptr_t)align);
mmap.dtor = my_mem_dtor;
alloc_sz += mmap.sz + align;
diff --git a/libvpx/examples/force_keyframe.txt b/libvpx/examples/force_keyframe.txt
deleted file mode 100644
index a9c16be..0000000
--- a/libvpx/examples/force_keyframe.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-@TEMPLATE encoder_tmpl.c
-Forcing A Keyframe
-==================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example demonstrating how to control placement of keyframes
-on a frame-by-frame basis.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Configuration
--------------
-Keyframes can be forced by setting the VPX_EFLAG_FORCE_KF bit of the
-flags passed to `vpx_codec_control()`. In this example, we force a
-keyframe every 8 frames.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PER_FRAME_CFG
-if(!(frame_cnt & 7))
- flags |= VPX_EFLAG_FORCE_KF;
-else
- flags &= ~VPX_EFLAG_FORCE_KF;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PER_FRAME_CFG
-
-
-Observing The Effects
----------------------
-The output of the encoder examples shows a 'K' rather than a dot '.'
-when the encoder generates a keyframe. Note that every 8 frames a 'K'
-is output.
diff --git a/libvpx/examples/gen_example_code.sh b/libvpx/examples/gen_example_code.sh
deleted file mode 100755
index 1133b49..0000000
--- a/libvpx/examples/gen_example_code.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-##
-## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-## Use of this source code is governed by a BSD-style license
-## that can be found in the LICENSE file in the root of the source
-## tree. An additional intellectual property rights grant can be found
-## in the file PATENTS. All contributing project authors may
-## be found in the AUTHORS file in the root of the source tree.
-##
-
-
-# gen_example_code.sh
-
-self=$0
-
-die_usage() {
- echo "Usage: $self <example.txt>"
- exit 1
-}
-
-die() {
- echo "$@"
- exit 1
-}
-
-include_block() {
- show_bar=$1
- block_name=${line##*@}
- indent=${line%%${block_name}}
- indent=${#indent}
- [ $indent -eq 1 ] && indent=0
- local on_block
- while IFS=$'\n' read -r t_line; do
- case "$t_line" in
- \~*\ ${block_name})
- if [ "x$on_block" == "xyes" ]; then
- return 0;
- else
- on_block=yes
- fi
- ;;
- @DEFAULT)
- if [ "x$on_block" == "xyes" ]; then
- include_block $show_bar < "${template%.c}.txt"
- return 0
- fi
- ;;
- *)
- if [ "x$on_block" == "xyes" ]; then
- local rem
- (( rem = 78 - indent ))
- case "$block_name" in
- \**) printf "%${indent}s * %s\n" "" "$t_line" ;;
- *)
- if [ "$show_bar" == "yes" ]; then
- printf "%${indent}s%-${rem}s//\n" "" "$t_line"
- else
- printf "%${indent}s%s\n" "" "$t_line"
- fi
- ;;
- esac
- fi
- esac
- done
- return 1
-}
-
-txt=$1
-[ -f "$txt" ] || die_usage
-read -r template < "$txt"
-case "$template" in
- @TEMPLATE*) template=${txt%/*}/${template##@TEMPLATE } ;;
- *) die "Failed to parse template name from '$template'" ;;
-esac
-
-while IFS=$'\n' read -r line; do
- case "$line" in
- @*) include_block yes < "$txt" \
- || include_block < "${template%.c}.txt" \
- #|| echo "WARNING: failed to find text for block $block_name" >&2
- ;;
- *) echo "$line" ;;
- esac
-done < "$template"
diff --git a/libvpx/examples/gen_example_doxy.php b/libvpx/examples/gen_example_doxy.php
deleted file mode 100755
index 701bbd3..0000000
--- a/libvpx/examples/gen_example_doxy.php
+++ /dev/null
@@ -1,224 +0,0 @@
-#!/usr/bin/env php
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-<?php
-
-/* This script converts markdown to doxygen htmlonly syntax, nesting the
- * content inside a \page. It expects input on stdin and outputs on stdout.
- *
- * Usage: gen_example_doxy.php <page_identifier> "<page description>"
- */
-
-
-$geshi_path = dirname($argv[0])."/includes/geshi/geshi/"; // Language files
-$tmp_token = '<!-- I wanna rock you, Chaka Khan -->';
-
-// Include prerequisites or exit
-if(!include_once('includes/PHP-Markdown-Extra-1.2.3/markdown.php'))
- die("Cannot load Markdown transformer.\n");
-if(!include_once('includes/PHP-SmartyPants-1.5.1e/smartypants.php'))
- die("Cannot load SmartyPants transformer.\n");
-if(!include_once('includes/geshi/geshi.php'))
- die("Cannot load GeSHi transformer.\n");
-// ASCIIMathPHP?
-// HTML::Toc?
-// Tidy?
-// Prince?
-
-/**
- * Generate XHTML body
- *
- */
-
-$page_body = file_get_contents('php://stdin');
-
-// Transform any MathML expressions in the body text
-$regexp = '/\[\[(.*?)\]\]/'; // Double square bracket delimiters
-$page_body = preg_replace_callback($regexp, 'ASCIIMathPHPCallback', $page_body);
-
-// Fix ASCIIMathPHP's output
-$page_body = fix_asciiMath($page_body);
-
-// Wrap block-style <math> elements in <p>, since Markdown doesn't.
-$page_body = preg_replace('/\n(<math.*<\/math>)\n/', '<p class="eq_para">$1</p>', $page_body);
-
-// Transform the body text to HTML
-$page_body = Markdown($page_body);
-
-// Preprocess code blocks
-// Decode XML entities. GeSHi doesn't anticipate that
-// Markdown has already done this.
-$regexp = '|<pre><code>(.*?)<\/code><\/pre>|si';
-while (preg_match($regexp, $page_body, $matches) > 0)
-{
- // Replace 1st match with token
- $page_body = preg_replace($regexp, $tmp_token, $page_body, 1);
- $block_new = $matches[1];
- // Un-encode ampersand entities
- $block_new = decode_markdown($block_new);
- // Replace token with revised string
- $page_body = preg_replace("|$tmp_token|", '<div class="codeblock">'.$block_new.'</div>', $page_body);
-}
-
-// Run GeSHi over code blocks
-$regexp = '|<div class="codeblock">(.*?)<\/div>|si';
-$language = 'c';
-
-while (preg_match($regexp, $page_body, $matches))
-{
- $geshi = new GeSHi($matches[1], $language);
- $geshi->set_language_path($geshi_path);
- $block_new = $geshi->parse_code();
- // Strip annoying final newline
- $block_new = preg_replace('|\n&nbsp;<\/pre>|', '</pre>' , $block_new);
- // Remove style attribute (TODO: Research this in GeSHi)
- $block_new = preg_replace('| style="font-family:monospace;"|', '' , $block_new);
- $page_body = preg_replace($regexp, $block_new, $page_body, 1);
- unset($geshi); // Clean up
-}
-unset($block_new); // Clean up
-
-// Apply typographic flourishes
-$page_body = SmartyPants($page_body);
-
-
-/**
- * Generate Doxygen Body
- *
- */
-$page_id=(isset($argv[1]))?$argv[1]:"";
-$page_desc=(isset($argv[2]))?$argv[2]:"";
-print "/*!\\page ".$page_id." ".$page_desc."\n\\htmlonly\n";
-print $page_body;
-print "\\endhtmlonly\n*/\n";
-
-// ---------------------------------------------------------
-
-/**
- * decode_markdown()
- *
- * Markdown encodes '&', '<' and '>' in detected code
- * blocks, as a convenience. This will restore the
- * encoded entities to ordinary characters, since a
- * downstream transformer (like GeSHi) may not
- * anticipate this.
- *
- **********************************************************/
-
-function decode_markdown($input)
-{
- $out = FALSE;
-
- $entities = array ('|&amp;|'
- ,'|&lt;|'
- ,'|&gt;|'
- );
- $characters = array ('&'
- ,'<'
- ,'>'
- );
- $input = preg_replace($entities, $characters, $input);
- $out = $input;
-
- return $out;
-}
-
-
-/**
- * ASCIIMathML parser
- * http://tinyurl.com/ASCIIMathPHP
- *
- * @PARAM mtch_arr array - Array of ASCIIMath expressions
- * as returned by preg_replace_callback([pattern]). First
- * dimension is the full matched string (with delimiter);
- * 2nd dimension is the undelimited contents (typically
- * a capture group).
- *
- **********************************************************/
-
-function ASCIIMathPHPCallback($mtch_arr)
-{
- $txt = trim($mtch_arr[1]);
-
- include('includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.cfg.php');
- require_once('includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.class.php');
-
- static $asciimath;
-
- if (!isset($asciimath)) $asciimath = new ASCIIMathPHP($symbol_arr);
-
- $math_attr_arr = array('displaystyle' => 'true');
-
- $asciimath->setExpr($txt);
- $asciimath->genMathML($math_attr_arr);
-
- return($asciimath->getMathML());
-}
-
-/**
- * fix_asciiMath()
- *
- * ASCIIMath pretty-prints its output, with linefeeds
- * and tabs. Causes unexpected behavior in some renderers.
- * This flattens <math> blocks.
- *
- * @PARAM page_body str - The <body> element of an
- * XHTML page to transform.
- *
- **********************************************************/
-
-function fix_asciiMath($page_body)
-{
- $out = FALSE;
-
- // Remove linefeeds and whitespace in <math> elements
- $tags_bad = array('/(<math.*?>)\n*\s*/'
- , '/(<mstyle.*?>)\n*\s*/'
- , '/(<\/mstyle>)\n*\s*/'
- , '/(<mrow.*?>)\n*\s*/'
- , '/(<\/mrow>)\n*\s*/'
- , '/(<mo.*?>)\n*\s*/'
- , '/(<\/mo>)\n*\s*/'
- , '/(<mi.*?>)\n*\s*/'
- , '/(<\/mi>)\n*\s*/'
- , '/(<mn.*?>)\n*\s*/'
- , '/(<\/mn>)\n*\s*/'
- , '/(<mtext.*?>)\n*\s*/'
- , '/(<\/mtext>)\n*\s*/'
- , '/(<msqrt.*?>)\n*\s*/'
- , '/(<\/msqrt>)\n*\s*/'
- , '/(<mfrac.*?>)\n*\s*/'
- , '/(<\/mfrac>)\n*\s*/'
- );
- $tags_good = array( '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- );
- $out = preg_replace($tags_bad, $tags_good, $page_body);
-
- return $out;
-
-}
diff --git a/libvpx/examples/gen_example_text.sh b/libvpx/examples/gen_example_text.sh
deleted file mode 100755
index 9a8703d..0000000
--- a/libvpx/examples/gen_example_text.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-##
-## Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-##
-## Use of this source code is governed by a BSD-style license
-## that can be found in the LICENSE file in the root of the source
-## tree. An additional intellectual property rights grant can be found
-## in the file PATENTS. All contributing project authors may
-## be found in the AUTHORS file in the root of the source tree.
-##
-
-
-# gen_example_text.sh
-
-self=$0
-
-die_usage() {
- echo "Usage: $self <example.txt>"
- exit 1
-}
-
-die() {
- echo "$@"
- exit 1
-}
-
-include_block() {
- local on_block
- while IFS=$'\n' read -r t_line; do
- case "$t_line" in
- \~*\ ${block_name})
- if [ "x$on_block" == "xyes" ]; then
- return 0;
- else
- on_block=yes
- fi
- ;;
- *)
- if [ "x$on_block" == "xyes" ]; then
- echo "$t_line"
- fi
- ;;
- esac
- done
- echo "WARNING: failed to find text for block $block_name" >&2
- return 1
-}
-
-txt=$1
-[ -f "$txt" ] || die_usage
-read -r template < "$txt"
-case "$template" in
- @TEMPLATE*) template=${txt%/*}/${template##@TEMPLATE } ;;
- *) die "Failed to parse template name from '$template'" ;;
-esac
-
-fence="~~~~~~~~~"
-fence="${fence}${fence}"
-fence="${fence}${fence}"
-fence="${fence}${fence}"
-while IFS=$'\n' read -r line; do
- case "$line" in
- @TEMPLATE*)
- template=${template##@TEMPLATE }
- template=${template%.c}.txt
- ;;
- @DEFAULT)
- include_block < "$template"
- ;;
- ~~~*)
- block_name=${line##~* }
- [ "$block_name" == "INTRODUCTION" ] || echo "$fence"
- ;;
- *) echo "$line"
- ;;
- esac
-done < "$txt"
-
-echo
-echo "Putting It All Together"
-echo "======================="
-echo "${fence}"
-${self%/*}/gen_example_code.sh "${txt}"
-echo "${fence}"
diff --git a/libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.cfg.php b/libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.cfg.php
deleted file mode 100644
index 06f7979..0000000
--- a/libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.cfg.php
+++ /dev/null
@@ -1,218 +0,0 @@
-<?php
-
-$symbol_arr = array(
-
-// Greek symbols
-'alpha' => array( 'input'=>'alpha','tag'=>'mi', 'output'=>'&#' . hexdec('03B1') . ';'),
-'beta' => array( 'input'=>'beta','tag'=>'mi', 'output'=>'&#' . hexdec('03B2') . ';'),
-'chi' => array( 'input'=>'chi','tag'=>'mi', 'output'=>'&#' . hexdec('03C7') . ';'),
-'delta' => array( 'input'=>'delta','tag'=>'mi', 'output'=>'&#' . hexdec('03B4') . ';'),
-'Delta' => array( 'input'=>'Delta','tag'=>'mo', 'output'=>'&#' . hexdec('0394') . ';'),
-'epsi' => array( 'input'=>'epsi','tag'=>'mi', 'output'=>'&#' . hexdec('03B5') . ';'),
-'varepsilon' => array( 'input'=>'varepsilon','tag'=>'mi', 'output'=>'&#' . hexdec('025B') . ';'),
-'eta' => array( 'input'=>'eta','tag'=>'mi', 'output'=>'&#' . hexdec('03B7') . ';'),
-'gamma' => array( 'input'=>'gamma','tag'=>'mi', 'output'=>'&#' . hexdec('03B3') . ';'),
-'Gamma' => array( 'input'=>'Gamma','tag'=>'mi', 'output'=>'&#' . hexdec('0393') . ';'),
-'iota' => array( 'input'=>'iota','tag'=>'mi', 'output'=>'&#' . hexdec('03B9') . ';'),
-'kappa' => array( 'input'=>'kappa','tag'=>'mi', 'output'=>'&#' . hexdec('03BA') . ';'),
-'lambda' => array( 'input'=>'lambda','tag'=>'mi', 'output'=>'&#' . hexdec('03BB') . ';'),
-'Lambda' => array( 'input'=>'Lambda','tag'=>'mo', 'output'=>'&#' . hexdec('039B') . ';'),
-'mu' => array( 'input'=>'mu','tag'=>'mi', 'output'=>'&#' . hexdec('03BC') . ';'),
-'nu' => array( 'input'=>'nu','tag'=>'mi', 'output'=>'&#' . hexdec('03BD') . ';'),
-'omega' => array( 'input'=>'omega','tag'=>'mi', 'output'=>'&#' . hexdec('03C9') . ';'),
-'Omega' => array( 'input'=>'Omega','tag'=>'mo', 'output'=>'&#' . hexdec('03A9') . ';'),
-'phi' => array( 'input'=>'phi','tag'=>'mi', 'output'=>'&#' . hexdec('03C6') . ';'),
-'varphi' => array( 'input'=>'varphi','tag'=>'mi', 'output'=>'&#' . hexdec('03D5') . ';'),
-'Phi' => array( 'input'=>'Phi','tag'=>'mo', 'output'=>'&#' . hexdec('03A6') . ';'),
-'pi' => array( 'input'=>'pi','tag'=>'mi', 'output'=>'&#' . hexdec('03C0') . ';'),
-'Pi' => array( 'input'=>'Pi','tag'=>'mo', 'output'=>'&#' . hexdec('03A0') . ';'),
-'psi' => array( 'input'=>'psi','tag'=>'mi', 'output'=>'&#' . hexdec('03C8') . ';'),
-'rho' => array( 'input'=>'rho','tag'=>'mi', 'output'=>'&#' . hexdec('03C1') . ';'),
-'sigma' => array( 'input'=>'sigma','tag'=>'mi', 'output'=>'&#' . hexdec('03C3') . ';'),
-'Sigma' => array( 'input'=>'Sigma','tag'=>'mo', 'output'=>'&#' . hexdec('03A3') . ';'),
-'tau' => array( 'input'=>'tau','tag'=>'mi', 'output'=>'&#' . hexdec('03C4') . ';'),
-'theta' => array( 'input'=>'theta','tag'=>'mi', 'output'=>'&#' . hexdec('03B8') . ';'),
-'vartheta' => array( 'input'=>'vartheta','tag'=>'mi', 'output'=>'&#' . hexdec('03D1') . ';'),
-'Theta' => array( 'input'=>'Theta','tag'=>'mo', 'output'=>'&#' . hexdec('0398') . ';'),
-'upsilon' => array( 'input'=>'upsilon','tag'=>'mi', 'output'=>'&#' . hexdec('03C5') . ';'),
-'xi' => array( 'input'=>'xi','tag'=>'mi', 'output'=>'&#' . hexdec('03BE') . ';'),
-'Xi' => array( 'input'=>'alpha','tag'=>'mo', 'output'=>'&#' . hexdec('039E') . ';'),
-'zeta' => array( 'input'=>'zeta','tag'=>'mi', 'output'=>'&#' . hexdec('03B6') . ';'),
-
-// Binary operation symbols
-'*' => array( 'input'=>'*','tag'=>'mo', 'output'=>'&#' . hexdec('22C5') . ';'),
-'**' => array( 'input'=>'**','tag'=>'mo', 'output'=>'&#' . hexdec('22C6') . ';'),
-'//' => array( 'input'=>'//','tag'=>'mo', 'output'=>'/'),
-'\\\\' => array( 'input'=>'\\\\','tag'=>'mo', 'output'=>'\\'),
-'xx' => array( 'input'=>'xx','tag'=>'mo', 'output'=>'&#' . hexdec('00D7') . ';'),
-'-:' => array( 'input'=>'-:','tag'=>'mo', 'output'=>'&#' . hexdec('00F7') . ';'),
-'@' => array( 'input'=>'@','tag'=>'mo', 'output'=>'&#' . hexdec('2218') . ';'),
-'o+' => array( 'input'=>'o+','tag'=>'mo', 'output'=>'&#' . hexdec('2295') . ';'),
-'ox' => array( 'input'=>'ox','tag'=>'mo', 'output'=>'&#' . hexdec('2297') . ';'),
-'sum' => array( 'input'=>'sum','tag'=>'mo', 'output'=>'&#' . hexdec('2211') . ';', 'underover'=>TRUE),
-'prod' => array( 'input'=>'prod','tag'=>'mo', 'output'=>'&#' . hexdec('220F') . ';', 'underover'=>TRUE),
-'^^' => array( 'input'=>'^^','tag'=>'mo', 'output'=>'&#' . hexdec('2227') . ';'),
-'^^^' => array( 'input'=>'^^^','tag'=>'mo', 'output'=>'&#' . hexdec('22C0') . ';', 'underover'=>TRUE),
-'vv' => array( 'input'=>'vv','tag'=>'mo', 'output'=>'&#' . hexdec('2228') . ';'),
-'vvv' => array( 'input'=>'vvv','tag'=>'mo', 'output'=>'&#' . hexdec('22C1') . ';', 'underover'=>TRUE),
-'nn' => array( 'input'=>'nn','tag'=>'mo', 'output'=>'&#' . hexdec('2229') . ';'),
-'nnn' => array( 'input'=>'nnn','tag'=>'mo', 'output'=>'&#' . hexdec('22C5') . ';', 'underover'=>TRUE),
-'uu' => array( 'input'=>'uu','tag'=>'mo', 'output'=>'&#' . hexdec('222A') . ';'),
-'uuu' => array( 'input'=>'uuu','tag'=>'mo', 'output'=>'&#' . hexdec('22C3') . ';', 'underover'=>TRUE),
-
-// Binary relation symbols
-'!=' => array( 'input'=>'!=','tag'=>'mo', 'output'=>'&#' . hexdec('2260') . ';'),
-':=' => array( 'input'=>':=','tag'=>'mo', 'output'=>':=' ), /* 2005-06-05 wes */
-'<' => array( 'input'=>'<','tag'=>'mo', 'output'=>'&lt;'),
-'lt' => array( 'input'=>'lt','tag'=>'mo', 'output'=>'&lt;'), /* 2005-06-05 wes */
-'<=' => array( 'input'=>'<=','tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'),
-'lt=' => array( 'input'=>'lt=','tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'),
-'le' => array( 'input'=>'le','tag'=>'mo', 'output'=>'&#' . hexdec('2264') . ';'), /* 2005-06-05 wes */
-'>' => array( 'input'=>'>','tag'=>'mo', 'output'=>'&gt;'),
-'>=' => array( 'input'=>'>=','tag'=>'mo', 'output'=>'&#' . hexdec('2265') . ';'),
-'qeq' => array( 'input'=>'geq','tag'=>'mo', 'output'=>'&#' . hexdec('2265') . ';'),
-'-<' => array( 'input'=>'-<','tag'=>'mo', 'output'=>'&#' . hexdec('227A') . ';'),
-'-lt' => array( 'input'=>'-lt','tag'=>'mo', 'output'=>'&#' . hexdec('227A') . ';'),
-'>-' => array( 'input'=>'>-','tag'=>'mo', 'output'=>'&#' . hexdec('227B') . ';'),
-'in' => array( 'input'=>'in','tag'=>'mo', 'output'=>'&#' . hexdec('2208') . ';'),
-'!in' => array( 'input'=>'!in','tag'=>'mo', 'output'=>'&#' . hexdec('2209') . ';'),
-'sub' => array( 'input'=>'sub','tag'=>'mo', 'output'=>'&#' . hexdec('2282') . ';'),
-'sup' => array( 'input'=>'sup','tag'=>'mo', 'output'=>'&#' . hexdec('2283') . ';'),
-'sube' => array( 'input'=>'sube','tag'=>'mo', 'output'=>'&#' . hexdec('2286') . ';'),
-'supe' => array( 'input'=>'supe','tag'=>'mo', 'output'=>'&#' . hexdec('2287') . ';'),
-'-=' => array( 'input'=>'-=','tag'=>'mo', 'output'=>'&#' . hexdec('2261') . ';'),
-'~=' => array( 'input'=>'~=','tag'=>'mo', 'output'=>'&#' . hexdec('2245') . ';'),
-'~~' => array( 'input'=>'~~','tag'=>'mo', 'output'=>'&#' . hexdec('2248') . ';'),
-'prop' => array( 'input'=>'prop','tag'=>'mo', 'output'=>'&#' . hexdec('221D') . ';'),
-
-// Logical symbols
-'and' => array( 'input'=>'and','tag'=>'mtext', 'output'=>'and', 'space'=>'1ex'),
-'or' => array( 'input'=>'or','tag'=>'mtext', 'output'=>'or', 'space'=>'1ex'),
-'not' => array( 'input'=>'not','tag'=>'mo', 'output'=>'&#' . hexdec('00AC') . ';'),
-'=>' => array( 'input'=>'=>','tag'=>'mo', 'output'=>'&#' . hexdec('21D2') . ';'),
-'if' => array( 'input'=>'if','tag'=>'mo', 'output'=>'if', 'space'=>'1ex'),
-'iff' => array( 'input'=>'iff','tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'),
-'<=>' => array( 'input'=>'iff','tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'), /* 2005-06-07 wes */
-'AA' => array( 'input'=>'AA','tag'=>'mo', 'output'=>'&#' . hexdec('2200') . ';'),
-'EE' => array( 'input'=>'EE','tag'=>'mo', 'output'=>'&#' . hexdec('2203') . ';'),
-'_|_' => array( 'input'=>'_|_','tag'=>'mo', 'output'=>'&#' . hexdec('22A5') . ';'),
-'TT' => array( 'input'=>'TT','tag'=>'mo', 'output'=>'&#' . hexdec('22A4') . ';'),
-'|-' => array( 'input'=>'|-','tag'=>'mo', 'output'=>'&#' . hexdec('22A2') . ';'),
-'|=' => array( 'input'=>'|=','tag'=>'mo', 'output'=>'&#' . hexdec('22A8') . ';'),
-
-// Miscellaneous symbols
-'ang' => array('input'=>'ang','tag'=>'mo','output'=>'&#' . hexdec('2220') . ';'),
-'deg' => array('input'=>'deg','tag'=>'mo','output'=>'&#' . hexdec('00B0') . ';'),
-'int' => array( 'input'=>'int','tag'=>'mo', 'output'=>'&#' . hexdec('222B') . ';'),
-'dx' => array( 'input'=>'dx','tag'=>'mi', 'output'=>'{:d x:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'dy' => array( 'input'=>'dy','tag'=>'mi', 'output'=>'{:d y:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'dz' => array( 'input'=>'dz','tag'=>'mi', 'output'=>'{:d z:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'dt' => array( 'input'=>'dt','tag'=>'mi', 'output'=>'{:d t:}', 'definition'=>TRUE), /* 2005-06-11 wes */
-'oint' => array( 'input'=>'oint','tag'=>'mo', 'output'=>'&#' . hexdec('222E') . ';'),
-'del' => array( 'input'=>'del','tag'=>'mo', 'output'=>'&#' . hexdec('2202') . ';'),
-'grad' => array( 'input'=>'grad','tag'=>'mo', 'output'=>'&#' . hexdec('2207') . ';'),
-'+-' => array( 'input'=>'+-','tag'=>'mo', 'output'=>'&#' . hexdec('00B1') . ';'),
-'O/' => array( 'input'=>'0/','tag'=>'mo', 'output'=>'&#' . hexdec('2205') . ';'),
-'oo' => array( 'input'=>'oo','tag'=>'mo', 'output'=>'&#' . hexdec('221E') . ';'),
-'aleph' => array( 'input'=>'aleph','tag'=>'mo', 'output'=>'&#' . hexdec('2135') . ';'),
-'...' => array( 'input'=>'int','tag'=>'mo', 'output'=>'...'),
-'~' => array( 'input'=>'!~','tag'=>'mo', 'output'=>'&#' . hexdec('0020') . ';'),
-'\\ ' => array( 'input'=>'~','tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';'),
-'quad' => array( 'input'=>'quad','tag'=>'mo', 'output'=>'&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';'),
-'qquad' => array( 'input'=>'qquad','tag'=>'mo', 'output'=> '&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';&#' . hexdec('00A0') . ';'),
-'cdots' => array( 'input'=>'cdots','tag'=>'mo', 'output'=>'&#' . hexdec('22EF') . ';'),
-'vdots' => array( 'input'=>'vdots','tag'=>'mo', 'output'=>'&#' . hexdec('22EE') . ';'), /* 2005-06-11 wes */
-'ddots' => array( 'input'=>'ddots','tag'=>'mo', 'output'=>'&#' . hexdec('22F1') . ';'), /* 2005-06-11 wes */
-'diamond' => array( 'input'=>'diamond','tag'=>'mo', 'output'=>'&#' . hexdec('22C4') . ';'),
-'square' => array( 'input'=>'square','tag'=>'mo', 'output'=>'&#' . hexdec('25A1') . ';'),
-'|_' => array( 'input'=>'|_','tag'=>'mo', 'output'=>'&#' . hexdec('230A') . ';'),
-'_|' => array( 'input'=>'_|','tag'=>'mo', 'output'=>'&#' . hexdec('230B') . ';'),
-'|~' => array( 'input'=>'|~','tag'=>'mo', 'output'=>'&#' . hexdec('2308') . ';'),
-'~|' => array( 'input'=>'~|','tag'=>'mo', 'output'=>'&#' . hexdec('2309') . ';'),
-'CC' => array( 'input'=>'CC','tag'=>'mo', 'output'=>'&#' . hexdec('2102') . ';'),
-'NN' => array( 'input'=>'NN','tag'=>'mo', 'output'=>'&#' . hexdec('2115') . ';'),
-'QQ' => array( 'input'=>'QQ','tag'=>'mo', 'output'=>'&#' . hexdec('211A') . ';'),
-'RR' => array( 'input'=>'RR','tag'=>'mo', 'output'=>'&#' . hexdec('211D') . ';'),
-'ZZ' => array( 'input'=>'ZZ','tag'=>'mo', 'output'=>'&#' . hexdec('2124') . ';'),
-
-// Standard functions
-'lim' => array( 'input'=>'lim','tag'=>'mo', 'output'=>'lim', 'underover'=>TRUE),
-'Lim' => array( 'input'=>'Lim','tag'=>'mo', 'output'=>'Lim', 'underover'=>TRUE), /* 2005-06-11 wes */
-'sin' => array( 'input'=>'sin','tag'=>'mo', 'output'=>'sin', 'unary'=>TRUE, 'func'=>TRUE),
-'cos' => array( 'input'=>'cos', 'tag'=>'mo', 'output'=>'cos', 'unary'=>TRUE, 'func'=>TRUE),
-'tan' => array( 'input'=>'tan', 'tag'=>'mo', 'output'=>'tan', 'unary'=>TRUE, 'func'=>TRUE),
-'arcsin' => array( 'input'=>'arcsin','tag'=>'mo', 'output'=>'arcsin', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'arccos' => array( 'input'=>'arccos', 'tag'=>'mo', 'output'=>'arccos', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'arctan' => array( 'input'=>'arctan', 'tag'=>'mo', 'output'=>'arctan', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'sinh' => array( 'input'=>'sinh','tag'=>'mo', 'output'=>'sinh', 'unary'=>TRUE, 'func'=>TRUE),
-'cosh' => array( 'input'=>'cosh', 'tag'=>'mo', 'output'=>'cosh', 'unary'=>TRUE, 'func'=>TRUE),
-'tanh' => array( 'input'=>'tanh', 'tag'=>'mo', 'output'=>'tanh', 'unary'=>TRUE, 'func'=>TRUE),
-'cot' => array( 'input'=>'cot','tag'=>'mo', 'output'=>'cot', 'unary'=>TRUE, 'func'=>TRUE),
-'sec' => array( 'input'=>'sec', 'tag'=>'mo', 'output'=>'sec', 'unary'=>TRUE, 'func'=>TRUE),
-'csc' => array( 'input'=>'csc', 'tag'=>'mo', 'output'=>'csc', 'unary'=>TRUE, 'func'=>TRUE),
-'coth' => array( 'input'=>'coth','tag'=>'mo', 'output'=>'coth', 'unary'=>TRUE, 'func'=>TRUE),
-'sech' => array( 'input'=>'sech', 'tag'=>'mo', 'output'=>'sech', 'unary'=>TRUE, 'func'=>TRUE),
-'csch' => array( 'input'=>'csch', 'tag'=>'mo', 'output'=>'csch', 'unary'=>TRUE, 'func'=>TRUE),
-'log' => array( 'input'=>'log', 'tag'=>'mo', 'output'=>'log', 'unary'=>TRUE, 'func'=>TRUE),
-'ln' => array( 'input'=>'ln', 'tag'=>'mo', 'output'=>'ln', 'unary'=>TRUE, 'func'=>TRUE),
-'det' => array( 'input'=>'det', 'tag'=>'mo', 'output'=>'det', 'unary'=>TRUE, 'func'=>TRUE),
-'dim' => array( 'input'=>'dim', 'tag'=>'mo', 'output'=>'dim'),
-'mod' => array( 'input'=>'mod', 'tag'=>'mo', 'output'=>'mod'),
-'gcd' => array( 'input'=>'gcd', 'tag'=>'mo', 'output'=>'gcd', 'unary'=>TRUE, 'func'=>TRUE),
-'lcm' => array( 'input'=>'lcm', 'tag'=>'mo', 'output'=>'lcm', 'unary'=>TRUE, 'func'=>TRUE),
-'lub' => array( 'input'=>'lub', 'tag'=>'mo', 'output'=>'lub'), /* 2005-06-11 wes */
-'glb' => array( 'input'=>'glb', 'tag'=>'mo', 'output'=>'glb'), /* 2005-06-11 wes */
-'min' => array( 'input'=>'min', 'tag'=>'mo', 'output'=>'min', 'underover'=>TRUE), /* 2005-06-11 wes */
-'max' => array( 'input'=>'max', 'tag'=>'mo', 'output'=>'max', 'underover'=>TRUE), /* 2005-06-11 wes */
-'f' => array( 'input'=>'f','tag'=>'mi', 'output'=>'f', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-'g' => array( 'input'=>'g', 'tag'=>'mi', 'output'=>'g', 'unary'=>TRUE, 'func'=>TRUE), //2006-9-7 DL
-
-// Arrows
-'uarr' => array( 'input'=>'uarr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2191') . ';'),
-'darr' => array( 'input'=>'darr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2193') . ';'),
-'rarr' => array( 'input'=>'rarr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2192') . ';'),
-'->' => array( 'input'=>'->', 'tag'=>'mo', 'output'=>'&#' . hexdec('2192') . ';'),
-'|->' => array( 'input'=>'|->', 'tag'=>'mo', 'output'=>'&#' . hexdec('21A6') . ';'), /* 2005-06-11 wes */
-'larr' => array( 'input'=>'larr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2190') . ';'),
-'harr' => array( 'input'=>'harr', 'tag'=>'mo', 'output'=>'&#' . hexdec('2194') . ';'),
-'rArr' => array( 'input'=>'rArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D2') . ';'),
-'lArr' => array( 'input'=>'lArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D0') . ';'),
-'hArr' => array( 'input'=>'hArr', 'tag'=>'mo', 'output'=>'&#' . hexdec('21D4') . ';'),
-
-// Commands with argument
-'sqrt' => array( 'input'=>'sqrt', 'tag'=>'msqrt', 'output'=>'sqrt', 'unary'=>TRUE ),
-'root' => array( 'input'=>'root', 'tag'=>'mroot', 'output'=>'root', 'binary'=>TRUE ),
-'frac' => array( 'input'=>'frac', 'tag'=>'mfrac', 'output'=>'/', 'binary'=>TRUE),
-'/' => array( 'input'=>'/', 'tag'=>'mfrac', 'output'=>'/', 'infix'=>TRUE),
-'_' => array( 'input'=>'_', 'tag'=>'msub', 'output'=>'_', 'infix'=>TRUE),
-'^' => array( 'input'=>'^', 'tag'=>'msup', 'output'=>'^', 'infix'=>TRUE),
-'hat' => array( 'input'=>'hat', 'tag'=>'mover', 'output'=>'&#' . hexdec('005E') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'bar' => array( 'input'=>'bar', 'tag'=>'mover', 'output'=>'&#' . hexdec('00AF') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'vec' => array( 'input'=>'vec', 'tag'=>'mover', 'output'=>'&#' . hexdec('2192') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'dot' => array( 'input'=>'dot', 'tag'=>'mover', 'output'=>'.', 'unary'=>TRUE, 'acc'=>TRUE),
-'ddot' => array( 'input'=>'ddot', 'tag'=>'mover', 'output'=>'..', 'unary'=>TRUE, 'acc'=>TRUE),
-'ul' => array( 'input'=>'ul', 'tag'=>'munder', 'output'=>'&#' . hexdec('0332') . ';', 'unary'=>TRUE, 'acc'=>TRUE),
-'avec' => array( 'input'=>'avec', 'tag'=>'munder', 'output'=>'~', 'unary'=>TRUE, 'acc'=>TRUE),
-'text' => array( 'input'=>'text', 'tag'=>'mtext', 'output'=>'text', 'unary'=>TRUE),
-'mbox' => array( 'input'=>'mbox', 'tag'=>'mtext', 'output'=>'mbox', 'unary'=>TRUE),
-'"' => array( 'input'=>'"', 'tag'=>'mtext','output'=>'mbox', 'unary'=>TRUE),
-
-/* 2005-06-05 wes: added stackrel */
-'stackrel' => array( 'input'=>'stackrel', 'tag'=>'mover', 'output'=>'stackrel', 'binary'=>TRUE),
-
-// Grouping brackets
-'(' => array( 'input'=>'(', 'tag'=>'mo', 'output'=>'(', 'left_bracket'=>TRUE),
-')' => array( 'input'=>')', 'tag'=>'mo', 'output'=>')', 'right_bracket'=>TRUE),
-'[' => array( 'input'=>'[', 'tag'=>'mo', 'output'=>'[', 'left_bracket'=>TRUE),
-']' => array( 'input'=>']', 'tag'=>'mo', 'output'=>']', 'right_bracket'=>TRUE),
-'{' => array( 'input'=>'{', 'tag'=>'mo', 'output'=>'{', 'left_bracket'=>TRUE),
-'}' => array( 'input'=>'}', 'tag'=>'mo', 'output'=>'}', 'right_bracket'=>TRUE),
-'(:' => array( 'input'=>'(:', 'tag'=>'mo', 'output'=>'&#' . hexdec('2329') . ';', 'left_bracket'=>TRUE),
-':)' => array( 'input'=>':)', 'tag'=>'mo', 'output'=>'&#' . hexdec('232A') . ';', 'right_bracket'=>TRUE),
-'{:' => array( 'input'=>'{:', 'tag'=>'mo', 'output'=>'{:', 'left_bracket'=>TRUE, 'invisible'=>TRUE),
-':}' => array( 'input'=>':}', 'tag'=>'mo', 'output'=>':}', 'right_bracket'=>TRUE ,'invisible'=>TRUE),
-'<<' => array( 'input'=>'<<', 'tag'=>'mo', 'output'=>'&#' . hexdec('2329') . ';', 'left_bracket'=>TRUE), // 2005-06-07 wes
-'>>' => array( 'input'=>'>>', 'tag'=>'mo', 'output'=>'&#' . hexdec('232A') . ';', 'right_bracket'=>TRUE) // 2005-06-07 wes
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.class.php b/libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.class.php
deleted file mode 100644
index 5fb1060..0000000
--- a/libvpx/examples/includes/ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.class.php
+++ /dev/null
@@ -1,1119 +0,0 @@
-<?php
-
-/****
- * ASCIIMathPHP and associated classes:
- * -- XMLNode
- * -- MathMLNode extends XMLNode
- *
- * These classes are a PHP port of ASCIIMath
- * Version 1.3 Feb 19 2004, (c) Peter Jipsen http://www.chapman.edu/~jipsen
- *
- * ASCIIMathPHP Version 1.11, 26 April 2006, (c) Kee-Lin Steven Chan (kc56@cornell.edu)
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or (at
- * your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License (at http://www.gnu.org/copyleft/gpl.html)
- * for more details.
- *
- * ChangeLog
- *
- * Ver 2.0
- * -- PHP5 only version of ASCIIMathPHP
- *
- * Ver 1.12.1
- * -- Included the missing setCurrExpr() method
- *
- * Ver 1.12
- * -- Added changes that David Lippman <DLippman@pierce.ctc.edu> made to bring ASCIIMathPHP up to
- * ASCIIMath 1.4.7 functionality.
- * -- Added parseIntExpr, for intermediate expression parsing rule, allowing x^2/x^3 to render as (x^2)/(x^3)
- * -- Added quotes as another way of designating text; "hello" is equivalent to text(hello)
- * -- Added FUNC designator to allow sin, cos, etc to act as functions, so sin(x)/x renders as {sin(x)}/x
- *
- * Ver 1.11
- * -- Fixed bug that stopped script execution for incomplete expressions
- * -- Changed the algorithm for parsing expressions so that it matches the longest string possible (greedy)
- *
- * Ver 1.10
- * -- Added definition support
- * -- Added stackrel support
- * -- Added a bunch of different symbols etc. >>, << and definitions like dx, dy, dz etc.
- *
- * Ver 1.02
- * -- Fixed bug with mbox and text
- * -- Fixed spacing bug with mbox and text
- *
- * Ver 1.01
- * -- Fixed Bug that did not parse symbols greater than a single character
- * correctly when appearing at end of expression.
- *
- ***/
-
-class XMLNode
-{
- // Private variables
- var $_id;
- var $_name;
- var $_content;
- var $_mt_elem_flg;
- var $_attr_arr;
- var $_child_arr;
- var $_nmspc;
- var $_nmspc_alias;
- var $_parent_id;
- var $_parent_node;
-
- function XMLNode($id = NULL)
- {
- $this->_id = isset($id) ? $id : md5(uniqid(rand(),1));
- $this->_name = '';
- $this->_content = '';
- $this->_mt_elem_flg = FALSE;
- $this->_attr_arr = array();
- $this->_child_arr = array();
- $this->_nmspc = '';
- $this->_nmspc_alias = '';
- $this->_parent_id = FALSE;
- $this->_parent_node = NULL;
- }
-
- function addChild(&$node)
- {
- $this->_child_arr[$node->getId()] = $node;
- $node->setParentId($this->_id);
- $node->setParentNode($this);
- }
-
- function addChildArr(&$node_arr)
- {
- $key_arr = array_keys($node_arr);
- $num_key = count($key_arr);
-
- for ($i = 0; $i < $num_key; $i++) {
- $node = $node_arr[$key_arr[$i]];
- $this->addChild($node);
- }
- }
-
- function insertChildBefore($idx,&$node)
- {
- $key_arr = array_keys($this->_child_arr);
- $num_key = count($key_arr);
- $tmp_arr = arry();
-
- for ($i = 0;$i < $num_key;$i++) {
- if ($i == $idx) {
- $tmp_arr[$node->getId()] = $node;
- }
- $tmp_arr[$key_arr[$i]] = $this->_child_arr[$key_arr[$i]];
- }
- $this->_child_arr = $tmp_arr;
- }
-
- function insertChildAfter($idx,&$node)
- {
- $key_arr = array_keys($this->_child_arr);
- $num_key = count($key_arr);
- $tmp_arr = arry();
-
- for ($i = 0;$i < $num_key;$i++) {
- $tmp_arr[$key_arr[$i]] = $this->_child_arr[$key_arr[$i]];
- if ($i == $idx) {
- $tmp_arr[$node->getId()] = $node;
- }
- }
- $this->_child_arr = $tmp_arr;
- }
-
- function setId($id)
- {
- $this->_id = $id;
- }
-
- function setName($name)
- {
- $this->_name = $name;
- }
-
- function setNamepace($nmspc)
- {
- $this->_nmspc = $nmspc;
- }
-
- function setNamespaceAlias($nmspc_alias)
- {
- $this->_nmspc_alias = $nmspc_alias;
- }
-
- function setContent($content)
- {
- $this->_content = $content;
- }
-
- function setEmptyElem($mt_elem_flg)
- {
- $this->_mt_elem_flg = $mt_elem_flg;
- }
-
- function setAttr($attr_nm,$attr_val)
- {
- $this->_attr_arr[$attr_nm] = $attr_val;
- }
-
- function setAttrArr($attr_arr)
- {
- $this->_attr_arr = $attr_arr;
- }
-
- function setParentId($id)
- {
- $this->_parent_id = $id;
- }
-
- function setParentNode(&$node)
- {
- $this->_parent_node = $node;
- }
-
- function getId()
- {
- return($this->_id);
- }
-
- function getName()
- {
- return($this->_name);
- }
-
- function getNamespace()
- {
- return($this->_nmspc);
- }
-
- function getNamespaceAlias()
- {
- return($this->_nmspc_alias);
- }
-
- function getContent()
- {
- return($this->_content);
- }
-
- function getAttr($attr_nm)
- {
- if (isset($this->_attr_arr[$attr_nm])) {
- return($this->_attr_arr[$attr_nm]);
- } else {
- return(NULL);
- }
- }
-
- function getAttrArr()
- {
- return($this->_attr_arr);
- }
-
- function getParentId()
- {
- return($this->parent_id);
- }
-
- function getParentNode()
- {
- return($this->_parent_node);
- }
-
- function getChild($id)
- {
- if (isset($this->_child_arr[$id])) {
- return($this->_child_arr[$id]);
- } else {
- return(FALSE);
- }
- }
-
- function getFirstChild()
- {
- $id_arr = array_keys($this->_child_arr);
- $num_child = count($id_arr);
-
- if ($num_child > 0) {
- return($this->_child_arr[$id_arr[0]]);
- } else {
- return(FALSE);
- }
- }
-
- function getLastChild()
- {
- $id_arr = array_keys($this->_child_arr);
- $num_child = count($id_arr);
-
- if ($num_child > 0) {
- return($this->_child_arr[$id_arr[$num_child - 1]]);
- } else {
- return(FALSE);
- }
- }
-
- function getChildByIdx($idx)
- {
- $id_arr = array_keys($this->_child_arr);
-
- if (isset($this->_child_arr[$id_arr[$idx]])) {
- return($this->_child_arr[$id_arr[$idx]]);
- } else {
- return(FALSE);
- }
- }
-
- function getNumChild()
- {
- return(count($this->_child_arr));
- }
-
- function removeChild($id)
- {
- unset($this->_child_arr[$id]);
- }
-
- function removeChildByIdx($idx)
- {
- $key_arr = array_keys($this->_child_arr);
- unset($this->_child_arr[$key_arr[$idx]]);
- }
-
- function removeFirstChild()
- {
- $key_arr = array_keys($this->_child_arr);
- unset($this->_child_arr[$key_arr[0]]);
- }
-
- function removeLastChild()
- {
- $key_arr = array_keys($this->_child_arr);
- unset($this->_child_arr[$key_arr[count($key_arr)-1]]);
- }
-
- function dumpXML($indent_str = "\t")
- {
- $attr_txt = $this->_dumpAttr();
- $name = $this->_dumpName();
- $xmlns = $this->_dumpXmlns();
- $lvl = $this->_getCurrentLevel();
- $indent = str_pad('',$lvl,$indent_str);
-
- if ($this->_mt_elem_flg) {
- $tag = "$indent<$name$xmlns$attr_txt />";
- return($tag);
- } else {
- $key_arr = array_keys($this->_child_arr);
- $num_child = count($key_arr);
-
- $tag = "$indent<$name$xmlns$attr_txt>$this->_content";
-
- for ($i = 0;$i < $num_child;$i++) {
- $node = $this->_child_arr[$key_arr[$i]];
-
- $child_txt = $node->dumpXML($indent_str);
- $tag .= "\n$child_txt";
- }
-
- $tag .= ($num_child > 0 ? "\n$indent</$name>" : "</$name>");
- return($tag);
- }
- }
-
- function _dumpAttr()
- {
- $id_arr = array_keys($this->_attr_arr);
- $id_arr_cnt = count($id_arr);
- $attr_txt = '';
-
- for($i = 0;$i < $id_arr_cnt;$i++) {
- $key = $id_arr[$i];
- $attr_txt .= " $key=\"{$this->_attr_arr[$key]}\"";
- }
-
- return($attr_txt);
- }
-
- function _dumpName()
- {
- $alias = $this->getNamespaceAlias();
- if ($alias == '') {
- return($this->getName());
- } else {
- return("$alias:" . $this->getName());
- }
- }
-
- function _dumpXmlns()
- {
- $nmspc = $this->getNamespace();
- $alias = $this->getNamespaceAlias();
-
- if ($nmspc != '') {
- if ($alias == '') {
- return(" xmlns=\"" . $nmspc . "\"");
- } else {
- return(" xmlns:$alias=\"" . $nmspc . "\"");
- }
- } else {
- return('');
- }
- }
-
- function _getCurrentLevel()
- {
- if ($this->_parent_id === FALSE) {
- return(0);
- } else {
- $node = $this->getParentNode();
- $lvl = $node->_getCurrentLevel();
- $lvl++;
- return($lvl);
- }
- }
-}
-
-class MathMLNode extends XMLNode
-{
- function MathMLNode($id = NULL)
- {
- parent::XMLNode($id);
- }
-
- function removeBrackets()
- {
- if ($this->_name == 'mrow') {
- if ($c_node_0 = $this->getFirstChild()) {
- $c_node_0->isLeftBracket() ? $this->removeFirstChild() : 0;
- }
-
- if ($c_node_0 = $this->getLastChild()) {
- $c_node_0->isRightBracket() ? $this->removeLastChild() : 0;
- }
- }
- }
-
- function isLeftBracket()
- {
- switch ($this->_content) {
- case '{':
- case '[':
- case '(':
- return(TRUE);
- break;
- }
- return(FALSE);
- }
-
- function isRightBracket()
- {
- switch ($this->_content) {
- case '}':
- case ']':
- case ')':
- return(TRUE);
- break;
- }
- return(FALSE);
- }
-}
-
-class ASCIIMathPHP
-{
- var $_expr;
- var $_curr_expr;
- var $_prev_expr;
- var $_symbol_arr;
- var $_node_arr;
- var $_node_cntr;
-
- function ASCIIMathPHP($symbol_arr,$expr = NULL)
- {
- $this->_symbol_arr = $symbol_arr;
- if (isset($expr)) {
- $this->setExpr($expr);
- }
- }
-
- /**
- * Returns an empty node (containing a non-breaking space) 26-Apr-2006
- *
- * Used when an expression is incomplete
- *
- * @return object
- *
- * @access private
- */
- function emptyNode()
- {
- $tmp_node = $this->createNode();
- $tmp_node->setName('mn');
- $tmp_node->setContent('&#' . hexdec('200B') . ';');
- return $tmp_node;
- }
-
- function pushExpr($prefix) // 2005-06-11 wes
- {
- $this->_curr_expr = $prefix . $this->_curr_expr;
- }
-
- function setExpr($expr)
- {
- $this->_expr = $expr;
- $this->_curr_expr = $expr;
- $this->_prev_expr = $expr;
-
- $this->_node_arr = array();
- $this->_node_cntr = 0;
- }
-
- function genMathML($attr_arr = NULL)
- {
- // <math> node
- $node_0 = $this->createNode();
- $node_0->setName('math');
- $node_0->setNamepace('http://www.w3.org/1998/Math/MathML');
-
- // <mstyle> node
- if (isset($attr_arr)) {
- $node_1 = $this->createNode();
- $node_1->setName('mstyle');
- $node_1->setAttrArr($attr_arr);
-
- $node_arr = $this->parseExpr();
-
- $node_1->addChildArr($node_arr);
- $node_0->addChild($node_1);
- } else {
- $node_arr = $this->parseExpr();
- $node_0->addChildArr($node_arr);
- }
-
- return TRUE;
- }
-
- /*
- function mergeNodeArr(&$node_arr_0,&$node_arr_1)
- {
- $key_arr_0 = array_keys($node_arr_0);
- $key_arr_1 = array_keys($node_arr_1);
-
- $num_key_0 = count($key_arr_0);
- $num_key_1 = count($key_arr_1);
-
- $merge_arr = array();
-
- for ($i = 0;$i < $num_key_0;$i++) {
- $merge_arr[$key_arr_0[$i]] = $node_arr_0[$key_arr_0[$i]];
- }
-
- for ($j = 0;$j < $num_key_1;$i++) {
- $merge_arr[$key_arr_1[$i]] = $node_arr_1[$key_arr_1[$i]];
- }
-
- return($merge_arr);
- }
- */
-
- //Broken out of parseExpr Sept 7, 2006 David Lippman for
- //ASCIIMathML 1.4.7 compatibility
- function parseIntExpr()
- {
- $sym_0 = $this->getSymbol();
- $node_0 = $this->parseSmplExpr();
- $sym = $this->getSymbol();
-
- if (isset($sym['infix']) && $sym['input'] != '/') {
- $this->chopExpr($sym['symlen']);
- $node_1 = $this->parseSmplExpr();
-
- if ($node_1 === FALSE) { //show box in place of missing argument
- $node_1 = $this->emptyNode();//??
- } else {
- $node_1->removeBrackets();
- }
-
- // If 'sub' -- subscript
- if ($sym['input'] == '_') {
-
- $sym_1 = $this->getSymbol();
-
- // If 'sup' -- superscript
- if ($sym_1['input'] == '^') {
- $this->chopExpr($sym_1['symlen']);
- $node_2 = $this->parseSmplExpr();
- $node_2->removeBrackets();
-
- $node_3 = $this->createNode();
- $node_3->setName(isset($sym_0['underover']) ? 'munderover' : 'msubsup');
- $node_3->addChild($node_0);
- $node_3->addChild($node_1);
- $node_3->addChild($node_2);
-
- $node_4 = $this->createNode();
- $node_4->setName('mrow');
- $node_4->addChild($node_3);
-
- return $node_4;
- } else {
- $node_2 = $this->createNode();
- $node_2->setName(isset($sym_0['underover']) ? 'munder' : 'msub');
- $node_2->addChild($node_0);
- $node_2->addChild($node_1);
-
- return $node_2;
- }
- } else {
- $node_2 = $this->createNode();
- $node_2->setName($sym['tag']);
- $node_2->addChild($node_0);
- $node_2->addChild($node_1);
-
- return($node_2);
- }
- } elseif ($node_0 !== FALSE) {
- return($node_0);
- } else {
- return $this->emptyNode();
- }
-
- }
-
- function parseExpr()
- {
- // Child/Fragment array
- $node_arr = array();
-
- // Deal whole expressions like 'ax + by + c = 0' etc.
- do {
- $sym_0 = $this->getSymbol();
- $node_0 = $this->parseIntExpr();
- $sym = $this->getSymbol();
- // var_dump($sym);
-
- if (isset($sym['infix']) && $sym['input'] == '/') {
- $this->chopExpr($sym['symlen']);
- $node_1 = $this->parseIntExpr();
-
- if ($node_1 === FALSE) { //should show box in place of missing argument
- $node_1 = $this->emptyNode();
- continue;
- }
-
- $node_1->removeBrackets();
-
- // If 'div' -- divide
- $node_0->removeBrackets();
- $node_2 = $this->createNode();
- $node_2->setName($sym['tag']);
- $node_2->addChild($node_0);
- $node_2->addChild($node_1);
- $node_arr[$node_2->getId()] = $node_2;
-
- } elseif ($node_0 !== FALSE) {
- $node_arr[$node_0->getId()] = $node_0;
- }
- } while (!isset($sym['right_bracket']) && $sym !== FALSE && $sym['output'] != '');
-
- //var_dump($sym);
- // Possibly to deal with matrices
- if (isset($sym['right_bracket'])) {
- $node_cnt = count($node_arr);
- $key_node_arr = array_keys($node_arr);
-
- if ($node_cnt > 1) {
- $node_5 = $node_arr[$key_node_arr[$node_cnt-1]];
- $node_6 = $node_arr[$key_node_arr[$node_cnt-2]];
- } else {
- $node_5 = FALSE;
- $node_6 = FALSE;
- }
-
- // Dealing with matrices
- if ($node_5 !== FALSE && $node_6 !== FALSE &&
- $node_cnt > 1 &&
- $node_5->getName() == 'mrow' &&
- $node_6->getName() == 'mo' &&
- $node_6->getContent() == ',') {
-
- // Checking if Node 5 has a LastChild
- if ($node_7 = $node_5->getLastChild()) {
- $node_7_cntnt = $node_7->getContent();
- } else {
- $node_7_cntnt = FALSE;
- }
-
- // If there is a right bracket
- if ($node_7 !== FALSE && ($node_7_cntnt == ']' || $node_7_cntnt == ')')) {
-
- // Checking if Node 5 has a firstChild
- if ($node_8 = $node_5->getFirstChild()) {
- $node_8_cntnt = $node_8->getContent();
- } else {
- $node_8_cntnt = FALSE;
- }
-
- // If there is a matching left bracket
- if ($node_8 !== FALSE &&
- (($node_8_cntnt == '(' && $node_7_cntnt == ')' && $sym['output'] != '}') ||
- ($node_8_cntnt == '[' && $node_7_cntnt == ']'))) {
-
- $is_mtrx_flg = TRUE;
- $comma_pos_arr = array();
-
- $i = 0;
-
- while ($i < $node_cnt && $is_mtrx_flg) {
- $tmp_node = $node_arr[$key_node_arr[$i]];
-
- if($tmp_node_first = $tmp_node->getFirstChild()) {
- $tnfc = $tmp_node_first->getContent();
- } else {
- $tnfc = FALSE;
- }
-
- if($tmp_node_last = $tmp_node->getLastChild()) {
- $tnlc = $tmp_node_last->getContent();
- } else {
- $tnlc = FALSE;
- }
-
- if (isset($key_node_arr[$i+1])) {
- $next_tmp_node = $node_arr[$key_node_arr[$i+1]];
- $ntnn = $next_tmp_node->getName();
- $ntnc = $next_tmp_node->getContent();
- } else {
- $ntnn = FALSE;
- $ntnc = FALSE;
- }
-
- // Checking each node in node array for matrix criteria
- if ($is_mtrx_flg) {
- $is_mtrx_flg = $tmp_node->getName() == 'mrow' &&
- ($i == $node_cnt-1 || $ntnn == 'mo' && $ntnc == ',') &&
- $tnfc == $node_8_cntnt && $tnlc == $node_7_cntnt;
- }
-
- if ($is_mtrx_flg) {
- for ($j = 0;$j < $tmp_node->getNumChild();$j++) {
- $tmp_c_node = $tmp_node->getChildByIdx($j);
-
- if ($tmp_c_node->getContent() == ',') {
- $comma_pos_arr[$i][] = $j;
- }
- }
- }
-
- if ($is_mtrx_flg && $i > 1) {
-
- $cnt_cpan = isset($comma_pos_arr[$i]) ? count($comma_pos_arr[$i]) : NULL;
- $cnt_cpap = isset($comma_pos_arr[$i-2]) ? count($comma_pos_arr[$i-2]) : NULL;
- $is_mtrx_flg = $cnt_cpan == $cnt_cpap;
- }
-
- $i += 2;
- }
-
- // If the node passes the matrix tests
- if ($is_mtrx_flg) {
- $tab_node_arr = array();
-
- for ($i = 0;$i < $node_cnt;$i += 2) {
- $tmp_key_node_arr = array_keys($node_arr);
- if (!($tmp_node = $node_arr[$tmp_key_node_arr[0]])) {
- break;
- }
- $num_child = $tmp_node->getNumChild();
- $k = 0;
-
- $tmp_node->removeFirstChild();
-
- $row_node_arr = array();
- $row_frag_node_arr = array();
-
- for ($j = 1;$j < ($num_child-1);$j++) {
- if (isset($comma_pos_arr[$i][$k]) &&
- $j == $comma_pos_arr[$i][$k]) {
-
- $tmp_node->removeFirstChild();
-
- $tmp_c_node = $this->createNode();
- $tmp_c_node->setName('mtd');
- $tmp_c_node->addChildArr($row_frag_node_arr);
- $row_frag_node_arr = array();
-
- $row_node_arr[$tmp_c_node->getId()] = $tmp_c_node;
-
- $k++;
- } else {
-
- if ($tmp_c_node = $tmp_node->getFirstChild()) {
- $row_frag_node_arr[$tmp_c_node->getId()] = $tmp_c_node;
- $tmp_node->removeFirstChild();
- }
- }
- }
-
- $tmp_c_node = $this->createNode();
- $tmp_c_node->setName('mtd');
- $tmp_c_node->addChildArr($row_frag_node_arr);
-
- $row_node_arr[$tmp_c_node->getId()] = $tmp_c_node;
-
- if (count($node_arr) > 2) {
- $tmp_key_node_arr = array_keys($node_arr);
- unset($node_arr[$tmp_key_node_arr[0]]);
- unset($node_arr[$tmp_key_node_arr[1]]);
- }
-
- $tmp_c_node = $this->createNode();
- $tmp_c_node->setName('mtr');
- $tmp_c_node->addChildArr($row_node_arr);
-
- $tab_node_arr[$tmp_c_node->getId()] = $tmp_c_node;
- }
-
- $tmp_c_node = $this->createNode();
- $tmp_c_node->setName('mtable');
- $tmp_c_node->addChildArr($tab_node_arr);
-
- if (isset($sym['invisible'])) {
- $tmp_c_node->setAttr('columnalign','left');
- }
-
- $key_node_arr = array_keys($node_arr);
- $tmp_c_node->setId($key_node_arr[0]);
-
- $node_arr[$tmp_c_node->getId()] = $tmp_c_node;
- }
- }
- }
- }
-
- $this->chopExpr($sym['symlen']);
- if (!isset($sym['invisible'])) {
- $node_7 = $this->createNode();
- $node_7->setName('mo');
- $node_7->setContent($sym['output']);
- $node_arr[$node_7->getId()] = $node_7;
- }
- }
-
- return($node_arr);
- }
-
- function parseSmplExpr()
- {
- $sym = $this->getSymbol();
-
- if (!$sym || isset($sym['right_bracket'])) //return FALSE;
- return $this->emptyNode();
-
- $this->chopExpr($sym['symlen']);
-
- // 2005-06-11 wes: add definition type support
- if(isset($sym['definition'])) {
- $this->pushExpr($sym['output']);
- $sym = $this->getSymbol();
- $this->chopExpr($sym['symlen']);
- }
-
- if (isset($sym['left_bracket'])) {
- $node_arr = $this->parseExpr();
-
- if (isset($sym['invisible'])) {
- $node_0 = $this->createNode();
- $node_0->setName('mrow');
- $node_0->addChildArr($node_arr);
-
- return($node_0);
- } else {
- $node_0 = $this->createNode();
- $node_0->setName('mo');
- $node_0->setContent($sym['output']);
-
- $node_1 = $this->createNode();
- $node_1->setName('mrow');
- $node_1->addChild($node_0);
- $node_1->addChildArr($node_arr);
-
- return($node_1);
- }
- } elseif (isset($sym['unary'])) {
-
- if ($sym['input'] == 'sqrt') {
- $node_0 = $this->parseSmplExpr();
- $node_0->removeBrackets();
-
- $node_1 = $this->createNode();
- $node_1->setName($sym['tag']);
- $node_1->addChild($node_0);
-
- return($node_1);
- } elseif (isset($sym['func'])) { //added 2006-9-7 David Lippman
- $expr = ltrim($this->getCurrExpr());
- $st = $expr{0};
- $node_0 = $this->parseSmplExpr();
- //$node_0->removeBrackets();
- if ($st=='^' || $st == '_' || $st=='/' || $st=='|' || $st==',') {
- $node_1 = $this->createNode();
- $node_1->setName($sym['tag']);
- $node_1->setContent($sym['output']);
- $this->setCurrExpr($expr);
- return($node_1);
- } else {
- $node_1 = $this->createNode();
- $node_1->setName('mrow');
- $node_2 = $this->createNode();
- $node_2->setName($sym['tag']);
- $node_2->setContent($sym['output']);
- $node_1->addChild($node_2);
- $node_1->addChild($node_0);
- return($node_1);
- }
- } elseif ($sym['input'] == 'text' || $sym['input'] == 'mbox' || $sym['input'] == '"') {
- $expr = ltrim($this->getCurrExpr());
- if ($sym['input']=='"') {
- $end_brckt = '"';
- $txt = substr($expr,0,strpos($expr,$end_brckt));
- } else {
- switch($expr{0}) {
- case '(':
- $end_brckt = ')';
- break;
- case '[':
- $end_brckt = ']';
- break;
- case '{':
- $end_brckt = '}';
- break;
- default:
- $end_brckt = chr(11); // A character that will never be matched.
- break;
- }
- $txt = substr($expr,1,strpos($expr,$end_brckt)-1);
- }
-
- //$txt = substr($expr,1,strpos($expr,$end_brckt)-1);
- $len = strlen($txt);
-
- $node_0 = $this->createNode();
- $node_0->setName('mrow');
-
- if ($len > 0) {
- if ($txt{0} == " ") {
- $node_1 = $this->createNode();
- $node_1->setName('mspace');
- $node_1->setAttr('width','1ex');
-
- $node_0->addChild($node_1);
- }
-
- $node_3 = $this->createNode();
- $node_3->setName($sym['tag']);
- $node_3->setContent(trim($txt));
-
- $node_0->addChild($node_3);
-
- if ($len > 1 && $txt{$len-1} == " ") {
- $node_2 = $this->createNode();
- $node_2->setName('mspace');
- $node_2->setAttr('width','1ex');
-
- $node_0->addChild($node_2);
- }
-
- $this->chopExpr($len+2);
- }
- return($node_0);
-
- } elseif (isset($sym['acc'])) {
- $node_0 = $this->parseSmplExpr();
- $node_0->removeBrackets();
-
- $node_1 = $this->createNode();
- $node_1->setName($sym['tag']);
- $node_1->addChild($node_0);
-
- $node_2 = $this->createNode();
- $node_2->setName('mo');
- $node_2->setContent($sym['output']);
-
- $node_1->addChild($node_2);
- return($node_1);
- } else {
- // Font change commands -- to complete
- }
- } elseif (isset($sym['binary'])) {
- $node_arr = array();
-
- $node_0 = $this->parseSmplExpr();
- $node_0->removeBrackets();
-
- $node_1 = $this->parseSmplExpr();
- $node_1->removeBrackets();
-
- /* 2005-06-05 wes: added stackrel */
- if ($sym['input'] == 'root' || $sym['input'] == 'stackrel') {
- $node_arr[$node_1->getId()] = $node_1;
- $node_arr[$node_0->getId()] = $node_0;
- } elseif ($sym['input'] == 'frac') {
- $node_arr[$node_0->getId()] = $node_0;
- $node_arr[$node_1->getId()] = $node_1;
- }
-
- $node_2 = $this->createNode();
- $node_2->setName($sym['tag']);
- $node_2->addChildArr($node_arr);
-
- return($node_2);
- } elseif (isset($sym['infix'])) {
- $node_0 = $this->createNode();
- $node_0->setName('mo');
- $node_0->setContent($sym['output']);
-
- return($node_0);
- } elseif (isset($sym['space'])) {
- $node_0 = $this->createNode();
- $node_0->setName('mrow');
-
- $node_1 = $this->createNode();
- $node_1->setName('mspace');
- $node_1->setAttr('width',$sym['space']);
-
- $node_2 = $this->createNode();
- $node_2->setName($sym['tag']);
- $node_2->setContent($sym['output']);
-
- $node_3 = $this->createNode();
- $node_3->setName('mspace');
- $node_3->setAttr('width',$sym['space']);
-
- $node_0->addChild($node_1);
- $node_0->addChild($node_2);
- $node_0->addChild($node_3);
-
- return($node_0);
- } else {
-
- // A constant
- $node_0 = $this->createNode();
- $node_0->setName($sym['tag']);
- $node_0->setContent($sym['output']);
- return($node_0);
- }
-
- // Return an empty node
- return $this->emptyNode();
- }
-
- function getMathML()
- {
- $root = $this->_node_arr[0];
- return($root->dumpXML());
- }
-
- function getCurrExpr()
- {
- return($this->_curr_expr);
- }
-
- function setCurrExpr($str)
- {
- $this->_curr_expr = $str;
- }
-
- function getExpr()
- {
- return($this->_expr);
- }
-
- function getPrevExpr()
- {
- return($this->_prev_expr);
- }
-
- function createNode()
- {
- $node = new MathMLNode($this->_node_cntr);
- // $node->setNamespaceAlias('m');
- $this->_node_arr[$this->_node_cntr] = $node;
- $this->_node_cntr++;
- return($node);
- }
-
- /**
- * Gets the largest symbol in the expression (greedy). Changed from non-greedy 26-Apr-2006
- *
- * @parameter boolean[optional] Chop original string?
- *
- * @return mixed
- *
- * @access private
- */
- function getSymbol($chop_flg = FALSE)
- {
- // Implemented a reverse symbol matcher.
- // Instead of going front to back, it goes back to front. Steven 26-Apr-2006
- $chr_cnt = strlen($this->_curr_expr);
-
- if ($chr_cnt == 0) return FALSE;
-
- for ($i = $chr_cnt; $i > 0; $i--) {
- $sym_0 = substr($this->_curr_expr,0,$i);
-
- // Reading string for numeric values
- if (is_numeric($sym_0)) {
-
- if ($chop_flg) $this->chopExpr($i);
- return array('input'=>$sym_0, 'tag'=>'mn', 'output'=>$sym_0, 'symlen'=>$i);
-
- } elseif (isset($this->_symbol_arr[$sym_0])) {
-
- if ($chop_flg) $this->chopExpr($i);
- $sym_arr = $this->_symbol_arr[$sym_0];
- $sym_arr['symlen'] = $i;
- return $sym_arr;
- }
- }
-
- // Reading string for alphabetic constants and the minus sign
- $char = $this->_curr_expr{0};
- $len_left = $chop_flg ? $this->chopExpr(1) : strlen($this->_curr_expr)-1;
-
- // Deals with expressions of length 1
- if ($len_left == 0 && isset($this->_symbol_arr[$char])) {
- $sym_arr = $this->_symbol_arr[$char];
- $sym_arr['symlen'] = 1;
- return $sym_arr;
- } else {
- $tag = preg_match('/[a-z]/i',$char) ? 'mi' : 'mo';
- return array('input'=>$char, 'tag'=>$tag, 'output'=>$char, 'symlen'=>1);
- }
- }
-
- function chopExpr($strlen)
- {
- $this->_prev_expr = $this->_curr_expr;
-
- if ($strlen == strlen($this->_curr_expr)) {
- $this->_curr_expr = '';
- return(0);
- } else {
- $this->_curr_expr = ltrim(substr($this->_curr_expr,$strlen));
- return(strlen($this->_curr_expr));
- }
- }
-}
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/ASCIIMathPHP-2.0/htmlMathML.js b/libvpx/examples/includes/ASCIIMathPHP-2.0/htmlMathML.js
deleted file mode 100644
index f81a1d2..0000000
--- a/libvpx/examples/includes/ASCIIMathPHP-2.0/htmlMathML.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/* March 19, 2004 MathHTML (c) Peter Jipsen http://www.chapman.edu/~jipsen
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or (at
-your option) any later version.
-This program is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-(at http://www.gnu.org/copyleft/gpl.html) for more details.*/
-
-function convertMath(node) {// for Gecko
- if (node.nodeType==1) {
- var newnode =
- document.createElementNS("http://www.w3.org/1998/Math/MathML",
- node.nodeName.toLowerCase());
- for(var i=0; i < node.attributes.length; i++) {
- if (node.attributes[i].nodeName == 'displaystyle') {
- newnode.setAttribute(node.attributes[i].nodeName,node.attributes[i].nodeValue);
- }
- }
- for (var i=0; i<node.childNodes.length; i++) {
- var st = node.childNodes[i].nodeValue;
- if (st==null || st.slice(0,1)!=" " && st.slice(0,1)!="\n")
- newnode.appendChild(convertMath(node.childNodes[i]));
- }
- return newnode;
- }
- else return node;
-}
-function convert() {
-
- if (document.createElementNS) {
- var mmlnode = document.getElementsByTagName("span");
-
- for (var i=0; i<mmlnode.length; i++) {
- var tmp_node = mmlnode[i];
- if (tmp_node.className == 'asciimath') {
- tmp_node.replaceChild(convertMath(tmp_node.firstChild),tmp_node.firstChild);
- /*
- for (var j=0;j<tmp_node.childNodes.length;j++) {
- if (tmp_node.childNodes[j].nodeType != 3) {
-
- }
- }
- */
- }
- }
- } else {
- var st,node,newnode;
- var mmlnode = document.getElementsByTagName("math");
-
- for (var i=0; i<mmlnode.length; i++) {
- var str = "";
- node = mmlnode[i];
- while (node.nodeName!="/MATH" && node.nextSibling) {
- st = node.nodeName.toLowerCase();
- if (st=="#text") {
- str += node.nodeValue;
- } else {
- str += (st.slice(0,1)=="/" ? "</m:"+st.slice(1) : "<m:"+st);
- if (st.slice(0,1)!="/") {
- for(var j=0; j < node.attributes.length; j++) {
- if (node.attributes[j].nodeValue!="italic" &&
- node.attributes[j].nodeValue!="" &&
- node.attributes[j].nodeValue!="inherit" &&
- node.attributes[j].nodeValue!=undefined) {
- str += " "+node.attributes[j].nodeName+"="+
- "\""+node.attributes[j].nodeValue+"\"";
- }
- }
- }
- str += ">";
- }
- node = node.nextSibling;
- node.parentNode.removeChild(node.previousSibling);
- }
-
- if (str != '') {
- str += "</m:math>";
- newnode = document.createElement("span");
- node.parentNode.replaceChild(newnode,node);
- newnode.innerHTML = str;
- }
- }
- }
-} \ No newline at end of file
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/.gitattributes b/libvpx/examples/includes/HTML-Toc-0.91/.gitattributes
deleted file mode 100644
index aecf250..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* -crlf
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/Changes b/libvpx/examples/includes/HTML-Toc-0.91/Changes
deleted file mode 100644
index 81f8339..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/Changes
+++ /dev/null
@@ -1,26 +0,0 @@
-Revision history for Perl extension HTML::Toc.
-
-2001-09-03 Freddy Vulto <fvu@fvu.myweb.nl>
-
- Release 0.91
-
- - Tested on Cygwin.
- - Used Unix file type for source files.
- - Updated documentation.
- - Prohibited call with undefined parameter to HTML::Parser->parse() from
- HTML::_tokenTocEndParser->parse() which caused havoc with version 3.25
- of HTML::Parser.
- - Specified 'HTML::Parser' as module that needs to be available in order
- to use HTML::Toc.
- - Added protected method HTML::TocGenerator::_setActiveAnchorName().
- This method replaces the incongruous access of
- 'HTML::TocUpdator::_doDeleteTokens' by HTML::TocGenerator.
- HTML::TocUpdator now overrides '_setActiveAnchorName()' to allow
- the ancestor call to HTML::TocGenerator only when '_doDeleteTokens'
- equals false.
-
-2001-08-09 Freddy Vulto <fvu@fvu.myweb.nl>
-
- Release 0.90
-
- - First release.
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/MANIFEST b/libvpx/examples/includes/HTML-Toc-0.91/MANIFEST
deleted file mode 100644
index e90f3a8..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/MANIFEST
+++ /dev/null
@@ -1,26 +0,0 @@
-Changes
-Toc.pod
-Toc.pm
-TocGenerator.pm
-TocInsertor.pm
-TocUpdator.pm
-Makefile.PL
-MANIFEST
-t/extend.t
-t/format.t
-t/generate.t
-t/insert.t
-t/manualTest.t
-t/options.t
-t/podExamples.t
-t/propagate.t
-t/siteMap.t
-t/update.t
-t/ManualTest/manualTest1.htm
-t/SiteMap/index.htm
-t/SiteMap/SubDir1/index.htm
-t/SiteMap/SubDir1/SubSubDir1/index.htm
-t/SiteMap/SubDir2/index.htm
-t/SiteMap/SubDir2/SubSubDir1/index.htm
-t/SiteMap/SubDir2/SubSubDir2/index.htm
-t/SiteMap/SubDir3/index.htm
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/Makefile.PL b/libvpx/examples/includes/HTML-Toc-0.91/Makefile.PL
deleted file mode 100644
index 434d4fd..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/Makefile.PL
+++ /dev/null
@@ -1,8 +0,0 @@
-use ExtUtils::MakeMaker;
-
-WriteMakefile(
- 'NAME' => 'HTML::Toc',
- 'VERSION_FROM' => 'Toc.pm',
- 'PREREQ_PM' => {'HTML::Parser' => 0},
- 'MAN3PODS' => {},
-);
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/Toc.pm b/libvpx/examples/includes/HTML-Toc-0.91/Toc.pm
deleted file mode 100644
index ae2e8d8..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/Toc.pm
+++ /dev/null
@@ -1,549 +0,0 @@
-#=== HTML::Toc ================================================================
-# function: HTML Table of Contents
-
-
-package HTML::Toc;
-
-
-use strict;
-
-
-BEGIN {
- use vars qw($VERSION);
-
- $VERSION = '0.91';
-}
-
-
-use constant FILE_FILTER => '.*';
-use constant GROUP_ID_H => 'h';
-use constant LEVEL_1 => 1;
-use constant NUMBERING_STYLE_DECIMAL => 'decimal';
-
- # Templates
-
- # Anchor templates
-use constant TEMPLATE_ANCHOR_NAME => '$groupId."-".$node';
-use constant TEMPLATE_ANCHOR_HREF_BEGIN =>
- '"<a href=#$anchorName>"';
-use constant TEMPLATE_ANCHOR_HREF_BEGIN_FILE =>
- '"<a href=$file#$anchorName>"';
-use constant TEMPLATE_ANCHOR_HREF_END => '"</a>"';
-use constant TEMPLATE_ANCHOR_NAME_BEGIN =>
- '"<a name=$anchorName>"';
-use constant TEMPLATE_ANCHOR_NAME_END => '"</a>"';
-use constant TOKEN_UPDATE_BEGIN_OF_ANCHOR_NAME_BEGIN =>
- '<!-- #BeginTocAnchorNameBegin -->';
-use constant TOKEN_UPDATE_END_OF_ANCHOR_NAME_BEGIN =>
- '<!-- #EndTocAnchorNameBegin -->';
-use constant TOKEN_UPDATE_BEGIN_OF_ANCHOR_NAME_END =>
- '<!-- #BeginTocAnchorNameEnd -->';
-use constant TOKEN_UPDATE_END_OF_ANCHOR_NAME_END =>
- '<!-- #EndTocAnchorNameEnd -->';
-use constant TOKEN_UPDATE_BEGIN_NUMBER =>
- '<!-- #BeginTocNumber -->';
-use constant TOKEN_UPDATE_END_NUMBER =>
- '<!-- #EndTocNumber -->';
-use constant TOKEN_UPDATE_BEGIN_TOC =>
- '<!-- #BeginToc -->';
-use constant TOKEN_UPDATE_END_TOC =>
- '<!-- #EndToc -->';
-
-use constant TEMPLATE_TOKEN_NUMBER => '"$node &nbsp;"';
-
- # Level templates
-use constant TEMPLATE_LEVEL => '"<li>$text\n"';
-use constant TEMPLATE_LEVEL_BEGIN => '"<ul>\n"';
-use constant TEMPLATE_LEVEL_END => '"</ul>\n"';
-
-
-END {}
-
-
-#--- HTML::Toc::new() ---------------------------------------------------------
-# function: Constructor
-
-sub new {
- # Get arguments
- my ($aType) = @_;
- # Local variables
- my $self;
-
- $self = bless({}, $aType);
- # Default to empty 'options' array
- $self->{options} = {};
- # Empty toc
- $self->{_toc} = "";
- # Hash reference to array for each groupId, each array element
- # referring to the group of the level indicated by the array index.
- # For example, with the default 'tokenGroups', '_levelGroups' would
- # look like:
- #
- # {'h'} => [\$group1, \$group2, \$group3, \$group4, \$group5, \$group6];
- #
- $self->{_levelGroups} = undef;
- # Set default options
- $self->_setDefaults();
- return $self;
-} # new()
-
-
-#--- HTML::Toc::_compareLevels() ----------------------------------------------
-# function: Compare levels.
-# args: - $aLevel: pointer to level
-# - $aGroupLevel
-# - $aPreviousLevel
-# - $aPreviousGroupLevel
-# returns: 0 if new level equals previous level, 1 if new level exceeds
-# previous level, -1 if new level is smaller then previous level.
-
-sub _compareLevels {
- # Get arguments
- my (
- $self, $aLevel, $aPreviousLevel, $aGroupLevel, $aPreviousGroupLevel
- ) = @_;
- # Local variables
- my ($result);
- # Levels equals?
- if (
- ($aLevel == $aPreviousLevel) &&
- ($aGroupLevel == $aPreviousGroupLevel)
- ) {
- # Yes, levels are equals;
- # Indicate so
- $result = 0;
- }
- else {
- # No, levels differ;
- # Bias to new level being smaller than previous level;
- $result = -1;
- # Must groups not be nested and do group levels differ?
- if (
- ($self->{options}{'doNestGroup'} == 0) &&
- ($aGroupLevel != $aPreviousGroupLevel)
- ) {
- # Yes, groups must be kept apart and the group levels differ;
- # Level is greater than previous level?
- if (
- ($aLevel > $aPreviousLevel)
- ) {
- # Yes, level is greater than previous level;
- # Indicate so
- $result = 1;
- }
- }
- else {
- # No, group must be nested;
- # Level is greater than previous level?
- if (
- ($aLevel > $aPreviousLevel) ||
- ($aGroupLevel > $aPreviousGroupLevel)
- ) {
- # Yes, level is greater than previous level;
- # Indicate so
- $result = 1;
- }
- }
- }
- # Return value
- return $result;
-} # _compareLevels()
-
-
-#--- HTML::TocGenerator::_formatLevelIndent() ---------------------------------
-# function: Format indent.
-# args: - $aText: text to indent
-# - $aLevel: Level.
-# - $aGroupLevel: Group level.
-# - $aAdd
-# - $aGlobalLevel
-
-sub _formatLevelIndent {
- # Get arguments
- my ($self, $aText, $aAdd, $aGlobalLevel) = @_;
- # Local variables
- my ($levelIndent, $indent, $nrOfIndents);
- # Alias indentation option
- $levelIndent = $self->{options}{'levelIndent'}; #=~ s/[0-9]+/&/;
- # Calculate number of indents
- $nrOfIndents = ($aGlobalLevel + $aAdd) * $levelIndent;
- # Assemble indents
- $indent = pack("A$nrOfIndents");
- # Return value
- return $indent . $aText;
-} # _formatLevelIndent()
-
-
-#--- HTML::Toc::_formatToc() --------------------------------------------------
-# function: Format ToC.
-# args: - aPreviousLevel
-# - aPreviousGroupLevel
-# - aToc: ToC to format.
-# - aHeaderLines
-# note: Recursive function this is.
-
-sub _formatToc {
- # Get arguments
- my (
- $self, $aPreviousLevel, $aPreviousGroupLevel, $aToc, $aHeaderLines,
- $aGlobalLevel
- ) = @_;
- # Local variables
- my ($level, $groupLevel, $line, $groupId, $text, $compareStatus);
- my ($anchorName, $globalLevel, $node, $sequenceNr);
-
- LOOP: {
- # Lines need processing?
- while (scalar(@$aHeaderLines) > 0) {
- # Yes, lines need processing;
- # Get line
- $line = shift @$aHeaderLines;
-
- # Determine levels
- ($level, $groupLevel, $groupId, $node, $sequenceNr,
- $anchorName, $text) = split(
- / /, $line, 7
- );
- # Must level and group be processed?
- if (
- ($level =~ m/$self->{options}{'levelToToc'}/) &&
- ($groupId =~ m/$self->{options}{'groupToToc'}/)
- ) {
- # Yes, level must be processed;
- # Compare levels
- $compareStatus = $self->_compareLevels(
- $level, $aPreviousLevel, $groupLevel, $aPreviousGroupLevel
- );
-
- COMPARE_LEVELS: {
-
- # Equals?
- if ($compareStatus == 0) {
- # Yes, levels are equal;
- # Format level
- $$aToc .= $self->_formatLevelIndent(
- ref($self->{_templateLevel}) eq "CODE" ?
- &{$self->{_templateLevel}}(
- $level, $groupId, $node, $sequenceNr, $text
- ) :
- eval($self->{_templateLevel}),
- 0, $aGlobalLevel
- );
- }
-
- # Greater?
- if ($compareStatus > 0) {
- # Yes, new level is greater than previous level;
- # Must level be single-stepped?
- if (
- $self->{options}{'doSingleStepLevel'} &&
- ($aPreviousLevel) &&
- ($level > $aPreviousLevel)
- ) {
- # Yes, level must be single-stepped;
- # Make sure, new level is increased one step only
- $level = $aPreviousLevel + 1;
- }
- # Increase global level
- $aGlobalLevel++;
- # Format begin of level
- $$aToc .= $self->_formatLevelIndent(
- eval($self->{_templateLevelBegin}), -1, $aGlobalLevel
- );
- # Process line again
- unshift @$aHeaderLines, $line;
- # Assemble TOC (recursive) for next level
- $self->_formatToc(
- $level, $groupLevel, $aToc, $aHeaderLines, $aGlobalLevel
- );
- # Format end of level
- $$aToc .= $self->_formatLevelIndent(
- eval($self->{_templateLevelEnd}), -1, $aGlobalLevel
- );
- # Decrease global level
- $aGlobalLevel--;
- # Exit loop
- last COMPARE_LEVELS;
- }
-
- # Smaller?
- if ($compareStatus < 0) {
- # Yes, new level is smaller than previous level;
- # Process line again
- unshift @$aHeaderLines, $line;
- # End loop
- last LOOP;
- }
- }
- }
- }
- }
-} # _formatToc()
-
-
-#--- HTML::Toc::_parseTokenGroups() -------------------------------------------
-# function: Parse token groups
-
-sub _parseTokenGroups {
- # Get arguments
- my ($self) = @_;
- # Local variables
- my ($group, $levelGroups, $numberingStyle);
-
- # Clear any previous 'levelGroups'
- $self->{_levelGroups} = undef;
- # Determine default 'numberingStyle'
- $numberingStyle = defined($self->{options}{'numberingStyle'}) ?
- $self->{options}{'numberingStyle'} : NUMBERING_STYLE_DECIMAL;
-
- # Loop through groups
- foreach $group (@{$self->{options}{'tokenToToc'}}) {
- # 'groupId' is specified?
- if (! defined($group->{'groupId'})) {
- # No, 'groupId' isn't specified;
- # Set default groupId
- $group->{'groupId'} = GROUP_ID_H;
- }
- # 'level' is specified?
- if (! defined($group->{'level'})) {
- # No, 'level' isn't specified;
- # Set default level
- $group->{'level'} = LEVEL_1;
- }
- # 'numberingStyle' is specified?
- if (! defined($group->{'numberingStyle'})) {
- # No, 'numberingStyle' isn't specified;
- # Set default numberingStyle
- $group->{'numberingStyle'} = $numberingStyle;
- }
- # Add group to '_levelGroups' variabele
- $self->{_levelGroups}{$group->{'groupId'}}[$group->{'level'} - 1] =
- $group;
- }
-} # _parseTokenGroups()
-
-
-#--- HTML::Toc::_setDefaults() ------------------------------------------------
-# function: Set default options.
-
-sub _setDefaults {
- # Get arguments
- my ($self) = @_;
- # Set default options
- $self->setOptions(
- {
- 'attributeToExcludeToken' => '-',
- 'attributeToTocToken' => '@',
- 'insertionPoint' => 'after <body>',
- 'levelToToc' => '.*',
- 'groupToToc' => '.*',
- 'doNumberToken' => 0,
- 'doLinkToFile' => 0,
- 'doLinkToToken' => 1,
- 'doLinkToId' => 0,
- 'doSingleStepLevel' => 1,
- 'linkUri' => '',
- 'levelIndent' => 3,
- 'doNestGroup' => 0,
- 'doUseExistingAnchors' => 1,
- 'doUseExistingIds' => 1,
- 'tokenToToc' => [
- {
- 'level' => 1,
- 'tokenBegin' => '<h1>'
- }, {
- 'level' => 2,
- 'tokenBegin' => '<h2>'
- }, {
- 'level' => 3,
- 'tokenBegin' => '<h3>'
- }, {
- 'level' => 4,
- 'tokenBegin' => '<h4>'
- }, {
- 'level' => 5,
- 'tokenBegin' => '<h5>'
- }, {
- 'level' => 6,
- 'tokenBegin' => '<h6>'
- }
- ],
- 'header' =>
- "\n<!-- Table of Contents generated by Perl - HTML::Toc -->\n",
- 'footer' =>
- "\n<!-- End of generated Table of Contents -->\n",
- }
- );
-} # _setDefaults()
-
-
-#--- HTML::Toc::clear() -------------------------------------------------------
-# function: Clear ToC.
-
-sub clear {
- # Get arguments
- my ($self) = @_;
- # Clear ToC
- $self->{_toc} = "";
- $self->{toc} = "";
- $self->{groupIdLevels} = undef;
- $self->{levels} = undef;
-} # clear()
-
-
-#--- HTML::Toc::format() ------------------------------------------------------
-# function: Format ToC.
-# returns: Formatted ToC.
-
-sub format {
- # Get arguments
- my ($self) = @_;
- # Local variables;
- my $toc = "";
- my @tocLines = split(/\r\n|\n/, $self->{_toc});
- # Format table of contents
- $self->_formatToc("0", "0", \$toc, \@tocLines, 0);
- # Remove last newline
- $toc =~ s/\n$//m;
- # Add header & footer
- $toc = $self->{options}{'header'} . $toc . $self->{options}{'footer'};
- # Return value
- return $toc;
-} # format()
-
-
-#--- HTML::Toc::parseOptions() ------------------------------------------------
-# function: Parse options.
-
-sub parseOptions {
- # Get arguments
- my ($self) = @_;
- # Alias options
- my $options = $self->{options};
-
- # Parse token groups
- $self->_parseTokenGroups();
-
- # Link ToC to tokens?
- if ($self->{options}{'doLinkToToken'}) {
- # Yes, link ToC to tokens;
- # Determine anchor href template begin
- $self->{_templateAnchorHrefBegin} =
- defined($options->{'templateAnchorHrefBegin'}) ?
- $options->{'templateAnchorHrefBegin'} :
- $options->{'doLinkToFile'} ?
- TEMPLATE_ANCHOR_HREF_BEGIN_FILE : TEMPLATE_ANCHOR_HREF_BEGIN;
-
- # Determine anchor href template end
- $self->{_templateAnchorHrefEnd} =
- defined($options->{'templateAnchorHrefEnd'}) ?
- $options->{'templateAnchorHrefEnd'} :
- TEMPLATE_ANCHOR_HREF_END;
-
- # Determine anchor name template
- $self->{_templateAnchorName} =
- defined($options->{'templateAnchorName'}) ?
- $options->{'templateAnchorName'} :
- TEMPLATE_ANCHOR_NAME;
-
- # Determine anchor name template begin
- $self->{_templateAnchorNameBegin} =
- defined($options->{'templateAnchorNameBegin'}) ?
- $options->{'templateAnchorNameBegin'} :
- TEMPLATE_ANCHOR_NAME_BEGIN;
-
- # Determine anchor name template end
- $self->{_templateAnchorNameEnd} =
- defined($options->{'templateAnchorNameEnd'}) ?
- $options->{'templateAnchorNameEnd'} :
- TEMPLATE_ANCHOR_NAME_END;
- }
-
- # Determine token number template
- $self->{_templateTokenNumber} =
- defined($options->{'templateTokenNumber'}) ?
- $options->{'templateTokenNumber'} :
- TEMPLATE_TOKEN_NUMBER;
-
- # Determine level template
- $self->{_templateLevel} =
- defined($options->{'templateLevel'}) ?
- $options->{'templateLevel'} :
- TEMPLATE_LEVEL;
-
- # Determine level begin template
- $self->{_templateLevelBegin} =
- defined($options->{'templateLevelBegin'}) ?
- $options->{'templateLevelBegin'} :
- TEMPLATE_LEVEL_BEGIN;
-
- # Determine level end template
- $self->{_templateLevelEnd} =
- defined($options->{'templateLevelEnd'}) ?
- $options->{'templateLevelEnd'} :
- TEMPLATE_LEVEL_END;
-
- # Determine 'anchor name begin' begin update token
- $self->{_tokenUpdateBeginOfAnchorNameBegin} =
- defined($options->{'tokenUpdateBeginOfAnchorNameBegin'}) ?
- $options->{'tokenUpdateBeginOfAnchorNameBegin'} :
- TOKEN_UPDATE_BEGIN_OF_ANCHOR_NAME_BEGIN;
-
- # Determine 'anchor name begin' end update token
- $self->{_tokenUpdateEndOfAnchorNameBegin} =
- defined($options->{'tokenUpdateEndOfAnchorNameBegin'}) ?
- $options->{'tokenUpdateEndOfAnchorNameBegin'} :
- TOKEN_UPDATE_END_OF_ANCHOR_NAME_BEGIN;
-
- # Determine 'anchor name end' begin update token
- $self->{_tokenUpdateBeginOfAnchorNameEnd} =
- defined($options->{'tokenUpdateBeginOfAnchorNameEnd'}) ?
- $options->{'tokenUpdateBeginOfAnchorNameEnd'} :
- TOKEN_UPDATE_BEGIN_OF_ANCHOR_NAME_END;
-
- # Determine 'anchor name end' end update token
- $self->{_tokenUpdateEndOfAnchorNameEnd} =
- defined($options->{'tokenUpdateEndOfAnchorNameEnd'}) ?
- $options->{'tokenUpdateEndOfAnchorNameEnd'} :
- TOKEN_UPDATE_END_OF_ANCHOR_NAME_END;
-
- # Determine number begin update token
- $self->{_tokenUpdateBeginNumber} =
- defined($options->{'tokenUpdateBeginNumber'}) ?
- $options->{'tokenUpdateBeginNumber'} :
- TOKEN_UPDATE_BEGIN_NUMBER;
-
- # Determine number end update token
- $self->{_tokenUpdateEndNumber} =
- defined($options->{'tokenUpdateEndNumber'}) ?
- $options->{'tokenUpdateEndNumber'} :
- TOKEN_UPDATE_END_NUMBER;
-
- # Determine toc begin update token
- $self->{_tokenUpdateBeginToc} =
- defined($options->{'tokenUpdateBeginToc'}) ?
- $options->{'tokenUpdateBeginToc'} :
- TOKEN_UPDATE_BEGIN_TOC;
-
- # Determine toc end update token
- $self->{_tokenUpdateEndToc} =
- defined($options->{'tokenUpdateEndToc'}) ?
- $options->{'tokenUpdateEndToc'} :
- TOKEN_UPDATE_END_TOC;
-
-} # parseOptions()
-
-
-#--- HTML::Toc::setOptions() --------------------------------------------------
-# function: Set options.
-# args: - aOptions: Reference to hash containing options.
-
-sub setOptions {
- # Get arguments
- my ($self, $aOptions) = @_;
- # Add options
- %{$self->{options}} = (%{$self->{options}}, %$aOptions);
-} # setOptions()
-
-
-1;
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/Toc.pod b/libvpx/examples/includes/HTML-Toc-0.91/Toc.pod
deleted file mode 100644
index 6348503..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/Toc.pod
+++ /dev/null
@@ -1,1710 +0,0 @@
-=head1 NAME
-
-HTML::Toc - Generate, insert and update HTML Table of Contents.
-
-=head1 DESCRIPTION
-
-Generate, insert and update HTML Table of Contents.
-
-=head1 Introduction
-
-The HTML::Toc consists out of the following packages:
-
- HTML::Toc
- HTML::TocGenerator
- HTML::TocInsertor
- HTML::TocUpdator
-
-HTML::Toc is the object which will eventually hold the Table of Contents. HTML::TocGenerator does the actual generation of the ToC. HTML::TocInsertor handles the insertion of the ToC in the source. HTML::TocUpdator takes care of updating previously inserted ToCs.
-
-HTML::Parser is the base object of HTML::TocGenerator, HTML::TocInsertor and HTML::TocUpdator. Each of these objects uses its predecessor as its ancestor, as shown in the UML diagram underneath:
-
- +---------------------+
- | HTML::Parser |
- +---------------------+
- +---------------------+
- | +parse() |
- | +parse_file() |
- +----------+----------+
- /_\
- |
- +----------+----------+ <<uses>> +-----------+
- | HTML::TocGenerator + - - - - - -+ HTML::Toc |
- +---------------------+ +-----------+
- +---------------------+ +-----------+
- | +extend() | | +clear() |
- | +extendFromFile() | | +format() |
- | +generate() | +-----+-----+
- | +generateFromFile() | :
- +----------+----------+ :
- /_\ :
- | :
- +----------+----------+ <<uses>> :
- | HTML::TocInsertor + - - - - - - - - -+
- +---------------------+ :
- +---------------------+ :
- | +insert() | :
- | +insertIntoFile() | :
- +----------+----------+ :
- /_\ :
- | :
- +----------+----------+ <<uses>> :
- | HTML::TocUpdator + - - - - - - - - -+
- +---------------------+
- +---------------------+
- | +insert() |
- | +insertIntoFile() |
- | +update() |
- | +updateFile() |
- +---------------------+
-
-When generating a ToC you'll have to decide which object you want to use:
-
- TocGenerator:
- for generating a ToC without inserting the ToC into the source
- TocInsertor:
- for generating a ToC and inserting the ToC into the source
- TocUpdator:
- for generating and inserting a ToC, removing any previously
- inserted ToC elements
-
-Thus in tabular view, each object is capable of:
-
- generating inserting updating
- ---------------------------------
- TocGenerator X
- TocInsertor X X
- TocUpdator X X X
-
-=head2 Generating
-
-The code underneath will generate a ToC of the HTML headings C<<h1>>..C<<h6>> from a file C<index.htm>:
-
- use HTML::Toc;
- use HTML::TocGenerator;
-
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $tocGenerator->generateFromFile($toc, 'index.htm');
- print $toc->format();
-
-For example, with C<index.htm> containing:
-
- <html>
- <body>
- <h1>Chapter</h1>
- </body>
- </html>
-
-the output will be:
-
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1>Chapter</a>
- </ul>
- <!-- End of generated Table of Contents -->
-
-=head2 Inserting
-
-This code will generate a ToC of HTML headings C<<h1>>..C<<h6>> of file C<index.htm>, and insert the ToC after the C<<body>> tag at the same time:
-
- use HTML::Toc;
- use HTML::TocInsertor;
-
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $tocInsertor->insertIntoFile($toc, 'index.htm');
-
-For example, with C<index.htm> containing:
-
- <html>
- <body>
- <h1>Chapter</h1>
- </body>
- </html>
-
-the output will be:
-
- <html>
- <body>
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1>Chapter</a>
- </ul>
- <!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Chapter</h1></a>
- </body>
- </html>
-
-If you're planning to update the inserted ToC, you'd better use C<TocUpdator> to insert the ToC. C<TocUpdator> marks the inserted ToC elements with update tokens. These update tokens allow C<TocUpdator> to identify and remove the ToC elements during a future update session. This code uses C<TocUpdator> instead of C<TocInsertor>:
-
- use HTML::Toc;
- use HTML::TocUpdator;
-
- my $toc = HTML::Toc->new();
- my $tocUpdator = HTML::TocUpdator->new();
-
- $tocUpdator->insertIntoFile($toc, 'index.htm');
-
-When applying the code above on 'index.htm':
-
- <html>
- <body>
- <h1>
- Chapter
- </h1>
- </body>
- </html>
-
-the output will contain additional update tokens:
-
- <!-- #BeginToc -->
- <!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin -->
- <!-- #EndTocAnchorNameBegin -->
- <!-- #BeginTocAnchorNameEnd -->
- <!-- #EndTocAnchorNameEnd -->
-
-around the inserted ToC elements:
-
- <html>
- <body><!-- #BeginToc-->
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1> Chapter </a>
- </ul>
- <!-- End of generated Table of Contents -->
- <!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
- </body>
- </html>
-
-Instead of C<HTML::TocUpdator::insertIntoFile> you can also use C<HTML::TocUpdator::updateFile()>. C<HTML::TocUpdator::updateFile()> will also insert the ToC, whether there is a ToC already inserted or not.
-
-=head2 Updating
-
-This code will generate a ToC of HTML headings C<<h1>>..C<<h6>> of file C<indexToc.htm>, and insert or update the ToC after the C<<body>> tag at the same time:
-
- use HTML::Toc;
- use HTML::TocUpdator;
-
- my $toc = HTML::Toc->new();
- my $tocUpdator = HTML::TocUpdator->new();
-
- $tocUpdator->updateFile($toc, 'indexToc.htm');
-
-For example, with C<indexToc.htm> containing:
-
- <html>
- <body><!-- #BeginToc -->
- foo
- <!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin -->bar<!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd -->foo<!-- #EndTocAnchorNameEnd -->
- </body>h
- </html>
-
-the output will be:
-
- <html>
- <body><!-- #BeginToc -->
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1> Chapter </a>
- </ul>
- <!-- End of generated Table of Contents -->
- <!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
- </body>
- </html>
-
-All text between the update tokens will be replaced. So be warned: all manual changes made to text between update tokens will be removed unrecoverable after calling C<HTML::TocUpdator::update()> or C<HTML::TocUpdator::updateFile()>.
-
-=head2 Formatting
-
-The ToC isn't generated all at once. There are two stages involved: generating and formatting. Generating the ToC actually means storing a preliminary ToC in C<HTML::Toc-E<gt>{_toc}>. This preliminary, tokenized ToC has to be turned into something useful by calling C<HTML::Toc-E<gt>format()>. For an example, see paragraph 'L<Generating|"generating">'.
-
-=head1 Advanced
-
-The ToC generation can be modified in a variety of ways. The following paragraphs each explain a single modification. An example of most of the modifications can be found in the C<manualTest.t> test file. Within this test, a manual containing:
-
- preface
- introduction
- table of contents
- table of figures
- table of tables
- parts
- chapters
- appendixes
- bibliography
-
-is formatted.
-
-=head2 Using attribute value as ToC text
-
-Normally, the ToC will be made of text between specified ToC tokens. It's also possible to use the attribute value of a token as a ToC text. This can be done by specifying the attribute marked with an L<attributeToTocToken|"attributeToTocToken"> within the L<tokenBegin|"tokenBegin"> token. For example, suppose you want to generate a ToC of the C<alt> attributes of the following image tokens:
-
- <body>
- <img src=test1.gif alt="First picture">
- <img src=test2.gif alt="Second picture">
- </body>
-
-This would be the code:
-
- use HTML::Toc;
- use HTML::TocInsertor;
-
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'tokenToToc' => [{
- 'groupId' => 'image',
- 'tokenBegin' => '<img alt=@>'
- }],
- });
- $tocInsertor->insertIntoFile($toc, $filename);
-
-and the output will be:
-
- <body>
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#image-1>First picture</a>
- <li><a href=#image-2>Second picture</a>
- </ul>
- <!-- End of generated Table of Contents -->
-
- <a name=image-1><img src=test1.gif alt="First picture"></a>
- <a name=image-2><img src=test2.gif alt="Second picture"></a>
- </body>
-
-=head2 Generate single ToC of multiple files
-
-Besides generating a ToC of a single file, it's also possible to generate a single ToC of multiple files. This can be done by specifying either an array of files as the file argument and/or by extending an existing ToC.
-
-=head3 Specify an array of files
-
-For example, suppose you want to generate a ToC of both C<doc1.htm>:
-
- <body>
- <h1>Chapter of document 1</h1>
- </body>
-
-and C<doc2.htm>:
-
- <body>
- <h1>Chapter of document 2</h1>
- </body>
-
-Here's the code to do so by specifying an array of files:
-
- use HTML::Toc;
- use HTML::TocGenerator;
-
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({'doLinkToFile' => 1});
- $tocGenerator->generateFromFile($toc, ['doc1.htm', 'doc2.htm']);
- print $toc->format();
-
-And the output will be:
-
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=doc1.htm#h-1>Chapter of document 1</a>
- <li><a href=doc2.htm#h-2>Chapter of document 2</a>
- </ul>
- <!-- End of generated Table of Contents -->
-
-=head3 Extend an existing ToC
-
-It's also possible to extend an existing ToC. For example, suppose we want the generate a ToC of file C<doc1.htm>:
-
- <body>
- <h1>Chapter of document 1</h1>
- </body>
-
-and extend this ToC with text from C<doc2.htm>:
-
- <body>
- <h1>Chapter of document 2</h1>
- </body>
-
-Here's the code to do so:
-
- use HTML::Toc;
- use HTML::TocGenerator;
-
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({'doLinkToFile' => 1});
- $tocGenerator->generateFromFile($toc, 'doc1.htm');
- $tocGenerator->extendFromFile($toc, 'doc2.htm');
- print $toc->format();
-
-And the output will be:
-
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=doc1.htm#h-1>Chapter of document 1</a>
- <li><a href=doc2.htm#h-2>Chapter of document 2</a>
- </ul>
- <!-- End of generated Table of Contents -->
-
-=head2 Generate multiple ToCs
-
-It's possible to generate multiple ToCs at once by specifying a C<HTML::Toc> object array as the ToC argument. For example, suppose you want to generate a default ToC of HTML headings <h1>..<h6> as well as a ToC of the C<alt> image attributes of the following text:
-
- <body>
- <h1>Header One</h1>
- <img src=test1.gif alt="First picture" id=image_001>
- <h2>Paragraph One</h2>
- <img src=test2.gif alt="Second picture" id=image_002>
- </body>
-
-Here's how you would do so:
-
- use HTML::Toc;
- use HTML::TocInsertor;
-
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc2->setOptions({
- 'tokenToToc' => [{
- 'groupId' => 'image',
- 'tokenBegin' => '<img alt=@>'
- }],
- });
- $tocInsertor->insertIntoFile([$toc1, $toc2], $filename);
-
-And the output will be:
-
- <body>
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1>Header One</a>
- <ul>
- <li><a href=#h-1.1>Paragraph One</a>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#image-1>First picture</a>
- <li><a href=#image-2>Second picture</a>
- </ul>
- <!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Header One</h1></a>
- <a name=image-1><img src=test1.gif alt="First picture"></a>
- <a name=h-1.1><h2>Paragraph One</h2></a>
- <a name=image-2><img src=test2.gif alt="Second picture"></a>
- </body>
-
-=head2 Generate multiple groups in one ToC
-
-You may want to generate a ToC consisting of multiple ToC groups.
-
-=head3 Specify an additional 'Appendix' group
-
-Suppose you want to generate a ToC with one group for the normal headings, and one group for the appendix headings, using this source file:
-
- <body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h3>Subparagraph</h3>
- <h1>Chapter</h1>
- <h1 class=appendix>Appendix Chapter</h1>
- <h2 class=appendix>Appendix Paragraph</h2>
- </body>
-
-With the code underneath:
-
- use HTML::Toc;
- use HTML::TocInsertor;
-
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'tokenBegin' => '<h2 class=-appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }]
- });
- $tocInsertor->insertIntoFile($toc, $filename);
-
-the output will be:
-
- <body>
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1>Chapter</a>
- <ul>
- <li><a href=#h-1.1>Paragraph</a>
- </ul>
- <li><a href=#h-2>Chapter</a>
- </ul>
- <ul>
- <li><a href=#appendix-1>Appendix Chapter</a>
- <ul>
- <li><a href=#appendix-1.1>Appendix Paragraph</a>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Chapter</h1></a>
- <a name=h-1.1><h2>Paragraph</h2></a>
- <h3>Subparagraph</h3>
- <a name=h-2><h1>Chapter</h1></a>
- <a name=appendix-1><h1 class=appendix>Appendix Chapter</h1></a>
- <a name=appendix-1.1><h2 class=appendix>Appendix Paragraph</h2></a>
- </body>
-
-=head3 Specify an additional 'Part' group
-
-Suppose you want to generate a ToC of a document which is divided in multiple parts like this file underneath:
-
- <body>
- <h1 class=part>First Part</h1>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h1 class=part>Second Part</h1>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- </body>
-
-With the code underneath:
-
- use HTML::Toc;
- use HTML::TocInsertor;
-
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-part>'
- }, {
- 'tokenBegin' => '<h2 class=-part>',
- 'level' => 2,
- }, {
- 'groupId' => 'part',
- 'tokenBegin' => '<h1 class=part>',
- 'level' => 1,
- 'numberingStyle' => 'upper-alpha'
- }]
- });
- $tocInsertor->insertIntoFile($toc, $filename);
-
-the output will be:
-
- <body>
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#part-A>First Part</a>
- </ul>
- <ul>
- <li><a href=#h-1>Chapter</a>
- <ul>
- <li><a href=#h-1.1>Paragraph</a>
- </ul>
- </ul>
- <ul>
- <li><a href=#part-B>Second Part</a>
- </ul>
- <ul>
- <li><a href=#h-2>Chapter</a>
- <ul>
- <li><a href=#h-2.1>Paragraph</a>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
- <a name=part-A><h1 class=part>A &nbsp;First Part</h1></a>
- <a name=h-1><h1>1 &nbsp;Chapter</h1></a>
- <a name=h-1.1><h2>1.1 &nbsp;Paragraph</h2></a>
- <a name=part-B><h1 class=part>B &nbsp;Second Part</h1></a>
- <a name=h-2><h1>2 &nbsp;Chapter</h1></a>
- <a name=h-2.1><h2>2.1 &nbsp;Paragraph</h2></a>
- </body>
-
-=head2 Number ToC entries
-
-By default, the generated ToC will list its entries unnumbered. If you want to number the ToC entries, two options are available. Either you can specify a numbered list by modifying L<templateLevelBegin|"templateLevelBegin"> and L<templateLevelEnd|"templateLevelEnd">. Or when the ToC isn't a simple numbered list, you can use the numbers generated by HTML::TocGenerator.
-
-=head3 Specify numbered list
-
-By modifying L<templateLevelBegin|"templateLevelBegin"> and L<templateLevelEnd|"templateLevelEnd"> you can specify a numbered ToC:
-
- use HTML::Toc;
- use HTML::TocGenerator;
-
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- });
- $tocGenerator->generateFromFile($toc, 'index.htm');
- print $toc->format();
-
-For instance with the original file containing:
-
- <body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- </body>
-
-The formatted ToC now will contain C<ol> instead of C<ul> tags:
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ol>
- <li><a href=#h-1>Chapter</a>
- <ol>
- <li><a href=#h-1.1>Paragraph</a>
- </ol>
- </ol>
- <!-- End of generated Table of Contents -->
-
-See also: L<Using CSS for ToC formatting|"Using CSS for ToC formatting">.
-
-=head3 Use generated numbers
-
-Instead of using the HTML ordered list (OL), it's also possible to use the generated numbers to number to ToC nodes. This can be done by modifying L<templateLevel|"templateLevel">:
-
- use HTML::Toc;
- use HTML::TocGenerator;
-
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({
- 'templateLevel' => '"<li>$node &nbsp;$text\n"',
- });
- $tocGenerator->generateFromFile($toc, 'index.htm');
- print $toc->format();
-
-For instance with the original file containing:
-
- <body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- </body>
-
-The formatted ToC now will have the node numbers hard-coded:
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li>1 &nbsp;<a href=#h-1>Chapter</a>
- <ul>
- <li>1.1 &nbsp;<a href=#h-1.1>Paragraph</a>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
-See also: L<Using CSS for ToC formatting|"Using CSS for ToC formatting">.
-
-=head2 Using CSS for ToC formatting
-
-Suppose you want to display a ToC with upper-alpha numbered appendix headings. To accomplish this, you can specify a CSS style within the source document:
-
- <html>
- <head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
- </head>
- <body>
- <h1 class=appendix>Appendix</h1>
- <h2 class=appendix>Appendix Paragraph</h2>
- <h1 class=appendix>Appendix</h1>
- <h2 class=appendix>Appendix Paragraph</h2>
- </body>
- </html>
-
-Here's the code:
-
- my $toc = new HTML::Toc;
- my $tocInsertor = new HTML::TocInsertor;
-
- $toc->setOptions({
- 'templateLevelBegin' => '"<ol class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'upper-alpha'
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2>',
- 'level' => 2,
- }]
- });
- $tocInsertor->insertIntoFile($toc, $filename);
-
-Which whill result in the following output:
-
- <html>
- <head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
- </head>
- <body>
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ol class=toc_appendix1>
- <li><a href=#appendix-A>Appendix</a>
- <ol class=toc_appendix2>
- <li><a href=#appendix-A.1>Appendix Paragraph</a>
- </ol>
- <li><a href=#appendix-B>Appendix</a>
- <ol class=toc_appendix2>
- <li><a href=#appendix-B.1>Appendix Paragraph</a>
- </ol>
- </ol>
- <!-- End of generated Table of Contents -->
-
- <a name=appendix-A><h1>A &nbsp;Appendix</h1></a>
- <a name=appendix-A.1><h2>A.1 &nbsp;Appendix Paragraph</h2></a>
- <a name=appendix-B><h1>B &nbsp;Appendix</h1></a>
- <a name=appendix-B.1><h2>B.1 &nbsp;Appendix Paragraph</h2></a>
- </body>
- </html>
-
-=head2 Creating site map
-
-Suppose you want to generate a table of contents of the E<lt>titleE<gt> tags of the files in the following directory structure:
-
- path file
-
- . index.htm, <title>Main</title>
- |- SubDir1 index.htm, <title>Sub1</title>
- | |- SubSubDir1 index.htm, <title>SubSub1</title>
- |
- |- SubDir2 index.htm, <title>Sub2</title>
- | |- SubSubDir1 index.htm, <title>SubSub1</title>
- | |- SubSubDir2 index.htm, <title>SubSub2</title>
- |
- |- SubDir3 index.htm, <title>Sub3</title>
-
-By specifying 'fileSpec' which determine how many slashes (/) each file may contain for a specific level:
-
- use HTML::Toc;
- use HTML::TocGenerator;
- use File::Find;
-
- my $toc = HTML::Toc->new;
- my $tocGenerator = HTML::TocGenerator->new;
- my @fileList;
-
- sub wanted {
- # Add file to 'fileList' if extension matches '.htm'
- push (@fileList, $File::Find::name) if (m/\.htm$/);
- }
-
- $toc->setOptions({
- 'doLinkToFile' => 1,
- 'templateAnchorName' => '""',
- 'templateAnchorHref' => '"<a href=$file"."#".$groupId.$level.">"',
- 'doLinkTocToToken' => 1,
- 'tokenToToc' => [{
- 'groupId' => 'dir',
- 'level' => 1,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+$'
- }, {
- 'groupId' => 'dir',
- 'level' => 2,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+?/[^/]+$'
- }, {
- 'groupId' => 'dir',
- 'level' => 3,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+?/[^/]+?/[^/]+$'
- }]
- });
-
- # Traverse directory structure
- find({wanted => \&wanted, no_chdir => 1}, '.');
- # Generate ToC of case-insensitively sorted file list
- $tocGenerator->extendFromFile(
- $toc, [sort {uc($a) cmp uc($b)} @fileList]
- );
- print $toc->format();
-
-the following ToC will be generated:
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=./index.htm#>Main</a>
- <ul>
- <li><a href=./SubDir1/index.htm#>Sub1</a>
- <ul>
- <li><a href=./SubDir1/SubSubDir1/index.htm#>SubSub1</a>
- </ul>
- <li><a href=./SubDir2/index.htm#>Sub2</a>
- <ul>
- <li><a href=./SubDir2/SubSubDir1/index.htm#>SubSub1</a>
- <li><a href=./SubDir2/SubSubDir2/index.htm#>SubSub2</a>
- </ul>
- <li><a href=./SubDir3/index.htm#>Sub3</a>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
-=head1 Methods
-
-=head2 HTML::Toc::clear()
-
- syntax: $toc->clear()
- returns: --
-
-Clear the ToC.
-
-=head2 HTML::Toc::format()
-
- syntax: $scalar = $toc->format()
- returns: Formatted ToC.
-
-Format tokenized ToC.
-
-=head2 HTML::TocGenerator::extend()
-
- syntax: $tocGenerator->extend($toc, $string [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to extend
- - $string: string to retrieve ToC from
- - $options: hash reference containing generator options.
-
-Extend ToC from specified string. For generator options, see L<HTML::TocGenerator Options|"HTML::TocGenerator Options">
-
-=head2 HTML::TocGenerator::extendFromFile()
-
- syntax: $tocGenerator->extendFromFile($toc, $filename [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to extend
- - $filename: (reference to array of) file(s) to extend ToC from
- - $options: hash reference containing generator options.
-
-Extend ToC from specified file. For generator options, see L<HTML::TocGenerator Options|"HTML::TocGenerator Options">. For an example, see L<Extend an existing ToC>.
-
-=head2 HTML::TocGenerator::generate()
-
- syntax: $tocGenerator->generate($toc, $string [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to generate
- - $string: string to retrieve ToC from
- - $options: hash reference containing generator options.
-
-Generate ToC from specified string. Before generating, the ToC will be cleared. For extending an existing ToC, use the L<HTML::TocGenerator::extend()|"HTML::TocGenerator::extend()"> method. For generator options, see L<HTML::TocGenerator Options|"HTML::TocGenerator Options">.
-
-=head2 HTML::TocGenerator::generateFromFile()
-
- syntax: $tocGenerator->generateFromFile($toc, $filename [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to
- generate
- - $filename: (reference to array of) file(s) to generate ToC from
- - $options: hash reference containing generator options.
-
-Generate ToC from specified file. Before generating, the ToC will be cleared. For extending an extisting ToC, use the L<HTML::TocGenerator::extendFromFile()|"HTML::TocGenerator::extendFromFile()"> method. For generator options, see L<HTML::TocGenerator Options|"HTML::TocGenerator Options">.
-
-=head2 HTML::TocInsertor::insert()
-
- syntax: $tocInsertor->insert($toc, $string [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to insert
- - $string: string to insert ToC in
- - $options: hash reference containing insertor options.
-
-Insert ToC into specified string. For insertor options, see L<HTML::TocInsertor Options|"HTML::TocInsertor Options">.
-
-=head2 HTML::TocInsertor::insertIntoFile()
-
- syntax: $tocInsertor->insertIntoFile($toc, $filename [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to insert
- - $filename: (reference to array of) file(s) to insert ToC in
- - $options: hash reference containing insertor options.
-
-Insert ToC into specified file. For insertor options, see L<HTML::TocInsertor Options|"HTML::TocInsertor Options">.
-
-=head2 HTML::TocUpdator::insert()
-
- syntax: $tocUpdator->insert($toc, $string [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to insert
- - $string: string to insert ToC in
- - $options: hash reference containing updator options.
-
-Insert ToC into specified string. Differs from L<HTML::TocInsertor::insert()|"HTML::TocInsertor::insert()"> in that inserted text will be surrounded with update tokens in order for C<HTML::TocUpdator> to be able to update this text the next time an update is issued. For updator options, see L<HTML::TocUpdator Options|"HTML::TocUpdator Options">.
-
-=head2 HTML::TocUpdator::insertIntoFile()
-
- syntax: $tocUpdator->insertIntoFile($toc, $filename [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to insert
- - $filename: (reference to array of) file(s) to insert ToC in
- - $options: hash reference containing updator options.
-
-Insert ToC into specified file. Differs from L<HTML::TocInsertor::insert()|"HTML::TocInsertor::insert()"> in that inserted text will be surrounded with update tokens in order for C<HTML::TocUpdator> to be able to update this text the next time an update is issued. For updator options, see L<HTML::TocUpdator Options|"HTML::TocUpdator Options">.
-
-=head2 HTML::TocUpdator::update()
-
- syntax: $tocUpdator->update($toc, $string [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to insert
- - $string: string to update ToC in
- - $options: hash reference containing updator options.
-
-Update ToC within specified string. For updator options, see L<HTML::TocUpdator Options|"HTML::TocUpdator Options">.
-
-=head2 HTML::TocUpdator::updateFile()
-
- syntax: $tocUpdator->updateFile($toc, $filename [, $options])
- args: - $toc: (reference to array of) HTML::Toc object(s) to insert
- - $filename: (reference to array of) file(s) to update ToC in
- - $options: hash reference containing updator options.
-
-Update ToC of specified file. For updator options, see L<HTML::TocUpdator Options|"HTML::TocUpdator Options">.
-
-=head1 Parser Options
-
-When generating a ToC, additional options may be specified which influence the way the ToCs are generated using either C<TocGenerator>, C<TocInsertor> or C<TocUpdator>. The options must be specified as a hash reference. For example:
-
- $tocGenerator->generateFromFile($toc, $filename, {doUseGroupsGlobal => 1});
-
-Available options are:
-
-=over 4
-
-=item L<doGenerateToc|"doGenerateToc">
-
-=item L<doUseGroupsGlobal|"doUseGroupsGlobal">
-
-=item L<output|"output">
-
-=item L<outputFile|"outputFile">
-
-=back
-
-=head2 doGenerateToc
-
- syntax: [0|1]
- default: 1
- applicable to: TocInsertor, TocUpdator
-
-True (1) if ToC must be generated. False (0) if ToC must be inserted only.
-
-=head2 doUseGroupsGlobal
-
- syntax: [0|1]
- default: 0
- applicable to: TocGenerator, TocInsertor, TocUpdator
-
-True (1) if group levels must be used globally accross ToCs. False (0) if not. This option only makes sense when an array of ToCs is specified. For example, suppose you want to generate two ToCs, one ToC for '<h1>' tokens and one ToC for '<h2>' tokens, of the file 'index.htm':
-
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
-
-Using the default setting of 'doUseGroupsGlobal' => 0:
-
- use HTML::Toc;
- use HTML::TocGenerator;
-
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc1->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h1>'}]
- });
- $toc2->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h2>'}]
- });
- $tocGenerator->generateFromFile([$toc1, $toc2], 'index.htm');
- print $toc1->format() . "\n\n" . $toc2->format();
-
-the output will be:
-
- <ul>
- <li><a href=#h-1>Chapter</a>
- </ul>
-
- <ul>
- <li><a href=#h-1>Paragraph</a>
- </ul>
-
-Each ToC will use its own numbering scheme. Now if 'C<doUseGroupsGlobal = 1>' is specified:
-
- $tocGenerator->generateFromFile(
- [$toc1, $toc2], 'index.htm', {'doUseGroupsGlobal' => 1}
- );
-
-the output will be:
-
- <ul>
- <li><a href=#h-1>Chapter</a>
- </ul>
-
- <ul>
- <li><a href=#h-2>Paragraph</a>
- </ul>
-
-using a global numbering scheme for all ToCs.
-
-=head2 output
-
- syntax: reference to scalar
- default: none
- applicable to: TocInsertor, TocUpdator
-
-Reference to scalar where the output must be stored in.
-
-=head2 outputFile
-
- syntax: scalar
- default: none
- applicable to: TocInsertor, TocUpdator
-
-Filename to write output to. If no filename is specified, output will be written to standard output.
-
-=head1 HTML::Toc Options
-
-The C<HTML::Toc> options can be grouped in the following categories:
-
-=over 4
-
-=item L<Generate options|"Generate options">
-
-=item L<Insert options|"Insert options">
-
-=item L<Update options|"Update options">
-
-=item L<Format options|"Format options">
-
-=back
-
-The ToC options must be specified using the 'setOptions' method. For example:
-
- my $toc = new HTML::Toc;
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'footer' => '<!-- End Of ToC -->'
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'lower-alpha'
- }]
- });
-
-=head2 Generate options
-
-=over 4
-
-=item Token groups
-
-=over 4
-
-=item L<tokenToToc|"tokenToToc">
-
-=over 4
-
-=item L<doNumberToken|"doNumberToken">
-
-=item L<fileSpec|"fileSpec">
-
-=item L<groupId|"groupId">
-
-=item L<level|"level">
-
-=item L<tokenBegin|"tokenBegin">
-
-=item L<tokenEnd|"tokenEnd">
-
-=item L<numberingStyle|"numberingStyle">
-
-=back
-
-=item L<groupToToc|"groupToToc">
-
-=item L<levelToToc|"levelToToc">
-
-=back
-
-=item Numbering tokens
-
-=over 4
-
-=item L<doNumberToken|"doNumberToken">
-
-=item L<numberingStyle|"numberingStyle">
-
-=item L<templateTokenNumber|"templateTokenNumber">
-
-=back
-
-=item Miscellaneous
-
-=over 4
-
-=item L<attributeToExcludeToken|"attributeToExcludeToken">
-
-=item L<attributeToTocToken|"attributeToTocToken">
-
-=item L<groupToToc|"groupToToc">
-
-=item L<levelToToc|"levelToToc">
-
-=back
-
-=item Linking ToC to tokens
-
-=over 4
-
-=item L<doLinkToToken|"doLinkToToken">
-
-=item L<doLinkToFile|"doLinkToFile">
-
-=item L<doLinkToId|"doLinkToId">
-
-=item L<templateAnchorName|"templateAnchorName">
-
-=item L<templateAnchorHrefBegin|"templateAnchorHrefBegin">
-
-=item L<templateAnchorHrefEnd|"templateAnchorHrefEnd">
-
-=item L<templateAnchorNameBegin|"templateAnchorNameBegin">
-
-=item L<templateAnchorNameEnd|"templateAnchorNameEnd">
-
-=back
-
-=back
-
-=head2 Insert options
-
-=over 4
-
-=item L<insertionPoint|"insertionPoint">
-
-=back
-
-=head2 Update options
-
-=over 4
-
-=item L<tokenUpdateBeginAnchorName|"tokenUpdateBeginAnchorName">
-
-=item L<tokenUpdateEndAnchorName|"tokenUpdateEndAnchorName">
-
-=item L<tokenUpdateBeginToc|"tokenUpdateBeginToc">
-
-=item L<tokenUpdateEndToc|"tokenUpdateEndToc">
-
-=item L<tokenUpdateBeginNumber|"tokenUpdateBeginNumber">
-
-=item L<tokenUpdateEndNumber|"tokenUpdateEndNumber">
-
-=back
-
-=head2 Format options
-
-=over 4
-
-=item L<doSingleStepLevel|"doSingleStepLevel">
-
-=item L<doNestGroup|"doNestGroup">
-
-=item L<footer|"footer">
-
-=item L<groupToToc|"groupToToc">
-
-=item L<header|"header">
-
-=item L<levelIndent|"levelIndent">
-
-=item L<levelToToc|"levelToToc">
-
-=item L<templateLevelBegin|"templateLevelBegin">
-
-=item L<templateLevelEnd|"templateLevelEnd">
-
-=back
-
-=head1 HTML::Toc Options Reference
-
-=head2 attributeToExcludeToken
-
- syntax: $scalar
- default: '-'
-
-Token which marks an attribute value in a L<tokenBegin|"tokenBegin"> or L<insertionPoint|"insertionPoint"> token as an attribute value a token should not have to be marked as a ToC token. See also: L<Using attribute value as ToC entry|"Using attribute value as ToC text">.
-
-=head2 attributeToTocToken
-
- syntax: $scalar
- default: '@'
-
-Token which marks an attribute in a L<tokenBegin|"tokenBegin"> token as an attribute which must be used as ToC text. See also: L<Using attribute value as ToC entry|"Using attribute value as ToC text">.
-
-=head2 doLinkToToken
-
- syntax: [0|1]
- default: 1
-
-True (1) if ToC must be linked to tokens, False (0) if not. Note that 'HTML::TocInsertor' must be used to do the actual insertion of the anchor name within the source data.
-
-=head2 doLinkToFile
-
- syntax: [0|1]
- default: 0
-
-True (1) if ToC must be linked to file, False (0) if not. In effect only when L<doLinkToToken|"doLinkToToken"> equals True (1) and L<templateAnchorHrefBegin|"templateAnchorHrefBegin"> isn't specified.
-
-=head2 doLinkToId
-
- syntax: [0|1]
- default: 0
-
-True (1) if ToC must be linked to tokens by using token ids. False (0) if ToC must be linked to tokens by using anchor names.
-
-=head2 doNestGroup
-
- syntax: [0|1]
- default: 0
-
-True (1) if groups must be nested in the formatted ToC, False (0) if not. In effect only when multiple groups are specified within the L<tokenToToc|"tokenToToc"> setting. For an example, see L<Generate multiple groups in one ToC|"Generate multiple groups in one ToC">.
-
-=head2 doNumberToken
-
- syntax: [0|1]
- default: 0
-
-True (1) if tokens which are used for the ToC generation must be numbered. This option may be specified both as a global ToC option or within a L<tokenToToc|"tokenToToc"> group. When specified within a C<tokenToToc> option, the C<doNumberToken> applies to that group only. For an example, see L<Specify an additional 'Part' group|"Specify an additional 'Part' group">.
-
-=head2 doSingleStepLevel
-
- syntax: [0|1]
- default: 1
-
-True (1) if levels of a formatted ToC must advance one level at a time. For example, when generating a ToC of a file with a missing '<h2>':
-
- <h1>Chapter</h1>
- <h3>Paragraph</h3>
-
-By default, an empty indentation level will be inserted in the ToC:
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1>Header 1</a>
- <ul>
- <ul>
- <li><a href=#h-1.0.1>Header 3</a>
- </ul>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
-After specifying:
-
- $toc->setOptions({'doSingleStepLevel' => 0});
-
-the ToC will not have an indentation level inserted for level 2:
-
- <!-- Table of Contents generated by Perl - HTML::Toc -->
- <ul>
- <li><a href=#h-1>Header 1</a>
- <ul>
- <li><a href=#h-1.0.1>Header 3</a>
- </ul>
- </ul>
- <!-- End of generated Table of Contents -->
-
-=head2 fileSpec
-
- syntax: <regexp>
- default: undef
-
-Specifies which files should match the current level. Valid only if L<doLinkToFile|"doLinkToFile"> equals 1. For an example, see L<Site map|"Site map">.
-
-=head2 footer
-
- syntax: $scalar
- default: "\n<!-- End of generated Table of Contents -->\n"
-
-String to output at end of ToC.
-
-=head2 groupId
-
- syntax: $scalar
- default: 'h'
-
-Sets the group id attribute of a tokenGroup. With this attribute it's possible to divide the ToC into multiple groups. Each group has its own numbering scheme. For example, to generate a ToC of both normal headings and 'appendix' headings, specify the following ToC settings:
-
- $toc->setOptions({
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>'
- }]
- });
-
-=head2 groupToToc
-
- syntax: <regexp>
- default: '.*'
-
-Determines which groups to use for generating the ToC. For example, to create a ToC for groups [a-b] only, specify:
-
- 'groupToToc => '[a-b]'
-
-This option is evaluated during both ToC generation and ToC formatting. This enables you to generate a ToC of all groups, but - after generating - format only specified groups:
-
- $toc->setOptions({'groupToToc' => '.*'});
- $tocGenerator->generateToc($toc, ...);
- # Get ToC of all groups
- $fullToc = $toc->format();
- # Get ToC of 'appendix' group only
- $toc->setOptions({'groupToToc' => 'appendix'});
- $appendixToc = $toc->format();
-
-=head2 header
-
- syntax: $scalar
- default: "\n<!-- Table of Contents generated by Perl - HTML::Toc -->\n"
-
-String to output at begin of ToC.
-
-
-=head2 insertionPoint
-
- syntax: [<before|after|replace>] <token>
- default: 'after <body>'
- token: <[/]tag{ attribute=[-|@]<regexp>}> |
- <text regexp> |
- <declaration regexp> |
- <comment regexp>
-
-Determines the point within the source, where the ToC should be inserted. When specifying a start tag as the insertion point token, attributes to be included may be specified as well. Note that the attribute value must be specified as a regular expression. For example, to specify the C<<h1 class=header>> tag as insertion point:
-
- '<h1 class=^header$>'
-
-Examples of valid 'insertionPoint' tokens are:
-
- '<h1>'
- '</h1>'
- '<!-- ToC -->'
- '<!ToC>'
- 'ToC will be placed here'
-
-It is also possible to specify attributes to exclude, by prefixing the value with an L<attributeToExcludeToken|"attributeToExcludeToken">, default a minus sign (-). For example, to specify the C<<h1>> tag as insertion point, excluding all C<<h1 class=header>> tags:
-
- '<h1 class=-^header$>'
-
-See also L<tokenBegin|"tokenBegin">.
-
-=head2 level
-
- syntax: number
- default: 1
-
-Number which identifies at which level the tokengroup should be incorporated into the ToC. See also: L<tokenToToc|"tokenToToc">.
-
-=head2 levelIndent
-
- syntax: number
- default: 3
-
-Sets the number of spaces each level will be indented, when formatting the ToC.
-
-=head2 levelToToc
-
- syntax: <regexp>
- default: '.*'
-
-Determines which group levels to use for generating the ToC. For example, to create a ToC for levels 1-2 only, specify:
-
- 'levelToToc => '[1-2]'
-
-This option is evaluated during both ToC generation and ToC formatting. This enables you to generate a ToC of all levels, but - after generating - retrieve only specified levels:
-
- $toc->setOptions({'levelToToc' => '.*'});
- $tocGenerator->generateToc($toc, ...);
- # Get ToC of all levels
- $fullToc = $toc->getToc();
- # Get ToC of level 1 only
- $toc->setOptions({'levelToToc' => '1'});
- $level1Toc = $toc->getToc();
-
-=head2 numberingStyle
-
- syntax: [decimal|lower-alpha|upper-alpha|lower-roman|upper-roman]}
- default: decimal
-
-Determines which numbering style to use for a token group when L<doLinkToToken|"doLinkToToken"> is set to True (1). When specified as a main ToC option, the setting will be the default for all groups. When specified within a tokengroup, this setting will override any default for that particular tokengroup, e.g.:
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'lower-alpha'
- }]
- });
-
-If C<roman> style is specified, be sure to have the Roman module installed, available from L<http://www.perl.com/CPAN/modules/by-module/Roman>.
-
-=head2 templateAnchorName
-
- syntax: <expression|function reference>
- default: '$groupId."-".$node'
-
-Anchor name to use when L<doLinkToToken|"doLinkToToken"> is set to True (1). The anchor name is passed to both L<templateAnchorHrefBegin|"templateAnchorHrefBegin"> and L<templateAnchorNameBegin|"templateAnchorNameBegin">. The template may be specified as either an expression or a function reference. The expression may contain the following variables:
-
- $file
- $groupId
- $level
- $node
-
-If C<templateAnchorHrefBegin> is a function reference to a function returning the anchor, like in:
-
- $toc->setOptions({'templateAnchorName' => \&assembleAnchorName});
-
-the function will be called with the following arguments:
-
- $anchorName = assembleAnchorName($file, $groupId, $level, $node);
-
-=head2 templateAnchorHrefBegin
-
- syntax: <expression|function reference>
- default: '"<a href=#$anchorName>"' or
- '"<a href=$file#$anchorName>"',
- depending on 'doLinkToFile' being 0 or 1 respectively.
-
-Anchor reference begin token to use when L<doLinkToToken|"doLinkToToken"> is set to True (1). The template may be specified as either an expression or a function reference. The expression may contain the following variables:
-
- $file
- $groupId
- $level
- $node
- $anchorName
-
-If C<templateAnchorHrefBegin> is a function reference to a function returning the anchor, like in:
-
- $toc->setOptions({'templateAnchorHrefBegin' => \&assembleAnchorHrefBegin});
-
-the function will be called with the following arguments:
-
- $anchorHrefBegin = &assembleAnchorHrefBegin(
- $file, $groupId, $level, $node, $anchorName
- );
-
-See also: L<templateAnchorName|"templateAnchorName">, L<templateAnchorHrefEnd|"templateAnchorHrefEnd">.
-
-=head2 templateAnchorHrefEnd
-
- syntax: <expression|function reference>
- default: '"</a>"'
-
-Anchor reference end token to use when L<doLinkToToken|"doLinkToToken"> is set to True (1). The template may be specified as either an expression or a function reference. If L<templateAnchorHrefEnd|"templateAnchorHrefEnd"> is a function reference to a function returning the anchor end, like in:
-
- $toc->setOptions({'templateAnchorHrefEnd' => \&assembleAnchorHrefEnd});
-
-the function will be called without arguments:
-
- $anchorHrefEnd = &assembleAnchorHrefEnd;
-
-See also: L<templateAnchorHrefBegin|"templateAnchorHrefBegin">.
-
-=head2 templateAnchorNameBegin
-
- syntax: <expression|function reference>
- default: '"<a name=$anchorName>"'
-
-Anchor name begin token to use when L<doLinkToToken|"doLinkToToken"> is set to True (1). The template may be specified as either an expression or a function reference. The expression may contain the following variables:
-
- $file
- $groupId
- $level
- $node
- $anchorName
-
-If C<templateAnchorNameBegin> is a function reference to a function returning the anchor name, like in:
-
- $toc->setOptions({'templateAnchorNameBegin' => \&assembleAnchorNameBegin});
-
-the function will be called with the following arguments:
-
- $anchorNameBegin = assembleAnchorNameBegin(
- $file, $groupId, $level, $node, $anchorName
- );
-
-See also: L<templateAnchorName|"templateAnchorName">, L<templateAnchorNameEnd|"templateAnchorNameEnd">.
-
-=head2 templateAnchorNameEnd
-
- syntax: <expression|function reference>
- default: '"</a>"'
-
-Anchor name end token to use when L<doLinkToToken|"doLinkToToken"> is set to True (1). The template may be specified as either an expression or a function reference. If L<templateAnchorNameEnd|"templateAnchorNameEnd"> is a function reference to a function returning the anchor end, like in:
-
- $toc->setOptions({'templateAnchorNameEnd' => \&assembleAnchorNameEnd});
-
-the function will be called without arguments:
-
- $anchorNameEnd = &assembleAnchorNameEnd;
-
-See also: L<templateAnchorNameBegin|"templateAnchorNameBegin">.
-
-=head2 templateLevel
-
- syntax: <expression|function reference>
- default: '"<li>$text\n"'
-
-Expression to use when formatting a ToC node. The template may be specified as either an expression or a function reference. The expression may contain the following variables:
-
- $level
- $groupId
- $node
- $sequenceNr
- $text
-
-If C<templateLevel> is a function reference to a function returning the ToC node, like in:
-
- $toc->setOptions({'templateLevel' => \&AssembleTocNode});
-
-the function will be called with the following arguments:
-
- $tocNode = &AssembleTocNode(
- $level, $groupId, $node, $sequenceNr, $text
- );
-
-=head2 templateLevelBegin
-
- syntax: <expression>
- default: '"<ul>\n"'
-
-Expression to use when formatting begin of ToC level. See L<templateLevel|"templateLevel"> for list of available variables to use within the expression. For example, to give each ToC level a class name to use with Cascading Style Sheets (CSS), use the expression:
-
- '"<ul class=toc_$groupId$level>\n"'
-
-which will result in each ToC group being given a class name:
-
- <ul class=toc_h1>
- <li>Header
- </ul>
-
-For an example, see L<Using CSS for ToC formatting|"Using CSS for ToC formatting">.
-
-=head2 templateLevelEnd
-
- syntax: <expression>
- default: '"<ul>\n"'
-
-Expression to use when formatting end of ToC level. See L<templateLevel|"templateLevel"> for a list of available variables to use within the expression. The default expression is:
-
- '"</ul>\n"'
-
-For an example, see L<Using CSS for ToC formatting|"Using CSS for ToC formatting">.
-
-=head2 templateTokenNumber
-
- syntax: <expression|function reference>
- default: '"$node &nbsp;"'
-
-Token number to use when L<doNumberToken|"doNumberToken"> equals True (1). The template may be specified as either an expression or a function reference. The expression has access to the following variables:
-
- $file
- $groupId
- $groupLevel
- $level
- $node
- $toc
-
-If C<templateTokenNumber> is a function reference to a function returning the token number, like in:
-
- $toc->setOptions({'templateTokenNumber' => \&assembleTokenNumber});
-
-the function will be called with the following arguments:
-
- $number = &assembleTokenNumber(
- $node, $groupId, $file, $groupLevel, $level, $toc
- );
-
-=head2 tokenBegin
-
- syntax: <token>
- default: '<h1>'
- token: <[/]tag{ attribute=[-|@]<regexp>}> |
- <text regexp> |
- <declaration regexp> |
- <comment regexp>
-
-This scalar defines the token that will trigger text to be put into the ToC. Any start tag, end tag, comment, declaration or text string can be specified. Examples of valid 'tokenBegin' tokens are:
-
- '<h1>'
- '</end>'
- '<!-- Start ToC entry -->'
- '<!Start ToC entry>'
- 'ToC entry'
-
-When specifying a start tag, attributes to be included may be specified as well. Note that the attribute value is used as a regular expression. For example, to specify the C<<h1 class=header>> tag as tokenBegin:
-
- '<h1 class=^header$>'
-
-It is also possible to specify attributes to exclude, by prefixing the value with an L<attributeToExcludeToken|"attributeToExcludeToken">, default a minus sign (-). For example, to specify the C<<h1>> tag as tokenBegin, excluding all C<<h1 class=header>> tags:
-
- '<h1 class=-^header$>'
-
-Also, you can specify here an attribute value which has to be used as ToC text, by prefixing the value with an L<attributeToTocToken|"">, default an at sign (@). For example, to use the class value as ToC text:
-
- '<h1 class=@>'
-
-See L<Generate multiple ToCs|"Generate multiple ToCs"> for an elaborated example using the C<attributeToTocToken> to generate a ToC of image C<alt> attribute values.
-
-See also: L<tokenEnd|"tokenEnd">, L<tokenToToc|"tokenToToc">.
-
-=head2 tokenEnd
-
- syntax: $scalar
- default: empty string ('') or end tag counterpart of 'tokenBegin' if
- 'tokenBegin' is a start tag
-
-The 'tokenEnd' definition applies to the same rules as L<tokenBegin|"tokenBegin">.
-
-See also: L<tokenBegin|"tokenBegin">, L<tokenToToc|"tokenToToc">.
-
-=head2 tokenToToc
-
- syntax: [{array of hashrefs}]
- default: [{
- 'level' => 1,
- 'tokenBegin' => '<h1>'
- }, {
- 'level' => 2,
- 'tokenBegin' => '<h2>'
- }, {
- 'level' => 3,
- 'tokenBegin' => '<h3>'
- }, {
- 'level' => 4,
- 'tokenBegin' => '<h4>'
- }, {
- 'level' => 5,
- 'tokenBegin' => '<h5>'
- }, {
- 'level' => 6,
- 'tokenBegin' => '<h6>'
- }]
-
-This hash define the tokens that must act as ToC entries. Each tokengroup may contain a L<groupId|"groupId">, L<level|"level">, L<numberingStyle|"numberingStyle">, L<tokenBegin|"tokenBegin"> and L<tokenEnd|"tokenEnd"> identifier.
-
-=head2 tokenUpdateBeginAnchorName
-
- syntax: <string>
- default: '<!-- #BeginTocAnchorNameBegin -->';
-
-This token marks the begin of an anchor name, inserted by C<HTML::TocInsertor>. This option is used by C<HTML::TocUpdator>.
-
-=head2 tokenUpdateEndAnchorName
-
- syntax: <string>
- default: '<!-- #EndTocAnchorName -->';
-
-This option is used by C<HTML::TocUpdator>, to mark the end of an inserted anchor name.
-
-=head2 tokenUpdateBeginNumber
-
- syntax: <string>
- default: '<!-- #BeginTocNumber -->';
-
-This option is used by C<HTML::TocUpdator>, to mark the begin of an inserted number.
-
-=head2 tokenUpdateEndNumber
-
- syntax: <string>
- default: '<!-- #EndTocAnchorName -->';
-
-This option is used by C<HTML::TocUpdator>, to mark the end of an inserted number.
-
-=head2 tokenUpdateBeginToc
-
- syntax: <string>
- default: '<!-- #BeginToc -->';
-
-This option is used by C<HTML::TocUpdator>, to mark the begin of an inserted ToC.
-
-=head2 tokenUpdateEndToc
-
- syntax: <string>
- default: '<!-- #EndToc -->';
-
-This option is used by C<HTML::TocUpdator>, to mark the end of an inserted ToC.
-
-=head1 Known issues
-
-=head2 Cygwin
-
-In order for the test files to run on Cygwin without errors, the 'UNIX' default text file type has to be selected during the Cygwin setup.
-When extracting the tar.gz file with WinZip the 'TAR file smart CR/LF conversion' has to be turned off via {Options|Configuration...|Miscellaneous} in order for the files 'toc.pod' and './manualTest/manualTest1.htm' to be left in UNIX format.
-
-=head2 Nested anchors
-
-HTML::Toc can only link to existing anchors if these anchors are placed outside of the ToC tokens. Otherwise a warning will be given. For example, generating a L<linked|"doLinkToToken"> ToC of C<E<lt>h1E<gt>> tokens of the following text:
-
- <a name=foo><h1>Header</h1></a>
-
-will go all right, whereas:
-
- <h1><a name=foo>Header</a></h1>
-
-will yield the warning:
-
- warning (1): Nested anchor '<a name=foo>' within anchor '<a name=h-1>'.
-
-since anchor names aren't allowed to be nested according to the HTML 4.01 specification.
-
-=head1 AUTHOR
-
-Freddy Vulto E<lt>L<"fvu@fvu.myweb.nl">E<gt>
-
-=head1 COPYRIGHT
-
-Copyright (c) 2001 Freddy Vulto. All rights reserved.
-
-This library is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-=cut
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/TocGenerator.pm b/libvpx/examples/includes/HTML-Toc-0.91/TocGenerator.pm
deleted file mode 100644
index 8c49194..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/TocGenerator.pm
+++ /dev/null
@@ -1,1793 +0,0 @@
-#=== HTML::TocGenerator =======================================================
-# function: Generate 'HTML::Toc' table of contents.
-# note: - 'TT' is an abbrevation of 'TocToken'.
-
-
-package HTML::TocGenerator;
-
-
-use strict;
-use HTML::Parser;
-
-
-BEGIN {
- use vars qw(@ISA $VERSION);
-
- $VERSION = '0.91';
-
- @ISA = qw(HTML::Parser);
-}
-
-
- # Warnings
-use constant WARNING_NESTED_ANCHOR_PS_WITHIN_PS => 1;
-use constant WARNING_TOC_ATTRIBUTE_PS_NOT_AVAILABLE_WITHIN_PS => 2;
-
-
-use constant TOC_TOKEN_ID => 0;
-use constant TOC_TOKEN_INCLUDE => 1;
-use constant TOC_TOKEN_EXCLUDE => 2;
-use constant TOC_TOKEN_TOKENS => 3;
-use constant TOC_TOKEN_GROUP => 4;
-use constant TOC_TOKEN_TOC => 5;
-
- # Token types
-use constant TT_TAG_BEGIN => 0;
-use constant TT_TAG_END => 1;
-use constant TT_TAG_TYPE_END => 2;
-use constant TT_INCLUDE_ATTRIBUTES_BEGIN => 3;
-use constant TT_EXCLUDE_ATTRIBUTES_BEGIN => 4;
-use constant TT_INCLUDE_ATTRIBUTES_END => 5;
-use constant TT_EXCLUDE_ATTRIBUTES_END => 6;
-use constant TT_GROUP => 7;
-use constant TT_TOC => 8;
-use constant TT_ATTRIBUTES_TOC => 9;
-
-
-use constant CONTAINMENT_INCLUDE => 0;
-use constant CONTAINMENT_EXCLUDE => 1;
-
-use constant TEMPLATE_ANCHOR => '$groupId."-".$node';
-use constant TEMPLATE_ANCHOR_HREF =>
- '"<a href=#".' . TEMPLATE_ANCHOR . '.">"';
-use constant TEMPLATE_ANCHOR_HREF_FILE =>
- '"<a href=".$file."#".' . TEMPLATE_ANCHOR . '.">"';
-use constant TEMPLATE_ANCHOR_NAME =>
- '"<a name=".' . TEMPLATE_ANCHOR . '.">"';
-
-use constant TEMPLATE_TOKEN_NUMBER => '"$node &nbsp"';
-
-
-use constant TT_TOKENTYPE_START => 0;
-use constant TT_TOKENTYPE_END => 1;
-use constant TT_TOKENTYPE_TEXT => 2;
-use constant TT_TOKENTYPE_COMMENT => 3;
-use constant TT_TOKENTYPE_DECLARATION => 4;
-
-
-END {}
-
-
-#--- HTML::TocGenerator::new() ------------------------------------------------
-# function: Constructor
-
-sub new {
- # Get arguments
- my ($aType) = @_;
- my $self = $aType->SUPER::new;
- # Bias to not generate ToC
- $self->{_doGenerateToc} = 0;
- # Bias to not use global groups
- $self->{_doUseGroupsGlobal} = 0;
- # Output
- $self->{output} = "";
- # Reset internal variables
- $self->_resetBatchVariables();
-
- $self->{options} = {};
-
- return $self;
-} # new()
-
-
-#--- HTML::TocGenerator::_deinitializeBatch() ---------------------------------
-
-sub _deinitializeBatch() {
- # Get arguments
- my ($self) = @_;
-} # _deinitializeBatch()
-
-
-#--- HTML::TocGenerator::_deinitializeExtenderBatch() -------------------------
-
-sub _deinitializeExtenderBatch() {
- # Get arguments
- my ($self) = @_;
- # Do general batch deinitialization
- $self->_deinitializeBatch();
- # Indicate end of ToC generation
- $self->{_doGenerateToc} = 0;
- # Reset batch variables
- $self->_resetBatchVariables();
-} # _deinitializeExtenderBatch()
-
-
-#--- HTML::TocGenerator::_deinitializeGeneratorBatch() ------------------------
-
-sub _deinitializeGeneratorBatch() {
- # Get arguments
- my ($self) = @_;
- # Do 'extender' batch deinitialization
- $self->_deinitializeExtenderBatch();
-} # _deinitializeBatchGenerator()
-
-
-#--- HTML::TocGenerator::_doesHashContainHash() -------------------------------
-# function: Determines whether hash1 matches regular expressions of hash2.
-# args: - $aHash1
-# - $aHash2
-# - $aContainmentType: 0 (include) or 1 (exclude)
-# returns: True (1) if hash1 satisfies hash2, 0 if not. For example, with the
-# following hashes:
-#
-# %hash1 = { %hash2 = {
-# 'class' => 'header' 'class' => '^h'
-# 'id' => 'intro' }
-# }
-#
-# the routine will return 1 if 'aContainmentType' equals 0, cause
-# 'hash1' satisfies the conditions of 'hash2'. The routine will
-# return 0 if 'aContainmentType' equals 1, cause 'hash1' doesn't
-# exclude the conditions of 'hash2'.
-# note: Class function.
-
-sub _doesHashContainHash {
- # Get arguments
- my ($aHash1, $aHash2, $aContainmentType) = @_;
- # Local variables
- my ($key1, $value1, $key2, $value2, $result);
- # Bias to success
- $result = 1;
- # Loop through hash2
- HASH2: while (($key2, $value2) = each %$aHash2) {
- # Yes, values are available;
- # Get value1
- $value1 = $aHash1->{$key2};
- # Does value1 match criteria of value2?
- if (defined($value1) && $value1 =~ m/$value2/) {
- # Yes, value1 matches criteria of value2;
- # Containment type was exclude?
- if ($aContainmentType == CONTAINMENT_EXCLUDE) {
- # Yes, containment type was exclude;
- # Indicate condition fails
- $result = 0;
- # Reset 'each' iterator which we're going to break
- keys %$aHash2;
- # Break loop
- last HASH2;
- }
- }
- else {
- # No, value1 didn't match criteria of value2;
- # Containment type was include?
- if ($aContainmentType == CONTAINMENT_INCLUDE) {
- # Yes, containment type was include;
- # Indicate condition fails
- $result = 0;
- # Reset 'each' iterator which we're going to break
- keys %$aHash2;
- # Break loop
- last HASH2;
- }
- }
- }
- # Return value
- return $result;
-} # _doesHashContainHash()
-
-
-#--- HTML::TocGenerator::_extend() --------------------------------------------
-# function: Extend ToC.
-# - $aString: String to parse.
-
-sub _extend {
- # Get arguments
- my ($self, $aFile) = @_;
- # Local variables
- my ($file);
- # Parse string
- $self->parse($aFile);
- # Flush remaining buffered text
- $self->eof();
-} # _extend()
-
-
-#--- HTML::TocGenerator::_extendFromFile() ------------------------------------
-# function: Extend ToC.
-# - $aFile: (reference to array of) file to parse.
-
-sub _extendFromFile {
- # Get arguments
- my ($self, $aFile) = @_;
- # Local variables
- my ($file, @files);
- # Dereference array reference or make array of file specification
- @files = (ref($aFile) =~ m/ARRAY/) ? @$aFile : ($aFile);
- # Loop through files
- foreach $file (@files) {
- # Store filename
- $self->{_currentFile} = $file;
- # Parse file
- $self->parse_file($file);
- # Flush remaining buffered text
- $self->eof();
- }
-} # _extendFromFile()
-
-
-#--- HTML::TocGenerator::_formatHeadingLevel() --------------------------------
-# function: Format heading level.
-# args: - $aLevel: Level of current heading
-# - $aClass: Class of current heading
-# - $aGroup: Group of current heading
-# - $aToc: Toc of current heading
-
-sub _formatHeadingLevel {
- # Get arguments
- my ($self, $aLevel, $aClass, $aGroup, $aToc) = @_;
- # Local variables
- my ($result, $headingNumber, $numberingStyle);
-
- $headingNumber = $self->_getGroupIdManager($aToc)->
- {levels}{$aClass}[$aLevel - 1] || 0;
-
- # Alias numbering style of current group
- $numberingStyle = $aGroup->{numberingStyle};
-
- SWITCH: {
- if ($numberingStyle eq "decimal") {
- $result = $headingNumber;
- last SWITCH;
- }
- if ($numberingStyle eq "lower-alpha") {
- $result = chr($headingNumber + ord('a') - 1);
- last SWITCH;
- }
- if ($numberingStyle eq "upper-alpha") {
- $result = chr($headingNumber + ord('A') - 1);
- last SWITCH;
- }
- if ($numberingStyle eq "lower-roman") {
- require Roman;
- $result = Roman::roman($headingNumber);
- last SWITCH;
- }
- if ($numberingStyle eq "upper-roman") {
- require Roman;
- $result = Roman::Roman($headingNumber);
- last SWITCH;
- }
- die "Unknown case: $numberingStyle";
- }
- # Return value
- return $result;
-} # _formatHeadingLevel()
-
-
-#--- HTML::TocGenerator::_formatTocNode() -------------------------------------
-# function: Format heading node.
-# args: - $aLevel: Level of current heading
-# - $aClass: Class of current heading
-# - $aGroup: Group of current heading
-# - $aToc: Toc of current heading
-
-sub _formatTocNode {
- # Get arguments
- my ($self, $aLevel, $aClass, $aGroup, $aToc) = @_;
- # Local variables
- my ($result, $level, $levelGroups);
-
- # Alias 'levelGroups' of right 'groupId'
- $levelGroups = $aToc->{_levelGroups}{$aGroup->{'groupId'}};
- # Loop through levels
- for ($level = 1; $level <= $aLevel; $level++) {
- # If not first level, add dot
- $result = ($result ? $result . "." : $result);
- # Format heading level using argument group
- $result .= $self->_formatHeadingLevel(
- $level, $aClass, @{$levelGroups}[$level - 1], $aToc
- );
- }
- # Return value
- return $result;
-} # _formatTocNode()
-
-
-#--- HTML::TocGenerator::_generate() ------------------------------------------
-# function: Generate ToC.
-# args: - $aString: Reference to string to parse
-
-sub _generate {
- # Get arguments
- my ($self, $aString) = @_;
- # Local variables
- my ($toc);
- # Loop through ToCs
- foreach $toc (@{$self->{_tocs}}) {
- # Clear ToC
- $toc->clear();
- }
- # Extend ToCs
- $self->_extend($aString);
-} # _generate()
-
-
-#--- HTML::TocGenerator::_generateFromFile() ----------------------------------
-# function: Generate ToC.
-# args: - $aFile: (reference to array of) file to parse.
-
-sub _generateFromFile {
- # Get arguments
- my ($self, $aFile) = @_;
- # Local variables
- my ($toc);
- # Loop through ToCs
- foreach $toc (@{$self->{_tocs}}) {
- # Clear ToC
- $toc->clear();
- }
- # Extend ToCs
- $self->_extendFromFile($aFile);
-} # _generateFromFile()
-
-
-#--- HTML::TocGenerator::_getGroupIdManager() ---------------------------------
-# function: Get group id manager.
-# args: - $aToc: Active ToC.
-# returns: Group id levels.
-
-sub _getGroupIdManager {
- # Get arguments
- my ($self, $aToc) = @_;
- # Local variables
- my ($result);
- # Global groups?
- if ($self->{options}{'doUseGroupsGlobal'}) {
- # Yes, global groups;
- $result = $self;
- }
- else {
- # No, local groups;
- $result = $aToc;
- }
- # Return value
- return $result;
-} # _getGroupIdManager()
-
-
-#--- HTML::TocGenerator::_initializeBatch() -----------------------------------
-# function: Initialize batch. This function is called once when a parse batch
-# is started.
-# args: - $aTocs: Reference to array of tocs.
-
-sub _initializeBatch {
- # Get arguments
- my ($self, $aTocs) = @_;
- # Local variables
- my ($toc);
-
- # Store reference to tocs
-
- # Is ToC specification reference to array?
- if (ref($aTocs) =~ m/ARRAY/) {
- # Yes, ToC specification is reference to array;
- # Store array reference
- $self->{_tocs} = $aTocs;
- }
- else {
- # No, ToC specification is reference to ToC object;
- # Wrap reference in array reference, containing only one element
- $self->{_tocs} = [$aTocs];
- }
- # Loop through ToCs
- foreach $toc (@{$self->{_tocs}}) {
- # Parse ToC options
- $toc->parseOptions();
- }
-} # _initializeBatch()
-
-
-#--- HTML::TocGenerator::_initializeExtenderBatch() --------------------------
-# function: Initialize 'extender' batch. This function is called once when a
-# parse batch is started.
-# args: - $aTocs: Reference to array of tocs.
-
-sub _initializeExtenderBatch {
- # Get arguments
- my ($self, $aTocs) = @_;
- # Do general batch initialization
- $self->_initializeBatch($aTocs);
- # Parse ToC options
- $self->_parseTocOptions();
- # Indicate start of batch
- $self->{_doGenerateToc} = 1;
-} # _initializeExtenderBatch()
-
-
-#--- HTML::TocGenerator::_initializeGeneratorBatch() --------------------------
-# function: Initialize generator batch. This function is called once when a
-# parse batch is started.
-# args: - $aTocs: Reference to array of tocs.
-# - $aOptions: optional options
-
-sub _initializeGeneratorBatch {
- # Get arguments
- my ($self, $aTocs, $aOptions) = @_;
- # Add invocation options
- $self->setOptions($aOptions);
- # Option 'doUseGroupsGlobal' specified?
- if (!defined($self->{options}{'doUseGroupsGlobal'})) {
- # No, options 'doUseGroupsGlobal' not specified;
- # Default to no 'doUseGroupsGlobal'
- $self->{options}{'doUseGroupsGlobal'} = 0;
- }
- # Global groups?
- if ($self->{options}{'doUseGroupsGlobal'}) {
- # Yes, global groups;
- # Reset groups and levels
- $self->_resetStackVariables();
- }
- # Do 'extender' batch initialization
- $self->_initializeExtenderBatch($aTocs);
-} # _initializeGeneratorBatch()
-
-
-#--- HTML::TocGenerator::_linkTocToToken() ------------------------------------
-# function: Link ToC to token.
-# args: - $aToc: ToC to add token to.
-# - $aFile
-# - $aGroupId
-# - $aLevel
-# - $aNode
-# - $aGroupLevel
-# - $aLinkType
-# - $aTokenAttributes: reference to hash containing attributes of
-# currently parsed token
-
-sub _linkTocToToken {
- # Get arguments
- my (
- $self, $aToc, $aFile, $aGroupId, $aLevel, $aNode, $aGroupLevel,
- $aDoLinkToId, $aTokenAttributes
- ) = @_;
- # Local variables
- my ($file, $groupId, $level, $node, $anchorName);
- my ($doInsertAnchor, $doInsertId);
-
- # Fill local arguments to be used by templates
- $file = $aFile;
- $groupId = $aGroupId;
- $level = $aLevel;
- $node = $aNode;
-
- # Assemble anchor name
- $anchorName =
- ref($aToc->{_templateAnchorName}) eq "CODE" ?
- &{$aToc->{_templateAnchorName}}(
- $aFile, $aGroupId, $aLevel, $aNode
- ) :
- eval($aToc->{_templateAnchorName});
-
- # Bias to insert anchor name
- $doInsertAnchor = 1;
- $doInsertId = 0;
- # Link to 'id'?
- if ($aDoLinkToId) {
- # Yes, link to 'id';
- # Indicate to insert anchor id
- $doInsertAnchor = 0;
- $doInsertId = 1;
- # Id attribute is available?
- if (defined($aTokenAttributes->{id})) {
- # Yes, id attribute is available;
- # Use existing ids?
- if ($aToc->{options}{'doUseExistingIds'}) {
- # Yes, use existing ids;
- # Use existing id
- $anchorName = $aTokenAttributes->{id};
- # Indicate to not insert id
- $doInsertId = 0;
- }
- }
-
- }
- else {
- # No, link to 'name';
- # Anchor name is currently active?
- if (defined($self->{_activeAnchorName})) {
- # Yes, anchor name is currently active;
- # Use existing anchors?
- if ($aToc->{options}{'doUseExistingAnchors'}) {
- # Yes, use existing anchors;
- # Use existing anchor name
- $anchorName = $self->{_activeAnchorName};
- # Indicate to not insert anchor name
- $doInsertAnchor = 0;
- }
- else {
- # No, don't use existing anchors; insert new anchor;
- #
- }
- }
- }
-
- # Add reference to ToC
- $aToc->{_toc} .=
- ref($aToc->{_templateAnchorHrefBegin}) eq "CODE" ?
- &{$aToc->{_templateAnchorHrefBegin}}(
- $aFile, $aGroupId, $aLevel, $aNode, $anchorName
- ) :
- eval($aToc->{_templateAnchorHrefBegin});
-
- # Bias to not output anchor name end
- $self->{_doOutputAnchorNameEnd} = 0;
- # Must anchor be inserted?
- if ($doInsertAnchor) {
- # Yes, anchor must be inserted;
- # Allow adding of anchor name begin token to text by calling
- # 'anchorNameBegin' method
- $self->anchorNameBegin(
- ref($aToc->{_templateAnchorNameBegin}) eq "CODE" ?
- &{$aToc->{_templateAnchorNameBegin}}(
- $aFile, $aGroupId, $aLevel, $aNode, $anchorName
- ) :
- eval($aToc->{_templateAnchorNameBegin}),
- $aToc
- );
- }
-
- # Must anchorId attribute be inserted?
- if ($doInsertId) {
- # Yes, anchorId attribute must be inserted;
- # Allow adding of anchorId attribute to text by calling 'anchorId'
- # method
- $self->anchorId($anchorName);
- }
-} # _linkTocToToken()
-
-
-#--- HTML::TocGenerator::_outputAnchorNameEndConditionally() ------------------
-# function: Output 'anchor name end' if necessary
-# args: - $aToc: ToC of which 'anchor name end' must be output.
-
-sub _outputAnchorNameEndConditionally {
- # Get arguments
- my ($self, $aToc) = @_;
- # Must anchor name end be output?
- if ($self->{_doOutputAnchorNameEnd}) {
- # Yes, output anchor name end;
- # Allow adding of anchor to text by calling 'anchorNameEnd'
- # method
- $self->anchorNameEnd(
- ref($aToc->{_templateAnchorNameEnd}) eq "CODE" ?
- &{$aToc->{_templateAnchorNameEnd}} :
- eval($aToc->{_templateAnchorNameEnd}),
- $aToc
- );
- }
-} # _outputAnchorNameEndConditionally()
-
-
-#--- HTML::TocGenerator::_parseTocOptions() -----------------------------------
-# function: Parse ToC options.
-
-sub _parseTocOptions {
- # Get arguments
- my ($self) = @_;
- # Local variables
- my ($toc, $group, $tokens, $tokenType, $i);
- # Create parsers for ToC tokens
- $self->{_tokensTocBegin} = [];
- my $tokenTocBeginParser = HTML::_TokenTocBeginParser->new(
- $self->{_tokensTocBegin}
- );
- my $tokenTocEndParser = HTML::_TokenTocEndParser->new();
- # Loop through ToCs
- foreach $toc (@{$self->{_tocs}}) {
- # Reference parser ToC to current ToC
- $tokenTocBeginParser->setToc($toc);
- # Loop through 'tokenToToc' groups
- foreach $group (@{$toc->{options}{'tokenToToc'}}) {
- # Reference parser group to current group
- $tokenTocBeginParser->setGroup($group);
- # Parse 'tokenToToc' group
- $tokenTocBeginParser->parse($group->{'tokenBegin'});
- # Flush remaining buffered text
- $tokenTocBeginParser->eof();
- $tokenTocEndParser->parse(
- $group->{'tokenEnd'},
- $tokenTocBeginParser->{_lastAddedToken},
- $tokenTocBeginParser->{_lastAddedTokenType}
- );
- # Flush remaining buffered text
- $tokenTocEndParser->eof();
- }
- }
-} # _parseTocOptions()
-
-
-#--- HTML::TocGenerator::_processTocEndingToken() -----------------------------
-# function: Process ToC-ending-token.
-# args: - $aTocToken: token which acts as ToC-ending-token.
-
-sub _processTocEndingToken {
- # Get arguments
- my ($self, $aTocToken) = @_;
- # Local variables
- my ($toc);
- # Aliases
- $toc = $aTocToken->[TT_TOC];
- # Link ToC to tokens?
- if ($toc->{options}{'doLinkToToken'}) {
- # Yes, link ToC to tokens;
- # Add anchor href end
- $toc->{_toc} .=
- (ref($toc->{_templateAnchorHrefEnd}) eq "CODE") ?
- &{$toc->{_templateAnchorHrefEnd}} :
- eval($toc->{_templateAnchorHrefEnd});
-
- # Output anchor name end only if necessary
- $self->_outputAnchorNameEndConditionally($toc);
- }
-} # _processTocEndingToken()
-
-
-#--- HTML::TocGenerator::_processTocStartingToken() ---------------------------
-# function: Process ToC-starting-token.
-# args: - $aTocToken: token which acts as ToC-starting-token.
-# - $aTokenType: type of token. Can be either TT_TOKENTYPE_START,
-# _END, _TEXT, _COMMENT or _DECLARATION.
-# - $aTokenAttributes: reference to hash containing attributes of
-# currently parsed token
-# - $aTokenOrigText: reference to original token text
-
-sub _processTocStartingToken {
- # Get arguments
- my ($self, $aTocToken, $aTokenType, $aTokenAttributes, $aTokenOrigText) = @_;
- # Local variables
- my ($i, $level, $doLinkToId, $node, $groupLevel);
- my ($file, $tocTokenId, $groupId, $toc, $attribute);
- # Aliases
- $file = $self->{_currentFile};
- $toc = $aTocToken->[TT_TOC];
- $level = $aTocToken->[TT_GROUP]{'level'};
- $groupId = $aTocToken->[TT_GROUP]{'groupId'};
-
- # Retrieve 'doLinkToId' setting from either group options or toc options
- $doLinkToId = (defined($aTocToken->[TT_GROUP]{'doLinkToId'})) ?
- $aTocToken->[TT_GROUP]{'doLinkToId'} : $toc->{options}{'doLinkToId'};
-
- # Link to 'id' and tokenType isn't 'start'?
- if (($doLinkToId) && ($aTokenType != TT_TOKENTYPE_START)) {
- # Yes, link to 'id' and tokenType isn't 'start';
- # Indicate to *not* link to 'id'
- $doLinkToId = 0;
- }
-
- if (ref($level) eq "CODE") {
- $level = &$level($self->{_currentFile}, $node);
- }
- if (ref($groupId) eq "CODE") {
- $groupId = &$groupId($self->{_currentFile}, $node);
- }
-
- # Determine class level
-
- my $groupIdManager = $self->_getGroupIdManager($toc);
- # Known group?
- if (!exists($groupIdManager->{groupIdLevels}{$groupId})) {
- # No, unknown group;
- # Add group
- $groupIdManager->{groupIdLevels}{$groupId} = keys(
- %{$groupIdManager->{groupIdLevels}}
- ) + 1;
- }
- $groupLevel = $groupIdManager->{groupIdLevels}{$groupId};
-
- # Temporarily allow symbolic references
- #no strict qw(refs);
- # Increase level
- $groupIdManager->{levels}{$groupId}[$level - 1] += 1;
- # Reset remaining levels of same group
- for ($i = $level; $i < @{$groupIdManager->{levels}{$groupId}}; $i++) {
- $groupIdManager->{levels}{$groupId}[$i] = 0;
- }
-
- # Assemble numeric string indicating current level
- $node = $self->_formatTocNode(
- $level, $groupId, $aTocToken->[TT_GROUP], $toc
- );
-
- # Add newline if _toc not empty
- if ($toc->{_toc}) {
- $toc->{_toc} .= "\n";
- }
-
- # Add toc item info
- $toc->{_toc} .= "$level $groupLevel $groupId $node " .
- $groupIdManager->{levels}{$groupId}[$level - 1] . " ";
-
- # Add value of 'id' attribute if available
- if (defined($aTokenAttributes->{id})) {
- $toc->{_toc} .= $aTokenAttributes->{id};
- }
- $toc->{_toc} .= " ";
- # Link ToC to tokens?
- if ($toc->{options}{'doLinkToToken'}) {
- # Yes, link ToC to tokens;
- # Link ToC to token
- $self->_linkTocToToken(
- $toc, $file, $groupId, $level, $node, $groupLevel, $doLinkToId,
- $aTokenAttributes
- );
- }
-
- # Number tokens?
- if (
- $aTocToken->[TT_GROUP]{'doNumberToken'} ||
- (
- ! defined($aTocToken->[TT_GROUP]{'doNumberToken'}) &&
- $toc->{options}{'doNumberToken'}
- )
- ) {
- # Yes, number tokens;
- # Add number by calling 'number' method
- $self->number(
- ref($toc->{_templateTokenNumber}) eq "CODE" ?
- &{$toc->{_templateTokenNumber}}(
- $node, $groupId, $file, $groupLevel, $level, $toc
- ) :
- eval($toc->{_templateTokenNumber}),
- $toc
- );
- }
-
- # Must attribute be used as ToC text?
- if (defined($aTocToken->[TT_ATTRIBUTES_TOC])) {
- # Yes, attribute must be used as ToC text;
- # Loop through attributes
- foreach $attribute (@{$aTocToken->[TT_ATTRIBUTES_TOC]}) {
- # Attribute is available?
- if (defined($$aTokenAttributes{$attribute})) {
- # Yes, attribute is available;
- # Add attribute value to ToC
- $self->_processTocText($$aTokenAttributes{$attribute}, $toc);
- }
- else {
- # No, attribute isn't available;
- # Show warning
- $self->_showWarning(
- WARNING_TOC_ATTRIBUTE_PS_NOT_AVAILABLE_WITHIN_PS,
- [$attribute, $$aTokenOrigText]
- );
- }
- # Output anchor name end only if necessary
- #$self->_outputAnchorNameEndConditionally($toc);
- # End attribute
- $self->_processTocEndingToken($aTocToken);
- }
- }
- else {
- # No, attribute mustn't be used as ToC text;
- # Add end token to 'end token array'
- push(
- @{$self->{_tokensTocEnd}[$aTocToken->[TT_TAG_TYPE_END]]}, $aTocToken
- );
- }
-} # _processTocStartingToken()
-
-
-#--- HTML::TocGenerator::_processTocText() ------------------------------------
-# function: This function processes text which must be added to the preliminary
-# ToC.
-# args: - $aText: Text to add to ToC.
-# - $aToc: ToC to add text to.
-
-sub _processTocText {
- # Get arguments
- my ($self, $aText, $aToc) = @_;
- # Add text to ToC
- $aToc->{_toc} .= $aText;
-} # _processTocText()
-
-
-#--- HTML::TocGenerator::_processTokenAsTocEndingToken() ----------------------
-# function: Check for token being a token to use for triggering the end of
-# a ToC line and process it accordingly.
-# args: - $aTokenType: type of token: 'start', 'end', 'comment' or 'text'.
-# - $aTokenId: token id of currently parsed token
-
-sub _processTokenAsTocEndingToken {
- # Get arguments
- my ($self, $aTokenType, $aTokenId) = @_;
- # Local variables
- my ($i, $tokenId, $toc, $tokens);
- # Loop through dirty start tokens
- $i = 0;
-
- # Alias token array of right type
- $tokens = $self->{_tokensTocEnd}[$aTokenType];
- # Loop through token array
- while ($i < scalar @$tokens) {
- # Aliases
- $tokenId = $tokens->[$i][TT_TAG_END];
- # Does current end tag equals dirty tag?
- if ($aTokenId eq $tokenId) {
- # Yes, current end tag equals dirty tag;
- # Process ToC-ending-token
- $self->_processTocEndingToken($tokens->[$i]);
- # Remove dirty tag from array, automatically advancing to
- # next token
- splice(@$tokens, $i, 1);
- }
- else {
- # No, current end tag doesn't equal dirty tag;
- # Advance to next token
- $i++;
- }
- }
-} # _processTokenAsTocEndingToken()
-
-
-#--- HTML::TocGenerator::_processTokenAsTocStartingToken() --------------------
-# function: Check for token being a ToC-starting-token and process it
-# accordingly.
-# args: - $aTokenType: type of token. Can be either TT_TOKENTYPE_START,
-# _END, _TEXT, _COMMENT or _DECLARATION.
-# - $aTokenId: token id of currently parsed token
-# - $aTokenAttributes: reference to hash containing attributes of
-# currently parsed token
-# - $aTokenOrigText: reference to original text of token
-# returns: 1 if successful, i.e. token is processed as ToC-starting-token, 0
-# if not.
-
-sub _processTokenAsTocStartingToken {
- # Get arguments
- my ($self, $aTokenType, $aTokenId, $aTokenAttributes, $aTokenOrigText) = @_;
- # Local variables
- my ($level, $levelToToc, $groupId, $groupToToc);
- my ($result, $tocToken, $tagBegin, @tokensTocBegin, $fileSpec);
- # Bias to token not functioning as ToC-starting-token
- $result = 0;
- # Loop through start tokens of right type
- foreach $tocToken (@{$self->{_tokensTocBegin}[$aTokenType]}) {
- # Alias file filter
- $fileSpec = $tocToken->[TT_GROUP]{'fileSpec'};
- # File matches?
- if (!defined($fileSpec) || (
- defined($fileSpec) &&
- ($self->{_currentFile} =~ m/$fileSpec/)
- )) {
- # Yes, file matches;
- # Alias tag begin
- $tagBegin = $tocToken->[TT_TAG_BEGIN];
- # Tag and attributes match?
- if (
- defined($tagBegin) &&
- ($aTokenId =~ m/$tagBegin/) &&
- HTML::TocGenerator::_doesHashContainHash(
- $aTokenAttributes, $tocToken->[TT_INCLUDE_ATTRIBUTES_BEGIN], 0
- ) &&
- HTML::TocGenerator::_doesHashContainHash(
- $aTokenAttributes, $tocToken->[TT_EXCLUDE_ATTRIBUTES_BEGIN], 1
- )
- ) {
- # Yes, tag and attributes match;
- # Aliases
- $level = $tocToken->[TT_GROUP]{'level'};
- $levelToToc = $tocToken->[TT_TOC]{options}{'levelToToc'};
- $groupId = $tocToken->[TT_GROUP]{'groupId'};
- $groupToToc = $tocToken->[TT_TOC]{options}{'groupToToc'};
- # Must level and group be processed?
- if (
- ($level =~ m/$levelToToc/) &&
- ($groupId =~ m/$groupToToc/)
- ) {
- # Yes, level and group must be processed;
- # Indicate token acts as ToC-starting-token
- $result = 1;
- # Process ToC-starting-token
- $self->_processTocStartingToken(
- $tocToken, $aTokenType, $aTokenAttributes, $aTokenOrigText
- );
- }
- }
- }
- }
- # Return value
- return $result;
-} # _processTokenAsTocStartingToken()
-
-
-#--- HTML::TocGenerator::_resetBatchVariables() -------------------------------
-# function: Reset variables which are set because of batch invocation.
-
-sub _resetBatchVariables {
- # Get arguments
- my ($self) = @_;
-
- # Filename of current file being parsed, empty string if not available
- $self->{_currentFile} = "";
- # Arrays containing start, end, comment, text & declaration tokens which
- # must trigger the ToC assembling. Each array element may contain a
- # reference to an array containing the following elements:
- #
- # TT_TAG_BEGIN => 0;
- # TT_TAG_END => 1;
- # TT_TAG_TYPE_END => 2;
- # TT_INCLUDE_ATTRIBUTES_BEGIN => 3;
- # TT_EXCLUDE_ATTRIBUTES_BEGIN => 4;
- # TT_INCLUDE_ATTRIBUTES_END => 5;
- # TT_EXCLUDE_ATTRIBUTES_END => 6;
- # TT_GROUP => 7;
- # TT_TOC => 8;
- # TT_ATTRIBUTES_TOC => 9;
- #
- $self->{_tokensTocBegin} = [
- [], # TT_TOKENTYPE_START
- [], # TT_TOKENTYPE_END
- [], # TT_TOKENTYPE_COMMENT
- [], # TT_TOKENTYPE_TEXT
- [] # TT_TOKENTYPE_DECLARATION
- ];
- $self->{_tokensTocEnd} = [
- [], # TT_TOKENTYPE_START
- [], # TT_TOKENTYPE_END
- [], # TT_TOKENTYPE_COMMENT
- [], # TT_TOKENTYPE_TEXT
- [] # TT_TOKENTYPE_DECLARATION
- ];
- # TRUE if ToCs have been initialized, FALSE if not.
- $self->{_doneInitializeTocs} = 0;
- # Array of ToCs to process
- $self->{_tocs} = [];
- # Active anchor name
- $self->{_activeAnchorName} = undef;
-} # _resetBatchVariables()
-
-
-#--- HTML::TocGenerator::_resetStackVariables() -------------------------------
-# function: Reset variables which cumulate during ToC generation.
-
-sub _resetStackVariables {
- # Get arguments
- my ($self) = @_;
- # Reset variables
- $self->{levels} = undef;
- $self->{groupIdLevels} = undef;
-} # _resetStackVariables()
-
-
-#--- HTML::TocGenerator::_setActiveAnchorName() -------------------------------
-# function: Set active anchor name.
-# args: - aAnchorName: Name of anchor name to set active.
-
-sub _setActiveAnchorName {
- # Get arguments
- my ($self, $aAnchorName) = @_;
- # Set active anchor name
- $self->{_activeAnchorName} = $aAnchorName;
-} # _setActiveAnchorName()
-
-
-#--- HTML::TocGenerator::_showWarning() ---------------------------------------
-# function: Show warning.
-# args: - aWarningNr: Number of warning to show.
-# - aWarningArgs: Arguments to display within the warning.
-
-sub _showWarning {
- # Get arguments
- my ($self, $aWarningNr, $aWarningArgs) = @_;
- # Local variables
- my (%warnings);
- # Set warnings
- %warnings = (
- WARNING_NESTED_ANCHOR_PS_WITHIN_PS() =>
- "Nested anchor '%s' within anchor '%s'.",
- WARNING_TOC_ATTRIBUTE_PS_NOT_AVAILABLE_WITHIN_PS() =>
- "ToC attribute '%s' not available within token '%s'.",
- );
- # Show warning
- print STDERR "warning ($aWarningNr): " . sprintf($warnings{"$aWarningNr"}, @$aWarningArgs) . "\n";
-} # _showWarning()
-
-
-#--- HTML::TocGenerator::anchorId() -------------------------------------------
-# function: Anchor id processing method. Leave it up to the descendant to do
-# something useful with it.
-# args: - $aAnchorId
-# - $aToc: Reference to ToC to which anchorId belongs.
-
-sub anchorId {
-} # anchorId()
-
-
-#--- HTML::TocGenerator::anchorNameBegin() ------------------------------------
-# function: Anchor name begin processing method. Leave it up to the descendant
-# to do something useful with it.
-# args: - $aAnchorName
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub anchorNameBegin {
-} # anchorNameBegin()
-
-
-#--- HTML::TocGenerator::anchorNameEnd() --------------------------------------
-# function: Anchor name end processing method. Leave it up to the descendant
-# to do something useful with it.
-# args: - $aAnchorName
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub anchorNameEnd {
-} # anchorNameEnd()
-
-
-#--- HTML::TocGenerator::comment() --------------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Must a ToC be generated?
- if ($self->{_doGenerateToc}) {
- # Yes, a ToC must be generated
- # Process end tag as ToC-starting-token
- $self->_processTokenAsTocStartingToken(
- TT_TOKENTYPE_COMMENT, $aComment, undef, \$aComment
- );
- # Process end tag as token which ends ToC registration
- $self->_processTokenAsTocEndingToken(
- TT_TOKENTYPE_COMMENT, $aComment
- );
- }
-} # comment()
-
-
-#--- HTML::TocGenerator::end() ------------------------------------------------
-# function: This function is called every time a closing tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aOrigText: tag name including brackets.
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Local variables
- my ($tag, $toc, $i);
- # Must a ToC be generated?
- if ($self->{_doGenerateToc}) {
- # Yes, a ToC must be generated
- # Process end tag as ToC-starting-token
- $self->_processTokenAsTocStartingToken(
- TT_TOKENTYPE_END, $aTag, undef, \$aOrigText
- );
- # Process end tag as ToC-ending-token
- $self->_processTokenAsTocEndingToken(
- TT_TOKENTYPE_END, $aTag
- );
- # Tag is of type 'anchor'?
- if (defined($self->{_activeAnchorName}) && ($aTag eq "a")) {
- # Yes, tag is of type 'anchor';
- # Reset dirty anchor
- $self->{_activeAnchorName} = undef;
- }
- }
-} # end()
-
-
-#--- HTML::TocGenerator::extend() ---------------------------------------------
-# function: Extend ToCs.
-# args: - $aTocs: Reference to array of ToC objects
-# - $aString: String to parse.
-
-sub extend {
- # Get arguments
- my ($self, $aTocs, $aString) = @_;
- # Initialize TocGenerator batch
- $self->_initializeExtenderBatch($aTocs);
- # Extend ToCs
- $self->_extend($aString);
- # Deinitialize TocGenerator batch
- $self->_deinitializeExtenderBatch();
-} # extend()
-
-
-#--- HTML::TocGenerator::extendFromFile() -------------------------------------
-# function: Extend ToCs.
-# args: - @aTocs: Reference to array of ToC objects
-# - @aFiles: Reference to array of files to parse.
-
-sub extendFromFile {
- # Get arguments
- my ($self, $aTocs, $aFiles) = @_;
- # Initialize TocGenerator batch
- $self->_initializeExtenderBatch($aTocs);
- # Extend ToCs
- $self->_extendFromFile($aFiles);
- # Deinitialize TocGenerator batch
- $self->_deinitializeExtenderBatch();
-} # extendFromFile()
-
-
-#--- HTML::TocGenerator::generate() -------------------------------------------
-# function: Generate ToC.
-# args: - $aToc: Reference to (array of) ToC object(s)
-# - $aString: Reference to string to parse
-# - $aOptions: optional options
-
-sub generate {
- # Get arguments
- my ($self, $aToc, $aString, $aOptions) = @_;
- # Initialize TocGenerator batch
- $self->_initializeGeneratorBatch($aToc, $aOptions);
- # Do generate ToC
- $self->_generate($aString);
- # Deinitialize TocGenerator batch
- $self->_deinitializeGeneratorBatch();
-} # generate()
-
-
-#--- HTML::TocGenerator::generateFromFile() -----------------------------------
-# function: Generate ToC.
-# args: - $aToc: Reference to (array of) ToC object(s)
-# - $aFile: (reference to array of) file to parse.
-# - $aOptions: optional options
-
-sub generateFromFile {
- # Get arguments
- my ($self, $aToc, $aFile, $aOptions) = @_;
- # Initialize TocGenerator batch
- $self->_initializeGeneratorBatch($aToc, $aOptions);
- # Do generate ToC
- $self->_generateFromFile($aFile);
- # Deinitialize TocGenerator batch
- $self->_deinitializeGeneratorBatch();
-} # generateFromFile()
-
-
-#--- HTML::TocGenerator::number() ---------------------------------------------
-# function: Heading number processing method. Leave it up to the descendant
-# to do something useful with it.
-# args: - $aNumber
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub number {
- # Get arguments
- my ($self, $aNumber, $aToc) = @_;
-} # number()
-
-
-#--- HTML::TocGenerator::parse() ----------------------------------------------
-# function: Parse scalar.
-# args: - $aString: string to parse
-
-sub parse {
- # Get arguments
- my ($self, $aString) = @_;
- # Call ancestor
- $self->SUPER::parse($aString);
-} # parse()
-
-
-#--- HTML::TocGenerator::parse_file() -----------------------------------------
-# function: Parse file.
-
-sub parse_file {
- # Get arguments
- my ($self, $aFile) = @_;
- # Call ancestor
- $self->SUPER::parse_file($aFile);
-} # parse_file()
-
-
-#--- HTML::TocGenerator::setOptions() -----------------------------------------
-# function: Set options.
-# args: - aOptions: Reference to hash containing options.
-
-sub setOptions {
- # Get arguments
- my ($self, $aOptions) = @_;
- # Options are defined?
- if (defined($aOptions)) {
- # Yes, options are defined; add to options
- %{$self->{options}} = (%{$self->{options}}, %$aOptions);
- }
-} # setOptions()
-
-
-#--- HTML::TocGenerator::start() ----------------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all tag attributes (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- $self->{isTocToken} = 0;
- # Start tag is of type 'anchor name'?
- if ($aTag eq "a" && defined($aAttr->{name})) {
- # Yes, start tag is of type 'anchor name';
- # Is another anchor already active?
- if (defined($self->{_activeAnchorName})) {
- # Yes, another anchor is already active;
- # Is the first anchor inserted by 'TocGenerator'?
- if ($self->{_doOutputAnchorNameEnd}) {
- # Yes, the first anchor is inserted by 'TocGenerator';
- # Show warning
- $self->_showWarning(
- WARNING_NESTED_ANCHOR_PS_WITHIN_PS,
- [$aOrigText, $self->{_activeAnchorName}]
- );
- }
- }
- # Set active anchor name
- $self->_setActiveAnchorName($aAttr->{name});
- }
- # Must a ToC be generated?
- if ($self->{_doGenerateToc}) {
- # Yes, a ToC must be generated
- # Process start tag as ToC token
- $self->{isTocToken} = $self->_processTokenAsTocStartingToken(
- TT_TOKENTYPE_START, $aTag, $aAttr, \$aOrigText
- );
- # Process end tag as ToC-ending-token
- $self->_processTokenAsTocEndingToken(
- TT_TOKENTYPE_START, $aTag
- );
- }
-} # start()
-
-
-#--- HTML::TocGenerator::text() -----------------------------------------------
-# function: This function is called every time plain text is encountered.
-# args: - @_: array containing data.
-
-sub text {
- # Get arguments
- my ($self, $aText) = @_;
- # Local variables
- my ($text, $toc, $i, $token, $tokens);
- # Must a ToC be generated?
- if ($self->{_doGenerateToc}) {
- # Yes, a ToC must be generated
- # Are there dirty start tags?
-
- # Loop through token types
- foreach $tokens (@{$self->{_tokensTocEnd}}) {
- # Loop though tokens
- foreach $token (@$tokens) {
- # Add text to toc
-
- # Alias
- $toc = $token->[TT_TOC];
- # Remove possible newlines from text
- ($text = $aText) =~ s/\s*\n\s*/ /g;
- # Add text to toc
- $self->_processTocText($text, $toc);
- }
- }
- }
-} # text()
-
-
-
-
-#=== HTML::_TokenTocParser ====================================================
-# function: Parse 'toc tokens'. 'Toc tokens' mark HTML code which is to be
-# inserted into the ToC.
-# note: Used internally.
-
-package HTML::_TokenTocParser;
-
-
-BEGIN {
- use vars qw(@ISA);
-
- @ISA = qw(HTML::Parser);
-}
-
-
-END {}
-
-
-#--- HTML::_TokenTocParser::new() ---------------------------------------------
-# function: Constructor
-
-sub new {
- # Get arguments
- my ($aType) = @_;
- # Create instance
- my $self = $aType->SUPER::new;
-
- # Return instance
- return $self;
-} # new()
-
-
-#--- HTML::_TokenTocParser::_parseAttributes() --------------------------------
-# function: Parse attributes.
-# args: - $aAttr: Reference to hash containing all tag attributes (in lower
-# case).
-# - $aIncludeAttributes: Reference to hash to which 'include
-# attributes' must be added.
-# - $aExcludeAttributes: Reference to hash to which 'exclude
-# attributes' must be added.
-# - $aTocAttributes: Reference to hash to which 'ToC attributes'
-# must be added.
-
-sub _parseAttributes {
- # Get arguments
- my (
- $self, $aAttr, $aIncludeAttributes, $aExcludeAttributes,
- $aTocAttributes
- ) = @_;
- # Local variables
- my ($key, $value);
- my ($attributeToExcludeToken, $attributeToTocToken);
- # Get token which marks attributes which must be excluded
- $attributeToExcludeToken = $self->{_toc}{options}{'attributeToExcludeToken'};
- $attributeToTocToken = $self->{_toc}{options}{'attributeToTocToken'};
- # Loop through attributes
- while (($key, $value) = each %$aAttr) {
- # Attribute value equals 'ToC token'?
- if ($value =~ m/$attributeToTocToken/) {
- # Yes, attribute value equals 'ToC token';
- # Add attribute to 'ToC attributes'
- push @$aTocAttributes, $key;
- }
- else {
- # No, attribute isn't 'ToC' token;
- # Attribute value starts with 'exclude token'?
- if ($value =~ m/^$attributeToExcludeToken(.*)/) {
- # Yes, attribute value starts with 'exclude token';
- # Add attribute to 'exclude attributes'
- $$aExcludeAttributes{$key} = "$1";
- }
- else {
- # No, attribute key doesn't start with '-';
- # Add attribute to 'include attributes'
- $$aIncludeAttributes{$key} = $value;
- }
- }
- }
-} # _parseAttributes()
-
-
-
-
-#=== HTML::_TokenTocBeginParser ===============================================
-# function: Parse 'toc tokens'. 'Toc tokens' mark HTML code which is to be
-# inserted into the ToC.
-# note: Used internally.
-
-package HTML::_TokenTocBeginParser;
-
-
-BEGIN {
- use vars qw(@ISA);
-
- @ISA = qw(HTML::_TokenTocParser);
-}
-
-END {}
-
-
-#--- HTML::_TokenTocBeginParser::new() ----------------------------------------
-# function: Constructor
-
-sub new {
- # Get arguments
- my ($aType, $aTokenArray) = @_;
- # Create instance
- my $self = $aType->SUPER::new;
- # Reference token array
- $self->{tokens} = $aTokenArray;
- # Reference to last added token
- $self->{_lastAddedToken} = undef;
- $self->{_lastAddedTokenType} = undef;
- # Return instance
- return $self;
-} # new()
-
-
-#--- HTML::_TokenTocBeginParser::_processAttributes() -------------------------
-# function: Process attributes.
-# args: - $aAttributes: Attributes to parse.
-
-sub _processAttributes {
- # Get arguments
- my ($self, $aAttributes) = @_;
- # Local variables
- my (%includeAttributes, %excludeAttributes, @tocAttributes);
-
- # Parse attributes
- $self->_parseAttributes(
- $aAttributes, \%includeAttributes, \%excludeAttributes, \@tocAttributes
- );
- # Include attributes are specified?
- if (keys(%includeAttributes) > 0) {
- # Yes, include attributes are specified;
- # Store include attributes
- @${$self->{_lastAddedToken}}[
- HTML::TocGenerator::TT_INCLUDE_ATTRIBUTES_BEGIN
- ] = \%includeAttributes;
- }
- # Exclude attributes are specified?
- if (keys(%excludeAttributes) > 0) {
- # Yes, exclude attributes are specified;
- # Store exclude attributes
- @${$self->{_lastAddedToken}}[
- HTML::TocGenerator::TT_EXCLUDE_ATTRIBUTES_BEGIN
- ] = \%excludeAttributes;
- }
- # Toc attributes are specified?
- if (@tocAttributes > 0) {
- # Yes, toc attributes are specified;
- # Store toc attributes
- @${$self->{_lastAddedToken}}[
- HTML::TocGenerator::TT_ATTRIBUTES_TOC
- ] = \@tocAttributes;
- }
-} # _processAttributes()
-
-
-#--- HTML::_TokenTocBeginParser::_processToken() ------------------------------
-# function: Process token.
-# args: - $aTokenType: Type of token to process.
-# - $aTag: Tag of token.
-
-sub _processToken {
- # Get arguments
- my ($self, $aTokenType, $aTag) = @_;
- # Local variables
- my ($tokenArray, $index);
- # Push element on array of update tokens
- $index = push(@{$self->{tokens}[$aTokenType]}, []) - 1;
- # Alias token array to add element to
- $tokenArray = $self->{tokens}[$aTokenType];
- # Indicate last updated token array element
- $self->{_lastAddedTokenType} = $aTokenType;
- $self->{_lastAddedToken} = \$$tokenArray[$index];
- # Add fields
- $$tokenArray[$index][HTML::TocGenerator::TT_TAG_BEGIN] = $aTag;
- $$tokenArray[$index][HTML::TocGenerator::TT_GROUP] = $self->{_group};
- $$tokenArray[$index][HTML::TocGenerator::TT_TOC] = $self->{_toc};
-} # _processToken()
-
-
-#--- HTML::_TokenTocBeginParser::comment() ------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_COMMENT, $aComment);
-} # comment()
-
-
-#--- HTML::_TokenTocBeginParser::declaration() --------------------------------
-# function: This function is called every time a markup declaration is
-# encountered by HTML::Parser.
-# args: - $aDeclaration: Markup declaration.
-
-sub declaration {
- # Get arguments
- my ($self, $aDeclaration) = @_;
- # Process token
- $self->_processToken(
- HTML::TocGenerator::TT_TOKENTYPE_DECLARATION, $aDeclaration
- );
-} # declaration()
-
-
-#--- HTML::_TokenTocBeginParser::end() ----------------------------------------
-# function: This function is called every time a closing tag is encountered
-# by HTML::Parser.
-# args: - $aTag: tag name (in lower case).
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_END, $aTag);
-} # end()
-
-
-#--- HTML::_TokenTocBeginParser::parse() --------------------------------------
-# function: Parse begin token.
-# args: - $aToken: 'toc token' to parse
-
-sub parse {
- # Get arguments
- my ($self, $aString) = @_;
- # Call ancestor
- $self->SUPER::parse($aString);
-} # parse()
-
-
-#--- HTML::_TokenTocBeginParser->setGroup() -----------------------------------
-# function: Set current 'tokenToToc' group.
-
-sub setGroup {
- # Get arguments
- my ($self, $aGroup) = @_;
- # Set current 'tokenToToc' group
- $self->{_group} = $aGroup;
-} # setGroup()
-
-
-#--- HTML::_TokenTocBeginParser->setToc() -------------------------------------
-# function: Set current ToC.
-
-sub setToc {
- # Get arguments
- my ($self, $aToc) = @_;
- # Set current ToC
- $self->{_toc} = $aToc;
-} # setToc()
-
-
-#--- HTML::_TokenTocBeginParser::start() --------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all attribute keys (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_START, $aTag);
- # Process attributes
- $self->_processAttributes($aAttr);
-} # start()
-
-
-#--- HTML::_TokenTocBeginParser::text() ---------------------------------------
-# function: This function is called every time plain text is encountered.
-# args: - @_: array containing data.
-
-sub text {
- # Get arguments
- my ($self, $aText) = @_;
- # Was token already created and is last added token of type 'text'?
- if (
- defined($self->{_lastAddedToken}) &&
- $self->{_lastAddedTokenType} == HTML::TocGenerator::TT_TOKENTYPE_TEXT
- ) {
- # Yes, token is already created;
- # Add tag to existing token
- @${$self->{_lastAddedToken}}[HTML::TocGenerator::TT_TAG_BEGIN] .= $aText;
- }
- else {
- # No, token isn't created;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_TEXT, $aText);
- }
-} # text()
-
-
-
-
-#=== HTML::_TokenTocEndParser =================================================
-# function: Parse 'toc tokens'. 'Toc tokens' mark HTML code which is to be
-# inserted into the ToC.
-# note: Used internally.
-
-package HTML::_TokenTocEndParser;
-
-
-BEGIN {
- use vars qw(@ISA);
-
- @ISA = qw(HTML::_TokenTocParser);
-}
-
-
-END {}
-
-
-#--- HTML::_TokenTocEndParser::new() ------------------------------------------
-# function: Constructor
-# args: - $aType: Class type.
-
-sub new {
- # Get arguments
- my ($aType) = @_;
- # Create instance
- my $self = $aType->SUPER::new;
- # Reference to last added token
- $self->{_lastAddedToken} = undef;
- # Return instance
- return $self;
-} # new()
-
-
-#--- HTML::_TokenTocEndParser::_processAttributes() ---------------------------
-# function: Process attributes.
-# args: - $aAttributes: Attributes to parse.
-
-sub _processAttributes {
- # Get arguments
- my ($self, $aAttributes) = @_;
- # Local variables
- my (%includeAttributes, %excludeAttributes);
-
- # Parse attributes
- $self->_parseAttributes(
- $aAttributes, \%includeAttributes, \%excludeAttributes
- );
- # Include attributes are specified?
- if (keys(%includeAttributes) > 0) {
- # Yes, include attributes are specified;
- # Store include attributes
- @${$self->{_Token}}[
- HTML::TocGenerator::TT_INCLUDE_ATTRIBUTES_END
- ] = \%includeAttributes;
- }
- # Exclude attributes are specified?
- if (keys(%excludeAttributes) > 0) {
- # Yes, exclude attributes are specified;
- # Store exclude attributes
- @${$self->{_Token}}[
- HTML::TocGenerator::TT_EXCLUDE_ATTRIBUTES_END
- ] = \%excludeAttributes;
- }
-} # _processAttributes()
-
-
-#--- HTML::_TokenTocEndParser::_processToken() --------------------------------
-# function: Process token.
-# args: - $aTokenType: Type of token to process.
-# - $aTag: Tag of token.
-
-sub _processToken {
- # Get arguments
- my ($self, $aTokenType, $aTag) = @_;
- # Update token
- @${$self->{_token}}[HTML::TocGenerator::TT_TAG_TYPE_END] = $aTokenType;
- @${$self->{_token}}[HTML::TocGenerator::TT_TAG_END] = $aTag;
- # Indicate token type which has been processed
- $self->{_lastAddedTokenType} = $aTokenType;
-} # _processToken()
-
-
-#--- HTML::_TokenTocEndParser::comment() --------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_COMMENT, $aComment);
-} # comment()
-
-
-#--- HTML::_TokenTocDeclarationParser::declaration() --------------------------
-# function: This function is called every time a markup declaration is
-# encountered by HTML::Parser.
-# args: - $aDeclaration: Markup declaration.
-
-sub declaration {
- # Get arguments
- my ($self, $aDeclaration) = @_;
- # Process token
- $self->_processToken(
- HTML::TocGenerator::TT_TOKENTYPE_DECLARATION, $aDeclaration
- );
-} # declaration()
-
-
-#--- HTML::_TokenTocEndParser::end() ------------------------------------------
-# function: This function is called every time a closing tag is encountered
-# by HTML::Parser.
-# args: - $aTag: tag name (in lower case).
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_END, $aTag);
-} # end()
-
-
-#--- HTML::_TokenTocEndParser::parse() ----------------------------------------
-# function: Parse token.
-# args: - $aString: 'toc token' to parse
-# - $aToken: Reference to token
-# - $aTokenTypeBegin: Type of begin token
-
-sub parse {
- # Get arguments
- my ($self, $aString, $aToken, $aTokenTypeBegin) = @_;
- # Token argument specified?
- if (defined($aToken)) {
- # Yes, token argument is specified;
- # Store token reference
- $self->{_token} = $aToken;
- }
- # End tag defined?
- if (! defined($aString)) {
- # No, end tag isn't defined;
- # Last added tokentype was of type 'start'?
- if (
- (defined($aTokenTypeBegin)) &&
- ($aTokenTypeBegin == HTML::TocGenerator::TT_TOKENTYPE_START)
- ) {
- # Yes, last added tokentype was of type 'start';
- # Assume end tag
- $self->_processToken(
- HTML::TocGenerator::TT_TAG_END,
- @${$self->{_token}}[HTML::TocGenerator::TT_TAG_BEGIN]
- );
- }
- }
- else {
- # Call ancestor
- $self->SUPER::parse($aString);
- }
-} # parse()
-
-
-#--- HTML::_TokenTocEndParser::start() ----------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all attribute keys (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_START, $aTag);
- # Process attributes
- $self->_processAttributes($aAttr);
-} # start()
-
-
-#--- HTML::_TokenTocEndParser::text() -----------------------------------------
-# function: This function is called every time plain text is encountered.
-# args: - @_: array containing data.
-
-sub text {
- # Get arguments
- my ($self, $aText) = @_;
-
- # Is token already created?
- if (defined($self->{_lastAddedTokenType})) {
- # Yes, token is already created;
- # Add tag to existing token
- @${$self->{_token}}[HTML::TocGenerator::TT_TAG_END] .= $aText;
- }
- else {
- # No, token isn't created;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_TEXT, $aText);
- }
-} # text()
-
-
-1;
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/TocInsertor.pm b/libvpx/examples/includes/HTML-Toc-0.91/TocInsertor.pm
deleted file mode 100644
index b554870..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/TocInsertor.pm
+++ /dev/null
@@ -1,1066 +0,0 @@
-#--- TocInsertor.pm -----------------------------------------------------------
-# function: Insert Table of Contents HTML::Toc, generated by
-# HTML::TocGenerator.
-# note: - The term 'propagate' is used as a shortcut for the process of
-# both generating and inserting a ToC at the same time.
-# - 'TIP' is an abbreviation of 'Toc Insertion Point'.
-
-
-package HTML::TocInsertor;
-
-
-use strict;
-use FileHandle;
-use HTML::TocGenerator;
-
-
-BEGIN {
- use vars qw(@ISA $VERSION);
-
- $VERSION = '0.91';
-
- @ISA = qw(HTML::TocGenerator);
-}
-
- # TocInsertionPoint (TIP) constants
-
-use constant TIP_PREPOSITION_REPLACE => 'replace';
-use constant TIP_PREPOSITION_BEFORE => 'before';
-use constant TIP_PREPOSITION_AFTER => 'after';
-
-use constant TIP_TOKEN_ID => 0;
-use constant TIP_PREPOSITION => 1;
-use constant TIP_INCLUDE_ATTRIBUTES => 2;
-use constant TIP_EXCLUDE_ATTRIBUTES => 3;
-use constant TIP_TOC => 4;
-
-use constant MODE_DO_NOTHING => 0; # 0b00
-use constant MODE_DO_INSERT => 1; # 0b01
-use constant MODE_DO_PROPAGATE => 3; # 0b11
-
-END {}
-
-
-#--- HTML::TocInsertor::new() -------------------------------------------------
-# function: Constructor.
-
-sub new {
- # Get arguments
- my ($aType) = @_;
- my $self = $aType->SUPER::new;
- # TRUE if insertion point token must be output, FALSE if not
- $self->{_doOutputInsertionPointToken} = 1;
- # Reset batch variables
- $self->_resetBatchVariables;
- # Bias to not insert ToC
- $self->{hti__Mode} = MODE_DO_NOTHING;
-
- # TODO: Initialize output
-
- return $self;
-} # new()
-
-
-#--- HTML::TocInsertor::_deinitializeOutput() ---------------------------------
-# function: Deinitialize output.
-
-sub _deinitializeOutput {
- # Get arguments
- my ($self) = @_;
- # Filehandle is defined?
- if (defined($self->{_outputFileHandle})) {
- # Yes, filehandle is defined;
- # Restore selected filehandle
- select($self->{_oldFileHandle});
- # Undefine filehandle, closing it automatically
- undef $self->{_outputFileHandle};
- }
-} # _deinitializeOutput()
-
-
-#--- HTML::TocInsertor::_initializeOutput() -----------------------------------
-# function: Initialize output.
-
-sub _initializeOutput {
- # Get arguments
- my ($self) = @_;
- # Bias to write to outputfile
- my $doOutputToFile = 1;
-
- # Is output specified?
- if (defined($self->{options}{'output'})) {
- # Yes, output is specified;
- # Indicate to not output to outputfile
- $doOutputToFile = 0;
- # Alias output reference
- $self->{_output} = $self->{options}{'output'};
- # Clear output
- ${$self->{_output}} = "";
- }
-
- # Is output file specified?
- if (defined($self->{options}{'outputFile'})) {
- # Yes, output file is specified;
- # Indicate to output to outputfile
- $doOutputToFile = 1;
- # Open file
- $self->{_outputFileHandle} =
- new FileHandle ">" . $self->{options}{'outputFile'};
-
- # Backup currently selected filehandle
- $self->{_oldFileHandle} = select;
- # Set new default filehandle
- select($self->{_outputFileHandle});
- }
-
- # Alias output-to-file indicator
- $self->{_doOutputToFile} = $doOutputToFile;
-} # _initializeOutput()
-
-
-#--- HTML::TocInsertor::_deinitializeInsertorBatch() --------------------------
-# function: Deinitialize insertor batch.
-
-sub _deinitializeInsertorBatch {
- # Get arguments
- my ($self) = @_;
- # Indicate ToC insertion has finished
- $self->{_isTocInsertionPointPassed} = 0;
- # Write buffered output
- $self->_writeBufferedOutput();
- # Propagate?
- if ($self->{hti__Mode} == MODE_DO_PROPAGATE) {
- # Yes, propagate;
- # Deinitialize generator batch
- $self->_deinitializeGeneratorBatch();
- }
- else {
- # No, insert only;
- # Do general batch deinitialization
- $self->_deinitializeBatch();
- }
- # Deinitialize output
- $self->_deinitializeOutput();
- # Indicate end of batch
- $self->{hti__Mode} = MODE_DO_NOTHING;
- # Reset batch variables
- $self->_resetBatchVariables();
-} # _deinitializeInsertorBatch()
-
-
-#--- HTML::TocInsertor::_initializeInsertorBatch() ----------------------------
-# function: Initialize insertor batch.
-# args: - $aTocs: Reference to array of tocs.
-# - $aOptions: optional options
-
-sub _initializeInsertorBatch {
- # Get arguments
- my ($self, $aTocs, $aOptions) = @_;
- # Add invocation options
- $self->setOptions($aOptions);
- # Option 'doGenerateToc' specified?
- if (!defined($self->{options}{'doGenerateToc'})) {
- # No, options 'doGenerateToc' not specified;
- # Default to 'doGenerateToc'
- $self->{options}{'doGenerateToc'} = 1;
- }
- # Propagate?
- if ($self->{options}{'doGenerateToc'}) {
- # Yes, propagate;
- # Indicate mode
- $self->{hti__Mode} = MODE_DO_PROPAGATE;
- # Initialize generator batch
- # NOTE: This method takes care of calling '_initializeBatch()'
- $self->_initializeGeneratorBatch($aTocs);
- }
- else {
- # No, insert;
- # Indicate mode
- $self->{hti__Mode} = MODE_DO_INSERT;
- # Do general batch initialization
- $self->_initializeBatch($aTocs);
- }
- # Initialize output
- $self->_initializeOutput();
- # Parse ToC insertion points
- $self->_parseTocInsertionPoints();
-} # _initializeInsertorBatch()
-
-
-#--- HTML::TocInsertor::_insert() ---------------------------------------------
-# function: Insert ToC in string.
-# args: - $aString: Reference to string to parse.
-# note: Used internally.
-
-sub _insert {
- # Get arguments
- my ($self, $aString) = @_;
- # Propagate?
- if ($self->{options}{'doGenerateToc'}) {
- # Yes, propagate;
- # Generate & insert ToC
- $self->_generate($aString);
- }
- else {
- # No, just insert ToC
- # Insert by parsing file
- $self->parse($aString);
- # Flush remaining buffered text
- $self->eof();
- }
-} # _insert()
-
-
-#--- HTML::TocInsertor::_insertIntoFile() -------------------------------------
-# function: Do insert generated ToCs in file.
-# args: - $aToc: (reference to array of) ToC object(s) to insert.
-# - $aFile: (reference to array of) file(s) to parse for insertion
-# points.
-# - $aOptions: optional insertor options
-# note: Used internally.
-
-sub _insertIntoFile {
- # Get arguments
- my ($self, $aFile) = @_;
- # Local variables;
- my ($file, @files);
- # Dereference array reference or make array of file specification
- @files = (ref($aFile) =~ m/ARRAY/) ? @$aFile : ($aFile);
- # Loop through files
- foreach $file (@files) {
- # Propagate?
- if ($self->{options}{'doGenerateToc'}) {
- # Yes, propagate;
- # Generate and insert ToC
- $self->_generateFromFile($file);
- }
- else {
- # No, just insert ToC
- # Insert by parsing file
- $self->parse_file($file);
- }
- }
-} # _insertIntoFile()
-
-
-#--- HTML::TocInsertor::_parseTocInsertionPoints() ----------------------------
-# function: Parse ToC insertion point specifier.
-
-sub _parseTocInsertionPoints {
- # Get arguments
- my ($self) = @_;
- # Local variables
- my ($tipPreposition, $tipToken, $toc, $tokenTipParser);
- # Create parser for TIP tokens
- $tokenTipParser = HTML::_TokenTipParser->new(
- $self->{_tokensTip}
- );
- # Loop through ToCs
- foreach $toc (@{$self->{_tocs}}) {
- # Split TIP in preposition and token
- ($tipPreposition, $tipToken) = split(
- '\s+', $toc->{options}{'insertionPoint'}, 2
- );
- # Known preposition?
- if (
- ($tipPreposition ne TIP_PREPOSITION_REPLACE) &&
- ($tipPreposition ne TIP_PREPOSITION_BEFORE) &&
- ($tipPreposition ne TIP_PREPOSITION_AFTER)
- ) {
- # No, unknown preposition;
- # Use default preposition
- $tipPreposition = TIP_PREPOSITION_AFTER;
- # Use entire 'insertionPoint' as token
- $tipToken = $toc->{options}{'insertionPoint'};
- }
- # Indicate current ToC to parser
- $tokenTipParser->setToc($toc);
- # Indicate current preposition to parser
- $tokenTipParser->setPreposition($tipPreposition);
- # Parse ToC Insertion Point
- $tokenTipParser->parse($tipToken);
- # Flush remaining buffered text
- $tokenTipParser->eof();
- }
-} # _parseTocInsertionPoints()
-
-
-#--- HTML::TocInsertor::_processTokenAsInsertionPoint() -----------------------
-# function: Check for token being a ToC insertion point (Tip) token and
-# process it accordingly.
-# args: - $aTokenType: type of token: start, end, comment or text.
-# - $aTokenId: token id of currently parsed token
-# - $aTokenAttributes: attributes of currently parsed token
-# - $aOrigText: complete token
-# returns: 1 if successful -- token is processed as insertion point, 0
-# if not.
-
-sub _processTokenAsInsertionPoint {
- # Get arguments
- my ($self, $aTokenType, $aTokenId, $aTokenAttributes, $aOrigText) = @_;
- # Local variables
- my ($i, $result, $tipToken, $tipTokenId, $tipTokens);
- # Bias to token not functioning as a ToC insertion point (Tip) token
- $result = 0;
- # Alias ToC insertion point (Tip) array of right type
- $tipTokens = $self->{_tokensTip}[$aTokenType];
- # Loop through tipTokens
- $i = 0;
- while ($i < scalar @{$tipTokens}) {
- # Aliases
- $tipToken = $tipTokens->[$i];
- $tipTokenId = $tipToken->[TIP_TOKEN_ID];
- # Id & attributes match?
- if (
- ($aTokenId =~ m/$tipTokenId/) && (
- HTML::TocGenerator::_doesHashContainHash(
- $aTokenAttributes, $tipToken->[TIP_INCLUDE_ATTRIBUTES], 0
- ) &&
- HTML::TocGenerator::_doesHashContainHash(
- $aTokenAttributes, $tipToken->[TIP_EXCLUDE_ATTRIBUTES], 1
- )
- )
- ) {
- # Yes, id and attributes match;
- # Process ToC insertion point
- $self->_processTocInsertionPoint($tipToken);
- # Indicate token functions as ToC insertion point
- $result = 1;
- # Remove Tip token, automatically advancing to next token
- splice(@$tipTokens, $i, 1);
- }
- else {
- # No, tag doesn't match ToC insertion point
- # Advance to next start token
- $i++;
- }
- }
- # Token functions as ToC insertion point?
- if ($result) {
- # Yes, token functions as ToC insertion point;
- # Process insertion point(s)
- $self->_processTocInsertionPoints($aOrigText);
- }
- # Return value
- return $result;
-} # _processTokenAsInsertionPoint()
-
-
-#--- HTML::TocInsertor::toc() -------------------------------------------------
-# function: Toc processing method. Add toc reference to scenario.
-# args: - $aScenario: Scenario to add ToC reference to.
-# - $aToc: Reference to ToC to insert.
-# note: The ToC hasn't been build yet; only a reference to the ToC to be
-# build is inserted.
-
-sub toc {
- # Get arguments
- my ($self, $aScenario, $aToc) = @_;
- # Add toc to scenario
- push(@$aScenario, $aToc);
-} # toc()
-
-
-#--- HTML::TocInsertor::_processTocInsertionPoint() ----------------------------
-# function: Process ToC insertion point.
-# args: - $aTipToken: Reference to token array item which matches the ToC
-# insertion point.
-
-sub _processTocInsertionPoint {
- # Get arguments
- my ($self, $aTipToken) = @_;
- # Local variables
- my ($tipToc, $tipPreposition);
-
- # Aliases
- $tipToc = $aTipToken->[TIP_TOC];
- $tipPreposition = $aTipToken->[TIP_PREPOSITION];
-
- SWITCH: {
- # Replace token with ToC?
- if ($tipPreposition eq TIP_PREPOSITION_REPLACE) {
- # Yes, replace token;
- # Indicate ToC insertion point has been passed
- $self->{_isTocInsertionPointPassed} = 1;
- # Add ToC reference to scenario reference by calling 'toc' method
- $self->toc($self->{_scenarioAfterToken}, $tipToc);
- #push(@{$self->{_scenarioAfterToken}}, $tipTokenToc);
- # Indicate token itself must not be output
- $self->{_doOutputInsertionPointToken} = 0;
- last SWITCH;
- }
- # Output ToC before token?
- if ($tipPreposition eq TIP_PREPOSITION_BEFORE) {
- # Yes, output ToC before token;
- # Indicate ToC insertion point has been passed
- $self->{_isTocInsertionPointPassed} = 1;
- # Add ToC reference to scenario reference by calling 'toc' method
- $self->toc($self->{_scenarioBeforeToken}, $tipToc);
- #push(@{$self->{_scenarioBeforeToken}}, $tipTokenToc);
- last SWITCH;
- }
- # Output ToC after token?
- if ($tipPreposition eq TIP_PREPOSITION_AFTER) {
- # Yes, output ToC after token;
- # Indicate ToC insertion point has been passed
- $self->{_isTocInsertionPointPassed} = 1;
- # Add ToC reference to scenario reference by calling 'toc' method
- $self->toc($self->{_scenarioAfterToken}, $tipToc);
- #push(@{$self->{_scenarioAfterToken}}, $tipTokenToc);
- last SWITCH;
- }
- }
-} # _processTocInsertionPoint()
-
-
-#--- HTML::TocInsertor::_processTocInsertionPoints() --------------------------
-# function: Process ToC insertion points
-# args: - $aTokenText: Text of token which acts as insertion point for one
-# or multiple ToCs.
-
-sub _processTocInsertionPoints {
- # Get arguments
- my ($self, $aTokenText) = @_;
- # Local variables
- my ($outputPrefix, $outputSuffix);
- # Extend scenario
- push(@{$self->{_scenario}}, @{$self->{_scenarioBeforeToken}});
-
- if ($outputPrefix = $self->{_outputPrefix}) {
- push(@{$self->{_scenario}}, \$outputPrefix);
- $self->{_outputPrefix} = "";
- }
-
- # Must insertion point token be output?
- if ($self->{_doOutputInsertionPointToken}) {
- # Yes, output insertion point token;
- push(@{$self->{_scenario}}, \$aTokenText);
- }
-
- if ($outputSuffix = $self->{_outputSuffix}) {
- push(@{$self->{_scenario}}, \$outputSuffix);
- $self->{_outputSuffix} = "";
- }
-
- push(@{$self->{_scenario}}, @{$self->{_scenarioAfterToken}});
- # Add new act to scenario for output to come
- my $output = "";
- push(@{$self->{_scenario}}, \$output);
- # Write output, processing possible '_outputSuffix'
- #$self->_writeOrBufferOutput("");
- # Reset helper scenario's
- $self->{_scenarioBeforeToken} = [];
- $self->{_scenarioAfterToken} = [];
- # Reset bias value to output insertion point token
- $self->{_doOutputInsertionPointToken} = 1;
-
-} # _processTocInsertionPoints()
-
-
-#--- HTML::Toc::_resetBatchVariables() ----------------------------------------
-# function: Reset batch variables.
-
-sub _resetBatchVariables {
- my ($self) = @_;
- # Call ancestor
- $self->SUPER::_resetBatchVariables();
- # Array containing references to scalars. This array depicts the order
- # in which output must be performed after the first ToC Insertion Point
- # has been passed.
- $self->{_scenario} = [];
- # Helper scenario
- $self->{_scenarioBeforeToken} = [];
- # Helper scenario
- $self->{_scenarioAfterToken} = [];
- # Arrays containing start, end, comment, text & declaration tokens which
- # must trigger the ToC insertion. Each array element may contain a
- # reference to an array containing the following elements:
- $self->{_tokensTip} = [
- [], # TT_TOKENTYPE_START
- [], # TT_TOKENTYPE_END
- [], # TT_TOKENTYPE_COMMENT
- [], # TT_TOKENTYPE_TEXT
- [] # TT_TOKENTYPE_DECLARATION
- ];
- # 1 if ToC insertion point has been passed, 0 if not
- $self->{_isTocInsertionPointPassed} = 0;
- # Tokens after ToC
- $self->{outputBuffer} = "";
- # Trailing text after parsed token
- $self->{_outputSuffix} = "";
- # Preceding text before parsed token
- $self->{_outputPrefix} = "";
-} # _resetBatchVariables()
-
-
-#--- HTML::TocInsertor::_writeBufferedOutput() --------------------------------
-# function: Write buffered output to output device(s).
-
-sub _writeBufferedOutput {
- # Get arguments
- my ($self) = @_;
- # Local variables
- my ($scene);
- # Must ToC be parsed?
- if ($self->{options}{'parseToc'}) {
- # Yes, ToC must be parsed;
- # Parse ToC
- #$self->parse($self->{toc});
- # Output tokens after ToC
- #$self->_writeOrBufferOutput($self->{outputBuffer});
- }
- else {
- # No, ToC needn't be parsed;
- # Output scenario
- foreach $scene (@{$self->{_scenario}}) {
- # Is scene a reference to a scalar?
- if (ref($scene) eq "SCALAR") {
- # Yes, scene is a reference to a scalar;
- # Output scene
- $self->_writeOutput($$scene);
- }
- else {
- # No, scene must be reference to HTML::Toc;
- # Output toc
- $self->_writeOutput($scene->format());
- }
- }
- }
-} # _writeBufferedOutput()
-
-
-#--- HTML::TocInsertor::_writeOrBufferOutput() --------------------------------
-# function: Write processed HTML to output device(s).
-# args: - aOutput: scalar to write
-# note: If '_isTocInsertionPointPassed' text is buffered before being
-# output because the ToC has to be generated before it can be output.
-# Only after the entire data has been parsed, the ToC and the
-# following text will be output.
-
-sub _writeOrBufferOutput {
- # Get arguments
- my ($self, $aOutput) = @_;
-
- # Add possible output prefix and suffix
- $aOutput = $self->{_outputPrefix} . $aOutput . $self->{_outputSuffix};
- # Clear output prefix and suffix
- $self->{_outputPrefix} = "";
- $self->{_outputSuffix} = "";
-
- # Has ToC insertion point been passed?
- if ($self->{_isTocInsertionPointPassed}) {
- # Yes, ToC insertion point has been passed;
- # Buffer output; add output to last '_scenario' item
- my $index = scalar(@{$self->{_scenario}}) - 1;
- ${$self->{_scenario}[$index]} .= $aOutput;
- }
- else {
- # No, ToC insertion point hasn't been passed;
- # Write output
- $self->_writeOutput($aOutput);
- }
-} # _writeOrBufferOutput()
-
-
-#--- HTML::TocInsertor::_writeOutput() ----------------------------------------
-# function: Write processed HTML to output device(s).
-# args: - aOutput: scalar to write
-
-sub _writeOutput {
- # Get arguments
- my ($self, $aOutput) = @_;
- # Write output to scalar;
- ${$self->{_output}} .= $aOutput if (defined($self->{_output}));
- # Write output to output file
- print $aOutput if ($self->{_doOutputToFile})
-} # _writeOutput()
-
-
-#--- HTML::TocGenerator::anchorId() -------------------------------------------
-# function: Anchor id processing method.
-# args: - $aAnchorId
-
-sub anchorId {
- # Get arguments
- my ($self, $aAnchorId) = @_;
- # Indicate id must be added to start tag
- $self->{_doAddAnchorIdToStartTag} = 1;
- $self->{_anchorId} = $aAnchorId;
-} # anchorId()
-
-
-#--- HTML::TocInsertor::anchorNameBegin() -------------------------------------
-# function: Process anchor name begin, generated by HTML::TocGenerator.
-# args: - $aAnchorNameBegin: Anchor name begin tag to output.
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub anchorNameBegin {
- # Get arguments
- my ($self, $aAnchorNameBegin, $aToc) = @_;
- # Is another anchorName active?
- if (defined($self->{_activeAnchorName})) {
- # Yes, another anchorName is active;
- # Show warning
- print "Warn\n";
- $self->_showWarning(
- HTML::TocGenerator::WARNING_NESTED_ANCHOR_PS_WITHIN_PS,
- [$aAnchorNameBegin, $self->{_activeAnchorName}]
- );
- }
- # Store anchor name as output prefix
- $self->{_outputPrefix} = $aAnchorNameBegin;
- # Indicate active anchor name
- $self->{_activeAnchorName} = $aAnchorNameBegin;
- # Indicate anchor name end must be output
- $self->{_doOutputAnchorNameEnd} = 1;
-} # anchorNameBegin()
-
-
-#--- HTML::TocInsertor::anchorNameEnd() ---------------------------------------
-# function: Process anchor name end, generated by HTML::TocGenerator.
-# args: - $aAnchorNameEnd: Anchor name end tag to output.
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub anchorNameEnd {
- # Get arguments
- my ($self, $aAnchorNameEnd) = @_;
- # Store anchor name as output prefix
- $self->{_outputSuffix} .= $aAnchorNameEnd;
- # Indicate deactive anchor name
- $self->{_activeAnchorName} = undef;
-} # anchorNameEnd()
-
-
-#--- HTML::TocInsertor::comment() ---------------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Local variables
- my ($tocInsertionPointToken, $doOutput, $origText);
- # Allow ancestor to process the comment tag
- $self->SUPER::comment($aComment);
- # Assemble original comment
- $origText = "<!--$aComment-->";
- # Must ToCs be inserted?
- if ($self->{hti__Mode} & MODE_DO_INSERT) {
- # Yes, ToCs must be inserted;
- # Processing comment as ToC insertion point is successful?
- if (! $self->_processTokenAsInsertionPoint(
- HTML::TocGenerator::TT_TOKENTYPE_COMMENT, $aComment, undef, $origText
- )) {
- # No, comment isn't a ToC insertion point;
- # Output comment normally
- $self->_writeOrBufferOutput($origText);
- }
- }
-} # comment()
-
-
-#--- HTML::TocInsertor::declaration() -----------------------------------------
-# function: This function is called every time a declaration is encountered
-# by HTML::Parser.
-
-sub declaration {
- # Get arguments
- my ($self, $aDeclaration) = @_;
- # Allow ancestor to process the declaration tag
- $self->SUPER::declaration($aDeclaration);
- # Must ToCs be inserted?
- if ($self->{hti__Mode} & MODE_DO_INSERT) {
- # Yes, ToCs must be inserted;
- # Processing declaration as ToC insertion point is successful?
- if (! $self->_processTokenAsInsertionPoint(
- HTML::TocGenerator::TT_TOKENTYPE_DECLARATION, $aDeclaration, undef,
- "<!$aDeclaration>"
- )) {
- # No, declaration isn't a ToC insertion point;
- # Output declaration normally
- $self->_writeOrBufferOutput("<!$aDeclaration>");
- }
- }
-} # declaration()
-
-
-#--- HTML::TocInsertor::end() -------------------------------------------------
-# function: This function is called every time a closing tag is encountered
-# by HTML::Parser.
-# args: - $aTag: tag name (in lower case).
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Allow ancestor to process the end tag
- $self->SUPER::end($aTag, $aOrigText);
- # Must ToCs be inserted?
- if ($self->{hti__Mode} & MODE_DO_INSERT) {
- # Yes, ToCs must be inserted;
- # Processing end tag as ToC insertion point is successful?
- if (! $self->_processTokenAsInsertionPoint(
- HTML::TocGenerator::TT_TOKENTYPE_END, $aTag, undef, $aOrigText
- )) {
- # No, end tag isn't a ToC insertion point;
- # Output end tag normally
- $self->_writeOrBufferOutput($aOrigText);
- }
- }
-} # end()
-
-
-#--- HTML::TocInsertor::insert() ----------------------------------------------
-# function: Insert ToC in string.
-# args: - $aToc: (reference to array of) ToC object to insert
-# - $aString: string to insert ToC in
-# - $aOptions: hash reference with optional insertor options
-
-sub insert {
- # Get arguments
- my ($self, $aToc, $aString, $aOptions) = @_;
- # Initialize TocInsertor batch
- $self->_initializeInsertorBatch($aToc, $aOptions);
- # Do insert Toc
- $self->_insert($aString);
- # Deinitialize TocInsertor batch
- $self->_deinitializeInsertorBatch();
-} # insert()
-
-
-#--- HTML::TocInsertor::insertIntoFile() --------------------------------------
-# function: Insert ToCs in file.
-# args: - $aToc: (reference to array of) ToC object(s) to insert.
-# - $aFile: (reference to array of) file(s) to parse for insertion
-# points.
-# - $aOptions: optional insertor options
-
-sub insertIntoFile {
- # Get arguments
- my ($self, $aToc, $aFile, $aOptions) = @_;
- # Initialize TocInsertor batch
- $self->_initializeInsertorBatch($aToc, $aOptions);
- # Do insert ToCs into file
- $self->_insertIntoFile($aFile);
- # Deinitialize TocInsertor batch
- $self->_deinitializeInsertorBatch();
-} # insertIntoFile()
-
-
-#--- HTML::TocInsertor::number() ----------------------------------------------
-# function: Process heading number generated by HTML::Toc.
-# args: - $aNumber
-
-sub number {
- # Get arguments
- my ($self, $aNumber) = @_;
- # Store heading number as output suffix
- $self->{_outputSuffix} .= $aNumber;
-} # number()
-
-
-#--- HTML::TocInsertor::propagateFile() ---------------------------------------
-# function: Propagate ToC; generate & insert ToC, using file as input.
-# args: - $aToc: (reference to array of) ToC object to insert
-# - $aFile: (reference to array of) file to parse for insertion
-# points.
-# - $aOptions: optional insertor options
-
-sub propagateFile {
- # Get arguments
- my ($self, $aToc, $aFile, $aOptions) = @_;
- # Local variables;
- my ($file, @files);
- # Initialize TocInsertor batch
- $self->_initializeInsertorBatch($aToc, $aOptions);
- # Dereference array reference or make array of file specification
- @files = (ref($aFile) =~ m/ARRAY/) ? @$aFile : ($aFile);
- # Loop through files
- foreach $file (@files) {
- # Generate and insert ToC
- $self->_generateFromFile($file);
- }
- # Deinitialize TocInsertor batch
- $self->_deinitializeInsertorBatch();
-} # propagateFile()
-
-
-#--- HTML::TocInsertor::start() -----------------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all tag attributes (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- # Local variables
- my ($doOutput, $i, $tocToken, $tag, $anchorId);
- # Let ancestor process the start tag
- $self->SUPER::start($aTag, $aAttr, $aAttrSeq, $aOrigText);
- # Must ToC be inserted?
- if ($self->{hti__Mode} & MODE_DO_INSERT) {
- # Yes, ToC must be inserted;
- # Processing start tag as ToC insertion point is successful?
- if (! $self->_processTokenAsInsertionPoint(
- HTML::TocGenerator::TT_TOKENTYPE_START, $aTag, $aAttr, $aOrigText
- )) {
- # No, start tag isn't a ToC insertion point;
- # Add anchor id?
- if ($self->{_doAddAnchorIdToStartTag}) {
- # Yes, anchor id must be added;
- # Reset indicator;
- $self->{_doAddAnchorIdToStartTag} = 0;
- # Alias anchor id
- $anchorId = $self->{_anchorId};
- # Attribute 'id' already exists?
- if (defined($aAttr->{id})) {
- # Yes, attribute 'id' already exists;
- # Show warning
- print STDERR "WARNING: Overwriting existing id attribute '" .
- $aAttr->{id} . "' of tag $aOrigText\n";
-
- # Add anchor id to start tag
- $aOrigText =~ s/(id)=\S*([\s>])/$1=$anchorId$2/i;
- }
- else {
- # No, attribute 'id' doesn't exist;
- # Add anchor id to start tag
- $aOrigText =~ s/>/ id=$anchorId>/;
- }
- }
- # Output start tag normally
- $self->_writeOrBufferOutput($aOrigText);
- }
- }
-} # start()
-
-
-#--- HTML::TocInsertor::text() ------------------------------------------------
-# function: This function is called every time plain text is encountered.
-# args: - @_: array containing data.
-
-sub text {
- # Get arguments
- my ($self, $aText) = @_;
- # Let ancestor process the text
- $self->SUPER::text($aText);
- # Must ToC be inserted?
- if ($self->{hti__Mode} & MODE_DO_INSERT) {
- # Yes, ToC must be inserted;
- # Processing text as ToC insertion point is successful?
- if (! $self->_processTokenAsInsertionPoint(
- HTML::TocGenerator::TT_TOKENTYPE_TEXT, $aText, undef, $aText
- )) {
- # No, text isn't a ToC insertion point;
- # Output text normally
- $self->_writeOrBufferOutput($aText);
- }
- }
-} # text()
-
-
-
-
-#=== HTML::_TokenTipParser ====================================================
-# function: Parse 'TIP tokens'. 'TIP tokens' mark HTML code which is to be
-# used as the ToC Insertion Point.
-# note: Used internally.
-
-package HTML::_TokenTipParser;
-
-
-BEGIN {
- use vars qw(@ISA);
-
- @ISA = qw(HTML::_TokenTocParser);
-}
-
-
-END {}
-
-
-#--- HTML::_TokenTipParser::new() ---------------------------------------------
-# function: Constructor
-
-sub new {
- # Get arguments
- my ($aType, $aTokenArray) = @_;
- # Create instance
- my $self = $aType->SUPER::new;
- # Reference token array
- $self->{tokens} = $aTokenArray;
- # Reference to last added token
- $self->{_lastAddedToken} = undef;
- $self->{_lastAddedTokenType} = undef;
- # Return instance
- return $self;
-} # new()
-
-
-#--- HTML::_TokenTipParser::_processAttributes() ------------------------------
-# function: Process attributes.
-# args: - $aAttributes: Attributes to parse.
-
-sub _processAttributes {
- # Get arguments
- my ($self, $aAttributes) = @_;
- # Local variables
- my (%includeAttributes, %excludeAttributes);
-
- # Parse attributes
- $self->_parseAttributes(
- $aAttributes, \%includeAttributes, \%excludeAttributes
- );
- # Include attributes are specified?
- if (keys(%includeAttributes) > 0) {
- # Yes, include attributes are specified;
- # Store include attributes
- @${$self->{_lastAddedToken}}[
- HTML::TocInsertor::TIP_INCLUDE_ATTRIBUTES
- ] = \%includeAttributes;
- }
- # Exclude attributes are specified?
- if (keys(%excludeAttributes) > 0) {
- # Yes, exclude attributes are specified;
- # Store exclude attributes
- @${$self->{_lastAddedToken}}[
- HTML::TocInsertor::TIP_EXCLUDE_ATTRIBUTES
- ] = \%excludeAttributes;
- }
-} # _processAttributes()
-
-
-#--- HTML::_TokenTipParser::_processToken() -----------------------------------
-# function: Process token.
-# args: - $aTokenType: Type of token to process.
-# - $aTag: Tag of token.
-
-sub _processToken {
- # Get arguments
- my ($self, $aTokenType, $aTag) = @_;
- # Local variables
- my ($tokenArray, $index);
- # Push element on array of update tokens
- $index = push(@{$self->{tokens}[$aTokenType]}, []) - 1;
- # Alias token array to add element to
- $tokenArray = $self->{tokens}[$aTokenType];
- # Indicate last updated token array element
- $self->{_lastAddedTokenType} = $aTokenType;
- $self->{_lastAddedToken} = \$$tokenArray[$index];
- # Add fields
- $$tokenArray[$index][HTML::TocInsertor::TIP_TOC] = $self->{_toc};
- $$tokenArray[$index][HTML::TocInsertor::TIP_TOKEN_ID] = $aTag;
- $$tokenArray[$index][HTML::TocInsertor::TIP_PREPOSITION] =
- $self->{_preposition};
-} # _processToken()
-
-
-#--- HTML::_TokenTipParser::comment() -----------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_COMMENT, $aComment);
-} # comment()
-
-
-#--- HTML::_TokenTipParser::declaration() --------------------------------
-# function: This function is called every time a markup declaration is
-# encountered by HTML::Parser.
-# args: - $aDeclaration: Markup declaration.
-
-sub declaration {
- # Get arguments
- my ($self, $aDeclaration) = @_;
- # Process token
- $self->_processToken(
- HTML::TocGenerator::TT_TOKENTYPE_DECLARATION, $aDeclaration
- );
-} # declaration()
-
-
-#--- HTML::_TokenTipParser::end() ----------------------------------------
-# function: This function is called every time a closing tag is encountered
-# by HTML::Parser.
-# args: - $aTag: tag name (in lower case).
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_END, $aTag);
-} # end()
-
-
-#--- HTML::_TokenTipParser->setPreposition() ----------------------------------
-# function: Set current preposition.
-
-sub setPreposition {
- # Get arguments
- my ($self, $aPreposition) = @_;
- # Set current ToC
- $self->{_preposition} = $aPreposition;
-} # setPreposition()
-
-
-#--- HTML::_TokenTipParser->setToc() ------------------------------------------
-# function: Set current ToC.
-
-sub setToc {
- # Get arguments
- my ($self, $aToc) = @_;
- # Set current ToC
- $self->{_toc} = $aToc;
-} # setToc()
-
-
-#--- HTML::_TokenTipParser::start() --------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all attribute keys (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_START, $aTag);
- # Process attributes
- $self->_processAttributes($aAttr);
-} # start()
-
-
-#--- HTML::_TokenTipParser::text() ---------------------------------------
-# function: This function is called every time plain text is encountered.
-# args: - @_: array containing data.
-
-sub text {
- # Get arguments
- my ($self, $aText) = @_;
- # Was token already created and is last added token of type 'text'?
- if (
- defined($self->{_lastAddedToken}) &&
- $self->{_lastAddedTokenType} == HTML::TocGenerator::TT_TOKENTYPE_TEXT
- ) {
- # Yes, token is already created;
- # Add tag to existing token
- @${$self->{_lastAddedToken}}[HTML::TocGenerator::TT_TAG_BEGIN] .= $aText;
- }
- else {
- # No, token isn't created;
- # Process token
- $self->_processToken(HTML::TocGenerator::TT_TOKENTYPE_TEXT, $aText);
- }
-} # text()
-
-
-1;
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/TocUpdator.pm b/libvpx/examples/includes/HTML-Toc-0.91/TocUpdator.pm
deleted file mode 100644
index affca9d..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/TocUpdator.pm
+++ /dev/null
@@ -1,693 +0,0 @@
-#==== HTML::TocUpdator ========================================================
-# function: Update 'HTML::Toc' table of contents.
-# note: - 'TUT' is an abbreviation of 'Toc Update Token'.
-
-
-package HTML::TocUpdator;
-
-
-use strict;
-use HTML::TocInsertor;
-
-
-BEGIN {
- use vars qw(@ISA $VERSION);
-
- $VERSION = '0.91';
-
- @ISA = qw(HTML::TocInsertor);
-}
-
-
-use constant TUT_TOKENTYPE_START => 0;
-use constant TUT_TOKENTYPE_END => 1;
-use constant TUT_TOKENTYPE_TEXT => 2;
-use constant TUT_TOKENTYPE_COMMENT => 3;
-
-use constant MODE_DO_NOTHING => 0; # 0b00
-use constant MODE_DO_INSERT => 1; # 0b01
-use constant MODE_DO_UPDATE => 3; # 0b11
-
-
-END {}
-
-
-#--- HTML::TocUpdator::new() --------------------------------------------------
-# function: Constructor.
-
-sub new {
- # Get arguments
- my ($aType) = @_;
- my $self = $aType->SUPER::new;
- # Bias to not update ToC
- $self->{htu__Mode} = MODE_DO_NOTHING;
- # Bias to not delete tokens
- $self->{_doDeleteTokens} = 0;
- # Reset batch variables
- #$self->_resetBatchVariables;
-
- $self->{options} = {};
-
- # TODO: Initialize output
-
- return $self;
-} # new()
-
-
-#--- HTML::TocUpdator::_deinitializeUpdatorBatch() --------------------------
-# function: Deinitialize updator batch.
-# args: - $aTocs: Reference to array of tocs.
-
-sub _deinitializeUpdatorBatch {
- # Get arguments
- my ($self, $aTocs) = @_;
- # Indicate end of ToC updating
- $self->{htu__Mode} = MODE_DO_NOTHING;
- # Deinitialize insertor batch
- $self->_deinitializeInsertorBatch();
-} # _deinitializeUpdatorBatch()
-
-
-#--- HTML::TokenUpdator::_doesHashEqualHash() ---------------------------------
-# function: Determines whether hash1 equals hash2.
-# args: - $aHash1
-# - $aHash2
-# returns: True (1) if hash1 equals hash2, 0 if not. For example, with the
-# following hashes:
-#
-# %hash1 = { %hash2 = {
-# 'class' => 'header', 'class' => 'header',
-# 'id' => 'intro1' 'id' => 'intro2'
-# } }
-#
-# the routine will return 0, cause the hash fields 'id' differ.
-# note: Class function.
-
-sub _doesHashEqualHash {
- # Get arguments
- my ($aHash1, $aHash2) = @_;
- # Local variables
- my ($key1, $value1, $key2, $value2, $result);
- # Bias to success
- $result = 1;
- # Loop through hash1 while values available
- HASH1: while (($key1, $value1) = each %$aHash1) {
- # Yes, values are available;
- # Value1 differs from value2?
- if ($value1 ne $aHash2->{$key1}) {
- # Yes, hashes differ;
- # Indicate condition fails
- $result = 0;
- # Reset 'each' iterator which we're going to break
- keys %$aHash2;
- # Break loop
- last HASH1;
- }
- }
- # Return value
- return $result;
-} # _doesHashEqualHash()
-
-
-#--- HTML::TokenUpdator::_doesTagExistInArray() -------------------------------
-# function: Check whether tag & attributes matches any of the tags & attributes
-# in the specified array. The array must consist of elements with
-# format:
-#
-# [$tag, \%attributes]
-#
-# args: - $aTag: tag to search for
-# - $aAttributes: tag attributes to search for
-# - $aArray: Array to search in.
-# returns: 1 if tag does exist in array, 0 if not.
-# note: Class function.
-
-sub _doesTagExistInArray {
- # Get arguments
- my ($aTag, $aAttributes, $aArray) = @_;
- # Local variables
- my ($tag, $result);
- # Bias to non-existing tag
- $result = 0;
- # Loop through existing tags
- TAG: foreach $tag (@{$aArray}) {
- if (defined(@{$tag}[0])) {
- # Does tag equals any existing tag?
- if ($aTag eq @{$tag}[0]) {
- # Yes, tag equals existing tag;
- # Do hashes equal?
- if (HTML::TocUpdator::_doesHashEqualHash(
- $aAttributes, @{$tag}[1]
- )) {
- # Yes, hashes are the same;
- # Indicate tag exists in array
- $result = 1;
- # Break loop
- last TAG;
- }
- }
- }
- }
- # Return value
- return $result;
-} # _doesTagExistInArray()
-
-
-#--- HTML::TocUpdator::_initializeUpdatorBatch() ----------------------------
-# function: Initialize insertor batch.
-# args: - $aMode: Mode. Can be either MODE_DO_INSERT or MODE_DO_UPDATE
-# - $aTocs: Reference to array of tocs.
-# - $aOptions: optional options
-# note: Updating actually means: deleting the old ToC and inserting a new
-# ToC. That's why we're calling 'insertor' methods here.
-
-sub _initializeUpdatorBatch {
- # Get arguments
- my ($self, $aMode, $aTocs, $aOptions) = @_;
- # Initialize insertor batch
- $self->_initializeInsertorBatch($aTocs, $aOptions);
- # Parse ToC update templates
- $self->_parseTocUpdateTokens();
- # Indicate start of ToC updating
- $self->{htu__Mode} = $aMode;
-} # _initializeUpdatorBatch()
-
-
-#--- HTML::TocUpdator::_parseTocUpdateTokens() --------------------------------
-# function: Parse ToC insertion point specifier.
-
-sub _parseTocUpdateTokens {
- # Get arguments
- my ($self) = @_;
- # Local variables
- my ($toc, $tokenType, $tokenPreposition, $token);
- my ($tocInsertionPoint, $tocInsertionPointTokenAttributes);
- # Create parser for update begin tokens
- my $tokenUpdateBeginParser = HTML::_TokenUpdateParser->new(
- $self->{_tokensUpdateBegin}
- );
- # Create parser for update end tokens
- my $tokenUpdateEndParser = HTML::_TokenUpdateParser->new(
- $self->{_tokensUpdateEnd}
- );
-
- # Loop through ToCs
- foreach $toc (@{$self->{_tocs}}) {
- # Parse update tokens
- $tokenUpdateBeginParser->parse(
- $toc->{_tokenUpdateBeginOfAnchorNameBegin}
- );
- $tokenUpdateBeginParser->parse($toc->{_tokenUpdateBeginOfAnchorNameEnd});
- $tokenUpdateBeginParser->parse($toc->{_tokenUpdateBeginNumber});
- $tokenUpdateBeginParser->parse($toc->{_tokenUpdateBeginToc});
-
- $tokenUpdateEndParser->parse($toc->{_tokenUpdateEndOfAnchorNameBegin});
- $tokenUpdateEndParser->parse($toc->{_tokenUpdateEndOfAnchorNameEnd});
- $tokenUpdateEndParser->parse($toc->{_tokenUpdateEndNumber});
- $tokenUpdateEndParser->parse($toc->{_tokenUpdateEndToc});
- }
-} # _parseTocUpdateTokens()
-
-
-#--- HTML::TocUpdator::_resetBatchVariables() ---------------------------------
-# function: Reset batch variables
-
-sub _resetBatchVariables {
- # Get arguments
- my ($self) = @_;
- # Call ancestor
- $self->SUPER::_resetBatchVariables();
- # Arrays containing start, end, comment & text tokens which indicate
- # the begin of ToC tokens. The tokens are stored in keys of hashes to
- # avoid storing duplicates as an array would.
- $self->{_tokensUpdateBegin} = [
- [], # ['<start tag>', <attributes>]
- {}, # {'<end tag>' => ''}
- {}, # {'<text>' => ''}
- {} # {'<comment>' => ''}
- ];
- # Arrays containing start, end, comment & text tokens which indicate
- # the end of ToC tokens. The tokens are stored in keys of hashes to
- # avoid storing duplicates as an array would.
- $self->{_tokensUpdateEnd} = [
- [], # ['<start tag>', <attributes>]
- {}, # {'<end tag>' => ''}
- {}, # {'<text>' => ''}
- {} # {'<comment>' => ''}
- ];
-} # _resetBatchVariables()
-
-
-#--- HTML::TocUpdator::_setActiveAnchorName() ---------------------------------
-# function: Set active anchor name.
-# args: - aAnchorName: Name of anchor name to set active.
-
-sub _setActiveAnchorName {
- # Get arguments
- my ($self, $aAnchorName) = @_;
- # Are tokens being deleted?
- if (! $self->{_doDeleteTokens}) {
- # No, tokens aren't being deleted;
- # Call ancestor to set anchor name
- $self->SUPER::_setActiveAnchorName($aAnchorName);
- }
-} # _setActiveAnchorName()
-
-
-#--- HTML::TocUpdator::_update() ----------------------------------------------
-# function: Update ToC in string.
-# args: - $aMode: Mode. Can be either MODE_DO_UPDATE or MODE_DO_INSERT.
-# - $aToc: (reference to array of) ToC object to update
-# - $aString: string to update ToC of
-# - $aOptions: optional updator options
-# note: Used internally.
-
-sub _update {
- # Get arguments
- my ($self, $aMode, $aToc, $aString, $aOptions) = @_;
- # Initialize TocUpdator batch
- $self->_initializeUpdatorBatch($aMode, $aToc, $aOptions);
- # Start updating ToC by starting ToC insertion
- $self->_insert($aString);
- # Deinitialize TocUpdator batch
- $self->_deinitializeUpdatorBatch();
-} # update()
-
-
-#--- HTML::TocUpdator::_updateFile() ------------------------------------------
-# function: Update ToCs in file.
-# args: - $aMode: Mode. Can be either MODE_DO_UPDATE or MODE_DO_INSERT.
-# - $aToc: (reference to array of) ToC object to update
-# - $aFile: (reference to array of) file to parse for updating.
-# - $aOptions: optional updator options
-# note: Used internally.
-
-sub _updateFile {
- # Get arguments
- my ($self, $aMode, $aToc, $aFile, $aOptions) = @_;
- # Initialize TocUpdator batch
- $self->_initializeUpdatorBatch($aMode, $aToc, $aOptions);
- # Start updating ToC by starting ToC insertion
- $self->_insertIntoFile($aFile);
- # Deinitialize TocUpdator batch
- $self->_deinitializeUpdatorBatch();
-} # _updateFile()
-
-
-#--- HTML::TocUpdator::_writeOrBufferOutput() ---------------------------------
-# function: Write processed HTML to output device(s).
-# args: - aOutput: scalar to write
-
-sub _writeOrBufferOutput {
- # Get arguments
- my ($self, $aOutput) = @_;
- # Delete output?
- if (! $self->{_doDeleteTokens}) {
- # No, don't delete output;
- # Call ancestor
- $self->SUPER::_writeOrBufferOutput($aOutput);
- }
-} # _writeOrBufferOutput()
-
-
-#--- HTML::TocUpdator::anchorNameBegin() --------------------------------------
-# function: Process 'anchor name begin' generated by HTML::Toc.
-# args: - $aAnchorName: Anchor name begin tag to output.
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub anchorNameBegin {
- # Get arguments
- my ($self, $aAnchorNameBegin, $aToc) = @_;
- # Call ancestor
- $self->SUPER::anchorNameBegin($aAnchorNameBegin);
- # Must ToC be inserted or updated?
- if ($self->{htu__Mode} != MODE_DO_NOTHING) {
- # Yes, ToC must be inserted or updated;
- # Surround anchor name with update tags
- $self->{_outputPrefix} =
- $aToc->{_tokenUpdateBeginOfAnchorNameBegin} .
- $self->{_outputPrefix} .
- $aToc->{_tokenUpdateEndOfAnchorNameBegin};
- }
-} # anchorNameBegin()
-
-
-#--- HTML::TocUpdator::anchorNameEnd() ----------------------------------------
-# function: Process 'anchor name end' generated by HTML::Toc.
-# args: - $aAnchorNameEnd: Anchor name end tag to output.
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub anchorNameEnd {
- # Get arguments
- my ($self, $aAnchorNameEnd, $aToc) = @_;
- # Call ancestor
- $self->SUPER::anchorNameEnd($aAnchorNameEnd);
- # Must ToC be inserted or updated?
- if ($self->{htu__Mode} != MODE_DO_NOTHING) {
- # Yes, ToC must be inserted or updated;
- # Surround anchor name with update tags
- $self->{_outputSuffix} =
- $aToc->{_tokenUpdateBeginOfAnchorNameEnd} .
- $self->{_outputSuffix} .
- $aToc->{_tokenUpdateEndOfAnchorNameEnd};
- }
-} # anchorNameEnd()
-
-
-#--- HTML::TocUpdator::comment() ----------------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Must ToC be updated?
- if ($self->{htu__Mode} == MODE_DO_UPDATE) {
- # Yes, ToC must be updated;
- # Updator is currently deleting tokens?
- if ($self->{_doDeleteTokens}) {
- # Yes, tokens must be deleted;
- # Call ancestor
- $self->SUPER::comment($aComment);
-
- # Look for update end token
-
- # Does comment matches update end token?
- if (defined(
- $self->{_tokensUpdateEnd}[TUT_TOKENTYPE_COMMENT]{$aComment}
- )) {
- # Yes, comment matches update end token;
- # Indicate to stop deleting tokens
- $self->{_doDeleteTokens} = 0;
- }
- }
- else {
- # No, tokens mustn't be deleted;
-
- # Look for update begin token
-
- # Does comment matches update begin token?
- if (defined(
- $self->{_tokensUpdateBegin}[TUT_TOKENTYPE_COMMENT]{$aComment}
- )) {
- # Yes, comment matches update begin token;
- # Indicate to start deleting tokens
- $self->{_doDeleteTokens} = 1;
- }
- # Call ancestor
- $self->SUPER::comment($aComment);
- }
- }
- else {
- # No, ToC mustn't be updated;
- # Call ancestor
- $self->SUPER::comment($aComment);
- }
-} # comment()
-
-
-#--- HTML::TocUpdator::end() --------------------------------------------------
-# function: This function is called every time a closing tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aOrigText: tag name including brackets.
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Call ancestor
- $self->SUPER::end($aTag, $aOrigText);
- # Must ToC be updated?
- if ($self->{htu__Mode} == MODE_DO_UPDATE) {
- # Yes, ToC must be updated;
- # Updator is currently deleting tokens?
- if ($self->{_doDeleteTokens}) {
- # Yes, tokens must be deleted;
- # Does end tag matches update end token?
- if (defined(
- $self->{_tokensUpdateEnd}[TUT_TOKENTYPE_END]{$aTag}
- )) {
- # Yes, end tag matches update end token;
- # Indicate to stop deleting tokens
- $self->{_doDeleteTokens} = 0;
- }
- }
- }
-} # end()
-
-
-#--- HTML::TocUpdator::insert() -----------------------------------------------
-# function: Insert ToC in string.
-# args: - $aToc: (reference to array of) ToC object to update
-# - $aString: string to insert ToC in.
-# - $aOptions: optional updator options
-
-sub insert {
- # Get arguments
- my ($self, $aToc, $aString, $aOptions) = @_;
- # Do start insert
- $self->_update(MODE_DO_INSERT, $aToc, $aString, $aOptions);
-} # insert()
-
-
-#--- HTML::TocUpdator::insertIntoFile() --------------------------------------
-# function: Insert ToC in file.
-# args: - $aToc: (reference to array of) ToC object to update
-# - $aFile: File to insert ToC in.
-# - $aOptions: optional updator options
-
-sub insertIntoFile {
- # Get arguments
- my ($self, $aToc, $aFile, $aOptions) = @_;
- # Do start insert
- $self->_updateFile(MODE_DO_INSERT, $aToc, $aFile, $aOptions);
-} # insertIntoFile()
-
-
-#--- HTML::TocUpdator::number() -----------------------------------------------
-# function: Process heading number generated by HTML::Toc.
-# args: - $aNumber
-# - $aToc: Reference to ToC to which anchorname belongs.
-
-sub number {
- # Get arguments
- my ($self, $aNumber, $aToc) = @_;
- # Call ancestor
- $self->SUPER::number($aNumber);
- # Must ToC be inserted or updated?
- if ($self->{htu__Mode} != MODE_DO_NOTHING) {
- # Yes, ToC must be inserted or updated;
- # Surround number with update tags
- $self->{_outputSuffix} =
- $aToc->{_tokenUpdateBeginNumber} .
- $self->{_outputSuffix} .
- $aToc->{_tokenUpdateEndNumber};
- }
-} # number()
-
-
-#--- HTML::TocUpdator::start() ------------------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all tag attributes (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- # Must ToC be updated?
- if ($self->{htu__Mode} == MODE_DO_UPDATE) {
- # Yes, ToC must be updated;
- # Does start tag matches token update begin tag?
- if (HTML::TocUpdator::_doesTagExistInArray(
- $aTag, $aAttr, $self->{_tokensUpdateBegin}[TUT_TOKENTYPE_START]
- )) {
- # Yes, start tag matches token update tag;
- # Indicate to delete tokens
- $self->{_doDeleteTokens} = 1;
- }
- }
- # Let ancestor process the start tag
- $self->SUPER::start($aTag, $aAttr, $aAttrSeq, $aOrigText);
-} # start()
-
-
-#--- HTML::TocUpdator::toc() --------------------------------------------------
-# function: Toc processing method. Add toc reference to scenario.
-# args: - $aScenario: Scenario to add ToC reference to.
-# - $aToc: Reference to ToC to insert.
-# note: The ToC hasn't been build yet; only a reference to the ToC to be
-# build is inserted.
-
-sub toc {
- # Get arguments
- my ($self, $aScenario, $aToc) = @_;
-
- # Surround toc with update tokens
-
- # Add update begin token
- push(@$aScenario, \$aToc->{_tokenUpdateBeginToc});
- # Call ancestor
- $self->SUPER::toc($aScenario, $aToc);
- # Add update end token
- push(@$aScenario, \$aToc->{_tokenUpdateEndToc});
-} # toc()
-
-
-#--- HTML::TocUpdator::_processTocText() --------------------------------------
-# function: Toc text processing function.
-# args: - $aText: Text to add to ToC.
-# - $aToc: ToC to add text to.
-
-sub _processTocText {
- # Get arguments
- my ($self, $aText, $aToc) = @_;
- # Delete output?
- if (! $self->{_doDeleteTokens}) {
- # No, don't delete output;
- # Call ancestor
- $self->SUPER::_processTocText($aText, $aToc);
- }
-} # _processTocText()
-
-
-#--- HTML::TocUpdator::update() -----------------------------------------------
-# function: Update ToC in string.
-# args: - $aToc: (reference to array of) ToC object to update
-# - $aString: string to update ToC of
-# - $aOptions: optional updator options
-
-sub update {
- # Get arguments
- my ($self, $aToc, $aString, $aOptions) = @_;
- # Do start update
- $self->_update(MODE_DO_UPDATE, $aToc, $aString, $aOptions);
-} # update()
-
-
-#--- HTML::TocUpdator::updateFile() -------------------------------------------
-# function: Update ToC of file.
-# args: - $aToc: (reference to array of) ToC object to update
-# - $aFile: (reference to array of) file to parse for updating.
-# - $aOptions: optional updator options
-
-sub updateFile {
- # Get arguments
- my ($self, $aToc, $aFile, $aOptions) = @_;
- # Do start update
- $self->_updateFile(MODE_DO_UPDATE, $aToc, $aFile, $aOptions);
-} # update()
-
-
-
-
-#=== HTML::_TokenUpdateParser =================================================
-# function: Parse 'update tokens'. 'Update tokens' mark HTML code which is
-# inserted by 'HTML::TocInsertor'.
-# note: Used internally.
-
-package HTML::_TokenUpdateParser;
-
-
-BEGIN {
- use vars qw(@ISA);
-
- @ISA = qw(HTML::Parser);
-}
-
-END {}
-
-
-#--- HTML::_TokenUpdateParser::new() ------------------------------------------
-# function: Constructor
-
-sub new {
- # Get arguments
- my ($aType, $aTokenArray) = @_;
- # Create instance
- my $self = $aType->SUPER::new;
- # Reference token array
- $self->{tokens} = $aTokenArray;
- # Return instance
- return $self;
-} # new()
-
-
-#--- HTML::_TokenUpdateParser::comment() --------------------------------------
-# function: Process comment.
-# args: - $aComment: comment text with '<!--' and '-->' tags stripped off.
-
-sub comment {
- # Get arguments
- my ($self, $aComment) = @_;
- # Add token to array of update tokens
- $self->{tokens}[HTML::TocUpdator::TUT_TOKENTYPE_COMMENT]{$aComment} = '';
-} # comment()
-
-
-#--- HTML::_TokenUpdateParser::end() ------------------------------------------
-# function: This function is called every time a closing tag is encountered
-# by HTML::Parser.
-# args: - $aTag: tag name (in lower case).
-
-sub end {
- # Get arguments
- my ($self, $aTag, $aOrigText) = @_;
- # Add token to array of update tokens
- $self->{tokens}[HTML::TocUpdator::TUT_TOKENTYPE_END]{$aTag} = '';
-} # end()
-
-
-#--- HTML::_TokenUpdateParser::parse() ----------------------------------------
-# function: Parse token.
-# args: - $aToken: 'update token' to parse
-
-sub parse {
- # Get arguments
- my ($self, $aString) = @_;
- # Call ancestor
- $self->SUPER::parse($aString);
-} # parse()
-
-
-#--- HTML::_TokenUpdateParser::start() ----------------------------------------
-# function: This function is called every time an opening tag is encountered.
-# args: - $aTag: tag name (in lower case).
-# - $aAttr: reference to hash containing all tag attributes (in lower
-# case).
-# - $aAttrSeq: reference to array containing all tag attributes (in
-# lower case) in the original order
-# - $aOrigText: the original HTML text
-
-sub start {
- # Get arguments
- my ($self, $aTag, $aAttr, $aAttrSeq, $aOrigText) = @_;
- # Does token exist in array?
- if (! HTML::TocUpdator::_doesTagExistInArray(
- $aTag, $aAttr, $self->{tokens}[HTML::TocUpdator::TUT_TOKENTYPE_START]
- )) {
- # No, token doesn't exist in array;
- # Add token to array of update tokens
- push(
- @{$self->{tokens}[HTML::TocUpdator::TUT_TOKENTYPE_START]},
- [$aTag, $aAttr]
- );
- }
-} # start()
-
-
-#--- HTML::_TokenUpdateParser::text() -----------------------------------------
-# function: This function is called every time plain text is encountered.
-# args: - @_: array containing data.
-
-sub text {
- # Get arguments
- my ($self, $aText) = @_;
- # Add token to array of update tokens
- $self->{tokens}[HTML::TocUpdator::TUT_TOKENTYPE_TEXT]{$aText} = '';
-} # text()
-
-
-1;
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm
deleted file mode 100644
index 1bd250f..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/ManualTest/manualTest1.htm
+++ /dev/null
@@ -1,92 +0,0 @@
-<html>
-<head>
- <title>Manual</title>
- <style type="text/css">
- ul.toc_appendix1 {
- list-style-type: none;
- margin-left: 0;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<h1 class=prelude>Preface</h1>
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-<!-- Table of Contents -->
-
-<h1 class=prelude>Table of Figures</h1>
-<!-- Table of Figures -->
-
-<h1 class=prelude>Table of Tables</h1>
-<!-- Table of Tables -->
-
-<h1 class=prelude>Introduction</h1>
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<p class=captionTable>Compile Steps</p>
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<h1 class=part>Disks</h1>
-<h1>Compiler Disk v1</h1>
-<img src=img.gif alt="Contents Compiler Disk v1">
-<p class=captionFigure>Contents Compiler Disk v1</p>
-
-<h2>System</h2>
-<h2>Standard Library</h2>
-
-<h1>Compiler Disk v2</h1>
-<img src=img.gif alt="Contents Compiler Disk v2">
-<p class=captionFigure>Contents Compiler Disk v2</p>
-
-<h2>System</h2>
-<h3>parser.com</h3>
-<h3>compiler.com</h3>
-<h3>linker.com</h3>
-<h2>Standard Library</h2>
-
-<h1>Library System Disk</h1>
-<h1 class=part>Personal</h1>
-<h1>Tips & Tricks</h1>
-<h1 class=part>Appendixes</h1>
-<h1 class=appendix>Functions Standard Library v1</h1>
-<h1 class=appendix>Functions Standard Library v2</h1>
-<h1 class=appendix>Functions Graphic Library</h1>
-<h1 class=prelude>Bibliography</h1>
-</body>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm
deleted file mode 100644
index 5288cde..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/SubSubDir1/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>SubSub1</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm
deleted file mode 100644
index c938212..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir1/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Sub1</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm
deleted file mode 100644
index 5288cde..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir1/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>SubSub1</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm
deleted file mode 100644
index eaadf8c..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/SubSubDir2/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>SubSub2</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm
deleted file mode 100644
index 8445eb1..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir2/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Sub2</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm
deleted file mode 100644
index cf9aa99..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/SubDir3/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Sub3</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm b/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm
deleted file mode 100644
index 864b0b5..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/SiteMap/index.htm
+++ /dev/null
@@ -1,5 +0,0 @@
-<html>
-<head>
-<title>Main</title>
-</head>
-</html>
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/extend.t b/libvpx/examples/includes/HTML-Toc-0.91/t/extend.t
deleted file mode 100644
index fe9daee..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/extend.t
+++ /dev/null
@@ -1,87 +0,0 @@
-#--- generate.t ---------------------------------------------------------------
-# function: Test ToC generation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 4; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-
-my ($filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT';
-<h1>Header</h1>
-EOT
- close(FILE);
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. extend ----------------------------------------------------------------
-
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
- # Extend ToC
-$tocGenerator->extend($toc, "<h1>Header</h1>");
- # Test ToC
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 2. extendFromFile --------------------------------------------------------
-
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Extend ToC
-$tocGenerator->extendFromFile($toc, $filename);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 3. extendFromFiles -------------------------------------------------------
-
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Extend ToC
-$tocGenerator->extendFromFile($toc, [$filename, $filename]);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 4. linkTocToToken --------------------------------------------------------
-
-$toc->setOptions({
- 'doLinkToToken' => 1,
-});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
- # Extend ToC
-$tocGenerator->extend($toc, "<h1>Header</h1>");
- # Test ToC
-ok($toc->format() . "\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-<li><a href=#h-2>Header</a>
-</ul>
-EOT
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/format.t b/libvpx/examples/includes/HTML-Toc-0.91/t/format.t
deleted file mode 100644
index 62d2b6c..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/format.t
+++ /dev/null
@@ -1,157 +0,0 @@
-#--- format.t -----------------------------------------------------------------
-# function: Test ToC formatting.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 6; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-
-my ($output, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-my $tocInsertor = HTML::TocInsertor->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'insertionPoint' => 'before <h1>',
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. templateLevelBegin ----------------------------------------------------
-
-$toc->setOptions({
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"'
-});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok($output, "<ul class=toc_h1>\n<li>Header\n</ul><h1>Header</h1>");
-$toc->setOptions({'templateLevelBegin' => undef});
-
-
-#--- 2. levelToToc -----------------------------------------------------------
-
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h2>Header2</h2>");
-$toc->setOptions({'levelToToc' => '1'});
-ok($toc->format(), "<ul>\n<li>Header1\n</ul>");
-$toc->setOptions({'levelToToc' => '.*'});
-
-
-#--- 3. groupToToc -----------------------------------------------------------
-
-$toc->setOptions({
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1 class=-foo>'
- }, {
- 'groupId' => 'foo',
- 'level' => 1,
- 'tokenBegin' => '<h1 class=foo>'
- }]
-});
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h1 class=foo>Foo</h1>");
-$toc->setOptions({'groupToToc' => 'foo'});
-ok($toc->format(), "<ul>\n<li>Foo\n</ul>");
-$toc->setOptions({'groupToToc' => '.*'});
-
-
-#--- 4. header & footer -------------------------------------------------------
-
-$toc->setOptions({
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>'
- }],
- 'header' => '<!-- TocHeader -->',
- 'footer' => '<!-- TocFooter -->',
-});
-$tocInsertor->insert($toc, "<h1>Header1</h1>", {'output' => \$output});
-ok("$output\n", <<EOT);
-<!-- TocHeader --><ul>
-<li>Header1
-</ul><!-- TocFooter --><h1>Header1</h1>
-EOT
-
-
- # Test 'doSingleStepLevel' => 1
-TestSingleStepLevel1();
- # Test 'doSingleStepLevel' => 0
-TestSingleStepLevel0();
-
-
-#--- 5. TestSingleStepLevel1 --------------------------------------------------
-
-sub TestSingleStepLevel1 {
- my $toc = new HTML::Toc;
- my $tocGenerator = new HTML::TocGenerator;
-
- # Generate ToC
- $tocGenerator->generate($toc, <<EOT);
-<h1>Header 1</h1>
-<h3>Header 3</h3>
-EOT
- # Compare output
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Header 1</a>
- <ul>
- <ul>
- <li><a href=#h-1.0.1>Header 3</a>
- </ul>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSingleStepLevel1()
-
-
-#--- 6. TestSingleStepLevel0 --------------------------------------------------
-
-sub TestSingleStepLevel0 {
- my $toc = new HTML::Toc;
- my $tocGenerator = new HTML::TocGenerator;
-
- # Set ToC options
- $toc->setOptions({'doSingleStepLevel' => 0});
- # Generate ToC
- $tocGenerator->generate($toc, <<EOT);
-<h1>Header 1</h1>
-<h3>Header 3</h3>
-EOT
- # Compare output
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Header 1</a>
- <ul>
- <li><a href=#h-1.0.1>Header 3</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSingleStepLevel0()
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/generate.t b/libvpx/examples/includes/HTML-Toc-0.91/t/generate.t
deleted file mode 100644
index 869bdf4..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/generate.t
+++ /dev/null
@@ -1,200 +0,0 @@
-#--- generate.t ---------------------------------------------------------------
-# function: Test ToC generation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 13; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-
-my ($filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT';
-<h1>Header</h1>
-EOT
- close(FILE);
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. generate --------------------------------------------------------------
-
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-ok($toc->format(), "<ul>\n<li>Header\n</ul>");
-
-
-#--- 2. generateFromFile ------------------------------------------------------
-
-$tocGenerator->generateFromFile($toc, $filename);
-ok($toc->format(), "<ul>\n<li>Header\n</ul>");
-
-
-#--- 3. generateFromFiles -----------------------------------------------------
-
-$tocGenerator->generateFromFile($toc, [$filename, $filename]);
-ok($toc->format(), "<ul>\n<li>Header\n<li>Header\n</ul>");
-
-
-#--- 4. doLinkToToken -----------------------------------------------------
-
-$toc->setOptions({'doLinkToToken' => 1});
-$tocGenerator->generateFromFile($toc, $filename, {'globalGroups' => 1});
-ok($toc->format(), "<ul>\n<li><a href=#h-1>Header</a>\n</ul>");
-
-
-#--- 5. doLinkToFile -------------------------------------------------------
-
-$toc->setOptions({'doLinkToFile' => 1});
-$tocGenerator->generateFromFile($toc, $filename);
-ok($toc->format(), "<ul>\n<li><a href=$filename#h-1>Header</a>\n</ul>");
-
-
-#--- 6. templateAnchorHrefBegin -----------------------------------------------
-
- # Set options
-$toc->setOptions({'templateAnchorHrefBegin' => '"test-$file"'});
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>test-".$filename."Header</a>\n</ul>");
- # Reset options
-$toc->setOptions({'templateAnchorHrefBegin' => undef});
-
-
-#--- 7. templateAnchorHrefBegin function --------------------------------------
-
-sub AssembleAnchorHrefBegin {
- # Get arguments
- my ($aFile, $aGroupId, $aLevel, $aNode) = @_;
- # Return value
- return $aFile . $aGroupId . $aLevel . $aNode;
-} # AssembleAnchorHrefBegin()
-
-
- # Set options
-$toc->setOptions({'templateAnchorHrefBegin' => \&AssembleAnchorHrefBegin});
- # Generate ToC
-$tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
-ok($toc->format(), "<ul>\n<li>".$filename."h11Header</a>\n</ul>");
- # Reset options
-$toc->setOptions({'templateAnchorHrefBegin' => undef});
-
-
-#--- 8. levelToToc no levels available ---------------------------------------
-
-$toc->setOptions({'levelToToc' => '2'});
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-ok($toc->format(), "");
-
-
-#--- 9. levelToToc level 1 ---------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'levelToToc' => '1',
- 'doLinkToToken' => 0,
-});
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h2>Header2</h2>");
-ok($toc->format(), "<ul>\n<li>Header1\n</ul>");
-
-
-#--- 10. levelToToc level 2 --------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'levelToToc' => '2',
- 'doLinkToToken' => 0,
-});
-$tocGenerator->generate($toc, "<h1>Header1</h1>\n<h2>Header2</h2>");
-ok($toc->format(), "<ul>\n<li>Header2\n</ul>");
- # Restore options
-$toc->setOptions({
- 'levelToToc' => '.*',
-});
-
-
-#--- 11. tokenToToc empty array ----------------------------------------------
-
- # Set options
-$toc->setOptions({'tokenToToc' => []});
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-ok($toc->format(), "");
-
-
-#--- 12. groups nested --------------------------------------------------------
-
-$toc->setOptions({
- 'doNestGroup' => 1,
- 'tokenToToc' => [
- {
- 'level' => 1,
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'groupId' => 'appendix',
- 'level' => 1,
- 'tokenBegin' => '<h1 class=appendix>'
- }
- ]
-});
-$tocGenerator->generate(
- $toc, "<h1>Header1</h1>\n<h1 class=appendix>Appendix</h1>"
-);
-ok($toc->format() . "\n", <<'EOT');
-<ul>
-<li>Header1
-<ul>
-<li>Appendix
-</ul>
-</ul>
-EOT
-
-
-#--- 13. groups not nested ----------------------------------------------------
-
-$toc->setOptions({
- 'doNestGroup' => 0,
- 'tokenToToc' => [
- {
- 'level' => 1,
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'groupId' => 'appendix',
- 'level' => 1,
- 'tokenBegin' => '<h1 class=appendix>'
- }
- ]
-});
-$tocGenerator->generate(
- $toc, "<h1>Header1</h1>\n<h1 class=appendix>Appendix</h1>"
-);
-ok($toc->format() . "\n", <<'EOT');
-<ul>
-<li>Header1
-</ul>
-<ul>
-<li>Appendix
-</ul>
-EOT
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/insert.t b/libvpx/examples/includes/HTML-Toc-0.91/t/insert.t
deleted file mode 100644
index 3f1adba..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/insert.t
+++ /dev/null
@@ -1,336 +0,0 @@
-#--- insert.t -----------------------------------------------------------------
-# function: Test ToC insertion.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 10; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-
-my ($output, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-my $tocInsertor = HTML::TocInsertor->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'header' => "",
- 'footer' => "",
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. insert before start ---------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'before <h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>");
-
-
-#--- 2. insert after start ----------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'after <h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<h1><ul>\n<li>Header\n</ul>Header</h1>");
-
-
-#--- 3. insert before end -----------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'before </h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<h1>Header<ul>\n<li>Header\n</ul></h1>");
-
-
-#--- 4. insert after end ------------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'after </h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
- # Test ToC
-ok($output, "<h1>Header</h1><ul>\n<li>Header\n</ul>");
-
-
-#--- 5. outputFile ------------------------------------------------------------
-
-$toc->setOptions({'insertionPoint' => 'before <h1>'});
- # Generate ToC
-$tocGenerator->generate($toc, "<h1>Header</h1>");
- # Insert ToC, output to file
-$tocInsertor->insert($toc, "<h1>Header</h1>", {
- 'outputFile' => $filename,
- 'doGenerateToc' => 0
-});
- # Read outputfile
-open(FILE, "<$filename") || die "Can't open $filename: $!";
-$content = join('', <FILE>);
-close(FILE);
- # Test ToC
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>");
-
-
-#--- 6. empty toc -------------------------------------------------------------
-
-$tocGenerator->generate($toc, "");
-$tocInsertor->insert($toc, "", {
- 'output' => \$output,
- 'doGenerateToc' => 0
-});
-ok($output, "");
-
-
-#--- TestAfterDeclaration() ---------------------------------------------------
-# function: Test putting HTML comment after declaration.
-
-sub TestAfterDeclaration {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'insertionPoint' => "after <!ToC>",
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<!ToC><body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<!ToC>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Appendix</a>
- <ul>
- <li><a href=#h-1.1>Appendix Paragraph</a>
- </ul>
- <li><a href=#h-2>Appendix</a>
- <ul>
- <li><a href=#h-2.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-<body>
- <a name=h-1><h1>Appendix</h1></a>
- <a name=h-1.1><h2>Appendix Paragraph</h2></a>
- <a name=h-2><h1>Appendix</h1></a>
- <a name=h-2.1><h2>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestAfterDeclaration()
-
-
-#--- TestNumberingStyle() -----------------------------------------------------
-# function: Test numberingstyle.
-
-sub TestNumberingStyle {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'numberingStyle' => 'lower-alpha',
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1>',
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2,
- 'numberingStyle' => 'upper-alpha'
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3,
- 'numberingStyle' => 'decimal'
- }]
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h3>Paragraph</h3>
- <h3>Paragraph</h3>
- <h3>Paragraph</h3>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-a>Chapter</a>
- <ul>
- <li><a href=#h-a.A>Paragraph</a>
- <ul>
- <li><a href=#h-a.A.1>Paragraph</a>
- <li><a href=#h-a.A.2>Paragraph</a>
- <li><a href=#h-a.A.3>Paragraph</a>
- </ul>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-a><h1>a &nbsp;Chapter</h1></a>
- <a name=h-a.A><h2>a.A &nbsp;Paragraph</h2></a>
- <a name=h-a.A.1><h3>a.A.1 &nbsp;Paragraph</h3></a>
- <a name=h-a.A.2><h3>a.A.2 &nbsp;Paragraph</h3></a>
- <a name=h-a.A.3><h3>a.A.3 &nbsp;Paragraph</h3></a>
-</body>
-EOT
-} # TestNumberingStyle()
-
-
-#--- TestReplaceComment() -----------------------------------------------------
-# function: Test replacing HTML comment with ToC.
-
-sub TestReplaceComment {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'insertionPoint' => "replace <!-- ToC -->"
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<!-- ToC -->
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Appendix</a>
- <ul>
- <li><a href=#h-1.1>Appendix Paragraph</a>
- </ul>
- <li><a href=#h-2>Appendix</a>
- <ul>
- <li><a href=#h-2.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
-<body>
- <a name=h-1><h1>Appendix</h1></a>
- <a name=h-1.1><h2>Appendix Paragraph</h2></a>
- <a name=h-2><h1>Appendix</h1></a>
- <a name=h-2.1><h2>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestReplaceComment()
-
-
-#--- TestReplaceText() -----------------------------------------------------
-# function: Test replacing HTML comment with ToC.
-
-sub TestReplaceText {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'insertionPoint' => "replace ToC will be placed here[,]"
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-The ToC will be placed here, overnight.
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Appendix</a>
- <ul>
- <li><a href=#h-1.1>Appendix Paragraph</a>
- </ul>
- <li><a href=#h-2>Appendix</a>
- <ul>
- <li><a href=#h-2.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-<body>
- <a name=h-1><h1>Appendix</h1></a>
- <a name=h-1.1><h2>Appendix Paragraph</h2></a>
- <a name=h-2><h1>Appendix</h1></a>
- <a name=h-2.1><h2>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestReplaceText()
-
-
- # 7. Test 'numberingStyle'
-TestNumberingStyle();
- # 8. Test replace comment
-TestReplaceComment();
- # 9. Test after declaration
-TestAfterDeclaration();
- # 10. Test replace text
-TestReplaceText();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t b/libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t
deleted file mode 100644
index cc19fff..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/manualTest.t
+++ /dev/null
@@ -1,768 +0,0 @@
-#--- manual.t -----------------------------------------------------------------
-# function: Test HTML::ToC generating a manual.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 3; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-
-#--- AssembleTocLine() --------------------------------------------------------
-# function: Assemble ToC line.
-
-sub AssembleTocLine {
- # Get arguments
- my ($aLevel, $aGroupId, $aNode, $aSequenceNr, $aText) = @_;
- # Local variables
- my ($result);
-
- # Assemble ToC line
- SWITCH: {
- if ($aGroupId eq "prelude") {
- $result = "<li>$aText\n";
- last SWITCH;
- }
- if ($aGroupId eq "part") {
- $result = "<li>Part $aNode &nbsp;$aText\n";
- last SWITCH;
- }
- if ($aGroupId eq "h") {
- $result = "<li>$aSequenceNr. &nbsp;$aText\n";
- last SWITCH;
- }
- else {
- $result = "<li>$aNode &nbsp;$aText\n";
- last SWITCH;
- }
- }
-
- # Return value
- return $result;
-} # AssembleTocLine()
-
-
-#--- AssembleTokenNumber() ----------------------------------------------------
-# function: Assemble token number.
-
-sub AssembleTokenNumber {
- # Get arguments
- my ($aNode, $aGroupId, $aFile, $aGroupLevel, $aLevel, $aToc) = @_;
- # Local variables
- my ($result);
- # Assemble token number
- SWITCH: {
- if ($aGroupId eq "part") {
- $result = "Part $aNode &nbsp;";
- last SWITCH;
- }
- else {
- $result = "$aNode &nbsp;";
- last SWITCH;
- }
- }
- # Return value
- return $result;
-} # AssembleTokenNumber()
-
-
-#--- TestInsertManualToc ------------------------------------------------------
-# function: Test inserting ToC into manual.
-
-sub TestInsertManualToc {
- my $output;
- # Create objects
- my $toc = new HTML::Toc;
- my $tocOfFigures = new HTML::Toc;
- my $tocOfTables = new HTML::Toc;
- my $tocInsertor = new HTML::TocInsertor;
-
- # Set ToC options
- $toc->setOptions({
- 'doNestGroup' => 1,
- 'doNumberToken' => 1,
- 'insertionPoint' => "replace <!-- Table of Contents -->",
- 'templateLevel' => \&AssembleTocLine,
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ul>\n"',
- 'templateTokenNumber' => \&AssembleTokenNumber,
- 'tokenToToc' => [{
- 'groupId' => 'part',
- 'doNumberToken' => 1,
- 'level' => 1,
- 'tokenBegin' => '<h1 class=part>',
- }, {
- 'tokenBegin' => '<h1 class=-[appendix|prelude|hidden|part]>'
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- 'numberingStyle' => 'upper-alpha',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'prelude',
- 'tokenBegin' => '<h1 class=prelude>',
- 'level' => 1,
- 'doNumberToken' => 0,
- }],
- });
- $tocOfFigures->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "replace <!-- Table of Figures -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Figure $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Figure',
- 'tokenBegin' => '<p class=captionFigure>'
- }]
- });
- $tocOfTables->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "replace <!-- Table of Tables -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Table $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Table',
- 'tokenBegin' => '<p class=captionTable>'
- }]
- });
- # Insert ToC
- $tocInsertor->insertIntoFile(
- [$toc, $tocOfFigures, $tocOfTables],
- 't/ManualTest/manualTest1.htm', {
- 'doUseGroupsGlobal' => 1,
- 'output' => \$output,
- 'outputFile' => 't/ManualTest/manualTest2.htm'
- }
- );
- ok($output, <<EOT);
-<html>
-<head>
- <title>Manual</title>
- <style type="text/css">
- ul.toc_appendix1 {
- list-style-type: none;
- margin-left: 0;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<a name=prelude-1><h1 class=prelude>Preface</h1></a>
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul class=toc_prelude1>
- <li><a href=#prelude-1>Preface</a>
- <li><a href=#prelude-2>Table of Figures</a>
- <li><a href=#prelude-3>Table of Tables</a>
- <li><a href=#prelude-4>Introduction</a>
- <ul class=toc_part1>
- <li>Part 1 &nbsp;<a href=#part-1>Disks</a>
- <ul class=toc_h1>
- <li>1. &nbsp;<a href=#h-1>Compiler Disk v1</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-1.1>System</a>
- <li>2. &nbsp;<a href=#h-1.2>Standard Library</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2>Compiler Disk v2</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-2.1>System</a>
- <ul class=toc_h3>
- <li>1. &nbsp;<a href=#h-2.1.1>parser.com</a>
- <li>2. &nbsp;<a href=#h-2.1.2>compiler.com</a>
- <li>3. &nbsp;<a href=#h-2.1.3>linker.com</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2.2>Standard Library</a>
- </ul>
- <li>3. &nbsp;<a href=#h-3>Library System Disk</a>
- </ul>
- <li>Part 2 &nbsp;<a href=#part-2>Personal</a>
- <ul class=toc_h1>
- <li>4. &nbsp;<a href=#h-4>Tips & Tricks</a>
- </ul>
- <li>Part 3 &nbsp;<a href=#part-3>Appendixes</a>
- <ul class=toc_appendix1>
- <li>A &nbsp;<a href=#appendix-A>Functions Standard Library v1</a>
- <li>B &nbsp;<a href=#appendix-B>Functions Standard Library v2</a>
- <li>C &nbsp;<a href=#appendix-C>Functions Graphic Library</a>
- </ul>
- </ul>
- <li><a href=#prelude-5>Bibliography</a>
-</ul>
-<!-- End of generated Table of Contents -->
-
-
-<a name=prelude-2><h1 class=prelude>Table of Figures</h1></a>
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Figure-1>Contents Compiler Disk v1</a>
- <li><a href=#Figure-2>Contents Compiler Disk v2</a>
-</ol>
-<!-- End of generated Table of Contents -->
-
-
-<a name=prelude-3><h1 class=prelude>Table of Tables</h1></a>
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Table-1>Compile Steps</a>
-</ol>
-<!-- End of generated Table of Contents -->
-
-
-<a name=prelude-4><h1 class=prelude>Introduction</h1></a>
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<a name=Table-1><p class=captionTable>Table 1: &nbsp;Compile Steps</p></a>
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<a name=part-1><h1 class=part>Part 1 &nbsp;Disks</h1></a>
-<a name=h-1><h1>1 &nbsp;Compiler Disk v1</h1></a>
-<img src=img.gif alt="Contents Compiler Disk v1">
-<a name=Figure-1><p class=captionFigure>Figure 1: &nbsp;Contents Compiler Disk v1</p></a>
-
-<a name=h-1.1><h2>1.1 &nbsp;System</h2></a>
-<a name=h-1.2><h2>1.2 &nbsp;Standard Library</h2></a>
-
-<a name=h-2><h1>2 &nbsp;Compiler Disk v2</h1></a>
-<img src=img.gif alt="Contents Compiler Disk v2">
-<a name=Figure-2><p class=captionFigure>Figure 2: &nbsp;Contents Compiler Disk v2</p></a>
-
-<a name=h-2.1><h2>2.1 &nbsp;System</h2></a>
-<a name=h-2.1.1><h3>2.1.1 &nbsp;parser.com</h3></a>
-<a name=h-2.1.2><h3>2.1.2 &nbsp;compiler.com</h3></a>
-<a name=h-2.1.3><h3>2.1.3 &nbsp;linker.com</h3></a>
-<a name=h-2.2><h2>2.2 &nbsp;Standard Library</h2></a>
-
-<a name=h-3><h1>3 &nbsp;Library System Disk</h1></a>
-<a name=part-2><h1 class=part>Part 2 &nbsp;Personal</h1></a>
-<a name=h-4><h1>4 &nbsp;Tips & Tricks</h1></a>
-<a name=part-3><h1 class=part>Part 3 &nbsp;Appendixes</h1></a>
-<a name=appendix-A><h1 class=appendix>A &nbsp;Functions Standard Library v1</h1></a>
-<a name=appendix-B><h1 class=appendix>B &nbsp;Functions Standard Library v2</h1></a>
-<a name=appendix-C><h1 class=appendix>C &nbsp;Functions Graphic Library</h1></a>
-<a name=prelude-5><h1 class=prelude>Bibliography</h1></a>
-</body>
-</html>
-EOT
-} # TestInsertManualToc()
-
-
-#--- TestInsertManualForUpdating() --------------------------------------------
-# function: Test inserting ToC into manual.
-
-sub TestInsertManualForUpdating {
- my $output;
- # Create objects
- my $toc = new HTML::Toc;
- my $tocOfFigures = new HTML::Toc;
- my $tocOfTables = new HTML::Toc;
- my $tocUpdator = new HTML::TocUpdator;
-
- # Set ToC options
- $toc->setOptions({
- 'doNestGroup' => 1,
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Contents -->",
- 'templateLevel' => \&AssembleTocLine,
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ul>\n"',
- 'templateTokenNumber' => \&AssembleTokenNumber,
- 'tokenToToc' => [{
- 'groupId' => 'part',
- 'doNumberToken' => 1,
- 'level' => 1,
- 'tokenBegin' => '<h1 class=part>',
- }, {
- 'tokenBegin' => '<h1 class=-[appendix|prelude|hidden|part]>'
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- 'numberingStyle' => 'upper-alpha',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'prelude',
- 'tokenBegin' => '<h1 class=prelude>',
- 'level' => 1,
- 'doNumberToken' => 0,
- }],
- });
- $tocOfFigures->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Figures -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Figure $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Figure',
- 'tokenBegin' => '<p class=captionFigure>'
- }]
- });
- $tocOfTables->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Tables -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Table $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Table',
- 'tokenBegin' => '<p class=captionTable>'
- }]
- });
- # Insert ToC
- $tocUpdator->updateFile(
- [$toc, $tocOfFigures, $tocOfTables],
- 't/ManualTest/manualTest1.htm', {
- 'doUseGroupsGlobal' => 1,
- 'output' => \$output,
- 'outputFile' => 't/ManualTest/manualTest3.htm'
- }
- );
- ok($output, <<EOT);
-<html>
-<head>
- <title>Manual</title>
- <style type="text/css">
- ul.toc_appendix1 {
- list-style-type: none;
- margin-left: 0;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-1><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Preface</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-<!-- Table of Contents --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul class=toc_prelude1>
- <li><a href=#prelude-1>Preface</a>
- <li><a href=#prelude-2>Table of Figures</a>
- <li><a href=#prelude-3>Table of Tables</a>
- <li><a href=#prelude-4>Introduction</a>
- <ul class=toc_part1>
- <li>Part 1 &nbsp;<a href=#part-1>Disks</a>
- <ul class=toc_h1>
- <li>1. &nbsp;<a href=#h-1>Compiler Disk v1</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-1.1>System</a>
- <li>2. &nbsp;<a href=#h-1.2>Standard Library</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2>Compiler Disk v2</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-2.1>System</a>
- <ul class=toc_h3>
- <li>1. &nbsp;<a href=#h-2.1.1>parser.com</a>
- <li>2. &nbsp;<a href=#h-2.1.2>compiler.com</a>
- <li>3. &nbsp;<a href=#h-2.1.3>linker.com</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2.2>Standard Library</a>
- </ul>
- <li>3. &nbsp;<a href=#h-3>Library System Disk</a>
- </ul>
- <li>Part 2 &nbsp;<a href=#part-2>Personal</a>
- <ul class=toc_h1>
- <li>4. &nbsp;<a href=#h-4>Tips & Tricks</a>
- </ul>
- <li>Part 3 &nbsp;<a href=#part-3>Appendixes</a>
- <ul class=toc_appendix1>
- <li>A &nbsp;<a href=#appendix-A>Functions Standard Library v1</a>
- <li>B &nbsp;<a href=#appendix-B>Functions Standard Library v2</a>
- <li>C &nbsp;<a href=#appendix-C>Functions Graphic Library</a>
- </ul>
- </ul>
- <li><a href=#prelude-5>Bibliography</a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-2><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Figures</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Figures --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Figure-1>Contents Compiler Disk v1</a>
- <li><a href=#Figure-2>Contents Compiler Disk v2</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-3><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Tables</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Tables --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Table-1>Compile Steps</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-4><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Introduction</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<!-- #BeginTocAnchorNameBegin --><a name=Table-1><!-- #EndTocAnchorNameBegin --><p class=captionTable><!-- #BeginTocNumber -->Table 1: &nbsp;<!-- #EndTocNumber -->Compile Steps</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<!-- #BeginTocAnchorNameBegin --><a name=part-1><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 1 &nbsp;<!-- #EndTocNumber -->Disks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Compiler Disk v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v1">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-1><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 1: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v1</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->2 &nbsp;<!-- #EndTocNumber -->Compiler Disk v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v2">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-2><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 2: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v2</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.1><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.1 &nbsp;<!-- #EndTocNumber -->parser.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.2><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.2 &nbsp;<!-- #EndTocNumber -->compiler.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.3><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.3 &nbsp;<!-- #EndTocNumber -->linker.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-3><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->3 &nbsp;<!-- #EndTocNumber -->Library System Disk</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-2><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 2 &nbsp;<!-- #EndTocNumber -->Personal</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-4><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->4 &nbsp;<!-- #EndTocNumber -->Tips & Tricks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-3><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 3 &nbsp;<!-- #EndTocNumber -->Appendixes</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-A><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->A &nbsp;<!-- #EndTocNumber -->Functions Standard Library v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-B><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->B &nbsp;<!-- #EndTocNumber -->Functions Standard Library v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-C><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->C &nbsp;<!-- #EndTocNumber -->Functions Graphic Library</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-5><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Bibliography</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestInsertManualForUpdating()
-
-
-#--- TestUpdateManual() -------------------------------------------------------
-# function: Test inserting ToC into manual.
-
-sub TestUpdateManual {
- my $output;
- # Create objects
- my $toc = new HTML::Toc;
- my $tocOfFigures = new HTML::Toc;
- my $tocOfTables = new HTML::Toc;
- my $tocUpdator = new HTML::TocUpdator;
-
- # Set ToC options
- $toc->setOptions({
- 'doNestGroup' => 1,
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Contents -->",
- 'templateLevel' => \&AssembleTocLine,
- 'templateLevelBegin' => '"<ul class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ul>\n"',
- 'templateTokenNumber' => \&AssembleTokenNumber,
- 'tokenToToc' => [{
- 'groupId' => 'part',
- 'doNumberToken' => 1,
- 'level' => 1,
- 'tokenBegin' => '<h1 class=part>',
- }, {
- 'tokenBegin' => '<h1 class=-[appendix|prelude|hidden|part]>'
- }, {
- 'tokenBegin' => '<h2>',
- 'level' => 2
- }, {
- 'tokenBegin' => '<h3>',
- 'level' => 3
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- 'numberingStyle' => 'upper-alpha',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'prelude',
- 'tokenBegin' => '<h1 class=prelude>',
- 'level' => 1,
- 'doNumberToken' => 0,
- }],
- });
- $tocOfFigures->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Figures -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Figure $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Figure',
- 'tokenBegin' => '<p class=captionFigure>'
- }]
- });
- $tocOfTables->setOptions({
- 'doNumberToken' => 1,
- 'insertionPoint' => "after <!-- Table of Tables -->",
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'templateTokenNumber' => '"Table $node: &nbsp;"',
- 'tokenToToc' => [{
- 'groupId' => 'Table',
- 'tokenBegin' => '<p class=captionTable>'
- }]
- });
- # Insert ToC
- $tocUpdator->updateFile(
- [$toc, $tocOfFigures, $tocOfTables],
- 't/ManualTest/manualTest3.htm', {
- 'doUseGroupsGlobal' => 1,
- 'output' => \$output,
- 'outputFile' => 't/ManualTest/manualTest4.htm'
- }
- );
- ok($output, <<EOT);
-<html>
-<head>
- <title>Manual</title>
- <style type="text/css">
- ul.toc_appendix1 {
- list-style-type: none;
- margin-left: 0;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_h2 {
- list-style-type: none;
- }
- ul.toc_h3 {
- list-style-type: none;
- }
- ul.toc_part1 {
- list-style-type: none;
- margin-left: 1;
- margin-top: 1em;
- margin-bottom: 1em;
- }
- ul.toc_prelude1 {
- list-style: none;
- }
- p.captionFigure {
- font-style: italic;
- font-weight: bold;
- }
- p.captionTable {
- font-style: italic;
- font-weight: bold;
- }
- </style>
-</head>
-<body>
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-1><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Preface</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Better C than never.
-
-<h1 class=hidden>Table of Contents</h1>
-<!-- Table of Contents --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul class=toc_prelude1>
- <li><a href=#prelude-1>Preface</a>
- <li><a href=#prelude-2>Table of Figures</a>
- <li><a href=#prelude-3>Table of Tables</a>
- <li><a href=#prelude-4>Introduction</a>
- <ul class=toc_part1>
- <li>Part 1 &nbsp;<a href=#part-1>Disks</a>
- <ul class=toc_h1>
- <li>1. &nbsp;<a href=#h-1>Compiler Disk v1</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-1.1>System</a>
- <li>2. &nbsp;<a href=#h-1.2>Standard Library</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2>Compiler Disk v2</a>
- <ul class=toc_h2>
- <li>1. &nbsp;<a href=#h-2.1>System</a>
- <ul class=toc_h3>
- <li>1. &nbsp;<a href=#h-2.1.1>parser.com</a>
- <li>2. &nbsp;<a href=#h-2.1.2>compiler.com</a>
- <li>3. &nbsp;<a href=#h-2.1.3>linker.com</a>
- </ul>
- <li>2. &nbsp;<a href=#h-2.2>Standard Library</a>
- </ul>
- <li>3. &nbsp;<a href=#h-3>Library System Disk</a>
- </ul>
- <li>Part 2 &nbsp;<a href=#part-2>Personal</a>
- <ul class=toc_h1>
- <li>4. &nbsp;<a href=#h-4>Tips & Tricks</a>
- </ul>
- <li>Part 3 &nbsp;<a href=#part-3>Appendixes</a>
- <ul class=toc_appendix1>
- <li>A &nbsp;<a href=#appendix-A>Functions Standard Library v1</a>
- <li>B &nbsp;<a href=#appendix-B>Functions Standard Library v2</a>
- <li>C &nbsp;<a href=#appendix-C>Functions Graphic Library</a>
- </ul>
- </ul>
- <li><a href=#prelude-5>Bibliography</a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-2><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Figures</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Figures --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Figure-1>Contents Compiler Disk v1</a>
- <li><a href=#Figure-2>Contents Compiler Disk v2</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-3><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Table of Tables</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- Table of Tables --><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#Table-1>Compile Steps</a>
-</ol>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-4><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Introduction</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-Thanks to standardisation and the excellent work of the QWERTY corporation it is possible to learn C with almost any C manual.
-<!-- #BeginTocAnchorNameBegin --><a name=Table-1><!-- #EndTocAnchorNameBegin --><p class=captionTable><!-- #BeginTocNumber -->Table 1: &nbsp;<!-- #EndTocNumber -->Compile Steps</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<ul><pre>
- Parser
- Compiler
- Linker
-</pre></ul>
-
-<!-- #BeginTocAnchorNameBegin --><a name=part-1><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 1 &nbsp;<!-- #EndTocNumber -->Disks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Compiler Disk v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v1">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-1><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 1: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v1</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-1.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->1.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->2 &nbsp;<!-- #EndTocNumber -->Compiler Disk v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<img src=img.gif alt="Contents Compiler Disk v2">
-<!-- #BeginTocAnchorNameBegin --><a name=Figure-2><!-- #EndTocAnchorNameBegin --><p class=captionFigure><!-- #BeginTocNumber -->Figure 2: &nbsp;<!-- #EndTocNumber -->Contents Compiler Disk v2</p><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.1 &nbsp;<!-- #EndTocNumber -->System</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.1><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.1 &nbsp;<!-- #EndTocNumber -->parser.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.2><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.2 &nbsp;<!-- #EndTocNumber -->compiler.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.1.3><!-- #EndTocAnchorNameBegin --><h3><!-- #BeginTocNumber -->2.1.3 &nbsp;<!-- #EndTocNumber -->linker.com</h3><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-2.2><!-- #EndTocAnchorNameBegin --><h2><!-- #BeginTocNumber -->2.2 &nbsp;<!-- #EndTocNumber -->Standard Library</h2><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-
-<!-- #BeginTocAnchorNameBegin --><a name=h-3><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->3 &nbsp;<!-- #EndTocNumber -->Library System Disk</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-2><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 2 &nbsp;<!-- #EndTocNumber -->Personal</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=h-4><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->4 &nbsp;<!-- #EndTocNumber -->Tips & Tricks</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=part-3><!-- #EndTocAnchorNameBegin --><h1 class=part><!-- #BeginTocNumber -->Part 3 &nbsp;<!-- #EndTocNumber -->Appendixes</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-A><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->A &nbsp;<!-- #EndTocNumber -->Functions Standard Library v1</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-B><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->B &nbsp;<!-- #EndTocNumber -->Functions Standard Library v2</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=appendix-C><!-- #EndTocAnchorNameBegin --><h1 class=appendix><!-- #BeginTocNumber -->C &nbsp;<!-- #EndTocNumber -->Functions Graphic Library</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-<!-- #BeginTocAnchorNameBegin --><a name=prelude-5><!-- #EndTocAnchorNameBegin --><h1 class=prelude>Bibliography</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestUpdateManual()
-
-
- # Test inserting ToC into manual
-TestInsertManualToc();
- # Test inserting ToC with update tokens into manual
-TestInsertManualForUpdating();
- # Test updating ToC
-TestUpdateManual();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/options.t b/libvpx/examples/includes/HTML-Toc-0.91/t/options.t
deleted file mode 100644
index 04bedac..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/options.t
+++ /dev/null
@@ -1,194 +0,0 @@
-#--- options.t ----------------------------------------------------------------
-# function: Test HTML::ToC. In particular test the available options.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 5; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-my ($filename);
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- TestAttributeToExcludeToken() --------------------------------------------
-# function: Test 'HTML::Toc' option 'attributeToExcludeToken'
-
-sub TestAttributeToExcludeToken {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter 1</h1>
- <h1 class=appendix>Appendix</h1>
-</body>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({
- 'attributeToExcludeToken' => 'foo',
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=foodix>'
- }]
- });
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter 1</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestAttributeToExcludeToken()
-
-
-#--- TestAttributeToTocToken() ------------------------------------------------
-# function: Test 'HTML::Toc' option 'attributeToTocToken'
-
-sub TestAttributeToTocToken {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <img src=test.gif alt=Picture>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- $toc->setOptions({
- 'attributeToTocToken' => 'foo',
- 'tokenToToc' => [{
- 'groupId' => 'image',
- 'tokenBegin' => '<img alt=foo>'
- }],
- });
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#image-1>Picture</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestAttributeToTocToken()
-
-
-#--- TestNumberingStyleDecimal ------------------------------------------------
-# function: Test 'decimal' numbering style.
-
-sub TestNumberingStyleDecimal {
- # Local variables
- my $output;
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'decimal'
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
- ok("$output\n", <<EOT);
-<a name=h-1><h1>1 &nbsp;Header</h1></a>
-EOT
-} # TestNumberingStyleDecimal()
-
-
-#--- TestNumberingStyleLowerAlpha ---------------------------------------------
-# function: Test 'lower-alpha' numbering style.
-
-sub TestNumberingStyleLowerAlpha {
- # Local variables
- my $output;
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'lower-alpha'
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
- ok("$output\n", <<EOT);
-<a name=h-a><h1>a &nbsp;Header</h1></a>
-EOT
-} # TestNumberingStyleLowerAlpha()
-
-
-#--- TestNumberingStyleUpperAlpha ---------------------------------------------
-# function: Test 'upper-alpha' numbering style.
-
-sub TestNumberingStyleUpperAlpha {
- # Local variables
- my $output;
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
-
- $toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'upper-alpha'
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
- ok("$output\n", <<EOT);
-<a name=h-A><h1>A &nbsp;Header</h1></a>
-EOT
-} # TestNumberingStyleUpperAlpha()
-
-
- # Test 'attributeToTocToken'
-TestAttributeToTocToken();
- # Test 'attributeToExcludeToken'
-TestAttributeToExcludeToken();
- # Test 'numberingStyleDecimal'
-TestNumberingStyleDecimal();
- # Test 'numberingStyleLowerAlpha'
-TestNumberingStyleLowerAlpha();
- # Test 'numberingStyleUpperAlpha'
-TestNumberingStyleUpperAlpha();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t b/libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t
deleted file mode 100644
index 6a546e6..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/podExamples.t
+++ /dev/null
@@ -1,709 +0,0 @@
-#--- podExamples.t ------------------------------------------------------------
-# function: Test HTML::ToC. In particular test the examples as described in
-# the POD documentation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 13; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-my ($filename, $filename2);
-
-
-BEGIN {
- # Create test file
- $filename = "tmp.htm";
- die "$filename is already there" if -e $filename;
- # Create test file 2
- $filename2 = "tmp2.htm";
- die "$filename2 is already there" if -e $filename2;
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
- # Remove test file 2
- unlink($filename2) or warn "Can't unlink $filename2: $!";
-}
-
-
-#--- TestExtendFromFile() --------------------------------------------------
-# function: Test 'HTML::TocGenerator->extendFromFile()
-
-sub TestExtendFromFile {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter of document 1</h1>
-</body>
-EOT
-
- # Assemble test file 2
- open(FILE, ">$filename2") || die "Can't create $filename2: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter of document 2</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set ToC options
- $toc->setOptions({'doLinkToFile' => 1});
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- $tocGenerator->extendFromFile($toc, $filename2);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=tmp.htm#h-1>Chapter of document 1</a>
- <li><a href=tmp2.htm#h-2>Chapter of document 2</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestExtendFromFile()
-
-
-#--- TestGenerateFromFiles() --------------------------------------------------
-# function: Test 'HTML::TocGenerator->generateFromFile()
-
-sub TestGenerateFromFiles {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter of document 1</h1>
-</body>
-EOT
-
- # Assemble test file 2
- open(FILE, ">$filename2") || die "Can't create $filename2: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter of document 2</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set ToC options
- $toc->setOptions({'doLinkToFile' => 1});
- # Generate ToC
- $tocGenerator->generateFromFile($toc, [$filename, $filename2]);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=tmp.htm#h-1>Chapter of document 1</a>
- <li><a href=tmp2.htm#h-2>Chapter of document 2</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestGenerateFromFiles()
-
-
-#--- TestGenerateFromFiles() --------------------------------------------------
-# function: Test 'HTML::TocGenerator->generateFromFile() using multiple files.
-
-sub TestGenerateFromFile {
- # Assemble test file 1
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestGenerateFromFile()
-
-
-#--- TestInsertIntoFile() -----------------------------------------------------
-# function: Test 'HTML::TocInsertor->insertIntoFile()
-
-sub TestInsertIntoFile {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>Chapter</h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Generate ToC
- $tocInsertor->insertIntoFile($toc, $filename, {'output' => \$output});
- # Test ToC
- ok($output, <<EOT);
-<html>
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Chapter</h1></a>
-</body>
-</html>
-EOT
-} # TestInsertIntoFile()
-
-
-#--- TestInsertIntoFileUsingTocUpdator() --------------------------------------
-# function: Test 'HTML::TocUpdator->insertIntoFile()
-
-sub TestInsertIntoFileUsingTocUpdator {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body>
- <h1>
- Chapter
- </h1>
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocUpdator = HTML::TocUpdator->new();
- my $output;
-
- # Generate ToC
- $tocUpdator->insertIntoFile($toc, $filename, {'output' => \$output});
- # Test ToC
- ok($output, <<EOT);
-<html>
-<body><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1> Chapter </a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestInsertIntoFileUsingTocUpdator()
-
-
-#--- TestGlobalGroups0() ------------------------------------------------------
-# function: Test 'HTML::TocGenerator' option 'doUseGroupsGlobal = 0'.
-
-sub TestGlobalGroups0 {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Chapter</h1>
-<h2>Paragraph</h2>
-EOT
-
- # Create objects
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set options
- $toc1->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h1>'}]
- });
- $toc2->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h2>'}]
- });
- # Generate ToC
- $tocGenerator->generateFromFile([$toc1, $toc2], $filename);
- # Test ToC
- ok($toc1->format() . $toc2->format() . "\n", <<'EOT');
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul><ul>
- <li><a href=#h-1>Paragraph</a>
-</ul>
-EOT
-} # TestGlobalGroups0()
-
-
-#--- TestGlobalGroups1() ------------------------------------------------------
-# function: Test 'HTML::TocGenerator' option 'doUseGroupsGlobal = 0'.
-
-sub TestGlobalGroups1 {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT';
-<h1>Chapter</h1>
-<h2>Paragraph</h2>
-EOT
- close(FILE);
-
- # Create objects
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set options
- $toc1->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h1>'}]
- });
- $toc2->setOptions({
- 'header' => '',
- 'footer' => '',
- 'tokenToToc' => [{'tokenBegin' => '<h2>'}]
- });
- # Generate ToC
- $tocGenerator->generateFromFile(
- [$toc1, $toc2], $filename, {'doUseGroupsGlobal' => 1}
- );
- # Test ToC
- ok($toc1->format() . $toc2->format() . "\n", <<'EOT');
-<ul>
- <li><a href=#h-1>Chapter</a>
-</ul><ul>
- <li><a href=#h-2>Paragraph</a>
-</ul>
-EOT
-} # TestGlobalGroups1()
-
-
-#--- TestMultipleGroupsAppendix() ---------------------------------------------
-# function: Test multiple ToCs
-
-sub TestMultipleGroupsAppendix() {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-appendix>'
- }, {
- 'tokenBegin' => '<h2 class=-appendix>',
- 'level' => 2
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1 class=appendix>',
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2 class=appendix>',
- 'level' => 2
- }],
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h3>Subparagraph</h3>
- <h1>Chapter</h1>
- <h1 class=appendix>Appendix Chapter</h1>
- <h2 class=appendix>Appendix Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Chapter</a>
- <ul>
- <li><a href=#h-1.1>Paragraph</a>
- </ul>
- <li><a href=#h-2>Chapter</a>
-</ul>
-<ul>
- <li><a href=#appendix-1>Appendix Chapter</a>
- <ul>
- <li><a href=#appendix-1.1>Appendix Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Chapter</h1></a>
- <a name=h-1.1><h2>Paragraph</h2></a>
- <h3>Subparagraph</h3>
- <a name=h-2><h1>Chapter</h1></a>
- <a name=appendix-1><h1 class=appendix>Appendix Chapter</h1></a>
- <a name=appendix-1.1><h2 class=appendix>Appendix Paragraph</h2></a>
-</body>
-EOT
-} # TestMultipleGroupsAppendix()
-
-
-#--- TestMultipleGroupsPart() -------------------------------------------------
-# function: Test multiple ToCs
-
-sub TestMultipleGroupsPart() {
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc->setOptions({
- 'tokenToToc' => [{
- 'tokenBegin' => '<h1 class=-part>'
- }, {
- 'tokenBegin' => '<h2 class=-part>',
- 'level' => 2,
- }, {
- 'groupId' => 'part',
- 'tokenBegin' => '<h1 class=part>',
- 'level' => 1,
- 'doNumberToken' => 1,
- 'numberingStyle' => 'upper-alpha'
- }]
- });
- # Generate ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<body>
- <h1 class=part>First Part</h1>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
- <h1 class=part>Second Part</h1>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
-</body>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#part-A>First Part</a>
-</ul>
-<ul>
- <li><a href=#h-1>Chapter</a>
- <ul>
- <li><a href=#h-1.1>Paragraph</a>
- </ul>
-</ul>
-<ul>
- <li><a href=#part-B>Second Part</a>
-</ul>
-<ul>
- <li><a href=#h-2>Chapter</a>
- <ul>
- <li><a href=#h-2.1>Paragraph</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=part-A><h1 class=part>A &nbsp;First Part</h1></a>
- <a name=h-1><h1>Chapter</h1></a>
- <a name=h-1.1><h2>Paragraph</h2></a>
- <a name=part-B><h1 class=part>B &nbsp;Second Part</h1></a>
- <a name=h-2><h1>Chapter</h1></a>
- <a name=h-2.1><h2>Paragraph</h2></a>
-</body>
-EOT
-} # TestMultipleGroupsPart()
-
-
-#--- TestMultipleTocs() -------------------------------------------------------
-# function: Test multiple ToCs
-
-sub TestMultipleTocs() {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Header One</h1>
- <img src=test1.gif alt="First picture">
- <h2>Paragraph One</h2>
- <img src=test2.gif alt="Second picture">
-</body>
-EOT
-
- # Create objects
- my $toc1 = HTML::Toc->new();
- my $toc2 = HTML::Toc->new();
- my $tocInsertor = HTML::TocInsertor->new();
- my $output;
-
- # Set ToC options
- $toc2->setOptions({
- 'tokenToToc' => [{
- 'groupId' => 'image',
- 'tokenBegin' => '<img alt=@>'
- }],
- });
- # Generate ToC
- $tocInsertor->insertIntoFile(
- [$toc1, $toc2], $filename, {'output' => \$output}
- );
- # Test ToC
- ok($output, <<EOT);
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1>Header One</a>
- <ul>
- <li><a href=#h-1.1>Paragraph One</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#image-1>First picture</a>
- <li><a href=#image-2>Second picture</a>
-</ul>
-<!-- End of generated Table of Contents -->
-
- <a name=h-1><h1>Header One</h1></a>
- <a name=image-1><img src=test1.gif alt="First picture"></a>
- <a name=h-1.1><h2>Paragraph One</h2></a>
- <a name=image-2><img src=test2.gif alt="Second picture"></a>
-</body>
-EOT
-} # TestMultipleTocs()
-
-
-#--- TestSpecifyNumberedList() ------------------------------------------------
-# function: Test specifying numbered list.
-
-sub TestSpecifyNumberedList {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<body>
- <h1>Chapter</h1>
- <h2>Paragraph</h2>
-</body>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocGenerator = HTML::TocGenerator->new();
-
- # Set ToC options
- $toc->setOptions({
- 'templateLevelBegin' => '"<ol>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- });
- # Generate ToC
- $tocGenerator->generateFromFile($toc, $filename);
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol>
- <li><a href=#h-1>Chapter</a>
- <ol>
- <li><a href=#h-1.1>Paragraph</a>
- </ol>
-</ol>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSpecifyNumberedList()
-
-
-#--- TestUpdateFile() ---------------------------------------------------------
-# function: Test 'HTML::TocUpdator->updateFile()'
-
-sub TestUpdateFile {
- # Assemble test file
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<html>
-<body><!-- #BeginToc -->
-foo
-<!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin -->bar<!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd -->foo<!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-
- # Create objects
- my $toc = HTML::Toc->new();
- my $tocUpdator = HTML::TocUpdator->new();
- my $output;
-
- # Generate ToC
- $tocUpdator->updateFile($toc, $filename, {'output' => \$output});
- # Test ToC
- ok($output, <<EOT);
-<html>
-<body><!-- #BeginToc -->
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=#h-1> Chapter </a>
-</ul>
-<!-- End of generated Table of Contents -->
-<!-- #EndToc -->
- <!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1>
- Chapter
- </h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-</body>
-</html>
-EOT
-} # TestUpdateFile()
-
-
-#--- TestUsingCSS() -----------------------------------------------------------
-# function: Test multiple ToCs
-
-sub TestUsingCSS() {
-
- # Create objects
- my $toc = new HTML::Toc;
- my $tocInsertor = new HTML::TocInsertor;
- my $output;
-
- $toc->setOptions({
- 'templateLevelBegin' => '"<ol class=toc_$groupId$level>\n"',
- 'templateLevelEnd' => '"</ol>\n"',
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'upper-alpha'
- }, {
- 'groupId' => 'appendix',
- 'tokenBegin' => '<h2>',
- 'level' => 2,
- }]
- });
- $tocInsertor->insert($toc, <<EOT);
-<html>
-<head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
-</head>
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-</html>
-EOT
- # Insert ToC
- $tocInsertor->insert($toc, <<EOT, {'output' => \$output});
-<html>
-<head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
-</head>
-<body>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
- <h1>Appendix</h1>
- <h2>Appendix Paragraph</h2>
-</body>
-</html>
-EOT
- # Test ToC
- ok($output, <<EOT);
-<html>
-<head>
- <style type="text/css">
- ol.toc_appendix1 { list-style-type: upper-alpha }
- </style>
-</head>
-<body>
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ol class=toc_appendix1>
- <li><a href=#appendix-A>Appendix</a>
- <ol class=toc_appendix2>
- <li><a href=#appendix-A.1>Appendix Paragraph</a>
- </ol>
- <li><a href=#appendix-B>Appendix</a>
- <ol class=toc_appendix2>
- <li><a href=#appendix-B.1>Appendix Paragraph</a>
- </ol>
-</ol>
-<!-- End of generated Table of Contents -->
-
- <a name=appendix-A><h1>A &nbsp;Appendix</h1></a>
- <a name=appendix-A.1><h2>A.1 &nbsp;Appendix Paragraph</h2></a>
- <a name=appendix-B><h1>B &nbsp;Appendix</h1></a>
- <a name=appendix-B.1><h2>B.1 &nbsp;Appendix Paragraph</h2></a>
-</body>
-</html>
-EOT
-} # TestUsingCSS()
-
-
- # Test 'extendFromFile()'
-TestExtendFromFile();
- # Test 'generateFromFile()'
-TestGenerateFromFile();
- # Test 'generateFromFiles()'
-TestGenerateFromFiles();
- # Test 'doUseGroupsGlobal = 0'
-TestGlobalGroups0();
- # Test 'doUseGroupsGlobal = 1'
-TestGlobalGroups1();
- # Test 'tocInsertor->insertIntoFile'
-TestInsertIntoFile();
- # Test 'tocUpdator->insertIntoFile'
-TestInsertIntoFileUsingTocUpdator();
- # Test additional 'appendix' group
-TestMultipleGroupsAppendix();
- # Test additional 'part' group
-TestMultipleGroupsPart();
- # Test multiple ToCs
-TestMultipleTocs();
- # Test specifying numbered list
-TestSpecifyNumberedList();
- # Test 'updateFile()'
-TestUpdateFile();
- # Test using CSS
-TestUsingCSS();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t b/libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t
deleted file mode 100644
index 63de18d..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/propagate.t
+++ /dev/null
@@ -1,176 +0,0 @@
-#--- propagate.t --------------------------------------------------------------
-# function: Test ToC propagation.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 10; }
-
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-
-my ($output, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocGenerator = HTML::TocGenerator->new;
-my $tocInsertor = HTML::TocInsertor->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 0,
- 'levelIndent' => 0,
- 'insertionPoint' => 'before <h1>',
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. propagate -------------------------------------------------------------
-
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>");
-
-
-#--- 2. propagateFile ---------------------------------------------------------
-
-$tocInsertor->insertIntoFile($toc, $filename, {'output' => \$output});
-ok($output, "<ul>\n<li>Header\n</ul><h1>Header</h1>\n");
-
-
-#--- 3. doLinkToToken -----------------------------------------------------
-
-$toc->setOptions({'doLinkToToken' => 1});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-</ul><a name=h-1><h1>Header</h1></a>
-EOT
-
-
-#--- 4. templateAnchorHrefBegin -----------------------------------------------
-
-$toc->setOptions(
- {'templateAnchorHrefBegin' => '"<$node${file}test${groupId}>"'}
-);
-$tocInsertor->insertIntoFile($toc, $filename, {'output' => \$output});
-ok($output, "<ul>\n<li><1${filename}testh>Header</a>\n</ul><a name=h-1><h1>Header</h1></a>\n");
-$toc->setOptions({'templateAnchorHrefBegin' => undef});
-
-
-#--- 5. templateAnchorNameBegin -----------------------------------------------
-
-$toc->setOptions({
- 'templateAnchorName' => '"$node$groupId"',
- 'templateAnchorNameBegin' => '"<$anchorName>"'
-});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok($output, "<ul>\n<li><a href=#1h>Header</a>\n</ul><1h><h1>Header</h1></a>");
-$toc->setOptions({'templateAnchorName' => undef});
-
-
-#--- 6. templateAnchorName function -------------------------------------------
-
-sub AssembleAnchorName {
- # Get arguments
- my ($aFile, $aGroupId, $aLevel, $aNode) = @_;
- # Return value
- return $aFile . $aGroupId . $aLevel . $aNode;
-} # AssembleAnchorName()
-
- # Set options
-$toc->setOptions({'templateAnchorNameBegin' => \&AssembleAnchorName});
- # Propagate ToC
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
-ok($output, "<ul>\n<li><a href=#h-1>Header</a>\n</ul>h11<h1>Header</h1></a>");
- # Restore options
-$toc->setOptions({'templateAnchorNameBegin' => undef});
-
-
-#--- 7. doNumberToken --------------------------------------------------------
-
- # Set options
-$toc->setOptions({'doNumberToken' => 1});
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-</ul><a name=h-1><h1>1 &nbsp;Header</h1></a>
-EOT
- # Reset options
-$toc->setOptions({
- 'templateTokenNumber' => undef,
- 'doNumberToken' => 0
-});
-
-
-#--- 8. templateTokenNumber ---------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'templateTokenNumber' => '"-$node-"',
- 'doNumberToken' => 1
-});
- # Propagate ToC
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-1>Header</a>
-</ul><a name=h-1><h1>-1-Header</h1></a>
-EOT
- # Reset options
-$toc->setOptions({
- 'doNumberToken' => 0,
- 'templateTokenNumber' => undef
-});
-
-
-#--- 9. numberingStyle --------------------------------------------------------
-
- # Set options
-$toc->setOptions({
- 'doNumberToken' => 1,
- 'tokenToToc' => [{
- 'level' => 1,
- 'tokenBegin' => '<h1>',
- 'numberingStyle' => 'lower-alpha'
- }]
-});
- # Propagate ToC
-$tocInsertor->insert($toc, "<h1>Header</h1>", {'output' => \$output});
- # Test ToC
-ok("$output\n", <<'EOT');
-<ul>
-<li><a href=#h-a>Header</a>
-</ul><a name=h-a><h1>a &nbsp;Header</h1></a>
-EOT
- # Reset options
-$toc->setOptions({
- 'doNumberToken' => 0,
- 'tokenToToc' => undef,
-});
-
-
-#--- 10. declaration pass through ---------------------------------------------
-
-$tocInsertor->insert($toc, '<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><h1>Header</h1>', {'output' => \$output});
- # Test ToC
-ok($output, '<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><h1>Header</h1>');
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t b/libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t
deleted file mode 100644
index 074f0bd..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/siteMap.t
+++ /dev/null
@@ -1,97 +0,0 @@
-#--- manual.t -----------------------------------------------------------------
-# function: Test HTML::ToC generating a manual.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 1; }
-
-use Data::Dumper;
-use File::Find;
-use HTML::Toc;
-use HTML::TocGenerator;
-use HTML::TocInsertor;
-use HTML::TocUpdator;
-
-
- # Create objects
-my $toc = HTML::Toc->new();
-my $tocGenerator = HTML::TocGenerator->new();
-my @fileList;
-
-
-#--- TestSiteMap() ------------------------------------------------------------
-# function: Test specifying numbered list.
-
-sub TestSiteMap {
- # Set ToC options
- $toc->setOptions({
- 'doLinkToFile' => 1,
- 'templateAnchorName' => '""',
- 'templateAnchorHref' => '"<a href=$file"."#".$groupId.$level.">"',
- 'doLinkTocToToken' => 1,
- 'tokenToToc' => [{
- 'groupId' => 'dir',
- 'level' => 1,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+$'
- }, {
- 'groupId' => 'dir',
- 'level' => 2,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+?/[^/]+$'
- }, {
- 'groupId' => 'dir',
- 'level' => 3,
- 'tokenBegin' => '<title>',
- 'tokenEnd' => '</title>',
- 'fileSpec' => '\./[^/]+?/[^/]+?/[^/]+$'
- }]
- });
- # Change current directory
- chdir("t/SiteMap");
- # Find files, filling 'fileList'
- find({wanted => \&WantedSiteMap, no_chdir => 1}, '.');
- # Generate ToC of case-insensitively sorted file list
- $tocGenerator->extendFromFile(
- $toc, [sort {uc($a) cmp uc($b)} @fileList]
- );
- # Restore current directory
- chdir("../..");
- # Test ToC
- ok($toc->format(), <<EOT);
-
-<!-- Table of Contents generated by Perl - HTML::Toc -->
-<ul>
- <li><a href=./index.htm#>Main</a>
- <ul>
- <li><a href=./SubDir1/index.htm#>Sub1</a>
- <ul>
- <li><a href=./SubDir1/SubSubDir1/index.htm#>SubSub1</a>
- </ul>
- <li><a href=./SubDir2/index.htm#>Sub2</a>
- <ul>
- <li><a href=./SubDir2/SubSubDir1/index.htm#>SubSub1</a>
- <li><a href=./SubDir2/SubSubDir2/index.htm#>SubSub2</a>
- </ul>
- <li><a href=./SubDir3/index.htm#>Sub3</a>
- </ul>
-</ul>
-<!-- End of generated Table of Contents -->
-EOT
-} # TestSiteMap()
-
-
-#--- WantedSiteMap() ----------------------------------------------------------
-# function: 'Wanted' function, used by File::Find of 'TestSiteMap()'.
-
-sub WantedSiteMap {
- # Add file to 'fileList' if extension matches '.htm'
- push (@fileList, $File::Find::name) if (m/\.htm$/);
-} # WantedSiteMap()
-
-
- # Test site map
-TestSiteMap();
diff --git a/libvpx/examples/includes/HTML-Toc-0.91/t/update.t b/libvpx/examples/includes/HTML-Toc-0.91/t/update.t
deleted file mode 100644
index e4777b6..0000000
--- a/libvpx/examples/includes/HTML-Toc-0.91/t/update.t
+++ /dev/null
@@ -1,114 +0,0 @@
-#--- update.t -----------------------------------------------------------------
-# function: Test ToC updating.
-
-use strict;
-use Test;
-
-BEGIN { plan tests => 6; }
-
-use HTML::Toc;
-use HTML::TocUpdator;
-
-my ($output, $output2, $content, $filename);
-my $toc = HTML::Toc->new;
-my $tocUpdator = HTML::TocUpdator->new;
-
-$toc->setOptions({
- 'doLinkToToken' => 1,
- 'doNumberToken' => 1,
- 'levelIndent' => 0,
- 'insertionPoint' => 'before <h1>',
- 'header' => '',
- 'footer' => '',
-});
-
-
-BEGIN {
- # Create test file
- $filename = "file$$.htm";
- die "$filename is already there" if -e $filename;
- open(FILE, ">$filename") || die "Can't create $filename: $!";
- print FILE <<'EOT'; close(FILE);
-<h1>Header</h1>
-EOT
-}
-
-
-END {
- # Remove test file
- unlink($filename) or warn "Can't unlink $filename: $!";
-}
-
-
-#--- 1. update ----------------------------------------------------------------
-
-$tocUpdator->update($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-#--- 2. updateFile ------------------------------------------------------------
-
-$tocUpdator->updateFile($toc, $filename, {'output' => \$output});
- open(FILE, ">a.out1") || die "Can't create a.out1: $!";
- print FILE $output; close(FILE);
-$output2 = <<'EOT';
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
- open(FILE, ">a.out2") || die "Can't create a.out2: $!";
- print FILE $output2; close(FILE);
-ok($output, $output2);
-
-
-#--- 3. insert ----------------------------------------------------------------
-
-$tocUpdator->insert($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-#--- 4. insertIntoFile --------------------------------------------------------
-
-$tocUpdator->insertIntoFile($toc, $filename, {'output' => \$output});
-ok($output, <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-
-#--- 5. update twice ----------------------------------------------------------
-
-$tocUpdator->update($toc, "<h1>Header</h1>", {'output' => \$output});
-$tocUpdator->update($toc, $output, {'output' => \$output2});
-ok("$output\n", <<'EOT');
-<!-- #BeginToc --><ul>
-<li><a href=#h-1>Header</a>
-</ul><!-- #EndToc --><!-- #BeginTocAnchorNameBegin --><a name=h-1><!-- #EndTocAnchorNameBegin --><h1><!-- #BeginTocNumber -->1 &nbsp;<!-- #EndTocNumber -->Header</h1><!-- #BeginTocAnchorNameEnd --></a><!-- #EndTocAnchorNameEnd -->
-EOT
-
-
-#--- 6. tokens update begin & end ---------------------------------------------
-
-$toc->setOptions({
- 'tokenUpdateBeginOfAnchorNameBegin' => '<tocAnchorNameBegin>',
- 'tokenUpdateEndOfAnchorNameBegin' => '</tocAnchorNameBegin>',
- 'tokenUpdateBeginOfAnchorNameEnd' => '<tocAnchorNameEnd>',
- 'tokenUpdateEndOfAnchorNameEnd' => '</tocAnchorNameEnd>',
- 'tokenUpdateBeginNumber' => '<tocNumber>',
- 'tokenUpdateEndNumber' => '</tocNumber>',
- 'tokenUpdateBeginToc' => '<toc>',
- 'tokenUpdateEndToc', => '</toc>'
-});
-$tocUpdator->update($toc, "<h1>Header</h1>", {'output' => \$output});
-ok("$output\n", <<'EOT');
-<toc><ul>
-<li><a href=#h-1>Header</a>
-</ul></toc><tocAnchorNameBegin><a name=h-1></tocAnchorNameBegin><h1><tocNumber>1 &nbsp;</tocNumber>Header</h1><tocAnchorNameEnd></a></tocAnchorNameEnd>
-EOT
diff --git a/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/License.text b/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/License.text
deleted file mode 100644
index 52c868b..0000000
--- a/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/License.text
+++ /dev/null
@@ -1,36 +0,0 @@
-PHP Markdown & Extra
-Copyright (c) 2004-2008 Michel Fortin
-<http://www.michelf.com/>
-All rights reserved.
-
-Based on Markdown
-Copyright (c) 2003-2006 John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "Markdown" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
diff --git a/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/PHP Markdown Extra Readme.text b/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/PHP Markdown Extra Readme.text
deleted file mode 100644
index a1c520e..0000000
--- a/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/PHP Markdown Extra Readme.text
+++ /dev/null
@@ -1,731 +0,0 @@
-PHP Markdown Extra
-==================
-
-Version 1.2.3 - Wed 31 Dec 2008
-
-by Michel Fortin
-<http://www.michelf.com/>
-
-based on Markdown by John Gruber
-<http://daringfireball.net/>
-
-
-Introduction
-------------
-
-This is a special version of PHP Markdown with extra features. See
-<http://www.michelf.com/projects/php-markdown/extra/> for details.
-
-Markdown is a text-to-HTML conversion tool for web writers. Markdown
-allows you to write using an easy-to-read, easy-to-write plain text
-format, then convert it to structurally valid XHTML (or HTML).
-
-"Markdown" is two things: a plain text markup syntax, and a software
-tool, written in Perl, that converts the plain text markup to HTML.
-PHP Markdown is a port to PHP of the original Markdown program by
-John Gruber.
-
-PHP Markdown can work as a plug-in for WordPress and bBlog, as a
-modifier for the Smarty templating engine, or as a remplacement for
-textile formatting in any software that support textile.
-
-Full documentation of Markdown's syntax is available on John's
-Markdown page: <http://daringfireball.net/projects/markdown/>
-
-
-Installation and Requirement
-----------------------------
-
-PHP Markdown requires PHP version 4.0.5 or later.
-
-
-### WordPress ###
-
-PHP Markdown works with [WordPress][wp], version 1.2 or later.
-
- [wp]: http://wordpress.org/
-
-1. To use PHP Markdown with WordPress, place the "makrdown.php" file
- in the "plugins" folder. This folder is located inside
- "wp-content" at the root of your site:
-
- (site home)/wp-content/plugins/
-
-2. Activate the plugin with the administrative interface of
- WordPress. In the "Plugins" section you will now find Markdown.
- To activate the plugin, click on the "Activate" button on the
- same line than Markdown. Your entries will now be formatted by
- PHP Markdown.
-
-3. To post Markdown content, you'll first have to disable the
- "visual" editor in the User section of WordPress.
-
-You can configure PHP Markdown to not apply to the comments on your
-WordPress weblog. See the "Configuration" section below.
-
-It is not possible at this time to apply a different set of
-filters to different entries. All your entries will be formated by
-PHP Markdown. This is a limitation of WordPress. If your old entries
-are written in HTML (as opposed to another formatting syntax, like
-Textile), they'll probably stay fine after installing Markdown.
-
-
-### bBlog ###
-
-PHP Markdown also works with [bBlog][bb].
-
- [bb]: http://www.bblog.com/
-
-To use PHP Markdown with bBlog, rename "markdown.php" to
-"modifier.markdown.php" and place the file in the "bBlog_plugins"
-folder. This folder is located inside the "bblog" directory of
-your site, like this:
-
- (site home)/bblog/bBlog_plugins/modifier.markdown.php
-
-Select "Markdown" as the "Entry Modifier" when you post a new
-entry. This setting will only apply to the entry you are editing.
-
-
-### Replacing Textile in TextPattern ###
-
-[TextPattern][tp] use [Textile][tx] to format your text. You can
-replace Textile by Markdown in TextPattern without having to change
-any code by using the *Texitle Compatibility Mode*. This may work
-with other software that expect Textile too.
-
- [tx]: http://www.textism.com/tools/textile/
- [tp]: http://www.textpattern.com/
-
-1. Rename the "markdown.php" file to "classTextile.php". This will
- make PHP Markdown behave as if it was the actual Textile parser.
-
-2. Replace the "classTextile.php" file TextPattern installed in your
- web directory. It can be found in the "lib" directory:
-
- (site home)/textpattern/lib/
-
-Contrary to Textile, Markdown does not convert quotes to curly ones
-and does not convert multiple hyphens (`--` and `---`) into en- and
-em-dashes. If you use PHP Markdown in Textile Compatibility Mode, you
-can solve this problem by installing the "smartypants.php" file from
-[PHP SmartyPants][psp] beside the "classTextile.php" file. The Textile
-Compatibility Mode function will use SmartyPants automatically without
-further modification.
-
- [psp]: http://www.michelf.com/projects/php-smartypants/
-
-
-### In Your Own Programs ###
-
-You can use PHP Markdown easily in your current PHP program. Simply
-include the file and then call the Markdown function on the text you
-want to convert:
-
- include_once "markdown.php";
- $my_html = Markdown($my_text);
-
-If you wish to use PHP Markdown with another text filter function
-built to parse HTML, you should filter the text *after* the Markdown
-function call. This is an example with [PHP SmartyPants][psp]:
-
- $my_html = SmartyPants(Markdown($my_text));
-
-
-### With Smarty ###
-
-If your program use the [Smarty][sm] template engine, PHP Markdown
-can now be used as a modifier for your templates. Rename "markdown.php"
-to "modifier.markdown.php" and put it in your smarty plugins folder.
-
- [sm]: http://smarty.php.net/
-
-If you are using MovableType 3.1 or later, the Smarty plugin folder is
-located at `(MT CGI root)/php/extlib/smarty/plugins`. This will allow
-Markdown to work on dynamic pages.
-
-
-### Updating Markdown in Other Programs ###
-
-Many web applications now ship with PHP Markdown, or have plugins to
-perform the conversion to HTML. You can update PHP Markdown -- or
-replace it with PHP Markdown Extra -- in many of these programs by
-swapping the old "markdown.php" file for the new one.
-
-Here is a short non-exhaustive list of some programs and where they
-hide the "markdown.php" file.
-
-| Program | Path to Markdown
-| ------- | ----------------
-| [Pivot][] | `(site home)/pivot/includes/markdown/`
-
-If you're unsure if you can do this with your application, ask the
-developer, or wait for the developer to update his application or
-plugin with the new version of PHP Markdown.
-
- [Pivot]: http://pivotlog.net/
-
-
-Configuration
--------------
-
-By default, PHP Markdown produces XHTML output for tags with empty
-elements. E.g.:
-
- <br />
-
-Markdown can be configured to produce HTML-style tags; e.g.:
-
- <br>
-
-To do this, you must edit the "MARKDOWN_EMPTY_ELEMENT_SUFFIX"
-definition below the "Global default settings" header at the start of
-the "markdown.php" file.
-
-
-### WordPress-Specific Settings ###
-
-By default, the Markdown plugin applies to both posts and comments on
-your WordPress weblog. To deactivate one or the other, edit the
-`MARKDOWN_WP_POSTS` or `MARKDOWN_WP_COMMENTS` definitions under the
-"WordPress settings" header at the start of the "markdown.php" file.
-
-
-Bugs
-----
-
-To file bug reports please send email to:
-<michel.fortin@michelf.com>
-
-Please include with your report: (1) the example input; (2) the output you
-expected; (3) the output PHP Markdown actually produced.
-
-
-Version History
----------------
-
-Extra 1.2.3 (31 Dec 2008):
-
-* In WordPress pages featuring more than one post, footnote id prefixes are
- now automatically applied with the current post ID to avoid clashes
- between footnotes belonging to different posts.
-
-* Fix for a bug introduced in Extra 1.2 where block-level HTML tags where
- not detected correctly, thus the addition of erroneous `<p>` tags and
- interpretation of their content as Markdown-formatted instead of
- HTML-formatted.
-
-
-Extra 1.2.2 (21 Jun 2008):
-
-* Fixed a problem where abbreviation definitions, footnote
- definitions and link references were stripped inside
- fenced code blocks.
-
-* Fixed a bug where characters such as `"` in abbreviation
- definitions weren't properly encoded to HTML entities.
-
-* Fixed a bug where double quotes `"` were not correctly encoded
- as HTML entities when used inside a footnote reference id.
-
-
-1.0.1m (21 Jun 2008):
-
-* Lists can now have empty items.
-
-* Rewrote the emphasis and strong emphasis parser to fix some issues
- with odly placed and overlong markers.
-
-
-Extra 1.2.1 (27 May 2008):
-
-* Fixed a problem where Markdown headers and horizontal rules were
- transformed into their HTML equivalent inside fenced code blocks.
-
-
-Extra 1.2 (11 May 2008):
-
-* Added fenced code block syntax which don't require indentation
- and can start and end with blank lines. A fenced code block
- starts with a line of consecutive tilde (~) and ends on the
- next line with the same number of consecutive tilde. Here's an
- example:
-
- ~~~~~~~~~~~~
- Hello World!
- ~~~~~~~~~~~~
-
-* Rewrote parts of the HTML block parser to better accomodate
- fenced code blocks.
-
-* Footnotes may now be referenced from within another footnote.
-
-* Added programatically-settable parser property `predef_attr` for
- predefined attribute definitions.
-
-* Fixed an issue where an indented code block preceded by a blank
- line containing some other whitespace would confuse the HTML
- block parser into creating an HTML block when it should have
- been code.
-
-
-1.0.1l (11 May 2008):
-
-* Now removing the UTF-8 BOM at the start of a document, if present.
-
-* Now accepting capitalized URI schemes (such as HTTP:) in automatic
- links, such as `<HTTP://EXAMPLE.COM/>`.
-
-* Fixed a problem where `<hr@example.com>` was seen as a horizontal
- rule instead of an automatic link.
-
-* Fixed an issue where some characters in Markdown-generated HTML
- attributes weren't properly escaped with entities.
-
-* Fix for code blocks as first element of a list item. Previously,
- this didn't create any code block for item 2:
-
- * Item 1 (regular paragraph)
-
- * Item 2 (code block)
-
-* A code block starting on the second line of a document wasn't seen
- as a code block. This has been fixed.
-
-* Added programatically-settable parser properties `predef_urls` and
- `predef_titles` for predefined URLs and titles for reference-style
- links. To use this, your PHP code must call the parser this way:
-
- $parser = new Markdwon_Parser;
- $parser->predef_urls = array('linkref' => 'http://example.com');
- $html = $parser->transform($text);
-
- You can then use the URL as a normal link reference:
-
- [my link][linkref]
- [my link][linkRef]
-
- Reference names in the parser properties *must* be lowercase.
- Reference names in the Markdown source may have any case.
-
-* Added `setup` and `teardown` methods which can be used by subclassers
- as hook points to arrange the state of some parser variables before and
- after parsing.
-
-
-Extra 1.1.7 (26 Sep 2007):
-
-1.0.1k (26 Sep 2007):
-
-* Fixed a problem introduced in 1.0.1i where three or more identical
- uppercase letters, as well as a few other symbols, would trigger
- a horizontal line.
-
-
-Extra 1.1.6 (4 Sep 2007):
-
-1.0.1j (4 Sep 2007):
-
-* Fixed a problem introduced in 1.0.1i where the closing `code` and
- `pre` tags at the end of a code block were appearing in the wrong
- order.
-
-* Overriding configuration settings by defining constants from an
- external before markdown.php is included is now possible without
- producing a PHP warning.
-
-
-Extra 1.1.5 (31 Aug 2007):
-
-1.0.1i (31 Aug 2007):
-
-* Fixed a problem where an escaped backslash before a code span
- would prevent the code span from being created. This should now
- work as expected:
-
- Litteral backslash: \\`code span`
-
-* Overall speed improvements, especially with long documents.
-
-
-Extra 1.1.4 (3 Aug 2007):
-
-1.0.1h (3 Aug 2007):
-
-* Added two properties (`no_markup` and `no_entities`) to the parser
- allowing HTML tags and entities to be disabled.
-
-* Fix for a problem introduced in 1.0.1g where posting comments in
- WordPress would trigger PHP warnings and cause some markup to be
- incorrectly filtered by the kses filter in WordPress.
-
-
-Extra 1.1.3 (3 Jul 2007):
-
-* Fixed a performance problem when parsing some invalid HTML as an HTML
- block which was resulting in too much recusion and a segmentation fault
- for long documents.
-
-* The markdown="" attribute now accepts unquoted values.
-
-* Fixed an issue where underscore-emphasis didn't work when applied on the
- first or the last word of an element having the markdown="1" or
- markdown="span" attribute set unless there was some surrounding whitespace.
- This didn't work:
-
- <p markdown="1">_Hello_ _world_</p>
-
- Now it does produce emphasis as expected.
-
-* Fixed an issue preventing footnotes from working when the parser's
- footnote id prefix variable (fn_id_prefix) is not empty.
-
-* Fixed a performance problem where the regular expression for strong
- emphasis introduced in version 1.1 could sometime be long to process,
- give slightly wrong results, and in some circumstances could remove
- entirely the content for a whole paragraph.
-
-* Fixed an issue were abbreviations tags could be incorrectly added
- inside URLs and title of links.
-
-* Placing footnote markers inside a link, resulting in two nested links, is
- no longer allowed.
-
-
-1.0.1g (3 Jul 2007):
-
-* Fix for PHP 5 compiled without the mbstring module. Previous fix to
- calculate the length of UTF-8 strings in `detab` when `mb_strlen` is
- not available was only working with PHP 4.
-
-* Fixed a problem with WordPress 2.x where full-content posts in RSS feeds
- were not processed correctly by Markdown.
-
-* Now supports URLs containing literal parentheses for inline links
- and images, such as:
-
- [WIMP](http://en.wikipedia.org/wiki/WIMP_(computing))
-
- Such parentheses may be arbitrarily nested, but must be
- balanced. Unbalenced parentheses are allowed however when the URL
- when escaped or when the URL is enclosed in angle brakets `<>`.
-
-* Fixed a performance problem where the regular expression for strong
- emphasis introduced in version 1.0.1d could sometime be long to process,
- give slightly wrong results, and in some circumstances could remove
- entirely the content for a whole paragraph.
-
-* Some change in version 1.0.1d made possible the incorrect nesting of
- anchors within each other. This is now fixed.
-
-* Fixed a rare issue where certain MD5 hashes in the content could
- be changed to their corresponding text. For instance, this:
-
- The MD5 value for "+" is "26b17225b626fb9238849fd60eabdf60".
-
- was incorrectly changed to this in previous versions of PHP Markdown:
-
- <p>The MD5 value for "+" is "+".</p>
-
-* Now convert escaped characters to their numeric character
- references equivalent.
-
- This fix an integration issue with SmartyPants and backslash escapes.
- Since Markdown and SmartyPants have some escapable characters in common,
- it was sometime necessary to escape them twice. Previously, two
- backslashes were sometime required to prevent Markdown from "eating" the
- backslash before SmartyPants sees it:
-
- Here are two hyphens: \\--
-
- Now, only one backslash will do:
-
- Here are two hyphens: \--
-
-
-Extra 1.1.2 (7 Feb 2007)
-
-* Fixed an issue where headers preceded too closely by a paragraph
- (with no blank line separating them) where put inside the paragraph.
-
-* Added the missing TextileRestricted method that was added to regular
- PHP Markdown since 1.0.1d but which I forgot to add to Extra.
-
-
-1.0.1f (7 Feb 2007):
-
-* Fixed an issue with WordPress where manually-entered excerpts, but
- not the auto-generated ones, would contain nested paragraphs.
-
-* Fixed an issue introduced in 1.0.1d where headers and blockquotes
- preceded too closely by a paragraph (not separated by a blank line)
- where incorrectly put inside the paragraph.
-
-* Fixed an issue introduced in 1.0.1d in the tokenizeHTML method where
- two consecutive code spans would be merged into one when together they
- form a valid tag in a multiline paragraph.
-
-* Fixed an long-prevailing issue where blank lines in code blocks would
- be doubled when the code block is in a list item.
-
- This was due to the list processing functions relying on artificially
- doubled blank lines to correctly determine when list items should
- contain block-level content. The list item processing model was thus
- changed to avoid the need for double blank lines.
-
-* Fixed an issue with `<% asp-style %>` instructions used as inline
- content where the opening `<` was encoded as `&lt;`.
-
-* Fixed a parse error occuring when PHP is configured to accept
- ASP-style delimiters as boundaries for PHP scripts.
-
-* Fixed a bug introduced in 1.0.1d where underscores in automatic links
- got swapped with emphasis tags.
-
-
-Extra 1.1.1 (28 Dec 2006)
-
-* Fixed a problem where whitespace at the end of the line of an atx-style
- header would cause tailing `#` to appear as part of the header's content.
- This was caused by a small error in the regex that handles the definition
- for the id attribute in PHP Markdown Extra.
-
-* Fixed a problem where empty abbreviations definitions would eat the
- following line as its definition.
-
-* Fixed an issue with calling the Markdown parser repetitivly with text
- containing footnotes. The footnote hashes were not reinitialized properly.
-
-
-1.0.1e (28 Dec 2006)
-
-* Added support for internationalized domain names for email addresses in
- automatic link. Improved the speed at which email addresses are converted
- to entities. Thanks to Milian Wolff for his optimisations.
-
-* Made deterministic the conversion to entities of email addresses in
- automatic links. This means that a given email address will always be
- encoded the same way.
-
-* PHP Markdown will now use its own function to calculate the length of an
- UTF-8 string in `detab` when `mb_strlen` is not available instead of
- giving a fatal error.
-
-
-Extra 1.1 (1 Dec 2006)
-
-* Added a syntax for footnotes.
-
-* Added an experimental syntax to define abbreviations.
-
-
-1.0.1d (1 Dec 2006)
-
-* Fixed a bug where inline images always had an empty title attribute. The
- title attribute is now present only when explicitly defined.
-
-* Link references definitions can now have an empty title, previously if the
- title was defined but left empty the link definition was ignored. This can
- be useful if you want an empty title attribute in images to hide the
- tooltip in Internet Explorer.
-
-* Made `detab` aware of UTF-8 characters. UTF-8 multi-byte sequences are now
- correctly mapped to one character instead of the number of bytes.
-
-* Fixed a small bug with WordPress where WordPress' default filter `wpautop`
- was not properly deactivated on comment text, resulting in hard line breaks
- where Markdown do not prescribes them.
-
-* Added a `TextileRestrited` method to the textile compatibility mode. There
- is no restriction however, as Markdown does not have a restricted mode at
- this point. This should make PHP Markdown work again in the latest
- versions of TextPattern.
-
-* Converted PHP Markdown to a object-oriented design.
-
-* Changed span and block gamut methods so that they loop over a
- customizable list of methods. This makes subclassing the parser a more
- interesting option for creating syntax extensions.
-
-* Also added a "document" gamut loop which can be used to hook document-level
- methods (like for striping link definitions).
-
-* Changed all methods which were inserting HTML code so that they now return
- a hashed representation of the code. New methods `hashSpan` and `hashBlock`
- are used to hash respectivly span- and block-level generated content. This
- has a couple of significant effects:
-
- 1. It prevents invalid nesting of Markdown-generated elements which
- could occur occuring with constructs like `*something [link*][1]`.
- 2. It prevents problems occuring with deeply nested lists on which
- paragraphs were ill-formed.
- 3. It removes the need to call `hashHTMLBlocks` twice during the the
- block gamut.
-
- Hashes are turned back to HTML prior output.
-
-* Made the block-level HTML parser smarter using a specially-crafted regular
- expression capable of handling nested tags.
-
-* Solved backtick issues in tag attributes by rewriting the HTML tokenizer to
- be aware of code spans. All these lines should work correctly now:
-
- <span attr='`ticks`'>bar</span>
- <span attr='``double ticks``'>bar</span>
- `<test a="` content of attribute `">`
-
-* Changed the parsing of HTML comments to match simply from `<!--` to `-->`
- instead using of the more complicated SGML-style rule with paired `--`.
- This is how most browsers parse comments and how XML defines them too.
-
-* `<address>` has been added to the list of block-level elements and is now
- treated as an HTML block instead of being wrapped within paragraph tags.
-
-* Now only trim trailing newlines from code blocks, instead of trimming
- all trailing whitespace characters.
-
-* Fixed bug where this:
-
- [text](http://m.com "title" )
-
- wasn't working as expected, because the parser wasn't allowing for spaces
- before the closing paren.
-
-* Filthy hack to support markdown='1' in div tags.
-
-* _DoAutoLinks() now supports the 'dict://' URL scheme.
-
-* PHP- and ASP-style processor instructions are now protected as
- raw HTML blocks.
-
- <? ... ?>
- <% ... %>
-
-* Fix for escaped backticks still triggering code spans:
-
- There are two raw backticks here: \` and here: \`, not a code span
-
-
-Extra 1.0 - 5 September 2005
-
-* Added support for setting the id attributes for headers like this:
-
- Header 1 {#header1}
- ========
-
- ## Header 2 ## {#header2}
-
- This only work only for headers for now.
-
-* Tables will now work correctly as the first element of a definition
- list. For example, this input:
-
- Term
-
- : Header | Header
- ------- | -------
- Cell | Cell
-
- used to produce no definition list and a table where the first
- header was named ": Header". This is now fixed.
-
-* Fix for a problem where a paragraph following a table was not
- placed between `<p>` tags.
-
-
-Extra 1.0b4 - 1 August 2005
-
-* Fixed some issues where whitespace around HTML blocks were trigging
- empty paragraph tags.
-
-* Fixed an HTML block parsing issue that would cause a block element
- following a code span or block with unmatched opening bracket to be
- placed inside a paragraph.
-
-* Removed some PHP notices that could appear when parsing definition
- lists and tables with PHP notice reporting flag set.
-
-
-Extra 1.0b3 - 29 July 2005
-
-* Definition lists now require a blank line before each term. Solves
- an ambiguity where the last line of lazy-indented definitions could
- be mistaken by PHP Markdown as a new term in the list.
-
-* Definition lists now support multiple terms per definition.
-
-* Some special tags were replaced in the output by their md5 hash
- key. Things such as this now work as expected:
-
- ## Header <?php echo $number ?> ##
-
-
-Extra 1.0b2 - 26 July 2005
-
-* Definition lists can now take two or more definitions for one term.
- This should have been the case before, but a bug prevented this
- from working right.
-
-* Fixed a problem where single column table with a pipe only at the
- end where not parsed as table. Here is such a table:
-
- | header
- | ------
- | cell
-
-* Fixed problems with empty cells in the first column of a table with
- no leading pipe, like this one:
-
- header | header
- ------ | ------
- | cell
-
-* Code spans containing pipes did not within a table. This is now
- fixed by parsing code spans before splitting rows into cells.
-
-* Added the pipe character to the backlash escape character lists.
-
-Extra 1.0b1 (25 Jun 2005)
-
-* First public release of PHP Markdown Extra.
-
-
-Copyright and License
----------------------
-
-Copyright (c) 2004-2005 Michel Fortin
-<http://www.michelf.com/>
-All rights reserved.
-
-Based on Markdown
-Copyright (c) 2003-2005 John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the
- distribution.
-
-* Neither the name "Markdown" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
diff --git a/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/markdown.php b/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/markdown.php
deleted file mode 100644
index 1b7c042..0000000
--- a/libvpx/examples/includes/PHP-Markdown-Extra-1.2.3/markdown.php
+++ /dev/null
@@ -1,2909 +0,0 @@
-<?php
-#
-# Markdown Extra - A text-to-HTML conversion tool for web writers
-#
-# PHP Markdown & Extra
-# Copyright (c) 2004-2008 Michel Fortin
-# <http://www.michelf.com/projects/php-markdown/>
-#
-# Original Markdown
-# Copyright (c) 2004-2006 John Gruber
-# <http://daringfireball.net/projects/markdown/>
-#
-
-
-define( 'MARKDOWN_VERSION', "1.0.1m" ); # Sat 21 Jun 2008
-define( 'MARKDOWNEXTRA_VERSION', "1.2.3" ); # Wed 31 Dec 2008
-
-
-#
-# Global default settings:
-#
-
-# Change to ">" for HTML output
-@define( 'MARKDOWN_EMPTY_ELEMENT_SUFFIX', " />");
-
-# Define the width of a tab for code blocks.
-@define( 'MARKDOWN_TAB_WIDTH', 4 );
-
-# Optional title attribute for footnote links and backlinks.
-@define( 'MARKDOWN_FN_LINK_TITLE', "" );
-@define( 'MARKDOWN_FN_BACKLINK_TITLE', "" );
-
-# Optional class attribute for footnote links and backlinks.
-@define( 'MARKDOWN_FN_LINK_CLASS', "" );
-@define( 'MARKDOWN_FN_BACKLINK_CLASS', "" );
-
-
-#
-# WordPress settings:
-#
-
-# Change to false to remove Markdown from posts and/or comments.
-@define( 'MARKDOWN_WP_POSTS', true );
-@define( 'MARKDOWN_WP_COMMENTS', true );
-
-
-
-### Standard Function Interface ###
-
-@define( 'MARKDOWN_PARSER_CLASS', 'MarkdownExtra_Parser' );
-
-function Markdown($text) {
-#
-# Initialize the parser and return the result of its transform method.
-#
- # Setup static parser variable.
- static $parser;
- if (!isset($parser)) {
- $parser_class = MARKDOWN_PARSER_CLASS;
- $parser = new $parser_class;
- }
-
- # Transform text using parser.
- return $parser->transform($text);
-}
-
-
-### WordPress Plugin Interface ###
-
-/*
-Plugin Name: Markdown Extra
-Plugin URI: http://www.michelf.com/projects/php-markdown/
-Description: <a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a> allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by <a href="http://daringfireball.net/">John Gruber</a>. <a href="http://www.michelf.com/projects/php-markdown/">More...</a>
-Version: 1.2.2
-Author: Michel Fortin
-Author URI: http://www.michelf.com/
-*/
-
-if (isset($wp_version)) {
- # More details about how it works here:
- # <http://www.michelf.com/weblog/2005/wordpress-text-flow-vs-markdown/>
-
- # Post content and excerpts
- # - Remove WordPress paragraph generator.
- # - Run Markdown on excerpt, then remove all tags.
- # - Add paragraph tag around the excerpt, but remove it for the excerpt rss.
- if (MARKDOWN_WP_POSTS) {
- remove_filter('the_content', 'wpautop');
- remove_filter('the_content_rss', 'wpautop');
- remove_filter('the_excerpt', 'wpautop');
- add_filter('the_content', 'mdwp_MarkdownPost', 6);
- add_filter('the_content_rss', 'mdwp_MarkdownPost', 6);
- add_filter('get_the_excerpt', 'mdwp_MarkdownPost', 6);
- add_filter('get_the_excerpt', 'trim', 7);
- add_filter('the_excerpt', 'mdwp_add_p');
- add_filter('the_excerpt_rss', 'mdwp_strip_p');
-
- remove_filter('content_save_pre', 'balanceTags', 50);
- remove_filter('excerpt_save_pre', 'balanceTags', 50);
- add_filter('the_content', 'balanceTags', 50);
- add_filter('get_the_excerpt', 'balanceTags', 9);
- }
-
- # Add a footnote id prefix to posts when inside a loop.
- function mdwp_MarkdownPost($text) {
- static $parser;
- if (!$parser) {
- $parser_class = MARKDOWN_PARSER_CLASS;
- $parser = new $parser_class;
- }
- if (is_single() || is_page() || is_feed()) {
- $parser->fn_id_prefix = "";
- } else {
- $parser->fn_id_prefix = get_the_ID() . ".";
- }
- return $parser->transform($text);
- }
-
- # Comments
- # - Remove WordPress paragraph generator.
- # - Remove WordPress auto-link generator.
- # - Scramble important tags before passing them to the kses filter.
- # - Run Markdown on excerpt then remove paragraph tags.
- if (MARKDOWN_WP_COMMENTS) {
- remove_filter('comment_text', 'wpautop', 30);
- remove_filter('comment_text', 'make_clickable');
- add_filter('pre_comment_content', 'Markdown', 6);
- add_filter('pre_comment_content', 'mdwp_hide_tags', 8);
- add_filter('pre_comment_content', 'mdwp_show_tags', 12);
- add_filter('get_comment_text', 'Markdown', 6);
- add_filter('get_comment_excerpt', 'Markdown', 6);
- add_filter('get_comment_excerpt', 'mdwp_strip_p', 7);
-
- global $mdwp_hidden_tags, $mdwp_placeholders;
- $mdwp_hidden_tags = explode(' ',
- '<p> </p> <pre> </pre> <ol> </ol> <ul> </ul> <li> </li>');
- $mdwp_placeholders = explode(' ', str_rot13(
- 'pEj07ZbbBZ U1kqgh4w4p pre2zmeN6K QTi31t9pre ol0MP1jzJR '.
- 'ML5IjmbRol ulANi1NsGY J7zRLJqPul liA8ctl16T K9nhooUHli'));
- }
-
- function mdwp_add_p($text) {
- if (!preg_match('{^$|^<(p|ul|ol|dl|pre|blockquote)>}i', $text)) {
- $text = '<p>'.$text.'</p>';
- $text = preg_replace('{\n{2,}}', "</p>\n\n<p>", $text);
- }
- return $text;
- }
-
- function mdwp_strip_p($t) { return preg_replace('{</?p>}i', '', $t); }
-
- function mdwp_hide_tags($text) {
- global $mdwp_hidden_tags, $mdwp_placeholders;
- return str_replace($mdwp_hidden_tags, $mdwp_placeholders, $text);
- }
- function mdwp_show_tags($text) {
- global $mdwp_hidden_tags, $mdwp_placeholders;
- return str_replace($mdwp_placeholders, $mdwp_hidden_tags, $text);
- }
-}
-
-
-### bBlog Plugin Info ###
-
-function identify_modifier_markdown() {
- return array(
- 'name' => 'markdown',
- 'type' => 'modifier',
- 'nicename' => 'PHP Markdown Extra',
- 'description' => 'A text-to-HTML conversion tool for web writers',
- 'authors' => 'Michel Fortin and John Gruber',
- 'licence' => 'GPL',
- 'version' => MARKDOWNEXTRA_VERSION,
- 'help' => '<a href="http://daringfireball.net/projects/markdown/syntax">Markdown syntax</a> allows you to write using an easy-to-read, easy-to-write plain text format. Based on the original Perl version by <a href="http://daringfireball.net/">John Gruber</a>. <a href="http://www.michelf.com/projects/php-markdown/">More...</a>',
- );
-}
-
-
-### Smarty Modifier Interface ###
-
-function smarty_modifier_markdown($text) {
- return Markdown($text);
-}
-
-
-### Textile Compatibility Mode ###
-
-# Rename this file to "classTextile.php" and it can replace Textile everywhere.
-
-if (strcasecmp(substr(__FILE__, -16), "classTextile.php") == 0) {
- # Try to include PHP SmartyPants. Should be in the same directory.
- @include_once 'smartypants.php';
- # Fake Textile class. It calls Markdown instead.
- class Textile {
- function TextileThis($text, $lite='', $encode='') {
- if ($lite == '' && $encode == '') $text = Markdown($text);
- if (function_exists('SmartyPants')) $text = SmartyPants($text);
- return $text;
- }
- # Fake restricted version: restrictions are not supported for now.
- function TextileRestricted($text, $lite='', $noimage='') {
- return $this->TextileThis($text, $lite);
- }
- # Workaround to ensure compatibility with TextPattern 4.0.3.
- function blockLite($text) { return $text; }
- }
-}
-
-
-
-#
-# Markdown Parser Class
-#
-
-class Markdown_Parser {
-
- # Regex to match balanced [brackets].
- # Needed to insert a maximum bracked depth while converting to PHP.
- var $nested_brackets_depth = 6;
- var $nested_brackets_re;
-
- var $nested_url_parenthesis_depth = 4;
- var $nested_url_parenthesis_re;
-
- # Table of hash values for escaped characters:
- var $escape_chars = '\`*_{}[]()>#+-.!';
- var $escape_chars_re;
-
- # Change to ">" for HTML output.
- var $empty_element_suffix = MARKDOWN_EMPTY_ELEMENT_SUFFIX;
- var $tab_width = MARKDOWN_TAB_WIDTH;
-
- # Change to `true` to disallow markup or entities.
- var $no_markup = false;
- var $no_entities = false;
-
- # Predefined urls and titles for reference links and images.
- var $predef_urls = array();
- var $predef_titles = array();
-
-
- function Markdown_Parser() {
- #
- # Constructor function. Initialize appropriate member variables.
- #
- $this->_initDetab();
- $this->prepareItalicsAndBold();
-
- $this->nested_brackets_re =
- str_repeat('(?>[^\[\]]+|\[', $this->nested_brackets_depth).
- str_repeat('\])*', $this->nested_brackets_depth);
-
- $this->nested_url_parenthesis_re =
- str_repeat('(?>[^()\s]+|\(', $this->nested_url_parenthesis_depth).
- str_repeat('(?>\)))*', $this->nested_url_parenthesis_depth);
-
- $this->escape_chars_re = '['.preg_quote($this->escape_chars).']';
-
- # Sort document, block, and span gamut in ascendent priority order.
- asort($this->document_gamut);
- asort($this->block_gamut);
- asort($this->span_gamut);
- }
-
-
- # Internal hashes used during transformation.
- var $urls = array();
- var $titles = array();
- var $html_hashes = array();
-
- # Status flag to avoid invalid nesting.
- var $in_anchor = false;
-
-
- function setup() {
- #
- # Called before the transformation process starts to setup parser
- # states.
- #
- # Clear global hashes.
- $this->urls = $this->predef_urls;
- $this->titles = $this->predef_titles;
- $this->html_hashes = array();
-
- $in_anchor = false;
- }
-
- function teardown() {
- #
- # Called after the transformation process to clear any variable
- # which may be taking up memory unnecessarly.
- #
- $this->urls = array();
- $this->titles = array();
- $this->html_hashes = array();
- }
-
-
- function transform($text) {
- #
- # Main function. Performs some preprocessing on the input text
- # and pass it through the document gamut.
- #
- $this->setup();
-
- # Remove UTF-8 BOM and marker character in input, if present.
- $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text);
-
- # Standardize line endings:
- # DOS to Unix and Mac to Unix
- $text = preg_replace('{\r\n?}', "\n", $text);
-
- # Make sure $text ends with a couple of newlines:
- $text .= "\n\n";
-
- # Convert all tabs to spaces.
- $text = $this->detab($text);
-
- # Turn block-level HTML blocks into hash entries
- $text = $this->hashHTMLBlocks($text);
-
- # Strip any lines consisting only of spaces and tabs.
- # This makes subsequent regexen easier to write, because we can
- # match consecutive blank lines with /\n+/ instead of something
- # contorted like /[ ]*\n+/ .
- $text = preg_replace('/^[ ]+$/m', '', $text);
-
- # Run document gamut methods.
- foreach ($this->document_gamut as $method => $priority) {
- $text = $this->$method($text);
- }
-
- $this->teardown();
-
- return $text . "\n";
- }
-
- var $document_gamut = array(
- # Strip link definitions, store in hashes.
- "stripLinkDefinitions" => 20,
-
- "runBasicBlockGamut" => 30,
- );
-
-
- function stripLinkDefinitions($text) {
- #
- # Strips link definitions from text, stores the URLs and titles in
- # hash references.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Link defs are in the form: ^[id]: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\[(.+)\][ ]?: # id = $1
- [ ]*
- \n? # maybe *one* newline
- [ ]*
- <?(\S+?)>? # url = $2
- [ ]*
- \n? # maybe one newline
- [ ]*
- (?:
- (?<=\s) # lookbehind for whitespace
- ["(]
- (.*?) # title = $3
- [")]
- [ ]*
- )? # title is optional
- (?:\n+|\Z)
- }xm',
- array(&$this, '_stripLinkDefinitions_callback'),
- $text);
- return $text;
- }
- function _stripLinkDefinitions_callback($matches) {
- $link_id = strtolower($matches[1]);
- $this->urls[$link_id] = $matches[2];
- $this->titles[$link_id] =& $matches[3];
- return ''; # String that will replace the block
- }
-
-
- function hashHTMLBlocks($text) {
- if ($this->no_markup) return $text;
-
- $less_than_tab = $this->tab_width - 1;
-
- # Hashify HTML blocks:
- # We only want to do this for block-level HTML tags, such as headers,
- # lists, and tables. That's because we still want to wrap <p>s around
- # "paragraphs" that are wrapped in non-block-level tags, such as anchors,
- # phrase emphasis, and spans. The list of tags we're looking for is
- # hard-coded:
- #
- # * List "a" is made of tags which can be both inline or block-level.
- # These will be treated block-level when the start tag is alone on
- # its line, otherwise they're not matched here and will be taken as
- # inline later.
- # * List "b" is made of tags which are always block-level;
- #
- $block_tags_a_re = 'ins|del';
- $block_tags_b_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|'.
- 'script|noscript|form|fieldset|iframe|math';
-
- # Regular expression for the content of a block tag.
- $nested_tags_level = 4;
- $attr = '
- (?> # optional tag attributes
- \s # starts with whitespace
- (?>
- [^>"/]+ # text outside quotes
- |
- /+(?!>) # slash not followed by ">"
- |
- "[^"]*" # text inside double quotes (tolerate ">")
- |
- \'[^\']*\' # text inside single quotes (tolerate ">")
- )*
- )?
- ';
- $content =
- str_repeat('
- (?>
- [^<]+ # content without tag
- |
- <\2 # nested opening tag
- '.$attr.' # attributes
- (?>
- />
- |
- >', $nested_tags_level). # end of opening tag
- '.*?'. # last level nested tag content
- str_repeat('
- </\2\s*> # closing nested tag
- )
- |
- <(?!/\2\s*> # other tags with a different name
- )
- )*',
- $nested_tags_level);
- $content2 = str_replace('\2', '\3', $content);
-
- # First, look for nested blocks, e.g.:
- # <div>
- # <div>
- # tags for inner block must be indented.
- # </div>
- # </div>
- #
- # The outermost tags must start at the left margin for this to match, and
- # the inner nested divs must be indented.
- # We need to do this before the next, more liberal match, because the next
- # match will start at the first `<div>` and stop at the first `</div>`.
- $text = preg_replace_callback('{(?>
- (?>
- (?<=\n\n) # Starting after a blank line
- | # or
- \A\n? # the beginning of the doc
- )
- ( # save in $1
-
- # Match from `\n<tag>` to `</tag>\n`, handling nested tags
- # in between.
-
- [ ]{0,'.$less_than_tab.'}
- <('.$block_tags_b_re.')# start tag = $2
- '.$attr.'> # attributes followed by > and \n
- '.$content.' # content, support nesting
- </\2> # the matching end tag
- [ ]* # trailing spaces/tabs
- (?=\n+|\Z) # followed by a newline or end of document
-
- | # Special version for tags of group a.
-
- [ ]{0,'.$less_than_tab.'}
- <('.$block_tags_a_re.')# start tag = $3
- '.$attr.'>[ ]*\n # attributes followed by >
- '.$content2.' # content, support nesting
- </\3> # the matching end tag
- [ ]* # trailing spaces/tabs
- (?=\n+|\Z) # followed by a newline or end of document
-
- | # Special case just for <hr />. It was easier to make a special
- # case than to make the other regex more complicated.
-
- [ ]{0,'.$less_than_tab.'}
- <(hr) # start tag = $2
- '.$attr.' # attributes
- /?> # the matching end tag
- [ ]*
- (?=\n{2,}|\Z) # followed by a blank line or end of document
-
- | # Special case for standalone HTML comments:
-
- [ ]{0,'.$less_than_tab.'}
- (?s:
- <!-- .*? -->
- )
- [ ]*
- (?=\n{2,}|\Z) # followed by a blank line or end of document
-
- | # PHP and ASP-style processor instructions (<? and <%)
-
- [ ]{0,'.$less_than_tab.'}
- (?s:
- <([?%]) # $2
- .*?
- \2>
- )
- [ ]*
- (?=\n{2,}|\Z) # followed by a blank line or end of document
-
- )
- )}Sxmi',
- array(&$this, '_hashHTMLBlocks_callback'),
- $text);
-
- return $text;
- }
- function _hashHTMLBlocks_callback($matches) {
- $text = $matches[1];
- $key = $this->hashBlock($text);
- return "\n\n$key\n\n";
- }
-
-
- function hashPart($text, $boundary = 'X') {
- #
- # Called whenever a tag must be hashed when a function insert an atomic
- # element in the text stream. Passing $text to through this function gives
- # a unique text-token which will be reverted back when calling unhash.
- #
- # The $boundary argument specify what character should be used to surround
- # the token. By convension, "B" is used for block elements that needs not
- # to be wrapped into paragraph tags at the end, ":" is used for elements
- # that are word separators and "X" is used in the general case.
- #
- # Swap back any tag hash found in $text so we do not have to `unhash`
- # multiple times at the end.
- $text = $this->unhash($text);
-
- # Then hash the block.
- static $i = 0;
- $key = "$boundary\x1A" . ++$i . $boundary;
- $this->html_hashes[$key] = $text;
- return $key; # String that will replace the tag.
- }
-
-
- function hashBlock($text) {
- #
- # Shortcut function for hashPart with block-level boundaries.
- #
- return $this->hashPart($text, 'B');
- }
-
-
- var $block_gamut = array(
- #
- # These are all the transformations that form block-level
- # tags like paragraphs, headers, and list items.
- #
- "doHeaders" => 10,
- "doHorizontalRules" => 20,
-
- "doLists" => 40,
- "doCodeBlocks" => 50,
- "doBlockQuotes" => 60,
- );
-
- function runBlockGamut($text) {
- #
- # Run block gamut tranformations.
- #
- # We need to escape raw HTML in Markdown source before doing anything
- # else. This need to be done for each block, and not only at the
- # begining in the Markdown function since hashed blocks can be part of
- # list items and could have been indented. Indented blocks would have
- # been seen as a code block in a previous pass of hashHTMLBlocks.
- $text = $this->hashHTMLBlocks($text);
-
- return $this->runBasicBlockGamut($text);
- }
-
- function runBasicBlockGamut($text) {
- #
- # Run block gamut tranformations, without hashing HTML blocks. This is
- # useful when HTML blocks are known to be already hashed, like in the first
- # whole-document pass.
- #
- foreach ($this->block_gamut as $method => $priority) {
- $text = $this->$method($text);
- }
-
- # Finally form paragraph and restore hashed blocks.
- $text = $this->formParagraphs($text);
-
- return $text;
- }
-
-
- function doHorizontalRules($text) {
- # Do Horizontal Rules:
- return preg_replace(
- '{
- ^[ ]{0,3} # Leading space
- ([-*_]) # $1: First marker
- (?> # Repeated marker group
- [ ]{0,2} # Zero, one, or two spaces.
- \1 # Marker character
- ){2,} # Group repeated at least twice
- [ ]* # Tailing spaces
- $ # End of line.
- }mx',
- "\n".$this->hashBlock("<hr$this->empty_element_suffix")."\n",
- $text);
- }
-
-
- var $span_gamut = array(
- #
- # These are all the transformations that occur *within* block-level
- # tags like paragraphs, headers, and list items.
- #
- # Process character escapes, code spans, and inline HTML
- # in one shot.
- "parseSpan" => -30,
-
- # Process anchor and image tags. Images must come first,
- # because ![foo][f] looks like an anchor.
- "doImages" => 10,
- "doAnchors" => 20,
-
- # Make links out of things like `<http://example.com/>`
- # Must come after doAnchors, because you can use < and >
- # delimiters in inline links like [this](<url>).
- "doAutoLinks" => 30,
- "encodeAmpsAndAngles" => 40,
-
- "doItalicsAndBold" => 50,
- "doHardBreaks" => 60,
- );
-
- function runSpanGamut($text) {
- #
- # Run span gamut tranformations.
- #
- foreach ($this->span_gamut as $method => $priority) {
- $text = $this->$method($text);
- }
-
- return $text;
- }
-
-
- function doHardBreaks($text) {
- # Do hard breaks:
- return preg_replace_callback('/ {2,}\n/',
- array(&$this, '_doHardBreaks_callback'), $text);
- }
- function _doHardBreaks_callback($matches) {
- return $this->hashPart("<br$this->empty_element_suffix\n");
- }
-
-
- function doAnchors($text) {
- #
- # Turn Markdown link shortcuts into XHTML <a> tags.
- #
- if ($this->in_anchor) return $text;
- $this->in_anchor = true;
-
- #
- # First, handle reference-style links: [link text] [id]
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- \[
- ('.$this->nested_brackets_re.') # link text = $2
- \]
-
- [ ]? # one optional space
- (?:\n[ ]*)? # one optional newline followed by spaces
-
- \[
- (.*?) # id = $3
- \]
- )
- }xs',
- array(&$this, '_doAnchors_reference_callback'), $text);
-
- #
- # Next, inline-style links: [link text](url "optional title")
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- \[
- ('.$this->nested_brackets_re.') # link text = $2
- \]
- \( # literal paren
- [ ]*
- (?:
- <(\S*)> # href = $3
- |
- ('.$this->nested_url_parenthesis_re.') # href = $4
- )
- [ ]*
- ( # $5
- ([\'"]) # quote char = $6
- (.*?) # Title = $7
- \6 # matching quote
- [ ]* # ignore any spaces/tabs between closing quote and )
- )? # title is optional
- \)
- )
- }xs',
- array(&$this, '_DoAnchors_inline_callback'), $text);
-
- #
- # Last, handle reference-style shortcuts: [link text]
- # These must come last in case you've also got [link test][1]
- # or [link test](/foo)
- #
-// $text = preg_replace_callback('{
-// ( # wrap whole match in $1
-// \[
-// ([^\[\]]+) # link text = $2; can\'t contain [ or ]
-// \]
-// )
-// }xs',
-// array(&$this, '_doAnchors_reference_callback'), $text);
-
- $this->in_anchor = false;
- return $text;
- }
- function _doAnchors_reference_callback($matches) {
- $whole_match = $matches[1];
- $link_text = $matches[2];
- $link_id =& $matches[3];
-
- if ($link_id == "") {
- # for shortcut links like [this][] or [this].
- $link_id = $link_text;
- }
-
- # lower-case and turn embedded newlines into spaces
- $link_id = strtolower($link_id);
- $link_id = preg_replace('{[ ]?\n}', ' ', $link_id);
-
- if (isset($this->urls[$link_id])) {
- $url = $this->urls[$link_id];
- $url = $this->encodeAttribute($url);
-
- $result = "<a href=\"$url\"";
- if ( isset( $this->titles[$link_id] ) ) {
- $title = $this->titles[$link_id];
- $title = $this->encodeAttribute($title);
- $result .= " title=\"$title\"";
- }
-
- $link_text = $this->runSpanGamut($link_text);
- $result .= ">$link_text</a>";
- $result = $this->hashPart($result);
- }
- else {
- $result = $whole_match;
- }
- return $result;
- }
- function _doAnchors_inline_callback($matches) {
- $whole_match = $matches[1];
- $link_text = $this->runSpanGamut($matches[2]);
- $url = $matches[3] == '' ? $matches[4] : $matches[3];
- $title =& $matches[7];
-
- $url = $this->encodeAttribute($url);
-
- $result = "<a href=\"$url\"";
- if (isset($title)) {
- $title = $this->encodeAttribute($title);
- $result .= " title=\"$title\"";
- }
-
- $link_text = $this->runSpanGamut($link_text);
- $result .= ">$link_text</a>";
-
- return $this->hashPart($result);
- }
-
-
- function doImages($text) {
- #
- # Turn Markdown image shortcuts into <img> tags.
- #
- #
- # First, handle reference-style labeled images: ![alt text][id]
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- !\[
- ('.$this->nested_brackets_re.') # alt text = $2
- \]
-
- [ ]? # one optional space
- (?:\n[ ]*)? # one optional newline followed by spaces
-
- \[
- (.*?) # id = $3
- \]
-
- )
- }xs',
- array(&$this, '_doImages_reference_callback'), $text);
-
- #
- # Next, handle inline images: ![alt text](url "optional title")
- # Don't forget: encode * and _
- #
- $text = preg_replace_callback('{
- ( # wrap whole match in $1
- !\[
- ('.$this->nested_brackets_re.') # alt text = $2
- \]
- \s? # One optional whitespace character
- \( # literal paren
- [ ]*
- (?:
- <(\S*)> # src url = $3
- |
- ('.$this->nested_url_parenthesis_re.') # src url = $4
- )
- [ ]*
- ( # $5
- ([\'"]) # quote char = $6
- (.*?) # title = $7
- \6 # matching quote
- [ ]*
- )? # title is optional
- \)
- )
- }xs',
- array(&$this, '_doImages_inline_callback'), $text);
-
- return $text;
- }
- function _doImages_reference_callback($matches) {
- $whole_match = $matches[1];
- $alt_text = $matches[2];
- $link_id = strtolower($matches[3]);
-
- if ($link_id == "") {
- $link_id = strtolower($alt_text); # for shortcut links like ![this][].
- }
-
- $alt_text = $this->encodeAttribute($alt_text);
- if (isset($this->urls[$link_id])) {
- $url = $this->encodeAttribute($this->urls[$link_id]);
- $result = "<img src=\"$url\" alt=\"$alt_text\"";
- if (isset($this->titles[$link_id])) {
- $title = $this->titles[$link_id];
- $title = $this->encodeAttribute($title);
- $result .= " title=\"$title\"";
- }
- $result .= $this->empty_element_suffix;
- $result = $this->hashPart($result);
- }
- else {
- # If there's no such link ID, leave intact:
- $result = $whole_match;
- }
-
- return $result;
- }
- function _doImages_inline_callback($matches) {
- $whole_match = $matches[1];
- $alt_text = $matches[2];
- $url = $matches[3] == '' ? $matches[4] : $matches[3];
- $title =& $matches[7];
-
- $alt_text = $this->encodeAttribute($alt_text);
- $url = $this->encodeAttribute($url);
- $result = "<img src=\"$url\" alt=\"$alt_text\"";
- if (isset($title)) {
- $title = $this->encodeAttribute($title);
- $result .= " title=\"$title\""; # $title already quoted
- }
- $result .= $this->empty_element_suffix;
-
- return $this->hashPart($result);
- }
-
-
- function doHeaders($text) {
- # Setext-style headers:
- # Header 1
- # ========
- #
- # Header 2
- # --------
- #
- $text = preg_replace_callback('{ ^(.+?)[ ]*\n(=+|-+)[ ]*\n+ }mx',
- array(&$this, '_doHeaders_callback_setext'), $text);
-
- # atx-style headers:
- # # Header 1
- # ## Header 2
- # ## Header 2 with closing hashes ##
- # ...
- # ###### Header 6
- #
- $text = preg_replace_callback('{
- ^(\#{1,6}) # $1 = string of #\'s
- [ ]*
- (.+?) # $2 = Header text
- [ ]*
- \#* # optional closing #\'s (not counted)
- \n+
- }xm',
- array(&$this, '_doHeaders_callback_atx'), $text);
-
- return $text;
- }
- function _doHeaders_callback_setext($matches) {
- # Terrible hack to check we haven't found an empty list item.
- if ($matches[2] == '-' && preg_match('{^-(?: |$)}', $matches[1]))
- return $matches[0];
-
- $level = $matches[2]{0} == '=' ? 1 : 2;
- $block = "<h$level>".$this->runSpanGamut($matches[1])."</h$level>";
- return "\n" . $this->hashBlock($block) . "\n\n";
- }
- function _doHeaders_callback_atx($matches) {
- $level = strlen($matches[1]);
- $block = "<h$level>".$this->runSpanGamut($matches[2])."</h$level>";
- return "\n" . $this->hashBlock($block) . "\n\n";
- }
-
-
- function doLists($text) {
- #
- # Form HTML ordered (numbered) and unordered (bulleted) lists.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Re-usable patterns to match list item bullets and number markers:
- $marker_ul_re = '[*+-]';
- $marker_ol_re = '\d+[.]';
- $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)";
-
- $markers_relist = array($marker_ul_re, $marker_ol_re);
-
- foreach ($markers_relist as $marker_re) {
- # Re-usable pattern to match any entirel ul or ol list:
- $whole_list_re = '
- ( # $1 = whole list
- ( # $2
- [ ]{0,'.$less_than_tab.'}
- ('.$marker_re.') # $3 = first list item marker
- [ ]+
- )
- (?s:.+?)
- ( # $4
- \z
- |
- \n{2,}
- (?=\S)
- (?! # Negative lookahead for another list item marker
- [ ]*
- '.$marker_re.'[ ]+
- )
- )
- )
- '; // mx
-
- # We use a different prefix before nested lists than top-level lists.
- # See extended comment in _ProcessListItems().
-
- if ($this->list_level) {
- $text = preg_replace_callback('{
- ^
- '.$whole_list_re.'
- }mx',
- array(&$this, '_doLists_callback'), $text);
- }
- else {
- $text = preg_replace_callback('{
- (?:(?<=\n)\n|\A\n?) # Must eat the newline
- '.$whole_list_re.'
- }mx',
- array(&$this, '_doLists_callback'), $text);
- }
- }
-
- return $text;
- }
- function _doLists_callback($matches) {
- # Re-usable patterns to match list item bullets and number markers:
- $marker_ul_re = '[*+-]';
- $marker_ol_re = '\d+[.]';
- $marker_any_re = "(?:$marker_ul_re|$marker_ol_re)";
-
- $list = $matches[1];
- $list_type = preg_match("/$marker_ul_re/", $matches[3]) ? "ul" : "ol";
-
- $marker_any_re = ( $list_type == "ul" ? $marker_ul_re : $marker_ol_re );
-
- $list .= "\n";
- $result = $this->processListItems($list, $marker_any_re);
-
- $result = $this->hashBlock("<$list_type>\n" . $result . "</$list_type>");
- return "\n". $result ."\n\n";
- }
-
- var $list_level = 0;
-
- function processListItems($list_str, $marker_any_re) {
- #
- # Process the contents of a single ordered or unordered list, splitting it
- # into individual list items.
- #
- # The $this->list_level global keeps track of when we're inside a list.
- # Each time we enter a list, we increment it; when we leave a list,
- # we decrement. If it's zero, we're not in a list anymore.
- #
- # We do this because when we're not inside a list, we want to treat
- # something like this:
- #
- # I recommend upgrading to version
- # 8. Oops, now this line is treated
- # as a sub-list.
- #
- # As a single paragraph, despite the fact that the second line starts
- # with a digit-period-space sequence.
- #
- # Whereas when we're inside a list (or sub-list), that line will be
- # treated as the start of a sub-list. What a kludge, huh? This is
- # an aspect of Markdown's syntax that's hard to parse perfectly
- # without resorting to mind-reading. Perhaps the solution is to
- # change the syntax rules such that sub-lists must start with a
- # starting cardinal number; e.g. "1." or "a.".
-
- $this->list_level++;
-
- # trim trailing blank lines:
- $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str);
-
- $list_str = preg_replace_callback('{
- (\n)? # leading line = $1
- (^[ ]*) # leading whitespace = $2
- ('.$marker_any_re.' # list marker and space = $3
- (?:[ ]+|(?=\n)) # space only required if item is not empty
- )
- ((?s:.*?)) # list item text = $4
- (?:(\n+(?=\n))|\n) # tailing blank line = $5
- (?= \n* (\z | \2 ('.$marker_any_re.') (?:[ ]+|(?=\n))))
- }xm',
- array(&$this, '_processListItems_callback'), $list_str);
-
- $this->list_level--;
- return $list_str;
- }
- function _processListItems_callback($matches) {
- $item = $matches[4];
- $leading_line =& $matches[1];
- $leading_space =& $matches[2];
- $marker_space = $matches[3];
- $tailing_blank_line =& $matches[5];
-
- if ($leading_line || $tailing_blank_line ||
- preg_match('/\n{2,}/', $item))
- {
- # Replace marker with the appropriate whitespace indentation
- $item = $leading_space . str_repeat(' ', strlen($marker_space)) . $item;
- $item = $this->runBlockGamut($this->outdent($item)."\n");
- }
- else {
- # Recursion for sub-lists:
- $item = $this->doLists($this->outdent($item));
- $item = preg_replace('/\n+$/', '', $item);
- $item = $this->runSpanGamut($item);
- }
-
- return "<li>" . $item . "</li>\n";
- }
-
-
- function doCodeBlocks($text) {
- #
- # Process Markdown `<pre><code>` blocks.
- #
- $text = preg_replace_callback('{
- (?:\n\n|\A\n?)
- ( # $1 = the code block -- one or more lines, starting with a space/tab
- (?>
- [ ]{'.$this->tab_width.'} # Lines must start with a tab or a tab-width of spaces
- .*\n+
- )+
- )
- ((?=^[ ]{0,'.$this->tab_width.'}\S)|\Z) # Lookahead for non-space at line-start, or end of doc
- }xm',
- array(&$this, '_doCodeBlocks_callback'), $text);
-
- return $text;
- }
- function _doCodeBlocks_callback($matches) {
- $codeblock = $matches[1];
-
- $codeblock = $this->outdent($codeblock);
- $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
-
- # trim leading newlines and trailing newlines
- $codeblock = preg_replace('/\A\n+|\n+\z/', '', $codeblock);
-
- $codeblock = "<pre><code>$codeblock\n</code></pre>";
- return "\n\n".$this->hashBlock($codeblock)."\n\n";
- }
-
-
- function makeCodeSpan($code) {
- #
- # Create a code span markup for $code. Called from handleSpanToken.
- #
- $code = htmlspecialchars(trim($code), ENT_NOQUOTES);
- return $this->hashPart("<code>$code</code>");
- }
-
-
- var $em_relist = array(
- '' => '(?:(?<!\*)\*(?!\*)|(?<!_)_(?!_))(?=\S)(?![.,:;]\s)',
- '*' => '(?<=\S)(?<!\*)\*(?!\*)',
- '_' => '(?<=\S)(?<!_)_(?!_)',
- );
- var $strong_relist = array(
- '' => '(?:(?<!\*)\*\*(?!\*)|(?<!_)__(?!_))(?=\S)(?![.,:;]\s)',
- '**' => '(?<=\S)(?<!\*)\*\*(?!\*)',
- '__' => '(?<=\S)(?<!_)__(?!_)',
- );
- var $em_strong_relist = array(
- '' => '(?:(?<!\*)\*\*\*(?!\*)|(?<!_)___(?!_))(?=\S)(?![.,:;]\s)',
- '***' => '(?<=\S)(?<!\*)\*\*\*(?!\*)',
- '___' => '(?<=\S)(?<!_)___(?!_)',
- );
- var $em_strong_prepared_relist;
-
- function prepareItalicsAndBold() {
- #
- # Prepare regular expressions for seraching emphasis tokens in any
- # context.
- #
- foreach ($this->em_relist as $em => $em_re) {
- foreach ($this->strong_relist as $strong => $strong_re) {
- # Construct list of allowed token expressions.
- $token_relist = array();
- if (isset($this->em_strong_relist["$em$strong"])) {
- $token_relist[] = $this->em_strong_relist["$em$strong"];
- }
- $token_relist[] = $em_re;
- $token_relist[] = $strong_re;
-
- # Construct master expression from list.
- $token_re = '{('. implode('|', $token_relist) .')}';
- $this->em_strong_prepared_relist["$em$strong"] = $token_re;
- }
- }
- }
-
- function doItalicsAndBold($text) {
- $token_stack = array('');
- $text_stack = array('');
- $em = '';
- $strong = '';
- $tree_char_em = false;
-
- while (1) {
- #
- # Get prepared regular expression for seraching emphasis tokens
- # in current context.
- #
- $token_re = $this->em_strong_prepared_relist["$em$strong"];
-
- #
- # Each loop iteration seach for the next emphasis token.
- # Each token is then passed to handleSpanToken.
- #
- $parts = preg_split($token_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
- $text_stack[0] .= $parts[0];
- $token =& $parts[1];
- $text =& $parts[2];
-
- if (empty($token)) {
- # Reached end of text span: empty stack without emitting.
- # any more emphasis.
- while ($token_stack[0]) {
- $text_stack[1] .= array_shift($token_stack);
- $text_stack[0] .= array_shift($text_stack);
- }
- break;
- }
-
- $token_len = strlen($token);
- if ($tree_char_em) {
- # Reached closing marker while inside a three-char emphasis.
- if ($token_len == 3) {
- # Three-char closing marker, close em and strong.
- array_shift($token_stack);
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "<strong><em>$span</em></strong>";
- $text_stack[0] .= $this->hashPart($span);
- $em = '';
- $strong = '';
- } else {
- # Other closing marker: close one em or strong and
- # change current token state to match the other
- $token_stack[0] = str_repeat($token{0}, 3-$token_len);
- $tag = $token_len == 2 ? "strong" : "em";
- $span = $text_stack[0];
- $span = $this->runSpanGamut($span);
- $span = "<$tag>$span</$tag>";
- $text_stack[0] = $this->hashPart($span);
- $$tag = ''; # $$tag stands for $em or $strong
- }
- $tree_char_em = false;
- } else if ($token_len == 3) {
- if ($em) {
- # Reached closing marker for both em and strong.
- # Closing strong marker:
- for ($i = 0; $i < 2; ++$i) {
- $shifted_token = array_shift($token_stack);
- $tag = strlen($shifted_token) == 2 ? "strong" : "em";
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "<$tag>$span</$tag>";
- $text_stack[0] .= $this->hashPart($span);
- $$tag = ''; # $$tag stands for $em or $strong
- }
- } else {
- # Reached opening three-char emphasis marker. Push on token
- # stack; will be handled by the special condition above.
- $em = $token{0};
- $strong = "$em$em";
- array_unshift($token_stack, $token);
- array_unshift($text_stack, '');
- $tree_char_em = true;
- }
- } else if ($token_len == 2) {
- if ($strong) {
- # Unwind any dangling emphasis marker:
- if (strlen($token_stack[0]) == 1) {
- $text_stack[1] .= array_shift($token_stack);
- $text_stack[0] .= array_shift($text_stack);
- }
- # Closing strong marker:
- array_shift($token_stack);
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "<strong>$span</strong>";
- $text_stack[0] .= $this->hashPart($span);
- $strong = '';
- } else {
- array_unshift($token_stack, $token);
- array_unshift($text_stack, '');
- $strong = $token;
- }
- } else {
- # Here $token_len == 1
- if ($em) {
- if (strlen($token_stack[0]) == 1) {
- # Closing emphasis marker:
- array_shift($token_stack);
- $span = array_shift($text_stack);
- $span = $this->runSpanGamut($span);
- $span = "<em>$span</em>";
- $text_stack[0] .= $this->hashPart($span);
- $em = '';
- } else {
- $text_stack[0] .= $token;
- }
- } else {
- array_unshift($token_stack, $token);
- array_unshift($text_stack, '');
- $em = $token;
- }
- }
- }
- return $text_stack[0];
- }
-
-
- function doBlockQuotes($text) {
- $text = preg_replace_callback('/
- ( # Wrap whole match in $1
- (?>
- ^[ ]*>[ ]? # ">" at the start of a line
- .+\n # rest of the first line
- (.+\n)* # subsequent consecutive lines
- \n* # blanks
- )+
- )
- /xm',
- array(&$this, '_doBlockQuotes_callback'), $text);
-
- return $text;
- }
- function _doBlockQuotes_callback($matches) {
- $bq = $matches[1];
- # trim one level of quoting - trim whitespace-only lines
- $bq = preg_replace('/^[ ]*>[ ]?|^[ ]+$/m', '', $bq);
- $bq = $this->runBlockGamut($bq); # recurse
-
- $bq = preg_replace('/^/m', " ", $bq);
- # These leading spaces cause problem with <pre> content,
- # so we need to fix that:
- $bq = preg_replace_callback('{(\s*<pre>.+?</pre>)}sx',
- array(&$this, '_DoBlockQuotes_callback2'), $bq);
-
- return "\n". $this->hashBlock("<blockquote>\n$bq\n</blockquote>")."\n\n";
- }
- function _doBlockQuotes_callback2($matches) {
- $pre = $matches[1];
- $pre = preg_replace('/^ /m', '', $pre);
- return $pre;
- }
-
-
- function formParagraphs($text) {
- #
- # Params:
- # $text - string to process with html <p> tags
- #
- # Strip leading and trailing lines:
- $text = preg_replace('/\A\n+|\n+\z/', '', $text);
-
- $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
-
- #
- # Wrap <p> tags and unhashify HTML blocks
- #
- foreach ($grafs as $key => $value) {
- if (!preg_match('/^B\x1A[0-9]+B$/', $value)) {
- # Is a paragraph.
- $value = $this->runSpanGamut($value);
- $value = preg_replace('/^([ ]*)/', "<p>", $value);
- $value .= "</p>";
- $grafs[$key] = $this->unhash($value);
- }
- else {
- # Is a block.
- # Modify elements of @grafs in-place...
- $graf = $value;
- $block = $this->html_hashes[$graf];
- $graf = $block;
-// if (preg_match('{
-// \A
-// ( # $1 = <div> tag
-// <div \s+
-// [^>]*
-// \b
-// markdown\s*=\s* ([\'"]) # $2 = attr quote char
-// 1
-// \2
-// [^>]*
-// >
-// )
-// ( # $3 = contents
-// .*
-// )
-// (</div>) # $4 = closing tag
-// \z
-// }xs', $block, $matches))
-// {
-// list(, $div_open, , $div_content, $div_close) = $matches;
-//
-// # We can't call Markdown(), because that resets the hash;
-// # that initialization code should be pulled into its own sub, though.
-// $div_content = $this->hashHTMLBlocks($div_content);
-//
-// # Run document gamut methods on the content.
-// foreach ($this->document_gamut as $method => $priority) {
-// $div_content = $this->$method($div_content);
-// }
-//
-// $div_open = preg_replace(
-// '{\smarkdown\s*=\s*([\'"]).+?\1}', '', $div_open);
-//
-// $graf = $div_open . "\n" . $div_content . "\n" . $div_close;
-// }
- $grafs[$key] = $graf;
- }
- }
-
- return implode("\n\n", $grafs);
- }
-
-
- function encodeAttribute($text) {
- #
- # Encode text for a double-quoted HTML attribute. This function
- # is *not* suitable for attributes enclosed in single quotes.
- #
- $text = $this->encodeAmpsAndAngles($text);
- $text = str_replace('"', '&quot;', $text);
- return $text;
- }
-
-
- function encodeAmpsAndAngles($text) {
- #
- # Smart processing for ampersands and angle brackets that need to
- # be encoded. Valid character entities are left alone unless the
- # no-entities mode is set.
- #
- if ($this->no_entities) {
- $text = str_replace('&', '&amp;', $text);
- } else {
- # Ampersand-encoding based entirely on Nat Irons's Amputator
- # MT plugin: <http://bumppo.net/projects/amputator/>
- $text = preg_replace('/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/',
- '&amp;', $text);;
- }
- # Encode remaining <'s
- $text = str_replace('<', '&lt;', $text);
-
- return $text;
- }
-
-
- function doAutoLinks($text) {
- $text = preg_replace_callback('{<((https?|ftp|dict):[^\'">\s]+)>}i',
- array(&$this, '_doAutoLinks_url_callback'), $text);
-
- # Email addresses: <address@domain.foo>
- $text = preg_replace_callback('{
- <
- (?:mailto:)?
- (
- [-.\w\x80-\xFF]+
- \@
- [-a-z0-9\x80-\xFF]+(\.[-a-z0-9\x80-\xFF]+)*\.[a-z]+
- )
- >
- }xi',
- array(&$this, '_doAutoLinks_email_callback'), $text);
-
- return $text;
- }
- function _doAutoLinks_url_callback($matches) {
- $url = $this->encodeAttribute($matches[1]);
- $link = "<a href=\"$url\">$url</a>";
- return $this->hashPart($link);
- }
- function _doAutoLinks_email_callback($matches) {
- $address = $matches[1];
- $link = $this->encodeEmailAddress($address);
- return $this->hashPart($link);
- }
-
-
- function encodeEmailAddress($addr) {
- #
- # Input: an email address, e.g. "foo@example.com"
- #
- # Output: the email address as a mailto link, with each character
- # of the address encoded as either a decimal or hex entity, in
- # the hopes of foiling most address harvesting spam bots. E.g.:
- #
- # <p><a href="&#109;&#x61;&#105;&#x6c;&#116;&#x6f;&#58;&#x66;o&#111;
- # &#x40;&#101;&#x78;&#97;&#x6d;&#112;&#x6c;&#101;&#46;&#x63;&#111;
- # &#x6d;">&#x66;o&#111;&#x40;&#101;&#x78;&#97;&#x6d;&#112;&#x6c;
- # &#101;&#46;&#x63;&#111;&#x6d;</a></p>
- #
- # Based by a filter by Matthew Wickline, posted to BBEdit-Talk.
- # With some optimizations by Milian Wolff.
- #
- $addr = "mailto:" . $addr;
- $chars = preg_split('/(?<!^)(?!$)/', $addr);
- $seed = (int)abs(crc32($addr) / strlen($addr)); # Deterministic seed.
-
- foreach ($chars as $key => $char) {
- $ord = ord($char);
- # Ignore non-ascii chars.
- if ($ord < 128) {
- $r = ($seed * (1 + $key)) % 100; # Pseudo-random function.
- # roughly 10% raw, 45% hex, 45% dec
- # '@' *must* be encoded. I insist.
- if ($r > 90 && $char != '@') /* do nothing */;
- else if ($r < 45) $chars[$key] = '&#x'.dechex($ord).';';
- else $chars[$key] = '&#'.$ord.';';
- }
- }
-
- $addr = implode('', $chars);
- $text = implode('', array_slice($chars, 7)); # text without `mailto:`
- $addr = "<a href=\"$addr\">$text</a>";
-
- return $addr;
- }
-
-
- function parseSpan($str) {
- #
- # Take the string $str and parse it into tokens, hashing embeded HTML,
- # escaped characters and handling code spans.
- #
- $output = '';
-
- $span_re = '{
- (
- \\\\'.$this->escape_chars_re.'
- |
- (?<![`\\\\])
- `+ # code span marker
- '.( $this->no_markup ? '' : '
- |
- <!-- .*? --> # comment
- |
- <\?.*?\?> | <%.*?%> # processing instruction
- |
- <[/!$]?[-a-zA-Z0-9:]+ # regular tags
- (?>
- \s
- (?>[^"\'>]+|"[^"]*"|\'[^\']*\')*
- )?
- >
- ').'
- )
- }xs';
-
- while (1) {
- #
- # Each loop iteration seach for either the next tag, the next
- # openning code span marker, or the next escaped character.
- # Each token is then passed to handleSpanToken.
- #
- $parts = preg_split($span_re, $str, 2, PREG_SPLIT_DELIM_CAPTURE);
-
- # Create token from text preceding tag.
- if ($parts[0] != "") {
- $output .= $parts[0];
- }
-
- # Check if we reach the end.
- if (isset($parts[1])) {
- $output .= $this->handleSpanToken($parts[1], $parts[2]);
- $str = $parts[2];
- }
- else {
- break;
- }
- }
-
- return $output;
- }
-
-
- function handleSpanToken($token, &$str) {
- #
- # Handle $token provided by parseSpan by determining its nature and
- # returning the corresponding value that should replace it.
- #
- switch ($token{0}) {
- case "\\":
- return $this->hashPart("&#". ord($token{1}). ";");
- case "`":
- # Search for end marker in remaining text.
- if (preg_match('/^(.*?[^`])'.preg_quote($token).'(?!`)(.*)$/sm',
- $str, $matches))
- {
- $str = $matches[2];
- $codespan = $this->makeCodeSpan($matches[1]);
- return $this->hashPart($codespan);
- }
- return $token; // return as text since no ending marker found.
- default:
- return $this->hashPart($token);
- }
- }
-
-
- function outdent($text) {
- #
- # Remove one level of line-leading tabs or spaces
- #
- return preg_replace('/^(\t|[ ]{1,'.$this->tab_width.'})/m', '', $text);
- }
-
-
- # String length function for detab. `_initDetab` will create a function to
- # hanlde UTF-8 if the default function does not exist.
- var $utf8_strlen = 'mb_strlen';
-
- function detab($text) {
- #
- # Replace tabs with the appropriate amount of space.
- #
- # For each line we separate the line in blocks delemited by
- # tab characters. Then we reconstruct every line by adding the
- # appropriate number of space between each blocks.
-
- $text = preg_replace_callback('/^.*\t.*$/m',
- array(&$this, '_detab_callback'), $text);
-
- return $text;
- }
- function _detab_callback($matches) {
- $line = $matches[0];
- $strlen = $this->utf8_strlen; # strlen function for UTF-8.
-
- # Split in blocks.
- $blocks = explode("\t", $line);
- # Add each blocks to the line.
- $line = $blocks[0];
- unset($blocks[0]); # Do not add first block twice.
- foreach ($blocks as $block) {
- # Calculate amount of space, insert spaces, insert block.
- $amount = $this->tab_width -
- $strlen($line, 'UTF-8') % $this->tab_width;
- $line .= str_repeat(" ", $amount) . $block;
- }
- return $line;
- }
- function _initDetab() {
- #
- # Check for the availability of the function in the `utf8_strlen` property
- # (initially `mb_strlen`). If the function is not available, create a
- # function that will loosely count the number of UTF-8 characters with a
- # regular expression.
- #
- if (function_exists($this->utf8_strlen)) return;
- $this->utf8_strlen = create_function('$text', 'return preg_match_all(
- "/[\\\\x00-\\\\xBF]|[\\\\xC0-\\\\xFF][\\\\x80-\\\\xBF]*/",
- $text, $m);');
- }
-
-
- function unhash($text) {
- #
- # Swap back in all the tags hashed by _HashHTMLBlocks.
- #
- return preg_replace_callback('/(.)\x1A[0-9]+\1/',
- array(&$this, '_unhash_callback'), $text);
- }
- function _unhash_callback($matches) {
- return $this->html_hashes[$matches[0]];
- }
-
-}
-
-
-#
-# Markdown Extra Parser Class
-#
-
-class MarkdownExtra_Parser extends Markdown_Parser {
-
- # Prefix for footnote ids.
- var $fn_id_prefix = "";
-
- # Optional title attribute for footnote links and backlinks.
- var $fn_link_title = MARKDOWN_FN_LINK_TITLE;
- var $fn_backlink_title = MARKDOWN_FN_BACKLINK_TITLE;
-
- # Optional class attribute for footnote links and backlinks.
- var $fn_link_class = MARKDOWN_FN_LINK_CLASS;
- var $fn_backlink_class = MARKDOWN_FN_BACKLINK_CLASS;
-
- # Predefined abbreviations.
- var $predef_abbr = array();
-
-
- function MarkdownExtra_Parser() {
- #
- # Constructor function. Initialize the parser object.
- #
- # Add extra escapable characters before parent constructor
- # initialize the table.
- $this->escape_chars .= ':|';
-
- # Insert extra document, block, and span transformations.
- # Parent constructor will do the sorting.
- $this->document_gamut += array(
- "doFencedCodeBlocks" => 5,
- "stripFootnotes" => 15,
- "stripAbbreviations" => 25,
- "appendFootnotes" => 50,
- );
- $this->block_gamut += array(
- "doFencedCodeBlocks" => 5,
- "doTables" => 15,
- "doDefLists" => 45,
- );
- $this->span_gamut += array(
- "doFootnotes" => 5,
- "doAbbreviations" => 70,
- );
-
- parent::Markdown_Parser();
- }
-
-
- # Extra variables used during extra transformations.
- var $footnotes = array();
- var $footnotes_ordered = array();
- var $abbr_desciptions = array();
- var $abbr_word_re = '';
-
- # Give the current footnote number.
- var $footnote_counter = 1;
-
-
- function setup() {
- #
- # Setting up Extra-specific variables.
- #
- parent::setup();
-
- $this->footnotes = array();
- $this->footnotes_ordered = array();
- $this->abbr_desciptions = array();
- $this->abbr_word_re = '';
- $this->footnote_counter = 1;
-
- foreach ($this->predef_abbr as $abbr_word => $abbr_desc) {
- if ($this->abbr_word_re)
- $this->abbr_word_re .= '|';
- $this->abbr_word_re .= preg_quote($abbr_word);
- $this->abbr_desciptions[$abbr_word] = trim($abbr_desc);
- }
- }
-
- function teardown() {
- #
- # Clearing Extra-specific variables.
- #
- $this->footnotes = array();
- $this->footnotes_ordered = array();
- $this->abbr_desciptions = array();
- $this->abbr_word_re = '';
-
- parent::teardown();
- }
-
-
- ### HTML Block Parser ###
-
- # Tags that are always treated as block tags:
- var $block_tags_re = 'p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|address|form|fieldset|iframe|hr|legend';
-
- # Tags treated as block tags only if the opening tag is alone on it's line:
- var $context_block_tags_re = 'script|noscript|math|ins|del';
-
- # Tags where markdown="1" default to span mode:
- var $contain_span_tags_re = 'p|h[1-6]|li|dd|dt|td|th|legend|address';
-
- # Tags which must not have their contents modified, no matter where
- # they appear:
- var $clean_tags_re = 'script|math';
-
- # Tags that do not need to be closed.
- var $auto_close_tags_re = 'hr|img';
-
-
- function hashHTMLBlocks($text) {
- #
- # Hashify HTML Blocks and "clean tags".
- #
- # We only want to do this for block-level HTML tags, such as headers,
- # lists, and tables. That's because we still want to wrap <p>s around
- # "paragraphs" that are wrapped in non-block-level tags, such as anchors,
- # phrase emphasis, and spans. The list of tags we're looking for is
- # hard-coded.
- #
- # This works by calling _HashHTMLBlocks_InMarkdown, which then calls
- # _HashHTMLBlocks_InHTML when it encounter block tags. When the markdown="1"
- # attribute is found whitin a tag, _HashHTMLBlocks_InHTML calls back
- # _HashHTMLBlocks_InMarkdown to handle the Markdown syntax within the tag.
- # These two functions are calling each other. It's recursive!
- #
- #
- # Call the HTML-in-Markdown hasher.
- #
- list($text, ) = $this->_hashHTMLBlocks_inMarkdown($text);
-
- return $text;
- }
- function _hashHTMLBlocks_inMarkdown($text, $indent = 0,
- $enclosing_tag_re = '', $span = false)
- {
- #
- # Parse markdown text, calling _HashHTMLBlocks_InHTML for block tags.
- #
- # * $indent is the number of space to be ignored when checking for code
- # blocks. This is important because if we don't take the indent into
- # account, something like this (which looks right) won't work as expected:
- #
- # <div>
- # <div markdown="1">
- # Hello World. <-- Is this a Markdown code block or text?
- # </div> <-- Is this a Markdown code block or a real tag?
- # <div>
- #
- # If you don't like this, just don't indent the tag on which
- # you apply the markdown="1" attribute.
- #
- # * If $enclosing_tag_re is not empty, stops at the first unmatched closing
- # tag with that name. Nested tags supported.
- #
- # * If $span is true, text inside must treated as span. So any double
- # newline will be replaced by a single newline so that it does not create
- # paragraphs.
- #
- # Returns an array of that form: ( processed text , remaining text )
- #
- if ($text === '') return array('', '');
-
- # Regex to check for the presense of newlines around a block tag.
- $newline_before_re = '/(?:^\n?|\n\n)*$/';
- $newline_after_re =
- '{
- ^ # Start of text following the tag.
- (?>[ ]*<!--.*?-->)? # Optional comment.
- [ ]*\n # Must be followed by newline.
- }xs';
-
- # Regex to match any tag.
- $block_tag_re =
- '{
- ( # $2: Capture hole tag.
- </? # Any opening or closing tag.
- (?> # Tag name.
- '.$this->block_tags_re.' |
- '.$this->context_block_tags_re.' |
- '.$this->clean_tags_re.' |
- (?!\s)'.$enclosing_tag_re.'
- )
- (?:
- (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name.
- (?>
- ".*?" | # Double quotes (can contain `>`)
- \'.*?\' | # Single quotes (can contain `>`)
- .+? # Anything but quotes and `>`.
- )*?
- )?
- > # End of tag.
- |
- <!-- .*? --> # HTML Comment
- |
- <\?.*?\?> | <%.*?%> # Processing instruction
- |
- <!\[CDATA\[.*?\]\]> # CData Block
- |
- # Code span marker
- `+
- '. ( !$span ? ' # If not in span.
- |
- # Indented code block
- (?> ^[ ]*\n? | \n[ ]*\n )
- [ ]{'.($indent+4).'}[^\n]* \n
- (?>
- (?: [ ]{'.($indent+4).'}[^\n]* | [ ]* ) \n
- )*
- |
- # Fenced code block marker
- (?> ^ | \n )
- [ ]{'.($indent).'}~~~+[ ]*\n
- ' : '' ). ' # End (if not is span).
- )
- }xs';
-
-
- $depth = 0; # Current depth inside the tag tree.
- $parsed = ""; # Parsed text that will be returned.
-
- #
- # Loop through every tag until we find the closing tag of the parent
- # or loop until reaching the end of text if no parent tag specified.
- #
- do {
- #
- # Split the text using the first $tag_match pattern found.
- # Text before pattern will be first in the array, text after
- # pattern will be at the end, and between will be any catches made
- # by the pattern.
- #
- $parts = preg_split($block_tag_re, $text, 2,
- PREG_SPLIT_DELIM_CAPTURE);
-
- # If in Markdown span mode, add a empty-string span-level hash
- # after each newline to prevent triggering any block element.
- if ($span) {
- $void = $this->hashPart("", ':');
- $newline = "$void\n";
- $parts[0] = $void . str_replace("\n", $newline, $parts[0]) . $void;
- }
-
- $parsed .= $parts[0]; # Text before current tag.
-
- # If end of $text has been reached. Stop loop.
- if (count($parts) < 3) {
- $text = "";
- break;
- }
-
- $tag = $parts[1]; # Tag to handle.
- $text = $parts[2]; # Remaining text after current tag.
- $tag_re = preg_quote($tag); # For use in a regular expression.
-
- #
- # Check for: Code span marker
- #
- if ($tag{0} == "`") {
- # Find corresponding end marker.
- $tag_re = preg_quote($tag);
- if (preg_match('{^(?>.+?|\n(?!\n))*?(?<!`)'.$tag_re.'(?!`)}',
- $text, $matches))
- {
- # End marker found: pass text unchanged until marker.
- $parsed .= $tag . $matches[0];
- $text = substr($text, strlen($matches[0]));
- }
- else {
- # Unmatched marker: just skip it.
- $parsed .= $tag;
- }
- }
- #
- # Check for: Indented code block or fenced code block marker.
- #
- else if ($tag{0} == "\n" || $tag{0} == "~") {
- if ($tag{1} == "\n" || $tag{1} == " ") {
- # Indented code block: pass it unchanged, will be handled
- # later.
- $parsed .= $tag;
- }
- else {
- # Fenced code block marker: find matching end marker.
- $tag_re = preg_quote(trim($tag));
- if (preg_match('{^(?>.*\n)+?'.$tag_re.' *\n}', $text,
- $matches))
- {
- # End marker found: pass text unchanged until marker.
- $parsed .= $tag . $matches[0];
- $text = substr($text, strlen($matches[0]));
- }
- else {
- # No end marker: just skip it.
- $parsed .= $tag;
- }
- }
- }
- #
- # Check for: Opening Block level tag or
- # Opening Context Block tag (like ins and del)
- # used as a block tag (tag is alone on it's line).
- #
- else if (preg_match('{^<(?:'.$this->block_tags_re.')\b}', $tag) ||
- ( preg_match('{^<(?:'.$this->context_block_tags_re.')\b}', $tag) &&
- preg_match($newline_before_re, $parsed) &&
- preg_match($newline_after_re, $text) )
- )
- {
- # Need to parse tag and following text using the HTML parser.
- list($block_text, $text) =
- $this->_hashHTMLBlocks_inHTML($tag . $text, "hashBlock", true);
-
- # Make sure it stays outside of any paragraph by adding newlines.
- $parsed .= "\n\n$block_text\n\n";
- }
- #
- # Check for: Clean tag (like script, math)
- # HTML Comments, processing instructions.
- #
- else if (preg_match('{^<(?:'.$this->clean_tags_re.')\b}', $tag) ||
- $tag{1} == '!' || $tag{1} == '?')
- {
- # Need to parse tag and following text using the HTML parser.
- # (don't check for markdown attribute)
- list($block_text, $text) =
- $this->_hashHTMLBlocks_inHTML($tag . $text, "hashClean", false);
-
- $parsed .= $block_text;
- }
- #
- # Check for: Tag with same name as enclosing tag.
- #
- else if ($enclosing_tag_re !== '' &&
- # Same name as enclosing tag.
- preg_match('{^</?(?:'.$enclosing_tag_re.')\b}', $tag))
- {
- #
- # Increase/decrease nested tag count.
- #
- if ($tag{1} == '/') $depth--;
- else if ($tag{strlen($tag)-2} != '/') $depth++;
-
- if ($depth < 0) {
- #
- # Going out of parent element. Clean up and break so we
- # return to the calling function.
- #
- $text = $tag . $text;
- break;
- }
-
- $parsed .= $tag;
- }
- else {
- $parsed .= $tag;
- }
- } while ($depth >= 0);
-
- return array($parsed, $text);
- }
- function _hashHTMLBlocks_inHTML($text, $hash_method, $md_attr) {
- #
- # Parse HTML, calling _HashHTMLBlocks_InMarkdown for block tags.
- #
- # * Calls $hash_method to convert any blocks.
- # * Stops when the first opening tag closes.
- # * $md_attr indicate if the use of the `markdown="1"` attribute is allowed.
- # (it is not inside clean tags)
- #
- # Returns an array of that form: ( processed text , remaining text )
- #
- if ($text === '') return array('', '');
-
- # Regex to match `markdown` attribute inside of a tag.
- $markdown_attr_re = '
- {
- \s* # Eat whitespace before the `markdown` attribute
- markdown
- \s*=\s*
- (?>
- (["\']) # $1: quote delimiter
- (.*?) # $2: attribute value
- \1 # matching delimiter
- |
- ([^\s>]*) # $3: unquoted attribute value
- )
- () # $4: make $3 always defined (avoid warnings)
- }xs';
-
- # Regex to match any tag.
- $tag_re = '{
- ( # $2: Capture hole tag.
- </? # Any opening or closing tag.
- [\w:$]+ # Tag name.
- (?:
- (?=[\s"\'/a-zA-Z0-9]) # Allowed characters after tag name.
- (?>
- ".*?" | # Double quotes (can contain `>`)
- \'.*?\' | # Single quotes (can contain `>`)
- .+? # Anything but quotes and `>`.
- )*?
- )?
- > # End of tag.
- |
- <!-- .*? --> # HTML Comment
- |
- <\?.*?\?> | <%.*?%> # Processing instruction
- |
- <!\[CDATA\[.*?\]\]> # CData Block
- )
- }xs';
-
- $original_text = $text; # Save original text in case of faliure.
-
- $depth = 0; # Current depth inside the tag tree.
- $block_text = ""; # Temporary text holder for current text.
- $parsed = ""; # Parsed text that will be returned.
-
- #
- # Get the name of the starting tag.
- # (This pattern makes $base_tag_name_re safe without quoting.)
- #
- if (preg_match('/^<([\w:$]*)\b/', $text, $matches))
- $base_tag_name_re = $matches[1];
-
- #
- # Loop through every tag until we find the corresponding closing tag.
- #
- do {
- #
- # Split the text using the first $tag_match pattern found.
- # Text before pattern will be first in the array, text after
- # pattern will be at the end, and between will be any catches made
- # by the pattern.
- #
- $parts = preg_split($tag_re, $text, 2, PREG_SPLIT_DELIM_CAPTURE);
-
- if (count($parts) < 3) {
- #
- # End of $text reached with unbalenced tag(s).
- # In that case, we return original text unchanged and pass the
- # first character as filtered to prevent an infinite loop in the
- # parent function.
- #
- return array($original_text{0}, substr($original_text, 1));
- }
-
- $block_text .= $parts[0]; # Text before current tag.
- $tag = $parts[1]; # Tag to handle.
- $text = $parts[2]; # Remaining text after current tag.
-
- #
- # Check for: Auto-close tag (like <hr/>)
- # Comments and Processing Instructions.
- #
- if (preg_match('{^</?(?:'.$this->auto_close_tags_re.')\b}', $tag) ||
- $tag{1} == '!' || $tag{1} == '?')
- {
- # Just add the tag to the block as if it was text.
- $block_text .= $tag;
- }
- else {
- #
- # Increase/decrease nested tag count. Only do so if
- # the tag's name match base tag's.
- #
- if (preg_match('{^</?'.$base_tag_name_re.'\b}', $tag)) {
- if ($tag{1} == '/') $depth--;
- else if ($tag{strlen($tag)-2} != '/') $depth++;
- }
-
- #
- # Check for `markdown="1"` attribute and handle it.
- #
- if ($md_attr &&
- preg_match($markdown_attr_re, $tag, $attr_m) &&
- preg_match('/^1|block|span$/', $attr_m[2] . $attr_m[3]))
- {
- # Remove `markdown` attribute from opening tag.
- $tag = preg_replace($markdown_attr_re, '', $tag);
-
- # Check if text inside this tag must be parsed in span mode.
- $this->mode = $attr_m[2] . $attr_m[3];
- $span_mode = $this->mode == 'span' || $this->mode != 'block' &&
- preg_match('{^<(?:'.$this->contain_span_tags_re.')\b}', $tag);
-
- # Calculate indent before tag.
- if (preg_match('/(?:^|\n)( *?)(?! ).*?$/', $block_text, $matches)) {
- $strlen = $this->utf8_strlen;
- $indent = $strlen($matches[1], 'UTF-8');
- } else {
- $indent = 0;
- }
-
- # End preceding block with this tag.
- $block_text .= $tag;
- $parsed .= $this->$hash_method($block_text);
-
- # Get enclosing tag name for the ParseMarkdown function.
- # (This pattern makes $tag_name_re safe without quoting.)
- preg_match('/^<([\w:$]*)\b/', $tag, $matches);
- $tag_name_re = $matches[1];
-
- # Parse the content using the HTML-in-Markdown parser.
- list ($block_text, $text)
- = $this->_hashHTMLBlocks_inMarkdown($text, $indent,
- $tag_name_re, $span_mode);
-
- # Outdent markdown text.
- if ($indent > 0) {
- $block_text = preg_replace("/^[ ]{1,$indent}/m", "",
- $block_text);
- }
-
- # Append tag content to parsed text.
- if (!$span_mode) $parsed .= "\n\n$block_text\n\n";
- else $parsed .= "$block_text";
-
- # Start over a new block.
- $block_text = "";
- }
- else $block_text .= $tag;
- }
-
- } while ($depth > 0);
-
- #
- # Hash last block text that wasn't processed inside the loop.
- #
- $parsed .= $this->$hash_method($block_text);
-
- return array($parsed, $text);
- }
-
-
- function hashClean($text) {
- #
- # Called whenever a tag must be hashed when a function insert a "clean" tag
- # in $text, it pass through this function and is automaticaly escaped,
- # blocking invalid nested overlap.
- #
- return $this->hashPart($text, 'C');
- }
-
-
- function doHeaders($text) {
- #
- # Redefined to add id attribute support.
- #
- # Setext-style headers:
- # Header 1 {#header1}
- # ========
- #
- # Header 2 {#header2}
- # --------
- #
- $text = preg_replace_callback(
- '{
- (^.+?) # $1: Header text
- (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # $2: Id attribute
- [ ]*\n(=+|-+)[ ]*\n+ # $3: Header footer
- }mx',
- array(&$this, '_doHeaders_callback_setext'), $text);
-
- # atx-style headers:
- # # Header 1 {#header1}
- # ## Header 2 {#header2}
- # ## Header 2 with closing hashes ## {#header3}
- # ...
- # ###### Header 6 {#header2}
- #
- $text = preg_replace_callback('{
- ^(\#{1,6}) # $1 = string of #\'s
- [ ]*
- (.+?) # $2 = Header text
- [ ]*
- \#* # optional closing #\'s (not counted)
- (?:[ ]+\{\#([-_:a-zA-Z0-9]+)\})? # id attribute
- [ ]*
- \n+
- }xm',
- array(&$this, '_doHeaders_callback_atx'), $text);
-
- return $text;
- }
- function _doHeaders_attr($attr) {
- if (empty($attr)) return "";
- return " id=\"$attr\"";
- }
- function _doHeaders_callback_setext($matches) {
- if ($matches[3] == '-' && preg_match('{^- }', $matches[1]))
- return $matches[0];
- $level = $matches[3]{0} == '=' ? 1 : 2;
- $attr = $this->_doHeaders_attr($id =& $matches[2]);
- $block = "<h$level$attr>".$this->runSpanGamut($matches[1])."</h$level>";
- return "\n" . $this->hashBlock($block) . "\n\n";
- }
- function _doHeaders_callback_atx($matches) {
- $level = strlen($matches[1]);
- $attr = $this->_doHeaders_attr($id =& $matches[3]);
- $block = "<h$level$attr>".$this->runSpanGamut($matches[2])."</h$level>";
- return "\n" . $this->hashBlock($block) . "\n\n";
- }
-
-
- function doTables($text) {
- #
- # Form HTML tables.
- #
- $less_than_tab = $this->tab_width - 1;
- #
- # Find tables with leading pipe.
- #
- # | Header 1 | Header 2
- # | -------- | --------
- # | Cell 1 | Cell 2
- # | Cell 3 | Cell 4
- #
- $text = preg_replace_callback('
- {
- ^ # Start of a line
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- [|] # Optional leading pipe (present)
- (.+) \n # $1: Header row (at least one pipe)
-
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- [|] ([ ]*[-:]+[-| :]*) \n # $2: Header underline
-
- ( # $3: Cells
- (?>
- [ ]* # Allowed whitespace.
- [|] .* \n # Row content.
- )*
- )
- (?=\n|\Z) # Stop at final double newline.
- }xm',
- array(&$this, '_doTable_leadingPipe_callback'), $text);
-
- #
- # Find tables without leading pipe.
- #
- # Header 1 | Header 2
- # -------- | --------
- # Cell 1 | Cell 2
- # Cell 3 | Cell 4
- #
- $text = preg_replace_callback('
- {
- ^ # Start of a line
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- (\S.*[|].*) \n # $1: Header row (at least one pipe)
-
- [ ]{0,'.$less_than_tab.'} # Allowed whitespace.
- ([-:]+[ ]*[|][-| :]*) \n # $2: Header underline
-
- ( # $3: Cells
- (?>
- .* [|] .* \n # Row content
- )*
- )
- (?=\n|\Z) # Stop at final double newline.
- }xm',
- array(&$this, '_DoTable_callback'), $text);
-
- return $text;
- }
- function _doTable_leadingPipe_callback($matches) {
- $head = $matches[1];
- $underline = $matches[2];
- $content = $matches[3];
-
- # Remove leading pipe for each row.
- $content = preg_replace('/^ *[|]/m', '', $content);
-
- return $this->_doTable_callback(array($matches[0], $head, $underline, $content));
- }
- function _doTable_callback($matches) {
- $head = $matches[1];
- $underline = $matches[2];
- $content = $matches[3];
-
- # Remove any tailing pipes for each line.
- $head = preg_replace('/[|] *$/m', '', $head);
- $underline = preg_replace('/[|] *$/m', '', $underline);
- $content = preg_replace('/[|] *$/m', '', $content);
-
- # Reading alignement from header underline.
- $separators = preg_split('/ *[|] */', $underline);
- foreach ($separators as $n => $s) {
- if (preg_match('/^ *-+: *$/', $s)) $attr[$n] = ' align="right"';
- else if (preg_match('/^ *:-+: *$/', $s))$attr[$n] = ' align="center"';
- else if (preg_match('/^ *:-+ *$/', $s)) $attr[$n] = ' align="left"';
- else $attr[$n] = '';
- }
-
- # Parsing span elements, including code spans, character escapes,
- # and inline HTML tags, so that pipes inside those gets ignored.
- $head = $this->parseSpan($head);
- $headers = preg_split('/ *[|] */', $head);
- $col_count = count($headers);
-
- # Write column headers.
- $text = "<table>\n";
- $text .= "<thead>\n";
- $text .= "<tr>\n";
- foreach ($headers as $n => $header)
- $text .= " <th$attr[$n]>".$this->runSpanGamut(trim($header))."</th>\n";
- $text .= "</tr>\n";
- $text .= "</thead>\n";
-
- # Split content by row.
- $rows = explode("\n", trim($content, "\n"));
-
- $text .= "<tbody>\n";
- foreach ($rows as $row) {
- # Parsing span elements, including code spans, character escapes,
- # and inline HTML tags, so that pipes inside those gets ignored.
- $row = $this->parseSpan($row);
-
- # Split row by cell.
- $row_cells = preg_split('/ *[|] */', $row, $col_count);
- $row_cells = array_pad($row_cells, $col_count, '');
-
- $text .= "<tr>\n";
- foreach ($row_cells as $n => $cell)
- $text .= " <td$attr[$n]>".$this->runSpanGamut(trim($cell))."</td>\n";
- $text .= "</tr>\n";
- }
- $text .= "</tbody>\n";
- $text .= "</table>";
-
- return $this->hashBlock($text) . "\n";
- }
-
-
- function doDefLists($text) {
- #
- # Form HTML definition lists.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Re-usable pattern to match any entire dl list:
- $whole_list_re = '(?>
- ( # $1 = whole list
- ( # $2
- [ ]{0,'.$less_than_tab.'}
- ((?>.*\S.*\n)+) # $3 = defined term
- \n?
- [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
- )
- (?s:.+?)
- ( # $4
- \z
- |
- \n{2,}
- (?=\S)
- (?! # Negative lookahead for another term
- [ ]{0,'.$less_than_tab.'}
- (?: \S.*\n )+? # defined term
- \n?
- [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
- )
- (?! # Negative lookahead for another definition
- [ ]{0,'.$less_than_tab.'}:[ ]+ # colon starting definition
- )
- )
- )
- )'; // mx
-
- $text = preg_replace_callback('{
- (?>\A\n?|(?<=\n\n))
- '.$whole_list_re.'
- }mx',
- array(&$this, '_doDefLists_callback'), $text);
-
- return $text;
- }
- function _doDefLists_callback($matches) {
- # Re-usable patterns to match list item bullets and number markers:
- $list = $matches[1];
-
- # Turn double returns into triple returns, so that we can make a
- # paragraph for the last item in a list, if necessary:
- $result = trim($this->processDefListItems($list));
- $result = "<dl>\n" . $result . "\n</dl>";
- return $this->hashBlock($result) . "\n\n";
- }
-
-
- function processDefListItems($list_str) {
- #
- # Process the contents of a single definition list, splitting it
- # into individual term and definition list items.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # trim trailing blank lines:
- $list_str = preg_replace("/\n{2,}\\z/", "\n", $list_str);
-
- # Process definition terms.
- $list_str = preg_replace_callback('{
- (?>\A\n?|\n\n+) # leading line
- ( # definition terms = $1
- [ ]{0,'.$less_than_tab.'} # leading whitespace
- (?![:][ ]|[ ]) # negative lookahead for a definition
- # mark (colon) or more whitespace.
- (?> \S.* \n)+? # actual term (not whitespace).
- )
- (?=\n?[ ]{0,3}:[ ]) # lookahead for following line feed
- # with a definition mark.
- }xm',
- array(&$this, '_processDefListItems_callback_dt'), $list_str);
-
- # Process actual definitions.
- $list_str = preg_replace_callback('{
- \n(\n+)? # leading line = $1
- ( # marker space = $2
- [ ]{0,'.$less_than_tab.'} # whitespace before colon
- [:][ ]+ # definition mark (colon)
- )
- ((?s:.+?)) # definition text = $3
- (?= \n+ # stop at next definition mark,
- (?: # next term or end of text
- [ ]{0,'.$less_than_tab.'} [:][ ] |
- <dt> | \z
- )
- )
- }xm',
- array(&$this, '_processDefListItems_callback_dd'), $list_str);
-
- return $list_str;
- }
- function _processDefListItems_callback_dt($matches) {
- $terms = explode("\n", trim($matches[1]));
- $text = '';
- foreach ($terms as $term) {
- $term = $this->runSpanGamut(trim($term));
- $text .= "\n<dt>" . $term . "</dt>";
- }
- return $text . "\n";
- }
- function _processDefListItems_callback_dd($matches) {
- $leading_line = $matches[1];
- $marker_space = $matches[2];
- $def = $matches[3];
-
- if ($leading_line || preg_match('/\n{2,}/', $def)) {
- # Replace marker with the appropriate whitespace indentation
- $def = str_repeat(' ', strlen($marker_space)) . $def;
- $def = $this->runBlockGamut($this->outdent($def . "\n\n"));
- $def = "\n". $def ."\n";
- }
- else {
- $def = rtrim($def);
- $def = $this->runSpanGamut($this->outdent($def));
- }
-
- return "\n<dd>" . $def . "</dd>\n";
- }
-
-
- function doFencedCodeBlocks($text) {
- #
- # Adding the fenced code block syntax to regular Markdown:
- #
- # ~~~
- # Code block
- # ~~~
- #
- $less_than_tab = $this->tab_width;
-
- $text = preg_replace_callback('{
- (?:\n|\A)
- # 1: Opening marker
- (
- ~{3,} # Marker: three tilde or more.
- )
- [ ]* \n # Whitespace and newline following marker.
-
- # 2: Content
- (
- (?>
- (?!\1 [ ]* \n) # Not a closing marker.
- .*\n+
- )+
- )
-
- # Closing marker.
- \1 [ ]* \n
- }xm',
- array(&$this, '_doFencedCodeBlocks_callback'), $text);
-
- return $text;
- }
- function _doFencedCodeBlocks_callback($matches) {
- $codeblock = $matches[2];
- $codeblock = htmlspecialchars($codeblock, ENT_NOQUOTES);
- $codeblock = preg_replace_callback('/^\n+/',
- array(&$this, '_doFencedCodeBlocks_newlines'), $codeblock);
- $codeblock = "<pre><code>$codeblock</code></pre>";
- return "\n\n".$this->hashBlock($codeblock)."\n\n";
- }
- function _doFencedCodeBlocks_newlines($matches) {
- return str_repeat("<br$this->empty_element_suffix",
- strlen($matches[0]));
- }
-
-
- #
- # Redefining emphasis markers so that emphasis by underscore does not
- # work in the middle of a word.
- #
- var $em_relist = array(
- '' => '(?:(?<!\*)\*(?!\*)|(?<![a-zA-Z0-9_])_(?!_))(?=\S)(?![.,:;]\s)',
- '*' => '(?<=\S)(?<!\*)\*(?!\*)',
- '_' => '(?<=\S)(?<!_)_(?![a-zA-Z0-9_])',
- );
- var $strong_relist = array(
- '' => '(?:(?<!\*)\*\*(?!\*)|(?<![a-zA-Z0-9_])__(?!_))(?=\S)(?![.,:;]\s)',
- '**' => '(?<=\S)(?<!\*)\*\*(?!\*)',
- '__' => '(?<=\S)(?<!_)__(?![a-zA-Z0-9_])',
- );
- var $em_strong_relist = array(
- '' => '(?:(?<!\*)\*\*\*(?!\*)|(?<![a-zA-Z0-9_])___(?!_))(?=\S)(?![.,:;]\s)',
- '***' => '(?<=\S)(?<!\*)\*\*\*(?!\*)',
- '___' => '(?<=\S)(?<!_)___(?![a-zA-Z0-9_])',
- );
-
-
- function formParagraphs($text) {
- #
- # Params:
- # $text - string to process with html <p> tags
- #
- # Strip leading and trailing lines:
- $text = preg_replace('/\A\n+|\n+\z/', '', $text);
-
- $grafs = preg_split('/\n{2,}/', $text, -1, PREG_SPLIT_NO_EMPTY);
-
- #
- # Wrap <p> tags and unhashify HTML blocks
- #
- foreach ($grafs as $key => $value) {
- $value = trim($this->runSpanGamut($value));
-
- # Check if this should be enclosed in a paragraph.
- # Clean tag hashes & block tag hashes are left alone.
- $is_p = !preg_match('/^B\x1A[0-9]+B|^C\x1A[0-9]+C$/', $value);
-
- if ($is_p) {
- $value = "<p>$value</p>";
- }
- $grafs[$key] = $value;
- }
-
- # Join grafs in one text, then unhash HTML tags.
- $text = implode("\n\n", $grafs);
-
- # Finish by removing any tag hashes still present in $text.
- $text = $this->unhash($text);
-
- return $text;
- }
-
-
- ### Footnotes
-
- function stripFootnotes($text) {
- #
- # Strips link definitions from text, stores the URLs and titles in
- # hash references.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Link defs are in the form: [^id]: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\[\^(.+?)\][ ]?: # note_id = $1
- [ ]*
- \n? # maybe *one* newline
- ( # text = $2 (no blank lines allowed)
- (?:
- .+ # actual text
- |
- \n # newlines but
- (?!\[\^.+?\]:\s)# negative lookahead for footnote marker.
- (?!\n+[ ]{0,3}\S)# ensure line is not blank and followed
- # by non-indented content
- )*
- )
- }xm',
- array(&$this, '_stripFootnotes_callback'),
- $text);
- return $text;
- }
- function _stripFootnotes_callback($matches) {
- $note_id = $this->fn_id_prefix . $matches[1];
- $this->footnotes[$note_id] = $this->outdent($matches[2]);
- return ''; # String that will replace the block
- }
-
-
- function doFootnotes($text) {
- #
- # Replace footnote references in $text [^id] with a special text-token
- # which will be replaced by the actual footnote marker in appendFootnotes.
- #
- if (!$this->in_anchor) {
- $text = preg_replace('{\[\^(.+?)\]}', "F\x1Afn:\\1\x1A:", $text);
- }
- return $text;
- }
-
-
- function appendFootnotes($text) {
- #
- # Append footnote list to text.
- #
- $text = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
- array(&$this, '_appendFootnotes_callback'), $text);
-
- if (!empty($this->footnotes_ordered)) {
- $text .= "\n\n";
- $text .= "<div class=\"footnotes\">\n";
- $text .= "<hr". MARKDOWN_EMPTY_ELEMENT_SUFFIX ."\n";
- $text .= "<ol>\n\n";
-
- $attr = " rev=\"footnote\"";
- if ($this->fn_backlink_class != "") {
- $class = $this->fn_backlink_class;
- $class = $this->encodeAttribute($class);
- $attr .= " class=\"$class\"";
- }
- if ($this->fn_backlink_title != "") {
- $title = $this->fn_backlink_title;
- $title = $this->encodeAttribute($title);
- $attr .= " title=\"$title\"";
- }
- $num = 0;
-
- while (!empty($this->footnotes_ordered)) {
- $footnote = reset($this->footnotes_ordered);
- $note_id = key($this->footnotes_ordered);
- unset($this->footnotes_ordered[$note_id]);
-
- $footnote .= "\n"; # Need to append newline before parsing.
- $footnote = $this->runBlockGamut("$footnote\n");
- $footnote = preg_replace_callback('{F\x1Afn:(.*?)\x1A:}',
- array(&$this, '_appendFootnotes_callback'), $footnote);
-
- $attr = str_replace("%%", ++$num, $attr);
- $note_id = $this->encodeAttribute($note_id);
-
- # Add backlink to last paragraph; create new paragraph if needed.
- $backlink = "<a href=\"#fnref:$note_id\"$attr>&#8617;</a>";
- if (preg_match('{</p>$}', $footnote)) {
- $footnote = substr($footnote, 0, -4) . "&#160;$backlink</p>";
- } else {
- $footnote .= "\n\n<p>$backlink</p>";
- }
-
- $text .= "<li id=\"fn:$note_id\">\n";
- $text .= $footnote . "\n";
- $text .= "</li>\n\n";
- }
-
- $text .= "</ol>\n";
- $text .= "</div>";
- }
- return $text;
- }
- function _appendFootnotes_callback($matches) {
- $node_id = $this->fn_id_prefix . $matches[1];
-
- # Create footnote marker only if it has a corresponding footnote *and*
- # the footnote hasn't been used by another marker.
- if (isset($this->footnotes[$node_id])) {
- # Transfert footnote content to the ordered list.
- $this->footnotes_ordered[$node_id] = $this->footnotes[$node_id];
- unset($this->footnotes[$node_id]);
-
- $num = $this->footnote_counter++;
- $attr = " rel=\"footnote\"";
- if ($this->fn_link_class != "") {
- $class = $this->fn_link_class;
- $class = $this->encodeAttribute($class);
- $attr .= " class=\"$class\"";
- }
- if ($this->fn_link_title != "") {
- $title = $this->fn_link_title;
- $title = $this->encodeAttribute($title);
- $attr .= " title=\"$title\"";
- }
-
- $attr = str_replace("%%", $num, $attr);
- $node_id = $this->encodeAttribute($node_id);
-
- return
- "<sup id=\"fnref:$node_id\">".
- "<a href=\"#fn:$node_id\"$attr>$num</a>".
- "</sup>";
- }
-
- return "[^".$matches[1]."]";
- }
-
-
- ### Abbreviations ###
-
- function stripAbbreviations($text) {
- #
- # Strips abbreviations from text, stores titles in hash references.
- #
- $less_than_tab = $this->tab_width - 1;
-
- # Link defs are in the form: [id]*: url "optional title"
- $text = preg_replace_callback('{
- ^[ ]{0,'.$less_than_tab.'}\*\[(.+?)\][ ]?: # abbr_id = $1
- (.*) # text = $2 (no blank lines allowed)
- }xm',
- array(&$this, '_stripAbbreviations_callback'),
- $text);
- return $text;
- }
- function _stripAbbreviations_callback($matches) {
- $abbr_word = $matches[1];
- $abbr_desc = $matches[2];
- if ($this->abbr_word_re)
- $this->abbr_word_re .= '|';
- $this->abbr_word_re .= preg_quote($abbr_word);
- $this->abbr_desciptions[$abbr_word] = trim($abbr_desc);
- return ''; # String that will replace the block
- }
-
-
- function doAbbreviations($text) {
- #
- # Find defined abbreviations in text and wrap them in <abbr> elements.
- #
- if ($this->abbr_word_re) {
- // cannot use the /x modifier because abbr_word_re may
- // contain significant spaces:
- $text = preg_replace_callback('{'.
- '(?<![\w\x1A])'.
- '(?:'.$this->abbr_word_re.')'.
- '(?![\w\x1A])'.
- '}',
- array(&$this, '_doAbbreviations_callback'), $text);
- }
- return $text;
- }
- function _doAbbreviations_callback($matches) {
- $abbr = $matches[0];
- if (isset($this->abbr_desciptions[$abbr])) {
- $desc = $this->abbr_desciptions[$abbr];
- if (empty($desc)) {
- return $this->hashPart("<abbr>$abbr</abbr>");
- } else {
- $desc = $this->encodeAttribute($desc);
- return $this->hashPart("<abbr title=\"$desc\">$abbr</abbr>");
- }
- } else {
- return $matches[0];
- }
- }
-
-}
-
-
-/*
-
-PHP Markdown Extra
-==================
-
-Description
------------
-
-This is a PHP port of the original Markdown formatter written in Perl
-by John Gruber. This special "Extra" version of PHP Markdown features
-further enhancements to the syntax for making additional constructs
-such as tables and definition list.
-
-Markdown is a text-to-HTML filter; it translates an easy-to-read /
-easy-to-write structured text format into HTML. Markdown's text format
-is most similar to that of plain text email, and supports features such
-as headers, *emphasis*, code blocks, blockquotes, and links.
-
-Markdown's syntax is designed not as a generic markup language, but
-specifically to serve as a front-end to (X)HTML. You can use span-level
-HTML tags anywhere in a Markdown document, and you can use block level
-HTML tags (like <div> and <table> as well).
-
-For more information about Markdown's syntax, see:
-
-<http://daringfireball.net/projects/markdown/>
-
-
-Bugs
-----
-
-To file bug reports please send email to:
-
-<michel.fortin@michelf.com>
-
-Please include with your report: (1) the example input; (2) the output you
-expected; (3) the output Markdown actually produced.
-
-
-Version History
----------------
-
-See the readme file for detailed release notes for this version.
-
-
-Copyright and License
----------------------
-
-PHP Markdown & Extra
-Copyright (c) 2004-2008 Michel Fortin
-<http://www.michelf.com/>
-All rights reserved.
-
-Based on Markdown
-Copyright (c) 2003-2006 John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "Markdown" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
-
-*/
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/PHP-SmartyPants-1.5.1e/PHP SmartyPants Readme.txt b/libvpx/examples/includes/PHP-SmartyPants-1.5.1e/PHP SmartyPants Readme.txt
deleted file mode 100644
index 39d36dd..0000000
--- a/libvpx/examples/includes/PHP-SmartyPants-1.5.1e/PHP SmartyPants Readme.txt
+++ /dev/null
@@ -1,394 +0,0 @@
-PHP SmartyPants
-===============
-
-Version 1.5.1e - Fri 9 Dec 2005
-
-by Michel Fortin
-<http://www.michelf.com/>
-
-based on work by John Gruber
-<http://daringfireball.net/>
-
-
-Introduction
-------------
-
-PHP SmartyPants is a port to PHP of the original SmartyPants written
-in Perl by John Gruber.
-
-PHP SmartyPants is a free web publishing plug-in for WordPress and
-Smarty template engine that easily translates plain ASCII punctuation
-characters into "smart" typographic punctuation HTML entities.
-SmartyPants can also be invoked as a standalone PHP function.
-
-SmartyPants can perform the following transformations:
-
-* Straight quotes (`"` and `'`) into "curly" quote HTML entities
-* Backtick-style quotes (` ``like this'' `) into "curly" quote HTML
- entities
-* Dashes (`--` and `---`) into en- and em-dash entities
-* Three consecutive dots (`...`) into an ellipsis entity
-
-This means you can write, edit, and save using plain old ASCII straight
-quotes, plain dashes, and plain dots, but your published posts (and
-final HTML output) will appear with smart quotes, em-dashes, and proper
-ellipses.
-
-SmartyPants does not modify characters within `<pre>`, `<code>`,
-`<kbd>`, or `<script>` tag blocks. Typically, these tags are used to
-display text where smart quotes and other "smart punctuation" would not
-be appropriate, such as source code or example markup.
-
-
-### Backslash Escapes ###
-
-If you need to use literal straight quotes (or plain hyphens and
-periods), SmartyPants accepts the following backslash escape sequences
-to force non-smart punctuation. It does so by transforming the escape
-sequence into a decimal-encoded HTML entity:
-
-
- Escape Value Character
- ------ ----- ---------
- \\ &#92; \
- \" &#34; "
- \' &#39; '
- \. &#46; .
- \- &#45; -
- \` &#96; `
-
-
-This is useful, for example, when you want to use straight quotes as
-foot and inch marks:
-
- 6\'2\" tall
-
-translates into:
-
- 6&#39;2&#34; tall
-
-in SmartyPants's HTML output. Which, when rendered by a web browser,
-looks like:
-
- 6'2" tall
-
-
-Installation and Requirement
-----------------------------
-
-PHP SmartyPants require PHP version 4.0.5 or later.
-
-
-### WordPress ###
-
-WordPress already include a filter called "Texturize" with the same
-goal as SmartyPants. You could still find some usefulness to
-PHP SmartyPants if you are not happy enough with the standard algorithm.
-
-PHP SmartyPants works with [WordPress][wp], version 1.2 or later.
-
-[wp]: http://wordpress.org/
-
-1. To use PHP SmartyPants with WordPress, place the "smartypants.php"
- file in the "plugins" folder. This folder is hidden inside
- "wp-content" at the root of your site:
-
- (site home)/wp-content/plugins/smartypants.php
-
-2. Activate the plugin with the administrative interface of WordPress.
- In the "Plugins" section you will now find SmartyPants. To activate
- the plugin, click on the "Activate" button on the same line than
- SmartyPants. Your entries will now be filtered by PHP SmartyPants.
-
-Note: It is not possible at this time to apply a different set of
-filters to different entries. All your entries will be filtered by
-PHP SmartyPants if the plugin is active. This is currently a limitation
-of WordPress.
-
-
-### Blosxom ###
-
-SmartyPants works with Blosxom version 2.0 or later.
-
-1. Rename the "SmartyPants.pl" plug-in to "SmartyPants" (case is
- important). Movable Type requires plug-ins to have a ".pl"
- extension; Blosxom forbids it (at least as of this writing).
-
-2. Copy the "SmartyPants" plug-in file to your Blosxom plug-ins folder.
- If you're not sure where your Blosxom plug-ins folder is, see the
- Blosxom documentation for information.
-
-3. That's it. The entries in your weblog should now automatically have
- SmartyPants's default transformations applied.
-
-4. If you wish to configure SmartyPants's behavior, open the
- "SmartyPants" plug-in, and edit the value of the `$smartypants_attr`
- configuration variable, located near the top of the script. The
- default value is 1; see "Options", below, for the full list of
- supported values.
-
-
-### In your programs ###
-
-You can use PHP SmartyPants easily in your current PHP program. Simply
-include the file and then call the `SmartyPants` function on the text
-you want to convert:
-
- include_once "smartypants.php";
- $my_text = SmartyPants($my_text);
-
-
-### With Smarty ###
-
-If your program use the [Smarty][sm] template engine, PHP SmartyPants
-can now be used as a modifier for your templates. Rename
-"smartypants.php" to "modifier.smartypants.php" and put it in your
-smarty plugins folder.
-
-[sm]: http://smarty.php.net/
-
-
-Options and Configuration
--------------------------
-
-Settings are specified by editing the value of the `$smartypants_attr`
-variable in the "smartypants.php" file. For users of the Smarty template
-engine, the "smartypants" modifier also takes an optional attribute where
-you can specify configuration options, like this:
-`{$var|smartypants:1}` (where "1" is the configuration option).
-
-Numeric values are the easiest way to configure SmartyPants's behavior:
-
-"0"
- Suppress all transformations. (Do nothing.)
-
-"1"
- Performs default SmartyPants transformations: quotes (including
- backticks-style), em-dashes, and ellipses. `--` (dash dash) is
- used to signify an em-dash; there is no support for en-dashes.
-
-"2"
- Same as smarty_pants="1", except that it uses the old-school
- typewriter shorthand for dashes: `--` (dash dash) for en-dashes,
- `---` (dash dash dash) for em-dashes.
-
-"3"
- Same as smarty_pants="2", but inverts the shorthand for dashes: `--`
- (dash dash) for em-dashes, and `---` (dash dash dash) for en-dashes.
-
-"-1"
- Stupefy mode. Reverses the SmartyPants transformation process,
- turning the HTML entities produced by SmartyPants into their ASCII
- equivalents. E.g. `&#8220;` is turned into a simple double-quote
- (`"`), `&#8212;` is turned into two dashes, etc. This is useful if you
- wish to suppress smart punctuation in specific pages, such as
- RSS feeds.
-
-The following single-character attribute values can be combined to
-toggle individual transformations from within the smarty_pants
-attribute. For example, to educate normal quotes and em-dashes, but not
-ellipses or backticks-style quotes:
-
- $smartypants_attr = "qd";
-
-Or inside a Smarty template:
-
- {$var|smartypants:"qd"}
-
-"q"
- Educates normal quote characters: (`"`) and (`'`).
-
-"b"
- Educates ` ``backticks'' ` double quotes.
-
-"B"
- Educates backticks-style double quotes and ` `single' ` quotes.
-
-"d"
- Educates em-dashes.
-
-"D"
- Educates em-dashes and en-dashes, using old-school typewriter
- shorthand: (dash dash) for en-dashes, (dash dash dash) for
- em-dashes.
-
-"i"
- Educates em-dashes and en-dashes, using inverted old-school
- typewriter shorthand: (dash dash) for em-dashes, (dash dash dash)
- for en-dashes.
-
-"e"
- Educates ellipses.
-
-"w"
- Translates any instance of `&quot;` into a normal double-quote
- character. This should be of no interest to most people, but of
- particular interest to anyone who writes their posts using
- Dreamweaver, as Dreamweaver inexplicably uses this entity to
- represent a literal double-quote character. SmartyPants only
- educates normal quotes, not entities (because ordinarily, entities
- are used for the explicit purpose of representing the specific
- character they represent). The "w" option must be used in
- conjunction with one (or both) of the other quote options ("q" or
- "b"). Thus, if you wish to apply all SmartyPants transformations
- (quotes, en- and em-dashes, and ellipses) and also translate
- `&quot;` entities into regular quotes so SmartyPants can educate
- them, you should pass the following to the smarty_pants attribute:
-
- $smartypants_attr = "qDew";
-
- Inside a Smarty template, this will be:
-
- {$var|smartypants:"qDew"}
-
-
-Caveats
--------
-
-### Why You Might Not Want to Use Smart Quotes in Your Weblog ###
-
-For one thing, you might not care.
-
-Most normal, mentally stable individuals do not take notice of proper
-typographic punctuation. Many design and typography nerds, however,
-break out in a nasty rash when they encounter, say, a restaurant sign
-that uses a straight apostrophe to spell "Joe's".
-
-If you're the sort of person who just doesn't care, you might well want
-to continue not caring. Using straight quotes -- and sticking to the
-7-bit ASCII character set in general -- is certainly a simpler way to
-live.
-
-Even if you *do* care about accurate typography, you still might want to
-think twice before educating the quote characters in your weblog. One
-side effect of publishing curly quote HTML entities is that it makes
-your weblog a bit harder for others to quote from using copy-and-paste.
-What happens is that when someone copies text from your blog, the copied
-text contains the 8-bit curly quote characters (as well as the 8-bit
-characters for em-dashes and ellipses, if you use these options). These
-characters are not standard across different text encoding methods,
-which is why they need to be encoded as HTML entities.
-
-People copying text from your weblog, however, may not notice that
-you're using curly quotes, and they'll go ahead and paste the unencoded
-8-bit characters copied from their browser into an email message or
-their own weblog. When pasted as raw "smart quotes", these characters
-are likely to get mangled beyond recognition.
-
-That said, my own opinion is that any decent text editor or email client
-makes it easy to stupefy smart quote characters into their 7-bit
-equivalents, and I don't consider it my problem if you're using an
-indecent text editor or email client.
-
-### Algorithmic Shortcomings ###
-
-One situation in which quotes will get curled the wrong way is when
-apostrophes are used at the start of leading contractions. For example:
-
- 'Twas the night before Christmas.
-
-In the case above, SmartyPants will turn the apostrophe into an opening
-single-quote, when in fact it should be a closing one. I don't think
-this problem can be solved in the general case -- every word processor
-I've tried gets this wrong as well. In such cases, it's best to use the
-proper HTML entity for closing single-quotes (`&#8217;` or `&rsquo;`) by
-hand.
-
-
-Bugs
-----
-
-To file bug reports or feature requests (other than topics listed in the
-Caveats section above) please send email to:
-
-<michel.fortin@michelf.com>
-
-If the bug involves quotes being curled the wrong way, please send
-example text to illustrate.
-
-
-Version History
----------------
-
-1.5.1e (9 Dec 2005)
-
-* Corrected a bug that prevented special characters from being
- escaped.
-
-
-1.5.1d (6 Jun 2005)
-
-* Correct a small bug in `_TokenizeHTML` where a Doctype declaration
- was not seen as HTML, making curly quotes inside it.
-
-
-1.5.1c (13 Dec 2004)
-
-* Changed a regular expression in `_TokenizeHTML` that could lead
- to a segmentation fault with PHP 4.3.8 on Linux.
-
-
-1.5.1b (6 Sep 2004)
-
-* Corrected a problem with quotes immediately following a dash
- with no space between: `Text--"quoted text"--text.`
-
-* PHP SmartyPants can now be used as a modifier by the Smarty
- template engine. Rename the file to "modifier.smartypants.php"
- and put it in your smarty plugins folder.
-
-* Replaced a lot of spaces characters by tabs, saving about 4 KB.
-
-
-1.5.1a (30 Jun 2004)
-
-* PHP Markdown and PHP Smartypants now share the same `_TokenizeHTML`
- function when loaded simultanously.
-
-* Changed the internals of `_TokenizeHTML` to lower the PHP version
- requirement to PHP 4.0.5.
-
-
-1.5.1 (6 Jun 2004)
-
-* Initial release of PHP SmartyPants, based on version 1.5.1 of the
- original SmartyPants written in Perl.
-
-
-Copyright and License
----------------------
-
-Copyright (c) 2005 Michel Fortin
-<http://www.michelf.com/>
-All rights reserved.
-
-Copyright (c) 2003-2004 John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "SmartyPants" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as
-is" and any express or implied warranties, including, but not limited
-to, the implied warranties of merchantability and fitness for a
-particular purpose are disclaimed. In no event shall the copyright owner
-or contributors be liable for any direct, indirect, incidental, special,
-exemplary, or consequential damages (including, but not limited to,
-procurement of substitute goods or services; loss of use, data, or
-profits; or business interruption) however caused and on any theory of
-liability, whether in contract, strict liability, or tort (including
-negligence or otherwise) arising in any way out of the use of this
-software, even if advised of the possibility of such damage.
diff --git a/libvpx/examples/includes/PHP-SmartyPants-1.5.1e/smartypants.php b/libvpx/examples/includes/PHP-SmartyPants-1.5.1e/smartypants.php
deleted file mode 100644
index cc0dd96..0000000
--- a/libvpx/examples/includes/PHP-SmartyPants-1.5.1e/smartypants.php
+++ /dev/null
@@ -1,860 +0,0 @@
-<?php
-
-#
-# SmartyPants - Smart punctuation for web sites
-#
-# by John Gruber
-# <http://daringfireball.net>
-#
-# PHP port by Michel Fortin
-# <http://www.michelf.com/>
-#
-# Copyright (c) 2003-2004 John Gruber
-# Copyright (c) 2004-2005 Michel Fortin
-#
-
-
-global $SmartyPantsPHPVersion, $SmartyPantsSyntaxVersion,
- $smartypants_attr, $sp_tags_to_skip;
-
-$SmartyPantsPHPVersion = '1.5.1e'; # Fru 9 Dec 2005
-$SmartyPantsSyntaxVersion = '1.5.1'; # Fri 12 Mar 2004
-
-
-# Configurable variables:
-$smartypants_attr = "1"; # Change this to configure.
- # 1 => "--" for em-dashes; no en-dash support
- # 2 => "---" for em-dashes; "--" for en-dashes
- # 3 => "--" for em-dashes; "---" for en-dashes
- # See docs for more configuration options.
-
-# Globals:
-$sp_tags_to_skip = '<(/?)(?:pre|code|kbd|script|math)[\s>]';
-
-
-# -- WordPress plugin interface -----------------------------------------------
-/*
-Plugin Name: SmartyPants
-Plugin URI: http://www.michelf.com/projects/php-smartypants/
-Description: SmartyPants is a web publishing utility that translates plain ASCII punctuation characters into &#8220;smart&#8221; typographic punctuation HTML entities. This plugin <strong>replace the default WordPress Texturize algorithm</strong> for the content and the title of your posts, the comments body and author name, and everywhere else Texturize normally apply. Based on the original Perl version by <a href="http://daringfireball.net/">John Gruber</a>.
-Version: 1.5.1e
-Author: Michel Fortin
-Author URI: http://www.michelf.com/
-*/
-if (isset($wp_version)) {
- # Remove default Texturize filter that would conflict with SmartyPants.
- remove_filter('category_description', 'wptexturize');
- remove_filter('list_cats', 'wptexturize');
- remove_filter('comment_author', 'wptexturize');
- remove_filter('comment_text', 'wptexturize');
- remove_filter('single_post_title', 'wptexturize');
- remove_filter('the_title', 'wptexturize');
- remove_filter('the_content', 'wptexturize');
- remove_filter('the_excerpt', 'wptexturize');
- # Add SmartyPants filter with priority 10 (same as Texturize).
- add_filter('category_description', 'SmartyPants', 10);
- add_filter('list_cats', 'SmartyPants', 10);
- add_filter('comment_author', 'SmartyPants', 10);
- add_filter('comment_text', 'SmartyPants', 10);
- add_filter('single_post_title', 'SmartyPants', 10);
- add_filter('the_title', 'SmartyPants', 10);
- add_filter('the_content', 'SmartyPants', 10);
- add_filter('the_excerpt', 'SmartyPants', 10);
-}
-
-# -- Smarty Modifier Interface ------------------------------------------------
-function smarty_modifier_smartypants($text, $attr = NULL) {
- return SmartyPants($text, $attr);
-}
-
-
-
-function SmartyPants($text, $attr = NULL, $ctx = NULL) {
- global $smartypants_attr, $sp_tags_to_skip;
- # Paramaters:
- $text; # text to be parsed
- $attr; # value of the smart_quotes="" attribute
- $ctx; # MT context object (unused)
- if ($attr == NULL) $attr = $smartypants_attr;
-
- # Options to specify which transformations to make:
- $do_stupefy = FALSE;
- $convert_quot = 0; # should we translate &quot; entities into normal quotes?
-
- # Parse attributes:
- # 0 : do nothing
- # 1 : set all
- # 2 : set all, using old school en- and em- dash shortcuts
- # 3 : set all, using inverted old school en and em- dash shortcuts
- #
- # q : quotes
- # b : backtick quotes (``double'' only)
- # B : backtick quotes (``double'' and `single')
- # d : dashes
- # D : old school dashes
- # i : inverted old school dashes
- # e : ellipses
- # w : convert &quot; entities to " for Dreamweaver users
-
- if ($attr == "0") {
- # Do nothing.
- return $text;
- }
- else if ($attr == "1") {
- # Do everything, turn all options on.
- $do_quotes = 1;
- $do_backticks = 1;
- $do_dashes = 1;
- $do_ellipses = 1;
- }
- else if ($attr == "2") {
- # Do everything, turn all options on, use old school dash shorthand.
- $do_quotes = 1;
- $do_backticks = 1;
- $do_dashes = 2;
- $do_ellipses = 1;
- }
- else if ($attr == "3") {
- # Do everything, turn all options on, use inverted old school dash shorthand.
- $do_quotes = 1;
- $do_backticks = 1;
- $do_dashes = 3;
- $do_ellipses = 1;
- }
- else if ($attr == "-1") {
- # Special "stupefy" mode.
- $do_stupefy = 1;
- }
- else {
- $chars = preg_split('//', $attr);
- foreach ($chars as $c){
- if ($c == "q") { $do_quotes = 1; }
- else if ($c == "b") { $do_backticks = 1; }
- else if ($c == "B") { $do_backticks = 2; }
- else if ($c == "d") { $do_dashes = 1; }
- else if ($c == "D") { $do_dashes = 2; }
- else if ($c == "i") { $do_dashes = 3; }
- else if ($c == "e") { $do_ellipses = 1; }
- else if ($c == "w") { $convert_quot = 1; }
- else {
- # Unknown attribute option, ignore.
- }
- }
- }
-
- $tokens = _TokenizeHTML($text);
- $result = '';
- $in_pre = 0; # Keep track of when we're inside <pre> or <code> tags.
-
- $prev_token_last_char = ""; # This is a cheat, used to get some context
- # for one-character tokens that consist of
- # just a quote char. What we do is remember
- # the last character of the previous text
- # token, to use as context to curl single-
- # character quote tokens correctly.
-
- foreach ($tokens as $cur_token) {
- if ($cur_token[0] == "tag") {
- # Don't mess with quotes inside tags.
- $result .= $cur_token[1];
- if (preg_match("@$sp_tags_to_skip@", $cur_token[1], $matches)) {
- $in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
- }
- } else {
- $t = $cur_token[1];
- $last_char = substr($t, -1); # Remember last char of this token before processing.
- if (! $in_pre) {
- $t = ProcessEscapes($t);
-
- if ($convert_quot) {
- $t = preg_replace('/&quot;/', '"', $t);
- }
-
- if ($do_dashes) {
- if ($do_dashes == 1) $t = EducateDashes($t);
- if ($do_dashes == 2) $t = EducateDashesOldSchool($t);
- if ($do_dashes == 3) $t = EducateDashesOldSchoolInverted($t);
- }
-
- if ($do_ellipses) $t = EducateEllipses($t);
-
- # Note: backticks need to be processed before quotes.
- if ($do_backticks) {
- $t = EducateBackticks($t);
- if ($do_backticks == 2) $t = EducateSingleBackticks($t);
- }
-
- if ($do_quotes) {
- if ($t == "'") {
- # Special case: single-character ' token
- if (preg_match('/\S/', $prev_token_last_char)) {
- $t = "&#8217;";
- }
- else {
- $t = "&#8216;";
- }
- }
- else if ($t == '"') {
- # Special case: single-character " token
- if (preg_match('/\S/', $prev_token_last_char)) {
- $t = "&#8221;";
- }
- else {
- $t = "&#8220;";
- }
- }
- else {
- # Normal case:
- $t = EducateQuotes($t);
- }
- }
-
- if ($do_stupefy) $t = StupefyEntities($t);
- }
- $prev_token_last_char = $last_char;
- $result .= $t;
- }
- }
-
- return $result;
-}
-
-
-function SmartQuotes($text, $attr = NULL, $ctx = NULL) {
- global $smartypants_attr, $sp_tags_to_skip;
- # Paramaters:
- $text; # text to be parsed
- $attr; # value of the smart_quotes="" attribute
- $ctx; # MT context object (unused)
- if ($attr == NULL) $attr = $smartypants_attr;
-
- $do_backticks; # should we educate ``backticks'' -style quotes?
-
- if ($attr == 0) {
- # do nothing;
- return $text;
- }
- else if ($attr == 2) {
- # smarten ``backticks'' -style quotes
- $do_backticks = 1;
- }
- else {
- $do_backticks = 0;
- }
-
- # Special case to handle quotes at the very end of $text when preceded by
- # an HTML tag. Add a space to give the quote education algorithm a bit of
- # context, so that it can guess correctly that it's a closing quote:
- $add_extra_space = 0;
- if (preg_match("/>['\"]\\z/", $text)) {
- $add_extra_space = 1; # Remember, so we can trim the extra space later.
- $text .= " ";
- }
-
- $tokens = _TokenizeHTML($text);
- $result = '';
- $in_pre = 0; # Keep track of when we're inside <pre> or <code> tags
-
- $prev_token_last_char = ""; # This is a cheat, used to get some context
- # for one-character tokens that consist of
- # just a quote char. What we do is remember
- # the last character of the previous text
- # token, to use as context to curl single-
- # character quote tokens correctly.
-
- foreach ($tokens as $cur_token) {
- if ($cur_token[0] == "tag") {
- # Don't mess with quotes inside tags
- $result .= $cur_token[1];
- if (preg_match("@$sp_tags_to_skip@", $cur_token[1], $matches)) {
- $in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
- }
- } else {
- $t = $cur_token[1];
- $last_char = substr($t, -1); # Remember last char of this token before processing.
- if (! $in_pre) {
- $t = ProcessEscapes($t);
- if ($do_backticks) {
- $t = EducateBackticks($t);
- }
-
- if ($t == "'") {
- # Special case: single-character ' token
- if (preg_match('/\S/', $prev_token_last_char)) {
- $t = "&#8217;";
- }
- else {
- $t = "&#8216;";
- }
- }
- else if ($t == '"') {
- # Special case: single-character " token
- if (preg_match('/\S/', $prev_token_last_char)) {
- $t = "&#8221;";
- }
- else {
- $t = "&#8220;";
- }
- }
- else {
- # Normal case:
- $t = EducateQuotes($t);
- }
-
- }
- $prev_token_last_char = $last_char;
- $result .= $t;
- }
- }
-
- if ($add_extra_space) {
- preg_replace('/ \z/', '', $result); # Trim trailing space if we added one earlier.
- }
- return $result;
-}
-
-
-function SmartDashes($text, $attr = NULL, $ctx = NULL) {
- global $smartypants_attr, $sp_tags_to_skip;
- # Paramaters:
- $text; # text to be parsed
- $attr; # value of the smart_dashes="" attribute
- $ctx; # MT context object (unused)
- if ($attr == NULL) $attr = $smartypants_attr;
-
- # reference to the subroutine to use for dash education, default to EducateDashes:
- $dash_sub_ref = 'EducateDashes';
-
- if ($attr == 0) {
- # do nothing;
- return $text;
- }
- else if ($attr == 2) {
- # use old smart dash shortcuts, "--" for en, "---" for em
- $dash_sub_ref = 'EducateDashesOldSchool';
- }
- else if ($attr == 3) {
- # inverse of 2, "--" for em, "---" for en
- $dash_sub_ref = 'EducateDashesOldSchoolInverted';
- }
-
- $tokens;
- $tokens = _TokenizeHTML($text);
-
- $result = '';
- $in_pre = 0; # Keep track of when we're inside <pre> or <code> tags
- foreach ($tokens as $cur_token) {
- if ($cur_token[0] == "tag") {
- # Don't mess with quotes inside tags
- $result .= $cur_token[1];
- if (preg_match("@$sp_tags_to_skip@", $cur_token[1], $matches)) {
- $in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
- }
- } else {
- $t = $cur_token[1];
- if (! $in_pre) {
- $t = ProcessEscapes($t);
- $t = $dash_sub_ref($t);
- }
- $result .= $t;
- }
- }
- return $result;
-}
-
-
-function SmartEllipses($text, $attr = NULL, $ctx = NULL) {
- # Paramaters:
- $text; # text to be parsed
- $attr; # value of the smart_ellipses="" attribute
- $ctx; # MT context object (unused)
- if ($attr == NULL) $attr = $smartypants_attr;
-
- if ($attr == 0) {
- # do nothing;
- return $text;
- }
-
- $tokens;
- $tokens = _TokenizeHTML($text);
-
- $result = '';
- $in_pre = 0; # Keep track of when we're inside <pre> or <code> tags
- foreach ($tokens as $cur_token) {
- if ($cur_token[0] == "tag") {
- # Don't mess with quotes inside tags
- $result .= $cur_token[1];
- if (preg_match("@$sp_tags_to_skip@", $cur_token[1], $matches)) {
- $in_pre = isset($matches[1]) && $matches[1] == '/' ? 0 : 1;
- }
- } else {
- $t = $cur_token[1];
- if (! $in_pre) {
- $t = ProcessEscapes($t);
- $t = EducateEllipses($t);
- }
- $result .= $t;
- }
- }
- return $result;
-}
-
-
-function EducateQuotes($_) {
-#
-# Parameter: String.
-#
-# Returns: The string, with "educated" curly quote HTML entities.
-#
-# Example input: "Isn't this fun?"
-# Example output: &#8220;Isn&#8217;t this fun?&#8221;
-#
- # Make our own "punctuation" character class, because the POSIX-style
- # [:PUNCT:] is only available in Perl 5.6 or later:
- $punct_class = "[!\"#\\$\\%'()*+,-.\\/:;<=>?\\@\\[\\\\\]\\^_`{|}~]";
-
- # Special case if the very first character is a quote
- # followed by punctuation at a non-word-break. Close the quotes by brute force:
- $_ = preg_replace(
- array("/^'(?=$punct_class\\B)/", "/^\"(?=$punct_class\\B)/"),
- array('&#8217;', '&#8221;'), $_);
-
-
- # Special case for double sets of quotes, e.g.:
- # <p>He said, "'Quoted' words in a larger quote."</p>
- $_ = preg_replace(
- array("/\"'(?=\w)/", "/'\"(?=\w)/"),
- array('&#8220;&#8216;', '&#8216;&#8220;'), $_);
-
- # Special case for decade abbreviations (the '80s):
- $_ = preg_replace("/'(?=\\d{2}s)/", '&#8217;', $_);
-
- $close_class = '[^\ \t\r\n\[\{\(\-]';
- $dec_dashes = '&\#8211;|&\#8212;';
-
- # Get most opening single quotes:
- $_ = preg_replace("{
- (
- \\s | # a whitespace char, or
- &nbsp; | # a non-breaking space entity, or
- -- | # dashes, or
- &[mn]dash; | # named dash entities
- $dec_dashes | # or decimal entities
- &\\#x201[34]; # or hex
- )
- ' # the quote
- (?=\\w) # followed by a word character
- }x", '\1&#8216;', $_);
- # Single closing quotes:
- $_ = preg_replace("{
- ($close_class)?
- '
- (?(1)| # If $1 captured, then do nothing;
- (?=\\s | s\\b) # otherwise, positive lookahead for a whitespace
- ) # char or an 's' at a word ending position. This
- # is a special case to handle something like:
- # \"<i>Custer</i>'s Last Stand.\"
- }xi", '\1&#8217;', $_);
-
- # Any remaining single quotes should be opening ones:
- $_ = str_replace("'", '&#8216;', $_);
-
-
- # Get most opening double quotes:
- $_ = preg_replace("{
- (
- \\s | # a whitespace char, or
- &nbsp; | # a non-breaking space entity, or
- -- | # dashes, or
- &[mn]dash; | # named dash entities
- $dec_dashes | # or decimal entities
- &\\#x201[34]; # or hex
- )
- \" # the quote
- (?=\\w) # followed by a word character
- }x", '\1&#8220;', $_);
-
- # Double closing quotes:
- $_ = preg_replace("{
- ($close_class)?
- \"
- (?(1)|(?=\\s)) # If $1 captured, then do nothing;
- # if not, then make sure the next char is whitespace.
- }x", '\1&#8221;', $_);
-
- # Any remaining quotes should be opening ones.
- $_ = str_replace('"', '&#8220;', $_);
-
- return $_;
-}
-
-
-function EducateBackticks($_) {
-#
-# Parameter: String.
-# Returns: The string, with ``backticks'' -style double quotes
-# translated into HTML curly quote entities.
-#
-# Example input: ``Isn't this fun?''
-# Example output: &#8220;Isn't this fun?&#8221;
-#
-
- $_ = str_replace(array("``", "''",),
- array('&#8220;', '&#8221;'), $_);
- return $_;
-}
-
-
-function EducateSingleBackticks($_) {
-#
-# Parameter: String.
-# Returns: The string, with `backticks' -style single quotes
-# translated into HTML curly quote entities.
-#
-# Example input: `Isn't this fun?'
-# Example output: &#8216;Isn&#8217;t this fun?&#8217;
-#
-
- $_ = str_replace(array("`", "'",),
- array('&#8216;', '&#8217;'), $_);
- return $_;
-}
-
-
-function EducateDashes($_) {
-#
-# Parameter: String.
-#
-# Returns: The string, with each instance of "--" translated to
-# an em-dash HTML entity.
-#
-
- $_ = str_replace('--', '&#8212;', $_);
- return $_;
-}
-
-
-function EducateDashesOldSchool($_) {
-#
-# Parameter: String.
-#
-# Returns: The string, with each instance of "--" translated to
-# an en-dash HTML entity, and each "---" translated to
-# an em-dash HTML entity.
-#
-
- # em en
- $_ = str_replace(array("---", "--",),
- array('&#8212;', '&#8211;'), $_);
- return $_;
-}
-
-
-function EducateDashesOldSchoolInverted($_) {
-#
-# Parameter: String.
-#
-# Returns: The string, with each instance of "--" translated to
-# an em-dash HTML entity, and each "---" translated to
-# an en-dash HTML entity. Two reasons why: First, unlike the
-# en- and em-dash syntax supported by
-# EducateDashesOldSchool(), it's compatible with existing
-# entries written before SmartyPants 1.1, back when "--" was
-# only used for em-dashes. Second, em-dashes are more
-# common than en-dashes, and so it sort of makes sense that
-# the shortcut should be shorter to type. (Thanks to Aaron
-# Swartz for the idea.)
-#
-
- # en em
- $_ = str_replace(array("---", "--",),
- array('&#8211;', '&#8212;'), $_);
- return $_;
-}
-
-
-function EducateEllipses($_) {
-#
-# Parameter: String.
-# Returns: The string, with each instance of "..." translated to
-# an ellipsis HTML entity. Also converts the case where
-# there are spaces between the dots.
-#
-# Example input: Huh...?
-# Example output: Huh&#8230;?
-#
-
- $_ = str_replace(array("...", ". . .",), '&#8230;', $_);
- return $_;
-}
-
-
-function StupefyEntities($_) {
-#
-# Parameter: String.
-# Returns: The string, with each SmartyPants HTML entity translated to
-# its ASCII counterpart.
-#
-# Example input: &#8220;Hello &#8212; world.&#8221;
-# Example output: "Hello -- world."
-#
-
- # en-dash em-dash
- $_ = str_replace(array('&#8211;', '&#8212;'),
- array('-', '--'), $_);
-
- # single quote open close
- $_ = str_replace(array('&#8216;', '&#8217;'), "'", $_);
-
- # double quote open close
- $_ = str_replace(array('&#8220;', '&#8221;'), '"', $_);
-
- $_ = str_replace('&#8230;', '...', $_); # ellipsis
-
- return $_;
-}
-
-
-function ProcessEscapes($_) {
-#
-# Parameter: String.
-# Returns: The string, with after processing the following backslash
-# escape sequences. This is useful if you want to force a "dumb"
-# quote or other character to appear.
-#
-# Escape Value
-# ------ -----
-# \\ &#92;
-# \" &#34;
-# \' &#39;
-# \. &#46;
-# \- &#45;
-# \` &#96;
-#
- $_ = str_replace(
- array('\\\\', '\"', "\'", '\.', '\-', '\`'),
- array('&#92;', '&#34;', '&#39;', '&#46;', '&#45;', '&#96;'), $_);
-
- return $_;
-}
-
-
-# _TokenizeHTML is shared between PHP SmartyPants and PHP Markdown.
-# We only define it if it is not already defined.
-if (!function_exists('_TokenizeHTML')) :
-function _TokenizeHTML($str) {
-#
-# Parameter: String containing HTML markup.
-# Returns: An array of the tokens comprising the input
-# string. Each token is either a tag (possibly with nested,
-# tags contained therein, such as <a href="<MTFoo>">, or a
-# run of text between tags. Each element of the array is a
-# two-element array; the first is either 'tag' or 'text';
-# the second is the actual value.
-#
-#
-# Regular expression derived from the _tokenize() subroutine in
-# Brad Choate's MTRegex plugin.
-# <http://www.bradchoate.com/past/mtregex.php>
-#
- $index = 0;
- $tokens = array();
-
- $match = '(?s:<!(?:--.*?--\s*)+>)|'. # comment
- '(?s:<\?.*?\?>)|'. # processing instruction
- # regular tags
- '(?:<[/!$]?[-a-zA-Z0-9:]+\b(?>[^"\'>]+|"[^"]*"|\'[^\']*\')*>)';
-
- $parts = preg_split("{($match)}", $str, -1, PREG_SPLIT_DELIM_CAPTURE);
-
- foreach ($parts as $part) {
- if (++$index % 2 && $part != '')
- $tokens[] = array('text', $part);
- else
- $tokens[] = array('tag', $part);
- }
- return $tokens;
-}
-endif;
-
-
-/*
-
-PHP SmartyPants
-===============
-
-Description
------------
-
-This is a PHP translation of the original SmartyPants quote educator written in
-Perl by John Gruber.
-
-SmartyPants is a web publishing utility that translates plain ASCII
-punctuation characters into "smart" typographic punctuation HTML
-entities. SmartyPants can perform the following transformations:
-
-* Straight quotes (`"` and `'`) into "curly" quote HTML entities
-* Backticks-style quotes (` ``like this'' `) into "curly" quote HTML
- entities
-* Dashes (`--` and `---`) into en- and em-dash entities
-* Three consecutive dots (`...`) into an ellipsis entity
-
-SmartyPants does not modify characters within `<pre>`, `<code>`, `<kbd>`,
-`<script>`, or `<math>` tag blocks. Typically, these tags are used to
-display text where smart quotes and other "smart punctuation" would not
-be appropriate, such as source code or example markup.
-
-
-### Backslash Escapes ###
-
-If you need to use literal straight quotes (or plain hyphens and
-periods), SmartyPants accepts the following backslash escape sequences
-to force non-smart punctuation. It does so by transforming the escape
-sequence into a decimal-encoded HTML entity:
-
- Escape Value Character
- ------ ----- ---------
- \\ &#92; \
- \" &#34; "
- \' &#39; '
- \. &#46; .
- \- &#45; -
- \` &#96; `
-
-This is useful, for example, when you want to use straight quotes as
-foot and inch marks: 6'2" tall; a 17" iMac.
-
-
-Bugs
-----
-
-To file bug reports or feature requests (other than topics listed in the
-Caveats section above) please send email to:
-
-<michel.fortin@michelf.com>
-
-If the bug involves quotes being curled the wrong way, please send example
-text to illustrate.
-
-
-### Algorithmic Shortcomings ###
-
-One situation in which quotes will get curled the wrong way is when
-apostrophes are used at the start of leading contractions. For example:
-
- 'Twas the night before Christmas.
-
-In the case above, SmartyPants will turn the apostrophe into an opening
-single-quote, when in fact it should be a closing one. I don't think
-this problem can be solved in the general case -- every word processor
-I've tried gets this wrong as well. In such cases, it's best to use the
-proper HTML entity for closing single-quotes (`&#8217;`) by hand.
-
-
-Version History
----------------
-
-1.5.1e (9 Dec 2005)
-
-* Corrected a bug that prevented special characters from being
- escaped.
-
-
-1.5.1d (25 May 2005)
-
-* Corrected a small bug in `_TokenizeHTML` where a Doctype declaration
- was not seen as HTML (smart quotes where applied inside).
-
-
-1.5.1c (13 Dec 2004)
-
-* Changed a regular expression in `_TokenizeHTML` that could lead to
- a segmentation fault with PHP 4.3.8 on Linux.
-
-
-1.5.1b (6 Sep 2004)
-
-* Corrected a problem with quotes immediately following a dash
- with no space between: `Text--"quoted text"--text.`
-
-* PHP SmartyPants can now be used as a modifier by the Smarty
- template engine. Rename the file to "modifier.smartypants.php"
- and put it in your smarty plugins folder.
-
-* Replaced a lot of space characters by tabs, saving about 4 KB.
-
-
-1.5.1a (30 Jun 2004)
-
-* PHP Markdown and PHP Smartypants now share the same `_TokenizeHTML`
- function when loaded simultanously.
-
-* Changed the internals of `_TokenizeHTML` to lower the PHP version
- requirement to PHP 4.0.5.
-
-
-1.5.1 (6 Jun 2004)
-
-* Initial release of PHP SmartyPants, based on version 1.5.1 of the
- original SmartyPants written in Perl.
-
-
-Author
-------
-
-John Gruber
-<http://daringfireball.net/>
-
-Ported to PHP by Michel Fortin
-<http://www.michelf.com/>
-
-
-Additional Credits
-------------------
-
-Portions of this plug-in are based on Brad Choate's nifty MTRegex plug-in.
-Brad Choate also contributed a few bits of source code to this plug-in.
-Brad Choate is a fine hacker indeed. (<http://bradchoate.com/>)
-
-Jeremy Hedley (<http://antipixel.com/>) and Charles Wiltgen
-(<http://playbacktime.com/>) deserve mention for exemplary beta testing.
-
-
-Copyright and License
----------------------
-
-Copyright (c) 2003 John Gruber
-<http://daringfireball.net/>
-All rights reserved.
-
-Copyright (c) 2004-2005 Michel Fortin
-<http://www.michelf.com>
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name "SmartyPants" nor the names of its contributors may
- be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-This software is provided by the copyright holders and contributors "as is"
-and any express or implied warranties, including, but not limited to, the
-implied warranties of merchantability and fitness for a particular purpose
-are disclaimed. In no event shall the copyright owner or contributors be
-liable for any direct, indirect, incidental, special, exemplary, or
-consequential damages (including, but not limited to, procurement of
-substitute goods or services; loss of use, data, or profits; or business
-interruption) however caused and on any theory of liability, whether in
-contract, strict liability, or tort (including negligence or otherwise)
-arising in any way out of the use of this software, even if advised of the
-possibility of such damage.
-
-*/
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/contrib/aliased.php b/libvpx/examples/includes/geshi/contrib/aliased.php
deleted file mode 100644
index 4680ffb..0000000
--- a/libvpx/examples/includes/geshi/contrib/aliased.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-
-/**
- * Another GeSHi example script
- *
- * Configure your Apache server with 'AcceptPathInfo true' and something like
- * 'Alias /viewmysource /var/www/geshi/contrib/aliased.php'. Don't forget
- * to protect this alias as necessary.
- *
- * Usage - visit /viewmysource/file.name.ext to see that file with syntax
- * highlighting, where "viewmysource" is the name of the alias you set up.
- * You can use this without an alias too, just by visiting
- * aliased.php/file.name.ext.
- *
- * @author Ross Golder <ross@golder.org>
- * @version $Id: aliased.php 785 2006-07-19 10:09:45Z oracleshinoda $
- */
-
-// Your config here
-define("SOURCE_ROOT", "/var/www/your/source/root/");
-
-// Assume you've put geshi in the include_path already
-require_once("geshi.php");
-
-// Get path info
-$path = SOURCE_ROOT.$_SERVER['PATH_INFO'];
-
-// Check for dickheads trying to use '../' to get to sensitive areas
-$base_path_len = strlen(SOURCE_ROOT);
-$real_path = realpath($path);
-if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) {
- exit("Stop that.");
-}
-
-// Check file exists
-if(!file_exists($path)) {
- exit("File not found ($path).");
-}
-
-// Gather contents
-$contents = file_get_contents($path);
-
-// Prepare GeSHi instance
-$geshi =& new GeSHi($contents, "PHP");
-$geshi->set_header_type(GESHI_HEADER_PRE);
-$geshi->enable_classes();
-$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10);
-$geshi->set_overall_style('color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', true);
-$geshi->set_line_style('font: normal normal 95% \'Courier New\', Courier, monospace; color: #003030;', 'font-weight: bold; color: #006060;', true);
-$geshi->set_code_style('color: #000020;', 'color: #000020;');
-$geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
-$geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
-$geshi->set_header_content('Source code viewer');
-$geshi->set_header_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
-$geshi->set_footer_content('Parsed in <TIME> seconds, using GeSHi <VERSION>');
-$geshi->set_footer_content_style('font-family: Verdana, Arial, sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>Source code viewer - <?php echo $path; ?></title>
- <style type="text/css">
- <!--
- <?php
- // Output the stylesheet. Note it doesn't output the <style> tag
- echo $geshi->get_stylesheet();
- ?>
- html {
- background-color: #f0f0f0;
- }
- body {
- font-family: Verdana, Arial, sans-serif;
- margin: 10px;
- border: 2px solid #e0e0e0;
- background-color: #fcfcfc;
- padding: 5px;
- }
- h2 {
- margin: .1em 0 .2em .5em;
- border-bottom: 1px solid #b0b0b0;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 150%;
- }
- h3 {
- margin: .1em 0 .2em .5em;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 120%;
- }
- #footer {
- text-align: center;
- font-size: 80%;
- color: #a9a9a9;
- }
- #footer a {
- color: #9999ff;
- }
- textarea {
- border: 1px solid #b0b0b0;
- font-size: 90%;
- color: #333;
- margin-left: 20px;
- }
- select, input {
- margin-left: 20px;
- }
- p {
- font-size: 90%;
- margin-left: .5em;
- }
- -->
- </style>
-</head>
-<body>
-<?php
-// The fun part :)
-echo $geshi->parse_code();
-?>
-<hr/>
-</body>
-</html>
diff --git a/libvpx/examples/includes/geshi/contrib/cssgen.php b/libvpx/examples/includes/geshi/contrib/cssgen.php
deleted file mode 100644
index b75edc8..0000000
--- a/libvpx/examples/includes/geshi/contrib/cssgen.php
+++ /dev/null
@@ -1,456 +0,0 @@
-<?php
-/*************************************************************************************
- * cssgen.php
- * ----------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie
- * Release Version: 1.0.8.1
- * Date Started: 2004/05/20
- *
- * Application to generate custom CSS files for GeSHi (based on an idea by Andreas
- * Gohr)
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-set_magic_quotes_runtime(0);
-//
-// Functions
-//
-
-function make_header ( $title )
-{
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>GeSHi CSS Generator :: ' . $title . ' </title>
- <style type="text/css" media="screen">
- <!--
- html {
- font-family: Verdana, Arial, sans-serif;
- font-size: 80%;
- background-color: #d0d0d0;
- }
- body {
- margin: 10px;
- padding: 5px;
- border: 1px solid #f0f0f0;
- background-color: #f6f6f6;
- }
- h1 {
- border-bottom: 2px solid #e0e0e0;
- font-weight: normal;
- font-size: 150%;
- color: #c0c0c0;
- }
- input, textarea {
- border: 1px solid #d0d0d0;
- }
- th {
- text-align: right;
- font-weight: normal;
- }
- pre {
- font-size: 110%;
- color: #202020;
- }
- #footer {
- color: #b0b0b0;
- text-align: center;
- font-size: 90%;
- margin: 0 auto;
- border-top: 1px solid #e0e0e0;
- }
- #footer a {
- color: #c0c0c0;
- }
- -->
- </style>
- <script type="text/javascript">
- function select (state)
- {
- var cboxes = document.getElementsByTagName(\'input\');
- for (var i = 0; i < cboxes.length; i++) {
- if (cboxes[i].type == "checkbox") {
- if (state == "true") {
- cboxes[i].checked = true;
- } else if (state == "false") {
- cboxes[i].checked = false;
- } else if (state == "invert") {
- cboxes[i].checked = !cboxes[i].checked;
- }
- }
- }
- }
- </script>
-</head>
-<body>
-<h1>' . $title . '</h1>
-';
-}
-
-function make_footer ()
-{
- echo '<div id="footer"><a href="http://qbnz.com/highlighter/">GeSHi</a> &copy; Nigel McNie, 2004, released under the GPL</div></body>
-</html>';
-}
-
-
-function get_var ( $var_name )
-{
- if ( isset($_GET[$var_name]) )
- {
- return str_replace("\'", "'", $_GET[$var_name]);
- }
- elseif ( isset($_POST[$var_name]) )
- {
- return str_replace("\'", "'", $_POST[$var_name]);
- }
- return null;
-}
-
-
-
-//
-// Unset everything
-//
-foreach ( $_REQUEST as $var )
-{
- unset($$var);
-}
-foreach ( array(
- '_POST' => 'HTTP_POST_VARS',
- '_GET' => 'HTTP_GET_VARS',
- '_COOKIE' => 'HTTP_COOKIE_VARS',
- '_SERVER' => 'HTTP_SERVER_VARS',
- '_ENV' => 'HTTP_ENV_VARS',
- '_FILES' => 'HTTP_POST_FILES') as $array => $other )
-{
- if ( !isset($$array) )
- {
- $$array = $$other;
- }
- unset($$other);
-}
-
-
-// Get what step we're up to
-$step = get_var('step');
-
-if ( !$step || $step == 1 )
-{
- $errors = 0;
- make_header('Step 1');
- echo "Welcome to the GeSHi CSS generator.<br /><pre>Searching for GeSHi... ";
-
- // Find GeSHi
- $geshi_path = get_var('geshi-path');
- $geshi_lang_path = get_var('geshi-lang-path');
-
- if ( !$geshi_path )
- {
- $geshi_path = '../geshi.php';
- }
- if ( !$geshi_lang_path )
- {
- $geshi_lang_path = '../geshi/';
- }
-
-
- if ( is_file($geshi_path) && is_readable($geshi_path) )
- {
- // Get file contents and see if GeSHi is in here
- $file = @file($geshi_path);
- $contents = '';
- foreach ( $file as $line )
- {
- $contents .= $line;
- }
- if ( strpos($contents, '<?php
-/**
- * GeSHi - Generic Syntax Highlighter') !== false )
- {
- echo '<span style="color: green;">Found at ' . realpath($geshi_path) . '</span>';
- }
- else
- {
- ++$errors;
- $no_geshi_dot_php_error = true;
- echo '<span style="color: red;">Not found</span>';
- }
- }
- else
- {
- ++$errors;
- $no_geshi_dot_php_error = true;
- echo '<span style="color: red;">Not found</span>';
- }
-
- // Find language files
- echo "\nSearching for language files... ";
- if ( is_readable($geshi_lang_path . 'css-gen.cfg') )
- {
-
- echo '<span style="color: green;">Found at ' . realpath($geshi_lang_path) . '</span>';
- }
- else
- {
- ++$errors;
- $no_lang_dir_error = true;
- echo '<span style="color: red;">Not found</span>';
- }
- echo "</pre>\n";
-
- if ( $errors > 0 )
- {
- // We're gonna have to ask for the paths...
- echo 'Unfortunately CSSGen could not detect the following paths. Please input them and press &quot;submit&quot; to try again.';
- echo "
-<form action=\"cssgen.php\" method=\"post\">";
- if ( $no_geshi_dot_php_error )
- {
- echo "
-<br />geshi.php: <input type=\"text\" name=\"geshi-path\" value=\"" . realpath('../geshi.php') . "\" size=\"50\" />";
- }
- else
- {
- echo '<input type="hidden" name="geshi-path" value="' . htmlspecialchars($geshi_path) . '" />';
- }
- if ( $no_lang_dir_error )
- {
- echo "
-<br />language files directory: <input type=\"text\" name=\"geshi-lang-path\" value=\"" . realpath('../geshi/') . "/\" size=\"50\" /> (should have a trailing slash)";
- }
- else
- {
- echo '<input type="hidden" name="geshi-lang-path" value="' . $geshi_lang_path . '" />';
- }
-
- echo "
-<br /><input type=\"submit\" value=\"Search\" /></form>";
- }
- else
- {
- // no errors - echo continue form
- echo 'Everything seems to be detected successfully. Use the button to continue.
-<br /><br /><form action="cssgen.php?step=2" method="post">
-<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
-<input type="submit" value="Step 2" />';
- }
-
- make_footer();
-}
-// Step 2
-elseif ( $step == 2 )
-{
- make_header('Step 2');
-
- $geshi_path = get_var('geshi-path');
- $geshi_lang_path = get_var('geshi-lang-path');
-
- $dh = opendir($geshi_lang_path);
- $lang_files = array();
- $file = readdir($dh);
- while ( $file !== false )
- {
- if ( $file == '.' || $file == '..' || $file == 'CVS' || $file == 'css-gen.cfg' )
- {
- $file = readdir($dh);
- continue;
- }
- $lang_files[] = $file;
- $file = readdir($dh);
- }
- closedir($dh);
- sort($lang_files);
-
- // Now installed languages are in $lang_files
-
- echo '<form action="cssgen.php?step=3" method="post" id="step2">
-What languages are you wanting to make this stylesheet for?<br /><br />
-Detected languages:<br />';
-
- foreach ( $lang_files as $lang )
- {
- $lang = substr($lang, 0, strpos($lang, '.'));
- if ($lang) {
- echo "<input type=\"checkbox\" name=\"langs[$lang]\" checked=\"checked\" />&nbsp;$lang<br />\n";
- }
- }
-
- echo "Select: <a href=\"javascript:select('true')\">All</a>, <a href=\"javascript:select('false')\">None</a>, <a href=\"javascript:select('invert')\">Invert</a><br />\n";
-
- echo 'If you\'d like any other languages not detected here to be supported, please enter
-them here, one per line:<br /><textarea rows="4" cols="20" name="extra-langs"></textarea><br />
-';
-
- echo '<br />Styles:
-<table>
- <tr><th>Style for the overall code block:</th><td><input type="text" name="overall" value="border: 1px dotted #a0a0a0; font-family: \'Courier New\', Courier, monospace; background-color: #f0f0f0; color: #0000bb;" /></td></tr>
- <tr><th>Default Styles</th><td><input type="text" name="default-styles" value="font-weight:normal;background:transparent;color:#000; padding-left: 5px;" /></td></tr>
- <tr><th>Keywords I (if, do, while etc)</th><td><input type="text" name="keywords-1" value="color: #a1a100;" /></td></tr>
- <tr><th>Keywords II (null, true, false etc)</th><td><input type="text" name="keywords-2" value="color: #000; font-weight: bold;" /></td></tr>
- <tr><th>Inbuilt Functions (echo, print etc)</th><td><input type="text" name="keywords-3" value="color: #000066;" /></td></tr>
- <tr><th>Data Types (int, boolean etc)</th><td><input type="text" name="keywords-4" value="color: #f63333;" /></td></tr>
-
- <tr><th>Comments (//, <!-- --> etc)</th><td><input type="text" name="comments" value="color: #808080;" /></td></tr>
- <tr><th>Escaped Characters (\n, \t etc)</th><td><input type="text" name="escaped-chars" value="color: #000033; font-weight: bold;" /></td></tr>
- <tr><th>Brackets ( ([{}]) etc)</th><td><input type="text" name="brackets" value="color: #66cc66;" /></td></tr>
- <tr><th>Strings ("foo" etc)</th><td><input type="text" name="strings" value="color: #ff0000;" /></td></tr>
- <tr><th>Numbers (1, -54, 2.5 etc)</th><td><input type="text" name="numbers" value="color: #ff33ff;" /></td></tr>
- <tr><th>Methods (Foo.bar() etc)</th><td><input type="text" name="methods" value="color: #006600;" /></td></tr>
-</table>';
-
- echo '<input type="hidden" name="geshi-path" value="' . realpath($geshi_path) . '" /><input type="hidden" name="geshi-lang-path" value="' . realpath($geshi_lang_path) . '" />
-<input type="submit" value="Step 3" /></form>';
-
- make_footer();
-}
-// Step 3
-elseif ( $step == 3 )
-{
- make_header('Step 3');
- echo '<p>Here is your completed stylesheet. Note that it may not be perfect - no regular expression styles are included for one thing,
-you\'ll have to add those yourself (php and xml are just two languages that use them), and line numbers are not included, however
-it includes most of the basic information.</p>';
-
- // Make the stylesheet
- $part_selector_1 = '';
- $part_selector_2 = '';
- $part_selector_3 = '';
-
- $langs = get_var('langs');
- $extra_langs = trim(get_var('extra-langs'));
- if ( $extra_langs != '' )
- {
- $l = explode("\r\n", $extra_langs);
- foreach ( $l as $lng )
- {
- $langs[$lng] = true;
- }
- }
-
-
- foreach ( $langs as $lang => $dummy )
- {
- $part_selector_1 .= ".$lang {PART}, ";
- $part_selector_2 .= ".$lang {PART1}, .$lang {PART2}, ";
- $part_selector_3 .= ".$lang {PART1}, .$lang {PART2}, .$lang {PART3}, ";
- }
- $part_selector_1 = substr($part_selector_1, 0, -2);
- $part_selector_2 = substr($part_selector_2, 0, -2);
- $part_selector_3 = substr($part_selector_3, 0, -2);
-
-
- $default_styles = get_var('default-styles');
- $ol_selector = str_replace('{PART}', 'ol', $part_selector_1);
- $overall_styles = get_var('overall');
- $overall_selector = str_replace('{PART}', '', $part_selector_1);
-
- $stylesheet = "/* GeSHi (c) Nigel McNie 2004 (http://qbnz.com/highlighter) */";
-
- if ( $overall != '' )
- {
- $stylesheet .= "\n$overall_selector {{$overall_styles}}";
- }
- if ( $default_styles != '' )
- {
- $default_selector = str_replace(array('{PART1}', '{PART2}'), array('.de1', '.de2'), $part_selector_2);
- $stylesheet .= "\n$default_selector {{$default_styles}}";
- }
-
- // Do keywords
- $keywords_1 = get_var('keywords-1');
- $keyword_selector_1 = str_replace('{PART}', '.kw1', $part_selector_1);
- if ( $keywords_1 != '' )
- {
- $stylesheet .= "\n$keyword_selector_1 {{$keywords_1}}";
- }
-
- $keywords_2 = get_var('keywords-2');
- $keyword_selector_2 = str_replace('{PART}', '.kw2', $part_selector_1);
- if ( $keywords_2 != '' )
- {
- $stylesheet .= "\n$keyword_selector_2 {{$keywords_2}}";
- }
-
- $keywords_3 = get_var('keywords-3');
- $keyword_selector_3 = str_replace('{PART}', '.kw3', $part_selector_1);
- if ( $keywords_3 != '' )
- {
- $stylesheet .= "\n$keyword_selector_3 {{$keywords_3}}";
- }
-
- $keywords_4 = get_var('keywords-4');
- $keyword_selector_4 = str_replace('{PART}', '.kw4', $part_selector_1);
- if ( $keywords_4 != '' )
- {
- $stylesheet .= "\n$keyword_selector_4 {{$keywords_4}}";
- }
-
- // Do other lexics
- $comments = get_var('comments');
- $comment_selector = str_replace(array('{PART1}', '{PART2}', '{PART3}'), array('.co1', '.co2', '.coMULTI'), $part_selector_3);
- if ( $comments != '' )
- {
- $stylesheet .= "\n$comment_selector {{$comments}}";
- }
-
- $esc = get_var('escaped-chars');
- $esc_selector = str_replace('{PART}', '.es0', $part_selector_1);
- if ( $esc != '' )
- {
- $stylesheet .= "\n$esc_selector {{$esc}}";
- }
-
- $brackets = get_var('brackets');
- $brk_selector = str_replace('{PART}', '.br0', $part_selector_1);
- if ( $brackets != '' )
- {
- $stylesheet .= "\n$brk_selector {{$brackets}}";
- }
-
- $strings = get_var('strings');
- $string_selector = str_replace('{PART}', '.st0', $part_selector_1);
- if ( $strings != '' )
- {
- $stylesheet .= "\n$string_selector {{$strings}}";
- }
-
- $numbers = get_var('numbers');
- $num_selector = str_replace('{PART}', '.nu0', $part_selector_1);
- if ( $numbers != '' )
- {
- $stylesheet .= "\n$num_selector {{$numbers}}";
- }
-
- $methods = get_var('methods');
- $method_selector = str_replace('{PART}', '.me0', $part_selector_1);
- if ( $methods != '' )
- {
- $stylesheet .= "\n$method_selector {{$methods}}";
- }
-
- echo "<pre>$stylesheet</pre>";
-
- make_footer();
-}
-
-?>
diff --git a/libvpx/examples/includes/geshi/contrib/cssgen2.php b/libvpx/examples/includes/geshi/contrib/cssgen2.php
deleted file mode 100644
index cc3c39c..0000000
--- a/libvpx/examples/includes/geshi/contrib/cssgen2.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/**
- * A simple script which outputs the CSS classes for all languages
- * supported by GeSHi. You can access it directly to download
- * the CSS file. On *NIX you can also do a simple `php cssgen.php > geshi.css`.
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package geshi
- * @subpackage contrib
- * @author revulo <revulon@gmail.com>
- * @copyright 2008 revulo
- * @license http://gnu.org/copyleft/gpl.html GNU GPL
- *
- */
-
-require dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'geshi.php';
-$geshi = new GeSHi;
-
-$languages = array();
-if ($handle = opendir($geshi->language_path)) {
- while (($file = readdir($handle)) !== false) {
- $pos = strpos($file, '.');
- if ($pos > 0 && substr($file, $pos) == '.php') {
- $languages[] = substr($file, 0, $pos);
- }
- }
- closedir($handle);
-}
-sort($languages);
-
-header('Content-Type: application/octet-stream');
-header('Content-Disposition: attachment; filename="geshi.css"');
-
-echo "/**\n".
- " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
- " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
- " */\n";
-
-foreach ($languages as $language) {
- $geshi->set_language($language);
- // note: the false argument is required for stylesheet generators, see API documentation
- $css = $geshi->get_stylesheet(false);
- echo preg_replace('/^\/\*\*.*?\*\//s', '', $css);
-}
diff --git a/libvpx/examples/includes/geshi/contrib/example.php b/libvpx/examples/includes/geshi/contrib/example.php
deleted file mode 100644
index 32e6f0c..0000000
--- a/libvpx/examples/includes/geshi/contrib/example.php
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/**
- * GeSHi example script
- *
- * Just point your browser at this script (with geshi.php in the parent directory,
- * and the language files in subdirectory "../geshi/")
- *
- * @author Nigel McNie
- * @version $Id: example.php 1512 2008-07-21 21:05:40Z benbe $
- */
-header('Content-Type: text/html; charset=utf-8');
-
-error_reporting(E_ALL);
-
-// Rudimentary checking of where GeSHi is. In a default install it will be in ../, but
-// it could be in the current directory if the include_path is set. There's nowhere else
-// we can reasonably guess.
-if (is_readable('../geshi.php')) {
- $path = '../';
-} elseif (is_readable('geshi.php')) {
- $path = './';
-} else {
- die('Could not find geshi.php - make sure it is in your include path!');
-}
-require $path . 'geshi.php';
-
-$fill_source = false;
-if (isset($_POST['submit'])) {
- if (get_magic_quotes_gpc()) {
- $_POST['source'] = stripslashes($_POST['source']);
- }
- if (!strlen(trim($_POST['source']))) {
- $_POST['language'] = preg_replace('#[^a-zA-Z0-9\-_]#', '', $_POST['language']);
- $_POST['source'] = implode('', @file($path . 'geshi/' . $_POST['language'] . '.php'));
- $_POST['language'] = 'php';
- } else {
- $fill_source = true;
- }
-
- // Here's a free demo of how GeSHi works.
-
- // First the initialisation: source code to highlight and the language to use. Make sure
- // you sanitise correctly if you use $_POST of course - this very script has had a security
- // advisory against it in the past because of this. Please try not to use this script on a
- // live site.
- $geshi = new GeSHi($_POST['source'], $_POST['language']);
-
- // Use the PRE_VALID header. This means less output source since we don't have to output &nbsp;
- // everywhere. Of course it also means you can't set the tab width.
- // HEADER_PRE_VALID puts the <pre> tag inside the list items (<li>) thus producing valid HTML markup.
- // HEADER_PRE puts the <pre> tag around the list (<ol>) which is invalid in HTML 4 and XHTML 1
- // HEADER_DIV puts a <div> tag arount the list (valid!) but needs to replace whitespaces with &nbsp
- // thus producing much larger overhead. You can set the tab width though.
- $geshi->set_header_type(GESHI_HEADER_PRE_VALID);
-
- // Enable CSS classes. You can use get_stylesheet() to output a stylesheet for your code. Using
- // CSS classes results in much less output source.
- $geshi->enable_classes();
-
- // Enable line numbers. We want fancy line numbers, and we want every 5th line number to be fancy
- $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5);
-
- // Set the style for the PRE around the code. The line numbers are contained within this box (not
- // XHTML compliant btw, but if you are liberally minded about these things then you'll appreciate
- // the reduced source output).
- $geshi->set_overall_style('font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', false);
-
- // Set the style for line numbers. In order to get style for line numbers working, the <li> element
- // is being styled. This means that the code on the line will also be styled, and most of the time
- // you don't want this. So the set_code_style reverts styles for the line (by using a <div> on the line).
- // So the source output looks like this:
- //
- // <pre style="[set_overall_style styles]"><ol>
- // <li style="[set_line_style styles]"><div style="[set_code_style styles]>...</div></li>
- // ...
- // </ol></pre>
- $geshi->set_line_style('color: #003030;', 'font-weight: bold; color: #006060;', true);
- $geshi->set_code_style('color: #000020;', true);
-
- // Styles for hyperlinks in the code. GESHI_LINK for default styles, GESHI_HOVER for hover style etc...
- // note that classes must be enabled for this to work.
- $geshi->set_link_styles(GESHI_LINK, 'color: #000060;');
- $geshi->set_link_styles(GESHI_HOVER, 'background-color: #f0f000;');
-
- // Use the header/footer functionality. This puts a div with content within the PRE element, so it is
- // affected by the styles set by set_overall_style. So if the PRE has a border then the header/footer will
- // appear inside it.
- $geshi->set_header_content('<SPEED> <TIME> GeSHi &copy; 2004-2007, Nigel McNie, 2007-2008 Benny Baumann. View source of example.php for example of using GeSHi');
- $geshi->set_header_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;');
-
- // You can use <TIME> and <VERSION> as placeholders
- $geshi->set_footer_content('Parsed in <TIME> seconds at <SPEED>, using GeSHi <VERSION>');
- $geshi->set_footer_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-top: 1px solid #d0d0d0; padding: 2px;');
-} else {
- // make sure we don't preselect any language
- $_POST['language'] = null;
-}
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>GeSHi examples</title>
- <style type="text/css">
- <!--
- <?php
- if (isset($_POST['submit'])) {
- // Output the stylesheet. Note it doesn't output the <style> tag
- echo $geshi->get_stylesheet(true);
- }
- ?>
- html {
- background-color: #f0f0f0;
- }
- body {
- font-family: Verdana, Arial, sans-serif;
- margin: 10px;
- border: 2px solid #e0e0e0;
- background-color: #fcfcfc;
- padding: 5px;
- }
- h2 {
- margin: .1em 0 .2em .5em;
- border-bottom: 1px solid #b0b0b0;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 150%;
- }
- h3 {
- margin: .1em 0 .2em .5em;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 120%;
- }
- #footer {
- text-align: center;
- font-size: 80%;
- color: #a9a9a9;
- }
- #footer a {
- color: #9999ff;
- }
- textarea {
- border: 1px solid #b0b0b0;
- font-size: 90%;
- color: #333;
- margin-left: 20px;
- }
- select, input {
- margin-left: 20px;
- }
- p {
- font-size: 90%;
- margin-left: .5em;
- }
- -->
- </style>
-</head>
-<body>
-<h2>GeSHi Example Script</h2>
-<p>To use this script, make sure that <strong>geshi.php</strong> is in the parent directory or in your
-include_path, and that the language files are in a subdirectory of GeSHi's directory called <strong>geshi/</strong>.</p>
-<p>Enter your source and a language to highlight the source in and submit, or just choose a language to
-have that language file highlighted in PHP.</p>
-<?php
-if (isset($_POST['submit'])) {
- // The fun part :)
- echo $geshi->parse_code();
- echo '<hr />';
-}
-?>
-<form action="<?php echo basename($_SERVER['PHP_SELF']); ?>" method="post">
-<h3>Source to highlight</h3>
-<p>
-<textarea rows="10" cols="60" name="source" id="source"><?php echo $fill_source ? htmlspecialchars($_POST['source']) : '' ?></textarea>
-</p>
-<h3>Choose a language</h3>
-<p>
-<select name="language" id="language">
-<?php
-if (!($dir = @opendir(dirname(__FILE__) . '/geshi'))) {
- if (!($dir = @opendir(dirname(__FILE__) . '/../geshi'))) {
- echo '<option>No languages available!</option>';
- }
-}
-$languages = array();
-while ($file = readdir($dir)) {
- if ( $file[0] == '.' || strpos($file, '.', 1) === false) {
- continue;
- }
- $lang = substr($file, 0, strpos($file, '.'));
- $languages[] = $lang;
-}
-closedir($dir);
-sort($languages);
-foreach ($languages as $lang) {
- if (isset($_POST['language']) && $_POST['language'] == $lang) {
- $selected = 'selected="selected"';
- } else {
- $selected = '';
- }
- echo '<option value="' . $lang . '" '. $selected .'>' . $lang . "</option>\n";
-}
-
-?>
-</select>
-</p>
-<p>
-<input type="submit" name="submit" value="Highlight Source" />
-<input type="submit" name="clear" onclick="document.getElementById('source').value='';document.getElementById('language').value='';return false" value="clear" />
-</p>
-</form>
-<div id="footer">GeSHi &copy; Nigel McNie, 2004, released under the GNU GPL<br />
-For a better demonstration, check out the <a href="http://qbnz.com/highlighter/demo.php">online demo</a>
-</div>
-</body>
-</html>
diff --git a/libvpx/examples/includes/geshi/contrib/langcheck.php b/libvpx/examples/includes/geshi/contrib/langcheck.php
deleted file mode 100644
index 0a2ca32..0000000
--- a/libvpx/examples/includes/geshi/contrib/langcheck.php
+++ /dev/null
@@ -1,666 +0,0 @@
-<?php
-/**
- * GeSHi example script
- *
- * Just point your browser at this script (with geshi.php in the parent directory,
- * and the language files in subdirectory "../geshi/")
- *
- * @author Nigel McNie
- * @version $Id: langcheck.php 1971 2008-12-25 15:14:14Z benbe $
- */
-header('Content-Type: text/html; charset=utf-8');
-
-set_time_limit(0);
-error_reporting(E_ALL);
-$time_start = explode(' ', microtime());
-
-define ('TYPE_NOTICE', 0);
-define ('TYPE_WARNING', 1);
-define ('TYPE_ERROR', 2);
-
-$error_abort = false;
-$error_cache = array();
-function output_error_cache(){
- global $error_cache, $error_abort;
-
- if(count($error_cache)) {
- echo "<span style=\"color: #F00; font-weight: bold;\">Failed</span><br />";
- echo "<ol>\n";
- foreach($error_cache as $error_msg) {
- echo "<li>";
- switch($error_msg['t']) {
- case TYPE_NOTICE:
- echo "<span style=\"color: #080; font-weight: bold;\">NOTICE:</span>";
- break;
- case TYPE_WARNING:
- echo "<span style=\"color: #CC0; font-weight: bold;\">WARNING:</span>";
- break;
- case TYPE_ERROR:
- echo "<span style=\"color: #F00; font-weight: bold;\">ERROR:</span>";
- break;
- }
- echo " " . $error_msg['m'] . "</li>";
- }
- echo "</ol>\n";
- } else {
- echo "<span style=\"color: #080; font-weight: bold;\">OK</span><br />";
- }
- echo "\n";
-
- $error_cache = array();
-}
-
-function report_error($type, $message) {
- global $error_cache, $error_abort;
-
- $error_cache[] = array('t' => $type, 'm' => $message);
- if(TYPE_ERROR == $type) {
- $error_abort = true;
- }
-}
-
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
- <title>GeSHi Language File Validation Script</title>
- <style type="text/css">
- <!--
- html {
- background-color: #f0f0f0;
- }
- body {
- font-family: Verdana, Arial, sans-serif;
- margin: 10px;
- border: 2px solid #e0e0e0;
- background-color: #fcfcfc;
- padding: 5px;
- font-size: 10pt;
- }
- h2 {
- margin: .1em 0 .2em .5em;
- border-bottom: 1px solid #b0b0b0;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 150%;
- }
- h3 {
- margin: .1em 0 .2em .5em;
- color: #b0b0b0;
- font-weight: normal;
- font-size: 120%;
- }
- #footer {
- text-align: center;
- font-size: 80%;
- color: #a9a9a9;
- }
- #footer a {
- color: #9999ff;
- }
- textarea {
- border: 1px solid #b0b0b0;
- font-size: 90%;
- color: #333;
- margin-left: 20px;
- }
- select, input {
- margin-left: 20px;
- }
- p {
- font-size: 90%;
- margin-left: .5em;
- }
- -->
- </style>
-</head>
-<body>
-<h2>GeSHi Language File Validation Script</h2>
-<p>To use this script, make sure that <strong>geshi.php</strong> is in the
-parent directory or in your include_path, and that the language files are in a
-subdirectory of GeSHi's directory called <strong>geshi/</strong>.</p>
-<p>Everything else will be done by this script automatically. After the script
-finished you should see messages of what could cause trouble with GeSHi or where
-your language files can be improved. Please be patient, as this might take some time.</p>
-
-<ol>
-<li>Checking where to find GeSHi installation ... <?php
-// Rudimentary checking of where GeSHi is. In a default install it will be in ../, but
-// it could be in the current directory if the include_path is set. There's nowhere else
-// we can reasonably guess.
-if (is_readable('../geshi.php')) {
- $path = '../';
-} elseif (is_readable('geshi.php')) {
- $path = './';
-} else {
- report_error(TYPE_ERROR, 'Could not find geshi.php - make sure it is in your include path!');
-}
-
-if(!$error_abort) {
- require $path . 'geshi.php';
-
- if(!class_exists('GeSHi')) {
- report_error(TYPE_ERROR, 'The GeSHi class was not found, although it seemed we loaded the correct file!');
- }
-}
-
-if(!$error_abort) {
- if(!defined('GESHI_LANG_ROOT')) {
- report_error(TYPE_ERROR, 'There\'s no information present on where to find the language files!');
- } else if(!is_dir(GESHI_LANG_ROOT)) {
- report_error(TYPE_ERROR, 'The path "'.GESHI_LANG_ROOT.'" given, does not ressemble a directory!');
- } else if(!is_readable(GESHI_LANG_ROOT)) {
- report_error(TYPE_ERROR, 'The path "'.GESHI_LANG_ROOT.'" is not readable to this script!');
- }
-}
-
-output_error_cache();
-
-if(!$error_abort) {
- echo "</li>\n<li>Listing available language files ... ";
-
- if (!($dir = @opendir(GESHI_LANG_ROOT))) {
- report_error(TYPE_ERROR, 'Error requesting listing for available language files!');
- }
-
- $languages = array();
-
- if(!$error_abort) {
- while ($file = readdir($dir)) {
- if (!$file || $file[0] == '.' || strpos($file, '.') === false) {
- continue;
- }
- $lang = substr($file, 0, strpos($file, '.'));
- $languages[] = $lang;
- }
- closedir($dir);
- }
-
- $languages = array_unique($languages);
- sort($languages);
-
- if(!count($languages)) {
- report_error(TYPE_WARNING, 'Unable to locate any usable language files in "'.GESHI_LANG_ROOT.'"!');
- }
-
- output_error_cache();
-}
-
-if (isset($_REQUEST['show']) && in_array($_REQUEST['show'], $languages)) {
- $languages = array($_REQUEST['show']);
-}
-
-if(!$error_abort) {
- foreach ($languages as $lang) {
- echo "</li>\n<li>Validating language file for '$lang' ... ";
-
- $langfile = GESHI_LANG_ROOT . $lang . '.php';
-
- unset($language_data);
-
- if(!is_file($langfile)) {
- report_error(TYPE_ERROR, 'The path "' .$langfile. '" does not ressemble a regular file!');
- } else if(!is_readable($langfile)) {
- report_error(TYPE_ERROR, 'Cannot read file "' .$langfile. '"!');
- } else {
- $langfile_content = file_get_contents($langfile);
- if(preg_match("/\?>(?:\r?\n|\r(?!\n)){2,}\Z/", $langfile_content)) {
- report_error(TYPE_ERROR, 'Language file contains trailing empty lines at EOF!');
- }
- if(!preg_match("/\?>(?:\r?\n|\r(?!\n))?\Z/", $langfile_content)) {
- report_error(TYPE_ERROR, 'Language file contains no PHP end marker at EOF!');
- }
- if(preg_match("/\t/", $langfile_content)) {
- report_error(TYPE_NOTICE, 'Language file contains unescaped tabulator chars (probably for indentation)!');
- }
- if(preg_match('/^(?: )*(?! )(?! \*) /m', $langfile_content)) {
- report_error(TYPE_NOTICE, 'Language file contains irregular indentation (other than 4 spaces per indentation level)!');
- }
-
- if(!preg_match("/\/\*\*((?!\*\/).)*?Author:((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not contain a specification of an author!');
- }
- if(!preg_match("/\/\*\*((?!\*\/).)*?Copyright:((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not contain a specification of the copyright!');
- }
- if(!preg_match("/\/\*\*((?!\*\/).)*?Release Version:((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not contain a specification of the release version!');
- }
- if(!preg_match("/\/\*\*((?!\*\/).)*?Date Started:((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not contain a specification of the date it was started!');
- }
- if(!preg_match("/\/\*\*((?!\*\/).)*?This file is part of GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not state that it belongs to GeSHi!');
- }
- if(!preg_match("/\/\*\*((?!\*\/).)*?language file for GeSHi\.((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not state that it is a language file for GeSHi!');
- }
- if(!preg_match("/\/\*\*((?!\*\/).)*?GNU General Public License((?!\*\/).)*?\*\//s", $langfile_content)) {
- report_error(TYPE_WARNING, 'Language file does not state that it is provided under the terms of the GNU GPL!');
- }
-
- unset($langfile_content);
-
- include $langfile;
-
- if(!isset($language_data)) {
- report_error(TYPE_ERROR, 'Language file does not contain a $language_data structure to check!');
- } else if (!is_array($language_data)) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data structure which is not an array!');
- }
- }
-
- if(!$error_abort) {
- if(!isset($language_data['LANG_NAME'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'LANG_NAME\'] specification!');
- } else if (!is_string($language_data['LANG_NAME'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'LANG_NAME\'] specification which is not a string!');
- }
-
- if(!isset($language_data['COMMENT_SINGLE'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'COMMENT_SIGNLE\'] structure to check!');
- } else if (!is_array($language_data['COMMENT_SINGLE'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_SINGLE\'] structure which is not an array!');
- }
-
- if(!isset($language_data['COMMENT_MULTI'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'COMMENT_MULTI\'] structure to check!');
- } else if (!is_array($language_data['COMMENT_MULTI'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_MULTI\'] structure which is not an array!');
- }
-
- if(isset($language_data['COMMENT_REGEXP'])) {
- if (!is_array($language_data['COMMENT_REGEXP'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'COMMENT_REGEXP\'] structure which is not an array!');
- }
- }
-
- if(!isset($language_data['QUOTEMARKS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'QUOTEMARKS\'] structure to check!');
- } else if (!is_array($language_data['QUOTEMARKS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'QUOTEMARKS\'] structure which is not an array!');
- }
-
- if(isset($language_data['HARDQUOTE'])) {
- if (!is_array($language_data['HARDQUOTE'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'HARDQUOTE\'] structure which is not an array!');
- }
- }
-
- if(!isset($language_data['ESCAPE_CHAR'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'ESCAPE_CHAR\'] specification to check!');
- } else if (!is_string($language_data['ESCAPE_CHAR'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification which is not a string!');
- } else if (1 < strlen($language_data['ESCAPE_CHAR'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'ESCAPE_CHAR\'] specification is not empty or exactly one char!');
- }
-
- if(!isset($language_data['CASE_KEYWORDS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'CASE_KEYWORDS\'] specification!');
- } else if (!is_int($language_data['CASE_KEYWORDS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is not an integer!');
- } else if (GESHI_CAPS_NO_CHANGE != $language_data['CASE_KEYWORDS'] &&
- GESHI_CAPS_LOWER != $language_data['CASE_KEYWORDS'] &&
- GESHI_CAPS_UPPER != $language_data['CASE_KEYWORDS']) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_KEYWORDS\'] specification which is neither of GESHI_CAPS_NO_CHANGE, GESHI_CAPS_LOWER nor GESHI_CAPS_UPPER!');
- }
-
- if(!isset($language_data['KEYWORDS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'KEYWORDS\'] structure to check!');
- } else if (!is_array($language_data['KEYWORDS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'KEYWORDS\'] structure which is not an array!');
- } else {
- foreach($language_data['KEYWORDS'] as $kw_key => $kw_value) {
- if(!is_integer($kw_key)) {
- report_error(TYPE_WARNING, "Language file contains an key '$kw_key' in \$language_data['KEYWORDS'] that is not integer!");
- } else if (!is_array($kw_value)) {
- report_error(TYPE_ERROR, "Language file contains a \$language_data['CASE_SENSITIVE']['$kw_value'] structure which is not an array!");
- }
- }
- }
-
- if(!isset($language_data['SYMBOLS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'SYMBOLS\'] structure to check!');
- } else if (!is_array($language_data['SYMBOLS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'SYMBOLS\'] structure which is not an array!');
- }
-
- if(!isset($language_data['CASE_SENSITIVE'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'CASE_SENSITIVE\'] structure to check!');
- } else if (!is_array($language_data['CASE_SENSITIVE'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'CASE_SENSITIVE\'] structure which is not an array!');
- } else {
- foreach($language_data['CASE_SENSITIVE'] as $cs_key => $cs_value) {
- if(!is_integer($cs_key)) {
- report_error(TYPE_WARNING, "Language file contains an key '$cs_key' in \$language_data['CASE_SENSITIVE'] that is not integer!");
- } else if (!is_bool($cs_value)) {
- report_error(TYPE_ERROR, "Language file contains a Case Sensitivity specification for \$language_data['CASE_SENSITIVE']['$cs_value'] which is not a boolean!");
- }
- }
- }
-
- if(!isset($language_data['URLS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'URLS\'] structure to check!');
- } else if (!is_array($language_data['URLS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'URLS\'] structure which is not an array!');
- } else {
- foreach($language_data['URLS'] as $url_key => $url_value) {
- if(!is_integer($url_key)) {
- report_error(TYPE_WARNING, "Language file contains an key '$url_key' in \$language_data['URLS'] that is not integer!");
- } else if (!is_string($url_value)) {
- report_error(TYPE_ERROR, "Language file contains a Documentation URL specification for \$language_data['URLS']['$url_value'] which is not a string!");
- } else if (preg_match('#&([^;]*(=|$))#U', $url_value)) {
- report_error(TYPE_ERROR, "Language file contains unescaped ampersands (&amp;) in \$language_data['URLS']!");
- }
- }
- }
-
- if(!isset($language_data['OOLANG'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'OOLANG\'] specification!');
- } else if (!is_int($language_data['OOLANG']) && !is_bool($language_data['OOLANG'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OOLANG\'] specification which is neither boolean nor integer!');
- } else if (false !== $language_data['OOLANG'] &&
- true !== $language_data['OOLANG'] &&
- 2 !== $language_data['OOLANG']) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OOLANG\'] specification which is neither of false, true or 2!');
- }
-
- if(!isset($language_data['OBJECT_SPLITTERS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'OBJECT_SPLITTERS\'] structure to check!');
- } else if (!is_array($language_data['OBJECT_SPLITTERS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'OBJECT_SPLITTERS\'] structure which is not an array!');
- }
-
- if(!isset($language_data['REGEXPS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'REGEXPS\'] structure to check!');
- } else if (!is_array($language_data['REGEXPS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'REGEXPS\'] structure which is not an array!');
- }
-
- if(!isset($language_data['STRICT_MODE_APPLIES'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'STRICT_MODE_APPLIES\'] specification!');
- } else if (!is_int($language_data['STRICT_MODE_APPLIES'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is not an integer!');
- } else if (GESHI_MAYBE != $language_data['STRICT_MODE_APPLIES'] &&
- GESHI_ALWAYS != $language_data['STRICT_MODE_APPLIES'] &&
- GESHI_NEVER != $language_data['STRICT_MODE_APPLIES']) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STRICT_MODE_APPLIES\'] specification which is neither of GESHI_MAYBE, GESHI_ALWAYS nor GESHI_NEVER!');
- }
-
- if(!isset($language_data['SCRIPT_DELIMITERS'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'SCRIPT_DELIMITERS\'] structure to check!');
- } else if (!is_array($language_data['SCRIPT_DELIMITERS'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'SCRIPT_DELIMITERS\'] structure which is not an array!');
- }
-
- if(!isset($language_data['HIGHLIGHT_STRICT_BLOCK'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure to check!');
- } else if (!is_array($language_data['HIGHLIGHT_STRICT_BLOCK'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'HIGHLIGHT_STRICT_BLOCK\'] structure which is not an array!');
- }
-
- if(isset($language_data['TAB_WIDTH'])) {
- if (!is_int($language_data['TAB_WIDTH'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is not an integer!');
- } else if (1 > $language_data['TAB_WIDTH']) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'TAB_WIDTH\'] specification which is less than 1!');
- }
- }
-
- if(isset($language_data['PARSER_CONTROL'])) {
- if (!is_array($language_data['PARSER_CONTROL'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'PARSER_CONTROL\'] structure which is not an array!');
- }
- }
-
- if(!isset($language_data['STYLES'])) {
- report_error(TYPE_ERROR, 'Language file contains no $language_data[\'STYLES\'] structure to check!');
- } else if (!is_array($language_data['STYLES'])) {
- report_error(TYPE_ERROR, 'Language file contains a $language_data[\'STYLES\'] structure which is not an array!');
- } else {
- $style_arrays = array('KEYWORDS', 'COMMENTS', 'ESCAPE_CHAR',
- 'BRACKETS', 'STRINGS', 'NUMBERS', 'METHODS', 'SYMBOLS',
- 'REGEXPS', 'SCRIPT');
- foreach($style_arrays as $style_kind) {
- if(!isset($language_data['STYLES'][$style_kind])) {
- report_error(TYPE_ERROR, "Language file contains no \$language_data['STYLES']['$style_kind'] structure to check!");
- } else if (!is_array($language_data['STYLES'][$style_kind])) {
- report_error(TYPE_ERROR, "Language file contains a \$language_data['STYLES\']['$style_kind'] structure which is not an array!");
- } else {
- foreach($language_data['STYLES'][$style_kind] as $sk_key => $sk_value) {
- if(!is_int($sk_key) && ('COMMENTS' != $style_kind && 'MULTI' != $sk_key)
- && !(('STRINGS' == $style_kind || 'ESCAPE_CHAR' == $style_kind) && 'HARD' == $sk_key)) {
- report_error(TYPE_WARNING, "Language file contains an key '$sk_key' in \$language_data['STYLES']['$style_kind'] that is not integer!");
- } else if (!is_string($sk_value)) {
- report_error(TYPE_WARNING, "Language file contains a CSS specification for \$language_data['STYLES']['$style_kind'][$key] which is not a string!");
- }
- }
- }
- }
-
- unset($style_arrays);
- }
- }
-
- if(!$error_abort) {
- //Initial sanity checks survived? --> Let's dig deeper!
- foreach($language_data['KEYWORDS'] as $key => $keywords) {
- if(!isset($language_data['CASE_SENSITIVE'][$key])) {
- report_error(TYPE_ERROR, "Language file contains no \$language_data['CASE_SENSITIVE'] specification for keyword group $key!");
- }
- if(!isset($language_data['URLS'][$key])) {
- report_error(TYPE_ERROR, "Language file contains no \$language_data['URLS'] specification for keyword group $key!");
- }
- if(empty($keywords)) {
- report_error(TYPE_WARNING, "Language file contains an empty keyword list in \$language_data['KEYWORDS'] for group $key!");
- }
- foreach($keywords as $id => $kw) {
- if(!is_string($kw)) {
- report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['KEYWORDS'][$key][$id]!");
- } else if (!strlen($kw)) {
- report_error(TYPE_ERROR, "Language file contains an empty string entry at \$language_data['KEYWORDS'][$key][$id]!");
- } else if (preg_match('/^([\(\)\{\}\[\]\^=.,:;\-+\*\/%\$\"\'\?]|&[\w#]\w*;)+$/i', $kw)) {
- report_error(TYPE_NOTICE, "Language file contains an keyword ('$kw') at \$language_data['KEYWORDS'][$key][$id] which seems to be better suited for the symbols section!");
- }
- }
- if(count($keywords) != count(array_unique($keywords))) {
- $kw_diffs = array_count_values($keywords);
- foreach($kw_diffs as $kw => $kw_count) {
- if($kw_count > 1) {
- report_error(TYPE_WARNING, "Language file contains per-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key]!");
- }
- }
- }
- }
-
- $disallowed_before = "(?<![a-zA-Z0-9\$_\|\#;>|^&";
- $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
-
- foreach($language_data['KEYWORDS'] as $key => $keywords) {
- foreach($language_data['KEYWORDS'] as $key2 => $keywords2) {
- if($key2 <= $key) {
- continue;
- }
- $kw_diffs = array_intersect($keywords, $keywords2);
- foreach($kw_diffs as $kw) {
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS'])) {
- //Check the precondition\post-cindition for the involved keyword groups
- $g1_pre = $disallowed_before;
- $g2_pre = $disallowed_before;
- $g1_post = $disallowed_after;
- $g2_post = $disallowed_after;
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) {
- $g1_pre = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
- $g2_pre = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
- }
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) {
- $g1_post = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
- $g2_post = $language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
- }
-
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_BEFORE'])) {
- $g1_pre = $language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_BEFORE'];
- }
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_AFTER'])) {
- $g1_post = $language_data['PARSER_CONTROL']['KEYWORDS'][$key]['DISALLOWED_AFTER'];
- }
-
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_BEFORE'])) {
- $g2_pre = $language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_BEFORE'];
- }
- if(isset($language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_AFTER'])) {
- $g2_post = $language_data['PARSER_CONTROL']['KEYWORDS'][$key2]['DISALLOWED_AFTER'];
- }
-
- if($g1_pre != $g2_pre || $g1_post != $g2_post) {
- continue;
- }
- }
- report_error(TYPE_WARNING, "Language file contains cross-group duplicate keyword '$kw' in \$language_data['KEYWORDS'][$key] and \$language_data['KEYWORDS'][$key2]!");
- }
- }
- }
- foreach($language_data['CASE_SENSITIVE'] as $key => $keywords) {
- if(!isset($language_data['KEYWORDS'][$key]) && $key != GESHI_COMMENTS) {
- report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['CASE_SENSITIVE'] specification for non-existing keyword group $key!");
- }
- }
- foreach($language_data['URLS'] as $key => $keywords) {
- if(!isset($language_data['KEYWORDS'][$key])) {
- report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['URLS'] specification for non-existing keyword group $key!");
- }
- }
- foreach($language_data['STYLES']['KEYWORDS'] as $key => $keywords) {
- if(!isset($language_data['KEYWORDS'][$key])) {
- report_error(TYPE_WARNING, "Language file contains an superfluous \$language_data['STYLES']['KEYWORDS'] specification for non-existing keyword group $key!");
- }
- }
-
- foreach($language_data['COMMENT_SINGLE'] as $ck => $cv) {
- if(!is_int($ck)) {
- report_error(TYPE_WARNING, "Language file contains an key '$ck' in \$language_data['COMMENT_SINGLE'] that is not integer!");
- }
- if(!is_string($cv)) {
- report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['COMMENT_SINGLE'][$ck]!");
- }
- if(!isset($language_data['STYLES']['COMMENTS'][$ck])) {
- report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
- }
- }
- if(isset($language_data['COMMENT_REGEXP'])) {
- foreach($language_data['COMMENT_REGEXP'] as $ck => $cv) {
- if(!is_int($ck)) {
- report_error(TYPE_WARNING, "Language file contains an key '$ck' in \$language_data['COMMENT_REGEXP'] that is not integer!");
- }
- if(!is_string($cv)) {
- report_error(TYPE_WARNING, "Language file contains an non-string entry at \$language_data['COMMENT_REGEXP'][$ck]!");
- }
- if(!isset($language_data['STYLES']['COMMENTS'][$ck])) {
- report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['COMMENTS'] specification for comment group $ck!");
- }
- }
- }
- foreach($language_data['STYLES']['COMMENTS'] as $ck => $cv) {
- if($ck != 'MULTI' && !isset($language_data['COMMENT_SINGLE'][$ck]) &&
- !isset($language_data['COMMENT_REGEXP'][$ck])) {
- report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['COMMENTS'] specification for Single Line or Regular-Expression Comment key $ck!");
- }
- }
- if (isset($language_data['STYLES']['STRINGS']['HARD'])) {
- if (empty($language_data['HARDQUOTE'])) {
- report_error(TYPE_NOTICE, "Language file contains superfluous \$language_data['STYLES']['STRINGS'] specification for key 'HARD', but no 'HARDQUOTE's are defined!");
- }
- unset($language_data['STYLES']['STRINGS']['HARD']);
- }
- foreach($language_data['STYLES']['STRINGS'] as $sk => $sv) {
- if($sk && !isset($language_data['QUOTEMARKS'][$sk])) {
- report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['STRINGS'] specification for non-existing quotemark key $sk!");
- }
- }
-
- foreach($language_data['REGEXPS'] as $rk => $rv) {
- if(!is_int($rk)) {
- report_error(TYPE_WARNING, "Language file contains an key '$rk' in \$language_data['REGEXPS'] that is not integer!");
- }
- if(is_string($rv)) {
- //Check for unmasked / in regular expressions ...
- if(empty($rv)) {
- report_error(TYPE_WARNING, "Language file contains an empty regular expression at \$language_data['REGEXPS'][$rk]!");
- } else {
- if(preg_match("/(?<!\\\\)\//s", $rv)) {
- report_error(TYPE_WARNING, "Language file contains a regular expression with an unmasked / character at \$language_data['REGEXPS'][$rk]!");
- } elseif (preg_match("/(?<!<)(\\\\\\\\)*\\\\\|(?!>)/s", $rv)) {
- report_error(TYPE_WARNING, "Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '&lt;PIPE&gt;' instead at \$language_data['REGEXPS'][$rk]!");
- }
- }
- } elseif(is_array($rv)) {
- if(!isset($rv[GESHI_SEARCH])) {
- report_error(TYPE_ERROR, "Language file contains no GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
- } elseif(!is_string($rv[GESHI_SEARCH])) {
- report_error(TYPE_ERROR, "Language file contains a GESHI_SEARCH entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
- } else {
- if(preg_match("/(?<!\\\\)\//s", $rv[GESHI_SEARCH])) {
- report_error(TYPE_WARNING, "Language file contains a regular expression with an unmasked / character at \$language_data['REGEXPS'][$rk]!");
- } elseif (preg_match("/(?<!<)(\\\\\\\\)*\\\\\|(?!>)/s", $rv[GESHI_SEARCH])) {
- report_error(TYPE_WARNING, "Language file contains a regular expression with an unescaped match for a pipe character '|' which needs escaping as '&lt;PIPE&gt;' instead at \$language_data['REGEXPS'][$rk]!");
- }
- }
- if(!isset($rv[GESHI_REPLACE])) {
- report_error(TYPE_WARNING, "Language file contains no GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
- } elseif(!is_string($rv[GESHI_REPLACE])) {
- report_error(TYPE_ERROR, "Language file contains a GESHI_REPLACE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
- }
- if(!isset($rv[GESHI_MODIFIERS])) {
- report_error(TYPE_WARNING, "Language file contains no GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
- } elseif(!is_string($rv[GESHI_MODIFIERS])) {
- report_error(TYPE_ERROR, "Language file contains a GESHI_MODIFIERS entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
- }
- if(!isset($rv[GESHI_BEFORE])) {
- report_error(TYPE_WARNING, "Language file contains no GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
- } elseif(!is_string($rv[GESHI_BEFORE])) {
- report_error(TYPE_ERROR, "Language file contains a GESHI_BEFORE entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
- }
- if(!isset($rv[GESHI_AFTER])) {
- report_error(TYPE_WARNING, "Language file contains no GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk]!");
- } elseif(!is_string($rv[GESHI_AFTER])) {
- report_error(TYPE_ERROR, "Language file contains a GESHI_AFTER entry in extended regular expression at \$language_data['REGEXPS'][$rk] which is not a string!");
- }
- } else {
- report_error(TYPE_WARNING, "Language file contains an non-string and non-array entry at \$language_data['REGEXPS'][$rk]!");
- }
- if(!isset($language_data['STYLES']['REGEXPS'][$rk])) {
- report_error(TYPE_WARNING, "Language file contains no \$language_data['STYLES']['REGEXPS'] specification for regexp group $rk!");
- }
- }
- foreach($language_data['STYLES']['REGEXPS'] as $rk => $rv) {
- if(!isset($language_data['REGEXPS'][$rk])) {
- report_error(TYPE_NOTICE, "Language file contains an superfluous \$language_data['STYLES']['REGEXPS'] specification for regexp key $rk!");
- }
- }
-
-
- }
-
- output_error_cache();
-
- flush();
-
- if($error_abort) {
- break;
- }
- }
-}
-?></li>
-</ol>
-
-<p>Validation process completed in <?
-$time_end = explode(' ', microtime());
-$time_diff = $time_end[0] + $time_end[1] - $time_start[0] - $time_start[1];
-
-echo sprintf("%.2f", $time_diff);
-?> seconds.</p>
-
-<div id="footer">GeSHi &copy; 2004-2007 Nigel McNie, 2007-2008 Benny Baumann, released under the GNU GPL</div>
-</body>
-</html>
diff --git a/libvpx/examples/includes/geshi/docs/BUGS b/libvpx/examples/includes/geshi/docs/BUGS
deleted file mode 100644
index 8a5cf04..0000000
--- a/libvpx/examples/includes/geshi/docs/BUGS
+++ /dev/null
@@ -1,29 +0,0 @@
-
- BUGS - list of known bugs in GeSHi
- Version 1.0.8
-
-- Number highlighting is quite poor [possibly better now]
-- I'm not happy with URLS - there still could be extra bugs, and it's rather unflexible
- (see TODO for a possible fix)
-- "Important" sections for some reason seem to have their spans added after every
- newline up until the next lexic, instead of stopping at the <END GeSHi> part. In fact,
- context sensitiveness is quite poor...
-- Using the extra line number highlighting feature without actually using line numbers
- will result in malformed XHTML (not sure about this one though...)
-- Slow!!! Especially for source with lots of strings in it. GeSHi will work acceptably
- for sourcecode under 5K (for simple language files like SQL, a 100K file can be
- highlighted in just 6 seconds), but above about 25K things get a little slow... If
- you're using this as part of some larger software, you may want to think about
- making some sort of "cache" effect to speed things up and reduce server load.
-- The result is built by string replacement instead of by building another string based
- on the source, that would be much safer. The focus of releases beyond 1.0.7 will be on
- changing this behaviour, which may well fix some of the other bugs mentioned above.
-- As of 1.0.7.1, dots (.) are allowed before keywords. This may change highlighting of some
- things slightly, if you notice anything odd about the highlighting then please report
- it to me.
-- Perl/Javascript /.../ regex syntax is only supported basically and there's no
- guarantee it is working all the time.
-- The <pre> header output is not XHTML compliant. Please use the <div> header instead.
-
-Send any bug reports to BenBE@omorphia.de, or submit them via the bug tracker at
-sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231)
diff --git a/libvpx/examples/includes/geshi/docs/CHANGES b/libvpx/examples/includes/geshi/docs/CHANGES
deleted file mode 100644
index d64c4e5..0000000
--- a/libvpx/examples/includes/geshi/docs/CHANGES
+++ /dev/null
@@ -1,682 +0,0 @@
-
- CHANGES - Changelog for GeSHi (geshi.php only)
-
-Changes to the code are listed under the version they occured in, with who suggested
-it by each one (if there's nobody listed as suggesting it I dreamed it up :)). Users
-who suggested an idea often also provided the code that was used as a basis for the
-changes - thanks to all who suggested these ideas and gave me the code to show me how!
-
-Language files listed under each version were made by the author beside them, and then
-modified by me for consistency/bug fixing.
-
-Please send any bug reports to BenBE@omorphia.de, or use the bug report tracker
-at sourceforge (http://sourceforge.net/tracker/?group_id=114997&atid=670231)
-
-Version 1.0.8.3
- - Added language files
- * DCS (Stelio Passaris)
- * Locomotive Basic (Nacho Cabanes)
- * LSL2 (Linden Scripting Language) (William Fry)
- * Modula-3 (Martin Bishop)
- * Oberon-2 (Mike Mol)
- * Rebol (Lecanu Guillaume)
- - Fixed a problem where HardEscapes weren't working when no escape char was given (BenBE)
- - Added a PARSER_CONTROL setting to treat whitespace inside of keywords in
- the language file as "any whitespace" in the source (i.e. "CREATE TABLE"
- in SQL will match "CREATE\s+TABLE" instead of literally matching) (BenBE)
- - Added a possibility to allow setting the style for escape characters (BenBE)
- - Improvements to language files (BenBE)
- * Added some missing Perl keywords and obscure default variables (BenBE)
- * Allow for escaped colons to appear in CSS names (BenBE, simon)
- * Added multiline continuation suppoert of preprocessor defines for
- C, C for Mac, C++ and CC++ with Qt support (BenBE)
- * keywords for C-based languages are case-sensitive (BenBE)
- * Broken AutoIt highlighting (BenBE)
- * Problem with escaped backslash in PHP and D (BenBE)
- * Added some more functions for PHP (BenBE)
- * Some changes for AppleScript (Stefan Klieme)
- * Forbid highlighting keywords followed by / in bash (BenBE)
- * Updated the LaTeX file to link some keywords (BenBE)
- * Additional text rendered when matching special variables for PowerShell (BenBE)
- * Added some more keywords for ABAP (BenBE, Sandra Rossi, Jacob Laursen)
-Version 1.0.8.2
- - Added language files
- * Brainfuck \ Brainfork (Benny Baumann)
- * HQ9+ (Benny Baumann)
- * INTERCAL (Benny Baumann)
- * LOLcode (Benny Baumann)
- * LScript (Beau McGuigan)
- * Pixel Bender (Richard Olsson)
- * ProvideX (Jeff Wilder)
- * VIM Script (Swaroop C H)
- * Visual Prolog (Thomas Linder Puls)
- * Whitespace (Benny Baumann)
- - Changed priority for COMMENT_REGEXP compared to String highlighting (BenBE)
- - Fixed correct escaping of spaces inside of URLs (BenBE)
- - Updated the list of common file extensions (BenBE)
- - Updated the language file check script in contrib/ (BenBE)
- - Fixed a problem with link targets resulting in unclickable links (SF#2379120, BenBE)
- - Fixed an undefined variable issue in langcheck.php (BenBE)
- - Improvements to language files (BenBE)
- * eMail Header highlighting now uses the correct delimiters for keywords (BenBE)
- * eMail (RFC822\mbox) highlighting now highlights IPs, MIME types and
- subfield assignments correctly (BenBE)
- * Minor style changes in COBOL to improve loading performance (BenBE)
- * Added some missing keywords for D (BenBE)
- * Removed duplicate keywords from Progres, SAS and TSQL (BenBE)
- * Fixed Heredoc Syntax for Bash (SF#2185319, BenBE)
- * Moved symbol-lookalike sequences from keyword groups to separate symbol group
- for languages asp, klonec, klonecpp, php, php-brief (BenBE)
- * Fixed a lot of duplicate keyword warnings (BenBE)
- * Added missing keywords to the Python language file,
- introducing support for Python 3.0. (SF#2441839, milian)
- * Updated documentation links for TypoScript (SF#2014276, BenBE)
- * Fixed a problem with tag and attribute names in XML highlighting (SF#2276119, BenBE)
- * Improved MySQL language file (BenBE, JavaWoman)
- * Some commentss accidentially mistaken for DocComments (SF#2454897, BenBE)
- * Added improved Escape Char handling for c, c_mac, cpp and cpp_qt (SF#2458743, BenBE)
-Version 1.0.8.1
- - Added language files
- * AviSynth (Ryan Jones)
- * eMail \ mbox (Benny Baumann)
- * GNU Make (Neil Bird)
- * Oracle 11i support (Simon Redhead)
- * Prolog (Benny Baumann)
- * SciLab (Christophe David)
- * TeraTerm macro language (Boris Maisuradze)
- - Added support for Escape Regular Expressions (BenBE)
- * Implemented C-style Escapes in PHP (BenBE)
- * Introduced support for \xAB and \007 style Char Escapes in PHP (BenBE)
- * Implemented Variable Highlighting in PHP (BenBE)
- * Implemented Variable Highlighting in Bash (milian)
- - Fixed a problem with PCRE patterns for Keyword matching sometimes producing
- very large strings, that could not be handled by some versions of PCRE lib,
- causing broken highlighting an Regexp Compile errors (BenBE, milian)
- - Fixed broken highlighting of bash commands like `dbus-send --dest=org.....`,
- i.e. the dest was highlighted as variable declaration (milian)
- - Fixed broken highlighting of some symbols in their escaped form (BenBE)
- (<SEMI> and <PIPE> were accidentially filtered even though they are valid)
- - Fixed a "memory leak" in the *_regexp_caches (milian)
- - Fixed broken Escape chars if classes were disabled
- - start_line_numbers_at() was ignored when GESHI_HEADER_PRE_TABLE was set (revulo)
- - Fixed a problem allowing Remote Code Inclusion under certain circumstances (BenBE)
- - Changes to default CSS in order to make the GESHI_HEADER_PRE_TABLE align properly,
- even on Windows / Mac systems with strange fonts (milian, revulo, ^RT)
- - Minor style changes to the following languages:
- * cpp-qt (milian)
- * MySQL (BenBE)
- * PHP (BenBE)
- - Improvements to language files (BenBE, milian)
- * Added MinSpareThread\MaxSpareThreads to Apache highlighter (BenBE)
- * Added new Keyword group for APT sources.list highlighter (BenBE)
- * Fixed highlighting in LaTeX for \begin{} and \end{}, i.e. the stuff inside
- the curly braces. (milian, thanks for the report go to Matthias Pospiech)
- * Improved String support for D (BenBE)
- * MySQL was seriously broken (BenBE)
- * Reworked Keyword groups for MySQL to allow for more configuration (BenBE)
- * Improved Mirc script language file (milian)
- * Improved C++ Qt language file (milian)
- * Minor bug with Transpose Operator in Matlab (BenBE, Daniele de Rigo)
- * Highlighting of Batch Files for Windows (BenBE)
- * Updated AutoIt to include latest changes for AutoIt v3.2.12.1 (BenBE, Thierry)
- * Fixed duplicate keyword warnings for Perl, Tcl and Typoscript (BenBE)
- * Fixed Doc-URL getting reparsed by highlighted keywords of other groups (BenBE, Jordi Boggiano)
-Version 1.0.8
- - Added language files
- * APT sources.list (milian)
- * Boo (Marcus Griep)
- * CIL (Common Intermediate Language, .NET Assembly) (Marcus Griep)
- * COBOL (Benny Baumann)
- * Gnuplot (milian)
- * KLoneC (Mickael Auger)
- * KLoneC++ (Mickael Auger)
- * PIC16xxx assembler (Phil Mattison)
- * POV-Ray (Carl Fürstenberg)
- * PowerShell (Frode Aarebrot)
- * Progress (Marco Aurelio de Pasqual)
- * TypoScript (Jan-Philipp Halle)
- * Xorg configuration (milian)
- - Make GeSHi's constructor arguments optional, so something like `$foo = new GeSHi;` is possible. (milian)
- - Added an optimizer for lists to regular expressions. Using these cached lists results in a speedup of approx. 50%.
- The slightly increased memory consumption (~150KB for PHP language file) is more than worth it! (milian)
- - Some more memory & speed optimizations all over GeSHi (milian)
- * Reduced memory overhead when highlighting keywords (BenBE)
- * Keyword Linking now uses considerably less strtolower calls (milian)
- * Cache Symbol Search Regexp and make Symbol Highlighting faster (milian)
- * Use more native functions like substr_replace and strcasecmp to speed things up (milian)
- * Use considerably less strlen() calls on various points by caching the results (milian)
- * Properly set comments to be case insensitive where appropriate to increase performance (milian)
- * Improve the performance of the strict mode tokenizer, making highlighting of languages like
- HTML, ColdFusion or XML faster (milian)
- * Setup caches for parsing on demand to make stylesheet generators fast (milian)
- - Various improvements to Strict Block Handling (BenBE, milian)
- * Added support for RegExp-based Strict Blocks (BenBE)
- * Fixed highlighting incorrectly stopping at ?> in PHP (SF#1330968, BenBE)
- * Languages with STRICT_MODE_APPLIES = GESHI_MAYBE default to strict mode now. When no highlightable
- code is found in this mode, we fallback to the same setting as if GESHI_NEVER was set. That way it
- should not be needed to call enable_strictmode() manually. (milian)
- - Added new GESHI_HEADER_PRE_VALID type which uses the following markup: (milian)
- * With line numbers: <div>header<ol><li><pre>...</pre></li>...</ol></div>
- * Without line numbers: <pre>header...CODE...</pre>
- => valid HTML and no need for &nbsp; indentation
- - Added new GESHI_HEADER_PRE_TABLE type which can be used to prevent linenumber-selection in Firefox
- on copy'n'paste. (milian)
- - set_language will not reset any language settings by default anymore.
- * Added $force_reset param for to force full reload of a language. (milian)
- * Make sure strict_mode is set properly when doing repeated set_language calls (milian)
- - Fixed some problems with old PHP versions (SF#1975625, milian, BenBE)
- - Fixed broken use with Suhosin Patch when /e modifier was disabled (SF#2021800, BenBE)
- - Added support for external style information files to override language defaults without modifying language files (BenBE)
- - The overall_class is now up to the user, and the language-code is _always_ added as a class (milian)
- - Fixed Economy Mode for GeSHi::get_stylesheet() - now it just makes so much more sense! (milian)
- - Fixed Economy Mode when COMMENT_REGEXP are used (BenBE)
- - Changed the default encoding to use UTF-8, due to SF#2037598, BenBE)
- - Improved overall string support:
- * Added support for multichar string delimiters (SF#1932083, BenBE)
- * Fixed problems of unfinished strings and comments producing invalid XHTML (SF#1996353, BenBE)
- * Multichar Quotemarks sometimes had inconsistent behaviour (BenBE)
- * Support for multiple styles of strings depending on the starter (BenBE)
- * Properly handle escapes in strings, i.e. '\\' was not working properly before (milian)
- * Fixed escape char support when an escape char is followed by multi-byte chars (SF#2037598, BenBE)
- - Improved flexibility in language files (BenBE, milian)
- * Added PARSER_CONTROL for OOLANG method highlighting (SF#1923060, BenBE)
- * Added possibility to define strict blocks using an Regexp (BenBE)
- * Removed explicit escaping of / in Regular Expressions (BenBE)
- * Ignoring empty keyword groups when highlighting (milian)
- * Make language_permissions configurable in language files via ['PARSER_CONTROL']['ENABLE_FLAGS']
- this makes is_a calls unneeded and thus prevents PHP notices in PHP 5.x (milian)
- * Extended support for number formats now covering the most common formats (SF#1923058, BenBE)
- * Lifted a limitation that keywords had to have at least 2 subsequent letters (BenBE)
- * Changed behaviour of PARSER_CONTROL now allowing to provide the full Lookahead and Lookbehind
- expressions used as delimiters inside keywords instead of a simple char group (BenBE)
- * Fixed improper handling of newlines in REGEXPS so this does not produce invalid html anylonger (milian)
- - Some typos and mistakes in the documentation (BenBE)
- - Added a script to contrib/ to verify language files are correct (BenBE)
- - Fixed loads of compliancy warnings detected with that automated compliance testing script (BenBE)
- - Many other improvements to various language files (BenBE, milian)
- * Reduce strict errors & notices for language files (milian)
- * Fixed symbol highlighting with C++ sometimes missing keywords after ; and comments (BenBE)
- * Improved comment handling with TCL (Lars Hellström, BenBE)
- * Fixed broken handling with XML comments (BenBE, SF#1849233)
- * Fixed HTML comments spawning multiple lines producing invalid XHTML output (SF#1738173, BenBE)
- * Added support for parameters beginning with dash in BASH language (BenBE)
- * Support Apache's configuration sections, see http://httpd.apache.org/docs/2.2/sections.html (milian)
- * Minor issue with PHP Heredoc and Nowdoc syntax sometimes not getting highlighted (BenBE)
- * Updated Objective-C language file (SF#2013961, Quinn Taylor, BenBE)
- * Added some keywords for VHDL (beshig, BenBE)
- * Fixed severly broken ColdFusion language file (milian)
- * Fixed some incorrectly highlighted things with the CSS language file (milian, BenBE)
- * Improved Smarty language file (milian)
- * Improved CSS language file (milian)
- * Improved Pascal language file (milian)
- * Improved LaTeX language file (Андрей Парамонов, BenBE)
- * Fixed a regular expression in mIRC language file that caused a warning message to be issued (BenBE)
- * Removed <, > and / from HTML names, now only containing the real tag names (BenBE)
- * Use spaces instead of tabs for indendation in language files to have a consistent
- coding standard accross geshi files (milian)
- * Added some comment styles, keywords and added index highlighting (Chusslove Illich, Часлав Илић)
- - Removed some private methods which were only called at exactly one place (milian)
- * format_header_content
- * format_footer_content
- * get_attributes
- - Second part of default style changes. Affected in this release:
- * C++
- * C++ (QT)
- * CSS
- * VHDL
-Version 1.0.7.22
- - Added language files
- * glSlang (BenBE)
- * KiXtart (Riley McArdle)
- * Lotus Notes @Formulas (Richard Civil)
- * LotusScript (Richard Civil)
- * MXML (David Spurr)
- * Scala (Franco Lombardo)
- * ActionScript 3 (Jordi Boggiano)
- * GNU Gettext .po/.pot (Milian Wolff)
- * Verilog (Günter Dannoritzer)
- - Fixed a problem not yet addressed in 1.0.7.21 regarding highlighting of
- symbols that caused some extra characters to be added in the output or
- broke highlighting and standard compliance due to missing escaping of
- internally used characters (SF#192320 and SF#1926259, BenBE)
- - Fixed missing style information for ocaml language file (The_PHP_Jedi)
- - Fixed a bug causing masses of warnings in rendered output if language file
- miss style information (The_PHP_Jedi, BenBE)
- - Missing tab width information could lead to warnings (BenBE)
- - Missing symbol information for ASP (SF#1952038, nfsupport, BenBE)
- - Empty delimiter message with OOoBasic (BenBE, Ccornell)
- - Escaping of comments in LaTeX ignored (SF#1749806, BenBE)
- - Modified Math environment $$ in LaTeX to be non-greedy (BenBE)
- - Added possibility to match a regexp as comment (SF#1914640, SF#1945301, SF#1934832, BenBE)
- - Introduced C-Style multiline continuation comments (SF#1914640, SF#1945301, BenBE)
- - Introduced Fortran Comments (SF#1914640, SF#1934832, BenBE)
- - Implemented Heredoc and Nowdoc Syntax for PHP and Perl (SF#1914640, BenBE)
- - Implemented Compiler Directives for Delphi (SF#1914640, BenBE)
- - Implemented minimalistic support for JavaScript \ Perl Regular Expressions (SF#1786665, SF#1754333, SF#1956631, BenBE)
- - Fixed Strings in Matlab to be handled as comments instead of regexps, to prevent keywords being linked (BenBE)
- - Applied PARSER_CONTROL fix of CPP for CPP-QT-Derivative (BenBE)
- - Fixed incorrect treatment of unequally long multiline comment separators (related to SF #1891630, BenBE)
- - Added PARSER_CONTROL settings for keywords in ASM language file (SF#1835148, BenBE)
- - Fixed missing CASSE_SENSITIVE entry for DOS language file (SF#1956314, BenBE)
- - Fixed accidential highlighting of keywords in argument names (SF#1956456, Milian Wolff, BenBE)
- - Fixed yet again some #-related bash problem (SF#1956459, Milian Wolff, BenBE)
- - Added backticks as symbols (Milian Wolff)
- - Example script remembers selections and source submitted (Milian Wolff)
- - Example script allows remembered source and preselected language to be cleared (Milian Wolff)
- - Example script now properly includes geshi and doesn't suppress error messages anylonger. (Milian Wolff)
- - Code cleanup by using direct string indexing instead of substr with length 1 (Milian Wolff)
- - Optimized generation of code parts in strict mode (Milian Wolff)
- - Optimized COMMENT_REGEXP by using an incremental regexp cache (Milian Wolff, BenBE)
- - Fixed a problem that rarely skipped highlighting of escaped chars which usually should have gotten highlighted (BenBE)
- - Optimized generation of highlighted strings to use fast skip forward while highlighting them (Milian Wolff, BenBE)
- - Optimization using basic rework of indent function improving tab expansion performance (BenBE)
- - Lots of other minor optimizations based on coding style improvements (Milian Wolff)
- - Implemented setting to force spans to be closed before newlines, see SF#1727398 (Milian Wolff)
- - Added missing credits for D language file to THANKS file (SF#1720899, BenBE)
- - Optimization to prevent loading the current language file twice (Milian Wolff)
- - Optimization: Use file_get_contents() to load sourcecode from files.
- Even if GeSHi worked with PHP 4.1 before, it doesn't now. (Milian Wolff)
- - Added description of extra language features (SF#1970248, BenBE)
- - Added support for highlighting the C# using and namespace directives (SF #1395677, BenBE)
- - Added support for highlighting the Java import and package directives (SF #1395677, BenBE)
- - Fixed minor problem in Haskell cuasing accidential start of comment (SF#1987221, BenBE)
- - Fixed minor issue causing loads of warnings if a language files defines no symbols (BenBE)
- - Updated some aspects of the documentation and included further hints (BenBE)
- - First of series of color scheme changes. Affected languages (sofar):
- * Assembler (x86)
- * Bash
- * C
- * C#
- * Delphi
- * Fortran77
- * glSlang
- * Java & Java 5
- * JavaScript
- * OCaml
- * OpenOffice.org Basic
- * Pascal
- * Perl
- * PHP and PHP-Brief
-Version 1.0.7.21
- - Added language files
- * Basic4GL (Matthew Webb)
- - Fixed problem with mIRC language highlighting spaces only (BenBE)
- - Language files can now specify a function to be called to decide the
- colour of a regular expression match
- - Added single quote to Lua (Darrin Roenfanz)
- - Compare comments case insensitively (fixes AutoIT comments somewhat)
- (Daniel Gordon)
- - Fixed symbols not being highlighted at all (SF #1767953, BenBE)
- - Fixed brackets not correctly managed (SF #1767954, BenBE)
- - Changed default languages for some extensions
- - Included color and character information for symbol highlighting in some languages (BenBE)
- - Fixed a problem with extension detection if default was used (BenBE)
- - Fixed a highlighting problem with the LaTeX language (SF #1776182, BenBE)
- - Added a new parameter for enable_highlighting to reduce source duplication (SF #1786104, BenBE)
- - Updated doxygen documentation to include since tags and some missing parameters
- - Disabled symbol highlighting by default (doesn't affect brackets, cf. documentation) (BenBE)
- - Added a check for set_case_keywords for the given param to be supported (BenBE)
- - Minor rework of the HTML documentation layout \ W3C compliance (BenBE)
- - Fixed highlighting error in bash language avoiding keywords in comments (SF #1786314, SF #1564839, BenBE)
- - Fixed template params for C++ and C# not being highlighted (SF #1772919, BenBE)
- - Fixed more reported problems about mirc highlighting
- - Added some missing keywords for VB.NET
- - Fixed some warnings in DOS language file (Florian Angehrn)
- - Add possibility to handle more than one extra line style (SF #1698255, German Rumm, BenBE)
- - Fixed handling of URLs when output case differs from URL case (SF #1815504, Tom Samstag, BenBE)
- - Fixed POD (Plain Old Documentation) format problems breaking highlighting of Perl (SF #1891630, Shannon Wynter, BenBE)
- - Fixed a problem with mIRC when & was used for identifiers (SF #1875552, BenBE)
-Version 1.0.7.20
- - Added language files
- * Genero (logic) and Per (forms) (FOURJ's Genero 4GL) (Lars Gersmann)
- * Haskell (Dagit)
- * ABAP (Andres Picazo)
- * Motorola 68k Assembler (for MC68HC908GP32 Microcontroller) (BenBE)
- * Dot (Adrien Friggeri)
- - Fixed java documentation search for keywords to actually go to the
- documentation (spaze)
- - Applied fix for bug 1688864 (bad regexes) (Tim Starling)
- - Fixed comment CSS rule in visualfoxpro
- - ThinBASIC language update (Eros Olmi)
- - mIRC language update (BenBE)
- - Fixed outdated documentation URL of Perl language file (RuralMoon by BenBE)
- - Fixed tab replacement code not generating the correct number of spaces in
- some cases (Guillermo Calvo)
- - Fixed two typos in Z80 language file
- - Applied fix for bug 1730168 (Daniel Naber)
- - Applied fix for bug 1705482 (Jason Frame)
- * Configurable line endings (Replace \n by custom string)
- * per-language tab-widths (Adjustable for width>=1)
- * Included defaults for ASM (x86, m68k, z80), C, C (Mac), C++, C++ (QT), C#,
- Delphi, CSS,, HTML, PHP, PHP (Brief), QBasic, Ruby, XML
- - Added a possibility to force generation of a surrounding tag around
- the highlighted source
- - Applied fix for additional keywords for the bash language
- (cf. http://bash.thefreebizhost.com/bash_geshi.php, BenBE / Jan G)
- - Fix bad colour definition in GML language (Andreas Gohr)
- - Fixed phpdoc comments not being indented one space if they should be (Andy
- Hassall)
-Version 1.0.7.19
- - Added language files
- * X++ (Simon Butcher)
- * Rails (Moises Deniz)
- - Fixed invalid HTML being generated and doctypes not being highlighted over
- multiple lines properly when line numbers are on (Validome)
- - Improved the ruby syntax highlighting by basing it off the Rails file
- - Changed some regular expressions to possibly help with badly performing
- regex support in PHP (Tim Starling)
- - Allow {TIME}, {LANGUAGE} and {VERSION} to be used in the header as well as
- the normal <TIME>/<LANGUAGE>/<VERSION> (AthanD)
- - Changed comment regex in bash to prevent malformed XHTML (rv1971)
-Version 1.0.7.18
- - Added language files
- * ZiLOG Z80 Assembly (BenBE)
- - Fixed incorrect highlighting when the starter of a multiline comment is
- longer than the ender (Robert Anthony).
- - Fixed "</span" generated if a multiline comment is the last thing in the
- source (related to the above).
- - Added #cs => #ce comment markers to AutoIT (Robert Anthony)
- - Fixed spelling mistake for keyword in Python (wd3)
- - Added a method to enable/disable keyword linking (Ian McKellar)
- - Improved empty line detection for HTML output (BenBE)
- - Changed code style of geshi.php, and removed tabs
-Version 1.0.7.17
- - Fixed up ends of files having too many newlines (binarygroop)
- - Removed background colour on keyword group in eiffel (Julian Tschannen)
- - Removed GESHI_DIR_SEPARATOR constant usage, it's unnecessary (Aleksey Zapparov)
- - Added /* ... */ comments to coldfusion (Jeff Howden)
-Version 1.0.7.16
- - Added language files
- * ActionScript (Steffen Krause)
- * C++/QT (Iulian M)
- * PL/SQL (Victor Engmark)
- - Fixed up my e-mail address everywhere
- - Fixed notice with "error" property (IZIU Zielona Góra)
- - Added some entries to the get_language_name_from_extension table
- (Stebastian Schuberth)
-Version 1.0.7.15
- - Added language files
- * BNF (Rowan Rodrik van der Molen)
- * IO (me, thanks to Johnathan Wright)
- * mIRC (Alberto de Areba Sánchez)
- - Fixed use of colon in XML (Grigory Rubtsov)
- - Fixed notices in text.php, reg.php and latex.php when $this is not
- available (Clemens Weiß)
- - Made third parameter of geshi_highlight optional (Gaetano Giunta)
- - Fix incorrect highlighting of the $# variable in bash (Michael Knight)
- - Fixed single line comment mistake in thinbasic.php (Eros Olmi)
-Version 1.0.7.14
- - Added language files
- * thinBasic (Eros Olmi)
- * LaTeX (Matthais Pospiech)
- - Removed extra newlines at the end of some files
- - Fixed SF bug 1556404 - check before using $this in language files
- (Clemens Weiß)
-Version 1.0.7.13
- - Added language files
- * Uno IDL (Cedric Bosdonnat)
- - Fixed add_ids causing odd XHTML (RyanJ)
- - Fixed extra newline being added to end of result (Andreas Gohr)
-Version 1.0.7.12
- - Fixed lines being collapsed when they contain just a space (artlover)
- - Allowed matching for regexes using start/end matchers at the start/end
- of the code (Sheri)
- - Added (dubious) fix for google "I'm feeling lucky" search for java keywords
- (dubious in that it doesn't work for me)
- - mysql - Made the symbols into their own keyword group as the symbol group
- isn't used. Added a style for multiline comments.
- - Added a couple of php5 keywords to the php language files.
- - Allow XML tags to have dashes.
- - Changed LANG_NAME for many languages to be more sensible/correct case
- (Matthias Mohr)
- - Added case-sensitivity indices to python
-Version 1.0.7.11
- - Added language files
- * Smalltalk (Bananeweizen)
- - Minor style improvements to matlab
- - Moved a couple of functions to the correct group in smarty (arwan)
-Version 1.0.7.10
- - Added language files
- * TCL (Reid van Melle)
- * Winbatch (Craig Storey)
- * Groovy (Ivan F. Villanueva B.)
- * Text (SmokingRope)
- * Reg (SmokingRope)
- - Removed \ as an escape character in T-SQL (Dave Jackson)
- - Reset extra lines to highlight if source is changed (Diogo Resende)
- - Allow setting of lexic permissions in language files (SmokingRope)
- - Allow regexes to set a CSS class name (SmokingRope)
- - Added URL support to DOS language (mastrboy)
-Version 1.0.7.9
- - Added language files
- * Fortran (Cedric Arrabie)
- * SAS (Galen Johnson)
- * CFDG (John Horigan)
- - Fixed & in URL in java5 (Clemens Weiß)
- - Added MD5 and SHA1 to mysql keywords (polarina)
- - Fixes for highlight_lines_extra with line numbers (ithcy)
- - Fixed backslash characters being removed (ArTourter)
-Version 1.0.7.8
- - Fixed blank at start of MySQL file (W. Tasin)
- - Fixed smarty functions being broken (ultrabob)
- - Changed keyword and regexp detection and parsing
- slightly to allow more "meta characters" (like #) in
- keywords
- - Minor fixes for XML and GML
-Version 1.0.7.7
- - Added language files
- * T-SQL (Duncan Lock)
- * Robots.txt (Christian Lescuyer)
- * AutoIT (mastrboy)
- * Java 5 (Clemens Bruckmann)
- * ColdFusion (Diego)
- - A few keyword changes in java, removed :: object splitter (amphi)
- - Now using a simpler regular expression for numbers (Brice Bernard)
- - Fixed ah, bh etc. regs being highlighted as numbers (Unknown)
-Version 1.0.7.6
- - Fix backtick-string highlighting in ruby (Juan J. Martínez)
- - Add =begin multiline comments in ruby (Juan J. Martínez)
- - Added support for :keywords and ::access in lisp (Denis Mashkevich)
- - Prevented number highlighting if they are just after underscores (Joce)
- - Removed escape characters for strings in XML and HTML (floele)
- - Added instanceof keyword to java (jgottschling)
- - Fixed comments in ASP (SBD)
- - Removed unnecessary keyword style index from ini
- - Added support for " strings in ini
- - Removed unnecessary regex style index from blitzbasic
- - Keyword case of URL-ed keywords should be defined by language file (Benny Baumann)
- - Added "Hardquote" feature, provides more accurate string highlighting (Cliff Stanford)
- - Used hardquote support for @"..." strings in C# (Cliff Stanford)
- - Used hardquote support for ' strings in perl (Cliff Stanford)
- - Fixed setting of language path (Cliff Stanford)
- - Display source correctly formatted with line numbers (if requested) if an error
- has occured (several people)
- - Having no source to highlight is not an error condition anymore
- - Delphi language updated to include more keywords and types (BenBE)
- - Updated NSIS to version 2.11 (deguix)
-Version 1.0.7.5
- - Fix for using escape characters to escape newlines breaking XHTML compliance (Yves Goergen)
- - Fixed method highlighting in VB (Matt Beale)
- - Fixed multiline comment highlighting in SQL (MrBaseball34)
- - Fixed two ">" symbols being outputted when using a footer but not CSS classes (MrBaseball34)
- - Marked important block stuff as deprecated
- - Some documentation tidyup
- - Updated GML language file (Jos? Jorge Enr?quez Rodr?guez)
- - THANKS file tidied up
- - Fixed double </a> for elements in HTML (Yves Goergen)
- - Added some keywords for ASM (Dreuzzo)
-Version 1.0.7.4
- - Added language files
- * MySQL (Carl Fürstenberg)
- * BlitzBasic (Pàdraig O`Connel)
- - Fixed up geshi_highlight function: it now correctly uses <code> instead of <div> (Remi Faure)
- - When using GESHI_HEADER_NONE, remove the <ol> if line numbering is not enabled
- - Commented example.php so people can use it as a guide better
- - Fixed extra newline being generated if a comment is at the end
- of the source (many people, including Yves Goergen)
- - Fixed up some documentation issues
- - Some minor language file fixes (C++, Lua) (Lua fixes by chromix)
- - Fixed up no </span> in XML and other strict languages (regression from 1.0.7.3 fix: removed
- unnecessary </span> when using strict mode) (Daniel Ecer, drskrud),
-Version 1.0.7.3
- - Added language files
- * Scheme (Jon Raphaelson)
- * Ocaml and Ocaml-brief (Flaie)
- * Ruby (Amit Gupta)
- - Make urls generated for java highlighting XHTML compliant (Tim Van Wassenhove)
- - Removed unnecessary </span> when using strict mode (Tim Van Wassenhove)
- - Fixed warning in dos.php about undefined constant (Tim Van Wassenhove)
- - Fixed security hole in contrib/example.php - able to view any file if source
- not set and language is set to wierd value (Maksymilian Arciemowicz)
-Version 1.0.7.2
- - Added language files
- * Inno (Thomas Klinger)
- * Ini (Deguix)
- * DOS (Batchfile) (Alessandro Staltali)
- * Applescript (Stephan Klimek)
- * Freebasic (Roberto Rossi)
- * SDLBasic (Roberto Rossi)
- * ActionScript (links to French documentation) (NikO)
- - NSIS language file updated (deguix)
- - Lua language file updated (Roberto Rossi)
- - Bugfix: Styles incorrectly overriding default styles instead of being merged
- in set_*_styles methods (Stebastian Werner)
- - Added GESHI_HEADER_NONE as valid header type. This still allows header content.
-Version 1.0.7.1
- - Added language files:
- * Div (Gabriel Lorenzo)
- * GML (José Jorge Enríquez Rodríguez)
- * Eiffel (Zoran Simic)
- - Minor change to rules regarding when keywords can appear - now dots (.) are
- allowed before keywords. (NikO)
- - Bugfix: the line style for non-fancy lines when fancy highlighting is enabled
- is now applied (Amit Gupta)
-Version 1.0.7
- - Added language files:
- * Diff (Conny Brunnkvist)
- * VHDL (Alexander Krause)
- * D (Thomas Kuehne)
- * Matlab (Florian Knorn)
- - Python highlighting improved (thither, Federico Quagliata)
- - Changed file comments to use phpdoc syntax, and changed code style to be more
- like PEAR
- - Fixed bug in set_code_style: Second parameter is now optional
- - The $_GESHI_ERRORS array is gone, error messages are internal to the GeSHi class
- - Changed name of XML language to XML from HTML
- - Removed min and max tab width checks
- - Backported GeSHi 1.1.X's automatic language file path detection so you no longer
- need to use the third parameter of the constructor or set_language_path except for
- special circumstances.
- - Source is checked to make sure it is not empty else an error occurs
- - Removed excess characters after ?> in ada.php, apache.php and cpp.php that caused
- http headers to be sent (psichron)
- - Removed second "foreach" keyword for smarty language file that was causing
- duplication (Iss)
- - Added underscore to allowed characters in match for XML tags (anonymous)
- - Added some missing java keywords like "abstract" and "transient"
- - Added "list" and "continue" PHP keywords
- - set_language resets error status and strict mode (Andrew Black)
- - Removed margin:0 declaration from cssgen.php (Andrzej Kubaszek)
- - Fixed multiline comment selector in cssgen.php (Andrzej Kubaszek)
-Version 1.0.6
- - Added support for smart tabs - tabs that behave just like normal tabs when in
- GESHI_HEADER_DIV mode.
- - Partial patch for UTF-8 encoding applied (doesn't quite work however...)
-Version 1.0.5
- - Added language files:
- * MPASM (Bakalex)
- * Oracle 8 (Guy Wicks)
- - Fixed bug where not using an encoding type would sometime result in warnings (although
- there still seems to be issues with encoding in general that I'm trying to gather more
- data on) (Alexander Spennemann)
- - Removed "margin: 0" from <ol> in an attempt to make line numbers visible in IE again
- by default (untested, but I don't really care if it works... get firefox! ;))
- - Added note on php5 support (Karim Scheik)
- - Added two new methods: load_from_file and get_language_name_from_extension, that can
- help automate file highlighting (though the extension array at this time is quite bare)
- (David Gartner, Brian Cheesman)
-Version 1.0.4
- - Fixed many version-reporting bugs (Jack Lloyd)
- - Fixed bug where methods were not having the correct CSS generated for them
- by get_stylesheet() (Jack Lloyd)
- - Added new keywords to C and C++ files (Jack Lloyd)
- - Added section on case sensitivity to documentation that wasn't in the other versions
-Version 1.0.3
- - Added language files:
- * Smarty (Alan Juden)
- * C# (Alan Juden)
- * VB.NET (Alan Juden)
- * C for Macs (M. Uli Kusterer)
- * Objective C (M. Uli Kusterer)
- - Links can have a target attribute (Andreas Gohr)
- - Fixed multiline string bug if not using classes
- - Added method set_encoding that allows you to set the character
- set used by calls to htmlentities() in GeSHi
- - You can now specify an array of object splitters, and each
- type of method separated by each object splitter can be highlighted
- differently
- - If a language uses a case sensitive keyword group and that group
- has a URL associated with it, the keyword will not be lowercased
- in the URL (M. Uli Kusterer)
-Version 1.0.2
- - Added language files:
- * Actionscript (Steffen Krause)
- * ASP (Amit Gupta)
- * Bash (Andreas Gohr)
- * CADDCL (Roberto Rossi)
- * CadLisp (Roberto Rossi)
- * C++ (Dennis Bayer)
- * Delphi (Járja Norbert)
- * Javascript (Ben Keen)
- * Lisp (Roberto Rossi)
- * OpenOffice.org BASIC (Roberto Rossi)
- * Perl (Andreas Gohr and Ben Keen)
- * Python (Roberto Rossi)
- * VisualFoxPro (Roberto Armellin)
- * XML (Nigel McNie, from an idea/file by Christian Weiske)
- - Added contrib/ directory with script to create one external stylesheet
- from many languages(base script by Andreas Gohr, modified by Nigel McNie),
- and an example script (needs lotsa work...)
- - Code lines can have their own unique ID (for use with javascript)
- (suggested by Andreas von Oettingen)
- - Certain rows can be specified to be highlighted differently (suggested by
- Andreas von Oettingen)
- - Getter available for human-readable language name (suggested by Simon Patterson)
- - Line numbers aren't highlighted when a user selects the code
- - Contextual highlighting with <BEGIN GeSHi> ... <END GeSHi> in the code (which
- can be disabled)
- - Functions can be made into URLs to appropriate documentation (suggested
- by cybot_tm). Also thanks to Marcin Gryszkalis for the links for C, Java
- and Perl.
- - Code can have a header and footer
- - Time taken to parse the code is recorded and made available with the get_time()
- method
- - error() now returns a human-readable error message
- - Function geshi_highlight added to make it even easier to highlight on the fly
- - Advanced regular expression handling
- - Bug fixes to lexic_permission handling
-Version 1.0.1
- - Added methods set_symbols_style() and set_symbols_highlighting(). These should be used
- instead of set_brackets_style and set_brackets_highlighting respectively.
- - Added a new field - language_path - that can be set either when the constructor is
- called, or by the new method set_language_path(), that specifies a path to the directory
- containing the language files (bug reported by bbspliff)
- - Added a new method set_case_keywords(), that allows the auto-casing feature to be
- changed on the fly instead of simply being specified in the language file
- - If there is an error the source that is outputted is now handled much better
- - Lines are broken in the source only by \n now, not by \r\n (to save on output source)
- - Indentation moved into its own method
- - Method header() modified to allow the user to choose whether the code is surrounded in
- a <div> or a <pre> (see documentation for benefits of both). Method footer() likewise
- modified.
- - Method get_stylesheet() modified so that a smaller comment is outputted in economy mode,
- and bugs with when line number classes are outputted in economy mode have been fixed
- - Bug where spans had two quotes at the end of the attributes fixed (ie. <span style=".."">)
- - Added language files:
- * Ada (Tux)
- * Apache log file (Tux)
- * ASM (Tux)
- * NSIS (Tux)
- * Pascal (Tux)
-Version 1.0.0
- - Initial Release \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/COPYING b/libvpx/examples/includes/geshi/docs/COPYING
deleted file mode 100644
index 5b6e7c6..0000000
--- a/libvpx/examples/includes/geshi/docs/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users. This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
- To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
- We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
- Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software. If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
- Finally, any free program is threatened constantly by software
-patents. We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary. To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- GNU GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License. The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language. (Hereinafter, translation is included without limitation in
-the term "modification".) Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
- 1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
- 2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) You must cause the modified files to carry prominent notices
- stating that you changed the files and the date of any change.
-
- b) You must cause any work that you distribute or publish, that in
- whole or in part contains or is derived from the Program or any
- part thereof, to be licensed as a whole at no charge to all third
- parties under the terms of this License.
-
- c) If the modified program normally reads commands interactively
- when run, you must cause it, when started running for such
- interactive use in the most ordinary way, to print or display an
- announcement including an appropriate copyright notice and a
- notice that there is no warranty (or else, saying that you provide
- a warranty) and that users may redistribute the program under
- these conditions, and telling the user how to view a copy of this
- License. (Exception: if the Program itself is interactive but
- does not normally print such an announcement, your work based on
- the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
- a) Accompany it with the complete corresponding machine-readable
- source code, which must be distributed under the terms of Sections
- 1 and 2 above on a medium customarily used for software interchange; or,
-
- b) Accompany it with a written offer, valid for at least three
- years, to give any third party, for a charge no more than your
- cost of physically performing source distribution, a complete
- machine-readable copy of the corresponding source code, to be
- distributed under the terms of Sections 1 and 2 above on a medium
- customarily used for software interchange; or,
-
- c) Accompany it with the information you received as to the offer
- to distribute corresponding source code. (This alternative is
- allowed only for noncommercial distribution and only if you
- received the program in object code or executable form with such
- an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it. For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable. However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
- 5. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Program or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
- 6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
- 7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all. For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded. In such case, this License incorporates
-the limitation as if written in the body of this License.
-
- 9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation. If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
- 10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission. For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this. Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
- NO WARRANTY
-
- 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
- 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program is interactive, make it output a short notice like this
-when it starts in an interactive mode:
-
- Gnomovision version 69, Copyright (C) year name of author
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the program
- `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
- <signature of Ty Coon>, 1 April 1989
- Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs. If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/libvpx/examples/includes/geshi/docs/README b/libvpx/examples/includes/geshi/docs/README
deleted file mode 100644
index a08e78e..0000000
--- a/libvpx/examples/includes/geshi/docs/README
+++ /dev/null
@@ -1,33 +0,0 @@
-
- GeSHi - GEneric Syntax HIghlighter
- ----------------------------------
- Version 1.0.8
-
-Author: Nigel McNie, Benny Baumann
-Email: nigel@geshi.org, BenBE@omorphia.de
-GeSHi Website: http://qbnz.com/highlighter
-
-GeSHi is a generic syntax highlighter, written in PHP. You simply
-input the source code you wish to highlight with the language you
-wish to use, and the output will be a file syntax highlighted to
-XHTML standards.
-
-For more information on how to use GeSHi, please consult the
-documentation. If you got this readme from a GeSHi package, then
-the documentation is available in the docs/ directory. Documentation
-is also available at http://qbnz.com/highlighter/documentation.php
-
-If you think you've found a bug in GeSHi, contact me with a bug
-report at BenBE@omorphia.de, or submit it to the bug tracker at
-http://sourceforge.net/tracker/?group_id=114997&atid=670231. Be
-aware that minor highlighting errors may well just be incorrect
-language files, but if you do find something major please contact me.
-
-And if you're using GeSHi as a plugin/mod for some other software,
-please tell me about it! It's worth a link to you, and I can give
-you specialist help if you need it.
-
-GeSHi is free software, released under the GNU GPL. Please see the
-COPYING file for more information. If you do modify this program,
-please tell me about it! Perhaps you've made a good improvement that
-I can learn from :)
diff --git a/libvpx/examples/includes/geshi/docs/THANKS b/libvpx/examples/includes/geshi/docs/THANKS
deleted file mode 100644
index 9580567..0000000
--- a/libvpx/examples/includes/geshi/docs/THANKS
+++ /dev/null
@@ -1,163 +0,0 @@
-
- THANKS - List of credits for GeSHi
-
-I owe these people/groups my thanks for help with GeSHi. Thanks, guys!
-
-- Amit Gupta - Thanks for all that constructive criticism - it's
- a great help for making GeSHi even better. And
- thanks for the Wordpress plugin! (Anyone who is
- interested in the plugin can visit:
- http://blog.igeek.info/still-fresh/category/wp-plugins/igsyntax-hiliter/)
-- Andreas Gohr - Thanks for language files and for using GeSHi for DokuWiki
- (http://www.splitbrain.org/dokuwiki/wiki:dokuwiki). And thanks
- for all your criticisms and for that stylesheet-maker code :).
- Also, thanks for the UTF-8 patch.
-- Andreas von Oettingen - Thanks for those great ideas! :)
-- bbspliff - Thanks for pointing out that bug (pity I already
- found it though ;))
-- Benny Baumann - Thanks for your innumerable suggestions for improvements, and your
- work on Delphi support :)
-- Ben Keen - Thanks for the language files and pointing out some
- ideas for future releases. Lookin' forward to seeing that
- software soon! ;)
-- Brian Cheesman - Thanks for using GeSHi in phpCvsView, and for the suggestion about
- extension => language lookup
-- Christian Weiske - Thanks for the inspiration for creating advanced regexp
- highlighting :D
-- Cliff Stanford - Thanks for the hardquote support for C# and Perl (can be used elsewhere
- I'm sure)
-- David Gartner - Thanks for using GeSHi in net2ftp, and for the idea about a load_from_file
- method
-- forum.qbasicnews.com - Thanks for putting up with the crappy versions
- that I "forced" on you guys before ;)
-- Jack Lloyd - Thanks for pointing out the versioning and method CSS bugs, and giving
- me the extra C/C++ keywords
-- Karim Scheik - Thanks for the php5 support report
-- Marcin Gryszkalis - Thanks for those links for C, Java, Perl
-- M. Uli Kusterer - Thanks for the idea about URL case conversion
-- Milian Wolff - Thanks for the loads of optimizations
- - Thanks for helping with implementation of various features
-- Roberto Armellin - Thanks for pointing out some flaws in GeSHi (that will be solved
- in 1.2 guaranteed)
-- Sterling Christensen - Thanks for those links to language specs
-- Tux - Thanks for making all those language files :D
-- zbw - Thanks for proving a phpBB port was possible
-
-PEOPE WHO MADE LANGUAGE FILES
-
-- ABAP Andres Picazo
-- Actionscript Steffen Krause (french translation by NikO)
-- ActionScript 3 Jordi Boggiano (version for ActionScript3 and MXML)
-- Ada Tux
-- Apache Tux
-- Applescript Stephan Klimek
-- Apt sources.list Milian Wolff
-- ASM Tux
-- ASP Amit Gupta
-- AutoIT mastrboy
-- AviSynth Ryan Jones
-- Bash Andreas Gohr
-- Basic4GL Matthew Webb
-- BlitzBasic P�draig O`Connel
-- BNF Rowan Rodrik van der Molen
-- Boo Marcus Griep
-- Brainfuck \ Brainfork Benny Baumann
-- C++ Dennis Bayer, M. Uli Kusterer
-- C++/QT Iulian M
-- C# Alan Juden
-- C for Macs M. Uli Kusterer
-- CADDCL Roberto Rossi
-- CadLisp Roberto Rossi
-- CDFG John Horigan
-- CIL Marcus Griep
-- COBOL Benny Baumann
-- ColdFusion Diego
-- D Thomas Kuehne
-- DCS Stelio Passaris
-- Delphi Járja Norbert, Benny Baumann
-- Div Gabriel Lorenzo
-- DOS Alessandro Staltari
-- Eiffel Zoran Simic
-- eMail \ mbox Benny Baumann
-- FreeBasic Roberto Rossi
-- Fortran Cedric Arrabie
-- glSlang Benny Baumann
-- Gettext Milian Wolff
-- GNU make Neil Bird
-- Gnuplot Milian Wolff
-- GML José Jorge Enríquez Rodríguez
-- Groovy Ivan F. Villanueva B.
-- Haskell Dagit
-- HQ9+ Benny Baumann
-- Ini Deguix
-- Inno Thomas Klinger
-- INTERCAL Benny Baumann
-- Java 5 Clemens Bruckmann
-- Javascript Ben Keen
-- KiXtart Riley McArdle
-- KLone C Mickael Auger
-- KLone C++ Mickael Auger
-- LaTeX Matthais Pospiech
-- Lisp Roberto Rossi
-- Locomotive Basic Nacho Cabanes
-- LOLcode Benny Baumann
-- LScript Beau McGuigan
-- LSL2 William Fry
-- Lua Roberto Rossi
-- m86k Benny Baumann
-- mIRC Alberto de Areba Sánchez
-- Modula-3 Martin Bishop
-- MPASM Bakalex
-- MXML David Spurr
-- MySQL Carl Fürstenberg, Marjolein Katsma
-- NSIS Tux, Deguix
-- Oberon-2 Mike Mol
-- Objective C M. Uli Kusterer
-- Ocaml Flaie
-- Ocaml-brief Flaie
-- OpenOffice.org BASIC Roberto Rossi
-- Oracle 8 Guy Wicks
-- Oracle 11i Simon Redhead
-- Pascal Tux
-- Perl Andreas Gohr, Ben Keen
-- PIC16xxx assembler Phil Mattison
-- Pixel Bender Richard Olsson
-- PL/SQL Victor Engmark
-- POV-Ray Carl Fürstenberg
-- PowerShell Frode Aarebrot
-- Progress Marco Aurelio de Pasqual
-- Prolog Benny Baumann
-- ProvideX Jeff Wilder
-- Python Roberto Rossi
-- Rails Moises Deniz
-- Rebol Lecanu Guillaume
-- Reg SmokingRope
-- Robots Christian Lescuyer
-- Ruby Amit Gupta, Moises Deniz
-- SAS Galen Johnson
-- SDLBasic Roberto Rossi
-- Scheme Jon Raphaelson
-- SciLab Christophe David
-- Smalltalk Bananeweizen
-- Smarty Alan Juden
-- T-SQL Duncan Lock
-- TeraTerm Boris Maisuradze
-- Text SmokingRope
-- TCL Reid van Melle
-- thinBasic Eros Olmi
-- TypoScript Jan-Philipp Halle
-- Uno IDL Cedric Bosdonnat
-- VB Roberto Rossi
-- VB.NET Alan Juden
-- Verilog Günter Dannoritzer
-- VIM Script Swaroop C H
-- Visual FoxPro Roberto Armellin
-- Visual Prolog Thomas Linder Puls
-- Whitespace Benny Baumann
-- Winbatch Craig Storey
-- X++ Simon Butcher
-- Xorg config Milian Wolff
-- Z80 Assembler Benny Baumann
-
-Do you want your name in here? Help me out! Make a language file, or suggest a new
-feature, or make a plugin for GeSHi for some other software, then tell me about it! \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/TODO b/libvpx/examples/includes/geshi/docs/TODO
deleted file mode 100644
index ee71c77..0000000
--- a/libvpx/examples/includes/geshi/docs/TODO
+++ /dev/null
@@ -1,71 +0,0 @@
- TODO - List of things to do as of 2005/01/29
-
-Suggestions for things to add are welcome, if you have a feature request you
-can either post it to the forums:
-
-http://qbnz.com/highlighter/forum.php
-
-Or to the feature request tracker:
-
-http://sourceforge.net/tracker/?group_id=114997&atid=670234
-
-
- TODO for version 1.0.8.x
-
-- Rework the load_from_file method and the one for getting a file extension,
- as documented in the source.
-- use analogous vars to $next_comment_regexp_pos for more GeSHi structures,
- should reduce number of functions called and hence improve performance
-- make a set of default colours which can be used in the language files.
- this way we can give languages a uniform look and maybe even add "themes"
-- Get better coverage in our coderepo
-- README / INSTALL / ... file for phpdoc integration => take geshi-doc.*?
-- rework HARDQUOTE + styles, currently this is a bit of a mess imo (milian)
-- Allow per-keywordgroup AutoCaps/NoCaps
-- Complete API to support latest features
- set_number_style ($key missing)
- set_string_style ($key missing)
- set_case_keywords (support for per_keywordgroup AutoCaps)
-
-
- TODO for version 1.2.0
-
-- Rewrite engine to use remove/replace method (will hopefully almost
- eliminate the need for regular expressions except for numbers/methods
- etc). This will also assist for making different output formats [DONE]
-- "Intelligent" output format - eg if the user doesn't want lines to
- wrap and wants line numbers don't use <ol>, use the <table> method
- instead. (This saves on output)
-- Clear split between "public" and "private" methods [DONE]
-- PHP5 version
-- "Themes" for styles - basically pre-made stylesheets that can be used
- to highlight code of any language in a similar manner [DONE]
-- "Dialects" for languages - eg php4, php5. One master language definition
- file, and a bunch of "specialised" dialect files for each language
- Ability to specify a "specialised" dialect as default? [DONE]
-- Look at load/memory usage and try to reduce
-- Make tabs into tab-stops like a normal editor [DONE]
-- Ability to add more than one multiline comment or string [DONE]
-- Ability to specify that strings cannot be multiline [DONE]
-- Create a "wrapper" class for ultra-easy use
-- Code written in a style that conforms to a phpdoc utility [DONE, PEAR]
-- Dig functions/methods out of code and where they are called make an internal
- link back to their definition
-
-
- TODO for version 2.0.0
-
-- Support for multiple output formats (XHTML, XML, PDF, RTF etc) [DONE IN 1.2]
-- Support for auto-indent/code "beautifing"
-- Option for "Lite" highlighting - aims for speed and low server load
-- "Intelligent" highlighting inside comments, and ability to highlight
- source in multiple languages at once (eg PHP+HTML) [DONE IN 1.2]
-- Perhaps a script on the GeSHi site that would map urls to appropriate
- definitions and relocate the user? (eg, java documentation is
- structured in such a way that urls are not able to be used with GeSHi.
- Instead the URL could become:
- http://qbnz.com/highlighter/redirect.php?lang=java&kw=KeyWord
- and that script would redirect to the correct location.
- [BETTER FIX IN 1.2]
-
- $Id: TODO 1727 2008-08-08 13:36:52Z benbe $
diff --git a/libvpx/examples/includes/geshi/docs/api/__filesource/fsource_geshi_core_geshi.php.html b/libvpx/examples/includes/geshi/docs/api/__filesource/fsource_geshi_core_geshi.php.html
deleted file mode 100644
index 3d79982..0000000
--- a/libvpx/examples/includes/geshi/docs/api/__filesource/fsource_geshi_core_geshi.php.html
+++ /dev/null
@@ -1,4616 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>File Source for geshi.php</title>
- <link rel="stylesheet" href="../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <h1>Source for file geshi.php</h1>
-<p>Documentation is available at <a href="../geshi/core/_geshi.php.html">geshi.php</a></p>
-<div class="src-code">
-<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
-<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;GeSHi&nbsp;-&nbsp;Generic&nbsp;Syntax&nbsp;Highlighter</span></div></li>
-<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;GeSHi&nbsp;class&nbsp;for&nbsp;Generic&nbsp;Syntax&nbsp;Highlighting.&nbsp;Please&nbsp;refer&nbsp;to&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;documentation&nbsp;at&nbsp;http://qbnz.com/highlighter/documentation.php&nbsp;for&nbsp;more</span></div></li>
-<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;information&nbsp;about&nbsp;how&nbsp;to&nbsp;use&nbsp;this&nbsp;class.</span></div></li>
-<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*&nbsp;For&nbsp;changes,&nbsp;release&nbsp;notes,&nbsp;TODOs&nbsp;etc,&nbsp;see&nbsp;the&nbsp;relevant&nbsp;files&nbsp;in&nbsp;the&nbsp;docs/</span></div></li>
-<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;directory.</span></div></li>
-<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;This&nbsp;file&nbsp;is&nbsp;part&nbsp;of&nbsp;GeSHi.</span></div></li>
-<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;GeSHi&nbsp;is&nbsp;free&nbsp;software;&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify</span></div></li>
-<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by</span></div></li>
-<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation;&nbsp;either&nbsp;version&nbsp;2&nbsp;of&nbsp;the&nbsp;License,&nbsp;or</span></div></li>
-<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.</span></div></li>
-<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;GeSHi&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,</span></div></li>
-<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a21"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a22"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.</span></div></li>
-<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License</span></div></li>
-<li><div class="src-line"><a name="a25"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;along&nbsp;with&nbsp;GeSHi;&nbsp;if&nbsp;not,&nbsp;write&nbsp;to&nbsp;the&nbsp;Free&nbsp;Software</span></div></li>
-<li><div class="src-line"><a name="a26"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;Foundation,&nbsp;Inc.,&nbsp;59&nbsp;Temple&nbsp;Place,&nbsp;Suite&nbsp;330,&nbsp;Boston,&nbsp;MA&nbsp;&nbsp;02111-1307&nbsp;&nbsp;USA</span></div></li>
-<li><div class="src-line"><a name="a27"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;geshi</span></div></li>
-<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@subpackage</span><span class="src-doc">&nbsp;core</span></div></li>
-<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Nigel&nbsp;McNie&nbsp;&lt;nigel@geshi.org&gt;,&nbsp;Benny&nbsp;Baumann&nbsp;&lt;BenBE@omorphia.de&gt;</span></div></li>
-<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@copyright</span><span class="src-doc">&nbsp;&nbsp;(C)&nbsp;2004&nbsp;-&nbsp;2007&nbsp;Nigel&nbsp;McNie,&nbsp;(C)&nbsp;2007&nbsp;-&nbsp;2008&nbsp;Benny&nbsp;Baumann</span></div></li>
-<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;http://gnu.org/copyleft/gpl.html&nbsp;GNU&nbsp;GPL</span></div></li>
-<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a35"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a36"></a><span class="src-comm">//</span></div></li>
-<li><div class="src-line"><a name="a37"></a><span class="src-comm">//&nbsp;GeSHi&nbsp;Constants</span></div></li>
-<li><div class="src-line"><a name="a38"></a><span class="src-comm">//&nbsp;You&nbsp;should&nbsp;use&nbsp;these&nbsp;constant&nbsp;names&nbsp;in&nbsp;your&nbsp;programs&nbsp;instead&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a39"></a><span class="src-comm">//&nbsp;their&nbsp;values&nbsp;-&nbsp;you&nbsp;never&nbsp;know&nbsp;when&nbsp;a&nbsp;value&nbsp;may&nbsp;change&nbsp;in&nbsp;a&nbsp;future</span></div></li>
-<li><div class="src-line"><a name="a40"></a><span class="src-comm">//&nbsp;version</span></div></li>
-<li><div class="src-line"><a name="a41"></a><span class="src-comm">//</span></div></li>
-<li><div class="src-line"><a name="a42"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a43"></a><span class="src-doc">/**&nbsp;The&nbsp;version&nbsp;of&nbsp;this&nbsp;GeSHi&nbsp;file&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a44"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_VERSION'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'1.0.8.2'</span><span class="src-sym">,</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a45"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a46"></a><span class="src-comm">//&nbsp;Define&nbsp;the&nbsp;root&nbsp;directory&nbsp;for&nbsp;the&nbsp;GeSHi&nbsp;code&nbsp;tree</span></div></li>
-<li><div class="src-line"><a name="a47"></a><span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'GESHI_ROOT'</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**&nbsp;The&nbsp;root&nbsp;directory&nbsp;for&nbsp;GeSHi&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ROOT'</span><span class="src-sym">,&nbsp;</span><span class="src-id">dirname</span><span class="src-sym">(</span>__FILE__<span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a50"></a><span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a51"></a><span class="src-doc">/**&nbsp;The&nbsp;language&nbsp;file&nbsp;directory&nbsp;for&nbsp;GeSHi</span></div></li>
-<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;@access&nbsp;private&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a53"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_LANG_ROOT'</span><span class="src-sym">,&nbsp;</span><span class="src-id">GESHI_ROOT&nbsp;</span>.&nbsp;<span class="src-str">'geshi'&nbsp;</span>.&nbsp;<span class="src-id">DIRECTORY_SEPARATOR</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a54"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a55"></a><span class="src-comm">//&nbsp;Define&nbsp;if&nbsp;GeSHi&nbsp;should&nbsp;be&nbsp;paranoid&nbsp;about&nbsp;security</span></div></li>
-<li><div class="src-line"><a name="a56"></a><span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'GESHI_SECURITY_PARANOID'</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**&nbsp;Tells&nbsp;GeSHi&nbsp;to&nbsp;be&nbsp;paranoid&nbsp;about&nbsp;security&nbsp;settings&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_SECURITY_PARANOID'</span><span class="src-sym">,&nbsp;</span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a59"></a><span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a60"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a61"></a><span class="src-comm">//&nbsp;Line&nbsp;numbers&nbsp;-&nbsp;use&nbsp;with&nbsp;enable_line_numbers()</span></div></li>
-<li><div class="src-line"><a name="a62"></a><span class="src-doc">/**&nbsp;Use&nbsp;no&nbsp;line&nbsp;numbers&nbsp;when&nbsp;building&nbsp;the&nbsp;result&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a63"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NO_LINE_NUMBERS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a64"></a><span class="src-doc">/**&nbsp;Use&nbsp;normal&nbsp;line&nbsp;numbers&nbsp;when&nbsp;building&nbsp;the&nbsp;result&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a65"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NORMAL_LINE_NUMBERS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a66"></a><span class="src-doc">/**&nbsp;Use&nbsp;fancy&nbsp;line&nbsp;numbers&nbsp;when&nbsp;building&nbsp;the&nbsp;result&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a67"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_FANCY_LINE_NUMBERS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a68"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a69"></a><span class="src-comm">//&nbsp;Container&nbsp;HTML&nbsp;type</span></div></li>
-<li><div class="src-line"><a name="a70"></a><span class="src-doc">/**&nbsp;Use&nbsp;nothing&nbsp;to&nbsp;surround&nbsp;the&nbsp;source&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a71"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_NONE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a72"></a><span class="src-doc">/**&nbsp;Use&nbsp;a&nbsp;&quot;div&quot;&nbsp;to&nbsp;surround&nbsp;the&nbsp;source&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a73"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_DIV'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a74"></a><span class="src-doc">/**&nbsp;Use&nbsp;a&nbsp;&quot;pre&quot;&nbsp;to&nbsp;surround&nbsp;the&nbsp;source&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a75"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_PRE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a76"></a><span class="src-doc">/**&nbsp;Use&nbsp;a&nbsp;pre&nbsp;to&nbsp;wrap&nbsp;lines&nbsp;when&nbsp;line&nbsp;numbers&nbsp;are&nbsp;enabled&nbsp;or&nbsp;to&nbsp;wrap&nbsp;the&nbsp;whole&nbsp;code.&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a77"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_PRE_VALID'</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a78"></a><span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;*&nbsp;Use&nbsp;a&nbsp;&quot;table&quot;&nbsp;to&nbsp;surround&nbsp;the&nbsp;source:</span></div></li>
-<li><div class="src-line"><a name="a80"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a81"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;table&gt;</span></div></li>
-<li><div class="src-line"><a name="a82"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;thead&gt;&lt;tr&gt;&lt;td&nbsp;colspan=&quot;2&quot;&gt;$header&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;</span></div></li>
-<li><div class="src-line"><a name="a83"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;pre&gt;$linenumbers&lt;/pre&gt;&lt;/td&gt;&lt;td&gt;&lt;pre&gt;$code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;</span></div></li>
-<li><div class="src-line"><a name="a84"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;tfooter&gt;&lt;tr&gt;&lt;td&nbsp;colspan=&quot;2&quot;&gt;$footer&lt;/td&gt;&lt;/tr&gt;&lt;/tfoot&gt;</span></div></li>
-<li><div class="src-line"><a name="a85"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;/table&gt;</span></div></li>
-<li><div class="src-line"><a name="a86"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a87"></a><span class="src-doc">&nbsp;*&nbsp;this&nbsp;is&nbsp;essentially&nbsp;only&nbsp;a&nbsp;workaround&nbsp;for&nbsp;Firefox,&nbsp;see&nbsp;sf#1651996&nbsp;or&nbsp;take&nbsp;a&nbsp;look&nbsp;at</span></div></li>
-<li><div class="src-line"><a name="a88"></a><span class="src-doc">&nbsp;*&nbsp;https://bugzilla.mozilla.org/show_bug.cgi?id=365805</span></div></li>
-<li><div class="src-line"><a name="a89"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-tag">@note</span><span class="src-doc">&nbsp;when&nbsp;linenumbers&nbsp;are&nbsp;disabled&nbsp;this&nbsp;is&nbsp;essentially&nbsp;the&nbsp;same&nbsp;as&nbsp;GESHI_HEADER_PRE</span></div></li>
-<li><div class="src-line"><a name="a90"></a><span class="src-doc">&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a91"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HEADER_PRE_TABLE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a92"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a93"></a><span class="src-comm">//&nbsp;Capatalisation&nbsp;constants</span></div></li>
-<li><div class="src-line"><a name="a94"></a><span class="src-doc">/**&nbsp;Lowercase&nbsp;keywords&nbsp;found&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a95"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CAPS_NO_CHANGE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a96"></a><span class="src-doc">/**&nbsp;Uppercase&nbsp;keywords&nbsp;found&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a97"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CAPS_UPPER'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a98"></a><span class="src-doc">/**&nbsp;Leave&nbsp;keywords&nbsp;found&nbsp;as&nbsp;the&nbsp;case&nbsp;that&nbsp;they&nbsp;are&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a99"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CAPS_LOWER'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a100"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a101"></a><span class="src-comm">//&nbsp;Link&nbsp;style&nbsp;constants</span></div></li>
-<li><div class="src-line"><a name="a102"></a><span class="src-doc">/**&nbsp;Links&nbsp;in&nbsp;the&nbsp;source&nbsp;in&nbsp;the&nbsp;:link&nbsp;state&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a103"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_LINK'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a104"></a><span class="src-doc">/**&nbsp;Links&nbsp;in&nbsp;the&nbsp;source&nbsp;in&nbsp;the&nbsp;:hover&nbsp;state&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a105"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_HOVER'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a106"></a><span class="src-doc">/**&nbsp;Links&nbsp;in&nbsp;the&nbsp;source&nbsp;in&nbsp;the&nbsp;:active&nbsp;state&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a107"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ACTIVE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a108"></a><span class="src-doc">/**&nbsp;Links&nbsp;in&nbsp;the&nbsp;source&nbsp;in&nbsp;the&nbsp;:visited&nbsp;state&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a109"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_VISITED'</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a110"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a111"></a><span class="src-comm">//&nbsp;Important&nbsp;string&nbsp;starter/finisher</span></div></li>
-<li><div class="src-line"><a name="a112"></a><span class="src-comm">//&nbsp;Note&nbsp;that&nbsp;if&nbsp;you&nbsp;change&nbsp;these,&nbsp;they&nbsp;should&nbsp;be&nbsp;as-is:&nbsp;i.e.,&nbsp;don't</span></div></li>
-<li><div class="src-line"><a name="a113"></a><span class="src-comm">//&nbsp;write&nbsp;them&nbsp;as&nbsp;if&nbsp;they&nbsp;had&nbsp;been&nbsp;run&nbsp;through&nbsp;htmlentities()</span></div></li>
-<li><div class="src-line"><a name="a114"></a><span class="src-doc">/**&nbsp;The&nbsp;starter&nbsp;for&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;source&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a115"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_START_IMPORTANT'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'&lt;BEGIN&nbsp;GeSHi&gt;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a116"></a><span class="src-doc">/**&nbsp;The&nbsp;ender&nbsp;for&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;source&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a117"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_END_IMPORTANT'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'&lt;END&nbsp;GeSHi&gt;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a118"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a119"></a><span class="src-comm">/**#@+</span></div></li>
-<li><div class="src-line"><a name="a120"></a><span class="src-comm">&nbsp;*&nbsp;&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a121"></a><span class="src-comm">&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a122"></a><span class="src-comm">//&nbsp;When&nbsp;strict&nbsp;mode&nbsp;applies&nbsp;for&nbsp;a&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a123"></a><span class="src-doc">/**&nbsp;Strict&nbsp;mode&nbsp;never&nbsp;applies&nbsp;(this&nbsp;is&nbsp;the&nbsp;most&nbsp;common)&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a124"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NEVER'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a125"></a><span class="src-doc">/**&nbsp;Strict&nbsp;mode&nbsp;*might*&nbsp;apply,&nbsp;and&nbsp;can&nbsp;be&nbsp;enabled&nbsp;or</span></div></li>
-<li><div class="src-line"><a name="a126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;disabled&nbsp;by&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;GeSHi-&gt;enable_strict_mode()}</span><span class="src-doc">&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a127"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_MAYBE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a128"></a><span class="src-doc">/**&nbsp;Strict&nbsp;mode&nbsp;always&nbsp;applies&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a129"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ALWAYS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a130"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a131"></a><span class="src-comm">//&nbsp;Advanced&nbsp;regexp&nbsp;handling&nbsp;constants,&nbsp;used&nbsp;in&nbsp;language&nbsp;files</span></div></li>
-<li><div class="src-line"><a name="a132"></a><span class="src-doc">/**&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regex&nbsp;array&nbsp;defining&nbsp;what&nbsp;to&nbsp;search&nbsp;for&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a133"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_SEARCH'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a134"></a><span class="src-doc">/**&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regex&nbsp;array&nbsp;defining&nbsp;what&nbsp;bracket&nbsp;group&nbsp;in&nbsp;a</span></div></li>
-<li><div class="src-line"><a name="a135"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;matched&nbsp;search&nbsp;to&nbsp;use&nbsp;as&nbsp;a&nbsp;replacement&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a136"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_REPLACE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a137"></a><span class="src-doc">/**&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regex&nbsp;array&nbsp;defining&nbsp;any&nbsp;modifiers&nbsp;to&nbsp;the&nbsp;regular&nbsp;expression&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a138"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_MODIFIERS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a139"></a><span class="src-doc">/**&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regex&nbsp;array&nbsp;defining&nbsp;what&nbsp;bracket&nbsp;group&nbsp;in&nbsp;a</span></div></li>
-<li><div class="src-line"><a name="a140"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;matched&nbsp;search&nbsp;to&nbsp;put&nbsp;before&nbsp;the&nbsp;replacement&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a141"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_BEFORE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a142"></a><span class="src-doc">/**&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regex&nbsp;array&nbsp;defining&nbsp;what&nbsp;bracket&nbsp;group&nbsp;in&nbsp;a</span></div></li>
-<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;matched&nbsp;search&nbsp;to&nbsp;put&nbsp;after&nbsp;the&nbsp;replacement&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a144"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_AFTER'</span><span class="src-sym">,&nbsp;</span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a145"></a><span class="src-doc">/**&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regex&nbsp;array&nbsp;defining&nbsp;a&nbsp;custom&nbsp;keyword&nbsp;to&nbsp;use</span></div></li>
-<li><div class="src-line"><a name="a146"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;this&nbsp;regexp's&nbsp;html&nbsp;tag&nbsp;class&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a147"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_CLASS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a148"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a149"></a><span class="src-doc">/**&nbsp;Used&nbsp;in&nbsp;language&nbsp;files&nbsp;to&nbsp;mark&nbsp;comments&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a150"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_COMMENTS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a151"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a152"></a><span class="src-doc">/**&nbsp;Used&nbsp;to&nbsp;work&nbsp;around&nbsp;missing&nbsp;PHP&nbsp;features&nbsp;**/</span></div></li>
-<li><div class="src-line"><a name="a153"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_PHP_PRE_433'</span><span class="src-sym">,&nbsp;</span><span class="src-sym">!</span><span class="src-sym">(</span><span class="src-id">version_compare</span><span class="src-sym">(</span><span class="src-id">PHP_VERSION</span><span class="src-sym">,&nbsp;</span><span class="src-str">'4.3.3'</span><span class="src-sym">)&nbsp;</span>===&nbsp;<span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a154"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a155"></a><span class="src-doc">/**&nbsp;make&nbsp;sure&nbsp;we&nbsp;can&nbsp;call&nbsp;stripos&nbsp;**/</span></div></li>
-<li><div class="src-line"><a name="a156"></a><span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'stripos'</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;offset&nbsp;param&nbsp;of&nbsp;preg_match&nbsp;is&nbsp;not&nbsp;supported&nbsp;below&nbsp;PHP&nbsp;4.3.3</span></div></li>
-<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-id">GESHI_PHP_PRE_433</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a160"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
-<li><div class="src-line"><a name="a161"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="http://www.php.net/stripos">stripos</a><span class="src-sym">(</span><span class="src-var">$haystack</span><span class="src-sym">,&nbsp;</span><span class="src-var">$needle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$offset</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$haystack&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$haystack</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/'</span>.&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$needle</span><span class="src-sym">,&nbsp;</span><span class="src-str">'/'</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'/'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$haystack</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">,&nbsp;</span><span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a174"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@ignore</span></div></li>
-<li><div class="src-line"><a name="a175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="http://www.php.net/stripos">stripos</a><span class="src-sym">(</span><span class="src-var">$haystack</span><span class="src-sym">,&nbsp;</span><span class="src-var">$needle</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'/'</span>.&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$needle</span><span class="src-sym">,&nbsp;</span><span class="src-str">'/'</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'/'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$haystack</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">,&nbsp;</span><span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">,&nbsp;</span><span class="src-var">$offset</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a183"></a><span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a184"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a185"></a><span class="src-doc">/**&nbsp;some&nbsp;old&nbsp;PHP&nbsp;/&nbsp;PCRE&nbsp;subpatterns&nbsp;only&nbsp;support&nbsp;up&nbsp;to&nbsp;xxx&nbsp;subpatterns&nbsp;in</span></div></li>
-<li><div class="src-line"><a name="a186"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;regular&nbsp;expressions.&nbsp;Set&nbsp;this&nbsp;to&nbsp;false&nbsp;if&nbsp;your&nbsp;PCRE&nbsp;lib&nbsp;is&nbsp;up&nbsp;to&nbsp;date</span></div></li>
-<li><div class="src-line"><a name="a187"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;@see&nbsp;GeSHi-&gt;optimize_regexp_list()</span></div></li>
-<li><div class="src-line"><a name="a188"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;**/</span></div></li>
-<li><div class="src-line"><a name="a188"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a189"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_MAX_PCRE_SUBPATTERNS'</span><span class="src-sym">,&nbsp;</span><span class="src-num">500</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a190"></a><span class="src-doc">/**&nbsp;it's&nbsp;also&nbsp;important&nbsp;not&nbsp;to&nbsp;generate&nbsp;too&nbsp;long&nbsp;regular&nbsp;expressions</span></div></li>
-<li><div class="src-line"><a name="a191"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;be&nbsp;generous&nbsp;here...&nbsp;but&nbsp;keep&nbsp;in&nbsp;mind,&nbsp;that&nbsp;when&nbsp;reaching&nbsp;this&nbsp;limit&nbsp;we</span></div></li>
-<li><div class="src-line"><a name="a192"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;still&nbsp;have&nbsp;to&nbsp;close&nbsp;open&nbsp;patterns.&nbsp;12k&nbsp;should&nbsp;do&nbsp;just&nbsp;fine&nbsp;on&nbsp;a&nbsp;16k&nbsp;limit.</span></div></li>
-<li><div class="src-line"><a name="a193"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;@see&nbsp;GeSHi-&gt;optimize_regexp_list()</span></div></li>
-<li><div class="src-line"><a name="a194"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;**/</span></div></li>
-<li><div class="src-line"><a name="a194"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a195"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_MAX_PCRE_LENGTH'</span><span class="src-sym">,&nbsp;</span><span class="src-num">12288</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a196"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a197"></a><span class="src-comm">//Number&nbsp;format&nbsp;specification</span></div></li>
-<li><div class="src-line"><a name="a198"></a><span class="src-doc">/**&nbsp;Basic&nbsp;number&nbsp;format&nbsp;for&nbsp;integers&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a199"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_INT_BASIC'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//Default&nbsp;integers&nbsp;\d+</span></div></li>
-<li><div class="src-line"><a name="a200"></a><span class="src-doc">/**&nbsp;Enhanced&nbsp;number&nbsp;format&nbsp;for&nbsp;integers&nbsp;like&nbsp;seen&nbsp;in&nbsp;C&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a201"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_INT_CSTYLE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//Default&nbsp;C-Style&nbsp;\d+[lL]?</span></div></li>
-<li><div class="src-line"><a name="a202"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;binary&nbsp;numbers&nbsp;with&nbsp;a&nbsp;suffix&nbsp;&quot;b&quot;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a203"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_BIN_SUFFIX'</span><span class="src-sym">,&nbsp;</span><span class="src-num">16</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//[01]+[bB]</span></div></li>
-<li><div class="src-line"><a name="a204"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;binary&nbsp;numbers&nbsp;with&nbsp;a&nbsp;prefix&nbsp;%&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a205"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_BIN_PREFIX_PERCENT'</span><span class="src-sym">,&nbsp;</span><span class="src-num">32</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//%[01]+</span></div></li>
-<li><div class="src-line"><a name="a206"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;binary&nbsp;numbers&nbsp;with&nbsp;a&nbsp;prefix&nbsp;0b&nbsp;(C)&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a207"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_BIN_PREFIX_0B'</span><span class="src-sym">,&nbsp;</span><span class="src-num">64</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//0b[01]+</span></div></li>
-<li><div class="src-line"><a name="a208"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;octal&nbsp;numbers&nbsp;with&nbsp;a&nbsp;leading&nbsp;zero&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a209"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_OCT_PREFIX'</span><span class="src-sym">,&nbsp;</span><span class="src-num">256</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//0[0-7]+</span></div></li>
-<li><div class="src-line"><a name="a210"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;octal&nbsp;numbers&nbsp;with&nbsp;a&nbsp;suffix&nbsp;of&nbsp;o&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a211"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_OCT_SUFFIX'</span><span class="src-sym">,&nbsp;</span><span class="src-num">512</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//[0-7]+[oO]</span></div></li>
-<li><div class="src-line"><a name="a212"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;hex&nbsp;numbers&nbsp;with&nbsp;a&nbsp;prefix&nbsp;0x&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a213"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_HEX_PREFIX'</span><span class="src-sym">,&nbsp;</span><span class="src-num">4096</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//0x[0-9a-fA-F]+</span></div></li>
-<li><div class="src-line"><a name="a214"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;hex&nbsp;numbers&nbsp;with&nbsp;a&nbsp;suffix&nbsp;of&nbsp;h&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a215"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_HEX_SUFFIX'</span><span class="src-sym">,&nbsp;</span><span class="src-num">8192</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//[0-9][0-9a-fA-F]*h</span></div></li>
-<li><div class="src-line"><a name="a216"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;floating-point&nbsp;numbers&nbsp;without&nbsp;support&nbsp;for&nbsp;scientific&nbsp;notation&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a217"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_FLT_NONSCI'</span><span class="src-sym">,&nbsp;</span><span class="src-num">65536</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//\d+\.\d+</span></div></li>
-<li><div class="src-line"><a name="a218"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;floating-point&nbsp;numbers&nbsp;without&nbsp;support&nbsp;for&nbsp;scientific&nbsp;notation&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a219"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_FLT_NONSCI_F'</span><span class="src-sym">,&nbsp;</span><span class="src-num">131072</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//\d+(\.\d+)?f</span></div></li>
-<li><div class="src-line"><a name="a220"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;floating-point&nbsp;numbers&nbsp;with&nbsp;support&nbsp;for&nbsp;scientific&nbsp;notation&nbsp;(E)&nbsp;and&nbsp;optional&nbsp;leading&nbsp;zero&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a221"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_FLT_SCI_SHORT'</span><span class="src-sym">,&nbsp;</span><span class="src-num">262144</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//\.\d+e\d+</span></div></li>
-<li><div class="src-line"><a name="a222"></a><span class="src-doc">/**&nbsp;Number&nbsp;format&nbsp;to&nbsp;highlight&nbsp;floating-point&nbsp;numbers&nbsp;with&nbsp;support&nbsp;for&nbsp;scientific&nbsp;notation&nbsp;(E)&nbsp;and&nbsp;required&nbsp;leading&nbsp;digit&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a223"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_NUMBER_FLT_SCI_ZERO'</span><span class="src-sym">,&nbsp;</span><span class="src-num">524288</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-comm">//\d+(\.\d+)?e\d+</span></div></li>
-<li><div class="src-line"><a name="a224"></a><span class="src-comm">//Custom&nbsp;formats&nbsp;are&nbsp;passed&nbsp;by&nbsp;RX&nbsp;array</span></div></li>
-<li><div class="src-line"><a name="a225"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a226"></a><span class="src-comm">//&nbsp;Error&nbsp;detection&nbsp;-&nbsp;use&nbsp;these&nbsp;to&nbsp;analyse&nbsp;faults</span></div></li>
-<li><div class="src-line"><a name="a227"></a><span class="src-doc">/**&nbsp;No&nbsp;sourcecode&nbsp;to&nbsp;highlight&nbsp;was&nbsp;specified</span></div></li>
-<li><div class="src-line"><a name="a228"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span></div></li>
-<li><div class="src-line"><a name="a229"></a><span class="src-doc">&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a230"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_NO_INPUT'</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a231"></a><span class="src-doc">/**&nbsp;The&nbsp;language&nbsp;specified&nbsp;does&nbsp;not&nbsp;exist&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a232"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_NO_SUCH_LANG'</span><span class="src-sym">,&nbsp;</span><span class="src-num">2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a233"></a><span class="src-doc">/**&nbsp;GeSHi&nbsp;could&nbsp;not&nbsp;open&nbsp;a&nbsp;file&nbsp;for&nbsp;reading&nbsp;(generally&nbsp;a&nbsp;language&nbsp;file)&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a234"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_FILE_NOT_READABLE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a235"></a><span class="src-doc">/**&nbsp;The&nbsp;header&nbsp;type&nbsp;passed&nbsp;to&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;GeSHi-&gt;set_header_type()}</span><span class="src-doc">&nbsp;was&nbsp;invalid&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a236"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_INVALID_HEADER_TYPE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a237"></a><span class="src-doc">/**&nbsp;The&nbsp;line&nbsp;number&nbsp;type&nbsp;passed&nbsp;to&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;GeSHi-&gt;enable_line_numbers()}</span><span class="src-doc">&nbsp;was&nbsp;invalid&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a238"></a><a href="http://www.php.net/define">define</a><span class="src-sym">(</span><span class="src-str">'GESHI_ERROR_INVALID_LINE_NUMBER_TYPE'</span><span class="src-sym">,&nbsp;</span><span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a239"></a><span class="src-comm">/**#@-*/</span></div></li>
-<li><div class="src-line"><a name="a240"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a241"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a242"></a><span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a243"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;GeSHi&nbsp;Class.</span></div></li>
-<li><div class="src-line"><a name="a244"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a245"></a><span class="src-doc">&nbsp;*&nbsp;Please&nbsp;refer&nbsp;to&nbsp;the&nbsp;documentation&nbsp;for&nbsp;GeSHi&nbsp;1.0.X&nbsp;that&nbsp;is&nbsp;available</span></div></li>
-<li><div class="src-line"><a name="a246"></a><span class="src-doc">&nbsp;*&nbsp;at&nbsp;http://qbnz.com/highlighter/documentation.php&nbsp;for&nbsp;more&nbsp;information</span></div></li>
-<li><div class="src-line"><a name="a247"></a><span class="src-doc">&nbsp;*&nbsp;about&nbsp;how&nbsp;to&nbsp;use&nbsp;this&nbsp;class.</span></div></li>
-<li><div class="src-line"><a name="a248"></a><span class="src-doc">&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a249"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;&nbsp;&nbsp;geshi</span></div></li>
-<li><div class="src-line"><a name="a250"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;Nigel&nbsp;McNie&nbsp;&lt;nigel@geshi.org&gt;,&nbsp;Benny&nbsp;Baumann&nbsp;&lt;BenBE@omorphia.de&gt;</span></div></li>
-<li><div class="src-line"><a name="a251"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@copyright</span><span class="src-doc">&nbsp;(C)&nbsp;2004&nbsp;-&nbsp;2007&nbsp;Nigel&nbsp;McNie,&nbsp;(C)&nbsp;2007&nbsp;-&nbsp;2008&nbsp;Benny&nbsp;Baumann</span></div></li>
-<li><div class="src-line"><a name="a252"></a><span class="src-doc">&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a253"></a><span class="src-key">class&nbsp;</span><a href="../geshi/core/GeSHi.html">GeSHi</a>&nbsp;<span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/**#@+</span></div></li>
-<li><div class="src-line"><a name="a255"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a256"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a258"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;source&nbsp;code&nbsp;to&nbsp;highlight</span></div></li>
-<li><div class="src-line"><a name="a259"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a260"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$source&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a262"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a264"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;language&nbsp;to&nbsp;use&nbsp;when&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a265"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a266"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$language&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a268"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a269"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a270"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;data&nbsp;for&nbsp;the&nbsp;language&nbsp;used</span></div></li>
-<li><div class="src-line"><a name="a271"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a272"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$language_data&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a274"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a276"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;path&nbsp;to&nbsp;the&nbsp;language&nbsp;files</span></div></li>
-<li><div class="src-line"><a name="a277"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a278"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a279"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$language_path&nbsp;</span>=&nbsp;<span class="src-id">GESHI_LANG_ROOT</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a280"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a281"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a282"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;error&nbsp;message&nbsp;associated&nbsp;with&nbsp;an&nbsp;error</span></div></li>
-<li><div class="src-line"><a name="a283"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a284"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;check&nbsp;err&nbsp;reporting&nbsp;works</span></div></li>
-<li><div class="src-line"><a name="a285"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$error&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a287"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a289"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Possible&nbsp;error&nbsp;messages</span></div></li>
-<li><div class="src-line"><a name="a290"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a291"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$error_messages&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
-<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_ERROR_NO_SUCH_LANG&nbsp;</span>=&gt;&nbsp;<span class="src-str">'GeSHi&nbsp;could&nbsp;not&nbsp;find&nbsp;the&nbsp;language&nbsp;{LANGUAGE}&nbsp;(using&nbsp;path&nbsp;{PATH})'</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_ERROR_FILE_NOT_READABLE&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;file&nbsp;specified&nbsp;for&nbsp;load_from_file&nbsp;was&nbsp;not&nbsp;readable'</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_ERROR_INVALID_HEADER_TYPE&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;header&nbsp;type&nbsp;specified&nbsp;is&nbsp;invalid'</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_ERROR_INVALID_LINE_NUMBER_TYPE&nbsp;</span>=&gt;&nbsp;<span class="src-str">'The&nbsp;line&nbsp;number&nbsp;type&nbsp;specified&nbsp;is&nbsp;invalid'</span></div></li>
-<li><div class="src-line"><a name="a297"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a298"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a300"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Whether&nbsp;highlighting&nbsp;is&nbsp;strict&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a301"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a302"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a303"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$strict_mode&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a304"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a305"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a306"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Whether&nbsp;to&nbsp;use&nbsp;CSS&nbsp;classes&nbsp;in&nbsp;output</span></div></li>
-<li><div class="src-line"><a name="a307"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a308"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a309"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$use_classes&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a310"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a311"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a312"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;type&nbsp;of&nbsp;header&nbsp;to&nbsp;use.&nbsp;Can&nbsp;be&nbsp;one&nbsp;of&nbsp;the&nbsp;following</span></div></li>
-<li><div class="src-line"><a name="a313"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;values:</span></div></li>
-<li><div class="src-line"><a name="a314"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a315"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;-&nbsp;GESHI_HEADER_PRE:&nbsp;Source&nbsp;is&nbsp;outputted&nbsp;in&nbsp;a&nbsp;&quot;pre&quot;&nbsp;HTML&nbsp;element.</span></div></li>
-<li><div class="src-line"><a name="a316"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;-&nbsp;GESHI_HEADER_DIV:&nbsp;Source&nbsp;is&nbsp;outputted&nbsp;in&nbsp;a&nbsp;&quot;div&quot;&nbsp;HTML&nbsp;element.</span></div></li>
-<li><div class="src-line"><a name="a317"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;-&nbsp;GESHI_HEADER_NONE:&nbsp;No&nbsp;header&nbsp;is&nbsp;outputted.</span></div></li>
-<li><div class="src-line"><a name="a318"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a319"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a320"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a321"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$header_type&nbsp;</span>=&nbsp;<span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a322"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a323"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Array&nbsp;of&nbsp;permissions&nbsp;for&nbsp;which&nbsp;lexics&nbsp;should&nbsp;be&nbsp;highlighted</span></div></li>
-<li><div class="src-line"><a name="a325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a327"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$lexic_permissions&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
-<li><div class="src-line"><a name="a328"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'KEYWORDS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a329"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'COMMENTS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'MULTI'&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a330"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'REGEXPS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'ESCAPE_CHAR'&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'BRACKETS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">true</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'SYMBOLS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">false</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'STRINGS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">true</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a335"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'NUMBERS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">true</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a336"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'METHODS'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">true</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a337"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'SCRIPT'&nbsp;</span>=&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">true</span></div></li>
-<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a339"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a340"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a341"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;time&nbsp;it&nbsp;took&nbsp;to&nbsp;parse&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a342"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">double&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a343"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a344"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$time&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a345"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a346"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a347"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;content&nbsp;of&nbsp;the&nbsp;header&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a348"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a349"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a350"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$header_content&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a351"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a352"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a353"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;content&nbsp;of&nbsp;the&nbsp;footer&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a354"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a355"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$footer_content&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a357"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a358"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a359"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;style&nbsp;of&nbsp;the&nbsp;header&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a360"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a361"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a362"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$header_content_style&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a363"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a364"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a365"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;style&nbsp;of&nbsp;the&nbsp;footer&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a366"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a367"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a368"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$footer_content_style&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a369"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a370"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a371"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Tells&nbsp;if&nbsp;a&nbsp;block&nbsp;around&nbsp;the&nbsp;highlighted&nbsp;source&nbsp;should&nbsp;be&nbsp;forced</span></div></li>
-<li><div class="src-line"><a name="a372"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;if&nbsp;not&nbsp;using&nbsp;line&nbsp;numbering</span></div></li>
-<li><div class="src-line"><a name="a373"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a374"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a375"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$force_code_block&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a376"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a377"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a378"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;styles&nbsp;for&nbsp;hyperlinks&nbsp;in&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a379"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a380"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a381"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$link_styles&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a382"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a383"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a384"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Whether&nbsp;important&nbsp;blocks&nbsp;should&nbsp;be&nbsp;recognised&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a385"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a386"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span></div></li>
-<li><div class="src-line"><a name="a387"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;REMOVE&nbsp;THIS&nbsp;FUNCTIONALITY!</span></div></li>
-<li><div class="src-line"><a name="a388"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a389"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$enable_important_blocks&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a390"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a392"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Styles&nbsp;for&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a393"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a394"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span></div></li>
-<li><div class="src-line"><a name="a395"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;As&nbsp;above&nbsp;-&nbsp;rethink&nbsp;the&nbsp;whole&nbsp;idea&nbsp;of&nbsp;important&nbsp;blocks&nbsp;as&nbsp;it&nbsp;is&nbsp;buggy&nbsp;and</span></div></li>
-<li><div class="src-line"><a name="a396"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;will&nbsp;be&nbsp;hard&nbsp;to&nbsp;implement&nbsp;in&nbsp;1.2</span></div></li>
-<li><div class="src-line"><a name="a397"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a398"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$important_styles&nbsp;</span>=&nbsp;<span class="src-str">'font-weight:&nbsp;bold;&nbsp;color:&nbsp;red;'</span><span class="src-sym">;&nbsp;</span><span class="src-comm">//&nbsp;Styles&nbsp;for&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a399"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a400"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a401"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Whether&nbsp;CSS&nbsp;IDs&nbsp;should&nbsp;be&nbsp;added&nbsp;to&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a402"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a403"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a404"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$add_ids&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a405"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a406"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a407"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Lines&nbsp;that&nbsp;should&nbsp;be&nbsp;highlighted&nbsp;extra</span></div></li>
-<li><div class="src-line"><a name="a408"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a409"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a410"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$highlight_extra_lines&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a411"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a412"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a413"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Styles&nbsp;of&nbsp;lines&nbsp;that&nbsp;should&nbsp;be&nbsp;highlighted&nbsp;extra</span></div></li>
-<li><div class="src-line"><a name="a414"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a415"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a416"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$highlight_extra_lines_styles&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a417"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a418"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a419"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Styles&nbsp;of&nbsp;extra-highlighted&nbsp;lines</span></div></li>
-<li><div class="src-line"><a name="a420"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a421"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a422"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$highlight_extra_lines_style&nbsp;</span>=&nbsp;<span class="src-str">'background-color:&nbsp;#ffc;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a423"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a424"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a425"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;line&nbsp;ending</span></div></li>
-<li><div class="src-line"><a name="a426"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;null,&nbsp;nl2br()&nbsp;will&nbsp;be&nbsp;used&nbsp;on&nbsp;the&nbsp;result&nbsp;string.</span></div></li>
-<li><div class="src-line"><a name="a427"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Otherwise,&nbsp;all&nbsp;instances&nbsp;of&nbsp;\n&nbsp;will&nbsp;be&nbsp;replaced&nbsp;with&nbsp;$line_ending</span></div></li>
-<li><div class="src-line"><a name="a428"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a429"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a430"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$line_ending&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a431"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a432"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a433"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Number&nbsp;at&nbsp;which&nbsp;line&nbsp;numbers&nbsp;should&nbsp;start&nbsp;at</span></div></li>
-<li><div class="src-line"><a name="a434"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a435"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a436"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$line_numbers_start&nbsp;</span>=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a437"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a438"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a439"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;overall&nbsp;style&nbsp;for&nbsp;this&nbsp;code&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a440"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a441"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a442"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$overall_style&nbsp;</span>=&nbsp;<span class="src-str">'font-family:monospace;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a443"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a444"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a445"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;The&nbsp;style&nbsp;for&nbsp;the&nbsp;actual&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a446"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a447"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a448"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$code_style&nbsp;</span>=&nbsp;<span class="src-str">'font:&nbsp;normal&nbsp;normal&nbsp;1em/1.2em&nbsp;monospace;&nbsp;margin:0;&nbsp;padding:0;&nbsp;background:none;&nbsp;vertical-align:top;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a449"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a450"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a451"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;overall&nbsp;class&nbsp;for&nbsp;this&nbsp;code&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a452"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a453"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$overall_class&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a455"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a457"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;overall&nbsp;ID&nbsp;for&nbsp;this&nbsp;code&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a458"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a459"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a460"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$overall_id&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a461"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a462"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a463"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Line&nbsp;number&nbsp;styles</span></div></li>
-<li><div class="src-line"><a name="a464"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a465"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a466"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$line_style1&nbsp;</span>=&nbsp;<span class="src-str">'font-weight:&nbsp;normal;&nbsp;vertical-align:top;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a467"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a468"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a469"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Line&nbsp;number&nbsp;styles&nbsp;for&nbsp;fancy&nbsp;lines</span></div></li>
-<li><div class="src-line"><a name="a470"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a471"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a472"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$line_style2&nbsp;</span>=&nbsp;<span class="src-str">'font-weight:&nbsp;bold;&nbsp;vertical-align:top;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a473"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a474"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a475"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Style&nbsp;for&nbsp;line&nbsp;numbers&nbsp;when&nbsp;GESHI_HEADER_PRE_TABLE&nbsp;is&nbsp;chosen</span></div></li>
-<li><div class="src-line"><a name="a476"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a477"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a478"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$table_linenumber_style&nbsp;</span>=&nbsp;<span class="src-str">'width:1px;text-align:right;margin:0;padding:0&nbsp;2px;vertical-align:top;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a479"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a480"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a481"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Flag&nbsp;for&nbsp;how&nbsp;line&nbsp;numbers&nbsp;are&nbsp;displayed</span></div></li>
-<li><div class="src-line"><a name="a482"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a483"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a484"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$line_numbers&nbsp;</span>=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a485"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a486"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a487"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Flag&nbsp;to&nbsp;decide&nbsp;if&nbsp;multi&nbsp;line&nbsp;spans&nbsp;are&nbsp;allowed.&nbsp;Set&nbsp;it&nbsp;to&nbsp;false&nbsp;to&nbsp;make&nbsp;sure</span></div></li>
-<li><div class="src-line"><a name="a488"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;each&nbsp;tag&nbsp;is&nbsp;closed&nbsp;before&nbsp;and&nbsp;reopened&nbsp;after&nbsp;each&nbsp;linefeed.</span></div></li>
-<li><div class="src-line"><a name="a489"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a490"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a491"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$allow_multiline_span&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a492"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a493"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a494"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;&quot;nth&quot;&nbsp;value&nbsp;for&nbsp;fancy&nbsp;line&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a495"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a496"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a497"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$line_nth_row&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a498"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a499"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a500"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;size&nbsp;of&nbsp;tab&nbsp;stops</span></div></li>
-<li><div class="src-line"><a name="a501"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a502"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a503"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$tab_width&nbsp;</span>=&nbsp;<span class="src-num">8</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a504"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a505"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a506"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Should&nbsp;we&nbsp;use&nbsp;language-defined&nbsp;tab&nbsp;stop&nbsp;widths?</span></div></li>
-<li><div class="src-line"><a name="a507"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">int&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a508"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a509"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$use_language_tab_width&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a510"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a511"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a512"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Default&nbsp;target&nbsp;for&nbsp;keyword&nbsp;links</span></div></li>
-<li><div class="src-line"><a name="a513"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a514"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a515"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$link_target&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a516"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a517"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a518"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;encoding&nbsp;to&nbsp;use&nbsp;for&nbsp;entity&nbsp;encoding</span></div></li>
-<li><div class="src-line"><a name="a519"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;NOTE:&nbsp;Used&nbsp;with&nbsp;Escape&nbsp;Char&nbsp;Sequences&nbsp;to&nbsp;fix&nbsp;UTF-8&nbsp;handling&nbsp;(cf.&nbsp;SF#2037598)</span></div></li>
-<li><div class="src-line"><a name="a520"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a521"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a522"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$encoding&nbsp;</span>=&nbsp;<span class="src-str">'utf-8'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a523"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a524"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a525"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Should&nbsp;keywords&nbsp;be&nbsp;linked?</span></div></li>
-<li><div class="src-line"><a name="a526"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a527"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a528"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$keyword_links&nbsp;</span>=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a529"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a530"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a531"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Currently&nbsp;loaded&nbsp;language&nbsp;file</span></div></li>
-<li><div class="src-line"><a name="a532"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a533"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.7.22</span></div></li>
-<li><div class="src-line"><a name="a534"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a535"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$loaded_language&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a536"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a537"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a538"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Wether&nbsp;the&nbsp;caches&nbsp;needed&nbsp;for&nbsp;parsing&nbsp;are&nbsp;built&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a539"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a540"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">bool&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a541"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a542"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a543"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$parse_cache_built&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a544"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a545"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a546"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Work&nbsp;around&nbsp;for&nbsp;Suhosin&nbsp;Patch&nbsp;with&nbsp;disabled&nbsp;/e&nbsp;modifier</span></div></li>
-<li><div class="src-line"><a name="a547"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a548"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Note&nbsp;from&nbsp;suhosins&nbsp;author&nbsp;in&nbsp;config&nbsp;file:</span></div></li>
-<li><div class="src-line"><a name="a549"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;blockquote&gt;</span></div></li>
-<li><div class="src-line"><a name="a550"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;/e&nbsp;modifier&nbsp;inside&nbsp;&lt;code&gt;preg_replace()&lt;/code&gt;&nbsp;allows&nbsp;code&nbsp;execution.</span></div></li>
-<li><div class="src-line"><a name="a551"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Often&nbsp;it&nbsp;is&nbsp;the&nbsp;cause&nbsp;for&nbsp;remote&nbsp;code&nbsp;execution&nbsp;exploits.&nbsp;It&nbsp;is&nbsp;wise&nbsp;to</span></div></li>
-<li><div class="src-line"><a name="a552"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;deactivate&nbsp;this&nbsp;feature&nbsp;and&nbsp;test&nbsp;where&nbsp;in&nbsp;the&nbsp;application&nbsp;it&nbsp;is&nbsp;used.</span></div></li>
-<li><div class="src-line"><a name="a553"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;developer&nbsp;using&nbsp;the&nbsp;/e&nbsp;modifier&nbsp;should&nbsp;be&nbsp;made&nbsp;aware&nbsp;that&nbsp;he&nbsp;should</span></div></li>
-<li><div class="src-line"><a name="a554"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;use&nbsp;&lt;code&gt;preg_replace_callback()&lt;/code&gt;&nbsp;instead</span></div></li>
-<li><div class="src-line"><a name="a555"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/blockquote&gt;</span></div></li>
-<li><div class="src-line"><a name="a556"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a557"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">array&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a558"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a559"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a560"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$_kw_replace_group&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a561"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$_rx_key&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a562"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a563"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a564"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;some&nbsp;&quot;callback&nbsp;parameters&quot;&nbsp;for&nbsp;handle_multiline_regexps</span></div></li>
-<li><div class="src-line"><a name="a565"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a566"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a567"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a568"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@var&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a569"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a570"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$_hmr_before&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a571"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$_hmr_replace&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a572"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$_hmr_after&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a573"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><span class="src-var">$_hmr_key&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a574"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a575"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/**#@-*/</span></div></li>
-<li><div class="src-line"><a name="a576"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a577"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a578"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Creates&nbsp;a&nbsp;new&nbsp;GeSHi&nbsp;object,&nbsp;with&nbsp;source&nbsp;and&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a579"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a580"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;source&nbsp;code&nbsp;to&nbsp;highlight</span></div></li>
-<li><div class="src-line"><a name="a581"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;language&nbsp;to&nbsp;highlight&nbsp;the&nbsp;source&nbsp;with</span></div></li>
-<li><div class="src-line"><a name="a582"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;path&nbsp;to&nbsp;the&nbsp;language&nbsp;file&nbsp;directory.&nbsp;&lt;b&gt;This</span></div></li>
-<li><div class="src-line"><a name="a583"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;is&nbsp;deprecated!&lt;/b&gt;&nbsp;I've&nbsp;backported&nbsp;the&nbsp;auto&nbsp;path</span></div></li>
-<li><div class="src-line"><a name="a584"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;detection&nbsp;from&nbsp;the&nbsp;1.1.X&nbsp;dev&nbsp;branch,&nbsp;so&nbsp;now&nbsp;it</span></div></li>
-<li><div class="src-line"><a name="a585"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;should&nbsp;be&nbsp;automatically&nbsp;set&nbsp;correctly.&nbsp;If&nbsp;you&nbsp;have</span></div></li>
-<li><div class="src-line"><a name="a586"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;renamed&nbsp;the&nbsp;language&nbsp;directory&nbsp;however,&nbsp;you&nbsp;will</span></div></li>
-<li><div class="src-line"><a name="a587"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;still&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;path&nbsp;using&nbsp;this&nbsp;parameter&nbsp;or</span></div></li>
-<li><div class="src-line"><a name="a588"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;GeSHi-&gt;set_language_path()}</span></div></li>
-<li><div class="src-line"><a name="a589"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a590"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a591"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../geshi/core/GeSHi.html#methodGeSHi">GeSHi</a><span class="src-sym">(</span><span class="src-var">$source&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$language&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">,&nbsp;</span><span class="src-var">$path&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a592"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a593"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_source">set_source</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a594"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a595"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a596"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_language">set_language</a><span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a597"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_language_path">set_language_path</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a599"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a600"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a601"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
-<li><div class="src-line"><a name="a602"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;an&nbsp;error&nbsp;message&nbsp;associated&nbsp;with&nbsp;the&nbsp;last&nbsp;GeSHi&nbsp;operation,</span></div></li>
-<li><div class="src-line"><a name="a603"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;or&nbsp;false&nbsp;if&nbsp;no&nbsp;error&nbsp;has&nbsp;occured</span></div></li>
-<li><div class="src-line"><a name="a604"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a605"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">false</span><span class="src-doc">An&nbsp;error&nbsp;message&nbsp;if&nbsp;there&nbsp;has&nbsp;been&nbsp;an&nbsp;error,&nbsp;else&nbsp;false</span></div></li>
-<li><div class="src-line"><a name="a606"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a607"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a608"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../geshi/core/GeSHi.html#methoderror">error</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a609"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a610"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Put&nbsp;some&nbsp;template&nbsp;variables&nbsp;for&nbsp;debugging&nbsp;here&nbsp;...</span></div></li>
-<li><div class="src-line"><a name="a611"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$debug_tpl_vars&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
-<li><div class="src-line"><a name="a612"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'{LANGUAGE}'&nbsp;</span>=&gt;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a613"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'{PATH}'&nbsp;</span>=&gt;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_path</span></div></li>
-<li><div class="src-line"><a name="a614"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a615"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$msg&nbsp;</span>=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span></div></li>
-<li><div class="src-line"><a name="a616"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$debug_tpl_vars</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a617"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_values">array_values</a><span class="src-sym">(</span><span class="src-var">$debug_tpl_vars</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a618"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error_messages</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a619"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a620"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-str">&quot;</span><span class="src-str">&lt;br&nbsp;/&gt;&lt;strong&gt;GeSHi&nbsp;Error:&lt;/strong&gt;&nbsp;<span class="src-var">$msg</span>&nbsp;(code&nbsp;{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">}</span>)&lt;br&nbsp;/&gt;</span><span class="src-str"><span class="src-str">"</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a621"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a622"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a623"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a624"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a625"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a626"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;a&nbsp;human-readable&nbsp;language&nbsp;name&nbsp;(thanks&nbsp;to&nbsp;Simon&nbsp;Patterson</span></div></li>
-<li><div class="src-line"><a name="a627"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;the&nbsp;idea&nbsp;:))</span></div></li>
-<li><div class="src-line"><a name="a628"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a629"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;The&nbsp;name&nbsp;for&nbsp;the&nbsp;current&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a630"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a631"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a632"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">get_language_name</span><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a633"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_ERROR_NO_SUCH_LANG</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a634"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'LANG_NAME'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;(Unknown&nbsp;Language)'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a635"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a636"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'LANG_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a637"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a638"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a639"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a640"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;source&nbsp;code&nbsp;for&nbsp;this&nbsp;object</span></div></li>
-<li><div class="src-line"><a name="a641"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a642"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;source&nbsp;code&nbsp;to&nbsp;highlight</span></div></li>
-<li><div class="src-line"><a name="a643"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a644"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a645"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_source">set_source</a><span class="src-sym">(</span><span class="src-var">$source</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a646"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">source</span>&nbsp;=&nbsp;<span class="src-var">$source</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a647"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a648"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a649"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a650"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a651"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;language&nbsp;for&nbsp;this&nbsp;object</span></div></li>
-<li><div class="src-line"><a name="a652"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a653"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@note</span><span class="src-doc">&nbsp;since&nbsp;1.0.8&nbsp;this&nbsp;function&nbsp;won't&nbsp;reset&nbsp;language-settings&nbsp;by&nbsp;default&nbsp;anymore!</span></div></li>
-<li><div class="src-line"><a name="a654"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;you&nbsp;need&nbsp;this&nbsp;set&nbsp;$force_reset&nbsp;=&nbsp;true</span></div></li>
-<li><div class="src-line"><a name="a655"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a656"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;name&nbsp;of&nbsp;the&nbsp;language&nbsp;to&nbsp;use</span></div></li>
-<li><div class="src-line"><a name="a657"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a658"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a659"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_language">set_language</a><span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$force_reset</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a660"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$force_reset</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a661"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">loaded_language</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a662"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a663"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a664"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Clean&nbsp;up&nbsp;the&nbsp;language&nbsp;name&nbsp;to&nbsp;prevent&nbsp;malicious&nbsp;code&nbsp;injection</span></span></div></li>
-<li><div class="src-line"><a name="a665"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$language</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'#[^a-zA-Z0-9\-_]#'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$language</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a666"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a667"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$language</span>&nbsp;=&nbsp;<a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$language</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a668"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a669"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Retreive&nbsp;the&nbsp;full&nbsp;filename</span></span></div></li>
-<li><div class="src-line"><a name="a670"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$file_name</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_path</span>&nbsp;.&nbsp;<span class="src-var">$language</span>&nbsp;.&nbsp;<span class="src-str">'.php'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a671"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$file_name</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">loaded_language</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a672"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;language&nbsp;is&nbsp;already&nbsp;loaded!</span></span></div></li>
-<li><div class="src-line"><a name="a673"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a674"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a675"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a676"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span>&nbsp;=&nbsp;<span class="src-var">$language</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a677"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a678"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a679"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span>&nbsp;=&nbsp;<span class="src-id">GESHI_NEVER</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a680"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a681"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;we&nbsp;can&nbsp;read&nbsp;the&nbsp;desired&nbsp;file</span></span></div></li>
-<li><div class="src-line"><a name="a682"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a683"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>&nbsp;=&nbsp;<span class="src-id">GESHI_ERROR_NO_SUCH_LANG</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a684"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a685"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a686"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a687"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Load&nbsp;the&nbsp;language&nbsp;for&nbsp;parsing</span></span></div></li>
-<li><div class="src-line"><a name="a688"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">load_language</span><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a689"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a690"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a691"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a692"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;path&nbsp;to&nbsp;the&nbsp;directory&nbsp;containing&nbsp;the&nbsp;language&nbsp;files.&nbsp;Note</span></div></li>
-<li><div class="src-line"><a name="a693"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;that&nbsp;this&nbsp;path&nbsp;is&nbsp;relative&nbsp;to&nbsp;the&nbsp;directory&nbsp;of&nbsp;the&nbsp;script&nbsp;that&nbsp;included</span></div></li>
-<li><div class="src-line"><a name="a694"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;geshi.php,&nbsp;NOT&nbsp;geshi.php&nbsp;itself.</span></div></li>
-<li><div class="src-line"><a name="a695"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a696"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;path&nbsp;to&nbsp;the&nbsp;language&nbsp;directory</span></div></li>
-<li><div class="src-line"><a name="a697"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a698"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span><span class="src-doc">&nbsp;The&nbsp;path&nbsp;to&nbsp;the&nbsp;language&nbsp;files&nbsp;should&nbsp;now&nbsp;be&nbsp;automatically</span></div></li>
-<li><div class="src-line"><a name="a699"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;detected,&nbsp;so&nbsp;this&nbsp;method&nbsp;should&nbsp;no&nbsp;longer&nbsp;be&nbsp;needed.&nbsp;The</span></div></li>
-<li><div class="src-line"><a name="a700"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.1.X&nbsp;branch&nbsp;handles&nbsp;manual&nbsp;setting&nbsp;of&nbsp;the&nbsp;path&nbsp;differently</span></div></li>
-<li><div class="src-line"><a name="a701"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;so&nbsp;this&nbsp;method&nbsp;will&nbsp;disappear&nbsp;in&nbsp;1.2.0.</span></div></li>
-<li><div class="src-line"><a name="a702"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a703"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_language_path">set_language_path</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a704"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">,</span><span class="src-str">':'</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a705"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Security&nbsp;Fix&nbsp;to&nbsp;prevent&nbsp;external&nbsp;directories&nbsp;using&nbsp;fopen&nbsp;wrappers.</span></span></div></li>
-<li><div class="src-line"><a name="a706"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">DIRECTORY_SEPARATOR</span>&nbsp;==&nbsp;<span class="src-str">&quot;\\&quot;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a707"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'#^[a-zA-Z]:#'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$path</span><span class="src-sym">)</span>&nbsp;||&nbsp;<span class="src-id">false</span>&nbsp;!==&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">,</span>&nbsp;<span class="src-str">':'</span><span class="src-sym">,</span>&nbsp;<span class="src-num">2</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a708"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a709"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a710"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a711"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a712"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a713"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a714"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'#[^/a-zA-Z0-9_\.\-\\\s:]#'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$path</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a715"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Security&nbsp;Fix&nbsp;to&nbsp;prevent&nbsp;external&nbsp;directories&nbsp;using&nbsp;fopen&nbsp;wrappers.</span></span></div></li>
-<li><div class="src-line"><a name="a716"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a717"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a718"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_SECURITY_PARANOID&quot;&gt;GESHI_SECURITY_PARANOID&lt;/a&gt;</span>&nbsp;&amp;&amp;&nbsp;<span class="src-id">false</span>&nbsp;!==&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/.'</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a719"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Security&nbsp;Fix&nbsp;to&nbsp;prevent&nbsp;external&nbsp;directories&nbsp;using&nbsp;fopen&nbsp;wrappers.</span></span></div></li>
-<li><div class="src-line"><a name="a720"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a721"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a722"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_SECURITY_PARANOID&quot;&gt;GESHI_SECURITY_PARANOID&lt;/a&gt;</span>&nbsp;&amp;&amp;&nbsp;<span class="src-id">false</span>&nbsp;!==&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'..'</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a723"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Security&nbsp;Fix&nbsp;to&nbsp;prevent&nbsp;external&nbsp;directories&nbsp;using&nbsp;fopen&nbsp;wrappers.</span></span></div></li>
-<li><div class="src-line"><a name="a724"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a725"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a726"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a727"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_path</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-str">'/'</span>&nbsp;==&nbsp;<span class="src-var">$path</span><span class="src-sym">[</span><a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$path</span><span class="src-sym">)</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-var">$path</span>&nbsp;:&nbsp;<span class="src-var">$path</span>&nbsp;.&nbsp;<span class="src-str">'/'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a728"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_language">set_language</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;otherwise&nbsp;set_language_path&nbsp;has&nbsp;no&nbsp;effect</span></span></div></li>
-<li><div class="src-line"><a name="a729"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a730"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a731"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a732"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a733"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;type&nbsp;of&nbsp;header&nbsp;to&nbsp;be&nbsp;used.</span></div></li>
-<li><div class="src-line"><a name="a734"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a735"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;GESHI_HEADER_DIV&nbsp;is&nbsp;used,&nbsp;the&nbsp;code&nbsp;is&nbsp;surrounded&nbsp;in&nbsp;a&nbsp;&quot;div&quot;.This</span></div></li>
-<li><div class="src-line"><a name="a736"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;means&nbsp;more&nbsp;source&nbsp;code&nbsp;but&nbsp;more&nbsp;control&nbsp;over&nbsp;tab&nbsp;width&nbsp;and&nbsp;line-wrapping.</span></div></li>
-<li><div class="src-line"><a name="a737"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;GESHI_HEADER_PRE&nbsp;means&nbsp;that&nbsp;a&nbsp;&quot;pre&quot;&nbsp;is&nbsp;used&nbsp;-&nbsp;less&nbsp;source,&nbsp;but&nbsp;less</span></div></li>
-<li><div class="src-line"><a name="a738"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;control.&nbsp;Default&nbsp;is&nbsp;GESHI_HEADER_PRE.</span></div></li>
-<li><div class="src-line"><a name="a739"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a740"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;From&nbsp;1.0.7.2,&nbsp;you&nbsp;can&nbsp;use&nbsp;GESHI_HEADER_NONE&nbsp;to&nbsp;specify&nbsp;that&nbsp;no&nbsp;header&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a741"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;should&nbsp;be&nbsp;outputted.</span></div></li>
-<li><div class="src-line"><a name="a742"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a743"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">The&nbsp;type&nbsp;of&nbsp;header&nbsp;to&nbsp;be&nbsp;used</span></div></li>
-<li><div class="src-line"><a name="a744"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a745"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a746"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_header_type">set_header_type</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a747"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;we&nbsp;got&nbsp;a&nbsp;valid&nbsp;header&nbsp;type</span></span></div></li>
-<li><div class="src-line"><a name="a748"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">,</span>&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_NONE&quot;&gt;GESHI_HEADER_NONE&lt;/a&gt;</span><span class="src-sym">,</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_DIV&quot;&gt;GESHI_HEADER_DIV&lt;/a&gt;</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a749"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE&quot;&gt;GESHI_HEADER_PRE&lt;/a&gt;</span><span class="src-sym">,</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">,</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE&quot;&gt;GESHI_HEADER_PRE_TABLE&lt;/a&gt;</span><span class="src-sym">)))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a750"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>&nbsp;=&nbsp;<span class="src-id">GESHI_ERROR_INVALID_HEADER_TYPE</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a751"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a752"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a753"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a754"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Set&nbsp;that&nbsp;new&nbsp;header&nbsp;type</span></span></div></li>
-<li><div class="src-line"><a name="a755"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_type</span>&nbsp;=&nbsp;<span class="src-var">$type</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a756"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a757"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a758"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a759"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;the&nbsp;code&nbsp;that&nbsp;will&nbsp;be&nbsp;outputted</span></div></li>
-<li><div class="src-line"><a name="a760"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;when&nbsp;this&nbsp;object&nbsp;is&nbsp;parsed.&nbsp;The&nbsp;style&nbsp;should&nbsp;be&nbsp;a</span></div></li>
-<li><div class="src-line"><a name="a761"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;string&nbsp;of&nbsp;valid&nbsp;stylesheet&nbsp;declarations</span></div></li>
-<li><div class="src-line"><a name="a762"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a763"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;overall&nbsp;style&nbsp;for&nbsp;the&nbsp;outputted&nbsp;code&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a764"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;styles&nbsp;with&nbsp;the&nbsp;current&nbsp;styles&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a765"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a766"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a767"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_overall_style">set_overall_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a768"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a769"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a770"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a771"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_style</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a772"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a773"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a774"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a775"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a776"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;overall&nbsp;classname&nbsp;for&nbsp;this&nbsp;block&nbsp;of&nbsp;code.&nbsp;This</span></div></li>
-<li><div class="src-line"><a name="a777"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;class&nbsp;can&nbsp;then&nbsp;be&nbsp;used&nbsp;in&nbsp;a&nbsp;stylesheet&nbsp;to&nbsp;style&nbsp;this&nbsp;object's</span></div></li>
-<li><div class="src-line"><a name="a778"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;output</span></div></li>
-<li><div class="src-line"><a name="a779"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a780"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;class&nbsp;name&nbsp;to&nbsp;use&nbsp;for&nbsp;this&nbsp;block&nbsp;of&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a781"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a782"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a783"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_overall_class">set_overall_class</a><span class="src-sym">(</span><span class="src-var">$class</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a784"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_class</span>&nbsp;=&nbsp;<span class="src-var">$class</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a785"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a786"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a787"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a788"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;overall&nbsp;id&nbsp;for&nbsp;this&nbsp;block&nbsp;of&nbsp;code.&nbsp;This&nbsp;id&nbsp;can&nbsp;then</span></div></li>
-<li><div class="src-line"><a name="a789"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;be&nbsp;used&nbsp;in&nbsp;a&nbsp;stylesheet&nbsp;to&nbsp;style&nbsp;this&nbsp;object's&nbsp;output</span></div></li>
-<li><div class="src-line"><a name="a790"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a791"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;ID&nbsp;to&nbsp;use&nbsp;for&nbsp;this&nbsp;block&nbsp;of&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a792"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a793"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a794"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_overall_id">set_overall_id</a><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a795"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">overall_id</span>&nbsp;=&nbsp;<span class="src-var">$id</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a796"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a797"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a798"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a799"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;whether&nbsp;CSS&nbsp;classes&nbsp;should&nbsp;be&nbsp;used&nbsp;to&nbsp;highlight&nbsp;the&nbsp;source.&nbsp;Default</span></div></li>
-<li><div class="src-line"><a name="a800"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;is&nbsp;off,&nbsp;calling&nbsp;this&nbsp;method&nbsp;with&nbsp;no&nbsp;arguments&nbsp;will&nbsp;turn&nbsp;it&nbsp;on</span></div></li>
-<li><div class="src-line"><a name="a801"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a802"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;classes&nbsp;on&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a803"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a804"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a805"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_classes">enable_classes</a><span class="src-sym">(</span><span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a806"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a807"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a808"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a809"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a810"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;style&nbsp;for&nbsp;the&nbsp;actual&nbsp;code.&nbsp;This&nbsp;should&nbsp;be&nbsp;a&nbsp;string</span></div></li>
-<li><div class="src-line"><a name="a811"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;containing&nbsp;valid&nbsp;stylesheet&nbsp;declarations.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a812"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a813"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a814"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a815"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Note:&nbsp;Use&nbsp;this&nbsp;method&nbsp;to&nbsp;override&nbsp;any&nbsp;style&nbsp;changes&nbsp;you&nbsp;made&nbsp;to</span></div></li>
-<li><div class="src-line"><a name="a816"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;line&nbsp;numbers&nbsp;if&nbsp;you&nbsp;are&nbsp;using&nbsp;line&nbsp;numbers,&nbsp;else&nbsp;the&nbsp;line&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a817"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;code&nbsp;will&nbsp;have&nbsp;the&nbsp;same&nbsp;style&nbsp;as&nbsp;the&nbsp;line&nbsp;number!&nbsp;Consult&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a818"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;GeSHi&nbsp;documentation&nbsp;for&nbsp;more&nbsp;information&nbsp;about&nbsp;this.</span></div></li>
-<li><div class="src-line"><a name="a819"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a820"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;use&nbsp;for&nbsp;actual&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a821"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;current&nbsp;styles&nbsp;with&nbsp;the&nbsp;new&nbsp;styles</span></div></li>
-<li><div class="src-line"><a name="a822"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a823"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a824"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_code_style">set_code_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a825"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a826"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a827"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a828"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">code_style</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a829"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a830"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a831"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a832"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a833"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;the&nbsp;line&nbsp;numbers.</span></div></li>
-<li><div class="src-line"><a name="a834"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a835"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;style&nbsp;for&nbsp;the&nbsp;line&nbsp;numbers&nbsp;that&nbsp;are&nbsp;&quot;normal&quot;</span></div></li>
-<li><div class="src-line"><a name="a836"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string</span><span class="src-doc">|</span><span class="src-doc-type">boolean</span><span class="src-doc">If&nbsp;a&nbsp;string,&nbsp;this&nbsp;is&nbsp;the&nbsp;style&nbsp;of&nbsp;the&nbsp;line</span></div></li>
-<li><div class="src-line"><a name="a837"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;numbers&nbsp;that&nbsp;are&nbsp;&quot;fancy&quot;,&nbsp;otherwise&nbsp;if&nbsp;boolean&nbsp;then&nbsp;this</span></div></li>
-<li><div class="src-line"><a name="a838"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;defines&nbsp;whether&nbsp;the&nbsp;normal&nbsp;styles&nbsp;should&nbsp;be&nbsp;merged&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a839"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new&nbsp;normal&nbsp;styles&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a840"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">If&nbsp;set,&nbsp;is&nbsp;the&nbsp;flag&nbsp;for&nbsp;whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;&quot;fancy&quot;</span></div></li>
-<li><div class="src-line"><a name="a841"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;styles&nbsp;with&nbsp;the&nbsp;current&nbsp;styles&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a842"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a843"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a844"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_line_style">set_line_style</a><span class="src-sym">(</span><span class="src-var">$style1</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style2</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a845"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;we&nbsp;got&nbsp;2&nbsp;or&nbsp;three&nbsp;parameters</span></span></div></li>
-<li><div class="src-line"><a name="a846"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_bool">is_bool</a><span class="src-sym">(</span><span class="src-var">$style2</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a847"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-var">$style2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a848"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style2</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a849"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a850"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a851"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Actually&nbsp;set&nbsp;the&nbsp;new&nbsp;styles</span></span></div></li>
-<li><div class="src-line"><a name="a852"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a853"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span>&nbsp;=&nbsp;<span class="src-var">$style1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a854"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span>&nbsp;=&nbsp;<span class="src-var">$style2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a855"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a856"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style1</span>&nbsp;.=&nbsp;<span class="src-var">$style1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a857"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_style2</span>&nbsp;.=&nbsp;<span class="src-var">$style2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a858"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a859"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a860"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a861"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a862"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;whether&nbsp;line&nbsp;numbers&nbsp;should&nbsp;be&nbsp;displayed.</span></div></li>
-<li><div class="src-line"><a name="a863"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a864"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Valid&nbsp;values&nbsp;for&nbsp;the&nbsp;first&nbsp;parameter&nbsp;are:</span></div></li>
-<li><div class="src-line"><a name="a865"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a866"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;GESHI_NO_LINE_NUMBERS:&nbsp;Line&nbsp;numbers&nbsp;will&nbsp;not&nbsp;be&nbsp;displayed</span></div></li>
-<li><div class="src-line"><a name="a867"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;GESHI_NORMAL_LINE_NUMBERS:&nbsp;Line&nbsp;numbers&nbsp;will&nbsp;be&nbsp;displayed</span></div></li>
-<li><div class="src-line"><a name="a868"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;GESHI_FANCY_LINE_NUMBERS:&nbsp;Fancy&nbsp;line&nbsp;numbers&nbsp;will&nbsp;be&nbsp;displayed</span></div></li>
-<li><div class="src-line"><a name="a869"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a870"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;For&nbsp;fancy&nbsp;line&nbsp;numbers,&nbsp;the&nbsp;second&nbsp;parameter&nbsp;is&nbsp;used&nbsp;to&nbsp;signal&nbsp;which&nbsp;lines</span></div></li>
-<li><div class="src-line"><a name="a871"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;are&nbsp;to&nbsp;be&nbsp;fancy.&nbsp;For&nbsp;example,&nbsp;if&nbsp;the&nbsp;value&nbsp;of&nbsp;this&nbsp;parameter&nbsp;is&nbsp;5&nbsp;then&nbsp;every</span></div></li>
-<li><div class="src-line"><a name="a872"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;5th&nbsp;line&nbsp;will&nbsp;be&nbsp;fancy.</span></div></li>
-<li><div class="src-line"><a name="a873"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a874"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">How&nbsp;line&nbsp;numbers&nbsp;should&nbsp;be&nbsp;displayed</span></div></li>
-<li><div class="src-line"><a name="a875"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">Defines&nbsp;which&nbsp;lines&nbsp;are&nbsp;fancy</span></div></li>
-<li><div class="src-line"><a name="a876"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a877"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a878"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_line_numbers">enable_line_numbers</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$nth_row</span>&nbsp;=&nbsp;<span class="src-num">5</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a879"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;!=&nbsp;<span class="src-var">$flag</span>&nbsp;&amp;&amp;&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NORMAL_LINE_NUMBERS&quot;&gt;GESHI_NORMAL_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;!=&nbsp;<span class="src-var">$flag</span></span></div></li>
-<li><div class="src-line"><a name="a880"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS&quot;&gt;GESHI_FANCY_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;!=&nbsp;<span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a881"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>&nbsp;=&nbsp;<span class="src-id">GESHI_ERROR_INVALID_LINE_NUMBER_TYPE</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a882"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a883"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers</span>&nbsp;=&nbsp;<span class="src-var">$flag</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a884"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_nth_row</span>&nbsp;=&nbsp;<span class="src-var">$nth_row</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a885"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a886"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a887"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a888"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;wether&nbsp;spans&nbsp;and&nbsp;other&nbsp;HTML&nbsp;markup&nbsp;generated&nbsp;by&nbsp;GeSHi&nbsp;can</span></div></li>
-<li><div class="src-line"><a name="a889"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;span&nbsp;over&nbsp;multiple&nbsp;lines&nbsp;or&nbsp;not.&nbsp;Defaults&nbsp;to&nbsp;true&nbsp;to&nbsp;reduce&nbsp;overhead.</span></div></li>
-<li><div class="src-line"><a name="a890"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;it&nbsp;to&nbsp;false&nbsp;if&nbsp;you&nbsp;want&nbsp;to&nbsp;manipulate&nbsp;the&nbsp;output&nbsp;or&nbsp;manually&nbsp;display</span></div></li>
-<li><div class="src-line"><a name="a891"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;code&nbsp;in&nbsp;an&nbsp;ordered&nbsp;list.</span></div></li>
-<li><div class="src-line"><a name="a892"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a893"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Wether&nbsp;multiline&nbsp;spans&nbsp;are&nbsp;allowed&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a894"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.7.22</span></div></li>
-<li><div class="src-line"><a name="a895"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a896"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_multiline_span">enable_multiline_span</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a897"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">allow_multiline_span</span>&nbsp;=&nbsp;(bool)&nbsp;<span class="src-var">$flag</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a898"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a899"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a900"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a901"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;current&nbsp;setting&nbsp;for&nbsp;multiline&nbsp;spans,&nbsp;see&nbsp;GeSHi-&gt;enable_multiline_span().</span></div></li>
-<li><div class="src-line"><a name="a902"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a903"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;enable_multiline_span</span></div></li>
-<li><div class="src-line"><a name="a904"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">bool&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a905"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a906"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodget_multiline_span">get_multiline_span</a><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a907"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">allow_multiline_span</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a908"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a909"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a910"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a911"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;style&nbsp;for&nbsp;a&nbsp;keyword&nbsp;group.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a912"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a913"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a914"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a915"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;change&nbsp;the&nbsp;styles&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a916"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;keywords</span></div></li>
-<li><div class="src-line"><a name="a917"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a918"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a919"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a920"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a921"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_keyword_group_style">set_keyword_group_style</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a922"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Set&nbsp;the&nbsp;style&nbsp;for&nbsp;this&nbsp;keyword&nbsp;group</span></span></div></li>
-<li><div class="src-line"><a name="a923"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a924"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a925"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a926"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a927"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a928"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a929"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Update&nbsp;the&nbsp;lexic&nbsp;permissions</span></span></div></li>
-<li><div class="src-line"><a name="a930"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a931"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a932"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a933"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a934"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a935"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a936"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;a&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a937"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a938"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;turn&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a939"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;that&nbsp;group&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a940"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a941"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a942"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_keyword_group_highlighting">set_keyword_group_highlighting</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a943"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a944"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a945"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a946"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a947"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;comment&nbsp;groups.&nbsp;&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a948"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a949"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a950"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a951"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;comment&nbsp;group&nbsp;to&nbsp;change&nbsp;the&nbsp;styles&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a952"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;comments</span></div></li>
-<li><div class="src-line"><a name="a953"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a954"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a955"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a956"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a957"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_comments_style">set_comments_style</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a958"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a959"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a960"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a961"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a962"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a963"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a964"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a965"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a966"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;comment&nbsp;groups</span></div></li>
-<li><div class="src-line"><a name="a967"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a968"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;comment&nbsp;group&nbsp;to&nbsp;turn&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a969"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;that&nbsp;group&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a970"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a971"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a972"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_comments_highlighting">set_comments_highlighting</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a973"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a974"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a975"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a976"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a977"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;escaped&nbsp;characters.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a978"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a979"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a980"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a981"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;escape&nbsp;characters</span></div></li>
-<li><div class="src-line"><a name="a982"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a983"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a984"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a985"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a986"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_escape_characters_style">set_escape_characters_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a987"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a988"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a989"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a990"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a991"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a992"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a993"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a994"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a995"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;escaped&nbsp;characters</span></div></li>
-<li><div class="src-line"><a name="a996"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a997"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;escape&nbsp;characters&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a998"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a999"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1000"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_escape_characters_highlighting">set_escape_characters_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1001"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1002"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1003"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1004"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1005"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;brackets.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a1006"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1007"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a1008"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1009"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;DEPRECATED:&nbsp;use&nbsp;set_symbols_style&nbsp;instead.</span></div></li>
-<li><div class="src-line"><a name="a1010"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;will&nbsp;be&nbsp;removed&nbsp;in&nbsp;1.2.X</span></div></li>
-<li><div class="src-line"><a name="a1011"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1012"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;brackets</span></div></li>
-<li><div class="src-line"><a name="a1013"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a1014"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a1015"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1016"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span><span class="src-doc">&nbsp;In&nbsp;favour&nbsp;of&nbsp;set_symbols_style</span></div></li>
-<li><div class="src-line"><a name="a1017"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1018"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_brackets_style">set_brackets_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1019"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1020"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1021"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1022"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1023"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1024"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1025"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1026"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1027"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;brackets</span></div></li>
-<li><div class="src-line"><a name="a1028"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1029"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;is&nbsp;DEPRECATED:&nbsp;use&nbsp;set_symbols_highlighting&nbsp;instead.</span></div></li>
-<li><div class="src-line"><a name="a1030"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;will&nbsp;be&nbsp;remove&nbsp;in&nbsp;1.2.X</span></div></li>
-<li><div class="src-line"><a name="a1031"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1032"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;brackets&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1033"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1034"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span><span class="src-doc">&nbsp;In&nbsp;favour&nbsp;of&nbsp;set_symbols_highlighting</span></div></li>
-<li><div class="src-line"><a name="a1035"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1036"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_brackets_highlighting">set_brackets_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1037"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1038"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1039"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1040"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1041"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;symbols.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a1042"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1043"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a1044"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1045"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;symbols</span></div></li>
-<li><div class="src-line"><a name="a1046"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a1047"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a1048"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;Tells&nbsp;the&nbsp;group&nbsp;of&nbsp;symbols&nbsp;for&nbsp;which&nbsp;style&nbsp;should&nbsp;be&nbsp;set.</span></div></li>
-<li><div class="src-line"><a name="a1049"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.1</span></div></li>
-<li><div class="src-line"><a name="a1050"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1051"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_symbols_style">set_symbols_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$group</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1052"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Update&nbsp;the&nbsp;style&nbsp;of&nbsp;symbols</span></span></div></li>
-<li><div class="src-line"><a name="a1053"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1054"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1055"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1056"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1057"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1058"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1059"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;For&nbsp;backward&nbsp;compatibility</span></span></div></li>
-<li><div class="src-line"><a name="a1060"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-num">0</span>&nbsp;==&nbsp;<span class="src-var">$group</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1061"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_brackets_style">set_brackets_style</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1062"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1063"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1064"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1065"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1066"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;symbols</span></div></li>
-<li><div class="src-line"><a name="a1067"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1068"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;symbols&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1069"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1070"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1071"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_symbols_highlighting">set_symbols_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1072"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Update&nbsp;lexic&nbsp;permissions&nbsp;for&nbsp;this&nbsp;symbol&nbsp;group</span></span></div></li>
-<li><div class="src-line"><a name="a1073"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1074"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1075"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;For&nbsp;backward&nbsp;compatibility</span></span></div></li>
-<li><div class="src-line"><a name="a1076"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_brackets_highlighting">set_brackets_highlighting</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1077"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1078"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1079"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1080"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;strings.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a1081"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1082"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a1083"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1084"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;escape&nbsp;characters</span></div></li>
-<li><div class="src-line"><a name="a1085"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a1086"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a1087"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1088"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1089"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_strings_style">set_strings_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1090"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1091"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1092"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1093"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1094"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1095"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1096"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1097"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1098"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;strings</span></div></li>
-<li><div class="src-line"><a name="a1099"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1100"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;strings&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1101"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1102"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1103"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_strings_highlighting">set_strings_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1104"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1105"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1106"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1107"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1108"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;numbers.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a1109"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1110"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a1111"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1112"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;numbers</span></div></li>
-<li><div class="src-line"><a name="a1113"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a1114"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a1115"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1116"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1117"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_numbers_style">set_numbers_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1118"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1119"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1120"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1121"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1122"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1123"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1124"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1125"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;numbers</span></div></li>
-<li><div class="src-line"><a name="a1127"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;numbers&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1129"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1130"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1131"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_numbers_highlighting">set_numbers_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1132"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1133"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1134"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1135"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1136"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;methods.&nbsp;$key&nbsp;is&nbsp;a&nbsp;number&nbsp;that&nbsp;references&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1137"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;appropriate&nbsp;&quot;object&nbsp;splitter&quot;&nbsp;-&nbsp;see&nbsp;the&nbsp;language&nbsp;file&nbsp;for&nbsp;the&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a1138"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;you&nbsp;are&nbsp;highlighting&nbsp;to&nbsp;get&nbsp;this&nbsp;number.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a1139"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1140"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a1141"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1142"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;object&nbsp;splitter&nbsp;to&nbsp;change&nbsp;the&nbsp;styles&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a1143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;methods</span></div></li>
-<li><div class="src-line"><a name="a1144"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a1145"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a1146"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1147"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1148"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_methods_style">set_methods_style</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1149"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1150"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1151"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1152"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1153"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1154"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1155"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1156"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1157"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;methods</span></div></li>
-<li><div class="src-line"><a name="a1158"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1159"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;methods&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1160"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1161"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1162"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_methods_highlighting">set_methods_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1163"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1164"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1165"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1166"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1167"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;styles&nbsp;for&nbsp;regexps.&nbsp;If&nbsp;$preserve_defaults&nbsp;is</span></div></li>
-<li><div class="src-line"><a name="a1168"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;true,&nbsp;then&nbsp;styles&nbsp;are&nbsp;merged&nbsp;with&nbsp;the&nbsp;default&nbsp;styles,&nbsp;with&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1169"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;user&nbsp;defined&nbsp;styles&nbsp;having&nbsp;priority</span></div></li>
-<li><div class="src-line"><a name="a1170"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1171"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;style&nbsp;to&nbsp;make&nbsp;the&nbsp;regular&nbsp;expression&nbsp;matches</span></div></li>
-<li><div class="src-line"><a name="a1172"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;merge&nbsp;the&nbsp;new&nbsp;styles&nbsp;with&nbsp;the&nbsp;old&nbsp;or&nbsp;just</span></div></li>
-<li><div class="src-line"><a name="a1173"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to&nbsp;overwrite&nbsp;them</span></div></li>
-<li><div class="src-line"><a name="a1174"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1176"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_regexps_style">set_regexps_style</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$preserve_defaults</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1177"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$preserve_defaults</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1178"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1179"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1180"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1181"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1182"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1183"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1184"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1185"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;highlighting&nbsp;on/off&nbsp;for&nbsp;regexps</span></div></li>
-<li><div class="src-line"><a name="a1186"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1187"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;regular&nbsp;expression&nbsp;group&nbsp;to&nbsp;turn&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1188"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;turn&nbsp;highlighting&nbsp;for&nbsp;the&nbsp;regular&nbsp;expression&nbsp;group&nbsp;on&nbsp;or&nbsp;off</span></div></li>
-<li><div class="src-line"><a name="a1189"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1190"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1191"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_regexps_highlighting">set_regexps_highlighting</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1192"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1193"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1194"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1195"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1196"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;whether&nbsp;a&nbsp;set&nbsp;of&nbsp;keywords&nbsp;are&nbsp;checked&nbsp;for&nbsp;in&nbsp;a&nbsp;case&nbsp;sensitive&nbsp;manner</span></div></li>
-<li><div class="src-line"><a name="a1197"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1198"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;change&nbsp;the&nbsp;case&nbsp;sensitivity&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a1199"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;check&nbsp;in&nbsp;a&nbsp;case&nbsp;sensitive&nbsp;manner&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a1200"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1201"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1202"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_case_sensitivity">set_case_sensitivity</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$case</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1203"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$case</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1204"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1205"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1206"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1207"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;case&nbsp;that&nbsp;keywords&nbsp;should&nbsp;use&nbsp;when&nbsp;found.&nbsp;Use&nbsp;the&nbsp;constants:</span></div></li>
-<li><div class="src-line"><a name="a1208"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1209"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;GESHI_CAPS_NO_CHANGE:&nbsp;leave&nbsp;keywords&nbsp;as-is</span></div></li>
-<li><div class="src-line"><a name="a1210"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;GESHI_CAPS_UPPER:&nbsp;convert&nbsp;all&nbsp;keywords&nbsp;to&nbsp;uppercase&nbsp;where&nbsp;found</span></div></li>
-<li><div class="src-line"><a name="a1211"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;GESHI_CAPS_LOWER:&nbsp;convert&nbsp;all&nbsp;keywords&nbsp;to&nbsp;lowercase&nbsp;where&nbsp;found</span></div></li>
-<li><div class="src-line"><a name="a1212"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1213"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">A&nbsp;constant&nbsp;specifying&nbsp;what&nbsp;to&nbsp;do&nbsp;with&nbsp;matched&nbsp;keywords</span></div></li>
-<li><div class="src-line"><a name="a1214"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.1</span></div></li>
-<li><div class="src-line"><a name="a1215"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1216"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_case_keywords">set_case_keywords</a><span class="src-sym">(</span><span class="src-var">$case</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1217"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$case</span><span class="src-sym">,</span>&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a1218"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_CAPS_NO_CHANGE&quot;&gt;GESHI_CAPS_NO_CHANGE&lt;/a&gt;</span><span class="src-sym">,</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_CAPS_UPPER&quot;&gt;GESHI_CAPS_UPPER&lt;/a&gt;</span><span class="src-sym">,</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_CAPS_LOWER&quot;&gt;GESHI_CAPS_LOWER&lt;/a&gt;</span><span class="src-sym">)))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1219"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_KEYWORDS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$case</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1220"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1221"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1222"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1223"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1224"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;how&nbsp;many&nbsp;spaces&nbsp;a&nbsp;tab&nbsp;is&nbsp;substituted&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a1225"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1226"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Widths&nbsp;below&nbsp;zero&nbsp;are&nbsp;ignored</span></div></li>
-<li><div class="src-line"><a name="a1227"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1228"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">The&nbsp;tab&nbsp;width</span></div></li>
-<li><div class="src-line"><a name="a1229"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1230"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1231"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_tab_width">set_tab_width</a><span class="src-sym">(</span><span class="src-var">$width</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1232"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tab_width</span>&nbsp;=&nbsp;<a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$width</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1233"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1234"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;it&nbsp;fit's&nbsp;the&nbsp;constraints:</span></span></div></li>
-<li><div class="src-line"><a name="a1235"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tab_width</span>&nbsp;<&nbsp;<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1236"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Return&nbsp;it&nbsp;to&nbsp;the&nbsp;default</span></span></div></li>
-<li><div class="src-line"><a name="a1237"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tab_width</span>&nbsp;=&nbsp;<span class="src-num">8</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1238"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1239"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1240"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1241"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1242"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;whether&nbsp;or&nbsp;not&nbsp;to&nbsp;use&nbsp;tab-stop&nbsp;width&nbsp;specifed&nbsp;by&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a1243"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1244"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;use&nbsp;language-specific&nbsp;tab-stop&nbsp;widths</span></div></li>
-<li><div class="src-line"><a name="a1245"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.7.20</span></div></li>
-<li><div class="src-line"><a name="a1246"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1247"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_use_language_tab_width">set_use_language_tab_width</a><span class="src-sym">(</span><span class="src-var">$use</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1248"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_language_tab_width</span>&nbsp;=&nbsp;(bool)&nbsp;<span class="src-var">$use</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1249"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1250"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1251"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1252"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;the&nbsp;tab&nbsp;width&nbsp;to&nbsp;use,&nbsp;based&nbsp;on&nbsp;the&nbsp;current&nbsp;language&nbsp;and&nbsp;user</span></div></li>
-<li><div class="src-line"><a name="a1253"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;preference</span></div></li>
-<li><div class="src-line"><a name="a1254"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1255"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">Tab&nbsp;width</span></div></li>
-<li><div class="src-line"><a name="a1256"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.7.20</span></div></li>
-<li><div class="src-line"><a name="a1257"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1258"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodget_real_tab_width">get_real_tab_width</a><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1259"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_language_tab_width</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a1260"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'TAB_WIDTH'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1261"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">tab_width</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1262"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1263"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'TAB_WIDTH'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1264"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1265"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1266"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1267"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1268"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Enables/disables&nbsp;strict&nbsp;highlighting.&nbsp;Default&nbsp;is&nbsp;off,&nbsp;calling&nbsp;this</span></div></li>
-<li><div class="src-line"><a name="a1269"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;method&nbsp;without&nbsp;parameters&nbsp;will&nbsp;turn&nbsp;it&nbsp;on.&nbsp;See&nbsp;documentation</span></div></li>
-<li><div class="src-line"><a name="a1270"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;more&nbsp;details&nbsp;on&nbsp;strict&nbsp;mode&nbsp;and&nbsp;where&nbsp;to&nbsp;use&nbsp;it.</span></div></li>
-<li><div class="src-line"><a name="a1271"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1272"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;to&nbsp;enable&nbsp;strict&nbsp;mode&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a1273"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1274"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1275"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_strict_mode">enable_strict_mode</a><span class="src-sym">(</span><span class="src-var">$mode</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1276"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_MAYBE</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STRICT_MODE_APPLIES'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1277"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">strict_mode</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$mode</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">GESHI_ALWAYS</span>&nbsp;:&nbsp;<span class="src-id">GESHI_NEVER</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1278"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1279"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1280"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1281"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1282"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Disables&nbsp;all&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a1283"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1284"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1285"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;&nbsp;Rewrite&nbsp;with&nbsp;array&nbsp;traversal</span></div></li>
-<li><div class="src-line"><a name="a1286"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span><span class="src-doc">&nbsp;In&nbsp;favour&nbsp;of&nbsp;enable_highlighting</span></div></li>
-<li><div class="src-line"><a name="a1287"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1288"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methoddisable_highlighting">disable_highlighting</a><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1289"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodenable_highlighting">enable_highlighting</a><span class="src-sym">(</span><span class="src-id">false</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1290"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1291"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1292"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1293"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Enables&nbsp;all&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a1294"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1295"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;optional&nbsp;flag&nbsp;parameter&nbsp;was&nbsp;added&nbsp;in&nbsp;version&nbsp;1.0.7.21&nbsp;and&nbsp;can&nbsp;be&nbsp;used</span></div></li>
-<li><div class="src-line"><a name="a1296"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;enable&nbsp;(true)&nbsp;or&nbsp;disable&nbsp;(false)&nbsp;all&nbsp;highlighting.</span></div></li>
-<li><div class="src-line"><a name="a1297"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1298"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1299"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">A&nbsp;flag&nbsp;specifying&nbsp;whether&nbsp;to&nbsp;enable&nbsp;or&nbsp;disable&nbsp;all&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a1300"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;&nbsp;Rewrite&nbsp;with&nbsp;array&nbsp;traversal</span></div></li>
-<li><div class="src-line"><a name="a1301"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1302"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_highlighting">enable_highlighting</a><span class="src-sym">(</span><span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1303"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-var">$flag</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1304"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$value</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1305"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1306"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$value</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$k</span>&nbsp;=&gt;&nbsp;<span class="src-var">$v</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1307"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$flag</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1308"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1309"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1310"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$flag</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1311"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1312"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1313"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1314"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Context&nbsp;blocks</span></span></div></li>
-<li><div class="src-line"><a name="a1315"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span>&nbsp;=&nbsp;<span class="src-var">$flag</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1316"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1317"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1318"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1319"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Given&nbsp;a&nbsp;file&nbsp;extension,&nbsp;this&nbsp;method&nbsp;returns&nbsp;either&nbsp;a&nbsp;valid&nbsp;geshi&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a1320"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;name,&nbsp;or&nbsp;the&nbsp;empty&nbsp;string&nbsp;if&nbsp;it&nbsp;couldn't&nbsp;be&nbsp;found</span></div></li>
-<li><div class="src-line"><a name="a1321"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1322"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;extension&nbsp;to&nbsp;get&nbsp;a&nbsp;language&nbsp;name&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a1323"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">&nbsp;A&nbsp;lookup&nbsp;array&nbsp;to&nbsp;use&nbsp;instead&nbsp;of&nbsp;the&nbsp;default&nbsp;one</span></div></li>
-<li><div class="src-line"><a name="a1324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.5</span></div></li>
-<li><div class="src-line"><a name="a1325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;Re-think&nbsp;about&nbsp;how&nbsp;this&nbsp;method&nbsp;works&nbsp;(maybe&nbsp;make&nbsp;it&nbsp;private&nbsp;and/or&nbsp;make&nbsp;it</span></div></li>
-<li><div class="src-line"><a name="a1326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a&nbsp;extension-&gt;lang&nbsp;lookup?)</span></div></li>
-<li><div class="src-line"><a name="a1327"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;static?</span></div></li>
-<li><div class="src-line"><a name="a1328"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1329"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodget_language_name_from_extension">get_language_name_from_extension</a><span class="src-sym">(</span>&nbsp;<span class="src-var">$extension</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$lookup</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1330"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>&nbsp;<span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$lookup</span><span class="src-sym">)</span>&nbsp;||&nbsp;<span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$lookup</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1331"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lookup</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a1332"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'actionscript'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'as'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1333"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'ada'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'a'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'ada'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'adb'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'ads'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1334"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'apache'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'conf'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1335"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'asm'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'ash'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'asm'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'inc'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1336"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'asp'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'asp'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1337"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'bash'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'sh'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1338"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'bf'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'bf'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1339"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'c'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'c'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'h'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1340"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'c_mac'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'c'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'h'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1341"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'caddcl'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1342"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'cadlisp'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1343"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'cdfg'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cdfg'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1344"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'cobol'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cbl'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1345"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'cpp'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cpp'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'hpp'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'C'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'H'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'CPP'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'HPP'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1346"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'csharp'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'cs'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1347"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'css'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'css'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1348"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'d'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'d'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1349"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'delphi'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'dpk'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'dpr'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'pp'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'pas'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1350"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'diff'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'diff'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'patch'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1351"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'dos'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'bat'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'cmd'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1352"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'gettext'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'po'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'pot'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1353"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'gml'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'gml'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1354"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'gnuplot'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'plt'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1355"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'groovy'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'groovy'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1356"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'haskell'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'hs'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1357"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'html4strict'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'html'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'htm'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1358"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'ini'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'ini'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'desktop'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1359"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'java'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'java'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1360"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'javascript'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'js'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1361"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'klonec'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'kl1'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1362"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'klonecpp'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'klx'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1363"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'latex'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'tex'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1364"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'lisp'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'lisp'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1365"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'lua'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'lua'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1366"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'matlab'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'m'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1367"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'mpasm'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1368"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'mysql'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'sql'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1369"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'nsis'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1370"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'objc'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1371"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'oobas'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1372"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'oracle8'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1373"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'oracle10'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1374"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'pascal'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pas'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1375"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'perl'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pl'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'pm'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1376"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'php'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'php'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'php5'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'phtml'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'phps'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1377"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'povray'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pov'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1378"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'providex'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pvc'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'pvx'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1379"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'prolog'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pl'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1380"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'python'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'py'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1381"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'qbasic'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'bi'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1382"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'reg'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'reg'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1383"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'ruby'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'rb'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1384"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'sas'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'sas'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1385"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'scala'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'scala'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1386"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'scheme'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'scm'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1387"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'scilab'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'sci'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1388"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'smalltalk'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'st'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1389"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'smarty'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1390"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'tcl'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'tcl'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1391"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'vb'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'bas'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1392"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'vbnet'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1393"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'visualfoxpro'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1394"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'whitespace'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'ws'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1395"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'xml'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'xml'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'svg'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1396"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'z80'</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'z80'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'asm'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'inc'</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a1397"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1398"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1399"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1400"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$lookup</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$lang</span>&nbsp;=&gt;&nbsp;<span class="src-var">$extensions</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1401"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$extension</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$extensions</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1402"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$lang</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1403"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1404"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1405"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1406"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1407"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1408"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1409"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Given&nbsp;a&nbsp;file&nbsp;name,&nbsp;this&nbsp;method&nbsp;loads&nbsp;its&nbsp;contents&nbsp;in,&nbsp;and&nbsp;attempts</span></div></li>
-<li><div class="src-line"><a name="a1410"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;set&nbsp;the&nbsp;language&nbsp;automatically.&nbsp;An&nbsp;optional&nbsp;lookup&nbsp;table&nbsp;can&nbsp;be</span></div></li>
-<li><div class="src-line"><a name="a1411"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;passed&nbsp;for&nbsp;looking&nbsp;up&nbsp;the&nbsp;language&nbsp;name.&nbsp;If&nbsp;not&nbsp;specified&nbsp;a&nbsp;default</span></div></li>
-<li><div class="src-line"><a name="a1412"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;table&nbsp;is&nbsp;used</span></div></li>
-<li><div class="src-line"><a name="a1413"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1414"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;language&nbsp;table&nbsp;is&nbsp;in&nbsp;the&nbsp;form</span></div></li>
-<li><div class="src-line"><a name="a1415"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;pre&gt;array(</span></div></li>
-<li><div class="src-line"><a name="a1416"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;'lang_name'&nbsp;=&gt;&nbsp;array('extension',&nbsp;'extension',&nbsp;...),</span></div></li>
-<li><div class="src-line"><a name="a1417"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;'lang_name'&nbsp;...</span></div></li>
-<li><div class="src-line"><a name="a1418"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;);&lt;/pre&gt;</span></div></li>
-<li><div class="src-line"><a name="a1419"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1420"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;filename&nbsp;to&nbsp;load&nbsp;the&nbsp;source&nbsp;from</span></div></li>
-<li><div class="src-line"><a name="a1421"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">&nbsp;A&nbsp;lookup&nbsp;array&nbsp;to&nbsp;use&nbsp;instead&nbsp;of&nbsp;the&nbsp;default&nbsp;one</span></div></li>
-<li><div class="src-line"><a name="a1422"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;Complete&nbsp;rethink&nbsp;of&nbsp;this&nbsp;and&nbsp;above&nbsp;method</span></div></li>
-<li><div class="src-line"><a name="a1423"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.5</span></div></li>
-<li><div class="src-line"><a name="a1424"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1425"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodload_from_file">load_from_file</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$lookup</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1426"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1427"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_source">set_source</a><span class="src-sym">(</span><a href="http://www.php.net/file_get_contents">file_get_contents</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1428"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_language">set_language</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodget_language_name_from_extension">get_language_name_from_extension</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/strrchr">strrchr</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'.'</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$lookup</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1429"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1430"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span>&nbsp;=&nbsp;<span class="src-id">GESHI_ERROR_FILE_NOT_READABLE</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1431"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1432"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1433"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1434"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1435"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Adds&nbsp;a&nbsp;keyword&nbsp;to&nbsp;a&nbsp;keyword&nbsp;group&nbsp;for&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a1436"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1437"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;add&nbsp;the&nbsp;keyword&nbsp;to</span></div></li>
-<li><div class="src-line"><a name="a1438"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;word&nbsp;to&nbsp;add&nbsp;to&nbsp;the&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1439"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1440"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1441"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodadd_keyword">add_keyword</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$word</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1442"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1443"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$word</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1444"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1445"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//NEW&nbsp;in&nbsp;1.0.8&nbsp;don't&nbsp;recompile&nbsp;the&nbsp;whole&nbsp;optimized&nbsp;regexp,&nbsp;simply&nbsp;append&nbsp;it</span></span></div></li>
-<li><div class="src-line"><a name="a1446"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parse_cache_built</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1447"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subkey</span>&nbsp;=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1448"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$subkey</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-str">'|'</span>&nbsp;.&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1449"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1450"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1451"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1452"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1453"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1454"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Removes&nbsp;a&nbsp;keyword&nbsp;from&nbsp;a&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1455"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1456"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;remove&nbsp;the&nbsp;keyword&nbsp;from</span></div></li>
-<li><div class="src-line"><a name="a1457"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;word&nbsp;to&nbsp;remove&nbsp;from&nbsp;the&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1458"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc">&nbsp;&nbsp;Wether&nbsp;to&nbsp;automatically&nbsp;recompile&nbsp;the&nbsp;optimized&nbsp;regexp&nbsp;list&nbsp;or&nbsp;not.</span></div></li>
-<li><div class="src-line"><a name="a1459"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Note:&nbsp;if&nbsp;you&nbsp;set&nbsp;this&nbsp;to&nbsp;false&nbsp;and&nbsp;@see&nbsp;GeSHi-&gt;parse_code()&nbsp;was&nbsp;already&nbsp;called&nbsp;once,</span></div></li>
-<li><div class="src-line"><a name="a1460"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for&nbsp;the&nbsp;current&nbsp;language,&nbsp;you&nbsp;have&nbsp;to&nbsp;manually&nbsp;call&nbsp;@see&nbsp;GeSHi-&gt;optimize_keyword_group()</span></div></li>
-<li><div class="src-line"><a name="a1461"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;the&nbsp;removed&nbsp;keyword&nbsp;will&nbsp;stay&nbsp;in&nbsp;cache&nbsp;and&nbsp;still&nbsp;be&nbsp;highlighted!&nbsp;On&nbsp;the&nbsp;other&nbsp;hand</span></div></li>
-<li><div class="src-line"><a name="a1462"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it&nbsp;might&nbsp;be&nbsp;too&nbsp;expensive&nbsp;to&nbsp;recompile&nbsp;the&nbsp;regexp&nbsp;list&nbsp;for&nbsp;every&nbsp;removal&nbsp;if&nbsp;you&nbsp;want&nbsp;to</span></div></li>
-<li><div class="src-line"><a name="a1463"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;remove&nbsp;a&nbsp;lot&nbsp;of&nbsp;keywords.</span></div></li>
-<li><div class="src-line"><a name="a1464"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1465"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1466"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodremove_keyword">remove_keyword</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$word</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$recompile</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1467"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$key_to_remove</span>&nbsp;=&nbsp;<a href="http://www.php.net/array_search">array_search</a><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1468"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$key_to_remove</span>&nbsp;!==&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1469"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key_to_remove</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1470"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1471"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//NEW&nbsp;in&nbsp;1.0.8,&nbsp;optionally&nbsp;recompile&nbsp;keyword&nbsp;group</span></span></div></li>
-<li><div class="src-line"><a name="a1472"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$recompile</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parse_cache_built</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1473"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodoptimize_keyword_group">optimize_keyword_group</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1474"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1475"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1476"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1477"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1478"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1479"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Creates&nbsp;a&nbsp;new&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1480"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1481"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;create</span></div></li>
-<li><div class="src-line"><a name="a1482"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;styles&nbsp;for&nbsp;the&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1483"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Whether&nbsp;the&nbsp;keyword&nbsp;group&nbsp;is&nbsp;case&nbsp;sensitive&nbsp;ornot</span></div></li>
-<li><div class="src-line"><a name="a1484"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">&nbsp;The&nbsp;words&nbsp;to&nbsp;use&nbsp;for&nbsp;the&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1485"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1486"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1487"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodadd_keyword_group">add_keyword_group</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$styles</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$case_sensitive</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$words</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1488"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$words</span>&nbsp;=&nbsp;(array)&nbsp;<span class="src-var">$words</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1489"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$words</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1490"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;empty&nbsp;word&nbsp;lists&nbsp;mess&nbsp;up&nbsp;highlighting</span></span></div></li>
-<li><div class="src-line"><a name="a1491"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1492"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1493"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1494"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Add&nbsp;the&nbsp;new&nbsp;keyword&nbsp;group&nbsp;internally</span></span></div></li>
-<li><div class="src-line"><a name="a1495"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$words</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1496"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1497"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$case_sensitive</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1498"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$styles</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1499"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1500"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//NEW&nbsp;in&nbsp;1.0.8,&nbsp;cache&nbsp;keyword&nbsp;regexp</span></span></div></li>
-<li><div class="src-line"><a name="a1501"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parse_cache_built</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1502"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodoptimize_keyword_group">optimize_keyword_group</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1503"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1504"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1505"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1506"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1507"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Removes&nbsp;a&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1508"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1509"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;remove</span></div></li>
-<li><div class="src-line"><a name="a1510"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1511"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1512"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodremove_keyword_group">remove_keyword_group</a>&nbsp;<span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1513"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Remove&nbsp;the&nbsp;keyword&nbsp;group&nbsp;internally</span></span></div></li>
-<li><div class="src-line"><a name="a1514"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1515"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1516"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1517"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1518"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1519"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//NEW&nbsp;in&nbsp;1.0.8</span></span></div></li>
-<li><div class="src-line"><a name="a1520"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1521"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1522"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1523"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1524"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;compile&nbsp;optimized&nbsp;regexp&nbsp;list&nbsp;for&nbsp;keyword&nbsp;group</span></div></li>
-<li><div class="src-line"><a name="a1525"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1526"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">&nbsp;&nbsp;The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;compile&nbsp;&amp;&nbsp;optimize</span></div></li>
-<li><div class="src-line"><a name="a1527"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a1528"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1529"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodoptimize_keyword_group">optimize_keyword_group</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1530"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a1531"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">optimize_regexp_list</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1532"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1533"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1534"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1535"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;content&nbsp;of&nbsp;the&nbsp;header&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a1536"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1537"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;content&nbsp;of&nbsp;the&nbsp;header&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a1538"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1539"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1540"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_header_content">set_header_content</a><span class="src-sym">(</span><span class="src-var">$content</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1541"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_content</span>&nbsp;=&nbsp;<span class="src-var">$content</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1542"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1543"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1544"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1545"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;content&nbsp;of&nbsp;the&nbsp;footer&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a1546"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1547"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;content&nbsp;of&nbsp;the&nbsp;footer&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a1548"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1549"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1550"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_footer_content">set_footer_content</a><span class="src-sym">(</span><span class="src-var">$content</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1551"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">footer_content</span>&nbsp;=&nbsp;<span class="src-var">$content</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1552"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1553"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1554"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1555"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;style&nbsp;for&nbsp;the&nbsp;header&nbsp;content</span></div></li>
-<li><div class="src-line"><a name="a1556"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1557"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;style&nbsp;for&nbsp;the&nbsp;header&nbsp;content</span></div></li>
-<li><div class="src-line"><a name="a1558"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1559"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1560"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_header_content_style">set_header_content_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1561"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">header_content_style</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1562"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1563"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1564"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1565"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;style&nbsp;for&nbsp;the&nbsp;footer&nbsp;content</span></div></li>
-<li><div class="src-line"><a name="a1566"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1567"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;style&nbsp;for&nbsp;the&nbsp;footer&nbsp;content</span></div></li>
-<li><div class="src-line"><a name="a1568"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1569"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1570"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_footer_content_style">set_footer_content_style</a><span class="src-sym">(</span><span class="src-var">$style</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1571"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">footer_content_style</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1572"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1573"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1574"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1575"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;whether&nbsp;to&nbsp;force&nbsp;a&nbsp;surrounding&nbsp;block&nbsp;around</span></div></li>
-<li><div class="src-line"><a name="a1576"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;highlighted&nbsp;code&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a1577"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1578"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Tells&nbsp;whether&nbsp;to&nbsp;enable&nbsp;or&nbsp;disable&nbsp;this&nbsp;feature</span></div></li>
-<li><div class="src-line"><a name="a1579"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.7.20</span></div></li>
-<li><div class="src-line"><a name="a1580"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1581"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_inner_code_block">enable_inner_code_block</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1582"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">force_code_block</span>&nbsp;=&nbsp;(bool)<span class="src-var">$flag</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1583"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1584"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1585"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1586"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;base&nbsp;URL&nbsp;to&nbsp;be&nbsp;used&nbsp;for&nbsp;keywords</span></div></li>
-<li><div class="src-line"><a name="a1587"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1588"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">The&nbsp;key&nbsp;of&nbsp;the&nbsp;keyword&nbsp;group&nbsp;to&nbsp;set&nbsp;the&nbsp;URL&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a1589"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;URL&nbsp;to&nbsp;set&nbsp;for&nbsp;the&nbsp;group.&nbsp;If&nbsp;{FNAME}&nbsp;is&nbsp;in</span></div></li>
-<li><div class="src-line"><a name="a1590"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;url&nbsp;somewhere,&nbsp;it&nbsp;is&nbsp;replaced&nbsp;by&nbsp;the&nbsp;keyword</span></div></li>
-<li><div class="src-line"><a name="a1591"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;the&nbsp;URL&nbsp;is&nbsp;being&nbsp;made&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a1592"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1593"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1594"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_url_for_keyword_group">set_url_for_keyword_group</a><span class="src-sym">(</span><span class="src-var">$group</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$url</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1595"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$url</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1596"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1597"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1598"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1599"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;styles&nbsp;for&nbsp;links&nbsp;in&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a1600"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1601"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">A&nbsp;constant&nbsp;that&nbsp;specifies&nbsp;what&nbsp;state&nbsp;the&nbsp;style&nbsp;is&nbsp;being</span></div></li>
-<li><div class="src-line"><a name="a1602"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;set&nbsp;for&nbsp;-&nbsp;e.g.&nbsp;:hover&nbsp;or&nbsp;:visited</span></div></li>
-<li><div class="src-line"><a name="a1603"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;styles&nbsp;to&nbsp;use&nbsp;for&nbsp;that&nbsp;state</span></div></li>
-<li><div class="src-line"><a name="a1604"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1605"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1606"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_link_styles">set_link_styles</a><span class="src-sym">(</span><span class="src-var">$type</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$styles</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1607"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_styles</span><span class="src-sym">[</span><span class="src-var">$type</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$styles</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1608"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1609"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1610"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1611"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;target&nbsp;for&nbsp;links&nbsp;in&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a1612"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1613"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;target&nbsp;for&nbsp;links&nbsp;in&nbsp;the&nbsp;code,&nbsp;e.g.&nbsp;_blank</span></div></li>
-<li><div class="src-line"><a name="a1614"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.3</span></div></li>
-<li><div class="src-line"><a name="a1615"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1616"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_link_target">set_link_target</a><span class="src-sym">(</span><span class="src-var">$target</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1617"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$target</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1618"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1619"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1620"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">link_target</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;target=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$target</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&nbsp;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1621"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1622"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1623"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1624"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1625"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;styles&nbsp;for&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a1626"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1627"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;styles&nbsp;to&nbsp;use&nbsp;on&nbsp;important&nbsp;parts&nbsp;of&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a1628"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1629"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1630"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_important_styles">set_important_styles</a><span class="src-sym">(</span><span class="src-var">$styles</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1631"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">important_styles</span>&nbsp;=&nbsp;<span class="src-var">$styles</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1632"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1633"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1634"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1635"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;whether&nbsp;context-important&nbsp;blocks&nbsp;are&nbsp;highlighted</span></div></li>
-<li><div class="src-line"><a name="a1636"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1637"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">Tells&nbsp;whether&nbsp;to&nbsp;enable&nbsp;or&nbsp;disable&nbsp;highlighting&nbsp;of&nbsp;important&nbsp;blocks</span></div></li>
-<li><div class="src-line"><a name="a1638"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;REMOVE&nbsp;THIS&nbsp;SHIZ&nbsp;FROM&nbsp;GESHI!</span></div></li>
-<li><div class="src-line"><a name="a1639"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@deprecated</span></div></li>
-<li><div class="src-line"><a name="a1640"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1641"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1642"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_important_blocks">enable_important_blocks</a><span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1643"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">enable_important_blocks</span>&nbsp;=&nbsp;<span class="src-sym">(</span>&nbsp;<span class="src-var">$flag</span>&nbsp;<span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1644"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1645"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1646"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1647"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Whether&nbsp;CSS&nbsp;IDs&nbsp;should&nbsp;be&nbsp;added&nbsp;to&nbsp;each&nbsp;line</span></div></li>
-<li><div class="src-line"><a name="a1648"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1649"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">If&nbsp;true,&nbsp;IDs&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;each&nbsp;line.</span></div></li>
-<li><div class="src-line"><a name="a1650"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1651"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1652"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_ids">enable_ids</a><span class="src-sym">(</span><span class="src-var">$flag</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1653"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">add_ids</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-id">true</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1654"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1655"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1656"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1657"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Specifies&nbsp;which&nbsp;lines&nbsp;to&nbsp;highlight&nbsp;extra</span></div></li>
-<li><div class="src-line"><a name="a1658"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1659"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;extra&nbsp;style&nbsp;parameter&nbsp;was&nbsp;added&nbsp;in&nbsp;1.0.7.21.</span></div></li>
-<li><div class="src-line"><a name="a1660"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1661"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc">An&nbsp;array&nbsp;of&nbsp;line&nbsp;numbers&nbsp;to&nbsp;highlight,&nbsp;or&nbsp;just&nbsp;a&nbsp;line</span></div></li>
-<li><div class="src-line"><a name="a1662"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;number&nbsp;on&nbsp;its&nbsp;own.</span></div></li>
-<li><div class="src-line"><a name="a1663"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">A&nbsp;string&nbsp;specifying&nbsp;the&nbsp;style&nbsp;to&nbsp;use&nbsp;for&nbsp;this&nbsp;line.</span></div></li>
-<li><div class="src-line"><a name="a1664"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;null&nbsp;is&nbsp;specified,&nbsp;the&nbsp;default&nbsp;style&nbsp;is&nbsp;used.</span></div></li>
-<li><div class="src-line"><a name="a1665"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;false&nbsp;is&nbsp;specified,&nbsp;the&nbsp;line&nbsp;will&nbsp;be&nbsp;removed&nbsp;from</span></div></li>
-<li><div class="src-line"><a name="a1666"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;special&nbsp;highlighting</span></div></li>
-<li><div class="src-line"><a name="a1667"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1668"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;&nbsp;Some&nbsp;data&nbsp;replication&nbsp;here&nbsp;that&nbsp;could&nbsp;be&nbsp;cut&nbsp;down&nbsp;on</span></div></li>
-<li><div class="src-line"><a name="a1669"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1670"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodhighlight_lines_extra">highlight_lines_extra</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style</span>&nbsp;=&nbsp;<span class="src-id">null</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1671"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1672"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Split&nbsp;up&nbsp;the&nbsp;job&nbsp;using&nbsp;single&nbsp;lines&nbsp;at&nbsp;a&nbsp;time</span></span></div></li>
-<li><div class="src-line"><a name="a1673"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$lines</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$line</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1674"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodhighlight_lines_extra">highlight_lines_extra</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1675"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1676"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1677"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Mark&nbsp;the&nbsp;line&nbsp;as&nbsp;being&nbsp;highlighted&nbsp;specially</span></span></div></li>
-<li><div class="src-line"><a name="a1678"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span>&nbsp;=&nbsp;<a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1679"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">[</span><span class="src-var">$lines</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$lines</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1680"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1681"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Decide&nbsp;on&nbsp;which&nbsp;style&nbsp;to&nbsp;use</span></span></div></li>
-<li><div class="src-line"><a name="a1682"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$style</span>&nbsp;===&nbsp;<span class="src-id">null</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span>&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;we&nbsp;should&nbsp;use&nbsp;default&nbsp;style</span></span></div></li>
-<li><div class="src-line"><a name="a1683"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$lines</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1684"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$style</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span>&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;to&nbsp;remove&nbsp;this&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a1685"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines</span><span class="src-sym">[</span><span class="src-var">$lines</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1686"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$lines</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1687"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1688"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$lines</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$style</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1689"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1690"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1691"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1692"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1693"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1694"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;style&nbsp;for&nbsp;extra-highlighted&nbsp;lines</span></div></li>
-<li><div class="src-line"><a name="a1695"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1696"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;style&nbsp;for&nbsp;extra-highlighted&nbsp;lines</span></div></li>
-<li><div class="src-line"><a name="a1697"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1698"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1699"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_highlight_lines_extra_style">set_highlight_lines_extra_style</a><span class="src-sym">(</span><span class="src-var">$styles</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1700"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">highlight_extra_lines_style</span>&nbsp;=&nbsp;<span class="src-var">$styles</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1701"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1702"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1703"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1704"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;line-ending</span></div></li>
-<li><div class="src-line"><a name="a1705"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1706"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;new&nbsp;line-ending</span></div></li>
-<li><div class="src-line"><a name="a1707"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1708"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1709"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_line_ending">set_line_ending</a><span class="src-sym">(</span><span class="src-var">$line_ending</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1710"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_ending</span>&nbsp;=&nbsp;(string)<span class="src-var">$line_ending</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1711"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1712"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1713"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1714"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;what&nbsp;number&nbsp;line&nbsp;numbers&nbsp;should&nbsp;start&nbsp;at.&nbsp;Should</span></div></li>
-<li><div class="src-line"><a name="a1715"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;be&nbsp;a&nbsp;positive&nbsp;integer,&nbsp;and&nbsp;will&nbsp;be&nbsp;converted&nbsp;to&nbsp;one.</span></div></li>
-<li><div class="src-line"><a name="a1716"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1717"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Warning:&lt;/b&gt;&nbsp;Using&nbsp;this&nbsp;method&nbsp;will&nbsp;add&nbsp;the&nbsp;&quot;start&quot;</span></div></li>
-<li><div class="src-line"><a name="a1718"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;attribute&nbsp;to&nbsp;the&nbsp;&amp;lt;ol&amp;gt;&nbsp;that&nbsp;is&nbsp;used&nbsp;for&nbsp;line&nbsp;numbering.</span></div></li>
-<li><div class="src-line"><a name="a1719"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;&lt;b&gt;not&lt;/b&gt;&nbsp;valid&nbsp;XHTML&nbsp;strict,&nbsp;so&nbsp;if&nbsp;that's&nbsp;what&nbsp;you</span></div></li>
-<li><div class="src-line"><a name="a1720"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;care&nbsp;about&nbsp;then&nbsp;don't&nbsp;use&nbsp;this&nbsp;method.&nbsp;Firefox&nbsp;is&nbsp;getting</span></div></li>
-<li><div class="src-line"><a name="a1721"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;support&nbsp;for&nbsp;the&nbsp;CSS&nbsp;method&nbsp;of&nbsp;doing&nbsp;this&nbsp;in&nbsp;1.1&nbsp;and&nbsp;Opera</span></div></li>
-<li><div class="src-line"><a name="a1722"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;has&nbsp;support&nbsp;for&nbsp;the&nbsp;CSS&nbsp;method,&nbsp;but&nbsp;(of&nbsp;course)&nbsp;IE&nbsp;doesn't</span></div></li>
-<li><div class="src-line"><a name="a1723"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;so&nbsp;it's&nbsp;not&nbsp;worth&nbsp;doing&nbsp;it&nbsp;the&nbsp;CSS&nbsp;way&nbsp;yet.</span></div></li>
-<li><div class="src-line"><a name="a1724"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1725"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">int&nbsp;</span><span class="src-doc">The&nbsp;number&nbsp;to&nbsp;start&nbsp;line&nbsp;numbers&nbsp;at</span></div></li>
-<li><div class="src-line"><a name="a1726"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1727"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1728"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodstart_line_numbers_at">start_line_numbers_at</a><span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1729"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">line_numbers_start</span>&nbsp;=&nbsp;<a href="http://www.php.net/abs">abs</a><span class="src-sym">(</span><a href="http://www.php.net/intval">intval</a><span class="src-sym">(</span><span class="src-var">$number</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1730"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1731"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1732"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1733"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;encoding&nbsp;used&nbsp;for&nbsp;htmlspecialchars(),&nbsp;for&nbsp;international</span></div></li>
-<li><div class="src-line"><a name="a1734"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;support.</span></div></li>
-<li><div class="src-line"><a name="a1735"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1736"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;NOTE:&nbsp;This&nbsp;is&nbsp;not&nbsp;needed&nbsp;for&nbsp;now&nbsp;because&nbsp;htmlspecialchars()&nbsp;is&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a1737"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;being&nbsp;used&nbsp;(it&nbsp;has&nbsp;a&nbsp;security&nbsp;hole&nbsp;in&nbsp;PHP4&nbsp;that&nbsp;has&nbsp;not&nbsp;been&nbsp;patched).</span></div></li>
-<li><div class="src-line"><a name="a1738"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Maybe&nbsp;in&nbsp;a&nbsp;future&nbsp;version&nbsp;it&nbsp;may&nbsp;make&nbsp;a&nbsp;return&nbsp;for&nbsp;speed&nbsp;reasons,&nbsp;but</span></div></li>
-<li><div class="src-line"><a name="a1739"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;I&nbsp;doubt&nbsp;it.</span></div></li>
-<li><div class="src-line"><a name="a1740"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1741"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;encoding&nbsp;to&nbsp;use&nbsp;for&nbsp;the&nbsp;source</span></div></li>
-<li><div class="src-line"><a name="a1742"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.3</span></div></li>
-<li><div class="src-line"><a name="a1743"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1744"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodset_encoding">set_encoding</a><span class="src-sym">(</span><span class="src-var">$encoding</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1745"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$encoding</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1746"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">encoding</span>&nbsp;=&nbsp;<a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$encoding</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1747"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1748"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1749"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1750"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1751"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Turns&nbsp;linking&nbsp;of&nbsp;keywords&nbsp;on&nbsp;or&nbsp;off.</span></div></li>
-<li><div class="src-line"><a name="a1752"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1753"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">boolean&nbsp;</span><span class="src-doc">If&nbsp;true,&nbsp;links&nbsp;will&nbsp;be&nbsp;added&nbsp;to&nbsp;keywords</span></div></li>
-<li><div class="src-line"><a name="a1754"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a1755"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1756"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodenable_keyword_links">enable_keyword_links</a><span class="src-sym">(</span><span class="src-var">$enable</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1757"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">keyword_links</span>&nbsp;=&nbsp;(bool)&nbsp;<span class="src-var">$enable</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1758"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1759"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1760"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1761"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Setup&nbsp;caches&nbsp;needed&nbsp;for&nbsp;styling.&nbsp;This&nbsp;is&nbsp;automatically&nbsp;called&nbsp;in</span></div></li>
-<li><div class="src-line"><a name="a1762"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;parse_code()&nbsp;and&nbsp;get_stylesheet()&nbsp;when&nbsp;appropriate.&nbsp;This&nbsp;function&nbsp;helps</span></div></li>
-<li><div class="src-line"><a name="a1763"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;stylesheet&nbsp;generators&nbsp;as&nbsp;they&nbsp;rely&nbsp;on&nbsp;some&nbsp;style&nbsp;information&nbsp;being</span></div></li>
-<li><div class="src-line"><a name="a1764"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;preprocessed</span></div></li>
-<li><div class="src-line"><a name="a1765"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1766"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a1767"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a1768"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1769"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">build_style_cache</span><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1770"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Build&nbsp;the&nbsp;style&nbsp;cache&nbsp;needed&nbsp;to&nbsp;highlight&nbsp;numbers&nbsp;appropriate</span></span></div></li>
-<li><div class="src-line"><a name="a1771"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1772"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//First&nbsp;check&nbsp;what&nbsp;way&nbsp;highlighting&nbsp;information&nbsp;for&nbsp;numbers&nbsp;are&nbsp;given</span></span></div></li>
-<li><div class="src-line"><a name="a1773"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1774"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1775"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1776"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1777"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1778"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1779"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1780"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1781"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1782"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a1783"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_INT_BASIC</span>&nbsp;|</span></div></li>
-<li><div class="src-line"><a name="a1784"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_FLT_NONSCI</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1785"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1786"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1787"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$j</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$j</span>&nbsp;>&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$j</span>&gt;&gt;=<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1788"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Rearrange&nbsp;style&nbsp;indices&nbsp;if&nbsp;required&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a1789"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span>&lt;&lt;<span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1790"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a1791"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span>&lt;&lt;<span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1792"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span>&lt;&lt;<span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1793"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1794"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1795"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;this&nbsp;bit&nbsp;is&nbsp;set&nbsp;for&nbsp;highlighting</span></span></div></li>
-<li><div class="src-line"><a name="a1796"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$j</span><span class="src-sym">&</span><span class="src-num">1</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1797"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//So&nbsp;this&nbsp;bit&nbsp;is&nbsp;set&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a1798"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;it&nbsp;belongs&nbsp;to&nbsp;group&nbsp;0&nbsp;or&nbsp;the&nbsp;actual&nbsp;stylegroup</span></span></div></li>
-<li><div class="src-line"><a name="a1799"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1800"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-num">1</span>&nbsp;&lt;&lt;&nbsp;<span class="src-var">$i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1801"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1802"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1803"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1804"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1805"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;|=&nbsp;<span class="src-num">1</span>&nbsp;&lt;&lt;&nbsp;<span class="src-var">$i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1806"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1807"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1808"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1809"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1810"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1811"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1812"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1813"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a1814"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Setup&nbsp;caches&nbsp;needed&nbsp;for&nbsp;parsing.&nbsp;This&nbsp;is&nbsp;automatically&nbsp;called&nbsp;in&nbsp;parse_code()&nbsp;when&nbsp;appropriate.</span></div></li>
-<li><div class="src-line"><a name="a1815"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;function&nbsp;makes&nbsp;stylesheet&nbsp;generators&nbsp;much&nbsp;faster&nbsp;as&nbsp;they&nbsp;do&nbsp;not&nbsp;need&nbsp;these&nbsp;caches.</span></div></li>
-<li><div class="src-line"><a name="a1816"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1817"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a1818"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a1819"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a1820"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">build_parse_cache</span><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1821"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;cache&nbsp;symbol&nbsp;regexp</span></span></div></li>
-<li><div class="src-line"><a name="a1822"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//As&nbsp;this&nbsp;is&nbsp;a&nbsp;costy&nbsp;operation,&nbsp;we&nbsp;avoid&nbsp;doing&nbsp;it&nbsp;for&nbsp;multiple&nbsp;groups&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a1823"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Instead&nbsp;we&nbsp;perform&nbsp;it&nbsp;for&nbsp;all&nbsp;symbols&nbsp;at&nbsp;once.</span></span></div></li>
-<li><div class="src-line"><a name="a1824"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a1825"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//For&nbsp;this&nbsp;to&nbsp;work,&nbsp;we&nbsp;need&nbsp;to&nbsp;reorganize&nbsp;the&nbsp;data&nbsp;arrays.</span></span></div></li>
-<li><div class="src-line"><a name="a1826"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1827"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'MULTIPLE_SYMBOL_GROUPS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;>&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1828"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1829"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1830"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_multi</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;multi&nbsp;char&nbsp;symbols</span></span></div></li>
-<li><div class="src-line"><a name="a1831"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_single</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;single&nbsp;char&nbsp;symbols</span></span></div></li>
-<li><div class="src-line"><a name="a1832"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$symbols</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1833"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$symbols</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1834"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$symbols</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$sym</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1835"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sym</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$sym</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1836"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$sym</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1837"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$sym</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1838"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$sym</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span>&nbsp;<span class="src-comm">//&nbsp;multiple&nbsp;chars</span></span></div></li>
-<li><div class="src-line"><a name="a1839"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_multi</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$sym</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1840"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span>&nbsp;<span class="src-comm">//&nbsp;single&nbsp;char</span></span></div></li>
-<li><div class="src-line"><a name="a1841"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$sym</span>&nbsp;==&nbsp;<span class="src-str">'-'</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1842"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;don't&nbsp;trigger&nbsp;range&nbsp;out&nbsp;of&nbsp;order&nbsp;error</span></span></div></li>
-<li><div class="src-line"><a name="a1843"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_single</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'\-'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1844"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1845"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_single</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$sym</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1846"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1847"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1848"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1849"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1850"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1851"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbols</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$symbols</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1852"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$symbols</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1853"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$symbols</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1854"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$symbols</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span>&nbsp;<span class="src-comm">//&nbsp;multiple&nbsp;chars</span></span></div></li>
-<li><div class="src-line"><a name="a1855"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_multi</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$symbols</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1856"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$symbols</span>&nbsp;==&nbsp;<span class="src-str">'-'</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1857"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;don't&nbsp;trigger&nbsp;range&nbsp;out&nbsp;of&nbsp;order&nbsp;error</span></span></div></li>
-<li><div class="src-line"><a name="a1858"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_single</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'\-'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1859"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span>&nbsp;<span class="src-comm">//&nbsp;single&nbsp;char</span></span></div></li>
-<li><div class="src-line"><a name="a1860"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg_single</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><span class="src-var">$symbols</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1861"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1862"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1863"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1864"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1865"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1866"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Now&nbsp;we&nbsp;have&nbsp;an&nbsp;array&nbsp;with&nbsp;each&nbsp;possible&nbsp;symbol&nbsp;as&nbsp;the&nbsp;key&nbsp;and&nbsp;the&nbsp;style&nbsp;as&nbsp;the&nbsp;actual&nbsp;data.</span></span></div></li>
-<li><div class="src-line"><a name="a1867"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;way&nbsp;we&nbsp;can&nbsp;set&nbsp;the&nbsp;correct&nbsp;style&nbsp;just&nbsp;the&nbsp;moment&nbsp;we&nbsp;highlight&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a1868"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a1869"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Now&nbsp;we&nbsp;need&nbsp;to&nbsp;rewrite&nbsp;our&nbsp;array&nbsp;to&nbsp;get&nbsp;a&nbsp;search&nbsp;string&nbsp;that</span></span></div></li>
-<li><div class="src-line"><a name="a1870"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1871"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$symbol_preg_multi</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1872"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/rsort">rsort</a><span class="src-sym">(</span><span class="src-var">$symbol_preg_multi</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1873"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">'|'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_preg_multi</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1874"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1875"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$symbol_preg_single</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1876"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/rsort">rsort</a><span class="src-sym">(</span><span class="src-var">$symbol_preg_single</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1877"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_preg</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'['</span>&nbsp;.&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_preg_single</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">']'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1878"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1879"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_SEARCH'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;|&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_preg</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1880"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1881"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1882"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;cache&nbsp;optimized&nbsp;regexp&nbsp;for&nbsp;keyword&nbsp;matching</span></span></div></li>
-<li><div class="src-line"><a name="a1883"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remove&nbsp;old&nbsp;cache</span></span></div></li>
-<li><div class="src-line"><a name="a1884"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1885"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1886"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a1887"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1888"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodoptimize_keyword_group">optimize_keyword_group</a><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1889"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1890"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1891"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1892"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;brackets</span></span></div></li>
-<li><div class="src-line"><a name="a1893"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1894"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHE_BRACKET_MATCH'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'['</span><span class="src-sym">,</span>&nbsp;<span class="src-str">']'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'('</span><span class="src-sym">,</span>&nbsp;<span class="src-str">')'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'{'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'}'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1895"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">use_classes</span>&nbsp;&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1896"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHE_BRACKET_REPLACE'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a1897"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;&amp;#91;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1898"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;&amp;#93;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1899"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;&amp;#40;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1900"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;&amp;#41;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1901"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;&amp;#123;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1902"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;&amp;#125;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1903"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1904"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1905"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1906"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHE_BRACKET_REPLACE'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a1907"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;br0&quot;&gt;&amp;#91;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1908"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;br0&quot;&gt;&amp;#93;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1909"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;br0&quot;&gt;&amp;#40;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1910"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;br0&quot;&gt;&amp;#41;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1911"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;br0&quot;&gt;&amp;#123;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1912"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;br0&quot;&gt;&amp;#125;|&gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1913"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1914"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1915"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1916"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1917"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Build&nbsp;the&nbsp;parse&nbsp;cache&nbsp;needed&nbsp;to&nbsp;highlight&nbsp;numbers&nbsp;appropriate</span></span></div></li>
-<li><div class="src-line"><a name="a1918"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1919"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;the&nbsp;style&nbsp;rearrangements&nbsp;have&nbsp;been&nbsp;processed&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a1920"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;also&nbsp;does&nbsp;some&nbsp;preprocessing&nbsp;to&nbsp;check&nbsp;which&nbsp;style&nbsp;groups&nbsp;are&nbsp;useable&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a1921"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1922"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">build_style_cache</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1923"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1924"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1925"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Number&nbsp;format&nbsp;specification</span></span></div></li>
-<li><div class="src-line"><a name="a1926"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//All&nbsp;this&nbsp;formats&nbsp;are&nbsp;matched&nbsp;case-insensitively!</span></span></div></li>
-<li><div class="src-line"><a name="a1927"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static</span>&nbsp;<span class="src-var">$numbers_format</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a1928"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_INT_BASIC</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1929"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.%])(?&lt;![\d\.]e[+\-])([1-9]\d*?|0)(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1930"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_INT_CSTYLE</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1931"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.%])(?&lt;![\d\.]e[+\-])([1-9]\d*?|0)l(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1932"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_BIN_SUFFIX</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1933"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])[01]+?b(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1934"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_BIN_PREFIX_PERCENT</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1935"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.%])(?&lt;![\d\.]e[+\-])%[01]+?(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1936"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_BIN_PREFIX_0B</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1937"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.%])(?&lt;![\d\.]e[+\-])0b[01]+?(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1938"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_OCT_PREFIX</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1939"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])0[0-7]+?(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1940"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_OCT_SUFFIX</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1941"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])[0-7]+?o(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1942"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_HEX_PREFIX</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1943"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])0x[0-9a-f]+?(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1944"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_HEX_SUFFIX</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1945"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])\d[0-9a-f]*?h(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1946"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_FLT_NONSCI</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1947"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])\d+?\.\d+?(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1948"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_FLT_NONSCI_F</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1949"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)f(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1950"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_FLT_SCI_SHORT</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1951"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])\.\d+?(?:e[+\-]?\d+?)?(?![0-9a-z\.])'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a1952"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GESHI_NUMBER_FLT_SCI_ZERO</span>&nbsp;=&gt;</span></div></li>
-<li><div class="src-line"><a name="a1953"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'(?&lt;![0-9a-z_\.])(?&lt;![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)(?:e[+\-]?\d+?)?(?![0-9a-z\.])'</span></span></div></li>
-<li><div class="src-line"><a name="a1954"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1955"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1956"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//At&nbsp;this&nbsp;step&nbsp;we&nbsp;have&nbsp;an&nbsp;associative&nbsp;array&nbsp;with&nbsp;flag&nbsp;groups&nbsp;for&nbsp;a</span></span></div></li>
-<li><div class="src-line"><a name="a1957"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//specific&nbsp;style&nbsp;or&nbsp;an&nbsp;string&nbsp;denoting&nbsp;a&nbsp;regexp&nbsp;given&nbsp;its&nbsp;index.</span></span></div></li>
-<li><div class="src-line"><a name="a1958"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_RXCACHE'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1959"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$rxdata</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1960"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">is_string</span><span class="src-sym">(</span><span class="src-var">$rxdata</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1961"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp</span>&nbsp;=&nbsp;<span class="src-var">$rxdata</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1962"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1963"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;is&nbsp;a&nbsp;bitfield&nbsp;of&nbsp;number&nbsp;flags&nbsp;to&nbsp;highlight:</span></span></div></li>
-<li><div class="src-line"><a name="a1964"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Build&nbsp;an&nbsp;array,&nbsp;implode&nbsp;them&nbsp;together&nbsp;and&nbsp;make&nbsp;this&nbsp;the&nbsp;actual&nbsp;RX</span></span></div></li>
-<li><div class="src-line"><a name="a1965"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rxuse</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1966"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span><span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;&lt;=&nbsp;<span class="src-var">$rxdata</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&lt;&lt;=<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1967"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$rxdata</span>&nbsp;<span class="src-sym">&</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1968"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rxuse</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$numbers_format</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1969"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1970"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1971"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp</span>&nbsp;=&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;|&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$rxuse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1972"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1973"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1974"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_RXCACHE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a1975"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">"</span></span>/(?&lt;!&lt;\|\/NUM!)(?&lt;!\d\/&gt;)(<span class="src-var">$regexp</span>)(?!\|&gt;)/i<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1976"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1977"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1978"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1979"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">parse_cache_built</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1980"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a1981"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1982"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a1983"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;the&nbsp;code&nbsp;in&nbsp;$this-&gt;source,&nbsp;highlighted&nbsp;and&nbsp;surrounded&nbsp;by&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a1984"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;nessecary&nbsp;HTML.</span></div></li>
-<li><div class="src-line"><a name="a1985"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1986"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;should&nbsp;only&nbsp;be&nbsp;called&nbsp;ONCE,&nbsp;cos&nbsp;it's&nbsp;SLOW!&nbsp;If&nbsp;you&nbsp;want&nbsp;to&nbsp;highlight</span></div></li>
-<li><div class="src-line"><a name="a1987"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;same&nbsp;source&nbsp;multiple&nbsp;times,&nbsp;you're&nbsp;better&nbsp;off&nbsp;doing&nbsp;a&nbsp;whole&nbsp;lot&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a1988"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;str_replaces&nbsp;to&nbsp;replace&nbsp;the&nbsp;&amp;lt;span&amp;gt;s</span></div></li>
-<li><div class="src-line"><a name="a1989"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a1990"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a1991"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a1992"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">parse_code</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1993"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Start&nbsp;the&nbsp;timer</span></span></div></li>
-<li><div class="src-line"><a name="a1994"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start_time</span>&nbsp;=&nbsp;<span class="src-id">microtime</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a1995"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a1996"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Firstly,&nbsp;if&nbsp;there&nbsp;is&nbsp;an&nbsp;error,&nbsp;we&nbsp;won't&nbsp;highlight</span></span></div></li>
-<li><div class="src-line"><a name="a1997"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">error</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a1998"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Escape&nbsp;the&nbsp;source&nbsp;for&nbsp;output</span></span></div></li>
-<li><div class="src-line"><a name="a1999"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-var">source</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2000"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2001"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;fix&nbsp;is&nbsp;related&nbsp;to&nbsp;SF#1923020,&nbsp;but&nbsp;has&nbsp;to&nbsp;be&nbsp;applied&nbsp;regardless&nbsp;of</span></span></div></li>
-<li><div class="src-line"><a name="a2002"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//actually&nbsp;highlighting&nbsp;symbols.</span></span></div></li>
-<li><div class="src-line"><a name="a2003"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'&lt;SEMI&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;PIPE&gt;'</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">';'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'|'</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2004"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2005"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Timing&nbsp;is&nbsp;irrelevant</span></span></div></li>
-<li><div class="src-line"><a name="a2006"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">set_time</span><span class="src-sym">(</span><span class="src-var">$start_time</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start_time</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2007"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">finalise</span><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2008"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2009"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2010"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2011"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sure&nbsp;the&nbsp;parse&nbsp;cache&nbsp;is&nbsp;up2date</span></span></div></li>
-<li><div class="src-line"><a name="a2012"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_cache_built</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2013"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">build_parse_cache</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2014"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2015"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2016"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Replace&nbsp;all&nbsp;newlines&nbsp;to&nbsp;a&nbsp;common&nbsp;form.</span></span></div></li>
-<li><div class="src-line"><a name="a2017"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\r\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">source</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2018"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\r&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2019"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2020"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;spaces&nbsp;for&nbsp;regular&nbsp;expression&nbsp;matching&nbsp;and&nbsp;line&nbsp;numbers</span></span></div></li>
-<li><div class="src-line"><a name="a2021"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$code&nbsp;=&nbsp;&quot;\n&quot;&nbsp;.&nbsp;$code&nbsp;.&nbsp;&quot;\n&quot;;</span></span></div></li>
-<li><div class="src-line"><a name="a2022"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a2023"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Initialise&nbsp;various&nbsp;stuff</span></span></div></li>
-<li><div class="src-line"><a name="a2024"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$length</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2025"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$COMMENT_MATCHED</span>&nbsp;&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2026"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;&nbsp;&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2027"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$endresult</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2028"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2029"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&quot;Important&quot;&nbsp;selections&nbsp;are&nbsp;handled&nbsp;like&nbsp;multiline&nbsp;comments</span></span></div></li>
-<li><div class="src-line"><a name="a2030"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;@todo&nbsp;GET&nbsp;RID&nbsp;OF&nbsp;THIS&nbsp;SHIZ</span></span></div></li>
-<li><div class="src-line"><a name="a2031"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodenable_important_blocks">enable_important_blocks</a><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2032"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_MULTI'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT&quot;&gt;GESHI_START_IMPORTANT&lt;/a&gt;</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_END_IMPORTANT&quot;&gt;GESHI_END_IMPORTANT&lt;/a&gt;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2033"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2034"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2035"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">strict_mode</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2036"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Break&nbsp;the&nbsp;source&nbsp;into&nbsp;bits.&nbsp;Each&nbsp;bit&nbsp;will&nbsp;be&nbsp;a&nbsp;portion&nbsp;of&nbsp;the&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2037"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;within&nbsp;script&nbsp;delimiters&nbsp;-&nbsp;for&nbsp;example,&nbsp;HTML&nbsp;between&nbsp;&lt;&nbsp;and&nbsp;&gt;</span></span></div></li>
-<li><div class="src-line"><a name="a2038"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$k</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2039"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2040"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2041"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_match_pointer</span>&nbsp;=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2042"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;use&nbsp;a&nbsp;copy&nbsp;to&nbsp;unset&nbsp;delimiters&nbsp;on&nbsp;demand&nbsp;(when&nbsp;they&nbsp;are&nbsp;not&nbsp;found)</span></span></div></li>
-<li><div class="src-line"><a name="a2043"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$delim_copy</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SCRIPT_DELIMITERS'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2044"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2045"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$length</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2046"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_match_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;never&nbsp;true</span></span></div></li>
-<li><div class="src-line"><a name="a2047"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$delim_copy</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$dk</span>&nbsp;=&gt;&nbsp;<span class="src-var">$delimiters</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2048"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$delimiters</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2049"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$delimiters</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$open</span>&nbsp;=&gt;&nbsp;<span class="src-var">$close</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2050"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sure&nbsp;the&nbsp;cache&nbsp;is&nbsp;setup&nbsp;properly</span></span></div></li>
-<li><div class="src-line"><a name="a2051"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2052"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2053"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'next_match'</span>&nbsp;=&gt;&nbsp;-<span class="src-num">1</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2054"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'dk'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$dk</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2055"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2056"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'open'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$open</span><span class="src-sym">,</span>&nbsp;<span class="src-comm">//&nbsp;needed&nbsp;for&nbsp;grouping&nbsp;of&nbsp;adjacent&nbsp;code&nbsp;blocks&nbsp;(see&nbsp;below)</span></span></div></li>
-<li><div class="src-line"><a name="a2057"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'open_strlen'</span>&nbsp;=&gt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2058"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2059"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'close'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$close</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2060"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'close_strlen'</span>&nbsp;=&gt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2061"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2062"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2063"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Get&nbsp;the&nbsp;next&nbsp;little&nbsp;bit&nbsp;for&nbsp;this&nbsp;opening&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2064"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span>&nbsp;<&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2065"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;only&nbsp;find&nbsp;the&nbsp;next&nbsp;pos&nbsp;if&nbsp;it&nbsp;was&nbsp;not&nbsp;already&nbsp;cached</span></span></div></li>
-<li><div class="src-line"><a name="a2066"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$open_pos</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$open</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2067"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$open_pos</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2068"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;no&nbsp;match&nbsp;for&nbsp;this&nbsp;delimiter&nbsp;ever</span></span></div></li>
-<li><div class="src-line"><a name="a2069"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$delim_copy</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2070"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2071"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2072"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$open_pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2073"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2074"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span>&nbsp;<&nbsp;<span class="src-var">$next_match_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2075"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//So&nbsp;we&nbsp;got&nbsp;a&nbsp;new&nbsp;match,&nbsp;update&nbsp;the&nbsp;close_pos</span></span></div></li>
-<li><div class="src-line"><a name="a2076"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'close_pos'</span><span class="src-sym">]</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a2077"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span>+<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2078"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2079"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_match_pointer</span>&nbsp;=<span class="src-sym">&</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2080"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_match_pos</span>&nbsp;=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2081"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2082"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2083"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2084"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//So&nbsp;we&nbsp;should&nbsp;match&nbsp;an&nbsp;RegExp&nbsp;as&nbsp;Strict&nbsp;Block&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2085"></a><span class="src-doc">/**</span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a2086"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;value&nbsp;in&nbsp;$delimiters&nbsp;is&nbsp;expected&nbsp;to&nbsp;be&nbsp;an&nbsp;RegExp</span></div></li>
-<li><div class="src-line"><a name="a2087"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;containing&nbsp;exactly&nbsp;2&nbsp;matching&nbsp;groups:</span></div></li>
-<li><div class="src-line"><a name="a2088"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;Group&nbsp;1&nbsp;is&nbsp;the&nbsp;opener</span></div></li>
-<li><div class="src-line"><a name="a2089"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;-&nbsp;Group&nbsp;2&nbsp;is&nbsp;the&nbsp;closer</span></div></li>
-<li><div class="src-line"><a name="a2090"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a2091"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">GESHI_PHP_PRE_433</span>&nbsp;&amp;&amp;&nbsp;<span class="src-comm">//Needs&nbsp;proper&nbsp;rewrite&nbsp;to&nbsp;work&nbsp;with&nbsp;PHP&nbsp;&gt;=4.3.0;&nbsp;4.3.3&nbsp;is&nbsp;guaranteed&nbsp;to&nbsp;work.</span></span></div></li>
-<li><div class="src-line"><a name="a2092"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$delimiters</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches_rx</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2093"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//We&nbsp;got&nbsp;a&nbsp;match&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2094"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2095"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'next_match'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$matches_rx</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2096"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'dk'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$dk</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2097"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2098"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'close_strlen'</span>&nbsp;=&gt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$matches_rx</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2099"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'close_pos'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$matches_rx</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2100"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2101"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2102"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;no&nbsp;match&nbsp;for&nbsp;this&nbsp;delimiter&nbsp;ever</span></span></div></li>
-<li><div class="src-line"><a name="a2103"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$delim_copy</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2104"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2105"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2106"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2107"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span>&nbsp;&lt;=&nbsp;<span class="src-var">$next_match_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2108"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_match_pointer</span>&nbsp;=<span class="src-sym">&</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2109"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_match_pos</span>&nbsp;=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-var">$dk</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2110"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2111"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2112"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2113"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;non-highlightable&nbsp;text</span></span></div></li>
-<li><div class="src-line"><a name="a2114"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2115"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pos</span>&nbsp;-&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a2116"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2117"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$k</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2118"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2119"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$next_match_pos</span>&nbsp;>&nbsp;<span class="src-var">$length</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2120"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;out&nbsp;of&nbsp;bounds&nbsp;means&nbsp;no&nbsp;next&nbsp;match&nbsp;was&nbsp;found</span></span></div></li>
-<li><div class="src-line"><a name="a2121"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2122"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2123"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2124"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;highlightable&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2125"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'dk'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2126"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2127"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Only&nbsp;combine&nbsp;for&nbsp;non-rx&nbsp;script&nbsp;blocks</span></span></div></li>
-<li><div class="src-line"><a name="a2128"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$delim_copy</span><span class="src-sym">[</span><span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'dk'</span><span class="src-sym">]]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2129"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;group&nbsp;adjacent&nbsp;script&nbsp;blocks,&nbsp;e.g.&nbsp;&lt;foobar&gt;&lt;asdf&gt;&nbsp;should&nbsp;be&nbsp;one&nbsp;block,&nbsp;not&nbsp;three!</span></span></div></li>
-<li><div class="src-line"><a name="a2130"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$next_match_pos</span>&nbsp;+&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'open_strlen'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2131"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span>&nbsp;<span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2132"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'close'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2133"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close_pos</span>&nbsp;==&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2134"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2135"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2136"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span>&nbsp;+&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'close_strlen'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2137"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;==&nbsp;<span class="src-var">$length</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2138"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2139"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2140"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'open'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'open_strlen'</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-num">1</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2141"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'open_strlen'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;==&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'open'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2142"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;merge&nbsp;adjacent&nbsp;but&nbsp;make&nbsp;sure&nbsp;we&nbsp;don't&nbsp;merge&nbsp;things&nbsp;like&nbsp;&lt;tag&gt;&lt;!--&nbsp;comment&nbsp;--&gt;</span></span></div></li>
-<li><div class="src-line"><a name="a2143"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$matches</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$submatches</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2144"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$submatches</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$match</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2145"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match</span><span class="src-sym">[</span><span class="src-str">'next_match'</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2146"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;a&nbsp;different&nbsp;block&nbsp;already&nbsp;matches&nbsp;here!</span></span></div></li>
-<li><div class="src-line"><a name="a2147"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span>&nbsp;<span class="src-num">3</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2148"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2149"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2150"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2151"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2152"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2153"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2154"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2155"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2156"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'close_pos'</span><span class="src-sym">]</span>&nbsp;+&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">[</span><span class="src-str">'close_strlen'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2157"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2158"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2159"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2160"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close_pos</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2161"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;no&nbsp;closing&nbsp;delimiter&nbsp;found!</span></span></div></li>
-<li><div class="src-line"><a name="a2162"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pos</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2163"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$k</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2164"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2165"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2166"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pos</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;-&nbsp;<span class="src-var">$next_match_pos</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2167"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$k</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2168"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2169"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2170"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$delim_copy</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pointer</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$next_match_pos</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2171"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_parts</span>&nbsp;=&nbsp;<span class="src-var">$k</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2172"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2173"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$num_parts</span>&nbsp;==&nbsp;<span class="src-num">1</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">strict_mode</span>&nbsp;==&nbsp;<span class="src-id">GESHI_MAYBE</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2174"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;when&nbsp;we&nbsp;have&nbsp;only&nbsp;one&nbsp;part,&nbsp;we&nbsp;don't&nbsp;have&nbsp;anything&nbsp;to&nbsp;highlight&nbsp;at&nbsp;all.</span></span></div></li>
-<li><div class="src-line"><a name="a2175"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;we&nbsp;have&nbsp;a&nbsp;&quot;maybe&quot;&nbsp;strict&nbsp;language,&nbsp;this&nbsp;should&nbsp;be&nbsp;handled&nbsp;as&nbsp;highlightable&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2176"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2177"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">0</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2178"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">0</span>&nbsp;=&gt;&nbsp;<span class="src-str">''</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2179"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<span class="src-str">''</span></span></div></li>
-<li><div class="src-line"><a name="a2180"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2181"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2182"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">0</span>&nbsp;=&gt;&nbsp;<span class="src-id">null</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2183"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span></span></div></li>
-<li><div class="src-line"><a name="a2184"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a2185"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2186"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_parts</span>&nbsp;=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2187"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2188"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2189"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2190"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Not&nbsp;strict&nbsp;mode&nbsp;-&nbsp;simply&nbsp;dump&nbsp;the&nbsp;source&nbsp;into</span></span></div></li>
-<li><div class="src-line"><a name="a2191"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;array&nbsp;at&nbsp;index&nbsp;1&nbsp;(the&nbsp;first&nbsp;highlightable&nbsp;block)</span></span></div></li>
-<li><div class="src-line"><a name="a2192"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parts</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2193"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">0</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2194"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">0</span>&nbsp;=&gt;&nbsp;<span class="src-str">''</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2195"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<span class="src-str">''</span></span></div></li>
-<li><div class="src-line"><a name="a2196"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2197"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2198"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">0</span>&nbsp;=&gt;&nbsp;<span class="src-id">null</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2199"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-num">1</span>&nbsp;=&gt;&nbsp;<span class="src-var">$code</span></span></div></li>
-<li><div class="src-line"><a name="a2200"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a2201"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2202"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_parts</span>&nbsp;=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2203"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2204"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2205"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Unset&nbsp;variables&nbsp;we&nbsp;won't&nbsp;need&nbsp;any&nbsp;longer</span></span></div></li>
-<li><div class="src-line"><a name="a2206"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2207"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2208"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Preload&nbsp;some&nbsp;repeatedly&nbsp;used&nbsp;values&nbsp;regarding&nbsp;hardquotes&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2209"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$hq</span>&nbsp;=&nbsp;isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'HARDQUOTE'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'HARDQUOTE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;:&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2210"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$hq_strlen</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$hq</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2211"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2212"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Preload&nbsp;if&nbsp;line&nbsp;numbers&nbsp;are&nbsp;to&nbsp;be&nbsp;generated&nbsp;afterwards</span></span></div></li>
-<li><div class="src-line"><a name="a2213"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Added&nbsp;a&nbsp;check&nbsp;if&nbsp;line&nbsp;breaks&nbsp;should&nbsp;be&nbsp;forced&nbsp;even&nbsp;without&nbsp;line&nbsp;numbers,&nbsp;fixes&nbsp;SF#1727398</span></span></div></li>
-<li><div class="src-line"><a name="a2214"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$check_linenumbers</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2215"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines</span><span class="src-sym">)</span>&nbsp;||&nbsp;<span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">allow_multiline_span</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2216"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2217"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//preload&nbsp;the&nbsp;escape&nbsp;char&nbsp;for&nbsp;faster&nbsp;checking&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2218"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escaped_escape_char</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2219"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2220"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;is&nbsp;used&nbsp;for&nbsp;single-line&nbsp;comments</span></span></div></li>
-<li><div class="src-line"><a name="a2221"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sc_disallowed_before</span>&nbsp;=&nbsp;<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2222"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sc_disallowed_after</span>&nbsp;=&nbsp;<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2223"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2224"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2225"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2226"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2227"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sc_disallowed_before</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2228"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2229"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_AFTER'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2230"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$sc_disallowed_after</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_AFTER'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2231"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2232"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2233"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2234"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2235"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Fix&nbsp;for&nbsp;SF#1932083:&nbsp;Multichar&nbsp;Quotemarks&nbsp;unsupported</span></span></div></li>
-<li><div class="src-line"><a name="a2236"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$is_string_starter</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2237"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2238"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'QUOTEMARKS'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$quotemark</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2239"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$quotemark</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2240"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$quotemark</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]</span>&nbsp;=&nbsp;(string)<span class="src-var">$quotemark</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2241"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$quotemark</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2242"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$quotemark</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2243"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$quotemark</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2244"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$quotemark</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2245"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2246"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$quotemark</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$quotemark</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2247"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2248"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2249"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2250"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2251"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Now&nbsp;we&nbsp;go&nbsp;through&nbsp;each&nbsp;part.&nbsp;We&nbsp;know&nbsp;that&nbsp;even-indexed&nbsp;parts&nbsp;are</span></span></div></li>
-<li><div class="src-line"><a name="a2252"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;code&nbsp;that&nbsp;shouldn't&nbsp;be&nbsp;highlighted,&nbsp;and&nbsp;odd-indexed&nbsp;parts&nbsp;should</span></span></div></li>
-<li><div class="src-line"><a name="a2253"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;be&nbsp;highlighted</span></span></div></li>
-<li><div class="src-line"><a name="a2254"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$key</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$key</span>&nbsp;<&nbsp;<span class="src-var">$num_parts</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2255"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$STRICTATTRS</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2256"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2257"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;this&nbsp;block&nbsp;should&nbsp;be&nbsp;highlighted...</span></span></div></li>
-<li><div class="src-line"><a name="a2258"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-sym">(</span><span class="src-var">$key</span>&nbsp;<span class="src-sym">&</span>&nbsp;<span class="src-num">1</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2259"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Else&nbsp;not&nbsp;a&nbsp;block&nbsp;to&nbsp;highlight</span></span></div></li>
-<li><div class="src-line"><a name="a2260"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$endresult</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2261"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2262"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2263"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2264"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2265"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2266"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$part</span>&nbsp;=&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2267"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2268"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$highlight_part</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2269"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">strict_mode</span>&nbsp;&amp;&amp;&nbsp;<span class="src-sym">!</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2270"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;get&nbsp;the&nbsp;class&nbsp;key&nbsp;for&nbsp;this&nbsp;block&nbsp;of&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2271"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$script_key</span>&nbsp;=&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2272"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$highlight_part</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'HIGHLIGHT_STRICT_BLOCK'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2273"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span>&nbsp;!=&nbsp;<span class="src-str">''</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2274"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2275"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;a&nbsp;span&nbsp;element&nbsp;around&nbsp;the&nbsp;source&nbsp;to</span></span></div></li>
-<li><div class="src-line"><a name="a2276"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;highlight&nbsp;the&nbsp;overall&nbsp;source&nbsp;block</span></span></div></li>
-<li><div class="src-line"><a name="a2277"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2278"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2279"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$script_key</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2280"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2281"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;sc'</span>&nbsp;.&nbsp;<span class="src-var">$script_key</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2282"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2283"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2284"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$STRICTATTRS</span>&nbsp;=&nbsp;<span class="src-var">$attributes</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2285"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2286"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2287"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2288"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$highlight_part</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2289"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Now,&nbsp;highlight&nbsp;the&nbsp;code&nbsp;in&nbsp;this&nbsp;block.&nbsp;This&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2290"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;is&nbsp;really&nbsp;the&nbsp;engine&nbsp;of&nbsp;GeSHi&nbsp;(along&nbsp;with&nbsp;the&nbsp;method</span></span></div></li>
-<li><div class="src-line"><a name="a2291"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse_non_string_part).</span></span></div></li>
-<li><div class="src-line"><a name="a2292"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a2293"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;cache&nbsp;comment&nbsp;regexps&nbsp;incrementally</span></span></div></li>
-<li><div class="src-line"><a name="a2294"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_regexp_key</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2295"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_regexp_pos</span>&nbsp;=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2296"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_multi_pos</span>&nbsp;=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2297"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_single_pos</span>&nbsp;=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2298"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_regexp_cache_per_key</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2299"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_multi_cache_per_key</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2300"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_single_cache_per_key</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2301"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_open_comment_multi</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2302"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_single_key</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2303"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_regexp_cache_per_key</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2304"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_key</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2305"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2306"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2307"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$length</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2308"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2309"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Get&nbsp;the&nbsp;next&nbsp;char</span></span></div></li>
-<li><div class="src-line"><a name="a2310"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char</span>&nbsp;=&nbsp;<span class="src-var">$part</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2311"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char_len</span>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2312"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2313"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;update&nbsp;regexp&nbsp;comment&nbsp;cache&nbsp;if&nbsp;needed</span></span></div></li>
-<li><div class="src-line"><a name="a2314"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_REGEXP'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$next_comment_regexp_pos</span>&nbsp;<&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2315"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_regexp_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2316"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_REGEXP'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$comment_key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$regexp</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2317"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2318"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2319"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-var">$i</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2320"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2321"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;have&nbsp;already&nbsp;matched&nbsp;something</span></span></div></li>
-<li><div class="src-line"><a name="a2322"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2323"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;comment&nbsp;is&nbsp;never&nbsp;matched</span></span></div></li>
-<li><div class="src-line"><a name="a2324"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2325"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2326"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2327"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2328"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;is&nbsp;to&nbsp;allow&nbsp;use&nbsp;of&nbsp;the&nbsp;offset&nbsp;parameter&nbsp;in&nbsp;preg_match&nbsp;and&nbsp;stay&nbsp;as&nbsp;compatible&nbsp;with&nbsp;older&nbsp;PHP&nbsp;versions&nbsp;as&nbsp;possible</span></span></div></li>
-<li><div class="src-line"><a name="a2329"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_PHP_PRE_433</span>&nbsp;&amp;&amp;&nbsp;<a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$match</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">))</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2330"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">GESHI_PHP_PRE_433</span>&nbsp;&amp;&amp;&nbsp;<a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$match</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">))</span></span></div></li>
-<li><div class="src-line"><a name="a2331"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2332"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2333"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_PHP_PRE_433</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2334"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;+=&nbsp;<span class="src-var">$i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2335"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2336"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2337"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2338"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'key'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$comment_key</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2339"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'length'</span>&nbsp;=&gt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2340"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'pos'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$match_i</span></span></div></li>
-<li><div class="src-line"><a name="a2341"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2342"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2343"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2344"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2345"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2346"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2347"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;!==&nbsp;<span class="src-id">false</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$match_i</span>&nbsp;<&nbsp;<span class="src-var">$next_comment_regexp_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2348"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_regexp_pos</span>&nbsp;=&nbsp;<span class="src-var">$match_i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2349"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_regexp_key</span>&nbsp;=&nbsp;<span class="src-var">$comment_key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2350"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;===&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2351"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2352"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2353"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2354"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2355"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2356"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2357"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_started</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2358"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2359"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2360"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Possibly&nbsp;the&nbsp;start&nbsp;of&nbsp;a&nbsp;new&nbsp;string&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2361"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a2362"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;which&nbsp;starter&nbsp;it&nbsp;was&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2363"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Fix&nbsp;for&nbsp;SF#1932083:&nbsp;Multichar&nbsp;Quotemarks&nbsp;unsupported</span></span></div></li>
-<li><div class="src-line"><a name="a2364"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2365"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char_new</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2366"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$testchar</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2367"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$testchar</span>&nbsp;===&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$testchar</span><span class="src-sym">))</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2368"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$testchar</span><span class="src-sym">)</span>&nbsp;>&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$char_new</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2369"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char_new</span>&nbsp;=&nbsp;<span class="src-var">$testchar</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2370"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_started</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2371"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2372"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2373"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$string_started</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2374"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char</span>&nbsp;=&nbsp;<span class="src-var">$char_new</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2375"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2376"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2377"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$testchar</span>&nbsp;=&nbsp;<span class="src-var">$is_string_starter</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2378"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$testchar</span>&nbsp;===&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$testchar</span><span class="src-sym">)))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2379"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char</span>&nbsp;=&nbsp;<span class="src-var">$testchar</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2380"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_started</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2381"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2382"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2383"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char_len</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2384"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2385"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2386"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$string_started</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$i</span>&nbsp;!=&nbsp;<span class="src-var">$next_comment_regexp_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2387"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Hand&nbsp;out&nbsp;the&nbsp;correct&nbsp;style&nbsp;information&nbsp;for&nbsp;this&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2388"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_key</span>&nbsp;=&nbsp;<a href="http://www.php.net/array_search">array_search</a><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'QUOTEMARKS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2389"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$string_key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2390"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$string_key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2391"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_key</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2392"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2393"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2394"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse&nbsp;the&nbsp;stuff&nbsp;before&nbsp;this</span></span></div></li>
-<li><div class="src-line"><a name="a2395"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2396"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2397"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2398"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2399"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$string_key</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2400"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2401"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;st'</span>.<span class="src-var">$string_key</span>.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2402"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2403"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2404"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;now&nbsp;handle&nbsp;the&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2405"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$string_attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.&nbsp;<span class="src-id">GeSHi</span><span class="src-sym">::</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$char</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2406"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$char_len</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2407"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_open</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2408"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2409"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_REGEXP'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2410"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2411"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2412"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2413"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;do&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2414"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;regular&nbsp;ending&nbsp;pos&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2415"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$char</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2416"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<span class="src-var">$close_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2417"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2418"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2419"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2420"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2421"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;update&nbsp;escape&nbsp;regexp&nbsp;cache&nbsp;if&nbsp;needed</span></span></div></li>
-<li><div class="src-line"><a name="a2422"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_REGEXP'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;<&nbsp;<span class="src-var">$start</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2423"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2424"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_REGEXP'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$escape_key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$regexp</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2425"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2426"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2427"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-var">$start</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2428"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2429"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;have&nbsp;already&nbsp;matched&nbsp;something</span></span></div></li>
-<li><div class="src-line"><a name="a2430"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2431"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;comment&nbsp;is&nbsp;never&nbsp;matched</span></span></div></li>
-<li><div class="src-line"><a name="a2432"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2433"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2434"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2435"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2436"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;is&nbsp;to&nbsp;allow&nbsp;use&nbsp;of&nbsp;the&nbsp;offset&nbsp;parameter&nbsp;in&nbsp;preg_match&nbsp;and&nbsp;stay&nbsp;as&nbsp;compatible&nbsp;with&nbsp;older&nbsp;PHP&nbsp;versions&nbsp;as&nbsp;possible</span></span></div></li>
-<li><div class="src-line"><a name="a2437"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_PHP_PRE_433</span>&nbsp;&amp;&amp;&nbsp;<a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$match</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">))</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2438"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">GESHI_PHP_PRE_433</span>&nbsp;&amp;&amp;&nbsp;<a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$match</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_OFFSET_CAPTURE</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span></span></div></li>
-<li><div class="src-line"><a name="a2439"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2440"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2441"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_PHP_PRE_433</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2442"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;+=&nbsp;<span class="src-var">$start</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2443"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2444"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2445"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2446"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'key'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$escape_key</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2447"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'length'</span>&nbsp;=&gt;&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2448"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'pos'</span>&nbsp;=&gt;&nbsp;<span class="src-var">$match_i</span></span></div></li>
-<li><div class="src-line"><a name="a2449"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2450"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2451"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'pos'</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2452"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2453"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2454"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2455"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;!==&nbsp;<span class="src-id">false</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$match_i</span>&nbsp;<&nbsp;<span class="src-var">$next_escape_regexp_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2456"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;=&nbsp;<span class="src-var">$match_i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2457"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_key</span>&nbsp;=&nbsp;<span class="src-var">$escape_key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2458"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;===&nbsp;<span class="src-var">$start</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2459"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2460"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2461"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2462"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2463"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2464"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2465"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Find&nbsp;the&nbsp;next&nbsp;simple&nbsp;escape&nbsp;position</span></span></div></li>
-<li><div class="src-line"><a name="a2466"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-str">''</span>&nbsp;!=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2467"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$simple_escape</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2468"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<span class="src-var">$simple_escape</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2469"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$simple_escape</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2470"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2471"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2472"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$simple_escape</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2473"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2474"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2475"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2476"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$simple_escape</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2477"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2478"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2479"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-var">$simple_escape</span>&nbsp;<&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2480"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$simple_escape</span>&nbsp;<&nbsp;<span class="src-var">$length</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2481"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$simple_escape</span>&nbsp;<&nbsp;<span class="src-var">$close_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2482"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//The&nbsp;nexxt&nbsp;escape&nbsp;sequence&nbsp;is&nbsp;a&nbsp;simple&nbsp;one&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2483"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_pos</span>&nbsp;=&nbsp;<span class="src-var">$simple_escape</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2484"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2485"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Add&nbsp;the&nbsp;stuff&nbsp;not&nbsp;in&nbsp;the&nbsp;string&nbsp;yet&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2486"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span>&nbsp;-&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2487"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2488"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;style&nbsp;for&nbsp;this&nbsp;escaped&nbsp;char&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2489"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2490"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2491"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2492"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;es0&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2493"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2494"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2495"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Add&nbsp;the&nbsp;style&nbsp;for&nbsp;the&nbsp;escape&nbsp;char&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2496"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$escape_char_attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a2497"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">GeSHi</span><span class="src-sym">::</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2498"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2499"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;byte&nbsp;AFTER&nbsp;the&nbsp;ESCAPE_CHAR&nbsp;we&nbsp;just&nbsp;found</span></span></div></li>
-<li><div class="src-line"><a name="a2500"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_char</span>&nbsp;=&nbsp;<span class="src-var">$part</span><span class="src-sym">[</span><span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2501"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$es_char</span>&nbsp;==&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2502"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;don't&nbsp;put&nbsp;a&nbsp;newline&nbsp;around&nbsp;newlines</span></span></div></li>
-<li><div class="src-line"><a name="a2503"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&lt;/span&gt;\n&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2504"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2505"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/ord">ord</a><span class="src-sym">(</span><span class="src-var">$es_char</span><span class="src-sym">)</span>&nbsp;&gt;=&nbsp;<span class="src-num">128</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2506"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;is&nbsp;an&nbsp;non-ASCII&nbsp;char&nbsp;(UTF8&nbsp;or&nbsp;single&nbsp;byte)</span></span></div></li>
-<li><div class="src-line"><a name="a2507"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;code&nbsp;tries&nbsp;to&nbsp;work&nbsp;around&nbsp;SF#2037598&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2508"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'mb_substr'</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2509"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_char_m</span>&nbsp;=&nbsp;<a href="http://www.php.net/mb_substr">mb_substr</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span>+<span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<span class="src-num">16</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">encoding</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2510"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-var">$es_char_m</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2511"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-id">GESHI_PHP_PRE_433</span>&nbsp;&amp;&amp;&nbsp;<span class="src-str">'utf-8'</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">encoding</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2512"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">&quot;/[\xC2-\xDF][\x80-\xBF]&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a2513"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;|\xE0[\xA0-\xBF][\x80-\xBF]&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a2514"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a2515"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;|\xED[\x80-\x9F][\x80-\xBF]&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a2516"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;|\xF0[\x90-\xBF][\x80-\xBF]{2}&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a2517"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;|[\xF1-\xF3][\x80-\xBF]{3}&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a2518"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;|\xF4[\x80-\x8F][\x80-\xBF]{2}/s&quot;</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2519"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_char_m</span><span class="src-sym">,</span>&nbsp;<span class="src-id">null</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2520"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_char_m</span>&nbsp;=&nbsp;<span class="src-var">$es_char_m</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2521"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2522"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_char_m</span>&nbsp;=&nbsp;<span class="src-var">$es_char</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2523"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2524"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$es_char_m</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2525"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2526"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_char_m</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$es_char</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2527"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2528"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$es_char_m</span><span class="src-sym">)</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2529"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2530"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$es_char</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2531"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2532"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2533"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$next_escape_regexp_pos</span>&nbsp;<&nbsp;<span class="src-var">$length</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2534"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_escape_regexp_pos</span>&nbsp;<&nbsp;<span class="src-var">$close_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2535"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$es_pos</span>&nbsp;=&nbsp;<span class="src-var">$next_escape_regexp_pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2536"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Add&nbsp;the&nbsp;stuff&nbsp;not&nbsp;in&nbsp;the&nbsp;string&nbsp;yet&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2537"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span>&nbsp;-&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2538"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2539"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;key&nbsp;and&nbsp;length&nbsp;of&nbsp;this&nbsp;match&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2540"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape</span>&nbsp;=&nbsp;<span class="src-var">$escape_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$next_escape_regexp_key</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2541"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_str</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$escape</span><span class="src-sym">[</span><span class="src-str">'length'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2542"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_key</span>&nbsp;=&nbsp;<span class="src-var">$escape</span><span class="src-sym">[</span><span class="src-str">'key'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2543"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2544"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;style&nbsp;for&nbsp;this&nbsp;escaped&nbsp;char&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2545"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2546"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$escape_key</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2547"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2548"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;es'</span>&nbsp;.&nbsp;<span class="src-var">$escape_key</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2549"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2550"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2551"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Add&nbsp;the&nbsp;style&nbsp;for&nbsp;the&nbsp;escape&nbsp;char&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2552"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$escape_char_attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a2553"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$escape_str</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2554"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2555"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-var">$escape</span><span class="src-sym">[</span><span class="src-str">'length'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2556"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2557"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Copy&nbsp;the&nbsp;remainder&nbsp;of&nbsp;the&nbsp;string&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a2558"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-var">$start</span>&nbsp;+&nbsp;<span class="src-var">$char_len</span><span class="src-sym">))</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2559"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span>&nbsp;+&nbsp;<span class="src-var">$char_len</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2560"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_open</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2561"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2562"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">while</span><span class="src-sym">(</span><span class="src-var">$string_open</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2563"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2564"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$check_linenumbers</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2565"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Are&nbsp;line&nbsp;numbers&nbsp;used?&nbsp;If,&nbsp;we&nbsp;should&nbsp;end&nbsp;the&nbsp;string&nbsp;before</span></span></div></li>
-<li><div class="src-line"><a name="a2566"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;newline&nbsp;and&nbsp;begin&nbsp;it&nbsp;again&nbsp;(so&nbsp;when&nbsp;&lt;li&gt;s&nbsp;are&nbsp;put&nbsp;in&nbsp;the&nbsp;source</span></span></div></li>
-<li><div class="src-line"><a name="a2567"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remains&nbsp;XHTML&nbsp;compliant)</span></span></div></li>
-<li><div class="src-line"><a name="a2568"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note&nbsp;to&nbsp;self:&nbsp;This&nbsp;opens&nbsp;up&nbsp;possibility&nbsp;of&nbsp;config&nbsp;files&nbsp;specifying</span></span></div></li>
-<li><div class="src-line"><a name="a2569"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;that&nbsp;languages&nbsp;can/cannot&nbsp;have&nbsp;multiline&nbsp;strings???</span></span></div></li>
-<li><div class="src-line"><a name="a2570"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;/span&gt;\n&lt;span<span class="src-var">$string_attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2571"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2572"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2573"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$string</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2574"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2575"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$start</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2576"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2577"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$hq</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$hq</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$char</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2578"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$hq_strlen</span><span class="src-sym">)</span>&nbsp;==&nbsp;<span class="src-var">$hq</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2579"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;The&nbsp;start&nbsp;of&nbsp;a&nbsp;hard&nbsp;quoted&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2580"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2581"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'HARD'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2582"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'HARD'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2583"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2584"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;st_h&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2585"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;es_h&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2586"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2587"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse&nbsp;the&nbsp;stuff&nbsp;before&nbsp;this</span></span></div></li>
-<li><div class="src-line"><a name="a2588"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2589"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2590"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2591"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;now&nbsp;handle&nbsp;the&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2592"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2593"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2594"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;look&nbsp;for&nbsp;closing&nbsp;quote</span></span></div></li>
-<li><div class="src-line"><a name="a2595"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$hq_strlen</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2596"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close_pos</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'HARDQUOTE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2597"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2598"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$part</span><span class="src-sym">[</span><span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2599"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sure&nbsp;this&nbsp;quote&nbsp;is&nbsp;not&nbsp;escaped</span></span></div></li>
-<li><div class="src-line"><a name="a2600"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'HARDESCAPE'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$hardescape</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2601"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$hardescape</span><span class="src-sym">))</span>&nbsp;==&nbsp;<span class="src-var">$hardescape</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2602"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;wether&nbsp;this&nbsp;quote&nbsp;is&nbsp;escaped&nbsp;or&nbsp;if&nbsp;it&nbsp;is&nbsp;something&nbsp;like&nbsp;'\\'</span></span></div></li>
-<li><div class="src-line"><a name="a2603"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$escape_char_pos</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2604"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$escape_char_pos</span>&nbsp;>&nbsp;<span class="src-num">0</span></span></div></li>
-<li><div class="src-line"><a name="a2605"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;<span class="src-var">$part</span><span class="src-sym">[</span><span class="src-var">$escape_char_pos</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2606"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--<span class="src-var">$escape_char_pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2607"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2608"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">((</span><span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-var">$escape_char_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">&</span>&nbsp;<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2609"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;uneven&nbsp;number&nbsp;of&nbsp;escape&nbsp;chars&nbsp;=&gt;&nbsp;this&nbsp;quote&nbsp;is&nbsp;escaped</span></span></div></li>
-<li><div class="src-line"><a name="a2610"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span>&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2611"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2612"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2613"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2614"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2615"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2616"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;found&nbsp;closing&nbsp;quote</span></span></div></li>
-<li><div class="src-line"><a name="a2617"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2618"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2619"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2620"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Found&nbsp;the&nbsp;closing&nbsp;delimiter?</span></span></div></li>
-<li><div class="src-line"><a name="a2621"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$close_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2622"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;span&nbsp;till&nbsp;the&nbsp;end&nbsp;of&nbsp;this&nbsp;$part&nbsp;when&nbsp;no&nbsp;closing&nbsp;delimiter&nbsp;is&nbsp;found</span></span></div></li>
-<li><div class="src-line"><a name="a2623"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2624"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2625"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2626"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;actual&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2627"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2628"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2629"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2630"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;handle&nbsp;escape&nbsp;chars&nbsp;and&nbsp;encode&nbsp;html&nbsp;chars</span></span></div></li>
-<li><div class="src-line"><a name="a2631"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;(special&nbsp;because&nbsp;when&nbsp;we&nbsp;have&nbsp;escape&nbsp;chars&nbsp;within&nbsp;our&nbsp;string&nbsp;they&nbsp;may&nbsp;not&nbsp;be&nbsp;escaped)</span></span></div></li>
-<li><div class="src-line"><a name="a2632"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2633"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2634"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_string</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2635"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$es_pos</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2636"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;hmtl&nbsp;escape&nbsp;stuff&nbsp;before</span></span></div></li>
-<li><div class="src-line"><a name="a2637"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_string</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span>&nbsp;-&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2638"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;if&nbsp;this&nbsp;is&nbsp;a&nbsp;hard&nbsp;escape</span></span></div></li>
-<li><div class="src-line"><a name="a2639"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'HARDESCAPE'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$hardescape</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2640"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$es_pos</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$hardescape</span><span class="src-sym">))</span>&nbsp;==&nbsp;<span class="src-var">$hardescape</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2641"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;indeed,&nbsp;this&nbsp;is&nbsp;a&nbsp;hardescape</span></span></div></li>
-<li><div class="src-line"><a name="a2642"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_string</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$escape_char_attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a2643"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$hardescape</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2644"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$hardescape</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2645"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span>&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2646"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2647"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2648"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;not&nbsp;a&nbsp;hard&nbsp;escape,&nbsp;but&nbsp;a&nbsp;normal&nbsp;escape</span></span></div></li>
-<li><div class="src-line"><a name="a2649"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;they&nbsp;come&nbsp;in&nbsp;pairs&nbsp;of&nbsp;two</span></span></div></li>
-<li><div class="src-line"><a name="a2650"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$c</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2651"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">[</span><span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-var">$c</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">[</span><span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-var">$c</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a2652"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;<span class="src-var">$string</span><span class="src-sym">[</span><span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-var">$c</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span></span></div></li>
-<li><div class="src-line"><a name="a2653"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;<span class="src-var">$string</span><span class="src-sym">[</span><span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-var">$c</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">]</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2654"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$c</span>&nbsp;+=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2655"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2656"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$c</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2657"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_string</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$escape_char_attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a2658"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">str_repeat</span><span class="src-sym">(</span><span class="src-var">$escaped_escape_char</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$c</span><span class="src-sym">)</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a2659"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2660"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-var">$c</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2661"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2662"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;is&nbsp;just&nbsp;a&nbsp;single&nbsp;lonely&nbsp;escape&nbsp;char...</span></span></div></li>
-<li><div class="src-line"><a name="a2663"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_string</span>&nbsp;.=&nbsp;<span class="src-var">$escaped_escape_char</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2664"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-var">$es_pos</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2665"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2666"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2667"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<span class="src-var">$new_string</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2668"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2669"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2670"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2671"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2672"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$check_linenumbers</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2673"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Are&nbsp;line&nbsp;numbers&nbsp;used?&nbsp;If,&nbsp;we&nbsp;should&nbsp;end&nbsp;the&nbsp;string&nbsp;before</span></span></div></li>
-<li><div class="src-line"><a name="a2674"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;newline&nbsp;and&nbsp;begin&nbsp;it&nbsp;again&nbsp;(so&nbsp;when&nbsp;&lt;li&gt;s&nbsp;are&nbsp;put&nbsp;in&nbsp;the&nbsp;source</span></span></div></li>
-<li><div class="src-line"><a name="a2675"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;remains&nbsp;XHTML&nbsp;compliant)</span></span></div></li>
-<li><div class="src-line"><a name="a2676"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note&nbsp;to&nbsp;self:&nbsp;This&nbsp;opens&nbsp;up&nbsp;possibility&nbsp;of&nbsp;config&nbsp;files&nbsp;specifying</span></span></div></li>
-<li><div class="src-line"><a name="a2677"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;that&nbsp;languages&nbsp;can/cannot&nbsp;have&nbsp;multiline&nbsp;strings???</span></span></div></li>
-<li><div class="src-line"><a name="a2678"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;/span&gt;\n&lt;span<span class="src-var">$string_attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$string</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2679"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2680"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2681"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;</span><span class="src-str">&quot;</span>&lt;span<span class="src-var">$string_attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.&nbsp;<span class="src-var">$string</span>&nbsp;.&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2682"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$string</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2683"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2684"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2685"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Have&nbsp;a&nbsp;look&nbsp;for&nbsp;regexp&nbsp;comments</span></span></div></li>
-<li><div class="src-line"><a name="a2686"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;==&nbsp;<span class="src-var">$next_comment_regexp_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2687"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$COMMENT_MATCHED</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2688"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment</span>&nbsp;=&nbsp;<span class="src-var">$comment_regexp_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$next_comment_regexp_key</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2689"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$comment</span><span class="src-sym">[</span><span class="src-str">'length'</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2690"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2691"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//@todo&nbsp;If&nbsp;remove&nbsp;important&nbsp;do&nbsp;remove&nbsp;here</span></span></div></li>
-<li><div class="src-line"><a name="a2692"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2693"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2694"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment</span><span class="src-sym">[</span><span class="src-str">'key'</span><span class="src-sym">]]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2695"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2696"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;co'</span>&nbsp;.&nbsp;<span class="src-var">$comment</span><span class="src-sym">[</span><span class="src-str">'key'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2697"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2698"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2699"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.&nbsp;<span class="src-var">$test_str</span>&nbsp;.&nbsp;<span class="src-str">&quot;&lt;/span&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2700"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2701"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Short-cut&nbsp;through&nbsp;all&nbsp;the&nbsp;multiline&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2702"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$check_linenumbers</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2703"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;strreplace&nbsp;to&nbsp;put&nbsp;close&nbsp;span&nbsp;and&nbsp;open&nbsp;span&nbsp;around&nbsp;multiline&nbsp;newlines</span></span></div></li>
-<li><div class="src-line"><a name="a2704"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2705"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;/span&gt;\n&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2706"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">&quot;\n&nbsp;&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\n&amp;nbsp;&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$test_str</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a2707"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2708"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2709"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2710"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2711"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;+=&nbsp;<span class="src-var">$comment</span><span class="src-sym">[</span><span class="src-str">'length'</span><span class="src-sym">]</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2712"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2713"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse&nbsp;the&nbsp;rest</span></span></div></li>
-<li><div class="src-line"><a name="a2714"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2715"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2716"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2717"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2718"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;we&nbsp;haven't&nbsp;matched&nbsp;a&nbsp;regexp&nbsp;comment,&nbsp;try&nbsp;multi-line&nbsp;comments</span></span></div></li>
-<li><div class="src-line"><a name="a2719"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$COMMENT_MATCHED</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2720"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Is&nbsp;this&nbsp;a&nbsp;multiline&nbsp;comment?</span></span></div></li>
-<li><div class="src-line"><a name="a2721"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_MULTI'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$next_comment_multi_pos</span>&nbsp;<&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2722"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_multi_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2723"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_MULTI'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$open</span>&nbsp;=&gt;&nbsp;<span class="src-var">$close</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2724"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2725"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2726"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-var">$i</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2727"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2728"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;have&nbsp;already&nbsp;matched&nbsp;something</span></span></div></li>
-<li><div class="src-line"><a name="a2729"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2730"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;comment&nbsp;is&nbsp;never&nbsp;matched</span></span></div></li>
-<li><div class="src-line"><a name="a2731"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2732"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2733"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2734"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">((</span><span class="src-var">$match_i</span>&nbsp;=&nbsp;<a href="http://www.php.net/stripos">stripos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$open</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">))</span>&nbsp;!==&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2735"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$match_i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2736"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2737"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_multi_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2738"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2739"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2740"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;!==&nbsp;<span class="src-id">false</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$match_i</span>&nbsp;<&nbsp;<span class="src-var">$next_comment_multi_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2741"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_multi_pos</span>&nbsp;=&nbsp;<span class="src-var">$match_i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2742"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_open_comment_multi</span>&nbsp;=&nbsp;<span class="src-var">$open</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2743"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;===&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2744"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2745"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2746"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2747"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2748"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2749"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;==&nbsp;<span class="src-var">$next_comment_multi_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2750"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$open</span>&nbsp;=&nbsp;<span class="src-var">$next_open_comment_multi</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2751"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_MULTI'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$open</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2752"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$open_strlen</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2753"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_strlen</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2754"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$COMMENT_MATCHED</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2755"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str_match</span>&nbsp;=&nbsp;<span class="src-var">$open</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2756"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//@todo&nbsp;If&nbsp;remove&nbsp;important&nbsp;do&nbsp;remove&nbsp;here</span></span></div></li>
-<li><div class="src-line"><a name="a2757"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2758"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$open</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT&quot;&gt;GESHI_START_IMPORTANT&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2759"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$open</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT&quot;&gt;GESHI_START_IMPORTANT&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2760"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2761"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2762"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2763"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;coMULTI&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2764"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2765"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2766"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2767"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2768"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">important_styles</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2769"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2770"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;imp&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2771"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2772"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2773"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;We&nbsp;don't&nbsp;include&nbsp;the&nbsp;start&nbsp;of&nbsp;the&nbsp;comment&nbsp;if&nbsp;it's&nbsp;an</span></span></div></li>
-<li><div class="src-line"><a name="a2774"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&quot;important&quot;&nbsp;part</span></span></div></li>
-<li><div class="src-line"><a name="a2775"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2776"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2777"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2778"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$open</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2779"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2780"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2781"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-id">strpos</span><span class="src-sym">(</span>&nbsp;<span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$open_strlen</span>&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2782"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2783"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close_pos</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2784"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2785"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2786"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2787"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Short-cut&nbsp;through&nbsp;all&nbsp;the&nbsp;multiline&nbsp;code</span></span></div></li>
-<li><div class="src-line"><a name="a2788"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rest_of_comment</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-id">substr</span><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$open_strlen</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-var">$i</span>&nbsp;-&nbsp;<span class="src-var">$open_strlen</span>&nbsp;+&nbsp;<span class="src-var">$close_strlen</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2789"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">((</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2790"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str_match</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT&quot;&gt;GESHI_START_IMPORTANT&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2791"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$check_linenumbers</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2792"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2793"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;strreplace&nbsp;to&nbsp;put&nbsp;close&nbsp;span&nbsp;and&nbsp;open&nbsp;span&nbsp;around&nbsp;multiline&nbsp;newlines</span></span></div></li>
-<li><div class="src-line"><a name="a2794"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;.=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2795"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;/span&gt;\n&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a2796"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">&quot;\n&nbsp;&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\n&amp;nbsp;&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$rest_of_comment</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a2797"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2798"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2799"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;.=&nbsp;<span class="src-var">$rest_of_comment</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2800"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2801"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2802"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MULTI'</span><span class="src-sym">]</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2803"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str_match</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT&quot;&gt;GESHI_START_IMPORTANT&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2804"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2805"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2806"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2807"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span>&nbsp;+&nbsp;<span class="src-var">$close_strlen</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2808"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2809"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse&nbsp;the&nbsp;rest</span></span></div></li>
-<li><div class="src-line"><a name="a2810"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2811"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2812"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2813"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2814"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2815"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;we&nbsp;haven't&nbsp;matched&nbsp;a&nbsp;multiline&nbsp;comment,&nbsp;try&nbsp;single-line&nbsp;comments</span></span></div></li>
-<li><div class="src-line"><a name="a2816"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$COMMENT_MATCHED</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2817"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;cache&nbsp;potential&nbsp;single&nbsp;line&nbsp;comment&nbsp;occurances</span></span></div></li>
-<li><div class="src-line"><a name="a2818"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_SINGLE'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$next_comment_single_pos</span>&nbsp;<&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2819"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_single_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2820"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_SINGLE'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$comment_key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$comment_mark</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2821"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2822"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2823"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;&gt;=&nbsp;<span class="src-var">$i</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2824"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2825"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;have&nbsp;already&nbsp;matched&nbsp;something</span></span></div></li>
-<li><div class="src-line"><a name="a2826"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2827"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;comment&nbsp;is&nbsp;never&nbsp;matched</span></span></div></li>
-<li><div class="src-line"><a name="a2828"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2829"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2830"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match_i</span>&nbsp;=&nbsp;<span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2831"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a2832"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;case&nbsp;sensitive&nbsp;comments</span></span></div></li>
-<li><div class="src-line"><a name="a2833"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id">GESHI_COMMENTS</span><span class="src-sym">]</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2834"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;=&nbsp;<a href="http://www.php.net/stripos">stripos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$comment_mark</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">))</span>&nbsp;!==&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2835"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;non&nbsp;case&nbsp;sensitive</span></span></div></li>
-<li><div class="src-line"><a name="a2836"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id">GESHI_COMMENTS</span><span class="src-sym">]</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2837"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">((</span><span class="src-var">$match_i</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$comment_mark</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">))</span>&nbsp;!==&nbsp;<span class="src-id">false</span><span class="src-sym">)))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2838"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$match_i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2839"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2840"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_single_cache_per_key</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2841"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2842"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2843"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;!==&nbsp;<span class="src-id">false</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$match_i</span>&nbsp;<&nbsp;<span class="src-var">$next_comment_single_pos</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2844"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_single_pos</span>&nbsp;=&nbsp;<span class="src-var">$match_i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2845"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$next_comment_single_key</span>&nbsp;=&nbsp;<span class="src-var">$comment_key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2846"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$match_i</span>&nbsp;===&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2847"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2848"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2849"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2850"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2851"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2852"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$next_comment_single_pos</span>&nbsp;==&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2853"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_key</span>&nbsp;=&nbsp;<span class="src-var">$next_comment_single_key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2854"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$comment_mark</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_SINGLE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2855"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$com_len</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$comment_mark</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2856"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2857"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;check&nbsp;will&nbsp;find&nbsp;special&nbsp;variables&nbsp;like&nbsp;$#&nbsp;in&nbsp;bash</span></span></div></li>
-<li><div class="src-line"><a name="a2858"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;or&nbsp;compiler&nbsp;directives&nbsp;of&nbsp;Delphi&nbsp;beginning&nbsp;{$</span></span></div></li>
-<li><div class="src-line"><a name="a2859"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">((</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$sc_disallowed_before</span><span class="src-sym">)</span>&nbsp;||&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;==&nbsp;<span class="src-num">0</span><span class="src-sym">)</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2860"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$sc_disallowed_before</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$part</span><span class="src-sym">[</span><span class="src-var">$i</span>-<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)))</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a2861"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$sc_disallowed_after</span><span class="src-sym">)</span>&nbsp;||&nbsp;<span class="src-sym">(</span><span class="src-var">$length</span>&nbsp;&lt;=&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$com_len</span><span class="src-sym">)</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a2862"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$sc_disallowed_after</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$part</span><span class="src-sym">[</span><span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$com_len</span><span class="src-sym">]</span><span class="src-sym">))))</span></span></div></li>
-<li><div class="src-line"><a name="a2863"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2864"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;is&nbsp;a&nbsp;valid&nbsp;comment</span></span></div></li>
-<li><div class="src-line"><a name="a2865"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$COMMENT_MATCHED</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2866"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2867"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2868"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2869"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2870"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;co'</span>&nbsp;.&nbsp;<span class="src-var">$comment_key</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2871"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2872"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;span<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;&nbsp;</span><span class="src-str">.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">change_case</span><span class="src-sym">(</span><span class="src-var">$comment_mark</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2873"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2874"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$comment_mark</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2875"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2876"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2877"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;this&nbsp;comment&nbsp;is&nbsp;the&nbsp;last&nbsp;in&nbsp;the&nbsp;source</span></span></div></li>
-<li><div class="src-line"><a name="a2878"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-id">strpos</span><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2879"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oops</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2880"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close_pos</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2881"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_pos</span>&nbsp;=&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2882"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oops</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2883"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2884"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-var">$com_len</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close_pos</span>&nbsp;-&nbsp;<span class="src-var">$i</span>&nbsp;-&nbsp;<span class="src-var">$com_len</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2885"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$comment_key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2886"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&lt;/span&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2887"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2888"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2889"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Take&nbsp;into&nbsp;account&nbsp;that&nbsp;the&nbsp;comment&nbsp;might&nbsp;be&nbsp;the&nbsp;last&nbsp;in&nbsp;the&nbsp;source</span></span></div></li>
-<li><div class="src-line"><a name="a2890"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$oops</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2891"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$test_str</span>&nbsp;.=&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2892"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2893"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2894"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-var">$close_pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2895"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2896"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;parse&nbsp;the&nbsp;rest</span></span></div></li>
-<li><div class="src-line"><a name="a2897"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2898"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2899"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2900"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2901"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2902"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2903"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2904"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Where&nbsp;are&nbsp;we&nbsp;adding&nbsp;this&nbsp;char?</span></span></div></li>
-<li><div class="src-line"><a name="a2905"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$COMMENT_MATCHED</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2906"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;.=&nbsp;<span class="src-var">$char</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2907"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2908"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$test_str</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2909"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$test_str</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2910"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$COMMENT_MATCHED</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2911"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2912"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2913"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Parse&nbsp;the&nbsp;last&nbsp;bit</span></span></div></li>
-<li><div class="src-line"><a name="a2914"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2915"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2916"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2917"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2918"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2919"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Close&nbsp;the&nbsp;&lt;span&gt;&nbsp;that&nbsp;surrounds&nbsp;the&nbsp;block</span></span></div></li>
-<li><div class="src-line"><a name="a2920"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$STRICTATTRS</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2921"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;/span&gt;\n&lt;span<span class="src-var">$STRICTATTRS</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2922"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2923"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2924"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2925"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$endresult</span>&nbsp;.=&nbsp;<span class="src-var">$result</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2926"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$part</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$parts</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2927"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2928"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2929"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;fix&nbsp;is&nbsp;related&nbsp;to&nbsp;SF#1923020,&nbsp;but&nbsp;has&nbsp;to&nbsp;be&nbsp;applied&nbsp;regardless&nbsp;of</span></span></div></li>
-<li><div class="src-line"><a name="a2930"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//actually&nbsp;highlighting&nbsp;symbols.</span></span></div></li>
-<li><div class="src-line"><a name="a2931"></a><span class="src-doc">/**&nbsp;NOTE:&nbsp;memorypeak&nbsp;#3&nbsp;*/</span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a2932"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$endresult</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'&lt;SEMI&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;PIPE&gt;'</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">';'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'|'</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$endresult</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2933"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2934"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Parse&nbsp;the&nbsp;last&nbsp;stuff&nbsp;(redundant?)</span></span></div></li>
-<li><div class="src-line"><a name="a2935"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result&nbsp;.=&nbsp;$this-&gt;parse_non_string_part($stuff_to_parse);</span></span></div></li>
-<li><div class="src-line"><a name="a2936"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a2937"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Lop&nbsp;off&nbsp;the&nbsp;very&nbsp;first&nbsp;and&nbsp;last&nbsp;spaces</span></span></div></li>
-<li><div class="src-line"><a name="a2938"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$result&nbsp;=&nbsp;substr($result,&nbsp;1,&nbsp;-1);</span></span></div></li>
-<li><div class="src-line"><a name="a2939"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a2940"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;We're&nbsp;finished:&nbsp;stop&nbsp;timing</span></span></div></li>
-<li><div class="src-line"><a name="a2941"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">set_time</span><span class="src-sym">(</span><span class="src-var">$start_time</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2942"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2943"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">finalise</span><span class="src-sym">(</span><span class="src-var">$endresult</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2944"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$endresult</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2945"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2946"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2947"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a2948"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Swaps&nbsp;out&nbsp;spaces&nbsp;and&nbsp;tabs&nbsp;for&nbsp;HTML&nbsp;indentation.&nbsp;Not&nbsp;needed&nbsp;if</span></div></li>
-<li><div class="src-line"><a name="a2949"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;code&nbsp;is&nbsp;in&nbsp;a&nbsp;pre&nbsp;block...</span></div></li>
-<li><div class="src-line"><a name="a2950"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a2951"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;source&nbsp;to&nbsp;indent&nbsp;(reference!)</span></div></li>
-<li><div class="src-line"><a name="a2952"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a2953"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a2954"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a2955"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">indent</span><span class="src-sym">(</span><span class="src-sym">&</span><span class="src-var">$result</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2956"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">///&nbsp;Replace&nbsp;tabs&nbsp;with&nbsp;the&nbsp;correct&nbsp;number&nbsp;of&nbsp;spaces</span></span></div></li>
-<li><div class="src-line"><a name="a2957"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;!==&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\t&quot;</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2958"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span>&nbsp;=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2959"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span><span class="src-comm">//Save&nbsp;memory&nbsp;while&nbsp;we&nbsp;process&nbsp;the&nbsp;lines&nbsp;individually</span></span></div></li>
-<li><div class="src-line"><a name="a2960"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tab_width</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodget_real_tab_width">get_real_tab_width</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2961"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tab_string</span>&nbsp;=&nbsp;<span class="src-str">'&amp;nbsp;'</span>&nbsp;.&nbsp;<a href="http://www.php.net/str_repeat">str_repeat</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$tab_width</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2962"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2963"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$key</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$n</span>&nbsp;=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$key</span>&nbsp;<&nbsp;<span class="src-var">$n</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$key</span>++<span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2964"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$line</span>&nbsp;=&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2965"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\t&quot;</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2966"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2967"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2968"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a2969"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pos</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2970"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$length</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2971"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;reduce&nbsp;memory</span></span></div></li>
-<li><div class="src-line"><a name="a2972"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a2973"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$IN_TAG</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2974"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$length</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2975"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char</span>&nbsp;=&nbsp;<span class="src-var">$line</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2976"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Simple&nbsp;engine&nbsp;to&nbsp;work&nbsp;out&nbsp;whether&nbsp;we're&nbsp;in&nbsp;a&nbsp;tag.</span></span></div></li>
-<li><div class="src-line"><a name="a2977"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;we&nbsp;are&nbsp;we&nbsp;modify&nbsp;$pos.&nbsp;This&nbsp;is&nbsp;so&nbsp;we&nbsp;ignore&nbsp;HTML</span></span></div></li>
-<li><div class="src-line"><a name="a2978"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;in&nbsp;the&nbsp;line&nbsp;and&nbsp;only&nbsp;workout&nbsp;the&nbsp;tab&nbsp;replacement</span></span></div></li>
-<li><div class="src-line"><a name="a2979"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;via&nbsp;the&nbsp;actual&nbsp;content&nbsp;of&nbsp;the&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a2980"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;test&nbsp;could&nbsp;be&nbsp;improved&nbsp;to&nbsp;include&nbsp;strings&nbsp;in&nbsp;the</span></span></div></li>
-<li><div class="src-line"><a name="a2981"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;html&nbsp;so&nbsp;that&nbsp;&lt;&nbsp;or&nbsp;&gt;&nbsp;would&nbsp;be&nbsp;allowed&nbsp;in&nbsp;user's&nbsp;styles</span></span></div></li>
-<li><div class="src-line"><a name="a2982"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;(e.g.&nbsp;quotes:&nbsp;'&lt;'&nbsp;'&gt;';&nbsp;or&nbsp;similar)</span></span></div></li>
-<li><div class="src-line"><a name="a2983"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$IN_TAG</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2984"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-str">'&gt;'</span>&nbsp;==&nbsp;<span class="src-var">$char</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2985"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$IN_TAG</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2986"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2987"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$char</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2988"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-str">'&lt;'</span>&nbsp;==&nbsp;<span class="src-var">$char</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2989"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$IN_TAG</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2990"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2991"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-str">'&amp;'</span>&nbsp;==&nbsp;<span class="src-var">$char</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2992"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$substr</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">3</span><span class="src-sym">,</span>&nbsp;<span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2993"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$posi</span>&nbsp;=&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$substr</span><span class="src-sym">,</span>&nbsp;<span class="src-str">';'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2994"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<span class="src-var">$posi</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2995"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2996"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a2997"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pos</span>&nbsp;-=&nbsp;<span class="src-var">$posi</span>+<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a2998"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a2999"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$char</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3000"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-str">&quot;\t&quot;</span>&nbsp;==&nbsp;<span class="src-var">$char</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3001"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3002"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;OPTIMISE&nbsp;-&nbsp;move&nbsp;$strs&nbsp;out.&nbsp;Make&nbsp;an&nbsp;array:</span></span></div></li>
-<li><div class="src-line"><a name="a3003"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$tabs&nbsp;=&nbsp;array(</span></span></div></li>
-<li><div class="src-line"><a name="a3004"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;1&nbsp;=&gt;&nbsp;'&amp;nbsp;',</span></span></div></li>
-<li><div class="src-line"><a name="a3005"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;2&nbsp;=&gt;&nbsp;'&amp;nbsp;&nbsp;',</span></span></div></li>
-<li><div class="src-line"><a name="a3006"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;3&nbsp;=&gt;&nbsp;'&amp;nbsp;&nbsp;&amp;nbsp;'&nbsp;etc&nbsp;etc</span></span></div></li>
-<li><div class="src-line"><a name="a3007"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;to&nbsp;use&nbsp;instead&nbsp;of&nbsp;building&nbsp;a&nbsp;string&nbsp;every&nbsp;time</span></span></div></li>
-<li><div class="src-line"><a name="a3008"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tab_end_width</span>&nbsp;=&nbsp;<span class="src-var">$tab_width</span>&nbsp;-&nbsp;<span class="src-sym">(</span><span class="src-var">$pos</span>&nbsp;%&nbsp;<span class="src-var">$tab_width</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//Moved&nbsp;out&nbsp;of&nbsp;the&nbsp;look&nbsp;as&nbsp;it&nbsp;doesn't&nbsp;change&nbsp;within&nbsp;the&nbsp;loop</span></span></div></li>
-<li><div class="src-line"><a name="a3009"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">((</span><span class="src-var">$pos</span>&nbsp;<span class="src-sym">&</span>&nbsp;<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;||&nbsp;<span class="src-num">1</span>&nbsp;==&nbsp;<span class="src-var">$tab_end_width</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3010"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str</span>&nbsp;.=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$tab_string</span><span class="src-sym">,</span>&nbsp;<span class="src-num">6</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$tab_end_width</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3011"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3012"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$str</span>&nbsp;.=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$tab_string</span><span class="src-sym">,</span>&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$tab_end_width</span>+<span class="src-num">5</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3013"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3014"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$str</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3015"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pos</span>&nbsp;+=&nbsp;<span class="src-var">$tab_end_width</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3016"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3017"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;===&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;\t&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3018"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3019"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3020"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3021"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-num">0</span>&nbsp;==&nbsp;<span class="src-var">$pos</span>&nbsp;&amp;&amp;&nbsp;<span class="src-str">'&nbsp;'</span>&nbsp;==&nbsp;<span class="src-var">$char</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3022"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-str">'&amp;nbsp;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3023"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3024"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3025"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$lines</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.=&nbsp;<span class="src-var">$char</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3026"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$pos</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3027"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3028"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3029"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3030"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$lines</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3031"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$lines</span><span class="src-sym">)</span><span class="src-sym">;</span><span class="src-comm">//We&nbsp;don't&nbsp;need&nbsp;the&nbsp;lines&nbsp;separated&nbsp;beyond&nbsp;this&nbsp;---&nbsp;free&nbsp;them!</span></span></div></li>
-<li><div class="src-line"><a name="a3032"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3033"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Other&nbsp;whitespace</span></span></div></li>
-<li><div class="src-line"><a name="a3034"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;BenBE:&nbsp;Fix&nbsp;to&nbsp;reduce&nbsp;the&nbsp;number&nbsp;of&nbsp;replacements&nbsp;to&nbsp;be&nbsp;done</span></span></div></li>
-<li><div class="src-line"><a name="a3035"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'/^&nbsp;/m'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&amp;nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3036"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&nbsp;&nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&nbsp;&amp;nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3037"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3038"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3039"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_ending</span>&nbsp;===&nbsp;<span class="src-id">null</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3040"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<a href="http://www.php.net/nl2br">nl2br</a><span class="src-sym">(</span><span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3041"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3042"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$result</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_ending</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$result</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3043"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3044"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3045"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3046"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3047"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a3048"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Changes&nbsp;the&nbsp;case&nbsp;of&nbsp;a&nbsp;keyword&nbsp;for&nbsp;those&nbsp;languages&nbsp;where&nbsp;a&nbsp;change&nbsp;is&nbsp;asked&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a3049"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3050"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;keyword&nbsp;to&nbsp;change&nbsp;the&nbsp;case&nbsp;of</span></div></li>
-<li><div class="src-line"><a name="a3051"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;keyword&nbsp;with&nbsp;its&nbsp;case&nbsp;changed</span></div></li>
-<li><div class="src-line"><a name="a3052"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a3053"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3054"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a3055"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">change_case</span><span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3056"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3057"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_CAPS_UPPER&quot;&gt;GESHI_CAPS_UPPER&lt;/a&gt;</span>:</span></div></li>
-<li><div class="src-line"><a name="a3058"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3059"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_CAPS_LOWER&quot;&gt;GESHI_CAPS_LOWER&lt;/a&gt;</span>:</span></div></li>
-<li><div class="src-line"><a name="a3060"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3061"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">default</span>:</span></div></li>
-<li><div class="src-line"><a name="a3062"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$instr</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3063"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3064"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3065"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3066"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a3067"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Handles&nbsp;replacements&nbsp;of&nbsp;keywords&nbsp;to&nbsp;include&nbsp;markup&nbsp;and&nbsp;links&nbsp;if&nbsp;requested</span></div></li>
-<li><div class="src-line"><a name="a3068"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3069"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc">&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;keyword&nbsp;to&nbsp;add&nbsp;the&nbsp;Markup&nbsp;to</span></div></li>
-<li><div class="src-line"><a name="a3070"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">The&nbsp;</span><span class="src-doc">HTML&nbsp;for&nbsp;the&nbsp;match&nbsp;found</span></div></li>
-<li><div class="src-line"><a name="a3071"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a3072"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3073"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3074"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;&nbsp;&nbsp;Get&nbsp;rid&nbsp;of&nbsp;ender&nbsp;in&nbsp;keyword&nbsp;links</span></div></li>
-<li><div class="src-line"><a name="a3075"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a3076"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">handle_keyword_replace</span><span class="src-sym">(</span><span class="src-var">$match</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3077"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$k</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_kw_replace_group</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3078"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keyword</span>&nbsp;=&nbsp;<span class="src-var">$match</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3079"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3080"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$before</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3081"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$after</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3082"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3083"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">keyword_links</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3084"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Keyword&nbsp;links&nbsp;have&nbsp;been&nbsp;ebabled</span></span></div></li>
-<li><div class="src-line"><a name="a3085"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a3086"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3087"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3088"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;There&nbsp;is&nbsp;a&nbsp;base&nbsp;group&nbsp;for&nbsp;this&nbsp;keyword</span></span></div></li>
-<li><div class="src-line"><a name="a3089"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a3090"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Old&nbsp;system:&nbsp;strtolower</span></span></div></li>
-<li><div class="src-line"><a name="a3091"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$keyword&nbsp;=&nbsp;(&nbsp;$this-&gt;language_data['CASE_SENSITIVE'][$group]&nbsp;)&nbsp;?&nbsp;$keyword&nbsp;:&nbsp;strtolower($keyword);</span></span></div></li>
-<li><div class="src-line"><a name="a3092"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;New&nbsp;system:&nbsp;get&nbsp;keyword&nbsp;from&nbsp;language&nbsp;file&nbsp;to&nbsp;get&nbsp;correct&nbsp;case</span></span></div></li>
-<li><div class="src-line"><a name="a3093"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3094"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'{FNAME}'</span><span class="src-sym">)</span>&nbsp;!==&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3095"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$word</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3096"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strcasecmp">strcasecmp</a><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$keyword</span><span class="src-sym">)</span>&nbsp;==&nbsp;<span class="src-num">0</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3097"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3098"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3099"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3100"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3101"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$word</span>&nbsp;=&nbsp;<span class="src-var">$keyword</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3102"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3103"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3104"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$before</span>&nbsp;=&nbsp;<span class="src-str">'&lt;|UR1|&quot;'</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a3105"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a3106"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a3107"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'{FNAME}'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3108"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'{FNAMEL}'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3109"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'{FNAMEU}'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3110"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'.'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3111"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a3112"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'+'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'%20'</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/urlencode">urlencode</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">)))</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3113"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'+'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'%20'</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/urlencode">urlencode</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">))))</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3114"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'+'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'%20'</span><span class="src-sym">,</span>&nbsp;<a href="http://www.php.net/urlencode">urlencode</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$word</span><span class="src-sym">))))</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3115"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;DOT&gt;'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3116"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'URLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span></span></div></li>
-<li><div class="src-line"><a name="a3117"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3118"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$after</span>&nbsp;=&nbsp;<span class="src-str">'&lt;/a&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3119"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3120"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3121"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3122"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$before</span>&nbsp;.&nbsp;<span class="src-str">'&lt;|/'</span>.&nbsp;<span class="src-var">$k</span>&nbsp;.<span class="src-str">'/&gt;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">change_case</span><span class="src-sym">(</span><span class="src-var">$keyword</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'|&gt;'</span>&nbsp;.&nbsp;<span class="src-var">$after</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3123"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3124"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3125"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a3126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;handles&nbsp;regular&nbsp;expressions&nbsp;highlighting-definitions&nbsp;with&nbsp;callback&nbsp;functions</span></div></li>
-<li><div class="src-line"><a name="a3127"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@note</span><span class="src-doc">&nbsp;this&nbsp;is&nbsp;a&nbsp;callback,&nbsp;don't&nbsp;use&nbsp;it&nbsp;directly</span></div></li>
-<li><div class="src-line"><a name="a3129"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3130"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">the&nbsp;matches&nbsp;array</span></div></li>
-<li><div class="src-line"><a name="a3131"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">The&nbsp;</span><span class="src-doc">highlighted&nbsp;string</span></div></li>
-<li><div class="src-line"><a name="a3132"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a3133"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3134"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a3135"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">handle_regexps_callback</span><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3136"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;before:&nbsp;&quot;'&nbsp;style=\&quot;'&nbsp;.&nbsp;call_user_func(\&quot;$func\&quot;,&nbsp;'\\1')&nbsp;.&nbsp;'\&quot;\\1|&gt;'&quot;,</span></span></div></li>
-<li><div class="src-line"><a name="a3137"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<a href="http://www.php.net/call_user_func">call_user_func</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_rx_key</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span>.&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'|&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3138"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3139"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3140"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a3141"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;handles&nbsp;newlines&nbsp;in&nbsp;REGEXPS&nbsp;matches.&nbsp;Set&nbsp;the&nbsp;_hmr_*&nbsp;vars&nbsp;before&nbsp;calling&nbsp;this</span></div></li>
-<li><div class="src-line"><a name="a3142"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3143"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@note</span><span class="src-doc">&nbsp;this&nbsp;is&nbsp;a&nbsp;callback,&nbsp;don't&nbsp;use&nbsp;it&nbsp;directly</span></div></li>
-<li><div class="src-line"><a name="a3144"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3145"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc">the&nbsp;matches&nbsp;array</span></div></li>
-<li><div class="src-line"><a name="a3146"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">string&nbsp;</span></div></li>
-<li><div class="src-line"><a name="a3147"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a3148"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3149"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a3150"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">handle_multiline_regexps</span><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3151"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$before</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_before</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3152"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$after</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_after</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3153"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_replace</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3154"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replace</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_replace</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3155"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$search</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3156"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3157"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$k</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3158"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$search</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'\\'</span>&nbsp;.&nbsp;<span class="src-var">$k</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3159"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3160"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3161"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$before</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-var">$search</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$before</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3162"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$after</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-var">$search</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$after</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3163"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replace</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-var">$search</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$matches</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$replace</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3164"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3165"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replace</span>&nbsp;=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3166"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3167"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$before</span></span></div></li>
-<li><div class="src-line"><a name="a3168"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;<span class="src-str">'&lt;|!REG3XP'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_key</span>&nbsp;.<span class="src-str">'!&gt;'</span></span></div></li>
-<li><div class="src-line"><a name="a3169"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">&quot;|&gt;\n&lt;|!REG3XP&quot;</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_key</span>&nbsp;.&nbsp;<span class="src-str">'!&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$replace</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a3170"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;<span class="src-str">'|&gt;'</span></span></div></li>
-<li><div class="src-line"><a name="a3171"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;<span class="src-var">$after</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3172"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3173"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3174"></a><span class="src-doc">/**</span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;</span></span></div></li>
-<li><div class="src-line"><a name="a3175"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Takes&nbsp;a&nbsp;string&nbsp;that&nbsp;has&nbsp;no&nbsp;strings&nbsp;or&nbsp;comments&nbsp;in&nbsp;it,&nbsp;and&nbsp;highlights</span></div></li>
-<li><div class="src-line"><a name="a3176"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;stuff&nbsp;like&nbsp;keywords,&nbsp;numbers&nbsp;and&nbsp;methods.</span></div></li>
-<li><div class="src-line"><a name="a3177"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3178"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc">The&nbsp;string&nbsp;to&nbsp;parse&nbsp;for&nbsp;keyword,&nbsp;numbers&nbsp;etc.</span></div></li>
-<li><div class="src-line"><a name="a3179"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@since</span><span class="src-doc">&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a3180"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@access</span><span class="src-doc">&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3181"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@todo</span><span class="src-doc">&nbsp;BUGGY!&nbsp;Why?&nbsp;Why&nbsp;not&nbsp;build&nbsp;string&nbsp;and&nbsp;return?</span></div></li>
-<li><div class="src-line"><a name="a3182"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span><span class="src-str"></span></span></div></li>
-<li><div class="src-line"><a name="a3183"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">parse_non_string_part</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3184"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3185"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3186"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Regular&nbsp;expressions</span></span></div></li>
-<li><div class="src-line"><a name="a3187"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$regexp</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3188"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3189"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3190"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3191"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;produce&nbsp;valid&nbsp;HTML&nbsp;when&nbsp;we&nbsp;match&nbsp;multiple&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3192"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_replace</span>&nbsp;=&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_REPLACE</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3193"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_before</span>&nbsp;=&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_BEFORE</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3194"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_key</span>&nbsp;=&nbsp;<span class="src-var">$key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3195"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_after</span>&nbsp;=&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_AFTER</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3196"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace_callback">preg_replace_callback</a><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a3197"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;/&quot;</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_SEARCH</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">"</span></span>/{<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_MODIFIERS</span><span class="src-sym">]</span><span class="src-sym">}</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3198"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'handle_multiline_regexps'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3199"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3200"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_replace</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3201"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_before</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3202"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_after</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3203"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3204"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a3205"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'/'</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_SEARCH</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'/'</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_MODIFIERS</span><span class="src-sym">]</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3206"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_BEFORE</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&lt;|!REG3XP'</span>.&nbsp;<span class="src-var">$key</span>&nbsp;.<span class="src-str">'!&gt;'</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_REPLACE</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'|&gt;'</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span><span class="src-sym">[</span><span class="src-id">GESHI_AFTER</span><span class="src-sym">]</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3207"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3208"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3209"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3210"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3211"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;produce&nbsp;valid&nbsp;HTML&nbsp;when&nbsp;we&nbsp;match&nbsp;multiple&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3212"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_key</span>&nbsp;=&nbsp;<span class="src-var">$key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3213"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace_callback">preg_replace_callback</a><span class="src-sym">(</span>&nbsp;<span class="src-str">&quot;/(&quot;</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span>&nbsp;.&nbsp;<span class="src-str">&quot;)/&quot;</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3214"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'handle_multiline_regexps'</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3215"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_hmr_key</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3216"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3217"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span>&nbsp;<span class="src-str">&quot;/(&quot;</span>&nbsp;.&nbsp;<span class="src-var">$regexp</span>&nbsp;.&nbsp;<span class="src-str">&quot;)/&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;|!REG3XP<span class="src-var">$key</span>!&gt;\\1|&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3218"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3219"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3220"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3221"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3222"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3223"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Highlight&nbsp;numbers.&nbsp;As&nbsp;of&nbsp;1.0.8&nbsp;we&nbsp;support&nbsp;diffent&nbsp;types&nbsp;of&nbsp;numbers</span></span></div></li>
-<li><div class="src-line"><a name="a3224"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$numbers_found</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3225"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<a href="http://www.php.net/preg_match">preg_match</a><span class="src-sym">(</span><span class="src-str">'#\d#'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;<span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3226"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$numbers_found</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3227"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3228"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//For&nbsp;each&nbsp;of&nbsp;the&nbsp;formats&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3229"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_RXCACHE'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$id</span>&nbsp;=&gt;&nbsp;<span class="src-var">$regexp</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3230"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;it&nbsp;should&nbsp;be&nbsp;highlighted&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3231"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-var">$regexp</span><span class="src-sym">,</span>&nbsp;<span class="src-str">"</span></span>&lt;|/NUM!<span class="src-var">$id</span>/&gt;\\1|&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3232"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3233"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3234"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3235"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Highlight&nbsp;keywords</span></span></div></li>
-<li><div class="src-line"><a name="a3236"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_before</span>&nbsp;=&nbsp;<span class="src-str">&quot;(?&lt;![a-zA-Z0-9\$_\|\#;&gt;|^&amp;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3237"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_after</span>&nbsp;=&nbsp;<span class="src-str">&quot;(?![a-zA-Z0-9_\|%\\-&amp;;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3238"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3239"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$quotemarks</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span><a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'QUOTEMARKS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3240"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_before</span>&nbsp;.=&nbsp;<span class="src-var">$quotemarks</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3241"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_after</span>&nbsp;.=&nbsp;<span class="src-var">$quotemarks</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3242"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3243"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_before</span>&nbsp;.=&nbsp;<span class="src-str">&quot;])&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3244"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_after</span>&nbsp;.=&nbsp;<span class="src-str">&quot;])&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3245"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3246"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser_control_pergroup</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3247"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3248"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3249"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$x</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;check&nbsp;wether&nbsp;per-keyword-group&nbsp;parser_control&nbsp;is&nbsp;enabled</span></span></div></li>
-<li><div class="src-line"><a name="a3250"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3251"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_before</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3252"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$x</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3253"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3254"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_AFTER'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3255"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_after</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_AFTER'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3256"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$x</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3257"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3258"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser_control_pergroup</span>&nbsp;=&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;-&nbsp;<span class="src-var">$x</span><span class="src-sym">)</span>&nbsp;>&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3259"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3260"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3261"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3262"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;this&nbsp;is&nbsp;changed,&nbsp;don't&nbsp;forget&nbsp;to&nbsp;change&nbsp;it&nbsp;below</span></span></div></li>
-<li><div class="src-line"><a name="a3263"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!empty($disallowed_before))&nbsp;{</span></span></div></li>
-<li><div class="src-line"><a name="a3264"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$disallowed_before&nbsp;=&nbsp;&quot;(?&lt;![$disallowed_before])&quot;;</span></span></div></li>
-<li><div class="src-line"><a name="a3265"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div></li>
-<li><div class="src-line"><a name="a3266"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!empty($disallowed_after))&nbsp;{</span></span></div></li>
-<li><div class="src-line"><a name="a3267"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$disallowed_after&nbsp;=&nbsp;&quot;(?![$disallowed_after])&quot;;</span></span></div></li>
-<li><div class="src-line"><a name="a3268"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div></li>
-<li><div class="src-line"><a name="a3269"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a3270"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$k</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3271"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a3272"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3273"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3274"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$case_sensitive</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CASE_SENSITIVE'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3275"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$modifiers</span>&nbsp;=&nbsp;<span class="src-var">$case_sensitive</span>&nbsp;?&nbsp;<span class="src-str">''</span>&nbsp;:&nbsp;<span class="src-str">'i'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3276"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3277"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;NEW&nbsp;in&nbsp;1.0.8&nbsp;-&nbsp;per-keyword-group&nbsp;parser&nbsp;control</span></span></div></li>
-<li><div class="src-line"><a name="a3278"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_before_local</span>&nbsp;=&nbsp;<span class="src-var">$disallowed_before</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3279"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_after_local</span>&nbsp;=&nbsp;<span class="src-var">$disallowed_after</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3280"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$parser_control_pergroup</span>&nbsp;&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3281"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3282"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_before_local</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a3283"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3284"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3285"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3286"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_AFTER'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3287"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$disallowed_after_local</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a3288"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'DISALLOWED_AFTER'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3289"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3290"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3291"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3292"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_kw_replace_group</span>&nbsp;=&nbsp;<span class="src-var">$k</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3293"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3294"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//NEW&nbsp;in&nbsp;1.0.8,&nbsp;the&nbsp;cached&nbsp;regexp&nbsp;list</span></span></div></li>
-<li><div class="src-line"><a name="a3295"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;since&nbsp;we&nbsp;don't&nbsp;want&nbsp;PHP&nbsp;/&nbsp;PCRE&nbsp;to&nbsp;crash&nbsp;due&nbsp;to&nbsp;too&nbsp;large&nbsp;patterns&nbsp;we&nbsp;split&nbsp;them&nbsp;into&nbsp;smaller&nbsp;chunks</span></span></div></li>
-<li><div class="src-line"><a name="a3296"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$set</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$set_length</span>&nbsp;=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$set</span>&nbsp;<&nbsp;&nbsp;<span class="src-var">$set_length</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$set</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3297"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywordset</span>&nbsp;=<span class="src-sym">&</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHED_KEYWORD_LISTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$set</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3298"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Might&nbsp;make&nbsp;a&nbsp;more&nbsp;unique&nbsp;string&nbsp;for&nbsp;putting&nbsp;the&nbsp;number&nbsp;in&nbsp;soon</span></span></div></li>
-<li><div class="src-line"><a name="a3299"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Basically,&nbsp;we&nbsp;don't&nbsp;put&nbsp;the&nbsp;styles&nbsp;in&nbsp;yet&nbsp;because&nbsp;then&nbsp;the&nbsp;styles&nbsp;themselves&nbsp;will</span></span></div></li>
-<li><div class="src-line"><a name="a3300"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;get&nbsp;highlighted&nbsp;if&nbsp;the&nbsp;language&nbsp;has&nbsp;a&nbsp;CSS&nbsp;keyword&nbsp;in&nbsp;it&nbsp;(like&nbsp;CSS,&nbsp;for&nbsp;example&nbsp;;))</span></span></div></li>
-<li><div class="src-line"><a name="a3301"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace_callback">preg_replace_callback</a><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a3302"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">"</span></span>/<span class="src-var">$disallowed_before_local</span>({<span class="src-var">$keywordset</span><span class="src-sym">}</span>)(?!\&lt;DOT\&gt;(?:htm|php))<span class="src-var">$disallowed_after_local</span>/<span class="src-var">$modifiers</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3303"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'handle_keyword_replace'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3304"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span></span></div></li>
-<li><div class="src-line"><a name="a3305"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3306"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3307"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3308"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3309"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3310"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a3311"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Now&nbsp;that's&nbsp;all&nbsp;done,&nbsp;replace&nbsp;/[number]/&nbsp;with&nbsp;the&nbsp;correct&nbsp;styles</span></span></div></li>
-<li><div class="src-line"><a name="a3312"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a3313"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$k</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3314"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3315"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a3316"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;?</span></div></li>
-<li><div class="src-line"><a name="a3317"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$k</span><span class="src-sym">]</span>&nbsp;:&nbsp;<span class="src-str">&quot;&quot;</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3318"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3319"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;kw'</span>&nbsp;.&nbsp;<span class="src-var">$k</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3320"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3321"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">"</span></span>&lt;|/<span class="src-var">$k</span>/&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;</span><span class="src-str">&quot;</span>&lt;|<span class="src-var">$attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3322"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3323"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3324"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$numbers_found</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3325"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Put&nbsp;number&nbsp;styles&nbsp;in</span></span></div></li>
-<li><div class="src-line"><a name="a3326"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_RXCACHE'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$id</span>&nbsp;=&gt;&nbsp;<span class="src-var">$regexp</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3327"></a></span><span class="src-str"><span class="src-comm">//Commented&nbsp;out&nbsp;for&nbsp;now,&nbsp;as&nbsp;this&nbsp;needs&nbsp;some&nbsp;review&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3328"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;($numbers_permissions&nbsp;&amp;&nbsp;$id)&nbsp;{</span></span></div></li>
-<li><div class="src-line"><a name="a3329"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;the&nbsp;appropriate&nbsp;style&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3330"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Checking&nbsp;for&nbsp;unset&nbsp;styles&nbsp;is&nbsp;done&nbsp;by&nbsp;the&nbsp;style&nbsp;cache&nbsp;builder&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3331"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3332"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$id</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3333"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3334"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;nu'</span>.<span class="src-var">$id</span>.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3335"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3336"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3337"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Set&nbsp;in&nbsp;the&nbsp;correct&nbsp;styles&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3338"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">"</span></span>/NUM!<span class="src-var">$id</span>/<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$attributes</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3339"></a></span><span class="src-str"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span></div></li>
-<li><div class="src-line"><a name="a3340"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3341"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3342"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3343"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Highlight&nbsp;methods&nbsp;and&nbsp;fields&nbsp;in&nbsp;objects</span></span></div></li>
-<li><div class="src-line"><a name="a3344"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3345"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oolang_spaces</span>&nbsp;=&nbsp;<span class="src-str">&quot;[\s]*&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3346"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oolang_before</span>&nbsp;=&nbsp;<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3347"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oolang_after</span>&nbsp;=&nbsp;<span class="src-str">&quot;[a-zA-Z][a-zA-Z0-9_]*&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3348"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3349"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3350"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MATCH_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3351"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oolang_before</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MATCH_BEFORE'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3352"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3353"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MATCH_AFTER'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3354"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oolang_after</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MATCH_AFTER'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3355"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3356"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MATCH_SPACES'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3357"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$oolang_spaces</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'OOLANG'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'MATCH_SPACES'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3358"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3359"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3360"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3361"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3362"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'OBJECT_SPLITTERS'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$splitter</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3363"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">false</span>&nbsp;!==&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$splitter</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3364"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3365"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3366"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3367"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;me'</span>&nbsp;.&nbsp;<span class="src-var">$key</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3368"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3369"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">"</span></span>/(<span class="src-var">$oolang_before</span>)(<span class="src-str">&quot;&nbsp;</span><span class="src-str">.&nbsp;<span class="src-id">preg_quote</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'OBJECT_SPLITTERS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'/'</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">"</span></span>)(<span class="src-var">$oolang_spaces</span>)(<span class="src-var">$oolang_after</span>)/<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;</span><span class="src-str">&quot;</span>\\1\\2\\3&lt;|<span class="src-var">$attributes</span>&gt;\\4|&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3370"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3371"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3372"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3373"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3374"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a3375"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Highlight&nbsp;brackets.&nbsp;Yes,&nbsp;I've&nbsp;tried&nbsp;adding&nbsp;a&nbsp;semi-colon&nbsp;to&nbsp;this&nbsp;list.</span></span></div></li>
-<li><div class="src-line"><a name="a3376"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;You&nbsp;try&nbsp;it,&nbsp;and&nbsp;see&nbsp;what&nbsp;happens&nbsp;;)</span></span></div></li>
-<li><div class="src-line"><a name="a3377"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;TODO:&nbsp;Fix&nbsp;lexic&nbsp;permissions&nbsp;not&nbsp;converting&nbsp;entities&nbsp;if&nbsp;shouldn't</span></span></div></li>
-<li><div class="src-line"><a name="a3378"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;be&nbsp;highlighting&nbsp;regardless</span></span></div></li>
-<li><div class="src-line"><a name="a3379"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a3380"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3381"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHE_BRACKET_MATCH'</span><span class="src-sym">]</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3382"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'CACHE_BRACKET_REPLACE'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3383"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3384"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3385"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3386"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//FIX&nbsp;for&nbsp;symbol&nbsp;highlighting&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3387"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span>&nbsp;&amp;&amp;&nbsp;<span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3388"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Get&nbsp;all&nbsp;matches&nbsp;and&nbsp;throw&nbsp;away&nbsp;those&nbsp;witin&nbsp;a&nbsp;block&nbsp;that&nbsp;is&nbsp;already&nbsp;highlighted...&nbsp;(i.e.&nbsp;matched&nbsp;by&nbsp;a&nbsp;regexp)</span></span></div></li>
-<li><div class="src-line"><a name="a3389"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$n_symbols</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_match_all">preg_match_all</a><span class="src-sym">(</span><span class="src-str">&quot;/&lt;\|(?:&lt;DOT&gt;|[^&gt;])+&gt;(?:(?!\|&gt;).*?)\|&gt;|&lt;\/a&gt;|(?:&quot;</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_SEARCH'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">&quot;)+/&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$pot_symbols</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_OFFSET_CAPTURE</span>&nbsp;|&nbsp;<span class="src-id">PREG_SET_ORDER</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3390"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$global_offset</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3391"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$s_id</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$s_id</span>&nbsp;<&nbsp;<span class="src-var">$n_symbols</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$s_id</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3392"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_match</span>&nbsp;=&nbsp;<span class="src-var">$pot_symbols</span><span class="src-sym">[</span><span class="src-var">$s_id</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3393"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$symbol_match</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;'</span><span class="src-sym">)</span>&nbsp;!==&nbsp;<span class="src-id">false</span>&nbsp;||&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$symbol_match</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&gt;'</span><span class="src-sym">)</span>&nbsp;!==&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3394"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;already&nbsp;highlighted&nbsp;blocks&nbsp;_must_&nbsp;include&nbsp;either&nbsp;&lt;&nbsp;or&nbsp;&gt;</span></span></div></li>
-<li><div class="src-line"><a name="a3395"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;so&nbsp;if&nbsp;this&nbsp;conditional&nbsp;applies,&nbsp;we&nbsp;have&nbsp;to&nbsp;skip&nbsp;this&nbsp;match</span></span></div></li>
-<li><div class="src-line"><a name="a3396"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;BenBE:&nbsp;UNLESS&nbsp;the&nbsp;block&nbsp;contains&nbsp;&lt;SEMI&gt;&nbsp;or&nbsp;&lt;PIPE&gt;</span></span></div></li>
-<li><div class="src-line"><a name="a3397"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$symbol_match</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;SEMI&gt;'</span><span class="src-sym">)</span>&nbsp;===&nbsp;<span class="src-id">false</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3398"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$symbol_match</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;PIPE&gt;'</span><span class="src-sym">)</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3399"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3400"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3401"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3402"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3403"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;we&nbsp;reach&nbsp;this&nbsp;point,&nbsp;we&nbsp;have&nbsp;a&nbsp;valid&nbsp;match&nbsp;which&nbsp;needs&nbsp;to&nbsp;be&nbsp;highlighted</span></span></div></li>
-<li><div class="src-line"><a name="a3404"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a3405"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_length</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$symbol_match</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3406"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_offset</span>&nbsp;=&nbsp;<span class="src-var">$pot_symbols</span><span class="src-sym">[</span><span class="src-var">$s_id</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3407"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$pot_symbols</span><span class="src-sym">[</span><span class="src-var">$s_id</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3408"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_end</span>&nbsp;=&nbsp;<span class="src-var">$symbol_length</span>&nbsp;+&nbsp;<span class="src-var">$symbol_offset</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3409"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;=&nbsp;<span class="src-str">&quot;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3410"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3411"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;we&nbsp;have&nbsp;multiple&nbsp;styles,&nbsp;we&nbsp;have&nbsp;to&nbsp;handle&nbsp;them&nbsp;properly</span></span></div></li>
-<li><div class="src-line"><a name="a3412"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'MULTIPLE_SYMBOL_GROUPS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3413"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$old_sym</span>&nbsp;=&nbsp;-<span class="src-num">1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3414"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Split&nbsp;the&nbsp;current&nbsp;stuff&nbsp;to&nbsp;replace&nbsp;into&nbsp;its&nbsp;atomic&nbsp;symbols&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3415"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/preg_match_all">preg_match_all</a><span class="src-sym">(</span><span class="src-str">&quot;/&quot;</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_SEARCH'</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">&quot;/&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_match</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$sym_match_syms</span><span class="src-sym">,</span>&nbsp;<span class="src-id">PREG_PATTERN_ORDER</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3416"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$sym_match_syms</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$sym_ms</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3417"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;consequtive&nbsp;symbols&nbsp;belong&nbsp;to&nbsp;the&nbsp;same&nbsp;group&nbsp;to&nbsp;save&nbsp;output&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3418"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$sym_ms</span><span class="src-sym">]</span><span class="src-sym">)</span></span></div></li>
-<li><div class="src-line"><a name="a3419"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$sym_ms</span><span class="src-sym">]</span>&nbsp;!=&nbsp;<span class="src-var">$old_sym</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3420"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>-<span class="src-num">1</span>&nbsp;!=&nbsp;<span class="src-var">$old_sym</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3421"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;.=&nbsp;<span class="src-str">&quot;|&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3422"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3423"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$old_sym</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'SYMBOL_DATA'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$sym_ms</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3424"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3425"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$old_sym</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3426"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3427"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;sy'</span>&nbsp;.&nbsp;<span class="src-var">$old_sym</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3428"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3429"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3430"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;.=&nbsp;<span class="src-var">$sym_ms</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3431"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3432"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$sym_match_syms</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3433"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3434"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Close&nbsp;remaining&nbsp;tags&nbsp;and&nbsp;insert&nbsp;the&nbsp;replacement&nbsp;at&nbsp;the&nbsp;right&nbsp;position&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3435"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Take&nbsp;caution&nbsp;if&nbsp;symbol_hl&nbsp;is&nbsp;empty&nbsp;to&nbsp;avoid&nbsp;doubled&nbsp;closing&nbsp;spans.</span></span></div></li>
-<li><div class="src-line"><a name="a3436"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>-<span class="src-num">1</span>&nbsp;!=&nbsp;<span class="src-var">$old_sym</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3437"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;.=&nbsp;<span class="src-str">&quot;|&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3438"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3439"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3440"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3441"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;=&nbsp;<span class="src-str">'&lt;|&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3442"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3443"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;=&nbsp;<span class="src-str">'&lt;|&nbsp;class=&quot;sy0&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3444"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3445"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$symbol_hl</span>&nbsp;.=&nbsp;<span class="src-var">$symbol_match</span>&nbsp;.&nbsp;<span class="src-str">'|&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3446"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3447"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3448"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr_replace">substr_replace</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_hl</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_offset</span>&nbsp;+&nbsp;<span class="src-var">$global_offset</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$symbol_length</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3449"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3450"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;since&nbsp;we&nbsp;replace&nbsp;old&nbsp;text&nbsp;with&nbsp;something&nbsp;of&nbsp;different&nbsp;size,</span></span></div></li>
-<li><div class="src-line"><a name="a3451"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we'll&nbsp;have&nbsp;to&nbsp;keep&nbsp;track&nbsp;of&nbsp;the&nbsp;differences</span></span></div></li>
-<li><div class="src-line"><a name="a3452"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$global_offset</span>&nbsp;+=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$symbol_hl</span><span class="src-sym">)</span>&nbsp;-&nbsp;<span class="src-var">$symbol_length</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3453"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3454"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3455"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//FIX&nbsp;for&nbsp;symbol&nbsp;highlighting&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3456"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a3457"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;class/style&nbsp;for&nbsp;regexps</span></span></div></li>
-<li><div class="src-line"><a name="a3458"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3459"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3460"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_callable">is_callable</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3461"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_rx_key</span>&nbsp;=&nbsp;<span class="src-var">$key</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3462"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace_callback">preg_replace_callback</a><span class="src-sym">(</span><span class="src-str">"</span></span>/!REG3XP<span class="src-var">$key</span>!(.*)\|&gt;/U<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3463"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'handle_regexps_callback'</span><span class="src-sym">)</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a3464"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3465"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3466"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3467"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3468"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3469"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3470"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-id">GESHI_CLASS</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3471"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;'</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a3472"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id">GESHI_CLASS</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3473"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3474"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;re'</span>&nbsp;.&nbsp;<span class="src-var">$key</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3475"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3476"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3477"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">"</span></span>!REG3XP<span class="src-var">$key</span>!<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;</span><span class="src-str">&quot;</span><span class="src-var">$attributes</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3478"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3479"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3480"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3481"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3482"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Replace&nbsp;&lt;DOT&gt;&nbsp;with&nbsp;.&nbsp;for&nbsp;urls</span></span></div></li>
-<li><div class="src-line"><a name="a3483"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<span class="src-id">str_replace</span><span class="src-sym">(</span><span class="src-str">'&lt;DOT&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'.'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3484"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Replace&nbsp;&lt;|UR1|&nbsp;with&nbsp;&lt;a&nbsp;href=&nbsp;for&nbsp;urls&nbsp;also</span></span></div></li>
-<li><div class="src-line"><a name="a3485"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">link_styles</span><span class="src-sym">[</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_LINK&quot;&gt;GESHI_LINK&lt;/a&gt;</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3486"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3487"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|UR1|'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;a'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">link_target</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;href='</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3488"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3489"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|UR1|'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;a'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">link_target</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">link_styles</span><span class="src-sym">[</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_LINK&quot;&gt;GESHI_LINK&lt;/a&gt;</span><span class="src-sym">]</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&nbsp;href='</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3490"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3491"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3492"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|UR1|'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;a'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">link_target</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;href='</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3493"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3494"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3495"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a3496"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;NOW&nbsp;we&nbsp;add&nbsp;the&nbsp;span&nbsp;thingy&nbsp;;)</span></span></div></li>
-<li><div class="src-line"><a name="a3497"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//</span></span></div></li>
-<li><div class="src-line"><a name="a3498"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a3499"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">'&lt;|'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;span'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3500"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a>&nbsp;<span class="src-sym">(</span>&nbsp;<span class="src-str">'|&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$stuff_to_parse</span>&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3501"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$stuff_to_parse</span><span class="src-sym">,</span>&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3502"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3503"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3504"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3505"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Sets&nbsp;the&nbsp;time&nbsp;taken&nbsp;to&nbsp;parse&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a3506"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3507"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;microtime&nbsp;The&nbsp;time&nbsp;when&nbsp;parsing&nbsp;started</span></div></li>
-<li><div class="src-line"><a name="a3508"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;microtime&nbsp;The&nbsp;time&nbsp;when&nbsp;parsing&nbsp;ended</span></div></li>
-<li><div class="src-line"><a name="a3509"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a3510"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3511"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3512"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">set_time</span><span class="src-sym">(</span><span class="src-var">$start_time</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$end_time</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3513"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$start_time</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3514"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$end</span>&nbsp;=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$end_time</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3515"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="http://www.php.net/time">time</a>&nbsp;=&nbsp;<span class="src-var">$end</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;+&nbsp;<span class="src-var">$end</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span>&nbsp;-&nbsp;<span class="src-var">$start</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span>&nbsp;-&nbsp;<span class="src-var">$start</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3516"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3517"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3518"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3519"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;the&nbsp;time&nbsp;taken&nbsp;to&nbsp;parse&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a3520"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3521"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;double&nbsp;The&nbsp;time&nbsp;taken&nbsp;to&nbsp;parse&nbsp;the&nbsp;code</span></div></li>
-<li><div class="src-line"><a name="a3522"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a3523"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3524"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodget_time">get_time</a><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3525"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="http://www.php.net/time">time</a><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3526"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3527"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3528"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3529"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Merges&nbsp;arrays&nbsp;recursively,&nbsp;overwriting&nbsp;values&nbsp;of&nbsp;the&nbsp;first&nbsp;array&nbsp;with&nbsp;values&nbsp;of&nbsp;later&nbsp;arrays</span></div></li>
-<li><div class="src-line"><a name="a3530"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3531"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.8</span></div></li>
-<li><div class="src-line"><a name="a3532"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3533"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3534"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">merge_arrays</span><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3535"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$arrays</span>&nbsp;=&nbsp;<a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3536"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$narrays</span>&nbsp;=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$arrays</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3537"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3538"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;check&nbsp;arguments</span></span></div></li>
-<li><div class="src-line"><a name="a3539"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;comment&nbsp;out&nbsp;if&nbsp;more&nbsp;performance&nbsp;is&nbsp;necessary&nbsp;(in&nbsp;this&nbsp;case&nbsp;the&nbsp;foreach&nbsp;loop&nbsp;will&nbsp;trigger&nbsp;a&nbsp;warning&nbsp;if&nbsp;the&nbsp;argument&nbsp;is&nbsp;not&nbsp;an&nbsp;array)</span></span></div></li>
-<li><div class="src-line"><a name="a3540"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$narrays</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;++<span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3541"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$arrays</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3542"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;also&nbsp;array_merge_recursive&nbsp;returns&nbsp;nothing&nbsp;in&nbsp;this&nbsp;case</span></span></div></li>
-<li><div class="src-line"><a name="a3543"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/trigger_error">trigger_error</a><span class="src-sym">(</span><span class="src-str">'Argument&nbsp;#'</span>&nbsp;.&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>+<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&nbsp;is&nbsp;not&nbsp;an&nbsp;array&nbsp;-&nbsp;trying&nbsp;to&nbsp;merge&nbsp;array&nbsp;with&nbsp;scalar!&nbsp;Returning&nbsp;false!'</span><span class="src-sym">,</span>&nbsp;<span class="src-id">E_USER_WARNING</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3544"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3545"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3546"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3547"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3548"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;first&nbsp;array&nbsp;is&nbsp;in&nbsp;the&nbsp;output&nbsp;set&nbsp;in&nbsp;every&nbsp;case</span></span></div></li>
-<li><div class="src-line"><a name="a3549"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span>&nbsp;=&nbsp;<span class="src-var">$arrays</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3550"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3551"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;merege&nbsp;$ret&nbsp;with&nbsp;the&nbsp;remaining&nbsp;arrays</span></span></div></li>
-<li><div class="src-line"><a name="a3552"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$narrays</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;++<span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3553"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$arrays</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$value</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3554"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3555"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;$ret[$key]&nbsp;is&nbsp;not&nbsp;an&nbsp;array&nbsp;you&nbsp;try&nbsp;to&nbsp;merge&nbsp;an&nbsp;scalar&nbsp;value&nbsp;with&nbsp;an&nbsp;array&nbsp;-&nbsp;the&nbsp;result&nbsp;is&nbsp;not&nbsp;defined&nbsp;(incompatible&nbsp;arrays)</span></span></div></li>
-<li><div class="src-line"><a name="a3556"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;in&nbsp;this&nbsp;case&nbsp;the&nbsp;call&nbsp;will&nbsp;trigger&nbsp;an&nbsp;E_USER_WARNING&nbsp;and&nbsp;the&nbsp;$ret[$key]&nbsp;will&nbsp;be&nbsp;false.</span></span></div></li>
-<li><div class="src-line"><a name="a3557"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">merge_arrays</span><span class="src-sym">(</span><span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3558"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3559"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ret</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$value</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3560"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3561"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3562"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3563"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3564"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$ret</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3565"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3566"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3567"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3568"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Gets&nbsp;language&nbsp;information&nbsp;and&nbsp;stores&nbsp;it&nbsp;for&nbsp;later&nbsp;use</span></div></li>
-<li><div class="src-line"><a name="a3569"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3570"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;The&nbsp;filename&nbsp;of&nbsp;the&nbsp;language&nbsp;file&nbsp;you&nbsp;want&nbsp;to&nbsp;load</span></div></li>
-<li><div class="src-line"><a name="a3571"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a3572"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3573"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@todo&nbsp;Needs&nbsp;to&nbsp;load&nbsp;keys&nbsp;for&nbsp;lexic&nbsp;permissions&nbsp;for&nbsp;keywords,&nbsp;regexps&nbsp;etc</span></div></li>
-<li><div class="src-line"><a name="a3574"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3575"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">load_language</span><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3576"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$file_name</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">loaded_language</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3577"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;file&nbsp;is&nbsp;already&nbsp;loaded!</span></span></div></li>
-<li><div class="src-line"><a name="a3578"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3579"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3580"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3581"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Prepare&nbsp;some&nbsp;stuff&nbsp;before&nbsp;actually&nbsp;loading&nbsp;the&nbsp;language&nbsp;file</span></span></div></li>
-<li><div class="src-line"><a name="a3582"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">loaded_language</span>&nbsp;=&nbsp;<span class="src-var">$file_name</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3583"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">parse_cache_built</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3584"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodenable_highlighting">enable_highlighting</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3585"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$language_data</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3586"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3587"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Load&nbsp;the&nbsp;language&nbsp;file</span></span></div></li>
-<li><div class="src-line"><a name="a3588"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;require&nbsp;<span class="src-var">$file_name</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3589"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3590"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Perhaps&nbsp;some&nbsp;checking&nbsp;might&nbsp;be&nbsp;added&nbsp;here&nbsp;later&nbsp;to&nbsp;check&nbsp;that</span></span></div></li>
-<li><div class="src-line"><a name="a3591"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$language&nbsp;data&nbsp;is&nbsp;a&nbsp;valid&nbsp;thing&nbsp;but&nbsp;maybe&nbsp;not</span></span></div></li>
-<li><div class="src-line"><a name="a3592"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span>&nbsp;=&nbsp;<span class="src-var">$language_data</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3593"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3594"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;strict&nbsp;mode&nbsp;if&nbsp;should&nbsp;be&nbsp;set</span></span></div></li>
-<li><div class="src-line"><a name="a3595"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">strict_mode</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STRICT_MODE_APPLIES'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3596"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3597"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;permissions&nbsp;for&nbsp;all&nbsp;lexics&nbsp;to&nbsp;true</span></span></div></li>
-<li><div class="src-line"><a name="a3598"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;so&nbsp;they'll&nbsp;be&nbsp;highlighted&nbsp;by&nbsp;default</span></span></div></li>
-<li><div class="src-line"><a name="a3599"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3600"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3601"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3602"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3603"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">false</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3604"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3605"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3606"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3607"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_SINGLE'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3608"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3609"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3610"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/array_keys">array_keys</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">)</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3611"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3612"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3613"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3614"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;for&nbsp;BenBE&nbsp;and&nbsp;future&nbsp;code&nbsp;reviews:</span></span></div></li>
-<li><div class="src-line"><a name="a3615"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;can&nbsp;use&nbsp;empty&nbsp;here&nbsp;since&nbsp;we&nbsp;only&nbsp;check&nbsp;for&nbsp;existance&nbsp;and&nbsp;emptiness&nbsp;of&nbsp;an&nbsp;array</span></span></div></li>
-<li><div class="src-line"><a name="a3616"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;if&nbsp;it&nbsp;is&nbsp;not&nbsp;an&nbsp;array&nbsp;at&nbsp;all&nbsp;but&nbsp;rather&nbsp;false&nbsp;or&nbsp;null&nbsp;this&nbsp;will&nbsp;work&nbsp;as&nbsp;intended&nbsp;as&nbsp;well</span></span></div></li>
-<li><div class="src-line"><a name="a3617"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;even&nbsp;if&nbsp;$this-&gt;language_data['PARSER_CONTROL']&nbsp;is&nbsp;undefined&nbsp;this&nbsp;won't&nbsp;trigger&nbsp;a&nbsp;notice</span></span></div></li>
-<li><div class="src-line"><a name="a3618"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ENABLE_FLAGS'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3619"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ENABLE_FLAGS'</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$flag</span>&nbsp;=&gt;&nbsp;<span class="src-var">$value</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3620"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;it's&nbsp;either&nbsp;true&nbsp;or&nbsp;false&nbsp;and&nbsp;maybe&nbsp;is&nbsp;true&nbsp;as&nbsp;well</span></span></div></li>
-<li><div class="src-line"><a name="a3621"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$perm</span>&nbsp;=&nbsp;<span class="src-var">$value</span>&nbsp;!==&nbsp;<span class="src-id">GESHI_NEVER</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3622"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$flag</span>&nbsp;==&nbsp;<span class="src-str">'ALL'</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3623"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodenable_highlighting">enable_highlighting</a><span class="src-sym">(</span><span class="src-var">$perm</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3624"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3625"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3626"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$flag</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3627"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;unknown&nbsp;lexic&nbsp;permission</span></span></div></li>
-<li><div class="src-line"><a name="a3628"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3629"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3630"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$flag</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3631"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$flag</span><span class="src-sym">]</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$val</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3632"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$flag</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$key</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$perm</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3633"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3634"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3635"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-var">$flag</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$perm</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3636"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3637"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3638"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'PARSER_CONTROL'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ENABLE_FLAGS'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3639"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3640"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3641"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//NEW&nbsp;in&nbsp;1.0.8:&nbsp;Allow&nbsp;styles&nbsp;to&nbsp;be&nbsp;loaded&nbsp;from&nbsp;a&nbsp;separate&nbsp;file&nbsp;to&nbsp;override&nbsp;defaults</span></span></div></li>
-<li><div class="src-line"><a name="a3642"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style_filename</span>&nbsp;=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$file_name</span><span class="src-sym">,</span>&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;-<span class="src-num">4</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'.style.php'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3643"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/is_readable">is_readable</a><span class="src-sym">(</span><span class="src-var">$style_filename</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3644"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Clear&nbsp;any&nbsp;style_data&nbsp;that&nbsp;could&nbsp;have&nbsp;been&nbsp;set&nbsp;before&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3645"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$style_data</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3646"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$style_data</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3647"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3648"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3649"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Read&nbsp;the&nbsp;Style&nbsp;Information&nbsp;from&nbsp;the&nbsp;style&nbsp;file</span></span></div></li>
-<li><div class="src-line"><a name="a3650"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-inc">include</span>&nbsp;<span class="src-var">$style_filename</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3651"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3652"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Apply&nbsp;the&nbsp;new&nbsp;styles&nbsp;to&nbsp;our&nbsp;current&nbsp;language&nbsp;styles</span></span></div></li>
-<li><div class="src-line"><a name="a3653"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$style_data</span><span class="src-sym">)</span>&nbsp;&amp;&amp;&nbsp;<a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$style_data</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3654"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span>&nbsp;=</span></div></li>
-<li><div class="src-line"><a name="a3655"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">merge_arrays</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$style_data</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3656"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3657"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3658"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3659"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3660"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3661"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Takes&nbsp;the&nbsp;parsed&nbsp;code&nbsp;and&nbsp;various&nbsp;options,&nbsp;and&nbsp;creates&nbsp;the&nbsp;HTML</span></div></li>
-<li><div class="src-line"><a name="a3662"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;surrounding&nbsp;it&nbsp;to&nbsp;make&nbsp;it&nbsp;look&nbsp;nice.</span></div></li>
-<li><div class="src-line"><a name="a3663"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3664"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;string&nbsp;The&nbsp;code&nbsp;already&nbsp;parsed&nbsp;(reference!)</span></div></li>
-<li><div class="src-line"><a name="a3665"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a3666"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3667"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3668"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">finalise</span><span class="src-sym">(</span><span class="src-sym">&</span><span class="src-var">$parsed_code</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3669"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Remove&nbsp;end&nbsp;parts&nbsp;of&nbsp;important&nbsp;declarations</span></span></div></li>
-<li><div class="src-line"><a name="a3670"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;is&nbsp;BUGGY!!&nbsp;My&nbsp;fault&nbsp;for&nbsp;bad&nbsp;code:&nbsp;fix&nbsp;coming&nbsp;in&nbsp;1.2</span></span></div></li>
-<li><div class="src-line"><a name="a3671"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;@todo&nbsp;Remove&nbsp;this&nbsp;crap</span></span></div></li>
-<li><div class="src-line"><a name="a3672"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodenable_important_blocks">enable_important_blocks</a>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3673"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strpos">strpos</a><span class="src-sym">(</span><span class="src-var">$parsed_code</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT&quot;&gt;GESHI_START_IMPORTANT&lt;/a&gt;</span><span class="src-sym">))</span>&nbsp;===&nbsp;<span class="src-id">false</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3674"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_END_IMPORTANT&quot;&gt;GESHI_END_IMPORTANT&lt;/a&gt;</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$parsed_code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3675"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3676"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3677"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;HTML&nbsp;whitespace&nbsp;stuff&nbsp;if&nbsp;we're&nbsp;using&nbsp;the&nbsp;&lt;div&gt;&nbsp;header</span></span></div></li>
-<li><div class="src-line"><a name="a3678"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE&quot;&gt;GESHI_HEADER_PRE&lt;/a&gt;</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3679"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">indent</span><span class="src-sym">(</span><span class="src-var">$parsed_code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3680"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3681"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3682"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;purge&nbsp;some&nbsp;unnecessary&nbsp;stuff</span></span></div></li>
-<li><div class="src-line"><a name="a3683"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/**&nbsp;NOTE:&nbsp;memorypeak&nbsp;#1&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3684"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'#&lt;span[^&gt;]+&gt;(\s*)&lt;/span&gt;#'</span><span class="src-sym">,</span>&nbsp;<span class="src-str">'\\1'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$parsed_code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3685"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3686"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;we&nbsp;are&nbsp;using&nbsp;IDs&nbsp;for&nbsp;line&nbsp;numbers,&nbsp;there&nbsp;needs&nbsp;to&nbsp;be&nbsp;an&nbsp;overall</span></span></div></li>
-<li><div class="src-line"><a name="a3687"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;ID&nbsp;set&nbsp;to&nbsp;prevent&nbsp;collisions.</span></span></div></li>
-<li><div class="src-line"><a name="a3688"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">add_ids</span>&nbsp;&amp;&amp;&nbsp;<span class="src-sym">!</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3689"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span>&nbsp;=&nbsp;<span class="src-str">'geshi-'</span>&nbsp;.&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><a href="http://www.php.net/md5">md5</a><span class="src-sym">(</span><a href="http://www.php.net/microtime">microtime</a><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">,</span>&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-num">4</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3690"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3691"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3692"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Get&nbsp;code&nbsp;into&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3693"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/**&nbsp;NOTE:&nbsp;memorypeak&nbsp;#2&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3694"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code</span>&nbsp;=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$parsed_code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3695"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3696"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3697"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;we're&nbsp;using&nbsp;line&nbsp;numbers,&nbsp;we&nbsp;insert&nbsp;&lt;li&gt;s&nbsp;and&nbsp;appropriate</span></span></div></li>
-<li><div class="src-line"><a name="a3698"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;markup&nbsp;to&nbsp;style&nbsp;them&nbsp;(otherwise&nbsp;we&nbsp;don't&nbsp;need&nbsp;to&nbsp;do&nbsp;anything)</span></span></div></li>
-<li><div class="src-line"><a name="a3699"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE&quot;&gt;GESHI_HEADER_PRE_TABLE&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3700"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;we're&nbsp;using&nbsp;the&nbsp;&lt;pre&gt;&nbsp;header,&nbsp;we&nbsp;shouldn't&nbsp;add&nbsp;newlines&nbsp;because</span></span></div></li>
-<li><div class="src-line"><a name="a3701"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;&lt;pre&gt;&nbsp;will&nbsp;line-break&nbsp;them&nbsp;(and&nbsp;the&nbsp;&lt;li&gt;s&nbsp;already&nbsp;do&nbsp;this&nbsp;for&nbsp;us)</span></span></div></li>
-<li><div class="src-line"><a name="a3702"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ls</span>&nbsp;=&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE&quot;&gt;GESHI_HEADER_PRE&lt;/a&gt;</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-str">&quot;\n&quot;</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3703"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3704"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;vars&nbsp;to&nbsp;defaults&nbsp;for&nbsp;following&nbsp;loop</span></span></div></li>
-<li><div class="src-line"><a name="a3705"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3706"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3707"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Foreach&nbsp;line...</span></span></div></li>
-<li><div class="src-line"><a name="a3708"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$n</span>&nbsp;=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$n</span><span class="src-sym">;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3709"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Reset&nbsp;the&nbsp;attributes&nbsp;for&nbsp;a&nbsp;new&nbsp;line&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a3710"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3711"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3712"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Make&nbsp;lines&nbsp;have&nbsp;at&nbsp;least&nbsp;one&nbsp;space&nbsp;in&nbsp;them&nbsp;if&nbsp;they're&nbsp;empty</span></span></div></li>
-<li><div class="src-line"><a name="a3713"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;BenBE:&nbsp;Checking&nbsp;emptiness&nbsp;using&nbsp;trim&nbsp;instead&nbsp;of&nbsp;relying&nbsp;on&nbsp;blanks</span></span></div></li>
-<li><div class="src-line"><a name="a3714"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-str">''</span>&nbsp;==&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3715"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&amp;nbsp;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3716"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3717"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3718"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;this&nbsp;is&nbsp;a&nbsp;&quot;special&nbsp;line&quot;...</span></span></div></li>
-<li><div class="src-line"><a name="a3719"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS&quot;&gt;GESHI_FANCY_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3720"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;%&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_nth_row</span>&nbsp;==&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_nth_row</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3721"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;the&nbsp;attributes&nbsp;to&nbsp;style&nbsp;the&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3722"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3723"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$attr&nbsp;=&nbsp;'&nbsp;class=&quot;li2&quot;';</span></span></div></li>
-<li><div class="src-line"><a name="a3724"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'class'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'li2'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3725"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$def_attr</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;de2&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3726"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3727"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$attr&nbsp;=&nbsp;'&nbsp;style=&quot;'&nbsp;.&nbsp;$this-&gt;line_style2&nbsp;.&nbsp;'&quot;';</span></span></div></li>
-<li><div class="src-line"><a name="a3728"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_style2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3729"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;style&nbsp;&quot;covers&nbsp;up&quot;&nbsp;the&nbsp;special&nbsp;styles&nbsp;set&nbsp;for&nbsp;special&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3730"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;so&nbsp;that&nbsp;styles&nbsp;applied&nbsp;to&nbsp;special&nbsp;lines&nbsp;don't&nbsp;apply&nbsp;to&nbsp;the&nbsp;actual</span></span></div></li>
-<li><div class="src-line"><a name="a3731"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;code&nbsp;on&nbsp;that&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3732"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$def_attr</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">code_style</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3733"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3734"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3735"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3736"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$attr&nbsp;=&nbsp;'&nbsp;class=&quot;li1&quot;';</span></span></div></li>
-<li><div class="src-line"><a name="a3737"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'class'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'li1'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3738"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$def_attr</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;de1&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3739"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3740"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$attr&nbsp;=&nbsp;'&nbsp;style=&quot;'&nbsp;.&nbsp;$this-&gt;line_style1&nbsp;.&nbsp;'&quot;';</span></span></div></li>
-<li><div class="src-line"><a name="a3741"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_style1</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3742"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$def_attr</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">code_style</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3743"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3744"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3745"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3746"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;which&nbsp;type&nbsp;of&nbsp;tag&nbsp;to&nbsp;insert&nbsp;for&nbsp;this&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3747"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3748"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;pre<span class="src-var">$def_attr</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3749"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$end</span>&nbsp;=&nbsp;<span class="src-str">'&lt;/pre&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3750"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3751"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Span&nbsp;or&nbsp;div?</span></span></div></li>
-<li><div class="src-line"><a name="a3752"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&lt;div<span class="src-var">$def_attr</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3753"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$end</span>&nbsp;=&nbsp;<span class="src-str">'&lt;/div&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3754"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3755"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3756"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3757"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3758"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Are&nbsp;we&nbsp;supposed&nbsp;to&nbsp;use&nbsp;ids?&nbsp;If&nbsp;so,&nbsp;add&nbsp;them</span></span></div></li>
-<li><div class="src-line"><a name="a3759"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">add_ids</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3760"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'id'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">"</span></span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span>-<span class="src-var">$i</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3761"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3762"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3763"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Is&nbsp;this&nbsp;some&nbsp;line&nbsp;with&nbsp;extra&nbsp;styles???</span></span></div></li>
-<li><div class="src-line"><a name="a3764"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">in_array</span><span class="src-sym">(</span><span class="src-var">$i</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3765"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3766"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3767"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'class'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>lx<span class="src-var">$i</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3768"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3769"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'class'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">&quot;ln-xtra&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3770"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3771"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3772"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_push">array_push</a><span class="src-sym">(</span><span class="src-var">$attrs</span><span class="src-sym">[</span><span class="src-str">'style'</span><span class="src-sym">]</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">get_line_style</span><span class="src-sym">(</span><span class="src-var">$i</span><span class="src-sym">))</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3773"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3774"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3775"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3776"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;in&nbsp;the&nbsp;line&nbsp;surrounded&nbsp;by&nbsp;appropriate&nbsp;list&nbsp;HTML</span></span></div></li>
-<li><div class="src-line"><a name="a3777"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr_string</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3778"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$attrs</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$attr</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3779"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr_string</span>&nbsp;.=&nbsp;<span class="src-str">'&nbsp;'</span>&nbsp;.&nbsp;<span class="src-var">$key</span>&nbsp;.&nbsp;<span class="src-str">'=&quot;'</span>&nbsp;.&nbsp;<a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">'&nbsp;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$attr</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3780"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3781"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3782"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;li<span class="src-var">$attr_string</span>&gt;<span class="src-var">$start</span>{<span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span>-<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">}</span><span class="src-var">$end</span>&lt;/li&gt;<span class="src-var">$ls</span><span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3783"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3784"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3785"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3786"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$n</span>&nbsp;=&nbsp;<span class="src-id">count</span><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3787"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3788"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;de1&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3789"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3790"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">code_style</span>&nbsp;.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3791"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3792"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3793"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;pre'</span>.&nbsp;<span class="src-var">$attributes</span>&nbsp;.<span class="src-str">'&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3794"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">elseif</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE&quot;&gt;GESHI_HEADER_PRE_TABLE&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3795"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3796"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3797"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;ln&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3798"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3799"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attrs</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">table_linenumber_style</span>&nbsp;.<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3800"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3801"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;td'</span>.<span class="src-var">$attrs</span>.<span class="src-str">'&gt;&lt;pre'</span>.<span class="src-var">$attributes</span>.<span class="src-str">'&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3802"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;get&nbsp;linenumbers</span></span></div></li>
-<li><div class="src-line"><a name="a3803"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;don't&nbsp;merge&nbsp;it&nbsp;with&nbsp;the&nbsp;for&nbsp;below,&nbsp;since&nbsp;it&nbsp;should&nbsp;be&nbsp;better&nbsp;for</span></span></div></li>
-<li><div class="src-line"><a name="a3804"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;memory&nbsp;consumption&nbsp;this&nbsp;way</span></span></div></li>
-<li><div class="src-line"><a name="a3805"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;@todo:&nbsp;but...&nbsp;actually&nbsp;it&nbsp;would&nbsp;still&nbsp;be&nbsp;somewhat&nbsp;nice&nbsp;to&nbsp;merge&nbsp;the&nbsp;two&nbsp;loops</span></span></div></li>
-<li><div class="src-line"><a name="a3806"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;mem&nbsp;peaks&nbsp;are&nbsp;at&nbsp;different&nbsp;positions</span></span></div></li>
-<li><div class="src-line"><a name="a3807"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$n</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3808"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3809"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;fancy&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3810"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS&quot;&gt;GESHI_FANCY_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3811"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;%&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_nth_row</span>&nbsp;==&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_nth_row</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3812"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;the&nbsp;attributes&nbsp;to&nbsp;style&nbsp;the&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3813"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3814"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;span&nbsp;class=&quot;xtra&nbsp;li2&quot;&gt;&lt;span&nbsp;class=&quot;de2&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3815"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3816"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;style&nbsp;&quot;covers&nbsp;up&quot;&nbsp;the&nbsp;special&nbsp;styles&nbsp;set&nbsp;for&nbsp;special&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3817"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;so&nbsp;that&nbsp;styles&nbsp;applied&nbsp;to&nbsp;special&nbsp;lines&nbsp;don't&nbsp;apply&nbsp;to&nbsp;the&nbsp;actual</span></span></div></li>
-<li><div class="src-line"><a name="a3818"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;code&nbsp;on&nbsp;that&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3819"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;span&nbsp;style=&quot;display:block;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_style2</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;'</span></span></div></li>
-<li><div class="src-line"><a name="a3820"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<span class="src-str">'&lt;span&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">code_style</span>&nbsp;.<span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3821"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3822"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close</span>&nbsp;+=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3823"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3824"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Is&nbsp;this&nbsp;some&nbsp;line&nbsp;with&nbsp;extra&nbsp;styles???</span></span></div></li>
-<li><div class="src-line"><a name="a3825"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3826"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3827"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3828"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span&nbsp;class=\&quot;xtra&nbsp;lx<span class="src-var">$i</span>\&quot;&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3829"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3830"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&lt;span&nbsp;class=\&quot;xtra&nbsp;ln-xtra\&quot;&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3831"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3832"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3833"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&lt;span&nbsp;style=\&quot;display:block;&quot;</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">get_line_style</span><span class="src-sym">(</span><span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">&quot;\&quot;&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3834"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3835"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$close</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3836"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3837"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers_start</span>&nbsp;+&nbsp;<span class="src-var">$i</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3838"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3839"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<a href="http://www.php.net/str_repeat">str_repeat</a><span class="src-sym">(</span><span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3840"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;!=&nbsp;<span class="src-var">$n</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3841"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3842"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3843"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3844"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;/pre&gt;&lt;/td&gt;&lt;td'</span>.<span class="src-var">$attributes</span>.<span class="src-str">'&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3845"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3846"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;pre'</span>.&nbsp;<span class="src-var">$attributes</span>&nbsp;.<span class="src-str">'&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3847"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3848"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;No&nbsp;line&nbsp;numbers,&nbsp;but&nbsp;still&nbsp;need&nbsp;to&nbsp;handle&nbsp;highlighting&nbsp;lines&nbsp;extra.</span></span></div></li>
-<li><div class="src-line"><a name="a3849"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Have&nbsp;to&nbsp;use&nbsp;divs&nbsp;so&nbsp;the&nbsp;full&nbsp;width&nbsp;of&nbsp;the&nbsp;code&nbsp;is&nbsp;highlighted</span></span></div></li>
-<li><div class="src-line"><a name="a3850"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3851"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span>&nbsp;<span class="src-var">$i</span>&nbsp;<&nbsp;<span class="src-var">$n</span><span class="src-sym">;</span>&nbsp;++<span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3852"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Make&nbsp;lines&nbsp;have&nbsp;at&nbsp;least&nbsp;one&nbsp;space&nbsp;in&nbsp;them&nbsp;if&nbsp;they're&nbsp;empty</span></span></div></li>
-<li><div class="src-line"><a name="a3853"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;BenBE:&nbsp;Checking&nbsp;emptiness&nbsp;using&nbsp;trim&nbsp;instead&nbsp;of&nbsp;relying&nbsp;on&nbsp;blanks</span></span></div></li>
-<li><div class="src-line"><a name="a3854"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-str">''</span>&nbsp;==&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3855"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&amp;nbsp;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3856"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3857"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;fancy&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3858"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS&quot;&gt;GESHI_FANCY_LINE_NUMBERS&lt;/a&gt;</span>&nbsp;&amp;&amp;</span></div></li>
-<li><div class="src-line"><a name="a3859"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$i</span>&nbsp;%&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_nth_row</span>&nbsp;==&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_nth_row</span>&nbsp;-&nbsp;<span class="src-num">1</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3860"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;the&nbsp;attributes&nbsp;to&nbsp;style&nbsp;the&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3861"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3862"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;span&nbsp;class=&quot;xtra&nbsp;li2&quot;&gt;&lt;span&nbsp;class=&quot;de2&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3863"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3864"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;style&nbsp;&quot;covers&nbsp;up&quot;&nbsp;the&nbsp;special&nbsp;styles&nbsp;set&nbsp;for&nbsp;special&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a3865"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;so&nbsp;that&nbsp;styles&nbsp;applied&nbsp;to&nbsp;special&nbsp;lines&nbsp;don't&nbsp;apply&nbsp;to&nbsp;the&nbsp;actual</span></span></div></li>
-<li><div class="src-line"><a name="a3866"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;code&nbsp;on&nbsp;that&nbsp;line</span></span></div></li>
-<li><div class="src-line"><a name="a3867"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;span&nbsp;style=&quot;display:block;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_style2</span>&nbsp;.&nbsp;<span class="src-str">'&quot;&gt;'</span></span></div></li>
-<li><div class="src-line"><a name="a3868"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.<span class="src-str">'&lt;span&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">code_style</span>&nbsp;.<span class="src-str">'&quot;&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3869"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3870"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close</span>&nbsp;+=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3871"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3872"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Is&nbsp;this&nbsp;some&nbsp;line&nbsp;with&nbsp;extra&nbsp;styles???</span></span></div></li>
-<li><div class="src-line"><a name="a3873"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">1</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3874"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3875"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3876"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&lt;span&nbsp;class=\&quot;xtra&nbsp;lx<span class="src-var">$i</span>\&quot;&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3877"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3878"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&lt;span&nbsp;class=\&quot;xtra&nbsp;ln-xtra\&quot;&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3879"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3880"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3881"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&lt;span&nbsp;style=\&quot;display:block;&quot;</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">get_line_style</span><span class="src-sym">(</span><span class="src-var">$i</span><span class="src-sym">)</span>&nbsp;.&nbsp;<span class="src-str">&quot;\&quot;&gt;&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3882"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3883"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$close</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3884"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3885"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3886"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3887"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3888"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$close</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3889"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<a href="http://www.php.net/str_repeat">str_repeat</a><span class="src-sym">(</span><span class="src-str">'&lt;/span&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$close</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3890"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close</span>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3891"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3892"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$i</span>&nbsp;+&nbsp;<span class="src-num">1</span>&nbsp;<&nbsp;<span class="src-var">$n</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3893"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">&quot;\n&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3894"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3895"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$code</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3896"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3897"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3898"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span>&nbsp;||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE&quot;&gt;GESHI_HEADER_PRE_TABLE&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3899"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;/pre&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3900"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3901"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE&quot;&gt;GESHI_HEADER_PRE_TABLE&lt;/a&gt;</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3902"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-str">'&lt;/td&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3903"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3904"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3905"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3906"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parsed_code</span>&nbsp;.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">footer</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3907"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3908"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3909"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3910"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Creates&nbsp;the&nbsp;header&nbsp;for&nbsp;the&nbsp;code&nbsp;block&nbsp;(with&nbsp;correct&nbsp;attributes)</span></div></li>
-<li><div class="src-line"><a name="a3911"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3912"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;The&nbsp;header&nbsp;for&nbsp;the&nbsp;code&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a3913"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a3914"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3915"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3916"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="http://www.php.net/header">header</a><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3917"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Get&nbsp;attributes&nbsp;needed</span></span></div></li>
-<li><div class="src-line"><a name="a3918"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3919"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@todo&nbsp;&nbsp;&nbsp;Document&nbsp;behaviour&nbsp;change&nbsp;-&nbsp;class&nbsp;is&nbsp;outputted&nbsp;regardless&nbsp;of&nbsp;whether</span></div></li>
-<li><div class="src-line"><a name="a3920"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;we're&nbsp;using&nbsp;classes&nbsp;or&nbsp;not.&nbsp;Same&nbsp;with&nbsp;style</span></div></li>
-<li><div class="src-line"><a name="a3921"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3922"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3923"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_class</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3924"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;.=&nbsp;<span class="src-str">&quot;&nbsp;&quot;</span>.<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_class</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3925"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3926"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;.=&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3927"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3928"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3929"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span>&nbsp;id=\&quot;{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span><span class="src-sym">}</span>\&quot;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3930"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3931"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_style</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3932"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attributes</span>&nbsp;.=&nbsp;<span class="src-str">'&nbsp;style=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_style</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3933"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3934"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3935"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ol_attributes</span>&nbsp;=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3936"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3937"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers_start</span>&nbsp;!=&nbsp;<span class="src-num">1</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3938"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$ol_attributes</span>&nbsp;.=&nbsp;<span class="src-str">'&nbsp;start=&quot;'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers_start</span>&nbsp;.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3939"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3940"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3941"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Get&nbsp;the&nbsp;header&nbsp;HTML</span></span></div></li>
-<li><div class="src-line"><a name="a3942"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$header</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_content</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3943"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$header</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3944"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE&quot;&gt;GESHI_HEADER_PRE&lt;/a&gt;</span>&nbsp;||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3945"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$header</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$header</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3946"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3947"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$header</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">replace_keywords</span><span class="src-sym">(</span><span class="src-var">$header</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3948"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3949"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3950"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;head&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3951"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3952"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&nbsp;style=\&quot;{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_content_style</span><span class="src-sym">}</span>\&quot;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3953"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3954"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_PRE_TABLE</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3955"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$header</span>&nbsp;=&nbsp;</span><span class="src-str">&quot;</span>&lt;thead&gt;&lt;tr&gt;&lt;td&nbsp;colspan=\&quot;2\&quot;&nbsp;<span class="src-var">$attr</span>&gt;<span class="src-var">$header</span>&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3956"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3957"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$header</span>&nbsp;=&nbsp;</span><span class="src-str">&quot;</span>&lt;div<span class="src-var">$attr</span>&gt;<span class="src-var">$header</span>&lt;/div&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3958"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3959"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3960"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3961"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_HEADER_NONE</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3962"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3963"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;</span><span class="src-str">&quot;</span><span class="src-var">$header</span>&lt;ol<span class="src-var">$attributes$ol_attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3964"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3965"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-var">$header</span>&nbsp;.&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">force_code_block</span>&nbsp;?&nbsp;<span class="src-str">'&lt;div&gt;'</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3966"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3967"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3968"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Work&nbsp;out&nbsp;what&nbsp;to&nbsp;return&nbsp;and&nbsp;do&nbsp;it</span></span></div></li>
-<li><div class="src-line"><a name="a3969"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3970"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE&quot;&gt;GESHI_HEADER_PRE&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3971"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-str">"</span></span>&lt;pre<span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>&lt;ol<span class="src-var">$ol_attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3972"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_DIV</span>&nbsp;||</span></div></li>
-<li><div class="src-line"><a name="a3973"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_PRE_VALID</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3974"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;</span><span class="src-str">&quot;</span>&lt;div<span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>&lt;ol<span class="src-var">$ol_attributes</span>&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3975"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_PRE_TABLE</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3976"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;</span><span class="src-str">&quot;</span>&lt;table<span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span>&lt;tbody&gt;&lt;tr&nbsp;class=\&quot;li1\&quot;&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3977"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3978"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3979"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_PRE</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3980"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;</span><span class="src-str">&quot;</span>&lt;pre<span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span><span class="src-str">&quot;&nbsp;&nbsp;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a3981"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">force_code_block</span>&nbsp;?&nbsp;<span class="src-str">'&lt;div&gt;'</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3982"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3983"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-str">"</span></span>&lt;div<span class="src-var">$attributes</span>&gt;<span class="src-var">$header</span><span class="src-str">&quot;&nbsp;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a3984"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">force_code_block</span>&nbsp;?&nbsp;<span class="src-str">'&lt;div&gt;'</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3985"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3986"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3987"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a3988"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a3989"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a3990"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;the&nbsp;footer&nbsp;for&nbsp;the&nbsp;code&nbsp;block.</span></div></li>
-<li><div class="src-line"><a name="a3991"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a3992"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;The&nbsp;footer&nbsp;for&nbsp;the&nbsp;code&nbsp;block</span></div></li>
-<li><div class="src-line"><a name="a3993"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a3994"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a3995"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a3996"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">footer</span><span class="src-sym">(</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3997"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$footer</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">footer_content</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a3998"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$footer</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a3999"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE&quot;&gt;GESHI_HEADER_PRE&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4000"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$footer</span>&nbsp;=&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-str">&quot;\n&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-str">''</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$footer</span><span class="src-sym">)</span><span class="src-sym">;;</span></span></div></li>
-<li><div class="src-line"><a name="a4001"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4002"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$footer</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">replace_keywords</span><span class="src-sym">(</span><span class="src-var">$footer</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4003"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4004"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">use_classes</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4005"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr</span>&nbsp;=&nbsp;<span class="src-str">'&nbsp;class=&quot;foot&quot;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4006"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4007"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$attr</span>&nbsp;=&nbsp;<span class="src-str">"</span></span>&nbsp;style=\&quot;{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">footer_content_style</span><span class="src-sym">}</span>\&quot;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4008"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4009"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_PRE_TABLE</span>&nbsp;&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">linenumbers</span>&nbsp;!=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4010"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$footer</span>&nbsp;=&nbsp;</span><span class="src-str">&quot;</span>&lt;tfoot&gt;&lt;tr&gt;&lt;td&nbsp;colspan=\&quot;2\&quot;&gt;<span class="src-var">$footer</span>&lt;/td&gt;&lt;/tr&gt;&lt;/tfoot&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4011"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4012"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$footer</span>&nbsp;=&nbsp;</span><span class="src-str">&quot;</span>&lt;div<span class="src-var">$attr</span>&gt;<span class="src-var">$footer</span>&lt;/div&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4013"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4014"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4015"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4016"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-id">GESHI_HEADER_NONE</span>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4017"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span>&nbsp;?&nbsp;<span class="src-str">'&lt;/ol&gt;'</span>&nbsp;.&nbsp;<span class="src-var">$footer</span>&nbsp;:&nbsp;<span class="src-var">$footer</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4018"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4019"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4020"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_DIV&quot;&gt;GESHI_HEADER_DIV&lt;/a&gt;</span>&nbsp;||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID&quot;&gt;GESHI_HEADER_PRE_VALID&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4021"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4022"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-str">"</span></span>&lt;/ol&gt;<span class="src-var">$footer</span>&lt;/div&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4023"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4024"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">force_code_block</span>&nbsp;?&nbsp;<span class="src-str">'&lt;/div&gt;'</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a4025"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">"</span></span><span class="src-var">$footer</span>&lt;/div&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4026"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4027"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">elseif</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_type</span>&nbsp;==&nbsp;<span class="src-id">GESHI_HEADER_PRE_TABLE</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4028"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4029"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;</span><span class="src-str">&quot;</span>&lt;/tr&gt;&lt;/tbody&gt;<span class="src-var">$footer</span>&lt;/table&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4030"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4031"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">force_code_block</span>&nbsp;?&nbsp;<span class="src-str">'&lt;/div&gt;'</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a4032"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">"</span></span><span class="src-var">$footer</span>&lt;/div&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4033"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4034"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4035"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">GESHI_NO_LINE_NUMBERS</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4036"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;</span><span class="src-str">&quot;</span>&lt;/ol&gt;<span class="src-var">$footer</span>&lt;/pre&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4037"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4038"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">force_code_block</span>&nbsp;?&nbsp;<span class="src-str">'&lt;/div&gt;'</span>&nbsp;:&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a4039"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">"</span></span><span class="src-var">$footer</span>&lt;/pre&gt;<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4040"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4041"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4042"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4043"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a4044"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Replaces&nbsp;certain&nbsp;keywords&nbsp;in&nbsp;the&nbsp;header&nbsp;and&nbsp;footer&nbsp;with</span></div></li>
-<li><div class="src-line"><a name="a4045"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;certain&nbsp;configuration&nbsp;values</span></div></li>
-<li><div class="src-line"><a name="a4046"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4047"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;string&nbsp;The&nbsp;header&nbsp;or&nbsp;footer&nbsp;content&nbsp;to&nbsp;do&nbsp;replacement&nbsp;on</span></div></li>
-<li><div class="src-line"><a name="a4048"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;The&nbsp;header&nbsp;or&nbsp;footer&nbsp;with&nbsp;replaced&nbsp;keywords</span></div></li>
-<li><div class="src-line"><a name="a4049"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.2</span></div></li>
-<li><div class="src-line"><a name="a4050"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a4051"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a4052"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">replace_keywords</span><span class="src-sym">(</span><span class="src-var">$instr</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4053"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span>&nbsp;=&nbsp;<span class="src-var">$replacements</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4054"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4055"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&lt;TIME&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4056"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'{TIME}'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4057"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<a href="http://www.php.net/number_format">number_format</a><span class="src-sym">(</span><span class="src-var">$time</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodget_time">get_time</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,</span>&nbsp;<span class="src-num">3</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4058"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4059"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&lt;LANGUAGE&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4060"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'{LANGUAGE}'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4061"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'LANG_NAME'</span><span class="src-sym">]</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4062"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4063"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&lt;VERSION&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4064"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'{VERSION}'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4065"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_VERSION&quot;&gt;GESHI_VERSION&lt;/a&gt;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4066"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4067"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&lt;SPEED&gt;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4068"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$keywords</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'{SPEED}'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4069"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$time</span>&nbsp;&lt;=&nbsp;<span class="src-num">0</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4070"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$speed</span>&nbsp;=&nbsp;<span class="src-str">'N/A'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4071"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4072"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$speed</span>&nbsp;=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">source</span><span class="src-sym">)</span>&nbsp;/&nbsp;<span class="src-var">$time</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4073"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$speed</span>&nbsp;&gt;=&nbsp;<span class="src-num">1024</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4074"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$speed</span>&nbsp;=&nbsp;<a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">&quot;%.2f&nbsp;KB/s&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$speed</span>&nbsp;/&nbsp;<span class="src-num">1024.0</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4075"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4076"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$speed</span>&nbsp;=&nbsp;<a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-str">&quot;%.0f&nbsp;B/s&quot;</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$speed</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4077"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4078"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4079"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$replacements</span><span class="src-sym">[</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-var">$speed</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4080"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4081"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<a href="http://www.php.net/str_replace">str_replace</a><span class="src-sym">(</span><span class="src-var">$keywords</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$replacements</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$instr</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4082"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4083"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4084"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a4085"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Secure&nbsp;replacement&nbsp;for&nbsp;PHP&nbsp;built-in&nbsp;function&nbsp;htmlspecialchars().</span></div></li>
-<li><div class="src-line"><a name="a4086"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4087"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;See&nbsp;ticket&nbsp;#427&nbsp;(http://wush.net/trac/wikka/ticket/427)&nbsp;for&nbsp;the&nbsp;rationale</span></div></li>
-<li><div class="src-line"><a name="a4088"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;this&nbsp;replacement&nbsp;function.</span></div></li>
-<li><div class="src-line"><a name="a4089"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4090"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;INTERFACE&nbsp;for&nbsp;this&nbsp;function&nbsp;is&nbsp;almost&nbsp;the&nbsp;same&nbsp;as&nbsp;that&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a4091"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;htmlspecialchars(),&nbsp;with&nbsp;the&nbsp;same&nbsp;default&nbsp;for&nbsp;quote&nbsp;style;&nbsp;however,&nbsp;there</span></div></li>
-<li><div class="src-line"><a name="a4092"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;is&nbsp;no&nbsp;'charset'&nbsp;parameter.&nbsp;The&nbsp;reason&nbsp;for&nbsp;this&nbsp;is&nbsp;as&nbsp;follows:</span></div></li>
-<li><div class="src-line"><a name="a4093"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4094"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;PHP&nbsp;docs&nbsp;say:</span></div></li>
-<li><div class="src-line"><a name="a4095"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&quot;The&nbsp;third&nbsp;argument&nbsp;charset&nbsp;defines&nbsp;character&nbsp;set&nbsp;used&nbsp;in&nbsp;conversion.&quot;</span></div></li>
-<li><div class="src-line"><a name="a4096"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4097"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;I&nbsp;suspect&nbsp;PHP's&nbsp;htmlspecialchars()&nbsp;is&nbsp;working&nbsp;at&nbsp;the&nbsp;byte-value&nbsp;level&nbsp;and</span></div></li>
-<li><div class="src-line"><a name="a4098"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;thus&nbsp;_needs_&nbsp;to&nbsp;know&nbsp;(or&nbsp;asssume)&nbsp;a&nbsp;character&nbsp;set&nbsp;because&nbsp;the&nbsp;special</span></div></li>
-<li><div class="src-line"><a name="a4099"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;characters&nbsp;to&nbsp;be&nbsp;replaced&nbsp;could&nbsp;exist&nbsp;at&nbsp;different&nbsp;code&nbsp;points&nbsp;in</span></div></li>
-<li><div class="src-line"><a name="a4100"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;different&nbsp;character&nbsp;sets.&nbsp;(If&nbsp;indeed&nbsp;htmlspecialchars()&nbsp;works&nbsp;at</span></div></li>
-<li><div class="src-line"><a name="a4101"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;byte-value&nbsp;level&nbsp;that&nbsp;goes&nbsp;some&nbsp;&nbsp;way&nbsp;towards&nbsp;explaining&nbsp;why&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a4102"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;vulnerability&nbsp;would&nbsp;exist&nbsp;in&nbsp;this&nbsp;function,&nbsp;too,&nbsp;and&nbsp;not&nbsp;only&nbsp;in</span></div></li>
-<li><div class="src-line"><a name="a4103"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;htmlentities()&nbsp;which&nbsp;certainly&nbsp;is&nbsp;working&nbsp;at&nbsp;byte-value&nbsp;level.)</span></div></li>
-<li><div class="src-line"><a name="a4104"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4105"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;replacement&nbsp;function&nbsp;however&nbsp;works&nbsp;at&nbsp;character&nbsp;level&nbsp;and&nbsp;should</span></div></li>
-<li><div class="src-line"><a name="a4106"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;therefore&nbsp;be&nbsp;&quot;immune&quot;&nbsp;to&nbsp;character&nbsp;set&nbsp;differences&nbsp;-&nbsp;so&nbsp;no&nbsp;charset</span></div></li>
-<li><div class="src-line"><a name="a4107"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;parameter&nbsp;is&nbsp;needed&nbsp;or&nbsp;provided.&nbsp;If&nbsp;a&nbsp;third&nbsp;parameter&nbsp;is&nbsp;passed,&nbsp;it&nbsp;will</span></div></li>
-<li><div class="src-line"><a name="a4108"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;be&nbsp;silently&nbsp;ignored.</span></div></li>
-<li><div class="src-line"><a name="a4109"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4110"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;In&nbsp;the&nbsp;OUTPUT&nbsp;there&nbsp;is&nbsp;a&nbsp;minor&nbsp;difference&nbsp;in&nbsp;that&nbsp;we&nbsp;use&nbsp;'&amp;#39;'&nbsp;instead</span></div></li>
-<li><div class="src-line"><a name="a4111"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;of&nbsp;PHP's&nbsp;'&amp;#039;'&nbsp;for&nbsp;a&nbsp;single&nbsp;quote:&nbsp;this&nbsp;provides&nbsp;compatibility&nbsp;with</span></div></li>
-<li><div class="src-line"><a name="a4112"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;get_html_translation_table(HTML_SPECIALCHARS,&nbsp;ENT_QUOTES)</span></div></li>
-<li><div class="src-line"><a name="a4113"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;(see&nbsp;comment&nbsp;by&nbsp;mikiwoz&nbsp;at&nbsp;yahoo&nbsp;dot&nbsp;co&nbsp;dot&nbsp;uk&nbsp;on</span></div></li>
-<li><div class="src-line"><a name="a4114"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;http://php.net/htmlspecialchars);&nbsp;it&nbsp;also&nbsp;matches&nbsp;the&nbsp;entity&nbsp;definition</span></div></li>
-<li><div class="src-line"><a name="a4115"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;for&nbsp;XML&nbsp;1.0</span></div></li>
-<li><div class="src-line"><a name="a4116"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;(http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters).</span></div></li>
-<li><div class="src-line"><a name="a4117"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Like&nbsp;PHP&nbsp;we&nbsp;use&nbsp;a&nbsp;numeric&nbsp;character&nbsp;reference&nbsp;instead&nbsp;of&nbsp;'&amp;apos;'&nbsp;for&nbsp;the</span></div></li>
-<li><div class="src-line"><a name="a4118"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;single&nbsp;quote.&nbsp;For&nbsp;the&nbsp;other&nbsp;special&nbsp;characters&nbsp;we&nbsp;use&nbsp;the&nbsp;named&nbsp;entity</span></div></li>
-<li><div class="src-line"><a name="a4119"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;references,&nbsp;as&nbsp;PHP&nbsp;is&nbsp;doing.</span></div></li>
-<li><div class="src-line"><a name="a4120"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4121"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{@link&nbsp;http://wikkawiki.org/JavaWoman&nbsp;Marjolein&nbsp;Katsma}</span></div></li>
-<li><div class="src-line"><a name="a4122"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4123"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@license&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://www.gnu.org/copyleft/lgpl.html</span></div></li>
-<li><div class="src-line"><a name="a4124"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GNU&nbsp;Lesser&nbsp;General&nbsp;Public&nbsp;License</span></div></li>
-<li><div class="src-line"><a name="a4125"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@copyright&nbsp;&nbsp;&nbsp;Copyright&nbsp;2007,&nbsp;{@link&nbsp;http://wikkawiki.org/CreditsPage</span></div></li>
-<li><div class="src-line"><a name="a4126"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wikka&nbsp;Development&nbsp;Team}</span></div></li>
-<li><div class="src-line"><a name="a4127"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4128"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;private</span></div></li>
-<li><div class="src-line"><a name="a4129"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;$string&nbsp;string&nbsp;to&nbsp;be&nbsp;converted</span></div></li>
-<li><div class="src-line"><a name="a4130"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;integer&nbsp;$quote_style</span></div></li>
-<li><div class="src-line"><a name="a4131"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;ENT_COMPAT:&nbsp;&nbsp;&nbsp;escapes&nbsp;&amp;,&nbsp;&lt;,&nbsp;&gt;&nbsp;and&nbsp;double&nbsp;quote&nbsp;(default)</span></div></li>
-<li><div class="src-line"><a name="a4132"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;ENT_NOQUOTES:&nbsp;escapes&nbsp;only&nbsp;&amp;,&nbsp;&lt;&nbsp;and&nbsp;&gt;</span></div></li>
-<li><div class="src-line"><a name="a4133"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;ENT_QUOTES:&nbsp;&nbsp;&nbsp;escapes&nbsp;&amp;,&nbsp;&lt;,&nbsp;&gt;,&nbsp;double&nbsp;and&nbsp;single&nbsp;quotes</span></div></li>
-<li><div class="src-line"><a name="a4134"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;string&nbsp;&nbsp;converted&nbsp;string</span></div></li>
-<li><div class="src-line"><a name="a4135"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.0.7.18</span></div></li>
-<li><div class="src-line"><a name="a4136"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a4137"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<span class="src-id">hsc</span><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$quote_style</span>&nbsp;=&nbsp;<span class="src-id">ENT_COMPAT</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4138"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;init</span></span></div></li>
-<li><div class="src-line"><a name="a4139"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static</span>&nbsp;<span class="src-var">$aTransSpecchar</span>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></span></div></li>
-<li><div class="src-line"><a name="a4140"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&amp;'</span>&nbsp;=&gt;&nbsp;<span class="src-str">'&amp;amp;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a4141"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&quot;'</span>&nbsp;=&gt;&nbsp;<span class="src-str">'&amp;quot;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a4142"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&lt;'</span>&nbsp;=&gt;&nbsp;<span class="src-str">'&amp;lt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a4143"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'&gt;'</span>&nbsp;=&gt;&nbsp;<span class="src-str">'&amp;gt;'</span><span class="src-sym">,</span></span></div></li>
-<li><div class="src-line"><a name="a4144"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4145"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;fix&nbsp;is&nbsp;related&nbsp;to&nbsp;SF#1923020,&nbsp;but&nbsp;has&nbsp;to&nbsp;be&nbsp;applied</span></span></div></li>
-<li><div class="src-line"><a name="a4146"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//regardless&nbsp;of&nbsp;actually&nbsp;highlighting&nbsp;symbols.</span></span></div></li>
-<li><div class="src-line"><a name="a4147"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a4148"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Circumvent&nbsp;a&nbsp;bug&nbsp;with&nbsp;symbol&nbsp;highlighting</span></span></div></li>
-<li><div class="src-line"><a name="a4149"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;is&nbsp;required&nbsp;as&nbsp;;&nbsp;would&nbsp;produce&nbsp;undesirable&nbsp;side-effects&nbsp;if&nbsp;it</span></span></div></li>
-<li><div class="src-line"><a name="a4150"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//was&nbsp;not&nbsp;to&nbsp;be&nbsp;processed&nbsp;as&nbsp;an&nbsp;entity.</span></span></div></li>
-<li><div class="src-line"><a name="a4151"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">';'</span>&nbsp;=&gt;&nbsp;<span class="src-str">'&lt;SEMI&gt;'</span><span class="src-sym">,</span>&nbsp;<span class="src-comm">//&nbsp;Force&nbsp;;&nbsp;to&nbsp;be&nbsp;processed&nbsp;as&nbsp;entity</span></span></div></li>
-<li><div class="src-line"><a name="a4152"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'|'</span>&nbsp;=&gt;&nbsp;<span class="src-str">'&lt;PIPE&gt;'</span>&nbsp;<span class="src-comm">//&nbsp;Force&nbsp;|&nbsp;to&nbsp;be&nbsp;processed&nbsp;as&nbsp;entity</span></span></div></li>
-<li><div class="src-line"><a name="a4153"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;ENT_COMPAT&nbsp;set</span></span></div></li>
-<li><div class="src-line"><a name="a4154"></a></span><span class="src-str"><span class="src-comm"></span></span></div></li>
-<li><div class="src-line"><a name="a4155"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$quote_style</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4156"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case</span>&nbsp;<span class="src-id">ENT_NOQUOTES</span>:&nbsp;<span class="src-comm">//&nbsp;don't&nbsp;convert&nbsp;double&nbsp;quotes</span></span></div></li>
-<li><div class="src-line"><a name="a4157"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$aTransSpecchar</span><span class="src-sym">[</span><span class="src-str">'&quot;'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4158"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4159"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case</span>&nbsp;<span class="src-id">ENT_QUOTES</span>:&nbsp;<span class="src-comm">//&nbsp;convert&nbsp;single&nbsp;quotes&nbsp;as&nbsp;well</span></span></div></li>
-<li><div class="src-line"><a name="a4160"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$aTransSpecchar</span><span class="src-sym">[</span><span class="src-str">&quot;'&quot;</span><span class="src-sym">]</span>&nbsp;=&nbsp;<span class="src-str">'&amp;#39;'</span><span class="src-sym">;</span>&nbsp;<span class="src-comm">//&nbsp;(apos)&nbsp;htmlspecialchars()&nbsp;uses&nbsp;'&amp;#039;'</span></span></div></li>
-<li><div class="src-line"><a name="a4161"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4162"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4163"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4164"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;return&nbsp;translated&nbsp;string</span></span></div></li>
-<li><div class="src-line"><a name="a4165"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<a href="http://www.php.net/strtr">strtr</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,</span>&nbsp;<span class="src-var">$aTransSpecchar</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4166"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4167"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4168"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;/**</span></div></li>
-<li><div class="src-line"><a name="a4169"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Returns&nbsp;a&nbsp;stylesheet&nbsp;for&nbsp;the&nbsp;highlighted&nbsp;code.&nbsp;If&nbsp;$economy&nbsp;mode</span></div></li>
-<li><div class="src-line"><a name="a4170"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;is&nbsp;true,&nbsp;we&nbsp;only&nbsp;return&nbsp;the&nbsp;stylesheet&nbsp;declarations&nbsp;that&nbsp;matter&nbsp;for</span></div></li>
-<li><div class="src-line"><a name="a4171"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;this&nbsp;code&nbsp;block&nbsp;instead&nbsp;of&nbsp;the&nbsp;whole&nbsp;thing</span></div></li>
-<li><div class="src-line"><a name="a4172"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</span></div></li>
-<li><div class="src-line"><a name="a4173"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&nbsp;boolean&nbsp;Whether&nbsp;to&nbsp;use&nbsp;economy&nbsp;mode&nbsp;or&nbsp;not</span></div></li>
-<li><div class="src-line"><a name="a4174"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;A&nbsp;stylesheet&nbsp;built&nbsp;on&nbsp;the&nbsp;data&nbsp;for&nbsp;the&nbsp;current&nbsp;language</span></div></li>
-<li><div class="src-line"><a name="a4175"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;&nbsp;1.0.0</span></div></li>
-<li><div class="src-line"><a name="a4176"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
-<li><div class="src-line"><a name="a4177"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function</span>&nbsp;<a href="../geshi/core/GeSHi.html#methodget_stylesheet">get_stylesheet</a><span class="src-sym">(</span><span class="src-var">$economy_mode</span>&nbsp;=&nbsp;<span class="src-id">true</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4178"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;there's&nbsp;an&nbsp;error,&nbsp;chances&nbsp;are&nbsp;that&nbsp;the&nbsp;language&nbsp;file</span></span></div></li>
-<li><div class="src-line"><a name="a4179"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;won't&nbsp;have&nbsp;populated&nbsp;the&nbsp;language&nbsp;data&nbsp;file,&nbsp;so&nbsp;we&nbsp;can't</span></span></div></li>
-<li><div class="src-line"><a name="a4180"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;risk&nbsp;getting&nbsp;a&nbsp;stylesheet...</span></span></div></li>
-<li><div class="src-line"><a name="a4181"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methoderror">error</a><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4182"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span>&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4183"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4184"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4185"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//Check&nbsp;if&nbsp;the&nbsp;style&nbsp;rearrangements&nbsp;have&nbsp;been&nbsp;processed&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a4186"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//This&nbsp;also&nbsp;does&nbsp;some&nbsp;preprocessing&nbsp;to&nbsp;check&nbsp;which&nbsp;style&nbsp;groups&nbsp;are&nbsp;useable&nbsp;...</span></span></div></li>
-<li><div class="src-line"><a name="a4187"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'NUMBERS_CACHE'</span><span class="src-sym">]</span><span class="src-sym">))</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4188"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">build_style_cache</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4189"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4190"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4191"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;First,&nbsp;work&nbsp;out&nbsp;what&nbsp;the&nbsp;selector&nbsp;should&nbsp;be.&nbsp;If&nbsp;there's&nbsp;an&nbsp;ID,</span></span></div></li>
-<li><div class="src-line"><a name="a4192"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;that&nbsp;should&nbsp;be&nbsp;used,&nbsp;the&nbsp;same&nbsp;for&nbsp;a&nbsp;class.&nbsp;Otherwise,&nbsp;a&nbsp;selector</span></span></div></li>
-<li><div class="src-line"><a name="a4193"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;of&nbsp;''&nbsp;means&nbsp;that&nbsp;these&nbsp;styles&nbsp;will&nbsp;be&nbsp;applied&nbsp;anywhere</span></span></div></li>
-<li><div class="src-line"><a name="a4194"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4195"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector</span>&nbsp;=&nbsp;<span class="src-str">'#'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4196"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4197"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector</span>&nbsp;=&nbsp;<span class="src-str">'.'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4198"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_class</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4199"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector</span>&nbsp;.=&nbsp;<span class="src-str">'.'</span>&nbsp;.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_class</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4200"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4201"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4202"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector</span>&nbsp;.=&nbsp;<span class="src-str">'&nbsp;'</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4203"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4204"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Header&nbsp;of&nbsp;the&nbsp;stylesheet</span></span></div></li>
-<li><div class="src-line"><a name="a4205"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4206"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet</span>&nbsp;=&nbsp;<span class="src-str">&quot;/**\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4207"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;GeSHi&nbsp;Dynamically&nbsp;Generated&nbsp;Stylesheet\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4208"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;--------------------------------------\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4209"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">"</span></span>&nbsp;*&nbsp;Dynamically&nbsp;generated&nbsp;stylesheet&nbsp;for&nbsp;{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language</span><span class="src-sym">}</span>\n<span class="src-str">&quot;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a4210"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-str">&quot;</span>&nbsp;*&nbsp;CSS&nbsp;class:&nbsp;{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_class</span><span class="src-sym">}</span>,&nbsp;CSS&nbsp;id:&nbsp;{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_id</span><span class="src-sym">}</span>\n<span class="src-str">&quot;</span><span class="src-str">.</span></div></li>
-<li><div class="src-line"><a name="a4211"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;GeSHi&nbsp;(C)&nbsp;2004&nbsp;-&nbsp;2007&nbsp;Nigel&nbsp;McNie,&nbsp;2007&nbsp;-&nbsp;2008&nbsp;Benny&nbsp;Baumann\n&quot;</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a4212"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;(http://qbnz.com/highlighter/&nbsp;and&nbsp;http://geshi.org/)\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4213"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;--------------------------------------\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4214"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*/\n&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4215"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span>&nbsp;<span class="src-key">else</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4216"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet</span>&nbsp;=&nbsp;<span class="src-str">&quot;/**\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4217"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;GeSHi&nbsp;(C)&nbsp;2004&nbsp;-&nbsp;2007&nbsp;Nigel&nbsp;McNie,&nbsp;2007&nbsp;-&nbsp;2008&nbsp;Benny&nbsp;Baumann\n&quot;</span>&nbsp;.</span></div></li>
-<li><div class="src-line"><a name="a4218"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*&nbsp;(http://qbnz.com/highlighter/&nbsp;and&nbsp;http://geshi.org/)\n&quot;</span>.</span></div></li>
-<li><div class="src-line"><a name="a4219"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">&quot;&nbsp;*/\n&quot;</span><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4220"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4221"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4222"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Set&nbsp;the&nbsp;&lt;ol&gt;&nbsp;to&nbsp;have&nbsp;no&nbsp;effect&nbsp;at&nbsp;all&nbsp;if&nbsp;there&nbsp;are&nbsp;line&nbsp;numbers</span></span></div></li>
-<li><div class="src-line"><a name="a4223"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;(&lt;ol&gt;s&nbsp;have&nbsp;margins&nbsp;that&nbsp;should&nbsp;be&nbsp;destroyed&nbsp;so&nbsp;all&nbsp;layout&nbsp;is</span></span></div></li>
-<li><div class="src-line"><a name="a4224"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;controlled&nbsp;by&nbsp;the&nbsp;set_overall_style&nbsp;method,&nbsp;which&nbsp;works&nbsp;on&nbsp;the</span></span></div></li>
-<li><div class="src-line"><a name="a4225"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&lt;pre&gt;&nbsp;or&nbsp;&lt;div&gt;&nbsp;container).&nbsp;Additionally,&nbsp;set&nbsp;default&nbsp;styles&nbsp;for&nbsp;lines</span></span></div></li>
-<li><div class="src-line"><a name="a4226"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode</span>&nbsp;||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers</span>&nbsp;!=&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS&quot;&gt;GESHI_NO_LINE_NUMBERS&lt;/a&gt;</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4227"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$stylesheet&nbsp;.=&nbsp;&quot;$selector,&nbsp;{$selector}ol,&nbsp;{$selector}ol&nbsp;li&nbsp;{margin:&nbsp;0;}\n&quot;;</span></span></div></li>
-<li><div class="src-line"><a name="a4228"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span><span class="src-var">$selector</span>.de1,&nbsp;<span class="src-var">$selector</span>.de2&nbsp;{{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">code_style</span><span class="src-sym">}</span>}\n<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4229"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4230"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4231"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;overall&nbsp;styles</span></span></div></li>
-<li><div class="src-line"><a name="a4232"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note:&nbsp;neglect&nbsp;economy_mode,&nbsp;empty&nbsp;styles&nbsp;are&nbsp;meaningless</span></span></div></li>
-<li><div class="src-line"><a name="a4233"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_style</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4234"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet</span>&nbsp;.=&nbsp;<span class="src-str">"</span></span><span class="src-var">$selector</span>&nbsp;{{<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">overall_style</span><span class="src-sym">}</span>}\n<span class="src-str">&quot;</span><span class="src-str"><span class="src-sym">;</span></span></div></li>
-<li><div class="src-line"><a name="a4235"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></span></div></li>
-<li><div class="src-line"><a name="a4236"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4237"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;styles&nbsp;for&nbsp;links</span></span></div></li>
-<li><div class="src-line"><a name="a4238"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note:&nbsp;economy&nbsp;mode&nbsp;does&nbsp;not&nbsp;make&nbsp;_any_&nbsp;sense&nbsp;here</span></span></div></li>
-<li><div class="src-line"><a name="a4239"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;either&nbsp;the&nbsp;style&nbsp;is&nbsp;empty&nbsp;and&nbsp;thus&nbsp;no&nbsp;selector&nbsp;is&nbsp;needed</span></span></div></li>
-<li><div class="src-line"><a name="a4240"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;or&nbsp;the&nbsp;appropriate&nbsp;key&nbsp;is&nbsp;given.</span></span></div></li>
-<li><div class="src-line"><a name="a4241"></a></span><span class="src-str"><span class="src-comm"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">link_styles</span>&nbsp;<span class="src-key">as</span>&nbsp;<span class="src-var">$key</span>&nbsp;=&gt;&nbsp;<span class="src-var">$style</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4242"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$style</span>&nbsp;!=&nbsp;<span class="src-str">''</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4243"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">switch</span>&nbsp;<span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">)</span>&nbsp;<span class="src-sym">{</span></span></div></li>
-<li><div class="src-line"><a name="a4244"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case</span>&nbsp;<span class="src-id">&lt;a&nbsp;href=&quot;../geshi/core/_geshi.php.html#defineGESHI_LINK&quot;&gt;GESHI_LINK&lt;/a&gt;</span>:</span></div></li>
-<li><div class="src-line"><a name="a4245"></a></span><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet</span>&nbsp;.=&nbsp;<span class="src-str">"</span>{<span class="src-var">$selector</span><span class="src-sym">}</span>a:link&nbsp;{{<span class="src-var">$style</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4247"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_HOVER">GESHI_HOVER</a></span>:</div></li>
-<li><div class="src-line"><a name="a4248"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>a:hover&nbsp;{{<span class="src-var">$style</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4250"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_ACTIVE">GESHI_ACTIVE</a></span>:</div></li>
-<li><div class="src-line"><a name="a4251"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>a:active&nbsp;{{<span class="src-var">$style</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4252"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4253"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">case&nbsp;</span><span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_VISITED">GESHI_VISITED</a></span>:</div></li>
-<li><div class="src-line"><a name="a4254"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>a:visited&nbsp;{{<span class="src-var">$style</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4255"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4256"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4257"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4258"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4259"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4260"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Header&nbsp;and&nbsp;footer</span></div></li>
-<li><div class="src-line"><a name="a4261"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note:&nbsp;neglect&nbsp;economy_mode,&nbsp;empty&nbsp;styles&nbsp;are&nbsp;meaningless</span></div></li>
-<li><div class="src-line"><a name="a4262"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">header_content_style&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4263"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.head&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">header_content_style</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4264"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4265"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">footer_content_style&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4266"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.foot&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">footer_content_style</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4267"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4268"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4269"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Styles&nbsp;for&nbsp;important&nbsp;stuff</span></div></li>
-<li><div class="src-line"><a name="a4270"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note:&nbsp;neglect&nbsp;economy_mode,&nbsp;empty&nbsp;styles&nbsp;are&nbsp;meaningless</span></div></li>
-<li><div class="src-line"><a name="a4271"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">important_styles&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4272"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.imp&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">important_styles</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4273"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4274"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4275"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Simple&nbsp;line&nbsp;number&nbsp;styles</span></div></li>
-<li><div class="src-line"><a name="a4276"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">((</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers&nbsp;</span>!=&nbsp;<span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_style1&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4277"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>li,&nbsp;{<span class="src-var">$selector</span><span class="src-sym">}</span>.li1&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">line_style1</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4278"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4279"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">((</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers&nbsp;</span>!=&nbsp;<span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a></span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">table_linenumber_style&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4280"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>.ln&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">table_linenumber_style</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4281"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4282"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;there&nbsp;is&nbsp;a&nbsp;style&nbsp;set&nbsp;for&nbsp;fancy&nbsp;line&nbsp;numbers,&nbsp;echo&nbsp;it&nbsp;out</span></div></li>
-<li><div class="src-line"><a name="a4283"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">((</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_numbers&nbsp;</span>==&nbsp;<span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS">GESHI_FANCY_LINE_NUMBERS</a></span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">line_style2&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4284"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>.li2&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">line_style2</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4285"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4286"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4287"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note:&nbsp;empty&nbsp;styles&nbsp;are&nbsp;meaningless</span></div></li>
-<li><div class="src-line"><a name="a4288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||</div></li>
-<li><div class="src-line"><a name="a4290"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>&amp;&amp;</div></li>
-<li><div class="src-line"><a name="a4291"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'KEYWORDS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4292"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.kw<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||</div></li>
-<li><div class="src-line"><a name="a4297"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>&amp;&amp;</div></li>
-<li><div class="src-line"><a name="a4298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'COMMENTS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>||</div></li>
-<li><div class="src-line"><a name="a4299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_REGEXP'</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>&amp;&amp;</div></li>
-<li><div class="src-line"><a name="a4300"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'COMMENT_REGEXP'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">))))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4301"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.co<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4302"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4303"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4304"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4305"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'ESCAPE_CHAR'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4306"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;NEW:&nbsp;since&nbsp;1.0.8&nbsp;we&nbsp;have&nbsp;to&nbsp;handle&nbsp;hardescapes</span></div></li>
-<li><div class="src-line"><a name="a4307"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$group&nbsp;</span>===&nbsp;<span class="src-str">'HARD'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4308"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;<span class="src-str">'_h'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4309"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4310"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.es<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4311"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4312"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4313"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4314"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'BRACKETS'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4315"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.br<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4316"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4317"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4318"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4319"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'SYMBOLS'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4320"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.sy<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4321"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4322"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4323"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4324"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'STRINGS'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4325"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;NEW:&nbsp;since&nbsp;1.0.8&nbsp;we&nbsp;have&nbsp;to&nbsp;handle&nbsp;hardquotes</span></div></li>
-<li><div class="src-line"><a name="a4326"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$group&nbsp;</span>===&nbsp;<span class="src-str">'HARD'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4327"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$group&nbsp;</span>=&nbsp;<span class="src-str">'_h'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4328"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4329"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.st<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4330"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4333"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'NUMBERS'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4334"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.nu<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4335"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4336"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4337"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4338"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'METHODS'</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4339"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.me<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4340"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4341"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4342"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;note:&nbsp;neglect&nbsp;economy_mode,&nbsp;empty&nbsp;styles&nbsp;are&nbsp;meaningless</span></div></li>
-<li><div class="src-line"><a name="a4343"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'SCRIPT'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4344"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4345"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.sc<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4346"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4347"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4348"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'STYLES'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$group&nbsp;</span>=&gt;&nbsp;<span class="src-var">$styles</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4349"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$styles&nbsp;</span>!=&nbsp;<span class="src-str">''&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||</div></li>
-<li><div class="src-line"><a name="a4350"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>&amp;&amp;</div></li>
-<li><div class="src-line"><a name="a4351"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">lexic_permissions</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4352"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>&amp;&amp;</div></li>
-<li><div class="src-line"><a name="a4353"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_key_exists">array_key_exists</a><span class="src-sym">(</span><span class="src-id">GESHI_CLASS</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4354"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4355"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">language_data</span><span class="src-sym">[</span><span class="src-str">'REGEXPS'</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$group</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-id">GESHI_CLASS</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4356"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str">&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4357"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4358"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span><span class="src-str"><span class="src-var">$selector</span>.re<span class="src-var">$group</span>&nbsp;{{<span class="src-var">$styles</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4359"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4360"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4361"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4362"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Styles&nbsp;for&nbsp;lines&nbsp;being&nbsp;highlighted&nbsp;extra</span></div></li>
-<li><div class="src-line"><a name="a4363"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$economy_mode&nbsp;</span>||&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines</span><span class="src-sym">)</span>!=<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles</span><span class="src-sym">)))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4364"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>.ln-xtra,&nbsp;{<span class="src-var">$selector</span><span class="src-sym">}</span>li.ln-xtra,&nbsp;{<span class="src-var">$selector</span><span class="src-sym">}</span>div.ln-xtra&nbsp;{{<span class="src-var">$this</span></span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_style</span><span class="src-str"></span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4365"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4366"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>span.xtra&nbsp;{&nbsp;display:block;&nbsp;}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4367"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$lineid&nbsp;</span>=&gt;&nbsp;<span class="src-var">$linestyle</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4368"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stylesheet&nbsp;</span>.=&nbsp;<span class="src-str">&quot;</span>{<span class="src-var">$selector</span><span class="src-str"></span><span class="src-sym">}</span>.lx<span class="src-var">$lineid</span>,&nbsp;{<span class="src-var">$selector</span><span class="src-sym">}</span>li.lx<span class="src-var">$lineid</span>,&nbsp;{<span class="src-var">$selector</span><span class="src-sym">}</span>div.lx<span class="src-var">$lineid</span>&nbsp;{{<span class="src-var">$linestyle</span><span class="src-sym">}</span>}\n</span><span class="src-str">&quot;</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4369"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4370"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4371"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$stylesheet</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4372"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4373"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4374"></a>&nbsp;&nbsp;&nbsp;&nbsp;/**</div></li>
-<li><div class="src-line"><a name="a4375"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Get's&nbsp;the&nbsp;style&nbsp;that&nbsp;is&nbsp;used&nbsp;for&nbsp;the&nbsp;specified&nbsp;line</div></li>
-<li><div class="src-line"><a name="a4376"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</div></li>
-<li><div class="src-line"><a name="a4377"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;int&nbsp;The&nbsp;line&nbsp;number&nbsp;information&nbsp;is&nbsp;requested&nbsp;for</div></li>
-<li><div class="src-line"><a name="a4378"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</div></li>
-<li><div class="src-line"><a name="a4379"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.7.21</div></li>
-<li><div class="src-line"><a name="a4380"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</div></li>
-<li><div class="src-line"><a name="a4381"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-id">get_line_style</span><span class="src-sym">(</span><span class="src-var">$line</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4382"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$style&nbsp;=&nbsp;null;</span></div></li>
-<li><div class="src-line"><a name="a4383"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4384"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$line</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4385"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_styles</span><span class="src-sym">[</span><span class="src-var">$line</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4386"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-comm">//&nbsp;if&nbsp;no&nbsp;&quot;extra&quot;&nbsp;style&nbsp;assigned</span></div></li>
-<li><div class="src-line"><a name="a4387"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$style&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">highlight_extra_lines_style</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4388"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4389"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4390"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$style</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4391"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4392"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4393"></a>&nbsp;&nbsp;&nbsp;&nbsp;/**</div></li>
-<li><div class="src-line"><a name="a4394"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;this&nbsp;functions&nbsp;creates&nbsp;an&nbsp;optimized&nbsp;regular&nbsp;expression&nbsp;list</div></li>
-<li><div class="src-line"><a name="a4395"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;of&nbsp;an&nbsp;array&nbsp;of&nbsp;strings.</div></li>
-<li><div class="src-line"><a name="a4396"></a>&nbsp;&nbsp;&nbsp;&nbsp;*</div></li>
-<li><div class="src-line"><a name="a4397"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Example:</div></li>
-<li><div class="src-line"><a name="a4398"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&lt;code&gt;$list&nbsp;=&nbsp;array('faa',&nbsp;'foo',&nbsp;'foobar');</div></li>
-<li><div class="src-line"><a name="a4399"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&gt;&nbsp;string&nbsp;'f(aa|oo(bar)?)'&lt;/code&gt;</div></li>
-<li><div class="src-line"><a name="a4400"></a>&nbsp;&nbsp;&nbsp;&nbsp;*</div></li>
-<li><div class="src-line"><a name="a4401"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;$list&nbsp;array&nbsp;of&nbsp;(unquoted)&nbsp;strings</div></li>
-<li><div class="src-line"><a name="a4402"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;$regexp_delimiter&nbsp;your&nbsp;regular&nbsp;expression&nbsp;delimiter,&nbsp;@see&nbsp;preg_quote()</div></li>
-<li><div class="src-line"><a name="a4403"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;for&nbsp;regular&nbsp;expression</div></li>
-<li><div class="src-line"><a name="a4404"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@author&nbsp;Milian&nbsp;Wolff&nbsp;&lt;mail@milianw.de&gt;</div></li>
-<li><div class="src-line"><a name="a4405"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.8</div></li>
-<li><div class="src-line"><a name="a4406"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</div></li>
-<li><div class="src-line"><a name="a4407"></a>&nbsp;&nbsp;&nbsp;&nbsp;*/</div></li>
-<li><div class="src-line"><a name="a4408"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-id">optimize_regexp_list</span><span class="src-sym">(</span><span class="src-var">$list</span><span class="src-sym">,&nbsp;</span><span class="src-var">$regexp_delimiter&nbsp;</span>=&nbsp;<span class="src-str">'/'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4409"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regex_chars&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'.'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'\\'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'+'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'*'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'?'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'['</span><span class="src-sym">,&nbsp;</span><span class="src-str">'^'</span><span class="src-sym">,&nbsp;</span><span class="src-str">']'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'$'</span><span class="src-sym">,</span></div></li>
-<li><div class="src-line"><a name="a4410"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'('</span><span class="src-sym">,&nbsp;</span><span class="src-str">')'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'{'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'}'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'='</span><span class="src-sym">,&nbsp;</span><span class="src-str">'!'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'&lt;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'&gt;'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'|'</span><span class="src-sym">,&nbsp;</span><span class="src-str">':'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$regexp_delimiter</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4411"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/sort">sort</a><span class="src-sym">(</span><span class="src-var">$list</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4412"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp_list&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">''</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4413"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_subpatterns&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4414"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list_key&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4415"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4416"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;the&nbsp;tokens&nbsp;which&nbsp;we&nbsp;will&nbsp;use&nbsp;to&nbsp;generate&nbsp;the&nbsp;regexp&nbsp;list</span></div></li>
-<li><div class="src-line"><a name="a4417"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tokens&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4418"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$prev_keys&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4419"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;go&nbsp;through&nbsp;all&nbsp;entries&nbsp;of&nbsp;the&nbsp;list&nbsp;and&nbsp;generate&nbsp;the&nbsp;token&nbsp;list</span></div></li>
-<li><div class="src-line"><a name="a4420"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cur_len&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4421"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">for&nbsp;</span><span class="src-sym">(</span><span class="src-var">$i&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-var">$i_max&nbsp;</span>=&nbsp;<a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$list</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-var">$i&nbsp;</span>&lt;&nbsp;<span class="src-var">$i_max</span><span class="src-sym">;&nbsp;</span>++<span class="src-var">$i</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4422"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$cur_len&nbsp;</span>&gt;&nbsp;<span class="src-id">GESHI_MAX_PCRE_LENGTH</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4423"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;seems&nbsp;like&nbsp;the&nbsp;length&nbsp;of&nbsp;this&nbsp;pcre&nbsp;is&nbsp;growing&nbsp;exorbitantly</span></div></li>
-<li><div class="src-line"><a name="a4424"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp_list</span><span class="src-sym">[</span>++<span class="src-var">$list_key</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_optimize_regexp_list_tokens_to_string</span><span class="src-sym">(</span><span class="src-var">$tokens</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4425"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_subpatterns&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr_count">substr_count</a><span class="src-sym">(</span><span class="src-var">$regexp_list</span><span class="src-sym">[</span><span class="src-var">$list_key</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-str">'(?:'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4426"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tokens&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4427"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cur_len&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4428"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4429"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$level&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4430"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$entry&nbsp;</span>=&nbsp;<a href="http://www.php.net/preg_quote">preg_quote</a><span class="src-sym">(</span>(string)&nbsp;<span class="src-var">$list</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$regexp_delimiter</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4431"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pointer&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$tokens</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4432"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;properly&nbsp;assign&nbsp;the&nbsp;new&nbsp;entry&nbsp;to&nbsp;the&nbsp;correct&nbsp;position&nbsp;in&nbsp;the&nbsp;token&nbsp;array</span></div></li>
-<li><div class="src-line"><a name="a4433"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;possibly&nbsp;generate&nbsp;smaller&nbsp;common&nbsp;denominator&nbsp;keys</span></div></li>
-<li><div class="src-line"><a name="a4434"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span><span class="src-id">true</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4435"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;get&nbsp;the&nbsp;common&nbsp;denominator</span></div></li>
-<li><div class="src-line"><a name="a4436"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4437"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-var">$entry</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4438"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;is&nbsp;a&nbsp;duplicate&nbsp;entry,&nbsp;skip&nbsp;it</span></div></li>
-<li><div class="src-line"><a name="a4439"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue&nbsp;</span><span class="src-num">2</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4440"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4441"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$char&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4442"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$entry</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;isset<span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
-<li><div class="src-line"><a name="a4443"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;<span class="src-var">$entry</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]&nbsp;</span>==&nbsp;<span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]</span><span class="src-sym">[</span><span class="src-var">$char</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4444"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$char</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4445"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4446"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$char&nbsp;</span>&gt;&nbsp;<span class="src-num">0</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4447"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;entry&nbsp;has&nbsp;at&nbsp;least&nbsp;some&nbsp;chars&nbsp;in&nbsp;common&nbsp;with&nbsp;the&nbsp;current&nbsp;key</span></div></li>
-<li><div class="src-line"><a name="a4448"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$char&nbsp;</span>==&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4449"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;current&nbsp;key&nbsp;is&nbsp;totally&nbsp;matched,&nbsp;i.e.&nbsp;this&nbsp;entry&nbsp;has&nbsp;just&nbsp;some&nbsp;bits&nbsp;appended</span></div></li>
-<li><div class="src-line"><a name="a4450"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pointer&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]]</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4451"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4452"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;only&nbsp;part&nbsp;of&nbsp;the&nbsp;keys&nbsp;match</span></div></li>
-<li><div class="src-line"><a name="a4453"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_key_part1&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><span class="src-var">$char</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4454"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_key_part2&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$char</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4455"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4456"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$new_key_part1</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$regex_chars</span><span class="src-sym">)</span></div></li>
-<li><div class="src-line"><a name="a4457"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;||&nbsp;<a href="http://www.php.net/in_array">in_array</a><span class="src-sym">(</span><span class="src-var">$new_key_part2</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$regex_chars</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4458"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;this&nbsp;is&nbsp;bad,&nbsp;a&nbsp;regex&nbsp;char&nbsp;as&nbsp;first&nbsp;character</span></div></li>
-<li><div class="src-line"><a name="a4459"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$entry</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">''&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4460"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_splice">array_splice</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">,&nbsp;</span><span class="src-var">$level</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$entry</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4461"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cur_len&nbsp;</span>+=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$entry</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4462"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4463"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4464"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;relocate&nbsp;previous&nbsp;tokens</span></div></li>
-<li><div class="src-line"><a name="a4465"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$new_key_part1</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$new_key_part2&nbsp;</span>=&gt;&nbsp;<span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4466"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$prev_keys</span><span class="src-sym">[</span><span class="src-var">$level</span><span class="src-sym">]]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4467"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pointer&nbsp;</span>=&nbsp;<span class="src-sym">&amp;</span><span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$new_key_part1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4468"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;recreate&nbsp;key&nbsp;index</span></div></li>
-<li><div class="src-line"><a name="a4469"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_splice">array_splice</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">,&nbsp;</span><span class="src-var">$level</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$new_key_part1</span><span class="src-sym">,&nbsp;</span><span class="src-var">$new_key_part2</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4470"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cur_len&nbsp;</span>+=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$new_key_part2</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4471"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4472"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4473"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;++<span class="src-var">$level</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4474"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$entry&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$entry</span><span class="src-sym">,&nbsp;</span><span class="src-var">$char</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4475"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">continue</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4476"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4477"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;else:&nbsp;fall&nbsp;trough,&nbsp;i.e.&nbsp;no&nbsp;common&nbsp;denominator&nbsp;was&nbsp;found</span></div></li>
-<li><div class="src-line"><a name="a4478"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4479"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$level&nbsp;</span>==&nbsp;<span class="src-num">0&nbsp;</span>&amp;&amp;&nbsp;<span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$tokens</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4480"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;we&nbsp;can&nbsp;dump&nbsp;current&nbsp;tokens&nbsp;into&nbsp;the&nbsp;string&nbsp;and&nbsp;throw&nbsp;them&nbsp;away&nbsp;afterwards</span></div></li>
-<li><div class="src-line"><a name="a4481"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_entry&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_optimize_regexp_list_tokens_to_string</span><span class="src-sym">(</span><span class="src-var">$tokens</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4482"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_subpatterns&nbsp;</span>=&nbsp;<a href="http://www.php.net/substr_count">substr_count</a><span class="src-sym">(</span><span class="src-var">$new_entry</span><span class="src-sym">,&nbsp;</span><span class="src-str">'(?:'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4483"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-id">GESHI_MAX_PCRE_SUBPATTERNS&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$num_subpatterns&nbsp;</span>+&nbsp;<span class="src-var">$new_subpatterns&nbsp;</span>&gt;&nbsp;<span class="src-id">GESHI_MAX_PCRE_SUBPATTERNS</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4484"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp_list</span><span class="src-sym">[</span>++<span class="src-var">$list_key</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$new_entry</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4485"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_subpatterns&nbsp;</span>=&nbsp;<span class="src-var">$new_subpatterns</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4486"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4487"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$regexp_list</span><span class="src-sym">[</span><span class="src-var">$list_key</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4488"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_entry&nbsp;</span>=&nbsp;<span class="src-str">'|'&nbsp;</span>.&nbsp;<span class="src-var">$new_entry</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4489"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4490"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp_list</span><span class="src-sym">[</span><span class="src-var">$list_key</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-var">$new_entry</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4491"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$num_subpatterns&nbsp;</span>+=&nbsp;<span class="src-var">$new_subpatterns</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4492"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4493"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$tokens&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4494"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cur_len&nbsp;</span>=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4495"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4496"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;no&nbsp;further&nbsp;common&nbsp;denominator&nbsp;found</span></div></li>
-<li><div class="src-line"><a name="a4497"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$pointer</span><span class="src-sym">[</span><span class="src-var">$entry</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">''&nbsp;</span>=&gt;&nbsp;<span class="src-id">true</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4498"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_splice">array_splice</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">,&nbsp;</span><span class="src-var">$level</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$prev_keys</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$entry</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4499"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4500"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$cur_len&nbsp;</span>+=&nbsp;<a href="http://www.php.net/strlen">strlen</a><span class="src-sym">(</span><span class="src-var">$entry</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4501"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">break</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4502"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4503"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$list</span><span class="src-sym">[</span><span class="src-var">$i</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4504"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4505"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sure&nbsp;the&nbsp;last&nbsp;tokens&nbsp;get&nbsp;converted&nbsp;as&nbsp;well</span></div></li>
-<li><div class="src-line"><a name="a4506"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_entry&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_optimize_regexp_list_tokens_to_string</span><span class="src-sym">(</span><span class="src-var">$tokens</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4507"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-id">GESHI_MAX_PCRE_SUBPATTERNS&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$num_subpatterns&nbsp;</span>+&nbsp;<a href="http://www.php.net/substr_count">substr_count</a><span class="src-sym">(</span><span class="src-var">$new_entry</span><span class="src-sym">,&nbsp;</span><span class="src-str">'(?:'</span><span class="src-sym">)&nbsp;</span>&gt;&nbsp;<span class="src-id">GESHI_MAX_PCRE_SUBPATTERNS</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4508"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp_list</span><span class="src-sym">[</span>++<span class="src-var">$list_key</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$new_entry</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4509"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}&nbsp;</span><span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4510"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$regexp_list</span><span class="src-sym">[</span><span class="src-var">$list_key</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4511"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$new_entry&nbsp;</span>=&nbsp;<span class="src-str">'|'&nbsp;</span>.&nbsp;<span class="src-var">$new_entry</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4512"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4513"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$regexp_list</span><span class="src-sym">[</span><span class="src-var">$list_key</span><span class="src-sym">]&nbsp;</span>.=&nbsp;<span class="src-var">$new_entry</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4514"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4515"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$regexp_list</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4516"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4517"></a>&nbsp;&nbsp;&nbsp;&nbsp;/**</div></li>
-<li><div class="src-line"><a name="a4518"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;this&nbsp;function&nbsp;creates&nbsp;the&nbsp;appropriate&nbsp;regexp&nbsp;string&nbsp;of&nbsp;an&nbsp;token&nbsp;array</div></li>
-<li><div class="src-line"><a name="a4519"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;you&nbsp;should&nbsp;not&nbsp;call&nbsp;this&nbsp;function&nbsp;directly,&nbsp;@see&nbsp;$this-&gt;optimize_regexp_list().</div></li>
-<li><div class="src-line"><a name="a4520"></a>&nbsp;&nbsp;&nbsp;&nbsp;*</div></li>
-<li><div class="src-line"><a name="a4521"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;&amp;$tokens&nbsp;array&nbsp;of&nbsp;tokens</div></li>
-<li><div class="src-line"><a name="a4522"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;$recursed&nbsp;bool&nbsp;to&nbsp;know&nbsp;wether&nbsp;we&nbsp;recursed&nbsp;or&nbsp;not</div></li>
-<li><div class="src-line"><a name="a4523"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string</div></li>
-<li><div class="src-line"><a name="a4524"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@author&nbsp;Milian&nbsp;Wolff&nbsp;&lt;mail@milianw.de&gt;</div></li>
-<li><div class="src-line"><a name="a4525"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.8</div></li>
-<li><div class="src-line"><a name="a4526"></a>&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@access&nbsp;private</div></li>
-<li><div class="src-line"><a name="a4527"></a>&nbsp;&nbsp;&nbsp;&nbsp;*/</div></li>
-<li><div class="src-line"><a name="a4528"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><span class="src-id">_optimize_regexp_list_tokens_to_string</span><span class="src-sym">(</span><span class="src-sym">&amp;</span><span class="src-var">$tokens</span><span class="src-sym">,&nbsp;</span><span class="src-var">$recursed&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4529"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>=&nbsp;<span class="src-str">''</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4530"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$tokens&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$token&nbsp;</span>=&gt;&nbsp;<span class="src-var">$sub_tokens</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4531"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>.=&nbsp;<span class="src-var">$token</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4532"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$close_entry&nbsp;</span>=&nbsp;isset<span class="src-sym">(</span><span class="src-var">$sub_tokens</span><span class="src-sym">[</span><span class="src-str">''</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4533"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$sub_tokens</span><span class="src-sym">[</span><span class="src-str">''</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4534"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$sub_tokens</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4535"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>.=&nbsp;<span class="src-str">'(?:'&nbsp;</span>.&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">_optimize_regexp_list_tokens_to_string</span><span class="src-sym">(</span><span class="src-var">$sub_tokens</span><span class="src-sym">,&nbsp;</span><span class="src-id">true</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">')'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4536"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$close_entry</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4537"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;make&nbsp;sub_tokens&nbsp;optional</span></div></li>
-<li><div class="src-line"><a name="a4538"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>.=&nbsp;<span class="src-str">'?'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4539"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4540"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4541"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>.=&nbsp;<span class="src-str">'|'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4542"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4543"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><span class="src-var">$recursed</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4544"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;do&nbsp;some&nbsp;optimizations</span></div></li>
-<li><div class="src-line"><a name="a4545"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;common&nbsp;trailing&nbsp;strings</span></div></li>
-<li><div class="src-line"><a name="a4546"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;BUGGY!</span></div></li>
-<li><div class="src-line"><a name="a4547"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$list&nbsp;=&nbsp;preg_replace_callback('#(?&lt;=^|\:|\|)\w+?(\w+)(?:\|.+\1)+(?=\|)#',&nbsp;create_function(</span></div></li>
-<li><div class="src-line"><a name="a4548"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;'$matches',&nbsp;'return&nbsp;&quot;(?:&quot;&nbsp;.&nbsp;preg_replace(&quot;#&quot;&nbsp;.&nbsp;preg_quote($matches[1],&nbsp;&quot;#&quot;)&nbsp;.&nbsp;&quot;(?=\||$)#&quot;,&nbsp;&quot;&quot;,&nbsp;$matches[0])&nbsp;.&nbsp;&quot;)&quot;&nbsp;.&nbsp;$matches[1];'),&nbsp;$list);</span></div></li>
-<li><div class="src-line"><a name="a4549"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;(?:p)?&nbsp;=&gt;&nbsp;p?</span></div></li>
-<li><div class="src-line"><a name="a4550"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>=&nbsp;<a href="http://www.php.net/preg_replace">preg_replace</a><span class="src-sym">(</span><span class="src-str">'#\(\?\:(.)\)\?#'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'\1?'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$list</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4551"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;(?:a|b|c|d|...)?&nbsp;=&gt;&nbsp;[abcd...]?</span></div></li>
-<li><div class="src-line"><a name="a4552"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;TODO:&nbsp;a|bb|c&nbsp;=&gt;&nbsp;[ac]|bb</span></div></li>
-<li><div class="src-line"><a name="a4553"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-var">$callback_2</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4554"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span>isset<span class="src-sym">(</span><span class="src-var">$callback_2</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4555"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$callback_2&nbsp;</span>=&nbsp;<a href="http://www.php.net/create_function">create_function</a><span class="src-sym">(</span><span class="src-str">'$matches'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'return&nbsp;&quot;[&quot;&nbsp;.&nbsp;str_replace(&quot;|&quot;,&nbsp;&quot;&quot;,&nbsp;$matches[1])&nbsp;.&nbsp;&quot;]&quot;;'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4556"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4557"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$list&nbsp;</span>=&nbsp;<a href="http://www.php.net/preg_replace_callback">preg_replace_callback</a><span class="src-sym">(</span><span class="src-str">'#\(\?\:((?:.\|)+.)\)#'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$callback_2</span><span class="src-sym">,&nbsp;</span><span class="src-var">$list</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4558"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4559"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;return&nbsp;$list&nbsp;without&nbsp;trailing&nbsp;pipe</span></div></li>
-<li><div class="src-line"><a name="a4560"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$list</span><span class="src-sym">,&nbsp;</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span>-<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4561"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4562"></a><span class="src-sym">}&nbsp;</span><span class="src-comm">//&nbsp;End&nbsp;Class&nbsp;GeSHi</span></div></li>
-<li><div class="src-line"><a name="a4563"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4564"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4565"></a><span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/function_exists">function_exists</a><span class="src-sym">(</span><span class="src-str">'geshi_highlight'</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4566"></a>&nbsp;&nbsp;&nbsp;&nbsp;/**</div></li>
-<li><div class="src-line"><a name="a4567"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Easy&nbsp;way&nbsp;to&nbsp;highlight&nbsp;stuff.&nbsp;Behaves&nbsp;just&nbsp;like&nbsp;highlight_string</div></li>
-<li><div class="src-line"><a name="a4568"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*</div></li>
-<li><div class="src-line"><a name="a4569"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;The&nbsp;code&nbsp;to&nbsp;highlight</div></li>
-<li><div class="src-line"><a name="a4570"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;The&nbsp;language&nbsp;to&nbsp;highlight&nbsp;the&nbsp;code&nbsp;in</div></li>
-<li><div class="src-line"><a name="a4571"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;string&nbsp;The&nbsp;path&nbsp;to&nbsp;the&nbsp;language&nbsp;files.&nbsp;You&nbsp;can&nbsp;leave&nbsp;this&nbsp;blank&nbsp;if&nbsp;you&nbsp;need</div></li>
-<li><div class="src-line"><a name="a4572"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;as&nbsp;from&nbsp;version&nbsp;1.0.7&nbsp;the&nbsp;path&nbsp;should&nbsp;be&nbsp;automatically&nbsp;detected</div></li>
-<li><div class="src-line"><a name="a4573"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;boolean&nbsp;Whether&nbsp;to&nbsp;return&nbsp;the&nbsp;result&nbsp;or&nbsp;to&nbsp;echo</div></li>
-<li><div class="src-line"><a name="a4574"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;string&nbsp;The&nbsp;code&nbsp;highlighted&nbsp;(if&nbsp;$return&nbsp;is&nbsp;true)</div></li>
-<li><div class="src-line"><a name="a4575"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@since&nbsp;1.0.2</div></li>
-<li><div class="src-line"><a name="a4576"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</div></li>
-<li><div class="src-line"><a name="a4577"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">function&nbsp;</span><a href="../geshi/core/_geshi.php.html#functiongeshi_highlight">geshi_highlight</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,&nbsp;</span><span class="src-var">$language</span><span class="src-sym">,&nbsp;</span><span class="src-var">$path&nbsp;</span>=&nbsp;<span class="src-id">null</span><span class="src-sym">,&nbsp;</span><span class="src-var">$return&nbsp;</span>=&nbsp;<span class="src-id">false</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4578"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$geshi&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><a href="../geshi/core/GeSHi.html#methodGeSHi">GeSHi</a><span class="src-sym">(</span><span class="src-var">$string</span><span class="src-sym">,&nbsp;</span><span class="src-var">$language</span><span class="src-sym">,&nbsp;</span><span class="src-var">$path</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4579"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$geshi</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodset_header_type">set_header_type</a><span class="src-sym">(</span><span class="src-id"><a href="../geshi/core/_geshi.php.html#defineGESHI_HEADER_NONE">GESHI_HEADER_NONE</a></span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4580"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4581"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$return</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4582"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-str">'&lt;code&gt;'&nbsp;</span>.&nbsp;<span class="src-var">$geshi</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodparse_code">parse_code</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&lt;/code&gt;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4583"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4584"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4585"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;<span class="src-str">'&lt;code&gt;'&nbsp;</span>.&nbsp;<span class="src-var">$geshi</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methodparse_code">parse_code</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&lt;/code&gt;'</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4586"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4587"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$geshi</span><span class="src-sym">-&gt;</span><a href="../geshi/core/GeSHi.html#methoderror">error</a><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
-<li><div class="src-line"><a name="a4588"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">false</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4589"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4590"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-id">true</span><span class="src-sym">;</span></div></li>
-<li><div class="src-line"><a name="a4591"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4592"></a><span class="src-sym">}</span></div></li>
-<li><div class="src-line"><a name="a4593"></a>&nbsp;</div></li>
-<li><div class="src-line"><a name="a4594"></a><span class="src-php">?&gt;</span></div></li>
-</ol></div>
-</div>
- <p class="notes" id="credit">
- Documentation generated on Thu, 25 Dec 2008 14:34:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/blank.html b/libvpx/examples/includes/geshi/docs/api/blank.html
deleted file mode 100644
index d44ac46..0000000
--- a/libvpx/examples/includes/geshi/docs/api/blank.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<html>
-<head>
- <title>GeSHi 1.0.8</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
-</head>
-<body>
-<div align="center"><h1>GeSHi 1.0.8</h1></div>
-<b>Welcome to geshi!</b><br />
-<br />
-This documentation was generated by <a href="http://www.phpdoc.org">phpDocumentor v1.4.2</a><br />
-</body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/classtrees_geshi.html b/libvpx/examples/includes/geshi/docs/api/classtrees_geshi.html
deleted file mode 100644
index e5c3868..0000000
--- a/libvpx/examples/includes/geshi/docs/api/classtrees_geshi.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
-
-<!-- Start of Class Data -->
-<H2>
-
-</H2>
-<h2>Root class GeSHi</h2>
-<ul>
-<li><a href="geshi/core/GeSHi.html">GeSHi</a></li></ul>
-
- <p class="notes" id="credit">
- Documentation generated on Thu, 25 Dec 2008 14:34:34 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/elementindex.html b/libvpx/examples/includes/geshi/docs/api/elementindex.html
deleted file mode 100644
index 970ebd1..0000000
--- a/libvpx/examples/includes/geshi/docs/api/elementindex.html
+++ /dev/null
@@ -1,867 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <a name="top"></a>
-<h2>Full index</h2>
-<h3>Package indexes</h3>
-<ul>
- <li><a href="elementindex_geshi.html">geshi</a></li>
-</ul>
-<br />
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex.html#a">a</a>
- <a class="index-letter" href="elementindex.html#d">d</a>
- <a class="index-letter" href="elementindex.html#e">e</a>
- <a class="index-letter" href="elementindex.html#g">g</a>
- <a class="index-letter" href="elementindex.html#h">h</a>
- <a class="index-letter" href="elementindex.html#l">l</a>
- <a class="index-letter" href="elementindex.html#o">o</a>
- <a class="index-letter" href="elementindex.html#p">p</a>
- <a class="index-letter" href="elementindex.html#r">r</a>
- <a class="index-letter" href="elementindex.html#s">s</a>
-</div>
-
- <a name="a"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">a</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">add_keyword</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodadd_keyword">GeSHi::add_keyword()</a> in geshi.php</div>
- <div class="index-item-description">Adds a keyword to a keyword group for highlighting</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">add_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodadd_keyword_group">GeSHi::add_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">Creates a new keyword group</div>
- </dd>
- </dl>
- <a name="d"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">d</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">disable_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methoddisable_highlighting">GeSHi::disable_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Disables all highlighting</div>
- </dd>
- </dl>
- <a name="e"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">e</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_classes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_classes">GeSHi::enable_classes()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether CSS classes should be used to highlight the source. Default is off, calling this method with no arguments will turn it on</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_highlighting">GeSHi::enable_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Enables all highlighting</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_ids</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_ids">GeSHi::enable_ids()</a> in geshi.php</div>
- <div class="index-item-description">Whether CSS IDs should be added to each line</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_important_blocks</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_important_blocks">GeSHi::enable_important_blocks()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether context-important blocks are highlighted</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_inner_code_block</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_inner_code_block">GeSHi::enable_inner_code_block()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether to force a surrounding block around the highlighted code or not</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_keyword_links</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_keyword_links">GeSHi::enable_keyword_links()</a> in geshi.php</div>
- <div class="index-item-description">Turns linking of keywords on or off.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_line_numbers</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_line_numbers">GeSHi::enable_line_numbers()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether line numbers should be displayed.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_multiline_span</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_multiline_span">GeSHi::enable_multiline_span()</a> in geshi.php</div>
- <div class="index-item-description">Sets wether spans and other HTML markup generated by GeSHi can span over multiple lines or not. Defaults to true to reduce overhead.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_strict_mode</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_strict_mode">GeSHi::enable_strict_mode()</a> in geshi.php</div>
- <div class="index-item-description">Enables/disables strict highlighting. Default is off, calling this method without parameters will turn it on. See documentation for more details on strict mode and where to use it.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">error</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methoderror">GeSHi::error()</a> in geshi.php</div>
- <div class="index-item-description">Returns an error message associated with the last GeSHi operation, or false if no error has occured</div>
- </dd>
- </dl>
- <a name="g"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">g</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Constructor.png" alt="Method" title="Method" /></title>
- <span class="method-title">GeSHi</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodGeSHi">GeSHi::GeSHi()</a> in geshi.php</div>
- <div class="index-item-description">Creates a new GeSHi object, with source and language</div>
- </dd>
- <dt class="field">
- <img src="media/images/Class.png" alt="Class" title="Class" /></title>
- GeSHi
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html">GeSHi</a> in geshi.php</div>
- <div class="index-item-description">The GeSHi Class.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Page.png" alt="Page" title="Page" /></title>
- <span class="include-title">geshi.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html">geshi.php</a> in geshi.php</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_ACTIVE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_ACTIVE">GESHI_ACTIVE</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :active state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_CAPS_LOWER</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_CAPS_LOWER">GESHI_CAPS_LOWER</a> in geshi.php</div>
- <div class="index-item-description">Leave keywords found as the case that they are</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_CAPS_NO_CHANGE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_CAPS_NO_CHANGE">GESHI_CAPS_NO_CHANGE</a> in geshi.php</div>
- <div class="index-item-description">Lowercase keywords found</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_CAPS_UPPER</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_CAPS_UPPER">GESHI_CAPS_UPPER</a> in geshi.php</div>
- <div class="index-item-description">Uppercase keywords found</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_END_IMPORTANT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_END_IMPORTANT">GESHI_END_IMPORTANT</a> in geshi.php</div>
- <div class="index-item-description">The ender for important parts of the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_FANCY_LINE_NUMBERS</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS">GESHI_FANCY_LINE_NUMBERS</a> in geshi.php</div>
- <div class="index-item-description">Use fancy line numbers when building the result</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_DIV</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_DIV">GESHI_HEADER_DIV</a> in geshi.php</div>
- <div class="index-item-description">Use a &quot;div&quot; to surround the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_NONE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_NONE">GESHI_HEADER_NONE</a> in geshi.php</div>
- <div class="index-item-description">Use nothing to surround the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_PRE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE">GESHI_HEADER_PRE</a> in geshi.php</div>
- <div class="index-item-description">Use a &quot;pre&quot; to surround the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_PRE_TABLE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE">GESHI_HEADER_PRE_TABLE</a> in geshi.php</div>
- <div class="index-item-description">Use a &quot;table&quot; to surround the source:</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_PRE_VALID</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID">GESHI_HEADER_PRE_VALID</a> in geshi.php</div>
- <div class="index-item-description">Use a pre to wrap lines when line numbers are enabled or to wrap the whole code.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Function.png" alt="Function" title="Function" /></title>
- <span class="method-title">geshi_highlight</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#functiongeshi_highlight">geshi_highlight()</a> in geshi.php</div>
- <div class="index-item-description">Easy way to highlight stuff. Behaves just like highlight_string</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HOVER</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HOVER">GESHI_HOVER</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :hover state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_LANG_ROOT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_LANG_ROOT">GESHI_LANG_ROOT</a> in geshi.php</div>
- <div class="index-item-description">The language file directory for GeSHi</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_LINK</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_LINK">GESHI_LINK</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :link state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_NORMAL_LINE_NUMBERS</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_NORMAL_LINE_NUMBERS">GESHI_NORMAL_LINE_NUMBERS</a> in geshi.php</div>
- <div class="index-item-description">Use normal line numbers when building the result</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_NO_LINE_NUMBERS</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a> in geshi.php</div>
- <div class="index-item-description">Use no line numbers when building the result</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_ROOT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_ROOT">GESHI_ROOT</a> in geshi.php</div>
- <div class="index-item-description">The root directory for GeSHi</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_SECURITY_PARANOID</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_SECURITY_PARANOID">GESHI_SECURITY_PARANOID</a> in geshi.php</div>
- <div class="index-item-description">Tells GeSHi to be paranoid about security settings</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_START_IMPORTANT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a> in geshi.php</div>
- <div class="index-item-description">The starter for important parts of the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_VERSION</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_VERSION">GESHI_VERSION</a> in geshi.php</div>
- <div class="index-item-description">The version of this GeSHi file</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_VISITED</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_VISITED">GESHI_VISITED</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :visited state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_language_name</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_language_name">GeSHi::get_language_name()</a> in geshi.php</div>
- <div class="index-item-description">Gets a human-readable language name (thanks to Simon Patterson for the idea :))</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_language_name_from_extension</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_language_name_from_extension">GeSHi::get_language_name_from_extension()</a> in geshi.php</div>
- <div class="index-item-description">Given a file extension, this method returns either a valid geshi language name, or the empty string if it couldn't be found</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_multiline_span</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_multiline_span">GeSHi::get_multiline_span()</a> in geshi.php</div>
- <div class="index-item-description">Get current setting for multiline spans, see GeSHi-&gt;enable_multiline_span().</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_real_tab_width</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_real_tab_width">GeSHi::get_real_tab_width()</a> in geshi.php</div>
- <div class="index-item-description">Returns the tab width to use, based on the current language and user preference</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_stylesheet</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_stylesheet">GeSHi::get_stylesheet()</a> in geshi.php</div>
- <div class="index-item-description">Returns a stylesheet for the highlighted code. If $economy mode is true, we only return the stylesheet declarations that matter for this code block instead of the whole thing</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_time</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_time">GeSHi::get_time()</a> in geshi.php</div>
- <div class="index-item-description">Gets the time taken to parse the code</div>
- </dd>
- </dl>
- <a name="h"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">h</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">highlight_lines_extra</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodhighlight_lines_extra">GeSHi::highlight_lines_extra()</a> in geshi.php</div>
- <div class="index-item-description">Specifies which lines to highlight extra</div>
- </dd>
- </dl>
- <a name="l"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">l</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">load_from_file</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodload_from_file">GeSHi::load_from_file()</a> in geshi.php</div>
- <div class="index-item-description">Given a file name, this method loads its contents in, and attempts</div>
- </dd>
- </dl>
- <a name="o"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">o</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">optimize_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodoptimize_keyword_group">GeSHi::optimize_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">compile optimized regexp list for keyword group</div>
- </dd>
- </dl>
- <a name="p"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">p</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">parse_code</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodparse_code">GeSHi::parse_code()</a> in geshi.php</div>
- <div class="index-item-description">Returns the code in $this-&gt;source, highlighted and surrounded by the nessecary HTML.</div>
- </dd>
- </dl>
- <a name="r"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">r</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">remove_keyword</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodremove_keyword">GeSHi::remove_keyword()</a> in geshi.php</div>
- <div class="index-item-description">Removes a keyword from a keyword group</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">remove_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodremove_keyword_group">GeSHi::remove_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">Removes a keyword group</div>
- </dd>
- </dl>
- <a name="s"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">s</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_brackets_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_brackets_highlighting">GeSHi::set_brackets_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for brackets</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_brackets_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_brackets_style">GeSHi::set_brackets_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for brackets. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_case_keywords</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_case_keywords">GeSHi::set_case_keywords()</a> in geshi.php</div>
- <div class="index-item-description">Sets the case that keywords should use when found. Use the constants:</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_case_sensitivity</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_case_sensitivity">GeSHi::set_case_sensitivity()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether a set of keywords are checked for in a case sensitive manner</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_code_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_code_style">GeSHi::set_code_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for the actual code. This should be a string</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_comments_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_comments_highlighting">GeSHi::set_comments_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for comment groups</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_comments_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_comments_style">GeSHi::set_comments_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for comment groups. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_encoding</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_encoding">GeSHi::set_encoding()</a> in geshi.php</div>
- <div class="index-item-description">Sets the encoding used for htmlspecialchars(), for international support.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_escape_characters_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_escape_characters_highlighting">GeSHi::set_escape_characters_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for escaped characters</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_escape_characters_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_escape_characters_style">GeSHi::set_escape_characters_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for escaped characters. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_footer_content</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_footer_content">GeSHi::set_footer_content()</a> in geshi.php</div>
- <div class="index-item-description">Sets the content of the footer block</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_footer_content_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_footer_content_style">GeSHi::set_footer_content_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for the footer content</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_header_content</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_header_content">GeSHi::set_header_content()</a> in geshi.php</div>
- <div class="index-item-description">Sets the content of the header block</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_header_content_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_header_content_style">GeSHi::set_header_content_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for the header content</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_header_type</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_header_type">GeSHi::set_header_type()</a> in geshi.php</div>
- <div class="index-item-description">Sets the type of header to be used.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_highlight_lines_extra_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_highlight_lines_extra_style">GeSHi::set_highlight_lines_extra_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for extra-highlighted lines</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_important_styles</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_important_styles">GeSHi::set_important_styles()</a> in geshi.php</div>
- <div class="index-item-description">Sets styles for important parts of the code</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_keyword_group_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_keyword_group_highlighting">GeSHi::set_keyword_group_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for a keyword group</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_keyword_group_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_keyword_group_style">GeSHi::set_keyword_group_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for a keyword group. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_language</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_language">GeSHi::set_language()</a> in geshi.php</div>
- <div class="index-item-description">Sets the language for this object</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_language_path</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_language_path">GeSHi::set_language_path()</a> in geshi.php</div>
- <div class="index-item-description">Sets the path to the directory containing the language files. Note that this path is relative to the directory of the script that included geshi.php, NOT geshi.php itself.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_line_ending</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_line_ending">GeSHi::set_line_ending()</a> in geshi.php</div>
- <div class="index-item-description">Sets the line-ending</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_line_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_line_style">GeSHi::set_line_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for the line numbers.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_link_styles</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_link_styles">GeSHi::set_link_styles()</a> in geshi.php</div>
- <div class="index-item-description">Sets styles for links in code</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_link_target</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_link_target">GeSHi::set_link_target()</a> in geshi.php</div>
- <div class="index-item-description">Sets the target for links in code</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_methods_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_methods_highlighting">GeSHi::set_methods_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for methods</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_methods_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_methods_style">GeSHi::set_methods_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for methods. $key is a number that references the</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_numbers_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_numbers_highlighting">GeSHi::set_numbers_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for numbers</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_numbers_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_numbers_style">GeSHi::set_numbers_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for numbers. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_overall_class</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_overall_class">GeSHi::set_overall_class()</a> in geshi.php</div>
- <div class="index-item-description">Sets the overall classname for this block of code. This class can then be used in a stylesheet to style this object's output</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_overall_id</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_overall_id">GeSHi::set_overall_id()</a> in geshi.php</div>
- <div class="index-item-description">Sets the overall id for this block of code. This id can then be used in a stylesheet to style this object's output</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_overall_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_overall_style">GeSHi::set_overall_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for the code that will be outputted when this object is parsed. The style should be a string of valid stylesheet declarations</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_regexps_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_regexps_highlighting">GeSHi::set_regexps_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for regexps</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_regexps_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_regexps_style">GeSHi::set_regexps_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for regexps. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_source</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_source">GeSHi::set_source()</a> in geshi.php</div>
- <div class="index-item-description">Sets the source code for this object</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_strings_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_strings_highlighting">GeSHi::set_strings_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for strings</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_strings_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_strings_style">GeSHi::set_strings_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for strings. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_symbols_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_symbols_highlighting">GeSHi::set_symbols_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for symbols</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_symbols_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_symbols_style">GeSHi::set_symbols_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for symbols. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_tab_width</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_tab_width">GeSHi::set_tab_width()</a> in geshi.php</div>
- <div class="index-item-description">Sets how many spaces a tab is substituted for</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_url_for_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_url_for_keyword_group">GeSHi::set_url_for_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">Sets the base URL to be used for keywords</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_use_language_tab_width</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_use_language_tab_width">GeSHi::set_use_language_tab_width()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether or not to use tab-stop width specifed by language</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">start_line_numbers_at</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodstart_line_numbers_at">GeSHi::start_line_numbers_at()</a> in geshi.php</div>
- <div class="index-item-description">Sets what number line numbers should start at. Should be a positive integer, and will be converted to one.</div>
- </dd>
- </dl>
-
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex.html#a">a</a>
- <a class="index-letter" href="elementindex.html#d">d</a>
- <a class="index-letter" href="elementindex.html#e">e</a>
- <a class="index-letter" href="elementindex.html#g">g</a>
- <a class="index-letter" href="elementindex.html#h">h</a>
- <a class="index-letter" href="elementindex.html#l">l</a>
- <a class="index-letter" href="elementindex.html#o">o</a>
- <a class="index-letter" href="elementindex.html#p">p</a>
- <a class="index-letter" href="elementindex.html#r">r</a>
- <a class="index-letter" href="elementindex.html#s">s</a>
-</div> </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/elementindex_geshi.html b/libvpx/examples/includes/geshi/docs/api/elementindex_geshi.html
deleted file mode 100644
index f319396..0000000
--- a/libvpx/examples/includes/geshi/docs/api/elementindex_geshi.html
+++ /dev/null
@@ -1,864 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <a name="top"></a>
-<h2>[geshi] element index</h2>
-<a href="elementindex.html">All elements</a>
-<br />
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex_geshi.html#a">a</a>
- <a class="index-letter" href="elementindex_geshi.html#d">d</a>
- <a class="index-letter" href="elementindex_geshi.html#e">e</a>
- <a class="index-letter" href="elementindex_geshi.html#g">g</a>
- <a class="index-letter" href="elementindex_geshi.html#h">h</a>
- <a class="index-letter" href="elementindex_geshi.html#l">l</a>
- <a class="index-letter" href="elementindex_geshi.html#o">o</a>
- <a class="index-letter" href="elementindex_geshi.html#p">p</a>
- <a class="index-letter" href="elementindex_geshi.html#r">r</a>
- <a class="index-letter" href="elementindex_geshi.html#s">s</a>
-</div>
-
- <a name="a"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">a</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">add_keyword</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodadd_keyword">GeSHi::add_keyword()</a> in geshi.php</div>
- <div class="index-item-description">Adds a keyword to a keyword group for highlighting</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">add_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodadd_keyword_group">GeSHi::add_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">Creates a new keyword group</div>
- </dd>
- </dl>
- <a name="d"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">d</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">disable_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methoddisable_highlighting">GeSHi::disable_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Disables all highlighting</div>
- </dd>
- </dl>
- <a name="e"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">e</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_classes</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_classes">GeSHi::enable_classes()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether CSS classes should be used to highlight the source. Default is off, calling this method with no arguments will turn it on</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_highlighting">GeSHi::enable_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Enables all highlighting</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_ids</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_ids">GeSHi::enable_ids()</a> in geshi.php</div>
- <div class="index-item-description">Whether CSS IDs should be added to each line</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_important_blocks</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_important_blocks">GeSHi::enable_important_blocks()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether context-important blocks are highlighted</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_inner_code_block</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_inner_code_block">GeSHi::enable_inner_code_block()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether to force a surrounding block around the highlighted code or not</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_keyword_links</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_keyword_links">GeSHi::enable_keyword_links()</a> in geshi.php</div>
- <div class="index-item-description">Turns linking of keywords on or off.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_line_numbers</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_line_numbers">GeSHi::enable_line_numbers()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether line numbers should be displayed.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_multiline_span</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_multiline_span">GeSHi::enable_multiline_span()</a> in geshi.php</div>
- <div class="index-item-description">Sets wether spans and other HTML markup generated by GeSHi can span over multiple lines or not. Defaults to true to reduce overhead.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">enable_strict_mode</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodenable_strict_mode">GeSHi::enable_strict_mode()</a> in geshi.php</div>
- <div class="index-item-description">Enables/disables strict highlighting. Default is off, calling this method without parameters will turn it on. See documentation for more details on strict mode and where to use it.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">error</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methoderror">GeSHi::error()</a> in geshi.php</div>
- <div class="index-item-description">Returns an error message associated with the last GeSHi operation, or false if no error has occured</div>
- </dd>
- </dl>
- <a name="g"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">g</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Constructor.png" alt="Method" title="Method" /></title>
- <span class="method-title">GeSHi</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodGeSHi">GeSHi::GeSHi()</a> in geshi.php</div>
- <div class="index-item-description">Creates a new GeSHi object, with source and language</div>
- </dd>
- <dt class="field">
- <img src="media/images/Class.png" alt="Class" title="Class" /></title>
- GeSHi
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html">GeSHi</a> in geshi.php</div>
- <div class="index-item-description">The GeSHi Class.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Page.png" alt="Page" title="Page" /></title>
- <span class="include-title">geshi.php</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html">geshi.php</a> in geshi.php</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_ACTIVE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_ACTIVE">GESHI_ACTIVE</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :active state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_CAPS_LOWER</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_CAPS_LOWER">GESHI_CAPS_LOWER</a> in geshi.php</div>
- <div class="index-item-description">Leave keywords found as the case that they are</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_CAPS_NO_CHANGE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_CAPS_NO_CHANGE">GESHI_CAPS_NO_CHANGE</a> in geshi.php</div>
- <div class="index-item-description">Lowercase keywords found</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_CAPS_UPPER</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_CAPS_UPPER">GESHI_CAPS_UPPER</a> in geshi.php</div>
- <div class="index-item-description">Uppercase keywords found</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_END_IMPORTANT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_END_IMPORTANT">GESHI_END_IMPORTANT</a> in geshi.php</div>
- <div class="index-item-description">The ender for important parts of the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_FANCY_LINE_NUMBERS</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_FANCY_LINE_NUMBERS">GESHI_FANCY_LINE_NUMBERS</a> in geshi.php</div>
- <div class="index-item-description">Use fancy line numbers when building the result</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_DIV</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_DIV">GESHI_HEADER_DIV</a> in geshi.php</div>
- <div class="index-item-description">Use a &quot;div&quot; to surround the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_NONE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_NONE">GESHI_HEADER_NONE</a> in geshi.php</div>
- <div class="index-item-description">Use nothing to surround the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_PRE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE">GESHI_HEADER_PRE</a> in geshi.php</div>
- <div class="index-item-description">Use a &quot;pre&quot; to surround the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_PRE_TABLE</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_TABLE">GESHI_HEADER_PRE_TABLE</a> in geshi.php</div>
- <div class="index-item-description">Use a &quot;table&quot; to surround the source:</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HEADER_PRE_VALID</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HEADER_PRE_VALID">GESHI_HEADER_PRE_VALID</a> in geshi.php</div>
- <div class="index-item-description">Use a pre to wrap lines when line numbers are enabled or to wrap the whole code.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Function.png" alt="Function" title="Function" /></title>
- <span class="method-title">geshi_highlight</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#functiongeshi_highlight">geshi_highlight()</a> in geshi.php</div>
- <div class="index-item-description">Easy way to highlight stuff. Behaves just like highlight_string</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_HOVER</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_HOVER">GESHI_HOVER</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :hover state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_LANG_ROOT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_LANG_ROOT">GESHI_LANG_ROOT</a> in geshi.php</div>
- <div class="index-item-description">The language file directory for GeSHi</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_LINK</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_LINK">GESHI_LINK</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :link state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_NORMAL_LINE_NUMBERS</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_NORMAL_LINE_NUMBERS">GESHI_NORMAL_LINE_NUMBERS</a> in geshi.php</div>
- <div class="index-item-description">Use normal line numbers when building the result</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_NO_LINE_NUMBERS</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_NO_LINE_NUMBERS">GESHI_NO_LINE_NUMBERS</a> in geshi.php</div>
- <div class="index-item-description">Use no line numbers when building the result</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_ROOT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_ROOT">GESHI_ROOT</a> in geshi.php</div>
- <div class="index-item-description">The root directory for GeSHi</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_SECURITY_PARANOID</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_SECURITY_PARANOID">GESHI_SECURITY_PARANOID</a> in geshi.php</div>
- <div class="index-item-description">Tells GeSHi to be paranoid about security settings</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_START_IMPORTANT</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_START_IMPORTANT">GESHI_START_IMPORTANT</a> in geshi.php</div>
- <div class="index-item-description">The starter for important parts of the source</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_VERSION</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_VERSION">GESHI_VERSION</a> in geshi.php</div>
- <div class="index-item-description">The version of this GeSHi file</div>
- </dd>
- <dt class="field">
- <img src="media/images/Constant.png" alt="Constant" title="Constant" /></title>
- <span class="const-title">GESHI_VISITED</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/_geshi.php.html#defineGESHI_VISITED">GESHI_VISITED</a> in geshi.php</div>
- <div class="index-item-description">Links in the source in the :visited state</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_language_name</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_language_name">GeSHi::get_language_name()</a> in geshi.php</div>
- <div class="index-item-description">Gets a human-readable language name (thanks to Simon Patterson for the idea :))</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_language_name_from_extension</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_language_name_from_extension">GeSHi::get_language_name_from_extension()</a> in geshi.php</div>
- <div class="index-item-description">Given a file extension, this method returns either a valid geshi language name, or the empty string if it couldn't be found</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_multiline_span</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_multiline_span">GeSHi::get_multiline_span()</a> in geshi.php</div>
- <div class="index-item-description">Get current setting for multiline spans, see GeSHi-&gt;enable_multiline_span().</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_real_tab_width</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_real_tab_width">GeSHi::get_real_tab_width()</a> in geshi.php</div>
- <div class="index-item-description">Returns the tab width to use, based on the current language and user preference</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_stylesheet</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_stylesheet">GeSHi::get_stylesheet()</a> in geshi.php</div>
- <div class="index-item-description">Returns a stylesheet for the highlighted code. If $economy mode is true, we only return the stylesheet declarations that matter for this code block instead of the whole thing</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">get_time</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodget_time">GeSHi::get_time()</a> in geshi.php</div>
- <div class="index-item-description">Gets the time taken to parse the code</div>
- </dd>
- </dl>
- <a name="h"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">h</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">highlight_lines_extra</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodhighlight_lines_extra">GeSHi::highlight_lines_extra()</a> in geshi.php</div>
- <div class="index-item-description">Specifies which lines to highlight extra</div>
- </dd>
- </dl>
- <a name="l"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">l</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">load_from_file</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodload_from_file">GeSHi::load_from_file()</a> in geshi.php</div>
- <div class="index-item-description">Given a file name, this method loads its contents in, and attempts</div>
- </dd>
- </dl>
- <a name="o"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">o</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">optimize_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodoptimize_keyword_group">GeSHi::optimize_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">compile optimized regexp list for keyword group</div>
- </dd>
- </dl>
- <a name="p"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">p</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">parse_code</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodparse_code">GeSHi::parse_code()</a> in geshi.php</div>
- <div class="index-item-description">Returns the code in $this-&gt;source, highlighted and surrounded by the nessecary HTML.</div>
- </dd>
- </dl>
- <a name="r"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">r</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">remove_keyword</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodremove_keyword">GeSHi::remove_keyword()</a> in geshi.php</div>
- <div class="index-item-description">Removes a keyword from a keyword group</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">remove_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodremove_keyword_group">GeSHi::remove_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">Removes a keyword group</div>
- </dd>
- </dl>
- <a name="s"></a>
- <div class="index-letter-section">
- <div style="float: left" class="index-letter-title">s</div>
- <div style="float: right"><a href="#top">top</a></div>
- <div style="clear: both"></div>
- </div>
- <dl>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_brackets_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_brackets_highlighting">GeSHi::set_brackets_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for brackets</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_brackets_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_brackets_style">GeSHi::set_brackets_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for brackets. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_case_keywords</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_case_keywords">GeSHi::set_case_keywords()</a> in geshi.php</div>
- <div class="index-item-description">Sets the case that keywords should use when found. Use the constants:</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_case_sensitivity</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_case_sensitivity">GeSHi::set_case_sensitivity()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether a set of keywords are checked for in a case sensitive manner</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_code_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_code_style">GeSHi::set_code_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for the actual code. This should be a string</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_comments_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_comments_highlighting">GeSHi::set_comments_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for comment groups</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_comments_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_comments_style">GeSHi::set_comments_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for comment groups. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_encoding</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_encoding">GeSHi::set_encoding()</a> in geshi.php</div>
- <div class="index-item-description">Sets the encoding used for htmlspecialchars(), for international support.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_escape_characters_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_escape_characters_highlighting">GeSHi::set_escape_characters_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for escaped characters</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_escape_characters_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_escape_characters_style">GeSHi::set_escape_characters_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for escaped characters. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_footer_content</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_footer_content">GeSHi::set_footer_content()</a> in geshi.php</div>
- <div class="index-item-description">Sets the content of the footer block</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_footer_content_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_footer_content_style">GeSHi::set_footer_content_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for the footer content</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_header_content</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_header_content">GeSHi::set_header_content()</a> in geshi.php</div>
- <div class="index-item-description">Sets the content of the header block</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_header_content_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_header_content_style">GeSHi::set_header_content_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for the header content</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_header_type</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_header_type">GeSHi::set_header_type()</a> in geshi.php</div>
- <div class="index-item-description">Sets the type of header to be used.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_highlight_lines_extra_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_highlight_lines_extra_style">GeSHi::set_highlight_lines_extra_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for extra-highlighted lines</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_important_styles</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_important_styles">GeSHi::set_important_styles()</a> in geshi.php</div>
- <div class="index-item-description">Sets styles for important parts of the code</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_keyword_group_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_keyword_group_highlighting">GeSHi::set_keyword_group_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for a keyword group</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_keyword_group_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_keyword_group_style">GeSHi::set_keyword_group_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the style for a keyword group. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_language</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_language">GeSHi::set_language()</a> in geshi.php</div>
- <div class="index-item-description">Sets the language for this object</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_language_path</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_language_path">GeSHi::set_language_path()</a> in geshi.php</div>
- <div class="index-item-description">Sets the path to the directory containing the language files. Note that this path is relative to the directory of the script that included geshi.php, NOT geshi.php itself.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_line_ending</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_line_ending">GeSHi::set_line_ending()</a> in geshi.php</div>
- <div class="index-item-description">Sets the line-ending</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_line_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_line_style">GeSHi::set_line_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for the line numbers.</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_link_styles</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_link_styles">GeSHi::set_link_styles()</a> in geshi.php</div>
- <div class="index-item-description">Sets styles for links in code</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_link_target</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_link_target">GeSHi::set_link_target()</a> in geshi.php</div>
- <div class="index-item-description">Sets the target for links in code</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_methods_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_methods_highlighting">GeSHi::set_methods_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for methods</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_methods_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_methods_style">GeSHi::set_methods_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for methods. $key is a number that references the</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_numbers_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_numbers_highlighting">GeSHi::set_numbers_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for numbers</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_numbers_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_numbers_style">GeSHi::set_numbers_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for numbers. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_overall_class</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_overall_class">GeSHi::set_overall_class()</a> in geshi.php</div>
- <div class="index-item-description">Sets the overall classname for this block of code. This class can then be used in a stylesheet to style this object's output</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_overall_id</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_overall_id">GeSHi::set_overall_id()</a> in geshi.php</div>
- <div class="index-item-description">Sets the overall id for this block of code. This id can then be used in a stylesheet to style this object's output</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_overall_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_overall_style">GeSHi::set_overall_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for the code that will be outputted when this object is parsed. The style should be a string of valid stylesheet declarations</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_regexps_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_regexps_highlighting">GeSHi::set_regexps_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for regexps</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_regexps_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_regexps_style">GeSHi::set_regexps_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for regexps. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_source</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_source">GeSHi::set_source()</a> in geshi.php</div>
- <div class="index-item-description">Sets the source code for this object</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_strings_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_strings_highlighting">GeSHi::set_strings_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for strings</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_strings_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_strings_style">GeSHi::set_strings_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for strings. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_symbols_highlighting</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_symbols_highlighting">GeSHi::set_symbols_highlighting()</a> in geshi.php</div>
- <div class="index-item-description">Turns highlighting on/off for symbols</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_symbols_style</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_symbols_style">GeSHi::set_symbols_style()</a> in geshi.php</div>
- <div class="index-item-description">Sets the styles for symbols. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_tab_width</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_tab_width">GeSHi::set_tab_width()</a> in geshi.php</div>
- <div class="index-item-description">Sets how many spaces a tab is substituted for</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_url_for_keyword_group</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_url_for_keyword_group">GeSHi::set_url_for_keyword_group()</a> in geshi.php</div>
- <div class="index-item-description">Sets the base URL to be used for keywords</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">set_use_language_tab_width</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodset_use_language_tab_width">GeSHi::set_use_language_tab_width()</a> in geshi.php</div>
- <div class="index-item-description">Sets whether or not to use tab-stop width specifed by language</div>
- </dd>
- <dt class="field">
- <img src="media/images/Method.png" alt="Method" title="Method" /></title>
- <span class="method-title">start_line_numbers_at</span>
- </dt>
- <dd class="index-item-body">
- <div class="index-item-details"><a href="geshi/core/GeSHi.html#methodstart_line_numbers_at">GeSHi::start_line_numbers_at()</a> in geshi.php</div>
- <div class="index-item-description">Sets what number line numbers should start at. Should be a positive integer, and will be converted to one.</div>
- </dd>
- </dl>
-
-<div class="index-letter-menu">
- <a class="index-letter" href="elementindex_geshi.html#a">a</a>
- <a class="index-letter" href="elementindex_geshi.html#d">d</a>
- <a class="index-letter" href="elementindex_geshi.html#e">e</a>
- <a class="index-letter" href="elementindex_geshi.html#g">g</a>
- <a class="index-letter" href="elementindex_geshi.html#h">h</a>
- <a class="index-letter" href="elementindex_geshi.html#l">l</a>
- <a class="index-letter" href="elementindex_geshi.html#o">o</a>
- <a class="index-letter" href="elementindex_geshi.html#p">p</a>
- <a class="index-letter" href="elementindex_geshi.html#r">r</a>
- <a class="index-letter" href="elementindex_geshi.html#s">s</a>
-</div> </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/errors.html b/libvpx/examples/includes/geshi/docs/api/errors.html
deleted file mode 100644
index c917f03..0000000
--- a/libvpx/examples/includes/geshi/docs/api/errors.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>phpDocumentor Parser Errors and Warnings</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <a href="#Post-parsing">Post-parsing</a><br>
-<a name="geshi.php"></a>
-<h1>geshi.php</h1>
-<h2>Errors:</h2><br>
-<b>Error on line 569</b> - DocBlock has multiple @access tags, illegal. ignoring additional tag "@access private"<br>
- <p class="notes" id="credit">
- Documentation generated on Thu, 25 Dec 2008 14:34:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/geshi/core/GeSHi.html b/libvpx/examples/includes/geshi/docs/api/geshi/core/GeSHi.html
deleted file mode 100644
index a8ccc7d..0000000
--- a/libvpx/examples/includes/geshi/docs/api/geshi/core/GeSHi.html
+++ /dev/null
@@ -1,2676 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs For Class GeSHi</title>
- <link rel="stylesheet" href="../../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="class-name"><img src="../../media/images/Class_logo.png"
- alt=" Class"
- title=" Class"
- style="vertical-align: middle"> GeSHi</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
-
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The GeSHi Class.</p>
-<p class="description"><p>Please refer to the documentation for GeSHi 1.0.X that is available at http://qbnz.com/highlighter/documentation.php for more information about how to use this class.</p></p>
- <ul class="tags">
- <li><span class="field">author:</span> Nigel McNie &lt;<a href="mailto:nigel@geshi.org">nigel@geshi.org</a>&gt;, Benny Baumann &lt;BenBE@omorphia.de&gt;</li>
- <li><span class="field">copyright:</span> (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann</li>
- </ul>
- <p class="notes">
- Located in <a class="field" href="_geshi.php.html">/geshi.php</a> (line <span class="field"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a253">253</a></span>)
- </p>
-
-
- <pre></pre>
-
- </div>
-</div>
-
-
-
-
- <a name="sec-method-summary"></a>
- <div class="info-box">
- <div class="info-box-title">Method Summary</span></div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
- </div>
- <div class="info-box-body">
- <div class="method-summary">
- <div class="method-definition">
- <img src="../../media/images/Constructor.png" alt=" "/>
- <span class="method-result">GeSHi</span>
- <a href="#GeSHi" title="details" class="method-name">GeSHi</a>
- ([<span class="var-type">string</span>&nbsp;<span class="var-name">$source</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$language</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span> = <span class="var-default">''</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#add_keyword" title="details" class="method-name">add_keyword</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$word</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#add_keyword_group" title="details" class="method-name">add_keyword_group</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$case_sensitive</span> = <span class="var-default">true</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$words</span> = <span class="var-default">array()</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#disable_highlighting" title="details" class="method-name">disable_highlighting</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_classes" title="details" class="method-name">enable_classes</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_highlighting" title="details" class="method-name">enable_highlighting</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_ids" title="details" class="method-name">enable_ids</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_important_blocks" title="details" class="method-name">enable_important_blocks</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_inner_code_block" title="details" class="method-name">enable_inner_code_block</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_keyword_links" title="details" class="method-name">enable_keyword_links</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$enable</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_line_numbers" title="details" class="method-name">enable_line_numbers</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$flag</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$nth_row</span> = <span class="var-default">5</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_multiline_span" title="details" class="method-name">enable_multiline_span</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#enable_strict_mode" title="details" class="method-name">enable_strict_mode</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">string|false</span>
- <a href="#error" title="details" class="method-name">error</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">string</span>
- <a href="#get_language_name" title="details" class="method-name">get_language_name</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#get_language_name_from_extension" title="details" class="method-name">get_language_name_from_extension</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$extension</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$lookup</span> = <span class="var-default">array()</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">bool</span>
- <a href="#get_multiline_span" title="details" class="method-name">get_multiline_span</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">int</span>
- <a href="#get_real_tab_width" title="details" class="method-name">get_real_tab_width</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">string</span>
- <a href="#get_stylesheet" title="details" class="method-name">get_stylesheet</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$economy_mode</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">double</span>
- <a href="#get_time" title="details" class="method-name">get_time</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#highlight_lines_extra" title="details" class="method-name">highlight_lines_extra</a>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$lines</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span> = <span class="var-default">null</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#load_from_file" title="details" class="method-name">load_from_file</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$file_name</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$lookup</span> = <span class="var-default">array()</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#optimize_keyword_group" title="details" class="method-name">optimize_keyword_group</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#parse_code" title="details" class="method-name">parse_code</a>
- ()
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#remove_keyword" title="details" class="method-name">remove_keyword</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$word</span>, [<span class="var-type">bool</span>&nbsp;<span class="var-name">$recompile</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#remove_keyword_group" title="details" class="method-name">remove_keyword_group</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_brackets_highlighting" title="details" class="method-name">set_brackets_highlighting</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_brackets_style" title="details" class="method-name">set_brackets_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_case_keywords" title="details" class="method-name">set_case_keywords</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$case</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_case_sensitivity" title="details" class="method-name">set_case_sensitivity</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$case</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_code_style" title="details" class="method-name">set_code_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_comments_highlighting" title="details" class="method-name">set_comments_highlighting</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_comments_style" title="details" class="method-name">set_comments_style</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_encoding" title="details" class="method-name">set_encoding</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_escape_characters_highlighting" title="details" class="method-name">set_escape_characters_highlighting</a>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_escape_characters_style" title="details" class="method-name">set_escape_characters_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_footer_content" title="details" class="method-name">set_footer_content</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$content</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_footer_content_style" title="details" class="method-name">set_footer_content_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_header_content" title="details" class="method-name">set_header_content</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$content</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_header_content_style" title="details" class="method-name">set_header_content_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_header_type" title="details" class="method-name">set_header_type</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$type</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_highlight_lines_extra_style" title="details" class="method-name">set_highlight_lines_extra_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_important_styles" title="details" class="method-name">set_important_styles</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_keyword_group_highlighting" title="details" class="method-name">set_keyword_group_highlighting</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_keyword_group_style" title="details" class="method-name">set_keyword_group_style</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_language" title="details" class="method-name">set_language</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$language</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$force_reset</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_language_path" title="details" class="method-name">set_language_path</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_line_ending" title="details" class="method-name">set_line_ending</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$line_ending</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_line_style" title="details" class="method-name">set_line_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style1</span>, [<span class="var-type">string|boolean</span>&nbsp;<span class="var-name">$style2</span> = <span class="var-default">''</span>], [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_link_styles" title="details" class="method-name">set_link_styles</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_link_target" title="details" class="method-name">set_link_target</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$target</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_methods_highlighting" title="details" class="method-name">set_methods_highlighting</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_methods_style" title="details" class="method-name">set_methods_style</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_numbers_highlighting" title="details" class="method-name">set_numbers_highlighting</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_numbers_style" title="details" class="method-name">set_numbers_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_overall_class" title="details" class="method-name">set_overall_class</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$class</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_overall_id" title="details" class="method-name">set_overall_id</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$id</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_overall_style" title="details" class="method-name">set_overall_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_regexps_highlighting" title="details" class="method-name">set_regexps_highlighting</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_regexps_style" title="details" class="method-name">set_regexps_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_source" title="details" class="method-name">set_source</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$source</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_strings_highlighting" title="details" class="method-name">set_strings_highlighting</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_strings_style" title="details" class="method-name">set_strings_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_symbols_highlighting" title="details" class="method-name">set_symbols_highlighting</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_symbols_style" title="details" class="method-name">set_symbols_style</a>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$group</span> = <span class="var-default">0</span>])
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_tab_width" title="details" class="method-name">set_tab_width</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$width</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_url_for_keyword_group" title="details" class="method-name">set_url_for_keyword_group</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$group</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$url</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#set_use_language_tab_width" title="details" class="method-name">set_use_language_tab_width</a>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$use</span>)
- </div>
- <div class="method-definition">
- <img src="../../media/images/Method.png" alt=" "/>
- <span class="method-result">void</span>
- <a href="#start_line_numbers_at" title="details" class="method-name">start_line_numbers_at</a>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$number</span>)
- </div>
- </div>
- </div>
- </div>
-
-
- <a name="sec-methods"></a>
- <div class="info-box">
- <div class="info-box-title">Methods</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
-
- </div>
- <div class="info-box-body">
- <A NAME='method_detail'></A>
-<a name="methodGeSHi" id="GeSHi"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Constructor.png" />
- <span class="method-title">Constructor GeSHi</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a591">591</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Creates a new GeSHi object, with source and language</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">GeSHi</span>
- <span class="method-name">
- GeSHi
- </span>
- ([<span class="var-type">string</span>&nbsp;<span class="var-name">$source</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$language</span> = <span class="var-default">''</span>], [<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span> = <span class="var-default">''</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$source</span><span class="var-description">: The source code to highlight</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$language</span><span class="var-description">: The language to highlight the source with</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$path</span><span class="var-description">: The path to the language file directory. <strong>This
- is deprecated!</strong> I've backported the auto path detection from the 1.1.X dev branch, so now it should be automatically set correctly. If you have renamed the language directory however, you will still need to set the path using this parameter or GeSHi->set_language_path()</span> </li>
- </ul>
-
-
- </div>
-<a name="methodadd_keyword" id="add_keyword"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">add_keyword</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1441">1441</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Adds a keyword to a keyword group for highlighting</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- add_keyword
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$word</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to add the keyword to</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$word</span><span class="var-description">: The word to add to the keyword group</span> </li>
- </ul>
-
-
- </div>
-<a name="methodadd_keyword_group" id="add_keyword_group"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">add_keyword_group</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1487">1487</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Creates a new keyword group</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- add_keyword_group
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$case_sensitive</span> = <span class="var-default">true</span>], [<span class="var-type">array</span>&nbsp;<span class="var-name">$words</span> = <span class="var-default">array()</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to create</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$styles</span><span class="var-description">: The styles for the keyword group</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$case_sensitive</span><span class="var-description">: Whether the keyword group is case sensitive ornot</span> </li>
- <li>
- <span class="var-type">array</span>
- <span class="var-name">$words</span><span class="var-description">: The words to use for the keyword group</span> </li>
- </ul>
-
-
- </div>
-<a name="methoddisable_highlighting" id="disable_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">disable_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1288">1288</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Disables all highlighting</p>
- <ul class="tags">
- <li><span class="field">deprecated:</span> In favour of enable_highlighting</li>
- <li><span class="field">todo:</span> Rewrite with array traversal</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- disable_highlighting
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodenable_classes" id="enable_classes"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_classes</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a805">805</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets whether CSS classes should be used to highlight the source. Default is off, calling this method with no arguments will turn it on</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_classes
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn classes on or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_highlighting" id="enable_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1302">1302</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Enables all highlighting</p>
-<p class="description"><p>The optional flag parameter was added in version 1.0.7.21 and can be used to enable (true) or disable (false) all highlighting.</p></p>
- <ul class="tags">
- <li><span class="field">todo:</span> Rewrite with array traversal</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_highlighting
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: A flag specifying whether to enable or disable all highlighting</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_ids" id="enable_ids"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_ids</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1652">1652</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Whether CSS IDs should be added to each line</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_ids
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: If true, IDs will be added to each line.</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_important_blocks" id="enable_important_blocks"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_important_blocks</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1642">1642</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets whether context-important blocks are highlighted</p>
- <ul class="tags">
- <li><span class="field">deprecated:</span> </li>
- <li><span class="field">todo:</span> REMOVE THIS SHIZ FROM GESHI!</li>
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_important_blocks
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Tells whether to enable or disable highlighting of important blocks</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_inner_code_block" id="enable_inner_code_block"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_inner_code_block</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1581">1581</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets whether to force a surrounding block around the highlighted code or not</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.7.20</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_inner_code_block
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Tells whether to enable or disable this feature</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_keyword_links" id="enable_keyword_links"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_keyword_links</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1756">1756</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns linking of keywords on or off.</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_keyword_links
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$enable</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$enable</span><span class="var-description">: If true, links will be added to keywords</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_line_numbers" id="enable_line_numbers"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_line_numbers</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a878">878</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets whether line numbers should be displayed.</p>
-<p class="description"><p>Valid values for the first parameter are:</p><p><ul><li>GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed</li><li>GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed</li><li>GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed</li></ul> For fancy line numbers, the second parameter is used to signal which lines are to be fancy. For example, if the value of this parameter is 5 then every 5th line will be fancy.</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_line_numbers
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$flag</span>, [<span class="var-type">int</span>&nbsp;<span class="var-name">$nth_row</span> = <span class="var-default">5</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$flag</span><span class="var-description">: How line numbers should be displayed</span> </li>
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$nth_row</span><span class="var-description">: Defines which lines are fancy</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_multiline_span" id="enable_multiline_span"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_multiline_span</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a896">896</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets wether spans and other HTML markup generated by GeSHi can span over multiple lines or not. Defaults to true to reduce overhead.</p>
-<p class="description"><p>Set it to false if you want to manipulate the output or manually display the code in an ordered list.</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.7.22</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_multiline_span
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Wether multiline spans are allowed or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methodenable_strict_mode" id="enable_strict_mode"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">enable_strict_mode</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1275">1275</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Enables/disables strict highlighting. Default is off, calling this method without parameters will turn it on. See documentation for more details on strict mode and where to use it.</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- enable_strict_mode
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$mode</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$mode</span><span class="var-description">: Whether to enable strict mode or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methoderror" id="error"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">error</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a608">608</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Returns an error message associated with the last GeSHi operation, or false if no error has occured</p>
- <ul class="tags">
- <li><span class="field">return:</span> An error message if there has been an error, else false</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">string|false</span>
- <span class="method-name">
- error
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodget_language_name" id="get_language_name"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">get_language_name</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a632">632</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Gets a human-readable language name (thanks to Simon Patterson for the idea :))</p>
- <ul class="tags">
- <li><span class="field">return:</span> The name for the current language</li>
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">string</span>
- <span class="method-name">
- get_language_name
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodget_language_name_from_extension" id="get_language_name_from_extension"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">get_language_name_from_extension</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1329">1329</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Given a file extension, this method returns either a valid geshi language name, or the empty string if it couldn't be found</p>
- <ul class="tags">
- <li><span class="field">todo:</span> Re-think about how this method works (maybe make it private and/or make it a extension-&gt;lang lookup?)</li>
- <li><span class="field">todo:</span> static?</li>
- <li><span class="field">since:</span> 1.0.5</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- get_language_name_from_extension
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$extension</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$lookup</span> = <span class="var-default">array()</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$extension</span><span class="var-description">: The extension to get a language name for</span> </li>
- <li>
- <span class="var-type">array</span>
- <span class="var-name">$lookup</span><span class="var-description">: A lookup array to use instead of the default one</span> </li>
- </ul>
-
-
- </div>
-<a name="methodget_multiline_span" id="get_multiline_span"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">get_multiline_span</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a906">906</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Get current setting for multiline spans, see GeSHi-&gt;enable_multiline_span().</p>
- <ul class="tags">
- <li><span class="field">see:</span> <a href="../../geshi/core/GeSHi.html#methodenable_multiline_span">GeSHi::enable_multiline_span()</a></li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">bool</span>
- <span class="method-name">
- get_multiline_span
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodget_real_tab_width" id="get_real_tab_width"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">get_real_tab_width</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1258">1258</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Returns the tab width to use, based on the current language and user preference</p>
- <ul class="tags">
- <li><span class="field">return:</span> Tab width</li>
- <li><span class="field">since:</span> 1.0.7.20</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">int</span>
- <span class="method-name">
- get_real_tab_width
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodget_stylesheet" id="get_stylesheet"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">get_stylesheet</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a4177">4177</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Returns a stylesheet for the highlighted code. If $economy mode is true, we only return the stylesheet declarations that matter for this code block instead of the whole thing</p>
- <ul class="tags">
- <li><span class="field">return:</span> A stylesheet built on the data for the current language</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">string</span>
- <span class="method-name">
- get_stylesheet
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$economy_mode</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$economy_mode</span><span class="var-description">: Whether to use economy mode or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methodget_time" id="get_time"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">get_time</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a3524">3524</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Gets the time taken to parse the code</p>
- <ul class="tags">
- <li><span class="field">return:</span> The time taken to parse the code</li>
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">double</span>
- <span class="method-name">
- get_time
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodhighlight_lines_extra" id="highlight_lines_extra"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">highlight_lines_extra</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1670">1670</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Specifies which lines to highlight extra</p>
-<p class="description"><p>The extra style parameter was added in 1.0.7.21.</p></p>
- <ul class="tags">
- <li><span class="field">todo:</span> Some data replication here that could be cut down on</li>
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- highlight_lines_extra
- </span>
- (<span class="var-type">mixed</span>&nbsp;<span class="var-name">$lines</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span> = <span class="var-default">null</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">mixed</span>
- <span class="var-name">$lines</span><span class="var-description">: An array of line numbers to highlight, or just a line number on its own.</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: A string specifying the style to use for this line. If null is specified, the default style is used. If false is specified, the line will be removed from special highlighting</span> </li>
- </ul>
-
-
- </div>
-<a name="methodload_from_file" id="load_from_file"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">load_from_file</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1425">1425</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Given a file name, this method loads its contents in, and attempts</p>
-<p class="description"><p>to set the language automatically. An optional lookup table can be passed for looking up the language name. If not specified a default table is used</p><p>The language table is in the form <pre>array(
- 'lang_name' => array('extension', 'extension', ...),
- 'lang_name' ...
- );</pre></p></p>
- <ul class="tags">
- <li><span class="field">todo:</span> Complete rethink of this and above method</li>
- <li><span class="field">since:</span> 1.0.5</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- load_from_file
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$file_name</span>, [<span class="var-type">array</span>&nbsp;<span class="var-name">$lookup</span> = <span class="var-default">array()</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$file_name</span><span class="var-description">: The filename to load the source from</span> </li>
- <li>
- <span class="var-type">array</span>
- <span class="var-name">$lookup</span><span class="var-description">: A lookup array to use instead of the default one</span> </li>
- </ul>
-
-
- </div>
-<a name="methodoptimize_keyword_group" id="optimize_keyword_group"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">optimize_keyword_group</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1529">1529</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">compile optimized regexp list for keyword group</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.8</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- optimize_keyword_group
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to compile &amp; optimize</span> </li>
- </ul>
-
-
- </div>
-<a name="methodparse_code" id="parse_code"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">parse_code</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1992">1992</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Returns the code in $this-&gt;source, highlighted and surrounded by the nessecary HTML.</p>
-<p class="description"><p>This should only be called ONCE, cos it's SLOW! If you want to highlight the same source multiple times, you're better off doing a whole lot of str_replaces to replace the &amp;lt;span&amp;gt;s</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- parse_code
- </span>
- ()
- </div>
-
-
-
- </div>
-<a name="methodremove_keyword" id="remove_keyword"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">remove_keyword</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1466">1466</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Removes a keyword from a keyword group</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- remove_keyword
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$word</span>, [<span class="var-type">bool</span>&nbsp;<span class="var-name">$recompile</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to remove the keyword from</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$word</span><span class="var-description">: The word to remove from the keyword group</span> </li>
- <li>
- <span class="var-type">bool</span>
- <span class="var-name">$recompile</span><span class="var-description">: Wether to automatically recompile the optimized regexp list or not. Note: if you set this to false and @see GeSHi-&gt;parse_code() was already called once, for the current language, you have to manually call @see GeSHi-&gt;optimize_keyword_group() or the removed keyword will stay in cache and still be highlighted! On the other hand it might be too expensive to recompile the regexp list for every removal if you want to remove a lot of keywords.</span> </li>
- </ul>
-
-
- </div>
-<a name="methodremove_keyword_group" id="remove_keyword_group"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">remove_keyword_group</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1512">1512</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Removes a keyword group</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- remove_keyword_group
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to remove</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_brackets_highlighting" id="set_brackets_highlighting"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_brackets_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1036">1036</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for brackets</p>
-<p class="description"><p>This method is DEPRECATED: use set_symbols_highlighting instead. This method will be remove in 1.2.X</p></p>
- <ul class="tags">
- <li><span class="field">deprecated:</span> In favour of set_symbols_highlighting</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_brackets_highlighting
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for brackets on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_brackets_style" id="set_brackets_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_brackets_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1018">1018</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for brackets. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
-<p class="description"><p>This method is DEPRECATED: use set_symbols_style instead. This method will be removed in 1.2.X</p></p>
- <ul class="tags">
- <li><span class="field">deprecated:</span> In favour of set_symbols_style</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_brackets_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the brackets</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_case_keywords" id="set_case_keywords"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_case_keywords</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1216">1216</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the case that keywords should use when found. Use the constants:</p>
-<p class="description"><p><ul><li>GESHI_CAPS_NO_CHANGE: leave keywords as-is</li><li>GESHI_CAPS_UPPER: convert all keywords to uppercase where found</li><li>GESHI_CAPS_LOWER: convert all keywords to lowercase where found</li></ul></p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.1</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_case_keywords
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$case</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$case</span><span class="var-description">: A constant specifying what to do with matched keywords</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_case_sensitivity" id="set_case_sensitivity"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_case_sensitivity</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1202">1202</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets whether a set of keywords are checked for in a case sensitive manner</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_case_sensitivity
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$case</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to change the case sensitivity of</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$case</span><span class="var-description">: Whether to check in a case sensitive manner or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_code_style" id="set_code_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_code_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a824">824</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the style for the actual code. This should be a string</p>
-<p class="description"><p>containing valid stylesheet declarations. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p><p>Note: Use this method to override any style changes you made to the line numbers if you are using line numbers, else the line of code will have the same style as the line number! Consult the GeSHi documentation for more information about this.</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_code_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to use for actual code</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the current styles with the new styles</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_comments_highlighting" id="set_comments_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_comments_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a972">972</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for comment groups</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_comments_highlighting
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the comment group to turn on or off</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for that group on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_comments_style" id="set_comments_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_comments_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a957">957</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for comment groups. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_comments_style
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the comment group to change the styles of</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the comments</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_encoding" id="set_encoding"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_encoding</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1744">1744</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the encoding used for htmlspecialchars(), for international support.</p>
-<p class="description"><p>NOTE: This is not needed for now because htmlspecialchars() is not being used (it has a security hole in PHP4 that has not been patched). Maybe in a future version it may make a return for speed reasons, but I doubt it.</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.3</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_encoding
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$encoding</span><span class="var-description">: The encoding to use for the source</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_escape_characters_highlighting" id="set_escape_characters_highlighting"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_escape_characters_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1000">1000</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for escaped characters</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_escape_characters_highlighting
- </span>
- ([<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for escape characters on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_escape_characters_style" id="set_escape_characters_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_escape_characters_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a986">986</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for escaped characters. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_escape_characters_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the escape characters</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_footer_content" id="set_footer_content"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_footer_content</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1550">1550</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the content of the footer block</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_footer_content
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$content</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$content</span><span class="var-description">: The content of the footer block</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_footer_content_style" id="set_footer_content_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_footer_content_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1570">1570</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the style for the footer content</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_footer_content_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style for the footer content</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_header_content" id="set_header_content"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_header_content</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1540">1540</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the content of the header block</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_header_content
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$content</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$content</span><span class="var-description">: The content of the header block</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_header_content_style" id="set_header_content_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_header_content_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1560">1560</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the style for the header content</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_header_content_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style for the header content</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_header_type" id="set_header_type"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_header_type</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a746">746</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the type of header to be used.</p>
-<p class="description"><p>If GESHI_HEADER_DIV is used, the code is surrounded in a &quot;div&quot;.This means more source code but more control over tab width and line-wrapping. GESHI_HEADER_PRE means that a &quot;pre&quot; is used - less source, but less control. Default is GESHI_HEADER_PRE.</p><p>From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code should be outputted.</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_header_type
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$type</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$type</span><span class="var-description">: The type of header to be used</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_highlight_lines_extra_style" id="set_highlight_lines_extra_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_highlight_lines_extra_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1699">1699</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the style for extra-highlighted lines</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_highlight_lines_extra_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$styles</span><span class="var-description">: The style for extra-highlighted lines</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_important_styles" id="set_important_styles"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_important_styles</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1630">1630</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets styles for important parts of the code</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_important_styles
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$styles</span><span class="var-description">: The styles to use on important parts of the code</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_keyword_group_highlighting" id="set_keyword_group_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_keyword_group_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a942">942</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for a keyword group</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_keyword_group_highlighting
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span> = <span class="var-default">true</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to turn on or off</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for that group on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_keyword_group_style" id="set_keyword_group_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_keyword_group_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a921">921</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the style for a keyword group. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_keyword_group_style
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the keyword group to change the styles of</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the keywords</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_language" id="set_language"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_language</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a659">659</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the language for this object</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- <li><span class="field">note:</span> since 1.0.8 this function won't reset language-settings by default anymore! if you need this set $force_reset = true</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_language
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$language</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$force_reset</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$language</span><span class="var-description">: The name of the language to use</span> </li>
- <li>
- <span class="var-type"></span>
- <span class="var-name">$force_reset</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_language_path" id="set_language_path"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_language_path</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a703">703</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the path to the directory containing the language files. Note that this path is relative to the directory of the script that included geshi.php, NOT geshi.php itself.</p>
- <ul class="tags">
- <li><span class="field">deprecated:</span> The path to the language files should now be automatically detected, so this method should no longer be needed. The 1.1.X branch handles manual setting of the path differently so this method will disappear in 1.2.0.</li>
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_language_path
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$path</span><span class="var-description">: The path to the language directory</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_line_ending" id="set_line_ending"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_line_ending</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1709">1709</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the line-ending</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_line_ending
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$line_ending</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$line_ending</span><span class="var-description">: The new line-ending</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_line_style" id="set_line_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_line_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a844">844</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for the line numbers.</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_line_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style1</span>, [<span class="var-type">string|boolean</span>&nbsp;<span class="var-name">$style2</span> = <span class="var-default">''</span>], [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style1</span><span class="var-description">: The style for the line numbers that are &quot;normal&quot;</span> </li>
- <li>
- <span class="var-type">string|boolean</span>
- <span class="var-name">$style2</span><span class="var-description">: If a string, this is the style of the line numbers that are &quot;fancy&quot;, otherwise if boolean then this defines whether the normal styles should be merged with the new normal styles or not</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: If set, is the flag for whether to merge the &quot;fancy&quot; styles with the current styles or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_link_styles" id="set_link_styles"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_link_styles</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1606">1606</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets styles for links in code</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_link_styles
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$type</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$styles</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$type</span><span class="var-description">: A constant that specifies what state the style is being set for - e.g. :hover or :visited</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$styles</span><span class="var-description">: The styles to use for that state</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_link_target" id="set_link_target"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_link_target</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1616">1616</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the target for links in code</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.3</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_link_target
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$target</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$target</span><span class="var-description">: The target for links in the code, e.g. _blank</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_methods_highlighting" id="set_methods_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_methods_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1162">1162</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for methods</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_methods_highlighting
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for methods on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_methods_style" id="set_methods_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_methods_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1148">1148</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for methods. $key is a number that references the</p>
-<p class="description"><p>appropriate &quot;object splitter&quot; - see the language file for the language you are highlighting to get this number. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_methods_style
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the object splitter to change the styles of</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the methods</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_numbers_highlighting" id="set_numbers_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_numbers_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1131">1131</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for numbers</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_numbers_highlighting
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for numbers on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_numbers_style" id="set_numbers_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_numbers_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1117">1117</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for numbers. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_numbers_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the numbers</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_overall_class" id="set_overall_class"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_overall_class</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a783">783</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the overall classname for this block of code. This class can then be used in a stylesheet to style this object's output</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_overall_class
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$class</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$class</span><span class="var-description">: The class name to use for this block of code</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_overall_id" id="set_overall_id"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_overall_id</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a794">794</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the overall id for this block of code. This id can then be used in a stylesheet to style this object's output</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_overall_id
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$id</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$id</span><span class="var-description">: The ID to use for this block of code</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_overall_style" id="set_overall_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_overall_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a767">767</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for the code that will be outputted when this object is parsed. The style should be a string of valid stylesheet declarations</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_overall_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The overall style for the outputted code block</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the styles with the current styles or not</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_regexps_highlighting" id="set_regexps_highlighting"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_regexps_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1191">1191</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for regexps</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_regexps_highlighting
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$key</span><span class="var-description">: The key of the regular expression group to turn on or off</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for the regular expression group on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_regexps_style" id="set_regexps_style"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_regexps_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1176">1176</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for regexps. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_regexps_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$key</span>, <span class="var-type">boolean</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$key</span><span class="var-description">: The style to make the regular expression matches</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$style</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- <li>
- <span class="var-type"></span>
- <span class="var-name">$preserve_defaults</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_source" id="set_source"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_source</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a645">645</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the source code for this object</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_source
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$source</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$source</span><span class="var-description">: The source code to highlight</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_strings_highlighting" id="set_strings_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_strings_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1103">1103</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for strings</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_strings_highlighting
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for strings on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_strings_style" id="set_strings_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_strings_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1089">1089</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for strings. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_strings_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the escape characters</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_symbols_highlighting" id="set_symbols_highlighting"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_symbols_highlighting</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1071">1071</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Turns highlighting on/off for symbols</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_symbols_highlighting
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$flag</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$flag</span><span class="var-description">: Whether to turn highlighting for symbols on or off</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_symbols_style" id="set_symbols_style"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_symbols_style</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1051">1051</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the styles for symbols. If $preserve_defaults is true, then styles are merged with the default styles, with the user defined styles having priority</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.1</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_symbols_style
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$style</span>, [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$preserve_defaults</span> = <span class="var-default">false</span>], [<span class="var-type">int</span>&nbsp;<span class="var-name">$group</span> = <span class="var-default">0</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$style</span><span class="var-description">: The style to make the symbols</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$preserve_defaults</span><span class="var-description">: Whether to merge the new styles with the old or just to overwrite them</span> </li>
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$group</span><span class="var-description">: Tells the group of symbols for which style should be set.</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_tab_width" id="set_tab_width"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_tab_width</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1231">1231</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets how many spaces a tab is substituted for</p>
-<p class="description"><p>Widths below zero are ignored</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.0</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_tab_width
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$width</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$width</span><span class="var-description">: The tab width</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_url_for_keyword_group" id="set_url_for_keyword_group"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_url_for_keyword_group</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1594">1594</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets the base URL to be used for keywords</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_url_for_keyword_group
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$group</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$url</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$group</span><span class="var-description">: The key of the keyword group to set the URL for</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$url</span><span class="var-description">: The URL to set for the group. If {FNAME} is in the url somewhere, it is replaced by the keyword that the URL is being made for</span> </li>
- </ul>
-
-
- </div>
-<a name="methodset_use_language_tab_width" id="set_use_language_tab_width"><!-- --></a>
-<div class="oddrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">set_use_language_tab_width</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1247">1247</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets whether or not to use tab-stop width specifed by language</p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.7.20</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- set_use_language_tab_width
- </span>
- (<span class="var-type">boolean</span>&nbsp;<span class="var-name">$use</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$use</span><span class="var-description">: Whether to use language-specific tab-stop widths</span> </li>
- </ul>
-
-
- </div>
-<a name="methodstart_line_numbers_at" id="start_line_numbers_at"><!-- --></a>
-<div class="evenrow">
-
- <div class="method-header">
- <img src="../../media/images/Method.png" />
- <span class="method-title">start_line_numbers_at</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a1728">1728</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Sets what number line numbers should start at. Should be a positive integer, and will be converted to one.</p>
-<p class="description"><p><strong>Warning:</strong> Using this method will add the &quot;start&quot; attribute to the &amp;lt;ol&amp;gt; that is used for line numbering. This is <strong>not</strong> valid XHTML strict, so if that's what you care about then don't use this method. Firefox is getting support for the CSS method of doing this in 1.1 and Opera has support for the CSS method, but (of course) IE doesn't so it's not worth doing it the CSS way yet.</p></p>
- <ul class="tags">
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
-
- <div class="method-signature">
- <span class="method-result">void</span>
- <span class="method-name">
- start_line_numbers_at
- </span>
- (<span class="var-type">int</span>&nbsp;<span class="var-name">$number</span>)
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">int</span>
- <span class="var-name">$number</span><span class="var-description">: The number to start line numbers at</span> </li>
- </ul>
-
-
- </div>
-
- </div>
- </div>
-
-
- <p class="notes" id="credit">
- Documentation generated on Thu, 25 Dec 2008 14:34:52 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
- </p>
- </div></body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/geshi/core/_geshi.php.html b/libvpx/examples/includes/geshi/docs/api/geshi/core/_geshi.php.html
deleted file mode 100644
index 798f68f..0000000
--- a/libvpx/examples/includes/geshi/docs/api/geshi/core/_geshi.php.html
+++ /dev/null
@@ -1,478 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Docs for page geshi.php</title>
- <link rel="stylesheet" href="../../media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="page-body">
-<h2 class="file-name"><img src="../../media/images/Page_logo.png" alt="File" style="vertical-align: middle">/geshi.php</h2>
-
-<a name="sec-description"></a>
-<div class="info-box">
- <div class="info-box-title">Description</div>
- <div class="nav-bar">
- <span class="disabled">Description</span> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-constants">Constants</a>
- | <a href="#sec-functions">Functions</a>
- </div>
- <div class="info-box-body">
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">GeSHi - Generic Syntax Highlighter</p>
-<p class="description"><p>The GeSHi class for Generic Syntax Highlighting. Please refer to the documentation at http://qbnz.com/highlighter/documentation.php for more information about how to use this class.</p><p>For changes, release notes, TODOs etc, see the relevant files in the docs/ directory.</p><p>This file is part of GeSHi.</p><p>GeSHi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.</p><p>GeSHi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p><p>You should have received a copy of the GNU General Public License along with GeSHi; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p></p>
- <ul class="tags">
- <li><span class="field">author:</span> Nigel McNie &lt;<a href="mailto:nigel@geshi.org">nigel@geshi.org</a>&gt;, Benny Baumann &lt;BenBE@omorphia.de&gt;</li>
- <li><span class="field">copyright:</span> (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann</li>
- <li><span class="field">filesource:</span> <a href="../../__filesource/fsource_geshi_core_geshi.php.html">Source Code for this file</a></li>
- <li><span class="field">license:</span> <a href="http://gnu.org/copyleft/gpl.html">GNU GPL</a></li>
- </ul>
-
- </div>
-</div>
-
- <a name="sec-classes"></a>
- <div class="info-box">
- <div class="info-box-title">Classes</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <span class="disabled">Classes</span>
- | <a href="#sec-constants">Constants</a>
- | <a href="#sec-functions">Functions</a>
- </div>
- <div class="info-box-body">
- <table cellpadding="2" cellspacing="0" class="class-table">
- <tr>
- <th class="class-table-header">Class</th>
- <th class="class-table-header">Description</th>
- </tr>
- <tr>
- <td style="padding-right: 2em; vertical-align: top; white-space: nowrap">
- <img src="../../media/images/Class.png"
- alt=" class"
- title=" class"/>
- <a href="../../geshi/core/GeSHi.html">GeSHi</a>
- </td>
- <td>
- The GeSHi Class.
- </td>
- </tr>
- </table>
- </div>
- </div>
-
-
- <a name="sec-constants"></a>
- <div class="info-box">
- <div class="info-box-title">Constants</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <span class="disabled">Constants</span>
- | <a href="#sec-functions">Functions</a>
- </div>
- <div class="info-box-body">
- <a name="defineGESHI_ACTIVE"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_ACTIVE</span> = 2
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a107">107</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Links in the source in the :active state</p>
-
-
-</div>
-<a name="defineGESHI_CAPS_LOWER"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_CAPS_LOWER</span> = 2
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a99">99</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Leave keywords found as the case that they are</p>
-
-
-</div>
-<a name="defineGESHI_CAPS_NO_CHANGE"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_CAPS_NO_CHANGE</span> = 0
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a95">95</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Lowercase keywords found</p>
-
-
-</div>
-<a name="defineGESHI_CAPS_UPPER"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_CAPS_UPPER</span> = 1
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a97">97</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Uppercase keywords found</p>
-
-
-</div>
-<a name="defineGESHI_END_IMPORTANT"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_END_IMPORTANT</span> = '&lt;END GeSHi&gt;'
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a117">117</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The ender for important parts of the source</p>
-
-
-</div>
-<a name="defineGESHI_FANCY_LINE_NUMBERS"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_FANCY_LINE_NUMBERS</span> = 2
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a67">67</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use fancy line numbers when building the result</p>
-
-
-</div>
-<a name="defineGESHI_HEADER_DIV"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_HEADER_DIV</span> = 1
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a73">73</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use a &quot;div&quot; to surround the source</p>
-
-
-</div>
-<a name="defineGESHI_HEADER_NONE"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_HEADER_NONE</span> = 0
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a71">71</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use nothing to surround the source</p>
-
-
-</div>
-<a name="defineGESHI_HEADER_PRE"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_HEADER_PRE</span> = 2
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a75">75</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use a &quot;pre&quot; to surround the source</p>
-
-
-</div>
-<a name="defineGESHI_HEADER_PRE_TABLE"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_HEADER_PRE_TABLE</span> = 4
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a91">91</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use a &quot;table&quot; to surround the source:</p>
-<p class="description"><p>&lt;table&gt; &lt;thead&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;$header&lt;/td&gt;&lt;/tr&gt;&lt;/thead&gt; &lt;tbody&gt;&lt;tr&gt;&lt;td&gt;<pre>$linenumbers</pre>&lt;/td&gt;&lt;td&gt;<pre>$code></pre>&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt; &lt;tfooter&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;$footer&lt;/td&gt;&lt;/tr&gt;&lt;/tfoot&gt; &lt;/table&gt;</p><p>this is essentially only a workaround for Firefox, see sf#1651996 or take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=365805</p></p>
- <ul class="tags">
- <li><span class="field">note:</span> when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE</li>
- </ul>
-
-
-</div>
-<a name="defineGESHI_HEADER_PRE_VALID"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_HEADER_PRE_VALID</span> = 3
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a77">77</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use a pre to wrap lines when line numbers are enabled or to wrap the whole code.</p>
-
-
-</div>
-<a name="defineGESHI_HOVER"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_HOVER</span> = 1
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a105">105</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Links in the source in the :hover state</p>
-
-
-</div>
-<a name="defineGESHI_LANG_ROOT"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_LANG_ROOT</span> = GESHI_ROOT.'geshi'.DIRECTORY_SEPARATOR
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a53">53</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The language file directory for GeSHi</p>
-
-
-</div>
-<a name="defineGESHI_LINK"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_LINK</span> = 0
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a103">103</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Links in the source in the :link state</p>
-
-
-</div>
-<a name="defineGESHI_NORMAL_LINE_NUMBERS"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_NORMAL_LINE_NUMBERS</span> = 1
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a65">65</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use normal line numbers when building the result</p>
-
-
-</div>
-<a name="defineGESHI_NO_LINE_NUMBERS"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_NO_LINE_NUMBERS</span> = 0
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a63">63</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Use no line numbers when building the result</p>
-
-
-</div>
-<a name="defineGESHI_ROOT"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_ROOT</span> = dirname(__FILE__).DIRECTORY_SEPARATOR
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a49">49</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The root directory for GeSHi</p>
-
-
-</div>
-<a name="defineGESHI_SECURITY_PARANOID"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_SECURITY_PARANOID</span> = false
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a58">58</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Tells GeSHi to be paranoid about security settings</p>
-
-
-</div>
-<a name="defineGESHI_START_IMPORTANT"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_START_IMPORTANT</span> = '&lt;BEGIN GeSHi&gt;'
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a115">115</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The starter for important parts of the source</p>
-
-
-</div>
-<a name="defineGESHI_VERSION"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_VERSION</span> = '1.0.8.2',
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a44">44</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">The version of this GeSHi file</p>
-
-
-</div>
-<a name="defineGESHI_VISITED"><!-- --></a>
-<div class="oddrow">
-
- <div>
- <img src="../../media/images/Constant.png" />
- <span class="const-title">
- <span class="const-name">GESHI_VISITED</span> = 3
- (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a109">109</a></span>)
- </span>
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Links in the source in the :visited state</p>
-
-
-</div>
- </div>
- </div>
-
-
- <a name="sec-functions"></a>
- <div class="info-box">
- <div class="info-box-title">Functions</div>
- <div class="nav-bar">
- <a href="#sec-description">Description</a> |
- <a href="#sec-classes">Classes</a>
- | <a href="#sec-constants">Constants</a>
- | <span class="disabled">Functions</span>
- </div>
- <div class="info-box-body">
- <a name="functiongeshi_highlight" id="functiongeshi_highlight"><!-- --></a>
-<div class="evenrow">
-
- <div>
- <img src="../../media/images/Function.png" />
- <span class="method-title">geshi_highlight</span> (line <span class="line-number"><a href="../../__filesource/fsource_geshi_core_geshi.php.html#a4577">4577</a></span>)
- </div>
-
- <!-- ========== Info from phpDoc block ========= -->
-<p class="short-description">Easy way to highlight stuff. Behaves just like highlight_string</p>
- <ul class="tags">
- <li><span class="field">return:</span> The code highlighted (if $return is true)</li>
- <li><span class="field">since:</span> 1.0.2</li>
- </ul>
- <div class="method-signature">
- <span class="method-result">string</span>
- <span class="method-name">
- geshi_highlight
- </span>
- (<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$language</span>, [<span class="var-type">string</span>&nbsp;<span class="var-name">$path</span> = <span class="var-default">null</span>], [<span class="var-type">boolean</span>&nbsp;<span class="var-name">$return</span> = <span class="var-default">false</span>])
- </div>
-
- <ul class="parameters">
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$string</span><span class="var-description">: The code to highlight</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$language</span><span class="var-description">: The language to highlight the code in</span> </li>
- <li>
- <span class="var-type">string</span>
- <span class="var-name">$path</span><span class="var-description">: The path to the language files. You can leave this blank if you need as from version 1.0.7 the path should be automatically detected</span> </li>
- <li>
- <span class="var-type">boolean</span>
- <span class="var-name">$return</span><span class="var-description">: Whether to return the result or to echo</span> </li>
- </ul>
-
-
-</div>
- </div>
- </div>
-
- <p class="notes" id="credit">
- Documentation generated on Thu, 25 Dec 2008 14:34:34 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
- </p>
- </div></body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/index.html b/libvpx/examples/includes/geshi/docs/api/index.html
deleted file mode 100644
index f499a8f..0000000
--- a/libvpx/examples/includes/geshi/docs/api/index.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//FR"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <!-- Generated by phpDocumentor on Thu, 25 Dec 2008 14:34:34 +0100 -->
- <title>GeSHi 1.0.8</title>
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
-</head>
-
-<FRAMESET rows='120,*'>
- <FRAME src='packages.html' name='left_top' frameborder="1" bordercolor="#999999">
- <FRAMESET cols='25%,*'>
- <FRAME src='li_geshi.html' name='left_bottom' frameborder="1" bordercolor="#999999">
- <FRAME src='blank.html' name='right' frameborder="1" bordercolor="#999999">
- </FRAMESET>
- <NOFRAMES>
- <H2>Frame Alert</H2>
- <P>This document is designed to be viewed using the frames feature.
- If you see this message, you are using a non-frame-capable web client.</P>
- </NOFRAMES>
-</FRAMESET>
-</HTML> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/li_geshi.html b/libvpx/examples/includes/geshi/docs/api/li_geshi.html
deleted file mode 100644
index f074e37..0000000
--- a/libvpx/examples/includes/geshi/docs/api/li_geshi.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="package-title">geshi</div>
-<div class="package-details">
-
- <dl class="tree">
-
- <dt class="folder-title">Description</dt>
- <dd>
- <a href='classtrees_geshi.html' target='right'>Class trees</a><br />
- <a href='elementindex_geshi.html' target='right'>Index of elements</a><br />
- <a href="todolist.html" target="right">Todo List</a><br />
- </dd>
-
-
-
-
-
-
-
- <dt class="sub-package"><img class="tree-icon" src="media/images/package.png" alt="Sub-package">core</dt>
- <dd>
- <dl class="tree">
- <dt class="folder-title"><img class="tree-icon" src="media/images/class_folder.png" alt=" ">Classes</dt>
- <dd><img class="tree-icon" src="media/images/Class.png" alt="Class"><a href='geshi/core/GeSHi.html' target='right'>GeSHi</a></dd>
- <dt class="folder-title"><img class="tree-icon" src="media/images/function_folder.png" alt=" ">Functions</dt>
- <dd><img class="tree-icon" src="media/images/Function.png" alt="Function"><a href='geshi/core/_geshi.php.html#functiongeshi_highlight' target='right'>geshi_highlight</a></dd>
- <dt class="folder-title"><img class="tree-icon" src="media/images/folder.png" alt=" ">Files</dt>
- <dd><img class="tree-icon" src="media/images/Page.png" alt="File"><a href='geshi/core/_geshi.php.html' target='right'>geshi.php</a></dd>
- </dl>
- </dd>
-
-
- </dl>
-</div>
-<p class="notes"><a href="http://www.phpdoc.org" target="_blank">phpDocumentor v <span class="field">1.4.2</span></a></p>
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/media/banner.css b/libvpx/examples/includes/geshi/docs/api/media/banner.css
deleted file mode 100644
index 032b037..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/banner.css
+++ /dev/null
@@ -1,33 +0,0 @@
-body
-{
- background-color: #EEEEEE;
- margin: 0px;
- padding: 0px;
-}
-
-/* Banner (top bar) classes */
-
-.banner { }
-
-.banner-menu
-{
- text-align: right;
- clear: both;
- padding: .5em;
- border-top: 2px solid #AAAAAA;
-}
-
-.banner-title
-{
- text-align: right;
- font-size: 20pt;
- font-weight: bold;
- margin: .2em;
-}
-
-.package-selector
-{
- background-color: #DDDDDD;
- border: 1px solid #AAAAAA;
- color: #000090;
-}
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass.png b/libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass.png
deleted file mode 100644
index afa9d1d..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass_logo.png
deleted file mode 100644
index 8f65c39..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractClass_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractMethod.png b/libvpx/examples/includes/geshi/docs/api/media/images/AbstractMethod.png
deleted file mode 100644
index 605ccbe..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractMethod.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass.png b/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass.png
deleted file mode 100644
index 53d76c6..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass_logo.png
deleted file mode 100644
index 4e68f57..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateClass_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateMethod.png b/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateMethod.png
deleted file mode 100644
index 41cc9f0..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/AbstractPrivateMethod.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Class.png b/libvpx/examples/includes/geshi/docs/api/media/images/Class.png
deleted file mode 100644
index cf548d2..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Class.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Class_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/Class_logo.png
deleted file mode 100644
index 6f223c4..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Class_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Constant.png b/libvpx/examples/includes/geshi/docs/api/media/images/Constant.png
deleted file mode 100644
index a9c6f28..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Constant.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Constructor.png b/libvpx/examples/includes/geshi/docs/api/media/images/Constructor.png
deleted file mode 100644
index 3f16222..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Constructor.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Destructor.png b/libvpx/examples/includes/geshi/docs/api/media/images/Destructor.png
deleted file mode 100644
index f28528f..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Destructor.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Function.png b/libvpx/examples/includes/geshi/docs/api/media/images/Function.png
deleted file mode 100644
index 902fe25..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Function.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Global.png b/libvpx/examples/includes/geshi/docs/api/media/images/Global.png
deleted file mode 100644
index 7281bd2..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Global.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/I.png b/libvpx/examples/includes/geshi/docs/api/media/images/I.png
deleted file mode 100644
index e8512fb..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/I.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Index.png b/libvpx/examples/includes/geshi/docs/api/media/images/Index.png
deleted file mode 100644
index 6558ec3..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Index.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Interface.png b/libvpx/examples/includes/geshi/docs/api/media/images/Interface.png
deleted file mode 100644
index e6cd51e..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Interface.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Interface_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/Interface_logo.png
deleted file mode 100644
index 6f223c4..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Interface_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/L.png b/libvpx/examples/includes/geshi/docs/api/media/images/L.png
deleted file mode 100644
index eb334ed..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/L.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Lminus.png b/libvpx/examples/includes/geshi/docs/api/media/images/Lminus.png
deleted file mode 100644
index f7c43c0..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Lminus.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Lplus.png b/libvpx/examples/includes/geshi/docs/api/media/images/Lplus.png
deleted file mode 100644
index 848ec2f..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Lplus.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Method.png b/libvpx/examples/includes/geshi/docs/api/media/images/Method.png
deleted file mode 100644
index 9b21578..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Method.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Page.png b/libvpx/examples/includes/geshi/docs/api/media/images/Page.png
deleted file mode 100644
index ffe7986..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Page.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Page_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/Page_logo.png
deleted file mode 100644
index 44ce0b3..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Page_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass.png b/libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass.png
deleted file mode 100644
index 470e6d5..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass_logo.png
deleted file mode 100644
index 590e006..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateClass_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateMethod.png b/libvpx/examples/includes/geshi/docs/api/media/images/PrivateMethod.png
deleted file mode 100644
index d01f2b3..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateMethod.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateVariable.png b/libvpx/examples/includes/geshi/docs/api/media/images/PrivateVariable.png
deleted file mode 100644
index d76b21d..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/PrivateVariable.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/StaticMethod.png b/libvpx/examples/includes/geshi/docs/api/media/images/StaticMethod.png
deleted file mode 100644
index 9b21578..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/StaticMethod.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/StaticVariable.png b/libvpx/examples/includes/geshi/docs/api/media/images/StaticVariable.png
deleted file mode 100644
index 8e82019..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/StaticVariable.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/T.png b/libvpx/examples/includes/geshi/docs/api/media/images/T.png
deleted file mode 100644
index 3017325..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/T.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Tminus.png b/libvpx/examples/includes/geshi/docs/api/media/images/Tminus.png
deleted file mode 100644
index 2260e42..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Tminus.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Tplus.png b/libvpx/examples/includes/geshi/docs/api/media/images/Tplus.png
deleted file mode 100644
index 2c8d8f4..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Tplus.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/Variable.png b/libvpx/examples/includes/geshi/docs/api/media/images/Variable.png
deleted file mode 100644
index 8e82019..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/Variable.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/blank.png b/libvpx/examples/includes/geshi/docs/api/media/images/blank.png
deleted file mode 100644
index cee9cd3..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/blank.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/class_folder.png b/libvpx/examples/includes/geshi/docs/api/media/images/class_folder.png
deleted file mode 100644
index 84e9587..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/class_folder.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/empty.png b/libvpx/examples/includes/geshi/docs/api/media/images/empty.png
deleted file mode 100644
index d568386..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/empty.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/file.png b/libvpx/examples/includes/geshi/docs/api/media/images/file.png
deleted file mode 100644
index 0bb2427..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/file.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/folder.png b/libvpx/examples/includes/geshi/docs/api/media/images/folder.png
deleted file mode 100644
index a2d79f8..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/folder.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/function_folder.png b/libvpx/examples/includes/geshi/docs/api/media/images/function_folder.png
deleted file mode 100644
index 8b3d6e3..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/function_folder.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/next_button.png b/libvpx/examples/includes/geshi/docs/api/media/images/next_button.png
deleted file mode 100644
index cdbc615..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/next_button.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/next_button_disabled.png b/libvpx/examples/includes/geshi/docs/api/media/images/next_button_disabled.png
deleted file mode 100644
index 4a11780..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/next_button_disabled.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/package.png b/libvpx/examples/includes/geshi/docs/api/media/images/package.png
deleted file mode 100644
index b04cf56..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/package.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/package_folder.png b/libvpx/examples/includes/geshi/docs/api/media/images/package_folder.png
deleted file mode 100644
index 6162baf..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/package_folder.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/previous_button.png b/libvpx/examples/includes/geshi/docs/api/media/images/previous_button.png
deleted file mode 100644
index 327fdbc..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/previous_button.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/previous_button_disabled.png b/libvpx/examples/includes/geshi/docs/api/media/images/previous_button_disabled.png
deleted file mode 100644
index c02ff64..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/previous_button_disabled.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/private_class_logo.png b/libvpx/examples/includes/geshi/docs/api/media/images/private_class_logo.png
deleted file mode 100644
index 590e006..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/private_class_logo.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/tutorial.png b/libvpx/examples/includes/geshi/docs/api/media/images/tutorial.png
deleted file mode 100644
index bc19737..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/tutorial.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/tutorial_folder.png b/libvpx/examples/includes/geshi/docs/api/media/images/tutorial_folder.png
deleted file mode 100644
index 2a468b2..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/tutorial_folder.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/images/up_button.png b/libvpx/examples/includes/geshi/docs/api/media/images/up_button.png
deleted file mode 100644
index ff36c59..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/images/up_button.png
+++ /dev/null
Binary files differ
diff --git a/libvpx/examples/includes/geshi/docs/api/media/stylesheet.css b/libvpx/examples/includes/geshi/docs/api/media/stylesheet.css
deleted file mode 100644
index ed3f0b2..0000000
--- a/libvpx/examples/includes/geshi/docs/api/media/stylesheet.css
+++ /dev/null
@@ -1,145 +0,0 @@
-a { color: #000090; text-decoration: none; }
-a:hover, a:active, a:focus { color: highlighttext; background-color: highlight; text-decoration: none; }
-
-body { background: #FFFFFF; }
-body, table { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt; }
-
-a img { border: 0px; }
-
-/* Page layout/boxes */
-
-.info-box { }
-.info-box-title { margin: 1em 0em 0em 0em; font-weight: normal; font-size: 14pt; color: #999999; border-bottom: 2px solid #999999; }
-.info-box-body { border: 1px solid #999999; padding: .5em; }
-.nav-bar { font-size: 8pt; white-space: nowrap; text-align: right; padding: .2em; margin: 0em 0em 1em 0em; }
-
-.oddrow { background-color: #F8F8F8; border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
-.evenrow { border: 1px solid #AAAAAA; padding: .5em; margin-bottom: 1em}
-
-.page-body { max-width: 800px; margin: auto; }
-.tree { white-space: nowrap; font: icon }
-.tree dd { margin-left: 19px }
-.tree dl { margin: 0px }
-.tree-icon { vertical-align: middle; border: 0px; margin-right: 3px }
-
-/* Index formatting classes */
-
-.index-item-body { margin-top: .5em; margin-bottom: .5em}
-.index-item-description { margin-top: .25em }
-.index-item-details { font-weight: normal; font-style: italic; font-size: 8pt }
-.index-letter-section { background-color: #EEEEEE; border: 1px dotted #999999; padding: .5em; margin-bottom: 1em}
-.index-letter-title { font-size: 12pt; font-weight: bold }
-.index-letter-menu { text-align: center; margin: 1em }
-.index-letter { font-size: 12pt }
-
-/* Docbook classes */
-
-.description {}
-.short-description { font-weight: bold; color: #666666; }
-.tags { padding-left: 0em; margin-left: 3em; color: #666666; list-style-type: square; }
-.parameters { padding-left: 0em; margin-left: 3em; color: #014fbe; list-style-type: square; }
-.redefinitions { font-size: 8pt; padding-left: 0em; margin-left: 2em; }
-.package { font-weight: bold; }
-.package-title { font-weight: bold; font-size: 14pt; border-bottom: 1px solid black }
-.package-details { font-size: 85%; }
-.sub-package { font-weight: bold; }
-.tutorial { border-width: thin; border-color: #0066ff; }
-.tutorial-nav-box { width: 100%; border: 1px solid #999999; background-color: #F8F8F8; }
-.folder-title { font-style: italic; font-family: Verdana, Arial, Helvetica, sans-serif }
-
-/* Generic formatting */
-
-.field { font-weight: bold; }
-.detail { font-size: 8pt; }
-.notes { font-style: italic; font-size: 8pt; }
-.separator { background-color: #999999; height: 2px; }
-.warning { color: #FF6600; }
-.disabled { font-style: italic; color: #999999; }
-
-/* Code elements */
-
-.line-number { }
-
-.class-table { width: 100%; }
-.class-table-header { border-bottom: 1px dotted #666666; text-align: left}
-.class-name { color: #0000AA; font-weight: bold; }
-
-.method-summary { color: #009000; padding-left: 1em; font-size: 8pt; }
-.method-header { }
-.method-definition { margin-bottom: .2em }
-.method-title { color: #009000; font-weight: bold; }
-.method-name { font-weight: bold; }
-.method-signature { font-size: 85%; color: #666666; margin: .5em 0em }
-.method-result { font-style: italic; }
-
-.var-summary { padding-left: 1em; font-size: 8pt; }
-.var-header { }
-.var-title { color: #014fbe; margin-bottom: .3em }
-.var-type { font-style: italic; }
-.var-name { font-weight: bold; }
-.var-default {}
-.var-description { font-weight: normal; color: #000000; }
-
-.include-title { color: #014fbe;}
-.include-type { font-style: italic; }
-.include-name { font-weight: bold; }
-
-.const-title { color: #FF6600; }
-.const-name { font-weight: bold; }
-
-/* Syntax highlighting */
-
-.src-code { font-family: 'Courier New', Courier, monospace; font-weight: normal; }
-.src-line { font-family: 'Courier New', Courier, monospace; font-weight: normal; }
-
-.src-code a:link { padding: 1px; text-decoration: underline; color: #0000DD; }
-.src-code a:visited { text-decoration: underline; color: #0000DD; }
-.src-code a:active { background-color: #FFFF66; color: #008000; }
-.src-code a:hover { background-color: #FFFF66; text-decoration: overline underline; color: #008000; }
-
-.src-comm { color: #666666; }
-.src-id { color: #FF6600; font-style: italic; }
-.src-inc { color: #0000AA; font-weight: bold; }
-.src-key { color: #0000AA; font-weight: bold; }
-.src-num { color: #CC0000; }
-.src-str { color: #CC0000; }
-.src-sym { }
-.src-var { }
-
-.src-php { font-weight: bold; }
-
-.src-doc { color: #666666; }
-.src-doc-close-template { color: #666666 }
-.src-doc-coretag { color: #008000; }
-.src-doc-inlinetag {}
-.src-doc-internal {}
-.src-doc-tag { color: #0080CC; }
-.src-doc-template { color: #666666 }
-.src-doc-type { font-style: italic; color: #444444 }
-.src-doc-var { color: #444444 }
-
-.tute-tag { color: #009999 }
-.tute-attribute-name { color: #0000FF }
-.tute-attribute-value { color: #0099FF }
-.tute-entity { font-weight: bold; }
-.tute-comment { font-style: italic }
-.tute-inline-tag { color: #636311; font-weight: bold }
-
-/* tutorial */
-
-.authors { }
-.author { font-style: italic; font-weight: bold }
-.author-blurb { margin: .5em 0em .5em 2em; font-size: 85%; font-weight: normal; font-style: normal }
-.example { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; }
-*[class="example"] { line-height : 1.0em; }
-.listing { border: 1px dashed #999999; background-color: #EEEEEE; padding: .5em; white-space: nowrap; }
-*[class="listing"] { line-height : 1.0em; }
-.release-info { font-size: 85%; font-style: italic; margin: 1em 0em }
-.ref-title-box { }
-.ref-title { }
-.ref-purpose { font-style: italic; color: #666666 }
-.ref-synopsis { }
-.title { font-weight: bold; border-bottom: 1px solid #999999; color: #999999; }
-.cmd-synopsis { margin: 1em 0em }
-.cmd-title { font-weight: bold }
-.toc { margin-left: 2em; padding-left: 0em }
diff --git a/libvpx/examples/includes/geshi/docs/api/packages.html b/libvpx/examples/includes/geshi/docs/api/packages.html
deleted file mode 100644
index d8c4c04..0000000
--- a/libvpx/examples/includes/geshi/docs/api/packages.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title></title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <link rel="stylesheet" href="media/banner.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div class="banner">
- <div class="banner-title">geshi</div>
- <div class="banner-menu">
- <form>
- <table cellpadding="0" cellspacing="0" style="width: 100%">
- <tr>
- <td>
- </td>
- <td style="width: 2em">&nbsp;</td>
- <td style="text-align: right">
- </td>
- </tr>
- </table>
- </form>
- </div>
- </div>
- </body>
- </html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/api/todolist.html b/libvpx/examples/includes/geshi/docs/api/todolist.html
deleted file mode 100644
index 95177c1..0000000
--- a/libvpx/examples/includes/geshi/docs/api/todolist.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <!-- template designed by Marco Von Ballmoos -->
- <title>Todo List</title>
- <link rel="stylesheet" href="media/stylesheet.css" />
- <meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
- </head>
- <body>
- <div align="center"><h1>Todo List</h1></div>
-<h2>geshi</h2>
-<h3><a href="geshi/core/GeSHi.html#methoddisable_highlighting">GeSHi::disable_highlighting()</a></h3>
-<ul>
- <li>Rewrite with array traversal</li>
-</ul>
-<h3><a href="geshi/core/GeSHi.html#methodenable_highlighting">GeSHi::enable_highlighting()</a></h3>
-<ul>
- <li>Rewrite with array traversal</li>
-</ul>
-<h3><a href="geshi/core/GeSHi.html#methodenable_important_blocks">GeSHi::enable_important_blocks()</a></h3>
-<ul>
- <li>REMOVE THIS SHIZ FROM GESHI!</li>
-</ul>
-<h3><a href="geshi/core/GeSHi.html#methodget_language_name_from_extension">GeSHi::get_language_name_from_extension()</a></h3>
-<ul>
- <li>Re-think about how this method works (maybe make it private and/or make it a extension-&gt;lang lookup?)</li>
- <li>static?</li>
-</ul>
-<h3><a href="geshi/core/GeSHi.html#methodhighlight_lines_extra">GeSHi::highlight_lines_extra()</a></h3>
-<ul>
- <li>Some data replication here that could be cut down on</li>
-</ul>
-<h3><a href="geshi/core/GeSHi.html#methodload_from_file">GeSHi::load_from_file()</a></h3>
-<ul>
- <li>Complete rethink of this and above method</li>
-</ul>
- <p class="notes" id="credit">
- Documentation generated on Thu, 25 Dec 2008 14:34:53 +0100 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
- </p>
- </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/geshi-doc.html b/libvpx/examples/includes/geshi/docs/geshi-doc.html
deleted file mode 100644
index fff5347..0000000
--- a/libvpx/examples/includes/geshi/docs/geshi-doc.html
+++ /dev/null
@@ -1,4051 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
- <head>
- <title>GeSHi Documentation 1.0.8.3</title>
-
- <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
- <meta name="keywords" content="GeSHi, syntax, highlighter, colorizer, beautifier, code, generic, php, sql, css, html, syntax, highlighting, documentation" />
- <meta name="description" content="GeSHi - Generic Syntax Highlighter for PHP. Highlight many languages, including PHP, CSS, HTML, SQL, Java and C for XHTML compliant output using this easy PHP Class. Every aspect of the highlighting is customisable, from colours and other styles to case-sensitivity checking and more. GeSHi - the best syntax highlighter in the world!" />
-
- <style type="text/css">
- html {
- background-color: #e6e6e6;
- }
- body {
- font-family: Verdana, Arial, sans-serif;
- margin: 10px;
- border: 2px solid #d0d0d0;
- background-color: #f6f6f6;
- padding: 10px;
- }
- p, ul, ol, div, blockquote, dt, dd {
- font-size: 80%;
- line-height: 140%;
- letter-spacing: 1px;
- color: #002;
- }
- dt {
- font-weight: bold;
- }
- acronym {
- border-bottom: 1px dotted #303030;
- cursor: help;
- }
- blockquote {
- font-weight: bold;
- }
- pre, .geshicode {
- border: 1px solid #c0e6ff;
- background-color: #e0e8ef;
- color: #002;
- margin:0;
- font-size: 12px;
- width:100%;
- }
- table {
- border-collapse:collapse;
- }
- .geshicode pre {
- border:none;
- background-color:inherit;
- font-weight:bold;
- }
- .geshicode .li2 td {
- background-color:#eee;
- }
- .geshicode .li1 td {
- background-color:#fff;
- }
- .geshicode td td {
- padding:0 2px;
- }
- .geshicode td, .geshicode table {
- width: 100%;
- }
- .geshicode td.ln {
- border-right:2px solid #e0e8ef;
- }
- .geshicode .head {
- text-align:center;
- font-weight:bold;
- }
- code, tt, kbd {
- font-size: 125%;
- font-weight:normal;
- }
- hr {
- height: 0;
- border: none;
- border-top: 1px dotted #404040;
- width: 75%;
- }
- var {
- color: blue; font-style: normal; font-family: monospace;
- }
- li {
- padding-top: 2px;
- }
- ul ul, ol ol, div ul, div ol {
- font-size:100%;
- }
- .note {
- border: 1px solid yellow;
- background-color: #ffc;
- color: #220;
- padding: 5px;
- margin: 1em 0 0 .75em;
- }
- .caution {
- border: 6px double red;
- background-color: #fcc;
- color: #200;
- padding: 5px;
- margin: 1em 0 0 .75em;
- }
- .caution p:first-child, .note p:first-child {
- margin-top: 0;
- }
- .caution-header {
- border: 1px solid red;
- border-width: 1px 2px 2px 1px;
- margin-top: -1.6em;
- background-color: #fcc;
- width: 10%;
- font-weight: bold;
- text-align: center;
- color: #600;
- }
- .note-header {
- border: 1px solid #ff0;
- border-width: 1px 2px 2px 1px;
- margin-top: -1.2em;
- background-color: #ffc;
- width: 10%;
- font-weight: bold;
- text-align: center;
- color: #660;
- }
- .nav {
- font-size: 70%;
- }
- .nav a {
- color: #707070;
- border: 1px solid #a0a0a0;
- border-width: 0 1px 1px 1px;
- border-top: 1px dotted #c0c0c0;
- text-decoration: none;
- padding: 1px 2px;
- background-color: #e0e0e0;
- -moz-border-radius-bottomleft: 3px;
- -moz-border-radius-bottomright: 3px;
- }
- h1, #contents {
- margin-top: 0;
- margin-bottom: 0;
- text-align: center;
- color: #404060;
- }
- #contents {
- text-align:left;
- background:none;
- border:none;
- }
- h2 {
- border-bottom: 1px dotted #b0b0b0;
- margin-top: 2em;
- border-top: 1px dotted #b0b0b0;
- background-color: #ddd;
- margin-bottom: 0;
- }
- h3 {
- margin-top: 1.6em;
- border-bottom: 1px dotted #c0c0c0;
- margin-bottom: 0;
- }
- h4 {
- border-bottom: 1px dotted #d0d0d0;
- margin-top: 1.2em;
- margin-bottom: 0;
- }
- h2, h3, h4 {
- color: #707070;
- font-weight: normal;
- }
- a {
- color: #7777ff;
- }
- sup a {
- text-decoration: none;
- }
- abbr {
- cursor: help;
- }
- .header p {
- text-align: center;
- border-bottom: 1px dotted #d0d0d0;
- }
-
- .header dl {
- background-color: #e0e8ef;
- color: #002;
- padding: 5px;
- }
-
- .header img {
- float: right;
- margin:2.5em 1em 0 0;
- }
-
- /**
- * GeSHi Dynamically Generated Stylesheet
- * --------------------------------------
- * Dynamically generated stylesheet for bash
- * CSS class: , CSS id:
- * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
- * (http://qbnz.com/highlighter/ and http://geshi.org/)
- * --------------------------------------
- */
-.bash .de1, .bash .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
-.bash {font-family:monospace;}
-.bash .imp {font-weight: bold; color: red;}
-.bash li, .bash .li1 {font-weight: normal; vertical-align:top;}
-.bash .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
-.bash .li2 {font-weight: bold; vertical-align:top;}
-.bash .kw1 {color: #000000; font-weight: bold;}
-.bash .kw2 {color: #c20cb9; font-weight: bold;}
-.bash .kw3 {color: #7a0874; font-weight: bold;}
-.bash .co0 {color: #666666; font-style: italic;}
-.bash .co1 {color: #800000;}
-.bash .co2 {color: #cc0000; font-style: italic;}
-.bash .co3 {color: #000000; font-weight: bold;}
-.bash .es1 {color: #000099; font-weight: bold;}
-.bash .es2 {color: #007800;}
-.bash .es3 {color: #007800;}
-.bash .es4 {color: #007800;}
-.bash .es5 {color: #780078;}
-.bash .es_h {color: #000099; font-weight: bold;}
-.bash .br0 {color: #7a0874; font-weight: bold;}
-.bash .sy0 {color: #000000; font-weight: bold;}
-.bash .st0 {color: #ff0000;}
-.bash .st_h {color: #ff0000;}
-.bash .nu0 {color: #000000;}
-.bash .re0 {color: #007800;}
-.bash .re1 {color: #007800;}
-.bash .re2 {color: #007800;}
-.bash .re4 {color: #007800;}
-.bash .re5 {color: #660033;}
-.bash .ln-xtra, .bash li.ln-xtra, .bash div.ln-xtra {background-color: #ffc;}
-.bash span.xtra { display:block; }
-
-/**
- * GeSHi Dynamically Generated Stylesheet
- * --------------------------------------
- * Dynamically generated stylesheet for php
- * CSS class: , CSS id:
- * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
- * (http://qbnz.com/highlighter/ and http://geshi.org/)
- * --------------------------------------
- */
-.php .de1, .php .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
-.php {font-family:monospace;}
-.php .imp {font-weight: bold; color: red;}
-.php li, .php .li1 {font-weight: normal; vertical-align:top;}
-.php .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
-.php .li2 {font-weight: bold; vertical-align:top;}
-.php .kw1 {color: #b1b100;}
-.php .kw2 {color: #000000; font-weight: bold;}
-.php .kw3 {color: #990000;}
-.php .kw4 {color: #009900; font-weight: bold;}
-.php .co1 {color: #666666; font-style: italic;}
-.php .co2 {color: #666666; font-style: italic;}
-.php .co3 {color: #0000cc; font-style: italic;}
-.php .co4 {color: #009933; font-style: italic;}
-.php .coMULTI {color: #666666; font-style: italic;}
-.php .es0 {color: #000099; font-weight: bold;}
-.php .es1 {color: #000099; font-weight: bold;}
-.php .es2 {color: #660099; font-weight: bold;}
-.php .es3 {color: #660099; font-weight: bold;}
-.php .es4 {color: #006699; font-weight: bold;}
-.php .es5 {color: #006699; font-weight: bold; font-style: italic;}
-.php .es6 {color: #009933; font-weight: bold;}
-.php .es_h {color: #000099; font-weight: bold;}
-.php .br0 {color: #009900;}
-.php .sy0 {color: #339933;}
-.php .sy1 {color: #000000; font-weight: bold;}
-.php .st0 {color: #0000ff;}
-.php .st_h {color: #0000ff;}
-.php .nu0 {color: #cc66cc;}
-.php .nu8 {color: #208080;}
-.php .nu12 {color: #208080;}
-.php .nu19 {color:#800080;}
-.php .me1 {color: #004000;}
-.php .me2 {color: #004000;}
-.php .re0 {color: #000088;}
-.php .ln-xtra, .php li.ln-xtra, .php div.ln-xtra {background-color: #ffc;}
-.php span.xtra { display:block; }
-
-/**
- * GeSHi Dynamically Generated Stylesheet
- * --------------------------------------
- * Dynamically generated stylesheet for html4strict
- * CSS class: , CSS id:
- * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
- * (http://qbnz.com/highlighter/ and http://geshi.org/)
- * --------------------------------------
- */
-.html4strict .de1, .html4strict .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
-.html4strict {font-family:monospace;}
-.html4strict .imp {font-weight: bold; color: red;}
-.html4strict li, .html4strict .li1 {font-weight: normal; vertical-align:top;}
-.html4strict .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
-.html4strict .li2 {font-weight: bold; vertical-align:top;}
-.html4strict .kw2 {color: #000000; font-weight: bold;}
-.html4strict .kw3 {color: #000066;}
-.html4strict .es0 {color: #000099; font-weight: bold;}
-.html4strict .br0 {color: #66cc66;}
-.html4strict .sy0 {color: #66cc66;}
-.html4strict .st0 {color: #ff0000;}
-.html4strict .nu0 {color: #cc66cc;}
-.html4strict .sc-1 {color: #808080; font-style: italic;}
-.html4strict .sc0 {color: #00bbdd;}
-.html4strict .sc1 {color: #ddbb00;}
-.html4strict .sc2 {color: #009900;}
-.html4strict .ln-xtra, .html4strict li.ln-xtra, .html4strict div.ln-xtra {background-color: #ffc;}
-.html4strict span.xtra { display:block; }
-
-/**
- * GeSHi Dynamically Generated Stylesheet
- * --------------------------------------
- * Dynamically generated stylesheet for css
- * CSS class: , CSS id:
- * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
- * (http://qbnz.com/highlighter/ and http://geshi.org/)
- * --------------------------------------
- */
-.css .de1, .css .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
-.css {font-family:monospace;}
-.css .imp {font-weight: bold; color: red;}
-.css li, .css .li1 {font-weight: normal; vertical-align:top;}
-.css .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
-.css .li2 {font-weight: bold; vertical-align:top;}
-.css .kw1 {color: #000000; font-weight: bold;}
-.css .kw2 {color: #993333;}
-.css .co1 {color: #a1a100;}
-.css .co2 {color: #ff0000; font-style: italic;}
-.css .coMULTI {color: #808080; font-style: italic;}
-.css .es0 {color: #000099; font-weight: bold;}
-.css .br0 {color: #00AA00;}
-.css .sy0 {color: #00AA00;}
-.css .st0 {color: #ff0000;}
-.css .nu0 {color: #cc66cc;}
-.css .re0 {color: #cc00cc;}
-.css .re1 {color: #6666ff;}
-.css .re2 {color: #3333ff;}
-.css .re3 {color: #933;}
-.css .ln-xtra, .css li.ln-xtra, .css div.ln-xtra {background-color: #ffc;}
-.css span.xtra { display:block; }
-
-/**
- * GeSHi Dynamically Generated Stylesheet
- * --------------------------------------
- * Dynamically generated stylesheet for java
- * CSS class: , CSS id:
- * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
- * (http://qbnz.com/highlighter/ and http://geshi.org/)
- * --------------------------------------
- */
-.java .de1, .java .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}
-.java {font-family:monospace;}
-.java .imp {font-weight: bold; color: red;}
-.java li, .java .li1 {font-weight: normal; vertical-align:top;}
-.java .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}
-.java .li2 {font-weight: bold; vertical-align:top;}
-.java .kw1 {color: #000000; font-weight: bold;}
-.java .kw2 {color: #000066; font-weight: bold;}
-.java .kw3 {color: #003399;}
-.java .kw4 {color: #000066; font-weight: bold;}
-.java .co1 {color: #666666; font-style: italic;}
-.java .co2 {color: #006699;}
-.java .co3 {color: #008000; font-style: italic; font-weight: bold;}
-.java .coMULTI {color: #666666; font-style: italic;}
-.java .es0 {color: #000099; font-weight: bold;}
-.java .br0 {color: #009900;}
-.java .sy0 {color: #339933;}
-.java .st0 {color: #0000ff;}
-.java .nu0 {color: #cc66cc;}
-.java .me1 {color: #006633;}
-.java .me2 {color: #006633;}
-.java .ln-xtra, .java li.ln-xtra, .java div.ln-xtra {background-color: #ffc;}
-.java span.xtra { display:block; }
-
-
- </style>
- </head>
- <body>
- <h1 id="top"><abbr title="Generic Syntax Highlighter">GeSHi</abbr> Documentation</h1>
-
-<div class="header">
-
-<p>Version 1.0.8.3</p>
-
-<p><img src="http://qbnz.com/highlighter/images/geshi.png" alt="The GeSHi Logo" /></p>
-
-<dl>
-<dt>Authors:</dt>
-<dd>&copy; 2004 - 2007&#160;<a href="mailto:nigel@geshi.org">Nigel McNie</a></dd>
-
-<dd>&copy; 2007 - 2009&#160;<a href="mailto:BenBE@omorphia.de">Benny Baumann</a></dd>
-
-<dd>&copy; 2008 - 2009&#160;<a href="mailto:mail@milianw.de">Milian Wolff</a></dd>
-
-<dt><abbr title="Generic Syntax Highlighter">GeSHi</abbr> Website:</dt>
-<dd><a href="http://qbnz.com/highlighter">http://qbnz.com/highlighter</a></dd>
-</dl>
-
-</div>
-
-<p>This is the documentation for <abbr title="Generic Syntax Highlighter">GeSHi</abbr> - Generic Syntax Highlighter.</p>
-
-<p>The most modern version of this document is available on the web -
-go to <a href="http://qbnz.com/highlighter/documentation.php">http://qbnz.com/highlighter/documentation.php</a> to view it.</p>
-
-<p>Any comments, questions, confusing points? Please <a href="#feedback">get in contact</a> with the developers! We
-need all the information we can get to make the use of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> and everything related to it (including this documentation)
-a breeze.</p>
-
-<h2 id="contents">Contents</h2>
-
-<div id="toc"><ul>
-<li><a href="#introduction">1 Introduction</a><ul>
-<li><a href="#features">1.1 Features</a></li>
-<li><a href="#about-geshi">1.2 About <abbr title="Generic Syntax Highlighter">GeSHi</abbr></a></li>
-<li><a href="#credits">1.3 Credits</a></li>
-<li><a href="#feedback">1.4 Feedback</a></li>
-</ul></li>
-<li><a href="#the-basics">2 The Basics</a><ul>
-<li><a href="#getting-geshi">2.1 Getting <abbr title="Generic Syntax Highlighter">GeSHi</abbr> work</a><ul>
-<li><a href="#requirements">2.1.1 Requirements</a></li>
-<li><a href="#downloading-geshi">2.1.2 Downloading <abbr title="Generic Syntax Highlighter">GeSHi</abbr></a></li>
-<li><a href="#extracting-geshi">2.1.3 Extracting <abbr title="Generic Syntax Highlighter">GeSHi</abbr></a></li>
-<li><a href="#installing-geshi">2.1.4 Installing <abbr title="Generic Syntax Highlighter">GeSHi</abbr></a></li>
-</ul></li>
-<li><a href="#basic-usage">2.2 Basic Usage</a></li>
-</ul></li>
-<li><a href="#advanced-features">3 Advanced Features</a><ul>
-<li><a href="#the-code-container">3.1 The Code Container</a></li>
-<li><a href="#line-numbers">3.2 Line Numbers</a><ul>
-<li><a href="#enabling-line-numbers">3.2.1 Enabling Line Numbers</a></li>
-<li><a href="#styling-line-numbers">3.2.2 Styling Line Numbers</a></li>
-<li><a href="#starting-line-numbers">3.2.3 Choosing a Start Number</a></li>
-</ul></li>
-<li><a href="#using-css-classes">3.3 Using <abbr title="Cascading Style Sheets">CSS</abbr> Classes</a><ul>
-<li><a href="#enabling-css-classes">3.3.1 Enabling <abbr title="Cascading Style Sheets">CSS</abbr> Classes</a></li>
-<li><a href="#setting-css-class-id">3.3.2 Setting the <abbr title="Cascading Style Sheets">CSS</abbr> class and ID</a></li>
-<li><a href="#getting-stylesheet">3.3.3 Getting the stylesheet for your code</a></li>
-<li><a href="#using-an-external-stylesheet">3.3.4 Using an External Stylesheet</a></li>
-</ul></li>
-<li><a href="#changing-styles">3.4 Changing Styles</a><ul>
-<li><a href="#the-overall-styles">3.4.1 The Overall Styles</a></li>
-<li><a href="#line-number-styles">3.4.2 Line Number Styles</a></li>
-<li><a href="#setting-keyword-styles">3.4.3 Setting Keyword Styles</a></li>
-<li><a href="#setting-comment-styles">3.4.4 Setting Comment Styles</a></li>
-<li><a href="#setting-other-styles">3.4.5 Setting Other Styles</a></li>
-</ul></li>
-<li><a href="#case-caps">3.5 Case Sensitivity and Auto Casing</a><ul>
-<li><a href="#auto-caps-nocaps">3.5.1 Auto-Caps/NoCaps</a></li>
-<li><a href="#setting-case-sensitivity">3.5.2 Setting Case Sensitivity</a></li>
-</ul></li>
-<li><a href="#changing-config">3.6 Changing the Source, Language, Config Options</a><ul>
-<li><a href="#changing-the-source">3.6.1 Changing the Source Code</a></li>
-<li><a href="#changing-the-language">3.6.2 Changing the Language</a></li>
-<li><a href="#changing-the-path">3.6.3 Changing the Language Path</a></li>
-<li><a href="#changing-the-charset">3.6.4 Changing the Character Set</a></li>
-</ul></li>
-<li><a href="#error-handling">3.7 Error Handling</a></li>
-<li><a href="#disabling-lexics">3.8 Disabling styling of some Lexics</a></li>
-<li><a href="#setting-tab-width">3.9 Setting the Tab Width</a></li>
-<li><a href="#using-strict-mode">3.10 Using Strict Mode</a></li>
-<li><a href="#adding-removing-keywords">3.11 Adding/Removing Keywords</a><ul>
-<li><a href="#adding-a-keyword">3.11.1 Adding a Keyword</a></li>
-<li><a href="#removing-a-keyword">3.11.2 Removing a Keyword</a></li>
-<li><a href="#adding-a-keyword-group">3.11.3 Adding a Keyword Group</a></li>
-<li><a href="#removing-a-keyword-group">3.11.4 Removing a Keyword Group</a></li>
-</ul></li>
-<li><a href="#headers-and-footers">3.12 Headers and Footers for Your Code</a><ul>
-<li><a href="#keyword-substitution">3.12.1 Keyword Substitution</a></li>
-<li><a href="#setting-header-content">3.12.2 Setting Header Content</a></li>
-<li><a href="#setting-footer-content">3.12.3 Setting Footer Content</a></li>
-<li><a href="#styling-header-content">3.12.4 Styling Header Content</a></li>
-<li><a href="#styling-footer-content">3.12.5 Styling Footer Content</a></li>
-</ul></li>
-<li><a href="#keyword-urls">3.13 Keyword URLs</a><ul>
-<li><a href="#setting-a-url">3.13.1 Setting a URL for a Keyword Group</a></li>
-<li><a href="#disabling-urls">3.13.2 Disabling a URL for a Keyword Group</a></li>
-<li><a href="#disabling-all-urls">3.13.3 Disabling all URLs for Keywords</a></li>
-<li><a href="#styling-links">3.13.4 Styling Links</a></li>
-<li><a href="#using-targets">3.13.5 Setting the Link Target</a></li>
-</ul></li>
-<li><a href="#using-contextual-importance">3.14 Using Contextual Importance</a></li>
-<li><a href="#highlighting-special-lines-extra">3.15 Highlighting Special Lines &#8220;Extra&#8221;</a><ul>
-<li><a href="#specifying-lines-to-highlight-extra">3.15.1 Specifying the Lines to Highlight Extra</a></li>
-<li><a href="#styles-for-highlighted-lines">3.15.2 Styles for the Highlighted Lines</a></li>
-</ul></li>
-<li><a href="#adding-ids-to-each-line">3.16 Adding IDs to Each Line</a></li>
-<li><a href="#getting-the-time-of-styling">3.17 Getting the Time of Styling</a></li>
-</ul></li>
-<li><a href="#language-files">4 Language Files</a><ul>
-<li><a href="#language-file-example">4.1 An Example Language File</a></li>
-<li><a href="#language-file-conventions">4.2 Language File Conventions</a></li>
-<li><a href="#language-file-sections">4.3 Language File Sections</a><ul>
-<li><a href="#language-file-header">4.3.1 The Header</a></li>
-<li><a href="#language-file-start-indices">4.3.2 The First Indices</a></li>
-<li><a href="#language-file-keywords">4.3.3 Keywords</a></li>
-<li><a href="#language-file-symbols-case">4.3.4 Symbols and Case Sensitivity</a></li>
-<li><a href="#language-file-styles">4.3.5 Styles for your Language File</a></li>
-<li><a href="#language-file-urls">4.3.6 URLs for Functions</a></li>
-<li><a href="#language-file-numbers-support">4.3.7 Number Highlighting Support</a></li>
-<li><a href="#language-file-oo-support">4.3.8 Object Orientation Support</a></li>
-<li><a href="#language-file-regexps">4.3.9 Using Regular Expressions</a></li>
-<li><a href="#language-file-strict-mode">4.3.10 Contextual Highlighting and Strict Mode</a></li>
-<li><a href="#language-file-parser-control">4.3.11 Special Parser Settings (Experimental)</a></li>
-<li><a href="#language-file-tidying-up">4.3.12 Tidying Up</a></li>
-</ul></li>
-<li><a href="#lang-validation">4.4 Validating your language file</a></li>
-</ul></li>
-<li><a href="#method-constant-reference">5 Method/Constant Reference</a></li>
-</ul>
-</div>
-
-<h2 id="introduction">1 Introduction</h2><div class="nav"><a href="#features">Next</a></div>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> is exactly what the acronym stands for: a <strong>Generic Syntax Highlighter</strong>. As long
-as you have a language file for almost any computer language - whether it be a
-scripting language, object orientated, markup or anything in between - <abbr title="Generic Syntax Highlighter">GeSHi</abbr> can
-highlight it! <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is extremely customisable - the same source can be highlighted
-multiple times in multiple ways - the same source even with a different language.
-<abbr title="Generic Syntax Highlighter">GeSHi</abbr> outputs XHTML strict compliant code<sup id="fnref:xhtml-strict"><a href="#fn:xhtml-strict" rel="footnote">1</a></sup>, and can
-make use of <abbr title="Cascading Style Sheets">CSS</abbr> to save on the amount of output. And what is the cost for all of this? You need
-<a href="http://php.net"><abbr title="PHP: HTML Preprocessor">PHP</abbr></a>. That&#8217;s all!</p>
-
-<h3 id="features">1.1 Features</h3><div class="nav"><a href="#introduction">Previous</a> | <a href="#introduction">Top</a> | <a href="#about-geshi">Next</a></div>
-
-<p>Here are some of the standout features of <abbr title="Generic Syntax Highlighter">GeSHi</abbr>:</p>
-
-<dl>
-<dt>Programmed in <abbr title="PHP: HTML Preprocessor">PHP</abbr>:</dt>
-<dd><abbr title="Generic Syntax Highlighter">GeSHi</abbr> is coded entirely in <abbr title="PHP: HTML Preprocessor">PHP</abbr>. This means that where ever you have <abbr title="PHP: HTML Preprocessor">PHP</abbr>, you
-can have <abbr title="Generic Syntax Highlighter">GeSHi</abbr>! Almost any free webhost supports <abbr title="PHP: HTML Preprocessor">PHP</abbr>, and <abbr title="Generic Syntax Highlighter">GeSHi</abbr> works fine with <abbr title="PHP: HTML Preprocessor">PHP</abbr> > 4.3.0<sup id="fnref:php-version-note"><a href="#fn:php-version-note" rel="footnote">2</a></sup>.</dd>
-
-<dt>Support for many languages:</dt>
-<dd><abbr title="Generic Syntax Highlighter">GeSHi</abbr> comes with more than <em>100</em> languages, including <abbr title="PHP: HTML Preprocessor">PHP</abbr>, <abbr title="Hypertext Markup Language">HTML</abbr>, <abbr title="Cascading Style Sheets">CSS</abbr>, Java, C, Lisp, <abbr title="Extensible Markup Language">XML</abbr>, Perl, Python,
-<abbr title="Assembly language">ASM</abbr> and many more!</dd>
-
-<dt>XHTML compliant output:</dt>
-<dd><abbr title="Generic Syntax Highlighter">GeSHi</abbr> produces XHTML compliant output, using stylesheets, so you need not worry about
-<abbr title="Generic Syntax Highlighter">GeSHi</abbr> ruining your claims to perfection in the standards department ;)</dd>
-
-<dt>Highly customisable:</dt>
-<dd><abbr title="Generic Syntax Highlighter">GeSHi</abbr> allows you to change the style of the output on the fly, use <abbr title="Cascading Style Sheets">CSS</abbr> classes or not, use an external
-stylesheet or not, use line numbering, change the case of output keywords&#8230; the list goes on and on!</dd>
-
-<dt>Flexible:</dt>
-<dd>Unfortunately, <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is quite load/time intensive for large blocks of code. However, you want speed?
-Turn off any features you don&#8217;t like, pre-make a stylesheet and use <abbr title="Cascading Style Sheets">CSS</abbr> classes to reduce the amount of output and more -
-it&#8217;s easy to strike a balance that suits you.</dd>
-</dl>
-
-<p>This is just a taste of what you get with <abbr title="Generic Syntax Highlighter">GeSHi</abbr> - the best syntax highlighter for the web in the world!</p>
-
-<h3 id="about-geshi">1.2 About <abbr title="Generic Syntax Highlighter">GeSHi</abbr></h3><div class="nav"><a href="#features">Previous</a> | <a href="#introduction">Top</a> | <a href="#credits">Next</a></div>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> started as a mod for the <a href="http://phpbb.net"><abbr title="PHP Burning Board">phpBB</abbr></a> forum system, to enable highlighting of more
-languages than the available (which can be roughly estimated to exactly 0 ;)). However, it quickly spawned into an
-entire project on its own. But now it has been released, work continues on a mod
-for phpBB<sup id="fnref:phpbb-note"><a href="#fn:phpbb-note" rel="footnote">3</a></sup> - and hopefully for many forum systems, blogs and other web-based systems.</p>
-
-<p>Several systems are using <abbr title="Generic Syntax Highlighter">GeSHi</abbr> now, including:</p>
-
-<ul>
-<li><a href="http://www.splitbrain.org/docuwiki/">Dokuwiki</a> - An advanced wiki engine</li>
-<li><a href="http://gtk.php.net/">gtk.php.net</a> - Their manual uses <abbr title="Generic Syntax Highlighter">GeSHi</abbr> for syntax highlighting</li>
-<li><a href="http://www.wordpress.org/">WordPress</a> - A powerful blogging system<sup id="fnref:plugin-only"><a href="#fn:plugin-only" rel="footnote">4</a></sup></li>
-<li><a href="http://www.php-fusion.co.uk/"><abbr title="PHP: HTML Preprocessor">PHP</abbr>-Fusion</a> - A constantly evolving CMS</li>
-<li><a href="http://cypreess.dione.cc/sqlm">SQL Manager</a> - A Postgres DBAL</li>
-<li><a href="http://www.mamboserver.com/">Mambo</a> - A popular open source CMS</li>
-<li><a href="http://www.mediawiki.org/">MediaWiki</a> - A leader in Wikis[^plugin-only]</li>
-<li><a href="http://www.tikiwiki.org/">TikiWiki</a> - A megapowerful Wiki/CMS</li>
-<li><a href="http://www.tikipro.org/">TikiPro</a> - Another powerful Wiki based on TikiWiki</li>
-<li><a href="http://www.wikkawiki.org/">WikkaWiki</a> - A flexible and lightweight Wiki engine</li>
-<li><a href="http://robloach.net/projects/phpscripts/rweb/">RWeb</a> - A site-building tool</li>
-</ul>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> is the original work of <a href="mailto:nigel@geshi.org">Nigel McNie</a>. The project was later handed over to <a href="mailto:BenBE@omorphia.de">Benny Baumann</a>.
-Others have helped with aspects of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> also, they&#8217;re mentioned in the <a href="THANKS"><code>THANKS</code></a> file.</p>
-
-<h3 id="credits">1.3 Credits</h3><div class="nav"><a href="#about-geshi">Previous</a> | <a href="#introduction">Top</a> | <a href="#feedback">Next</a></div>
-
-<p>Many people have helped out with <abbr title="Generic Syntax Highlighter">GeSHi</abbr>, whether by creating language files, submitting bug
-reports, suggesting new ideas or simply pointing out a new idea or something I&#8217;d missed. All
-of these people have helped to build a better <abbr title="Generic Syntax Highlighter">GeSHi</abbr>, you can see them in the <a href="THANKS"><code>THANKS</code></a>
-file.</p>
-
-<p>Do you want your name on this list? Why not make a language file, or submit a valid bug? Or perhaps help me with an
-added feature I can&#8217;t get my head around, or suggest a new feature, or even port
-<abbr title="Generic Syntax Highlighter">GeSHi</abbr> to anothe language? There&#8217;s lots you can do to help out, and I need it all :)</p>
-
-<h3 id="feedback">1.4 Feedback</h3><div class="nav"><a href="#credits">Previous</a> | <a href="#introduction">Top</a> | <a href="#the-basics">Next</a></div>
-
-<p>I need your feedback! <em>ANY</em>thing you have to say is fine, whether it be a query,
-congratulations, a bug report or complaint, I don&#8217;t care! I want to make this software
-the best it can be, and I need your help! You can contact me in the following ways:</p>
-
-<ul>
-<li><strong>E-mail:</strong> <a href="mailto:nigel@geshi.org">Nigel McNie</a>, <a href="mailto:BenBE@omorphia.de">Benny Baumann</a> or better yet: use the <a href="http://lists.sourceforge.net/mailman/listinfo/geshi-users">geshi-users</a> mailinglist</li>
-<li><strong>Forums:</strong> <a href="http://sourceforge.net/forum?group_id=114997">Sourceforge.net Forums</a></li>
-<li><strong>IRC:</strong> <a href="irc://irc.freenode.net/geshi">#geshi</a> on <a href="http://freenode.net">Freenode</a></li>
-</ul>
-
-<p>Remember, any help I am grateful for :)</p>
-
-<h2 id="the-basics">2 The Basics</h2><div class="nav"><a href="#feedback">Previous</a> | <a href="#getting-geshi">Next</a></div>
-
-<p>In this section, you&#8217;ll learn a bit about <abbr title="Generic Syntax Highlighter">GeSHi</abbr>, how it works and what it uses, how to install it and how to use
-it to perform basic highlighting.</p>
-
-<h3 id="getting-geshi">2.1 Getting <abbr title="Generic Syntax Highlighter">GeSHi</abbr> work</h3><div class="nav"><a href="#the-basics">Previous</a> | <a href="#the-basics">Top</a> | <a href="#requirements">Next</a></div>
-
-<p>If you&#8217;re reading this and don&#8217;t have <abbr title="Generic Syntax Highlighter">GeSHi</abbr>, that&#8217;s a problem ;). So, how do you get your hands on it?</p>
-
-<h4 id="requirements">2.1.1 Requirements</h4><div class="nav"><a href="#getting-geshi">Previous</a> | <a href="#getting-geshi">Top</a> | <a href="#downloading-geshi">Next</a></div>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> requires the following to be installable:</p>
-
-<ul>
-<li><strong><a href="http://php.net"><abbr title="PHP: HTML Preprocessor">PHP</abbr></a></strong>. It&#8217;s untested with anything other below 4.4.X. I hope to extend this range soon. I see no reason why
-it won&#8217;t work with any version of <abbr title="PHP: HTML Preprocessor">PHP</abbr> above 4.3.0.</li>
-<li><strong>Approximately 2 megabytes of space</strong>. The actual script is small - around 150K - but most of the size comes
-from the large number of language files (over 100!). If you&#8217;re pushed for space, make sure you don&#8217;t upload to
-your server the <code>docs/</code> or <code>contrib/</code> directory, and you may want to leave out any language files that don&#8217;t
-take your fancy either.</li>
-</ul>
-
-<p>As you can see, the requirements are very small. If <abbr title="Generic Syntax Highlighter">GeSHi</abbr> does NOT work for you in a particular version of <abbr title="PHP: HTML Preprocessor">PHP</abbr>, let
-me know why and I&#8217;ll fix it.</p>
-
-<h4 id="downloading-geshi">2.1.2 Downloading <abbr title="Generic Syntax Highlighter">GeSHi</abbr></h4><div class="nav"><a href="#requirements">Previous</a> | <a href="#getting-geshi">Top</a> | <a href="#extracting-geshi">Next</a></div>
-
-<p>There are several ways to get a copy of <abbr title="Generic Syntax Highlighter">GeSHi</abbr>. The first and easiest way of all is
-visiting <a href="http://qbnz.com/highlighter/downloads.php">http://qbnz.com/highlighter/downloads.php</a> to obtain the latest version.
-This is suitable especially when you plan on using <abbr title="Generic Syntax Highlighter">GeSHi</abbr> on an production website
-or otherwise need a stable copy for flawless operation.</p>
-
-<p>If you are somewhat more sophisticated or need a feature just recently implemented
-you might consider getting <abbr title="Generic Syntax Highlighter">GeSHi</abbr> by downloading via SVN. There are multiple ways
-for doing so and each one has its own advantages and disadvantages. Let&#8217;s cover
-the various locations in the SVN you might download from:</p>
-
-<ul>
-<li><a href="https://geshi.svn.sourceforge.net/svnroot/geshi/tags/">https://geshi.svn.sourceforge.net/svnroot/geshi/tags/</a>:<br />
-This directory holds all previous releases of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> each as a subdirectory. By downloading from here you can test your code with various old versions
-in case something has been broken recently.</li>
-<li><a href="https://geshi.svn.sourceforge.net/svnroot/geshi/branches/RELEASE_1_0_X_STABLE/geshi-1.0.X/src/">https://geshi.svn.sourceforge.net/svnroot/geshi/branches/RELEASE_1_0_X_STABLE/geshi-1.0.X/src/</a>:<br />
-This directory is the right place for you if you want to have reasonably current versions of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> but need something that is stable. This directory
-is updated once in a while between updates whenever there&#8217;s something new but which is already reasonably stable. This branch is used to form the
-actual release once the work is done.</li>
-<li><a href="https://geshi.svn.sourceforge.net/svnroot/geshi/trunk/geshi-1.0.X/src/">https://geshi.svn.sourceforge.net/svnroot/geshi/trunk/geshi-1.0.X/src/</a>:<br />
-This directory is the working directory where every new feature, patch or improvement is committed to. This directory is updated regularly, but is not
-guaranteed to be tested and stable at all times. With this version you&#8217;ll always get the latest version of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> out there, but beware of bugs! There
-will be loads of them here! So this is absolutely <strong>not recommended</strong> for productive use!</li>
-</ul>
-
-<p>If you have choosen the right SVN directory for you do a quick
-<code class="highlighted bash"><span class="kw2">svn</span> <span class="kw2">co</span> <span class="re1">$SVNPATH</span> geshi</code> where <code class="highlighted bash"><span class="re1">$SVNPATH</span></code> is one of the above paths and your desired version of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> will be
-downloaded into an subdirectory called &#8220;geshi&#8221;. If you got a version of <abbr title="Generic Syntax Highlighter">GeSHi</abbr>
-you can go on installing as shown below.</p>
-
-<h4 id="extracting-geshi">2.1.3 Extracting <abbr title="Generic Syntax Highlighter">GeSHi</abbr></h4><div class="nav"><a href="#downloading-geshi">Previous</a> | <a href="#getting-geshi">Top</a> | <a href="#installing-geshi">Next</a></div>
-
-<p>Packages come in <code>.zip</code>, <code>.tar.gz</code> and <code>.tar.bz2</code> format, so there&#8217;s no complaining about whether it&#8217;s available for
-you. *nix users probably want <code>.tar.gz</code> or <code>.tar.bz2</code> and windows users probably want <code>.zip</code>.
-And those lucky to download it directly from SVN don&#8217;t even need to bother extracting <abbr title="Generic Syntax Highlighter">GeSHi</abbr>.</p>
-
-<p>To extract <abbr title="Generic Syntax Highlighter">GeSHi</abbr> in Linux (<code>.tar.gz</code>):</p>
-
-<ol>
-<li>Open a shell</li>
-<li><code class="highlighted bash"><span class="kw3">cd</span></code> to the directory where the archive lies</li>
-<li>Type <code class="highlighted bash"><span class="kw2">tar</span> <span class="re5">-xzvf</span> <span class="br0">&#91;</span>filename<span class="br0">&#93;</span></code> where <code>[filename]</code> is the name of the archive (typically <code>GeSHi-1.X.X.tar.gz</code>)</li>
-<li><abbr title="Generic Syntax Highlighter">GeSHi</abbr> will be extracted to its own directory</li>
-</ol>
-
-<p>To extract <abbr title="Generic Syntax Highlighter">GeSHi</abbr> in Windows (<code>.zip</code>):</p>
-
-<ol>
-<li>Open Explorer</li>
-<li>Navigate to the directory where the archive lies</li>
-<li>Extract the archive. The method you use will depend on your configuration. Some people can right-click upon
-the archive and select &#8220;Extract&#8221; from there, others may have to drag the archive and drop it upon an extraction program.</li>
-</ol>
-
-<p>To extract from <code>.zip</code> you&#8217;ll need an unzipping program - <code class="highlighted bash"><span class="kw2">unzip</span></code> in Linux, or 7-Zip, WinZip, WinRAR or similar for Windows.</p>
-
-<h4 id="installing-geshi">2.1.4 Installing <abbr title="Generic Syntax Highlighter">GeSHi</abbr></h4><div class="nav"><a href="#extracting-geshi">Previous</a> | <a href="#getting-geshi">Top</a> | <a href="#basic-usage">Next</a></div>
-
-<p>Installing <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is a snap, even for those most new to <abbr title="PHP: HTML Preprocessor">PHP</abbr>. There&#8217;s no tricks involved. Honest!</p>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> is nothing more than a <abbr title="PHP: HTML Preprocessor">PHP</abbr> class with related language support files. Those of you familiar with <abbr title="PHP: HTML Preprocessor">PHP</abbr> can then
-guess how easy the installation will be: simply copy it into your include path somewhere. You can put it wherever you
-like in this include path. I recommend that you put the language files in a subdirectory of your include path too -
-perhaps the same subdirectory that geshi.php is in. <strong>Remember this path</strong> for later.</p>
-
-<p>If you don&#8217;t know what an include path is, don&#8217;t worry. Simply copy <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to your webserver. So for example, say your
-site is at <code>http://mysite.com/myfolder</code>, you can copy <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to your site so the directory structure is like this:</p>
-
-<pre><code>http://mysite.com/myfolder/geshi/[language files]
-http://mysite.com/myfolder/geshi.php
-</code></pre>
-
-<p>Or you can put it in any subdirectory you like:</p>
-
-<pre><code>http://mysite.com/myfolder/includes/geshi/[language files]
-http://mysite.com/myfolder/includes/geshi.php
-</code></pre>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>When using <abbr title="Generic Syntax Highlighter">GeSHi</abbr> on a live site, the only directory required is the <code>geshi/</code> subdirectory. Both <code>contrib/</code> and <code>docs/</code> are
-worthless, and furthermore, as some people discovered, one of the files in contrib had a security hole (fixed as of 1.0.7.3).
-I suggest you delete these directories from any live site they are on.</p>
-
-</div>
-
-<h3 id="basic-usage">2.2 Basic Usage</h3><div class="nav"><a href="#installing-geshi">Previous</a> | <a href="#the-basics">Top</a> | <a href="#advanced-features">Next</a></div>
-
-<p>Use of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is very easy. Here&#8217;s a simple example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-<span class="xtra li2"><span class="de2">28</span></span></pre></td><td class="de1"><pre class="de1"><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// Include the GeSHi library</span></span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">include_once</span> <span class="st_h">'geshi.php'</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="co1">//</span></span></span><span class="co1">// Define some source to highlight, a language to use</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// and the path to the language files</span></span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$source</span> <span class="sy0">=</span> <span class="st_h">'$foo = 45;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">for ( $i = 1; $i &lt; $foo; $i++ )</span></span></span><span class="st_h">{</span>
-<span class="xtra li2"><span class="de2"><span class="st_h"> &nbsp;echo &quot;$foo\n&quot;;</span></span></span><span class="st_h"> &nbsp;--$foo;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">}'</span><span class="sy0">;</span></span></span><span class="re0">$language</span> <span class="sy0">=</span> <span class="st_h">'php'</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// Create a GeSHi object</span></span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="re0">$language</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// And echo the result!</span></span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<p>As you can see, there&#8217;s only three really important lines:</p>
-
-<p><code class="highlighted php"><span class="kw1">include_once</span><span class="br0">&#40;</span><span class="st_h">'geshi.php'</span><span class="br0">&#41;</span></code></p>
-
-<p>This line includes the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> class for use</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="re0">$language</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>This line creates a new <abbr title="Generic Syntax Highlighter">GeSHi</abbr> object, holding the source and the language you want to use for highlighting.</p>
-
-<p><code class="highlighted php"><span class="kw1">echo</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>This line spits out the result :)</p>
-
-<p>So as you can see, simple usage of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is really easy. Just create a new <abbr title="Generic Syntax Highlighter">GeSHi</abbr> object and get the code!</p>
-
-<p>Since version 1.0.2, there is a function included with <abbr title="Generic Syntax Highlighter">GeSHi</abbr> called <code>geshi_highlight</code>. This behaves exactly as the php
-function <code class="highlighted php"><span class="kw3">highlight_string</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code> behaves - all you do is pass it the language you want to use to highlight and the
-path to the language files as well as the source. Here are some examples:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-</pre></td><td class="de1"><pre class="de1"><span class="co1">// Simply echo the highlighted code</span>
-<span class="xtra li2"><span class="de2">geshi_highlight<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'php'</span><span class="sy0">,</span> <span class="re0">$path</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="co1">// Get the code back, for use later</span></span></span><span class="re0">$code</span> <span class="sy0">=</span> geshi_highlight<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'java'</span><span class="sy0">,</span> <span class="re0">$path</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// Check if there is an error with parsing this code</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><a href="http://www.php.net/ob_start"><span class="kw3">ob_start</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$result</span> <span class="sy0">=</span> geshi_highlight<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'perl'</span><span class="sy0">,</span> <span class="re0">$path</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span><span class="re0">$code</span> <span class="sy0">=</span> <a href="http://www.php.net/ob_get_contents"><span class="kw3">ob_get_contents</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><a href="http://www.php.net/ob_end_clean"><span class="kw3">ob_end_clean</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">if</span> <span class="br0">&#40;</span> <span class="sy0">!</span><span class="re0">$result</span> <span class="br0">&#41;</span></span></span><span class="br0">&#123;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// There was an error with highlighting...</span></span></span><span class="br0">&#125;</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">else</span></span></span><span class="br0">&#123;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// All OK :)</span></span></span><span class="br0">&#125;</span></pre></td></tr></tbody></table>
-
-<p>However, these are really simple examples and doesn&#8217;t even begin to cover all the advanced features of <abbr title="Generic Syntax Highlighter">GeSHi</abbr>.
-If you want to learn more, continue on to section 3: Advanced Features.</p>
-
-<h2 id="advanced-features">3 Advanced Features</h2><div class="nav"><a href="#basic-usage">Previous</a> | <a href="#the-code-container">Next</a></div>
-
-<p>This section documents the advanced features of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> - strict mode, using <abbr title="Cascading Style Sheets">CSS</abbr> classes, changing styles on the fly,
-disabling highlighting of some things and more.</p>
-
-<p>In this section there are many code snippets. For all of these, you should assume that the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> library has been
-included, and a <abbr title="Generic Syntax Highlighter">GeSHi</abbr> object has been created and is referenced by the variable <code class="highlighted php"><span class="re0">$geshi</span></code>. Normally, the
-source, language and path used are arbitary.</p>
-
-<h3 id="the-code-container">3.1 The Code Container</h3><div class="nav"><a href="#advanced-features">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#line-numbers">Next</a></div>
-
-<p>The <strong>Code Container</strong> has a fundamental effect on the layout of your code before you even begin to style. What is the
-Code Container? It&#8217;s the bit of markup that goes around your code to contain it. By default your code is surrounded
-by a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code>, but you can also specify a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>.</p>
-
-<p>The <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> header is the default. If you&#8217;re familiar with <abbr title="Hypertext Markup Language">HTML</abbr> you&#8217;ll know that whitespace is rendered
-&#8220;as is&#8221; by a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> element. The advantage for you is that if you use <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> the whitespace
-you use will appear pretty much exactly how it is in the source, and what&#8217;s more <abbr title="Generic Syntax Highlighter">GeSHi</abbr> won&#8217;t have to add a whole
-lot of <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">br</span> <span class="sy0">/</span>&gt;</span></code>&#8217;s and non-breaking spaces (<code class="highlighted html4strict"><span class="sc1">&amp;nbsp;</span></code>) to your code to indent it. This saves
-you source code (and your valuable visitors waiting time and your bandwidth).</p>
-
-<p>But if you don&#8217;t like <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> or it looks stupid in your browser no matter what styles you try to
-apply to it or something similar, you might want to use a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> instead. A <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> will
-result in more source - <abbr title="Generic Syntax Highlighter">GeSHi</abbr> will have to insert whitespace markup - but in return you can wrap long lines of code
-that would otherwise have your browser&#8217;s horizontal scrollbar appear. Of course with <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> you can
-<em>not</em> wrap lines if you please. The highlighter demo at the <a href="http://qbnz.com/highlighter"><abbr title="Generic Syntax Highlighter">GeSHi</abbr> home page</a> uses the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>
-approach for this reason.</p>
-
-<p>At this stage there isn&#8217;t an option to wrap the code in <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">code</span>&gt;</span></code> tags (unless you use the function
-<code>geshi_highlight</code>), partly because of the inconsistent and unexpected ways stuff in <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">code</span>&gt;</span></code> tags is
-highlighted. Besides, <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">code</span>&gt;</span></code> is an inline element. But this may become an option in future versions.</p>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.7.2 there is a new header type, that specifies that the code should not be wrapped in anything at all.</p>
-
-<p>Another requested addition has been made in <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.7.20 to force <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to create a block around the highlighted
-source even if this wasn&#8217;t necessary, thus styles that are applied to the output of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> can directly influence
-the code only even if headers and footers are present.</p>
-
-<p>To change/set the header to use, you call the <strong><code class="highlighted php">set_header_type<span class="br0">&#40;</span><span class="br0">&#41;</span></code></strong> method. It has one required argument which
-defines the container type. Available are:</p>
-
-<dl>
-<dt><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_type</span><span class="br0">&#40;</span>GESHI_HEADER_DIV<span class="br0">&#41;</span><span class="sy0">;</span></code></dt>
-<dd>
-<p>Puts a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> around both, code and linenumbers. Whitespace is converted to <code class="highlighted html4strict"><span class="sc1">&amp;nbsp;</span></code>
-sequences (i.e. one whitespace and the html entity of a non-breaking whitespace) to keep your indendation level
-in tact. Tabs are converted as well and you can manually <a href="#setting-tab-width">define the tab-width</a>. Lines are automatically wrapped.
-Linenumbers are created using an ordered list.</p>
-</dd>
-
-<dt><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_type</span><span class="br0">&#40;</span>GESHI_HEADER_PRE<span class="br0">&#41;</span><span class="sy0">;</span></code></dt>
-<dd>
-<p>Wraps code and linenumbers in a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> container. This way whitespace is kept as-is and thus
-this header produces less overhead then the <code>GESHI_HEADER_DIV</code> header type. Since linenumbers are still
-created using an ordered list this header type produces <strong>invalid <abbr title="Hypertext Markup Language">HTML</abbr></strong>.</p>
-</dd>
-
-<dt><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_type</span><span class="br0">&#40;</span>GESHI_HEADER_PRE_VALID<span class="br0">&#41;</span><span class="sy0">;</span></code></dt>
-<dd><em><small>Available since 1.0.8</small></em></dd>
-
-<dd>
-<p>When linenumbers are disabled, this behaves just like <code>GESHI_HEADER_PRE</code>. In the other case though, a
-<code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> is used to wrap the code and linenumbers and the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> is put inside the list
-items (<code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">li</span>&gt;</span></code>). This means slightly larger <abbr title="Hypertext Markup Language">HTML</abbr> output compared to <code>GESHI_HEADER_PRE</code>, but the
-output is <strong>valid <abbr title="Hypertext Markup Language">HTML</abbr></strong>.</p>
-</dd>
-
-<dt><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_type</span><span class="br0">&#40;</span>GESHI_HEADER_PRE_TABLE<span class="br0">&#41;</span><span class="sy0">;</span></code></dt>
-<dd><em><small>Available since 1.0.8</small></em></dd>
-
-<dd>
-<p>Once again a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> tag wraps the output. This time though no ordered list is used to create an ordered list,
-but instead we use a table with two cells in a single row. The left cell contains a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> tag which holds all
-linenumbers. The second cell holds the highlighted code, also wrapped in a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> tag, just like with
-<code>GESHI_HEADER_PRE</code>.</p>
-</dd>
-
-<dd>
-<p>This produces <strong>valid <abbr title="Hypertext Markup Language">HTML</abbr></strong> and works around the nasty selection behaviour of Firefox and other Gecko based
-browsers, see <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1651996&amp;group_id=114997&amp;atid=670231">SF#1651996</a> for more information.</p>
-</dd>
-
-<dt><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_type</span><span class="br0">&#40;</span>GESHI_HEADER_NONE<span class="br0">&#41;</span><span class="sy0">;</span></code></dt>
-<dd><em><small>Available since 1.0.7.2</small></em></dd>
-
-<dd>
-<p>No wrapper is added.</p>
-</dd>
-</dl>
-
-<p>Those are the only arguments you should pass to <code class="highlighted php">set_header_type</code>. Passing anything else may cause inconsistencies
-in what is used as the Code Container (although it <em>should</em> simply use a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code>). Better not to risk it.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>GESHI_HEADER_DIV, GESHI_HEADER_PRE, etc. are <em>constants</em>, so don&#8217;t put them in strings!</p>
-
-</div>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>The default styles for the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> and <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> <em>will be different</em>, especially if you use
- line numbers!</p>
-
-<p>I have found that a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> results in code that is smaller than for that of a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>, you
- should rectify this difference by using <strong><code class="highlighted php">set_overall_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code></strong> if you need to. But be aware of this
- difference for if you are changing the header type!</p>
-
-</div>
-
-<h3 id="line-numbers">3.2 Line Numbers</h3><div class="nav"><a href="#the-code-container">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#enabling-line-numbers">Next</a></div>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> has the ability to add line numbers to your code (see the demo available at <a href="http://qbnz.com/highlighter/demo.php">http://qbnz.com/highlighter/demo.php</a>
-to see what can be achieved). Line numbers are a great way to make your code look professional, especially if you use the
-fancy line numbers feature.</p>
-
-<p>There are multiple methods for highlighting line numbers, but none of them is perfect. Of the various ways to highlight
-line numbers <abbr title="Generic Syntax Highlighter">GeSHi</abbr> itself implements 2 different approaches, but allows you
-by the way it generates the code to do the line numbers yourself if necessary - but more on this case later.</p>
-
-<p>The easiest approach is using the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">ol</span>&gt;</span></code>-tag for generating the line numbers, but
-even though this is the easiest one there&#8217;s a big drawback with this one when
-using Gecko-engine based browsers like Firefox or Konqueror. In these browsers
-this approach will select the line numbers along with the code or will include extra markup in the selection.</p>
-
-<p>The other approach has been implemented in the 1.0.8 release of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> with the <code class="highlighted php">GESHI_HEADER_PRE_TABLE</code> header type.
-When using this header type the line numbers are rendered apart from the source
-in a table cell while the actual source is formatted as if the <code class="highlighted php">GESHI_HEADER_PRE</code> header had been used.
-This approach works with Firefox and other Gecko-based browsers so far although extreme care
-has to be taken when applying styles to your source as Windows has some fonts
-where bold font is of different height than normal or italic text of the same fontface.</p>
-
-<h4 id="enabling-line-numbers">3.2.1 Enabling Line Numbers</h4><div class="nav"><a href="#line-numbers">Previous</a> | <a href="#line-numbers">Top</a> | <a href="#styling-line-numbers">Next</a></div>
-
-<p>To highlight a source with line numbers, you call the <code class="highlighted php">enable_line_numbers<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_line_numbers</span><span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span><span class="sy0">;</span></code>
-Where <code class="highlighted php"><span class="re0">$flag</span></code> is one of the following:</p>
-
-<ul>
-<li><code>GESHI_NORMAL_LINE_NUMBERS</code> - Use normal line numbering</li>
-<li><code>GESHI_FANCY_LINE_NUMBERS</code> - Use fancy line numbering</li>
-<li><code>GESHI_NO_LINE_NUMBERS</code> - Disable line numbers (default)</li>
-</ul>
-
-<p>Normal line numbers means you specify a style for them, and that style gets applied to all of them. Fancy line numbers
-means that you can specify a different style for each n<sup>th</sup> line number. You change the value of n (default 5):</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_line_numbers</span><span class="br0">&#40;</span>GESHI_FANCY_LINE_NUMBERS<span class="sy0">,</span> <span class="nu0">37</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>The second parameter is not used in any other mode. Setting it to <code>0</code> is the same as simply using normal line numbers.
-Setting it to <code>1</code> applies the fancy style to every line number.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>The values above are CONSTANTS - so don&#8217;t put them in strings!</p>
-
-</div>
-
-<h4 id="styling-line-numbers">3.2.2 Styling Line Numbers</h4><div class="nav"><a href="#enabling-line-numbers">Previous</a> | <a href="#line-numbers">Top</a> | <a href="#starting-line-numbers">Next</a></div>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.2, line numbers are added by the use of ordered lists. This solves the old issues of line number
-styles inheriting from styles meant for the code. Also, this solves an important issue about selecting code. For
-example, line numbers look nice, but when you go to select the code in your browser to copy it? You got the line
-numbers too! Not such a good thing, but thankfully this issue is now solved. What is the price? Unfortunately the
-whole way that styles are inherited/used has changed for those of you who were familiar with 1.0.1, and there is
-quite a bit more <abbr title="Hypertext Markup Language">HTML</abbr> involved. So think carefully about these things before you enable line numbers.</p>
-
-<p>Now, onto how to style line numbers:</p>
-
-<p>Styles are set for line numbers using the <code class="highlighted php">set_line_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="st_h">'background: #fcfcfc;'</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>If you&#8217;re using Fancy Line Numbers mode, you pass a second string for the style of the n<sup>th</sup> line number:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="st_h">'background: #fcfcfc;'</span><span class="sy0">,</span> <span class="st_h">'background: #f0f0f0;'</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>The second style will have no effect if you&#8217;re not using Fancy Line Numbers mode.</p>
-
-<p>By default, the styles you pass overwrite the current styles. Add a boolean &#8220;true&#8221; after the styles you specify to combine them with the current styles:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="st_h">'background: red;'</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// or, for fancy line numbers</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="st_h">'background: red;'</span><span class="sy0">,</span> <span class="st_h">'background: blue;'</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Due to a bug with Firefox the issue that should have been fixed with 1.0.2 has reappeared in another form as Firefox
- includes extra text\markup into plaintext versions of webpage copies. This can sometimes be useful (actually it&#8217;s
- used to get the plaintext version of this documentation), but more often is quite annoying. Best practice so far is
- to either not use line numbers, or offer the visitor of your page a plaintext version of your source. To learn more
- have a look at the <a href="http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1651996&amp;group_id=114997&amp;atid=670231">SF.net BugTracker Issue #1651996</a>. This will hopefully be fixed in <abbr title="Generic Syntax Highlighter">GeSHi</abbr> version 1.2
- or as soon as Firefox provides webdevelopers with adequate ways to control this feature - whichever comes first!</p>
-
-</div>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>When you set line number styles, the code will inherit those styles! This is the main issue to come out of the 1.0.2
- release. If you want your code to be styled in a predictable manner, you&#8217;ll have to call the <code class="highlighted php">set_code_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code>
- method to rectify this problem.</p>
-
-<p>Note also that you cannot apply background colours to line numbers unless you use <code class="highlighted php">set_overall_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code>.
- Here&#8217;s how you&#8217;d style:</p>
-
-<ol>
-<li><p>Use <code class="highlighted php">set_overall_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to style the overall code block. For example, you can set the border
-style/colour, any margins and padding etc. using this method. <strong>In addition:</strong> set the background colour for
-all the line numbers using this method.</p></li>
-<li><p>Use <code class="highlighted php">set_line_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to style the foreground of the line numbers. For example, you can set the colour,
-weight, font, padding etc. of the line numbers using this method.</p></li>
-<li><p>Use <code class="highlighted php">set_code_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to explicitly override the styles you set for line numbers using
-<code class="highlighted php">set_line_style</code>. For example, if you&#8217;d set the line numbers to be bold (or even if you&#8217;d only set
-the fancy line number style to be bold), and you didn&#8217;t actually want your code to be bold, you&#8217;d make sure
-that <code class="highlighted css"><span class="kw1">font-weight</span><span class="sy0">:</span> <span class="kw2">normal</span><span class="sy0">;</span></code> was in the stylesheet rule you passed to <code class="highlighted php">set_code_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code>.</p>
-
-<p>This is the one major change from <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.1 - make sure you become familiar with this, and make sure that you check
-any code you have already styled with 1.0.1 when you upgrade to make sure nothing bad happens to it.</p></li>
-</ol>
-
-</div>
-
-<h4 id="starting-line-numbers">3.2.3 Choosing a Start Number</h4><div class="nav"><a href="#styling-line-numbers">Previous</a> | <a href="#line-numbers">Top</a> | <a href="#using-css-classes">Next</a></div>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.2, you can now make the line numbers start at any number, rather than just 1. This feature is useful
-if you&#8217;re highlighting code from a file from around a certain line number in that file, as an additional guide to
-those who will view the code. You set the line numbers by calling the <code class="highlighted php">start_line_numbers_at<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">start_line_numbers_at</span><span class="br0">&#40;</span><span class="re0">$number</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p><code class="highlighted php"><span class="re0">$number</span></code> must be a positive integer (or zero). If it is not, <abbr title="Generic Syntax Highlighter">GeSHi</abbr> will convert it anyway.</p>
-
-<p>If you have not enabled line numbers, this will have no effect.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>Although I&#8217;d like <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to have XHTML strict compliance, this feature will break compliancy (however transitional
- compliancy remains). This is because the only widely supported way to change the start value for line numbers is
- by using the <strong>start=&#8221;number&#8221;</strong> attribute of the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">ol</span>&gt;</span></code> tag. Although <abbr title="Cascading Style Sheets">CSS</abbr> does provide a mechanism for
- doing this, it is only supported in Opera versions 7.5 and above (not even Firefox supports this).</p>
-
-</div>
-
-<h3 id="using-css-classes">3.3 Using <abbr title="Cascading Style Sheets">CSS</abbr> Classes</h3><div class="nav"><a href="#starting-line-numbers">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#enabling-css-classes">Next</a></div>
-
-<p>Using <abbr title="Cascading Style Sheets">CSS</abbr> to highlight your code instead of in-lining the styles is a definate bonus. Not only is it more compliant
-(the w3c is deprecating the style attribute in XHTML 2.0) but it results in far less outputted code - up to a whopping
-90% saving - which makes a &#42;huge&#42; difference to those unlucky of us on modems!</p>
-
-<h4 id="enabling-css-classes">3.3.1 Enabling <abbr title="Cascading Style Sheets">CSS</abbr> Classes</h4><div class="nav"><a href="#using-css-classes">Previous</a> | <a href="#using-css-classes">Top</a> | <a href="#setting-css-class-id">Next</a></div>
-
-<p>By default, <abbr title="Generic Syntax Highlighter">GeSHi</abbr> doesn&#8217;t use the classes, so it&#8217;s easy just to whack out some highlighted code if you need without
-worrying about stylesheets. However, if you&#8217;re a bit more organised about it, you should use the classes ;). To turn
-the use of classes on, you call the <code class="highlighted php">enable_classes<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>If you want to turn classes OFF for some reason later:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>If classes are enabled when <code class="highlighted php">parse_code<span class="br0">&#40;</span><span class="br0">&#41;</span></code> is called, then the resultant source will use <abbr title="Cascading Style Sheets">CSS</abbr> classes in the
-output, otherwise it will in-line the styles. The advantages of using classes are great - the reduction in source will
-be very noticeable, and what&#8217;s more you can use one stylesheet for several different highlights on the same page. In
-fact, you can even use an external stylesheet and link to that, saving even more time and source (because stylesheets
-are cached by browsers).</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>There have been problems with inline styles and the Symbol Highlighting added in 1.0.7.21. If you can you should
- therefore turn <abbr title="Cascading Style Sheets">CSS</abbr> classes ON to avoid those issues. Although latest reworks in 1.0.8 should fix most of those issues.</p>
-
-</div>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>This should be the very first method you call after creating a new <abbr title="Generic Syntax Highlighter">GeSHi</abbr> object! That way, various other methods
- can act upon your choice to use classes correctly. In theory, you could call this method just before parsing the
- code, but this may result in unexpected behaviour.</p>
-
-</div>
-
-<h4 id="setting-css-class-id">3.3.2 Setting the <abbr title="Cascading Style Sheets">CSS</abbr> class and ID</h4><div class="nav"><a href="#enabling-css-classes">Previous</a> | <a href="#using-css-classes">Top</a> | <a href="#getting-stylesheet">Next</a></div>
-
-<p>You can set an overall <abbr title="Cascading Style Sheets">CSS</abbr> class and id for the code. This is a good feature that allows you to use the same
-stylesheet for many different snippets of code. You call <code class="highlighted php">set_overall_class<span class="br0">&#40;</span><span class="br0">&#41;</span></code> and <code class="highlighted php">set_overall_id</code>
-to accomplish this:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_overall_class</span><span class="br0">&#40;</span><span class="st_h">'mycode'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_overall_id</span><span class="br0">&#40;</span><span class="st_h">'dk48ck'</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<p>The default classname is the name of the language being used. This means you can use just the one stylesheet for all
-sources that use the same language, and incidentally means that you probably won&#8217;t have to call these methods too often.</p>
-
-<p><abbr title="Cascading Style Sheets">CSS</abbr> IDs are supposed to be unique, and you should use them as such. Basically, you can specify an ID for your code
-and then use that ID to highlight that code in a unique way. You&#8217;d do this for a block of code that you expressly
-wanted to be highlighted in a different way (see the section below on gettting the stylesheet for your code for an example).</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 the class name will always include the language name used for highlighting.</p>
-
-</div>
-
-<h4 id="getting-stylesheet">3.3.3 Getting the stylesheet for your code</h4><div class="nav"><a href="#setting-css-class-id">Previous</a> | <a href="#using-css-classes">Top</a> | <a href="#using-an-external-stylesheet">Next</a></div>
-
-<p>The other half of using <abbr title="Cascading Style Sheets">CSS</abbr> classes is getting the stylesheet for use with the classes. <abbr title="Generic Syntax Highlighter">GeSHi</abbr> makes it very easy to
-get a stylesheet for your code, with one easy method call:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-</pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// Here we have code that will spit out a header for</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// a stylesheet. For example:</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="st_h">'&lt;html&gt;</span></span></span><span class="st_h">&lt;head&gt;&lt;title&gt;Code&lt;/title&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">&lt;style type=&quot;text/css&quot;&gt;</span></span></span><span class="st_h">&lt;!--'</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// Echo out the stylesheet for this code block</span></span></span><span class="kw1">echo</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">get_stylesheet</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// And continue echoing the page</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="kw1">echo</span> <span class="st_h">'--&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">&lt;/style&gt;&lt;/head&gt;</span></span></span><span class="st_h">&lt;body&gt;'</span><span class="sy0">;</span></pre></td></tr></tbody></table>
-
-<p>The <code class="highlighted php">get_stylesheet<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method gets the stylesheet for your code in one easy call. All you need to do
-is output it in the correct place. As you can also see, you don&#8217;t even have to enable class usage to get the
-stylesheet nessecary either - however not enabling classes but using the stylesheet may result in problems later.</p>
-
-<p>By default, <code class="highlighted php">get_stylesheet<span class="br0">&#40;</span><span class="br0">&#41;</span></code> tries to echo the least amount of code possible. Although currently it doesn&#8217;t
-check to see if a certain lexic is even in the source, you can expect this feature in the future. At least for the
-present however, if you explicitly disable the highlighting of a certain lexic, or disable line numbers, the related
-<abbr title="Cascading Style Sheets">CSS</abbr> will not be outputted. This may be a bad thing for you perhaps you&#8217;re going to use the stylesheet for many blocks
-of code, some with line numbers, others with some lexic enabled where this source has it disabled. Or perhaps you&#8217;re
-building an external stylesheet and want all lexics included. So to get around this problem, you do this:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">get_stylesheet</span><span class="br0">&#40;</span><span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>This turns economy mode off, and all of the stylesheet will be outputted regardless.</p>
-
-<p>Now lets say you have several snippets of code, using the same language. In most of them you don&#8217;t mind if they&#8217;re
-highlighted the same way (in fact, that&#8217;s exactly what you want) but in one of them you&#8217;d like the source to be
-highlighted differently. Here&#8217;s how you can do that:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-<span class="xtra li2"><span class="de2">28</span></span>29
-<span class="xtra li2"><span class="de2">30</span></span>31
-<span class="xtra li2"><span class="de2">32</span></span>33
-<span class="xtra li2"><span class="de2">34</span></span>35
-<span class="xtra li2"><span class="de2">36</span></span>37
-<span class="xtra li2"><span class="de2">38</span></span>39
-<span class="xtra li2"><span class="de2">40</span></span>41
-<span class="xtra li2"><span class="de2">42</span></span>43
-<span class="xtra li2"><span class="de2">44</span></span>45
-<span class="xtra li2"><span class="de2">46</span></span>47
-<span class="xtra li2"><span class="de2">48</span></span></pre></td><td class="de1"><pre class="de1"><span class="co1">// assume path is the default &quot;geshi/&quot; relative to the current directory</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$geshi1</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source1</span><span class="sy0">,</span> <span class="re0">$lang</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi2</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source2</span><span class="sy0">,</span> <span class="re0">$lang</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi3</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source3</span><span class="sy0">,</span> <span class="re0">$lang</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="co1">// Turn classes on for all sources</span></span></span><span class="re0">$geshi1</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$geshi2</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi3</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="co1">// Make $geshi3 unique</span></span></span><span class="re0">$geshi3</span><span class="sy0">-&gt;</span><span class="me1">set_overall_id</span><span class="br0">&#40;</span><span class="st_h">'different'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="co1">//</span></span></span><span class="co1">// Methods are called on $geshi3 to change styles...</span>
-<span class="xtra li2"><span class="de2"><span class="co1">//</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="st_h">'&lt;html&gt;</span></span></span><span class="st_h">&lt;head&gt;&lt;title&gt;Code&lt;/title&gt;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="st_h">&lt;style type=&quot;text/css&quot;&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">&lt;!--</span></span></span><span class="st_h">'</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// Get the nessecary stylesheets</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="re0">$geshi1</span><span class="sy0">-&gt;</span><span class="me1">get_stylesheet</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="re0">$geshi3</span><span class="sy0">-&gt;</span><span class="me1">get_stylesheet</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="st_h">'--&gt;</span></span></span><span class="st_h">&lt;/style&gt;&lt;/head&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">&lt;body&gt;'</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="kw1">echo</span> <span class="st_h">'Code snippet 1:'</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="re0">$geshi1</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span><span class="kw1">echo</span> <span class="st_h">'Code snippet 2 (same highlighting as 1):'</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="kw1">echo</span> <span class="re0">$geshi2</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="st_h">'Code snippet 3 (DIFFERENT highlighting):'</span><span class="sy0">;</span></span></span><span class="kw1">echo</span> <span class="re0">$geshi3</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="st_h">'&lt;/body&gt;&lt;/html&gt;'</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<p>Before version 1.0.2, you needed to set the class of the code you wanted to be unique to the empty string. This
-limitation has been removed in version 1.0.2 - if you set the ID of a block of code, all styling will be done based
-on that ID alone.</p>
-
-<h4 id="using-an-external-stylesheet">3.3.4 Using an External Stylesheet</h4><div class="nav"><a href="#getting-stylesheet">Previous</a> | <a href="#using-css-classes">Top</a> | <a href="#changing-styles">Next</a></div>
-
-<p>An external stylesheet can reduce even more the amount of code needed to highlight some source. However there are some
-drawbacks with this. To use an external stylesheet, it&#8217;s up to you to link it in to your document, normally with
-the following <abbr title="Hypertext Markup Language">HTML</abbr>:</p>
-
-<table class="html4strict geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">HTML code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-</pre></td><td class="de1"><pre class="de1"><span class="sc2">&lt;<a href="http://december.com/html/4/element/html.html"><span class="kw2">html</span></a>&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="sc2">&lt;<a href="http://december.com/html/4/element/head.html"><span class="kw2">head</span></a>&gt;</span></span></span><span class="sc2">&lt;<a href="http://december.com/html/4/element/link.html"><span class="kw2">link</span></a> <span class="kw3">rel</span><span class="sy0">=</span><span class="st0">&quot;stylesheet&quot;</span> <span class="kw3">type</span><span class="sy0">=</span><span class="st0">&quot;text/css&quot;</span> <span class="kw3">href</span><span class="sy0">=</span><span class="st0">&quot;url_to_stylesheet.css&quot;</span> <span class="sy0">/</span>&gt;</span></pre></td></tr></tbody></table>
-
-<p>In your external stylesheet you put <abbr title="Cascading Style Sheets">CSS</abbr> declarations for your code. Then just make sure you&#8217;re using the correct class (use
-<code class="highlighted php">set_overall_class<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to ensure this) and this should work fine.</p>
-
-<p>This method is great if you don&#8217;t mind the source always being highlighted the same (in particular, if you&#8217;re making a
-plugin for a forum/wiki/other system, using an external stylesheet is a good idea!). It saves a small amount of code and
-your bandwidth, and it&#8217;s relatively easy to just change the stylesheet should you need to. However, using this will render
-the methods that change the styles of the code useless, because of course the stylesheet is no longer being dynamically
-generated. You can still disable highlighting of certain lexics dynamically, however.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>As of version 1.0.2, <abbr title="Generic Syntax Highlighter">GeSHi</abbr> comes with a <code>contrib/</code> directory, which in it contains a &#8220;wizard&#8221; script for creating
- a stylesheet. Although this script is by no means a complete solution, it will create the necessary rules for the
- basic lexics - comments, strings for example. Things not included in the wizard include regular expressions for any
- language that uses them (<abbr title="PHP: HTML Preprocessor">PHP</abbr> and <abbr title="Extensible Markup Language">XML</abbr> are two languages that use them), and keyword-link styles. However, this script
- should take some of the tedium out of the job of making an external stylesheet. Expect a much better version of this
- script in version 1.2!</p>
-
-</div>
-
-<h3 id="changing-styles">3.4 Changing Styles</h3><div class="nav"><a href="#using-an-external-stylesheet">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#the-overall-styles">Next</a></div>
-
-<p>One of the more powerful features of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is the ability to change the style of the output dynamically. Why be chained
-to the boring styles the language authors make up? You can change almost every single aspect of highlighted code - and
-can even say whether something is to be highlighted at all.</p>
-
-<p>If you&#8217;re confused about &#8220;styles&#8221;, you probably want to have a quick tutorial in them so you know what you can do with
-them. Checkout the homepage of <abbr title="Cascading Style Sheets">CSS</abbr> at <a href="http://www.w3.org/Style/CSS">http://www.w3.org/Style/CSS</a>.</p>
-
-<h4 id="the-overall-styles">3.4.1 The Overall Styles</h4><div class="nav"><a href="#changing-styles">Previous</a> | <a href="#changing-styles">Top</a> | <a href="#line-number-styles">Next</a></div>
-
-<p>The code outputted by <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is either in a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> or a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> (see the section entitled &#8220;The
-Code Container&#8221;), and this can be styled.</p>
-
-<p><code>$geshi-&gt;set_overall_style('... styles ...');</code>
-Where styles is a string containing valid <abbr title="Cascading Style Sheets">CSS</abbr> declarations. By default, these styles overwrite the current styles, but you can change this by adding a second parameter:</p>
-
-<p><code>$geshi-&gt;set_overall_style('color: blue;', true);</code>
-The default styles &#8220;shine through&#8221; wherever anything isn&#8217;t highlighted. Also, you can apply more advanced styles, like position: (fixed|relative) etc, because a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>/<code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> is a block level element.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Remember that a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> will by default have a larger font size than a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code>, as discussed in the section <a href="#the-code-container">&#8220;The Code Container&#8221;</a>.</p>
-
-</div>
-
-<h4 id="line-number-styles">3.4.2 Line Number Styles</h4><div class="nav"><a href="#the-overall-styles">Previous</a> | <a href="#changing-styles">Top</a> | <a href="#setting-keyword-styles">Next</a></div>
-
-<p>You may wish to refer to the section [Styling Line Numbers][1] before reading this section.</p>
-
-<p>As of version 1.0.2, the way line numbers are generated is different, so therefore the way that they are styled is
-different. In particular, now you cannot set the background style of the fancy line numbers to be different from that
-of the normal line numbers.</p>
-
-<p>Line number styles are set by using the method <code class="highlighted php">set_line_style</code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="re0">$style1</span><span class="sy0">,</span> <span class="re0">$style2</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p><code class="highlighted php"><span class="re0">$style1</span></code> is the style of the line numbers by default, and <code class="highlighted php"><span class="re0">$style2</span></code> is the style of the fancy line numbers.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>Things have changed since 1.0.1! This note is <strong>very</strong> important - please make sure you check this twice before
- complaining about line numbers!</p>
-
-<p>Because of the way that ordered lists are done in <abbr title="Hypertext Markup Language">HTML</abbr>, there really isn&#8217;t normally a way to style the actual
- <em>numbers</em> in the list. I&#8217;ve cheated somewhat with <abbr title="Generic Syntax Highlighter">GeSHi</abbr> - I&#8217;ve made it possible to use <abbr title="Cascading Style Sheets">CSS</abbr> to style the <em>foreground</em> of
- the line numbers. So therefore, you can change the color, font size and type, and padding on them. If you want to
- have a pretty background, you <strong>must</strong> use <code class="highlighted php">set_overall_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to do this, and use <code class="highlighted php">set_code_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code>
- to style the actual code! This is explained in the section above: <a href="#styling-line-numbers">Styling Line Numbers</a>.</p>
-
-<p>In addition, the styles for fancy line numbers <em>is now the difference between the normal styles and the styles you want
- to achieve</em>. For example, in <abbr title="Generic Syntax Highlighter">GeSHi</abbr> prior to 1.0.2 you may have done this to style line numbers:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="st_h">'color: red; font-weight: bold;'</span><span class="sy0">,</span> <span class="st_h">'color: green; font-weight: bold'</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Now you instead can do this:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_line_style</span><span class="br0">&#40;</span><span class="st_h">'color: red; font-weight: bold;'</span><span class="sy0">,</span> <span class="st_h">'color: green;'</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>The <code class="highlighted css"><span class="kw1">font-weight</span><span class="sy0">:</span> <span class="kw2">bold</span><span class="sy0">;</span></code> will automatically carry through to the fancy styles. This is actually a small
- saving in code - but the difference may be confusing for anyone using 1.0.1 at first.</p>
-
-</div>
-
-<h4 id="setting-keyword-styles">3.4.3 Setting Keyword Styles</h4><div class="nav"><a href="#line-number-styles">Previous</a> | <a href="#changing-styles">Top</a> | <a href="#setting-comment-styles">Next</a></div>
-
-<p>Perhaps the most regular change you will make will be to the styles of a keyword set. In order to change the styles for
-a particular set, you&#8217;ll have to know what the set is called first. Sets are numbered from 1 up. Typically, set 1
-contains keywords like <code>if</code>, <code>while</code>, <code>do</code>, <code>for</code>, <code>switch</code> etc, set 2 contains <code>null</code>, <code>false</code>, <code>true</code> etc, set 3
-contains function inbuilt into the language (<code>echo</code>, <code>htmlspecialchars</code> etc. in <abbr title="PHP: HTML Preprocessor">PHP</abbr>) and set 4 contains data types and
-similar variable modifiers: <code>int</code>, <code>double</code>, <code>real</code>, <code>static</code> etc. However these things are not fixed, and you should
-check the language file to see what key you want. Having a familiarity with a language file is definately a plus for
-using it.</p>
-
-<p>To change the styles for a keyword set, call the <code class="highlighted php">set_keyword_group_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_keyword_group_style</span><span class="br0">&#40;</span><span class="re0">$group</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$group</span></code> is the group to change the styles for and <code class="highlighted php"><span class="re0">$styles</span></code> is a string containing the styles
-to apply to that group.</p>
-
-<p>By default, the styles you pass overwrite the current styles. Add a boolean <code class="highlighted php"><span class="kw4">true</span></code> after the styles you specify to
-combine them with the current styles:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_keyword_group_style</span><span class="br0">&#40;</span><span class="nu0">3</span><span class="sy0">,</span> <span class="st_h">'color: white;'</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<h4 id="setting-comment-styles">3.4.4 Setting Comment Styles</h4><div class="nav"><a href="#setting-keyword-styles">Previous</a> | <a href="#changing-styles">Top</a> | <a href="#setting-other-styles">Next</a></div>
-
-<p>To change the styles for a comment group, call the <code class="highlighted php">set_comments_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_comments_style</span><span class="br0">&#40;</span><span class="re0">$group</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$group</span></code> is either a number corresponding to a single-line comment, or the string <code class="highlighted php"><span class="st_h">'MULTI'</span></code> to
-specify multiline comments:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_comments_style</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="st_h">'font-style: italic;'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_comments_style</span><span class="br0">&#40;</span><span class="st_h">'MULTI'</span><span class="sy0">,</span> <span class="st_h">'display: hidden;'</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<p>By default, the styles you pass overwrite the current styles. Add a boolean <code class="highlighted php"><span class="kw4">true</span></code> after the styles you specify to
-combine them with the current styles:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_comments_style</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="st_h">'font-weight: 100;'</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>In 1.0.7.22 a new kind of Comments called &#8220;COMMENT_REGEXP&#8221; has been added. Those are handled by setting single
- line comment styles.</p>
-
-</div>
-
-<h4 id="setting-other-styles">3.4.5 Setting Other Styles</h4><div class="nav"><a href="#setting-comment-styles">Previous</a> | <a href="#changing-styles">Top</a> | <a href="#case-caps">Next</a></div>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> can highlight many other aspects of your source other than just keywords and comments. Strings, Numbers, Methods
-and Brackets among other things can all also be highlighted. Here are the related methods:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-</pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_escape_characters_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_symbols_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_strings_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_numbers_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_methods_style</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_regexps_style</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></td></tr></tbody></table>
-
-<p><code class="highlighted php"><span class="re0">$styles</span></code> is a string containing valid stylesheet declarations, while <code class="highlighted php"><span class="re0">$preserve_defaults</span></code> should be set
-to <code class="highlighted php"><span class="kw4">true</span></code> if you want your styles to be merged with the previous styles. In the case of <code class="highlighted php">set_methods_style<span class="br0">&#40;</span><span class="br0">&#41;</span></code>,
-you should select a group to set the styles of, check the language files for the number used for each &#8220;object splitter&#8221;.</p>
-
-<p>Like this was possible for <code class="highlighted php">set_method_style</code> a new parameter has been introduced for
-<code class="highlighted php">set_symbols_style</code> too which allows you to select the group of symbols for which you&#8217;d like to change your
-style. <code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_symbols_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$preserve_defaults</span><span class="br0">&#91;</span><span class="sy0">,</span> <span class="re0">$group</span><span class="br0">&#93;</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="sy0">;</span></code> If the third parameter is not
-given, group 0 is assumed. Furthermore you should note that any changes to group 0 are also reflected in the bracket
-style, i.e. a pass-through call to <code class="highlighted php">set_bracket_style</code> is made.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Since <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 multiple styles for strings and numbers are supported, though the API doesn&#8217;t provide full access yet.</p>
-
-</div>
-
-<h3 id="case-caps">3.5 Case Sensitivity and Auto Casing</h3><div class="nav"><a href="#setting-other-styles">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#auto-caps-nocaps">Next</a></div>
-
-<p>Controlling the case of the outputted source is an easy job with <abbr title="Generic Syntax Highlighter">GeSHi</abbr>. You can control which keywords are converted in
-case, and also control whether keywords are checked in a case sensitive manner.</p>
-
-<h4 id="auto-caps-nocaps">3.5.1 Auto-Caps/NoCaps</h4><div class="nav"><a href="#case-caps">Previous</a> | <a href="#case-caps">Top</a> | <a href="#setting-case-sensitivity">Next</a></div>
-
-<p>Auto-Caps/NoCaps is a nifty little feature that capitalises or lowercases automatically certain lexics when they are
-styled. I dabble in QuickBASIC, a dialect of BASIC which is well known for it&#8217;s capatalisation, and SQL is another
-language well known for using caps for readability.</p>
-
-<p>To change what case lexics are rendered in, you call the <code class="highlighted php">set_case_keywords<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_case_keywords</span><span class="br0">&#40;</span><span class="re0">$caps_modifier</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>The valid values to pass to this method are:</p>
-
-<ul>
-<li><code>GESHI_CAPS_NO_CHANGE</code> - Don&#8217;t change the case of any lexics, leave as they are found</li>
-<li><code>GESHI_CAPS_UPPER</code> - Uppercase all lexics found</li>
-<li><code>GESHI_CAPS_LOWER</code> - Lowercase all lexics found</li>
-</ul>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>When I say &#8220;lexic&#8221;, I mean &#8220;keywords&#8221;. <strong>Any</strong> keyword in <strong>any</strong> keyword array will be modified using this option!
- This is one small area of inflexibility I hope to fix in 1.2.X.</p>
-
-</div>
-
-<p>I suspect this will only be used to specify <code>GESHI_CAPS_NO_CHANGE</code> to turn off autocaps for languages like SQL
-and BASIC variants, like so:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'sql'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_case_keywords</span><span class="br0">&#40;</span>GESHI_CAPS_NO_CHANGE<span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// don't want keywords capatalised</span></span></span></pre></td></tr></tbody></table>
-
-<p>All the same, it can be used for some interesting effects:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'java'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// Anyone who's used java knows how picky it is about CapitalLetters...</span></span></span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_case_keywords</span><span class="br0">&#40;</span>GESHI_CAPS_LOWER<span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// No *way* the source will look right now ;)</span></span></span></pre></td></tr></tbody></table>
-
-<h4 id="setting-case-sensitivity">3.5.2 Setting Case Sensitivity</h4><div class="nav"><a href="#auto-caps-nocaps">Previous</a> | <a href="#case-caps">Top</a> | <a href="#changing-config">Next</a></div>
-
-<p>Some languages, like <abbr title="PHP: HTML Preprocessor">PHP</abbr>, don&#8217;t mind what case function names and keywords are in, while others, like Java, depend on
-such pickiness to maintain their bad reputations ;). In any event, you can use the <code class="highlighted php">set_case_sensitivity<span class="br0">&#40;</span><span class="br0">&#41;</span></code>
-to change the case sensitiveness of a particular keyword group from the default:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_case_sensitivity</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="sy0">,</span> <span class="re0">$sensitivity</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$key</span></code> is the key of the group for which you wish to change case sensitivness for (see the language file
-for that language), and <code class="highlighted php"><span class="re0">$sensitivity</span></code> is a boolean value - <code class="highlighted php"><span class="kw4">true</span></code> if the keyword is case sensitive, and
-<code class="highlighted php"><span class="kw4">false</span></code> if not.</p>
-
-<h3 id="changing-config">3.6 Changing the Source, Language, Config Options</h3><div class="nav"><a href="#setting-case-sensitivity">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#changing-the-source">Next</a></div>
-
-<p>What happens if you want to change the source to be highlighted on the fly, or the language. Or if you want to specify
-any of those basic fields after you&#8217;ve created a <abbr title="Generic Syntax Highlighter">GeSHi</abbr> object? Well, that&#8217;s where these methods come in.</p>
-
-<h4 id="changing-the-source">3.6.1 Changing the Source Code</h4><div class="nav"><a href="#changing-config">Previous</a> | <a href="#changing-config">Top</a> | <a href="#changing-the-language">Next</a></div>
-
-<p>To change the source code, you call the <code class="highlighted php">set_source<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_source</span><span class="br0">&#40;</span><span class="re0">$newsource</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source1</span><span class="sy0">,</span> <span class="st_h">'php'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// Method calls to specify various options...</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$code1</span> <span class="sy0">=</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_source</span><span class="br0">&#40;</span><span class="re0">$source2</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$code2</span> <span class="sy0">=</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<h4 id="changing-the-language">3.6.2 Changing the Language</h4><div class="nav"><a href="#changing-the-source">Previous</a> | <a href="#changing-config">Top</a> | <a href="#changing-the-path">Next</a></div>
-
-<p>What happens if you want to change the language used for highlighting? Just call <code class="highlighted php">set_language<span class="br0">&#40;</span><span class="br0">&#41;</span></code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_language</span><span class="br0">&#40;</span><span class="st_h">'newlanguage'</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span></pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'php'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$code</span> <span class="sy0">=</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="co1">// Highlight GeSHi's output</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_source</span><span class="br0">&#40;</span><span class="re0">$code</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_language</span><span class="br0">&#40;</span><span class="st_h">'html4strict'</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_classes</span><span class="br0">&#40;</span><span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="kw1">echo</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.5, you can use the method <code class="highlighted php">load_from_file<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to load the source code and language from a file.
-Simply pass this method a file name and it will attempt to load the source and set the language.</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">load_from_file</span><span class="br0">&#40;</span><span class="re0">$file_name</span><span class="sy0">,</span> <span class="re0">$lookup</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p><code class="highlighted php"><span class="re0">$file_name</span></code> is the file name to use, and <code class="highlighted php"><span class="re0">$lookup</span></code> is an optional parameter that contains a lookup
-array to use for deciding which language to choose. You can use this to override <abbr title="Generic Syntax Highlighter">GeSHi</abbr>&#8217;s default lookup array, which
-may not contain the extension of the file you&#8217;re after, or perhaps does have your extension but under a different
-language. The lookup array is of the form:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span></pre></td><td class="de1"><pre class="de1"><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp;<span class="st_h">'lang_name'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'extension'</span><span class="sy0">,</span> <span class="st_h">'extension'</span><span class="sy0">,</span> <span class="sy0">...</span><span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp;<span class="st_h">'lang_name'</span> <span class="sy0">...</span>
-<span class="xtra li2"><span class="de2"><span class="br0">&#41;</span><span class="sy0">;</span></span></span></pre></td></tr></tbody></table>
-
-<p>Also, you can use the method <code class="highlighted php">get_language_name_from_extension<span class="br0">&#40;</span><span class="br0">&#41;</span></code> if you need to convert a file extension
-to a valid language name. This method will return the empty string if it could not find a match in the lookup, and
-like <code class="highlighted php">load_from_file</code> it accepts an optional second parameter that contains a lookup array.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Names are case-insensitive - they will be converted to lower case to match a language file however. So if you&#8217;re
- making a language file, remember it should have a name in lower case.</p>
-
-</div>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>What you pass to this method is the name of a language file, minus the .php extension. If you&#8217;re writing a plugin
- for a particular application, it&#8217;s up to you to somehow convert user input into a valid language name.</p>
-
-</div>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Since <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 this function does not reset language settings for an already loaded language. If you want
- to highlight code in the same language with different settings add the optional
- <code class="highlighted php"><span class="re0">$force_reset</span> parameter</code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_language</span><span class="br0">&#40;</span><span class="st_h">'language'</span><span class="sy0">,</span> <span class="kw4">true</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-</div>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> <code class="highlighted php"><span class="kw1">include</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code>s the language file, so be careful to make sure that users can&#8217;t pass some wierd
- language name to include any old script! <abbr title="Generic Syntax Highlighter">GeSHi</abbr> tries to strip non-valid characters out of a language name, but
- you should always do this your self anyway. In particular, language files are always lower-case, with either
- alphanumeric characters, dashes or underscores in their name.</p>
-
-<p>At the very least, strip &#8220;/&#8221; characters out of a language name.</p>
-
-</div>
-
-<h4 id="changing-the-path">3.6.3 Changing the Language Path</h4><div class="nav"><a href="#changing-the-language">Previous</a> | <a href="#changing-config">Top</a> | <a href="#changing-the-charset">Next</a></div>
-
-<p>What happens if all of a sudden you want to use language files from a different directory from the current
-language file location? You call the <code class="highlighted php">set_language_path<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_language_path</span><span class="br0">&#40;</span><span class="re0">$newpath</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>It doesn&#8217;t matter whether the path has a trailing slash after it or not - only that it points to a valid folder.
-If it doesn&#8217;t, that&#8217;s your tough luck ;)</p>
-
-<h4 id="changing-the-charset">3.6.4 Changing the Character Set</h4><div class="nav"><a href="#changing-the-path">Previous</a> | <a href="#changing-config">Top</a> | <a href="#error-handling">Next</a></div>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Although <abbr title="Generic Syntax Highlighter">GeSHi</abbr> itself does not require to know the exact charset of your source you
- will need to set this option when processing sources where multi-byte characters can occur.
- As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.7.18 internally a rewrite of <code class="highlighted php"><span class="kw3">htmlspecialchars</span></code> is used
- due to a security flaw in that function that is unpatched in even the most recent PHP4 versions and in PHP5 &lt; 5.2.
- Although this does no longer explicitely require the charset it is required again
- as of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 to properly handle multi-byte characters (e.g. after an escape char).</p>
-
-</div>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 the default charset has been changed to UTF-8.</p>
-
-</div>
-
-<p>As of version 1.0.3, you can use the method <code class="highlighted php">set_encoding<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to specify the character set that your source
-is in. Valid names are those names that are valid for the <abbr title="PHP: HTML Preprocessor">PHP</abbr> mbstring library:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_encoding</span><span class="br0">&#40;</span><span class="re0">$encoding</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>There is a table of valid strings for <code class="highlighted php"><span class="re0">$encoding</span></code> at the php.net manual linked to above. If you do not
-specify an encoding, or specify an invalid encoding, the character set used is ISO-8859-1.</p>
-
-<h3 id="error-handling">3.7 Error Handling</h3><div class="nav"><a href="#changing-the-charset">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#disabling-lexics">Next</a></div>
-
-<p>What happens if you try to highlight using a language that doesn&#8217;t exist? Or if <abbr title="Generic Syntax Highlighter">GeSHi</abbr> can&#8217;t read a required file?
-The results you get may be confusing. You may check your code over and over, and never find anything wrong. <abbr title="Generic Syntax Highlighter">GeSHi</abbr>
-provides ways of finding out if <abbr title="Generic Syntax Highlighter">GeSHi</abbr> itself found anything wrong with what you tried to do. After highlighting,
-you can call the <code class="highlighted php">error<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="st_h">'hi'</span><span class="sy0">,</span> <span class="st_h">'thisLangIsNotSupported'</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p><code class="highlighted php"><span class="kw1">echo</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">error</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="co1">// echoes error message</span></code></p>
-
-<p>The error message you will get will look like this:</p>
-
-<blockquote>
- <p><abbr title="Generic Syntax Highlighter">GeSHi</abbr> Error: <abbr title="Generic Syntax Highlighter">GeSHi</abbr> could not find the language thisLangIsNotSupported (using path geshi/) (code 2)</p>
-</blockquote>
-
-<p>The error outputted will be the last error <abbr title="Generic Syntax Highlighter">GeSHi</abbr> came across, just like how <code class="highlighted php"><span class="kw3">mysql_error</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code> works.</p>
-
-<h3 id="disabling-lexics">3.8 Disabling styling of some Lexics</h3><div class="nav"><a href="#error-handling">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#setting-tab-width">Next</a></div>
-
-<p>One disadvantage of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> is that for large source files using complex languages, it can be quite slow with
-every option turned on. Although future releases will concentrate on the speed/resource side of highlighting,
-you can gain speed by disabling some of the highlighting options. This is done by using a
-series of <code class="highlighted php">set_<span class="sy0">*</span>_highlighting</code> methods:</p>
-
-<dl>
-<dt><code class="highlighted php">set_keyword_group_highlighting<span class="br0">&#40;</span><span class="re0">$group</span><span class="sy0">,</span> <span class="re0">$flag</span><span class="br0">&#41;</span><span class="sy0">:</span></code></dt>
-<dd>Sets whether a particular <code class="highlighted php"><span class="re0">$group</span></code> of keywords is to be highlighted or not. Consult the necessary
-language file(s) to see what <code class="highlighted php"><span class="re0">$group</span></code> should be for each group (typically a positive integer).
-<code class="highlighted php"><span class="re0">$flag</span></code> is <code class="highlighted php"><span class="kw4">false</span></code> if you want to disable highlighting of this group, and <code class="highlighted php"><span class="kw4">true</span></code> if you want
-to re-enable higlighting of this group. If you disable a keyword group then even if the keyword group has a
-related URL one will not be generated for that keyword.</dd>
-
-<dt><code class="highlighted php">set_comments_highlighting<span class="br0">&#40;</span><span class="re0">$group</span><span class="sy0">,</span> <span class="re0">$flag</span><span class="br0">&#41;</span><span class="sy0">:</span></code></dt>
-<dd>Sets whether a particular <code class="highlighted php"><span class="re0">$group</span></code> of comments is to be highlighted or not. Consult the necessary
-language file(s) to see what <code class="highlighted php"><span class="re0">$group</span></code> should be for each group (typically a positive integer, or th
-string <code class="highlighted php"><span class="st_h">'MULTI'</span></code> for multiline comments. <code class="highlighted php"><span class="re0">$flag</span></code> is <code class="highlighted php"><span class="kw4">false</span></code> if you want to disable
-highlighting of this group, and <code class="highlighted php"><span class="kw4">true</span></code> if you want to re-enable highlighting of this group.</dd>
-
-<dt><code class="highlighted php">set_regexps_highlighting<span class="br0">&#40;</span><span class="re0">$regexp</span><span class="sy0">,</span> <span class="re0">$flag</span><span class="br0">&#41;</span><span class="sy0">:</span></code></dt>
-<dd>Sets whether a particular <code class="highlighted php"><span class="re0">$regexp</span></code> is to be highlighted or not. Consult the necessary language file(s)
-to see what <code class="highlighted php"><span class="re0">$regexp</span></code> should be for each regexp (typically a positive integer, or the string <code class="highlighted php"><span class="st_h">'MULTI'</span></code>
-for multiline comments. <code class="highlighted php"><span class="re0">$flag</span></code> is <code class="highlighted php"><span class="kw4">false</span></code> if you want to disable highlighting of this group,
-and <code class="highlighted php"><span class="kw4">true</span></code> if you want to re-enable highlighting of this group.</dd>
-</dl>
-
-<p>The following methods:</p>
-
-<ul>
-<li><code class="highlighted php">set_escape_characters_highlighting<span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span></code></li>
-<li><code class="highlighted php">set_symbols_highlighting<span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span></code></li>
-<li><code class="highlighted php">set_strings_highlighting<span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span></code></li>
-<li><code class="highlighted php">set_numbers_highlighting<span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span></code></li>
-<li><code class="highlighted php">set_methods_highlighting<span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span></code></li>
-</ul>
-
-<p>Work on their respective lexics (e.g. <code class="highlighted php">set_methods_highlighting<span class="br0">&#40;</span><span class="br0">&#41;</span></code> will disable/enable highlighting of methods).
-For each method, if <code class="highlighted php"><span class="re0">$flag</span></code> is <code class="highlighted php"><span class="kw4">false</span></code> then the related lexics will not be highlighted at all (this
-means no <abbr title="Hypertext Markup Language">HTML</abbr> will surround the lexic like usual, saving on time and bandwidth.</p>
-
-<p>In case all highlighting should be disabled or reenabled <abbr title="Generic Syntax Highlighter">GeSHi</abbr> provides two methods called <code class="highlighted php">disable_highlighting<span class="br0">&#40;</span><span class="br0">&#41;</span></code>
-and <code class="highlighted php">enable_highlighting<span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span></code>. The optional paramter <code class="highlighted php"><span class="re0">$flag</span></code> has been added in 1.0.7.21 and specifies
-the desired state, i.e. <code class="highlighted php"><span class="kw4">true</span></code> (default) to turn all highlighting on, or <code class="highlighted php"><span class="kw4">false</span></code> to turn all
-highlighting off. Since 1.0.7.21 the method <code class="highlighted php">disnable_highlighting<span class="br0">&#40;</span><span class="br0">&#41;</span></code> has become deprecated.</p>
-
-<h3 id="setting-tab-width">3.9 Setting the Tab Width</h3><div class="nav"><a href="#disabling-lexics">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#using-strict-mode">Next</a></div>
-
-<p>If you&#8217;re using the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">pre</span>&gt;</span></code> header, tabs are handled automatically by your browser, and in general you can
-count on good results. However, if you&#8217;re using the <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code> header, you may want to specify a tab
-width explicitly.</p>
-
-<p>Note that tabs created in this fashion won&#8217;t be like normal tabs - there won&#8217;t be &#8220;tab-stops&#8221; as such, instead
-tabs will be replaced with the specified number of spaces - just like most editors do.</p>
-
-<p>To change the tab width, you call the <code class="highlighted php">set_tab_width<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_tab_width</span><span class="br0">&#40;</span><span class="re0">$width</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$width</span></code> is the width in spaces that you&#8217;d like tabs to be.</p>
-
-<h3 id="using-strict-mode">3.10 Using Strict Mode</h3><div class="nav"><a href="#setting-tab-width">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#adding-removing-keywords">Next</a></div>
-
-<p>Some languages like to get tricky, and jump in and out of the file that they&#8217;re in. For example, the vast
-majority of you reading this will have used a <abbr title="PHP: HTML Preprocessor">PHP</abbr> file. And you know that <abbr title="PHP: HTML Preprocessor">PHP</abbr> code is only executed if it&#8217;s
-within delimiters like <code class="highlighted php"><span class="kw2">&lt;?php</span></code> and <code class="highlighted php"><span class="sy1">?&gt;</span></code> (there are others of course&#8230;). So what happens if you do the
-following in a php file?</p>
-
-<p><code class="highlighted php">&lt;img src=&quot;<span class="kw2">&lt;?php</span> <span class="kw1">echo</span> <span class="kw3">rand</span><span class="br0">&#40;</span><span class="nu0">1</span><span class="sy0">,</span> <span class="nu0">100</span><span class="br0">&#41;</span> <span class="sy1">?&gt;</span>&quot; /&gt;</code></p>
-
-<p>When using <abbr title="Generic Syntax Highlighter">GeSHi</abbr> without strict mode, or using a bad highlighter, you&#8217;ll end up with scrambled crap,
-especially if you&#8217;re being slack about where you&#8217;re putting your quotes, you could end up with the rest
-of your file as bright blue. Fortunately, you can tell <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to be &#8220;strict&#8221; about just when it highlights
-and when it does not, using the <code class="highlighted php">enable_strict_mode<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_strict_mode</span><span class="br0">&#40;</span><span class="re0">$mode</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$mode</span></code> is <code class="highlighted php"><span class="kw4">true</span></code> or not specified to enable strict mode, or <code class="highlighted php"><span class="kw4">false</span></code> to disable
-strict mode if you&#8217;ve already turned it and don&#8217;t want it now.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 there is a new way to tell <abbr title="Generic Syntax Highlighter">GeSHi</abbr> when to use Strict Mode
- which is somewhat more intelligent than in previous releases. <abbr title="Generic Syntax Highlighter">GeSHi</abbr> now also
- allows <code class="highlighted php">GESHI_MAYBE</code>, <code class="highlighted php">GESHI_NEVER</code> and <code class="highlighted php">GESHI_ALWAYS</code> instead of <code class="highlighted php"><span class="kw4">true</span></code> and <code class="highlighted php"><span class="kw4">false</span></code>.
- Basically <code class="highlighted php">GESHI_ALWAYS</code> (<code class="highlighted php"><span class="kw4">true</span></code>) always enables strict mode,
- whereas <code class="highlighted php">GESHI_NEVER</code> (<code class="highlighted php"><span class="kw4">false</span></code>) completely disables strict mode. The new thing is
- <code class="highlighted php">GESHI_MAYBE</code> which enables strict mode if it finds any sequences of code
- that look like strict block delimiters.</p>
-
-<p>By the way: That&#8217;s why this section had to be changed, as the new documentation
- tool we now use, applies this feature and thus auto-detects when strict mode has to be used&#8230;</p>
-
-</div>
-
-<h3 id="adding-removing-keywords">3.11 Adding/Removing Keywords</h3><div class="nav"><a href="#using-strict-mode">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#adding-a-keyword">Next</a></div>
-
-<p>Lets say that you&#8217;re working on a large project, with many files, many classes and many functions. Perhaps also you
-have the source code on the web and highlighted by <abbr title="Generic Syntax Highlighter">GeSHi</abbr>, perhaps as a front end to CVS, as a learning tool, something
-to refer to, whatever. Well, why not highlight the names of the functions and classes <em>your</em> project uses, as well
-as the standard functions and classes? Or perhaps you&#8217;re not interested in highlighting certain functions, and would
-like to remove them? Or maybe you don&#8217;t mind if an entire function group goes west in the interest of speed? <abbr title="Generic Syntax Highlighter">GeSHi</abbr>
-can handle all of this!</p>
-
-<h4 id="adding-a-keyword">3.11.1 Adding a Keyword</h4><div class="nav"><a href="#adding-removing-keywords">Previous</a> | <a href="#adding-removing-keywords">Top</a> | <a href="#removing-a-keyword">Next</a></div>
-
-<p>If you want to add a keyword to an existing keyword group, you use the <code class="highlighted php">add_keyword</code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">add_keyword</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="sy0">,</span> <span class="re0">$word</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$key</span></code> is the index of the group of keywords you want to add this keyword to, and <code class="highlighted php"><span class="re0">$word</span></code> is
-the word to add.</p>
-
-<p>This implies knowledge of the language file to know the correct index.</p>
-
-<h4 id="removing-a-keyword">3.11.2 Removing a Keyword</h4><div class="nav"><a href="#adding-a-keyword">Previous</a> | <a href="#adding-removing-keywords">Top</a> | <a href="#adding-a-keyword-group">Next</a></div>
-
-<p>Perhaps you want to remove a keyword from an existing group. Maybe you don&#8217;t use it and want to save yourself some time. Whatever the reason, you can remove it using the <code class="highlighted php">remove_keyword</code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">remove_keyword</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="sy0">,</span> <span class="re0">$word</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$key</span></code> is the index of the group of keywords that you want to remove this keyword from, and
-<code class="highlighted php"><span class="re0">$word</span></code> is the word to remove.</p>
-
-<p>This implies knowledge of the language file to know the correct index - most of the time the keywords you&#8217;ll
-want to remove will be in group 3, but this is not guaranteed and you should check the language file first.</p>
-
-<p>This function is silent - if the keyword is not in the group you specified, nothing awful will happen ;)</p>
-
-<h4 id="adding-a-keyword-group">3.11.3 Adding a Keyword Group</h4><div class="nav"><a href="#removing-a-keyword">Previous</a> | <a href="#adding-removing-keywords">Top</a> | <a href="#removing-a-keyword-group">Next</a></div>
-
-<p>Lets say for your big project you have several main functions and classes that you&#8217;d like highlighted. Why not
-add them as their own group instead of having them highlighted the same way as other keywords? Then you can make
-them stand out, and people can instantly see which functions and classes are user defined or inbuilt. Furthermore,
-you could set the URL for this group to point at the API documentation of your project.</p>
-
-<p>You add a keyword group by using the <code class="highlighted php">add_keyword_group</code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">add_keyword_group</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="sy0">,</span> <span class="re0">$case_sensitive</span><span class="sy0">,</span> <span class="re0">$words</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$key</span></code> is the key that you want to use to refer to this group, <code class="highlighted php"><span class="re0">$styles</span></code> is the styles that
-you want to use to style this group, <code class="highlighted php"><span class="re0">$case_sensitive</span></code> is <strong>true</strong> or <strong>false</strong> depending on whether you want
-this group of keywords to be case sensitive or not and <code class="highlighted php"><span class="re0">$words</span></code> is an array of words (or a string) of which
-words to add to this group. For example:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">add_keyword_group</span><span class="br0">&#40;</span><span class="nu0">10</span><span class="sy0">,</span> <span class="st_h">'color: #600000;'</span><span class="sy0">,</span> <span class="kw4">false</span><span class="sy0">,</span> <span class="kw3">array</span><span class="br0">&#40;</span><span class="st_h">'myfunc_1'</span><span class="sy0">,</span> <span class="st_h">'myfunc_2'</span><span class="sy0">,</span> <span class="st_h">'myfunc_3'</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Adds a keyword group referenced by index 10, of which all keywords in the group will be dark red, each keyword
-can be in any case and which contains the keywords &#8220;myfunc_1&#8221;, &#8220;myfunc_2&#8221; and &#8220;myfunc_3&#8221;.</p>
-
-<p>After creating such a keyword group, you may call other <abbr title="Generic Syntax Highlighter">GeSHi</abbr> methods on it, just as you would for any other keyword group.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>If you specify a <code class="highlighted php"><span class="re0">$key</span></code> for which there is already a keyword group, the old keyword group will be
- overwritten! Most language files don&#8217;t use numbers larger than 5, so I recommend you play it safe and use a number
- like 10 or 42.</p>
-
-</div>
-
-<h4 id="removing-a-keyword-group">3.11.4 Removing a Keyword Group</h4><div class="nav"><a href="#adding-a-keyword-group">Previous</a> | <a href="#adding-removing-keywords">Top</a> | <a href="#headers-and-footers">Next</a></div>
-
-<p>Perhaps you <em>really</em> need speed? Why not just remove an entire keyword group? <abbr title="Generic Syntax Highlighter">GeSHi</abbr> won&#8217;t have to loop through
-each keyword checking for its existance, saving much time. You remove a keyword group by using the
-<code class="highlighted php">remove_keyword_group</code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">remove_keyword_group</span><span class="br0">&#40;</span><span class="re0">$key</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$key</span></code> is the key of the group you wish to remove. This implies knowleged of the language file.</p>
-
-<h3 id="headers-and-footers">3.12 Headers and Footers for Your Code</h3><div class="nav"><a href="#removing-a-keyword-group">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#keyword-substitution">Next</a></div>
-
-<p>So you want to add some special information to the highlighted source? <abbr title="Generic Syntax Highlighter">GeSHi</abbr> can do that too! You can specify headers
-and footers for your code, style them, and insert information from the highlighted source into your header or footer.</p>
-
-<h4 id="keyword-substitution">3.12.1 Keyword Substitution</h4><div class="nav"><a href="#headers-and-footers">Previous</a> | <a href="#headers-and-footers">Top</a> | <a href="#setting-header-content">Next</a></div>
-
-<p>In your header and footer, you can put special keywords that will be replaced with actual configuration values for
-this <abbr title="Generic Syntax Highlighter">GeSHi</abbr> object. The keywords you can use are:</p>
-
-<ul>
-<li><strong><code>&lt;TIME&gt;</code></strong> or <strong><code>{TIME}</code></strong>: Is replaced by the time it took for the <code class="highlighted php">parse_code<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method - i.e.,
-how long it took for your code to be highlighted. The time is returned to three decimal places.</li>
-<li><strong><code>&lt;LANGUAGE&gt;</code></strong> or <strong><code>{LANGUAGE}</code></strong>: Is replaced by a nice, friendly version of the language name used to
-highlight this code.</li>
-<li><strong><code>&lt;SPEED&gt;</code></strong> or <strong><code>{SPEED}</code></strong>: Is replaced by the speed at which your source has been processed.</li>
-<li><strong><code>&lt;VERSION&gt;</code></strong> or <strong><code>{VERSION}</code></strong>: The <abbr title="Generic Syntax Highlighter">GeSHi</abbr> version used to highlight the code.</li>
-</ul>
-
-<h4 id="setting-header-content">3.12.2 Setting Header Content</h4><div class="nav"><a href="#keyword-substitution">Previous</a> | <a href="#headers-and-footers">Top</a> | <a href="#setting-footer-content">Next</a></div>
-
-<p>The header for your code is a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>, which is inside the containing block. Therefore, it is affected by
-the method <code class="highlighted php">set_overall_style</code>, and should contain the sort of <abbr title="Hypertext Markup Language">HTML</abbr> that belongs in a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>.
-You may use any <abbr title="Hypertext Markup Language">HTML</abbr> you like, and format it as an <abbr title="Hypertext Markup Language">HTML</abbr> document. You should use valid <abbr title="Hypertext Markup Language">HTML</abbr> - convert to entities
-any quotemarks or angle brackets you want displayed. You set the header content using the method
-<code class="highlighted php">set_header_content<span class="br0">&#40;</span><span class="br0">&#41;</span></code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_content</span><span class="br0">&#40;</span><span class="re0">$content</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$content</span></code> is the <abbr title="Hypertext Markup Language">HTML</abbr> you want to use for the header.</p>
-
-<h4 id="setting-footer-content">3.12.3 Setting Footer Content</h4><div class="nav"><a href="#setting-header-content">Previous</a> | <a href="#headers-and-footers">Top</a> | <a href="#styling-header-content">Next</a></div>
-
-<p>The footer for your code is a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>, which is inside the containing block. Therefore, it is affected by
-the method <code class="highlighted php">set_overall_style</code>, and should contain the sort of <abbr title="Hypertext Markup Language">HTML</abbr> that belongs in a <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">div</span>&gt;</span></code>.
-You may use any <abbr title="Hypertext Markup Language">HTML</abbr> you like, and format it as an <abbr title="Hypertext Markup Language">HTML</abbr> document. You should use valid <abbr title="Hypertext Markup Language">HTML</abbr> - convert to entities
-any quotemarks or angle brackets you want displayed. You set the footer content using the method
-<code class="highlighted php">set_footer_content<span class="br0">&#40;</span><span class="br0">&#41;</span></code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_footer_content</span><span class="br0">&#40;</span><span class="re0">$content</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$content</span></code> is the <abbr title="Hypertext Markup Language">HTML</abbr> you want to use for the footer.</p>
-
-<h4 id="styling-header-content">3.12.4 Styling Header Content</h4><div class="nav"><a href="#setting-footer-content">Previous</a> | <a href="#headers-and-footers">Top</a> | <a href="#styling-footer-content">Next</a></div>
-
-<p>You can apply styles to the header content you have set with the <code class="highlighted php">set_header_content_style</code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_header_content_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$styles</span></code> is the stylesheet declarations you want to use to style the header content.</p>
-
-<h4 id="styling-footer-content">3.12.5 Styling Footer Content</h4><div class="nav"><a href="#styling-header-content">Previous</a> | <a href="#headers-and-footers">Top</a> | <a href="#keyword-urls">Next</a></div>
-
-<p>You can apply styles to the footer content you have set with the <code class="highlighted php">set_footer_content_style</code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_footer_content_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$styles</span></code> is the stylesheet declarations you want to use to style the footer content.</p>
-
-<h3 id="keyword-urls">3.13 Keyword URLs</h3><div class="nav"><a href="#styling-footer-content">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#setting-a-url">Next</a></div>
-
-<p>As of version 1.0.2, <abbr title="Generic Syntax Highlighter">GeSHi</abbr> allows you to specify a URL for keyword groups. This URL is used by <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to convert
-the keywords in that group into URLs to appropriate documentation. And using <code class="highlighted php">add_keyword_group</code> you
-can add functions and classes from your own projects and use the URL functionality to provide a link to your
-own API documentation.</p>
-
-<h4 id="setting-a-url">3.13.1 Setting a URL for a Keyword Group</h4><div class="nav"><a href="#keyword-urls">Previous</a> | <a href="#keyword-urls">Top</a> | <a href="#disabling-urls">Next</a></div>
-
-<p>To set the URL to be used for a keyword group, you use the <code class="highlighted php">set_url_for_keyword_group<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_url_for_keyword_group</span><span class="br0">&#40;</span><span class="re0">$group</span><span class="sy0">,</span> <span class="re0">$url</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$group</span></code> is the keyword group you want to assign the URL for, and <code class="highlighted php"><span class="re0">$url</span></code> is the URL for
-this group of keywords.</p>
-
-<p>You may be wondering how to make each keyword in the group point to the correct URL. You do this by putting
-<code>{FNAME}</code> in the URL at the correct place. For example, <abbr title="PHP: HTML Preprocessor">PHP</abbr> makes it easy by linking <code>www.php.net/function-name</code>
-to the documentation for that function, so the URL used is <code>http://www.php.net/{FNAME}</code>.</p>
-
-<p>Of course, when you get to a language like Java, that puts its class documentation in related folders, it gets a
-little trickier to work out an appropriate URL (see the Java language file!). I hope to provide some kind of
-redirection service at the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> website in the future.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>As of Version 1.0.7.21 there have been added two more symbols you can use to link to functions. <code>{FNAMEL}</code>
- will generate the lowercase version of the keyword, <code>{FNAMEU}</code> will generate the uppercase version. <code>{FNAME}</code>
- will provide the keyword as specified in the language file. <strong>Use one of these more specific placeholders
- if possible</strong>, as they result in less overhead while linking for case insensitive languages.</p>
-
-</div>
-
-<h4 id="disabling-urls">3.13.2 Disabling a URL for a Keyword Group</h4><div class="nav"><a href="#setting-a-url">Previous</a> | <a href="#keyword-urls">Top</a> | <a href="#disabling-all-urls">Next</a></div>
-
-<p>It&#8217;s easy to disable a URL for a keyword group: Simply use the method <code class="highlighted php">set_url_for_keyword_group<span class="br0">&#40;</span><span class="br0">&#41;</span></code> to pass
-an empty string as the URL:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_url_for_keyword_group</span><span class="br0">&#40;</span><span class="re0">$group</span><span class="sy0">,</span> <span class="st_h">''</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<h4 id="disabling-all-urls">3.13.3 Disabling all URLs for Keywords</h4><div class="nav"><a href="#disabling-urls">Previous</a> | <a href="#keyword-urls">Top</a> | <a href="#styling-links">Next</a></div>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.7.18, you can disable all URL linking for keywords:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_keyword_links</span><span class="br0">&#40;</span><span class="kw4">false</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<h4 id="styling-links">3.13.4 Styling Links</h4><div class="nav"><a href="#disabling-all-urls">Previous</a> | <a href="#keyword-urls">Top</a> | <a href="#using-targets">Next</a></div>
-
-<p>You can also style the function links. You can style their default status, hovered, active and visited status.
-All of this is controlled by one method, <code class="highlighted php">set_link_styles<span class="br0">&#40;</span><span class="br0">&#41;</span></code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_link_styles</span><span class="br0">&#40;</span><span class="re0">$mode</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$mode</span></code> is one of four values:</p>
-
-<ul>
-<li><strong><code class="highlighted php">GESHI_LINK</code>:</strong> The default style of the links.</li>
-<li><strong><code class="highlighted php">GESHI_HOVER</code>:</strong> The style of the links when they have focus (the mouse is hovering over them).</li>
-<li><strong><code class="highlighted php">GESHI_ACTIVE</code>:</strong> The style of the links when they are being clicked.</li>
-<li><strong><code class="highlighted php">GESHI_VISITED</code>:</strong> The style of links that the user has already visited.</li>
-</ul>
-
-<p>And <code class="highlighted php"><span class="re0">$styles</span></code> is the stylesheet declarations to apply to the links.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>The names <code class="highlighted php">GESHI_LINK</code>, <code class="highlighted php">GESHI_HOVER</code> &#8230; are constants. Don&#8217;t put them in quotes!</p>
-
-</div>
-
-<h4 id="using-targets">3.13.5 Setting the Link Target</h4><div class="nav"><a href="#styling-links">Previous</a> | <a href="#keyword-urls">Top</a> | <a href="#using-contextual-importance">Next</a></div>
-
-<p>Perhaps you want to set the target of link attributes, so the manual pages open in a new window? Use the
-<code class="highlighted php">set_link_target<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_link_target</span><span class="br0">&#40;</span><span class="re0">$target</span><span class="sy0">,</span> <span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$target</span></code> is any valid (X)<abbr title="Hypertext Markup Language">HTML</abbr> target value - <code>_blank</code> or <code>_top</code> for example.</p>
-
-<h3 id="using-contextual-importance">3.14 Using Contextual Importance</h3><div class="nav"><a href="#using-targets">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#highlighting-special-lines-extra">Next</a></div>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>This functionality is not only buggy, but is proving very hard to implement in 1.1.X. Therefore, this
- functionality may well be <strong>removed</strong> in 1.2.0. You are hereby warned!</p>
-
-</div>
-
-<p>This feature allows you to mark a part of your source as important. But as the
-implementation its use is deprecated and you should consider using
-the &#8220;Highlight Lines Extra&#8221; feature described below.</p>
-
-<h3 id="highlighting-special-lines-extra">3.15 Highlighting Special Lines &#8220;Extra&#8221;</h3><div class="nav"><a href="#using-contextual-importance">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#specifying-lines-to-highlight-extra">Next</a></div>
-
-<p>An alternative (and more stable) method of highlighting code that is important
-is to use extra highlighting by line. Although you may not know what line numbers
-contain the important lines, if you do this method is a much more flexible way of
-making important lines stand out.</p>
-
-<h4 id="specifying-lines-to-highlight-extra">3.15.1 Specifying the Lines to Highlight Extra</h4><div class="nav"><a href="#highlighting-special-lines-extra">Previous</a> | <a href="#highlighting-special-lines-extra">Top</a> | <a href="#styles-for-highlighted-lines">Next</a></div>
-
-<p>To specify which lines to highlight extra, you pass an array containing the line numbers to <code class="highlighted php">highlight_lines_extra<span class="br0">&#40;</span><span class="br0">&#41;</span></code>:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">highlight_lines_extra</span><span class="br0">&#40;</span><span class="re0">$array</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>The array could be in the form <code class="highlighted php"><span class="kw3">array</span><span class="br0">&#40;</span><span class="nu0">2</span><span class="sy0">,</span> <span class="nu0">3</span><span class="sy0">,</span> <span class="nu0">4</span><span class="sy0">,</span> <span class="nu0">7</span><span class="sy0">,</span> <span class="nu0">12</span><span class="sy0">,</span> <span class="nu0">344</span><span class="sy0">,</span> <span class="nu0">4242</span><span class="br0">&#41;</span></code>, made from a DB query, generated
-from looking through the source for certain important things and working out what line those things are&#8230;
-However you get the line numbers, the array should simply be an array of integers.</p>
-
-<p>Here&#8217;s an example, using the same source as before:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-</pre></td><td class="de1"><pre class="de1"><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="co1">// Here we go again! This time we'll simply highlight the 8th line</span></span></span><span class="co1">//</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$source</span> <span class="sy0">=</span> <span class="st_h">'public int[][] product ( n, m )</span></span></span><span class="st_h">{</span>
-<span class="xtra li2"><span class="de2"><span class="st_h"> &nbsp;int [][] ans = new int[n][m];</span></span></span><span class="st_h"> &nbsp;for ( int i = 0; i &lt; n; i++ )</span>
-<span class="xtra li2"><span class="de2"><span class="st_h"> &nbsp;{</span></span></span><span class="st_h"> &nbsp; &nbsp;for ( int j = 0; i &lt; m; j++ )</span>
-<span class="xtra li2"><span class="de2"><span class="st_h"> &nbsp; &nbsp;{</span></span></span><span class="st_h"> &nbsp; &nbsp; &nbsp;ans[i][j] = i * j;</span>
-<span class="xtra li2"><span class="de2"><span class="st_h"> &nbsp; &nbsp;}</span></span></span><span class="st_h"> &nbsp;}</span>
-<span class="xtra li2"><span class="de2"><span class="st_h"> &nbsp;return ans;</span></span></span><span class="st_h">}'</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="st_h">'java'</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">highlight_lines_extra</span><span class="br0">&#40;</span><a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">8</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="kw1">echo</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></td></tr></tbody></table>
-
-<p>Which produces:</p>
-
-<table class="java geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">Java code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2"><span class="xtra ln-xtra">8</span></span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span></pre></td><td class="de1"><pre class="de1"><span class="kw1">public</span> <span class="kw4">int</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span> product <span class="br0">&#40;</span> n, m <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2"><span class="br0">&#123;</span></span></span>&nbsp; <span class="kw4">int</span> <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span> ans <span class="sy0">=</span> <span class="kw1">new</span> <span class="kw4">int</span><span class="br0">&#91;</span>n<span class="br0">&#93;</span><span class="br0">&#91;</span>m<span class="br0">&#93;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span> <span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> n<span class="sy0">;</span> i<span class="sy0">++</span> <span class="br0">&#41;</span></span></span>&nbsp; <span class="br0">&#123;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="kw1">for</span> <span class="br0">&#40;</span> <span class="kw4">int</span> j <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> m<span class="sy0">;</span> j<span class="sy0">++</span> <span class="br0">&#41;</span></span></span>&nbsp; &nbsp; <span class="br0">&#123;</span>
-<span class="xtra li2"><span class="de2"><span class="xtra ln-xtra">&nbsp; &nbsp; &nbsp; ans<span class="br0">&#91;</span>i<span class="br0">&#93;</span><span class="br0">&#91;</span>j<span class="br0">&#93;</span> <span class="sy0">=</span> i <span class="sy0">*</span> j<span class="sy0">;</span></span></span></span>&nbsp; &nbsp; <span class="br0">&#125;</span>
-<span class="xtra li2"><span class="de2">&nbsp; <span class="br0">&#125;</span></span></span>&nbsp; <span class="kw1">return</span> ans<span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="br0">&#125;</span></span></span></pre></td></tr></tbody></table>
-
-<p>What&#8217;s more, as you can see the code on a highlighted line is still actually highlighted itself.</p>
-
-<h4 id="styles-for-highlighted-lines">3.15.2 Styles for the Highlighted Lines</h4><div class="nav"><a href="#specifying-lines-to-highlight-extra">Previous</a> | <a href="#highlighting-special-lines-extra">Top</a> | <a href="#adding-ids-to-each-line">Next</a></div>
-
-<p>Again as with contextual importance, you&#8217;re not chained to the yellow theme that is the default. You can
-use the <code class="highlighted php">set_highlight_lines_extra_style</code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">set_highlight_lines_extra_style</span><span class="br0">&#40;</span><span class="re0">$styles</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$styles</span></code> is the stylesheet declarations that you want to apply to highlighted lines.</p>
-
-<h3 id="adding-ids-to-each-line">3.16 Adding IDs to Each Line</h3><div class="nav"><a href="#styles-for-highlighted-lines">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#getting-the-time-of-styling">Next</a></div>
-
-<p>Perhaps you&#8217;re a javascript junkie? <abbr title="Generic Syntax Highlighter">GeSHi</abbr> provides a way to give each line an ID so you can access that line with
-javascript, or perhaps just by plain <abbr title="Cascading Style Sheets">CSS</abbr> (though if you want to access lines by <abbr title="Cascading Style Sheets">CSS</abbr> you should use the method
-in the previous section). To enable IDs you call the <code class="highlighted php">enable_ids<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<p><code class="highlighted php"><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">enable_ids</span><span class="br0">&#40;</span><span class="re0">$flag</span><span class="br0">&#41;</span><span class="sy0">;</span></code></p>
-
-<p>Where <code class="highlighted php"><span class="re0">$flag</span></code> is <code class="highlighted php"><span class="kw4">true</span></code> or not present to enable IDs, and <code class="highlighted php"><span class="kw4">false</span></code> to disable them again if you need.</p>
-
-<p>The ID generated is in the form <code>{overall-css-id}-{line-number}</code>. So for example, if you set the overall <abbr title="Cascading Style Sheets">CSS</abbr> id to
-be &#8220;mycode&#8221;, then the IDs for each line would by &#8220;mycode-1&#8221;, &#8220;mycode-2&#8221; etc. If there is no <abbr title="Cascading Style Sheets">CSS</abbr> ID set, then one is
-made up in the form <code>geshi-[4 random characters]</code>, but this is not so useful for if you want to do javascript manipulation.</p>
-
-<h3 id="getting-the-time-of-styling">3.17 Getting the Time of Styling</h3><div class="nav"><a href="#adding-ids-to-each-line">Previous</a> | <a href="#advanced-features">Top</a> | <a href="#language-files">Next</a></div>
-
-<p>Once you&#8217;ve called <code class="highlighted php">parse_code<span class="br0">&#40;</span><span class="br0">&#41;</span></code>, you can get the time it took to run the highlighting by calling the
-<code class="highlighted php">get_time<span class="br0">&#40;</span><span class="br0">&#41;</span></code> method:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-</pre></td><td class="de1"><pre class="de1"><span class="re0">$geshi</span> <span class="sy0">=</span> <span class="kw2">new</span> GeSHi<span class="br0">&#40;</span><span class="re0">$source</span><span class="sy0">,</span> <span class="re0">$language</span><span class="sy0">,</span> <span class="re0">$path</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$code</span> <span class="sy0">=</span> <a href="http://www.php.net/mysql_real_escape_string"><span class="kw3">mysql_real_escape_string</span></a><span class="br0">&#40;</span><span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">parse_code</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2"><span class="re0">$time</span> <span class="sy0">=</span> <span class="re0">$geshi</span><span class="sy0">-&gt;</span><span class="me1">get_time</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="co1">// do something with it</span></span></span><a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;INSERT INTO code VALUES ('<span class="es4">$code</span>', '<span class="es4">$time</span>')&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></td></tr></tbody></table>
-
-<h2 id="language-files">4 Language Files</h2><div class="nav"><a href="#getting-the-time-of-styling">Previous</a> | <a href="#language-file-example">Next</a></div>
-
-<p>So now you know what features <abbr title="Generic Syntax Highlighter">GeSHi</abbr> offers, and perhaps you&#8217;ve even meddled with the source. Or perhaps
-you&#8217;d like a language file for language X but it doesn&#8217;t seem to be supported? Rubbish! <abbr title="Generic Syntax Highlighter">GeSHi</abbr> will highlight
-anything, what do you think I coded this for? ^_^ You&#8217;ll just have to learn how to make a language file
-yourself. And I promise it&#8217;s not too hard - and if you&#8217;re here you&#8217;re in the right place!</p>
-
-<h3 id="language-file-example">4.1 An Example Language File</h3><div class="nav"><a href="#language-files">Previous</a> | <a href="#language-files">Top</a> | <a href="#language-file-conventions">Next</a></div>
-
-<p>Let&#8217;s begin by looking at an example language file - the language file for the first language ever supported,
-<abbr title="PHP: HTML Preprocessor">PHP</abbr>:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-<span class="xtra li2"><span class="de2">28</span></span>29
-<span class="xtra li2"><span class="de2">30</span></span>31
-<span class="xtra li2"><span class="de2">32</span></span>33
-<span class="xtra li2"><span class="de2">34</span></span>35
-<span class="xtra li2"><span class="de2">36</span></span>37
-<span class="xtra li2"><span class="de2">38</span></span>39
-<span class="xtra li2"><span class="de2">40</span></span>41
-<span class="xtra li2"><span class="de2">42</span></span>43
-<span class="xtra li2"><span class="de2">44</span></span>45
-<span class="xtra li2"><span class="de2">46</span></span>47
-<span class="xtra li2"><span class="de2">48</span></span>49
-<span class="xtra li2"><span class="de2">50</span></span>51
-<span class="xtra li2"><span class="de2">52</span></span>53
-<span class="xtra li2"><span class="de2">54</span></span>55
-<span class="xtra li2"><span class="de2">56</span></span>57
-<span class="xtra li2"><span class="de2">58</span></span>59
-<span class="xtra li2"><span class="de2">60</span></span>61
-<span class="xtra li2"><span class="de2">62</span></span>63
-<span class="xtra li2"><span class="de2">64</span></span>65
-<span class="xtra li2"><span class="de2">66</span></span>67
-<span class="xtra li2"><span class="de2">68</span></span>69
-<span class="xtra li2"><span class="de2">70</span></span>71
-<span class="xtra li2"><span class="de2">72</span></span>73
-<span class="xtra li2"><span class="de2">74</span></span>75
-<span class="xtra li2"><span class="de2">76</span></span>77
-<span class="xtra li2"><span class="de2">78</span></span>79
-<span class="xtra li2"><span class="de2">80</span></span>81
-<span class="xtra li2"><span class="de2">82</span></span>83
-<span class="xtra li2"><span class="de2">84</span></span>85
-<span class="xtra li2"><span class="de2">86</span></span>87
-<span class="xtra li2"><span class="de2">88</span></span>89
-<span class="xtra li2"><span class="de2">90</span></span>91
-<span class="xtra li2"><span class="de2">92</span></span>93
-<span class="xtra li2"><span class="de2">94</span></span>95
-<span class="xtra li2"><span class="de2">96</span></span>97
-<span class="xtra li2"><span class="de2">98</span></span>99
-<span class="xtra li2"><span class="de2">100</span></span>101
-<span class="xtra li2"><span class="de2">102</span></span>103
-<span class="xtra li2"><span class="de2">104</span></span>105
-<span class="xtra li2"><span class="de2">106</span></span>107
-<span class="xtra li2"><span class="de2">108</span></span>109
-<span class="xtra li2"><span class="de2">110</span></span>111
-<span class="xtra li2"><span class="de2">112</span></span>113
-<span class="xtra li2"><span class="de2">114</span></span>115
-<span class="xtra li2"><span class="de2">116</span></span>117
-<span class="xtra li2"><span class="de2">118</span></span>119
-<span class="xtra li2"><span class="de2">120</span></span>121
-<span class="xtra li2"><span class="de2">122</span></span>123
-<span class="xtra li2"><span class="de2">124</span></span>125
-<span class="xtra li2"><span class="de2">126</span></span>127
-<span class="xtra li2"><span class="de2">128</span></span>129
-<span class="xtra li2"><span class="de2">130</span></span>131
-<span class="xtra li2"><span class="de2">132</span></span>133
-<span class="xtra li2"><span class="de2">134</span></span>135
-<span class="xtra li2"><span class="de2">136</span></span>137
-<span class="xtra li2"><span class="de2">138</span></span>139
-<span class="xtra li2"><span class="de2">140</span></span>141
-<span class="xtra li2"><span class="de2">142</span></span>143
-<span class="xtra li2"><span class="de2">144</span></span>145
-<span class="xtra li2"><span class="de2">146</span></span>147
-<span class="xtra li2"><span class="de2">148</span></span>149
-<span class="xtra li2"><span class="de2">150</span></span>151
-<span class="xtra li2"><span class="de2">152</span></span>153
-<span class="xtra li2"><span class="de2">154</span></span>155
-<span class="xtra li2"><span class="de2">156</span></span>157
-<span class="xtra li2"><span class="de2">158</span></span>159
-<span class="xtra li2"><span class="de2">160</span></span>161
-<span class="xtra li2"><span class="de2">162</span></span>163
-<span class="xtra li2"><span class="de2">164</span></span>165
-<span class="xtra li2"><span class="de2">166</span></span>167
-<span class="xtra li2"><span class="de2">168</span></span>169
-<span class="xtra li2"><span class="de2">170</span></span>171
-<span class="xtra li2"><span class="de2">172</span></span>173
-<span class="xtra li2"><span class="de2">174</span></span>175
-<span class="xtra li2"><span class="de2">176</span></span>177
-<span class="xtra li2"><span class="de2">178</span></span>179
-<span class="xtra li2"><span class="de2">180</span></span>181
-<span class="xtra li2"><span class="de2">182</span></span>183
-<span class="xtra li2"><span class="de2">184</span></span>185
-<span class="xtra li2"><span class="de2">186</span></span>187
-<span class="xtra li2"><span class="de2">188</span></span>189
-<span class="xtra li2"><span class="de2">190</span></span>191
-<span class="xtra li2"><span class="de2">192</span></span>193
-<span class="xtra li2"><span class="de2">194</span></span>195
-<span class="xtra li2"><span class="de2">196</span></span>197
-<span class="xtra li2"><span class="de2">198</span></span>199
-<span class="xtra li2"><span class="de2">200</span></span>201
-<span class="xtra li2"><span class="de2">202</span></span>203
-<span class="xtra li2"><span class="de2">204</span></span>205
-<span class="xtra li2"><span class="de2">206</span></span>207
-<span class="xtra li2"><span class="de2">208</span></span>209
-<span class="xtra li2"><span class="de2">210</span></span>211
-<span class="xtra li2"><span class="de2">212</span></span>213
-<span class="xtra li2"><span class="de2">214</span></span>215
-<span class="xtra li2"><span class="de2">216</span></span>217
-<span class="xtra li2"><span class="de2">218</span></span>219
-<span class="xtra li2"><span class="de2">220</span></span>221
-<span class="xtra li2"><span class="de2">222</span></span>223
-<span class="xtra li2"><span class="de2">224</span></span>225
-<span class="xtra li2"><span class="de2">226</span></span>227
-<span class="xtra li2"><span class="de2">228</span></span>229
-<span class="xtra li2"><span class="de2">230</span></span>231
-<span class="xtra li2"><span class="de2">232</span></span>233
-<span class="xtra li2"><span class="de2">234</span></span>235
-<span class="xtra li2"><span class="de2">236</span></span>237
-<span class="xtra li2"><span class="de2">238</span></span>239
-<span class="xtra li2"><span class="de2">240</span></span>241
-<span class="xtra li2"><span class="de2">242</span></span>243
-<span class="xtra li2"><span class="de2">244</span></span>245
-<span class="xtra li2"><span class="de2">246</span></span>247
-<span class="xtra li2"><span class="de2">248</span></span>249
-<span class="xtra li2"><span class="de2">250</span></span>251
-<span class="xtra li2"><span class="de2">252</span></span>253
-<span class="xtra li2"><span class="de2">254</span></span>255
-<span class="xtra li2"><span class="de2">256</span></span>257
-<span class="xtra li2"><span class="de2">258</span></span>259
-<span class="xtra li2"><span class="de2">260</span></span>261
-<span class="xtra li2"><span class="de2">262</span></span>263
-<span class="xtra li2"><span class="de2">264</span></span>265
-<span class="xtra li2"><span class="de2">266</span></span>267
-<span class="xtra li2"><span class="de2">268</span></span>269
-<span class="xtra li2"><span class="de2">270</span></span>271
-<span class="xtra li2"><span class="de2">272</span></span>273
-<span class="xtra li2"><span class="de2">274</span></span>275
-<span class="xtra li2"><span class="de2">276</span></span>277
-<span class="xtra li2"><span class="de2">278</span></span>279
-<span class="xtra li2"><span class="de2">280</span></span>281
-<span class="xtra li2"><span class="de2">282</span></span>283
-<span class="xtra li2"><span class="de2">284</span></span>285
-<span class="xtra li2"><span class="de2">286</span></span>287
-<span class="xtra li2"><span class="de2">288</span></span>289
-<span class="xtra li2"><span class="de2">290</span></span>291
-<span class="xtra li2"><span class="de2">292</span></span>293
-<span class="xtra li2"><span class="de2">294</span></span>295
-<span class="xtra li2"><span class="de2">296</span></span>297
-<span class="xtra li2"><span class="de2">298</span></span>299
-<span class="xtra li2"><span class="de2">300</span></span>301
-<span class="xtra li2"><span class="de2">302</span></span>303
-<span class="xtra li2"><span class="de2">304</span></span>305
-<span class="xtra li2"><span class="de2">306</span></span>307
-<span class="xtra li2"><span class="de2">308</span></span>309
-<span class="xtra li2"><span class="de2">310</span></span>311
-<span class="xtra li2"><span class="de2">312</span></span>313
-<span class="xtra li2"><span class="de2">314</span></span>315
-<span class="xtra li2"><span class="de2">316</span></span>317
-<span class="xtra li2"><span class="de2">318</span></span>319
-<span class="xtra li2"><span class="de2">320</span></span>321
-<span class="xtra li2"><span class="de2">322</span></span>323
-<span class="xtra li2"><span class="de2">324</span></span>325
-<span class="xtra li2"><span class="de2">326</span></span>327
-<span class="xtra li2"><span class="de2">328</span></span>329
-<span class="xtra li2"><span class="de2">330</span></span>331
-<span class="xtra li2"><span class="de2">332</span></span>333
-<span class="xtra li2"><span class="de2">334</span></span>335
-<span class="xtra li2"><span class="de2">336</span></span>337
-<span class="xtra li2"><span class="de2">338</span></span>339
-<span class="xtra li2"><span class="de2">340</span></span>341
-<span class="xtra li2"><span class="de2">342</span></span>343
-<span class="xtra li2"><span class="de2">344</span></span>345
-<span class="xtra li2"><span class="de2">346</span></span>347
-<span class="xtra li2"><span class="de2">348</span></span>349
-<span class="xtra li2"><span class="de2">350</span></span>351
-<span class="xtra li2"><span class="de2">352</span></span>353
-<span class="xtra li2"><span class="de2">354</span></span>355
-<span class="xtra li2"><span class="de2">356</span></span>357
-<span class="xtra li2"><span class="de2">358</span></span>359
-<span class="xtra li2"><span class="de2">360</span></span>361
-<span class="xtra li2"><span class="de2">362</span></span>363
-<span class="xtra li2"><span class="de2">364</span></span>365
-<span class="xtra li2"><span class="de2">366</span></span>367
-<span class="xtra li2"><span class="de2">368</span></span>369
-<span class="xtra li2"><span class="de2">370</span></span>371
-<span class="xtra li2"><span class="de2">372</span></span>373
-<span class="xtra li2"><span class="de2">374</span></span>375
-<span class="xtra li2"><span class="de2">376</span></span>377
-<span class="xtra li2"><span class="de2">378</span></span>379
-<span class="xtra li2"><span class="de2">380</span></span>381
-<span class="xtra li2"><span class="de2">382</span></span>383
-<span class="xtra li2"><span class="de2">384</span></span>385
-<span class="xtra li2"><span class="de2">386</span></span>387
-<span class="xtra li2"><span class="de2">388</span></span>389
-<span class="xtra li2"><span class="de2">390</span></span>391
-<span class="xtra li2"><span class="de2">392</span></span>393
-<span class="xtra li2"><span class="de2">394</span></span>395
-<span class="xtra li2"><span class="de2">396</span></span>397
-<span class="xtra li2"><span class="de2">398</span></span>399
-<span class="xtra li2"><span class="de2">400</span></span>401
-<span class="xtra li2"><span class="de2">402</span></span>403
-<span class="xtra li2"><span class="de2">404</span></span>405
-<span class="xtra li2"><span class="de2">406</span></span>407
-<span class="xtra li2"><span class="de2">408</span></span>409
-<span class="xtra li2"><span class="de2">410</span></span>411
-<span class="xtra li2"><span class="de2">412</span></span>413
-<span class="xtra li2"><span class="de2">414</span></span>415
-<span class="xtra li2"><span class="de2">416</span></span>417
-<span class="xtra li2"><span class="de2">418</span></span>419
-<span class="xtra li2"><span class="de2">420</span></span>421
-<span class="xtra li2"><span class="de2">422</span></span>423
-<span class="xtra li2"><span class="de2">424</span></span>425
-<span class="xtra li2"><span class="de2">426</span></span>427
-<span class="xtra li2"><span class="de2">428</span></span>429
-<span class="xtra li2"><span class="de2">430</span></span>431
-<span class="xtra li2"><span class="de2">432</span></span>433
-<span class="xtra li2"><span class="de2">434</span></span>435
-<span class="xtra li2"><span class="de2">436</span></span>437
-<span class="xtra li2"><span class="de2">438</span></span>439
-<span class="xtra li2"><span class="de2">440</span></span>441
-<span class="xtra li2"><span class="de2">442</span></span>443
-<span class="xtra li2"><span class="de2">444</span></span>445
-<span class="xtra li2"><span class="de2">446</span></span>447
-<span class="xtra li2"><span class="de2">448</span></span>449
-<span class="xtra li2"><span class="de2">450</span></span>451
-<span class="xtra li2"><span class="de2">452</span></span>453
-<span class="xtra li2"><span class="de2">454</span></span>455
-<span class="xtra li2"><span class="de2">456</span></span>457
-<span class="xtra li2"><span class="de2">458</span></span>459
-<span class="xtra li2"><span class="de2">460</span></span>461
-<span class="xtra li2"><span class="de2">462</span></span>463
-<span class="xtra li2"><span class="de2">464</span></span>465
-<span class="xtra li2"><span class="de2">466</span></span>467
-<span class="xtra li2"><span class="de2">468</span></span>469
-<span class="xtra li2"><span class="de2">470</span></span>471
-<span class="xtra li2"><span class="de2">472</span></span>473
-<span class="xtra li2"><span class="de2">474</span></span>475
-<span class="xtra li2"><span class="de2">476</span></span>477
-<span class="xtra li2"><span class="de2">478</span></span>479
-<span class="xtra li2"><span class="de2">480</span></span>481
-<span class="xtra li2"><span class="de2">482</span></span>483
-<span class="xtra li2"><span class="de2">484</span></span>485
-<span class="xtra li2"><span class="de2">486</span></span>487
-<span class="xtra li2"><span class="de2">488</span></span>489
-<span class="xtra li2"><span class="de2">490</span></span>491
-<span class="xtra li2"><span class="de2">492</span></span>493
-<span class="xtra li2"><span class="de2">494</span></span>495
-<span class="xtra li2"><span class="de2">496</span></span>497
-<span class="xtra li2"><span class="de2">498</span></span>499
-<span class="xtra li2"><span class="de2">500</span></span>501
-<span class="xtra li2"><span class="de2">502</span></span>503
-<span class="xtra li2"><span class="de2">504</span></span>505
-<span class="xtra li2"><span class="de2">506</span></span>507
-<span class="xtra li2"><span class="de2">508</span></span>509
-<span class="xtra li2"><span class="de2">510</span></span>511
-<span class="xtra li2"><span class="de2">512</span></span>513
-<span class="xtra li2"><span class="de2">514</span></span>515
-<span class="xtra li2"><span class="de2">516</span></span>517
-<span class="xtra li2"><span class="de2">518</span></span>519
-<span class="xtra li2"><span class="de2">520</span></span>521
-<span class="xtra li2"><span class="de2">522</span></span>523
-<span class="xtra li2"><span class="de2">524</span></span>525
-<span class="xtra li2"><span class="de2">526</span></span>527
-<span class="xtra li2"><span class="de2">528</span></span>529
-<span class="xtra li2"><span class="de2">530</span></span>531
-<span class="xtra li2"><span class="de2">532</span></span>533
-<span class="xtra li2"><span class="de2">534</span></span>535
-<span class="xtra li2"><span class="de2">536</span></span>537
-<span class="xtra li2"><span class="de2">538</span></span>539
-<span class="xtra li2"><span class="de2">540</span></span>541
-<span class="xtra li2"><span class="de2">542</span></span>543
-<span class="xtra li2"><span class="de2">544</span></span>545
-<span class="xtra li2"><span class="de2">546</span></span>547
-<span class="xtra li2"><span class="de2">548</span></span>549
-<span class="xtra li2"><span class="de2">550</span></span>551
-<span class="xtra li2"><span class="de2">552</span></span>553
-<span class="xtra li2"><span class="de2">554</span></span>555
-<span class="xtra li2"><span class="de2">556</span></span>557
-<span class="xtra li2"><span class="de2">558</span></span>559
-<span class="xtra li2"><span class="de2">560</span></span>561
-<span class="xtra li2"><span class="de2">562</span></span>563
-<span class="xtra li2"><span class="de2">564</span></span>565
-<span class="xtra li2"><span class="de2">566</span></span>567
-<span class="xtra li2"><span class="de2">568</span></span>569
-<span class="xtra li2"><span class="de2">570</span></span>571
-<span class="xtra li2"><span class="de2">572</span></span>573
-<span class="xtra li2"><span class="de2">574</span></span>575
-<span class="xtra li2"><span class="de2">576</span></span>577
-<span class="xtra li2"><span class="de2">578</span></span>579
-<span class="xtra li2"><span class="de2">580</span></span>581
-<span class="xtra li2"><span class="de2">582</span></span>583
-<span class="xtra li2"><span class="de2">584</span></span>585
-<span class="xtra li2"><span class="de2">586</span></span>587
-<span class="xtra li2"><span class="de2">588</span></span>589
-<span class="xtra li2"><span class="de2">590</span></span>591
-<span class="xtra li2"><span class="de2">592</span></span>593
-<span class="xtra li2"><span class="de2">594</span></span>595
-<span class="xtra li2"><span class="de2">596</span></span>597
-<span class="xtra li2"><span class="de2">598</span></span>599
-<span class="xtra li2"><span class="de2">600</span></span>601
-<span class="xtra li2"><span class="de2">602</span></span>603
-<span class="xtra li2"><span class="de2">604</span></span>605
-<span class="xtra li2"><span class="de2">606</span></span>607
-<span class="xtra li2"><span class="de2">608</span></span>609
-<span class="xtra li2"><span class="de2">610</span></span>611
-<span class="xtra li2"><span class="de2">612</span></span>613
-<span class="xtra li2"><span class="de2">614</span></span>615
-<span class="xtra li2"><span class="de2">616</span></span>617
-<span class="xtra li2"><span class="de2">618</span></span>619
-<span class="xtra li2"><span class="de2">620</span></span>621
-<span class="xtra li2"><span class="de2">622</span></span>623
-<span class="xtra li2"><span class="de2">624</span></span>625
-<span class="xtra li2"><span class="de2">626</span></span>627
-<span class="xtra li2"><span class="de2">628</span></span>629
-<span class="xtra li2"><span class="de2">630</span></span>631
-<span class="xtra li2"><span class="de2">632</span></span>633
-<span class="xtra li2"><span class="de2">634</span></span>635
-<span class="xtra li2"><span class="de2">636</span></span>637
-<span class="xtra li2"><span class="de2">638</span></span>639
-<span class="xtra li2"><span class="de2">640</span></span>641
-<span class="xtra li2"><span class="de2">642</span></span>643
-<span class="xtra li2"><span class="de2">644</span></span>645
-<span class="xtra li2"><span class="de2">646</span></span>647
-<span class="xtra li2"><span class="de2">648</span></span>649
-<span class="xtra li2"><span class="de2">650</span></span>651
-<span class="xtra li2"><span class="de2">652</span></span>653
-<span class="xtra li2"><span class="de2">654</span></span>655
-<span class="xtra li2"><span class="de2">656</span></span>657
-<span class="xtra li2"><span class="de2">658</span></span>659
-<span class="xtra li2"><span class="de2">660</span></span>661
-<span class="xtra li2"><span class="de2">662</span></span>663
-<span class="xtra li2"><span class="de2">664</span></span>665
-<span class="xtra li2"><span class="de2">666</span></span>667
-<span class="xtra li2"><span class="de2">668</span></span>669
-<span class="xtra li2"><span class="de2">670</span></span>671
-<span class="xtra li2"><span class="de2">672</span></span>673
-<span class="xtra li2"><span class="de2">674</span></span>675
-<span class="xtra li2"><span class="de2">676</span></span>677
-<span class="xtra li2"><span class="de2">678</span></span>679
-<span class="xtra li2"><span class="de2">680</span></span>681
-<span class="xtra li2"><span class="de2">682</span></span>683
-<span class="xtra li2"><span class="de2">684</span></span>685
-<span class="xtra li2"><span class="de2">686</span></span>687
-<span class="xtra li2"><span class="de2">688</span></span>689
-<span class="xtra li2"><span class="de2">690</span></span>691
-<span class="xtra li2"><span class="de2">692</span></span>693
-<span class="xtra li2"><span class="de2">694</span></span>695
-<span class="xtra li2"><span class="de2">696</span></span>697
-<span class="xtra li2"><span class="de2">698</span></span>699
-<span class="xtra li2"><span class="de2">700</span></span>701
-<span class="xtra li2"><span class="de2">702</span></span>703
-<span class="xtra li2"><span class="de2">704</span></span>705
-<span class="xtra li2"><span class="de2">706</span></span>707
-<span class="xtra li2"><span class="de2">708</span></span>709
-<span class="xtra li2"><span class="de2">710</span></span>711
-<span class="xtra li2"><span class="de2">712</span></span>713
-<span class="xtra li2"><span class="de2">714</span></span>715
-<span class="xtra li2"><span class="de2">716</span></span>717
-<span class="xtra li2"><span class="de2">718</span></span>719
-<span class="xtra li2"><span class="de2">720</span></span>721
-<span class="xtra li2"><span class="de2">722</span></span>723
-<span class="xtra li2"><span class="de2">724</span></span>725
-<span class="xtra li2"><span class="de2">726</span></span>727
-<span class="xtra li2"><span class="de2">728</span></span>729
-<span class="xtra li2"><span class="de2">730</span></span>731
-<span class="xtra li2"><span class="de2">732</span></span>733
-<span class="xtra li2"><span class="de2">734</span></span>735
-<span class="xtra li2"><span class="de2">736</span></span>737
-<span class="xtra li2"><span class="de2">738</span></span>739
-<span class="xtra li2"><span class="de2">740</span></span>741
-<span class="xtra li2"><span class="de2">742</span></span>743
-<span class="xtra li2"><span class="de2">744</span></span>745
-<span class="xtra li2"><span class="de2">746</span></span>747
-<span class="xtra li2"><span class="de2">748</span></span>749
-<span class="xtra li2"><span class="de2">750</span></span>751
-<span class="xtra li2"><span class="de2">752</span></span>753
-<span class="xtra li2"><span class="de2">754</span></span>755
-<span class="xtra li2"><span class="de2">756</span></span>757
-<span class="xtra li2"><span class="de2">758</span></span>759
-<span class="xtra li2"><span class="de2">760</span></span>761
-<span class="xtra li2"><span class="de2">762</span></span>763
-<span class="xtra li2"><span class="de2">764</span></span>765
-<span class="xtra li2"><span class="de2">766</span></span>767
-<span class="xtra li2"><span class="de2">768</span></span>769
-<span class="xtra li2"><span class="de2">770</span></span>771
-<span class="xtra li2"><span class="de2">772</span></span>773
-<span class="xtra li2"><span class="de2">774</span></span>775
-<span class="xtra li2"><span class="de2">776</span></span>777
-<span class="xtra li2"><span class="de2">778</span></span>779
-<span class="xtra li2"><span class="de2">780</span></span>781
-<span class="xtra li2"><span class="de2">782</span></span>783
-<span class="xtra li2"><span class="de2">784</span></span>785
-<span class="xtra li2"><span class="de2">786</span></span>787
-<span class="xtra li2"><span class="de2">788</span></span>789
-<span class="xtra li2"><span class="de2">790</span></span>791
-<span class="xtra li2"><span class="de2">792</span></span>793
-<span class="xtra li2"><span class="de2">794</span></span>795
-<span class="xtra li2"><span class="de2">796</span></span>797
-<span class="xtra li2"><span class="de2">798</span></span>799
-<span class="xtra li2"><span class="de2">800</span></span>801
-<span class="xtra li2"><span class="de2">802</span></span>803
-<span class="xtra li2"><span class="de2">804</span></span>805
-<span class="xtra li2"><span class="de2">806</span></span>807
-<span class="xtra li2"><span class="de2">808</span></span>809
-<span class="xtra li2"><span class="de2">810</span></span>811
-<span class="xtra li2"><span class="de2">812</span></span>813
-<span class="xtra li2"><span class="de2">814</span></span>815
-<span class="xtra li2"><span class="de2">816</span></span>817
-<span class="xtra li2"><span class="de2">818</span></span>819
-<span class="xtra li2"><span class="de2">820</span></span>821
-<span class="xtra li2"><span class="de2">822</span></span>823
-<span class="xtra li2"><span class="de2">824</span></span>825
-<span class="xtra li2"><span class="de2">826</span></span>827
-<span class="xtra li2"><span class="de2">828</span></span>829
-<span class="xtra li2"><span class="de2">830</span></span>831
-<span class="xtra li2"><span class="de2">832</span></span>833
-<span class="xtra li2"><span class="de2">834</span></span>835
-<span class="xtra li2"><span class="de2">836</span></span>837
-<span class="xtra li2"><span class="de2">838</span></span>839
-<span class="xtra li2"><span class="de2">840</span></span>841
-<span class="xtra li2"><span class="de2">842</span></span>843
-<span class="xtra li2"><span class="de2">844</span></span>845
-<span class="xtra li2"><span class="de2">846</span></span>847
-<span class="xtra li2"><span class="de2">848</span></span>849
-<span class="xtra li2"><span class="de2">850</span></span>851
-<span class="xtra li2"><span class="de2">852</span></span>853
-<span class="xtra li2"><span class="de2">854</span></span>855
-<span class="xtra li2"><span class="de2">856</span></span>857
-<span class="xtra li2"><span class="de2">858</span></span>859
-<span class="xtra li2"><span class="de2">860</span></span>861
-<span class="xtra li2"><span class="de2">862</span></span>863
-<span class="xtra li2"><span class="de2">864</span></span>865
-<span class="xtra li2"><span class="de2">866</span></span>867
-<span class="xtra li2"><span class="de2">868</span></span>869
-<span class="xtra li2"><span class="de2">870</span></span>871
-<span class="xtra li2"><span class="de2">872</span></span>873
-<span class="xtra li2"><span class="de2">874</span></span>875
-<span class="xtra li2"><span class="de2">876</span></span>877
-<span class="xtra li2"><span class="de2">878</span></span>879
-<span class="xtra li2"><span class="de2">880</span></span>881
-<span class="xtra li2"><span class="de2">882</span></span>883
-<span class="xtra li2"><span class="de2">884</span></span>885
-<span class="xtra li2"><span class="de2">886</span></span>887
-<span class="xtra li2"><span class="de2">888</span></span>889
-<span class="xtra li2"><span class="de2">890</span></span>891
-<span class="xtra li2"><span class="de2">892</span></span>893
-<span class="xtra li2"><span class="de2">894</span></span>895
-<span class="xtra li2"><span class="de2">896</span></span>897
-<span class="xtra li2"><span class="de2">898</span></span>899
-<span class="xtra li2"><span class="de2">900</span></span>901
-<span class="xtra li2"><span class="de2">902</span></span>903
-<span class="xtra li2"><span class="de2">904</span></span>905
-<span class="xtra li2"><span class="de2">906</span></span>907
-<span class="xtra li2"><span class="de2">908</span></span>909
-<span class="xtra li2"><span class="de2">910</span></span>911
-<span class="xtra li2"><span class="de2">912</span></span>913
-<span class="xtra li2"><span class="de2">914</span></span>915
-<span class="xtra li2"><span class="de2">916</span></span>917
-<span class="xtra li2"><span class="de2">918</span></span>919
-<span class="xtra li2"><span class="de2">920</span></span>921
-<span class="xtra li2"><span class="de2">922</span></span>923
-<span class="xtra li2"><span class="de2">924</span></span>925
-<span class="xtra li2"><span class="de2">926</span></span>927
-<span class="xtra li2"><span class="de2">928</span></span>929
-<span class="xtra li2"><span class="de2">930</span></span>931
-<span class="xtra li2"><span class="de2">932</span></span>933
-<span class="xtra li2"><span class="de2">934</span></span>935
-<span class="xtra li2"><span class="de2">936</span></span>937
-<span class="xtra li2"><span class="de2">938</span></span>939
-<span class="xtra li2"><span class="de2">940</span></span>941
-<span class="xtra li2"><span class="de2">942</span></span>943
-<span class="xtra li2"><span class="de2">944</span></span>945
-<span class="xtra li2"><span class="de2">946</span></span>947
-<span class="xtra li2"><span class="de2">948</span></span>949
-<span class="xtra li2"><span class="de2">950</span></span>951
-<span class="xtra li2"><span class="de2">952</span></span>953
-<span class="xtra li2"><span class="de2">954</span></span>955
-<span class="xtra li2"><span class="de2">956</span></span>957
-<span class="xtra li2"><span class="de2">958</span></span>959
-<span class="xtra li2"><span class="de2">960</span></span>961
-<span class="xtra li2"><span class="de2">962</span></span>963
-<span class="xtra li2"><span class="de2">964</span></span>965
-<span class="xtra li2"><span class="de2">966</span></span>967
-<span class="xtra li2"><span class="de2">968</span></span>969
-<span class="xtra li2"><span class="de2">970</span></span>971
-<span class="xtra li2"><span class="de2">972</span></span>973
-<span class="xtra li2"><span class="de2">974</span></span>975
-<span class="xtra li2"><span class="de2">976</span></span>977
-<span class="xtra li2"><span class="de2">978</span></span>979
-<span class="xtra li2"><span class="de2">980</span></span>981
-<span class="xtra li2"><span class="de2">982</span></span>983
-<span class="xtra li2"><span class="de2">984</span></span>985
-<span class="xtra li2"><span class="de2">986</span></span>987
-<span class="xtra li2"><span class="de2">988</span></span>989
-<span class="xtra li2"><span class="de2">990</span></span>991
-<span class="xtra li2"><span class="de2">992</span></span>993
-<span class="xtra li2"><span class="de2">994</span></span>995
-<span class="xtra li2"><span class="de2">996</span></span>997
-<span class="xtra li2"><span class="de2">998</span></span>999
-<span class="xtra li2"><span class="de2">1000</span></span>1001
-<span class="xtra li2"><span class="de2">1002</span></span>1003
-<span class="xtra li2"><span class="de2">1004</span></span>1005
-<span class="xtra li2"><span class="de2">1006</span></span>1007
-<span class="xtra li2"><span class="de2">1008</span></span>1009
-<span class="xtra li2"><span class="de2">1010</span></span>1011
-<span class="xtra li2"><span class="de2">1012</span></span>1013
-<span class="xtra li2"><span class="de2">1014</span></span>1015
-<span class="xtra li2"><span class="de2">1016</span></span>1017
-<span class="xtra li2"><span class="de2">1018</span></span>1019
-<span class="xtra li2"><span class="de2">1020</span></span>1021
-<span class="xtra li2"><span class="de2">1022</span></span>1023
-<span class="xtra li2"><span class="de2">1024</span></span>1025
-<span class="xtra li2"><span class="de2">1026</span></span>1027
-<span class="xtra li2"><span class="de2">1028</span></span>1029
-<span class="xtra li2"><span class="de2">1030</span></span>1031
-<span class="xtra li2"><span class="de2">1032</span></span>1033
-<span class="xtra li2"><span class="de2">1034</span></span>1035
-<span class="xtra li2"><span class="de2">1036</span></span>1037
-<span class="xtra li2"><span class="de2">1038</span></span>1039
-<span class="xtra li2"><span class="de2">1040</span></span>1041
-<span class="xtra li2"><span class="de2">1042</span></span>1043
-<span class="xtra li2"><span class="de2">1044</span></span>1045
-<span class="xtra li2"><span class="de2">1046</span></span>1047
-<span class="xtra li2"><span class="de2">1048</span></span>1049
-<span class="xtra li2"><span class="de2">1050</span></span>1051
-<span class="xtra li2"><span class="de2">1052</span></span>1053
-<span class="xtra li2"><span class="de2">1054</span></span>1055
-<span class="xtra li2"><span class="de2">1056</span></span>1057
-<span class="xtra li2"><span class="de2">1058</span></span>1059
-<span class="xtra li2"><span class="de2">1060</span></span>1061
-<span class="xtra li2"><span class="de2">1062</span></span>1063
-<span class="xtra li2"><span class="de2">1064</span></span>1065
-<span class="xtra li2"><span class="de2">1066</span></span>1067
-<span class="xtra li2"><span class="de2">1068</span></span>1069
-<span class="xtra li2"><span class="de2">1070</span></span>1071
-<span class="xtra li2"><span class="de2">1072</span></span>1073
-<span class="xtra li2"><span class="de2">1074</span></span>1075
-<span class="xtra li2"><span class="de2">1076</span></span>1077
-<span class="xtra li2"><span class="de2">1078</span></span>1079
-<span class="xtra li2"><span class="de2">1080</span></span>1081
-<span class="xtra li2"><span class="de2">1082</span></span>1083
-<span class="xtra li2"><span class="de2">1084</span></span>1085
-<span class="xtra li2"><span class="de2">1086</span></span>1087
-<span class="xtra li2"><span class="de2">1088</span></span>1089
-<span class="xtra li2"><span class="de2">1090</span></span>1091
-<span class="xtra li2"><span class="de2">1092</span></span>1093
-<span class="xtra li2"><span class="de2">1094</span></span></pre></td><td class="de1"><pre class="de1"><span class="kw2">&lt;?php</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">/*************************************************************************************</span></span></span><span class="coMULTI">&nbsp;* php.php</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* --------</span></span></span><span class="coMULTI">&nbsp;* Author: Nigel McNie (nigel@geshi.org)</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)</span></span></span><span class="coMULTI">&nbsp;* Release Version: 1.0.8.3</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* Date Started: 2004/06/20</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* PHP language file for GeSHi.</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* CHANGES</span></span></span><span class="coMULTI">&nbsp;* -------</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* 2008/05/23 (1.0.7.22)</span></span></span><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;Added description of extra language features (SF#1970248)</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* 2004/11/25 (1.0.3)</span></span></span><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;Added support for multiple object splitters</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;Fixed &amp;new problem</span></span></span><span class="coMULTI">&nbsp;* 2004/10/27 (1.0.2)</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;Added URL support</span></span></span><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;Added extra constants</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* 2004/08/05 (1.0.1)</span></span></span><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;Added support for symbols</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* 2004/07/14 (1.0.0)</span></span></span><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;First Release</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* TODO (updated 2004/07/14)</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* -------------------------</span></span></span><span class="coMULTI">&nbsp;* * Make sure the last few function I may have missed</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; (like eval()) are included for highlighting</span></span></span><span class="coMULTI">&nbsp;* * Split to several files - php4, php5 etc</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;*************************************************************************************</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* &nbsp; &nbsp; This file is part of GeSHi.</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* &nbsp; GeSHi is free software; you can redistribute it and/or modify</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; it under the terms of the GNU General Public License as published by</span></span></span><span class="coMULTI">&nbsp;* &nbsp; the Free Software Foundation; either version 2 of the License, or</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; (at your option) any later version.</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; GeSHi is distributed in the hope that it will be useful,</span></span></span><span class="coMULTI">&nbsp;* &nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the</span></span></span><span class="coMULTI">&nbsp;* &nbsp; GNU General Public License for more details.</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* &nbsp; You should have received a copy of the GNU General Public License</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; along with GeSHi; if not, write to the Free Software</span></span></span><span class="coMULTI">&nbsp;* &nbsp; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA &nbsp;02111-1307 &nbsp;USA</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;************************************************************************************/</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$language_data</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'LANG_NAME'</span> <span class="sy0">=&gt;</span> <span class="st_h">'PHP'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'COMMENT_SINGLE'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'//'</span><span class="sy0">,</span> <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'#'</span><span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'COMMENT_MULTI'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'/*'</span> <span class="sy0">=&gt;</span> <span class="st_h">'*/'</span><span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'HARDQUOTE'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;'&quot;</span><span class="sy0">,</span> <span class="st0">&quot;'&quot;</span><span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'HARDESCAPE'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;'&quot;</span><span class="sy0">,</span> <span class="st0">&quot;<span class="es1">\\</span>&quot;</span><span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'HARDCHAR'</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;<span class="es1">\\</span>&quot;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'COMMENT_REGEXP'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Heredoc and Nowdoc syntax</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'/&lt;&lt;&lt;\s*?(\'?)([a-zA-Z0-9]+?)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// phpdoc comments</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">'#/\*\*(?![\*\/]).*\*/#sU'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// Advanced # handling</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;/#.*?(?:(?=\?\&gt;)|^)/smi&quot;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'CASE_KEYWORDS'</span> <span class="sy0">=&gt;</span> GESHI_CAPS_NO_CHANGE<span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'QUOTEMARKS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'&quot;'</span><span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'ESCAPE_CHAR'</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'ESCAPE_REGEXP'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Simple Single Char Escapes</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;#<span class="es1">\\</span><span class="es1">\\</span>[nfrtv<span class="es1">\$</span><span class="es1">\&quot;</span><span class="es1">\n</span><span class="es1">\\</span><span class="es1">\\</span>]#i&quot;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Hexadecimal Char Specs</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;#<span class="es1">\\</span><span class="es1">\\</span>x[\da-fA-F]{1,2}#i&quot;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Octal Char Specs</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;#<span class="es1">\\</span><span class="es1">\\</span>[0-7]{1,3}#&quot;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//String Parsing of Variable Names</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;#<span class="es1">\\</span>$[a-z0-9_]+(?:<span class="es1">\\</span>[[a-z0-9_]+<span class="es1">\\</span>]|-&gt;[a-z0-9_]+)?|(?:<span class="es1">\\</span>{<span class="es1">\\</span>$|<span class="es1">\\</span>$<span class="es1">\\</span>{)[a-z0-9_]+(?:<span class="es1">\\</span>[('?)[a-z0-9_]*<span class="es1">\\</span>1<span class="es1">\\</span>]|-&gt;[a-z0-9_]+)*<span class="es1">\\</span>}#i&quot;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Experimental extension supporting cascaded {${$var}} syntax</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;#<span class="es1">\$</span>[a-z0-9_]+(?:\[[a-z0-9_]+\]|-&gt;[a-z0-9_]+)?|(?:\{<span class="es1">\$</span>|<span class="es1">\$</span>\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*<span class="es1">\\</span>1\]|-&gt;[a-z0-9_]+)*\}|\{<span class="es1">\$</span>(?R)\}#i&quot;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Format String support in &quot;&quot;-Strings</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">6</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;#%(?:%|(?:\d+<span class="es1">\\</span><span class="es1">\\</span><span class="es1">\\</span><span class="es1">\$</span>)?<span class="es1">\\</span>+?(?:<span class="es2">\x20</span>|0|'.)?-?(?:\d+|<span class="es1">\\</span>*)?(?:\.\d+)?[bcdefFosuxX])#&quot;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'NUMBERS'</span> <span class="sy0">=&gt;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_INT_BASIC <span class="sy0">|</span> &nbsp;GESHI_NUMBER_OCT_PREFIX <span class="sy0">|</span> GESHI_NUMBER_HEX_PREFIX <span class="sy0">|</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_FLT_SCI_ZERO<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'KEYWORDS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'as'</span><span class="sy0">,</span><span class="st_h">'break'</span><span class="sy0">,</span><span class="st_h">'case'</span><span class="sy0">,</span><span class="st_h">'continue'</span><span class="sy0">,</span><span class="st_h">'default'</span><span class="sy0">,</span><span class="st_h">'do'</span><span class="sy0">,</span><span class="st_h">'else'</span><span class="sy0">,</span><span class="st_h">'elseif'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'endfor'</span><span class="sy0">,</span><span class="st_h">'endforeach'</span><span class="sy0">,</span><span class="st_h">'endif'</span><span class="sy0">,</span><span class="st_h">'endswitch'</span><span class="sy0">,</span><span class="st_h">'endwhile'</span><span class="sy0">,</span><span class="st_h">'for'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'foreach'</span><span class="sy0">,</span><span class="st_h">'if'</span><span class="sy0">,</span><span class="st_h">'include'</span><span class="sy0">,</span><span class="st_h">'include_once'</span><span class="sy0">,</span><span class="st_h">'require'</span><span class="sy0">,</span><span class="st_h">'require_once'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'return'</span><span class="sy0">,</span><span class="st_h">'switch'</span><span class="sy0">,</span><span class="st_h">'while'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'echo'</span><span class="sy0">,</span><span class="st_h">'print'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&amp;amp;new'</span><span class="sy0">,</span><span class="st_h">'&amp;lt;/script&amp;gt;'</span><span class="sy0">,</span><span class="st_h">'&amp;lt;?php'</span><span class="sy0">,</span><span class="st_h">'&amp;lt;script language'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'class'</span><span class="sy0">,</span><span class="st_h">'const'</span><span class="sy0">,</span><span class="st_h">'declare'</span><span class="sy0">,</span><span class="st_h">'extends'</span><span class="sy0">,</span><span class="st_h">'function'</span><span class="sy0">,</span><span class="st_h">'global'</span><span class="sy0">,</span><span class="st_h">'interface'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'namespace'</span><span class="sy0">,</span><span class="st_h">'new'</span><span class="sy0">,</span><span class="st_h">'private'</span><span class="sy0">,</span><span class="st_h">'public'</span><span class="sy0">,</span><span class="st_h">'self'</span><span class="sy0">,</span><span class="st_h">'var'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'abs'</span><span class="sy0">,</span><span class="st_h">'acos'</span><span class="sy0">,</span><span class="st_h">'acosh'</span><span class="sy0">,</span><span class="st_h">'addcslashes'</span><span class="sy0">,</span><span class="st_h">'addslashes'</span><span class="sy0">,</span><span class="st_h">'aggregate'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'aggregate_methods'</span><span class="sy0">,</span><span class="st_h">'aggregate_methods_by_list'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'aggregate_methods_by_regexp'</span><span class="sy0">,</span><span class="st_h">'aggregate_properties'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'aggregate_properties_by_list'</span><span class="sy0">,</span><span class="st_h">'aggregate_properties_by_regexp'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'aggregation_info'</span><span class="sy0">,</span><span class="st_h">'apache_child_terminate'</span><span class="sy0">,</span><span class="st_h">'apache_get_modules'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'apache_get_version'</span><span class="sy0">,</span><span class="st_h">'apache_getenv'</span><span class="sy0">,</span><span class="st_h">'apache_lookup_uri'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'apache_note'</span><span class="sy0">,</span><span class="st_h">'apache_request_headers'</span><span class="sy0">,</span><span class="st_h">'apache_response_headers'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'apache_setenv'</span><span class="sy0">,</span><span class="st_h">'array'</span><span class="sy0">,</span><span class="st_h">'array_change_key_case'</span><span class="sy0">,</span><span class="st_h">'array_chunk'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_combine'</span><span class="sy0">,</span><span class="st_h">'array_count_values'</span><span class="sy0">,</span><span class="st_h">'array_diff'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_diff_assoc'</span><span class="sy0">,</span><span class="st_h">'array_diff_key'</span><span class="sy0">,</span><span class="st_h">'array_diff_uassoc'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_diff_ukey'</span><span class="sy0">,</span><span class="st_h">'array_fill'</span><span class="sy0">,</span><span class="st_h">'array_fill_keys'</span><span class="sy0">,</span><span class="st_h">'array_filter'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_flip'</span><span class="sy0">,</span><span class="st_h">'array_intersect'</span><span class="sy0">,</span><span class="st_h">'array_intersect_assoc'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_intersect_key'</span><span class="sy0">,</span><span class="st_h">'array_intersect_uassoc'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_intersect_ukey'</span><span class="sy0">,</span><span class="st_h">'array_key_exists'</span><span class="sy0">,</span><span class="st_h">'array_keys'</span><span class="sy0">,</span><span class="st_h">'array_map'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_merge'</span><span class="sy0">,</span><span class="st_h">'array_merge_recursive'</span><span class="sy0">,</span><span class="st_h">'array_multisort'</span><span class="sy0">,</span><span class="st_h">'array_pad'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_pop'</span><span class="sy0">,</span><span class="st_h">'array_product'</span><span class="sy0">,</span><span class="st_h">'array_push'</span><span class="sy0">,</span><span class="st_h">'array_rand'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_reduce'</span><span class="sy0">,</span><span class="st_h">'array_reverse'</span><span class="sy0">,</span><span class="st_h">'array_search'</span><span class="sy0">,</span><span class="st_h">'array_shift'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_slice'</span><span class="sy0">,</span><span class="st_h">'array_splice'</span><span class="sy0">,</span><span class="st_h">'array_sum'</span><span class="sy0">,</span><span class="st_h">'array_udiff'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_udiff_assoc'</span><span class="sy0">,</span><span class="st_h">'array_udiff_uassoc'</span><span class="sy0">,</span><span class="st_h">'array_uintersect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_uintersect_assoc'</span><span class="sy0">,</span><span class="st_h">'array_uintersect_uassoc'</span><span class="sy0">,</span><span class="st_h">'array_unique'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'array_unshift'</span><span class="sy0">,</span><span class="st_h">'array_values'</span><span class="sy0">,</span><span class="st_h">'array_walk'</span><span class="sy0">,</span><span class="st_h">'array_walk_recursive'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'arsort'</span><span class="sy0">,</span><span class="st_h">'asin'</span><span class="sy0">,</span><span class="st_h">'asinh'</span><span class="sy0">,</span><span class="st_h">'asort'</span><span class="sy0">,</span><span class="st_h">'assert'</span><span class="sy0">,</span><span class="st_h">'assert_options'</span><span class="sy0">,</span><span class="st_h">'atan'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'atan2'</span><span class="sy0">,</span><span class="st_h">'atanh'</span><span class="sy0">,</span><span class="st_h">'base_convert'</span><span class="sy0">,</span><span class="st_h">'base64_decode'</span><span class="sy0">,</span><span class="st_h">'base64_encode'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'basename'</span><span class="sy0">,</span><span class="st_h">'bcadd'</span><span class="sy0">,</span><span class="st_h">'bccomp'</span><span class="sy0">,</span><span class="st_h">'bcdiv'</span><span class="sy0">,</span><span class="st_h">'bcmod'</span><span class="sy0">,</span><span class="st_h">'bcmul'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcompiler_load'</span><span class="sy0">,</span><span class="st_h">'bcompiler_load_exe'</span><span class="sy0">,</span><span class="st_h">'bcompiler_parse_class'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcompiler_read'</span><span class="sy0">,</span><span class="st_h">'bcompiler_write_class'</span><span class="sy0">,</span><span class="st_h">'bcompiler_write_constant'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcompiler_write_exe_footer'</span><span class="sy0">,</span><span class="st_h">'bcompiler_write_file'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcompiler_write_footer'</span><span class="sy0">,</span><span class="st_h">'bcompiler_write_function'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcompiler_write_functions_from_file'</span><span class="sy0">,</span><span class="st_h">'bcompiler_write_header'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcompiler_write_included_filename'</span><span class="sy0">,</span><span class="st_h">'bcpow'</span><span class="sy0">,</span><span class="st_h">'bcpowmod'</span><span class="sy0">,</span><span class="st_h">'bcscale'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bcsqrt'</span><span class="sy0">,</span><span class="st_h">'bcsub'</span><span class="sy0">,</span><span class="st_h">'bin2hex'</span><span class="sy0">,</span><span class="st_h">'bindec'</span><span class="sy0">,</span><span class="st_h">'bindtextdomain'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bind_textdomain_codeset'</span><span class="sy0">,</span><span class="st_h">'bitset_empty'</span><span class="sy0">,</span><span class="st_h">'bitset_equal'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bitset_excl'</span><span class="sy0">,</span><span class="st_h">'bitset_fill'</span><span class="sy0">,</span><span class="st_h">'bitset_from_array'</span><span class="sy0">,</span><span class="st_h">'bitset_from_hash'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bitset_from_string'</span><span class="sy0">,</span><span class="st_h">'bitset_in'</span><span class="sy0">,</span><span class="st_h">'bitset_incl'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bitset_intersection'</span><span class="sy0">,</span><span class="st_h">'bitset_invert'</span><span class="sy0">,</span><span class="st_h">'bitset_is_empty'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bitset_subset'</span><span class="sy0">,</span><span class="st_h">'bitset_to_array'</span><span class="sy0">,</span><span class="st_h">'bitset_to_hash'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bitset_to_string'</span><span class="sy0">,</span><span class="st_h">'bitset_union'</span><span class="sy0">,</span><span class="st_h">'blenc_encrypt'</span><span class="sy0">,</span><span class="st_h">'bzclose'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bzcompress'</span><span class="sy0">,</span><span class="st_h">'bzdecompress'</span><span class="sy0">,</span><span class="st_h">'bzerrno'</span><span class="sy0">,</span><span class="st_h">'bzerror'</span><span class="sy0">,</span><span class="st_h">'bzerrstr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'bzflush'</span><span class="sy0">,</span><span class="st_h">'bzopen'</span><span class="sy0">,</span><span class="st_h">'bzread'</span><span class="sy0">,</span><span class="st_h">'bzwrite'</span><span class="sy0">,</span><span class="st_h">'cal_days_in_month'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cal_from_jd'</span><span class="sy0">,</span><span class="st_h">'cal_info'</span><span class="sy0">,</span><span class="st_h">'cal_to_jd'</span><span class="sy0">,</span><span class="st_h">'call_user_func'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'call_user_func_array'</span><span class="sy0">,</span><span class="st_h">'call_user_method'</span><span class="sy0">,</span><span class="st_h">'call_user_method_array'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ceil'</span><span class="sy0">,</span><span class="st_h">'chdir'</span><span class="sy0">,</span><span class="st_h">'checkdate'</span><span class="sy0">,</span><span class="st_h">'checkdnsrr'</span><span class="sy0">,</span><span class="st_h">'chgrp'</span><span class="sy0">,</span><span class="st_h">'chmod'</span><span class="sy0">,</span><span class="st_h">'chop'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'chown'</span><span class="sy0">,</span><span class="st_h">'chr'</span><span class="sy0">,</span><span class="st_h">'chunk_split'</span><span class="sy0">,</span><span class="st_h">'class_exists'</span><span class="sy0">,</span><span class="st_h">'class_implements'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'class_parents'</span><span class="sy0">,</span><span class="st_h">'classkit_aggregate_methods'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'classkit_doc_comments'</span><span class="sy0">,</span><span class="st_h">'classkit_import'</span><span class="sy0">,</span><span class="st_h">'classkit_method_add'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'classkit_method_copy'</span><span class="sy0">,</span><span class="st_h">'classkit_method_redefine'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'classkit_method_remove'</span><span class="sy0">,</span><span class="st_h">'classkit_method_rename'</span><span class="sy0">,</span><span class="st_h">'clearstatcache'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'closedir'</span><span class="sy0">,</span><span class="st_h">'closelog'</span><span class="sy0">,</span><span class="st_h">'com_create_guid'</span><span class="sy0">,</span><span class="st_h">'com_event_sink'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'com_get_active_object'</span><span class="sy0">,</span><span class="st_h">'com_load_typelib'</span><span class="sy0">,</span><span class="st_h">'com_message_pump'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'com_print_typeinfo'</span><span class="sy0">,</span><span class="st_h">'compact'</span><span class="sy0">,</span><span class="st_h">'confirm_phpdoc_compiled'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'connection_aborted'</span><span class="sy0">,</span><span class="st_h">'connection_status'</span><span class="sy0">,</span><span class="st_h">'constant'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'convert_cyr_string'</span><span class="sy0">,</span><span class="st_h">'convert_uudecode'</span><span class="sy0">,</span><span class="st_h">'convert_uuencode'</span><span class="sy0">,</span><span class="st_h">'copy'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cos'</span><span class="sy0">,</span><span class="st_h">'cosh'</span><span class="sy0">,</span><span class="st_h">'count'</span><span class="sy0">,</span><span class="st_h">'count_chars'</span><span class="sy0">,</span><span class="st_h">'cpdf_add_annotation'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_add_outline'</span><span class="sy0">,</span><span class="st_h">'cpdf_arc'</span><span class="sy0">,</span><span class="st_h">'cpdf_begin_text'</span><span class="sy0">,</span><span class="st_h">'cpdf_circle'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_clip'</span><span class="sy0">,</span><span class="st_h">'cpdf_close'</span><span class="sy0">,</span><span class="st_h">'cpdf_closepath'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_closepath_fill_stroke'</span><span class="sy0">,</span><span class="st_h">'cpdf_closepath_stroke'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_continue_text'</span><span class="sy0">,</span><span class="st_h">'cpdf_curveto'</span><span class="sy0">,</span><span class="st_h">'cpdf_end_text'</span><span class="sy0">,</span><span class="st_h">'cpdf_fill'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_fill_stroke'</span><span class="sy0">,</span><span class="st_h">'cpdf_finalize'</span><span class="sy0">,</span><span class="st_h">'cpdf_finalize_page'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_global_set_document_limits'</span><span class="sy0">,</span><span class="st_h">'cpdf_import_jpeg'</span><span class="sy0">,</span><span class="st_h">'cpdf_lineto'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_moveto'</span><span class="sy0">,</span><span class="st_h">'cpdf_newpath'</span><span class="sy0">,</span><span class="st_h">'cpdf_open'</span><span class="sy0">,</span><span class="st_h">'cpdf_output_buffer'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_page_init'</span><span class="sy0">,</span><span class="st_h">'cpdf_rect'</span><span class="sy0">,</span><span class="st_h">'cpdf_restore'</span><span class="sy0">,</span><span class="st_h">'cpdf_rlineto'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_rmoveto'</span><span class="sy0">,</span><span class="st_h">'cpdf_rotate'</span><span class="sy0">,</span><span class="st_h">'cpdf_rotate_text'</span><span class="sy0">,</span><span class="st_h">'cpdf_save'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_save_to_file'</span><span class="sy0">,</span><span class="st_h">'cpdf_scale'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_action_url'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_char_spacing'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_creator'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_current_page'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_font'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_font_directories'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_font_map_file'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_horiz_scaling'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_keywords'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_leading'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_page_animation'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_subject'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_text_matrix'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_text_pos'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_text_rendering'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_text_rise'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_title'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_set_viewer_preferences'</span><span class="sy0">,</span><span class="st_h">'cpdf_set_word_spacing'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_setdash'</span><span class="sy0">,</span><span class="st_h">'cpdf_setflat'</span><span class="sy0">,</span><span class="st_h">'cpdf_setgray'</span><span class="sy0">,</span><span class="st_h">'cpdf_setgray_fill'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_setgray_stroke'</span><span class="sy0">,</span><span class="st_h">'cpdf_setlinecap'</span><span class="sy0">,</span><span class="st_h">'cpdf_setlinejoin'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_setlinewidth'</span><span class="sy0">,</span><span class="st_h">'cpdf_setmiterlimit'</span><span class="sy0">,</span><span class="st_h">'cpdf_setrgbcolor'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_setrgbcolor_fill'</span><span class="sy0">,</span><span class="st_h">'cpdf_setrgbcolor_stroke'</span><span class="sy0">,</span><span class="st_h">'cpdf_show'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_show_xy'</span><span class="sy0">,</span><span class="st_h">'cpdf_stringwidth'</span><span class="sy0">,</span><span class="st_h">'cpdf_stroke'</span><span class="sy0">,</span><span class="st_h">'cpdf_text'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cpdf_translate'</span><span class="sy0">,</span><span class="st_h">'crack_check'</span><span class="sy0">,</span><span class="st_h">'crack_closedict'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'crack_getlastmessage'</span><span class="sy0">,</span><span class="st_h">'crack_opendict'</span><span class="sy0">,</span><span class="st_h">'crc32'</span><span class="sy0">,</span><span class="st_h">'create_function'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'crypt'</span><span class="sy0">,</span><span class="st_h">'ctype_alnum'</span><span class="sy0">,</span><span class="st_h">'ctype_alpha'</span><span class="sy0">,</span><span class="st_h">'ctype_cntrl'</span><span class="sy0">,</span><span class="st_h">'ctype_digit'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ctype_graph'</span><span class="sy0">,</span><span class="st_h">'ctype_lower'</span><span class="sy0">,</span><span class="st_h">'ctype_print'</span><span class="sy0">,</span><span class="st_h">'ctype_punct'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ctype_space'</span><span class="sy0">,</span><span class="st_h">'ctype_upper'</span><span class="sy0">,</span><span class="st_h">'ctype_xdigit'</span><span class="sy0">,</span><span class="st_h">'curl_close'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'curl_copy_handle'</span><span class="sy0">,</span><span class="st_h">'curl_errno'</span><span class="sy0">,</span><span class="st_h">'curl_error'</span><span class="sy0">,</span><span class="st_h">'curl_exec'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'curl_getinfo'</span><span class="sy0">,</span><span class="st_h">'curl_init'</span><span class="sy0">,</span><span class="st_h">'curl_multi_add_handle'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'curl_multi_close'</span><span class="sy0">,</span><span class="st_h">'curl_multi_exec'</span><span class="sy0">,</span><span class="st_h">'curl_multi_getcontent'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'curl_multi_info_read'</span><span class="sy0">,</span><span class="st_h">'curl_multi_init'</span><span class="sy0">,</span><span class="st_h">'curl_multi_remove_handle'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'curl_multi_select'</span><span class="sy0">,</span><span class="st_h">'curl_setopt'</span><span class="sy0">,</span><span class="st_h">'curl_setopt_array'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'curl_version'</span><span class="sy0">,</span><span class="st_h">'current'</span><span class="sy0">,</span><span class="st_h">'cvsclient_connect'</span><span class="sy0">,</span><span class="st_h">'cvsclient_log'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'cvsclient_login'</span><span class="sy0">,</span><span class="st_h">'cvsclient_retrieve'</span><span class="sy0">,</span><span class="st_h">'date'</span><span class="sy0">,</span><span class="st_h">'date_create'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'date_date_set'</span><span class="sy0">,</span><span class="st_h">'date_default_timezone_get'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'date_default_timezone_set'</span><span class="sy0">,</span><span class="st_h">'date_format'</span><span class="sy0">,</span><span class="st_h">'date_isodate_set'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'date_modify'</span><span class="sy0">,</span><span class="st_h">'date_offset_get'</span><span class="sy0">,</span><span class="st_h">'date_parse'</span><span class="sy0">,</span><span class="st_h">'date_sun_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'date_sunrise'</span><span class="sy0">,</span><span class="st_h">'date_sunset'</span><span class="sy0">,</span><span class="st_h">'date_time_set'</span><span class="sy0">,</span><span class="st_h">'date_timezone_get'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'date_timezone_set'</span><span class="sy0">,</span><span class="st_h">'db_id_list'</span><span class="sy0">,</span><span class="st_h">'dba_close'</span><span class="sy0">,</span><span class="st_h">'dba_delete'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dba_exists'</span><span class="sy0">,</span><span class="st_h">'dba_fetch'</span><span class="sy0">,</span><span class="st_h">'dba_firstkey'</span><span class="sy0">,</span><span class="st_h">'dba_handlers'</span><span class="sy0">,</span><span class="st_h">'dba_insert'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dba_key_split'</span><span class="sy0">,</span><span class="st_h">'dba_list'</span><span class="sy0">,</span><span class="st_h">'dba_nextkey'</span><span class="sy0">,</span><span class="st_h">'dba_open'</span><span class="sy0">,</span><span class="st_h">'dba_optimize'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dba_popen'</span><span class="sy0">,</span><span class="st_h">'dba_replace'</span><span class="sy0">,</span><span class="st_h">'dba_sync'</span><span class="sy0">,</span><span class="st_h">'dbase_add_record'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbase_close'</span><span class="sy0">,</span><span class="st_h">'dbase_create'</span><span class="sy0">,</span><span class="st_h">'dbase_delete_record'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbase_get_header_info'</span><span class="sy0">,</span><span class="st_h">'dbase_get_record'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbase_get_record_with_names'</span><span class="sy0">,</span><span class="st_h">'dbase_numfields'</span><span class="sy0">,</span><span class="st_h">'dbase_numrecords'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbase_open'</span><span class="sy0">,</span><span class="st_h">'dbase_pack'</span><span class="sy0">,</span><span class="st_h">'dbase_replace_record'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbg_get_all_contexts'</span><span class="sy0">,</span><span class="st_h">'dbg_get_all_module_names'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbg_get_all_source_lines'</span><span class="sy0">,</span><span class="st_h">'dbg_get_context_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbg_get_module_name'</span><span class="sy0">,</span><span class="st_h">'dbg_get_profiler_results'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbg_get_source_context'</span><span class="sy0">,</span><span class="st_h">'dblist'</span><span class="sy0">,</span><span class="st_h">'dbmclose'</span><span class="sy0">,</span><span class="st_h">'dbmdelete'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbmexists'</span><span class="sy0">,</span><span class="st_h">'dbmfetch'</span><span class="sy0">,</span><span class="st_h">'dbmfirstkey'</span><span class="sy0">,</span><span class="st_h">'dbminsert'</span><span class="sy0">,</span><span class="st_h">'dbmnextkey'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbmopen'</span><span class="sy0">,</span><span class="st_h">'dbmreplace'</span><span class="sy0">,</span><span class="st_h">'dbx_close'</span><span class="sy0">,</span><span class="st_h">'dbx_compare'</span><span class="sy0">,</span><span class="st_h">'dbx_connect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbx_error'</span><span class="sy0">,</span><span class="st_h">'dbx_escape_string'</span><span class="sy0">,</span><span class="st_h">'dbx_fetch_row'</span><span class="sy0">,</span><span class="st_h">'dbx_query'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dbx_sort'</span><span class="sy0">,</span><span class="st_h">'dcgettext'</span><span class="sy0">,</span><span class="st_h">'dcngettext'</span><span class="sy0">,</span><span class="st_h">'deaggregate'</span><span class="sy0">,</span><span class="st_h">'debug_backtrace'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'debug_zval_dump'</span><span class="sy0">,</span><span class="st_h">'debugbreak'</span><span class="sy0">,</span><span class="st_h">'decbin'</span><span class="sy0">,</span><span class="st_h">'dechex'</span><span class="sy0">,</span><span class="st_h">'decoct'</span><span class="sy0">,</span><span class="st_h">'define'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'defined'</span><span class="sy0">,</span><span class="st_h">'define_syslog_variables'</span><span class="sy0">,</span><span class="st_h">'deg2rad'</span><span class="sy0">,</span><span class="st_h">'dgettext'</span><span class="sy0">,</span><span class="st_h">'die'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dio_close'</span><span class="sy0">,</span><span class="st_h">'dio_open'</span><span class="sy0">,</span><span class="st_h">'dio_read'</span><span class="sy0">,</span><span class="st_h">'dio_seek'</span><span class="sy0">,</span><span class="st_h">'dio_stat'</span><span class="sy0">,</span><span class="st_h">'dio_write'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'dir'</span><span class="sy0">,</span><span class="st_h">'dirname'</span><span class="sy0">,</span><span class="st_h">'disk_free_space'</span><span class="sy0">,</span><span class="st_h">'disk_total_space'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'diskfreespace'</span><span class="sy0">,</span><span class="st_h">'dl'</span><span class="sy0">,</span><span class="st_h">'dngettext'</span><span class="sy0">,</span><span class="st_h">'docblock_token_name'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'docblock_tokenize'</span><span class="sy0">,</span><span class="st_h">'dom_import_simplexml'</span><span class="sy0">,</span><span class="st_h">'domxml_add_root'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_attributes'</span><span class="sy0">,</span><span class="st_h">'domxml_children'</span><span class="sy0">,</span><span class="st_h">'domxml_doc_add_root'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_doc_document_element'</span><span class="sy0">,</span><span class="st_h">'domxml_doc_get_element_by_id'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_doc_get_elements_by_tagname'</span><span class="sy0">,</span><span class="st_h">'domxml_doc_get_root'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_doc_set_root'</span><span class="sy0">,</span><span class="st_h">'domxml_doc_validate'</span><span class="sy0">,</span><span class="st_h">'domxml_doc_xinclude'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_dump_mem'</span><span class="sy0">,</span><span class="st_h">'domxml_dump_mem_file'</span><span class="sy0">,</span><span class="st_h">'domxml_dump_node'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_dumpmem'</span><span class="sy0">,</span><span class="st_h">'domxml_elem_get_attribute'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_elem_set_attribute'</span><span class="sy0">,</span><span class="st_h">'domxml_get_attribute'</span><span class="sy0">,</span><span class="st_h">'domxml_getattr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_html_dump_mem'</span><span class="sy0">,</span><span class="st_h">'domxml_new_child'</span><span class="sy0">,</span><span class="st_h">'domxml_new_doc'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_new_xmldoc'</span><span class="sy0">,</span><span class="st_h">'domxml_node'</span><span class="sy0">,</span><span class="st_h">'domxml_node_add_namespace'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_node_attributes'</span><span class="sy0">,</span><span class="st_h">'domxml_node_children'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_node_get_content'</span><span class="sy0">,</span><span class="st_h">'domxml_node_has_attributes'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_node_new_child'</span><span class="sy0">,</span><span class="st_h">'domxml_node_set_content'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_node_set_namespace'</span><span class="sy0">,</span><span class="st_h">'domxml_node_unlink_node'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_open_file'</span><span class="sy0">,</span><span class="st_h">'domxml_open_mem'</span><span class="sy0">,</span><span class="st_h">'domxml_parser'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_add_chunk'</span><span class="sy0">,</span><span class="st_h">'domxml_parser_cdata_section'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_characters'</span><span class="sy0">,</span><span class="st_h">'domxml_parser_comment'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_end'</span><span class="sy0">,</span><span class="st_h">'domxml_parser_end_document'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_end_element'</span><span class="sy0">,</span><span class="st_h">'domxml_parser_entity_reference'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_get_document'</span><span class="sy0">,</span><span class="st_h">'domxml_parser_namespace_decl'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_processing_instruction'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_parser_start_document'</span><span class="sy0">,</span><span class="st_h">'domxml_parser_start_element'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_root'</span><span class="sy0">,</span><span class="st_h">'domxml_set_attribute'</span><span class="sy0">,</span><span class="st_h">'domxml_setattr'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_substitute_entities_default'</span><span class="sy0">,</span><span class="st_h">'domxml_unlink_node'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'domxml_version'</span><span class="sy0">,</span><span class="st_h">'domxml_xmltree'</span><span class="sy0">,</span><span class="st_h">'doubleval'</span><span class="sy0">,</span><span class="st_h">'each'</span><span class="sy0">,</span><span class="st_h">'easter_date'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'easter_days'</span><span class="sy0">,</span><span class="st_h">'empty'</span><span class="sy0">,</span><span class="st_h">'end'</span><span class="sy0">,</span><span class="st_h">'ereg'</span><span class="sy0">,</span><span class="st_h">'ereg_replace'</span><span class="sy0">,</span><span class="st_h">'eregi'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'eregi_replace'</span><span class="sy0">,</span><span class="st_h">'error_get_last'</span><span class="sy0">,</span><span class="st_h">'error_log'</span><span class="sy0">,</span><span class="st_h">'error_reporting'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'escapeshellarg'</span><span class="sy0">,</span><span class="st_h">'escapeshellcmd'</span><span class="sy0">,</span><span class="st_h">'eval'</span><span class="sy0">,</span><span class="st_h">'event_deschedule'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'event_dispatch'</span><span class="sy0">,</span><span class="st_h">'event_free'</span><span class="sy0">,</span><span class="st_h">'event_handle_signal'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'event_have_events'</span><span class="sy0">,</span><span class="st_h">'event_init'</span><span class="sy0">,</span><span class="st_h">'event_new'</span><span class="sy0">,</span><span class="st_h">'event_pending'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'event_priority_set'</span><span class="sy0">,</span><span class="st_h">'event_schedule'</span><span class="sy0">,</span><span class="st_h">'event_set'</span><span class="sy0">,</span><span class="st_h">'event_timeout'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'exec'</span><span class="sy0">,</span><span class="st_h">'exif_imagetype'</span><span class="sy0">,</span><span class="st_h">'exif_read_data'</span><span class="sy0">,</span><span class="st_h">'exif_tagname'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'exif_thumbnail'</span><span class="sy0">,</span><span class="st_h">'exit'</span><span class="sy0">,</span><span class="st_h">'exp'</span><span class="sy0">,</span><span class="st_h">'explode'</span><span class="sy0">,</span><span class="st_h">'expm1'</span><span class="sy0">,</span><span class="st_h">'extension_loaded'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'extract'</span><span class="sy0">,</span><span class="st_h">'ezmlm_hash'</span><span class="sy0">,</span><span class="st_h">'fbird_add_user'</span><span class="sy0">,</span><span class="st_h">'fbird_affected_rows'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_backup'</span><span class="sy0">,</span><span class="st_h">'fbird_blob_add'</span><span class="sy0">,</span><span class="st_h">'fbird_blob_cancel'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_blob_close'</span><span class="sy0">,</span><span class="st_h">'fbird_blob_create'</span><span class="sy0">,</span><span class="st_h">'fbird_blob_echo'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_blob_get'</span><span class="sy0">,</span><span class="st_h">'fbird_blob_import'</span><span class="sy0">,</span><span class="st_h">'fbird_blob_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_blob_open'</span><span class="sy0">,</span><span class="st_h">'fbird_close'</span><span class="sy0">,</span><span class="st_h">'fbird_commit'</span><span class="sy0">,</span><span class="st_h">'fbird_commit_ret'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_connect'</span><span class="sy0">,</span><span class="st_h">'fbird_db_info'</span><span class="sy0">,</span><span class="st_h">'fbird_delete_user'</span><span class="sy0">,</span><span class="st_h">'fbird_drop_db'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_errcode'</span><span class="sy0">,</span><span class="st_h">'fbird_errmsg'</span><span class="sy0">,</span><span class="st_h">'fbird_execute'</span><span class="sy0">,</span><span class="st_h">'fbird_fetch_assoc'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_fetch_object'</span><span class="sy0">,</span><span class="st_h">'fbird_fetch_row'</span><span class="sy0">,</span><span class="st_h">'fbird_field_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_free_event_handler'</span><span class="sy0">,</span><span class="st_h">'fbird_free_query'</span><span class="sy0">,</span><span class="st_h">'fbird_free_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_gen_id'</span><span class="sy0">,</span><span class="st_h">'fbird_maintain_db'</span><span class="sy0">,</span><span class="st_h">'fbird_modify_user'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_name_result'</span><span class="sy0">,</span><span class="st_h">'fbird_num_fields'</span><span class="sy0">,</span><span class="st_h">'fbird_num_params'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_param_info'</span><span class="sy0">,</span><span class="st_h">'fbird_pconnect'</span><span class="sy0">,</span><span class="st_h">'fbird_prepare'</span><span class="sy0">,</span><span class="st_h">'fbird_query'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_restore'</span><span class="sy0">,</span><span class="st_h">'fbird_rollback'</span><span class="sy0">,</span><span class="st_h">'fbird_rollback_ret'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_server_info'</span><span class="sy0">,</span><span class="st_h">'fbird_service_attach'</span><span class="sy0">,</span><span class="st_h">'fbird_service_detach'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fbird_set_event_handler'</span><span class="sy0">,</span><span class="st_h">'fbird_trans'</span><span class="sy0">,</span><span class="st_h">'fbird_wait_event'</span><span class="sy0">,</span><span class="st_h">'fclose'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_add_doc_javascript'</span><span class="sy0">,</span><span class="st_h">'fdf_add_template'</span><span class="sy0">,</span><span class="st_h">'fdf_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_create'</span><span class="sy0">,</span><span class="st_h">'fdf_enum_values'</span><span class="sy0">,</span><span class="st_h">'fdf_errno'</span><span class="sy0">,</span><span class="st_h">'fdf_error'</span><span class="sy0">,</span><span class="st_h">'fdf_get_ap'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_get_attachment'</span><span class="sy0">,</span><span class="st_h">'fdf_get_encoding'</span><span class="sy0">,</span><span class="st_h">'fdf_get_file'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_get_flags'</span><span class="sy0">,</span><span class="st_h">'fdf_get_opt'</span><span class="sy0">,</span><span class="st_h">'fdf_get_status'</span><span class="sy0">,</span><span class="st_h">'fdf_get_value'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_get_version'</span><span class="sy0">,</span><span class="st_h">'fdf_header'</span><span class="sy0">,</span><span class="st_h">'fdf_next_field_name'</span><span class="sy0">,</span><span class="st_h">'fdf_open'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_open_string'</span><span class="sy0">,</span><span class="st_h">'fdf_remove_item'</span><span class="sy0">,</span><span class="st_h">'fdf_save'</span><span class="sy0">,</span><span class="st_h">'fdf_save_string'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_set_ap'</span><span class="sy0">,</span><span class="st_h">'fdf_set_encoding'</span><span class="sy0">,</span><span class="st_h">'fdf_set_file'</span><span class="sy0">,</span><span class="st_h">'fdf_set_flags'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_set_javascript_action'</span><span class="sy0">,</span><span class="st_h">'fdf_set_on_import_javascript'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_set_opt'</span><span class="sy0">,</span><span class="st_h">'fdf_set_status'</span><span class="sy0">,</span><span class="st_h">'fdf_set_submit_form_action'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fdf_set_target_frame'</span><span class="sy0">,</span><span class="st_h">'fdf_set_value'</span><span class="sy0">,</span><span class="st_h">'fdf_set_version'</span><span class="sy0">,</span><span class="st_h">'feof'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fflush'</span><span class="sy0">,</span><span class="st_h">'fgetc'</span><span class="sy0">,</span><span class="st_h">'fgetcsv'</span><span class="sy0">,</span><span class="st_h">'fgets'</span><span class="sy0">,</span><span class="st_h">'fgetss'</span><span class="sy0">,</span><span class="st_h">'file'</span><span class="sy0">,</span><span class="st_h">'file_exists'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'file_get_contents'</span><span class="sy0">,</span><span class="st_h">'file_put_contents'</span><span class="sy0">,</span><span class="st_h">'fileatime'</span><span class="sy0">,</span><span class="st_h">'filectime'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'filegroup'</span><span class="sy0">,</span><span class="st_h">'fileinode'</span><span class="sy0">,</span><span class="st_h">'filemtime'</span><span class="sy0">,</span><span class="st_h">'fileowner'</span><span class="sy0">,</span><span class="st_h">'fileperms'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'filepro'</span><span class="sy0">,</span><span class="st_h">'filepro_fieldcount'</span><span class="sy0">,</span><span class="st_h">'filepro_fieldname'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'filepro_fieldtype'</span><span class="sy0">,</span><span class="st_h">'filepro_fieldwidth'</span><span class="sy0">,</span><span class="st_h">'filepro_retrieve'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'filepro_rowcount'</span><span class="sy0">,</span><span class="st_h">'filesize'</span><span class="sy0">,</span><span class="st_h">'filetype'</span><span class="sy0">,</span><span class="st_h">'filter_has_var'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'filter_id'</span><span class="sy0">,</span><span class="st_h">'filter_input'</span><span class="sy0">,</span><span class="st_h">'filter_input_array'</span><span class="sy0">,</span><span class="st_h">'filter_list'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'filter_var'</span><span class="sy0">,</span><span class="st_h">'filter_var_array'</span><span class="sy0">,</span><span class="st_h">'finfo_buffer'</span><span class="sy0">,</span><span class="st_h">'finfo_close'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'finfo_file'</span><span class="sy0">,</span><span class="st_h">'finfo_open'</span><span class="sy0">,</span><span class="st_h">'finfo_set_flags'</span><span class="sy0">,</span><span class="st_h">'floatval'</span><span class="sy0">,</span><span class="st_h">'flock'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'floor'</span><span class="sy0">,</span><span class="st_h">'flush'</span><span class="sy0">,</span><span class="st_h">'fmod'</span><span class="sy0">,</span><span class="st_h">'fnmatch'</span><span class="sy0">,</span><span class="st_h">'fopen'</span><span class="sy0">,</span><span class="st_h">'fpassthru'</span><span class="sy0">,</span><span class="st_h">'fprintf'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fputcsv'</span><span class="sy0">,</span><span class="st_h">'fputs'</span><span class="sy0">,</span><span class="st_h">'fread'</span><span class="sy0">,</span><span class="st_h">'frenchtojd'</span><span class="sy0">,</span><span class="st_h">'fribidi_charset_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fribidi_get_charsets'</span><span class="sy0">,</span><span class="st_h">'fribidi_log2vis'</span><span class="sy0">,</span><span class="st_h">'fscanf'</span><span class="sy0">,</span><span class="st_h">'fseek'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'fsockopen'</span><span class="sy0">,</span><span class="st_h">'fstat'</span><span class="sy0">,</span><span class="st_h">'ftell'</span><span class="sy0">,</span><span class="st_h">'ftok'</span><span class="sy0">,</span><span class="st_h">'ftp_alloc'</span><span class="sy0">,</span><span class="st_h">'ftp_cdup'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_chdir'</span><span class="sy0">,</span><span class="st_h">'ftp_chmod'</span><span class="sy0">,</span><span class="st_h">'ftp_close'</span><span class="sy0">,</span><span class="st_h">'ftp_connect'</span><span class="sy0">,</span><span class="st_h">'ftp_delete'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_exec'</span><span class="sy0">,</span><span class="st_h">'ftp_fget'</span><span class="sy0">,</span><span class="st_h">'ftp_fput'</span><span class="sy0">,</span><span class="st_h">'ftp_get'</span><span class="sy0">,</span><span class="st_h">'ftp_get_option'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_login'</span><span class="sy0">,</span><span class="st_h">'ftp_mdtm'</span><span class="sy0">,</span><span class="st_h">'ftp_mkdir'</span><span class="sy0">,</span><span class="st_h">'ftp_nb_continue'</span><span class="sy0">,</span><span class="st_h">'ftp_nb_fget'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_nb_fput'</span><span class="sy0">,</span><span class="st_h">'ftp_nb_get'</span><span class="sy0">,</span><span class="st_h">'ftp_nb_put'</span><span class="sy0">,</span><span class="st_h">'ftp_nlist'</span><span class="sy0">,</span><span class="st_h">'ftp_pasv'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_put'</span><span class="sy0">,</span><span class="st_h">'ftp_pwd'</span><span class="sy0">,</span><span class="st_h">'ftp_quit'</span><span class="sy0">,</span><span class="st_h">'ftp_raw'</span><span class="sy0">,</span><span class="st_h">'ftp_rawlist'</span><span class="sy0">,</span><span class="st_h">'ftp_rename'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_rmdir'</span><span class="sy0">,</span><span class="st_h">'ftp_set_option'</span><span class="sy0">,</span><span class="st_h">'ftp_site'</span><span class="sy0">,</span><span class="st_h">'ftp_size'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ftp_ssl_connect'</span><span class="sy0">,</span><span class="st_h">'ftp_systype'</span><span class="sy0">,</span><span class="st_h">'ftruncate'</span><span class="sy0">,</span><span class="st_h">'function_exists'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'func_get_arg'</span><span class="sy0">,</span><span class="st_h">'func_get_args'</span><span class="sy0">,</span><span class="st_h">'func_num_args'</span><span class="sy0">,</span><span class="st_h">'fwrite'</span><span class="sy0">,</span><span class="st_h">'gd_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'getallheaders'</span><span class="sy0">,</span><span class="st_h">'getcwd'</span><span class="sy0">,</span><span class="st_h">'getdate'</span><span class="sy0">,</span><span class="st_h">'getenv'</span><span class="sy0">,</span><span class="st_h">'gethostbyaddr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gethostbyname'</span><span class="sy0">,</span><span class="st_h">'gethostbynamel'</span><span class="sy0">,</span><span class="st_h">'getimagesize'</span><span class="sy0">,</span><span class="st_h">'getlastmod'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'getmxrr'</span><span class="sy0">,</span><span class="st_h">'getmygid'</span><span class="sy0">,</span><span class="st_h">'getmyinode'</span><span class="sy0">,</span><span class="st_h">'getmypid'</span><span class="sy0">,</span><span class="st_h">'getmyuid'</span><span class="sy0">,</span><span class="st_h">'getopt'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'getprotobyname'</span><span class="sy0">,</span><span class="st_h">'getprotobynumber'</span><span class="sy0">,</span><span class="st_h">'getrandmax'</span><span class="sy0">,</span><span class="st_h">'getrusage'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'getservbyname'</span><span class="sy0">,</span><span class="st_h">'getservbyport'</span><span class="sy0">,</span><span class="st_h">'gettext'</span><span class="sy0">,</span><span class="st_h">'gettimeofday'</span><span class="sy0">,</span><span class="st_h">'gettype'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_browser'</span><span class="sy0">,</span><span class="st_h">'get_cfg_var'</span><span class="sy0">,</span><span class="st_h">'get_class'</span><span class="sy0">,</span><span class="st_h">'get_class_methods'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_class_vars'</span><span class="sy0">,</span><span class="st_h">'get_current_user'</span><span class="sy0">,</span><span class="st_h">'get_declared_classes'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_defined_constants'</span><span class="sy0">,</span><span class="st_h">'get_defined_functions'</span><span class="sy0">,</span><span class="st_h">'get_defined_vars'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_extension_funcs'</span><span class="sy0">,</span><span class="st_h">'get_headers'</span><span class="sy0">,</span><span class="st_h">'get_html_translation_table'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_included_files'</span><span class="sy0">,</span><span class="st_h">'get_include_path'</span><span class="sy0">,</span><span class="st_h">'get_loaded_extensions'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_magic_quotes_gpc'</span><span class="sy0">,</span><span class="st_h">'get_magic_quotes_runtime'</span><span class="sy0">,</span><span class="st_h">'get_meta_tags'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_object_vars'</span><span class="sy0">,</span><span class="st_h">'get_parent_class'</span><span class="sy0">,</span><span class="st_h">'get_required_files'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'get_resource_type'</span><span class="sy0">,</span><span class="st_h">'glob'</span><span class="sy0">,</span><span class="st_h">'gmdate'</span><span class="sy0">,</span><span class="st_h">'gmmktime'</span><span class="sy0">,</span><span class="st_h">'gmp_abs'</span><span class="sy0">,</span><span class="st_h">'gmp_add'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_and'</span><span class="sy0">,</span><span class="st_h">'gmp_clrbit'</span><span class="sy0">,</span><span class="st_h">'gmp_cmp'</span><span class="sy0">,</span><span class="st_h">'gmp_com'</span><span class="sy0">,</span><span class="st_h">'gmp_div'</span><span class="sy0">,</span><span class="st_h">'gmp_div_q'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_div_qr'</span><span class="sy0">,</span><span class="st_h">'gmp_div_r'</span><span class="sy0">,</span><span class="st_h">'gmp_divexact'</span><span class="sy0">,</span><span class="st_h">'gmp_fact'</span><span class="sy0">,</span><span class="st_h">'gmp_gcd'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_gcdext'</span><span class="sy0">,</span><span class="st_h">'gmp_hamdist'</span><span class="sy0">,</span><span class="st_h">'gmp_init'</span><span class="sy0">,</span><span class="st_h">'gmp_intval'</span><span class="sy0">,</span><span class="st_h">'gmp_invert'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_jacobi'</span><span class="sy0">,</span><span class="st_h">'gmp_legendre'</span><span class="sy0">,</span><span class="st_h">'gmp_mod'</span><span class="sy0">,</span><span class="st_h">'gmp_mul'</span><span class="sy0">,</span><span class="st_h">'gmp_neg'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_nextprime'</span><span class="sy0">,</span><span class="st_h">'gmp_or'</span><span class="sy0">,</span><span class="st_h">'gmp_perfect_square'</span><span class="sy0">,</span><span class="st_h">'gmp_popcount'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_pow'</span><span class="sy0">,</span><span class="st_h">'gmp_powm'</span><span class="sy0">,</span><span class="st_h">'gmp_prob_prime'</span><span class="sy0">,</span><span class="st_h">'gmp_random'</span><span class="sy0">,</span><span class="st_h">'gmp_scan0'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_scan1'</span><span class="sy0">,</span><span class="st_h">'gmp_setbit'</span><span class="sy0">,</span><span class="st_h">'gmp_sign'</span><span class="sy0">,</span><span class="st_h">'gmp_sqrt'</span><span class="sy0">,</span><span class="st_h">'gmp_sqrtrem'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gmp_strval'</span><span class="sy0">,</span><span class="st_h">'gmp_sub'</span><span class="sy0">,</span><span class="st_h">'gmp_xor'</span><span class="sy0">,</span><span class="st_h">'gmstrftime'</span><span class="sy0">,</span><span class="st_h">'gopher_parsedir'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gregoriantojd'</span><span class="sy0">,</span><span class="st_h">'gzclose'</span><span class="sy0">,</span><span class="st_h">'gzcompress'</span><span class="sy0">,</span><span class="st_h">'gzdeflate'</span><span class="sy0">,</span><span class="st_h">'gzencode'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gzeof'</span><span class="sy0">,</span><span class="st_h">'gzfile'</span><span class="sy0">,</span><span class="st_h">'gzgetc'</span><span class="sy0">,</span><span class="st_h">'gzgets'</span><span class="sy0">,</span><span class="st_h">'gzgetss'</span><span class="sy0">,</span><span class="st_h">'gzinflate'</span><span class="sy0">,</span><span class="st_h">'gzopen'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gzpassthru'</span><span class="sy0">,</span><span class="st_h">'gzputs'</span><span class="sy0">,</span><span class="st_h">'gzread'</span><span class="sy0">,</span><span class="st_h">'gzrewind'</span><span class="sy0">,</span><span class="st_h">'gzseek'</span><span class="sy0">,</span><span class="st_h">'gztell'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'gzuncompress'</span><span class="sy0">,</span><span class="st_h">'gzwrite'</span><span class="sy0">,</span><span class="st_h">'hash'</span><span class="sy0">,</span><span class="st_h">'hash_algos'</span><span class="sy0">,</span><span class="st_h">'hash_file'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'hash_final'</span><span class="sy0">,</span><span class="st_h">'hash_hmac'</span><span class="sy0">,</span><span class="st_h">'hash_hmac_file'</span><span class="sy0">,</span><span class="st_h">'hash_init'</span><span class="sy0">,</span><span class="st_h">'hash_update'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'hash_update_file'</span><span class="sy0">,</span><span class="st_h">'hash_update_stream'</span><span class="sy0">,</span><span class="st_h">'header'</span><span class="sy0">,</span><span class="st_h">'headers_list'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'headers_sent'</span><span class="sy0">,</span><span class="st_h">'hebrev'</span><span class="sy0">,</span><span class="st_h">'hebrevc'</span><span class="sy0">,</span><span class="st_h">'hexdec'</span><span class="sy0">,</span><span class="st_h">'highlight_file'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'highlight_string'</span><span class="sy0">,</span><span class="st_h">'html_doc'</span><span class="sy0">,</span><span class="st_h">'html_doc_file'</span><span class="sy0">,</span><span class="st_h">'html_entity_decode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'htmlentities'</span><span class="sy0">,</span><span class="st_h">'htmlspecialchars'</span><span class="sy0">,</span><span class="st_h">'htmlspecialchars_decode'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_build_cookie'</span><span class="sy0">,</span><span class="st_h">'http_build_query'</span><span class="sy0">,</span><span class="st_h">'http_build_str'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_build_url'</span><span class="sy0">,</span><span class="st_h">'http_cache_etag'</span><span class="sy0">,</span><span class="st_h">'http_cache_last_modified'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_chunked_decode'</span><span class="sy0">,</span><span class="st_h">'http_date'</span><span class="sy0">,</span><span class="st_h">'http_deflate'</span><span class="sy0">,</span><span class="st_h">'http_get'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_get_request_body'</span><span class="sy0">,</span><span class="st_h">'http_get_request_body_stream'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_get_request_headers'</span><span class="sy0">,</span><span class="st_h">'http_head'</span><span class="sy0">,</span><span class="st_h">'http_inflate'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_match_etag'</span><span class="sy0">,</span><span class="st_h">'http_match_modified'</span><span class="sy0">,</span><span class="st_h">'http_match_request_header'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_negotiate_charset'</span><span class="sy0">,</span><span class="st_h">'http_negotiate_content_type'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_negotiate_language'</span><span class="sy0">,</span><span class="st_h">'http_parse_cookie'</span><span class="sy0">,</span><span class="st_h">'http_parse_headers'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_parse_message'</span><span class="sy0">,</span><span class="st_h">'http_parse_params'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_persistent_handles_clean'</span><span class="sy0">,</span><span class="st_h">'http_persistent_handles_count'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_persistent_handles_ident'</span><span class="sy0">,</span><span class="st_h">'http_post_data'</span><span class="sy0">,</span><span class="st_h">'http_post_fields'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_put_data'</span><span class="sy0">,</span><span class="st_h">'http_put_file'</span><span class="sy0">,</span><span class="st_h">'http_put_stream'</span><span class="sy0">,</span><span class="st_h">'http_redirect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_request'</span><span class="sy0">,</span><span class="st_h">'http_request_body_encode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_request_method_exists'</span><span class="sy0">,</span><span class="st_h">'http_request_method_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_request_method_register'</span><span class="sy0">,</span><span class="st_h">'http_request_method_unregister'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_send_content_disposition'</span><span class="sy0">,</span><span class="st_h">'http_send_content_type'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_send_data'</span><span class="sy0">,</span><span class="st_h">'http_send_file'</span><span class="sy0">,</span><span class="st_h">'http_send_last_modified'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_send_status'</span><span class="sy0">,</span><span class="st_h">'http_send_stream'</span><span class="sy0">,</span><span class="st_h">'http_support'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'http_throttle'</span><span class="sy0">,</span><span class="st_h">'hypot'</span><span class="sy0">,</span><span class="st_h">'i18n_convert'</span><span class="sy0">,</span><span class="st_h">'i18n_discover_encoding'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'i18n_http_input'</span><span class="sy0">,</span><span class="st_h">'i18n_http_output'</span><span class="sy0">,</span><span class="st_h">'i18n_internal_encoding'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'i18n_ja_jp_hantozen'</span><span class="sy0">,</span><span class="st_h">'i18n_mime_header_decode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'i18n_mime_header_encode'</span><span class="sy0">,</span><span class="st_h">'ibase_add_user'</span><span class="sy0">,</span><span class="st_h">'ibase_affected_rows'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_backup'</span><span class="sy0">,</span><span class="st_h">'ibase_blob_add'</span><span class="sy0">,</span><span class="st_h">'ibase_blob_cancel'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_blob_close'</span><span class="sy0">,</span><span class="st_h">'ibase_blob_create'</span><span class="sy0">,</span><span class="st_h">'ibase_blob_echo'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_blob_get'</span><span class="sy0">,</span><span class="st_h">'ibase_blob_import'</span><span class="sy0">,</span><span class="st_h">'ibase_blob_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_blob_open'</span><span class="sy0">,</span><span class="st_h">'ibase_close'</span><span class="sy0">,</span><span class="st_h">'ibase_commit'</span><span class="sy0">,</span><span class="st_h">'ibase_commit_ret'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_connect'</span><span class="sy0">,</span><span class="st_h">'ibase_db_info'</span><span class="sy0">,</span><span class="st_h">'ibase_delete_user'</span><span class="sy0">,</span><span class="st_h">'ibase_drop_db'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_errcode'</span><span class="sy0">,</span><span class="st_h">'ibase_errmsg'</span><span class="sy0">,</span><span class="st_h">'ibase_execute'</span><span class="sy0">,</span><span class="st_h">'ibase_fetch_assoc'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_fetch_object'</span><span class="sy0">,</span><span class="st_h">'ibase_fetch_row'</span><span class="sy0">,</span><span class="st_h">'ibase_field_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_free_event_handler'</span><span class="sy0">,</span><span class="st_h">'ibase_free_query'</span><span class="sy0">,</span><span class="st_h">'ibase_free_result'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_gen_id'</span><span class="sy0">,</span><span class="st_h">'ibase_maintain_db'</span><span class="sy0">,</span><span class="st_h">'ibase_modify_user'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_name_result'</span><span class="sy0">,</span><span class="st_h">'ibase_num_fields'</span><span class="sy0">,</span><span class="st_h">'ibase_num_params'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_param_info'</span><span class="sy0">,</span><span class="st_h">'ibase_pconnect'</span><span class="sy0">,</span><span class="st_h">'ibase_prepare'</span><span class="sy0">,</span><span class="st_h">'ibase_query'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_restore'</span><span class="sy0">,</span><span class="st_h">'ibase_rollback'</span><span class="sy0">,</span><span class="st_h">'ibase_rollback_ret'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_server_info'</span><span class="sy0">,</span><span class="st_h">'ibase_service_attach'</span><span class="sy0">,</span><span class="st_h">'ibase_service_detach'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ibase_set_event_handler'</span><span class="sy0">,</span><span class="st_h">'ibase_trans'</span><span class="sy0">,</span><span class="st_h">'ibase_wait_event'</span><span class="sy0">,</span><span class="st_h">'iconv'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'iconv_get_encoding'</span><span class="sy0">,</span><span class="st_h">'iconv_mime_decode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'iconv_mime_decode_headers'</span><span class="sy0">,</span><span class="st_h">'iconv_mime_encode'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'iconv_set_encoding'</span><span class="sy0">,</span><span class="st_h">'iconv_strlen'</span><span class="sy0">,</span><span class="st_h">'iconv_strpos'</span><span class="sy0">,</span><span class="st_h">'iconv_strrpos'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'iconv_substr'</span><span class="sy0">,</span><span class="st_h">'id3_get_frame_long_name'</span><span class="sy0">,</span><span class="st_h">'id3_get_frame_short_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'id3_get_genre_id'</span><span class="sy0">,</span><span class="st_h">'id3_get_genre_list'</span><span class="sy0">,</span><span class="st_h">'id3_get_genre_name'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'id3_get_tag'</span><span class="sy0">,</span><span class="st_h">'id3_get_version'</span><span class="sy0">,</span><span class="st_h">'id3_remove_tag'</span><span class="sy0">,</span><span class="st_h">'id3_set_tag'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'idate'</span><span class="sy0">,</span><span class="st_h">'ignore_user_abort'</span><span class="sy0">,</span><span class="st_h">'image_type_to_extension'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'image_type_to_mime_type'</span><span class="sy0">,</span><span class="st_h">'image2wbmp'</span><span class="sy0">,</span><span class="st_h">'imagealphablending'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imageantialias'</span><span class="sy0">,</span><span class="st_h">'imagearc'</span><span class="sy0">,</span><span class="st_h">'imagechar'</span><span class="sy0">,</span><span class="st_h">'imagecharup'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecolorallocate'</span><span class="sy0">,</span><span class="st_h">'imagecolorallocatealpha'</span><span class="sy0">,</span><span class="st_h">'imagecolorat'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecolorclosest'</span><span class="sy0">,</span><span class="st_h">'imagecolorclosestalpha'</span><span class="sy0">,</span><span class="st_h">'imagecolordeallocate'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecolorexact'</span><span class="sy0">,</span><span class="st_h">'imagecolorexactalpha'</span><span class="sy0">,</span><span class="st_h">'imagecolormatch'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecolorresolve'</span><span class="sy0">,</span><span class="st_h">'imagecolorresolvealpha'</span><span class="sy0">,</span><span class="st_h">'imagecolorset'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecolorsforindex'</span><span class="sy0">,</span><span class="st_h">'imagecolorstotal'</span><span class="sy0">,</span><span class="st_h">'imagecolortransparent'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imageconvolution'</span><span class="sy0">,</span><span class="st_h">'imagecopy'</span><span class="sy0">,</span><span class="st_h">'imagecopymerge'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecopymergegray'</span><span class="sy0">,</span><span class="st_h">'imagecopyresampled'</span><span class="sy0">,</span><span class="st_h">'imagecopyresized'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecreate'</span><span class="sy0">,</span><span class="st_h">'imagecreatefromgd'</span><span class="sy0">,</span><span class="st_h">'imagecreatefromgd2'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecreatefromgd2part'</span><span class="sy0">,</span><span class="st_h">'imagecreatefromgif'</span><span class="sy0">,</span><span class="st_h">'imagecreatefromjpeg'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecreatefrompng'</span><span class="sy0">,</span><span class="st_h">'imagecreatefromstring'</span><span class="sy0">,</span><span class="st_h">'imagecreatefromwbmp'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagecreatefromxbm'</span><span class="sy0">,</span><span class="st_h">'imagecreatetruecolor'</span><span class="sy0">,</span><span class="st_h">'imagedashedline'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagedestroy'</span><span class="sy0">,</span><span class="st_h">'imageellipse'</span><span class="sy0">,</span><span class="st_h">'imagefill'</span><span class="sy0">,</span><span class="st_h">'imagefilledarc'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagefilledellipse'</span><span class="sy0">,</span><span class="st_h">'imagefilledpolygon'</span><span class="sy0">,</span><span class="st_h">'imagefilledrectangle'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagefilltoborder'</span><span class="sy0">,</span><span class="st_h">'imagefilter'</span><span class="sy0">,</span><span class="st_h">'imagefontheight'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagefontwidth'</span><span class="sy0">,</span><span class="st_h">'imageftbbox'</span><span class="sy0">,</span><span class="st_h">'imagefttext'</span><span class="sy0">,</span><span class="st_h">'imagegammacorrect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagegd'</span><span class="sy0">,</span><span class="st_h">'imagegd2'</span><span class="sy0">,</span><span class="st_h">'imagegif'</span><span class="sy0">,</span><span class="st_h">'imagegrabscreen'</span><span class="sy0">,</span><span class="st_h">'imagegrabwindow'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imageinterlace'</span><span class="sy0">,</span><span class="st_h">'imageistruecolor'</span><span class="sy0">,</span><span class="st_h">'imagejpeg'</span><span class="sy0">,</span><span class="st_h">'imagelayereffect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imageline'</span><span class="sy0">,</span><span class="st_h">'imageloadfont'</span><span class="sy0">,</span><span class="st_h">'imagepalettecopy'</span><span class="sy0">,</span><span class="st_h">'imagepng'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagepolygon'</span><span class="sy0">,</span><span class="st_h">'imagepsbbox'</span><span class="sy0">,</span><span class="st_h">'imagepsencodefont'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagepsextendfont'</span><span class="sy0">,</span><span class="st_h">'imagepsfreefont'</span><span class="sy0">,</span><span class="st_h">'imagepsloadfont'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagepsslantfont'</span><span class="sy0">,</span><span class="st_h">'imagepstext'</span><span class="sy0">,</span><span class="st_h">'imagerectangle'</span><span class="sy0">,</span><span class="st_h">'imagerotate'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagesavealpha'</span><span class="sy0">,</span><span class="st_h">'imagesetbrush'</span><span class="sy0">,</span><span class="st_h">'imagesetpixel'</span><span class="sy0">,</span><span class="st_h">'imagesetstyle'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagesetthickness'</span><span class="sy0">,</span><span class="st_h">'imagesettile'</span><span class="sy0">,</span><span class="st_h">'imagestring'</span><span class="sy0">,</span><span class="st_h">'imagestringup'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagesx'</span><span class="sy0">,</span><span class="st_h">'imagesy'</span><span class="sy0">,</span><span class="st_h">'imagetruecolortopalette'</span><span class="sy0">,</span><span class="st_h">'imagettfbbox'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imagettftext'</span><span class="sy0">,</span><span class="st_h">'imagetypes'</span><span class="sy0">,</span><span class="st_h">'imagewbmp'</span><span class="sy0">,</span><span class="st_h">'imagexbm'</span><span class="sy0">,</span><span class="st_h">'imap_8bit'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_alerts'</span><span class="sy0">,</span><span class="st_h">'imap_append'</span><span class="sy0">,</span><span class="st_h">'imap_base64'</span><span class="sy0">,</span><span class="st_h">'imap_binary'</span><span class="sy0">,</span><span class="st_h">'imap_body'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_bodystruct'</span><span class="sy0">,</span><span class="st_h">'imap_check'</span><span class="sy0">,</span><span class="st_h">'imap_clearflag_full'</span><span class="sy0">,</span><span class="st_h">'imap_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_create'</span><span class="sy0">,</span><span class="st_h">'imap_createmailbox'</span><span class="sy0">,</span><span class="st_h">'imap_delete'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_deletemailbox'</span><span class="sy0">,</span><span class="st_h">'imap_errors'</span><span class="sy0">,</span><span class="st_h">'imap_expunge'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_fetch_overview'</span><span class="sy0">,</span><span class="st_h">'imap_fetchbody'</span><span class="sy0">,</span><span class="st_h">'imap_fetchheader'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_fetchstructure'</span><span class="sy0">,</span><span class="st_h">'imap_fetchtext'</span><span class="sy0">,</span><span class="st_h">'imap_get_quota'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_get_quotaroot'</span><span class="sy0">,</span><span class="st_h">'imap_getacl'</span><span class="sy0">,</span><span class="st_h">'imap_getmailboxes'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_getsubscribed'</span><span class="sy0">,</span><span class="st_h">'imap_header'</span><span class="sy0">,</span><span class="st_h">'imap_headerinfo'</span><span class="sy0">,</span><span class="st_h">'imap_headers'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_last_error'</span><span class="sy0">,</span><span class="st_h">'imap_list'</span><span class="sy0">,</span><span class="st_h">'imap_listmailbox'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_listsubscribed'</span><span class="sy0">,</span><span class="st_h">'imap_lsub'</span><span class="sy0">,</span><span class="st_h">'imap_mail'</span><span class="sy0">,</span><span class="st_h">'imap_mail_compose'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_mail_copy'</span><span class="sy0">,</span><span class="st_h">'imap_mail_move'</span><span class="sy0">,</span><span class="st_h">'imap_mailboxmsginfo'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_mime_header_decode'</span><span class="sy0">,</span><span class="st_h">'imap_msgno'</span><span class="sy0">,</span><span class="st_h">'imap_num_msg'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_num_recent'</span><span class="sy0">,</span><span class="st_h">'imap_open'</span><span class="sy0">,</span><span class="st_h">'imap_ping'</span><span class="sy0">,</span><span class="st_h">'imap_qprint'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_rename'</span><span class="sy0">,</span><span class="st_h">'imap_renamemailbox'</span><span class="sy0">,</span><span class="st_h">'imap_reopen'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_rfc822_parse_adrlist'</span><span class="sy0">,</span><span class="st_h">'imap_rfc822_parse_headers'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_rfc822_write_address'</span><span class="sy0">,</span><span class="st_h">'imap_savebody'</span><span class="sy0">,</span><span class="st_h">'imap_scan'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_scanmailbox'</span><span class="sy0">,</span><span class="st_h">'imap_search'</span><span class="sy0">,</span><span class="st_h">'imap_set_quota'</span><span class="sy0">,</span><span class="st_h">'imap_setacl'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_setflag_full'</span><span class="sy0">,</span><span class="st_h">'imap_sort'</span><span class="sy0">,</span><span class="st_h">'imap_status'</span><span class="sy0">,</span><span class="st_h">'imap_subscribe'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_thread'</span><span class="sy0">,</span><span class="st_h">'imap_timeout'</span><span class="sy0">,</span><span class="st_h">'imap_uid'</span><span class="sy0">,</span><span class="st_h">'imap_undelete'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_unsubscribe'</span><span class="sy0">,</span><span class="st_h">'imap_utf7_decode'</span><span class="sy0">,</span><span class="st_h">'imap_utf7_encode'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'imap_utf8'</span><span class="sy0">,</span><span class="st_h">'implode'</span><span class="sy0">,</span><span class="st_h">'import_request_variables'</span><span class="sy0">,</span><span class="st_h">'in_array'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ini_alter'</span><span class="sy0">,</span><span class="st_h">'ini_get'</span><span class="sy0">,</span><span class="st_h">'ini_get_all'</span><span class="sy0">,</span><span class="st_h">'ini_restore'</span><span class="sy0">,</span><span class="st_h">'ini_set'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'intval'</span><span class="sy0">,</span><span class="st_h">'ip2long'</span><span class="sy0">,</span><span class="st_h">'iptcembed'</span><span class="sy0">,</span><span class="st_h">'iptcparse'</span><span class="sy0">,</span><span class="st_h">'isset'</span><span class="sy0">,</span><span class="st_h">'is_a'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'is_array'</span><span class="sy0">,</span><span class="st_h">'is_bool'</span><span class="sy0">,</span><span class="st_h">'is_callable'</span><span class="sy0">,</span><span class="st_h">'is_dir'</span><span class="sy0">,</span><span class="st_h">'is_double'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'is_executable'</span><span class="sy0">,</span><span class="st_h">'is_file'</span><span class="sy0">,</span><span class="st_h">'is_finite'</span><span class="sy0">,</span><span class="st_h">'is_float'</span><span class="sy0">,</span><span class="st_h">'is_infinite'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'is_int'</span><span class="sy0">,</span><span class="st_h">'is_integer'</span><span class="sy0">,</span><span class="st_h">'is_link'</span><span class="sy0">,</span><span class="st_h">'is_long'</span><span class="sy0">,</span><span class="st_h">'is_nan'</span><span class="sy0">,</span><span class="st_h">'is_null'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'is_numeric'</span><span class="sy0">,</span><span class="st_h">'is_object'</span><span class="sy0">,</span><span class="st_h">'is_readable'</span><span class="sy0">,</span><span class="st_h">'is_real'</span><span class="sy0">,</span><span class="st_h">'is_resource'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'is_scalar'</span><span class="sy0">,</span><span class="st_h">'is_soap_fault'</span><span class="sy0">,</span><span class="st_h">'is_string'</span><span class="sy0">,</span><span class="st_h">'is_subclass_of'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'is_uploaded_file'</span><span class="sy0">,</span><span class="st_h">'is_writable'</span><span class="sy0">,</span><span class="st_h">'is_writeable'</span><span class="sy0">,</span><span class="st_h">'iterator_apply'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'iterator_count'</span><span class="sy0">,</span><span class="st_h">'iterator_to_array'</span><span class="sy0">,</span><span class="st_h">'java_last_exception_clear'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'java_last_exception_get'</span><span class="sy0">,</span><span class="st_h">'jddayofweek'</span><span class="sy0">,</span><span class="st_h">'jdmonthname'</span><span class="sy0">,</span><span class="st_h">'jdtofrench'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'jdtogregorian'</span><span class="sy0">,</span><span class="st_h">'jdtojewish'</span><span class="sy0">,</span><span class="st_h">'jdtojulian'</span><span class="sy0">,</span><span class="st_h">'jdtounix'</span><span class="sy0">,</span><span class="st_h">'jewishtojd'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'join'</span><span class="sy0">,</span><span class="st_h">'jpeg2wbmp'</span><span class="sy0">,</span><span class="st_h">'json_decode'</span><span class="sy0">,</span><span class="st_h">'json_encode'</span><span class="sy0">,</span><span class="st_h">'juliantojd'</span><span class="sy0">,</span><span class="st_h">'key'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'key_exists'</span><span class="sy0">,</span><span class="st_h">'krsort'</span><span class="sy0">,</span><span class="st_h">'ksort'</span><span class="sy0">,</span><span class="st_h">'lcg_value'</span><span class="sy0">,</span><span class="st_h">'ldap_add'</span><span class="sy0">,</span><span class="st_h">'ldap_bind'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_close'</span><span class="sy0">,</span><span class="st_h">'ldap_compare'</span><span class="sy0">,</span><span class="st_h">'ldap_connect'</span><span class="sy0">,</span><span class="st_h">'ldap_count_entries'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_delete'</span><span class="sy0">,</span><span class="st_h">'ldap_dn2ufn'</span><span class="sy0">,</span><span class="st_h">'ldap_err2str'</span><span class="sy0">,</span><span class="st_h">'ldap_errno'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_error'</span><span class="sy0">,</span><span class="st_h">'ldap_explode_dn'</span><span class="sy0">,</span><span class="st_h">'ldap_first_attribute'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_first_entry'</span><span class="sy0">,</span><span class="st_h">'ldap_first_reference'</span><span class="sy0">,</span><span class="st_h">'ldap_free_result'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_get_attributes'</span><span class="sy0">,</span><span class="st_h">'ldap_get_dn'</span><span class="sy0">,</span><span class="st_h">'ldap_get_entries'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_get_option'</span><span class="sy0">,</span><span class="st_h">'ldap_get_values'</span><span class="sy0">,</span><span class="st_h">'ldap_get_values_len'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_list'</span><span class="sy0">,</span><span class="st_h">'ldap_mod_add'</span><span class="sy0">,</span><span class="st_h">'ldap_mod_del'</span><span class="sy0">,</span><span class="st_h">'ldap_mod_replace'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_modify'</span><span class="sy0">,</span><span class="st_h">'ldap_next_attribute'</span><span class="sy0">,</span><span class="st_h">'ldap_next_entry'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_next_reference'</span><span class="sy0">,</span><span class="st_h">'ldap_parse_reference'</span><span class="sy0">,</span><span class="st_h">'ldap_parse_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_read'</span><span class="sy0">,</span><span class="st_h">'ldap_rename'</span><span class="sy0">,</span><span class="st_h">'ldap_search'</span><span class="sy0">,</span><span class="st_h">'ldap_set_option'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ldap_sort'</span><span class="sy0">,</span><span class="st_h">'ldap_start_tls'</span><span class="sy0">,</span><span class="st_h">'ldap_unbind'</span><span class="sy0">,</span><span class="st_h">'levenshtein'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'libxml_clear_errors'</span><span class="sy0">,</span><span class="st_h">'libxml_get_errors'</span><span class="sy0">,</span><span class="st_h">'libxml_get_last_error'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'libxml_set_streams_context'</span><span class="sy0">,</span><span class="st_h">'libxml_use_internal_errors'</span><span class="sy0">,</span><span class="st_h">'link'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'linkinfo'</span><span class="sy0">,</span><span class="st_h">'list'</span><span class="sy0">,</span><span class="st_h">'localeconv'</span><span class="sy0">,</span><span class="st_h">'localtime'</span><span class="sy0">,</span><span class="st_h">'log'</span><span class="sy0">,</span><span class="st_h">'log1p'</span><span class="sy0">,</span><span class="st_h">'log10'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'long2ip'</span><span class="sy0">,</span><span class="st_h">'lstat'</span><span class="sy0">,</span><span class="st_h">'ltrim'</span><span class="sy0">,</span><span class="st_h">'lzf_compress'</span><span class="sy0">,</span><span class="st_h">'lzf_decompress'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'lzf_optimized_for'</span><span class="sy0">,</span><span class="st_h">'magic_quotes_runtime'</span><span class="sy0">,</span><span class="st_h">'mail'</span><span class="sy0">,</span><span class="st_h">'max'</span><span class="sy0">,</span><span class="st_h">'mbereg'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mberegi'</span><span class="sy0">,</span><span class="st_h">'mberegi_replace'</span><span class="sy0">,</span><span class="st_h">'mbereg_match'</span><span class="sy0">,</span><span class="st_h">'mbereg_replace'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mbereg_search'</span><span class="sy0">,</span><span class="st_h">'mbereg_search_getpos'</span><span class="sy0">,</span><span class="st_h">'mbereg_search_getregs'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mbereg_search_init'</span><span class="sy0">,</span><span class="st_h">'mbereg_search_pos'</span><span class="sy0">,</span><span class="st_h">'mbereg_search_regs'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mbereg_search_setpos'</span><span class="sy0">,</span><span class="st_h">'mbregex_encoding'</span><span class="sy0">,</span><span class="st_h">'mbsplit'</span><span class="sy0">,</span><span class="st_h">'mbstrcut'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mbstrlen'</span><span class="sy0">,</span><span class="st_h">'mbstrpos'</span><span class="sy0">,</span><span class="st_h">'mbstrrpos'</span><span class="sy0">,</span><span class="st_h">'mbsubstr'</span><span class="sy0">,</span><span class="st_h">'mb_check_encoding'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_convert_case'</span><span class="sy0">,</span><span class="st_h">'mb_convert_encoding'</span><span class="sy0">,</span><span class="st_h">'mb_convert_kana'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_convert_variables'</span><span class="sy0">,</span><span class="st_h">'mb_decode_mimeheader'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_decode_numericentity'</span><span class="sy0">,</span><span class="st_h">'mb_detect_encoding'</span><span class="sy0">,</span><span class="st_h">'mb_detect_order'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_encode_mimeheader'</span><span class="sy0">,</span><span class="st_h">'mb_encode_numericentity'</span><span class="sy0">,</span><span class="st_h">'mb_ereg'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_eregi'</span><span class="sy0">,</span><span class="st_h">'mb_eregi_replace'</span><span class="sy0">,</span><span class="st_h">'mb_ereg_match'</span><span class="sy0">,</span><span class="st_h">'mb_ereg_replace'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_ereg_search'</span><span class="sy0">,</span><span class="st_h">'mb_ereg_search_getpos'</span><span class="sy0">,</span><span class="st_h">'mb_ereg_search_getregs'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_ereg_search_init'</span><span class="sy0">,</span><span class="st_h">'mb_ereg_search_pos'</span><span class="sy0">,</span><span class="st_h">'mb_ereg_search_regs'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_ereg_search_setpos'</span><span class="sy0">,</span><span class="st_h">'mb_get_info'</span><span class="sy0">,</span><span class="st_h">'mb_http_input'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_http_output'</span><span class="sy0">,</span><span class="st_h">'mb_internal_encoding'</span><span class="sy0">,</span><span class="st_h">'mb_language'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_list_encodings'</span><span class="sy0">,</span><span class="st_h">'mb_output_handler'</span><span class="sy0">,</span><span class="st_h">'mb_parse_str'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_preferred_mime_name'</span><span class="sy0">,</span><span class="st_h">'mb_regex_encoding'</span><span class="sy0">,</span><span class="st_h">'mb_regex_set_options'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_send_mail'</span><span class="sy0">,</span><span class="st_h">'mb_split'</span><span class="sy0">,</span><span class="st_h">'mb_strcut'</span><span class="sy0">,</span><span class="st_h">'mb_strimwidth'</span><span class="sy0">,</span><span class="st_h">'mb_stripos'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_stristr'</span><span class="sy0">,</span><span class="st_h">'mb_strlen'</span><span class="sy0">,</span><span class="st_h">'mb_strpos'</span><span class="sy0">,</span><span class="st_h">'mb_strrchr'</span><span class="sy0">,</span><span class="st_h">'mb_strrichr'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_strripos'</span><span class="sy0">,</span><span class="st_h">'mb_strrpos'</span><span class="sy0">,</span><span class="st_h">'mb_strstr'</span><span class="sy0">,</span><span class="st_h">'mb_strtolower'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_strtoupper'</span><span class="sy0">,</span><span class="st_h">'mb_strwidth'</span><span class="sy0">,</span><span class="st_h">'mb_substitute_character'</span><span class="sy0">,</span><span class="st_h">'mb_substr'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mb_substr_count'</span><span class="sy0">,</span><span class="st_h">'mcrypt_cbc'</span><span class="sy0">,</span><span class="st_h">'mcrypt_cfb'</span><span class="sy0">,</span><span class="st_h">'mcrypt_create_iv'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_decrypt'</span><span class="sy0">,</span><span class="st_h">'mcrypt_ecb'</span><span class="sy0">,</span><span class="st_h">'mcrypt_enc_get_algorithms_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_enc_get_block_size'</span><span class="sy0">,</span><span class="st_h">'mcrypt_enc_get_iv_size'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_enc_get_key_size'</span><span class="sy0">,</span><span class="st_h">'mcrypt_enc_get_modes_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_enc_get_supported_key_sizes'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_enc_is_block_algorithm'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_enc_is_block_algorithm_mode'</span><span class="sy0">,</span><span class="st_h">'mcrypt_enc_is_block_mode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_enc_self_test'</span><span class="sy0">,</span><span class="st_h">'mcrypt_encrypt'</span><span class="sy0">,</span><span class="st_h">'mcrypt_generic'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_generic_deinit'</span><span class="sy0">,</span><span class="st_h">'mcrypt_generic_end'</span><span class="sy0">,</span><span class="st_h">'mcrypt_generic_init'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_get_block_size'</span><span class="sy0">,</span><span class="st_h">'mcrypt_get_cipher_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_get_iv_size'</span><span class="sy0">,</span><span class="st_h">'mcrypt_get_key_size'</span><span class="sy0">,</span><span class="st_h">'mcrypt_list_algorithms'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_list_modes'</span><span class="sy0">,</span><span class="st_h">'mcrypt_module_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_get_algo_block_size'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_get_algo_key_size'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_get_supported_key_sizes'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_is_block_algorithm'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_is_block_algorithm_mode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_is_block_mode'</span><span class="sy0">,</span><span class="st_h">'mcrypt_module_open'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mcrypt_module_self_test'</span><span class="sy0">,</span><span class="st_h">'mcrypt_ofb'</span><span class="sy0">,</span><span class="st_h">'md5'</span><span class="sy0">,</span><span class="st_h">'md5_file'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mdecrypt_generic'</span><span class="sy0">,</span><span class="st_h">'memcache_add'</span><span class="sy0">,</span><span class="st_h">'memcache_add_server'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_close'</span><span class="sy0">,</span><span class="st_h">'memcache_connect'</span><span class="sy0">,</span><span class="st_h">'memcache_debug'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_decrement'</span><span class="sy0">,</span><span class="st_h">'memcache_delete'</span><span class="sy0">,</span><span class="st_h">'memcache_flush'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_get'</span><span class="sy0">,</span><span class="st_h">'memcache_get_extended_stats'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_get_server_status'</span><span class="sy0">,</span><span class="st_h">'memcache_get_stats'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_get_version'</span><span class="sy0">,</span><span class="st_h">'memcache_increment'</span><span class="sy0">,</span><span class="st_h">'memcache_pconnect'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_replace'</span><span class="sy0">,</span><span class="st_h">'memcache_set'</span><span class="sy0">,</span><span class="st_h">'memcache_set_compress_threshold'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memcache_set_server_params'</span><span class="sy0">,</span><span class="st_h">'memory_get_peak_usage'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'memory_get_usage'</span><span class="sy0">,</span><span class="st_h">'metaphone'</span><span class="sy0">,</span><span class="st_h">'mhash'</span><span class="sy0">,</span><span class="st_h">'mhash_count'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mhash_get_block_size'</span><span class="sy0">,</span><span class="st_h">'mhash_get_hash_name'</span><span class="sy0">,</span><span class="st_h">'mhash_keygen_s2k'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'method_exists'</span><span class="sy0">,</span><span class="st_h">'microtime'</span><span class="sy0">,</span><span class="st_h">'mime_content_type'</span><span class="sy0">,</span><span class="st_h">'min'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ming_keypress'</span><span class="sy0">,</span><span class="st_h">'ming_setcubicthreshold'</span><span class="sy0">,</span><span class="st_h">'ming_setscale'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ming_useconstants'</span><span class="sy0">,</span><span class="st_h">'ming_useswfversion'</span><span class="sy0">,</span><span class="st_h">'mkdir'</span><span class="sy0">,</span><span class="st_h">'mktime'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'money_format'</span><span class="sy0">,</span><span class="st_h">'move_uploaded_file'</span><span class="sy0">,</span><span class="st_h">'msql'</span><span class="sy0">,</span><span class="st_h">'msql_affected_rows'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_close'</span><span class="sy0">,</span><span class="st_h">'msql_connect'</span><span class="sy0">,</span><span class="st_h">'msql_create_db'</span><span class="sy0">,</span><span class="st_h">'msql_createdb'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_data_seek'</span><span class="sy0">,</span><span class="st_h">'msql_db_query'</span><span class="sy0">,</span><span class="st_h">'msql_dbname'</span><span class="sy0">,</span><span class="st_h">'msql_drop_db'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_dropdb'</span><span class="sy0">,</span><span class="st_h">'msql_error'</span><span class="sy0">,</span><span class="st_h">'msql_fetch_array'</span><span class="sy0">,</span><span class="st_h">'msql_fetch_field'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_fetch_object'</span><span class="sy0">,</span><span class="st_h">'msql_fetch_row'</span><span class="sy0">,</span><span class="st_h">'msql_field_flags'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_field_len'</span><span class="sy0">,</span><span class="st_h">'msql_field_name'</span><span class="sy0">,</span><span class="st_h">'msql_field_seek'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_field_table'</span><span class="sy0">,</span><span class="st_h">'msql_field_type'</span><span class="sy0">,</span><span class="st_h">'msql_fieldflags'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_fieldlen'</span><span class="sy0">,</span><span class="st_h">'msql_fieldname'</span><span class="sy0">,</span><span class="st_h">'msql_fieldtable'</span><span class="sy0">,</span><span class="st_h">'msql_fieldtype'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_free_result'</span><span class="sy0">,</span><span class="st_h">'msql_freeresult'</span><span class="sy0">,</span><span class="st_h">'msql_list_dbs'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_list_fields'</span><span class="sy0">,</span><span class="st_h">'msql_list_tables'</span><span class="sy0">,</span><span class="st_h">'msql_listdbs'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_listfields'</span><span class="sy0">,</span><span class="st_h">'msql_listtables'</span><span class="sy0">,</span><span class="st_h">'msql_num_fields'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_num_rows'</span><span class="sy0">,</span><span class="st_h">'msql_numfields'</span><span class="sy0">,</span><span class="st_h">'msql_numrows'</span><span class="sy0">,</span><span class="st_h">'msql_pconnect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_query'</span><span class="sy0">,</span><span class="st_h">'msql_regcase'</span><span class="sy0">,</span><span class="st_h">'msql_result'</span><span class="sy0">,</span><span class="st_h">'msql_select_db'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'msql_selectdb'</span><span class="sy0">,</span><span class="st_h">'msql_tablename'</span><span class="sy0">,</span><span class="st_h">'mssql_bind'</span><span class="sy0">,</span><span class="st_h">'mssql_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_connect'</span><span class="sy0">,</span><span class="st_h">'mssql_data_seek'</span><span class="sy0">,</span><span class="st_h">'mssql_execute'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_fetch_array'</span><span class="sy0">,</span><span class="st_h">'mssql_fetch_assoc'</span><span class="sy0">,</span><span class="st_h">'mssql_fetch_batch'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_fetch_field'</span><span class="sy0">,</span><span class="st_h">'mssql_fetch_object'</span><span class="sy0">,</span><span class="st_h">'mssql_fetch_row'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_field_length'</span><span class="sy0">,</span><span class="st_h">'mssql_field_name'</span><span class="sy0">,</span><span class="st_h">'mssql_field_seek'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_field_type'</span><span class="sy0">,</span><span class="st_h">'mssql_free_result'</span><span class="sy0">,</span><span class="st_h">'mssql_free_statement'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_get_last_message'</span><span class="sy0">,</span><span class="st_h">'mssql_guid_string'</span><span class="sy0">,</span><span class="st_h">'mssql_init'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_min_error_severity'</span><span class="sy0">,</span><span class="st_h">'mssql_min_message_severity'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_next_result'</span><span class="sy0">,</span><span class="st_h">'mssql_num_fields'</span><span class="sy0">,</span><span class="st_h">'mssql_num_rows'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_pconnect'</span><span class="sy0">,</span><span class="st_h">'mssql_query'</span><span class="sy0">,</span><span class="st_h">'mssql_result'</span><span class="sy0">,</span><span class="st_h">'mssql_rows_affected'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mssql_select_db'</span><span class="sy0">,</span><span class="st_h">'mt_getrandmax'</span><span class="sy0">,</span><span class="st_h">'mt_rand'</span><span class="sy0">,</span><span class="st_h">'mt_srand'</span><span class="sy0">,</span><span class="st_h">'mysql'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_affected_rows'</span><span class="sy0">,</span><span class="st_h">'mysql_client_encoding'</span><span class="sy0">,</span><span class="st_h">'mysql_close'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_connect'</span><span class="sy0">,</span><span class="st_h">'mysql_createdb'</span><span class="sy0">,</span><span class="st_h">'mysql_create_db'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_data_seek'</span><span class="sy0">,</span><span class="st_h">'mysql_dbname'</span><span class="sy0">,</span><span class="st_h">'mysql_db_name'</span><span class="sy0">,</span><span class="st_h">'mysql_db_query'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_dropdb'</span><span class="sy0">,</span><span class="st_h">'mysql_drop_db'</span><span class="sy0">,</span><span class="st_h">'mysql_errno'</span><span class="sy0">,</span><span class="st_h">'mysql_error'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_escape_string'</span><span class="sy0">,</span><span class="st_h">'mysql_fetch_array'</span><span class="sy0">,</span><span class="st_h">'mysql_fetch_assoc'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_fetch_field'</span><span class="sy0">,</span><span class="st_h">'mysql_fetch_lengths'</span><span class="sy0">,</span><span class="st_h">'mysql_fetch_object'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_fetch_row'</span><span class="sy0">,</span><span class="st_h">'mysql_fieldflags'</span><span class="sy0">,</span><span class="st_h">'mysql_fieldlen'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_fieldname'</span><span class="sy0">,</span><span class="st_h">'mysql_fieldtable'</span><span class="sy0">,</span><span class="st_h">'mysql_fieldtype'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_field_flags'</span><span class="sy0">,</span><span class="st_h">'mysql_field_len'</span><span class="sy0">,</span><span class="st_h">'mysql_field_name'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_field_seek'</span><span class="sy0">,</span><span class="st_h">'mysql_field_table'</span><span class="sy0">,</span><span class="st_h">'mysql_field_type'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_freeresult'</span><span class="sy0">,</span><span class="st_h">'mysql_free_result'</span><span class="sy0">,</span><span class="st_h">'mysql_get_client_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_get_host_info'</span><span class="sy0">,</span><span class="st_h">'mysql_get_proto_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_get_server_info'</span><span class="sy0">,</span><span class="st_h">'mysql_info'</span><span class="sy0">,</span><span class="st_h">'mysql_insert_id'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_listdbs'</span><span class="sy0">,</span><span class="st_h">'mysql_listfields'</span><span class="sy0">,</span><span class="st_h">'mysql_listtables'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_list_dbs'</span><span class="sy0">,</span><span class="st_h">'mysql_list_fields'</span><span class="sy0">,</span><span class="st_h">'mysql_list_processes'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_list_tables'</span><span class="sy0">,</span><span class="st_h">'mysql_numfields'</span><span class="sy0">,</span><span class="st_h">'mysql_numrows'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_num_fields'</span><span class="sy0">,</span><span class="st_h">'mysql_num_rows'</span><span class="sy0">,</span><span class="st_h">'mysql_pconnect'</span><span class="sy0">,</span><span class="st_h">'mysql_ping'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_query'</span><span class="sy0">,</span><span class="st_h">'mysql_real_escape_string'</span><span class="sy0">,</span><span class="st_h">'mysql_result'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_selectdb'</span><span class="sy0">,</span><span class="st_h">'mysql_select_db'</span><span class="sy0">,</span><span class="st_h">'mysql_set_charset'</span><span class="sy0">,</span><span class="st_h">'mysql_stat'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_tablename'</span><span class="sy0">,</span><span class="st_h">'mysql_table_name'</span><span class="sy0">,</span><span class="st_h">'mysql_thread_id'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysql_unbuffered_query'</span><span class="sy0">,</span><span class="st_h">'mysqli_affected_rows'</span><span class="sy0">,</span><span class="st_h">'mysqli_autocommit'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_bind_param'</span><span class="sy0">,</span><span class="st_h">'mysqli_bind_result'</span><span class="sy0">,</span><span class="st_h">'mysqli_change_user'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_character_set_name'</span><span class="sy0">,</span><span class="st_h">'mysqli_client_encoding'</span><span class="sy0">,</span><span class="st_h">'mysqli_close'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_commit'</span><span class="sy0">,</span><span class="st_h">'mysqli_connect'</span><span class="sy0">,</span><span class="st_h">'mysqli_connect_errno'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_connect_error'</span><span class="sy0">,</span><span class="st_h">'mysqli_data_seek'</span><span class="sy0">,</span><span class="st_h">'mysqli_debug'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_disable_reads_from_master'</span><span class="sy0">,</span><span class="st_h">'mysqli_disable_rpl_parse'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_dump_debug_info'</span><span class="sy0">,</span><span class="st_h">'mysqli_embedded_server_end'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_embedded_server_start'</span><span class="sy0">,</span><span class="st_h">'mysqli_enable_reads_from_master'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_enable_rpl_parse'</span><span class="sy0">,</span><span class="st_h">'mysqli_errno'</span><span class="sy0">,</span><span class="st_h">'mysqli_error'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_escape_string'</span><span class="sy0">,</span><span class="st_h">'mysqli_execute'</span><span class="sy0">,</span><span class="st_h">'mysqli_fetch'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_fetch_array'</span><span class="sy0">,</span><span class="st_h">'mysqli_fetch_assoc'</span><span class="sy0">,</span><span class="st_h">'mysqli_fetch_field'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_fetch_field_direct'</span><span class="sy0">,</span><span class="st_h">'mysqli_fetch_fields'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_fetch_lengths'</span><span class="sy0">,</span><span class="st_h">'mysqli_fetch_object'</span><span class="sy0">,</span><span class="st_h">'mysqli_fetch_row'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_field_count'</span><span class="sy0">,</span><span class="st_h">'mysqli_field_seek'</span><span class="sy0">,</span><span class="st_h">'mysqli_field_tell'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_free_result'</span><span class="sy0">,</span><span class="st_h">'mysqli_get_charset'</span><span class="sy0">,</span><span class="st_h">'mysqli_get_client_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_get_client_version'</span><span class="sy0">,</span><span class="st_h">'mysqli_get_host_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_get_metadata'</span><span class="sy0">,</span><span class="st_h">'mysqli_get_proto_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_get_server_info'</span><span class="sy0">,</span><span class="st_h">'mysqli_get_server_version'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_get_warnings'</span><span class="sy0">,</span><span class="st_h">'mysqli_info'</span><span class="sy0">,</span><span class="st_h">'mysqli_init'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_insert_id'</span><span class="sy0">,</span><span class="st_h">'mysqli_kill'</span><span class="sy0">,</span><span class="st_h">'mysqli_master_query'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_more_results'</span><span class="sy0">,</span><span class="st_h">'mysqli_multi_query'</span><span class="sy0">,</span><span class="st_h">'mysqli_next_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_num_fields'</span><span class="sy0">,</span><span class="st_h">'mysqli_num_rows'</span><span class="sy0">,</span><span class="st_h">'mysqli_options'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_param_count'</span><span class="sy0">,</span><span class="st_h">'mysqli_ping'</span><span class="sy0">,</span><span class="st_h">'mysqli_prepare'</span><span class="sy0">,</span><span class="st_h">'mysqli_query'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_real_connect'</span><span class="sy0">,</span><span class="st_h">'mysqli_real_escape_string'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_real_query'</span><span class="sy0">,</span><span class="st_h">'mysqli_report'</span><span class="sy0">,</span><span class="st_h">'mysqli_rollback'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_rpl_parse_enabled'</span><span class="sy0">,</span><span class="st_h">'mysqli_rpl_probe'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_rpl_query_type'</span><span class="sy0">,</span><span class="st_h">'mysqli_select_db'</span><span class="sy0">,</span><span class="st_h">'mysqli_send_long_data'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_send_query'</span><span class="sy0">,</span><span class="st_h">'mysqli_set_charset'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_set_local_infile_default'</span><span class="sy0">,</span><span class="st_h">'mysqli_set_local_infile_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_set_opt'</span><span class="sy0">,</span><span class="st_h">'mysqli_slave_query'</span><span class="sy0">,</span><span class="st_h">'mysqli_sqlstate'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_ssl_set'</span><span class="sy0">,</span><span class="st_h">'mysqli_stat'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_affected_rows'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_attr_get'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_attr_set'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_bind_param'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_bind_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_close'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_data_seek'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_errno'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_error'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_execute'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_fetch'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_field_count'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_free_result'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_get_warnings'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_init'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_insert_id'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_num_rows'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_param_count'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_prepare'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_reset'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_result_metadata'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_send_long_data'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_stmt_sqlstate'</span><span class="sy0">,</span><span class="st_h">'mysqli_stmt_store_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_store_result'</span><span class="sy0">,</span><span class="st_h">'mysqli_thread_id'</span><span class="sy0">,</span><span class="st_h">'mysqli_thread_safe'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'mysqli_use_result'</span><span class="sy0">,</span><span class="st_h">'mysqli_warning_count'</span><span class="sy0">,</span><span class="st_h">'natcasesort'</span><span class="sy0">,</span><span class="st_h">'natsort'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'new_xmldoc'</span><span class="sy0">,</span><span class="st_h">'next'</span><span class="sy0">,</span><span class="st_h">'ngettext'</span><span class="sy0">,</span><span class="st_h">'nl2br'</span><span class="sy0">,</span><span class="st_h">'nl_langinfo'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ntuser_getdomaincontroller'</span><span class="sy0">,</span><span class="st_h">'ntuser_getusergroups'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ntuser_getuserinfo'</span><span class="sy0">,</span><span class="st_h">'ntuser_getuserlist'</span><span class="sy0">,</span><span class="st_h">'number_format'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ob_clean'</span><span class="sy0">,</span><span class="st_h">'ob_deflatehandler'</span><span class="sy0">,</span><span class="st_h">'ob_end_clean'</span><span class="sy0">,</span><span class="st_h">'ob_end_flush'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ob_etaghandler'</span><span class="sy0">,</span><span class="st_h">'ob_flush'</span><span class="sy0">,</span><span class="st_h">'ob_get_clean'</span><span class="sy0">,</span><span class="st_h">'ob_get_contents'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ob_get_flush'</span><span class="sy0">,</span><span class="st_h">'ob_get_length'</span><span class="sy0">,</span><span class="st_h">'ob_get_level'</span><span class="sy0">,</span><span class="st_h">'ob_get_status'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ob_gzhandler'</span><span class="sy0">,</span><span class="st_h">'ob_iconv_handler'</span><span class="sy0">,</span><span class="st_h">'ob_implicit_flush'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ob_inflatehandler'</span><span class="sy0">,</span><span class="st_h">'ob_list_handlers'</span><span class="sy0">,</span><span class="st_h">'ob_start'</span><span class="sy0">,</span><span class="st_h">'ob_tidyhandler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'octdec'</span><span class="sy0">,</span><span class="st_h">'odbc_autocommit'</span><span class="sy0">,</span><span class="st_h">'odbc_binmode'</span><span class="sy0">,</span><span class="st_h">'odbc_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_close_all'</span><span class="sy0">,</span><span class="st_h">'odbc_columnprivileges'</span><span class="sy0">,</span><span class="st_h">'odbc_columns'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_commit'</span><span class="sy0">,</span><span class="st_h">'odbc_connect'</span><span class="sy0">,</span><span class="st_h">'odbc_cursor'</span><span class="sy0">,</span><span class="st_h">'odbc_data_source'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_do'</span><span class="sy0">,</span><span class="st_h">'odbc_error'</span><span class="sy0">,</span><span class="st_h">'odbc_errormsg'</span><span class="sy0">,</span><span class="st_h">'odbc_exec'</span><span class="sy0">,</span><span class="st_h">'odbc_execute'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_fetch_array'</span><span class="sy0">,</span><span class="st_h">'odbc_fetch_into'</span><span class="sy0">,</span><span class="st_h">'odbc_fetch_object'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_fetch_row'</span><span class="sy0">,</span><span class="st_h">'odbc_field_len'</span><span class="sy0">,</span><span class="st_h">'odbc_field_name'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_field_num'</span><span class="sy0">,</span><span class="st_h">'odbc_field_precision'</span><span class="sy0">,</span><span class="st_h">'odbc_field_scale'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_field_type'</span><span class="sy0">,</span><span class="st_h">'odbc_foreignkeys'</span><span class="sy0">,</span><span class="st_h">'odbc_free_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_gettypeinfo'</span><span class="sy0">,</span><span class="st_h">'odbc_longreadlen'</span><span class="sy0">,</span><span class="st_h">'odbc_next_result'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_num_fields'</span><span class="sy0">,</span><span class="st_h">'odbc_num_rows'</span><span class="sy0">,</span><span class="st_h">'odbc_pconnect'</span><span class="sy0">,</span><span class="st_h">'odbc_prepare'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_primarykeys'</span><span class="sy0">,</span><span class="st_h">'odbc_procedurecolumns'</span><span class="sy0">,</span><span class="st_h">'odbc_procedures'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_result'</span><span class="sy0">,</span><span class="st_h">'odbc_result_all'</span><span class="sy0">,</span><span class="st_h">'odbc_rollback'</span><span class="sy0">,</span><span class="st_h">'odbc_setoption'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_specialcolumns'</span><span class="sy0">,</span><span class="st_h">'odbc_statistics'</span><span class="sy0">,</span><span class="st_h">'odbc_tableprivileges'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'odbc_tables'</span><span class="sy0">,</span><span class="st_h">'opendir'</span><span class="sy0">,</span><span class="st_h">'openlog'</span><span class="sy0">,</span><span class="st_h">'openssl_csr_export'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_csr_export_to_file'</span><span class="sy0">,</span><span class="st_h">'openssl_csr_get_public_key'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_csr_get_subject'</span><span class="sy0">,</span><span class="st_h">'openssl_csr_new'</span><span class="sy0">,</span><span class="st_h">'openssl_csr_sign'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_error_string'</span><span class="sy0">,</span><span class="st_h">'openssl_free_key'</span><span class="sy0">,</span><span class="st_h">'openssl_get_privatekey'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_get_publickey'</span><span class="sy0">,</span><span class="st_h">'openssl_open'</span><span class="sy0">,</span><span class="st_h">'openssl_pkcs12_export'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_pkcs12_export_to_file'</span><span class="sy0">,</span><span class="st_h">'openssl_pkcs12_read'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_pkcs7_decrypt'</span><span class="sy0">,</span><span class="st_h">'openssl_pkcs7_encrypt'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_pkcs7_sign'</span><span class="sy0">,</span><span class="st_h">'openssl_pkcs7_verify'</span><span class="sy0">,</span><span class="st_h">'openssl_pkey_export'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_pkey_export_to_file'</span><span class="sy0">,</span><span class="st_h">'openssl_pkey_free'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_pkey_get_details'</span><span class="sy0">,</span><span class="st_h">'openssl_pkey_get_private'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_pkey_get_public'</span><span class="sy0">,</span><span class="st_h">'openssl_pkey_new'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_private_decrypt'</span><span class="sy0">,</span><span class="st_h">'openssl_private_encrypt'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_public_decrypt'</span><span class="sy0">,</span><span class="st_h">'openssl_public_encrypt'</span><span class="sy0">,</span><span class="st_h">'openssl_seal'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_sign'</span><span class="sy0">,</span><span class="st_h">'openssl_verify'</span><span class="sy0">,</span><span class="st_h">'openssl_x509_checkpurpose'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_x509_check_private_key'</span><span class="sy0">,</span><span class="st_h">'openssl_x509_export'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_x509_export_to_file'</span><span class="sy0">,</span><span class="st_h">'openssl_x509_free'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'openssl_x509_parse'</span><span class="sy0">,</span><span class="st_h">'openssl_x509_read'</span><span class="sy0">,</span><span class="st_h">'ord'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'output_add_rewrite_var'</span><span class="sy0">,</span><span class="st_h">'output_reset_rewrite_vars'</span><span class="sy0">,</span><span class="st_h">'overload'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'outputdebugstring'</span><span class="sy0">,</span><span class="st_h">'pack'</span><span class="sy0">,</span><span class="st_h">'parse_ini_file'</span><span class="sy0">,</span><span class="st_h">'parse_str'</span><span class="sy0">,</span><span class="st_h">'parse_url'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'parsekit_compile_file'</span><span class="sy0">,</span><span class="st_h">'parsekit_compile_string'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'parsekit_func_arginfo'</span><span class="sy0">,</span><span class="st_h">'parsekit_opcode_flags'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'parsekit_opcode_name'</span><span class="sy0">,</span><span class="st_h">'passthru'</span><span class="sy0">,</span><span class="st_h">'pathinfo'</span><span class="sy0">,</span><span class="st_h">'pclose'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_add_bookmark'</span><span class="sy0">,</span><span class="st_h">'pdf_add_launchlink'</span><span class="sy0">,</span><span class="st_h">'pdf_add_locallink'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_add_nameddest'</span><span class="sy0">,</span><span class="st_h">'pdf_add_note'</span><span class="sy0">,</span><span class="st_h">'pdf_add_pdflink'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_add_thumbnail'</span><span class="sy0">,</span><span class="st_h">'pdf_add_weblink'</span><span class="sy0">,</span><span class="st_h">'pdf_arc'</span><span class="sy0">,</span><span class="st_h">'pdf_arcn'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_attach_file'</span><span class="sy0">,</span><span class="st_h">'pdf_begin_font'</span><span class="sy0">,</span><span class="st_h">'pdf_begin_glyph'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_begin_page'</span><span class="sy0">,</span><span class="st_h">'pdf_begin_pattern'</span><span class="sy0">,</span><span class="st_h">'pdf_begin_template'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_circle'</span><span class="sy0">,</span><span class="st_h">'pdf_clip'</span><span class="sy0">,</span><span class="st_h">'pdf_close'</span><span class="sy0">,</span><span class="st_h">'pdf_close_image'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_close_pdi'</span><span class="sy0">,</span><span class="st_h">'pdf_close_pdi_page'</span><span class="sy0">,</span><span class="st_h">'pdf_closepath'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_closepath_fill_stroke'</span><span class="sy0">,</span><span class="st_h">'pdf_closepath_stroke'</span><span class="sy0">,</span><span class="st_h">'pdf_concat'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_continue_text'</span><span class="sy0">,</span><span class="st_h">'pdf_create_gstate'</span><span class="sy0">,</span><span class="st_h">'pdf_create_pvf'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_curveto'</span><span class="sy0">,</span><span class="st_h">'pdf_delete'</span><span class="sy0">,</span><span class="st_h">'pdf_delete_pvf'</span><span class="sy0">,</span><span class="st_h">'pdf_encoding_set_char'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_end_font'</span><span class="sy0">,</span><span class="st_h">'pdf_end_glyph'</span><span class="sy0">,</span><span class="st_h">'pdf_end_page'</span><span class="sy0">,</span><span class="st_h">'pdf_end_pattern'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_end_template'</span><span class="sy0">,</span><span class="st_h">'pdf_endpath'</span><span class="sy0">,</span><span class="st_h">'pdf_fill'</span><span class="sy0">,</span><span class="st_h">'pdf_fill_imageblock'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_fill_pdfblock'</span><span class="sy0">,</span><span class="st_h">'pdf_fill_stroke'</span><span class="sy0">,</span><span class="st_h">'pdf_fill_textblock'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_findfont'</span><span class="sy0">,</span><span class="st_h">'pdf_fit_image'</span><span class="sy0">,</span><span class="st_h">'pdf_fit_pdi_page'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_fit_textline'</span><span class="sy0">,</span><span class="st_h">'pdf_get_apiname'</span><span class="sy0">,</span><span class="st_h">'pdf_get_buffer'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_get_errmsg'</span><span class="sy0">,</span><span class="st_h">'pdf_get_errnum'</span><span class="sy0">,</span><span class="st_h">'pdf_get_parameter'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_get_pdi_parameter'</span><span class="sy0">,</span><span class="st_h">'pdf_get_pdi_value'</span><span class="sy0">,</span><span class="st_h">'pdf_get_value'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_initgraphics'</span><span class="sy0">,</span><span class="st_h">'pdf_lineto'</span><span class="sy0">,</span><span class="st_h">'pdf_load_font'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_load_iccprofile'</span><span class="sy0">,</span><span class="st_h">'pdf_load_image'</span><span class="sy0">,</span><span class="st_h">'pdf_makespotcolor'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_moveto'</span><span class="sy0">,</span><span class="st_h">'pdf_new'</span><span class="sy0">,</span><span class="st_h">'pdf_open_ccitt'</span><span class="sy0">,</span><span class="st_h">'pdf_open_file'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_open_image'</span><span class="sy0">,</span><span class="st_h">'pdf_open_image_file'</span><span class="sy0">,</span><span class="st_h">'pdf_open_pdi'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_open_pdi_page'</span><span class="sy0">,</span><span class="st_h">'pdf_place_image'</span><span class="sy0">,</span><span class="st_h">'pdf_place_pdi_page'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_process_pdi'</span><span class="sy0">,</span><span class="st_h">'pdf_rect'</span><span class="sy0">,</span><span class="st_h">'pdf_restore'</span><span class="sy0">,</span><span class="st_h">'pdf_rotate'</span><span class="sy0">,</span><span class="st_h">'pdf_save'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_scale'</span><span class="sy0">,</span><span class="st_h">'pdf_set_border_color'</span><span class="sy0">,</span><span class="st_h">'pdf_set_border_dash'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_set_border_style'</span><span class="sy0">,</span><span class="st_h">'pdf_set_gstate'</span><span class="sy0">,</span><span class="st_h">'pdf_set_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_set_parameter'</span><span class="sy0">,</span><span class="st_h">'pdf_set_text_pos'</span><span class="sy0">,</span><span class="st_h">'pdf_set_value'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_setcolor'</span><span class="sy0">,</span><span class="st_h">'pdf_setdash'</span><span class="sy0">,</span><span class="st_h">'pdf_setdashpattern'</span><span class="sy0">,</span><span class="st_h">'pdf_setflat'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_setfont'</span><span class="sy0">,</span><span class="st_h">'pdf_setlinecap'</span><span class="sy0">,</span><span class="st_h">'pdf_setlinejoin'</span><span class="sy0">,</span><span class="st_h">'pdf_setlinewidth'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_setmatrix'</span><span class="sy0">,</span><span class="st_h">'pdf_setmiterlimit'</span><span class="sy0">,</span><span class="st_h">'pdf_setpolydash'</span><span class="sy0">,</span><span class="st_h">'pdf_shading'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_shading_pattern'</span><span class="sy0">,</span><span class="st_h">'pdf_shfill'</span><span class="sy0">,</span><span class="st_h">'pdf_show'</span><span class="sy0">,</span><span class="st_h">'pdf_show_boxed'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_show_xy'</span><span class="sy0">,</span><span class="st_h">'pdf_skew'</span><span class="sy0">,</span><span class="st_h">'pdf_stringwidth'</span><span class="sy0">,</span><span class="st_h">'pdf_stroke'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pdf_translate'</span><span class="sy0">,</span><span class="st_h">'pdo_drivers'</span><span class="sy0">,</span><span class="st_h">'pfsockopen'</span><span class="sy0">,</span><span class="st_h">'pg_affected_rows'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_cancel_query'</span><span class="sy0">,</span><span class="st_h">'pg_clientencoding'</span><span class="sy0">,</span><span class="st_h">'pg_client_encoding'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_close'</span><span class="sy0">,</span><span class="st_h">'pg_cmdtuples'</span><span class="sy0">,</span><span class="st_h">'pg_connect'</span><span class="sy0">,</span><span class="st_h">'pg_connection_busy'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_connection_reset'</span><span class="sy0">,</span><span class="st_h">'pg_connection_status'</span><span class="sy0">,</span><span class="st_h">'pg_convert'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_copy_from'</span><span class="sy0">,</span><span class="st_h">'pg_copy_to'</span><span class="sy0">,</span><span class="st_h">'pg_dbname'</span><span class="sy0">,</span><span class="st_h">'pg_delete'</span><span class="sy0">,</span><span class="st_h">'pg_end_copy'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_errormessage'</span><span class="sy0">,</span><span class="st_h">'pg_escape_bytea'</span><span class="sy0">,</span><span class="st_h">'pg_escape_string'</span><span class="sy0">,</span><span class="st_h">'pg_exec'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_execute'</span><span class="sy0">,</span><span class="st_h">'pg_fetch_all'</span><span class="sy0">,</span><span class="st_h">'pg_fetch_all_columns'</span><span class="sy0">,</span><span class="st_h">'pg_fetch_array'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_fetch_assoc'</span><span class="sy0">,</span><span class="st_h">'pg_fetch_object'</span><span class="sy0">,</span><span class="st_h">'pg_fetch_result'</span><span class="sy0">,</span><span class="st_h">'pg_fetch_row'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_fieldisnull'</span><span class="sy0">,</span><span class="st_h">'pg_fieldname'</span><span class="sy0">,</span><span class="st_h">'pg_fieldnum'</span><span class="sy0">,</span><span class="st_h">'pg_fieldprtlen'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_fieldsize'</span><span class="sy0">,</span><span class="st_h">'pg_fieldtype'</span><span class="sy0">,</span><span class="st_h">'pg_field_is_null'</span><span class="sy0">,</span><span class="st_h">'pg_field_name'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_field_num'</span><span class="sy0">,</span><span class="st_h">'pg_field_prtlen'</span><span class="sy0">,</span><span class="st_h">'pg_field_size'</span><span class="sy0">,</span><span class="st_h">'pg_field_table'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_field_type'</span><span class="sy0">,</span><span class="st_h">'pg_field_type_oid'</span><span class="sy0">,</span><span class="st_h">'pg_free_result'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_freeresult'</span><span class="sy0">,</span><span class="st_h">'pg_get_notify'</span><span class="sy0">,</span><span class="st_h">'pg_get_pid'</span><span class="sy0">,</span><span class="st_h">'pg_get_result'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_getlastoid'</span><span class="sy0">,</span><span class="st_h">'pg_host'</span><span class="sy0">,</span><span class="st_h">'pg_insert'</span><span class="sy0">,</span><span class="st_h">'pg_last_error'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_last_notice'</span><span class="sy0">,</span><span class="st_h">'pg_last_oid'</span><span class="sy0">,</span><span class="st_h">'pg_loclose'</span><span class="sy0">,</span><span class="st_h">'pg_locreate'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_loexport'</span><span class="sy0">,</span><span class="st_h">'pg_loimport'</span><span class="sy0">,</span><span class="st_h">'pg_loopen'</span><span class="sy0">,</span><span class="st_h">'pg_loread'</span><span class="sy0">,</span><span class="st_h">'pg_loreadall'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_lounlink'</span><span class="sy0">,</span><span class="st_h">'pg_lowrite'</span><span class="sy0">,</span><span class="st_h">'pg_lo_close'</span><span class="sy0">,</span><span class="st_h">'pg_lo_create'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_lo_export'</span><span class="sy0">,</span><span class="st_h">'pg_lo_import'</span><span class="sy0">,</span><span class="st_h">'pg_lo_open'</span><span class="sy0">,</span><span class="st_h">'pg_lo_read'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_lo_read_all'</span><span class="sy0">,</span><span class="st_h">'pg_lo_seek'</span><span class="sy0">,</span><span class="st_h">'pg_lo_tell'</span><span class="sy0">,</span><span class="st_h">'pg_lo_unlink'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_lo_write'</span><span class="sy0">,</span><span class="st_h">'pg_meta_data'</span><span class="sy0">,</span><span class="st_h">'pg_numfields'</span><span class="sy0">,</span><span class="st_h">'pg_numrows'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_num_fields'</span><span class="sy0">,</span><span class="st_h">'pg_num_rows'</span><span class="sy0">,</span><span class="st_h">'pg_options'</span><span class="sy0">,</span><span class="st_h">'pg_parameter_status'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_pconnect'</span><span class="sy0">,</span><span class="st_h">'pg_ping'</span><span class="sy0">,</span><span class="st_h">'pg_port'</span><span class="sy0">,</span><span class="st_h">'pg_prepare'</span><span class="sy0">,</span><span class="st_h">'pg_put_line'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_query'</span><span class="sy0">,</span><span class="st_h">'pg_query_params'</span><span class="sy0">,</span><span class="st_h">'pg_result'</span><span class="sy0">,</span><span class="st_h">'pg_result_error'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_result_error_field'</span><span class="sy0">,</span><span class="st_h">'pg_result_seek'</span><span class="sy0">,</span><span class="st_h">'pg_result_status'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_select'</span><span class="sy0">,</span><span class="st_h">'pg_send_execute'</span><span class="sy0">,</span><span class="st_h">'pg_send_prepare'</span><span class="sy0">,</span><span class="st_h">'pg_send_query'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_send_query_params'</span><span class="sy0">,</span><span class="st_h">'pg_set_client_encoding'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_set_error_verbosity'</span><span class="sy0">,</span><span class="st_h">'pg_setclientencoding'</span><span class="sy0">,</span><span class="st_h">'pg_trace'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_transaction_status'</span><span class="sy0">,</span><span class="st_h">'pg_tty'</span><span class="sy0">,</span><span class="st_h">'pg_unescape_bytea'</span><span class="sy0">,</span><span class="st_h">'pg_untrace'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pg_update'</span><span class="sy0">,</span><span class="st_h">'pg_version'</span><span class="sy0">,</span><span class="st_h">'php_egg_logo_guid'</span><span class="sy0">,</span><span class="st_h">'php_ini_loaded_file'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'php_ini_scanned_files'</span><span class="sy0">,</span><span class="st_h">'php_logo_guid'</span><span class="sy0">,</span><span class="st_h">'php_real_logo_guid'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'php_sapi_name'</span><span class="sy0">,</span><span class="st_h">'php_strip_whitespace'</span><span class="sy0">,</span><span class="st_h">'php_uname'</span><span class="sy0">,</span><span class="st_h">'phpcredits'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'phpdoc_xml_from_string'</span><span class="sy0">,</span><span class="st_h">'phpinfo'</span><span class="sy0">,</span><span class="st_h">'phpversion'</span><span class="sy0">,</span><span class="st_h">'pi'</span><span class="sy0">,</span><span class="st_h">'png2wbmp'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pop3_close'</span><span class="sy0">,</span><span class="st_h">'pop3_delete_message'</span><span class="sy0">,</span><span class="st_h">'pop3_get_account_size'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pop3_get_message'</span><span class="sy0">,</span><span class="st_h">'pop3_get_message_count'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pop3_get_message_header'</span><span class="sy0">,</span><span class="st_h">'pop3_get_message_ids'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pop3_get_message_size'</span><span class="sy0">,</span><span class="st_h">'pop3_get_message_sizes'</span><span class="sy0">,</span><span class="st_h">'pop3_open'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'pop3_undelete'</span><span class="sy0">,</span><span class="st_h">'popen'</span><span class="sy0">,</span><span class="st_h">'pos'</span><span class="sy0">,</span><span class="st_h">'posix_ctermid'</span><span class="sy0">,</span><span class="st_h">'posix_errno'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_getcwd'</span><span class="sy0">,</span><span class="st_h">'posix_getegid'</span><span class="sy0">,</span><span class="st_h">'posix_geteuid'</span><span class="sy0">,</span><span class="st_h">'posix_getgid'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_getgrgid'</span><span class="sy0">,</span><span class="st_h">'posix_getgrnam'</span><span class="sy0">,</span><span class="st_h">'posix_getgroups'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_getlogin'</span><span class="sy0">,</span><span class="st_h">'posix_getpgid'</span><span class="sy0">,</span><span class="st_h">'posix_getpgrp'</span><span class="sy0">,</span><span class="st_h">'posix_getpid'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_getppid'</span><span class="sy0">,</span><span class="st_h">'posix_getpwnam'</span><span class="sy0">,</span><span class="st_h">'posix_getpwuid'</span><span class="sy0">,</span><span class="st_h">'posix_getrlimit'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_getsid'</span><span class="sy0">,</span><span class="st_h">'posix_getuid'</span><span class="sy0">,</span><span class="st_h">'posix_get_last_error'</span><span class="sy0">,</span><span class="st_h">'posix_isatty'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_kill'</span><span class="sy0">,</span><span class="st_h">'posix_mkfifo'</span><span class="sy0">,</span><span class="st_h">'posix_setegid'</span><span class="sy0">,</span><span class="st_h">'posix_seteuid'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_setgid'</span><span class="sy0">,</span><span class="st_h">'posix_setpgid'</span><span class="sy0">,</span><span class="st_h">'posix_setsid'</span><span class="sy0">,</span><span class="st_h">'posix_setuid'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'posix_strerror'</span><span class="sy0">,</span><span class="st_h">'posix_times'</span><span class="sy0">,</span><span class="st_h">'posix_ttyname'</span><span class="sy0">,</span><span class="st_h">'posix_uname'</span><span class="sy0">,</span><span class="st_h">'pow'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'preg_grep'</span><span class="sy0">,</span><span class="st_h">'preg_last_error'</span><span class="sy0">,</span><span class="st_h">'preg_match'</span><span class="sy0">,</span><span class="st_h">'preg_match_all'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'preg_quote'</span><span class="sy0">,</span><span class="st_h">'preg_replace'</span><span class="sy0">,</span><span class="st_h">'preg_replace_callback'</span><span class="sy0">,</span><span class="st_h">'preg_split'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'prev'</span><span class="sy0">,</span><span class="st_h">'print_r'</span><span class="sy0">,</span><span class="st_h">'printf'</span><span class="sy0">,</span><span class="st_h">'proc_close'</span><span class="sy0">,</span><span class="st_h">'proc_get_status'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'proc_open'</span><span class="sy0">,</span><span class="st_h">'proc_terminate'</span><span class="sy0">,</span><span class="st_h">'putenv'</span><span class="sy0">,</span><span class="st_h">'quoted_printable_decode'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'quotemeta'</span><span class="sy0">,</span><span class="st_h">'rad2deg'</span><span class="sy0">,</span><span class="st_h">'radius_acct_open'</span><span class="sy0">,</span><span class="st_h">'radius_add_server'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_auth_open'</span><span class="sy0">,</span><span class="st_h">'radius_close'</span><span class="sy0">,</span><span class="st_h">'radius_config'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_create_request'</span><span class="sy0">,</span><span class="st_h">'radius_cvt_addr'</span><span class="sy0">,</span><span class="st_h">'radius_cvt_int'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_cvt_string'</span><span class="sy0">,</span><span class="st_h">'radius_demangle'</span><span class="sy0">,</span><span class="st_h">'radius_demangle_mppe_key'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_get_attr'</span><span class="sy0">,</span><span class="st_h">'radius_get_vendor_attr'</span><span class="sy0">,</span><span class="st_h">'radius_put_addr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_put_attr'</span><span class="sy0">,</span><span class="st_h">'radius_put_int'</span><span class="sy0">,</span><span class="st_h">'radius_put_string'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_put_vendor_addr'</span><span class="sy0">,</span><span class="st_h">'radius_put_vendor_attr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_put_vendor_int'</span><span class="sy0">,</span><span class="st_h">'radius_put_vendor_string'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_request_authenticator'</span><span class="sy0">,</span><span class="st_h">'radius_send_request'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'radius_server_secret'</span><span class="sy0">,</span><span class="st_h">'radius_strerror'</span><span class="sy0">,</span><span class="st_h">'rand'</span><span class="sy0">,</span><span class="st_h">'range'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'rawurldecode'</span><span class="sy0">,</span><span class="st_h">'rawurlencode'</span><span class="sy0">,</span><span class="st_h">'read_exif_data'</span><span class="sy0">,</span><span class="st_h">'readdir'</span><span class="sy0">,</span><span class="st_h">'readfile'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'readgzfile'</span><span class="sy0">,</span><span class="st_h">'readlink'</span><span class="sy0">,</span><span class="st_h">'realpath'</span><span class="sy0">,</span><span class="st_h">'reg_close_key'</span><span class="sy0">,</span><span class="st_h">'reg_create_key'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'reg_enum_key'</span><span class="sy0">,</span><span class="st_h">'reg_enum_value'</span><span class="sy0">,</span><span class="st_h">'reg_get_value'</span><span class="sy0">,</span><span class="st_h">'reg_open_key'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'reg_set_value'</span><span class="sy0">,</span><span class="st_h">'register_shutdown_function'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'register_tick_function'</span><span class="sy0">,</span><span class="st_h">'rename'</span><span class="sy0">,</span><span class="st_h">'res_close'</span><span class="sy0">,</span><span class="st_h">'res_get'</span><span class="sy0">,</span><span class="st_h">'res_list'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'res_list_type'</span><span class="sy0">,</span><span class="st_h">'res_open'</span><span class="sy0">,</span><span class="st_h">'res_set'</span><span class="sy0">,</span><span class="st_h">'reset'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'restore_error_handler'</span><span class="sy0">,</span><span class="st_h">'restore_include_path'</span><span class="sy0">,</span><span class="st_h">'rewind'</span><span class="sy0">,</span><span class="st_h">'rewinddir'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'rmdir'</span><span class="sy0">,</span><span class="st_h">'round'</span><span class="sy0">,</span><span class="st_h">'rsort'</span><span class="sy0">,</span><span class="st_h">'rtrim'</span><span class="sy0">,</span><span class="st_h">'runkit_class_adopt'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_class_emancipate'</span><span class="sy0">,</span><span class="st_h">'runkit_constant_add'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_constant_redefine'</span><span class="sy0">,</span><span class="st_h">'runkit_constant_remove'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_default_property_add'</span><span class="sy0">,</span><span class="st_h">'runkit_function_add'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_function_copy'</span><span class="sy0">,</span><span class="st_h">'runkit_function_redefine'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_function_remove'</span><span class="sy0">,</span><span class="st_h">'runkit_function_rename'</span><span class="sy0">,</span><span class="st_h">'runkit_import'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_lint'</span><span class="sy0">,</span><span class="st_h">'runkit_lint_file'</span><span class="sy0">,</span><span class="st_h">'runkit_method_add'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_method_copy'</span><span class="sy0">,</span><span class="st_h">'runkit_method_redefine'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_method_remove'</span><span class="sy0">,</span><span class="st_h">'runkit_method_rename'</span><span class="sy0">,</span><span class="st_h">'runkit_object_id'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_return_value_used'</span><span class="sy0">,</span><span class="st_h">'runkit_sandbox_output_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'runkit_superglobals'</span><span class="sy0">,</span><span class="st_h">'runkit_zval_inspect'</span><span class="sy0">,</span><span class="st_h">'scandir'</span><span class="sy0">,</span><span class="st_h">'sem_acquire'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sem_get'</span><span class="sy0">,</span><span class="st_h">'sem_release'</span><span class="sy0">,</span><span class="st_h">'sem_remove'</span><span class="sy0">,</span><span class="st_h">'serialize'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_cache_expire'</span><span class="sy0">,</span><span class="st_h">'session_cache_limiter'</span><span class="sy0">,</span><span class="st_h">'session_commit'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_decode'</span><span class="sy0">,</span><span class="st_h">'session_destroy'</span><span class="sy0">,</span><span class="st_h">'session_encode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_get_cookie_params'</span><span class="sy0">,</span><span class="st_h">'session_id'</span><span class="sy0">,</span><span class="st_h">'session_is_registered'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_module_name'</span><span class="sy0">,</span><span class="st_h">'session_name'</span><span class="sy0">,</span><span class="st_h">'session_regenerate_id'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_register'</span><span class="sy0">,</span><span class="st_h">'session_save_path'</span><span class="sy0">,</span><span class="st_h">'session_set_cookie_params'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_set_save_handler'</span><span class="sy0">,</span><span class="st_h">'session_start'</span><span class="sy0">,</span><span class="st_h">'session_unregister'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'session_unset'</span><span class="sy0">,</span><span class="st_h">'session_write_close'</span><span class="sy0">,</span><span class="st_h">'set_content'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'set_error_handler'</span><span class="sy0">,</span><span class="st_h">'set_file_buffer'</span><span class="sy0">,</span><span class="st_h">'set_include_path'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'set_magic_quotes_runtime'</span><span class="sy0">,</span><span class="st_h">'set_socket_blocking'</span><span class="sy0">,</span><span class="st_h">'set_time_limit'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'setcookie'</span><span class="sy0">,</span><span class="st_h">'setlocale'</span><span class="sy0">,</span><span class="st_h">'setrawcookie'</span><span class="sy0">,</span><span class="st_h">'settype'</span><span class="sy0">,</span><span class="st_h">'sha1'</span><span class="sy0">,</span><span class="st_h">'sha1_file'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'shell_exec'</span><span class="sy0">,</span><span class="st_h">'shmop_close'</span><span class="sy0">,</span><span class="st_h">'shmop_delete'</span><span class="sy0">,</span><span class="st_h">'shmop_open'</span><span class="sy0">,</span><span class="st_h">'shmop_read'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'shmop_size'</span><span class="sy0">,</span><span class="st_h">'shmop_write'</span><span class="sy0">,</span><span class="st_h">'shm_attach'</span><span class="sy0">,</span><span class="st_h">'shm_detach'</span><span class="sy0">,</span><span class="st_h">'shm_get_var'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'shm_put_var'</span><span class="sy0">,</span><span class="st_h">'shm_remove'</span><span class="sy0">,</span><span class="st_h">'shm_remove_var'</span><span class="sy0">,</span><span class="st_h">'show_source'</span><span class="sy0">,</span><span class="st_h">'shuffle'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'similar_text'</span><span class="sy0">,</span><span class="st_h">'simplexml_import_dom'</span><span class="sy0">,</span><span class="st_h">'simplexml_load_file'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'simplexml_load_string'</span><span class="sy0">,</span><span class="st_h">'sin'</span><span class="sy0">,</span><span class="st_h">'sinh'</span><span class="sy0">,</span><span class="st_h">'sizeof'</span><span class="sy0">,</span><span class="st_h">'sleep'</span><span class="sy0">,</span><span class="st_h">'smtp_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'smtp_cmd_data'</span><span class="sy0">,</span><span class="st_h">'smtp_cmd_mail'</span><span class="sy0">,</span><span class="st_h">'smtp_cmd_rcpt'</span><span class="sy0">,</span><span class="st_h">'smtp_connect'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'snmp_get_quick_print'</span><span class="sy0">,</span><span class="st_h">'snmp_get_valueretrieval'</span><span class="sy0">,</span><span class="st_h">'snmp_read_mib'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'snmp_set_quick_print'</span><span class="sy0">,</span><span class="st_h">'snmp_set_valueretrieval'</span><span class="sy0">,</span><span class="st_h">'snmp2_get'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'snmp2_getnext'</span><span class="sy0">,</span><span class="st_h">'snmp2_real_walk'</span><span class="sy0">,</span><span class="st_h">'snmp2_set'</span><span class="sy0">,</span><span class="st_h">'snmp2_walk'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'snmp3_get'</span><span class="sy0">,</span><span class="st_h">'snmp3_getnext'</span><span class="sy0">,</span><span class="st_h">'snmp3_real_walk'</span><span class="sy0">,</span><span class="st_h">'snmp3_set'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'snmp3_walk'</span><span class="sy0">,</span><span class="st_h">'snmpget'</span><span class="sy0">,</span><span class="st_h">'snmpgetnext'</span><span class="sy0">,</span><span class="st_h">'snmprealwalk'</span><span class="sy0">,</span><span class="st_h">'snmpset'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'snmpwalk'</span><span class="sy0">,</span><span class="st_h">'snmpwalkoid'</span><span class="sy0">,</span><span class="st_h">'socket_accept'</span><span class="sy0">,</span><span class="st_h">'socket_bind'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_clear_error'</span><span class="sy0">,</span><span class="st_h">'socket_close'</span><span class="sy0">,</span><span class="st_h">'socket_connect'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_create'</span><span class="sy0">,</span><span class="st_h">'socket_create_listen'</span><span class="sy0">,</span><span class="st_h">'socket_create_pair'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_getopt'</span><span class="sy0">,</span><span class="st_h">'socket_getpeername'</span><span class="sy0">,</span><span class="st_h">'socket_getsockname'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_get_option'</span><span class="sy0">,</span><span class="st_h">'socket_get_status'</span><span class="sy0">,</span><span class="st_h">'socket_iovec_add'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_iovec_alloc'</span><span class="sy0">,</span><span class="st_h">'socket_iovec_delete'</span><span class="sy0">,</span><span class="st_h">'socket_iovec_fetch'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_iovec_free'</span><span class="sy0">,</span><span class="st_h">'socket_iovec_set'</span><span class="sy0">,</span><span class="st_h">'socket_last_error'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_listen'</span><span class="sy0">,</span><span class="st_h">'socket_read'</span><span class="sy0">,</span><span class="st_h">'socket_readv'</span><span class="sy0">,</span><span class="st_h">'socket_recv'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_recvfrom'</span><span class="sy0">,</span><span class="st_h">'socket_recvmsg'</span><span class="sy0">,</span><span class="st_h">'socket_select'</span><span class="sy0">,</span><span class="st_h">'socket_send'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_sendmsg'</span><span class="sy0">,</span><span class="st_h">'socket_sendto'</span><span class="sy0">,</span><span class="st_h">'socket_setopt'</span><span class="sy0">,</span><span class="st_h">'socket_set_block'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_set_blocking'</span><span class="sy0">,</span><span class="st_h">'socket_set_nonblock'</span><span class="sy0">,</span><span class="st_h">'socket_set_option'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_set_timeout'</span><span class="sy0">,</span><span class="st_h">'socket_shutdown'</span><span class="sy0">,</span><span class="st_h">'socket_strerror'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'socket_write'</span><span class="sy0">,</span><span class="st_h">'socket_writev'</span><span class="sy0">,</span><span class="st_h">'sort'</span><span class="sy0">,</span><span class="st_h">'soundex'</span><span class="sy0">,</span><span class="st_h">'spl_autoload'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'spl_autoload_call'</span><span class="sy0">,</span><span class="st_h">'spl_autoload_extensions'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'spl_autoload_functions'</span><span class="sy0">,</span><span class="st_h">'spl_autoload_register'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'spl_autoload_unregister'</span><span class="sy0">,</span><span class="st_h">'spl_classes'</span><span class="sy0">,</span><span class="st_h">'spl_object_hash'</span><span class="sy0">,</span><span class="st_h">'split'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'spliti'</span><span class="sy0">,</span><span class="st_h">'sprintf'</span><span class="sy0">,</span><span class="st_h">'sql_regcase'</span><span class="sy0">,</span><span class="st_h">'sqlite_array_query'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_busy_timeout'</span><span class="sy0">,</span><span class="st_h">'sqlite_changes'</span><span class="sy0">,</span><span class="st_h">'sqlite_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_column'</span><span class="sy0">,</span><span class="st_h">'sqlite_create_aggregate'</span><span class="sy0">,</span><span class="st_h">'sqlite_create_function'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_current'</span><span class="sy0">,</span><span class="st_h">'sqlite_error_string'</span><span class="sy0">,</span><span class="st_h">'sqlite_escape_string'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_exec'</span><span class="sy0">,</span><span class="st_h">'sqlite_factory'</span><span class="sy0">,</span><span class="st_h">'sqlite_fetch_all'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_fetch_array'</span><span class="sy0">,</span><span class="st_h">'sqlite_fetch_column_types'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_fetch_object'</span><span class="sy0">,</span><span class="st_h">'sqlite_fetch_single'</span><span class="sy0">,</span><span class="st_h">'sqlite_fetch_string'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_field_name'</span><span class="sy0">,</span><span class="st_h">'sqlite_has_more'</span><span class="sy0">,</span><span class="st_h">'sqlite_has_prev'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_last_error'</span><span class="sy0">,</span><span class="st_h">'sqlite_last_insert_rowid'</span><span class="sy0">,</span><span class="st_h">'sqlite_libencoding'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_libversion'</span><span class="sy0">,</span><span class="st_h">'sqlite_next'</span><span class="sy0">,</span><span class="st_h">'sqlite_num_fields'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_num_rows'</span><span class="sy0">,</span><span class="st_h">'sqlite_open'</span><span class="sy0">,</span><span class="st_h">'sqlite_popen'</span><span class="sy0">,</span><span class="st_h">'sqlite_prev'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_query'</span><span class="sy0">,</span><span class="st_h">'sqlite_rewind'</span><span class="sy0">,</span><span class="st_h">'sqlite_seek'</span><span class="sy0">,</span><span class="st_h">'sqlite_single_query'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_udf_decode_binary'</span><span class="sy0">,</span><span class="st_h">'sqlite_udf_encode_binary'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sqlite_unbuffered_query'</span><span class="sy0">,</span><span class="st_h">'sqlite_valid'</span><span class="sy0">,</span><span class="st_h">'sqrt'</span><span class="sy0">,</span><span class="st_h">'srand'</span><span class="sy0">,</span><span class="st_h">'sscanf'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_auth_hostbased_file'</span><span class="sy0">,</span><span class="st_h">'ssh2_auth_none'</span><span class="sy0">,</span><span class="st_h">'ssh2_auth_password'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_auth_pubkey_file'</span><span class="sy0">,</span><span class="st_h">'ssh2_connect'</span><span class="sy0">,</span><span class="st_h">'ssh2_exec'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_fetch_stream'</span><span class="sy0">,</span><span class="st_h">'ssh2_fingerprint'</span><span class="sy0">,</span><span class="st_h">'ssh2_forward_accept'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_forward_listen'</span><span class="sy0">,</span><span class="st_h">'ssh2_methods_negotiated'</span><span class="sy0">,</span><span class="st_h">'ssh2_poll'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_publickey_add'</span><span class="sy0">,</span><span class="st_h">'ssh2_publickey_init'</span><span class="sy0">,</span><span class="st_h">'ssh2_publickey_list'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_publickey_remove'</span><span class="sy0">,</span><span class="st_h">'ssh2_scp_recv'</span><span class="sy0">,</span><span class="st_h">'ssh2_scp_send'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_sftp_lstat'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp_mkdir'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp_readlink'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_sftp_realpath'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp_rename'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp_rmdir'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_sftp_stat'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp_symlink'</span><span class="sy0">,</span><span class="st_h">'ssh2_sftp_unlink'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ssh2_shell'</span><span class="sy0">,</span><span class="st_h">'ssh2_tunnel'</span><span class="sy0">,</span><span class="st_h">'stat'</span><span class="sy0">,</span><span class="st_h">'stats_absolute_deviation'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_beta'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_binomial'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_cauchy'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_chisquare'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_exponential'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_f'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_gamma'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_laplace'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_logistic'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_negative_binomial'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_noncentral_chisquare'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_noncentral_f'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_noncentral_t'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_normal'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_poisson'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_t'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_cdf_uniform'</span><span class="sy0">,</span><span class="st_h">'stats_cdf_weibull'</span><span class="sy0">,</span><span class="st_h">'stats_covariance'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_dens_beta'</span><span class="sy0">,</span><span class="st_h">'stats_dens_cauchy'</span><span class="sy0">,</span><span class="st_h">'stats_dens_chisquare'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_dens_exponential'</span><span class="sy0">,</span><span class="st_h">'stats_dens_f'</span><span class="sy0">,</span><span class="st_h">'stats_dens_gamma'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_dens_laplace'</span><span class="sy0">,</span><span class="st_h">'stats_dens_logistic'</span><span class="sy0">,</span><span class="st_h">'stats_dens_normal'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_dens_pmf_binomial'</span><span class="sy0">,</span><span class="st_h">'stats_dens_pmf_hypergeometric'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_dens_pmf_negative_binomial'</span><span class="sy0">,</span><span class="st_h">'stats_dens_pmf_poisson'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_dens_t'</span><span class="sy0">,</span><span class="st_h">'stats_dens_uniform'</span><span class="sy0">,</span><span class="st_h">'stats_dens_weibull'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_harmonic_mean'</span><span class="sy0">,</span><span class="st_h">'stats_kurtosis'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_beta'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_gen_chisquare'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_exponential'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_gen_f'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_funiform'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_gamma'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_gen_ipoisson'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_iuniform'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_gen_noncenral_f'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_noncentral_chisquare'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_gen_noncentral_t'</span><span class="sy0">,</span><span class="st_h">'stats_rand_gen_normal'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_gen_t'</span><span class="sy0">,</span><span class="st_h">'stats_rand_getsd'</span><span class="sy0">,</span><span class="st_h">'stats_rand_ibinomial'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_ibinomial_negative'</span><span class="sy0">,</span><span class="st_h">'stats_rand_ignlgi'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_rand_phrase_to_seeds'</span><span class="sy0">,</span><span class="st_h">'stats_rand_ranf'</span><span class="sy0">,</span><span class="st_h">'stats_rand_setall'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_skew'</span><span class="sy0">,</span><span class="st_h">'stats_standard_deviation'</span><span class="sy0">,</span><span class="st_h">'stats_stat_binomial_coef'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_stat_correlation'</span><span class="sy0">,</span><span class="st_h">'stats_stat_factorial'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_stat_independent_t'</span><span class="sy0">,</span><span class="st_h">'stats_stat_innerproduct'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_stat_paired_t'</span><span class="sy0">,</span><span class="st_h">'stats_stat_percentile'</span><span class="sy0">,</span><span class="st_h">'stats_stat_powersum'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stats_variance'</span><span class="sy0">,</span><span class="st_h">'strcasecmp'</span><span class="sy0">,</span><span class="st_h">'strchr'</span><span class="sy0">,</span><span class="st_h">'strcmp'</span><span class="sy0">,</span><span class="st_h">'strcoll'</span><span class="sy0">,</span><span class="st_h">'strcspn'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_bucket_append'</span><span class="sy0">,</span><span class="st_h">'stream_bucket_make_writeable'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_bucket_new'</span><span class="sy0">,</span><span class="st_h">'stream_bucket_prepend'</span><span class="sy0">,</span><span class="st_h">'stream_context_create'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_context_get_default'</span><span class="sy0">,</span><span class="st_h">'stream_context_get_options'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_context_set_default'</span><span class="sy0">,</span><span class="st_h">'stream_context_set_option'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_context_set_params'</span><span class="sy0">,</span><span class="st_h">'stream_copy_to_stream'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_encoding'</span><span class="sy0">,</span><span class="st_h">'stream_filter_append'</span><span class="sy0">,</span><span class="st_h">'stream_filter_prepend'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_filter_register'</span><span class="sy0">,</span><span class="st_h">'stream_filter_remove'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_get_contents'</span><span class="sy0">,</span><span class="st_h">'stream_get_filters'</span><span class="sy0">,</span><span class="st_h">'stream_get_line'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_get_meta_data'</span><span class="sy0">,</span><span class="st_h">'stream_get_transports'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_get_wrappers'</span><span class="sy0">,</span><span class="st_h">'stream_is_local'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_notification_callback'</span><span class="sy0">,</span><span class="st_h">'stream_register_wrapper'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_resolve_include_path'</span><span class="sy0">,</span><span class="st_h">'stream_select'</span><span class="sy0">,</span><span class="st_h">'stream_set_blocking'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_set_timeout'</span><span class="sy0">,</span><span class="st_h">'stream_set_write_buffer'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_socket_accept'</span><span class="sy0">,</span><span class="st_h">'stream_socket_client'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_socket_enable_crypto'</span><span class="sy0">,</span><span class="st_h">'stream_socket_get_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_socket_pair'</span><span class="sy0">,</span><span class="st_h">'stream_socket_recvfrom'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_socket_sendto'</span><span class="sy0">,</span><span class="st_h">'stream_socket_server'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_socket_shutdown'</span><span class="sy0">,</span><span class="st_h">'stream_supports_lock'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_wrapper_register'</span><span class="sy0">,</span><span class="st_h">'stream_wrapper_restore'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stream_wrapper_unregister'</span><span class="sy0">,</span><span class="st_h">'strftime'</span><span class="sy0">,</span><span class="st_h">'stripcslashes'</span><span class="sy0">,</span><span class="st_h">'stripos'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'stripslashes'</span><span class="sy0">,</span><span class="st_h">'strip_tags'</span><span class="sy0">,</span><span class="st_h">'stristr'</span><span class="sy0">,</span><span class="st_h">'strlen'</span><span class="sy0">,</span><span class="st_h">'strnatcasecmp'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'strnatcmp'</span><span class="sy0">,</span><span class="st_h">'strpbrk'</span><span class="sy0">,</span><span class="st_h">'strncasecmp'</span><span class="sy0">,</span><span class="st_h">'strncmp'</span><span class="sy0">,</span><span class="st_h">'strpos'</span><span class="sy0">,</span><span class="st_h">'strrchr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'strrev'</span><span class="sy0">,</span><span class="st_h">'strripos'</span><span class="sy0">,</span><span class="st_h">'strrpos'</span><span class="sy0">,</span><span class="st_h">'strspn'</span><span class="sy0">,</span><span class="st_h">'strstr'</span><span class="sy0">,</span><span class="st_h">'strtok'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'strtolower'</span><span class="sy0">,</span><span class="st_h">'strtotime'</span><span class="sy0">,</span><span class="st_h">'strtoupper'</span><span class="sy0">,</span><span class="st_h">'strtr'</span><span class="sy0">,</span><span class="st_h">'strval'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'str_ireplace'</span><span class="sy0">,</span><span class="st_h">'str_pad'</span><span class="sy0">,</span><span class="st_h">'str_repeat'</span><span class="sy0">,</span><span class="st_h">'str_replace'</span><span class="sy0">,</span><span class="st_h">'str_rot13'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'str_split'</span><span class="sy0">,</span><span class="st_h">'str_shuffle'</span><span class="sy0">,</span><span class="st_h">'str_word_count'</span><span class="sy0">,</span><span class="st_h">'substr'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'substr_compare'</span><span class="sy0">,</span><span class="st_h">'substr_count'</span><span class="sy0">,</span><span class="st_h">'substr_replace'</span><span class="sy0">,</span><span class="st_h">'svn_add'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_auth_get_parameter'</span><span class="sy0">,</span><span class="st_h">'svn_auth_set_parameter'</span><span class="sy0">,</span><span class="st_h">'svn_cat'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_checkout'</span><span class="sy0">,</span><span class="st_h">'svn_cleanup'</span><span class="sy0">,</span><span class="st_h">'svn_client_version'</span><span class="sy0">,</span><span class="st_h">'svn_commit'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_diff'</span><span class="sy0">,</span><span class="st_h">'svn_export'</span><span class="sy0">,</span><span class="st_h">'svn_fs_abort_txn'</span><span class="sy0">,</span><span class="st_h">'svn_fs_apply_text'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_begin_txn2'</span><span class="sy0">,</span><span class="st_h">'svn_fs_change_node_prop'</span><span class="sy0">,</span><span class="st_h">'svn_fs_check_path'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_contents_changed'</span><span class="sy0">,</span><span class="st_h">'svn_fs_copy'</span><span class="sy0">,</span><span class="st_h">'svn_fs_delete'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_dir_entries'</span><span class="sy0">,</span><span class="st_h">'svn_fs_file_contents'</span><span class="sy0">,</span><span class="st_h">'svn_fs_file_length'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_is_dir'</span><span class="sy0">,</span><span class="st_h">'svn_fs_is_file'</span><span class="sy0">,</span><span class="st_h">'svn_fs_make_dir'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_make_file'</span><span class="sy0">,</span><span class="st_h">'svn_fs_node_created_rev'</span><span class="sy0">,</span><span class="st_h">'svn_fs_node_prop'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_props_changed'</span><span class="sy0">,</span><span class="st_h">'svn_fs_revision_prop'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_fs_revision_root'</span><span class="sy0">,</span><span class="st_h">'svn_fs_txn_root'</span><span class="sy0">,</span><span class="st_h">'svn_fs_youngest_rev'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_import'</span><span class="sy0">,</span><span class="st_h">'svn_info'</span><span class="sy0">,</span><span class="st_h">'svn_log'</span><span class="sy0">,</span><span class="st_h">'svn_ls'</span><span class="sy0">,</span><span class="st_h">'svn_repos_create'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_repos_fs'</span><span class="sy0">,</span><span class="st_h">'svn_repos_fs_begin_txn_for_commit'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_repos_fs_commit_txn'</span><span class="sy0">,</span><span class="st_h">'svn_repos_hotcopy'</span><span class="sy0">,</span><span class="st_h">'svn_repos_open'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'svn_repos_recover'</span><span class="sy0">,</span><span class="st_h">'svn_status'</span><span class="sy0">,</span><span class="st_h">'svn_update'</span><span class="sy0">,</span><span class="st_h">'symlink'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'sys_get_temp_dir'</span><span class="sy0">,</span><span class="st_h">'syslog'</span><span class="sy0">,</span><span class="st_h">'system'</span><span class="sy0">,</span><span class="st_h">'tan'</span><span class="sy0">,</span><span class="st_h">'tanh'</span><span class="sy0">,</span><span class="st_h">'tempnam'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'textdomain'</span><span class="sy0">,</span><span class="st_h">'thread_get'</span><span class="sy0">,</span><span class="st_h">'thread_include'</span><span class="sy0">,</span><span class="st_h">'thread_lock'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'thread_lock_try'</span><span class="sy0">,</span><span class="st_h">'thread_mutex_destroy'</span><span class="sy0">,</span><span class="st_h">'thread_mutex_init'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'thread_set'</span><span class="sy0">,</span><span class="st_h">'thread_start'</span><span class="sy0">,</span><span class="st_h">'thread_unlock'</span><span class="sy0">,</span><span class="st_h">'tidy_access_count'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_clean_repair'</span><span class="sy0">,</span><span class="st_h">'tidy_config_count'</span><span class="sy0">,</span><span class="st_h">'tidy_diagnose'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_error_count'</span><span class="sy0">,</span><span class="st_h">'tidy_get_body'</span><span class="sy0">,</span><span class="st_h">'tidy_get_config'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_get_error_buffer'</span><span class="sy0">,</span><span class="st_h">'tidy_get_head'</span><span class="sy0">,</span><span class="st_h">'tidy_get_html'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_get_html_ver'</span><span class="sy0">,</span><span class="st_h">'tidy_get_output'</span><span class="sy0">,</span><span class="st_h">'tidy_get_release'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_get_root'</span><span class="sy0">,</span><span class="st_h">'tidy_get_status'</span><span class="sy0">,</span><span class="st_h">'tidy_getopt'</span><span class="sy0">,</span><span class="st_h">'tidy_is_xhtml'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_is_xml'</span><span class="sy0">,</span><span class="st_h">'tidy_parse_file'</span><span class="sy0">,</span><span class="st_h">'tidy_parse_string'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'tidy_repair_file'</span><span class="sy0">,</span><span class="st_h">'tidy_repair_string'</span><span class="sy0">,</span><span class="st_h">'tidy_warning_count'</span><span class="sy0">,</span><span class="st_h">'time'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'timezone_abbreviations_list'</span><span class="sy0">,</span><span class="st_h">'timezone_identifiers_list'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'timezone_name_from_abbr'</span><span class="sy0">,</span><span class="st_h">'timezone_name_get'</span><span class="sy0">,</span><span class="st_h">'timezone_offset_get'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'timezone_open'</span><span class="sy0">,</span><span class="st_h">'timezone_transitions_get'</span><span class="sy0">,</span><span class="st_h">'tmpfile'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'token_get_all'</span><span class="sy0">,</span><span class="st_h">'token_name'</span><span class="sy0">,</span><span class="st_h">'touch'</span><span class="sy0">,</span><span class="st_h">'trigger_error'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'transliterate'</span><span class="sy0">,</span><span class="st_h">'transliterate_filters_get'</span><span class="sy0">,</span><span class="st_h">'trim'</span><span class="sy0">,</span><span class="st_h">'uasort'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ucfirst'</span><span class="sy0">,</span><span class="st_h">'ucwords'</span><span class="sy0">,</span><span class="st_h">'uksort'</span><span class="sy0">,</span><span class="st_h">'umask'</span><span class="sy0">,</span><span class="st_h">'uniqid'</span><span class="sy0">,</span><span class="st_h">'unixtojd'</span><span class="sy0">,</span><span class="st_h">'unlink'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'unpack'</span><span class="sy0">,</span><span class="st_h">'unregister_tick_function'</span><span class="sy0">,</span><span class="st_h">'unserialize'</span><span class="sy0">,</span><span class="st_h">'unset'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'urldecode'</span><span class="sy0">,</span><span class="st_h">'urlencode'</span><span class="sy0">,</span><span class="st_h">'user_error'</span><span class="sy0">,</span><span class="st_h">'use_soap_error_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'usleep'</span><span class="sy0">,</span><span class="st_h">'usort'</span><span class="sy0">,</span><span class="st_h">'utf8_decode'</span><span class="sy0">,</span><span class="st_h">'utf8_encode'</span><span class="sy0">,</span><span class="st_h">'var_dump'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'var_export'</span><span class="sy0">,</span><span class="st_h">'variant_abs'</span><span class="sy0">,</span><span class="st_h">'variant_add'</span><span class="sy0">,</span><span class="st_h">'variant_and'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_cast'</span><span class="sy0">,</span><span class="st_h">'variant_cat'</span><span class="sy0">,</span><span class="st_h">'variant_cmp'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_date_from_timestamp'</span><span class="sy0">,</span><span class="st_h">'variant_date_to_timestamp'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_div'</span><span class="sy0">,</span><span class="st_h">'variant_eqv'</span><span class="sy0">,</span><span class="st_h">'variant_fix'</span><span class="sy0">,</span><span class="st_h">'variant_get_type'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_idiv'</span><span class="sy0">,</span><span class="st_h">'variant_imp'</span><span class="sy0">,</span><span class="st_h">'variant_int'</span><span class="sy0">,</span><span class="st_h">'variant_mod'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_mul'</span><span class="sy0">,</span><span class="st_h">'variant_neg'</span><span class="sy0">,</span><span class="st_h">'variant_not'</span><span class="sy0">,</span><span class="st_h">'variant_or'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_pow'</span><span class="sy0">,</span><span class="st_h">'variant_round'</span><span class="sy0">,</span><span class="st_h">'variant_set'</span><span class="sy0">,</span><span class="st_h">'variant_set_type'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'variant_sub'</span><span class="sy0">,</span><span class="st_h">'variant_xor'</span><span class="sy0">,</span><span class="st_h">'version_compare'</span><span class="sy0">,</span><span class="st_h">'virtual'</span><span class="sy0">,</span><span class="st_h">'vfprintf'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'vprintf'</span><span class="sy0">,</span><span class="st_h">'vsprintf'</span><span class="sy0">,</span><span class="st_h">'wddx_add_vars'</span><span class="sy0">,</span><span class="st_h">'wddx_deserialize'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'wddx_packet_end'</span><span class="sy0">,</span><span class="st_h">'wddx_packet_start'</span><span class="sy0">,</span><span class="st_h">'wddx_serialize_value'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'wddx_serialize_vars'</span><span class="sy0">,</span><span class="st_h">'win_beep'</span><span class="sy0">,</span><span class="st_h">'win_browse_file'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win_browse_folder'</span><span class="sy0">,</span><span class="st_h">'win_create_link'</span><span class="sy0">,</span><span class="st_h">'win_message_box'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win_play_wav'</span><span class="sy0">,</span><span class="st_h">'win_shell_execute'</span><span class="sy0">,</span><span class="st_h">'win32_create_service'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_delete_service'</span><span class="sy0">,</span><span class="st_h">'win32_get_last_control_message'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_ps_list_procs'</span><span class="sy0">,</span><span class="st_h">'win32_ps_stat_mem'</span><span class="sy0">,</span><span class="st_h">'win32_ps_stat_proc'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_query_service_status'</span><span class="sy0">,</span><span class="st_h">'win32_scheduler_delete_task'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_scheduler_enum_tasks'</span><span class="sy0">,</span><span class="st_h">'win32_scheduler_get_task_info'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_scheduler_run'</span><span class="sy0">,</span><span class="st_h">'win32_scheduler_set_task_info'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_set_service_status'</span><span class="sy0">,</span><span class="st_h">'win32_start_service'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'win32_start_service_ctrl_dispatcher'</span><span class="sy0">,</span><span class="st_h">'win32_stop_service'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'wordwrap'</span><span class="sy0">,</span><span class="st_h">'xml_error_string'</span><span class="sy0">,</span><span class="st_h">'xml_get_current_byte_index'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_get_current_column_number'</span><span class="sy0">,</span><span class="st_h">'xml_get_current_line_number'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_get_error_code'</span><span class="sy0">,</span><span class="st_h">'xml_parse'</span><span class="sy0">,</span><span class="st_h">'xml_parser_create'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_parser_create_ns'</span><span class="sy0">,</span><span class="st_h">'xml_parser_free'</span><span class="sy0">,</span><span class="st_h">'xml_parser_get_option'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_parser_set_option'</span><span class="sy0">,</span><span class="st_h">'xml_parse_into_struct'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_character_data_handler'</span><span class="sy0">,</span><span class="st_h">'xml_set_default_handler'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_element_handler'</span><span class="sy0">,</span><span class="st_h">'xml_set_end_namespace_decl_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_external_entity_ref_handler'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_notation_decl_handler'</span><span class="sy0">,</span><span class="st_h">'xml_set_object'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_processing_instruction_handler'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_start_namespace_decl_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_unparsed_entity_decl_handler'</span><span class="sy0">,</span><span class="st_h">'xmldoc'</span><span class="sy0">,</span><span class="st_h">'xmldocfile'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_decode'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_decode_request'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_encode'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_encode_request'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_get_type'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_is_fault'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_parse_method_descriptions'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_server_add_introspection_data'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_server_call_method'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_server_create'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_server_destroy'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_server_register_introspection_callback'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlrpc_server_register_method'</span><span class="sy0">,</span><span class="st_h">'xmlrpc_set_type'</span><span class="sy0">,</span><span class="st_h">'xmltree'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_end_attribute'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_end_cdata'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_end_comment'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_end_document'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_end_dtd'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_end_dtd_attlist'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_end_dtd_element'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_end_dtd_entity'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_end_element'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_end_pi'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_flush'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_full_end_element'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_open_memory'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_open_uri'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_output_memory'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_set_indent'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_set_indent_string'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_start_attribute'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_start_attribute_ns'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_start_cdata'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_start_comment'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_start_document'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_start_dtd'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_start_dtd_attlist'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_start_dtd_element'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_start_dtd_entity'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_start_element'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_start_element_ns'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_start_pi'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_text'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_write_attribute'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_write_attribute_ns'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_write_cdata'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_write_comment'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_write_dtd'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_write_dtd_attlist'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_write_dtd_element'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_write_dtd_entity'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_write_element'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_write_element_ns'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xmlwriter_write_pi'</span><span class="sy0">,</span><span class="st_h">'xmlwriter_write_raw'</span><span class="sy0">,</span><span class="st_h">'xpath_eval'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xpath_eval_expression'</span><span class="sy0">,</span><span class="st_h">'xpath_new_context'</span><span class="sy0">,</span><span class="st_h">'xpath_register_ns'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xpath_register_ns_auto'</span><span class="sy0">,</span><span class="st_h">'xptr_eval'</span><span class="sy0">,</span><span class="st_h">'xptr_new_context'</span><span class="sy0">,</span><span class="st_h">'yp_all'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'yp_cat'</span><span class="sy0">,</span><span class="st_h">'yp_errno'</span><span class="sy0">,</span><span class="st_h">'yp_err_string'</span><span class="sy0">,</span><span class="st_h">'yp_first'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'yp_get_default_domain'</span><span class="sy0">,</span><span class="st_h">'yp_master'</span><span class="sy0">,</span><span class="st_h">'yp_match'</span><span class="sy0">,</span><span class="st_h">'yp_next'</span><span class="sy0">,</span><span class="st_h">'yp_order'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_current_obfuscation_level'</span><span class="sy0">,</span><span class="st_h">'zend_get_cfg_var'</span><span class="sy0">,</span><span class="st_h">'zend_get_id'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_loader_current_file'</span><span class="sy0">,</span><span class="st_h">'zend_loader_enabled'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_loader_file_encoded'</span><span class="sy0">,</span><span class="st_h">'zend_loader_file_licensed'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_loader_install_license'</span><span class="sy0">,</span><span class="st_h">'zend_loader_version'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_logo_guid'</span><span class="sy0">,</span><span class="st_h">'zend_match_hostmasks'</span><span class="sy0">,</span><span class="st_h">'zend_obfuscate_class_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_obfuscate_function_name'</span><span class="sy0">,</span><span class="st_h">'zend_optimizer_version'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zend_runtime_obfuscate'</span><span class="sy0">,</span><span class="st_h">'zend_version'</span><span class="sy0">,</span><span class="st_h">'zip_close'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zip_entry_close'</span><span class="sy0">,</span><span class="st_h">'zip_entry_compressedsize'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zip_entry_compressionmethod'</span><span class="sy0">,</span><span class="st_h">'zip_entry_filesize'</span><span class="sy0">,</span><span class="st_h">'zip_entry_name'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zip_entry_open'</span><span class="sy0">,</span><span class="st_h">'zip_entry_read'</span><span class="sy0">,</span><span class="st_h">'zip_open'</span><span class="sy0">,</span><span class="st_h">'zip_read'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zlib_get_coding_type'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'DEFAULT_INCLUDE_PATH'</span><span class="sy0">,</span> <span class="st_h">'DIRECTORY_SEPARATOR'</span><span class="sy0">,</span> <span class="st_h">'E_ALL'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_COMPILE_ERROR'</span><span class="sy0">,</span> <span class="st_h">'E_COMPILE_WARNING'</span><span class="sy0">,</span> <span class="st_h">'E_CORE_ERROR'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_CORE_WARNING'</span><span class="sy0">,</span> <span class="st_h">'E_ERROR'</span><span class="sy0">,</span> <span class="st_h">'E_NOTICE'</span><span class="sy0">,</span> <span class="st_h">'E_PARSE'</span><span class="sy0">,</span> <span class="st_h">'E_STRICT'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_USER_ERROR'</span><span class="sy0">,</span> <span class="st_h">'E_USER_NOTICE'</span><span class="sy0">,</span> <span class="st_h">'E_USER_WARNING'</span><span class="sy0">,</span> <span class="st_h">'E_WARNING'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ENT_COMPAT'</span><span class="sy0">,</span><span class="st_h">'ENT_QUOTES'</span><span class="sy0">,</span><span class="st_h">'ENT_NOQUOTES'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'false'</span><span class="sy0">,</span> <span class="st_h">'null'</span><span class="sy0">,</span> <span class="st_h">'PEAR_EXTENSION_DIR'</span><span class="sy0">,</span> <span class="st_h">'PEAR_INSTALL_DIR'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_BINDIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_CONFIG_FILE_PATH'</span><span class="sy0">,</span> <span class="st_h">'PHP_DATADIR'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_EXTENSION_DIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_LIBDIR'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_LOCALSTATEDIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_OS'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_OUTPUT_HANDLER_CONT'</span><span class="sy0">,</span> <span class="st_h">'PHP_OUTPUT_HANDLER_END'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_OUTPUT_HANDLER_START'</span><span class="sy0">,</span> <span class="st_h">'PHP_SYSCONFDIR'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_VERSION'</span><span class="sy0">,</span> <span class="st_h">'true'</span><span class="sy0">,</span> <span class="st_h">'__CLASS__'</span><span class="sy0">,</span> <span class="st_h">'__FILE__'</span><span class="sy0">,</span> <span class="st_h">'__FUNCTION__'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'__LINE__'</span><span class="sy0">,</span> <span class="st_h">'__METHOD__'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'SYMBOLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;%'</span><span class="sy0">,</span> <span class="st_h">'&lt;%='</span><span class="sy0">,</span> <span class="st_h">'%&gt;'</span><span class="sy0">,</span> <span class="st_h">'&lt;?'</span><span class="sy0">,</span> <span class="st_h">'&lt;?='</span><span class="sy0">,</span> <span class="st_h">'?&gt;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'('</span><span class="sy0">,</span> <span class="st_h">')'</span><span class="sy0">,</span> <span class="st_h">'['</span><span class="sy0">,</span> <span class="st_h">']'</span><span class="sy0">,</span> <span class="st_h">'{'</span><span class="sy0">,</span> <span class="st_h">'}'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'!'</span><span class="sy0">,</span> <span class="st_h">'@'</span><span class="sy0">,</span> <span class="st_h">'%'</span><span class="sy0">,</span> <span class="st_h">'&amp;'</span><span class="sy0">,</span> <span class="st_h">'|'</span><span class="sy0">,</span> <span class="st_h">'/'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;'</span><span class="sy0">,</span> <span class="st_h">'&gt;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'='</span><span class="sy0">,</span> <span class="st_h">'-'</span><span class="sy0">,</span> <span class="st_h">'+'</span><span class="sy0">,</span> <span class="st_h">'*'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'.'</span><span class="sy0">,</span> <span class="st_h">':'</span><span class="sy0">,</span> <span class="st_h">','</span><span class="sy0">,</span> <span class="st_h">';'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'CASE_SENSITIVE'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; GESHI_COMMENTS <span class="sy0">=&gt;</span> <span class="kw4">false</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="kw4">false</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="kw4">false</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="kw4">false</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="kw4">false</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'STYLES'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'KEYWORDS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #b1b100;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000000; font-weight: bold;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #990000;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #009900; font-weight: bold;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'COMMENTS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #666666; font-style: italic;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #666666; font-style: italic;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #0000cc; font-style: italic;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #009933; font-style: italic;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'MULTI'</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #666666; font-style: italic;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ESCAPE_CHAR'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000099; font-weight: bold;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000099; font-weight: bold;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #660099; font-weight: bold;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #660099; font-weight: bold;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #006699; font-weight: bold;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #006699; font-weight: bold; font-style: italic;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">6</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #009933; font-weight: bold;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'HARD'</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000099; font-weight: bold;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'BRACKETS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #009900;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'STRINGS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #0000ff;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'HARD'</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #0000ff;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'NUMBERS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #cc66cc;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_OCT_PREFIX <span class="sy0">=&gt;</span> <span class="st_h">'color: #208080;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_HEX_PREFIX <span class="sy0">=&gt;</span> <span class="st_h">'color: #208080;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_FLT_SCI_ZERO <span class="sy0">=&gt;</span> <span class="st_h">'color:#800080;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'METHODS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #004000;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #004000;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'SYMBOLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #339933;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000000; font-weight: bold;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'REGEXPS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000088;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'SCRIPT'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'URLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'http://www.php.net/{FNAMEL}'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'OOLANG'</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'OBJECT_SPLITTERS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'-&amp;gt;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'::'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'REGEXPS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Variables</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;[<span class="es1">\\</span>$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*&quot;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'STRICT_MODE_APPLIES'</span> <span class="sy0">=&gt;</span> GESHI_MAYBE<span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'SCRIPT_DELIMITERS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;?php'</span> <span class="sy0">=&gt;</span> <span class="st_h">'?&gt;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;?'</span> <span class="sy0">=&gt;</span> <span class="st_h">'?&gt;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;%'</span> <span class="sy0">=&gt;</span> <span class="st_h">'%&gt;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;script language=&quot;php&quot;&gt;'</span> <span class="sy0">=&gt;</span> <span class="st_h">'&lt;/script&gt;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;/(&lt;\?(?:php)?)(?:'(?:[^'<span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?'|<span class="es1">\&quot;</span>(?:[^<span class="es1">\&quot;</span><span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?<span class="es1">\&quot;</span>|\/\*(?!\*\/).*?\*\/|.)*?(\?&gt;|\Z)/sm&quot;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;/(&lt;%)(?:'(?:[^'<span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?'|<span class="es1">\&quot;</span>(?:[^<span class="es1">\&quot;</span><span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?<span class="es1">\&quot;</span>|\/\*(?!\*\/).*?\*\/|.)*?(%&gt;|\Z)/sm&quot;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'HIGHLIGHT_STRICT_BLOCK'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'TAB_WIDTH'</span> <span class="sy0">=&gt;</span> <span class="nu0">4</span>
-<span class="xtra li2"><span class="de2"><span class="br0">&#41;</span><span class="sy0">;</span></span></span>&nbsp;
-<span class="xtra li2"><span class="de2"><span class="sy1">?&gt;</span></span></span></pre></td></tr></tbody></table>
-
-<p>If you&#8217;re remotely familiar with <abbr title="PHP: HTML Preprocessor">PHP</abbr> (or even if you&#8217;re not), you can see that all that a language file consists of is
-a glorified variable assignment. Easy! All a language file does is assign a variable <code class="highlighted php"><span class="re0">$language_data</span></code>. Though
-still, there&#8217;s a lot of indices to that array&#8230; but this section is here to break each index down and explain it to you.</p>
-
-<h3 id="language-file-conventions">4.2 Language File Conventions</h3><div class="nav"><a href="#language-file-example">Previous</a> | <a href="#language-files">Top</a> | <a href="#language-file-sections">Next</a></div>
-
-<p>There are several conventions that are used in language files. For ease of use and readability, your language
-files should obey the following rules:</p>
-
-<ul>
-<li><strong>Indentation is <em>4 spaces</em>, not tabs:</strong> Use spaces! as editors continiously screw up tabs there should be
-no tabs in your documents since it would look differently on every computer otherwise.</li>
-<li><strong>Strings are in single quotes:</strong> Every string in a language file should be in single quotes (&#8216;), unless you are
-specifying a single quote as a quotemark or escape character, in which case they can be in double quotes for
-readability; or if you are specifying a REGEXP (see below). This ensures that the language file can be loaded
-as fast as possible by <abbr title="PHP: HTML Preprocessor">PHP</abbr> as unnecessary parsing can be avoided.</li>
-<li><strong>Large arrays are multi-lined:</strong> An array with more than three or four values should be broken into multiple
-lines. In any case, lines should not be wider than a full-screen window (about 100 chars per line max).
-Don&#8217;t break the keywords arrays after every keyword.</li>
-<li><strong>Ending brackets for multi-lined arrays on a new line:</strong> Also with a comma after them, unless the array is
-the last one in a parent array. See the <abbr title="PHP: HTML Preprocessor">PHP</abbr> language file for examples of where to use commas.</li>
-<li><strong>Use <abbr title="Generic Syntax Highlighter">GeSHi</abbr>&#8217;s constants:</strong> For capatalisation, regular expressions etc. use the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> constants, <em>not</em>
-their actual values.</li>
-<li><strong>Verbatim header format:</strong> Copy the file header verbatim from other language files and modify the values
-afterwards. Don&#8217;t try to invent own header formats, as your languages else will fail validation!</li>
-</ul>
-
-<p>There are more notes on each convention where it may appear in the language file sections below.</p>
-
-<h3 id="language-file-sections">4.3 Language File Sections</h3><div class="nav"><a href="#language-file-conventions">Previous</a> | <a href="#language-files">Top</a> | <a href="#language-file-header">Next</a></div>
-
-<p>This section will look at all the sections of a language file, and how they relate to the final highlighting result.</p>
-
-<h4 id="language-file-header">4.3.1 The Header</h4><div class="nav"><a href="#language-file-sections">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-start-indices">Next</a></div>
-
-<p>The <em>header</em> of a language file is the first lines with the big comment and the start of the variable
-<code class="highlighted php"><span class="re0">$language_data</span></code>:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-<span class="xtra li2"><span class="de2">28</span></span>29
-<span class="xtra li2"><span class="de2">30</span></span>31
-<span class="xtra li2"><span class="de2">32</span></span>33
-<span class="xtra li2"><span class="de2">34</span></span>35
-<span class="xtra li2"><span class="de2">36</span></span>37
-<span class="xtra li2"><span class="de2">38</span></span>39
-<span class="xtra li2"><span class="de2">40</span></span>41
-<span class="xtra li2"><span class="de2">42</span></span>43
-</pre></td><td class="de1"><pre class="de1"><span class="kw2">&lt;?php</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">/*************************************************************************************</span></span></span><span class="coMULTI">&nbsp;* &lt;name-of-language-file.php&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* ---------------------------------</span></span></span><span class="coMULTI">&nbsp;* Author: &lt;name&gt; (&lt;e-mail address&gt;)</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* Copyright: (c) 2008 &lt;name&gt; (&lt;website URL&gt;)</span></span></span><span class="coMULTI">&nbsp;* Release Version: &lt;GeSHi release&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* Date Started: &lt;date started&gt;</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &lt;name-of-language&gt; language file for GeSHi.</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &lt;any-comments...&gt;</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* CHANGES</span></span></span><span class="coMULTI">&nbsp;* -------</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &lt;date-of-release&gt; (&lt;GeSHi release&gt;)</span></span></span><span class="coMULTI">&nbsp;* &nbsp;- &nbsp;First Release</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* TODO (updated &lt;date-of-release&gt;)</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* -------------------------</span></span></span><span class="coMULTI">&nbsp;* &lt;things-to-do&gt;</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;*************************************************************************************</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* &nbsp; &nbsp; This file is part of GeSHi.</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* &nbsp; GeSHi is free software; you can redistribute it and/or modify</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; it under the terms of the GNU General Public License as published by</span></span></span><span class="coMULTI">&nbsp;* &nbsp; the Free Software Foundation; either version 2 of the License, or</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; (at your option) any later version.</span></span></span><span class="coMULTI">&nbsp;*</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; GeSHi is distributed in the hope that it will be useful,</span></span></span><span class="coMULTI">&nbsp;* &nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the</span></span></span><span class="coMULTI">&nbsp;* &nbsp; GNU General Public License for more details.</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;* &nbsp; You should have received a copy of the GNU General Public License</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;* &nbsp; along with GeSHi; if not, write to the Free Software</span></span></span><span class="coMULTI">&nbsp;* &nbsp; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA &nbsp;02111-1307 &nbsp;USA</span>
-<span class="xtra li2"><span class="de2"><span class="coMULTI">&nbsp;*</span></span></span><span class="coMULTI">&nbsp;************************************************************************************/</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="re0">$language_data</span> <span class="sy0">=</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a> <span class="br0">&#40;</span></pre></td></tr></tbody></table>
-
-<p>The parts in angle brackets are the parts that you change for your language file. <strong>Everything else <em>must</em> remain the same!</strong></p>
-
-<p>Here are the parts you should change:</p>
-
-<ul>
-<li><code>&lt;name-of-language-file.php&gt;</code> - This should become the name of your language file. Language file names are in
-lower case and contain only alphanumeric characters, dashes and underscores. Language files end with .php (which
-you should put with the name of your language file, eg language.php)</li>
-<li><code>&lt;name&gt;</code> - Your name, or alias.</li>
-<li><code>&lt;e-mail address&gt;</code> - Your e-mail address. If you want your language file included with <abbr title="Generic Syntax Highlighter">GeSHi</abbr> you <em>must</em>
-include an e-mail address that refers to an inbox controlled by you.</li>
-<li><code>&lt;website&gt;</code> - A URL of a website of yours (perhaps to a page that deals with your contribution to <abbr title="Generic Syntax Highlighter">GeSHi</abbr>, or
-your home page/blog)</li>
-<li><code>&lt;date-started&gt;</code> - The date you started working on the language file. If you can&#8217;t remember, guestimate.</li>
-<li><code>&lt;name-of-language&gt;</code> - The name of the language you made this language file for (probably similar to
-the language file name).</li>
-<li><code>&lt;any-comments&gt;</code> - Any comments you have to make about this language file, perhaps on where you got the keywords for,
-what dialect of the language this language file is for etc etc. If you don&#8217;t have any comments, remove the space for them.</li>
-<li><code>&lt;date-of-release</code> - The date you released the language file to the public. If you simply send it to me for inclusion
-in a new <abbr title="Generic Syntax Highlighter">GeSHi</abbr> and don&#8217;t release it, leave this blank, and I&#8217;ll replace it with the date of the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> release that
-it is first added to.</li>
-<li><code>&lt;GeSHi release&gt;</code> - This is the version of the release that will contain the changes you made.
-So if you have version 1.0.8 of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> running this will be the next version to be released, e.g. 1.0.8.1.</li>
-</ul>
-
-<p>Everything should remain the same.</p>
-
-<p><strong>Also:</strong> I&#8217;m not sure about the copyright on a new language file. I&#8217;m not a lawyer, could someone contact me about
-whether the copyright for a new language file should be exclusivly the authors, or joint with me (if included in a
-<abbr title="Generic Syntax Highlighter">GeSHi</abbr> release)?</p>
-
-<h4 id="language-file-start-indices">4.3.2 The First Indices</h4><div class="nav"><a href="#language-file-header">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-keywords">Next</a></div>
-
-<p>Here is an example from the php language file of the first indices:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span></pre></td><td class="de1"><pre class="de1"><span class="st_h">'LANG_NAME'</span> <span class="sy0">=&gt;</span> <span class="st_h">'PHP'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">'COMMENT_SINGLE'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'//'</span><span class="sy0">,</span> <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'#'</span><span class="br0">&#41;</span><span class="sy0">,</span></span></span><span class="st_h">'COMMENT_MULTI'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'/*'</span> <span class="sy0">=&gt;</span> <span class="st_h">'*/'</span><span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">'CASE_KEYWORDS'</span> <span class="sy0">=&gt;</span> GESHI_CAPS_NO_CHANGE<span class="sy0">,</span></span></span><span class="st_h">'QUOTEMARKS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st0">&quot;'&quot;</span><span class="sy0">,</span> <span class="st_h">'&quot;'</span><span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">'ESCAPE_CHAR'</span> <span class="sy0">=&gt;</span> <span class="st_h">'\\'</span><span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<p>The first indices are the first few lines of a language file before the KEYWORDS index. These indices specify:</p>
-
-<ul>
-<li><strong>&#8216;LANG_NAME&#8217;</strong>: The name of the language. This name should be a human-readable version of the name
-(e.g. <abbr title="Hypertext Markup Language">HTML</abbr> 4 (transitional) instead of html4trans)</li>
-<li><strong>&#8216;COMMENT_SINGLE&#8217;:</strong> An array of single-line comments in your language, indexed by integers starting
-from 1. A single line comment is a comment that starts at the marker and goes until the end of the line. These
-comments may be any length > 0, and since they can be styled individually, can be used for other things than comments
-(for example the Java language file defines &#8220;import&#8221; as a single line comment). If you are making a language that
-uses a &#8217; (apostrophe) as a comment (or in the comment marker somewhere), use double quotes. e.g.: &#8220;&#8217;&#8221;</li>
-<li><strong>&#8216;COMMENT_MULTI&#8217;:</strong> Used to specify multiline comments, an array in the form &#8216;OPEN&#8217; => &#8216;CLOSE&#8217;. Unfortunately,
-all of these comments you add here will be styled the same way (an area of improvement for <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.2.X).
-These comment markers may be any length > 0.</li>
-<li><strong>&#8216;CASE_KEYWORDS&#8217;:</strong> Used to set whether the case of keywords should be changed automatically as they are found.
-For example, in an SQL or BASIC dialect you may want all keywords to be upper case. The accepted values for this are:</li>
-<li><code>GESHI_CAPS_UPPER</code>: Convert the case of all keywords to upper case.</li>
-<li><code>GESHI_CAPS_LOWER</code>: Convert the case of all keywords to lower case.</li>
-<li><code>GESHI_CAPS_NO_CHANGE</code>: Don&#8217;t change the case of any keyword.</li>
-<li><strong>&#8216;QUOTEMARKS&#8217;:</strong> Specifies the characters that mark the beginning and end of a string. This is another example
-where if your language includes the &#8217; string delimiter you should use double quotes around it.</li>
-<li><strong>&#8216;ESCAPE_CHAR&#8217;:</strong> Specifies the escape character used in all strings. If your language does not have an escape
-character then make this the empty string (<code>''</code>). This is not an array! If found, any character after an
-escape character and the escape character itself will be highlighted differently, and the character after the
-escape character cannot end a string.</li>
-</ul>
-
-<p>In some language files you might see here other indices too, but those are dealt with later on.</p>
-
-<h4 id="language-file-keywords">4.3.3 Keywords</h4><div class="nav"><a href="#language-file-start-indices">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-symbols-case">Next</a></div>
-
-<p>Keywords will make up the bulk of a language file. In this part you add keywords for your language, including
-inbuilt functions, data types, predefined constants etc etc.</p>
-
-<p>Here&#8217;s a (shortened) example from the php language file:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-<span class="xtra li2"><span class="de2">28</span></span>29
-<span class="xtra li2"><span class="de2">30</span></span>31
-<span class="xtra li2"><span class="de2">32</span></span>33
-<span class="xtra li2"><span class="de2">34</span></span>35
-<span class="xtra li2"><span class="de2">36</span></span>37
-<span class="xtra li2"><span class="de2">38</span></span>39
-<span class="xtra li2"><span class="de2">40</span></span></pre></td><td class="de1"><pre class="de1"><span class="st_h">'KEYWORDS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'as'</span><span class="sy0">,</span> <span class="st_h">'break'</span><span class="sy0">,</span> <span class="st_h">'case'</span><span class="sy0">,</span> <span class="st_h">'do'</span><span class="sy0">,</span> <span class="st_h">'else'</span><span class="sy0">,</span> <span class="st_h">'elseif'</span><span class="sy0">,</span> <span class="st_h">'endif'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'endswitch'</span><span class="sy0">,</span> <span class="st_h">'endwhile'</span><span class="sy0">,</span> <span class="st_h">'for'</span><span class="sy0">,</span> <span class="st_h">'foreach'</span><span class="sy0">,</span> <span class="st_h">'if'</span><span class="sy0">,</span> <span class="st_h">'include'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'include_once'</span><span class="sy0">,</span> <span class="st_h">'require'</span><span class="sy0">,</span> <span class="st_h">'require_once'</span><span class="sy0">,</span> <span class="st_h">'return'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'switch'</span><span class="sy0">,</span> <span class="st_h">'while'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&amp;lt;/script&gt;'</span><span class="sy0">,</span> <span class="st_h">'&amp;lt;?'</span><span class="sy0">,</span> <span class="st_h">'&amp;lt;?php'</span><span class="sy0">,</span> <span class="st_h">'&amp;lt;script language='</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'?&gt;'</span><span class="sy0">,</span> <span class="st_h">'class'</span><span class="sy0">,</span> <span class="st_h">'default'</span><span class="sy0">,</span> <span class="st_h">'DEFAULT_INCLUDE_PATH'</span><span class="sy0">,</span> <span class="st_h">'E_ALL'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_COMPILE_ERROR'</span><span class="sy0">,</span> <span class="st_h">'E_COMPILE_WARNING'</span><span class="sy0">,</span> <span class="st_h">'E_CORE_ERROR'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_CORE_WARNING'</span><span class="sy0">,</span> <span class="st_h">'E_ERROR'</span><span class="sy0">,</span> <span class="st_h">'E_NOTICE'</span><span class="sy0">,</span> <span class="st_h">'E_PARSE'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_USER_ERROR'</span><span class="sy0">,</span> <span class="st_h">'E_USER_NOTICE'</span><span class="sy0">,</span> <span class="st_h">'E_USER_WARNING'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'E_WARNING'</span><span class="sy0">,</span> <span class="st_h">'false'</span><span class="sy0">,</span> <span class="st_h">'function'</span><span class="sy0">,</span> <span class="st_h">'new'</span><span class="sy0">,</span> <span class="st_h">'null'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PEAR_EXTENSION_DIR'</span><span class="sy0">,</span> <span class="st_h">'PEAR_INSTALL_DIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_BINDIR'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_CONFIG_FILE_PATH'</span><span class="sy0">,</span> <span class="st_h">'PHP_DATADIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_EXTENSION_DIR'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_LIBDIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_LOCALSTATEDIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_OS'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_OUTPUT_HANDLER_CONT'</span><span class="sy0">,</span> <span class="st_h">'PHP_OUTPUT_HANDLER_END'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'PHP_OUTPUT_HANDLER_START'</span><span class="sy0">,</span> <span class="st_h">'PHP_SYSCONFDIR'</span><span class="sy0">,</span> <span class="st_h">'PHP_VERSION'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'true'</span><span class="sy0">,</span> <span class="st_h">'var'</span><span class="sy0">,</span> <span class="st_h">'__CLASS__'</span><span class="sy0">,</span> <span class="st_h">'__FILE__'</span><span class="sy0">,</span> <span class="st_h">'__FUNCTION__'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'__LINE__'</span><span class="sy0">,</span> <span class="st_h">'__METHOD__'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_parser_create'</span><span class="sy0">,</span> <span class="st_h">'xml_parser_create_ns'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_parser_free'</span><span class="sy0">,</span> <span class="st_h">'xml_parser_get_option'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_parser_set_option'</span><span class="sy0">,</span> <span class="st_h">'xml_parse_into_struct'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_character_data_handler'</span><span class="sy0">,</span> <span class="st_h">'xml_set_default_handler'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_element_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_end_namespace_decl_handler'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_external_entity_ref_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_notation_decl_handler'</span><span class="sy0">,</span> <span class="st_h">'xml_set_object'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_processing_instruction_handler'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_start_namespace_decl_handler'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'xml_set_unparsed_entity_decl_handler'</span><span class="sy0">,</span> <span class="st_h">'yp_all'</span><span class="sy0">,</span> <span class="st_h">'yp_cat'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'yp_errno'</span><span class="sy0">,</span> <span class="st_h">'yp_err_string'</span><span class="sy0">,</span> <span class="st_h">'yp_first'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'yp_get_default_domain'</span><span class="sy0">,</span> <span class="st_h">'yp_master'</span><span class="sy0">,</span> <span class="st_h">'yp_match'</span><span class="sy0">,</span> <span class="st_h">'yp_next'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'yp_order'</span><span class="sy0">,</span> <span class="st_h">'zend_logo_guid'</span><span class="sy0">,</span> <span class="st_h">'zend_version'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'zlib_get_coding_type'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<p>You can see that the index &#8216;KEYWORDS&#8217; refers to an array of arrays, indexed by positive integers. In each array,
-there are some keywords (in the actual php language file there is in fact many more keywords in the array indexed by 3).
-Here are some points to note about these keywords:</p>
-
-<ul>
-<li><strong>Indexed by positive integers:</strong> Use nothing else! I may change this in 1.2.X, but for the 1.0.X series,
-use positive integers only. Using strings here results in unnecessary overhead degrading performance when
-highlighting code with your language file!</li>
-<li><strong>Keywords sorted ascending:</strong> Keywords <em>should</em> be sorted in <em>ascending</em> order. This is mainly for
-readability. An issue with versions before 1.0.8 has been solved, so the reverse sorting order
-is no longer required and should thus be avoided. <abbr title="Generic Syntax Highlighter">GeSHi</abbr> itself sorts the keywords internally when
-building some of its caches, so the order doesn&#8217;t matter, but makes things easier to read and maintain.</li>
-<li><strong>Keywords are case sensitive (sometimes):</strong> If your language is case-sensitive, the correct casing of the
-keywords is defined as the case of the keywords in these keyword arrays. If you check the java language file you
-will see that everything is in exact casing. So if any of these keyword arrays are case sensitive, put the
-keywords in as their correct case! (note that which groups are case sensitive and which are not is configurable,
-see later on). If a keyword group is case insensitive, put the lowercase version of the keyword here
-<strong>OR</strong> in case documentation links require a special casing (other than all lowercase or all uppercase)
-the casing required for them use their casing.</li>
-<li><strong>Keywords must be in <code class="highlighted php"><span class="kw3">htmlentities</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code> form:</strong> All keywords should be written as if they had been
-run through the php function <code class="highlighted php"><span class="kw3">htmlentities</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code>. E.g, the keyword is <code class="highlighted html4strict"><span class="sc1">&amp;lt;</span>foo<span class="sc1">&amp;gt;</span></code>, not
-<code class="highlighted html4strict"><span class="sc2">&lt;foo&gt;</span></code></li>
-<li><strong>Don&#8217;t use keywords to highlight symbols:</strong> Just don&#8217;t!!! It doesn&#8217;t work, and there is seperate support
-for symbols since <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.7.21.</li>
-<li><strong>Markup Languages are special cases:</strong> Check the html4strict language file for an example: You need to tweak
-the Parser control here to tell the surroundings of tagnames. In case of doubt, feel free to ask.</li>
-</ul>
-
-<h4 id="language-file-symbols-case">4.3.4 Symbols and Case Sensitivity</h4><div class="nav"><a href="#language-file-keywords">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-styles">Next</a></div>
-
-<p>So you&#8217;ve put all the keywords for your language in? Now for a breather before we style them :). Symbols define
-what symbols your language uses. These are things like colons, brackets/braces, and other such general punctuation.
-No alphanumeric stuff belongs here, just the same as no symbols belong into the keywords section.</p>
-
-<p>As of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> version 1.0.7.21 the symbols section can be used in two ways:</p>
-
-<dl>
-<dt>Flat usage:</dt>
-<dd>This mode is the suggested way for existing language files and languages that only need few symbols where no
-further differentiation is needed or desired. You simply put all the characters in an array under symbols as shown
-in the first example below. All symbols in flat usage belong to symbol style group 0.</dd>
-
-<dt>Group usage:</dt>
-<dd>This is a slightly more enhanced way to provide <abbr title="Generic Syntax Highlighter">GeSHi</abbr> symbol information. To use group you create several subarrays
-each containing only a subset of the symbols to highlight. Every array will need to have an unique index thus
-you can assign the appropriate styles later.</dd>
-</dl>
-
-<p>Here&#8217;s an example for flat symbol usage</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-</pre></td><td class="de1"><pre class="de1"><span class="st_h">'SYMBOLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; <span class="st_h">'('</span><span class="sy0">,</span> <span class="st_h">')'</span><span class="sy0">,</span> <span class="st_h">'['</span><span class="sy0">,</span> <span class="st_h">']'</span><span class="sy0">,</span> <span class="st_h">'{'</span><span class="sy0">,</span> <span class="st_h">'}'</span><span class="sy0">,</span> <span class="st_h">'!'</span><span class="sy0">,</span> <span class="st_h">'@'</span><span class="sy0">,</span> <span class="st_h">'|'</span><span class="sy0">,</span> <span class="st_h">'&amp;'</span><span class="sy0">,</span> <span class="st_h">'+'</span><span class="sy0">,</span> <span class="st_h">'-'</span><span class="sy0">,</span> <span class="st_h">'*'</span><span class="sy0">,</span> <span class="st_h">'/'</span><span class="sy0">,</span> <span class="st_h">'%'</span><span class="sy0">,</span> <span class="st_h">'='</span><span class="sy0">,</span> <span class="st_h">'&lt;'</span><span class="sy0">,</span> <span class="st_h">'&gt;'</span></span></span><span class="br0">&#41;</span><span class="sy0">,</span></pre></td></tr></tbody></table>
-
-<p>which is not too different from the newly introduced group usage shown below:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span></pre></td><td class="de1"><pre class="de1"><span class="st_h">'SYMBOLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'('</span><span class="sy0">,</span> <span class="st_h">')'</span><span class="sy0">,</span> <span class="st_h">'['</span><span class="sy0">,</span> <span class="st_h">']'</span><span class="sy0">,</span> <span class="st_h">'{'</span><span class="sy0">,</span> <span class="st_h">'}'</span><span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'!'</span><span class="sy0">,</span> <span class="st_h">'@'</span><span class="sy0">,</span> <span class="st_h">'|'</span><span class="sy0">,</span> <span class="st_h">'&amp;'</span><span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'+'</span><span class="sy0">,</span> <span class="st_h">'-'</span><span class="sy0">,</span> <span class="st_h">'*'</span><span class="sy0">,</span> <span class="st_h">'/'</span><span class="sy0">,</span> <span class="st_h">'%'</span><span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span><span class="st_h">'='</span><span class="sy0">,</span> <span class="st_h">'&amp;lt;'</span><span class="sy0">,</span> <span class="st_h">'&gt;'</span><span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2"><span class="br0">&#41;</span><span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>Please note that versions before 1.0.7.21 will silently ignore this setting.</p>
-
-<p>Also note that <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.7.21 itself had some bugs in Symbol highlighting that could cause
- heavily scrambled code output.</p>
-
-</div>
-
-<p>The following case sensitivity group alludes to the keywords section: here you can set which keyword groups are case sensitive.</p>
-
-<p>In the <strong>&#8216;CASE_SENSITIVE&#8217;</strong> group there&#8217;s a special key <code>GESHI_COMMENTS</code> which is used to set whether comments are
-case sensitive or not (for example, BASIC has the REM statement which while not being case sensitive is still alphanumeric, and
-as in the example given before about the Java language file using &#8220;import&#8221; as a single line comment, this can be
-useful sometimes. <strong>true</strong> if comments are case sensitive, <strong>false</strong> otherwise. All of the other indices
-correspond to indices in the <code>'KEYWORDS'</code> section (see above).</p>
-
-<h4 id="language-file-styles">4.3.5 Styles for your Language File</h4><div class="nav"><a href="#language-file-symbols-case">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-urls">Next</a></div>
-
-<p>This is the fun part! Here you get to choose the colours, fonts, backgrounds and anything else you&#8217;d like for your
-language file.</p>
-
-<p>Here&#8217;s an example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-<span class="xtra li2"><span class="de2">28</span></span>29
-<span class="xtra li2"><span class="de2">30</span></span>31
-<span class="xtra li2"><span class="de2">32</span></span>33
-<span class="xtra li2"><span class="de2">34</span></span>35
-<span class="xtra li2"><span class="de2">36</span></span>37
-<span class="xtra li2"><span class="de2">38</span></span>39
-</pre></td><td class="de1"><pre class="de1"><span class="st_h">'STYLES'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'KEYWORDS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #b1b100;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000000; font-weight: bold;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000066;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'COMMENTS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #808080; font-style: italic;'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #808080; font-style: italic;'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'MULTI'</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #808080; font-style: italic;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'ESCAPE_CHAR'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #000099; font-weight: bold;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'BRACKETS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #66cc66;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'STRINGS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #ff0000;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'NUMBERS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #cc66cc;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'METHODS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #006600;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'SYMBOLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #66cc66;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="st_h">'REGEXPS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">'color: #0000ff;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="st_h">'SCRIPT'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span></span></span>&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></pre></td></tr></tbody></table>
-
-<p>Note that all style rules should end with a semi-colon! This is important: <abbr title="Generic Syntax Highlighter">GeSHi</abbr> may add extra rules to the rules you
-specify (and will do so if a user tries to change your styles on the fly), so the last semi-colon in any stylesheet
-rule is important!</p>
-
-<p>All strings here should contain valid stylesheet declarations (it&#8217;s also fine to have the empty string).</p>
-
-<ul>
-<li><strong>&#8216;KEYWORDS&#8217;:</strong> This is an array, from keyword index to style. The index you use is the index you used in
-the keywords section to specify the keywords belonging to that group.</li>
-<li><strong>&#8216;COMMENTS&#8217;:</strong> This is an array, from single-line comment index to style for that index. The index &#8216;MULTI&#8217; is
-used for multiline comments (and cannot be an array). COMMENT_REGEXP use the style given for their key as
-if they were single-line comments.</li>
-<li><strong>&#8216;ESCAPE_CHAR&#8217;, &#8216;BRACKETS&#8217; and &#8216;METHODS&#8217;:</strong> These are arrays with only one index: 0. You cannot add other indices to
-these arrays.</li>
-<li><strong>&#8216;STRINGS&#8217;:</strong> This defines the various styles for the Quotemarks you defined earlier. If you don&#8217;t use
-multiple styles for strings there&#8217;s only one index: 0. Please also add this index in case no strings are present.</li>
-<li><strong>&#8216;NUMBERS&#8217;:</strong> This sets the styles used to highlight numbers. The format used here depends on the format used to
-set the formats of numbers to highlight. If you just used an integer (bitmask) for numbers, you have to either
-specify one key with the respective constant, and\or include a key 0 as a default style. If you used an
-array for the number markup, copy the keys used there and assign the styles accordingly.</li>
-<li><strong>&#8216;SYMBOLS&#8217;:</strong> This provides one key for each symbol group you defined above. If you used the flat usage
-make sure you include a key for symbols group 0.</li>
-<li><strong>&#8216;REGEXPS&#8217;:</strong> This is an array with a style for each matching regex. Also, since 1.0.7.21, you can specify the
-name of a function to be called, that will be given the text matched by the regex, each time a match is found.
-Note that my testing found that <code>create_function</code> would not work with this due to a <abbr title="PHP: HTML Preprocessor">PHP</abbr> bug, so you have to
-put the function definition at the top of the language file. Be sure to prefix the function name
-with <code>geshi_[languagename]_</code> as to not conflict with other functions!</li>
-<li><strong>&#8216;SCRIPT&#8217;:</strong> For languages that use script delimiters, this is where you can style each block of script. For
-example, <abbr title="Hypertext Markup Language">HTML</abbr> and <abbr title="Extensible Markup Language">XML</abbr> have blocks that begin with &lt; and end with > (i.e. tags) and blocks that begin with &amp; and
-end with&#160;; (i.e. character entities), and you can set a style to apply to each whole block. You specify the
-delimiters for the blocks below. Note that many languages will not need this feature.</li>
-</ul>
-
-<h4 id="language-file-urls">4.3.6 URLs for Functions</h4><div class="nav"><a href="#language-file-styles">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-numbers-support">Next</a></div>
-
-<p>This section lets you specify a url to visit for each keyword group. Useful for pointing functions at their online
-manual entries.</p>
-
-<p>Here is an example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span></pre></td><td class="de1"><pre class="de1"><span class="st_h">'URLS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="st_h">'http://www.php.net/{FNAME}'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<p>The indices of this array correspond to the keyword groups you specified in the keywords section. The string <code>{FNAME}</code>
-marks where the name of the function is substituted in. So for the example above, if the keyword being highlighted is
-&#8220;echo&#8221;, then the keyword will be a URL pointing to <code>http://www.php.net/echo</code>. Because some languages (Java!) don&#8217;t
-keep a uniform URL for functions/classes, you may have trouble in creating a URL for that language (though look in the
-java language file for a novel solution to it&#8217;s problem)</p>
-
-<h4 id="language-file-numbers-support">4.3.7 Number Highlighting Support</h4><div class="nav"><a href="#language-file-urls">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-oo-support">Next</a></div>
-
-<p>If your language supports different formats of numbers (e.g. integers and float representations) and you want
-<abbr title="Generic Syntax Highlighter">GeSHi</abbr> to handle them differently you can select from a set of predefined formats.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span></pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'NUMBERS'</span> <span class="sy0">=&gt;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_INT_BASIC <span class="sy0">|</span> GESHI_NUMBER_INT_CSTYLE <span class="sy0">|</span> GESHI_NUMBER_BIN_PREFIX_0B <span class="sy0">|</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_OCT_PREFIX <span class="sy0">|</span> GESHI_NUMBER_HEX_PREFIX <span class="sy0">|</span> GESHI_NUMBER_FLT_NONSCI <span class="sy0">|</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; GESHI_NUMBER_FLT_NONSCI_F <span class="sy0">|</span> GESHI_NUMBER_FLT_SCI_SHORT <span class="sy0">|</span> GESHI_NUMBER_FLT_SCI_ZERO<span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<p>All the formats you want <abbr title="Generic Syntax Highlighter">GeSHi</abbr> to recognize are selected via a bitmask that is built by bitwise OR-ing the format constants.
-When styling you use these constants to assign the proper styles. A style not assigned will automatically fallback to style group 0.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>For a complete list of formats supported by <abbr title="Generic Syntax Highlighter">GeSHi</abbr> have a look into the sources of geshi.php.</p>
-
-</div>
-
-<p>If you want to define your own formats for numbers or when you want to group the style for two or more formats you can use the array syntax.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-</pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'NUMBERS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> GESHI_NUMBER_INT_BASIC <span class="sy0">|</span> GESHI_NUMBER_INT_CSTYLE<span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> GESHI_NUMBER_BIN_PREFIX_0B<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> GESHI_NUMBER_OCT_PREFIX<span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> GESHI_NUMBER_HEX_PREFIX<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> GESHI_NUMBER_FLT_NONSCI <span class="sy0">|</span> GESHI_NUMBER_FLT_NONSCI_F <span class="sy0">|</span> GESHI_NUMBER_FLT_SCI_SHORT <span class="sy0">|</span> GESHI_NUMBER_FLT_SCI_ZERO</span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></pre></td></tr></tbody></table>
-
-<p>This creates 5 style groups 1..5 that will highlight each of the formats specified for each group.
-Styling of these groups doesn&#8217;t use the constants but uses the indices you just defined.</p>
-
-<p>Instead of using those predefined constants you also can assign a PCRE that matches a number when using this advanced format.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>The extended format hasn&#8217;t been exhaustively been tested. So beware of bugs there.</p>
-
-</div>
-
-<h4 id="language-file-oo-support">4.3.8 Object Orientation Support</h4><div class="nav"><a href="#language-file-numbers-support">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-regexps">Next</a></div>
-
-<p>Now we&#8217;re reaching the most little-used section of a language file, which includes such goodies as object orientation
-support and context support. <abbr title="Generic Syntax Highlighter">GeSHi</abbr> can highlight methods and data fields of objects easily, all you need to do is to
-tell it to do so and what the &#8220;splitter&#8221; is between object/method etc.</p>
-
-<p>Here&#8217;s an example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span></pre></td><td class="de1"><pre class="de1"><span class="st_h">'OOLANG'</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">'OBJECT_SPLITTER'</span> <span class="sy0">=&gt;</span> <span class="st_h">'-&amp;gt;'</span><span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<p>If your language has object orientation, the value of <code>'OOLANG'</code> is true, otherwise it is false. If it is object
-orientated, in the <code>'OBJECT_SPLITTER'</code> value you put the <code>htmlentities()</code> version of the &#8220;splitter&#8221; between
-objects and methods/fields. If it is not, then make this the empty string.</p>
-
-<h4 id="language-file-regexps">4.3.9 Using Regular Expressions</h4><div class="nav"><a href="#language-file-oo-support">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-strict-mode">Next</a></div>
-
-<p>Regular expressions are a good way to catch any other lexic that fits certain rules but can&#8217;t be listed as a keyword.
-A good example is variables in <abbr title="PHP: HTML Preprocessor">PHP</abbr>: variables always start with either one or two &#8220;$&#8221; signs, then alphanumeric
-characters (a simplification). This is easy to catch with regular expressions.</p>
-
-<p>And new to version 1.0.2, there is an advanced way of using regular expressions to catch certain things but highlight
-only part of those things. This is particularly useful for languages like <abbr title="Extensible Markup Language">XML</abbr>.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>Regular expressions use the PCRE syntax (perl-style), <em>not</em> the <code class="highlighted php"><span class="kw3">ereg</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code> style!</p>
-
-</div>
-
-<p>Here is an example (this time the <abbr title="PHP: HTML Preprocessor">PHP</abbr> file merged with the <abbr title="Extensible Markup Language">XML</abbr> file):</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-</pre></td><td class="de1"><pre class="de1"><span class="nu0">0</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; GESHI_SEARCH <span class="sy0">=&gt;</span> <span class="st_h">'(((xml:)?[a-z\-]+))(=)'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; GESHI_REPLACE <span class="sy0">=&gt;</span> <span class="st_h">'\\1'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; GESHI_MODIFIERS <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; GESHI_BEFORE <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; GESHI_AFTER <span class="sy0">=&gt;</span> <span class="st_h">'\\4'</span></span></span>&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2"><span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; GESHI_SEARCH <span class="sy0">=&gt;</span> <span class="st_h">'(&gt;/?[a-z0-9]*(&gt;)?)'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; GESHI_REPLACE <span class="sy0">=&gt;</span> <span class="st_h">'\\1'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; GESHI_MODIFIERS <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; GESHI_BEFORE <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; GESHI_AFTER <span class="sy0">=&gt;</span> <span class="st_h">''</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span><span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;[<span class="es1">\\</span>$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*&quot;</span></pre></td></tr></tbody></table>
-
-<p>As you can see there are two formats. One is the &#8220;simple&#8221; format used in <abbr title="Generic Syntax Highlighter">GeSHi</abbr> &lt; 1.0.2, and the other is a more
-advanced syntax. Firstly, the simple syntax:</p>
-
-<ul>
-<li><strong>May be in double quotes:</strong> To make it easier for those who always place their regular expressions in double quotes,
-you may place any regular expression here in double quotes if you wish.</li>
-<li><strong>Don&#8217;t use curly brackets where possible:</strong> If you want to use curly brackets (<code>()</code>) then by all means give it a try,
-but I&#8217;m not sure whether under some circumstances <abbr title="Generic Syntax Highlighter">GeSHi</abbr> may throw a wobbly. You have been warned! If you want to
-use brackets, it would be better to use the advanced syntax.</li>
-<li><strong>Don&#8217;t use the &#8220;everything&#8221; regex:</strong> (That&#8217;s the <code>.*?</code> regex). Use advanced syntax instead.</li>
-</ul>
-
-<p>And now for advanced syntax, which gives you much more control over exactly what is highlighted:</p>
-
-<ul>
-<li><strong>GESHI_SEARCH:</strong> This element specifies the regular expression to search for. If you plan to capture the output,
-use brackets (<code>()</code>). See how in the first example above, most of the regular expression is in one set of brackets
-(with the equals sign in other brackets). You should make sure that the part of the regular expression that is
-supposed to match what is highlighted is in brackets.</li>
-<li><strong>GESHI_REPLACE:</strong> This is what the stuff matched by the regular expression will be replaced with. If you&#8217;ve
-grouped the stuff you want highlighted into brackets in the GESHI_SEARCH element, then you can use <code>\\number</code>
-to match that group, where <code>number</code> is a number corresponding to how many open brackets are between the open
-bracket of the group you want highlighted and the start of the GESHI_SEARCH string + 1. This may sound confusing,
-and it probably is, but if you&#8217;re familiar with how <abbr title="PHP: HTML Preprocessor">PHP</abbr>&#8217;s regular expressions work you should understand. In the
-example above, the opening bracket for the stuff we want highlighted is the very first bracket in the string, so
-the number of brackets before that bracket and the start of the string is 0. So we add 1 and get our replacement
-string of <code>\\1</code> <small>(whew!)</small>.</li>
-</ul>
-
-<p>If you didn&#8217;t understand a word of that, make sure that there are brackets around the string in <code>GESHI_SEARCH</code>
-and use <code>\\1</code> for <code>GESHI_REPLACE</code> ;)</p>
-
-<ul>
-<li><strong>GESHI_MODIFIERS:</strong> Specify modifiers for your regular expression. If your regular expression includes the
-everything matcher (<code>.*?</code>), then your modifiers should include &#8220;s&#8221; and &#8220;i&#8221; (e.g. use &#8216;si&#8217; for this).</li>
-<li><strong>GESHI_BEFORE:</strong>Specifies a bracket group that should appear before the highlighted match (this bracketed group will
-not be highlighted). Use this if you had to match what you wanted by matching part of your regexp string to something
-before what you wanted to highlight, and you don&#8217;t want that part to disappear in the highlighted result.</li>
-<li><strong>GESHI_AFTER:</strong>Specifies a bracket group that should appear after the highlighted match (this bracketed group will
-not be highlighted). Use this if you had to match what you wanted by matching part of your regexp string to something
-after what you wanted to highlight, and you don&#8217;t want that part to disappear in the highlighted result.</li>
-</ul>
-
-<p>Is that totally confusing? Here&#8217;s the test for if you&#8217;re an android or not: If you found that perfectly understandable
-then you&#8217;re an android ;). Here&#8217;s a better example:</p>
-
-<p>Let&#8217;s say that I&#8217;m making a language, and variables in this language always start with a dollar sign ($), are always
-written in lowercase letters and always end with an ampersand (&amp;). eg:</p>
-
-<p><code class="highlighted php"><span class="re0">$foo</span><span class="sy0">&amp;</span> <span class="sy0">=</span> <span class="st_h">'bar'</span></code></p>
-
-<p>I want to highlight <em>only the text between the $ and the &amp;</em>. How do I do that? With simple regular expressions I can&#8217;t,
-but with advanced, it&#8217;s relatively easy:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span></pre></td><td class="de1"><pre class="de1"><span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// search for a dollar sign, then one or more of the characters a-z, then an ampersand</span></span></span>&nbsp; &nbsp; GESHI_SEARCH <span class="sy0">=&gt;</span> <span class="st_h">'(\$)([a-z]+)(&amp;)'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// we wanna highlight the characters, which are in the second bracketed group</span></span></span>&nbsp; &nbsp; GESHI_REPLACE <span class="sy0">=&gt;</span> <span class="st_h">'\\2'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// no modifiers, since we're not matching the &quot;anything&quot; regex</span></span></span>&nbsp; &nbsp; GESHI_MODIFIERS <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// before the highlighted characters should be the first</span></span></span>&nbsp; &nbsp; <span class="co1">// bracketed group (always a dollar sign in this example)</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; GESHI_BEFORE <span class="sy0">=&gt;</span> <span class="st_h">'\\1'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="co1">// after the highlighted characters should be the third</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="co1">// bracketed group (always an ampersand in this example)</span></span></span>&nbsp; &nbsp; GESHI_AFTER <span class="sy0">=&gt;</span> <span class="st_h">'\\3'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span></pre></td></tr></tbody></table>
-
-<p>So if someone tried to highlight using my language, all cases of <code>$foo&amp;</code> would turn into:</p>
-
-<p><code class="highlighted html4strict">$<span class="sc2">&lt;<span class="kw2">span</span> <span class="kw3">style</span><span class="sy0">=</span><span class="st0">&quot;color: blue;&quot;</span>&gt;</span>foo<span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">span</span>&gt;&lt;<span class="kw2">span</span> <span class="kw3">style</span><span class="sy0">=</span><span class="st0">&quot;color: green;&quot;</span>&gt;</span><span class="sc1">&amp;amp;</span><span class="sc2">&lt;<span class="sy0">/</span><span class="kw2">span</span>&gt;</span></code></p>
-
-<p>(which would of course be viewed in a browser to get something like <code class="highlighted php"><span class="re0">$foo</span><span class="sy0">&amp;</span></code>)</p>
-
-<h4 id="language-file-strict-mode">4.3.10 Contextual Highlighting and Strict Mode</h4><div class="nav"><a href="#language-file-regexps">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-parser-control">Next</a></div>
-
-<p>For languages like <abbr title="Hypertext Markup Language">HTML</abbr>, it&#8217;s good if we can highlight a tag (like <code class="highlighted html4strict"><span class="sc2">&lt;<span class="kw2">a</span>&gt;</span></code> for example). But how do we stop
-every single &#8220;a&#8221; in the source getting highlighted? What about for attributes? If I&#8217;ve got the word &#8220;colspan&#8221; in my
-text I don&#8217;t want that highlighted! So how do you tell <abbr title="Generic Syntax Highlighter">GeSHi</abbr> not to highlight in that case? You do it with &#8220;Strict Blocks&#8221;.</p>
-
-<p>Here is an example:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span>13
-<span class="xtra li2"><span class="de2">14</span></span>15
-<span class="xtra li2"><span class="de2">16</span></span>17
-<span class="xtra li2"><span class="de2">18</span></span>19
-<span class="xtra li2"><span class="de2">20</span></span>21
-<span class="xtra li2"><span class="de2">22</span></span>23
-<span class="xtra li2"><span class="de2">24</span></span>25
-<span class="xtra li2"><span class="de2">26</span></span>27
-</pre></td><td class="de1"><pre class="de1"><span class="sy1">&lt;?</span> <span class="coMULTI">/* ... */</span>
-<span class="xtra li2"><span class="de2"><span class="st_h">'STRICT_MODE_APPLIES'</span> <span class="sy0">=&gt;</span> GESHI_MAYBE<span class="sy0">,</span></span></span><span class="st_h">'SCRIPT_DELIMITERS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;?php'</span> <span class="sy0">=&gt;</span> <span class="st_h">'?&gt;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;?'</span> <span class="sy0">=&gt;</span> <span class="st_h">'?&gt;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;%'</span> <span class="sy0">=&gt;</span> <span class="st_h">'%&gt;'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'&lt;script language=&quot;php&quot;&gt;'</span> <span class="sy0">=&gt;</span> <span class="st_h">'&lt;/script&gt;'</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;/(&lt;\?(?:php)?)(?:'(?:[^'<span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?'|<span class="es1">\&quot;</span>(?:[^<span class="es1">\&quot;</span><span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?<span class="es1">\&quot;</span>|\/\*(?!\*\/).*?\*\/|.)*?(\?&gt;|\Z)/sm&quot;</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="st0">&quot;/(&lt;%)(?:'(?:[^'<span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?'|<span class="es1">\&quot;</span>(?:[^<span class="es1">\&quot;</span><span class="es1">\\</span><span class="es1">\\</span>]|<span class="es1">\\</span><span class="es1">\\</span>.)*?<span class="es1">\&quot;</span>|\/\*(?!\*\/).*?\*\/|.)*?(%&gt;|\Z)/sm&quot;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></span></span><span class="st_h">'HIGHLIGHT_STRICT_BLOCK'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">0</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">1</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">3</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="nu0">4</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; <span class="nu0">5</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span></span></span><span class="coMULTI">/* ... */</span> <span class="sy1">?&gt;</span></pre></td></tr></tbody></table>
-
-<p>What is strict mode? Strict mode says that highlighting only occurs inside the blocks you specify. You can see from
-the example above that highlighting will only occur if the source is inside <code class="highlighted php"><span class="kw2">&lt;?php</span> <span class="sy0">...</span> <span class="sy1">?&gt;</span></code> (though note the
-<code>GESHI_MAYBE</code>!). Here are some points about strict highlighting:</p>
-
-<ul>
-<li><strong>&#8216;STRICT_MODE_APPLIES&#8217;:</strong> This takes three values (all constants):
-
-<ul>
-<li><code>GESHI_ALWAYS</code>: Strict mode always applies for all of the blocks you specify. Users of your language
-file cannot turn strict mode off. This should be used for markup languages.</li>
-<li><code>GESHI_NEVER</code>: Strict mode is never used. Users of your language file cannot turn strict mode on. Use this
-value if there is no such thing as a block of code that would not be highlighted in your language
-(most languages, like C, Java etc. use this because anything in a C file should be highlighted).</li>
-<li><code>GESHI_MAYBE</code>: Strict mode &#42;sometimes&#42; applies. It defaults to &#8220;off&#8221;. Users can turn strict mode on if
-they please. If strict mode is off then everything in the source will be highlighted, even things outside
-the strict block markers. If strict mode is on the nothing outside strict block markers will be highlighted.</li>
-</ul></li>
-<li><strong>&#8216;SCRIPT_DELIMITERS&#8217;:</strong> This is an array of script delimiters, in the format of the above. The indices are use in the
-&#8216;SCRIPT&#8217; part of the styles section for highlighting everything in a strict block in a certain way.
-For example, you could set up your language file to make the background yellow of any code inside a strict
-block this way. The delimiters are in the form <code class="highlighted php"><span class="st_h">'OPEN'</span> <span class="sy0">=&gt;</span> <span class="st_h">'CLOSE'</span></code>. Delimiters can be of any
-length > 0. Delimiters are <em>not</em> formatted as if they were run through <code class="highlighted php"><span class="kw3">htmlentities</span><span class="br0">&#40;</span><span class="br0">&#41;</span></code>!</li>
-<li><strong>&#8216;HIGHLIGHT_STRICT_BLOCK&#8217;:</strong> specifies whether any highlighting should go on inside each block. Most of
-the time this should be true, but for example, in the <abbr title="Extensible Markup Language">XML</abbr> language file highlighting is turned off for
-blocks beginning with <code class="highlighted html4strict"><span class="sc0">&lt;!DOCTYPE</span></code> and ending with <code class="highlighted html4strict">&gt;</code>. However, you can still
-style the overall block using the method described above, and the <abbr title="Extensible Markup Language">XML</abbr> language file does just that.</li>
-</ul>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>The delimiters should be in <em>reverse alphabetical order</em>. Note that in the above example, <code class="highlighted php"><span class="kw2">&lt;?php</span></code>
- comes before <code class="highlighted php"><span class="sy1">&lt;?</span></code>.</p>
-
-</div>
-
-<p>Since <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 instead of specifying an array with starter and ender you may also provide a regular expression
-that matches <em>the full block</em> you wish to highlight. If the regular expression match starts at the same position
-as a previous array declaration the Regexp match is taken. This is to allow for a fall-back when a preg_match
-doesn&#8217;t quite work as expected so you still get reasonably well results.</p>
-
-<p>If you didn&#8217;t get this, you might want to look into the <abbr title="PHP: HTML Preprocessor">PHP</abbr> or <abbr title="Hypertext Markup Language">HTML</abbr> language files as this feature is used there
-to fix some issues that have been there for about 3 years.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>For <abbr title="PHP: HTML Preprocessor">PHP</abbr> versions &lt;4.3.3 Strict Block Regexps are completely ignored due to problems in those version
- that would cause loads of warning messages otherwise.</p>
-
-</div>
-
-<h4 id="language-file-parser-control">4.3.11 Special Parser Settings (Experimental)</h4><div class="nav"><a href="#language-file-strict-mode">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#language-file-tidying-up">Next</a></div>
-
-<p>Sometimes it is necessary for a language to render correctly to tweak some of the assumptions <abbr title="Generic Syntax Highlighter">GeSHi</abbr> usually makes to match the behaviour your language expects.
-To achieve this there is an experimental section called <code class="highlighted php"><span class="st_h">'PARSER_CONTROL'</span></code> which is optional and should be used only if necessary.
-With the help of this section some internal parameters of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> can be set which are not overrideable by the API and thus their use should be limited as much as possible.</p>
-
-<p>The syntax of the <strong>PARSER_CONTROL</strong> basically resembles an array structure simular to the one found in the rest of the language file. All subsections of the <strong>PARSER_CONTROL</strong> are optional.
-If a given setting isn&#8217;t present the usual default values of <abbr title="Generic Syntax Highlighter">GeSHi</abbr> are used.
-No validation of settings is performed for these settings. Also note that unknown settings are silently ignored.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>All <strong>PARSER_CONTROL</strong> settings are experimental and subject to change.
- So if you need a special setting in a public language file you should consider requesting it upstream.
- This is also the reason why documentation on these settings will only cover broad usage information as the underlying implementation might change without further notice.</p>
-
-</div>
-
-<p>One of the most common reasons why you might want to use the <strong>PARSER_CONTROL</strong> settings is to tweak what characters are allowed to surround a keyword.
-Usually <abbr title="Generic Syntax Highlighter">GeSHi</abbr> checks for a fixed set of characters like brackets and common symbols that denote the word boundary for a keyword.
-If this set conflicts with your language (e.g. - is allowed inside a keyword) or you want to limit the usage of a keyword to certain areas (e.g. for <abbr title="Hypertext Markup Language">HTML</abbr> tag names only match after &lt;) you can change those conditions here.</p>
-
-<p>Keyword boundary rules can either be set globally (directly within the PARSER_CONTROL&#8217;s KEYWORDS section or on a per-group basis.
-E.g. the following sample from the <abbr title="Hypertext Markup Language">HTML</abbr> language file sets different settings for keyword matching only for Keyword Group 2 and leaves the other groups alone.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span></pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'PARSER_CONTROL'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'KEYWORDS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="nu0">2</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'DISALLOWED_BEFORE'</span> <span class="sy0">=&gt;</span> <span class="st_h">'(?&lt;=&amp;lt;|&amp;lt;\/)'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'DISALLOWED_AFTER'</span> <span class="sy0">=&gt;</span> <span class="st_h">'(?=\s|\/|&amp;gt;)'</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span></span></span></pre></td></tr></tbody></table>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>The name <code class="highlighted php"><span class="st_h">'DISALLOWED_BEFORE'</span></code> and <code class="highlighted php"><span class="st_h">'DISALLOWED_AFTER'</span></code> might sound confusing at first, since they don&#8217;t define what to prevent, but what to match in order to find a keyword.
- The reason for this strange naming is based in the original implementation of this feature when Nigel implemented this in the old parser statically.
- When this implementation was brought out via the <strong>PARSER_CONTROL</strong> settings the original naming wasn&#8217;t altered since at that time this really was a blacklist of characters.
- Later on this implementation was changed from a blacklist of characters to a part of a PCRE regexp, but leaving the name.
- The naming might be subject to change though.</p>
-
-</div>
-
-<p>Another option you can change since <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8.3 is whether to treat spaces within keywords as literals (only a single space as given) or if the space should match any whitespace at that location.
-The following code will enable this behaviour for the whole keyword set. As said above you can choose to enable this for single keyword groups only though.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-</pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'PARSER_CONTROL'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'KEYWORDS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'SPACE_AS_WHITESPACE'</span> <span class="sy0">=&gt;</span> <span class="kw4">true</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span></span></span>&nbsp; &nbsp; <span class="br0">&#41;</span><span class="sy0">,</span></pre></td></tr></tbody></table>
-
-<p>Another option of interest might be disabling certain features for a given language.
-This might come in handy if the language file you are working on doesn&#8217;t support a given function or highlighting certain aspects won&#8217;t work properly or would interfere with custom implementations using regular expressions.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-<span class="xtra li2"><span class="de2">8</span></span>9
-<span class="xtra li2"><span class="de2">10</span></span>11
-<span class="xtra li2"><span class="de2">12</span></span></pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'PARSER_CONTROL'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ENABLE_FLAGS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ALL'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'NUMBERS'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'METHODS'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'SCRIPT'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'SYMBOLS'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'ESCAPE_CHAR'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'BRACKETS'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'STRINGS'</span> <span class="sy0">=&gt;</span> GESHI_NEVER<span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; <span class="br0">&#41;</span></span></span></pre></td></tr></tbody></table>
-
-<p>Inside the <code class="highlighted php"><span class="st_h">'ENABLE_FLAGS'</span></code> section follows an array of <code class="highlighted php"><span class="st_h">'name'</span><span class="sy0">=&gt;</span>value</code> pairs.
-Valid names are the sections below the <code class="highlighted php"><span class="st_h">'STYLES'</span></code> section (well, not exactly, but you can look there for what the features are called inside <abbr title="Generic Syntax Highlighter">GeSHi</abbr>).
-Valid values are the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> constants <code class="highlighted php">GESHI_NEVER</code> (don&#8217;t process this feature), <code class="highlighted php">GESHI_ALWAYS</code> (always process this feature, ignore the user) and <code class="highlighted php">GESHI_MAYBE</code> (listen to the user if he want&#8217;s this highlighted).
-The value <code class="highlighted php">GESHI_MAYBE</code> is the default one and thus needs not to be set explicitely.</p>
-
-<p>Another setting available through the <strong>PARSER_CONTROL</strong> settings is the possibility to limit the allowed characters before an single line comment.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-</pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'PARSER_CONTROL'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'COMMENTS'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'DISALLOWED_BEFORE'</span> <span class="sy0">=&gt;</span> <span class="st_h">'$'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span></span></span>&nbsp; &nbsp; <span class="br0">&#41;</span></pre></td></tr></tbody></table>
-
-<p>With the current implementation the DISALLOWED_BEFORE COMMENT-specific setting is a list of characters. But this is subject to change.</p>
-
-<div class="note">
-
-<div class="note-header">Note:</div>
-
-<p>There is no <code class="highlighted php"><span class="st_h">'DISALLOWED_AFTER'</span></code> setting with the <code class="highlighted php"><span class="st_h">'COMMENTS'</span></code>-<strong>PARSER_CONTROL</strong>.</p>
-
-</div>
-
-<p>Another <strong>PARSER_CONTROL</strong> setting for the environment around certain syntactic constructs refers to the handling of object-oriented languages.</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-<span class="xtra li2"><span class="de2">4</span></span>5
-<span class="xtra li2"><span class="de2">6</span></span>7
-</pre></td><td class="de1"><pre class="de1">&nbsp; &nbsp; <span class="st_h">'PARSER_CONTROL'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'OOLANG'</span> <span class="sy0">=&gt;</span> <a href="http://www.php.net/array"><span class="kw3">array</span></a><span class="br0">&#40;</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'MATCH_BEFORE'</span> <span class="sy0">=&gt;</span> <span class="st_h">''</span><span class="sy0">,</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'MATCH_AFTER'</span> <span class="sy0">=&gt;</span> <span class="st_h">'[a-zA-Z_][a-zA-Z0-9_]*'</span><span class="sy0">,</span></span></span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st_h">'MATCH_SPACES'</span> <span class="sy0">=&gt;</span> <span class="st_h">'[\s]*'</span>
-<span class="xtra li2"><span class="de2">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#41;</span></span></span>&nbsp; &nbsp; <span class="br0">&#41;</span></pre></td></tr></tbody></table>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>Please note that the settings discussed in this section are experimental and might be changed, removed or altered in their meaning at any time.</p>
-
-</div>
-
-<h4 id="language-file-tidying-up">4.3.12 Tidying Up</h4><div class="nav"><a href="#language-file-parser-control">Previous</a> | <a href="#language-file-sections">Top</a> | <a href="#lang-validation">Next</a></div>
-
-<p>All language files should end with:</p>
-
-<table class="php geshicode" style="font-family:monospace;"><thead><tr><td colspan="2" class="head">PHP code</td></tr></thead><tbody><tr class="li1"><td class="ln"><pre class="de1">1
-<span class="xtra li2"><span class="de2">2</span></span>3
-</pre></td><td class="de1"><pre class="de1"><span class="br0">&#41;</span><span class="sy0">;</span>
-<span class="xtra li2"><span class="de2">&nbsp;</span></span><span class="sy1">?&gt;</span></pre></td></tr></tbody></table>
-
-<p>That is the string content <code class="highlighted php"><span class="st0">&quot;<span class="es1">\n</span>);<span class="es1">\n</span>?&gt;<span class="es1">\n</span>&quot;</span></code>.</p>
-
-<div class="caution">
-
-<div class="caution-header">Caution:</div>
-
-<p>Make sure that there is EXACTLY one linebreak character at the end. If you accidentially include more
- you might end up with messages like &#8220;Headers already sent&#8221;.</p>
-
-</div>
-
-<h3 id="lang-validation">4.4 Validating your language file</h3><div class="nav"><a href="#language-file-tidying-up">Previous</a> | <a href="#language-files">Top</a> | <a href="#method-constant-reference">Next</a></div>
-
-<p>Since <abbr title="Generic Syntax Highlighter">GeSHi</abbr> 1.0.8 there is a new script <code>langcheck.php</code> in the contrib directory that scans all
-language files it finds in the geshi/ subdirectory of the <abbr title="Generic Syntax Highlighter">GeSHi</abbr> installation for mistakes.</p>
-
-<p>Please make sure that your language does not contain any mistakes that this script shows you when sending in
-your language file for inclusion into the official release as this saves work for us when including your file.
-Also you can be sure your language file will work as expected once your language file validates correctly.</p>
-
-<p>Please note that not all of the language files shipped with <abbr title="Generic Syntax Highlighter">GeSHi</abbr> are fully valid yet, but we&#8217;re working on it
-and are happy about every patch we get!</p>
-
-<h2 id="method-constant-reference">5 Method/Constant Reference</h2><div class="nav"><a href="#lang-validation">Previous</a></div>
-
-<p>I&#8217;m afraid I have been lying for a little while about this now! Since 1.0.7 I have been including a phpdoc API for
-the sourcecode in the <a href="api/index.html">api</a> directory, but have forgot to update the documentation! However, it is available,
-and may assist you in coding, especially for plugin coders.</p>
-
-<hr />
-
-<p>That&#8217;s all, folks!</p>
-
-<p>I&#8217;ve improved the documentation greatly from version 1.0.1, but there may still be problems with it, or it may still
-be confusing for you. Or perhaps I was just plain wrong about one point! If so, contact me and I&#8217;ll do my best to sort it out.</p>
-
-<p>In case you were wondering, I&#8217;ve finished development of the 1.0.X thread of <abbr title="Generic Syntax Highlighter">GeSHi</abbr>. The only releases I&#8217;ll make in this
-thread will be of the bug-fix/add language files type. In particular, version 1.0.2 was a &#8220;concept&#8221; release - testing
-how far I could take the highlighting idea (as well as ideas from others).</p>
-
-<p>I&#8217;m planning a code rewrite for 1.2.X, which will be based on a new engine - a &#8220;psuedo-tokenizer&#8221; engine. Hopefully
-it will massively reduce the server load and time taken (by almost eliminating regexps), while providing
-superior highlighting. But fear not! The interface and method names should all remain the same ^_^ (though I can&#8217;t
-say the same for language files!)</p>
-
-<p>And finally, a couple of people have been asking me: how did you generate that documentation? The amazing answer is: my
-brain. And yes, it took a long time, and I don&#8217;t recommend doing it this way. And yes, you can borrow the styles if
-you like, though flick me an e-mail if you do.</p>
-
-<p>Anyway, enough blather from me. Get <abbr title="Generic Syntax Highlighter">GeSHi</abbr> working for you already! :D</p>
-
-<div class="header">
-
-<dl>
-<dt>Authors:</dt>
-<dd>&copy; 2004 - 2007&#160;<a href="mailto:nigel@geshi.org">Nigel McNie</a></dd>
-
-<dd>&copy; 2007 - 2008&#160;<a href="mailto:BenBE@omorphia.de">Benny Baumann</a></dd>
-
-<dd>&copy; 2008&#160;<a href="mailto:mail@milianw.de">Milian Wolff</a></dd>
-
-<dt><abbr title="Generic Syntax Highlighter">GeSHi</abbr> Website:</dt>
-<dd><a href="http://qbnz.com/highlighter">http://qbnz.com/highlighter</a></dd>
-</dl>
-
-</div>
-
-<div class="footnotes">
-<hr />
-<ol>
-
-<li id="fn:xhtml-strict">
-<p>The PRE header (see <a href="#the-code-container">The Code Container</a>) is not valid <abbr title="Hypertext Markup Language">HTML</abbr>, you might want
-to use one of the other header types instead.&#160;<a href="#fnref:xhtml-strict" rev="footnote">&#8617;</a></p>
-</li>
-
-<li id="fn:php-version-note">
-<p>Support is granted for <abbr title="PHP: HTML Preprocessor">PHP</abbr> 4.3.0 and above, but especially 4.3.x cannot be guaranteed to
-work due to a lack of test systems. If you are forced to use such old <abbr title="PHP: HTML Preprocessor">PHP</abbr> versions complain at your hoster or
-contact us if you find compatibility issues so we can try to resolve them. It&#8217;s only <abbr title="PHP: HTML Preprocessor">PHP</abbr> 4.4.X and above that
-is verified to work.&#160;<a href="#fnref:php-version-note" rev="footnote">&#8617;</a></p>
-</li>
-
-<li id="fn:phpbb-note">
-<p>I am no longer working on this MOD, however if someone else wants to they can contact me for more
-information.&#160;<a href="#fnref:phpbb-note" rev="footnote">&#8617;</a></p>
-</li>
-
-<li id="fn:plugin-only">
-<p>Available as plugin only. In addition, some of the other entries mentioned
-here may only have <abbr title="Generic Syntax Highlighter">GeSHi</abbr> available as a plugin.&#160;<a href="#fnref:plugin-only" rev="footnote">&#8617;</a></p>
-</li>
-
-</ol>
-</div>
- </body>
-</html> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/docs/geshi-doc.txt b/libvpx/examples/includes/geshi/docs/geshi-doc.txt
deleted file mode 100644
index 4aae137..0000000
--- a/libvpx/examples/includes/geshi/docs/geshi-doc.txt
+++ /dev/null
@@ -1,1740 +0,0 @@
-[NOTE: This documentation has simply been copy-pasted from the HTML form and is NOT up to date, I recommend you
-read that instead]
-
-GeSHi Documentation
-Version 1.0.7.22
-
-Author: Nigel McNie, Benny Baumann
-Copyright: © 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann
-Email: nigel@geshi.org, BenBE@omorphia.de
-GeSHi Website: http://qbnz.com/highlighter
-
-This is the documentation for GeSHi - Generic Syntax Highlighter. The most modern version of this document is available on the web - go to http://qbnz.com/highlighter/documentation.php to view it.
-
-Any comments, questions, confusing points? Please contact me! I need all the information I can get to make the use of GeSHi and everything related to it (including this documentation) a breeze.
-Contents
-
- * 1. Introduction
- o 1.1 Features
- o 1.2 About GeSHi
- o 1.3 Credits
- o 1.4 Feedback
- * 2. The Basics
- o 2.1 Getting GeSHi
- o 2.2 Installing GeSHi
- + 2.2.1 Requirements
- + 2.2.2 Extracting GeSHi
- + 2.2.3 Installation
- o 2.3 Basic Usage
- * 3. Advanced Features
- o 3.1 The Code Container
- o 3.2 Line Numbers
- + 3.2.1 Enabling Line Numbers
- + 3.2.2 Styling Line Numbers
- + 3.2.3 Choosing a Start Number
- o 3.3 Using CSS Classes
- + 3.3.1 Enabling CSS Classes
- + 3.3.2 Setting the CSS Class/ID
- + 3.3.3 Getting the Stylesheet
- + 3.3.4 Using an External Stylesheet
- o 3.4 Changing Styles
- + 3.4.1 The Overall Styles
- + 3.4.2 Line Number Styles
- + 3.4.3 Setting Keyword Styles
- + 3.4.4 Setting Comment Styles
- + 3.4.5 Setting Other Styles
- o 3.5 Case Sensitivity and Auto Casing
- + 3.5.1 Auto Caps/Nocaps
- + 3.5.2 Setting Case Sensitivity
- o 3.6 Changing the Source/Language/Path/Charset
- + 3.6.1 Changing the Source Code
- + 3.6.2 Changing the Language
- + 3.6.3 Changing the Path
- + 3.6.4 Changing the Character Set
- + 3.6.5 Using load_from_file to change the language and source code
- o 3.7 Error Handling
- o 3.8 Disabling Styling of Some Lexics
- o 3.9 Setting the Tab Width
- o 3.10 Using Strict Mode
- o 3.11 Adding/Removing Keywords
- + 3.11.1 Adding a Keyword
- + 3.11.2 Removing a Keyword
- + 3.11.3 Adding a Keyword Group
- + 3.11.4 Removing a Keyword Group
- o 3.12 Headers and Footers for your code
- + 3.12.1 Keyword Substitution
- + 3.12.2 Setting Header Content
- + 3.12.3 Setting Footer Content
- + 3.12.4 Styling Header Content
- + 3.12.5 Styling Footer Content
- o 3.13 Keyword URLs
- + 3.13.1 Setting a URL for a Keyword Group
- + 3.13.2 Disabling URLs for a Keyword Group
- + 3.13.3 Disabling all URLs for Keywords
- + 3.13.4 Styling Links
- + 3.13.5 Setting the Link Target
- o 3.14 Using Contextual Importance
- o 3.15 Highlighting Special Lines "Extra"
- + Specifying the Lines to Highlight Extra
- + Styles for the Highlighted Lines
- o 3.16 Adding IDs to Each Line
- o 3.17 Getting the Time of Styling
- * 4 Language Files
- o 4.1 An Example Language File
- o 4.2 Language File Conventions
- o 4.3 Language File Sections
- + 4.3.1 The Header
- + 4.3.2 The First Indices
- + 4.3.3 Keywords
- + 4.3.4 Symbols and Case Sensitivity
- + 4.3.5 Styles for your Language Files
- + 4.3.6 URLs for Functions
- + 4.3.7 Object Orientation Support
- + 4.3.8 Using Regular Expressions
- + 4.3.9 Contextual Highlighting and Strict Mode
- + 4.3.10 Tidying Up
- * 5 Method/Constant Reference
-
-1: Introduction
-Top | Contents | Next | Previous
-
-GeSHi is exactly what the acronym stands for: a Generic Syntax Highlighter. As long as you have a language file for almost any computer language - whether it be a scripting language, object orientated, markup or anything in between - GeSHi can highlight it! GeSHi is extremely customisable - the same source can be highlighted multiple times in multiple ways - the same source even with a different language. GeSHi outputs XHTML strict compliant code*, and can make use of CSS to save on the amount of output. And what is the cost for all of this? You need PHP. That's all!
-
-*Most of the time. Some languages do not output XHTML strict code, and using line numbers with the PRE header is not legal either. These problems will be fixed in 1.2.
-1.1: Features
-Top | Contents | Next | Previous
-
-Here are some of the standout features of GeSHi:
-
- * Programmed in PHP: GeSHi is coded entirely in PHP. This means that where ever you have PHP, you can have GeSHi! Almost any free webhost supports PHP, and GeSHi works fine with PHP > 4.3.0*.
- * Support for many languages: GeSHi comes with about 100 languages, including PHP, HTML, CSS, Java, C, Lisp, XML, Perl, Python, ASM and many more!
- * XHTML compliant output: GeSHi produces XHTML compliant output, using stylesheets, so you need not worry about GeSHi ruining your claims to perfection in the standards department ;)
- * Highly customisable: GeSHi allows you to change the style of the output on the fly, use CSS classes or not, use an external stylesheet or not, use line numbering, change the case of output keywords... the list goes on and on!
- * Flexible: Unfortunately, GeSHi is quite load/time intensive for large blocks of code. However, you want speed? Turn off any features you don't like, pre-make a stylesheet and use CSS classes to reduce the amount of output and more - it's easy to strike a balance that suits you.
-
-This is just a taste of what you get with GeSHi - the best syntax highlighter for the web in the world!
-
-*Support is granted for PHP 4.3.0 and above, but especially 4.3.x cannot be guaranteed to work due to a lack of test systems. If you are forced to use such old PHP versions complain at your hoster or contact us if you find compatibility issues so we can try to resolve them. It's only PHP 4.4.X and above that is verified to work.
-1.2: About GeSHi
-Top | Contents | Next | Previous
-
-GeSHi started as a mod for the phpBB forum system, to enable highlighting of more languages than the available (which can be roughly estimated to exactly 0 ;)). However, it quickly spawned into an entire project on its own. But now it has been released, work continues on a mod for phpBB* - and hopefully for many forum systems, blogs and other web-based systems.
-
-*I am no longer working on this MOD, however if someone else wants to they can contact me for more information.
-
-Several systems are using GeSHi now, including:
-
- * Dokuwiki - An advanced wiki engine
- * gtk.php.net - Their manual uses GeSHi for syntax highlighting
- * WordPress - A powerful blogging system*
- * PHP-Fusion - A constantly evovling CMS
- * SQL Manager - A Postgres DBAL
- * Mambo - A popular open source CMS
- * MediaWiki - A leader in Wikis*
- * TikiWiki - A megapowerful Wiki/CMS
- * TikiPro - Another powerful Wiki based on Tikiwiki
- * RWeb - A site-building tool
-
-* Available as plugin only. In addition, some of the other entries mentioned here may only have GeSHi available as a plugin.
-
-GeSHi is the original work of Nigel McNie. The project was later handed over to Benny Baumann. Others have helped with aspects of GeSHi also, they're mentioned in the THANKS file.
-1.3: Credits
-Top | Contents | Next | Previous
-
-Many people have helped out with GeSHi, whether by creating language files, submitting bug reports, suggesting new ideas or simply pointing out a new idea or something I'd missed. All of these people have helped to build a better GeSHi, you can see them in the THANKS file.
-
-Do you want your name on this list? Why not make a language file, or submit a valid bug? Or perhaps help me with an added feature I can't get my head around, or suggest a new feature, or even port GeSHi to anothe language? There's lots you can do to help out, and I need it all :)
-1.4: Feedback
-Top | Contents | Next | Previous
-
-I need your feedback! ANYthing you have to say is fine, whether it be a query, congratulations, a bug report or complaint, I don't care! I want to make this software the best it can be, and I need your help! You can contact me in the following ways:
-
- * E-mail: nigel@geshi.org
- * Forums: Sourceforge.net Forums or GeSHi home forums
-
-Remember, any help I am grateful for :)
-2: The Basics
-Top | Contents | Next | Previous
-
-In this section, you'll learn a bit about GeSHi, how it works and what it uses, how to install it and how to use it to perform basic highlighting.
-2.1: Getting GeSHi
-Top | Contents | Next | Previous
-
-If you're reading this and don't have GeSHi, that's a problem ;). So, how do you get your hands on it? Visit http://qbnz.com/highlighter/downloads.php to obtain the latest version.
-2.2: Installing GeSHi
-Top | Contents | Next | Previous
-
-Installing GeSHi is a snap, even for those most new to PHP. There's no tricks involved. Honest!
-2.2.1: Requirements
-Top | Contents | Next | Previous
-
-GeSHi requires the following to be installable:
-
- * PHP. It's untested with anything other below 4.4.X. I hope to extend this range soon. I see no reason why it won't work with any version of PHP above 4.3.0.
- * Approximately 2 megabytes of space. The actual script is small - around 150K - but most of the size comes from the large number of language files (over 100!). If you're pushed for space, make sure you don't upload to your server the docs/ or contrib/ directory, and you may want to leave out any language files that don't take your fancy either.
-
-As you can see, the requirements are very small. If GeSHi does NOT work for you in a particular version of PHP, let me know why and I'll fix it.
-
-Packages come in .zip, .tar.gz and .tar.bz2 format, so there's no complaining about whether it's available for you. *nix users probably want .tar.gz or .tar.bz2 and windows users probably want .zip.
-2.2.2: Extracting GeSHi
-Top | Contents | Next | Previous
-
-To extract GeSHi in Linux (.tar.gz):
-
- 1. Open a shell
- 2. cd to the directory where the archive lies
- 3. Type tar -xzvf [filename] where [filename] is the name of the archive (typically GeSHi-1.X.X.tar.gz)
- 4. GeSHi will be extracted to its own directory
-
-To extract GeSHi in Windows (.zip):
-
- 1. Open Explorer
- 2. Navigate to the directory where the archive lies
- 3. Extract the archive. The method you use will depend on your configuration. Some people can right-click upon the archive and select "Extract" from there, others may have to drag the archive and drop it upon an extraction program.
-
-To extract from .zip you'll need an unzipping program - unzip in Linux, or Winzip, Winrar or similar for Windows.
-2.2.3: Installation
-Top | Contents | Next | Previous
-
-GeSHi is nothing more than a PHP class with related language support files. Those of you familiar with PHP can then guess how easy the installation will be: simply copy it into your include path somewhere. You can put it wherever you like in this include path. I recommend that you put the language files in a subdirectory of your include path too - perhaps the same subdirectory that geshi.php is in. Remember this path for later.
-
-If you don't know what an include path is, don't worry. Simply copy GeSHi to your webserver. So for example, say your site is at http://mysite.com/myfolder, you can copy GeSHi to your site so the directory structure is like this:
-
-http://mysite.com/myfolder/geshi/[language files]
-http://mysite.com/myfolder/geshi.php
-
-Or you can put it in any subdirectory you like:
-
-http://mysite.com/myfolder/includes/geshi/[language files]
-http://mysite.com/myfolder/includes/geshi.php
-
-Caution:
-
-When using GeSHi on a live site, the only directory required is the geshi/ subdirectory. Both contrib/ and docs/ are worthless, and furthermore, as some people discovered, one of the files in contrib had a security hole (fixed as of 1.0.7.3). I suggest you delete these directories from any live site they are on.
-2.3: Basic Usage
-Top | Contents | Next | Previous
-
-Use of GeSHi is very easy. Here's a simple example:
-//
-// Include the GeSHi library
-//
-include_once('geshi.php');
-
-//
-// Define some source to highlight, a language to use
-// and the path to the language files
-//
-$source = '$foo = 45;
-for ( $i = 1; $i < $foo; $i++ )
-{
- echo "$foo<br />\n";
- --$foo;
-}';
-$language = 'php';
-//
-// Create a GeSHi object
-//
-$geshi =& new GeSHi($source, $language);
-
-//
-// And echo the result!
-//
-echo $geshi->parse_code();
-
-As you can see, there's only three really important lines:
-include_once('geshi.php');
-
-This line includes the GeSHi class for use
-$geshi = new GeSHi($source, $language);
-
-This line creates a new GeSHi object, holding the source and the language you want to use for highlighting.
-echo $geshi->parse_code();
-
-This line spits out the result :)
-
-So as you can see, simple usage of GeSHi is really easy. Just create a new GeSHi object and get the code!
-
-Since version 1.0.2, there is a function included with GeSHi called geshi_highlight. This behaves exactly as the php function highlight_string behaves - all you do is pass it the language you want to use to highlight and the path to the language files as well as the source. Here are some examples:
-// Simply echo the highlighted code
-geshi_highlight($source, 'php', $path);
-
-// Get the code back, for use later
-$code = geshi_highlight($source, 'java', $path, true)
-
-// Check if there is an error with parsing this code
-ob_start();
-$result = geshi_highlight($source, 'perl', $path);
-$code = ob_get_contents();
-ob_end_clean();
-if ( !$result )
-{
- // There was an error with highlighting...
-}
-else
-{
- // All OK :)
-}
-
-However, these are really simple examples and doesn't even begin to cover all the advanced features of GeSHi. If you want to learn more, continue on to section 3: Advanced Features.
-3: Advanced Features
-Top | Contents | Next | Previous
-
-This section documents the advanced features of GeSHi - strict mode, using CSS classes, changing styles on the fly, disabling highlighting of some things and more.
-
-In this section there are many code snippets. For all of these, you should assume that the GeSHi library has been included, and a GeSHi object has been created and is referenced by the variable $geshi. Normally, the source, language and path used are arbitary.
-3.1 The Code Container
-Top | Contents | Next | Previous
-
-The Code Container has a fundamental effect on the layout of your code before you even begin to style. What is the Code Container? It's the bit of markup that goes around your code to contain it. By default your code is surrounded by a <pre>, but you can also specify a <div>.
-
-The <pre> header is the default. If you're familiar with HTML you'll know that whitespace is rendered "as is" by a <pre> element. The advantage for you is that if you use <pre> the whitespace you use will appear pretty much exactly how it is in the source, and what's more GeSHi won't have to add a whole lot of <br />'s and non-breaking spaces (&nbsp;) to your code to indent it. This saves you source code (and your valuable visitors waiting time and your bandwidth).
-
-But if you don't like <pre> or it looks stupid in your browser no matter what styles you try to apply to it or something similar, you might want to use a <div> instead. A <div> will result in more source - GeSHi will have to insert whitespace markup - but in return you can wrap long lines of code that would otherwise have your browser's horizontal scrollbar appear. Of course with <div> you can *not* wrap lines if you please. The highlighter demo at the GeSHi home page uses the <div> approach for this reason.
-
-At this stage there isn't an option to wrap the code in <code> tags (unless you use the function geshi_highlight), partly because of the inconsistent and unexpected ways stuff in <code> tags is highlighted. Besides, <code> is an inline element. But this may become an option in future versions.
-
-As of GeSHi 1.0.7.2 there is a new header type, that specifies that the code should not be wrapped in anything at all.
-
-Another requested addition has been made in GeSHi 1.0.7.20 to force GeSHi to create a block around the highlighted source even if this wasn't necessary, thus styles that are applied to the output of GeSHi can directly influence the code only even if headers and footers are present.
-
-To change/set the header to use, you call the set_header_type() method:
-$geshi->set_header_type(GESHI_HEADER_DIV);
-// or...
-$geshi->set_header_type(GESHI_HEADER_PRE); // or...
-$geshi->set_header_type(GESHI_HEADER_NONE);
-
-Those are the only three arguments you should pass to set_header_type. Passing anything else may cause inconsistencies in what is used as the Code Container (although it *should* simply use a <pre>). Better not to risk it.
-Note:
-
-GESHI_HEADER_DIV, GESHI_HEADER_PRE and GESHI_HEADER_NONE are constants, so don't put them in strings!
-Caution:
-
-The default styles for the <pre> and <div> will be different, especially if you use line numbers!. I have found that a <pre> results in code that is smaller than for that of a <div>, you should rectify this difference by using set_overall_style() if you need to. But be aware of this difference for if you are changing the header type!
-3.2: Line Numbers
-Top | Contents | Next | Previous
-
-GeSHi has the ability to add line numbers to your code (see the demo available at http://qbnz.com/highlighter/demo.php to see what can be achieved). Line numbers are a great way to make your code look professional, especially if you use the fancy line numbers feature.
-3.2.1: Enabling Line Numbers
-Top | Contents | Next | Previous
-
-To highlight a source with line numbers, you call the enable_line_numbers() method:
-$geshi->enable_line_numbers($flag);
-
-Where $flag is one of the following:
-
- * GESHI_NORMAL_LINE_NUMBERS - Use normal line numbering
- * GESHI_FANCY_LINE_NUMBERS - Use fancy line numbering
- * GESHI_NO_LINE_NUMBERS - Disable line numbers (default)
-
-Normal line numbers means you specify a style for them, and that style gets applied to all of them. Fancy line numbers means that you can specify a different style for each nth line number. You change the value of n (default 5):
-$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 37);
-
-The second parameter is not used in any other mode. Setting it to 0 is the same as simply using normal line numbers. Setting it to 1 applies the fancy style to every line number.
-Note:
-
-The values above are CONSTANTS - so don't put them in strings!
-3.2.2 Styling Line Numbers
-Top | Contents | Next | Previous
-
-As of GeSHi 1.0.2, line numbers are added by the use of ordered lists. This solves the old issues of line number styles inheriting from styles meant for the code. Also, this solves an important issue about selecting code. For example, line numbers look nice, but when you go to select the code in your browser to copy it? You got the line numbers too! Not such a good thing, but thankfully this issue is now solved. What is the price? Unfortunately the whole way that styles are inherited/used has changed for those of you who were familiar with 1.0.1, and there is quite a bit more HTML involved. So think carefully about these things before you enable line numbers.
-
-Now, onto how to style line numbers:
-
-Styles are set for line numbers using the set_line_style() method:
-$geshi->set_line_style('background: #fcfcfc;');
-
-If you're using Fancy Line Numbers mode, you pass a second string for the style of the nth line number:
-$geshi->set_line_style('background: #fcfcfc;', 'background: #f0f0f0;');
-
-The second style will have no effect if you're not using Fancy Line Numbers mode.
-
-By default, the styles you pass overwrite the current styles. Add a boolean "true" after the styles you specify to combine them with the current styles:
-$geshi->set_line_style('background: red;', true);
-// or, for fancy line numbers
-$geshi->set_line_style('background: red;', 'background: blue;', true);
-Note:
-
-Due to a bug with Firefox the issue that should have been fixed with 1.0.2 has reappeared in another form as Firefox includes extra text\markup into plaintext versions of webpage copies. This can sometimes be useful (actually it's used to get the plaintext version of this documentation), but more often is quite annoying. Best practice so far is to either not use line numbers, or offer the visitor of your page a plaintext version of your source. To learn more have a look at the SF.net BugTracker Issue #1651996. This will hopefully be fixed in GeSHi version 1.2 or as soon as Firefox provides webdevelopers with adequate ways to control this feature - whichever comes first!
-Caution:
-
-When you set line number styles, the code will inherit those styles! This is the main issue to come out of the 1.0.2 release. If you want your code to be styled in a predictable manner, you'll have to call the set_code_style() method to rectify this problem.
-
-Note also that you cannot apply background colours to line numbers unless you use set_overall_style(). Here's how you'd style:
-
- 1. Use set_overall_style() to style the overall code block. For example, you can set the border style/colour, any margins and padding etc. using this method. In addition: set the background colour for all the line numbers using this method.
- 2. Use set_line_style() to style the foreground of the line numbers. For example, you can set the colour, weight, font, padding etc. of the line numbers using this method.
- 3. Use set_code_style() to explicitly override the styles you set for line numbers using set_line_style. For example, if you'd set the line numbers to be bold (or even if you'd only set the fancy line number style to be bold), and you didn't actually want your code to be bold, you'd make sure that font-weight: normal; was in the stylesheet rule you passed to set_code_style
-
-This is the one major change from GeSHi 1.0.1 - make sure you become familiar with this, and make sure that you check any code you have already styled with 1.0.1 when you upgrade to make sure nothing bad happens to it.
-3.2.3: Choosing a Start Number
-Top | Contents | Next | Previous
-
-As of GeSHi 1.0.2, you can now make the line numbers start at any number, rather than just 1. This feature is useful if you're highlighting code from a file from around a certain line number in that file, as an additional guide to those who will view the code. You set the line numbers by calling the start_line_numbers_at() method:
-$geshi->start_line_numbers_at($number);
-
-$number must be a positive integer (or zero). If it is not, GeSHi will convert it anyway.
-
-If you have not enabled line numbers, this will have no effect.
-Caution:
-
-Although I'd like GeSHi to have XHTML strict compliance, this feature will break compliancy (however transitional compliancy remains). This is because the only widely supported way to change the start value for line numbers is by using the start="number" attribute of the <ol> tag. Although CSS does provide a mechanism for doing this, it is only supported in Opera versions 7.5 and above (not even Firefox supports this).
-3.3: Using CSS Classes
-Top | Contents | Next | Previous
-
-Using CSS to highlight your code instead of in-lining the styles is a definate bonus. Not only is it more compliant (the w3c is deprecating the style attribute in XHTML 2.0) but it results in far less outputted code - up to a whopping 90% saving - which makes a *huge* difference to those unlucky of us on modems!
-3.3.1: Enabling CSS Classes
-Top | Contents | Next | Previous
-
-By default, GeSHi doesn't use the classes, so it's easy just to whack out some highlighted code if you need without worrying about stylesheets. However, if you're a bit more organised about it, you should use the classes ;). To turn the use of classes on, you call the enable_classes() method:
-$geshi->enable_classes();
-
-If you want to turn classes OFF for some reason later:
-$geshi->enable_classes(false);
-
-If classes are enabled when parse_code() is called, then the resultant source will use CSS classes in the output, otherwise it will in-line the styles. The advantages of using classes are great - the reduction in source will be very noticeable, and what's more you can use one stylesheet for several different highlights on the same page. In fact, you can even use an external stylesheet and link to that, saving even more time and source (because stylesheets are cached by browsers).
-Note:
-
-There have been problems with inline styles and the Symbol Highlighting added in 1.0.7.21. If you can you should therefore turn CSS classes ON to avoid those issues.
-Caution:
-
-This should be the very first method you call after creating a new GeSHi object! That way, various other methods can act upon your choice to use classes correctly. In theory, you could call this method just before parsing the code, but this may result in unexpected behaviour.
-3.3.2: Setting the CSS class and ID
-Top | Contents | Next | Previous
-
-You can set an overall CSS class and id for the code. This is a good feature that allows you to use the same stylesheet for many different snippets of code. You call set_overall_class() and set_overall_id to accomplish this:
-$geshi->set_overall_class('mycode');
-$geshi->set_overall_id('dk48ck');
-
-The default classname is the name of the language being used. This means you can use just the one stylesheet for all sources that use the same language, and incidentally means that you probably won't have to call these methods too often.
-
-CSS IDs are supposed to be unique, and you should use them as such. Basically, you can specify an ID for your code and then use that ID to highlight that code in a unique way. You'd do this for a block of code that you expressly wanted to be highlighted in a different way (see the section below on gettting the stylesheet for your code for an example).
-3.3.3: Getting the stylesheet for your code
-Top | Contents | Next | Previous
-
-The other half of using CSS classes is getting the stylesheet for use with the classes. GeSHi makes it very easy to get a stylesheet for your code, with one easy method call:
-$geshi->enable_classes();
-
-// Here we have code that will spit out a header for
-// a stylesheet. For example:
-
-echo '<html>
-<head><title>Code</title>
-<style type="text/css">
-<!--';
-
-// Echo out the stylesheet for this code block
-
-echo $geshi->get_stylesheet();
-
-// And continue echoing the page
-
-echo '-->
-</style></head>
-<body>';
-
-The get_stylesheet() method gets the stylesheet for your code in one easy call. All you need to do is output it in the correct place. As you can also see, you don't even have to enable class usage to get the stylesheet nessecary either - however not enabling classes but using the stylesheet may result in problems later.
-
-By default, get_stylesheet() tries to echo the least amount of code possible. Although currently it doesn't check to see if a certain lexic is even in the source, you can expect this feature in the future. At least for the present however, if you explicitly disable the highlighting of a certain lexic, or disable line numbers, the related CSS will not be outputted. This may be a bad thing for you perhaps you're going to use the stylesheet for many blocks of code, some with line numbers, others with some lexic enabled where this source has it disabled. Or perhaps you're building an external stylesheet and want all lexics included. So to get around this problem, you do this:
-$geshi->get_stylesheet(false);
-
-This turns economy mode off, and all of the stylesheet will be outputted regardless.
-
-Now lets say you have several snippets of code, using the same language. In most of them you don't mind if they're highlighted the same way (in fact, that's exactly what you want) but in one of them you'd like the source to be highlighted differently. Here's how you can do that:
-// assume path is the default "geshi/" relative to the current directory
-$geshi1 = new GeSHi($source1, $lang);
-$geshi2 = new GeSHi($source2, $lang);
-$geshi3 = new GeSHi($source3, $lang);
-
-// Turn classes on for all sources
-$geshi1->enable_classes();
-$geshi2->enable_classes();
-$geshi3->enable_classes();
-
-// Make $geshi3 unique
-$geshi3->set_overall_id('different');
-
-//
-// Methods are called on $geshi3 to change styles...
-//
-
-echo '<html>
-<head><title>Code</title>
-<style type="text/css">
-<!--
-';
-
-// Get the nessecary stylesheets
-echo $geshi1->get_stylesheet();
-echo $geshi3->get_stylesheet();
-
-echo '-->
-</style></head>
-<body>';
-
-
-echo 'Code snippet 1:';
-echo $geshi1->parse_code();
-echo 'Code snippet 2 (same highlighting as 1):';
-echo $geshi2->parse_code();
-echo 'Code snippet 3 (DIFFERENT highlighting):';
-echo $geshi3->parse_code();
-
-echo '</body></html>';
-
-Before version 1.0.2, you needed to set the class of the code you wanted to be unique to the empty string. This limitation has been removed in version 1.0.2 - if you set the ID of a block of code, all styling will be done based on that ID alone.
-3.3.4: Using an External Stylesheet
-Top | Contents | Next | Previous
-
-An external stylesheet can reduce even more the amount of code needed to highlight some source. However there are some drawbacks with this. To use an external stylesheet, it's up to you to link it in to your document, normally with the following HTML:
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="url_to_stylesheet.css" />
-
-In your external stylesheet you put CSS declarations for your code. Then just make sure you're using the correct class (use set_overall_class() to ensure this) and this should work fine.
-
-This method is great if you don't mind the source always being highlighted the same (in particular, if you're making a plugin for a forum/wiki/other system, using an external stylesheet is a good idea!). It saves a small amount of code and your bandwidth, and it's relatively easy to just change the stylesheet should you need to. However, using this will render the methods that change the styles of the code useless, because of course the stylesheet is no longer being dynamically generated. You can still disable highlighting of certain lexics dynamically, however.
-Note:
-
-As of version 1.0.2, GeSHi comes with a contrib/ directory, which in it contains a "wizard" script for creating a stylesheet. Although this script is by no means a complete solution, it will create the necessary rules for the basic lexics - comments, strings for example. Things not included in the wizard include regular expressions for any language that uses them (PHP and XML are two languages that use them), and keyword-link styles. However, this script should take some of the tedium out of the job of making an external stylesheet. Expect a much better version of this script in version 1.2!
-3.4: Changing Styles
-Top | Contents | Next | Previous
-
-One of the more powerful features of GeSHi is the ability to change the style of the output dynamically. Why be chained to the boring styles the language authors make up? You can change almost every single aspect of highlighted code - and can even say whether something is to be highlighted at all.
-
-If you're confused about "styles", you probably want to have a quick tutorial in them so you know what you can do with them. Checkout the homepage of CSS at http://www.w3.org/Style/CSS.
-3.4.1: The Overall Styles
-Top | Contents | Next | Previous
-
-The code outputted by GeSHi is either in a <div> or a <pre> (see the section entitled "The Code Container"), and this can be styled.
-$geshi->set_overall_style('... styles ...');
-
-Where styles is a string containing valid CSS declarations. By default, these styles overwrite the current styles, but you can change this by adding a second parameter:
-$geshi->set_overall_style('color: blue;', true);
-
-The default styles "shine through" wherever anything isn't highlighted. Also, you can apply more advanced styles, like position: (fixed|relative) etc, because a <div>/<pre> is a block level element.
-Note:
-
-Remember that a <div> will by default have a larger font size than a <pre>, as discussed in the section "The Code Container".
-3.4.2: Line Number Styles
-Top | Contents | Next | Previous
-
-You may wish to refer to the section Styling Line Numbers before reading this section.
-
-As of version 1.0.2, the way line numbers are generated is different, so therefore the way that they are styled is different. In particular, now you cannot set the background style of the fancy line numbers to be different from that of the normal line numbers.
-
-Line number styles are set by using the method set_line_style:
-$geshi->set_line_style($style1, $style2);
-
-$style1 is the style of the line numbers by default, and $style2 is the style of the fancy line numbers.
-Caution:
-
-Things have changed since 1.0.1! This note is very important - please make sure you check this twice before complaining about line numbers!
-
-Because of the way that ordered lists are done in HTML, there really isn't normally a way to style the actual numbers in the list. I've cheated somewhat with GeSHi - I've made it possible to use CSS to style the foreground of the line numbers. So therefore, you can change the color, font size and type, and padding on them. If you want to have a pretty background, you must use set_overall_style() to do this, and use set_code_style() to style the actual code! This is explained in the section above: Styling Line Numbers.
-
-In addition, the styles for fancy line numbers is now the difference between the normal styles and the styles you want to achieve. For example, in GeSHi prior to 1.0.2 you may have done this to style line numbers:
-$geshi->set_line_style('color: red; font-weight: bold;', 'color: green; font-weight: bold');
-
-Now you instead can do this:
-$geshi->set_line_style('color: red; font-weight: bold;', 'color: green;');
-
-The font-weight: bold; will automatically carry through to the fancy styles. This is actually a small saving in code - but the difference may be confusing for anyone using 1.0.1 at first.
-3.4.3: Setting Keyword Styles
-Top | Contents | Next | Previous
-
-Perhaps the most regular change you will make will be to the styles of a keyword set. In order to change the styles for a particular set, you'll have to know what the set is called first. Sets are numbered from 1 up. Typically, set 1 contains keywords like if, while, do, for, switch etc, set 2 contains null, false, true etc, set 3 contains function inbuilt into the language (echo, htmlspecialchars etc. in PHP) and set 4 contains data types and similar variable modifiers: int, double, real, static etc. However these things are not fixed, and you should check the language file to see what key you want. Having a familiarity with a language file is definately a plus for using it.
-
-To change the styles for a keyword set, call the set_keyword_group_style() method:
-$geshi->set_keyword_group_style($group, $styles);
-
-Where $group is the group to change the styles for and $styles is a string containing the styles to apply to that group.
-
-By default, the styles you pass overwrite the current styles. Add a boolean true after the styles you specify to combine them with the current styles:
-$geshi->set_keyword_group_style(3, 'color: white;', true);
-3.4.4: Setting Comment Styles
-Top | Contents | Next | Previous
-
-To change the styles for a comment group, call the set_comments_style() method:
-$geshi->set_comments_style($group, $styles);
-
-Where $group is either a number corresponding to a single-line comment, or the string 'MULTI' to specify multiline comments:
-$geshi->set_comments_style(1, 'font-style: italic;');
-$geshi->set_comments_style('MULTI', 'display: hidden;');
-
-By default, the styles you pass overwrite the current styles. Add a boolean true after the styles you specify to combine them with the current styles:
-$geshi->set_comments_style(1, 'font-weight: 100;', true);
-Note:
-
-In 1.0.7.22 a new kind of Comments called "COMMENT_REGEXP" has been added. Those are handled by setting single line comment styles.
-3.4.5: Setting Other Styles
-Top | Contents | Next | Previous
-
-GeSHi can highlight many other aspects of your source other than just keywords and comments. Strings, Numbers, Methods and Brackets among other things can all also be highlighted. Here are the related methods:
-$geshi->set_escape_characters_style($styles[, $preserve_defaults]);
-$geshi->set_symbols_style($styles[, $preserve_defaults]);
-$geshi->set_strings_style($styles[, $preserve_defaults]);
-$geshi->set_numbers_style($styles[, $preserve_defaults]);
-$geshi->set_methods_style($key, $styles[, $preserve_defaults]);
-$geshi->set_regexps_style($key, $styles[, $preserve_defaults]);
-
-$styles is a string containing valid stylesheet declarations, while $preserve_defaults should be set to true if you want your styles to be merged with the previous styles. In the case of set_methods_style, you should select a group to set the styles of, check the language files for the number used for each "object splitter".
-
-Like this was possible for set_method_style a new parameter has been introduced for set_symbols_style too which allows you to select the group of symbols for which you'd like to change your style. $geshi->set_symbols_style($styles[, $preserve_defaults[, $group]]);
-If the third parameter is not given, group 0 is assumed. Furthermore you should note that any changes to group 0 are also reflected in the bracket style, i.e. a pass-through call to set_bracket_style is made.
-3.5: Case Sensitivity and Auto Casing
-Top | Contents | Next | Previous
-
-Controlling the case of the outputted source is an easy job with GeSHi. You can control which keywords are converted in case, and also control whether keywords are checked in a case sensitive manner.
-3.5.1: Auto-Caps/Nocaps
-Top | Contents | Next | Previous
-
-Auto-Caps/Nocaps is a nifty little feature that capitalises or lowercases automatically certain lexics when they are styled. I dabble in QuickBASIC, a dialect of BASIC which is well known for it's capatalisation, and SQL is another language well known for using caps for readability.
-
-To change what case lexics are rendered in, you call the set_case_keywords() method:
-$geshi->set_case_keywords($caps_modifier);
-
-The valid values to pass to this method are:
-
- * GESHI_CAPS_NO_CHANGE - Don't change the case of any lexics, leave as they are found
- * GESHI_CAPS_UPPER - Uppercase all lexics found
- * GESHI_CAPS_LOWER - Lowercase all lexics found
-
-Caution:
-
-When I say "lexic", I mean "keywords". Any keyword in any keyword array will be modified using this option! This is one small area of inflexibility I hope to fix in 1.2.X.
-
-I suspect this will only be used to specify GESHI_CAPS_NO_CHANGE to turn off autocaps for languages like SQL and BASIC variants, like so:
-$geshi = new GeSHi($source, 'sql');
-$geshi->set_case_keywords(GESHI_CAPS_NO_CHANGE); // don't want keywords capatalised
-
-All the same, it can be used for some interesting effects:
-$geshi = new GeSHi($source, 'java');
-// Anyone who's used java knows how picky it is about CapitalLetters...
-$geshi->set_case_keywords(GESHI_CAPS_LOWER);
-// No *way* the source will look right now ;)
-3.5.2: Setting Case Sensitivity
-Top | Contents | Next | Previous
-
-Some languages, like PHP, don't mind what case function names and keywords are in, while others, like Java, depend on such pickiness to maintain their bad reputations ;). In any event, you can use the set_case_sensitivity to change the case sensitiveness of a particular keyword group from the default:
-$geshi->set_case_sensitivity($key, $sensitivity);
-
-Where $key is the key of the group for which you wish to change case sensitivness for (see the language file for that language), and $sensitivity is a boolean value - true if the keyword is case sensitive, and false if not.
-3.6: Changing the Source, Language, Config Options
-Top | Contents | Next | Previous
-
-What happens if you want to change the source to be highlighted on the fly, or the language. Or if you want to specify any of those basic fields after you've created a GeSHi object? Well, that's where these methods come in.
-3.6.1: Changing the Source Code
-Top | Contents | Next | Previous
-
-To change the source code, you call the set_source() method:
-$geshi->set_source($newsource);
-
-Example:
-$geshi = new GeSHi($source1, 'php');
-
-// Method calls to specify various options...
-
-$code1 = $geshi->parse_code();
-
-$geshi->set_source($source2);
-$code2 = $geshi->parse_code();
-3.6.2: Changing the Language
-Top | Contents | Next | Previous
-
-What happens if you want to change the language used for highlighting? Just call set_language():
-$geshi->set_language('newlanguage');
-
-Example:
-$geshi = new GeSHi($source, 'php');
-
-$code = $geshi->parse_code();
-
-// Highlight GeSHi's output
-$geshi->set_source($code);
-$geshi->set_language('html4strict');
-$geshi->enable_classes(false);
-echo $geshi->parse_code();
-Note:
-
-Names are case-insensitive - they will be converted to lower case to match a language file however. So if you're making a language file, remember it should have a name in lower case.
-Note:
-
-What you pass to this method is the name of a language file, minus the .php extension. If you're writing a plugin for a particular application, it's up to you to somehow convert user input into a valid language name.
-Caution:
-
-GeSHi include()s the language file, so be careful to make sure that users can't pass some wierd language name to include any old script! GeSHi tries to strip non-valid characters out of a language name, but you should always do this your self anyway. In particular, language files are always lower-case, with either alphanumeric characters, dashes or underscores in their name.
-
-At the very least, strip "/" characters out of a language name.
-3.6.3: Changing the Language Path
-Top | Contents | Next | Previous
-
-What happens if all of a sudden you want to use language files from a different directory from the current language file location? You call the set_language_path() method:
-$geshi->set_language_path($newpath);
-
-It doesn't matter whether the path has a trailing slash after it or not - only that it points to a valid folder. If it doesn't, that's your tough luck ;)
-3.6.4: Changing the Character Set
-Top | Contents | Next | Previous
-Note:
-
-As of GeSHi 1.0.7.18, you don't need to use this, as htmlspecialchars is not being used due to a security flaw in it (that is unpatched in even the most recent PHP4 versions, and in PHP5 < 5.2). As long as you set the encoding properly with a php header() call, your foreign characters will be displayed correctly.
-
-As of version 1.0.3, you can use the method set_encoding to specify the character set that your source is in. Valid names are those names that are valid for the PHP function htmlentities():
-$geshi->set_encoding($encoding);
-
-There is a table of valid strings for $encoding at the php.net manual linked to above. If you do not specify an encoding, or specify an invalid encoding, the character set used is ISO-8859-1.
-Using load_from_file to Change the Language and Source Code
-Top | Contents | Next | Previous
-
-As of GeSHi 1.0.5, you can use the method load_from_file to load the source code and language from a file. Simply pass this method a file name and it will attempt to load the source and set the language.
-$geshi->load_from_file($file_name, $lookup);
-
-$file_name is the file name to use, and $lookup is an optional parameter that contains a lookup array to use for deciding which language to choose. You can use this to override GeSHi's default lookup array, which may not contain the extension of the file you're after, or perhaps does have your extension but under a different language. The lookup array is of the form:
-
-array(
- * 'lang_name' => array('extension', 'extension', ...),
- * 'lang_name' ...
- * );
-
-Also, you can use the method get_language_name_from_extension if you need to convert a file extension to a valid language name. This method will return the empty string if it could not find a match in the lookup, and like load_from_file it accepts an optional second parameter that contains a lookup array.
-3.7: Error Handling
-Top | Contents | Next | Previous
-
-What happens if you try to highlight using a language that doesn't exist? Or if GeSHi can't read a required file? The results you get may be confusing. You may check your code over and over, and never find anything wrong. GeSHi provides ways of finding out if GeSHi itself found anything wrong with what you tried to do. After highlighting, you can call the error() method:
-$geshi = new GeSHi('hi', 'thisLangIsNotSupported');
-
-echo $geshi->error(); // echoes error message
-
-The error message you will get will look like this:
-
- GeSHi Error: GeSHi could not find the language thisLangIsNotSupported (using path geshi/) (code 2)
-
-The error outputted will be the last error GeSHi came across, just like how mysql_error() works.
-3.8: Disabling styling of some Lexics
-Top | Contents | Next | Previous
-
-One disadvantage of GeSHi is that for large source files using complex languages, it can be quite slow with every option turned on. Although future releases will concentrate on the speed/resource side of highlighting, for now you can gain speed increases by disabling some of the highlighting options. This is done by using a series of set_*_highlighting methods:
-
- * set_keyword_group_highlighting($group, $flag): Sets whether a particular $group of keywords is to be highlighted or not. Consult the necessary language file(s) to see what $group should be for each group (typically a positive integer). $flag is false if you want to disable highlighting of this group, and true if you want to re-enable higlighting of this group. If you disable a keyword group then even if the keyword group has a related URL one will not be generated for that keyword.
- * set_comments_highlighting($group, $flag): Sets whether a particular $group of comments is to be highlighted or not. Consult the necessary language file(s) to see what $group should be for each group (typically a positive integer, or the string 'MULTI' for multiline comments. $flag is false if you want to disable highlighting of this group, and true if you want to re-enable highlighting of this group.
- * set_regexps_highlighting($regexp, $flag): Sets whether a particular $regexp is to be highlighted or not. Consult the necessary language file(s) to see what $regexp should be for each regexp (typically a positive integer, or the string 'MULTI' for multiline comments. $flag is false if you want to disable highlighting of this group, and true if you want to re-enable highlighting of this group.
- * The following methods:
- o set_escape_characters_highlighting($flag)
- o set_symbols_highlighting($flag)
- o set_strings_highlighting($flag)
- o set_numbers_highlighting($flag)
- o set_methods_highlighting($flag)
- Work on their respective lexics (e.g. set_methods_highlighting will disable/enable highlighting of methods). For each method, if $flag is false then the related lexics will not be highlighted at all (this means no HTML will surround the lexic like usual, saving on time and bandwidth.
-
-In case all highlighting should be disabled or reenabled GeSHi provides two methods called disable_highlighting() and enable_highlighting($flag). The optional paramter $flag has been added in 1.0.7.21 and specifies the desired state, i.e. true (default) to turn all highlighting on, or false to turn all highlighting off. Since 1.0.7.21 the method disnable_highlighting() has become deprecated.
-3.9: Setting the Tab Width
-Top | Contents | Next | Previous
-
-If you're using the <pre> header, tabs are handled automatically by your browser, and in general you can count on good results. However, if you're using the <div> header, you may want to specify a tab width explicitly.
-
-Note that tabs created in this fashion won't be like normal tabs - there won't be "tab-stops" as such, instead tabs will be replaced with the specified number of spaces.
-
-To change the tab width, you call the set_tab_width() method:
-$geshi->set_tab_width($width);
-
-Where $width is the width in spaces that you'd like tabs to be.
-3.10: Using Strict Mode
-Top | Contents | Next | Previous
-
-Some languages like to get tricky, and jump in and out of the file that they're in. For example, the vast majority of you reading this will have used a PHP file. And you know that PHP code is only executed if it's within delimiters like <?php and ?> (there are others of course...). So what happens if you do the following in a php file?
-<img src="<?php echo rand(1, 100) ?>" />
-
-Well normally using GeSHi with PHP, or using a bad highlighter, you'll end up with this:
-<img src="<?php echo rand(1, 100) ?>" />
-
-What a mess! Especially if you're being slack about where you're putting your quotes, you could end up with the rest of your file as bright red. Fortunately, you can tell GeSHi to be "strict" about just when it highlights and when it does not, using the enable_strict_mode method:
-$geshi->enable_strict_mode($mode);
-
-Where $mode is true or not specified to enable strict mode, or false to disable strict mode if you've already turned it and don't want it now.
-
-Here's the result: much better!
-<img src="<?php echo rand(1, 100) ?>" />
-3.11: Adding/Removing Keywords
-Top | Contents | Next | Previous
-
-Lets say that you're working on a large project, with many files, many classes and many functions. Perhaps also you have the source code on the web and highlighted by GeSHi, perhaps as a front end to CVS, as a learning tool, something to refer to, whatever. Well, why not highlight the names of the functions and classes *your* project uses, as well as the standard functions and classes? Or perhaps you're not interested in highlighting certain functions, and would like to remove them? Or maybe you don't mind if an entire function group goes west in the interest of speed? GeSHi can handle all of this!
-3.11.1: Adding a Keyword
-Top | Contents | Next | Previous
-
-If you want to add a keyword to an existing keyword group, you use the add_keyword method:
-$geshi->add_keyword($key, $word);
-
-Where $key is the index of the group of keywords you want to add this keyword to, and $word is the word to add.
-
-This implies knowledge of the language file to know the correct index.
-Note:
-
-Keywords should contain at least two alphabetical characters (lower or upper case letters only). This is to enable GeSHi to work much faster by not bothering to try to detect keywords in parts of your source where there is no alphabetical characters.
-3.11.2: Removing a Keyword
-Top | Contents | Next | Previous
-
-Perhaps you want to remove a keyword from an existing group. Maybe you don't use it and want to save yourself some time. Whatever the reason, you can remove it using the remove_keyword method:
-$geshi->remove_keyword($key, $word);
-
-Where $key is the index of the gropu of keywords that you want to remove this keyword from, and $word is the word to remove.
-
-This implies knowledge of the language file to know the correct index - most of the time the keywords you'll want to remove will be in group 3, but this is not guaranteed and you should check the language file first.
-
-This function is silent - if the keyword is not in the group you specified, nothing awful will happen ;)
-3.11.3: Adding a Keyword Group
-Top | Contents | Next | Previous
-
-Lets say for your big project you have several main functions and classes that you'd like highlighted. Why not add them as their own group instead of having them highlighted the same way as other keywords? Then you can make them stand out, and people can instantly see which functions and classes are user defined or inbuilt. Furthermore, you could set the URL for this group to point at the API documentation of your project.
-
-You add a keyword group by using the add_keyword_group method:
-$geshi->add_keyword_group($key, $styles, $case_sensitive, $words);
-
-Where $key is the key that you want to use to refer to this group, $styles is the styles that you want to use to style this group, $case_sensitive is true or false depending on whether you want this group of keywords to be case sensitive or not and $words is an array of words (or a string) of which words to add to this group. For example:
-$geshi->add_keyword_group(10, 'color: #600000;', false, array('myfunc_1', 'myfunc_2', 'myfunc_3'));
-
-Adds a keyword group referenced by index 10, of which all keywords in the group will be dark red, each keyword can be in any case and which contains the keywords "myfunc_1", "myfunc_2" and "myfunc_3".
-
-After creating such a keyword group, you may call other GeSHi methods on it, just as you would for any other keyword group.
-Caution:
-
-If you specify a $key for which there is already a keyword group, the old keyword group will be overwritten! Most language files don't use numbers larger than 5, so I recommend you play it safe and use a number like 10 or 42.
-3.11.4: Removing a Keyword Group
-Top | Contents | Next | Previous
-
-Perhaps you *really* need speed? Why not just remove an entire keyword group? GeSHi won't have to loop through each keyword checking for its existance, saving much time. You remove a keyword group by using the remove_keyword_group method:
-$geshi->remove_keyword_group($key);
-
-Where $key is the key of the group you wish to remove. This implies knowleged of the language file.
-3.12: Headers and Footers for Your Code
-Top | Contents | Next | Previous
-
-So you want to add some special information to the highlighted source? GeSHi can do that too! You can specify headers and footers for your code, style them, and insert information from the highlighted source into your header or footer.
-3.12.1: Keyword Substitution
-Top | Contents | Next | Previous
-
-In your header and footer, you can put special keywords that will be replaced with actual configuration values for this GeSHi object. The keywords you can use are:
-
- * <TIME> or {TIME}: Is replaced by the time it took for the parse_code method - i.e., how long it took for your code to be highlighted. The time is returned to three decimal places.
- * <LANGUAGE> or {LANGUAGE}: Is replaced by a nice, friendly version of the language name used to highlight this code.
- * <VERSION> or {VERSION}: The GeSHi version used to highlight the code.
-
-3.12.2: Setting Header Content
-Top | Contents | Next | Previous
-
-The header for your code is a <div>, which is inside the containing block. Therefore, it is affected by the method set_overall_style, and should contain the sort of HTML that belongs in a <div>. You may use any HTML you like, and format it as an HTML document. You should use valid HTML - convert to entities any quotemarks or angle brackets you want displayed. You set the header content using the method set_header_content:
-$geshi->set_header_content($content);
-
-Where $content is the HTML you want to use for the header.
-3.12.3: Setting Footer Content
-Top | Contents | Next | Previous
-
-The footer for your code is a <div>, which is inside the containing block. Therefore, it is affected by the method set_overall_style, and should contain the sort of HTML that belongs in a <div>. You may use any HTML you like, and format it as an HTML document. You should use valid HTML - convert to entities any quotemarks or angle brackets you want displayed. You set the footer content using the method set_footer_content:
-$geshi->set_footer_content($content);
-
-Where $content is the HTML you want to use for the footer.
-3.12.4: Styling Header Content
-Top | Contents | Next | Previous
-
-You can apply styles to the header content you have set with the set_header_content_style:
-$geshi->set_header_content_style($styles);
-
-Where $styles is the stylesheet declarations you want to use to style the header content.
-3.12.5: Styling Footer Content
-Top | Contents | Next | Previous
-
-You can apply styles to the footer content you have set with the set_footer_content_style:
-$geshi->set_footer_content_style($styles);
-
-Where $styles is the stylesheet declarations you want to use to style the footer content.
-3.13: Keyword URLs
-Top | Contents | Next | Previous
-
-As of version 1.0.2, GeSHi allows you to specify a URL for keyword groups. This URL is used by GeSHi to convert the keywords in that group into URLs to appropriate documentation. And using add_keyword_group you can add functions and classes from your own projects and use the URL functionality to provide a link to your own API documentation.
-3.13.1: Setting a URL for a Keyword Group
-Top | Contents | Next | Previous
-
-To set the URL to be used for a keyword group, you use the set_url_for_keyword_group method:
-$geshi->set_url_for_keyword_group($group, $url);
-
-Where $group is the keyword group you want to assign the URL for, and $url is the URL for this group of keywords.
-
-You may be wondering how to make each keyword in the group point to the correct URL. You do this by putting {FNAME} in the URL at the correct place. For example, PHP makes it easy by linking www.php.net/function-name to the documentation for that function, so the URL used is http://www.php.net/{FNAME}.
-
-Of course, when you get to a language like Java, that puts its class documentation in related folders, it gets a little trickier to work out an appropriate URL (see the Java language file!). I hope to provide some kind of redirection service at the GeSHi website in the future.
-Note:
-
-As of Version 1.0.7.21 there have been added two more symbols you can use to link to functions. {FNAMEL} will generate the lowercase version of the keyword, {FNAMEU} will generate the upper-case version. {FNAME} will provide the keyword as specified in the language file.
-3.13.2: Disabling a URL for a Keyword Group
-Top | Contents | Next | Previous
-
-It's easy to disable a URL for a keyword group: Simply use the method set_url_for_keyword_group to pass an empty string as the URL:
-$geshi->set_url_for_keyword_group($group, '');
-3.13.3 Disabling all URLs for Keywords
-Top | Contents | Next | Previous
-
-As of GeSHi 1.0.7.18, you can disable all URL linking for keywords:
-$geshi->enable_keyword_links(false);
-3.13.4: Styling Links
-Top | Contents | Next | Previous
-
-You can also style the function links. You can style their default status, hovered, active and visited status. All of this is controlled by one method, set_link_styles:
-$geshi->set_link_styles($mode, $styles);
-
-Where $mode is one of four values:
-
- * GESHI_LINK: The default style of the links.
- * GESHI_HOVER: The style of the links when they have focus (the mouse is hovering over them).
- * GESHI_ACTIVE: The style of the links when they are being clicked.
- * GESHI_VISITED: The style of links that the user has already visited.
-
-And $styles is the stylesheet declarations to apply to the links.
-3.13.5: Setting the Link Target
-Top | Contents | Next | Previous
-
-Perhaps you want to set the target of link attributes, so the manual pages open in a new window? Use the set_link_target method:
-$geshi->set_link_target($target, $styles);
-
-Where $target is any valid (X)HTML target value - _blank or _top for example.
-3.14: Using Contextual Importance
-Top | Contents | Next | Previous
-Caution:
-
-This functionality is not only buggy, but is proving very hard to implement in 1.1.X. Therefore, this functionality may well be removed in 1.2.0. You are hereby warned!
-3.15: Highlighting Special Lines "Extra"
-Top | Contents | Next | Previous
-
-An alternative (and more stable) method of highlighting code that is important is to use extra highlighting by line. Although you may not know what line numbers contain the important lines, if you do this method is a much more flexible way of making important lines stand out.
-3.15.1: Specifying the Lines to Highlight Extra
-Top | Contents | Next | Previous
-
-To specify which lines to highlight extra, you past an array containing the line numbers to highlight_lines_extra:
-$geshi->highlight_lines_extra($array);
-
-The array could be in the form array(2, 3, 4, 7, 12, 344, 4242), made from a DB query, generated from looking through the source for certain important things and working out what line those things are... however you get the line numbers, the array should simply be an array of integers.
-
-Here's an example, using the same source as before:
-//
-// Here we go again! This time we'll simply highlight the 8th line
-//
-$source = 'public int[][] product ( n, m )
-{
- int [][] ans = new int[n][m];
- for ( int i = 0; i < n; i++ )
- {
- for ( int j = 0; i < m; j++ )
- {
- ans[i][j] = i * j;
- }
- }
- return ans;
-}';
-
-$geshi = new GeSHi($source, 'java');
-
-$geshi->highlight_lines_extra(array(8));
-echo $geshi->parse_code();
-
-Which produces:
-public int[][] product ( n, m )
-{
- int [][] ans = new int[n][m];
- for ( int i = 0; i < n; i++ )
- {
- for ( int j = 0; i < m; j++ )
- {
- ans[i][j] = i * j;
- }
- }
- return ans;
-}
-
-What's more, as you can see the code on a highlighted line is still actually highlighted itself.
-Note:
-
-As you can see, this is a little buggy, but that is because of HTML laws (code elements should not contain div elements). This works just fine if you use line numbers.
-3.15.2: Styles for the Highlighted Lines
-Top | Contents | Next | Previous
-
-Again as with contextual importance, you're not chained to the yellow theme that is the default. You can use the set_highlight_lines_extra_style method:
-$geshi->set_highlight_lines_extra_style($styles);
-
-Where $styles is the stylesheet declarations that you want to apply to highlighted lines.
-3.16: Adding IDs to Each Line
-Top | Contents | Next | Previous
-
-Perhaps you're a javascript junkie? GeSHi provides a way to give each line an ID so you can access that line with javascript, or perhaps just by plain CSS (though if you want to access lines by CSS you should use the method in the previous section). To enable IDs you call the enable_ids method:
-$geshi->enable_ids($flag);
-
-Where $flag is true or not present to enable IDs, and false to disable them again if you need.
-
-The ID generated is in the form {overall-css-id}-{line-number}. So for example, if you set the overall CSS id to be "mycode", then the IDs for each line would by "mycode-1", "mycode-2" etc. If there is no CSS ID set, then one is made up in the form geshi-[4 random characters], but this is not so useful for if you want to do javascript manipulation.
-3.17: Getting the Time of Styling
-Top | Contents | Next | Previous
-
-Once you've called parse_code, you can get the time it took to run the highlighting by calling the get_time method:
-$geshi = new GeSHi($source, $language, $path);
-
-$code = mysql_real_escape_string($geshi->parse_code());
-$time = $geshi->get_time();
-
-// do something with it
-mysql_query("INSERT INTO code VALUES ('$code', '$time')");
-4: Language Files
-Top | Contents | Next | Previous
-
-So now you know what features GeSHi offers, and perhaps you've even meddled with the source. Or perhaps you'd like a language file for language X but it doesn't seem to be supported? Rubbish! GeSHi will highlight anything, what do you think I coded this for? ^_^ You'll just have to learn how to make a language file yourself. And I promise it's not too hard - and if you're here you're in the right place!
-4.1: An Example Language File
-Top | Contents | Next | Previous
-
-Let's begin by looking at an example language file - the language file for the first language ever supported, PHP.
-
-<?php
-/*************************************************************************************
- * php.php
- * --------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.2
- * CVS Revision Version: $Revision: 1196 $
- * Date Started: 2004/06/20
- * Last Modified: $Date: 2008-06-08 17:55:42 +0000 (So, 08. Jun 2008) $
- *
- * PHP language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/XX/XX (1.0.2)
- * - Added URL support
- * - Added extra constants
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/14)
- * -------------------------
- * * Make sure the last few function I may have missed
- * (like eval()) are included for highlighting
- * * Split to several files - php4, php5 etc
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'PHP',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'include', 'require', 'include_once', 'require_once',
- 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch',
- 'return', 'break'
- ),
- 2 => array(
- 'null', '__LINE__', '__FILE__',
- 'false', '&lt;?php', '?&gt;', '&lt;?',
- '&lt;script language=', '&lt;/script&gt;',
- 'true', 'var', 'default',
- 'function', 'class', 'new',
- '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
- 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
- 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
- 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
- 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
- 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
- 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
- ),
- 3 => array(
- 'zlib_get_coding_type','zend_version','zend_logo_guid','yp_order','yp_next',
- 'yp_match','yp_master','yp_get_default_domain','yp_first','yp_errno','yp_err_string',
- 'yp_cat','yp_all','xml_set_unparsed_entity_decl_handler','xml_set_start_namespace_decl_handler','xml_set_processing_instruction_handler','xml_set_object',
- 'xml_set_notation_decl_handler','xml_set_external_entity_ref_handler','xml_set_end_namespace_decl_handler','xml_set_element_handler','xml_set_default_handler','xml_set_character_data_handler',
- 'xml_parser_set_option','xml_parser_get_option','xml_parser_free','xml_parser_create_ns','xml_parser_create','xml_parse_into_struct',
- 'xml_parse','xml_get_error_code','xml_get_current_line_number','xml_get_current_column_number','xml_get_current_byte_index','xml_error_string',
- 'wordwrap','wddx_serialize_vars','wddx_serialize_value','wddx_packet_start','wddx_packet_end','wddx_deserialize',
- 'wddx_add_vars','vsprintf','vprintf','virtual','version_compare','var_export',
- 'var_dump','utf8_encode','utf8_decode','usort','usleep','user_error',
- 'urlencode','urldecode','unserialize','unregister_tick_function','unpack','unlink',
- 'unixtojd','uniqid','umask','uksort','ucwords','ucfirst',
- 'uasort','trim','trigger_error','touch','token_name','token_get_all',
- 'tmpfile','time','textdomain','tempnam','tanh','tan',
- 'system','syslog','symlink','substr_replace','substr_count','substr',
- 'strval','strtr','strtoupper','strtotime','strtolower','strtok',
- 'strstr','strspn','strrpos','strrev','strrchr','strpos',
- 'strncmp','strncasecmp','strnatcmp','strnatcasecmp','strlen','stristr',
- 'stripslashes','stripcslashes','strip_tags','strftime','stream_wrapper_register','stream_set_write_buffer',
- 'stream_set_timeout','stream_set_blocking','stream_select','stream_register_wrapper','stream_get_meta_data','stream_filter_prepend',
- 'stream_filter_append','stream_context_set_params','stream_context_set_option','stream_context_get_options','stream_context_create','strcspn',
- 'strcoll','strcmp','strchr','strcasecmp','str_word_count','str_shuffle',
- 'str_rot13','str_replace','str_repeat','str_pad','stat','sscanf',
- 'srand','sqrt','sql_regcase','sprintf','spliti','split',
- 'soundex','sort','socket_writev','socket_write','socket_strerror','socket_shutdown',
- 'socket_setopt','socket_set_timeout','socket_set_option','socket_set_nonblock','socket_set_blocking','socket_set_block',
- 'socket_sendto','socket_sendmsg','socket_send','socket_select','socket_recvmsg','socket_recvfrom',
- 'socket_recv','socket_readv','socket_read','socket_listen','socket_last_error','socket_iovec_set',
- 'socket_iovec_free','socket_iovec_fetch','socket_iovec_delete','socket_iovec_alloc','socket_iovec_add','socket_getsockname',
- 'socket_getpeername','socket_getopt','socket_get_status','socket_get_option','socket_create_pair','socket_create_listen',
- 'socket_create','socket_connect','socket_close','socket_clear_error','socket_bind','socket_accept',
- 'sleep','sizeof','sinh','sin','similar_text','shuffle',
- 'show_source','shmop_write','shmop_size','shmop_read','shmop_open','shmop_delete',
- 'shmop_close','shm_remove_var','shm_remove','shm_put_var','shm_get_var','shm_detach',
- 'shm_attach','shell_exec','sha1_file','sha1','settype','setlocale',
- 'setcookie','set_time_limit','set_socket_blocking','set_magic_quotes_runtime','set_include_path','set_file_buffer',
- 'set_error_handler','session_write_close','session_unset','session_unregister','session_start','session_set_save_handler',
- 'session_set_cookie_params','session_save_path','session_register','session_regenerate_id','session_name','session_module_name',
- 'session_is_registered','session_id','session_get_cookie_params','session_encode','session_destroy','session_decode',
- 'session_cache_limiter','session_cache_expire','serialize','sem_remove','sem_release','sem_get',
- 'sem_acquire','rtrim','rsort','round','rmdir','rewinddir',
- 'rewind','restore_include_path','restore_error_handler','reset','rename','register_tick_function',
- 'register_shutdown_function','realpath','readlink','readgzfile','readfile','readdir',
- 'read_exif_data','rawurlencode','rawurldecode','range','rand','rad2deg',
- 'quotemeta','quoted_printable_decode','putenv','proc_open','proc_close','printf',
- 'print_r','prev','preg_split','preg_replace_callback','preg_replace','preg_quote',
- 'preg_match_all','preg_match','preg_grep','pow','posix_uname','posix_ttyname',
- 'posix_times','posix_strerror','posix_setuid','posix_setsid','posix_setpgid','posix_setgid',
- 'posix_seteuid','posix_setegid','posix_mkfifo','posix_kill','posix_isatty','posix_getuid',
- 'posix_getsid','posix_getrlimit','posix_getpwuid','posix_getpwnam','posix_getppid','posix_getpid',
- 'posix_getpgrp','posix_getpgid','posix_getlogin','posix_getgroups','posix_getgrnam','posix_getgrgid',
- 'posix_getgid','posix_geteuid','posix_getegid','posix_getcwd','posix_get_last_error','posix_errno',
- 'posix_ctermid','pos','popen','pi','phpversion','phpinfo',
- 'phpcredits','php_uname','php_sapi_name','php_logo_guid','php_ini_scanned_files','pg_update',
- 'pg_untrace','pg_unescape_bytea','pg_tty','pg_trace','pg_setclientencoding','pg_set_client_encoding',
- 'pg_send_query','pg_select','pg_result_status','pg_result_seek','pg_result_error','pg_result',
- 'pg_query','pg_put_line','pg_port','pg_ping','pg_pconnect','pg_options',
- 'pg_numrows','pg_numfields','pg_num_rows','pg_num_fields','pg_meta_data','pg_lowrite',
- 'pg_lounlink','pg_loreadall','pg_loread','pg_loopen','pg_loimport','pg_loexport',
- 'pg_locreate','pg_loclose','pg_lo_write','pg_lo_unlink','pg_lo_tell','pg_lo_seek',
- 'pg_lo_read_all','pg_lo_read','pg_lo_open','pg_lo_import','pg_lo_export','pg_lo_create',
- 'pg_lo_close','pg_last_oid','pg_last_notice','pg_last_error','pg_insert','pg_host',
- 'pg_getlastoid','pg_get_result','pg_get_pid','pg_get_notify','pg_freeresult','pg_free_result',
- 'pg_fieldtype','pg_fieldsize','pg_fieldprtlen','pg_fieldnum','pg_fieldname','pg_fieldisnull',
- 'pg_field_type','pg_field_size','pg_field_prtlen','pg_field_num','pg_field_name','pg_field_is_null',
- 'pg_fetch_row','pg_fetch_result','pg_fetch_object','pg_fetch_assoc','pg_fetch_array','pg_fetch_all',
- 'pg_exec','pg_escape_string','pg_escape_bytea','pg_errormessage','pg_end_copy','pg_delete',
- 'pg_dbname','pg_copy_to','pg_copy_from','pg_convert','pg_connection_status','pg_connection_reset',
- 'pg_connection_busy','pg_connect','pg_cmdtuples','pg_close','pg_clientencoding','pg_client_encoding',
- 'pg_cancel_query','pg_affected_rows','pfsockopen','pclose','pathinfo','passthru',
- 'parse_url','parse_str','parse_ini_file','pack','overload','output_reset_rewrite_vars',
- 'output_add_rewrite_var','ord','openssl_x509_read','openssl_x509_parse','openssl_x509_free','openssl_x509_export_to_file',
- 'openssl_x509_export','openssl_x509_checkpurpose','openssl_x509_check_private_key','openssl_verify','openssl_sign','openssl_seal',
- 'openssl_public_encrypt','openssl_public_decrypt','openssl_private_encrypt','openssl_private_decrypt','openssl_pkey_new','openssl_pkey_get_public',
- 'openssl_pkey_get_private','openssl_pkey_free','openssl_pkey_export_to_file','openssl_pkey_export','openssl_pkcs7_verify','openssl_pkcs7_sign',
- 'openssl_pkcs7_encrypt','openssl_pkcs7_decrypt','openssl_open','openssl_get_publickey','openssl_get_privatekey','openssl_free_key',
- 'openssl_error_string','openssl_csr_sign','openssl_csr_new','openssl_csr_export_to_file','openssl_csr_export','openlog',
- 'opendir','octdec','ob_start','ob_list_handlers','ob_implicit_flush','ob_iconv_handler',
- 'ob_gzhandler','ob_get_status','ob_get_level','ob_get_length','ob_get_flush','ob_get_contents',
- 'ob_get_clean','ob_flush','ob_end_flush','ob_end_clean','ob_clean','number_format',
- 'nl_langinfo','nl2br','ngettext','next','natsort','natcasesort',
- 'mysql_unbuffered_query','mysql_thread_id','mysql_tablename','mysql_table_name','mysql_stat','mysql_selectdb',
- 'mysql_select_db','mysql_result','mysql_real_escape_string','mysql_query','mysql_ping','mysql_pconnect',
- 'mysql_numrows','mysql_numfields','mysql_num_rows','mysql_num_fields','mysql_listtables','mysql_listfields',
- 'mysql_listdbs','mysql_list_tables','mysql_list_processes','mysql_list_fields','mysql_list_dbs','mysql_insert_id',
- 'mysql_info','mysql_get_server_info','mysql_get_proto_info','mysql_get_host_info','mysql_get_client_info','mysql_freeresult',
- 'mysql_free_result','mysql_fieldtype','mysql_fieldtable','mysql_fieldname','mysql_fieldlen','mysql_fieldflags',
- 'mysql_field_type','mysql_field_table','mysql_field_seek','mysql_field_name','mysql_field_len','mysql_field_flags',
- 'mysql_fetch_row','mysql_fetch_object','mysql_fetch_lengths','mysql_fetch_field','mysql_fetch_assoc','mysql_fetch_array',
- 'mysql_escape_string','mysql_error','mysql_errno','mysql_dropdb','mysql_drop_db','mysql_dbname',
- 'mysql_db_query','mysql_db_name','mysql_data_seek','mysql_createdb','mysql_create_db','mysql_connect',
- 'mysql_close','mysql_client_encoding','mysql_affected_rows','mysql','mt_srand','mt_rand',
- 'mt_getrandmax','move_uploaded_file','money_format','mktime','mkdir','min',
- 'microtime','method_exists','metaphone','memory_get_usage','md5_file','md5',
- 'mbsubstr','mbstrrpos','mbstrpos','mbstrlen','mbstrcut','mbsplit',
- 'mbregex_encoding','mberegi_replace','mberegi','mbereg_search_setpos','mbereg_search_regs','mbereg_search_pos',
- 'mbereg_search_init','mbereg_search_getregs','mbereg_search_getpos','mbereg_search','mbereg_replace','mbereg_match',
- 'mbereg','mb_substr_count','mb_substr','mb_substitute_character','mb_strwidth','mb_strtoupper',
- 'mb_strtolower','mb_strrpos','mb_strpos','mb_strlen','mb_strimwidth','mb_strcut',
- 'mb_split','mb_send_mail','mb_regex_set_options','mb_regex_encoding','mb_preferred_mime_name','mb_parse_str',
- 'mb_output_handler','mb_language','mb_internal_encoding','mb_http_output','mb_http_input','mb_get_info',
- 'mb_eregi_replace','mb_eregi','mb_ereg_search_setpos','mb_ereg_search_regs','mb_ereg_search_pos','mb_ereg_search_init',
- 'mb_ereg_search_getregs','mb_ereg_search_getpos','mb_ereg_search','mb_ereg_replace','mb_ereg_match','mb_ereg',
- 'mb_encode_numericentity','mb_encode_mimeheader','mb_detect_order','mb_detect_encoding','mb_decode_numericentity','mb_decode_mimeheader',
- 'mb_convert_variables','mb_convert_kana','mb_convert_encoding','mb_convert_case','max','mail',
- 'magic_quotes_runtime','ltrim','lstat','long2ip','log1p','log10',
- 'log','localtime','localeconv','linkinfo','link','levenshtein',
- 'lcg_value','ksort','krsort','key_exists','key','juliantojd',
- 'join','jewishtojd','jdtounix','jdtojulian','jdtojewish','jdtogregorian',
- 'jdtofrench','jdmonthname','jddayofweek','is_writeable','is_writable','is_uploaded_file',
- 'is_subclass_of','is_string','is_scalar','is_resource','is_real','is_readable',
- 'is_object','is_numeric','is_null','is_nan','is_long','is_link',
- 'is_integer','is_int','is_infinite','is_float','is_finite','is_file',
- 'is_executable','is_double','is_dir','is_callable','is_bool','is_array',
- 'is_a','iptcparse','iptcembed','ip2long','intval','ini_set',
- 'ini_restore','ini_get_all','ini_get','ini_alter','in_array','import_request_variables',
- 'implode','image_type_to_mime_type','ignore_user_abort','iconv_set_encoding','iconv_get_encoding','iconv',
- 'i18n_mime_header_encode','i18n_mime_header_decode','i18n_ja_jp_hantozen','i18n_internal_encoding','i18n_http_output','i18n_http_input',
- 'i18n_discover_encoding','i18n_convert','hypot','htmlspecialchars','htmlentities','html_entity_decode',
- 'highlight_string','highlight_file','hexdec','hebrevc','hebrev','headers_sent',
- 'header','gzwrite','gzuncompress','gztell','gzseek','gzrewind',
- 'gzread','gzputs','gzpassthru','gzopen','gzinflate','gzgetss',
- 'gzgets','gzgetc','gzfile','gzeof','gzencode','gzdeflate',
- 'gzcompress','gzclose','gregoriantojd','gmstrftime','gmmktime','gmdate',
- 'glob','gettype','gettimeofday','gettext','getservbyport','getservbyname',
- 'getrusage','getrandmax','getprotobynumber','getprotobyname','getopt','getmyuid',
- 'getmypid','getmyinode','getmygid','getmxrr','getlastmod','getimagesize',
- 'gethostbynamel','gethostbyname','gethostbyaddr','getenv','getdate','getcwd',
- 'getallheaders','get_resource_type','get_required_files','get_parent_class','get_object_vars','get_meta_tags',
- 'get_magic_quotes_runtime','get_magic_quotes_gpc','get_loaded_extensions','get_included_files','get_include_path','get_html_translation_table',
- 'get_extension_funcs','get_defined_vars','get_defined_functions','get_defined_constants','get_declared_classes','get_current_user',
- 'get_class_vars','get_class_methods','get_class','get_cfg_var','get_browser','fwrite',
- 'function_exists','func_num_args','func_get_args','func_get_arg','ftruncate','ftp_systype',
- 'ftp_ssl_connect','ftp_size','ftp_site','ftp_set_option','ftp_rmdir','ftp_rename',
- 'ftp_rawlist','ftp_quit','ftp_pwd','ftp_put','ftp_pasv','ftp_nlist',
- 'ftp_nb_put','ftp_nb_get','ftp_nb_fput','ftp_nb_fget','ftp_nb_continue','ftp_mkdir',
- 'ftp_mdtm','ftp_login','ftp_get_option','ftp_get','ftp_fput','ftp_fget',
- 'ftp_exec','ftp_delete','ftp_connect','ftp_close','ftp_chdir','ftp_cdup',
- 'ftok','ftell','fstat','fsockopen','fseek','fscanf',
- 'frenchtojd','fread','fputs','fpassthru','fopen','fnmatch',
- 'fmod','flush','floor','flock','floatval','filetype',
- 'filesize','filepro_rowcount','filepro_retrieve','filepro_fieldwidth','filepro_fieldtype','filepro_fieldname',
- 'filepro_fieldcount','filepro','fileperms','fileowner','filemtime','fileinode',
- 'filegroup','filectime','fileatime','file_get_contents','file_exists','file',
- 'fgetss','fgets','fgetcsv','fgetc','fflush','feof',
- 'fclose','ezmlm_hash','extract','extension_loaded','expm1','explode',
- 'exp','exif_thumbnail','exif_tagname','exif_read_data','exif_imagetype','exec',
- 'escapeshellcmd','escapeshellarg','error_reporting','error_log','eregi_replace','eregi',
- 'ereg_replace','ereg','end','easter_days','easter_date','each',
- 'doubleval','dngettext','dl','diskfreespace','disk_total_space','disk_free_space',
- 'dirname','dir','dgettext','deg2rad','defined','define_syslog_variables',
- 'define','decoct','dechex','decbin','debug_zval_dump','debug_backtrace',
- 'deaggregate','dcngettext','dcgettext','dba_sync','dba_replace','dba_popen',
- 'dba_optimize','dba_open','dba_nextkey','dba_list','dba_insert','dba_handlers',
- 'dba_firstkey','dba_fetch','dba_exists','dba_delete','dba_close','date',
- 'current','ctype_xdigit','ctype_upper','ctype_space','ctype_punct','ctype_print',
- 'ctype_lower','ctype_graph','ctype_digit','ctype_cntrl','ctype_alpha','ctype_alnum',
- 'crypt','create_function','crc32','count_chars','count','cosh',
- 'cos','copy','convert_cyr_string','constant','connection_status','connection_aborted',
- 'compact','closelog','closedir','clearstatcache','class_exists','chunk_split',
- 'chr','chown','chop','chmod','chgrp','checkdnsrr',
- 'checkdate','chdir','ceil','call_user_method_array','call_user_method','call_user_func_array',
- 'call_user_func','cal_to_jd','cal_info','cal_from_jd','cal_days_in_month','bzwrite',
- 'bzread','bzopen','bzflush','bzerrstr','bzerror','bzerrno',
- 'bzdecompress','bzcompress','bzclose','bindtextdomain','bindec','bind_textdomain_codeset',
- 'bin2hex','bcsub','bcsqrt','bcscale','bcpow','bcmul',
- 'bcmod','bcdiv','bccomp','bcadd','basename','base_convert',
- 'base64_encode','base64_decode','atanh','atan2','atan','assert_options',
- 'assert','asort','asinh','asin','arsort','array_walk',
- 'array_values','array_unshift','array_unique','array_sum','array_splice','array_slice',
- 'array_shift','array_search','array_reverse','array_reduce','array_rand','array_push',
- 'array_pop','array_pad','array_multisort','array_merge_recursive','array_merge','array_map',
- 'array_keys','array_key_exists','array_intersect_assoc','array_intersect','array_flip','array_filter',
- 'array_fill','array_diff_assoc','array_diff','array_count_values','array_chunk','array_change_key_case',
- 'apache_setenv','apache_response_headers','apache_request_headers','apache_note','apache_lookup_uri','apache_get_version',
- 'apache_child_terminate','aggregation_info','aggregate_properties_by_regexp','aggregate_properties_by_list','aggregate_properties','aggregate_methods_by_regexp',
- 'aggregate_methods_by_list','aggregate_methods','aggregate','addslashes','addcslashes','acosh',
- 'acos','abs','_','echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.php.net/{FNAME}',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTER' => '-&gt;',
- 'REGEXPS' => array(
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<?php' => '?>'
- ),
- 1 => array(
- '<?' => '?>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- 3 => array(
- '<script language="php">' => '</script>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- )
-);
-
-?>
-
-If you're remotely familiar with PHP (or even if you're not), you can see that all that a language file consists of is a glorified variable assignment. Easy! All a language file does is assign a variable $language_data. Though still, there's a lot of indices to that array... but this section is here to break each index down and explain it to you.
-4.2: Language File Conventions
-Top | Contents | Next | Previous
-
-There are several conventions that are used in language files. For ease of use and readability, your language files should obey the following rules:
-
- * Indentation is in tabs, not spaces: Use tabs! There's no excuse for using spaces in this day and age, where almost every good editor allows you to change the tab width. Tabs also take up less space, and ensure proper alignment. When you indent, use tabs, and if your editor converts tabs to spaces, tell it not to.
- * Strings are in single quotes: Every string in a language file should be in single quotes ('), unless you are specifying a single quote as a quotemark or escape character, in which case they can be in double quotes for readability; or if you are specifying a REGEXP (see below)
- * Large arrays are multi-lined: An array with more than three or four values should be broken into multiple lines. In any case, lines should not be wider than a full-screen window (about 100 chars per line max).
- * Ending brackets for multi-lined arrays on a new line: Also with a comma after them, unless the array is the last one in a parent array. See the PHP language file for examples of where to use commas.
- * Use GeSHi's constants: For capatalisation, regular expressions etc. use the GeSHi constants, not their actual values.
-
-There are more notes on each convention where it may appear in the language file sections below.
-4.3: Language File Sections
-Top | Contents | Next | Previous
-
-This section will look at all the sections of a language file, and how they relate to the final highlighting result.
-4.3.1: The Header
-Top | Contents | Next | Previous
-
-The header of a language file is the first lines with the big comment and the start of the variable $language_data:
-
-<?php
-/*************************************************************************************
- * <name-of-language-file.php>
- * ---------------------------------
- * Author: <name> (<e-mail address>)
- * Copyright: (c) 2004 <name> (<website URL>)
- * Release Version: 1.0.0
- * CVS Revision Version: $Revision: 1196 $
- * Date Started: <date started>
- * Last Modified: $Date: 2008-06-08 17:55:42 +0000 (So, 08. Jun 2008) $
- *
- * <name-of-language> language file for GeSHi.
- *
- * <any-comments...>
- *
- * CHANGES
- * -------
- * <date-of-release> (1.0.0)
- * - First Release
- *
- * TODO (updated <date-of-release>)
- * -------------------------
- * <things-to-do>
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
-
-The parts in angle brackets are the parts that you change for your language file. Everything else *must* remain the same!
-
-Here are the parts you should change:
-
- * <name-of-language-file.php> - This should become the name of your language file. Language file names are in lower case and contain only alphanumeric characters, dashes and underscores. Language files end with .php (which you should put with the name of your language file, eg language.php)
- * <name> - Your name, or alias.
- * <e-mail address> - Your e-mail address. If you want your language file included with GeSHi you must include an e-mail address that refers to an inbox controlled by you.
- * <website> - A URL of a website of yours (perhaps to a page that deals with your contribution to GeSHi, or your home page/blog)
- * <date-started> - The date you started working on the language file. If you can't remember, guestimate.
- * <name-of-language> - The name of the language you made this language file for (probably similar to the language file name).
- * <any-comments> - Any comments you have to make about this language file, perhaps on where you got the keywords for, what dialect of the language this language file is for etc etc. If you don't have any comments, remove the space for them.
- * <date-of-release - The date you released the language file to the public. If you simply send it to me for inclusion in a new GeSHi and don't release it, leave this blank, and I'll replace it with the date of the GeSHi release that it is first added to.
-
-Everything should remain the same, including $Revision: 1196 $ and $Date: 2008-06-08 17:55:42 +0000 (So, 08. Jun 2008) $ (I know these may look funny but they have their purpose for those of you who don't know about SVN).
-
-Also: I'm not sure about the copyright on a new language file. I'm not a lawyer, could someone contact me about whether the copyright for a new language file should be exclusivly the authors, or joint with me (if included in a GeSHi release)?
-4.3.2: The First Indices
-Top | Contents | Next | Previous
-
-Here is an example from the php language file of the first indices:
-
- 'LANG_NAME' => 'PHP',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
-
-The first indices are the first few lines of a language file before the KEYWORDS index. These indices specify:
-
- * 'LANG_NAME': The name of the language. This name should be a human-readable version of the name (e.g. HTML 4 (transitional) instead of html4trans)
- * 'COMMENT_SINGLE': An array of single-line comments in your language, indexed by integers starting from 1. A single line comment is a comment that starts at the marker and goes until the end of the line. These comments may be any length > 0, and since they can be styled individually, can be used for other things than comments (for example the Java language file defines "import" as a single line comment). If you are making a language that uses a ' (apostrophe) as a comment (or in the comment marker somewhere), use double quotes. e.g.: "'"
- * 'COMMENT_MULTI': Used to specify multiline comments, an array in the form 'OPEN' => 'CLOSE'. Unfortunately, all of these comments you add here will be styled the same way (an area of improvement for GeSHi 1.2.X). These comment markers may be any length > 0.
- * 'CASE_KEYWORDS': Used to set whether the case of keywords should be changed automatically as they are found. For example, in an SQL or BASIC dialect you may want all keywords to be upper case. The accepted values for this are:
- o GESHI_CAPS_UPPER: Convert the case of all keywords to upper case.
- o GESHI_CAPS_LOWER: Convert the case of all keywords to lower case.
- o GESHI_CAPS_NO_CHANGE: Don't change the case of any keyword.
- * 'QUOTEMARKS': Specifies the characters that mark the beginning and end of a string. This is another example where if your language includes the ' string delimiter you should use double quotes around it.
- * 'ESCAPE_CHAR': Specifies the escape character used in all strings. If your language does not have an escape character then make this the empty string (''). This is not an array! If found, any character after an escape character and the escape character itself will be highlighted differently, and the character after the escape character cannot end a string.
-
-4.3.3: Keywords
-Top | Contents | Next | Previous
-
-Keywords will make up the bulk of a language file. In this part you add keywords for your language, including inbuilt functions, data types, predefined constants etc etc.
-
-Here's a (shortened) example from the php language file:
-
- 'KEYWORDS' => array(
- 1 => array(
- 'include', 'require', 'include_once', 'require_once',
- 'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch',
- 'return', 'break'
- ),
- 2 => array(
- 'null', '__LINE__', '__FILE__',
- 'false', '<?php', '?>', '<?',
- '<script language=', '</script>',
- 'true', 'var', 'default',
- 'function', 'class', 'new',
- '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
- 'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
- 'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
- 'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
- 'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
- 'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
- 'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
- ),
- 3 => array(
- 'zlib_get_coding_type','zend_version','zend_logo_guid','yp_order','yp_next',
- 'yp_match','yp_master','yp_get_default_domain','yp_first','yp_errno','yp_err_string',
- 'yp_cat','yp_all','xml_set_unparsed_entity_decl_handler','xml_set_start_namespace_decl_handler','xml_set_processing_instruction_handler','xml_set_object',
- 'xml_set_notation_decl_handler','xml_set_external_entity_ref_handler','xml_set_end_namespace_decl_handler','xml_set_element_handler','xml_set_default_handler','xml_set_character_data_handler',
- 'xml_parser_set_option','xml_parser_get_option','xml_parser_free','xml_parser_create_ns','xml_parser_create','xml_parse_into_struct'
- )
- ),
-
-You can see that the index 'KEYWORDS' refers to an array of arrays, indexed by positive integers. In each array, there are some keywords (in the actual php language file there is in fact many more keywords in the array indexed by 3). Here are some points to note about these keywords:
-
- * Indexed by positive integers: Use nothing else! I may change this in 1.2.X, but for the 1.0.X series, use positive integers only.
- * Keywords sorted in reverse: Keywords *should* be sorted in reverse order. I know that many of the language files I've made do not follow this rule, but that's because I made the files before I discovered the following issue with GeSHi: If you have two keywords, as and ascfor example, then when GeSHi encounters the "as" keyword it will be highlighted even if the "as" is part of "asc". I would get GeSHi to reverse-sort keyword arrays, but there's no harm in you doing this yourself and saving some processing time. At the least (and in fact this is sufficient) you should swap any keywords you come across that would be caught by this issue.
- * Keywords are case sensitive (sometimes): If your language is case-sensitive, the correct casing of the keywords is defined as the case of the keywords in these keyword arrays. If you check the java language file you will see that everything is in exact casing. So if any of these keyword arrays are case sensitive, put the keywords in as their correct case! (note that which groups are case sensitive and which are not is configurable, see later on)
- * Keywords must be in htmlentities() form: All keywords should be written as if they had been run through the php function htmlentities(). E.g, the keyword is &lt;foo&gt;, not <foo>
- * Don't use keywords to highlight symbols: Just don't. It doesn't work, and there will be seperate support for symbols later.
- * Markup Languages are special cases: Check the html4strict language file for an example: keywords have to be specified twice for opening tags and twice for each closing tag.
-
-4.3.4: Symbols and Case Sensitivity
-Top | Contents | Next | Previous
-
-So you've put all the keywords for your language in? Now for a breather before we style them :). Symbols define what symbols your language uses, these are things like colons, brackets/braces, and other such general punctuation, and case sensitivity alludes to the previous section: here you can set which keyword groups are case sensitive.
-
-As of GeSHi version 1.0.7.21 the symbols section is used in two ways:
-
- * Flat usage:
- This mode is the suggested way for existing language files and languages that only need few symbols where no further differentiation is needed or desired. You simply put all the characters in an array under symbols as shown in the first example below. All symbols in flat usage belong to symbol style group 0.
- * Group usage:
- This is a slightly more enhanced way to provide GeSHi symbol information. To use group you create several subarrays each containing only a subset of the symbols to highlight. Every array will need to have an unique index thus you can assign the appropriate styles later.
-
-Here's an example for flat symbol usage
-
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '@', '|', '&', '+', '-', '*', '/', '%', '=', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
-
-which is not too different from the newly introduced group usage shown below:
-
- 'SYMBOLS' => array(
- 0 => array('(', ')', '[', ']', '{', '}'),
- 1 => array('!', '@', '|', '&'),
- 2 => array('+', '-', '*', '/', '%'),
- 3 => array('=', '<', '>')
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
-
- * 'SYMBOLS': An array of the symbols, or - as of 1.0.7.21 - an array of symbol groups, used in your language. Please note that versions before 1.0.7.21 will silently ignore this setting.
- * 'CASE_SENSITIVE': Note the GESHI_COMMENTS! This is used to set whether comments are case sensitive or not (for example, BASIC has the REM statement which while not being case sensitive is still alphanumeric, and as in the example given before about the Java language file using "import" as a single line comment, this can be useful sometimes. true if comments are case sensitive, false otherwise. All of the other indices correspond to indices in the 'KEYWORDS' section (see above).
-
-4.3.5: Styles for your Language File
-Top | Contents | Next | Previous
-
-This is the fun part! Here you get to choose the colours, fonts, backgrounds and anything else you'd like for your language file.
-
-Here's an example:
-
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
-
-Note that all style rules should end with a semi-colon! This is important: GeSHi may add extra rules to the rules you specify (and will do so if a user tries to change your styles on the fly), so the last semi-colon in any stylesheet rule is important.
-
-All strings here should contain valid stylesheet declarations (it's also find to have the empty string).
-
- * 'KEYWORDS': This is an array, from keyword index to style. The index you use is the index you used in the keywords section to specify the keywords belonging to that group.
- * 'COMMENTS': This is an array, from single-line comment index to style for that index. The index 'MULTI' is used for multiline comments (and cannot be an array)
- * 'ESCAPE_CHAR' down to 'SYMBOLS': These are arrays with only one index: 0. You cannot add other indices to these arrays.
- * 'REGEXPS':This is an array with a style for each matching regex. Also, since 1.0.7.21, you can specify the name of a function to be called, that will be given the text matched by the regex, each time a match is found. Note that my testing found that create_function would not work with this due to a PHP bug, so you have to put the function definition at the top of the language file. Be sure to prefix the function name with geshi_[languagename]_ as to not conflict with other functions!
- * 'SCRIPT': For languages that use script delimiters, this is where you can style each block of script. For example, HTML and XML have blocks that begin with < and end with > (i.e. tags) and blocks that begin with & and end with ; (i.e. character entities), and you can set a style to apply to each whole block. You specify the delimiters for the blocks below. Note that many languages will not need this feature.
-
-4.3.6: URLs for Functions
-Top | Contents | Next | Previous
-
-This section lets you specify a url to visit for each keyword group. Useful for pointing functions at their online manual entries.
-
-Here is an example:
-
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.php.net/{FNAME}',
- 4 => ''
- ),
-
-The indices of this array correspond to the keyword groups you specified in the keywords section. The string {FNAME} marks where the name of the function is substituted in. So for the example above, if the keyword being highlighted is "echo", then the keyword will be a URL pointing to http://www.php.net/echo. Because some languages (Java!) don't keep a uniform URL for functions/classes, you may have trouble in creating a URL for that language (though look in the java language file for a novel solution to it's problem)
-4.3.7: Object Orientation Support
-Top | Contents | Next | Previous
-
-Now we're reaching the most little-used section of a language file, which includes such goodies as object orientation support and context support. GeSHi can highlight methods and data fields of objects easily, all you need to do is to tell it to do so and what the "splitter" is between object/method etc.
-
-Here's an example:
-
- 'OOLANG' => true,
- 'OBJECT_SPLITTER' => '->',
-
-If your language has object orientation, the value of 'OOLANG' is true, otherwise it is false. If it is object orientated, in the 'OBJECT_SPLITTER' value you put the htmlentities() version of the "splitter" between objects and methods/fields. If it is not, then make this the empty string.
-4.3.8: Using Regular Expressions
-Top | Contents | Next | Previous
-
-Regular expressions are a good way to catch any other lexic that fits certain rules but can't be listed as a keyword. A good example is variables in PHP: variables always start with either one or two "$" signs, then alphanumeric characters (a simplification). This is easy to catch with regular expressions.
-
-And new to version 1.0.2, there is an advanced way of using regular expressions to catch certain things but highlight only part of those things. This is particularly useful for languages like XML.
-Caution:
-
-Regular expressions use the PCRE syntax (perl-style), not the ereg() style!
-
-Here is an example (this time the PHP file merged with the XML file):
-
- 0 => array(
- GESHI_SEARCH => '(((xml:)?[a-z\-]+))(=)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => '\\4'
- ),
- 1 => array(
- GESHI_SEARCH => '(>/?[a-z0-9]*(>)?)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 2 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
-
-As you can see there are two formats. One is the "simple" format used in GeSHi < 1.0.2, and the other is a more advanced syntax. Firstly, the simple syntax:
-
- * May be in double quotes: To make it easier for those who always place their regular expressions in double quotes, you may place any regular expression here in double quotes if you wish.
- * Don't use curly brackets where possible: If you want to use curly brackets (()) then by all means give it a try, but I'm not sure whether under some circumstances GeSHi may throw a wobbly. You have been warned! If you want to use brackets, it would be better to use the advanced syntax.
- * Don't use the "everything" regex: (That's the .*? regex). Use advanced syntax instead.
-
-And now for advanced syntax, which gives you much more control over exactly what is highlighted:
-
- * GESHI_SEARCH: This element specifies the regular expression to search for. If you plan to capture the output, use brackets (()). See how in the first example above, most of the regular expression is in one set of brackets (with the equals sign in other brackets). You should make sure that the part of the regular expression that is supposed to match what is highlighted is in brackets.
- * GESHI_REPLACE: This is what the stuff matched by the regular expression will be replaced with. If you've grouped the stuff you want highlighted into brackets in the GESHI_SEARCH element, then you can use \\number to match that group, where number is a number corresponding to how many open brackets are between the open bracket of the group you want highlighted and the start of the GESHI_SEARCH string + 1. This may sound confusing, and it probably is, but if you're familiar with how PHP's regular expressions work you should understand. In the example above, the opening bracket for the stuff we want highlighted is the very first bracket in the string, so the number of brackets before that bracket and the start of the string is 0. So we add 1 and get our replacement string of \\1 (whew!).
-
- If you didn't understand a word of that, make sure that there are brackets around the string in GESHI_SEARCH and use \\1 for GESHI_REPLACE ;)
- * GESHI_MODIFIERS: Specify modifiers for your regular expression. If your regular expression includes the everything matcher (.*?), then your modifiers should include "s" and "i" (e.g. use 'si' for this).
- * GESHI_BEFORE:Specifies a bracket group that should appear before the highlighted match (this bracketed group will not be highlighted). Use this if you had to match what you wanted by matching part of your regexp string to something before what you wanted to highlight, and you don't want that part to disappear in the highlighted result.
- * GESHI_AFTER:Specifies a bracket group that should appear after the highlighted match (this bracketed group will not be highlighted). Use this if you had to match what you wanted by matching part of your regexp string to something after what you wanted to highlight, and you don't want that part to disappear in the highlighted result.
-
-Is that totally confusing? Here's the test for if you're an android or not: If you found that perfectly understandable then you're an android ;). Here's a better example:
-
-Let's say that I'm making a language, and variables in this language always start with a dollar sign ($), are always written in lowercase letters and always end with an ampersand (&). eg:
-$foo& = 'bar'
-
-I want to highlight only the text between the $ and the &. How do I do that? With simple regular expressions I can't, but with advanced, it's relatively easy:
-
- 1 => array(
- GESHI_SEARCH => '(\$)([a-z]+)(&)', // search for a dollar sign, then one or more of the characters a-z, then an ampersand
- GESHI_REPLACE => '\\2', // we wanna highlight the characters, which are in the second bracketed group
- GESHI_MODIFIERS => '', // no modifiers, since we're not matching the "anything" regex
- GESHI_BEFORE => '\\1', // before the highlighted characters should be the first bracketed group (always a dollar sign in this example)
- GESHI_AFTER => '\\3' // after the highlighted characters should be the third bracketed group (always an ampersand in this example)
- ),
-
-So if someone tried to highlight using my language, all cases of $foo& would turn into:
-$<span style="color: blue;">foo</span>&
-
-(which would of course be viewed in a browser to get something like $foo&)
-4.3.9: Contextual Highlighting and Strict Mode
-Top | Contents | Next | Previous
-
-For languages like HTML, it's good if we can highlight a tag (like <a> for example). But how do we stop every single "a" in the source getting highlighted? What about for attributes? If I've got the word "colspan" in my text I don't want that highlighted! So how do you tell GeSHi not to highlight in that case? You do it with "Strict Blocks".
-
-Here is an example:
-
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<?php' => '?>'
- ),
- 1 => array(
- '<?' => '?>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- 3 => array(
- '<script language="php">' => '</script>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- )
-
-What is strict mode? Strict mode says that highlighting only occurs inside the blocks you specify. You can see from the example above that highlighting will only occur if the source is inside <?php ... ?> (though note the GESHI_MAYBE!). Here are some points about strict highlighting:
-
- * 'STRICT_MODE_APPLIES': This takes three values (all constants):
- o GESHI_ALWAYS: Strict mode always applies for all of the blocks you specify. Users of your language file cannot turn strict mode off. This should be used for markup languages.
- o GESHI_NEVER: Strict mode is never used. Users of your language file cannot turn strict mode on. Use this value if there is no such thing as a block of code that would not be highlighted in your language (most languages, like C, Java etc. use this because anything in a C file should be highlighted).
- o GESHI_MAYBE: Strict mode *sometimes* applies. It defaults to "off". Users can turn strict mode on if they please. If strict mode is off then everything in the source will be highlighted, even things outside the strict block markers. If strict mode is on the nothing outside strict block markers will be highlighted.
- * SCRIPT_DELIMITERS: This is an array of script delimiters, in the format of the above. The indices are use in the 'SCRIPT' part of the styles section for highlighting everything in a strict block in a certain way. For example, you could set up your language file to make the background yellow of any code inside a strict block this way. The delimiters are in the form 'OPEN' => 'CLOSE'. Delimiters can be of any length > 0. Delimiters are not formatted as if they were run through htmlentities()!
- * 'HIGHLIGHT_STRICT_BLOCK': specifies whether any highlighting should go on inside each block. Most of the time this should be true, but for example, in the XML language file highlighting is turned off for blocks beginning with <!DOCTYPE and ending with >. However, you can still style the overall block using the method described above, and the XML language file does just that.
-
-Note:
-
-The delimiters should be in reverse alphabetical order. Note that in the above example, <?php comes before <?.
-4.3.10: Tidying Up
-Top | Contents | Next | Previous
-
-All language files should end with:
-
-);
-
-?>
-
-5: Method/Constant Reference
-Top | Contents | Next | Previous
-
-I'm afraid I have been lying for a little while about this now! Since 1.0.7 I have been including a phpdoc API for the sourcecode in the api directory, but have forgot to update the documentation! However, it is available, and may assist you in coding, especially for plugin coders.
-
-That's all, folks!
-
-I've improved the documentation greatly from version 1.0.1, but there may still be problems with it, or it may still be confusing for you. Or perhaps I was just plain wrong about one point! If so, contact me and I'll do my best to sort it out.
-
-In case you were wondering, I've finished development of the 1.0.X thread of GeSHi. The only releases I'll make in this thread will be of the bug-fix/add language files type. In particular, version 1.0.2 was a "concept" release - testing how far I could take the highlighting idea (as well as ideas from others).
-
-I'm planning a code rewrite for 1.2.X, which will be based on a new engine - a "psuedo-tokenizer" engine. Hopefully it will massively reduce the server load and time taken (by almost eliminating regexps), while providing superior highlighting. But fear not! The interface and method names should all remain the same ^_^ (though I can't say the same for language files!)
-
-And finally, a couple of people have been asking me: how did you generate that documentation? The amazing answer is: my brain. And yes, it took a long time, and I don't reccommend doing it this way. And yes, you can borrow the styles if you like, though flick me an e-mail if you do.
-
-Anyway, enough blather from me. Get GeSHi working for you already! :D
-
-Nigel McNie
-nigel@geshi.org
-http://qbnz.com/highlighter/
diff --git a/libvpx/examples/includes/geshi/docs/phpdoc.ini b/libvpx/examples/includes/geshi/docs/phpdoc.ini
deleted file mode 100644
index a55bc33..0000000
--- a/libvpx/examples/includes/geshi/docs/phpdoc.ini
+++ /dev/null
@@ -1,90 +0,0 @@
-;; phpDocumentor parse configuration file
-;;
-;; This file is designed to cut down on repetitive typing on the command-line or web interface
-;; You can copy this file to create a number of configuration files that can be used with the
-;; command-line switch -c, as in phpdoc -c default.ini or phpdoc -c myini.ini. The web
-;; interface will automatically generate a list of .ini files that can be used.
-;;
-;; default.ini is used to generate the online manual at http://www.phpdoc.org/docs
-;;
-;; ALL .ini files must be in the user subdirectory of phpDocumentor with an extension of .ini
-;;
-;; Copyright 2002, Greg Beaver <cellog@users.sourceforge.net>
-;;
-;; WARNING: do not change the name of any command-line parameters, phpDocumentor will ignore them
-
-[Parse Data]
-;; title of all the documentation
-;; legal values: any string
-title = GeSHi 1.0.8
-
-;; parse files that start with a . like .bash_profile
-;; legal values: true, false
-hidden = false
-
-;; show elements marked @access private in documentation by setting this to on
-;; legal values: on, off
-parseprivate = off
-
-;; parse with javadoc-like description (first sentence is always the short description)
-;; legal values: on, off
-javadocdesc = off
-
-;; add any custom @tags separated by commas here
-;; legal values: any legal tagname separated by commas.
-customtags = note
-
-;; This is only used by the XML:DocBook/peardoc2 converter
-defaultcategoryname = Documentation
-
-;; what is the main package?
-;; legal values: alphanumeric string plus - and _
-defaultpackagename = core
-
-;; output any parsing information? set to on for cron jobs
-;; legal values: on
-;quiet = on
-
-;; parse a PEAR-style repository. Do not turn this on if your project does
-;; not have a parent directory named "pear"
-;; legal values: on/off
-;pear = on
-
-;; where should the documentation be written?
-;; legal values: a legal path
-target = api
-
-;; limit output to the specified packages, even if others are parsed
-;; legal values: package names separated by commas
-;packageoutput = package1,package2
-
-;; comma-separated list of files to parse
-;; legal values: paths separated by commas
-filename = ../geshi.php
-
-;; comma-separated list of directories to parse
-;; legal values: directory paths separated by commas
-;directory = /path1,/path2,.,..,subdirectory
-;directory = /home/jeichorn/cvs/pear
-;directory = geshi
-
-;; template base directory (the equivalent directory of <installdir>/phpDocumentor)
-;templatebase = /path/to/my/templates
-
-;; comma-separated list of files, directories or wildcards ? and * (any wildcard) to ignore
-;; legal values: any wildcard strings separated by commas
-;ignore = /path/to/ignore*,*list.php,myfile.php,subdirectory/
-ignore = /*.svn/*
-
-;; comma-separated list of Converters to use in outputformat:Convertername:templatedirectory format
-;; legal values: HTML:frames:default,HTML:frames:l0l33t,HTML:frames:phpdoc.de,HTML:frames:phphtmllib,
-;; HTML:frames:earthli,
-;; HTML:frames:DOM/default,HTML:frames:DOM/l0l33t,HTML:frames:DOM/phpdoc.de,
-;; HTML:frames:DOM/phphtmllib,HTML:frames:DOM/earthli
-;; HTML:Smarty:default,HTML:Smarty:PHP,HTML:Smarty:HandS
-;; PDF:default:default,CHM:default:default,XML:DocBook/peardoc2:default
-output=HTML:frames:earthli
-
-;; turn this option on if you want highlighted source code for every file
-;; legal values: on/off
-sourcecode = on
diff --git a/libvpx/examples/includes/geshi/geshi.php b/libvpx/examples/includes/geshi/geshi.php
deleted file mode 100644
index 8cf1f9a..0000000
--- a/libvpx/examples/includes/geshi/geshi.php
+++ /dev/null
@@ -1,4619 +0,0 @@
-<?php
-/**
- * GeSHi - Generic Syntax Highlighter
- *
- * The GeSHi class for Generic Syntax Highlighting. Please refer to the
- * documentation at http://qbnz.com/highlighter/documentation.php for more
- * information about how to use this class.
- *
- * For changes, release notes, TODOs etc, see the relevant files in the docs/
- * directory.
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * @package geshi
- * @subpackage core
- * @author Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
- * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
- * @license http://gnu.org/copyleft/gpl.html GNU GPL
- *
- */
-
-//
-// GeSHi Constants
-// You should use these constant names in your programs instead of
-// their values - you never know when a value may change in a future
-// version
-//
-
-/** The version of this GeSHi file */
-define('GESHI_VERSION', '1.0.8.3');
-
-// Define the root directory for the GeSHi code tree
-if (!defined('GESHI_ROOT')) {
- /** The root directory for GeSHi */
- define('GESHI_ROOT', dirname(__FILE__) . DIRECTORY_SEPARATOR);
-}
-/** The language file directory for GeSHi
- @access private */
-define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR);
-
-// Define if GeSHi should be paranoid about security
-if (!defined('GESHI_SECURITY_PARANOID')) {
- /** Tells GeSHi to be paranoid about security settings */
- define('GESHI_SECURITY_PARANOID', false);
-}
-
-// Line numbers - use with enable_line_numbers()
-/** Use no line numbers when building the result */
-define('GESHI_NO_LINE_NUMBERS', 0);
-/** Use normal line numbers when building the result */
-define('GESHI_NORMAL_LINE_NUMBERS', 1);
-/** Use fancy line numbers when building the result */
-define('GESHI_FANCY_LINE_NUMBERS', 2);
-
-// Container HTML type
-/** Use nothing to surround the source */
-define('GESHI_HEADER_NONE', 0);
-/** Use a "div" to surround the source */
-define('GESHI_HEADER_DIV', 1);
-/** Use a "pre" to surround the source */
-define('GESHI_HEADER_PRE', 2);
-/** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */
-define('GESHI_HEADER_PRE_VALID', 3);
-/**
- * Use a "table" to surround the source:
- *
- * <table>
- * <thead><tr><td colspan="2">$header</td></tr></thead>
- * <tbody><tr><td><pre>$linenumbers</pre></td><td><pre>$code></pre></td></tr></tbody>
- * <tfooter><tr><td colspan="2">$footer</td></tr></tfoot>
- * </table>
- *
- * this is essentially only a workaround for Firefox, see sf#1651996 or take a look at
- * https://bugzilla.mozilla.org/show_bug.cgi?id=365805
- * @note when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE
- */
-define('GESHI_HEADER_PRE_TABLE', 4);
-
-// Capatalisation constants
-/** Lowercase keywords found */
-define('GESHI_CAPS_NO_CHANGE', 0);
-/** Uppercase keywords found */
-define('GESHI_CAPS_UPPER', 1);
-/** Leave keywords found as the case that they are */
-define('GESHI_CAPS_LOWER', 2);
-
-// Link style constants
-/** Links in the source in the :link state */
-define('GESHI_LINK', 0);
-/** Links in the source in the :hover state */
-define('GESHI_HOVER', 1);
-/** Links in the source in the :active state */
-define('GESHI_ACTIVE', 2);
-/** Links in the source in the :visited state */
-define('GESHI_VISITED', 3);
-
-// Important string starter/finisher
-// Note that if you change these, they should be as-is: i.e., don't
-// write them as if they had been run through htmlentities()
-/** The starter for important parts of the source */
-define('GESHI_START_IMPORTANT', '<BEGIN GeSHi>');
-/** The ender for important parts of the source */
-define('GESHI_END_IMPORTANT', '<END GeSHi>');
-
-/**#@+
- * @access private
- */
-// When strict mode applies for a language
-/** Strict mode never applies (this is the most common) */
-define('GESHI_NEVER', 0);
-/** Strict mode *might* apply, and can be enabled or
- disabled by {@link GeSHi->enable_strict_mode()} */
-define('GESHI_MAYBE', 1);
-/** Strict mode always applies */
-define('GESHI_ALWAYS', 2);
-
-// Advanced regexp handling constants, used in language files
-/** The key of the regex array defining what to search for */
-define('GESHI_SEARCH', 0);
-/** The key of the regex array defining what bracket group in a
- matched search to use as a replacement */
-define('GESHI_REPLACE', 1);
-/** The key of the regex array defining any modifiers to the regular expression */
-define('GESHI_MODIFIERS', 2);
-/** The key of the regex array defining what bracket group in a
- matched search to put before the replacement */
-define('GESHI_BEFORE', 3);
-/** The key of the regex array defining what bracket group in a
- matched search to put after the replacement */
-define('GESHI_AFTER', 4);
-/** The key of the regex array defining a custom keyword to use
- for this regexp's html tag class */
-define('GESHI_CLASS', 5);
-
-/** Used in language files to mark comments */
-define('GESHI_COMMENTS', 0);
-
-/** Used to work around missing PHP features **/
-define('GESHI_PHP_PRE_433', !(version_compare(PHP_VERSION, '4.3.3') === 1));
-
-/** make sure we can call stripos **/
-if (!function_exists('stripos')) {
- // the offset param of preg_match is not supported below PHP 4.3.3
- if (GESHI_PHP_PRE_433) {
- /**
- * @ignore
- */
- function stripos($haystack, $needle, $offset = null) {
- if (!is_null($offset)) {
- $haystack = substr($haystack, $offset);
- }
- if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE)) {
- return $match[0][1];
- }
- return false;
- }
- }
- else {
- /**
- * @ignore
- */
- function stripos($haystack, $needle, $offset = null) {
- if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE, $offset)) {
- return $match[0][1];
- }
- return false;
- }
- }
-}
-
-/** some old PHP / PCRE subpatterns only support up to xxx subpatterns in
- regular expressions. Set this to false if your PCRE lib is up to date
- @see GeSHi->optimize_regexp_list()
- **/
-define('GESHI_MAX_PCRE_SUBPATTERNS', 500);
-/** it's also important not to generate too long regular expressions
- be generous here... but keep in mind, that when reaching this limit we
- still have to close open patterns. 12k should do just fine on a 16k limit.
- @see GeSHi->optimize_regexp_list()
- **/
-define('GESHI_MAX_PCRE_LENGTH', 12288);
-
-//Number format specification
-/** Basic number format for integers */
-define('GESHI_NUMBER_INT_BASIC', 1); //Default integers \d+
-/** Enhanced number format for integers like seen in C */
-define('GESHI_NUMBER_INT_CSTYLE', 2); //Default C-Style \d+[lL]?
-/** Number format to highlight binary numbers with a suffix "b" */
-define('GESHI_NUMBER_BIN_SUFFIX', 16); //[01]+[bB]
-/** Number format to highlight binary numbers with a prefix % */
-define('GESHI_NUMBER_BIN_PREFIX_PERCENT', 32); //%[01]+
-/** Number format to highlight binary numbers with a prefix 0b (C) */
-define('GESHI_NUMBER_BIN_PREFIX_0B', 64); //0b[01]+
-/** Number format to highlight octal numbers with a leading zero */
-define('GESHI_NUMBER_OCT_PREFIX', 256); //0[0-7]+
-/** Number format to highlight octal numbers with a suffix of o */
-define('GESHI_NUMBER_OCT_SUFFIX', 512); //[0-7]+[oO]
-/** Number format to highlight hex numbers with a prefix 0x */
-define('GESHI_NUMBER_HEX_PREFIX', 4096); //0x[0-9a-fA-F]+
-/** Number format to highlight hex numbers with a suffix of h */
-define('GESHI_NUMBER_HEX_SUFFIX', 8192); //[0-9][0-9a-fA-F]*h
-/** Number format to highlight floating-point numbers without support for scientific notation */
-define('GESHI_NUMBER_FLT_NONSCI', 65536); //\d+\.\d+
-/** Number format to highlight floating-point numbers without support for scientific notation */
-define('GESHI_NUMBER_FLT_NONSCI_F', 131072); //\d+(\.\d+)?f
-/** Number format to highlight floating-point numbers with support for scientific notation (E) and optional leading zero */
-define('GESHI_NUMBER_FLT_SCI_SHORT', 262144); //\.\d+e\d+
-/** Number format to highlight floating-point numbers with support for scientific notation (E) and required leading digit */
-define('GESHI_NUMBER_FLT_SCI_ZERO', 524288); //\d+(\.\d+)?e\d+
-//Custom formats are passed by RX array
-
-// Error detection - use these to analyse faults
-/** No sourcecode to highlight was specified
- * @deprecated
- */
-define('GESHI_ERROR_NO_INPUT', 1);
-/** The language specified does not exist */
-define('GESHI_ERROR_NO_SUCH_LANG', 2);
-/** GeSHi could not open a file for reading (generally a language file) */
-define('GESHI_ERROR_FILE_NOT_READABLE', 3);
-/** The header type passed to {@link GeSHi->set_header_type()} was invalid */
-define('GESHI_ERROR_INVALID_HEADER_TYPE', 4);
-/** The line number type passed to {@link GeSHi->enable_line_numbers()} was invalid */
-define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5);
-/**#@-*/
-
-
-/**
- * The GeSHi Class.
- *
- * Please refer to the documentation for GeSHi 1.0.X that is available
- * at http://qbnz.com/highlighter/documentation.php for more information
- * about how to use this class.
- *
- * @package geshi
- * @author Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
- * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
- */
-class GeSHi {
- /**#@+
- * @access private
- */
- /**
- * The source code to highlight
- * @var string
- */
- var $source = '';
-
- /**
- * The language to use when highlighting
- * @var string
- */
- var $language = '';
-
- /**
- * The data for the language used
- * @var array
- */
- var $language_data = array();
-
- /**
- * The path to the language files
- * @var string
- */
- var $language_path = GESHI_LANG_ROOT;
-
- /**
- * The error message associated with an error
- * @var string
- * @todo check err reporting works
- */
- var $error = false;
-
- /**
- * Possible error messages
- * @var array
- */
- var $error_messages = array(
- GESHI_ERROR_NO_SUCH_LANG => 'GeSHi could not find the language {LANGUAGE} (using path {PATH})',
- GESHI_ERROR_FILE_NOT_READABLE => 'The file specified for load_from_file was not readable',
- GESHI_ERROR_INVALID_HEADER_TYPE => 'The header type specified is invalid',
- GESHI_ERROR_INVALID_LINE_NUMBER_TYPE => 'The line number type specified is invalid'
- );
-
- /**
- * Whether highlighting is strict or not
- * @var boolean
- */
- var $strict_mode = false;
-
- /**
- * Whether to use CSS classes in output
- * @var boolean
- */
- var $use_classes = false;
-
- /**
- * The type of header to use. Can be one of the following
- * values:
- *
- * - GESHI_HEADER_PRE: Source is outputted in a "pre" HTML element.
- * - GESHI_HEADER_DIV: Source is outputted in a "div" HTML element.
- * - GESHI_HEADER_NONE: No header is outputted.
- *
- * @var int
- */
- var $header_type = GESHI_HEADER_PRE;
-
- /**
- * Array of permissions for which lexics should be highlighted
- * @var array
- */
- var $lexic_permissions = array(
- 'KEYWORDS' => array(),
- 'COMMENTS' => array('MULTI' => true),
- 'REGEXPS' => array(),
- 'ESCAPE_CHAR' => true,
- 'BRACKETS' => true,
- 'SYMBOLS' => false,
- 'STRINGS' => true,
- 'NUMBERS' => true,
- 'METHODS' => true,
- 'SCRIPT' => true
- );
-
- /**
- * The time it took to parse the code
- * @var double
- */
- var $time = 0;
-
- /**
- * The content of the header block
- * @var string
- */
- var $header_content = '';
-
- /**
- * The content of the footer block
- * @var string
- */
- var $footer_content = '';
-
- /**
- * The style of the header block
- * @var string
- */
- var $header_content_style = '';
-
- /**
- * The style of the footer block
- * @var string
- */
- var $footer_content_style = '';
-
- /**
- * Tells if a block around the highlighted source should be forced
- * if not using line numbering
- * @var boolean
- */
- var $force_code_block = false;
-
- /**
- * The styles for hyperlinks in the code
- * @var array
- */
- var $link_styles = array();
-
- /**
- * Whether important blocks should be recognised or not
- * @var boolean
- * @deprecated
- * @todo REMOVE THIS FUNCTIONALITY!
- */
- var $enable_important_blocks = false;
-
- /**
- * Styles for important parts of the code
- * @var string
- * @deprecated
- * @todo As above - rethink the whole idea of important blocks as it is buggy and
- * will be hard to implement in 1.2
- */
- var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code
-
- /**
- * Whether CSS IDs should be added to the code
- * @var boolean
- */
- var $add_ids = false;
-
- /**
- * Lines that should be highlighted extra
- * @var array
- */
- var $highlight_extra_lines = array();
-
- /**
- * Styles of lines that should be highlighted extra
- * @var array
- */
- var $highlight_extra_lines_styles = array();
-
- /**
- * Styles of extra-highlighted lines
- * @var string
- */
- var $highlight_extra_lines_style = 'background-color: #ffc;';
-
- /**
- * The line ending
- * If null, nl2br() will be used on the result string.
- * Otherwise, all instances of \n will be replaced with $line_ending
- * @var string
- */
- var $line_ending = null;
-
- /**
- * Number at which line numbers should start at
- * @var int
- */
- var $line_numbers_start = 1;
-
- /**
- * The overall style for this code block
- * @var string
- */
- var $overall_style = 'font-family:monospace;';
-
- /**
- * The style for the actual code
- * @var string
- */
- var $code_style = 'font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;';
-
- /**
- * The overall class for this code block
- * @var string
- */
- var $overall_class = '';
-
- /**
- * The overall ID for this code block
- * @var string
- */
- var $overall_id = '';
-
- /**
- * Line number styles
- * @var string
- */
- var $line_style1 = 'font-weight: normal; vertical-align:top;';
-
- /**
- * Line number styles for fancy lines
- * @var string
- */
- var $line_style2 = 'font-weight: bold; vertical-align:top;';
-
- /**
- * Style for line numbers when GESHI_HEADER_PRE_TABLE is chosen
- * @var string
- */
- var $table_linenumber_style = 'width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;';
-
- /**
- * Flag for how line numbers are displayed
- * @var boolean
- */
- var $line_numbers = GESHI_NO_LINE_NUMBERS;
-
- /**
- * Flag to decide if multi line spans are allowed. Set it to false to make sure
- * each tag is closed before and reopened after each linefeed.
- * @var boolean
- */
- var $allow_multiline_span = true;
-
- /**
- * The "nth" value for fancy line highlighting
- * @var int
- */
- var $line_nth_row = 0;
-
- /**
- * The size of tab stops
- * @var int
- */
- var $tab_width = 8;
-
- /**
- * Should we use language-defined tab stop widths?
- * @var int
- */
- var $use_language_tab_width = false;
-
- /**
- * Default target for keyword links
- * @var string
- */
- var $link_target = '';
-
- /**
- * The encoding to use for entity encoding
- * NOTE: Used with Escape Char Sequences to fix UTF-8 handling (cf. SF#2037598)
- * @var string
- */
- var $encoding = 'utf-8';
-
- /**
- * Should keywords be linked?
- * @var boolean
- */
- var $keyword_links = true;
-
- /**
- * Currently loaded language file
- * @var string
- * @since 1.0.7.22
- */
- var $loaded_language = '';
-
- /**
- * Wether the caches needed for parsing are built or not
- *
- * @var bool
- * @since 1.0.8
- */
- var $parse_cache_built = false;
-
- /**
- * Work around for Suhosin Patch with disabled /e modifier
- *
- * Note from suhosins author in config file:
- * <blockquote>
- * The /e modifier inside <code>preg_replace()</code> allows code execution.
- * Often it is the cause for remote code execution exploits. It is wise to
- * deactivate this feature and test where in the application it is used.
- * The developer using the /e modifier should be made aware that he should
- * use <code>preg_replace_callback()</code> instead
- * </blockquote>
- *
- * @var array
- * @since 1.0.8
- */
- var $_kw_replace_group = 0;
- var $_rx_key = 0;
-
- /**
- * some "callback parameters" for handle_multiline_regexps
- *
- * @since 1.0.8
- * @access private
- * @var string
- */
- var $_hmr_before = '';
- var $_hmr_replace = '';
- var $_hmr_after = '';
- var $_hmr_key = 0;
-
- /**#@-*/
-
- /**
- * Creates a new GeSHi object, with source and language
- *
- * @param string The source code to highlight
- * @param string The language to highlight the source with
- * @param string The path to the language file directory. <b>This
- * is deprecated!</b> I've backported the auto path
- * detection from the 1.1.X dev branch, so now it
- * should be automatically set correctly. If you have
- * renamed the language directory however, you will
- * still need to set the path using this parameter or
- * {@link GeSHi->set_language_path()}
- * @since 1.0.0
- */
- function GeSHi($source = '', $language = '', $path = '') {
- if (!empty($source)) {
- $this->set_source($source);
- }
- if (!empty($language)) {
- $this->set_language($language);
- }
- $this->set_language_path($path);
- }
-
- /**
- * Returns an error message associated with the last GeSHi operation,
- * or false if no error has occured
- *
- * @return string|false An error message if there has been an error, else false
- * @since 1.0.0
- */
- function error() {
- if ($this->error) {
- //Put some template variables for debugging here ...
- $debug_tpl_vars = array(
- '{LANGUAGE}' => $this->language,
- '{PATH}' => $this->language_path
- );
- $msg = str_replace(
- array_keys($debug_tpl_vars),
- array_values($debug_tpl_vars),
- $this->error_messages[$this->error]);
-
- return "<br /><strong>GeSHi Error:</strong> $msg (code {$this->error})<br />";
- }
- return false;
- }
-
- /**
- * Gets a human-readable language name (thanks to Simon Patterson
- * for the idea :))
- *
- * @return string The name for the current language
- * @since 1.0.2
- */
- function get_language_name() {
- if (GESHI_ERROR_NO_SUCH_LANG == $this->error) {
- return $this->language_data['LANG_NAME'] . ' (Unknown Language)';
- }
- return $this->language_data['LANG_NAME'];
- }
-
- /**
- * Sets the source code for this object
- *
- * @param string The source code to highlight
- * @since 1.0.0
- */
- function set_source($source) {
- $this->source = $source;
- $this->highlight_extra_lines = array();
- }
-
- /**
- * Sets the language for this object
- *
- * @note since 1.0.8 this function won't reset language-settings by default anymore!
- * if you need this set $force_reset = true
- *
- * @param string The name of the language to use
- * @since 1.0.0
- */
- function set_language($language, $force_reset = false) {
- if ($force_reset) {
- $this->loaded_language = false;
- }
-
- //Clean up the language name to prevent malicious code injection
- $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
-
- $language = strtolower($language);
-
- //Retreive the full filename
- $file_name = $this->language_path . $language . '.php';
- if ($file_name == $this->loaded_language) {
- // this language is already loaded!
- return;
- }
-
- $this->language = $language;
-
- $this->error = false;
- $this->strict_mode = GESHI_NEVER;
-
- //Check if we can read the desired file
- if (!is_readable($file_name)) {
- $this->error = GESHI_ERROR_NO_SUCH_LANG;
- return;
- }
-
- // Load the language for parsing
- $this->load_language($file_name);
- }
-
- /**
- * Sets the path to the directory containing the language files. Note
- * that this path is relative to the directory of the script that included
- * geshi.php, NOT geshi.php itself.
- *
- * @param string The path to the language directory
- * @since 1.0.0
- * @deprecated The path to the language files should now be automatically
- * detected, so this method should no longer be needed. The
- * 1.1.X branch handles manual setting of the path differently
- * so this method will disappear in 1.2.0.
- */
- function set_language_path($path) {
- if(strpos($path,':')) {
- //Security Fix to prevent external directories using fopen wrappers.
- if(DIRECTORY_SEPARATOR == "\\") {
- if(!preg_match('#^[a-zA-Z]:#', $path) || false !== strpos($path, ':', 2)) {
- return;
- }
- } else {
- return;
- }
- }
- if(preg_match('#[^/a-zA-Z0-9_\.\-\\\s:]#', $path)) {
- //Security Fix to prevent external directories using fopen wrappers.
- return;
- }
- if(GESHI_SECURITY_PARANOID && false !== strpos($path, '/.')) {
- //Security Fix to prevent external directories using fopen wrappers.
- return;
- }
- if(GESHI_SECURITY_PARANOID && false !== strpos($path, '..')) {
- //Security Fix to prevent external directories using fopen wrappers.
- return;
- }
- if ($path) {
- $this->language_path = ('/' == $path[strlen($path) - 1]) ? $path : $path . '/';
- $this->set_language($this->language); // otherwise set_language_path has no effect
- }
- }
-
- /**
- * Sets the type of header to be used.
- *
- * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This
- * means more source code but more control over tab width and line-wrapping.
- * GESHI_HEADER_PRE means that a "pre" is used - less source, but less
- * control. Default is GESHI_HEADER_PRE.
- *
- * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code
- * should be outputted.
- *
- * @param int The type of header to be used
- * @since 1.0.0
- */
- function set_header_type($type) {
- //Check if we got a valid header type
- if (!in_array($type, array(GESHI_HEADER_NONE, GESHI_HEADER_DIV,
- GESHI_HEADER_PRE, GESHI_HEADER_PRE_VALID, GESHI_HEADER_PRE_TABLE))) {
- $this->error = GESHI_ERROR_INVALID_HEADER_TYPE;
- return;
- }
-
- //Set that new header type
- $this->header_type = $type;
- }
-
- /**
- * Sets the styles for the code that will be outputted
- * when this object is parsed. The style should be a
- * string of valid stylesheet declarations
- *
- * @param string The overall style for the outputted code block
- * @param boolean Whether to merge the styles with the current styles or not
- * @since 1.0.0
- */
- function set_overall_style($style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->overall_style = $style;
- } else {
- $this->overall_style .= $style;
- }
- }
-
- /**
- * Sets the overall classname for this block of code. This
- * class can then be used in a stylesheet to style this object's
- * output
- *
- * @param string The class name to use for this block of code
- * @since 1.0.0
- */
- function set_overall_class($class) {
- $this->overall_class = $class;
- }
-
- /**
- * Sets the overall id for this block of code. This id can then
- * be used in a stylesheet to style this object's output
- *
- * @param string The ID to use for this block of code
- * @since 1.0.0
- */
- function set_overall_id($id) {
- $this->overall_id = $id;
- }
-
- /**
- * Sets whether CSS classes should be used to highlight the source. Default
- * is off, calling this method with no arguments will turn it on
- *
- * @param boolean Whether to turn classes on or not
- * @since 1.0.0
- */
- function enable_classes($flag = true) {
- $this->use_classes = ($flag) ? true : false;
- }
-
- /**
- * Sets the style for the actual code. This should be a string
- * containing valid stylesheet declarations. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * Note: Use this method to override any style changes you made to
- * the line numbers if you are using line numbers, else the line of
- * code will have the same style as the line number! Consult the
- * GeSHi documentation for more information about this.
- *
- * @param string The style to use for actual code
- * @param boolean Whether to merge the current styles with the new styles
- * @since 1.0.2
- */
- function set_code_style($style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->code_style = $style;
- } else {
- $this->code_style .= $style;
- }
- }
-
- /**
- * Sets the styles for the line numbers.
- *
- * @param string The style for the line numbers that are "normal"
- * @param string|boolean If a string, this is the style of the line
- * numbers that are "fancy", otherwise if boolean then this
- * defines whether the normal styles should be merged with the
- * new normal styles or not
- * @param boolean If set, is the flag for whether to merge the "fancy"
- * styles with the current styles or not
- * @since 1.0.2
- */
- function set_line_style($style1, $style2 = '', $preserve_defaults = false) {
- //Check if we got 2 or three parameters
- if (is_bool($style2)) {
- $preserve_defaults = $style2;
- $style2 = '';
- }
-
- //Actually set the new styles
- if (!$preserve_defaults) {
- $this->line_style1 = $style1;
- $this->line_style2 = $style2;
- } else {
- $this->line_style1 .= $style1;
- $this->line_style2 .= $style2;
- }
- }
-
- /**
- * Sets whether line numbers should be displayed.
- *
- * Valid values for the first parameter are:
- *
- * - GESHI_NO_LINE_NUMBERS: Line numbers will not be displayed
- * - GESHI_NORMAL_LINE_NUMBERS: Line numbers will be displayed
- * - GESHI_FANCY_LINE_NUMBERS: Fancy line numbers will be displayed
- *
- * For fancy line numbers, the second parameter is used to signal which lines
- * are to be fancy. For example, if the value of this parameter is 5 then every
- * 5th line will be fancy.
- *
- * @param int How line numbers should be displayed
- * @param int Defines which lines are fancy
- * @since 1.0.0
- */
- function enable_line_numbers($flag, $nth_row = 5) {
- if (GESHI_NO_LINE_NUMBERS != $flag && GESHI_NORMAL_LINE_NUMBERS != $flag
- && GESHI_FANCY_LINE_NUMBERS != $flag) {
- $this->error = GESHI_ERROR_INVALID_LINE_NUMBER_TYPE;
- }
- $this->line_numbers = $flag;
- $this->line_nth_row = $nth_row;
- }
-
- /**
- * Sets wether spans and other HTML markup generated by GeSHi can
- * span over multiple lines or not. Defaults to true to reduce overhead.
- * Set it to false if you want to manipulate the output or manually display
- * the code in an ordered list.
- *
- * @param boolean Wether multiline spans are allowed or not
- * @since 1.0.7.22
- */
- function enable_multiline_span($flag) {
- $this->allow_multiline_span = (bool) $flag;
- }
-
- /**
- * Get current setting for multiline spans, see GeSHi->enable_multiline_span().
- *
- * @see enable_multiline_span
- * @return bool
- */
- function get_multiline_span() {
- return $this->allow_multiline_span;
- }
-
- /**
- * Sets the style for a keyword group. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param int The key of the keyword group to change the styles of
- * @param string The style to make the keywords
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_keyword_group_style($key, $style, $preserve_defaults = false) {
- //Set the style for this keyword group
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['KEYWORDS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['KEYWORDS'][$key] .= $style;
- }
-
- //Update the lexic permissions
- if (!isset($this->lexic_permissions['KEYWORDS'][$key])) {
- $this->lexic_permissions['KEYWORDS'][$key] = true;
- }
- }
-
- /**
- * Turns highlighting on/off for a keyword group
- *
- * @param int The key of the keyword group to turn on or off
- * @param boolean Whether to turn highlighting for that group on or off
- * @since 1.0.0
- */
- function set_keyword_group_highlighting($key, $flag = true) {
- $this->lexic_permissions['KEYWORDS'][$key] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for comment groups. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param int The key of the comment group to change the styles of
- * @param string The style to make the comments
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_comments_style($key, $style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['COMMENTS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['COMMENTS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for comment groups
- *
- * @param int The key of the comment group to turn on or off
- * @param boolean Whether to turn highlighting for that group on or off
- * @since 1.0.0
- */
- function set_comments_highlighting($key, $flag = true) {
- $this->lexic_permissions['COMMENTS'][$key] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for escaped characters. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param string The style to make the escape characters
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_escape_characters_style($style, $preserve_defaults = false, $group = 0) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['ESCAPE_CHAR'][$group] = $style;
- } else {
- $this->language_data['STYLES']['ESCAPE_CHAR'][$group] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for escaped characters
- *
- * @param boolean Whether to turn highlighting for escape characters on or off
- * @since 1.0.0
- */
- function set_escape_characters_highlighting($flag = true) {
- $this->lexic_permissions['ESCAPE_CHAR'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for brackets. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * This method is DEPRECATED: use set_symbols_style instead.
- * This method will be removed in 1.2.X
- *
- * @param string The style to make the brackets
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- * @deprecated In favour of set_symbols_style
- */
- function set_brackets_style($style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['BRACKETS'][0] = $style;
- } else {
- $this->language_data['STYLES']['BRACKETS'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for brackets
- *
- * This method is DEPRECATED: use set_symbols_highlighting instead.
- * This method will be remove in 1.2.X
- *
- * @param boolean Whether to turn highlighting for brackets on or off
- * @since 1.0.0
- * @deprecated In favour of set_symbols_highlighting
- */
- function set_brackets_highlighting($flag) {
- $this->lexic_permissions['BRACKETS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for symbols. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param string The style to make the symbols
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @param int Tells the group of symbols for which style should be set.
- * @since 1.0.1
- */
- function set_symbols_style($style, $preserve_defaults = false, $group = 0) {
- // Update the style of symbols
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['SYMBOLS'][$group] = $style;
- } else {
- $this->language_data['STYLES']['SYMBOLS'][$group] .= $style;
- }
-
- // For backward compatibility
- if (0 == $group) {
- $this->set_brackets_style ($style, $preserve_defaults);
- }
- }
-
- /**
- * Turns highlighting on/off for symbols
- *
- * @param boolean Whether to turn highlighting for symbols on or off
- * @since 1.0.0
- */
- function set_symbols_highlighting($flag) {
- // Update lexic permissions for this symbol group
- $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false;
-
- // For backward compatibility
- $this->set_brackets_highlighting ($flag);
- }
-
- /**
- * Sets the styles for strings. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param string The style to make the escape characters
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_strings_style($style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['STRINGS'][0] = $style;
- } else {
- $this->language_data['STYLES']['STRINGS'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for strings
- *
- * @param boolean Whether to turn highlighting for strings on or off
- * @since 1.0.0
- */
- function set_strings_highlighting($flag) {
- $this->lexic_permissions['STRINGS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for numbers. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param string The style to make the numbers
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_numbers_style($style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['NUMBERS'][0] = $style;
- } else {
- $this->language_data['STYLES']['NUMBERS'][0] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for numbers
- *
- * @param boolean Whether to turn highlighting for numbers on or off
- * @since 1.0.0
- */
- function set_numbers_highlighting($flag) {
- $this->lexic_permissions['NUMBERS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for methods. $key is a number that references the
- * appropriate "object splitter" - see the language file for the language
- * you are highlighting to get this number. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param int The key of the object splitter to change the styles of
- * @param string The style to make the methods
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_methods_style($key, $style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['METHODS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['METHODS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for methods
- *
- * @param boolean Whether to turn highlighting for methods on or off
- * @since 1.0.0
- */
- function set_methods_highlighting($flag) {
- $this->lexic_permissions['METHODS'] = ($flag) ? true : false;
- }
-
- /**
- * Sets the styles for regexps. If $preserve_defaults is
- * true, then styles are merged with the default styles, with the
- * user defined styles having priority
- *
- * @param string The style to make the regular expression matches
- * @param boolean Whether to merge the new styles with the old or just
- * to overwrite them
- * @since 1.0.0
- */
- function set_regexps_style($key, $style, $preserve_defaults = false) {
- if (!$preserve_defaults) {
- $this->language_data['STYLES']['REGEXPS'][$key] = $style;
- } else {
- $this->language_data['STYLES']['REGEXPS'][$key] .= $style;
- }
- }
-
- /**
- * Turns highlighting on/off for regexps
- *
- * @param int The key of the regular expression group to turn on or off
- * @param boolean Whether to turn highlighting for the regular expression group on or off
- * @since 1.0.0
- */
- function set_regexps_highlighting($key, $flag) {
- $this->lexic_permissions['REGEXPS'][$key] = ($flag) ? true : false;
- }
-
- /**
- * Sets whether a set of keywords are checked for in a case sensitive manner
- *
- * @param int The key of the keyword group to change the case sensitivity of
- * @param boolean Whether to check in a case sensitive manner or not
- * @since 1.0.0
- */
- function set_case_sensitivity($key, $case) {
- $this->language_data['CASE_SENSITIVE'][$key] = ($case) ? true : false;
- }
-
- /**
- * Sets the case that keywords should use when found. Use the constants:
- *
- * - GESHI_CAPS_NO_CHANGE: leave keywords as-is
- * - GESHI_CAPS_UPPER: convert all keywords to uppercase where found
- * - GESHI_CAPS_LOWER: convert all keywords to lowercase where found
- *
- * @param int A constant specifying what to do with matched keywords
- * @since 1.0.1
- */
- function set_case_keywords($case) {
- if (in_array($case, array(
- GESHI_CAPS_NO_CHANGE, GESHI_CAPS_UPPER, GESHI_CAPS_LOWER))) {
- $this->language_data['CASE_KEYWORDS'] = $case;
- }
- }
-
- /**
- * Sets how many spaces a tab is substituted for
- *
- * Widths below zero are ignored
- *
- * @param int The tab width
- * @since 1.0.0
- */
- function set_tab_width($width) {
- $this->tab_width = intval($width);
-
- //Check if it fit's the constraints:
- if ($this->tab_width < 1) {
- //Return it to the default
- $this->tab_width = 8;
- }
- }
-
- /**
- * Sets whether or not to use tab-stop width specifed by language
- *
- * @param boolean Whether to use language-specific tab-stop widths
- * @since 1.0.7.20
- */
- function set_use_language_tab_width($use) {
- $this->use_language_tab_width = (bool) $use;
- }
-
- /**
- * Returns the tab width to use, based on the current language and user
- * preference
- *
- * @return int Tab width
- * @since 1.0.7.20
- */
- function get_real_tab_width() {
- if (!$this->use_language_tab_width ||
- !isset($this->language_data['TAB_WIDTH'])) {
- return $this->tab_width;
- } else {
- return $this->language_data['TAB_WIDTH'];
- }
- }
-
- /**
- * Enables/disables strict highlighting. Default is off, calling this
- * method without parameters will turn it on. See documentation
- * for more details on strict mode and where to use it.
- *
- * @param boolean Whether to enable strict mode or not
- * @since 1.0.0
- */
- function enable_strict_mode($mode = true) {
- if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) {
- $this->strict_mode = ($mode) ? GESHI_ALWAYS : GESHI_NEVER;
- }
- }
-
- /**
- * Disables all highlighting
- *
- * @since 1.0.0
- * @todo Rewrite with array traversal
- * @deprecated In favour of enable_highlighting
- */
- function disable_highlighting() {
- $this->enable_highlighting(false);
- }
-
- /**
- * Enables all highlighting
- *
- * The optional flag parameter was added in version 1.0.7.21 and can be used
- * to enable (true) or disable (false) all highlighting.
- *
- * @since 1.0.0
- * @param boolean A flag specifying whether to enable or disable all highlighting
- * @todo Rewrite with array traversal
- */
- function enable_highlighting($flag = true) {
- $flag = $flag ? true : false;
- foreach ($this->lexic_permissions as $key => $value) {
- if (is_array($value)) {
- foreach ($value as $k => $v) {
- $this->lexic_permissions[$key][$k] = $flag;
- }
- } else {
- $this->lexic_permissions[$key] = $flag;
- }
- }
-
- // Context blocks
- $this->enable_important_blocks = $flag;
- }
-
- /**
- * Given a file extension, this method returns either a valid geshi language
- * name, or the empty string if it couldn't be found
- *
- * @param string The extension to get a language name for
- * @param array A lookup array to use instead of the default one
- * @since 1.0.5
- * @todo Re-think about how this method works (maybe make it private and/or make it
- * a extension->lang lookup?)
- * @todo static?
- */
- function get_language_name_from_extension( $extension, $lookup = array() ) {
- if ( !is_array($lookup) || empty($lookup)) {
- $lookup = array(
- 'actionscript' => array('as'),
- 'ada' => array('a', 'ada', 'adb', 'ads'),
- 'apache' => array('conf'),
- 'asm' => array('ash', 'asm', 'inc'),
- 'asp' => array('asp'),
- 'bash' => array('sh'),
- 'bf' => array('bf'),
- 'c' => array('c', 'h'),
- 'c_mac' => array('c', 'h'),
- 'caddcl' => array(),
- 'cadlisp' => array(),
- 'cdfg' => array('cdfg'),
- 'cobol' => array('cbl'),
- 'cpp' => array('cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'),
- 'csharp' => array('cs'),
- 'css' => array('css'),
- 'd' => array('d'),
- 'delphi' => array('dpk', 'dpr', 'pp', 'pas'),
- 'diff' => array('diff', 'patch'),
- 'dos' => array('bat', 'cmd'),
- 'gettext' => array('po', 'pot'),
- 'gml' => array('gml'),
- 'gnuplot' => array('plt'),
- 'groovy' => array('groovy'),
- 'haskell' => array('hs'),
- 'html4strict' => array('html', 'htm'),
- 'ini' => array('ini', 'desktop'),
- 'java' => array('java'),
- 'javascript' => array('js'),
- 'klonec' => array('kl1'),
- 'klonecpp' => array('klx'),
- 'latex' => array('tex'),
- 'lisp' => array('lisp'),
- 'lua' => array('lua'),
- 'matlab' => array('m'),
- 'mpasm' => array(),
- 'mysql' => array('sql'),
- 'nsis' => array(),
- 'objc' => array(),
- 'oobas' => array(),
- 'oracle8' => array(),
- 'oracle10' => array(),
- 'pascal' => array('pas'),
- 'perl' => array('pl', 'pm'),
- 'php' => array('php', 'php5', 'phtml', 'phps'),
- 'povray' => array('pov'),
- 'providex' => array('pvc', 'pvx'),
- 'prolog' => array('pl'),
- 'python' => array('py'),
- 'qbasic' => array('bi'),
- 'reg' => array('reg'),
- 'ruby' => array('rb'),
- 'sas' => array('sas'),
- 'scala' => array('scala'),
- 'scheme' => array('scm'),
- 'scilab' => array('sci'),
- 'smalltalk' => array('st'),
- 'smarty' => array(),
- 'tcl' => array('tcl'),
- 'vb' => array('bas'),
- 'vbnet' => array(),
- 'visualfoxpro' => array(),
- 'whitespace' => array('ws'),
- 'xml' => array('xml', 'svg'),
- 'z80' => array('z80', 'asm', 'inc')
- );
- }
-
- foreach ($lookup as $lang => $extensions) {
- if (in_array($extension, $extensions)) {
- return $lang;
- }
- }
- return '';
- }
-
- /**
- * Given a file name, this method loads its contents in, and attempts
- * to set the language automatically. An optional lookup table can be
- * passed for looking up the language name. If not specified a default
- * table is used
- *
- * The language table is in the form
- * <pre>array(
- * 'lang_name' => array('extension', 'extension', ...),
- * 'lang_name' ...
- * );</pre>
- *
- * @param string The filename to load the source from
- * @param array A lookup array to use instead of the default one
- * @todo Complete rethink of this and above method
- * @since 1.0.5
- */
- function load_from_file($file_name, $lookup = array()) {
- if (is_readable($file_name)) {
- $this->set_source(file_get_contents($file_name));
- $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup));
- } else {
- $this->error = GESHI_ERROR_FILE_NOT_READABLE;
- }
- }
-
- /**
- * Adds a keyword to a keyword group for highlighting
- *
- * @param int The key of the keyword group to add the keyword to
- * @param string The word to add to the keyword group
- * @since 1.0.0
- */
- function add_keyword($key, $word) {
- if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
- $this->language_data['KEYWORDS'][$key][] = $word;
-
- //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
- if ($this->parse_cache_built) {
- $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
- $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
- }
- }
- }
-
- /**
- * Removes a keyword from a keyword group
- *
- * @param int The key of the keyword group to remove the keyword from
- * @param string The word to remove from the keyword group
- * @param bool Wether to automatically recompile the optimized regexp list or not.
- * Note: if you set this to false and @see GeSHi->parse_code() was already called once,
- * for the current language, you have to manually call @see GeSHi->optimize_keyword_group()
- * or the removed keyword will stay in cache and still be highlighted! On the other hand
- * it might be too expensive to recompile the regexp list for every removal if you want to
- * remove a lot of keywords.
- * @since 1.0.0
- */
- function remove_keyword($key, $word, $recompile = true) {
- $key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]);
- if ($key_to_remove !== false) {
- unset($this->language_data['KEYWORDS'][$key][$key_to_remove]);
-
- //NEW in 1.0.8, optionally recompile keyword group
- if ($recompile && $this->parse_cache_built) {
- $this->optimize_keyword_group($key);
- }
- }
- }
-
- /**
- * Creates a new keyword group
- *
- * @param int The key of the keyword group to create
- * @param string The styles for the keyword group
- * @param boolean Whether the keyword group is case sensitive ornot
- * @param array The words to use for the keyword group
- * @since 1.0.0
- */
- function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
- $words = (array) $words;
- if (empty($words)) {
- // empty word lists mess up highlighting
- return false;
- }
-
- //Add the new keyword group internally
- $this->language_data['KEYWORDS'][$key] = $words;
- $this->lexic_permissions['KEYWORDS'][$key] = true;
- $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive;
- $this->language_data['STYLES']['KEYWORDS'][$key] = $styles;
-
- //NEW in 1.0.8, cache keyword regexp
- if ($this->parse_cache_built) {
- $this->optimize_keyword_group($key);
- }
- }
-
- /**
- * Removes a keyword group
- *
- * @param int The key of the keyword group to remove
- * @since 1.0.0
- */
- function remove_keyword_group ($key) {
- //Remove the keyword group internally
- unset($this->language_data['KEYWORDS'][$key]);
- unset($this->lexic_permissions['KEYWORDS'][$key]);
- unset($this->language_data['CASE_SENSITIVE'][$key]);
- unset($this->language_data['STYLES']['KEYWORDS'][$key]);
-
- //NEW in 1.0.8
- unset($this->language_data['CACHED_KEYWORD_LISTS'][$key]);
- }
-
- /**
- * compile optimized regexp list for keyword group
- *
- * @param int The key of the keyword group to compile & optimize
- * @since 1.0.8
- */
- function optimize_keyword_group($key) {
- $this->language_data['CACHED_KEYWORD_LISTS'][$key] =
- $this->optimize_regexp_list($this->language_data['KEYWORDS'][$key]);
- $space_as_whitespace = false;
- if(isset($this->language_data['PARSER_CONTROL'])) {
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) {
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'])) {
- $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'];
- }
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
- if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
- $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'];
- }
- }
- }
- }
- if($space_as_whitespace) {
- foreach($this->language_data['CACHED_KEYWORD_LISTS'][$key] as $rxk => $rxv) {
- $this->language_data['CACHED_KEYWORD_LISTS'][$key][$rxk] =
- str_replace(" ", "\\s+", $rxv);
- }
- }
- }
-
- /**
- * Sets the content of the header block
- *
- * @param string The content of the header block
- * @since 1.0.2
- */
- function set_header_content($content) {
- $this->header_content = $content;
- }
-
- /**
- * Sets the content of the footer block
- *
- * @param string The content of the footer block
- * @since 1.0.2
- */
- function set_footer_content($content) {
- $this->footer_content = $content;
- }
-
- /**
- * Sets the style for the header content
- *
- * @param string The style for the header content
- * @since 1.0.2
- */
- function set_header_content_style($style) {
- $this->header_content_style = $style;
- }
-
- /**
- * Sets the style for the footer content
- *
- * @param string The style for the footer content
- * @since 1.0.2
- */
- function set_footer_content_style($style) {
- $this->footer_content_style = $style;
- }
-
- /**
- * Sets whether to force a surrounding block around
- * the highlighted code or not
- *
- * @param boolean Tells whether to enable or disable this feature
- * @since 1.0.7.20
- */
- function enable_inner_code_block($flag) {
- $this->force_code_block = (bool)$flag;
- }
-
- /**
- * Sets the base URL to be used for keywords
- *
- * @param int The key of the keyword group to set the URL for
- * @param string The URL to set for the group. If {FNAME} is in
- * the url somewhere, it is replaced by the keyword
- * that the URL is being made for
- * @since 1.0.2
- */
- function set_url_for_keyword_group($group, $url) {
- $this->language_data['URLS'][$group] = $url;
- }
-
- /**
- * Sets styles for links in code
- *
- * @param int A constant that specifies what state the style is being
- * set for - e.g. :hover or :visited
- * @param string The styles to use for that state
- * @since 1.0.2
- */
- function set_link_styles($type, $styles) {
- $this->link_styles[$type] = $styles;
- }
-
- /**
- * Sets the target for links in code
- *
- * @param string The target for links in the code, e.g. _blank
- * @since 1.0.3
- */
- function set_link_target($target) {
- if (!$target) {
- $this->link_target = '';
- } else {
- $this->link_target = ' target="' . $target . '"';
- }
- }
-
- /**
- * Sets styles for important parts of the code
- *
- * @param string The styles to use on important parts of the code
- * @since 1.0.2
- */
- function set_important_styles($styles) {
- $this->important_styles = $styles;
- }
-
- /**
- * Sets whether context-important blocks are highlighted
- *
- * @param boolean Tells whether to enable or disable highlighting of important blocks
- * @todo REMOVE THIS SHIZ FROM GESHI!
- * @deprecated
- * @since 1.0.2
- */
- function enable_important_blocks($flag) {
- $this->enable_important_blocks = ( $flag ) ? true : false;
- }
-
- /**
- * Whether CSS IDs should be added to each line
- *
- * @param boolean If true, IDs will be added to each line.
- * @since 1.0.2
- */
- function enable_ids($flag = true) {
- $this->add_ids = ($flag) ? true : false;
- }
-
- /**
- * Specifies which lines to highlight extra
- *
- * The extra style parameter was added in 1.0.7.21.
- *
- * @param mixed An array of line numbers to highlight, or just a line
- * number on its own.
- * @param string A string specifying the style to use for this line.
- * If null is specified, the default style is used.
- * If false is specified, the line will be removed from
- * special highlighting
- * @since 1.0.2
- * @todo Some data replication here that could be cut down on
- */
- function highlight_lines_extra($lines, $style = null) {
- if (is_array($lines)) {
- //Split up the job using single lines at a time
- foreach ($lines as $line) {
- $this->highlight_lines_extra($line, $style);
- }
- } else {
- //Mark the line as being highlighted specially
- $lines = intval($lines);
- $this->highlight_extra_lines[$lines] = $lines;
-
- //Decide on which style to use
- if ($style === null) { //Check if we should use default style
- unset($this->highlight_extra_lines_styles[$lines]);
- } else if ($style === false) { //Check if to remove this line
- unset($this->highlight_extra_lines[$lines]);
- unset($this->highlight_extra_lines_styles[$lines]);
- } else {
- $this->highlight_extra_lines_styles[$lines] = $style;
- }
- }
- }
-
- /**
- * Sets the style for extra-highlighted lines
- *
- * @param string The style for extra-highlighted lines
- * @since 1.0.2
- */
- function set_highlight_lines_extra_style($styles) {
- $this->highlight_extra_lines_style = $styles;
- }
-
- /**
- * Sets the line-ending
- *
- * @param string The new line-ending
- * @since 1.0.2
- */
- function set_line_ending($line_ending) {
- $this->line_ending = (string)$line_ending;
- }
-
- /**
- * Sets what number line numbers should start at. Should
- * be a positive integer, and will be converted to one.
- *
- * <b>Warning:</b> Using this method will add the "start"
- * attribute to the &lt;ol&gt; that is used for line numbering.
- * This is <b>not</b> valid XHTML strict, so if that's what you
- * care about then don't use this method. Firefox is getting
- * support for the CSS method of doing this in 1.1 and Opera
- * has support for the CSS method, but (of course) IE doesn't
- * so it's not worth doing it the CSS way yet.
- *
- * @param int The number to start line numbers at
- * @since 1.0.2
- */
- function start_line_numbers_at($number) {
- $this->line_numbers_start = abs(intval($number));
- }
-
- /**
- * Sets the encoding used for htmlspecialchars(), for international
- * support.
- *
- * NOTE: This is not needed for now because htmlspecialchars() is not
- * being used (it has a security hole in PHP4 that has not been patched).
- * Maybe in a future version it may make a return for speed reasons, but
- * I doubt it.
- *
- * @param string The encoding to use for the source
- * @since 1.0.3
- */
- function set_encoding($encoding) {
- if ($encoding) {
- $this->encoding = strtolower($encoding);
- }
- }
-
- /**
- * Turns linking of keywords on or off.
- *
- * @param boolean If true, links will be added to keywords
- * @since 1.0.2
- */
- function enable_keyword_links($enable = true) {
- $this->keyword_links = (bool) $enable;
- }
-
- /**
- * Setup caches needed for styling. This is automatically called in
- * parse_code() and get_stylesheet() when appropriate. This function helps
- * stylesheet generators as they rely on some style information being
- * preprocessed
- *
- * @since 1.0.8
- * @access private
- */
- function build_style_cache() {
- //Build the style cache needed to highlight numbers appropriate
- if($this->lexic_permissions['NUMBERS']) {
- //First check what way highlighting information for numbers are given
- if(!isset($this->language_data['NUMBERS'])) {
- $this->language_data['NUMBERS'] = 0;
- }
-
- if(is_array($this->language_data['NUMBERS'])) {
- $this->language_data['NUMBERS_CACHE'] = $this->language_data['NUMBERS'];
- } else {
- $this->language_data['NUMBERS_CACHE'] = array();
- if(!$this->language_data['NUMBERS']) {
- $this->language_data['NUMBERS'] =
- GESHI_NUMBER_INT_BASIC |
- GESHI_NUMBER_FLT_NONSCI;
- }
-
- for($i = 0, $j = $this->language_data['NUMBERS']; $j > 0; ++$i, $j>>=1) {
- //Rearrange style indices if required ...
- if(isset($this->language_data['STYLES']['NUMBERS'][1<<$i])) {
- $this->language_data['STYLES']['NUMBERS'][$i] =
- $this->language_data['STYLES']['NUMBERS'][1<<$i];
- unset($this->language_data['STYLES']['NUMBERS'][1<<$i]);
- }
-
- //Check if this bit is set for highlighting
- if($j&1) {
- //So this bit is set ...
- //Check if it belongs to group 0 or the actual stylegroup
- if(isset($this->language_data['STYLES']['NUMBERS'][$i])) {
- $this->language_data['NUMBERS_CACHE'][$i] = 1 << $i;
- } else {
- if(!isset($this->language_data['NUMBERS_CACHE'][0])) {
- $this->language_data['NUMBERS_CACHE'][0] = 0;
- }
- $this->language_data['NUMBERS_CACHE'][0] |= 1 << $i;
- }
- }
- }
- }
- }
- }
-
- /**
- * Setup caches needed for parsing. This is automatically called in parse_code() when appropriate.
- * This function makes stylesheet generators much faster as they do not need these caches.
- *
- * @since 1.0.8
- * @access private
- */
- function build_parse_cache() {
- // cache symbol regexp
- //As this is a costy operation, we avoid doing it for multiple groups ...
- //Instead we perform it for all symbols at once.
- //
- //For this to work, we need to reorganize the data arrays.
- if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) {
- $this->language_data['MULTIPLE_SYMBOL_GROUPS'] = count($this->language_data['STYLES']['SYMBOLS']) > 1;
-
- $this->language_data['SYMBOL_DATA'] = array();
- $symbol_preg_multi = array(); // multi char symbols
- $symbol_preg_single = array(); // single char symbols
- foreach ($this->language_data['SYMBOLS'] as $key => $symbols) {
- if (is_array($symbols)) {
- foreach ($symbols as $sym) {
- $sym = $this->hsc($sym);
- if (!isset($this->language_data['SYMBOL_DATA'][$sym])) {
- $this->language_data['SYMBOL_DATA'][$sym] = $key;
- if (isset($sym[1])) { // multiple chars
- $symbol_preg_multi[] = preg_quote($sym, '/');
- } else { // single char
- if ($sym == '-') {
- // don't trigger range out of order error
- $symbol_preg_single[] = '\-';
- } else {
- $symbol_preg_single[] = preg_quote($sym, '/');
- }
- }
- }
- }
- } else {
- $symbols = $this->hsc($symbols);
- if (!isset($this->language_data['SYMBOL_DATA'][$symbols])) {
- $this->language_data['SYMBOL_DATA'][$symbols] = 0;
- if (isset($symbols[1])) { // multiple chars
- $symbol_preg_multi[] = preg_quote($symbols, '/');
- } else if ($symbols == '-') {
- // don't trigger range out of order error
- $symbol_preg_single[] = '\-';
- } else { // single char
- $symbol_preg_single[] = preg_quote($symbols, '/');
- }
- }
- }
- }
-
- //Now we have an array with each possible symbol as the key and the style as the actual data.
- //This way we can set the correct style just the moment we highlight ...
- //
- //Now we need to rewrite our array to get a search string that
- $symbol_preg = array();
- if (!empty($symbol_preg_multi)) {
- rsort($symbol_preg_multi);
- $symbol_preg[] = implode('|', $symbol_preg_multi);
- }
- if (!empty($symbol_preg_single)) {
- rsort($symbol_preg_single);
- $symbol_preg[] = '[' . implode('', $symbol_preg_single) . ']';
- }
- $this->language_data['SYMBOL_SEARCH'] = implode("|", $symbol_preg);
- }
-
- // cache optimized regexp for keyword matching
- // remove old cache
- $this->language_data['CACHED_KEYWORD_LISTS'] = array();
- foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
- if (!isset($this->lexic_permissions['KEYWORDS'][$key]) ||
- $this->lexic_permissions['KEYWORDS'][$key]) {
- $this->optimize_keyword_group($key);
- }
- }
-
- // brackets
- if ($this->lexic_permissions['BRACKETS']) {
- $this->language_data['CACHE_BRACKET_MATCH'] = array('[', ']', '(', ')', '{', '}');
- if (!$this->use_classes && isset($this->language_data['STYLES']['BRACKETS'][0])) {
- $this->language_data['CACHE_BRACKET_REPLACE'] = array(
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#91;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#93;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#40;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#41;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#123;|>',
- '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#125;|>',
- );
- }
- else {
- $this->language_data['CACHE_BRACKET_REPLACE'] = array(
- '<| class="br0">&#91;|>',
- '<| class="br0">&#93;|>',
- '<| class="br0">&#40;|>',
- '<| class="br0">&#41;|>',
- '<| class="br0">&#123;|>',
- '<| class="br0">&#125;|>',
- );
- }
- }
-
- //Build the parse cache needed to highlight numbers appropriate
- if($this->lexic_permissions['NUMBERS']) {
- //Check if the style rearrangements have been processed ...
- //This also does some preprocessing to check which style groups are useable ...
- if(!isset($this->language_data['NUMBERS_CACHE'])) {
- $this->build_style_cache();
- }
-
- //Number format specification
- //All this formats are matched case-insensitively!
- static $numbers_format = array(
- GESHI_NUMBER_INT_BASIC =>
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])([1-9]\d*?|0)(?![0-9a-z\.])',
- GESHI_NUMBER_INT_CSTYLE =>
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])([1-9]\d*?|0)l(?![0-9a-z\.])',
- GESHI_NUMBER_BIN_SUFFIX =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])[01]+?b(?![0-9a-z\.])',
- GESHI_NUMBER_BIN_PREFIX_PERCENT =>
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])%[01]+?(?![0-9a-z\.])',
- GESHI_NUMBER_BIN_PREFIX_0B =>
- '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])0b[01]+?(?![0-9a-z\.])',
- GESHI_NUMBER_OCT_PREFIX =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0[0-7]+?(?![0-9a-z\.])',
- GESHI_NUMBER_OCT_SUFFIX =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])[0-7]+?o(?![0-9a-z\.])',
- GESHI_NUMBER_HEX_PREFIX =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0x[0-9a-f]+?(?![0-9a-z\.])',
- GESHI_NUMBER_HEX_SUFFIX =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\d[0-9a-f]*?h(?![0-9a-z\.])',
- GESHI_NUMBER_FLT_NONSCI =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\d+?\.\d+?(?![0-9a-z\.])',
- GESHI_NUMBER_FLT_NONSCI_F =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)f(?![0-9a-z\.])',
- GESHI_NUMBER_FLT_SCI_SHORT =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\.\d+?(?:e[+\-]?\d+?)?(?![0-9a-z\.])',
- GESHI_NUMBER_FLT_SCI_ZERO =>
- '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)(?:e[+\-]?\d+?)?(?![0-9a-z\.])'
- );
-
- //At this step we have an associative array with flag groups for a
- //specific style or an string denoting a regexp given its index.
- $this->language_data['NUMBERS_RXCACHE'] = array();
- foreach($this->language_data['NUMBERS_CACHE'] as $key => $rxdata) {
- if(is_string($rxdata)) {
- $regexp = $rxdata;
- } else {
- //This is a bitfield of number flags to highlight:
- //Build an array, implode them together and make this the actual RX
- $rxuse = array();
- for($i = 1; $i <= $rxdata; $i<<=1) {
- if($rxdata & $i) {
- $rxuse[] = $numbers_format[$i];
- }
- }
- $regexp = implode("|", $rxuse);
- }
-
- $this->language_data['NUMBERS_RXCACHE'][$key] =
- "/(?<!<\|\/NUM!)(?<!\d\/>)($regexp)(?!\|>)/i";
- }
- }
-
- $this->parse_cache_built = true;
- }
-
- /**
- * Returns the code in $this->source, highlighted and surrounded by the
- * nessecary HTML.
- *
- * This should only be called ONCE, cos it's SLOW! If you want to highlight
- * the same source multiple times, you're better off doing a whole lot of
- * str_replaces to replace the &lt;span&gt;s
- *
- * @since 1.0.0
- */
- function parse_code () {
- // Start the timer
- $start_time = microtime();
-
- // Firstly, if there is an error, we won't highlight
- if ($this->error) {
- //Escape the source for output
- $result = $this->hsc($this->source);
-
- //This fix is related to SF#1923020, but has to be applied regardless of
- //actually highlighting symbols.
- $result = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $result);
-
- // Timing is irrelevant
- $this->set_time($start_time, $start_time);
- $this->finalise($result);
- return $result;
- }
-
- // make sure the parse cache is up2date
- if (!$this->parse_cache_built) {
- $this->build_parse_cache();
- }
-
- // Replace all newlines to a common form.
- $code = str_replace("\r\n", "\n", $this->source);
- $code = str_replace("\r", "\n", $code);
-
- // Add spaces for regular expression matching and line numbers
-// $code = "\n" . $code . "\n";
-
- // Initialise various stuff
- $length = strlen($code);
- $COMMENT_MATCHED = false;
- $stuff_to_parse = '';
- $endresult = '';
-
- // "Important" selections are handled like multiline comments
- // @todo GET RID OF THIS SHIZ
- if ($this->enable_important_blocks) {
- $this->language_data['COMMENT_MULTI'][GESHI_START_IMPORTANT] = GESHI_END_IMPORTANT;
- }
-
- if ($this->strict_mode) {
- // Break the source into bits. Each bit will be a portion of the code
- // within script delimiters - for example, HTML between < and >
- $k = 0;
- $parts = array();
- $matches = array();
- $next_match_pointer = null;
- // we use a copy to unset delimiters on demand (when they are not found)
- $delim_copy = $this->language_data['SCRIPT_DELIMITERS'];
- $i = 0;
- while ($i < $length) {
- $next_match_pos = $length + 1; // never true
- foreach ($delim_copy as $dk => $delimiters) {
- if(is_array($delimiters)) {
- foreach ($delimiters as $open => $close) {
- // make sure the cache is setup properly
- if (!isset($matches[$dk][$open])) {
- $matches[$dk][$open] = array(
- 'next_match' => -1,
- 'dk' => $dk,
-
- 'open' => $open, // needed for grouping of adjacent code blocks (see below)
- 'open_strlen' => strlen($open),
-
- 'close' => $close,
- 'close_strlen' => strlen($close),
- );
- }
- // Get the next little bit for this opening string
- if ($matches[$dk][$open]['next_match'] < $i) {
- // only find the next pos if it was not already cached
- $open_pos = strpos($code, $open, $i);
- if ($open_pos === false) {
- // no match for this delimiter ever
- unset($delim_copy[$dk][$open]);
- continue;
- }
- $matches[$dk][$open]['next_match'] = $open_pos;
- }
- if ($matches[$dk][$open]['next_match'] < $next_match_pos) {
- //So we got a new match, update the close_pos
- $matches[$dk][$open]['close_pos'] =
- strpos($code, $close, $matches[$dk][$open]['next_match']+1);
-
- $next_match_pointer =& $matches[$dk][$open];
- $next_match_pos = $matches[$dk][$open]['next_match'];
- }
- }
- } else {
- //So we should match an RegExp as Strict Block ...
- /**
- * The value in $delimiters is expected to be an RegExp
- * containing exactly 2 matching groups:
- * - Group 1 is the opener
- * - Group 2 is the closer
- */
- if(!GESHI_PHP_PRE_433 && //Needs proper rewrite to work with PHP >=4.3.0; 4.3.3 is guaranteed to work.
- preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
- //We got a match ...
- $matches[$dk] = array(
- 'next_match' => $matches_rx[1][1],
- 'dk' => $dk,
-
- 'close_strlen' => strlen($matches_rx[2][0]),
- 'close_pos' => $matches_rx[2][1],
- );
- } else {
- // no match for this delimiter ever
- unset($delim_copy[$dk]);
- continue;
- }
-
- if ($matches[$dk]['next_match'] <= $next_match_pos) {
- $next_match_pointer =& $matches[$dk];
- $next_match_pos = $matches[$dk]['next_match'];
- }
- }
- }
- // non-highlightable text
- $parts[$k] = array(
- 1 => substr($code, $i, $next_match_pos - $i)
- );
- ++$k;
-
- if ($next_match_pos > $length) {
- // out of bounds means no next match was found
- break;
- }
-
- // highlightable code
- $parts[$k][0] = $next_match_pointer['dk'];
-
- //Only combine for non-rx script blocks
- if(is_array($delim_copy[$next_match_pointer['dk']])) {
- // group adjacent script blocks, e.g. <foobar><asdf> should be one block, not three!
- $i = $next_match_pos + $next_match_pointer['open_strlen'];
- while (true) {
- $close_pos = strpos($code, $next_match_pointer['close'], $i);
- if ($close_pos == false) {
- break;
- }
- $i = $close_pos + $next_match_pointer['close_strlen'];
- if ($i == $length) {
- break;
- }
- if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 ||
- substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) {
- // merge adjacent but make sure we don't merge things like <tag><!-- comment -->
- foreach ($matches as $submatches) {
- foreach ($submatches as $match) {
- if ($match['next_match'] == $i) {
- // a different block already matches here!
- break 3;
- }
- }
- }
- } else {
- break;
- }
- }
- } else {
- $close_pos = $next_match_pointer['close_pos'] + $next_match_pointer['close_strlen'];
- $i = $close_pos;
- }
-
- if ($close_pos === false) {
- // no closing delimiter found!
- $parts[$k][1] = substr($code, $next_match_pos);
- ++$k;
- break;
- } else {
- $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos);
- ++$k;
- }
- }
- unset($delim_copy, $next_match_pointer, $next_match_pos, $matches);
- $num_parts = $k;
-
- if ($num_parts == 1 && $this->strict_mode == GESHI_MAYBE) {
- // when we have only one part, we don't have anything to highlight at all.
- // if we have a "maybe" strict language, this should be handled as highlightable code
- $parts = array(
- 0 => array(
- 0 => '',
- 1 => ''
- ),
- 1 => array(
- 0 => null,
- 1 => $parts[0][1]
- )
- );
- $num_parts = 2;
- }
-
- } else {
- // Not strict mode - simply dump the source into
- // the array at index 1 (the first highlightable block)
- $parts = array(
- 0 => array(
- 0 => '',
- 1 => ''
- ),
- 1 => array(
- 0 => null,
- 1 => $code
- )
- );
- $num_parts = 2;
- }
-
- //Unset variables we won't need any longer
- unset($code);
-
- //Preload some repeatedly used values regarding hardquotes ...
- $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false;
- $hq_strlen = strlen($hq);
-
- //Preload if line numbers are to be generated afterwards
- //Added a check if line breaks should be forced even without line numbers, fixes SF#1727398
- $check_linenumbers = $this->line_numbers != GESHI_NO_LINE_NUMBERS ||
- !empty($this->highlight_extra_lines) || !$this->allow_multiline_span;
-
- //preload the escape char for faster checking ...
- $escaped_escape_char = $this->hsc($this->language_data['ESCAPE_CHAR']);
-
- // this is used for single-line comments
- $sc_disallowed_before = "";
- $sc_disallowed_after = "";
-
- if (isset($this->language_data['PARSER_CONTROL'])) {
- if (isset($this->language_data['PARSER_CONTROL']['COMMENTS'])) {
- if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'])) {
- $sc_disallowed_before = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'];
- }
- if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'])) {
- $sc_disallowed_after = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'];
- }
- }
- }
-
- //Fix for SF#1932083: Multichar Quotemarks unsupported
- $is_string_starter = array();
- if ($this->lexic_permissions['STRINGS']) {
- foreach ($this->language_data['QUOTEMARKS'] as $quotemark) {
- if (!isset($is_string_starter[$quotemark[0]])) {
- $is_string_starter[$quotemark[0]] = (string)$quotemark;
- } else if (is_string($is_string_starter[$quotemark[0]])) {
- $is_string_starter[$quotemark[0]] = array(
- $is_string_starter[$quotemark[0]],
- $quotemark);
- } else {
- $is_string_starter[$quotemark[0]][] = $quotemark;
- }
- }
- }
-
- // Now we go through each part. We know that even-indexed parts are
- // code that shouldn't be highlighted, and odd-indexed parts should
- // be highlighted
- for ($key = 0; $key < $num_parts; ++$key) {
- $STRICTATTRS = '';
-
- // If this block should be highlighted...
- if (!($key & 1)) {
- // Else not a block to highlight
- $endresult .= $this->hsc($parts[$key][1]);
- unset($parts[$key]);
- continue;
- }
-
- $result = '';
- $part = $parts[$key][1];
-
- $highlight_part = true;
- if ($this->strict_mode && !is_null($parts[$key][0])) {
- // get the class key for this block of code
- $script_key = $parts[$key][0];
- $highlight_part = $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key];
- if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
- $this->lexic_permissions['SCRIPT']) {
- // Add a span element around the source to
- // highlight the overall source block
- if (!$this->use_classes &&
- $this->language_data['STYLES']['SCRIPT'][$script_key] != '') {
- $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"';
- } else {
- $attributes = ' class="sc' . $script_key . '"';
- }
- $result .= "<span$attributes>";
- $STRICTATTRS = $attributes;
- }
- }
-
- if ($highlight_part) {
- // Now, highlight the code in this block. This code
- // is really the engine of GeSHi (along with the method
- // parse_non_string_part).
-
- // cache comment regexps incrementally
- $next_comment_regexp_key = '';
- $next_comment_regexp_pos = -1;
- $next_comment_multi_pos = -1;
- $next_comment_single_pos = -1;
- $comment_regexp_cache_per_key = array();
- $comment_multi_cache_per_key = array();
- $comment_single_cache_per_key = array();
- $next_open_comment_multi = '';
- $next_comment_single_key = '';
- $escape_regexp_cache_per_key = array();
- $next_escape_regexp_key = '';
- $next_escape_regexp_pos = -1;
-
- $length = strlen($part);
- for ($i = 0; $i < $length; ++$i) {
- // Get the next char
- $char = $part[$i];
- $char_len = 1;
-
- // update regexp comment cache if needed
- if (isset($this->language_data['COMMENT_REGEXP']) && $next_comment_regexp_pos < $i) {
- $next_comment_regexp_pos = $length;
- foreach ($this->language_data['COMMENT_REGEXP'] as $comment_key => $regexp) {
- $match_i = false;
- if (isset($comment_regexp_cache_per_key[$comment_key]) &&
- ($comment_regexp_cache_per_key[$comment_key]['pos'] >= $i ||
- $comment_regexp_cache_per_key[$comment_key]['pos'] === false)) {
- // we have already matched something
- if ($comment_regexp_cache_per_key[$comment_key]['pos'] === false) {
- // this comment is never matched
- continue;
- }
- $match_i = $comment_regexp_cache_per_key[$comment_key]['pos'];
- } else if (
- //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible
- (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $i), $match, PREG_OFFSET_CAPTURE)) ||
- (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $i))
- ) {
- $match_i = $match[0][1];
- if (GESHI_PHP_PRE_433) {
- $match_i += $i;
- }
-
- $comment_regexp_cache_per_key[$comment_key] = array(
- 'key' => $comment_key,
- 'length' => strlen($match[0][0]),
- 'pos' => $match_i
- );
- } else {
- $comment_regexp_cache_per_key[$comment_key]['pos'] = false;
- continue;
- }
-
- if ($match_i !== false && $match_i < $next_comment_regexp_pos) {
- $next_comment_regexp_pos = $match_i;
- $next_comment_regexp_key = $comment_key;
- if ($match_i === $i) {
- break;
- }
- }
- }
- }
-
- $string_started = false;
-
- if (isset($is_string_starter[$char])) {
- // Possibly the start of a new string ...
-
- //Check which starter it was ...
- //Fix for SF#1932083: Multichar Quotemarks unsupported
- if (is_array($is_string_starter[$char])) {
- $char_new = '';
- foreach ($is_string_starter[$char] as $testchar) {
- if ($testchar === substr($part, $i, strlen($testchar)) &&
- strlen($testchar) > strlen($char_new)) {
- $char_new = $testchar;
- $string_started = true;
- }
- }
- if ($string_started) {
- $char = $char_new;
- }
- } else {
- $testchar = $is_string_starter[$char];
- if ($testchar === substr($part, $i, strlen($testchar))) {
- $char = $testchar;
- $string_started = true;
- }
- }
- $char_len = strlen($char);
- }
-
- if ($string_started && $i != $next_comment_regexp_pos) {
- // Hand out the correct style information for this string
- $string_key = array_search($char, $this->language_data['QUOTEMARKS']);
- if (!isset($this->language_data['STYLES']['STRINGS'][$string_key]) ||
- !isset($this->language_data['STYLES']['ESCAPE_CHAR'][$string_key])) {
- $string_key = 0;
- }
-
- // parse the stuff before this
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
-
- if (!$this->use_classes) {
- $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][$string_key] . '"';
- } else {
- $string_attributes = ' class="st'.$string_key.'"';
- }
-
- // now handle the string
- $string = "<span$string_attributes>" . GeSHi::hsc($char);
- $start = $i + $char_len;
- $string_open = true;
-
- if(empty($this->language_data['ESCAPE_REGEXP'])) {
- $next_escape_regexp_pos = $length;
- }
-
- do {
- //Get the regular ending pos ...
- $close_pos = strpos($part, $char, $start);
- if(false === $close_pos) {
- $close_pos = $length;
- }
-
- if($this->lexic_permissions['ESCAPE_CHAR']) {
- // update escape regexp cache if needed
- if (isset($this->language_data['ESCAPE_REGEXP']) && $next_escape_regexp_pos < $start) {
- $next_escape_regexp_pos = $length;
- foreach ($this->language_data['ESCAPE_REGEXP'] as $escape_key => $regexp) {
- $match_i = false;
- if (isset($escape_regexp_cache_per_key[$escape_key]) &&
- ($escape_regexp_cache_per_key[$escape_key]['pos'] >= $start ||
- $escape_regexp_cache_per_key[$escape_key]['pos'] === false)) {
- // we have already matched something
- if ($escape_regexp_cache_per_key[$escape_key]['pos'] === false) {
- // this comment is never matched
- continue;
- }
- $match_i = $escape_regexp_cache_per_key[$escape_key]['pos'];
- } else if (
- //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible
- (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $start), $match, PREG_OFFSET_CAPTURE)) ||
- (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $start))
- ) {
- $match_i = $match[0][1];
- if (GESHI_PHP_PRE_433) {
- $match_i += $start;
- }
-
- $escape_regexp_cache_per_key[$escape_key] = array(
- 'key' => $escape_key,
- 'length' => strlen($match[0][0]),
- 'pos' => $match_i
- );
- } else {
- $escape_regexp_cache_per_key[$escape_key]['pos'] = false;
- continue;
- }
-
- if ($match_i !== false && $match_i < $next_escape_regexp_pos) {
- $next_escape_regexp_pos = $match_i;
- $next_escape_regexp_key = $escape_key;
- if ($match_i === $start) {
- break;
- }
- }
- }
- }
-
- //Find the next simple escape position
- if('' != $this->language_data['ESCAPE_CHAR']) {
- $simple_escape = strpos($part, $this->language_data['ESCAPE_CHAR'], $start);
- if(false === $simple_escape) {
- $simple_escape = $length;
- }
- } else {
- $simple_escape = $length;
- }
- } else {
- $next_escape_regexp_pos = $length;
- $simple_escape = $length;
- }
-
- if($simple_escape < $next_escape_regexp_pos &&
- $simple_escape < $length &&
- $simple_escape < $close_pos) {
- //The nexxt escape sequence is a simple one ...
- $es_pos = $simple_escape;
-
- //Add the stuff not in the string yet ...
- $string .= $this->hsc(substr($part, $start, $es_pos - $start));
-
- //Get the style for this escaped char ...
- if (!$this->use_classes) {
- $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"';
- } else {
- $escape_char_attributes = ' class="es0"';
- }
-
- //Add the style for the escape char ...
- $string .= "<span$escape_char_attributes>" .
- GeSHi::hsc($this->language_data['ESCAPE_CHAR']);
-
- //Get the byte AFTER the ESCAPE_CHAR we just found
- $es_char = $part[$es_pos + 1];
- if ($es_char == "\n") {
- // don't put a newline around newlines
- $string .= "</span>\n";
- $start = $es_pos + 2;
- } else if (ord($es_char) >= 128) {
- //This is an non-ASCII char (UTF8 or single byte)
- //This code tries to work around SF#2037598 ...
- if(function_exists('mb_substr')) {
- $es_char_m = mb_substr(substr($part, $es_pos+1, 16), 0, 1, $this->encoding);
- $string .= $es_char_m . '</span>';
- } else if (!GESHI_PHP_PRE_433 && 'utf-8' == $this->encoding) {
- if(preg_match("/[\xC2-\xDF][\x80-\xBF]".
- "|\xE0[\xA0-\xBF][\x80-\xBF]".
- "|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}".
- "|\xED[\x80-\x9F][\x80-\xBF]".
- "|\xF0[\x90-\xBF][\x80-\xBF]{2}".
- "|[\xF1-\xF3][\x80-\xBF]{3}".
- "|\xF4[\x80-\x8F][\x80-\xBF]{2}/s",
- $part, $es_char_m, null, $es_pos + 1)) {
- $es_char_m = $es_char_m[0];
- } else {
- $es_char_m = $es_char;
- }
- $string .= $this->hsc($es_char_m) . '</span>';
- } else {
- $es_char_m = $this->hsc($es_char);
- }
- $start = $es_pos + strlen($es_char_m) + 1;
- } else {
- $string .= $this->hsc($es_char) . '</span>';
- $start = $es_pos + 2;
- }
- } else if ($next_escape_regexp_pos < $length &&
- $next_escape_regexp_pos < $close_pos) {
- $es_pos = $next_escape_regexp_pos;
- //Add the stuff not in the string yet ...
- $string .= $this->hsc(substr($part, $start, $es_pos - $start));
-
- //Get the key and length of this match ...
- $escape = $escape_regexp_cache_per_key[$next_escape_regexp_key];
- $escape_str = substr($part, $es_pos, $escape['length']);
- $escape_key = $escape['key'];
-
- //Get the style for this escaped char ...
- if (!$this->use_classes) {
- $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][$escape_key] . '"';
- } else {
- $escape_char_attributes = ' class="es' . $escape_key . '"';
- }
-
- //Add the style for the escape char ...
- $string .= "<span$escape_char_attributes>" .
- $this->hsc($escape_str) . '</span>';
-
- $start = $es_pos + $escape['length'];
- } else {
- //Copy the remainder of the string ...
- $string .= $this->hsc(substr($part, $start, $close_pos - $start + $char_len)) . '</span>';
- $start = $close_pos + $char_len;
- $string_open = false;
- }
- } while($string_open);
-
- if ($check_linenumbers) {
- // Are line numbers used? If, we should end the string before
- // the newline and begin it again (so when <li>s are put in the source
- // remains XHTML compliant)
- // note to self: This opens up possibility of config files specifying
- // that languages can/cannot have multiline strings???
- $string = str_replace("\n", "</span>\n<span$string_attributes>", $string);
- }
-
- $result .= $string;
- $string = '';
- $i = $start - 1;
- continue;
- } else if ($this->lexic_permissions['STRINGS'] && $hq && $hq[0] == $char &&
- substr($part, $i, $hq_strlen) == $hq) {
- // The start of a hard quoted string
- if (!$this->use_classes) {
- $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS']['HARD'] . '"';
- $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR']['HARD'] . '"';
- } else {
- $string_attributes = ' class="st_h"';
- $escape_char_attributes = ' class="es_h"';
- }
- // parse the stuff before this
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
-
- // now handle the string
- $string = '';
-
- // look for closing quote
- $start = $i + $hq_strlen;
- while ($close_pos = strpos($part, $this->language_data['HARDQUOTE'][1], $start)) {
- $start = $close_pos + 1;
- if ($this->lexic_permissions['ESCAPE_CHAR'] && $part[$close_pos - 1] == $this->language_data['HARDCHAR']) {
- // make sure this quote is not escaped
- foreach ($this->language_data['HARDESCAPE'] as $hardescape) {
- if (substr($part, $close_pos - 1, strlen($hardescape)) == $hardescape) {
- // check wether this quote is escaped or if it is something like '\\'
- $escape_char_pos = $close_pos - 1;
- while ($escape_char_pos > 0
- && $part[$escape_char_pos - 1] == $this->language_data['HARDCHAR']) {
- --$escape_char_pos;
- }
- if (($close_pos - $escape_char_pos) & 1) {
- // uneven number of escape chars => this quote is escaped
- continue 2;
- }
- }
- }
- }
-
- // found closing quote
- break;
- }
-
- //Found the closing delimiter?
- if (!$close_pos) {
- // span till the end of this $part when no closing delimiter is found
- $close_pos = $length;
- }
-
- //Get the actual string
- $string = substr($part, $i, $close_pos - $i + 1);
- $i = $close_pos;
-
- // handle escape chars and encode html chars
- // (special because when we have escape chars within our string they may not be escaped)
- if ($this->lexic_permissions['ESCAPE_CHAR'] && $this->language_data['ESCAPE_CHAR']) {
- $start = 0;
- $new_string = '';
- while ($es_pos = strpos($string, $this->language_data['ESCAPE_CHAR'], $start)) {
- // hmtl escape stuff before
- $new_string .= $this->hsc(substr($string, $start, $es_pos - $start));
- // check if this is a hard escape
- foreach ($this->language_data['HARDESCAPE'] as $hardescape) {
- if (substr($string, $es_pos, strlen($hardescape)) == $hardescape) {
- // indeed, this is a hardescape
- $new_string .= "<span$escape_char_attributes>" .
- $this->hsc($hardescape) . '</span>';
- $start = $es_pos + strlen($hardescape);
- continue 2;
- }
- }
- // not a hard escape, but a normal escape
- // they come in pairs of two
- $c = 0;
- while (isset($string[$es_pos + $c]) && isset($string[$es_pos + $c + 1])
- && $string[$es_pos + $c] == $this->language_data['ESCAPE_CHAR']
- && $string[$es_pos + $c + 1] == $this->language_data['ESCAPE_CHAR']) {
- $c += 2;
- }
- if ($c) {
- $new_string .= "<span$escape_char_attributes>" .
- str_repeat($escaped_escape_char, $c) .
- '</span>';
- $start = $es_pos + $c;
- } else {
- // this is just a single lonely escape char...
- $new_string .= $escaped_escape_char;
- $start = $es_pos + 1;
- }
- }
- $string = $new_string . $this->hsc(substr($string, $start));
- } else {
- $string = $this->hsc($string);
- }
-
- if ($check_linenumbers) {
- // Are line numbers used? If, we should end the string before
- // the newline and begin it again (so when <li>s are put in the source
- // remains XHTML compliant)
- // note to self: This opens up possibility of config files specifying
- // that languages can/cannot have multiline strings???
- $string = str_replace("\n", "</span>\n<span$string_attributes>", $string);
- }
-
- $result .= "<span$string_attributes>" . $string . '</span>';
- $string = '';
- continue;
- } else {
- //Have a look for regexp comments
- if ($i == $next_comment_regexp_pos) {
- $COMMENT_MATCHED = true;
- $comment = $comment_regexp_cache_per_key[$next_comment_regexp_key];
- $test_str = $this->hsc(substr($part, $i, $comment['length']));
-
- //@todo If remove important do remove here
- if ($this->lexic_permissions['COMMENTS']['MULTI']) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment['key']] . '"';
- } else {
- $attributes = ' class="co' . $comment['key'] . '"';
- }
-
- $test_str = "<span$attributes>" . $test_str . "</span>";
-
- // Short-cut through all the multiline code
- if ($check_linenumbers) {
- // strreplace to put close span and open span around multiline newlines
- $test_str = str_replace(
- "\n", "</span>\n<span$attributes>",
- str_replace("\n ", "\n&nbsp;", $test_str)
- );
- }
- }
-
- $i += $comment['length'] - 1;
-
- // parse the rest
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- }
-
- // If we haven't matched a regexp comment, try multi-line comments
- if (!$COMMENT_MATCHED) {
- // Is this a multiline comment?
- if (!empty($this->language_data['COMMENT_MULTI']) && $next_comment_multi_pos < $i) {
- $next_comment_multi_pos = $length;
- foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) {
- $match_i = false;
- if (isset($comment_multi_cache_per_key[$open]) &&
- ($comment_multi_cache_per_key[$open] >= $i ||
- $comment_multi_cache_per_key[$open] === false)) {
- // we have already matched something
- if ($comment_multi_cache_per_key[$open] === false) {
- // this comment is never matched
- continue;
- }
- $match_i = $comment_multi_cache_per_key[$open];
- } else if (($match_i = stripos($part, $open, $i)) !== false) {
- $comment_multi_cache_per_key[$open] = $match_i;
- } else {
- $comment_multi_cache_per_key[$open] = false;
- continue;
- }
- if ($match_i !== false && $match_i < $next_comment_multi_pos) {
- $next_comment_multi_pos = $match_i;
- $next_open_comment_multi = $open;
- if ($match_i === $i) {
- break;
- }
- }
- }
- }
- if ($i == $next_comment_multi_pos) {
- $open = $next_open_comment_multi;
- $close = $this->language_data['COMMENT_MULTI'][$open];
- $open_strlen = strlen($open);
- $close_strlen = strlen($close);
- $COMMENT_MATCHED = true;
- $test_str_match = $open;
- //@todo If remove important do remove here
- if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
- $open == GESHI_START_IMPORTANT) {
- if ($open != GESHI_START_IMPORTANT) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"';
- } else {
- $attributes = ' class="coMULTI"';
- }
- $test_str = "<span$attributes>" . $this->hsc($open);
- } else {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->important_styles . '"';
- } else {
- $attributes = ' class="imp"';
- }
-
- // We don't include the start of the comment if it's an
- // "important" part
- $test_str = "<span$attributes>";
- }
- } else {
- $test_str = $this->hsc($open);
- }
-
- $close_pos = strpos( $part, $close, $i + $open_strlen );
-
- if ($close_pos === false) {
- $close_pos = $length;
- }
-
- // Short-cut through all the multiline code
- $rest_of_comment = $this->hsc(substr($part, $i + $open_strlen, $close_pos - $i - $open_strlen + $close_strlen));
- if (($this->lexic_permissions['COMMENTS']['MULTI'] ||
- $test_str_match == GESHI_START_IMPORTANT) &&
- $check_linenumbers) {
-
- // strreplace to put close span and open span around multiline newlines
- $test_str .= str_replace(
- "\n", "</span>\n<span$attributes>",
- str_replace("\n ", "\n&nbsp;", $rest_of_comment)
- );
- } else {
- $test_str .= $rest_of_comment;
- }
-
- if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
- $test_str_match == GESHI_START_IMPORTANT) {
- $test_str .= '</span>';
- }
-
- $i = $close_pos + $close_strlen - 1;
-
- // parse the rest
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- }
- }
-
- // If we haven't matched a multiline comment, try single-line comments
- if (!$COMMENT_MATCHED) {
- // cache potential single line comment occurances
- if (!empty($this->language_data['COMMENT_SINGLE']) && $next_comment_single_pos < $i) {
- $next_comment_single_pos = $length;
- foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) {
- $match_i = false;
- if (isset($comment_single_cache_per_key[$comment_key]) &&
- ($comment_single_cache_per_key[$comment_key] >= $i ||
- $comment_single_cache_per_key[$comment_key] === false)) {
- // we have already matched something
- if ($comment_single_cache_per_key[$comment_key] === false) {
- // this comment is never matched
- continue;
- }
- $match_i = $comment_single_cache_per_key[$comment_key];
- } else if (
- // case sensitive comments
- ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] &&
- ($match_i = stripos($part, $comment_mark, $i)) !== false) ||
- // non case sensitive
- (!$this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] &&
- (($match_i = strpos($part, $comment_mark, $i)) !== false))) {
- $comment_single_cache_per_key[$comment_key] = $match_i;
- } else {
- $comment_single_cache_per_key[$comment_key] = false;
- continue;
- }
- if ($match_i !== false && $match_i < $next_comment_single_pos) {
- $next_comment_single_pos = $match_i;
- $next_comment_single_key = $comment_key;
- if ($match_i === $i) {
- break;
- }
- }
- }
- }
- if ($next_comment_single_pos == $i) {
- $comment_key = $next_comment_single_key;
- $comment_mark = $this->language_data['COMMENT_SINGLE'][$comment_key];
- $com_len = strlen($comment_mark);
-
- // This check will find special variables like $# in bash
- // or compiler directives of Delphi beginning {$
- if ((empty($sc_disallowed_before) || ($i == 0) ||
- (false === strpos($sc_disallowed_before, $part[$i-1]))) &&
- (empty($sc_disallowed_after) || ($length <= $i + $com_len) ||
- (false === strpos($sc_disallowed_after, $part[$i + $com_len]))))
- {
- // this is a valid comment
- $COMMENT_MATCHED = true;
- if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"';
- } else {
- $attributes = ' class="co' . $comment_key . '"';
- }
- $test_str = "<span$attributes>" . $this->hsc($this->change_case($comment_mark));
- } else {
- $test_str = $this->hsc($comment_mark);
- }
-
- //Check if this comment is the last in the source
- $close_pos = strpos($part, "\n", $i);
- $oops = false;
- if ($close_pos === false) {
- $close_pos = $length;
- $oops = true;
- }
- $test_str .= $this->hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len));
- if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
- $test_str .= "</span>";
- }
-
- // Take into account that the comment might be the last in the source
- if (!$oops) {
- $test_str .= "\n";
- }
-
- $i = $close_pos;
-
- // parse the rest
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- }
- }
- }
- }
-
- // Where are we adding this char?
- if (!$COMMENT_MATCHED) {
- $stuff_to_parse .= $char;
- } else {
- $result .= $test_str;
- unset($test_str);
- $COMMENT_MATCHED = false;
- }
- }
- // Parse the last bit
- $result .= $this->parse_non_string_part($stuff_to_parse);
- $stuff_to_parse = '';
- } else {
- $result .= $this->hsc($part);
- }
- // Close the <span> that surrounds the block
- if ($STRICTATTRS != '') {
- $result = str_replace("\n", "</span>\n<span$STRICTATTRS>", $result);
- $result .= '</span>';
- }
-
- $endresult .= $result;
- unset($part, $parts[$key], $result);
- }
-
- //This fix is related to SF#1923020, but has to be applied regardless of
- //actually highlighting symbols.
- /** NOTE: memorypeak #3 */
- $endresult = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $endresult);
-
-// // Parse the last stuff (redundant?)
-// $result .= $this->parse_non_string_part($stuff_to_parse);
-
- // Lop off the very first and last spaces
-// $result = substr($result, 1, -1);
-
- // We're finished: stop timing
- $this->set_time($start_time, microtime());
-
- $this->finalise($endresult);
- return $endresult;
- }
-
- /**
- * Swaps out spaces and tabs for HTML indentation. Not needed if
- * the code is in a pre block...
- *
- * @param string The source to indent (reference!)
- * @since 1.0.0
- * @access private
- */
- function indent(&$result) {
- /// Replace tabs with the correct number of spaces
- if (false !== strpos($result, "\t")) {
- $lines = explode("\n", $result);
- $result = null;//Save memory while we process the lines individually
- $tab_width = $this->get_real_tab_width();
- $tab_string = '&nbsp;' . str_repeat(' ', $tab_width);
-
- for ($key = 0, $n = count($lines); $key < $n; $key++) {
- $line = $lines[$key];
- if (false === strpos($line, "\t")) {
- continue;
- }
-
- $pos = 0;
- $length = strlen($line);
- $lines[$key] = ''; // reduce memory
-
- $IN_TAG = false;
- for ($i = 0; $i < $length; ++$i) {
- $char = $line[$i];
- // Simple engine to work out whether we're in a tag.
- // If we are we modify $pos. This is so we ignore HTML
- // in the line and only workout the tab replacement
- // via the actual content of the string
- // This test could be improved to include strings in the
- // html so that < or > would be allowed in user's styles
- // (e.g. quotes: '<' '>'; or similar)
- if ($IN_TAG) {
- if ('>' == $char) {
- $IN_TAG = false;
- }
- $lines[$key] .= $char;
- } else if ('<' == $char) {
- $IN_TAG = true;
- $lines[$key] .= '<';
- } else if ('&' == $char) {
- $substr = substr($line, $i + 3, 5);
- $posi = strpos($substr, ';');
- if (false === $posi) {
- ++$pos;
- } else {
- $pos -= $posi+2;
- }
- $lines[$key] .= $char;
- } else if ("\t" == $char) {
- $str = '';
- // OPTIMISE - move $strs out. Make an array:
- // $tabs = array(
- // 1 => '&nbsp;',
- // 2 => '&nbsp; ',
- // 3 => '&nbsp; &nbsp;' etc etc
- // to use instead of building a string every time
- $tab_end_width = $tab_width - ($pos % $tab_width); //Moved out of the look as it doesn't change within the loop
- if (($pos & 1) || 1 == $tab_end_width) {
- $str .= substr($tab_string, 6, $tab_end_width);
- } else {
- $str .= substr($tab_string, 0, $tab_end_width+5);
- }
- $lines[$key] .= $str;
- $pos += $tab_end_width;
-
- if (false === strpos($line, "\t", $i + 1)) {
- $lines[$key] .= substr($line, $i + 1);
- break;
- }
- } else if (0 == $pos && ' ' == $char) {
- $lines[$key] .= '&nbsp;';
- ++$pos;
- } else {
- $lines[$key] .= $char;
- ++$pos;
- }
- }
- }
- $result = implode("\n", $lines);
- unset($lines);//We don't need the lines separated beyond this --- free them!
- }
- // Other whitespace
- // BenBE: Fix to reduce the number of replacements to be done
- $result = preg_replace('/^ /m', '&nbsp;', $result);
- $result = str_replace(' ', ' &nbsp;', $result);
-
- if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) {
- if ($this->line_ending === null) {
- $result = nl2br($result);
- } else {
- $result = str_replace("\n", $this->line_ending, $result);
- }
- }
- }
-
- /**
- * Changes the case of a keyword for those languages where a change is asked for
- *
- * @param string The keyword to change the case of
- * @return string The keyword with its case changed
- * @since 1.0.0
- * @access private
- */
- function change_case($instr) {
- switch ($this->language_data['CASE_KEYWORDS']) {
- case GESHI_CAPS_UPPER:
- return strtoupper($instr);
- case GESHI_CAPS_LOWER:
- return strtolower($instr);
- default:
- return $instr;
- }
- }
-
- /**
- * Handles replacements of keywords to include markup and links if requested
- *
- * @param string The keyword to add the Markup to
- * @return The HTML for the match found
- * @since 1.0.8
- * @access private
- *
- * @todo Get rid of ender in keyword links
- */
- function handle_keyword_replace($match) {
- $k = $this->_kw_replace_group;
- $keyword = $match[0];
-
- $before = '';
- $after = '';
-
- if ($this->keyword_links) {
- // Keyword links have been ebabled
-
- if (isset($this->language_data['URLS'][$k]) &&
- $this->language_data['URLS'][$k] != '') {
- // There is a base group for this keyword
-
- // Old system: strtolower
- //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword);
- // New system: get keyword from language file to get correct case
- if (!$this->language_data['CASE_SENSITIVE'][$k] &&
- strpos($this->language_data['URLS'][$k], '{FNAME}') !== false) {
- foreach ($this->language_data['KEYWORDS'][$k] as $word) {
- if (strcasecmp($word, $keyword) == 0) {
- break;
- }
- }
- } else {
- $word = $keyword;
- }
-
- $before = '<|UR1|"' .
- str_replace(
- array(
- '{FNAME}',
- '{FNAMEL}',
- '{FNAMEU}',
- '.'),
- array(
- str_replace('+', '%20', urlencode($this->hsc($word))),
- str_replace('+', '%20', urlencode($this->hsc(strtolower($word)))),
- str_replace('+', '%20', urlencode($this->hsc(strtoupper($word)))),
- '<DOT>'),
- $this->language_data['URLS'][$k]
- ) . '">';
- $after = '</a>';
- }
- }
-
- return $before . '<|/'. $k .'/>' . $this->change_case($keyword) . '|>' . $after;
- }
-
- /**
- * handles regular expressions highlighting-definitions with callback functions
- *
- * @note this is a callback, don't use it directly
- *
- * @param array the matches array
- * @return The highlighted string
- * @since 1.0.8
- * @access private
- */
- function handle_regexps_callback($matches) {
- // before: "' style=\"' . call_user_func(\"$func\", '\\1') . '\"\\1|>'",
- return ' style="' . call_user_func($this->language_data['STYLES']['REGEXPS'][$this->_rx_key], $matches[1]) . '"'. $matches[1] . '|>';
- }
-
- /**
- * handles newlines in REGEXPS matches. Set the _hmr_* vars before calling this
- *
- * @note this is a callback, don't use it directly
- *
- * @param array the matches array
- * @return string
- * @since 1.0.8
- * @access private
- */
- function handle_multiline_regexps($matches) {
- $before = $this->_hmr_before;
- $after = $this->_hmr_after;
- if ($this->_hmr_replace) {
- $replace = $this->_hmr_replace;
- $search = array();
-
- foreach (array_keys($matches) as $k) {
- $search[] = '\\' . $k;
- }
-
- $before = str_replace($search, $matches, $before);
- $after = str_replace($search, $matches, $after);
- $replace = str_replace($search, $matches, $replace);
- } else {
- $replace = $matches[0];
- }
- return $before
- . '<|!REG3XP' . $this->_hmr_key .'!>'
- . str_replace("\n", "|>\n<|!REG3XP" . $this->_hmr_key . '!>', $replace)
- . '|>'
- . $after;
- }
-
- /**
- * Takes a string that has no strings or comments in it, and highlights
- * stuff like keywords, numbers and methods.
- *
- * @param string The string to parse for keyword, numbers etc.
- * @since 1.0.0
- * @access private
- * @todo BUGGY! Why? Why not build string and return?
- */
- function parse_non_string_part($stuff_to_parse) {
- $stuff_to_parse = ' ' . $this->hsc($stuff_to_parse);
-
- // Regular expressions
- foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
- if ($this->lexic_permissions['REGEXPS'][$key]) {
- if (is_array($regexp)) {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- // produce valid HTML when we match multiple lines
- $this->_hmr_replace = $regexp[GESHI_REPLACE];
- $this->_hmr_before = $regexp[GESHI_BEFORE];
- $this->_hmr_key = $key;
- $this->_hmr_after = $regexp[GESHI_AFTER];
- $stuff_to_parse = preg_replace_callback(
- "/" . $regexp[GESHI_SEARCH] . "/{$regexp[GESHI_MODIFIERS]}",
- array($this, 'handle_multiline_regexps'),
- $stuff_to_parse);
- $this->_hmr_replace = false;
- $this->_hmr_before = '';
- $this->_hmr_after = '';
- } else {
- $stuff_to_parse = preg_replace(
- '/' . $regexp[GESHI_SEARCH] . '/' . $regexp[GESHI_MODIFIERS],
- $regexp[GESHI_BEFORE] . '<|!REG3XP'. $key .'!>' . $regexp[GESHI_REPLACE] . '|>' . $regexp[GESHI_AFTER],
- $stuff_to_parse);
- }
- } else {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- // produce valid HTML when we match multiple lines
- $this->_hmr_key = $key;
- $stuff_to_parse = preg_replace_callback( "/(" . $regexp . ")/",
- array($this, 'handle_multiline_regexps'), $stuff_to_parse);
- $this->_hmr_key = '';
- } else {
- $stuff_to_parse = preg_replace( "/(" . $regexp . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
- }
- }
- }
- }
-
- // Highlight numbers. As of 1.0.8 we support diffent types of numbers
- $numbers_found = false;
- if ($this->lexic_permissions['NUMBERS'] && preg_match('#\d#', $stuff_to_parse )) {
- $numbers_found = true;
-
- //For each of the formats ...
- foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
- //Check if it should be highlighted ...
- $stuff_to_parse = preg_replace($regexp, "<|/NUM!$id/>\\1|>", $stuff_to_parse);
- }
- }
-
- // Highlight keywords
- $disallowed_before = "(?<![a-zA-Z0-9\$_\|\#;>|^&";
- $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
- if ($this->lexic_permissions['STRINGS']) {
- $quotemarks = preg_quote(implode($this->language_data['QUOTEMARKS']), '/');
- $disallowed_before .= $quotemarks;
- $disallowed_after .= $quotemarks;
- }
- $disallowed_before .= "])";
- $disallowed_after .= "])";
-
- $parser_control_pergroup = false;
- if (isset($this->language_data['PARSER_CONTROL'])) {
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) {
- $x = 0; // check wether per-keyword-group parser_control is enabled
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) {
- $disallowed_before = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
- ++$x;
- }
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) {
- $disallowed_after = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
- ++$x;
- }
- $parser_control_pergroup = (count($this->language_data['PARSER_CONTROL']['KEYWORDS']) - $x) > 0;
- }
- }
-
- // if this is changed, don't forget to change it below
-// if (!empty($disallowed_before)) {
-// $disallowed_before = "(?<![$disallowed_before])";
-// }
-// if (!empty($disallowed_after)) {
-// $disallowed_after = "(?![$disallowed_after])";
-// }
-
- foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
- if (!isset($this->lexic_permissions['KEYWORDS'][$k]) ||
- $this->lexic_permissions['KEYWORDS'][$k]) {
-
- $case_sensitive = $this->language_data['CASE_SENSITIVE'][$k];
- $modifiers = $case_sensitive ? '' : 'i';
-
- // NEW in 1.0.8 - per-keyword-group parser control
- $disallowed_before_local = $disallowed_before;
- $disallowed_after_local = $disallowed_after;
- if ($parser_control_pergroup && isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k])) {
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'])) {
- $disallowed_before_local =
- $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'];
- }
-
- if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'])) {
- $disallowed_after_local =
- $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'];
- }
- }
-
- $this->_kw_replace_group = $k;
-
- //NEW in 1.0.8, the cached regexp list
- // since we don't want PHP / PCRE to crash due to too large patterns we split them into smaller chunks
- for ($set = 0, $set_length = count($this->language_data['CACHED_KEYWORD_LISTS'][$k]); $set < $set_length; ++$set) {
- $keywordset =& $this->language_data['CACHED_KEYWORD_LISTS'][$k][$set];
- // Might make a more unique string for putting the number in soon
- // Basically, we don't put the styles in yet because then the styles themselves will
- // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
- $stuff_to_parse = preg_replace_callback(
- "/$disallowed_before_local({$keywordset})(?!\<DOT\>(?:htm|php))$disallowed_after_local/$modifiers",
- array($this, 'handle_keyword_replace'),
- $stuff_to_parse
- );
- }
- }
- }
-
- //
- // Now that's all done, replace /[number]/ with the correct styles
- //
- foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
- if (!$this->use_classes) {
- $attributes = ' style="' .
- (isset($this->language_data['STYLES']['KEYWORDS'][$k]) ?
- $this->language_data['STYLES']['KEYWORDS'][$k] : "") . '"';
- } else {
- $attributes = ' class="kw' . $k . '"';
- }
- $stuff_to_parse = str_replace("<|/$k/>", "<|$attributes>", $stuff_to_parse);
- }
-
- if ($numbers_found) {
- // Put number styles in
- foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
-//Commented out for now, as this needs some review ...
-// if ($numbers_permissions & $id) {
- //Get the appropriate style ...
- //Checking for unset styles is done by the style cache builder ...
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][$id] . '"';
- } else {
- $attributes = ' class="nu'.$id.'"';
- }
-
- //Set in the correct styles ...
- $stuff_to_parse = str_replace("/NUM!$id/", $attributes, $stuff_to_parse);
-// }
- }
- }
-
- // Highlight methods and fields in objects
- if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) {
- $oolang_spaces = "[\s]*";
- $oolang_before = "";
- $oolang_after = "[a-zA-Z][a-zA-Z0-9_]*";
- if (isset($this->language_data['PARSER_CONTROL'])) {
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG'])) {
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'])) {
- $oolang_before = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'];
- }
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'])) {
- $oolang_after = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'];
- }
- if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'])) {
- $oolang_spaces = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'];
- }
- }
- }
-
- foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) {
- if (false !== strpos($stuff_to_parse, $splitter)) {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"';
- } else {
- $attributes = ' class="me' . $key . '"';
- }
- $stuff_to_parse = preg_replace("/($oolang_before)(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], '/') . ")($oolang_spaces)($oolang_after)/", "\\1\\2\\3<|$attributes>\\4|>", $stuff_to_parse);
- }
- }
- }
-
- //
- // Highlight brackets. Yes, I've tried adding a semi-colon to this list.
- // You try it, and see what happens ;)
- // TODO: Fix lexic permissions not converting entities if shouldn't
- // be highlighting regardless
- //
- if ($this->lexic_permissions['BRACKETS']) {
- $stuff_to_parse = str_replace( $this->language_data['CACHE_BRACKET_MATCH'],
- $this->language_data['CACHE_BRACKET_REPLACE'], $stuff_to_parse );
- }
-
-
- //FIX for symbol highlighting ...
- if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) {
- //Get all matches and throw away those witin a block that is already highlighted... (i.e. matched by a regexp)
- $n_symbols = preg_match_all("/<\|(?:<DOT>|[^>])+>(?:(?!\|>).*?)\|>|<\/a>|(?:" . $this->language_data['SYMBOL_SEARCH'] . ")+/", $stuff_to_parse, $pot_symbols, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
- $global_offset = 0;
- for ($s_id = 0; $s_id < $n_symbols; ++$s_id) {
- $symbol_match = $pot_symbols[$s_id][0][0];
- if (strpos($symbol_match, '<') !== false || strpos($symbol_match, '>') !== false) {
- // already highlighted blocks _must_ include either < or >
- // so if this conditional applies, we have to skip this match
- // BenBE: UNLESS the block contains <SEMI> or <PIPE>
- if(strpos($symbol_match, '<SEMI>') === false &&
- strpos($symbol_match, '<PIPE>') === false) {
- continue;
- }
- }
-
- // if we reach this point, we have a valid match which needs to be highlighted
-
- $symbol_length = strlen($symbol_match);
- $symbol_offset = $pot_symbols[$s_id][0][1];
- unset($pot_symbols[$s_id]);
- $symbol_end = $symbol_length + $symbol_offset;
- $symbol_hl = "";
-
- // if we have multiple styles, we have to handle them properly
- if ($this->language_data['MULTIPLE_SYMBOL_GROUPS']) {
- $old_sym = -1;
- // Split the current stuff to replace into its atomic symbols ...
- preg_match_all("/" . $this->language_data['SYMBOL_SEARCH'] . "/", $symbol_match, $sym_match_syms, PREG_PATTERN_ORDER);
- foreach ($sym_match_syms[0] as $sym_ms) {
- //Check if consequtive symbols belong to the same group to save output ...
- if (isset($this->language_data['SYMBOL_DATA'][$sym_ms])
- && ($this->language_data['SYMBOL_DATA'][$sym_ms] != $old_sym)) {
- if (-1 != $old_sym) {
- $symbol_hl .= "|>";
- }
- $old_sym = $this->language_data['SYMBOL_DATA'][$sym_ms];
- if (!$this->use_classes) {
- $symbol_hl .= '<| style="' . $this->language_data['STYLES']['SYMBOLS'][$old_sym] . '">';
- } else {
- $symbol_hl .= '<| class="sy' . $old_sym . '">';
- }
- }
- $symbol_hl .= $sym_ms;
- }
- unset($sym_match_syms);
-
- //Close remaining tags and insert the replacement at the right position ...
- //Take caution if symbol_hl is empty to avoid doubled closing spans.
- if (-1 != $old_sym) {
- $symbol_hl .= "|>";
- }
- } else {
- if (!$this->use_classes) {
- $symbol_hl = '<| style="' . $this->language_data['STYLES']['SYMBOLS'][0] . '">';
- } else {
- $symbol_hl = '<| class="sy0">';
- }
- $symbol_hl .= $symbol_match . '|>';
- }
-
- $stuff_to_parse = substr_replace($stuff_to_parse, $symbol_hl, $symbol_offset + $global_offset, $symbol_length);
-
- // since we replace old text with something of different size,
- // we'll have to keep track of the differences
- $global_offset += strlen($symbol_hl) - $symbol_length;
- }
- }
- //FIX for symbol highlighting ...
-
- // Add class/style for regexps
- foreach (array_keys($this->language_data['REGEXPS']) as $key) {
- if ($this->lexic_permissions['REGEXPS'][$key]) {
- if (is_callable($this->language_data['STYLES']['REGEXPS'][$key])) {
- $this->_rx_key = $key;
- $stuff_to_parse = preg_replace_callback("/!REG3XP$key!(.*)\|>/U",
- array($this, 'handle_regexps_callback'),
- $stuff_to_parse);
- } else {
- if (!$this->use_classes) {
- $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
- } else {
- if (is_array($this->language_data['REGEXPS'][$key]) &&
- array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) {
- $attributes = ' class="' .
- $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"';
- } else {
- $attributes = ' class="re' . $key . '"';
- }
- }
- $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
- }
- }
- }
-
- // Replace <DOT> with . for urls
- $stuff_to_parse = str_replace('<DOT>', '.', $stuff_to_parse);
- // Replace <|UR1| with <a href= for urls also
- if (isset($this->link_styles[GESHI_LINK])) {
- if ($this->use_classes) {
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
- } else {
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);
- }
- } else {
- $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
- }
-
- //
- // NOW we add the span thingy ;)
- //
-
- $stuff_to_parse = str_replace('<|', '<span', $stuff_to_parse);
- $stuff_to_parse = str_replace ( '|>', '</span>', $stuff_to_parse );
- return substr($stuff_to_parse, 1);
- }
-
- /**
- * Sets the time taken to parse the code
- *
- * @param microtime The time when parsing started
- * @param microtime The time when parsing ended
- * @since 1.0.2
- * @access private
- */
- function set_time($start_time, $end_time) {
- $start = explode(' ', $start_time);
- $end = explode(' ', $end_time);
- $this->time = $end[0] + $end[1] - $start[0] - $start[1];
- }
-
- /**
- * Gets the time taken to parse the code
- *
- * @return double The time taken to parse the code
- * @since 1.0.2
- */
- function get_time() {
- return $this->time;
- }
-
- /**
- * Merges arrays recursively, overwriting values of the first array with values of later arrays
- *
- * @since 1.0.8
- * @access private
- */
- function merge_arrays() {
- $arrays = func_get_args();
- $narrays = count($arrays);
-
- // check arguments
- // comment out if more performance is necessary (in this case the foreach loop will trigger a warning if the argument is not an array)
- for ($i = 0; $i < $narrays; $i ++) {
- if (!is_array($arrays[$i])) {
- // also array_merge_recursive returns nothing in this case
- trigger_error('Argument #' . ($i+1) . ' is not an array - trying to merge array with scalar! Returning false!', E_USER_WARNING);
- return false;
- }
- }
-
- // the first array is in the output set in every case
- $ret = $arrays[0];
-
- // merege $ret with the remaining arrays
- for ($i = 1; $i < $narrays; $i ++) {
- foreach ($arrays[$i] as $key => $value) {
- if (is_array($value) && isset($ret[$key])) {
- // if $ret[$key] is not an array you try to merge an scalar value with an array - the result is not defined (incompatible arrays)
- // in this case the call will trigger an E_USER_WARNING and the $ret[$key] will be false.
- $ret[$key] = $this->merge_arrays($ret[$key], $value);
- } else {
- $ret[$key] = $value;
- }
- }
- }
-
- return $ret;
- }
-
- /**
- * Gets language information and stores it for later use
- *
- * @param string The filename of the language file you want to load
- * @since 1.0.0
- * @access private
- * @todo Needs to load keys for lexic permissions for keywords, regexps etc
- */
- function load_language($file_name) {
- if ($file_name == $this->loaded_language) {
- // this file is already loaded!
- return;
- }
-
- //Prepare some stuff before actually loading the language file
- $this->loaded_language = $file_name;
- $this->parse_cache_built = false;
- $this->enable_highlighting();
- $language_data = array();
-
- //Load the language file
- require $file_name;
-
- // Perhaps some checking might be added here later to check that
- // $language data is a valid thing but maybe not
- $this->language_data = $language_data;
-
- // Set strict mode if should be set
- $this->strict_mode = $this->language_data['STRICT_MODE_APPLIES'];
-
- // Set permissions for all lexics to true
- // so they'll be highlighted by default
- foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
- if (!empty($this->language_data['KEYWORDS'][$key])) {
- $this->lexic_permissions['KEYWORDS'][$key] = true;
- } else {
- $this->lexic_permissions['KEYWORDS'][$key] = false;
- }
- }
-
- foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) {
- $this->lexic_permissions['COMMENTS'][$key] = true;
- }
- foreach (array_keys($this->language_data['REGEXPS']) as $key) {
- $this->lexic_permissions['REGEXPS'][$key] = true;
- }
-
- // for BenBE and future code reviews:
- // we can use empty here since we only check for existance and emptiness of an array
- // if it is not an array at all but rather false or null this will work as intended as well
- // even if $this->language_data['PARSER_CONTROL'] is undefined this won't trigger a notice
- if (!empty($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'])) {
- foreach ($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'] as $flag => $value) {
- // it's either true or false and maybe is true as well
- $perm = $value !== GESHI_NEVER;
- if ($flag == 'ALL') {
- $this->enable_highlighting($perm);
- continue;
- }
- if (!isset($this->lexic_permissions[$flag])) {
- // unknown lexic permission
- continue;
- }
- if (is_array($this->lexic_permissions[$flag])) {
- foreach ($this->lexic_permissions[$flag] as $key => $val) {
- $this->lexic_permissions[$flag][$key] = $perm;
- }
- } else {
- $this->lexic_permissions[$flag] = $perm;
- }
- }
- unset($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS']);
- }
-
- //Fix: Problem where hardescapes weren't handled if no ESCAPE_CHAR was given
- //You need to set one for HARDESCAPES only in this case.
- if(!isset($this->language_data['HARDCHAR'])) {
- $this->language_data['HARDCHAR'] = $this->language_data['ESCAPE_CHAR'];
- }
-
- //NEW in 1.0.8: Allow styles to be loaded from a separate file to override defaults
- $style_filename = substr($file_name, 0, -4) . '.style.php';
- if (is_readable($style_filename)) {
- //Clear any style_data that could have been set before ...
- if (isset($style_data)) {
- unset($style_data);
- }
-
- //Read the Style Information from the style file
- include $style_filename;
-
- //Apply the new styles to our current language styles
- if (isset($style_data) && is_array($style_data)) {
- $this->language_data['STYLES'] =
- $this->merge_arrays($this->language_data['STYLES'], $style_data);
- }
- }
- }
-
- /**
- * Takes the parsed code and various options, and creates the HTML
- * surrounding it to make it look nice.
- *
- * @param string The code already parsed (reference!)
- * @since 1.0.0
- * @access private
- */
- function finalise(&$parsed_code) {
- // Remove end parts of important declarations
- // This is BUGGY!! My fault for bad code: fix coming in 1.2
- // @todo Remove this crap
- if ($this->enable_important_blocks &&
- (strpos($parsed_code, $this->hsc(GESHI_START_IMPORTANT)) === false)) {
- $parsed_code = str_replace($this->hsc(GESHI_END_IMPORTANT), '', $parsed_code);
- }
-
- // Add HTML whitespace stuff if we're using the <div> header
- if ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) {
- $this->indent($parsed_code);
- }
-
- // purge some unnecessary stuff
- /** NOTE: memorypeak #1 */
- $parsed_code = preg_replace('#<span[^>]+>(\s*)</span>#', '\\1', $parsed_code);
-
- // If we are using IDs for line numbers, there needs to be an overall
- // ID set to prevent collisions.
- if ($this->add_ids && !$this->overall_id) {
- $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4);
- }
-
- // Get code into lines
- /** NOTE: memorypeak #2 */
- $code = explode("\n", $parsed_code);
- $parsed_code = $this->header();
-
- // If we're using line numbers, we insert <li>s and appropriate
- // markup to style them (otherwise we don't need to do anything)
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) {
- // If we're using the <pre> header, we shouldn't add newlines because
- // the <pre> will line-break them (and the <li>s already do this for us)
- $ls = ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) ? "\n" : '';
-
- // Set vars to defaults for following loop
- $i = 0;
-
- // Foreach line...
- for ($i = 0, $n = count($code); $i < $n;) {
- //Reset the attributes for a new line ...
- $attrs = array();
-
- // Make lines have at least one space in them if they're empty
- // BenBE: Checking emptiness using trim instead of relying on blanks
- if ('' == trim($code[$i])) {
- $code[$i] = '&nbsp;';
- }
-
- // If this is a "special line"...
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
- $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
- // Set the attributes to style the line
- if ($this->use_classes) {
- //$attr = ' class="li2"';
- $attrs['class'][] = 'li2';
- $def_attr = ' class="de2"';
- } else {
- //$attr = ' style="' . $this->line_style2 . '"';
- $attrs['style'][] = $this->line_style2;
- // This style "covers up" the special styles set for special lines
- // so that styles applied to special lines don't apply to the actual
- // code on that line
- $def_attr = ' style="' . $this->code_style . '"';
- }
- } else {
- if ($this->use_classes) {
- //$attr = ' class="li1"';
- $attrs['class'][] = 'li1';
- $def_attr = ' class="de1"';
- } else {
- //$attr = ' style="' . $this->line_style1 . '"';
- $attrs['style'][] = $this->line_style1;
- $def_attr = ' style="' . $this->code_style . '"';
- }
- }
-
- //Check which type of tag to insert for this line
- if ($this->header_type == GESHI_HEADER_PRE_VALID) {
- $start = "<pre$def_attr>";
- $end = '</pre>';
- } else {
- // Span or div?
- $start = "<div$def_attr>";
- $end = '</div>';
- }
-
- ++$i;
-
- // Are we supposed to use ids? If so, add them
- if ($this->add_ids) {
- $attrs['id'][] = "$this->overall_id-$i";
- }
-
- //Is this some line with extra styles???
- if (in_array($i, $this->highlight_extra_lines)) {
- if ($this->use_classes) {
- if (isset($this->highlight_extra_lines_styles[$i])) {
- $attrs['class'][] = "lx$i";
- } else {
- $attrs['class'][] = "ln-xtra";
- }
- } else {
- array_push($attrs['style'], $this->get_line_style($i));
- }
- }
-
- // Add in the line surrounded by appropriate list HTML
- $attr_string = '';
- foreach ($attrs as $key => $attr) {
- $attr_string .= ' ' . $key . '="' . implode(' ', $attr) . '"';
- }
-
- $parsed_code .= "<li$attr_string>$start{$code[$i-1]}$end</li>$ls";
- unset($code[$i - 1]);
- }
- } else {
- $n = count($code);
- if ($this->use_classes) {
- $attributes = ' class="de1"';
- } else {
- $attributes = ' style="'. $this->code_style .'"';
- }
- if ($this->header_type == GESHI_HEADER_PRE_VALID) {
- $parsed_code .= '<pre'. $attributes .'>';
- } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- if ($this->use_classes) {
- $attrs = ' class="ln"';
- } else {
- $attrs = ' style="'. $this->table_linenumber_style .'"';
- }
- $parsed_code .= '<td'.$attrs.'><pre'.$attributes.'>';
- // get linenumbers
- // we don't merge it with the for below, since it should be better for
- // memory consumption this way
- // @todo: but... actually it would still be somewhat nice to merge the two loops
- // the mem peaks are at different positions
- for ($i = 0; $i < $n; ++$i) {
- $close = 0;
- // fancy lines
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
- $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
- // Set the attributes to style the line
- if ($this->use_classes) {
- $parsed_code .= '<span class="xtra li2"><span class="de2">';
- } else {
- // This style "covers up" the special styles set for special lines
- // so that styles applied to special lines don't apply to the actual
- // code on that line
- $parsed_code .= '<span style="display:block;' . $this->line_style2 . '">'
- .'<span style="' . $this->code_style .'">';
- }
- $close += 2;
- }
- //Is this some line with extra styles???
- if (in_array($i + 1, $this->highlight_extra_lines)) {
- if ($this->use_classes) {
- if (isset($this->highlight_extra_lines_styles[$i])) {
- $parsed_code .= "<span class=\"xtra lx$i\">";
- } else {
- $parsed_code .= "<span class=\"xtra ln-xtra\">";
- }
- } else {
- $parsed_code .= "<span style=\"display:block;" . $this->get_line_style($i) . "\">";
- }
- ++$close;
- }
- $parsed_code .= $this->line_numbers_start + $i;
- if ($close) {
- $parsed_code .= str_repeat('</span>', $close);
- } else if ($i != $n) {
- $parsed_code .= "\n";
- }
- }
- $parsed_code .= '</pre></td><td'.$attributes.'>';
- }
- $parsed_code .= '<pre'. $attributes .'>';
- }
- // No line numbers, but still need to handle highlighting lines extra.
- // Have to use divs so the full width of the code is highlighted
- $close = 0;
- for ($i = 0; $i < $n; ++$i) {
- // Make lines have at least one space in them if they're empty
- // BenBE: Checking emptiness using trim instead of relying on blanks
- if ('' == trim($code[$i])) {
- $code[$i] = '&nbsp;';
- }
- // fancy lines
- if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
- $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
- // Set the attributes to style the line
- if ($this->use_classes) {
- $parsed_code .= '<span class="xtra li2"><span class="de2">';
- } else {
- // This style "covers up" the special styles set for special lines
- // so that styles applied to special lines don't apply to the actual
- // code on that line
- $parsed_code .= '<span style="display:block;' . $this->line_style2 . '">'
- .'<span style="' . $this->code_style .'">';
- }
- $close += 2;
- }
- //Is this some line with extra styles???
- if (in_array($i + 1, $this->highlight_extra_lines)) {
- if ($this->use_classes) {
- if (isset($this->highlight_extra_lines_styles[$i])) {
- $parsed_code .= "<span class=\"xtra lx$i\">";
- } else {
- $parsed_code .= "<span class=\"xtra ln-xtra\">";
- }
- } else {
- $parsed_code .= "<span style=\"display:block;" . $this->get_line_style($i) . "\">";
- }
- ++$close;
- }
-
- $parsed_code .= $code[$i];
-
- if ($close) {
- $parsed_code .= str_repeat('</span>', $close);
- $close = 0;
- }
- elseif ($i + 1 < $n) {
- $parsed_code .= "\n";
- }
- unset($code[$i]);
- }
-
- if ($this->header_type == GESHI_HEADER_PRE_VALID || $this->header_type == GESHI_HEADER_PRE_TABLE) {
- $parsed_code .= '</pre>';
- }
- if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- $parsed_code .= '</td>';
- }
- }
-
- $parsed_code .= $this->footer();
- }
-
- /**
- * Creates the header for the code block (with correct attributes)
- *
- * @return string The header for the code block
- * @since 1.0.0
- * @access private
- */
- function header() {
- // Get attributes needed
- /**
- * @todo Document behaviour change - class is outputted regardless of whether
- * we're using classes or not. Same with style
- */
- $attributes = ' class="' . $this->language;
- if ($this->overall_class != '') {
- $attributes .= " ".$this->overall_class;
- }
- $attributes .= '"';
-
- if ($this->overall_id != '') {
- $attributes .= " id=\"{$this->overall_id}\"";
- }
- if ($this->overall_style != '') {
- $attributes .= ' style="' . $this->overall_style . '"';
- }
-
- $ol_attributes = '';
-
- if ($this->line_numbers_start != 1) {
- $ol_attributes .= ' start="' . $this->line_numbers_start . '"';
- }
-
- // Get the header HTML
- $header = $this->header_content;
- if ($header) {
- if ($this->header_type == GESHI_HEADER_PRE || $this->header_type == GESHI_HEADER_PRE_VALID) {
- $header = str_replace("\n", '', $header);
- }
- $header = $this->replace_keywords($header);
-
- if ($this->use_classes) {
- $attr = ' class="head"';
- } else {
- $attr = " style=\"{$this->header_content_style}\"";
- }
- if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- $header = "<thead><tr><td colspan=\"2\" $attr>$header</td></tr></thead>";
- } else {
- $header = "<div$attr>$header</div>";
- }
- }
-
- if (GESHI_HEADER_NONE == $this->header_type) {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- return "$header<ol$attributes$ol_attributes>";
- }
- return $header . ($this->force_code_block ? '<div>' : '');
- }
-
- // Work out what to return and do it
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- if ($this->header_type == GESHI_HEADER_PRE) {
- return "<pre$attributes>$header<ol$ol_attributes>";
- } else if ($this->header_type == GESHI_HEADER_DIV ||
- $this->header_type == GESHI_HEADER_PRE_VALID) {
- return "<div$attributes>$header<ol$ol_attributes>";
- } else if ($this->header_type == GESHI_HEADER_PRE_TABLE) {
- return "<table$attributes>$header<tbody><tr class=\"li1\">";
- }
- } else {
- if ($this->header_type == GESHI_HEADER_PRE) {
- return "<pre$attributes>$header" .
- ($this->force_code_block ? '<div>' : '');
- } else {
- return "<div$attributes>$header" .
- ($this->force_code_block ? '<div>' : '');
- }
- }
- }
-
- /**
- * Returns the footer for the code block.
- *
- * @return string The footer for the code block
- * @since 1.0.0
- * @access private
- */
- function footer() {
- $footer = $this->footer_content;
- if ($footer) {
- if ($this->header_type == GESHI_HEADER_PRE) {
- $footer = str_replace("\n", '', $footer);;
- }
- $footer = $this->replace_keywords($footer);
-
- if ($this->use_classes) {
- $attr = ' class="foot"';
- } else {
- $attr = " style=\"{$this->footer_content_style}\"";
- }
- if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- $footer = "<tfoot><tr><td colspan=\"2\">$footer</td></tr></tfoot>";
- } else {
- $footer = "<div$attr>$footer</div>";
- }
- }
-
- if (GESHI_HEADER_NONE == $this->header_type) {
- return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '</ol>' . $footer : $footer;
- }
-
- if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- return "</ol>$footer</div>";
- }
- return ($this->force_code_block ? '</div>' : '') .
- "$footer</div>";
- }
- elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- return "</tr></tbody>$footer</table>";
- }
- return ($this->force_code_block ? '</div>' : '') .
- "$footer</div>";
- }
- else {
- if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- return "</ol>$footer</pre>";
- }
- return ($this->force_code_block ? '</div>' : '') .
- "$footer</pre>";
- }
- }
-
- /**
- * Replaces certain keywords in the header and footer with
- * certain configuration values
- *
- * @param string The header or footer content to do replacement on
- * @return string The header or footer with replaced keywords
- * @since 1.0.2
- * @access private
- */
- function replace_keywords($instr) {
- $keywords = $replacements = array();
-
- $keywords[] = '<TIME>';
- $keywords[] = '{TIME}';
- $replacements[] = $replacements[] = number_format($time = $this->get_time(), 3);
-
- $keywords[] = '<LANGUAGE>';
- $keywords[] = '{LANGUAGE}';
- $replacements[] = $replacements[] = $this->language_data['LANG_NAME'];
-
- $keywords[] = '<VERSION>';
- $keywords[] = '{VERSION}';
- $replacements[] = $replacements[] = GESHI_VERSION;
-
- $keywords[] = '<SPEED>';
- $keywords[] = '{SPEED}';
- if ($time <= 0) {
- $speed = 'N/A';
- } else {
- $speed = strlen($this->source) / $time;
- if ($speed >= 1024) {
- $speed = sprintf("%.2f KB/s", $speed / 1024.0);
- } else {
- $speed = sprintf("%.0f B/s", $speed);
- }
- }
- $replacements[] = $replacements[] = $speed;
-
- return str_replace($keywords, $replacements, $instr);
- }
-
- /**
- * Secure replacement for PHP built-in function htmlspecialchars().
- *
- * See ticket #427 (http://wush.net/trac/wikka/ticket/427) for the rationale
- * for this replacement function.
- *
- * The INTERFACE for this function is almost the same as that for
- * htmlspecialchars(), with the same default for quote style; however, there
- * is no 'charset' parameter. The reason for this is as follows:
- *
- * The PHP docs say:
- * "The third argument charset defines character set used in conversion."
- *
- * I suspect PHP's htmlspecialchars() is working at the byte-value level and
- * thus _needs_ to know (or asssume) a character set because the special
- * characters to be replaced could exist at different code points in
- * different character sets. (If indeed htmlspecialchars() works at
- * byte-value level that goes some way towards explaining why the
- * vulnerability would exist in this function, too, and not only in
- * htmlentities() which certainly is working at byte-value level.)
- *
- * This replacement function however works at character level and should
- * therefore be "immune" to character set differences - so no charset
- * parameter is needed or provided. If a third parameter is passed, it will
- * be silently ignored.
- *
- * In the OUTPUT there is a minor difference in that we use '&#39;' instead
- * of PHP's '&#039;' for a single quote: this provides compatibility with
- * get_html_translation_table(HTML_SPECIALCHARS, ENT_QUOTES)
- * (see comment by mikiwoz at yahoo dot co dot uk on
- * http://php.net/htmlspecialchars); it also matches the entity definition
- * for XML 1.0
- * (http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_Special_characters).
- * Like PHP we use a numeric character reference instead of '&apos;' for the
- * single quote. For the other special characters we use the named entity
- * references, as PHP is doing.
- *
- * @author {@link http://wikkawiki.org/JavaWoman Marjolein Katsma}
- *
- * @license http://www.gnu.org/copyleft/lgpl.html
- * GNU Lesser General Public License
- * @copyright Copyright 2007, {@link http://wikkawiki.org/CreditsPage
- * Wikka Development Team}
- *
- * @access private
- * @param string $string string to be converted
- * @param integer $quote_style
- * - ENT_COMPAT: escapes &, <, > and double quote (default)
- * - ENT_NOQUOTES: escapes only &, < and >
- * - ENT_QUOTES: escapes &, <, >, double and single quotes
- * @return string converted string
- * @since 1.0.7.18
- */
- function hsc($string, $quote_style = ENT_COMPAT) {
- // init
- static $aTransSpecchar = array(
- '&' => '&amp;',
- '"' => '&quot;',
- '<' => '&lt;',
- '>' => '&gt;',
-
- //This fix is related to SF#1923020, but has to be applied
- //regardless of actually highlighting symbols.
-
- //Circumvent a bug with symbol highlighting
- //This is required as ; would produce undesirable side-effects if it
- //was not to be processed as an entity.
- ';' => '<SEMI>', // Force ; to be processed as entity
- '|' => '<PIPE>' // Force | to be processed as entity
- ); // ENT_COMPAT set
-
- switch ($quote_style) {
- case ENT_NOQUOTES: // don't convert double quotes
- unset($aTransSpecchar['"']);
- break;
- case ENT_QUOTES: // convert single quotes as well
- $aTransSpecchar["'"] = '&#39;'; // (apos) htmlspecialchars() uses '&#039;'
- break;
- }
-
- // return translated string
- return strtr($string, $aTransSpecchar);
- }
-
- /**
- * Returns a stylesheet for the highlighted code. If $economy mode
- * is true, we only return the stylesheet declarations that matter for
- * this code block instead of the whole thing
- *
- * @param boolean Whether to use economy mode or not
- * @return string A stylesheet built on the data for the current language
- * @since 1.0.0
- */
- function get_stylesheet($economy_mode = true) {
- // If there's an error, chances are that the language file
- // won't have populated the language data file, so we can't
- // risk getting a stylesheet...
- if ($this->error) {
- return '';
- }
-
- //Check if the style rearrangements have been processed ...
- //This also does some preprocessing to check which style groups are useable ...
- if(!isset($this->language_data['NUMBERS_CACHE'])) {
- $this->build_style_cache();
- }
-
- // First, work out what the selector should be. If there's an ID,
- // that should be used, the same for a class. Otherwise, a selector
- // of '' means that these styles will be applied anywhere
- if ($this->overall_id) {
- $selector = '#' . $this->overall_id;
- } else {
- $selector = '.' . $this->language;
- if ($this->overall_class) {
- $selector .= '.' . $this->overall_class;
- }
- }
- $selector .= ' ';
-
- // Header of the stylesheet
- if (!$economy_mode) {
- $stylesheet = "/**\n".
- " * GeSHi Dynamically Generated Stylesheet\n".
- " * --------------------------------------\n".
- " * Dynamically generated stylesheet for {$this->language}\n".
- " * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n".
- " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
- " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
- " * --------------------------------------\n".
- " */\n";
- } else {
- $stylesheet = "/**\n".
- " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
- " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
- " */\n";
- }
-
- // Set the <ol> to have no effect at all if there are line numbers
- // (<ol>s have margins that should be destroyed so all layout is
- // controlled by the set_overall_style method, which works on the
- // <pre> or <div> container). Additionally, set default styles for lines
- if (!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
- //$stylesheet .= "$selector, {$selector}ol, {$selector}ol li {margin: 0;}\n";
- $stylesheet .= "$selector.de1, $selector.de2 {{$this->code_style}}\n";
- }
-
- // Add overall styles
- // note: neglect economy_mode, empty styles are meaningless
- if ($this->overall_style != '') {
- $stylesheet .= "$selector {{$this->overall_style}}\n";
- }
-
- // Add styles for links
- // note: economy mode does not make _any_ sense here
- // either the style is empty and thus no selector is needed
- // or the appropriate key is given.
- foreach ($this->link_styles as $key => $style) {
- if ($style != '') {
- switch ($key) {
- case GESHI_LINK:
- $stylesheet .= "{$selector}a:link {{$style}}\n";
- break;
- case GESHI_HOVER:
- $stylesheet .= "{$selector}a:hover {{$style}}\n";
- break;
- case GESHI_ACTIVE:
- $stylesheet .= "{$selector}a:active {{$style}}\n";
- break;
- case GESHI_VISITED:
- $stylesheet .= "{$selector}a:visited {{$style}}\n";
- break;
- }
- }
- }
-
- // Header and footer
- // note: neglect economy_mode, empty styles are meaningless
- if ($this->header_content_style != '') {
- $stylesheet .= "$selector.head {{$this->header_content_style}}\n";
- }
- if ($this->footer_content_style != '') {
- $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n";
- }
-
- // Styles for important stuff
- // note: neglect economy_mode, empty styles are meaningless
- if ($this->important_styles != '') {
- $stylesheet .= "$selector.imp {{$this->important_styles}}\n";
- }
-
- // Simple line number styles
- if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->line_style1 != '') {
- $stylesheet .= "{$selector}li, {$selector}.li1 {{$this->line_style1}}\n";
- }
- if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->table_linenumber_style != '') {
- $stylesheet .= "{$selector}.ln {{$this->table_linenumber_style}}\n";
- }
- // If there is a style set for fancy line numbers, echo it out
- if ((!$economy_mode || $this->line_numbers == GESHI_FANCY_LINE_NUMBERS) && $this->line_style2 != '') {
- $stylesheet .= "{$selector}.li2 {{$this->line_style2}}\n";
- }
-
- // note: empty styles are meaningless
- foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode ||
- (isset($this->lexic_permissions['KEYWORDS'][$group]) &&
- $this->lexic_permissions['KEYWORDS'][$group]))) {
- $stylesheet .= "$selector.kw$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode ||
- (isset($this->lexic_permissions['COMMENTS'][$group]) &&
- $this->lexic_permissions['COMMENTS'][$group]) ||
- (!empty($this->language_data['COMMENT_REGEXP']) &&
- !empty($this->language_data['COMMENT_REGEXP'][$group])))) {
- $stylesheet .= "$selector.co$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['ESCAPE_CHAR'])) {
- // NEW: since 1.0.8 we have to handle hardescapes
- if ($group === 'HARD') {
- $group = '_h';
- }
- $stylesheet .= "$selector.es$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['BRACKETS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['BRACKETS'])) {
- $stylesheet .= "$selector.br$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['SYMBOLS'])) {
- $stylesheet .= "$selector.sy$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['STRINGS'])) {
- // NEW: since 1.0.8 we have to handle hardquotes
- if ($group === 'HARD') {
- $group = '_h';
- }
- $stylesheet .= "$selector.st$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['NUMBERS'])) {
- $stylesheet .= "$selector.nu$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode || $this->lexic_permissions['METHODS'])) {
- $stylesheet .= "$selector.me$group {{$styles}}\n";
- }
- }
- // note: neglect economy_mode, empty styles are meaningless
- foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) {
- if ($styles != '') {
- $stylesheet .= "$selector.sc$group {{$styles}}\n";
- }
- }
- foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) {
- if ($styles != '' && (!$economy_mode ||
- (isset($this->lexic_permissions['REGEXPS'][$group]) &&
- $this->lexic_permissions['REGEXPS'][$group]))) {
- if (is_array($this->language_data['REGEXPS'][$group]) &&
- array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$group])) {
- $stylesheet .= "$selector.";
- $stylesheet .= $this->language_data['REGEXPS'][$group][GESHI_CLASS];
- $stylesheet .= " {{$styles}}\n";
- } else {
- $stylesheet .= "$selector.re$group {{$styles}}\n";
- }
- }
- }
- // Styles for lines being highlighted extra
- if (!$economy_mode || (count($this->highlight_extra_lines)!=count($this->highlight_extra_lines_styles))) {
- $stylesheet .= "{$selector}.ln-xtra, {$selector}li.ln-xtra, {$selector}div.ln-xtra {{$this->highlight_extra_lines_style}}\n";
- }
- $stylesheet .= "{$selector}span.xtra { display:block; }\n";
- foreach ($this->highlight_extra_lines_styles as $lineid => $linestyle) {
- $stylesheet .= "{$selector}.lx$lineid, {$selector}li.lx$lineid, {$selector}div.lx$lineid {{$linestyle}}\n";
- }
-
- return $stylesheet;
- }
-
- /**
- * Get's the style that is used for the specified line
- *
- * @param int The line number information is requested for
- * @access private
- * @since 1.0.7.21
- */
- function get_line_style($line) {
- //$style = null;
- $style = null;
- if (isset($this->highlight_extra_lines_styles[$line])) {
- $style = $this->highlight_extra_lines_styles[$line];
- } else { // if no "extra" style assigned
- $style = $this->highlight_extra_lines_style;
- }
-
- return $style;
- }
-
- /**
- * this functions creates an optimized regular expression list
- * of an array of strings.
- *
- * Example:
- * <code>$list = array('faa', 'foo', 'foobar');
- * => string 'f(aa|oo(bar)?)'</code>
- *
- * @param $list array of (unquoted) strings
- * @param $regexp_delimiter your regular expression delimiter, @see preg_quote()
- * @return string for regular expression
- * @author Milian Wolff <mail@milianw.de>
- * @since 1.0.8
- * @access private
- */
- function optimize_regexp_list($list, $regexp_delimiter = '/') {
- $regex_chars = array('.', '\\', '+', '*', '?', '[', '^', ']', '$',
- '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', $regexp_delimiter);
- sort($list);
- $regexp_list = array('');
- $num_subpatterns = 0;
- $list_key = 0;
-
- // the tokens which we will use to generate the regexp list
- $tokens = array();
- $prev_keys = array();
- // go through all entries of the list and generate the token list
- $cur_len = 0;
- for ($i = 0, $i_max = count($list); $i < $i_max; ++$i) {
- if ($cur_len > GESHI_MAX_PCRE_LENGTH) {
- // seems like the length of this pcre is growing exorbitantly
- $regexp_list[++$list_key] = $this->_optimize_regexp_list_tokens_to_string($tokens);
- $num_subpatterns = substr_count($regexp_list[$list_key], '(?:');
- $tokens = array();
- $cur_len = 0;
- }
- $level = 0;
- $entry = preg_quote((string) $list[$i], $regexp_delimiter);
- $pointer = &$tokens;
- // properly assign the new entry to the correct position in the token array
- // possibly generate smaller common denominator keys
- while (true) {
- // get the common denominator
- if (isset($prev_keys[$level])) {
- if ($prev_keys[$level] == $entry) {
- // this is a duplicate entry, skip it
- continue 2;
- }
- $char = 0;
- while (isset($entry[$char]) && isset($prev_keys[$level][$char])
- && $entry[$char] == $prev_keys[$level][$char]) {
- ++$char;
- }
- if ($char > 0) {
- // this entry has at least some chars in common with the current key
- if ($char == strlen($prev_keys[$level])) {
- // current key is totally matched, i.e. this entry has just some bits appended
- $pointer = &$pointer[$prev_keys[$level]];
- } else {
- // only part of the keys match
- $new_key_part1 = substr($prev_keys[$level], 0, $char);
- $new_key_part2 = substr($prev_keys[$level], $char);
-
- if (in_array($new_key_part1[0], $regex_chars)
- || in_array($new_key_part2[0], $regex_chars)) {
- // this is bad, a regex char as first character
- $pointer[$entry] = array('' => true);
- array_splice($prev_keys, $level, count($prev_keys), $entry);
- $cur_len += strlen($entry);
- continue;
- } else {
- // relocate previous tokens
- $pointer[$new_key_part1] = array($new_key_part2 => $pointer[$prev_keys[$level]]);
- unset($pointer[$prev_keys[$level]]);
- $pointer = &$pointer[$new_key_part1];
- // recreate key index
- array_splice($prev_keys, $level, count($prev_keys), array($new_key_part1, $new_key_part2));
- $cur_len += strlen($new_key_part2);
- }
- }
- ++$level;
- $entry = substr($entry, $char);
- continue;
- }
- // else: fall trough, i.e. no common denominator was found
- }
- if ($level == 0 && !empty($tokens)) {
- // we can dump current tokens into the string and throw them away afterwards
- $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens);
- $new_subpatterns = substr_count($new_entry, '(?:');
- if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + $new_subpatterns > GESHI_MAX_PCRE_SUBPATTERNS) {
- $regexp_list[++$list_key] = $new_entry;
- $num_subpatterns = $new_subpatterns;
- } else {
- if (!empty($regexp_list[$list_key])) {
- $new_entry = '|' . $new_entry;
- }
- $regexp_list[$list_key] .= $new_entry;
- $num_subpatterns += $new_subpatterns;
- }
- $tokens = array();
- $cur_len = 0;
- }
- // no further common denominator found
- $pointer[$entry] = array('' => true);
- array_splice($prev_keys, $level, count($prev_keys), $entry);
-
- $cur_len += strlen($entry);
- break;
- }
- unset($list[$i]);
- }
- // make sure the last tokens get converted as well
- $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens);
- if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + substr_count($new_entry, '(?:') > GESHI_MAX_PCRE_SUBPATTERNS) {
- $regexp_list[++$list_key] = $new_entry;
- } else {
- if (!empty($regexp_list[$list_key])) {
- $new_entry = '|' . $new_entry;
- }
- $regexp_list[$list_key] .= $new_entry;
- }
- return $regexp_list;
- }
- /**
- * this function creates the appropriate regexp string of an token array
- * you should not call this function directly, @see $this->optimize_regexp_list().
- *
- * @param &$tokens array of tokens
- * @param $recursed bool to know wether we recursed or not
- * @return string
- * @author Milian Wolff <mail@milianw.de>
- * @since 1.0.8
- * @access private
- */
- function _optimize_regexp_list_tokens_to_string(&$tokens, $recursed = false) {
- $list = '';
- foreach ($tokens as $token => $sub_tokens) {
- $list .= $token;
- $close_entry = isset($sub_tokens['']);
- unset($sub_tokens['']);
- if (!empty($sub_tokens)) {
- $list .= '(?:' . $this->_optimize_regexp_list_tokens_to_string($sub_tokens, true) . ')';
- if ($close_entry) {
- // make sub_tokens optional
- $list .= '?';
- }
- }
- $list .= '|';
- }
- if (!$recursed) {
- // do some optimizations
- // common trailing strings
- // BUGGY!
- //$list = preg_replace_callback('#(?<=^|\:|\|)\w+?(\w+)(?:\|.+\1)+(?=\|)#', create_function(
- // '$matches', 'return "(?:" . preg_replace("#" . preg_quote($matches[1], "#") . "(?=\||$)#", "", $matches[0]) . ")" . $matches[1];'), $list);
- // (?:p)? => p?
- $list = preg_replace('#\(\?\:(.)\)\?#', '\1?', $list);
- // (?:a|b|c|d|...)? => [abcd...]?
- // TODO: a|bb|c => [ac]|bb
- static $callback_2;
- if (!isset($callback_2)) {
- $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
- }
- $list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list);
- }
- // return $list without trailing pipe
- return substr($list, 0, -1);
- }
-} // End Class GeSHi
-
-
-if (!function_exists('geshi_highlight')) {
- /**
- * Easy way to highlight stuff. Behaves just like highlight_string
- *
- * @param string The code to highlight
- * @param string The language to highlight the code in
- * @param string The path to the language files. You can leave this blank if you need
- * as from version 1.0.7 the path should be automatically detected
- * @param boolean Whether to return the result or to echo
- * @return string The code highlighted (if $return is true)
- * @since 1.0.2
- */
- function geshi_highlight($string, $language, $path = null, $return = false) {
- $geshi = new GeSHi($string, $language, $path);
- $geshi->set_header_type(GESHI_HEADER_NONE);
-
- if ($return) {
- return '<code>' . $geshi->parse_code() . '</code>';
- }
-
- echo '<code>' . $geshi->parse_code() . '</code>';
-
- if ($geshi->error()) {
- return false;
- }
- return true;
- }
-}
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/abap.php b/libvpx/examples/includes/geshi/geshi/abap.php
deleted file mode 100644
index ffd8d10..0000000
--- a/libvpx/examples/includes/geshi/geshi/abap.php
+++ /dev/null
@@ -1,1419 +0,0 @@
-<?php
-/*************************************************************************************
- * abap.php
- * --------
- * Author: Andres Picazo (andres@andrespicazo.com)
- * Contributors:
- * - Sandra Rossi (sandra.rossi@gmail.com)
- * - Jacob Laursen (jlu@kmd.dk)
- * Copyright: (c) 2007 Andres Picazo
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * ABAP language file for GeSHi.
- *
- * Reference abap language documentation (abap 7.1) : http://help.sap.com/abapdocu/en/ABENABAP_INDEX.htm
- *
- * ABAP syntax is highly complex, several problems could not be addressed, see TODO below if you dare ;-)
- * Be aware that in ABAP language, keywords may be composed of several tokens,
- * separated by one or more spaces or carriage returns
- * (for example CONCATENATE 'hello' 'world' INTO string SEPARATED BY ' ')
- * it's why we must decode them with REGEXPS. As there are many keywords with several tokens,
- * I had to create a separate section in the code to simplify the reading.
- * Be aware that some words may be highlighted several times like for "ref to data", which is first
- * highlighted for "ref to data", then secondly for "ref to". It is very important to
- * position "ref to" after "ref to data" otherwise "data" wouldn't be highlighted because
- * of the previous highlight.
- * Styles used : keywords are all displayed in upper case, and they are organized into 4 categories :
- * 1) control statements (blue), 2) declarative statements (red-maroon),
- * 3) other statements (blue-green), 4) keywords (violet).
- * + GeSHi : literals (red) + symbols (green) + methods/attributes (mauve)
- * + unchanged style for other words.
- * Control, declarative and other statements are assigned URLs to sap documentation website:
- * http://help.sap.com/abapdocu/en/ABAP<statement_name>.htm
- *
- * CHANGES
- * -------
- * 2009/02/25 (1.0.8.3)
- * - Some more rework of the language file
- * 2009/01/04 (1.0.8.2)
- * - Major Release, more than 1000 statements and keywords added = whole abap 7.1 (Sandra Rossi)
- * 2007/06/27 (1.0.0)
- * - First Release
- *
- * TODO
- * ----
- * - in DATA data TYPE type, 2nd "data" and 2nd "type" are highlighted with data
- * style, but should be ignored. Same problem for all words!!! This is quite impossible to
- * solve it as we should define syntaxes of all statements (huge effort!) and use a lex
- * or something like that instead of regexp I guess.
- * - Some words are considered as being statement names (report, tables, etc.) though they
- * are used as keyword in some statements. For example: FORM xxxx TABLES itab. It was
- * arbitrary decided to define them as statement instead of keyword, because it may be
- * useful to have the URL to SAP help for some of them.
- * - if a comment is between 2 words of a keyword (for example SEPARATED "comment \n BY),
- * it is not considered as a keyword, but it should!
- * - for statements like "READ DATASET", GeSHi does not allow to set URLs because these
- * statements are determined by REGEXPS. For "READ DATASET", the URL should be
- * ABAPREAD_DATASET.htm. If a technical solution is found, be careful : URLs
- * are sometimes not valid because the URL does not exist. For example, for "AT NEW"
- * statement, the URL should be ABAPAT_ITAB.htm (not ABAPAT_NEW.htm).
- * There are many other exceptions.
- * Note: for adding this functionality within your php program, you can execute this code:
- * function add_urls_to_multi_tokens( $matches ) {
- * $url = preg_replace( "/[ \n]+/" , "_" , $matches[3] );
- * if( $url == $matches[3] ) return $matches[0] ;
- * else return $matches[1]."<a href=\"http://help.sap.com/abapdocu/en/ABAP".strtoupper($url).".htm\">".$matches[3]."</a>".$matches[4];
- * }
- * $html = $geshi->parse_code();
- * $html = preg_replace_callback( "£(zzz:(control|statement|data);\">)(.+?)(</span>)£s", "add_urls_to_multi_tokens", $html );
- * echo $html;
- * - Numbers followed by a dot terminating the statement are not properly recognized
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array(
- 'LANG_NAME' => 'ABAP',
- 'COMMENT_SINGLE' => array(
- 1 => '"'
- ),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- // lines beginning with star at 1st position are comments
- // (star anywhere else is not a comment, especially be careful with
- // "assign dref->* to <fs>" statement)
- 2 => '/^\*.*?$/m'
- ),
- 'CASE_KEYWORDS' => 0,
- 'QUOTEMARKS' => array(
- 1 => "'",
- 2 => "`"
- ),
- 'ESCAPE_CHAR' => '',
-
- 'KEYWORDS' => array(
- //***********************************************
- // Section 2 : process sequences of several tokens
- //***********************************************
-
- 7 => array(
- 'at new',
- 'at end of',
- 'at first',
- 'at last',
- 'loop at',
- 'loop at screen',
- ),
-
- 8 => array(
- 'private section',
- 'protected section',
- 'public section',
- 'at line-selection',
- 'at selection-screen',
- 'at user-command',
- 'assign component',
- 'assign table field',
- 'call badi',
- 'call customer-function',
- 'call customer subscreen',
- 'call dialog',
- 'call function',
- 'call method',
- 'call screen',
- 'call selection-screen',
- 'call transaction',
- 'call transformation',
- 'close cursor',
- 'close dataset',
- 'commit work',
- 'convert date',
- 'convert text',
- 'convert time stamp',
- 'create data',
- 'create object',
- 'delete dataset',
- 'delete from',
- 'describe distance',
- 'describe field',
- 'describe list',
- 'describe table',
- 'exec sql',
- 'exit from sql',
- 'exit from step-loop',
- 'export dynpro',
- 'export nametab',
- 'free memory',
- 'generate subroutine-pool',
- 'get badi',
- 'get bit',
- 'get cursor',
- 'get dataset',
- 'get locale',
- 'get parameter',
- 'get pf-status',
- 'get property',
- 'get reference',
- 'get run time',
- 'get time',
- 'get time stamp',
- 'import directory',
- 'insert report',
- 'insert text-pool',
- 'leave list-processing',
- 'leave program',
- 'leave screen',
- 'leave to list-processing',
- 'leave to transaction',
- 'modify line',
- 'modify screen',
- 'move percentage',
- 'open cursor',
- 'open dataset',
- 'raise event',
- 'raise exception',
- 'read dataset',
- 'read line',
- 'read report',
- 'read table',
- 'read textpool',
- 'receive results from function',
- 'refresh control',
- 'rollback work',
- 'set bit',
- 'set blank lines',
- 'set country',
- 'set cursor',
- 'set dataset',
- 'set extended check',
- 'set handler',
- 'set hold data',
- 'set language',
- 'set left scroll-boundary',
- 'set locale',
- 'set margin',
- 'set parameter',
- 'set pf-status',
- 'set property',
- 'set run time analyzer',
- 'set run time clock',
- 'set screen',
- 'set titlebar',
- 'set update task',
- 'set user-command',
- 'suppress dialog',
- 'truncate dataset',
- 'wait until',
- 'wait up to',
- ),
-
- 9 => array(
- 'accepting duplicate keys',
- 'accepting padding',
- 'accepting truncation',
- 'according to',
- 'actual length',
- 'adjacent duplicates',
- 'after input',
- 'all blob columns',
- 'all clob columns',
- 'all fields',
- 'all methods',
- 'all other columns',
- 'and mark',
- 'and return to screen',
- 'and return',
- 'and skip first screen',
- 'and wait',
- 'any table',
- 'appendage type',
- 'archive mode',
- 'archiving parameters',
- 'area handle',
- 'as checkbox',
- 'as icon',
- 'as line',
- 'as listbox',
- 'as person table',
- 'as search patterns',
- 'as separate unit',
- 'as subscreen',
- 'as symbol',
- 'as text',
- 'as window',
- 'at cursor-selection',
- 'at exit-command',
- 'at next application statement',
- 'at position',
-
- 'backup into',
- 'before output',
- 'before unwind',
- 'begin of block',
- 'begin of common part',
- 'begin of line',
- 'begin of screen',
- 'begin of tabbed block',
- 'begin of version',
- 'begin of',
- 'big endian',
- 'binary mode',
- 'binary search',
- 'by kernel module',
- 'bypassing buffer',
-
- 'client specified',
- 'code page',
- 'code page hint',
- 'code page into',
- 'color black',
- 'color blue',
- 'color green',
- 'color pink',
- 'color red',
- 'color yellow',
- 'compression off',
- 'compression on',
- 'connect to',
- 'corresponding fields of table',
- 'corresponding fields of',
- 'cover page',
- 'cover text',
- 'create package',
- 'create private',
- 'create protected',
- 'create public',
- 'current position',
-
- 'data buffer',
- 'data values',
- 'dataset expiration',
- 'daylight saving time',
- 'default key',
- 'default program',
- 'default screen',
- 'defining database',
- 'deleting leading',
- 'deleting trailing',
- 'directory entry',
- 'display like',
- 'display offset',
- 'during line-selection',
- 'dynamic selections',
-
- 'edit mask',
- 'end of block',
- 'end of common part',
- 'end of file',
- 'end of line',
- 'end of screen',
- 'end of tabbed block',
- 'end of version',
- 'end of',
- 'endian into',
- 'ending at',
- 'enhancement options into',
- 'enhancement into',
- 'environment time format',
- 'execute procedure',
- 'exporting list to memory',
- 'extension type',
-
- 'field format',
- 'field selection',
- 'field value into',
- 'final methods',
- 'first occurrence of',
- 'fixed-point arithmetic',
- 'for all entries',
- 'for all instances',
- 'for appending',
- 'for columns',
- 'for event of',
- 'for field',
- 'for high',
- 'for input',
- 'for lines',
- 'for low',
- 'for node',
- 'for output',
- 'for select',
- 'for table',
- 'for testing',
- 'for update',
- 'for user',
- 'frame entry',
- 'frame program from',
- 'from code page',
- 'from context',
- 'from database',
- 'from logfile id',
- 'from number format',
- 'from screen',
- 'from table',
- 'function key',
-
- 'get connection',
- 'global friends',
- 'group by',
-
- 'hashed table of',
- 'hashed table',
-
- 'if found',
- 'ignoring case',
- 'ignoring conversion errors',
- 'ignoring structure boundaries',
- 'implementations from',
- 'in background',
- 'in background task',
- 'in background unit',
- 'in binary mode',
- 'in byte mode',
- 'in char-to-hex mode',
- 'in character mode',
- 'in group',
- 'in legacy binary mode',
- 'in legacy text mode',
- 'in program',
- 'in remote task',
- 'in text mode',
- 'in table',
- 'in update task',
- 'include bound',
- 'include into',
- 'include program from',
- 'include structure',
- 'include type',
- 'including gaps',
- 'index table',
- 'inheriting from',
- 'init destination',
- 'initial line of',
- 'initial line',
- 'initial size',
- 'internal table',
- 'into sortable code',
-
- 'keep in spool',
- 'keeping directory entry',
- 'keeping logical unit of work',
- 'keeping task',
- 'keywords from',
-
- 'left margin',
- 'left outer',
- 'levels into',
- 'line format',
- 'line into',
- 'line of',
- 'line page',
- 'line value from',
- 'line value into',
- 'lines of',
- 'list authority',
- 'list dataset',
- 'list name',
- 'little endian',
- 'lob handle for',
- 'local friends',
- 'locator for',
- 'lower case',
-
- 'main table field',
- 'match count',
- 'match length',
- 'match line',
- 'match offset',
- 'matchcode object',
- 'maximum length',
- 'maximum width into',
- 'memory id',
- 'message into',
- 'messages into',
- 'modif id',
-
- 'nesting level',
- 'new list identification',
- 'next cursor',
- 'no database selection',
- 'no dialog',
- 'no end of line',
- 'no fields',
- 'no flush',
- 'no intervals',
- 'no intervals off',
- 'no standard page heading',
- 'no-extension off',
- 'non-unique key',
- 'non-unique sorted key',
- 'not at end of mode',
- 'number of lines',
- 'number of pages',
-
- 'object key',
- 'obligatory off',
- 'of current page',
- 'of page',
- 'of program',
- 'offset into',
- 'on block',
- 'on commit',
- 'on end of task',
- 'on end of',
- 'on exit-command',
- 'on help-request for',
- 'on radiobutton group',
- 'on rollback',
- 'on value-request for',
- 'open for package',
- 'option class-coding',
- 'option class',
- 'option coding',
- 'option expand',
- 'option syncpoints',
- 'options from',
- 'order by',
- 'overflow into',
-
- 'package section',
- 'package size',
- 'preferred parameter',
- 'preserving identifier escaping',
- 'primary key',
- 'print off',
- 'print on',
- 'program from',
- 'program type',
-
- 'radiobutton groups',
- 'radiobutton group',
- 'range of',
- 'reader for',
- 'receive buffer',
- 'reduced functionality',
- 'ref to data',
- 'ref to object',
- 'ref to',
-
- 'reference into',
- 'renaming with suffix',
- 'replacement character',
- 'replacement count',
- 'replacement length',
- 'replacement line',
- 'replacement offset',
- 'respecting blanks',
- 'respecting case',
- 'result into',
- 'risk level',
-
- 'sap cover page',
- 'search fkeq',
- 'search fkge',
- 'search gkeq',
- 'search gkge',
- 'section of',
- 'send buffer',
- 'separated by',
- 'shared buffer',
- 'shared memory',
- 'shared memory enabled',
- 'skipping byte-order mark',
- 'sorted by',
- 'sorted table of',
- 'sorted table',
- 'spool parameters',
- 'standard table of',
- 'standard table',
- 'starting at',
- 'starting new task',
- 'statements into',
- 'structure default',
- 'structures into',
-
- 'table field',
- 'table of',
- 'text mode',
- 'time stamp',
- 'time zone',
- 'to code page',
- 'to column',
- 'to context',
- 'to first page',
- 'to last page',
- 'to last line',
- 'to line',
- 'to lower case',
- 'to number format',
- 'to page',
- 'to sap spool',
- 'to upper case',
- 'tokens into',
- 'transporting no fields',
- 'type tableview',
- 'type tabstrip',
-
- 'unicode enabling',
- 'up to',
- 'upper case',
- 'using edit mask',
- 'using key',
- 'using no edit mask',
- 'using screen',
- 'using selection-screen',
- 'using selection-set',
- 'using selection-sets of program',
-
- 'valid between',
- 'valid from',
- 'value check',
- 'via job',
- 'via selection-screen',
- 'visible length',
-
- 'whenever found',
- 'with analysis',
- 'with byte-order mark',
- 'with comments',
- 'with current switchstates',
- 'with explicit enhancements',
- 'with frame',
- 'with free selections',
- 'with further secondary keys',
- 'with header line',
- 'with hold',
- 'with implicit enhancements',
- 'with inactive enhancements',
- 'with includes',
- 'with key',
- 'with linefeed',
- 'with list tokenization',
- 'with native linefeed',
- 'with non-unique key',
- 'with null',
- 'with pragmas',
- 'with precompiled headers',
- 'with selection-table',
- 'with smart linefeed',
- 'with table key',
- 'with test code',
- 'with type-pools',
- 'with unique key',
- 'with unix linefeed',
- 'with windows linefeed',
- 'without further secondary keys',
- 'without selection-screen',
- 'without spool dynpro',
- 'without trmac',
- 'word into',
- 'writer for'
- ),
-
- //**********************************************************
- // Other abap statements
- //**********************************************************
- 3 => array(
- 'add',
- 'add-corresponding',
- 'aliases',
- 'append',
- 'assign',
- 'at',
- 'authority-check',
-
- 'break-point',
-
- 'clear',
- 'collect',
- 'compute',
- 'concatenate',
- 'condense',
- 'class',
- 'class-events',
- 'class-methods',
- 'class-pool',
-
- 'define',
- 'delete',
- 'demand',
- 'detail',
- 'divide',
- 'divide-corresponding',
-
- 'editor-call',
- 'end-of-file',
- 'end-enhancement-section',
- 'end-of-definition',
- 'end-of-page',
- 'end-of-selection',
- 'endclass',
- 'endenhancement',
- 'endexec',
- 'endform',
- 'endfunction',
- 'endinterface',
- 'endmethod',
- 'endmodule',
- 'endon',
- 'endprovide',
- 'endselect',
- 'enhancement',
- 'enhancement-point',
- 'enhancement-section',
- 'export',
- 'extract',
- 'events',
-
- 'fetch',
- 'field-groups',
- 'find',
- 'format',
- 'form',
- 'free',
- 'function-pool',
- 'function',
-
- 'get',
-
- 'hide',
-
- 'import',
- 'infotypes',
- 'input',
- 'insert',
- 'include',
- 'initialization',
- 'interface',
- 'interface-pool',
- 'interfaces',
-
- 'leave',
- 'load-of-program',
- 'log-point',
-
- 'maximum',
- 'message',
- 'methods',
- 'method',
- 'minimum',
- 'modify',
- 'move',
- 'move-corresponding',
- 'multiply',
- 'multiply-corresponding',
-
- 'new-line',
- 'new-page',
- 'new-section',
-
- 'overlay',
-
- 'pack',
- 'perform',
- 'position',
- 'print-control',
- 'program',
- 'provide',
- 'put',
-
- 'raise',
- 'refresh',
- 'reject',
- 'replace',
- 'report',
- 'reserve',
-
- 'scroll',
- 'search',
- 'select',
- 'selection-screen',
- 'shift',
- 'skip',
- 'sort',
- 'split',
- 'start-of-selection',
- 'submit',
- 'subtract',
- 'subtract-corresponding',
- 'sum',
- 'summary',
- 'summing',
- 'supply',
- 'syntax-check',
-
- 'top-of-page',
- 'transfer',
- 'translate',
- 'type-pool',
-
- 'uline',
- 'unpack',
- 'update',
-
- 'window',
- 'write'
-
- ),
-
- //**********************************************************
- // keywords
- //**********************************************************
-
- 4 => array(
- 'abbreviated',
- 'abstract',
- 'accept',
- 'acos',
- 'activation',
- 'alias',
- 'align',
- 'all',
- 'allocate',
- 'and',
- 'assigned',
- 'any',
- 'appending',
- 'area',
- 'as',
- 'ascending',
- 'asin',
- 'assigning',
- 'atan',
- 'attributes',
- 'avg',
-
- 'backward',
- 'between',
- 'bit-and',
- 'bit-not',
- 'bit-or',
- 'bit-set',
- 'bit-xor',
- 'boolc',
- 'boolx',
- 'bound',
- 'bt',
- 'blocks',
- 'bounds',
- 'boxed',
- 'by',
- 'byte-ca',
- 'byte-cn',
- 'byte-co',
- 'byte-cs',
- 'byte-na',
- 'byte-ns',
-
- 'c',
- 'ca',
- 'calling',
- 'casting',
- 'ceil',
- 'center',
- 'centered',
- 'changing',
- 'char_off',
- 'charlen',
- 'circular',
- 'class_constructor',
- 'client',
- 'clike',
- 'close',
- 'cmax',
- 'cmin',
- 'cn',
- 'cnt',
- 'co',
- 'col_background',
- 'col_group',
- 'col_heading',
- 'col_key',
- 'col_negative',
- 'col_normal',
- 'col_positive',
- 'col_total',
- 'color',
- 'column',
- 'comment',
- 'comparing',
- 'components',
- 'condition',
- 'constructor',
- 'context',
- 'copies',
- 'count',
- 'country',
- 'cpi',
- 'creating',
- 'critical',
- 'concat_lines_of',
- 'cos',
- 'cosh',
- 'count_any_not_of',
- 'count_any_of',
- 'cp',
- 'cs',
- 'csequence',
- 'currency',
- 'current',
- 'cx_static_check',
- 'cx_root',
- 'cx_dynamic_check',
-
- 'd',
- 'dangerous',
- 'database',
- 'datainfo',
- 'date',
- 'dbmaxlen',
- 'dd/mm/yy',
- 'dd/mm/yyyy',
- 'ddmmyy',
- 'deallocate',
- 'decfloat',
- 'decfloat16',
- 'decfloat34',
- 'decimals',
- 'default',
- 'deferred',
- 'definition',
- 'department',
- 'descending',
- 'destination',
- 'disconnect',
- 'display-mode',
- 'distance',
- 'distinct',
- 'div',
- 'dummy',
-
- 'e',
- 'encoding',
- 'end-lines',
- 'engineering',
- 'environment',
- 'eq',
- 'equiv',
- 'error_message',
- 'errormessage',
- 'escape',
- 'exact',
- 'exception-table',
- 'exceptions',
- 'exclude',
- 'excluding',
- 'exists',
- 'exp',
- 'exponent',
- 'exporting',
- 'extended_monetary',
-
- 'field',
- 'filter-table',
- 'filters',
- 'filter',
- 'final',
- 'find_any_not_of',
- 'find_any_of',
- 'find_end',
- 'floor',
- 'first-line',
- 'font',
- 'forward',
- 'for',
- 'frac',
- 'from_mixed',
- 'friends',
- 'from',
- 'f',
-
- 'giving',
- 'ge',
- 'gt',
-
- 'handle',
- 'harmless',
- 'having',
- 'head-lines',
- 'help-id',
- 'help-request',
- 'high',
- 'hold',
- 'hotspot',
-
- 'i',
- 'id',
- 'ids',
- 'immediately',
- 'implementation',
- 'importing',
- 'in',
- 'initial',
- 'incl',
- 'including',
- 'increment',
- 'index',
- 'index-line',
- 'inner',
- 'inout',
- 'intensified',
- 'into',
- 'inverse',
- 'is',
- 'iso',
-
- 'join',
-
- 'key',
- 'kind',
-
- 'log10',
- 'language',
- 'late',
- 'layout',
- 'le',
- 'lt',
- 'left-justified',
- 'leftplus',
- 'leftspace',
- 'left',
- 'length',
- 'level',
- 'like',
- 'line-count',
- 'line-size',
- 'lines',
- 'line',
- 'load',
- 'long',
- 'lower',
- 'low',
- 'lpi',
-
- 'matches',
- 'match',
- 'mail',
- 'major-id',
- 'max',
- 'medium',
- 'memory',
- 'message-id',
- 'module',
- 'minor-id',
- 'min',
- 'mm/dd/yyyy',
- 'mm/dd/yy',
- 'mmddyy',
- 'mode',
- 'modifier',
- 'mod',
- 'monetary',
-
- 'name',
- 'nb',
- 'ne',
- 'next',
- 'no-display',
- 'no-extension',
- 'no-gap',
- 'no-gaps',
- 'no-grouping',
- 'no-heading',
- 'no-scrolling',
- 'no-sign',
- 'no-title',
- 'no-topofpage',
- 'no-zero',
- 'nodes',
- 'non-unicode',
- 'no',
- 'number',
- 'n',
- 'nmax',
- 'nmin',
- 'not',
- 'null',
- 'numeric',
- 'numofchar',
-
- 'o',
- 'objects',
- 'obligatory',
- 'occurs',
- 'offset',
- 'off',
- 'of',
- 'only',
- 'open',
- 'option',
- 'optional',
- 'options',
- 'output-length',
- 'output',
- 'out',
- 'on change of',
- 'or',
- 'others',
-
- 'pad',
- 'page',
- 'pages',
- 'parameter-table',
- 'part',
- 'performing',
- 'pos_high',
- 'pos_low',
- 'priority',
- 'public',
- 'pushbutton',
- 'p',
-
- 'queue-only',
- 'quickinfo',
-
- 'raising',
- 'range',
- 'read-only',
- 'received',
- 'receiver',
- 'receiving',
- 'redefinition',
- 'reference',
- 'regex',
- 'replacing',
- 'reset',
- 'responsible',
- 'result',
- 'results',
- 'resumable',
- 'returncode',
- 'returning',
- 'right',
- 'right-specified',
- 'rightplus',
- 'rightspace',
- 'round',
- 'rows',
- 'repeat',
- 'requested',
- 'rescale',
- 'reverse',
-
- 'scale_preserving',
- 'scale_preserving_scientific',
- 'scientific',
- 'scientific_with_leading_zero',
- 'screen',
- 'scrolling',
- 'seconds',
- 'segment',
- 'shift_left',
- 'shift_right',
- 'sign',
- 'simple',
- 'sin',
- 'sinh',
- 'short',
- 'shortdump-id',
- 'sign_as_postfix',
- 'single',
- 'size',
- 'some',
- 'source',
- 'space',
- 'spots',
- 'stable',
- 'state',
- 'static',
- 'statusinfo',
- 'sqrt',
- 'string',
- 'strlen',
- 'structure',
- 'style',
- 'subkey',
- 'submatches',
- 'substring',
- 'substring_after',
- 'substring_before',
- 'substring_from',
- 'substring_to',
- 'super',
- 'supplied',
- 'switch',
-
- 't',
- 'tan',
- 'tanh',
- 'table_line',
- 'table',
- 'tab',
- 'then',
- 'timestamp',
- 'times',
- 'time',
- 'timezone',
- 'title-lines',
- 'title',
- 'top-lines',
- 'to',
- 'to_lower',
- 'to_mixed',
- 'to_upper',
- 'trace-file',
- 'trace-table',
- 'transporting',
- 'trunc',
- 'type',
-
- 'under',
- 'unique',
- 'unit',
- 'user-command',
- 'using',
- 'utf-8',
-
- 'valid',
- 'value',
- 'value-request',
- 'values',
- 'vary',
- 'varying',
- 'version',
-
- 'warning',
- 'where',
- 'width',
- 'with',
- 'word',
- 'with-heading',
- 'with-title',
-
- 'x',
- 'xsequence',
- 'xstring',
- 'xstrlen',
-
- 'yes',
- 'yymmdd',
-
- 'z',
- 'zero'
-
- ),
-
- //**********************************************************
- // screen statements
- //**********************************************************
-
- 5 => array(
- 'call subscreen',
- 'chain',
- 'endchain',
- 'on chain-input',
- 'on chain-request',
- 'on help-request',
- 'on input',
- 'on request',
- 'on value-request',
- 'process'
- ),
-
- //**********************************************************
- // internal statements
- //**********************************************************
-
- 6 => array(
- 'generate dynpro',
- 'generate report',
- 'import dynpro',
- 'import nametab',
- 'include methods',
- 'load report',
- 'scan abap-source',
- 'scan and check abap-source',
- 'syntax-check for dynpro',
- 'syntax-check for program',
- 'syntax-trace',
- 'system-call',
- 'system-exit',
- 'verification-message'
- ),
-
- //**********************************************************
- // Control statements
- //**********************************************************
-
- 1 => array(
- 'assert',
- 'case',
- 'catch',
- 'check',
- 'cleanup',
- 'continue',
- 'do',
- 'else',
- 'elseif',
- 'endat',
- 'endcase',
- 'endcatch',
- 'endif',
- 'enddo',
- 'endloop',
- 'endtry',
- 'endwhile',
- 'exit',
- 'if',
- 'loop',
- 'resume',
- 'retry',
- 'return',
- 'stop',
- 'try',
- 'when',
- 'while'
-
- ),
-
- //**********************************************************
- // variable declaration statements
- //**********************************************************
-
- 2 => array(
- 'class-data',
- 'controls',
- 'constants',
- 'data',
- 'field-symbols',
- 'fields',
- 'local',
- 'parameters',
- 'ranges',
- 'select-options',
- 'statics',
- 'tables',
- 'type-pools',
- 'types'
- )
- ),
- 'SYMBOLS' => array(
- 0 => array(
- '='
- ),
- 1 => array(
- '(', ')', '{', '}', '[', ']', '+', '-', '*', '/', '!', '%', '^', '&', ':'
- )
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => false,
- 9 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;', //control statements
- 2 => 'color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;', //data statements
- 3 => 'color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;', //first token of other statements
- 4 => 'color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;', // next tokens of other statements ("keywords")
- 5 => 'color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;',
- 6 => 'color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;',
- 7 => 'color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;',
- 8 => 'color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;',
- 9 => 'color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #339933;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #808080;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #4da619;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #3399ff;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;',
- 2 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #800080;',
- 1 => 'color: #808080;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://help.sap.com/abapdocu/en/ABAP{FNAMEU}.htm',
- 2 => 'http://help.sap.com/abapdocu/en/ABAP{FNAMEU}.htm',
- 3 => 'http://help.sap.com/abapdocu/en/ABAP{FNAMEU}.htm',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => '',
- 9 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '-&gt;',
- 2 => '=&gt;'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 7 => array(
- 'SPACE_AS_WHITESPACE' => true
- ),
- 8 => array(
- 'SPACE_AS_WHITESPACE' => true
- ),
- 9 => array(
- 'SPACE_AS_WHITESPACE' => true
- )
- )
- ),
- 'TAB_WIDTH' => 4
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/actionscript.php b/libvpx/examples/includes/geshi/geshi/actionscript.php
deleted file mode 100644
index 658491d..0000000
--- a/libvpx/examples/includes/geshi/geshi/actionscript.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/*************************************************************************************
- * actionscript.php
- * ----------------
- * Author: Steffen Krause (Steffen.krause@muse.de)
- * Copyright: (c) 2004 Steffen Krause, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/20
- *
- * Actionscript language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'ActionScript',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- '#include', 'for', 'foreach', 'if', 'elseif', 'else', 'while', 'do', 'dowhile',
- 'endwhile', 'endif', 'switch', 'case', 'endswitch', 'return', 'break', 'continue', 'in'
- ),
- 2 => array(
- 'null', 'false', 'true', 'var',
- 'default', 'function', 'class',
- 'new', '_global'
- ),
- 3 => array(
- '#endinitclip', '#initclip', '__proto__', '_accProps', '_alpha', '_currentframe',
- '_droptarget', '_focusrect', '_framesloaded', '_height', '_highquality', '_lockroot',
- '_name', '_parent', '_quality', '_root', '_rotation', '_soundbuftime', '_target', '_totalframes',
- '_url', '_visible', '_width', '_x', '_xmouse', '_xscale', '_y', '_ymouse', '_yscale', 'abs',
- 'Accessibility', 'acos', 'activityLevel', 'add', 'addListener', 'addPage', 'addProperty',
- 'addRequestHeader', 'align', 'allowDomain', 'allowInsecureDomain', 'and', 'appendChild',
- 'apply', 'Arguments', 'Array', 'asfunction', 'asin', 'atan', 'atan2', 'attachAudio', 'attachMovie',
- 'attachSound', 'attachVideo', 'attributes', 'autosize', 'avHardwareDisable', 'background',
- 'backgroundColor', 'BACKSPACE', 'bandwidth', 'beginFill', 'beginGradientFill', 'blockIndent',
- 'bold', 'Boolean', 'border', 'borderColor', 'bottomScroll', 'bufferLength', 'bufferTime',
- 'builtInItems', 'bullet', 'Button', 'bytesLoaded', 'bytesTotal', 'call', 'callee', 'caller',
- 'Camera', 'capabilities', 'CAPSLOCK', 'caption', 'catch', 'ceil', 'charAt', 'charCodeAt',
- 'childNodes', 'chr', 'clear', 'clearInterval', 'cloneNode', 'close', 'Color', 'concat',
- 'connect', 'condenseWhite', 'constructor', 'contentType', 'ContextMenu', 'ContextMenuItem',
- 'CONTROL', 'copy', 'cos', 'createElement', 'createEmptyMovieClip', 'createTextField',
- 'createTextNode', 'currentFps', 'curveTo', 'CustomActions', 'customItems', 'data', 'Date',
- 'deblocking', 'delete', 'DELETEKEY', 'docTypeDecl', 'domain', 'DOWN',
- 'duplicateMovieClip', 'duration', 'dynamic', 'E', 'embedFonts', 'enabled',
- 'END', 'endFill', 'ENTER', 'eq', 'Error', 'ESCAPE(Konstante)', 'escape(Funktion)', 'eval',
- 'exactSettings', 'exp', 'extends', 'finally', 'findText', 'firstChild', 'floor',
- 'flush', 'focusEnabled', 'font', 'fps', 'fromCharCode', 'fscommand',
- 'gain', 'ge', 'get', 'getAscii', 'getBeginIndex', 'getBounds', 'getBytesLoaded', 'getBytesTotal',
- 'getCaretIndex', 'getCode', 'getCount', 'getDate', 'getDay', 'getDepth', 'getEndIndex', 'getFocus',
- 'getFontList', 'getFullYear', 'getHours', 'getInstanceAtDepth', 'getLocal', 'getMilliseconds',
- 'getMinutes', 'getMonth', 'getNewTextFormat', 'getNextHighestDepth', 'getPan', 'getProgress',
- 'getProperty', 'getRGB', 'getSeconds', 'getSelected', 'getSelectedText', 'getSize', 'getStyle',
- 'getStyleNames', 'getSWFVersion', 'getText', 'getTextExtent', 'getTextFormat', 'getTextSnapshot',
- 'getTime', 'getTimer', 'getTimezoneOffset', 'getTransform', 'getURL', 'getUTCDate', 'getUTCDay',
- 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds', 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds',
- 'getVersion', 'getVolume', 'getYear', 'globalToLocal', 'goto', 'gotoAndPlay', 'gotoAndStop',
- 'hasAccessibility', 'hasAudio', 'hasAudioEncoder', 'hasChildNodes', 'hasEmbeddedVideo', 'hasMP3',
- 'hasPrinting', 'hasScreenBroadcast', 'hasScreenPlayback', 'hasStreamingAudio', 'hasStreamingVideo',
- 'hasVideoEncoder', 'height', 'hide', 'hideBuiltInItems', 'hitArea', 'hitTest', 'hitTestTextNearPos',
- 'HOME', 'hscroll', 'html', 'htmlText', 'ID3', 'ifFrameLoaded', 'ignoreWhite', 'implements',
- 'import', 'indent', 'index', 'indexOf', 'Infinity', '-Infinity', 'INSERT', 'insertBefore', 'install',
- 'instanceof', 'int', 'interface', 'isActive', 'isDebugger', 'isDown', 'isFinite', 'isNaN', 'isToggled',
- 'italic', 'join', 'Key', 'language', 'lastChild', 'lastIndexOf', 'le', 'leading', 'LEFT', 'leftMargin',
- 'length', 'level', 'lineStyle', 'lineTo', 'list', 'LN10', 'LN2', 'load', 'loadClip', 'loaded', 'loadMovie',
- 'loadMovieNum', 'loadSound', 'loadVariables', 'loadVariablesNum', 'LoadVars', 'LocalConnection',
- 'localFileReadDisable', 'localToGlobal', 'log', 'LOG10E', 'LOG2E', 'manufacturer', 'Math', 'max',
- 'MAX_VALUE', 'maxChars', 'maxhscroll', 'maxscroll', 'mbchr', 'mblength', 'mbord', 'mbsubstring', 'menu',
- 'message', 'Microphone', 'min', 'MIN_VALUE', 'MMExecute', 'motionLevel', 'motionTimeOut', 'Mouse',
- 'mouseWheelEnabled', 'moveTo', 'Movieclip', 'MovieClipLoader', 'multiline', 'muted', 'name', 'names', 'NaN',
- 'ne', 'NEGATIVE_INFINITY', 'NetConnection', 'NetStream', 'newline', 'nextFrame',
- 'nextScene', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue', 'not', 'Number', 'Object',
- 'on', 'onActivity', 'onChanged', 'onClipEvent', 'onClose', 'onConnect', 'onData', 'onDragOut',
- 'onDragOver', 'onEnterFrame', 'onID3', 'onKeyDown', 'onKeyUp', 'onKillFocus', 'onLoad', 'onLoadComplete',
- 'onLoadError', 'onLoadInit', 'onLoadProgress', 'onLoadStart', 'onMouseDown', 'onMouseMove', 'onMouseUp',
- 'onMouseWheel', 'onPress', 'onRelease', 'onReleaseOutside', 'onResize', 'onRollOut', 'onRollOver',
- 'onScroller', 'onSelect', 'onSetFocus', 'onSoundComplete', 'onStatus', 'onUnload', 'onUpdate', 'onXML',
- 'or(logischesOR)', 'ord', 'os', 'parentNode', 'parseCSS', 'parseFloat', 'parseInt', 'parseXML', 'password',
- 'pause', 'PGDN', 'PGUP', 'PI', 'pixelAspectRatio', 'play', 'playerType', 'pop', 'position',
- 'POSITIVE_INFINITY', 'pow', 'prevFrame', 'previousSibling', 'prevScene', 'print', 'printAsBitmap',
- 'printAsBitmapNum', 'PrintJob', 'printNum', 'private', 'prototype', 'public', 'push', 'quality',
- 'random', 'rate', 'registerClass', 'removeListener', 'removeMovieClip', 'removeNode', 'removeTextField',
- 'replaceSel', 'replaceText', 'resolutionX', 'resolutionY', 'restrict', 'reverse', 'RIGHT',
- 'rightMargin', 'round', 'scaleMode', 'screenColor', 'screenDPI', 'screenResolutionX', 'screenResolutionY',
- 'scroll', 'seek', 'selectable', 'Selection', 'send', 'sendAndLoad', 'separatorBefore', 'serverString',
- 'set', 'setvariable', 'setBufferTime', 'setClipboard', 'setDate', 'setFocus', 'setFullYear', 'setGain',
- 'setHours', 'setInterval', 'setMask', 'setMilliseconds', 'setMinutes', 'setMode', 'setMonth',
- 'setMotionLevel', 'setNewTextFormat', 'setPan', 'setProperty', 'setQuality', 'setRate', 'setRGB',
- 'setSeconds', 'setSelectColor', 'setSelected', 'setSelection', 'setSilenceLevel', 'setStyle',
- 'setTextFormat', 'setTime', 'setTransform', 'setUseEchoSuppression', 'setUTCDate', 'setUTCFullYear',
- 'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setVolume',
- 'setYear', 'SharedObject', 'SHIFT(Konstante)', 'shift(Methode)', 'show', 'showMenu', 'showSettings',
- 'silenceLevel', 'silenceTimeout', 'sin', 'size', 'slice', 'smoothing', 'sort', 'sortOn', 'Sound', 'SPACE',
- 'splice', 'split', 'sqrt', 'SQRT1_2', 'SQRT2', 'Stage', 'start', 'startDrag', 'static', 'status', 'stop',
- 'stopAllSounds', 'stopDrag', 'String', 'StyleSheet(Klasse)', 'styleSheet(Eigenschaft)', 'substr',
- 'substring', 'super', 'swapDepths', 'System', 'TAB', 'tabChildren', 'tabEnabled', 'tabIndex',
- 'tabStops', 'tan', 'target', 'targetPath', 'tellTarget', 'text', 'textColor', 'TextField', 'TextFormat',
- 'textHeight', 'TextSnapshot', 'textWidth', 'this', 'throw', 'time', 'toggleHighQuality', 'toLowerCase',
- 'toString', 'toUpperCase', 'trace', 'trackAsMenu', 'try', 'type', 'typeof', 'undefined',
- 'underline', 'unescape', 'uninstall', 'unloadClip', 'unloadMovie', 'unLoadMovieNum', 'unshift', 'unwatch',
- 'UP', 'updateAfterEvent', 'updateProperties', 'url', 'useCodePage', 'useEchoSuppression', 'useHandCursor',
- 'UTC', 'valueOf', 'variable', 'version', 'Video', 'visible', 'void', 'watch', 'width',
- 'with', 'wordwrap', 'XML', 'xmlDecl', 'XMLNode', 'XMLSocket'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #0066CC;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array()
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/actionscript3.php b/libvpx/examples/includes/geshi/geshi/actionscript3.php
deleted file mode 100644
index b98002f..0000000
--- a/libvpx/examples/includes/geshi/geshi/actionscript3.php
+++ /dev/null
@@ -1,467 +0,0 @@
-<?php
-/*************************************************************************************
- * actionscript3.php
- * ----------------
- * Author: Jordi Boggiano (j.boggiano@seld.be)
- * Copyright: (c) 2007 Jordi Boggiano (http://www.seld.be/), Benny Baumann (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2007/11/26
- *
- * ActionScript3 language file for GeSHi.
- *
- * All keywords scraped from the Flex 2.0.1 Documentation
- *
- * The default style is based on FlexBuilder2 coloring, with the addition of class, package, method and
- * constant names that are highlighted to help identifying problem when used on public pastebins.
- *
- * For styling, keywords data from 0 to 1 (accessible through .kw1, etc.) are described here :
- *
- * 1 : operators
- * 2 : 'var' keyword
- * 3 : 'function' keyword
- * 4 : 'class' and 'package' keywords
- * 5 : all flash.* class names plus Top Level classes, mx are excluded
- * 6 : all flash.* package names, mx are excluded
- * 7 : valid flash method names and properties (there is no type checks sadly, for example String().x will be highlighted as 'x' is valid, but obviously strings don't have a x property)
- * 8 : valid flash constant names (again, no type check)
- *
- *
- * CHANGES
- * -------
- * 2007/12/06 (1.0.7.22)
- * - Added the 'this' keyword (oops)
- *
- * TODO (updated 2007/11/30)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'ActionScript 3',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'with', 'while', 'void', 'undefined', 'typeof', 'try', 'true',
- 'throw', 'this', 'switch', 'super', 'set', 'return', 'public', 'protected',
- 'private', 'null', 'new', 'is', 'internal', 'instanceof', 'in',
- 'import', 'if', 'get', 'for', 'false', 'else', 'each', 'do',
- 'delete', 'default', 'continue', 'catch', 'case', 'break', 'as'
- ),
- 2 => array(
- 'var'
- ),
- 3 => array(
- 'function'
- ),
- 4 => array(
- 'class', 'package'
- ),
- 6 => array(
- 'flash.xml', 'flash.utils', 'flash.ui', 'flash.text',
- 'flash.system', 'flash.profiler', 'flash.printing', 'flash.net',
- 'flash.media', 'flash.geom', 'flash.filters', 'flash.external',
- 'flash.events', 'flash.errors', 'flash.display',
- 'flash.accessibility'
- ),
- 7 => array(
- 'zoom', 'year', 'y', 'xmlDecl', 'x', 'writeUnsignedInt',
- 'writeUTFBytes', 'writeUTF', 'writeShort', 'writeObject',
- 'writeMultiByte', 'writeInt', 'writeFloat', 'writeExternal',
- 'writeDynamicProperty', 'writeDynamicProperties', 'writeDouble',
- 'writeBytes', 'writeByte', 'writeBoolean', 'wordWrap',
- 'willTrigger', 'width', 'volume', 'visible', 'videoWidth',
- 'videoHeight', 'version', 'valueOf', 'value', 'usingTLS',
- 'useRichTextClipboard', 'useHandCursor', 'useEchoSuppression',
- 'useCodePage', 'url', 'uri', 'uploadCompleteData', 'upload',
- 'updateProperties', 'updateAfterEvent', 'upState', 'unshift',
- 'unlock', 'unload', 'union', 'unescapeMultiByte', 'unescape',
- 'underline', 'uncompress', 'type', 'ty', 'tx', 'transparent',
- 'translate', 'transformPoint', 'transform', 'trackAsMenu', 'track',
- 'trace', 'totalMemory', 'totalFrames', 'topLeft', 'top',
- 'togglePause', 'toXMLString', 'toUpperCase', 'toUTCString',
- 'toTimeString', 'toString', 'toPrecision', 'toLowerCase',
- 'toLocaleUpperCase', 'toLocaleTimeString', 'toLocaleString',
- 'toLocaleLowerCase', 'toLocaleDateString', 'toFixed',
- 'toExponential', 'toDateString', 'timezoneOffset', 'timerComplete',
- 'timer', 'time', 'threshold', 'thickness', 'textWidth',
- 'textSnapshot', 'textInput', 'textHeight', 'textColor', 'text',
- 'test', 'target', 'tan', 'tabStops', 'tabIndexChange', 'tabIndex',
- 'tabEnabledChange', 'tabEnabled', 'tabChildrenChange',
- 'tabChildren', 'sync', 'swfVersion', 'swapChildrenAt',
- 'swapChildren', 'subtract', 'substring', 'substr', 'styleSheet',
- 'styleNames', 'strength', 'stopPropagation',
- 'stopImmediatePropagation', 'stopDrag', 'stopAll', 'stop', 'status',
- 'startDrag', 'start', 'stageY', 'stageX', 'stageWidth',
- 'stageHeight', 'stageFocusRect', 'stage', 'sqrt', 'split', 'splice',
- 'source', 'soundTransform', 'soundComplete', 'sortOn', 'sort',
- 'songName', 'some', 'socketData', 'smoothing', 'slice', 'size',
- 'sin', 'silent', 'silenceTimeout', 'silenceLevel', 'showSettings',
- 'showRedrawRegions', 'showDefaultContextMenu', 'show', 'shortcut',
- 'shiftKey', 'shift', 'sharpness', 'sharedEvents', 'shadowColor',
- 'shadowAlpha', 'settings', 'setUseEchoSuppression', 'setUTCSeconds',
- 'setUTCMonth', 'setUTCMinutes', 'setUTCMilliseconds', 'setUTCHours',
- 'setUTCFullYear', 'setUTCDate', 'setTimeout', 'setTime',
- 'setTextFormat', 'setStyle', 'setSilenceLevel', 'setSettings',
- 'setSelection', 'setSelected', 'setSelectColor', 'setSeconds',
- 'setQuality', 'setPropertyIsEnumerable', 'setProperty', 'setPixels',
- 'setPixel32', 'setPixel', 'setNamespace', 'setName',
- 'setMotionLevel', 'setMonth', 'setMode', 'setMinutes',
- 'setMilliseconds', 'setLoopback', 'setLoopBack', 'setLocalName',
- 'setKeyFrameInterval', 'setInterval', 'setHours', 'setFullYear',
- 'setEmpty', 'setDirty', 'setDate', 'setCompositionString',
- 'setClipboard', 'setChildren', 'setChildIndex',
- 'setAdvancedAntiAliasingTable', 'serverString', 'separatorBefore',
- 'sendToURL', 'send', 'selectionEndIndex', 'selectionBeginIndex',
- 'selectable', 'select', 'seek', 'securityError', 'securityDomain',
- 'secondsUTC', 'seconds', 'search', 'scrollV', 'scrollRect',
- 'scrollH', 'scroll', 'screenResolutionY', 'screenResolutionX',
- 'screenDPI', 'screenColor', 'scenes', 'scaleY', 'scaleX',
- 'scaleMode', 'scale9Grid', 'scale', 'save', 'sandboxType',
- 'sameDomain', 'running', 'round', 'rotation', 'rotate', 'root',
- 'rollOver', 'rollOut', 'rightToRight', 'rightToLeft', 'rightPeak',
- 'rightMargin', 'right', 'rewind', 'reverse', 'resume', 'restrict',
- 'resize', 'reset', 'requestHeaders', 'replaceText',
- 'replaceSelectedText', 'replace', 'repeatCount', 'render',
- 'removedFromStage', 'removed', 'removeNode', 'removeNamespace',
- 'removeEventListener', 'removeChildAt', 'removeChild',
- 'relatedObject', 'registerFont', 'registerClassAlias', 'redOffset',
- 'redMultiplier', 'rect', 'receiveVideo', 'receiveAudio',
- 'readUnsignedShort', 'readUnsignedInt', 'readUnsignedByte',
- 'readUTFBytes', 'readUTF', 'readShort', 'readObject',
- 'readMultiByte', 'readInt', 'readFloat', 'readExternal',
- 'readDouble', 'readBytes', 'readByte', 'readBoolean', 'ratios',
- 'rate', 'random', 'quality', 'push', 'publish', 'proxyType',
- 'prototype', 'propertyIsEnumerable', 'progress',
- 'processingInstructions', 'printAsBitmap', 'print',
- 'previousSibling', 'preventDefault', 'prevScene', 'prevFrame',
- 'prettyPrinting', 'prettyIndent', 'preserveAlpha', 'prependChild',
- 'prefix', 'pow', 'position', 'pop', 'polar', 'playerType', 'play',
- 'pixelSnapping', 'pixelDissolve', 'pixelBounds', 'pixelAspectRatio',
- 'perlinNoise', 'pause', 'parseXML', 'parseInt', 'parseFloat',
- 'parseCSS', 'parse', 'parentNode', 'parentDomain',
- 'parentAllowsChild', 'parent', 'parameters', 'paperWidth',
- 'paperHeight', 'pan', 'paletteMap', 'pageWidth', 'pageHeight',
- 'overState', 'outsideCutoff', 'os', 'orientation', 'open',
- 'opaqueBackground', 'onPlayStatus', 'onMetaData', 'onCuePoint',
- 'offsetPoint', 'offset', 'objectID', 'objectEncoding', 'numLock',
- 'numLines', 'numFrames', 'numChildren', 'normalize', 'noise',
- 'nodeValue', 'nodeType', 'nodeName', 'nodeKind', 'noAutoLabeling',
- 'nextValue', 'nextSibling', 'nextScene', 'nextNameIndex',
- 'nextName', 'nextFrame', 'netStatus', 'navigateToURL',
- 'namespaceURI', 'namespaceDeclarations', 'namespace', 'names',
- 'name', 'muted', 'multiline', 'moveTo', 'mouseY', 'mouseX',
- 'mouseWheelEnabled', 'mouseWheel', 'mouseUp', 'mouseTarget',
- 'mouseOver', 'mouseOut', 'mouseMove', 'mouseLeave',
- 'mouseFocusChange', 'mouseEnabled', 'mouseDown', 'mouseChildren',
- 'motionTimeout', 'motionLevel', 'monthUTC', 'month',
- 'modificationDate', 'mode', 'minutesUTC', 'minutes', 'min',
- 'millisecondsUTC', 'milliseconds', 'method', 'message', 'merge',
- 'menuSelect', 'menuItemSelect', 'maxScrollV', 'maxScrollH',
- 'maxLevel', 'maxChars', 'max', 'matrixY', 'matrixX', 'matrix',
- 'match', 'mask', 'mapPoint', 'mapBitmap', 'map', 'manufacturer',
- 'macType', 'loopback', 'loop', 'log', 'lock', 'localeCompare',
- 'localY', 'localX', 'localToGlobal', 'localName',
- 'localFileReadDisable', 'loaderURL', 'loaderInfo', 'loader',
- 'loadPolicyFile', 'loadBytes', 'load', 'liveDelay', 'link',
- 'lineTo', 'lineStyle', 'lineGradientStyle', 'level',
- 'letterSpacing', 'length', 'leftToRight', 'leftToLeft', 'leftPeak',
- 'leftMargin', 'left', 'leading', 'lastIndexOf', 'lastIndex',
- 'lastChild', 'language', 'labels', 'knockout', 'keyUp',
- 'keyLocation', 'keyFrameInterval', 'keyFocusChange', 'keyDown',
- 'keyCode', 'kerning', 'join', 'italic', 'isXMLName',
- 'isPrototypeOf', 'isNaN', 'isFocusInaccessible', 'isFinite',
- 'isEmpty', 'isDefaultPrevented', 'isDebugger', 'isBuffering',
- 'isAttribute', 'isAccessible', 'ioError', 'invert', 'invalidate',
- 'intersects', 'intersection', 'interpolate', 'insideCutoff',
- 'insertChildBefore', 'insertChildAfter', 'insertBefore', 'inner',
- 'init', 'info', 'inflatePoint', 'inflate', 'indexOf', 'index',
- 'indent', 'inScopeNamespaces', 'imeComposition', 'ime',
- 'ignoreWhitespace', 'ignoreWhite', 'ignoreProcessingInstructions',
- 'ignoreComments', 'ignoreCase', 'identity', 'idMap', 'id3',
- 'httpStatus', 'htmlText', 'hoursUTC', 'hours', 'hitTestTextNearPos',
- 'hitTestState', 'hitTestPoint', 'hitTestObject', 'hitTest',
- 'hitArea', 'highlightColor', 'highlightAlpha', 'hideObject',
- 'hideBuiltInItems', 'hide', 'height', 'hasVideoEncoder', 'hasTLS',
- 'hasStreamingVideo', 'hasStreamingAudio', 'hasSimpleContent',
- 'hasScreenPlayback', 'hasScreenBroadcast', 'hasProperty',
- 'hasPrinting', 'hasOwnProperty', 'hasMP3', 'hasIME', 'hasGlyphs',
- 'hasEventListener', 'hasEmbeddedVideo', 'hasDefinition',
- 'hasComplexContent', 'hasChildNodes', 'hasAudioEncoder', 'hasAudio',
- 'hasAccessibility', 'gridFitType', 'greenOffset', 'greenMultiplier',
- 'graphics', 'gotoAndStop', 'gotoAndPlay', 'globalToLocal', 'global',
- 'getUTCSeconds', 'getUTCMonth', 'getUTCMinutes',
- 'getUTCMilliseconds', 'getUTCHours', 'getUTCFullYear', 'getUTCDay',
- 'getUTCDate', 'getTimezoneOffset', 'getTimer', 'getTime',
- 'getTextRunInfo', 'getTextFormat', 'getText', 'getStyle',
- 'getStackTrace', 'getSelectedText', 'getSelected', 'getSeconds',
- 'getRemote', 'getRect', 'getQualifiedSuperclassName',
- 'getQualifiedClassName', 'getProperty', 'getPrefixForNamespace',
- 'getPixels', 'getPixel32', 'getPixel', 'getParagraphLength',
- 'getObjectsUnderPoint', 'getNamespaceForPrefix', 'getMonth',
- 'getMinutes', 'getMilliseconds', 'getMicrophone', 'getLocal',
- 'getLineText', 'getLineOffset', 'getLineMetrics', 'getLineLength',
- 'getLineIndexOfChar', 'getLineIndexAtPoint', 'getImageReference',
- 'getHours', 'getFullYear', 'getFirstCharInParagraph',
- 'getDescendants', 'getDefinitionByName', 'getDefinition', 'getDay',
- 'getDate', 'getColorBoundsRect', 'getClassByAlias', 'getChildIndex',
- 'getChildByName', 'getChildAt', 'getCharIndexAtPoint',
- 'getCharBoundaries', 'getCamera', 'getBounds', 'genre',
- 'generateFilterRect', 'gain', 'fullYearUTC', 'fullYear',
- 'fullScreen', 'fscommand', 'fromCharCode', 'framesLoaded',
- 'frameRate', 'frame', 'fps', 'forwardAndBack', 'formatToString',
- 'forceSimple', 'forEach', 'fontType', 'fontStyle', 'fontSize',
- 'fontName', 'font', 'focusRect', 'focusOut', 'focusIn', 'focus',
- 'flush', 'floor', 'floodFill', 'firstChild', 'findText', 'filters',
- 'filter', 'fillRect', 'fileList', 'extension', 'extended', 'exp',
- 'exec', 'exactSettings', 'every', 'eventPhase', 'escapeMultiByte',
- 'escape', 'errorID', 'error', 'equals', 'enumerateFonts',
- 'enterFrame', 'endian', 'endFill', 'encodeURIComponent',
- 'encodeURI', 'enabled', 'embedFonts', 'elements',
- 'dynamicPropertyWriter', 'dropTarget', 'drawRoundRect', 'drawRect',
- 'drawEllipse', 'drawCircle', 'draw', 'download', 'downState',
- 'doubleClickEnabled', 'doubleClick', 'dotall', 'domain',
- 'docTypeDecl', 'doConversion', 'divisor', 'distance', 'dispose',
- 'displayState', 'displayMode', 'displayAsPassword', 'dispatchEvent',
- 'description', 'describeType', 'descent', 'descendants',
- 'deltaTransformPoint', 'delta', 'deleteProperty', 'delay',
- 'defaultTextFormat', 'defaultSettings', 'defaultObjectEncoding',
- 'decodeURIComponent', 'decodeURI', 'decode', 'deblocking',
- 'deactivate', 'dayUTC', 'day', 'dateUTC', 'date', 'dataFormat',
- 'data', 'd', 'customItems', 'curveTo', 'currentTarget',
- 'currentScene', 'currentLabels', 'currentLabel', 'currentFrame',
- 'currentFPS', 'currentDomain', 'currentCount', 'ctrlKey', 'creator',
- 'creationDate', 'createTextNode', 'createGradientBox',
- 'createElement', 'createBox', 'cos', 'copyPixels', 'copyChannel',
- 'copy', 'conversionMode', 'contextMenuOwner', 'contextMenu',
- 'contentType', 'contentLoaderInfo', 'content', 'containsRect',
- 'containsPoint', 'contains', 'constructor', 'connectedProxyType',
- 'connected', 'connect', 'condenseWhite', 'concatenatedMatrix',
- 'concatenatedColorTransform', 'concat', 'computeSpectrum',
- 'compress', 'componentY', 'componentX', 'complete', 'compare',
- 'comments', 'comment', 'colors', 'colorTransform', 'color', 'code',
- 'close', 'cloneNode', 'clone', 'client', 'click', 'clearTimeout',
- 'clearInterval', 'clear', 'clamp', 'children', 'childNodes',
- 'childIndex', 'childAllowsParent', 'child', 'checkPolicyFile',
- 'charCount', 'charCodeAt', 'charCode', 'charAt', 'changeList',
- 'change', 'ceil', 'caretIndex', 'caption', 'capsLock', 'cancelable',
- 'cancel', 'callee', 'callProperty', 'call', 'cacheAsBitmap', 'c',
- 'bytesTotal', 'bytesLoaded', 'bytesAvailable', 'buttonMode',
- 'buttonDown', 'bullet', 'builtInItems', 'bufferTime',
- 'bufferLength', 'bubbles', 'browse', 'bottomScrollV', 'bottomRight',
- 'bottom', 'borderColor', 'border', 'bold', 'blurY', 'blurX',
- 'blueOffset', 'blueMultiplier', 'blockIndent', 'blendMode',
- 'bitmapData', 'bias', 'beginGradientFill', 'beginFill',
- 'beginBitmapFill', 'bandwidth', 'backgroundColor', 'background',
- 'b', 'available', 'avHardwareDisable', 'autoSize', 'attributes',
- 'attribute', 'attachNetStream', 'attachCamera', 'attachAudio',
- 'atan2', 'atan', 'asyncError', 'asin', 'ascent', 'artist',
- 'areSoundsInaccessible', 'areInaccessibleObjectsUnderPoint',
- 'applyFilter', 'apply', 'applicationDomain', 'appendText',
- 'appendChild', 'antiAliasType', 'angle', 'alwaysShowSelection',
- 'altKey', 'alphas', 'alphaOffset', 'alphaMultiplier', 'alpha',
- 'allowInsecureDomain', 'allowDomain', 'align', 'album',
- 'addedToStage', 'added', 'addPage', 'addNamespace', 'addHeader',
- 'addEventListener', 'addChildAt', 'addChild', 'addCallback', 'add',
- 'activityLevel', 'activity', 'active', 'activating', 'activate',
- 'actionScriptVersion', 'acos', 'accessibilityProperties', 'abs'
- ),
- 8 => array(
- 'WRAP', 'VERTICAL', 'VARIABLES',
- 'UTC', 'UPLOAD_COMPLETE_DATA', 'UP', 'UNLOAD', 'UNKNOWN',
- 'UNIQUESORT', 'TOP_RIGHT', 'TOP_LEFT', 'TOP', 'TIMER_COMPLETE',
- 'TIMER', 'TEXT_NODE', 'TEXT_INPUT', 'TEXT', 'TAB_INDEX_CHANGE',
- 'TAB_ENABLED_CHANGE', 'TAB_CHILDREN_CHANGE', 'TAB', 'SYNC',
- 'SUBTRACT', 'SUBPIXEL', 'STATUS', 'STANDARD', 'SQUARE', 'SQRT2',
- 'SQRT1_2', 'SPACE', 'SOUND_COMPLETE', 'SOCKET_DATA', 'SHOW_ALL',
- 'SHIFT', 'SETTINGS_MANAGER', 'SELECT', 'SECURITY_ERROR', 'SCROLL',
- 'SCREEN', 'ROUND', 'ROLL_OVER', 'ROLL_OUT', 'RIGHT', 'RGB',
- 'RETURNINDEXEDARRAY', 'RESIZE', 'REPEAT', 'RENDER',
- 'REMOVED_FROM_STAGE', 'REMOVED', 'REMOTE', 'REGULAR', 'REFLECT',
- 'RED', 'RADIAL', 'PROGRESS', 'PRIVACY', 'POST', 'POSITIVE_INFINITY',
- 'PORTRAIT', 'PIXEL', 'PI', 'PENDING', 'PAGE_UP', 'PAGE_DOWN', 'PAD',
- 'OVERLAY', 'OUTER', 'OPEN', 'NaN', 'NUM_PAD', 'NUMPAD_SUBTRACT',
- 'NUMPAD_MULTIPLY', 'NUMPAD_ENTER', 'NUMPAD_DIVIDE',
- 'NUMPAD_DECIMAL', 'NUMPAD_ADD', 'NUMPAD_9', 'NUMPAD_8', 'NUMPAD_7',
- 'NUMPAD_6', 'NUMPAD_5', 'NUMPAD_4', 'NUMPAD_3', 'NUMPAD_2',
- 'NUMPAD_1', 'NUMPAD_0', 'NUMERIC', 'NO_SCALE', 'NO_BORDER',
- 'NORMAL', 'NONE', 'NEVER', 'NET_STATUS', 'NEGATIVE_INFINITY',
- 'MULTIPLY', 'MOUSE_WHEEL', 'MOUSE_UP', 'MOUSE_OVER', 'MOUSE_OUT',
- 'MOUSE_MOVE', 'MOUSE_LEAVE', 'MOUSE_FOCUS_CHANGE', 'MOUSE_DOWN',
- 'MITER', 'MIN_VALUE', 'MICROPHONE', 'MENU_SELECT',
- 'MENU_ITEM_SELECT', 'MEDIUM', 'MAX_VALUE', 'LOW', 'LOG2E', 'LOG10E',
- 'LOCAL_WITH_NETWORK', 'LOCAL_WITH_FILE', 'LOCAL_TRUSTED',
- 'LOCAL_STORAGE', 'LN2', 'LN10', 'LITTLE_ENDIAN', 'LINK',
- 'LINEAR_RGB', 'LINEAR', 'LIGHT_COLOR', 'LIGHTEN', 'LEFT', 'LCD',
- 'LAYER', 'LANDSCAPE', 'KOREAN', 'KEY_UP', 'KEY_FOCUS_CHANGE',
- 'KEY_DOWN', 'JUSTIFY', 'JAPANESE_KATAKANA_HALF',
- 'JAPANESE_KATAKANA_FULL', 'JAPANESE_HIRAGANA', 'Infinity', 'ITALIC',
- 'IO_ERROR', 'INVERT', 'INSERT', 'INPUT', 'INNER', 'INIT',
- 'IME_COMPOSITION', 'IGNORE', 'ID3', 'HTTP_STATUS', 'HORIZONTAL',
- 'HOME', 'HIGH', 'HARDLIGHT', 'GREEN', 'GET', 'FULLSCREEN', 'FULL',
- 'FOCUS_OUT', 'FOCUS_IN', 'FLUSHED', 'FLASH9', 'FLASH8', 'FLASH7',
- 'FLASH6', 'FLASH5', 'FLASH4', 'FLASH3', 'FLASH2', 'FLASH1', 'F9',
- 'F8', 'F7', 'F6', 'F5', 'F4', 'F3', 'F2', 'F15', 'F14', 'F13',
- 'F12', 'F11', 'F10', 'F1', 'EXACT_FIT', 'ESCAPE', 'ERROR', 'ERASE',
- 'ENTER_FRAME', 'ENTER', 'END', 'EMBEDDED', 'ELEMENT_NODE', 'E',
- 'DYNAMIC', 'DOWN', 'DOUBLE_CLICK', 'DIFFERENCE', 'DEVICE',
- 'DESCENDING', 'DELETE', 'DEFAULT', 'DEACTIVATE', 'DATA',
- 'DARK_COLOR', 'DARKEN', 'CRT', 'CONTROL', 'CONNECT', 'COMPLETE',
- 'COLOR', 'CLOSE', 'CLICK', 'CLAMP', 'CHINESE', 'CHANGE', 'CENTER',
- 'CASEINSENSITIVE', 'CAPTURING_PHASE', 'CAPS_LOCK', 'CANCEL',
- 'CAMERA', 'BUBBLING_PHASE', 'BOTTOM_RIGHT', 'BOTTOM_LEFT', 'BOTTOM',
- 'BOLD_ITALIC', 'BOLD', 'BLUE', 'BINARY', 'BIG_ENDIAN', 'BEVEL',
- 'BEST', 'BACKSPACE', 'AUTO', 'AT_TARGET', 'ASYNC_ERROR', 'AMF3',
- 'AMF0', 'ALWAYS', 'ALPHANUMERIC_HALF', 'ALPHANUMERIC_FULL', 'ALPHA',
- 'ADVANCED', 'ADDED_TO_STAGE', 'ADDED', 'ADD', 'ACTIVITY',
- 'ACTIONSCRIPT3', 'ACTIONSCRIPT2'
- ),
- //FIX: Must be last in order to avoid conflicts with keywords present
- //in other keyword groups, that might get highlighted as part of the URL.
- //I know this is not a proper work-around, but should do just fine.
- 5 => array(
- 'uint', 'int', 'arguments', 'XMLSocket', 'XMLNodeType', 'XMLNode',
- 'XMLList', 'XMLDocument', 'XML', 'Video', 'VerifyError',
- 'URLVariables', 'URLStream', 'URLRequestMethod', 'URLRequestHeader',
- 'URLRequest', 'URLLoaderDataFormat', 'URLLoader', 'URIError',
- 'TypeError', 'Transform', 'TimerEvent', 'Timer', 'TextSnapshot',
- 'TextRenderer', 'TextLineMetrics', 'TextFormatAlign', 'TextFormat',
- 'TextFieldType', 'TextFieldAutoSize', 'TextField', 'TextEvent',
- 'TextDisplayMode', 'TextColorType', 'System', 'SyntaxError',
- 'SyncEvent', 'StyleSheet', 'String', 'StatusEvent', 'StaticText',
- 'StageScaleMode', 'StageQuality', 'StageAlign', 'Stage',
- 'StackOverflowError', 'Sprite', 'SpreadMethod', 'SoundTransform',
- 'SoundMixer', 'SoundLoaderContext', 'SoundChannel', 'Sound',
- 'Socket', 'SimpleButton', 'SharedObjectFlushStatus', 'SharedObject',
- 'Shape', 'SecurityPanel', 'SecurityErrorEvent', 'SecurityError',
- 'SecurityDomain', 'Security', 'ScriptTimeoutError', 'Scene',
- 'SWFVersion', 'Responder', 'RegExp', 'ReferenceError', 'Rectangle',
- 'RangeError', 'QName', 'Proxy', 'ProgressEvent',
- 'PrintJobOrientation', 'PrintJobOptions', 'PrintJob', 'Point',
- 'PixelSnapping', 'ObjectEncoding', 'Object', 'Number', 'NetStream',
- 'NetStatusEvent', 'NetConnection', 'Namespace', 'MovieClip',
- 'MouseEvent', 'Mouse', 'MorphShape', 'Microphone', 'MemoryError',
- 'Matrix', 'Math', 'LocalConnection', 'LoaderInfo', 'LoaderContext',
- 'Loader', 'LineScaleMode', 'KeyboardEvent', 'Keyboard',
- 'KeyLocation', 'JointStyle', 'InvalidSWFError',
- 'InterpolationMethod', 'InteractiveObject', 'IllegalOperationError',
- 'IOErrorEvent', 'IOError', 'IMEEvent', 'IMEConversionMode', 'IME',
- 'IExternalizable', 'IEventDispatcher', 'IDynamicPropertyWriter',
- 'IDynamicPropertyOutput', 'IDataOutput', 'IDataInput', 'ID3Info',
- 'IBitmapDrawable', 'HTTPStatusEvent', 'GridFitType', 'Graphics',
- 'GradientType', 'GradientGlowFilter', 'GradientBevelFilter',
- 'GlowFilter', 'Function', 'FrameLabel', 'FontType', 'FontStyle',
- 'Font', 'FocusEvent', 'FileReferenceList', 'FileReference',
- 'FileFilter', 'ExternalInterface', 'EventPhase', 'EventDispatcher',
- 'Event', 'EvalError', 'ErrorEvent', 'Error', 'Endian', 'EOFError',
- 'DropShadowFilter', 'DisplayObjectContainer', 'DisplayObject',
- 'DisplacementMapFilterMode', 'DisplacementMapFilter', 'Dictionary',
- 'DefinitionError', 'Date', 'DataEvent', 'ConvolutionFilter',
- 'ContextMenuItem', 'ContextMenuEvent', 'ContextMenuBuiltInItems',
- 'ContextMenu', 'ColorTransform', 'ColorMatrixFilter', 'Class',
- 'CapsStyle', 'Capabilities', 'Camera', 'CSMSettings', 'ByteArray',
- 'Boolean', 'BlurFilter', 'BlendMode', 'BitmapFilterType',
- 'BitmapFilterQuality', 'BitmapFilter', 'BitmapDataChannel',
- 'BitmapData', 'Bitmap', 'BevelFilter', 'AsyncErrorEvent', 'Array',
- 'ArgumentError', 'ApplicationDomain', 'AntiAliasType',
- 'ActivityEvent', 'ActionScriptVersion', 'AccessibilityProperties',
- 'Accessibility', 'AVM1Movie'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '%', '&', '*', '|', '/', '<', '>', '^', '-', '+', '~', '?', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0033ff; font-weight: bold;',
- 2 => 'color: #6699cc; font-weight: bold;',
- 3 => 'color: #339966; font-weight: bold;',
- 4 => 'color: #9900cc; font-weight: bold;',
- 5 => 'color: #004993;',
- 6 => 'color: #004993;',
- 7 => 'color: #004993;',
- 8 => 'color: #004993;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #009900;',
- 'MULTI' => 'color: #3f5fbf;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #990000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000; font-weight:bold;'
- ),
- 'METHODS' => array(
- 0 => 'color: #000000;',
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => 'http://www.google.com/search?q={FNAMEL}%20inurl:http://livedocs.adobe.com/flex/201/langref/%20inurl:{FNAMEL}.html&amp;filter=0&amp;num=100&amp;btnI=lucky',
- 6 => '',
- 7 => '',
- 8 => ''
- ),
- 'OOLANG' => false,//Save some time as OO identifiers aren't used
- 'OBJECT_SPLITTERS' => array(
- // commented out because it's not very relevant for AS, as all properties, methods and constants are dot-accessed.
- // I believe it's preferable to have package highlighting for example, which is not possible with this enabled.
- // 0 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array()
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/ada.php b/libvpx/examples/includes/geshi/geshi/ada.php
deleted file mode 100644
index 1013883..0000000
--- a/libvpx/examples/includes/geshi/geshi/ada.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-/*************************************************************************************
- * ada.php
- * -------
- * Author: Tux (tux@inmail.cz)
- * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/29
- *
- * Ada language file for GeSHi.
- * Words are from SciTe configuration file
- *
- * CHANGES
- * -------
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Removed apostrophe as string delimiter
- * - Added URL support
- * 2004/08/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Ada',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'begin', 'declare', 'do', 'else', 'elsif', 'exception', 'for', 'if',
- 'is', 'loop', 'while', 'then', 'end', 'select', 'case', 'until',
- 'goto', 'return'
- ),
- 2 => array(
- 'abs', 'and', 'mod', 'not', 'or', 'rem', 'xor'
- ),
- 3 => array(
- 'abort', 'abstract', 'accept', 'access', 'aliased', 'all', 'array', 'at', 'body',
- 'constant', 'delay', 'delta', 'digits', 'entry', 'exit',
- 'function', 'generic', 'in', 'limited', 'new', 'null', 'of', 'others', 'out', 'package', 'pragma',
- 'private', 'procedure', 'protected', 'raise', 'range', 'record', 'renames', 'requeue', 'reverse',
- 'separate', 'subtype', 'tagged', 'task', 'terminate', 'type', 'use', 'when', 'with'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00007f;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #46aa03; font-weight:bold;',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/apache.php b/libvpx/examples/includes/geshi/geshi/apache.php
deleted file mode 100644
index fa06afe..0000000
--- a/libvpx/examples/includes/geshi/geshi/apache.php
+++ /dev/null
@@ -1,206 +0,0 @@
-<?php
-/*************************************************************************************
- * apache.php
- * ----------
- * Author: Tux (tux@inmail.cz)
- * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/29/07
- *
- * Apache language file for GeSHi.
- * Words are from SciTe configuration file
- *
- * CHANGES
- * -------
- * 2008/17/06 (1.0.8)
- * - Added support for apache configuration sections (milian)
- * - Added missing php keywords (milian)
- * - Added some more keywords
- * - Disabled highlighting of brackets by default
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Added support for URLs
- * 2004/08/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/29)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Apache configuration',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- /*keywords*/
- 1 => array(
- 'accessconfig','accessfilename','action','addalt',
- 'addaltbyencoding','addaltbytype','addcharset',
- 'adddefaultcharset','adddescription',
- 'addencoding','addhandler','addicon','addiconbyencoding',
- 'addiconbytype','addlanguage','addmodule','addmoduleinfo',
- 'addtype','agentlog','alias','aliasmatch',
- 'allow','allowconnect','allowoverride','anonymous',
- 'anonymous_authoritative','anonymous_logemail','anonymous_mustgiveemail',
- 'anonymous_nouserid','anonymous_verifyemail','authauthoritative',
- 'authdbauthoritative','authdbgroupfile','authdbmauthoritative',
- 'authdbmgroupfile','authdbuserfile','authdbmuserfile',
- 'authdigestfile','authgroupfile','authname','authtype',
- 'authuserfile','bindaddress','browsermatch','browsermatchnocase',
- 'bs2000account','cachedefaultexpire','cachedirlength','cachedirlevels',
- 'cacheforcecompletion','cachegcinterval','cachelastmodifiedfactor','cachemaxexpire',
- 'cachenegotiateddocs','cacheroot','cachesize','checkspelling',
- 'clearmodulelist','contentdigest','cookieexpires','cookielog',
- 'cookietracking','coredumpdirectory','customlog',
- 'defaulticon','defaultlanguage','defaulttype','define',
- 'deny','directory','directorymatch','directoryindex',
- 'documentroot','errordocument','errorlog','example',
- 'expiresactive','expiresbytype','expiresdefault','extendedstatus',
- 'fancyindexing','files','filesmatch','forcetype',
- 'group','header','headername','hostnamelookups',
- 'identitycheck','ifdefine','ifmodule','imapbase',
- 'imapdefault','imapmenu','include','indexignore','indexorderdefault',
- 'indexoptions','keepalive','keepalivetimeout','languagepriority',
- 'limit','limitexcept','limitrequestbody','limitrequestfields',
- 'limitrequestfieldsize','limitrequestline','listen','listenbacklog',
- 'loadfile','loadmodule','location','locationmatch',
- 'lockfile','logformat','loglevel','maxclients',
- 'maxkeepaliverequests','maxrequestsperchild','maxspareservers','maxsparethreads','metadir',
- 'metafiles','metasuffix','mimemagicfile','minspareservers','minsparethreads',
- 'mmapfile','namevirtualhost','nocache','options','order',
- 'passenv','php_admin_value','php_admin_flag','php_value','pidfile','port','proxyblock','proxydomain',
- 'proxypass','proxypassreverse','proxyreceivebuffersize','proxyremote',
- 'proxyrequests','proxyvia','qsc','readmename',
- 'redirect','redirectmatch','redirectpermanent','redirecttemp',
- 'refererignore','refererlog','removehandler','require',
- 'resourceconfig','rewritebase','rewritecond','rewriteengine',
- 'rewritelock','rewritelog','rewriteloglevel','rewritemap',
- 'rewriteoptions','rewriterule','rlimitcpu','rlimitmem',
- 'rlimitnproc','satisfy','scoreboardfile','script',
- 'scriptalias','scriptaliasmatch','scriptinterpretersource','scriptlog',
- 'scriptlogbuffer','scriptloglength','sendbuffersize',
- 'serveradmin','serveralias','servername','serverpath',
- 'serverroot','serversignature','servertokens','servertype',
- 'setenv','setenvif','setenvifnocase','sethandler',
- 'singlelisten','startservers','threadsperchild','timeout',
- 'transferlog','typesconfig','unsetenv','usecanonicalname',
- 'user','userdir','virtualhost','virtualdocumentroot',
- 'virtualdocumentrootip','virtualscriptalias','virtualscriptaliasip',
- 'xbithack','from','all'
- ),
- /*keywords 2*/
- 2 => array(
- 'on','off','standalone','inetd','indexes',
- 'force-response-1.0','downgrade-1.0','nokeepalive',
- 'ndexes','includes','followsymlinks','none',
- 'x-compress','x-gzip'
- ),
- /*keywords 3*/
- 3 => array(
- 'Directory',
- 'DirectoryMatch',
- 'Files',
- 'FilesMatch',
- 'IfDefine',
- 'IfModule',
- 'IfVersion',
- 'Location',
- 'LocationMatch',
- 'Proxy',
- 'ProxyMatch',
- 'VirtualHost'
- )
- ),
- 'SYMBOLS' => array(
- '+', '-'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00007f;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #000000; font-weight:bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #339933;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'BRACKETS' => GESHI_NEVER,
- 'SYMBOLS' => GESHI_NEVER
- ),
- 'KEYWORDS' => array(
- 3 => array(
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/applescript.php b/libvpx/examples/includes/geshi/geshi/applescript.php
deleted file mode 100644
index 395bba7..0000000
--- a/libvpx/examples/includes/geshi/geshi/applescript.php
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-/*************************************************************************************
- * applescript.php
- * --------
- * Author: Stephan Klimek (http://www.initware.org)
- * Copyright: Stephan Klimek (http://www.initware.org)
- * Release Version: 1.0.8.3
- * Date Started: 2005/07/20
- *
- * AppleScript language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- *
- * TODO
- * -------------------------
- * URL settings to references
- *
- **************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'AppleScript',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array( '(*' => '*)'),
- 'COMMENT_REGEXP' => array(
- 2 => '/(?<=[a-z])\'/i',
- 3 => '/(?<![a-z])\'.*?\'/i',
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'application','close','count','delete','duplicate','exists','launch','make','move','open',
- 'print','quit','reopen','run','save','saving', 'idle', 'path to', 'number', 'alias', 'list', 'text', 'string',
- 'integer', 'it','me','version','pi','result','space','tab','anything','case','diacriticals','expansion',
- 'hyphens','punctuation','bold','condensed','expanded','hidden','italic','outline','plain',
- 'shadow','strikethrough','subscript','superscript','underline','ask','no','yes','false', 'id',
- 'true','weekday','monday','mon','tuesday','tue','wednesday','wed','thursday','thu','friday',
- 'fri','saturday','sat','sunday','sun','month','january','jan','february','feb','march',
- 'mar','april','apr','may','june','jun','july','jul','august','aug','september', 'quote', 'do JavaScript',
- 'sep','october','oct','november','nov','december','dec','minutes','hours', 'name', 'default answer',
- 'days','weeks', 'folder', 'folders', 'file', 'files', 'window', 'eject', 'disk', 'reveal', 'sleep',
- 'shut down', 'restart', 'display dialog', 'buttons', 'invisibles', 'item', 'items', 'delimiters', 'offset of',
- 'AppleScript\'s', 'choose file', 'choose folder', 'choose from list', 'beep', 'contents', 'do shell script',
- 'paragraph', 'paragraphs', 'missing value', 'quoted form', 'desktop', 'POSIX path', 'POSIX file',
- 'activate', 'document', 'adding', 'receiving', 'content', 'new', 'properties', 'info for', 'bounds',
- 'selection', 'extension', 'into', 'onto', 'by', 'between', 'against', 'set the clipboard to', 'the clipboard'
- ),
- 2 => array(
- 'each','some','every','whose','where','index','first','second','third','fourth',
- 'fifth','sixth','seventh','eighth','ninth','tenth','last','front','back','st','nd',
- 'rd','th','middle','named','through','thru','before','after','beginning','the', 'as',
- 'div','mod','and','not','or','contains','equal','equals','isnt', 'less', 'greater'
- ),
- 3 => array(
- 'script','property','prop','end','to','set','global','local','on','of',
- 'in','given','with','without','return','continue','tell','if','then','else','repeat',
- 'times','while','until','from','exit','try','error','considering','ignoring','timeout',
- 'transaction','my','get','put','is', 'copy'
- )
- ),
- 'SYMBOLS' => array(
- ')','+','-','^','*','/','&','<','>=','<','<=','=','�'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0066ff;',
- 2 => 'color: #ff0033;',
- 3 => 'color: #ff0033; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => '',
- 3 => 'color: #ff0000;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000000; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #009900;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #339933;',
- 4 => 'color: #0066ff;',
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => ',+-=&lt;&gt;/?^&amp;*'
- ),
- 'REGEXPS' => array(
- //Variables
- 0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*',
- //File descriptors
- 4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'SPACE_AS_WHITESPACE' => true
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/apt_sources.php b/libvpx/examples/includes/geshi/geshi/apt_sources.php
deleted file mode 100644
index 1321032..0000000
--- a/libvpx/examples/includes/geshi/geshi/apt_sources.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/*************************************************************************************
- * apt_sources.php
- * ----------
- * Author: Milian Wolff (mail@milianw.de)
- * Copyright: (c) 2008 Milian Wolff (http://milianw.de)
- * Release Version: 1.0.8.3
- * Date Started: 2008/06/17
- *
- * Apt sources.list language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/06/17 (1.0.8)
- * - Initial import
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Apt sources',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- /*keywords*/
- 1 => array(
- 'deb-src', 'deb'
- ),
- 2 => array(
- //Generic
- 'stable', 'old-stable', 'testing', 'testing-proposed-updates',
- 'unstable', 'unstable-proposed-updates', 'experimental',
- 'non-US', 'security', 'volatile', 'volatile-sloppy',
- 'apt-build',
- 'stable/updates',
- //Debian
- 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato', 'woody', 'sarge',
- 'etch', 'lenny', 'sid',
- //Ubuntu
- 'warty', 'warty-updates', 'warty-security', 'warty-proposed', 'warty-backports',
- 'hoary', 'hoary-updates', 'hoary-security', 'hoary-proposed', 'hoary-backports',
- 'breezy', 'breezy-updates', 'breezy-security', 'breezy-proposed', 'breezy-backports',
- 'dapper', 'dapper-updates', 'dapper-security', 'dapper-proposed', 'dapper-backports',
- 'edgy', 'edgy-updates', 'edgy-security', 'edgy-proposed', 'edgy-backports',
- 'feisty', 'feisty-updates', 'feisty-security', 'feisty-proposed', 'feisty-backports',
- 'gutsy', 'gutsy-updates', 'gutsy-security', 'gutsy-proposed', 'gutsy-backports',
- 'hardy', 'hardy-updates', 'hardy-security', 'hardy-proposed', 'hardy-backports',
- 'intrepid', 'intrepid-updates', 'intrepid-security', 'intrepid-proposed', 'intrepid-backports'
- ),
- 3 => array(
- 'main', 'restricted', 'preview', 'contrib', 'non-free',
- 'commercial', 'universe', 'multiverse'
- )
- ),
- 'REGEXPS' => array(
- 0 => "(((http|ftp):\/\/|file:\/)[^\s]+)|(cdrom:\[[^\]]*\][^\s]*)",
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => true,
- 3 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00007f;',
- 2 => 'color: #b1b100;',
- 3 => 'color: #b16000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- ),
- 'STRINGS' => array(
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'REGEXPS' => array(
- 0 => 'color: #009900;',
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'NUMBERS' => GESHI_NEVER,
- 'METHODS' => GESHI_NEVER,
- 'SCRIPT' => GESHI_NEVER,
- 'SYMBOLS' => GESHI_NEVER,
- 'ESCAPE_CHAR' => GESHI_NEVER,
- 'BRACKETS' => GESHI_NEVER,
- 'STRINGS' => GESHI_NEVER,
- ),
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#;>|^\/])',
- 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\.])'
- )
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/asm.php b/libvpx/examples/includes/geshi/geshi/asm.php
deleted file mode 100644
index af4eef7..0000000
--- a/libvpx/examples/includes/geshi/geshi/asm.php
+++ /dev/null
@@ -1,225 +0,0 @@
-<?php
-/*************************************************************************************
- * asm.php
- * -------
- * Author: Tux (tux@inmail.cz)
- * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/27
- *
- * x86 Assembler language file for GeSHi.
- * Words are from SciTe configuration file (based on NASM syntax)
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Added support for URLs
- * - Added binary and hexadecimal regexps
- * 2004/08/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'ASM',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- //Line address prefix suppression
- 'COMMENT_REGEXP' => array(2 => "/^(?:[0-9a-f]{0,4}:)?[0-9a-f]{4}(?:[0-9a-f]{4})?/mi"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /*CPU*/
- 1 => array(
- 'aaa','aad','aam','aas','adc','add','and','call','cbw','clc','cld','cli','cmc','cmp',
- 'cmps','cmpsb','cmpsw','cwd','daa','das','dec','div','esc','hlt','idiv','imul','in','inc',
- 'int','into','iret','ja','jae','jb','jbe','jc','jcxz','je','jg','jge','jl','jle','jmp',
- 'jna','jnae','jnb','jnbe','jnc','jne','jng','jnge','jnl','jnle','jno','jnp','jns','jnz',
- 'jo','jp','jpe','jpo','js','jz','lahf','lds','lea','les','lods','lodsb','lodsw','loop',
- 'loope','loopew','loopne','loopnew','loopnz','loopnzw','loopw','loopz','loopzw','mov',
- 'movs','movsb','movsw','mul','neg','nop','not','or','out','pop','popf','push','pushf',
- 'rcl','rcr','ret','retf','retn','rol','ror','sahf','sal','sar','sbb','scas','scasb','scasw',
- 'shl','shr','stc','std','sti','stos','stosb','stosw','sub','test','wait','xchg','xlat',
- 'xlatb','xor','bound','enter','ins','insb','insw','leave','outs','outsb','outsw','popa','pusha','pushw',
- 'arpl','lar','lsl','sgdt','sidt','sldt','smsw','str','verr','verw','clts','lgdt','lidt','lldt','lmsw','ltr',
- 'bsf','bsr','bt','btc','btr','bts','cdq','cmpsd','cwde','insd','iretd','iretdf','iretf',
- 'jecxz','lfs','lgs','lodsd','loopd','looped','loopned','loopnzd','loopzd','lss','movsd',
- 'movsx','movzx','outsd','popad','popfd','pushad','pushd','pushfd','scasd','seta','setae',
- 'setb','setbe','setc','sete','setg','setge','setl','setle','setna','setnae','setnb','setnbe',
- 'setnc','setne','setng','setnge','setnl','setnle','setno','setnp','setns','setnz','seto','setp',
- 'setpe','setpo','sets','setz','shld','shrd','stosd','bswap','cmpxchg','invd','invlpg','wbinvd','xadd','lock',
- 'rep','repe','repne','repnz','repz'
- ),
- /*FPU*/
- 2 => array(
- 'f2xm1','fabs','fadd','faddp','fbld','fbstp','fchs','fclex','fcom','fcomp','fcompp','fdecstp',
- 'fdisi','fdiv','fdivp','fdivr','fdivrp','feni','ffree','fiadd','ficom','ficomp','fidiv',
- 'fidivr','fild','fimul','fincstp','finit','fist','fistp','fisub','fisubr','fld','fld1',
- 'fldcw','fldenv','fldenvw','fldl2e','fldl2t','fldlg2','fldln2','fldpi','fldz','fmul',
- 'fmulp','fnclex','fndisi','fneni','fninit','fnop','fnsave','fnsavew','fnstcw','fnstenv',
- 'fnstenvw','fnstsw','fpatan','fprem','fptan','frndint','frstor','frstorw','fsave',
- 'fsavew','fscale','fsqrt','fst','fstcw','fstenv','fstenvw','fstp','fstsw','fsub','fsubp',
- 'fsubr','fsubrp','ftst','fwait','fxam','fxch','fxtract','fyl2x','fyl2xp1',
- 'fsetpm','fcos','fldenvd','fnsaved','fnstenvd','fprem1','frstord','fsaved','fsin','fsincos',
- 'fstenvd','fucom','fucomp','fucompp'
- ),
- /*registers*/
- 3 => array(
- 'ah','al','ax','bh','bl','bp','bx','ch','cl','cr0','cr2','cr3','cs','cx','dh','di','dl',
- 'dr0','dr1','dr2','dr3','dr6','dr7','ds','dx','eax','ebp','ebx','ecx','edi','edx',
- 'es','esi','esp','fs','gs','si','sp','ss','st','tr3','tr4','tr5','tr6','tr7'
- ),
- /*Directive*/
- 4 => array(
- '186','286','286c','286p','287','386','386c','386p','387','486','486p',
- '8086','8087','alpha','break','code','const','continue','cref','data','data?',
- 'dosseg','else','elseif','endif','endw','err','err1','err2','errb',
- 'errdef','errdif','errdifi','erre','erridn','erridni','errnb','errndef',
- 'errnz','exit','fardata','fardata?','if','lall','lfcond','list','listall',
- 'listif','listmacro','listmacroall',' model','no87','nocref','nolist',
- 'nolistif','nolistmacro','radix','repeat','sall','seq','sfcond','stack',
- 'startup','tfcond','type','until','untilcxz','while','xall','xcref',
- 'xlist','alias','align','assume','catstr','comm','comment','db','dd','df','dq',
- 'dt','dup','dw','echo','elseif1','elseif2','elseifb','elseifdef','elseifdif',
- 'elseifdifi','elseife','elseifidn','elseifidni','elseifnb','elseifndef','end',
- 'endm','endp','ends','eq',' equ','even','exitm','extern','externdef','extrn','for',
- 'forc','ge','goto','group','high','highword','if1','if2','ifb','ifdef','ifdif',
- 'ifdifi','ife',' ifidn','ifidni','ifnb','ifndef','include','includelib','instr','invoke',
- 'irp','irpc','label','le','length','lengthof','local','low','lowword','lroffset',
- 'macro','mask','mod','msfloat','name','ne','offset','opattr','option','org','%out',
- 'page','popcontext','private','proc','proto','ptr','public','purge','pushcontext','record',
- 'rept','seg','segment','short','size','sizeof','sizestr','struc','struct',
- 'substr','subtitle','subttl','textequ','this','title','typedef','union','width',
- '.model', '.stack', '.code', '.data'
- ),
- /*Operands*/
- 5 => array(
- '@b','@f','addr','basic','byte','c','carry?','dword',
- 'far','far16','fortran','fword','near','near16','overflow?','parity?','pascal','qword',
- 'real4',' real8','real10','sbyte','sdword','sign?','stdcall','sword','syscall','tbyte',
- 'vararg','word','zero?','flat','near32','far32',
- 'abs','all','assumes','at','casemap','common','compact',
- 'cpu','dotname','emulator','epilogue','error','export','expr16','expr32','farstack',
- 'forceframe','huge','language','large','listing','ljmp','loadds','m510','medium','memory',
- 'nearstack','nodotname','noemulator','nokeyword','noljmp','nom510','none','nonunique',
- 'nooldmacros','nooldstructs','noreadonly','noscoped','nosignextend','nothing',
- 'notpublic','oldmacros','oldstructs','os_dos','para','prologue',
- 'readonly','req','scoped','setif2','smallstack','tiny','use16','use32','uses'
- )
- ),
- 'SYMBOLS' => array(
- '[', ']', '(', ')',
- '+', '-', '*', '/', '%',
- '.', ',', ';', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00007f; font-weight: bold;',
- 2 => 'color: #0000ff; font-weight: bold;',
- 3 => 'color: #00007f;',
- 4 => 'color: #000000; font-weight: bold;',
- 5 => 'color: #000000; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900; font-weight: bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
-// 0 => 'color: #0000ff;',
-// 1 => 'color: #0000ff;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_BIN_PREFIX_PERCENT |
- GESHI_NUMBER_BIN_SUFFIX |
- GESHI_NUMBER_HEX_PREFIX |
- GESHI_NUMBER_HEX_SUFFIX |
- GESHI_NUMBER_OCT_SUFFIX |
- GESHI_NUMBER_INT_BASIC |
- GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_NONSCI_F |
- GESHI_NUMBER_FLT_SCI_ZERO,
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Hex numbers
-// 0 => /* */ "(?<=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))(?:[0-9][0-9a-fA-F]{0,31}[hH]|0x[0-9a-fA-F]{1,32})(?=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))",
- //Binary numbers
-// 1 => "(?<=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))[01]{1,64}[bB](?=([\\s\\(\\)\\[\\],;.:+\\-\\/*]))"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 8,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
- 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_<\|%])"
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/asp.php b/libvpx/examples/includes/geshi/geshi/asp.php
deleted file mode 100644
index d2404bb..0000000
--- a/libvpx/examples/includes/geshi/geshi/asp.php
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/*************************************************************************************
- * asp.php
- * --------
- * Author: Amit Gupta (http://blog.igeek.info/)
- * Copyright: (c) 2004 Amit Gupta (http://blog.igeek.info/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/13
- *
- * ASP language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/12/30 (1.0.3)
- * - Strings only delimited by ", comments by '
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Added support for URLs
- * 2004/08/13 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Include all the functions, keywords etc that I have missed
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'ASP',
- 'COMMENT_SINGLE' => array(1 => "'", 2 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'include', 'file', 'Const', 'Dim', 'Option', 'Explicit', 'Implicit', 'Set', 'Select', 'ReDim', 'Preserve',
- 'ByVal', 'ByRef', 'End', 'Private', 'Public', 'If', 'Then', 'Else', 'ElseIf', 'Case', 'With', 'NOT',
- 'While', 'Wend', 'For', 'Loop', 'Do', 'Request', 'Response', 'Server', 'ADODB', 'Session', 'Application',
- 'Each', 'In', 'Get', 'Next', 'INT', 'CINT', 'CBOOL', 'CDATE', 'CBYTE', 'CCUR', 'CDBL', 'CLNG', 'CSNG',
- 'CSTR', 'Fix', 'Is', 'Sgn', 'String', 'Boolean', 'Currency', 'Me', 'Single', 'Long', 'Integer', 'Byte',
- 'Variant', 'Double', 'To', 'Let', 'Xor', 'Resume', 'On', 'Error', 'Imp', 'GoTo', 'Call', 'Global'
- ),
- 2 => array(
- 'Null', 'Nothing', 'And',
- 'False',
- 'True', 'var', 'Or', 'BOF', 'EOF', 'xor',
- 'Function', 'Class', 'New', 'Sub'
- ),
- 3 => array(
- 'CreateObject', 'Write', 'Redirect', 'Cookies', 'BinaryRead', 'ClientCertificate', 'Form', 'QueryString',
- 'ServerVariables', 'TotalBytes', 'AddHeader', 'AppendToLog', 'BinaryWrite', 'Buffer', 'CacheControl',
- 'Charset', 'Clear', 'ContentType', 'End()', 'Expires', 'ExpiresAbsolute', 'Flush()', 'IsClientConnected',
- 'PICS', 'Status', 'Connection', 'Recordset', 'Execute', 'Abandon', 'Lock', 'UnLock', 'Command', 'Fields',
- 'Properties', 'Property', 'Send', 'Replace', 'InStr', 'TRIM', 'NOW', 'Day', 'Month', 'Hour', 'Minute', 'Second',
- 'Year', 'MonthName', 'LCase', 'UCase', 'Abs', 'Array', 'As', 'LEN', 'MoveFirst', 'MoveLast', 'MovePrevious',
- 'MoveNext', 'LBound', 'UBound', 'Transfer', 'Open', 'Close', 'MapPath', 'FileExists', 'OpenTextFile', 'ReadAll'
- )
- ),
- 'SYMBOLS' => array(
- 1 => array(
- '<%', '%>'
- ),
- 0 => array(
- '(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>',
- ';', ':', '?', '='),
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #990099; font-weight: bold;',
- 2 => 'color: #0000ff; font-weight: bold;',
- 3 => 'color: #330066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000;',
- 2 => 'color: #ff6600;',
- 'MULTI' => 'color: #008000;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #006600; font-weight:bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #cc0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #800000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #9900cc;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #006600; font-weight: bold;',
- 1 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<%' => '%>'
- ),
- 1 => array(
- '<script language="vbscript" runat="server">' => '</script>'
- ),
- 2 => array(
- '<script language="javascript" runat="server">' => '</script>'
- ),
- 3 => "/(<%=?)(?:\"[^\"]*?\"|\/\*(?!\*\/).*?\*\/|.)*?(%>|\Z)/sm"
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/autoit.php b/libvpx/examples/includes/geshi/geshi/autoit.php
deleted file mode 100644
index 259c822..0000000
--- a/libvpx/examples/includes/geshi/geshi/autoit.php
+++ /dev/null
@@ -1,1171 +0,0 @@
-<?php
-/*************************************************************************************
- * autoit.php
- * --------
- * Author: big_daddy (robert.i.anthony@gmail.com)
- * Copyright: (c) 2006 and to GESHi ;)
- * Release Version: 1.0.8.3
- * Date Started: 2006/01/26
- *
- * AutoIT language file for GeSHi.
- *
- * CHANGES
- * -------
- * Release 1.0.8.1 (2008/09/15)
- * - Updated on 22.03.2008 By Tlem (tlem@tuxolem.fr)
- * - The link on functions will now correctly re-direct to
- * - http://www.autoitscript.com/autoit3/docs/functions/{FNAME}.htm
- * - Updated whith au3.api (09.02.2008).
- * - Updated - 16 Mai 2008 - v3.2.12.0
- * - Updated - 12 June 2008 - v3.2.12.1
- * Release 1.0.7.20 (2006/01/26)
- * - First Release
- *
- * Current bugs & todo:
- * ----------
- * - not sure how to get sendkeys to work " {!}, {SPACE} etc... "
- * - just copyied the regexp for variable from php so this HAVE to be checked and fixed to a better one ;)
- *
- * Reference: http://www.autoitscript.com/autoit3/docs/
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License,
-or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not,
-write to the Free Software
- * Foundation,
-Inc.,
-59 Temple Place,
-Suite 330,
-Boston,
-MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'AutoIt',
- 'COMMENT_SINGLE' => array(';'),
- 'COMMENT_MULTI' => array(
- '#comments-start' => '#comments-end',
- '#cs' => '#ce'),
- 'COMMENT_REGEXP' => array(0 => '/(?<!#)#(\s.*)?$/m'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'And','ByRef','Case','Const','ContinueCase','ContinueLoop',
- 'Default','Dim','Do','Else','ElseIf','EndFunc','EndIf','EndSelect',
- 'EndSwitch','EndWith','Enum','Exit','ExitLoop','False','For','Func',
- 'Global','If','In','Local','Next','Not','Or','ReDim','Return',
- 'Select','Step','Switch','Then','To','True','Until','WEnd','While',
- 'With'
- ),
- 2 => array(
- '@AppDataCommonDir','@AppDataDir','@AutoItExe','@AutoItPID',
- '@AutoItUnicode','@AutoItVersion','@AutoItX64','@COM_EventObj',
- '@CommonFilesDir','@Compiled','@ComputerName','@ComSpec','@CR',
- '@CRLF','@DesktopCommonDir','@DesktopDepth','@DesktopDir',
- '@DesktopHeight','@DesktopRefresh','@DesktopWidth',
- '@DocumentsCommonDir','@error','@exitCode','@exitMethod',
- '@extended','@FavoritesCommonDir','@FavoritesDir','@GUI_CtrlHandle',
- '@GUI_CtrlId','@GUI_DragFile','@GUI_DragId','@GUI_DropId',
- '@GUI_WinHandle','@HomeDrive','@HomePath','@HomeShare',
- '@HotKeyPressed','@HOUR','@InetGetActive','@InetGetBytesRead',
- '@IPAddress1','@IPAddress2','@IPAddress3','@IPAddress4','@KBLayout',
- '@LF','@LogonDNSDomain','@LogonDomain','@LogonServer','@MDAY',
- '@MIN','@MON','@MyDocumentsDir','@NumParams','@OSBuild','@OSLang',
- '@OSServicePack','@OSTYPE','@OSVersion','@ProcessorArch',
- '@ProgramFilesDir','@ProgramsCommonDir','@ProgramsDir','@ScriptDir',
- '@ScriptFullPath','@ScriptLineNumber','@ScriptName','@SEC',
- '@StartMenuCommonDir','@StartMenuDir','@StartupCommonDir',
- '@StartupDir','@SW_DISABLE','@SW_ENABLE','@SW_HIDE','@SW_LOCK',
- '@SW_MAXIMIZE','@SW_MINIMIZE','@SW_RESTORE','@SW_SHOW',
- '@SW_SHOWDEFAULT','@SW_SHOWMAXIMIZED','@SW_SHOWMINIMIZED',
- '@SW_SHOWMINNOACTIVE','@SW_SHOWNA','@SW_SHOWNOACTIVATE',
- '@SW_SHOWNORMAL','@SW_UNLOCK','@SystemDir','@TAB','@TempDir',
- '@TRAY_ID','@TrayIconFlashing','@TrayIconVisible','@UserName',
- '@UserProfileDir','@WDAY','@WindowsDir','@WorkingDir','@YDAY',
- '@YEAR'
- ),
- 3 => array(
- 'Abs','ACos','AdlibDisable','AdlibEnable','Asc','AscW','ASin',
- 'Assign','ATan','AutoItSetOption','AutoItWinGetTitle',
- 'AutoItWinSetTitle','Beep','Binary','BinaryLen','BinaryMid',
- 'BinaryToString','BitAND','BitNOT','BitOR','BitRotate','BitShift',
- 'BitXOR','BlockInput','Break','Call','CDTray','Ceiling','Chr',
- 'ChrW','ClipGet','ClipPut','ConsoleRead','ConsoleWrite',
- 'ConsoleWriteError','ControlClick','ControlCommand',
- 'ControlDisable','ControlEnable','ControlFocus','ControlGetFocus',
- 'ControlGetHandle','ControlGetPos','ControlGetText','ControlHide',
- 'ControlListView','ControlMove','ControlSend','ControlSetText',
- 'ControlShow','ControlTreeView','Cos','Dec','DirCopy','DirCreate',
- 'DirGetSize','DirMove','DirRemove','DllCall','DllCallbackFree',
- 'DllCallbackGetPtr','DllCallbackRegister','DllClose','DllOpen',
- 'DllStructCreate','DllStructGetData','DllStructGetPtr',
- 'DllStructGetSize','DllStructSetData','DriveGetDrive',
- 'DriveGetFileSystem','DriveGetLabel','DriveGetSerial',
- 'DriveGetType','DriveMapAdd','DriveMapDel','DriveMapGet',
- 'DriveSetLabel','DriveSpaceFree','DriveSpaceTotal','DriveStatus',
- 'EnvGet','EnvSet','EnvUpdate','Eval','Execute','Exp',
- 'FileChangeDir','FileClose','FileCopy','FileCreateNTFSLink',
- 'FileCreateShortcut','FileDelete','FileExists','FileFindFirstFile',
- 'FileFindNextFile','FileGetAttrib','FileGetLongName',
- 'FileGetShortcut','FileGetShortName','FileGetSize','FileGetTime',
- 'FileGetVersion','FileInstall','FileMove','FileOpen',
- 'FileOpenDialog','FileRead','FileReadLine','FileRecycle',
- 'FileRecycleEmpty','FileSaveDialog','FileSelectFolder',
- 'FileSetAttrib','FileSetTime','FileWrite','FileWriteLine','Floor',
- 'FtpSetProxy','GUICreate','GUICtrlCreateAvi','GUICtrlCreateButton',
- 'GUICtrlCreateCheckbox','GUICtrlCreateCombo',
- 'GUICtrlCreateContextMenu','GUICtrlCreateDate','GUICtrlCreateDummy',
- 'GUICtrlCreateEdit','GUICtrlCreateGraphic','GUICtrlCreateGroup',
- 'GUICtrlCreateIcon','GUICtrlCreateInput','GUICtrlCreateLabel',
- 'GUICtrlCreateList','GUICtrlCreateListView',
- 'GUICtrlCreateListViewItem','GUICtrlCreateMenu',
- 'GUICtrlCreateMenuItem','GUICtrlCreateMonthCal','GUICtrlCreateObj',
- 'GUICtrlCreatePic','GUICtrlCreateProgress','GUICtrlCreateRadio',
- 'GUICtrlCreateSlider','GUICtrlCreateTab','GUICtrlCreateTabItem',
- 'GUICtrlCreateTreeView','GUICtrlCreateTreeViewItem',
- 'GUICtrlCreateUpdown','GUICtrlDelete','GUICtrlGetHandle',
- 'GUICtrlGetState','GUICtrlRead','GUICtrlRecvMsg',
- 'GUICtrlRegisterListViewSort','GUICtrlSendMsg','GUICtrlSendToDummy',
- 'GUICtrlSetBkColor','GUICtrlSetColor','GUICtrlSetCursor',
- 'GUICtrlSetData','GUICtrlSetFont','GUICtrlSetDefColor',
- 'GUICtrlSetDefBkColor','GUICtrlSetGraphic','GUICtrlSetImage',
- 'GUICtrlSetLimit','GUICtrlSetOnEvent','GUICtrlSetPos',
- 'GUICtrlSetResizing','GUICtrlSetState','GUICtrlSetStyle',
- 'GUICtrlSetTip','GUIDelete','GUIGetCursorInfo','GUIGetMsg',
- 'GUIGetStyle','GUIRegisterMsg','GUISetAccelerators()',
- 'GUISetBkColor','GUISetCoord','GUISetCursor','GUISetFont',
- 'GUISetHelp','GUISetIcon','GUISetOnEvent','GUISetState',
- 'GUISetStyle','GUIStartGroup','GUISwitch','Hex','HotKeySet',
- 'HttpSetProxy','HWnd','InetGet','InetGetSize','IniDelete','IniRead',
- 'IniReadSection','IniReadSectionNames','IniRenameSection',
- 'IniWrite','IniWriteSection','InputBox','Int','IsAdmin','IsArray',
- 'IsBinary','IsBool','IsDeclared','IsDllStruct','IsFloat','IsHWnd',
- 'IsInt','IsKeyword','IsNumber','IsObj','IsPtr','IsString','Log',
- 'MemGetStats','Mod','MouseClick','MouseClickDrag','MouseDown',
- 'MouseGetCursor','MouseGetPos','MouseMove','MouseUp','MouseWheel',
- 'MsgBox','Number','ObjCreate','ObjEvent','ObjGet','ObjName','Opt',
- 'Ping','PixelChecksum','PixelGetColor','PixelSearch','PluginClose',
- 'PluginOpen','ProcessClose','ProcessExists','ProcessGetStats',
- 'ProcessList','ProcessSetPriority','ProcessWait','ProcessWaitClose',
- 'ProgressOff','ProgressOn','ProgressSet','Ptr','Random','RegDelete',
- 'RegEnumKey','RegEnumVal','RegRead','RegWrite','Round','Run',
- 'RunAs','RunAsWait','RunWait','Send','SendKeepActive','SetError',
- 'SetExtended','ShellExecute','ShellExecuteWait','Shutdown','Sin',
- 'Sleep','SoundPlay','SoundSetWaveVolume','SplashImageOn',
- 'SplashOff','SplashTextOn','Sqrt','SRandom','StatusbarGetText',
- 'StderrRead','StdinWrite','StdioClose','StdoutRead','String',
- 'StringAddCR','StringCompare','StringFormat','StringInStr',
- 'StringIsAlNum','StringIsAlpha','StringIsASCII','StringIsDigit',
- 'StringIsFloat','StringIsInt','StringIsLower','StringIsSpace',
- 'StringIsUpper','StringIsXDigit','StringLeft','StringLen',
- 'StringLower','StringMid','StringRegExp','StringRegExpReplace',
- 'StringReplace','StringRight','StringSplit','StringStripCR',
- 'StringStripWS','StringToBinary','StringTrimLeft','StringTrimRight',
- 'StringUpper','Tan','TCPAccept','TCPCloseSocket','TCPConnect',
- 'TCPListen','TCPNameToIP','TCPRecv','TCPSend','TCPShutdown',
- 'TCPStartup','TimerDiff','TimerInit','ToolTip','TrayCreateItem',
- 'TrayCreateMenu','TrayGetMsg','TrayItemDelete','TrayItemGetHandle',
- 'TrayItemGetState','TrayItemGetText','TrayItemSetOnEvent',
- 'TrayItemSetState','TrayItemSetText','TraySetClick','TraySetIcon',
- 'TraySetOnEvent','TraySetPauseIcon','TraySetState','TraySetToolTip',
- 'TrayTip','UBound','UDPBind','UDPCloseSocket','UDPOpen','UDPRecv',
- 'UDPSend','UDPShutdown','UDPStartup','VarGetType','WinActivate',
- 'WinActive','WinClose','WinExists','WinFlash','WinGetCaretPos',
- 'WinGetClassList','WinGetClientSize','WinGetHandle','WinGetPos',
- 'WinGetProcess','WinGetState','WinGetText','WinGetTitle','WinKill',
- 'WinList','WinMenuSelectItem','WinMinimizeAll','WinMinimizeAllUndo',
- 'WinMove','WinSetOnTop','WinSetState','WinSetTitle','WinSetTrans',
- 'WinWait','WinWaitActive','WinWaitClose','WinWaitNotActive'
- ),
- 4 => array(
- 'ArrayAdd','ArrayBinarySearch','ArrayConcatenate','ArrayDelete',
- 'ArrayDisplay','ArrayFindAll','ArrayInsert','ArrayMax',
- 'ArrayMaxIndex','ArrayMin','ArrayMinIndex','ArrayPop','ArrayPush',
- 'ArrayReverse','ArraySearch','ArraySort','ArraySwap','ArrayToClip',
- 'ArrayToString','ArrayTrim','ChooseColor','ChooseFont',
- 'ClipBoard_ChangeChain','ClipBoard_Close','ClipBoard_CountFormats',
- 'ClipBoard_Empty','ClipBoard_EnumFormats','ClipBoard_FormatStr',
- 'ClipBoard_GetData','ClipBoard_GetDataEx','ClipBoard_GetFormatName',
- 'ClipBoard_GetOpenWindow','ClipBoard_GetOwner',
- 'ClipBoard_GetPriorityFormat','ClipBoard_GetSequenceNumber',
- 'ClipBoard_GetViewer','ClipBoard_IsFormatAvailable',
- 'ClipBoard_Open','ClipBoard_RegisterFormat','ClipBoard_SetData',
- 'ClipBoard_SetDataEx','ClipBoard_SetViewer','ClipPutFile',
- 'ColorConvertHSLtoRGB','ColorConvertRGBtoHSL','ColorGetBlue',
- 'ColorGetGreen','ColorGetRed','Date_Time_CompareFileTime',
- 'Date_Time_DOSDateTimeToArray','Date_Time_DOSDateTimeToFileTime',
- 'Date_Time_DOSDateTimeToStr','Date_Time_DOSDateToArray',
- 'Date_Time_DOSDateToStr','Date_Time_DOSTimeToArray',
- 'Date_Time_DOSTimeToStr','Date_Time_EncodeFileTime',
- 'Date_Time_EncodeSystemTime','Date_Time_FileTimeToArray',
- 'Date_Time_FileTimeToDOSDateTime',
- 'Date_Time_FileTimeToLocalFileTime','Date_Time_FileTimeToStr',
- 'Date_Time_FileTimeToSystemTime','Date_Time_GetFileTime',
- 'Date_Time_GetLocalTime','Date_Time_GetSystemTime',
- 'Date_Time_GetSystemTimeAdjustment',
- 'Date_Time_GetSystemTimeAsFileTime',
- 'Date_Time_GetSystemTimes','Date_Time_GetTickCount',
- 'Date_Time_GetTimeZoneInformation',
- 'Date_Time_LocalFileTimeToFileTime','Date_Time_SetFileTime',
- 'Date_Time_SetLocalTime','Date_Time_SetSystemTime',
- 'Date_Time_SetSystemTimeAdjustment',
- 'Date_Time_SetTimeZoneInformation','Date_Time_SystemTimeToArray',
- 'Date_Time_SystemTimeToDateStr','Date_Time_SystemTimeToDateTimeStr',
- 'Date_Time_SystemTimeToFileTime','Date_Time_SystemTimeToTimeStr',
- 'Date_Time_SystemTimeToTzSpecificLocalTime',
- 'Date_Time_TzSpecificLocalTimeToSystemTime','DateAdd',
- 'DateDayOfWeek','DateDaysInMonth','DateDiff','DateIsLeapYear',
- 'DateIsValid','DateTimeFormat','DateTimeSplit','DateToDayOfWeek',
- 'DateToDayOfWeekISO','DateToDayValue','DateToMonth',
- 'DayValueToDate','DebugBugReportEnv','DebugOut','DebugSetup',
- 'Degree','EventLog__Backup','EventLog__Clear','EventLog__Close',
- 'EventLog__Count','EventLog__DeregisterSource','EventLog__Full',
- 'EventLog__Notify','EventLog__Oldest','EventLog__Open',
- 'EventLog__OpenBackup','EventLog__Read','EventLog__RegisterSource',
- 'EventLog__Report','FileCountLines','FileCreate','FileListToArray',
- 'FilePrint','FileReadToArray','FileWriteFromArray',
- 'FileWriteLog','FileWriteToLine','GDIPlus_ArrowCapCreate',
- 'GDIPlus_ArrowCapDispose','GDIPlus_ArrowCapGetFillState',
- 'GDIPlus_ArrowCapGetHeight','GDIPlus_ArrowCapGetMiddleInset',
- 'GDIPlus_ArrowCapGetWidth','GDIPlus_ArrowCapSetFillState',
- 'GDIPlus_ArrowCapSetHeight','GDIPlus_ArrowCapSetMiddleInset',
- 'GDIPlus_ArrowCapSetWidth','GDIPlus_BitmapCloneArea',
- 'GDIPlus_BitmapCreateFromFile','GDIPlus_BitmapCreateFromGraphics',
- 'GDIPlus_BitmapCreateFromHBITMAP',
- 'GDIPlus_BitmapCreateHBITMAPFromBitmap','GDIPlus_BitmapDispose',
- 'GDIPlus_BitmapLockBits','GDIPlus_BitmapUnlockBits',
- 'GDIPlus_BrushClone','GDIPlus_BrushCreateSolid',
- 'GDIPlus_BrushDispose','GDIPlus_BrushGetType',
- 'GDIPlus_CustomLineCapDispose','GDIPlus_Decoders',
- 'GDIPlus_DecodersGetCount','GDIPlus_DecodersGetSize',
- 'GDIPlus_Encoders','GDIPlus_EncodersGetCLSID',
- 'GDIPlus_EncodersGetCount','GDIPlus_EncodersGetParamList',
- 'GDIPlus_EncodersGetParamListSize','GDIPlus_EncodersGetSize',
- 'GDIPlus_FontCreate','GDIPlus_FontDispose',
- 'GDIPlus_FontFamilyCreate','GDIPlus_FontFamilyDispose',
- 'GDIPlus_GraphicsClear','GDIPlus_GraphicsCreateFromHDC',
- 'GDIPlus_GraphicsCreateFromHWND','GDIPlus_GraphicsDispose',
- 'GDIPlus_GraphicsDrawArc','GDIPlus_GraphicsDrawBezier',
- 'GDIPlus_GraphicsDrawClosedCurve','GDIPlus_GraphicsDrawCurve',
- 'GDIPlus_GraphicsDrawEllipse','GDIPlus_GraphicsDrawImage',
- 'GDIPlus_GraphicsDrawImageRect','GDIPlus_GraphicsDrawImageRectRect',
- 'GDIPlus_GraphicsDrawLine','GDIPlus_GraphicsDrawPie',
- 'GDIPlus_GraphicsDrawPolygon','GDIPlus_GraphicsDrawRect',
- 'GDIPlus_GraphicsDrawString','GDIPlus_GraphicsDrawStringEx',
- 'GDIPlus_GraphicsFillClosedCurve','GDIPlus_GraphicsFillEllipse',
- 'GDIPlus_GraphicsFillPie','GDIPlus_GraphicsFillRect',
- 'GDIPlus_GraphicsGetDC','GDIPlus_GraphicsGetSmoothingMode',
- 'GDIPlus_GraphicsMeasureString','GDIPlus_GraphicsReleaseDC',
- 'GDIPlus_GraphicsSetSmoothingMode','GDIPlus_GraphicsSetTransform',
- 'GDIPlus_ImageDispose','GDIPlus_ImageGetGraphicsContext',
- 'GDIPlus_ImageGetHeight','GDIPlus_ImageGetWidth',
- 'GDIPlus_ImageLoadFromFile','GDIPlus_ImageSaveToFile',
- 'GDIPlus_ImageSaveToFileEx','GDIPlus_MatrixCreate',
- 'GDIPlus_MatrixDispose','GDIPlus_MatrixRotate','GDIPlus_ParamAdd',
- 'GDIPlus_ParamInit','GDIPlus_PenCreate','GDIPlus_PenDispose',
- 'GDIPlus_PenGetAlignment','GDIPlus_PenGetColor',
- 'GDIPlus_PenGetCustomEndCap','GDIPlus_PenGetDashCap',
- 'GDIPlus_PenGetDashStyle','GDIPlus_PenGetEndCap',
- 'GDIPlus_PenGetWidth','GDIPlus_PenSetAlignment',
- 'GDIPlus_PenSetColor','GDIPlus_PenSetCustomEndCap',
- 'GDIPlus_PenSetDashCap','GDIPlus_PenSetDashStyle',
- 'GDIPlus_PenSetEndCap','GDIPlus_PenSetWidth','GDIPlus_RectFCreate',
- 'GDIPlus_Shutdown','GDIPlus_Startup','GDIPlus_StringFormatCreate',
- 'GDIPlus_StringFormatDispose','GetIP','GUICtrlAVI_Close',
- 'GUICtrlAVI_Create','GUICtrlAVI_Destroy','GUICtrlAVI_Open',
- 'GUICtrlAVI_OpenEx','GUICtrlAVI_Play','GUICtrlAVI_Seek',
- 'GUICtrlAVI_Show','GUICtrlAVI_Stop','GUICtrlButton_Click',
- 'GUICtrlButton_Create','GUICtrlButton_Destroy',
- 'GUICtrlButton_Enable','GUICtrlButton_GetCheck',
- 'GUICtrlButton_GetFocus','GUICtrlButton_GetIdealSize',
- 'GUICtrlButton_GetImage','GUICtrlButton_GetImageList',
- 'GUICtrlButton_GetState','GUICtrlButton_GetText',
- 'GUICtrlButton_GetTextMargin','GUICtrlButton_SetCheck',
- 'GUICtrlButton_SetFocus','GUICtrlButton_SetImage',
- 'GUICtrlButton_SetImageList','GUICtrlButton_SetSize',
- 'GUICtrlButton_SetState','GUICtrlButton_SetStyle',
- 'GUICtrlButton_SetText','GUICtrlButton_SetTextMargin',
- 'GUICtrlButton_Show','GUICtrlComboBox_AddDir',
- 'GUICtrlComboBox_AddString','GUICtrlComboBox_AutoComplete',
- 'GUICtrlComboBox_BeginUpdate','GUICtrlComboBox_Create',
- 'GUICtrlComboBox_DeleteString','GUICtrlComboBox_Destroy',
- 'GUICtrlComboBox_EndUpdate','GUICtrlComboBox_FindString',
- 'GUICtrlComboBox_FindStringExact','GUICtrlComboBox_GetComboBoxInfo',
- 'GUICtrlComboBox_GetCount','GUICtrlComboBox_GetCurSel',
- 'GUICtrlComboBox_GetDroppedControlRect',
- 'GUICtrlComboBox_GetDroppedControlRectEx',
- 'GUICtrlComboBox_GetDroppedState','GUICtrlComboBox_GetDroppedWidth',
- 'GUICtrlComboBox_GetEditSel','GUICtrlComboBox_GetEditText',
- 'GUICtrlComboBox_GetExtendedUI',
- 'GUICtrlComboBox_GetHorizontalExtent',
- 'GUICtrlComboBox_GetItemHeight','GUICtrlComboBox_GetLBText',
- 'GUICtrlComboBox_GetLBTextLen','GUICtrlComboBox_GetList',
- 'GUICtrlComboBox_GetListArray','GUICtrlComboBox_GetLocale',
- 'GUICtrlComboBox_GetLocaleCountry','GUICtrlComboBox_GetLocaleLang',
- 'GUICtrlComboBox_GetLocalePrimLang',
- 'GUICtrlComboBox_GetLocaleSubLang','GUICtrlComboBox_GetMinVisible',
- 'GUICtrlComboBox_GetTopIndex','GUICtrlComboBox_InitStorage',
- 'GUICtrlComboBox_InsertString','GUICtrlComboBox_LimitText',
- 'GUICtrlComboBox_ReplaceEditSel','GUICtrlComboBox_ResetContent',
- 'GUICtrlComboBox_SelectString','GUICtrlComboBox_SetCurSel',
- 'GUICtrlComboBox_SetDroppedWidth','GUICtrlComboBox_SetEditSel',
- 'GUICtrlComboBox_SetEditText','GUICtrlComboBox_SetExtendedUI',
- 'GUICtrlComboBox_SetHorizontalExtent',
- 'GUICtrlComboBox_SetItemHeight','GUICtrlComboBox_SetMinVisible',
- 'GUICtrlComboBox_SetTopIndex','GUICtrlComboBox_ShowDropDown',
- 'GUICtrlComboBoxEx_AddDir','GUICtrlComboBoxEx_AddString',
- 'GUICtrlComboBoxEx_BeginUpdate','GUICtrlComboBoxEx_Create',
- 'GUICtrlComboBoxEx_CreateSolidBitMap',
- 'GUICtrlComboBoxEx_DeleteString','GUICtrlComboBoxEx_Destroy',
- 'GUICtrlComboBoxEx_EndUpdate','GUICtrlComboBoxEx_FindStringExact',
- 'GUICtrlComboBoxEx_GetComboBoxInfo',
- 'GUICtrlComboBoxEx_GetComboControl','GUICtrlComboBoxEx_GetCount',
- 'GUICtrlComboBoxEx_GetCurSel',
- 'GUICtrlComboBoxEx_GetDroppedControlRect',
- 'GUICtrlComboBoxEx_GetDroppedControlRectEx',
- 'GUICtrlComboBoxEx_GetDroppedState',
- 'GUICtrlComboBoxEx_GetDroppedWidth',
- 'GUICtrlComboBoxEx_GetEditControl','GUICtrlComboBoxEx_GetEditSel',
- 'GUICtrlComboBoxEx_GetEditText',
- 'GUICtrlComboBoxEx_GetExtendedStyle',
- 'GUICtrlComboBoxEx_GetExtendedUI','GUICtrlComboBoxEx_GetImageList',
- 'GUICtrlComboBoxEx_GetItem','GUICtrlComboBoxEx_GetItemEx',
- 'GUICtrlComboBoxEx_GetItemHeight','GUICtrlComboBoxEx_GetItemImage',
- 'GUICtrlComboBoxEx_GetItemIndent',
- 'GUICtrlComboBoxEx_GetItemOverlayImage',
- 'GUICtrlComboBoxEx_GetItemParam',
- 'GUICtrlComboBoxEx_GetItemSelectedImage',
- 'GUICtrlComboBoxEx_GetItemText','GUICtrlComboBoxEx_GetItemTextLen',
- 'GUICtrlComboBoxEx_GetList','GUICtrlComboBoxEx_GetListArray',
- 'GUICtrlComboBoxEx_GetLocale','GUICtrlComboBoxEx_GetLocaleCountry',
- 'GUICtrlComboBoxEx_GetLocaleLang',
- 'GUICtrlComboBoxEx_GetLocalePrimLang',
- 'GUICtrlComboBoxEx_GetLocaleSubLang',
- 'GUICtrlComboBoxEx_GetMinVisible','GUICtrlComboBoxEx_GetTopIndex',
- 'GUICtrlComboBoxEx_InitStorage','GUICtrlComboBoxEx_InsertString',
- 'GUICtrlComboBoxEx_LimitText','GUICtrlComboBoxEx_ReplaceEditSel',
- 'GUICtrlComboBoxEx_ResetContent','GUICtrlComboBoxEx_SetCurSel',
- 'GUICtrlComboBoxEx_SetDroppedWidth','GUICtrlComboBoxEx_SetEditSel',
- 'GUICtrlComboBoxEx_SetEditText',
- 'GUICtrlComboBoxEx_SetExtendedStyle',
- 'GUICtrlComboBoxEx_SetExtendedUI','GUICtrlComboBoxEx_SetImageList',
- 'GUICtrlComboBoxEx_SetItem','GUICtrlComboBoxEx_SetItemEx',
- 'GUICtrlComboBoxEx_SetItemHeight','GUICtrlComboBoxEx_SetItemImage',
- 'GUICtrlComboBoxEx_SetItemIndent',
- 'GUICtrlComboBoxEx_SetItemOverlayImage',
- 'GUICtrlComboBoxEx_SetItemParam',
- 'GUICtrlComboBoxEx_SetItemSelectedImage',
- 'GUICtrlComboBoxEx_SetMinVisible','GUICtrlComboBoxEx_SetTopIndex',
- 'GUICtrlComboBoxEx_ShowDropDown','GUICtrlDTP_Create',
- 'GUICtrlDTP_Destroy','GUICtrlDTP_GetMCColor','GUICtrlDTP_GetMCFont',
- 'GUICtrlDTP_GetMonthCal','GUICtrlDTP_GetRange',
- 'GUICtrlDTP_GetRangeEx','GUICtrlDTP_GetSystemTime',
- 'GUICtrlDTP_GetSystemTimeEx','GUICtrlDTP_SetFormat',
- 'GUICtrlDTP_SetMCColor','GUICtrlDTP_SetMCFont',
- 'GUICtrlDTP_SetRange','GUICtrlDTP_SetRangeEx',
- 'GUICtrlDTP_SetSystemTime','GUICtrlDTP_SetSystemTimeEx',
- 'GUICtrlEdit_AppendText','GUICtrlEdit_BeginUpdate',
- 'GUICtrlEdit_CanUndo','GUICtrlEdit_CharFromPos',
- 'GUICtrlEdit_Create','GUICtrlEdit_Destroy',
- 'GUICtrlEdit_EmptyUndoBuffer','GUICtrlEdit_EndUpdate',
- 'GUICtrlEdit_Find','GUICtrlEdit_FmtLines',
- 'GUICtrlEdit_GetFirstVisibleLine','GUICtrlEdit_GetLimitText',
- 'GUICtrlEdit_GetLine','GUICtrlEdit_GetLineCount',
- 'GUICtrlEdit_GetMargins','GUICtrlEdit_GetModify',
- 'GUICtrlEdit_GetPasswordChar','GUICtrlEdit_GetRECT',
- 'GUICtrlEdit_GetRECTEx','GUICtrlEdit_GetSel','GUICtrlEdit_GetText',
- 'GUICtrlEdit_GetTextLen','GUICtrlEdit_HideBalloonTip',
- 'GUICtrlEdit_InsertText','GUICtrlEdit_LineFromChar',
- 'GUICtrlEdit_LineIndex','GUICtrlEdit_LineLength',
- 'GUICtrlEdit_LineScroll','GUICtrlEdit_PosFromChar',
- 'GUICtrlEdit_ReplaceSel','GUICtrlEdit_Scroll',
- 'GUICtrlEdit_SetLimitText','GUICtrlEdit_SetMargins',
- 'GUICtrlEdit_SetModify','GUICtrlEdit_SetPasswordChar',
- 'GUICtrlEdit_SetReadOnly','GUICtrlEdit_SetRECT',
- 'GUICtrlEdit_SetRECTEx','GUICtrlEdit_SetRECTNP',
- 'GUICtrlEdit_SetRectNPEx','GUICtrlEdit_SetSel',
- 'GUICtrlEdit_SetTabStops','GUICtrlEdit_SetText',
- 'GUICtrlEdit_ShowBalloonTip','GUICtrlEdit_Undo',
- 'GUICtrlHeader_AddItem','GUICtrlHeader_ClearFilter',
- 'GUICtrlHeader_ClearFilterAll','GUICtrlHeader_Create',
- 'GUICtrlHeader_CreateDragImage','GUICtrlHeader_DeleteItem',
- 'GUICtrlHeader_Destroy','GUICtrlHeader_EditFilter',
- 'GUICtrlHeader_GetBitmapMargin','GUICtrlHeader_GetImageList',
- 'GUICtrlHeader_GetItem','GUICtrlHeader_GetItemAlign',
- 'GUICtrlHeader_GetItemBitmap','GUICtrlHeader_GetItemCount',
- 'GUICtrlHeader_GetItemDisplay','GUICtrlHeader_GetItemFlags',
- 'GUICtrlHeader_GetItemFormat','GUICtrlHeader_GetItemImage',
- 'GUICtrlHeader_GetItemOrder','GUICtrlHeader_GetItemParam',
- 'GUICtrlHeader_GetItemRect','GUICtrlHeader_GetItemRectEx',
- 'GUICtrlHeader_GetItemText','GUICtrlHeader_GetItemWidth',
- 'GUICtrlHeader_GetOrderArray','GUICtrlHeader_GetUnicodeFormat',
- 'GUICtrlHeader_HitTest','GUICtrlHeader_InsertItem',
- 'GUICtrlHeader_Layout','GUICtrlHeader_OrderToIndex',
- 'GUICtrlHeader_SetBitmapMargin',
- 'GUICtrlHeader_SetFilterChangeTimeout',
- 'GUICtrlHeader_SetHotDivider','GUICtrlHeader_SetImageList',
- 'GUICtrlHeader_SetItem','GUICtrlHeader_SetItemAlign',
- 'GUICtrlHeader_SetItemBitmap','GUICtrlHeader_SetItemDisplay',
- 'GUICtrlHeader_SetItemFlags','GUICtrlHeader_SetItemFormat',
- 'GUICtrlHeader_SetItemImage','GUICtrlHeader_SetItemOrder',
- 'GUICtrlHeader_SetItemParam','GUICtrlHeader_SetItemText',
- 'GUICtrlHeader_SetItemWidth','GUICtrlHeader_SetOrderArray',
- 'GUICtrlHeader_SetUnicodeFormat','GUICtrlIpAddress_ClearAddress',
- 'GUICtrlIpAddress_Create','GUICtrlIpAddress_Destroy',
- 'GUICtrlIpAddress_Get','GUICtrlIpAddress_GetArray',
- 'GUICtrlIpAddress_GetEx','GUICtrlIpAddress_IsBlank',
- 'GUICtrlIpAddress_Set','GUICtrlIpAddress_SetArray',
- 'GUICtrlIpAddress_SetEx','GUICtrlIpAddress_SetFocus',
- 'GUICtrlIpAddress_SetFont','GUICtrlIpAddress_SetRange',
- 'GUICtrlIpAddress_ShowHide','GUICtrlListBox_AddFile',
- 'GUICtrlListBox_AddString','GUICtrlListBox_BeginUpdate',
- 'GUICtrlListBox_Create','GUICtrlListBox_DeleteString',
- 'GUICtrlListBox_Destroy','GUICtrlListBox_Dir',
- 'GUICtrlListBox_EndUpdate','GUICtrlListBox_FindInText',
- 'GUICtrlListBox_FindString','GUICtrlListBox_GetAnchorIndex',
- 'GUICtrlListBox_GetCaretIndex','GUICtrlListBox_GetCount',
- 'GUICtrlListBox_GetCurSel','GUICtrlListBox_GetHorizontalExtent',
- 'GUICtrlListBox_GetItemData','GUICtrlListBox_GetItemHeight',
- 'GUICtrlListBox_GetItemRect','GUICtrlListBox_GetItemRectEx',
- 'GUICtrlListBox_GetListBoxInfo','GUICtrlListBox_GetLocale',
- 'GUICtrlListBox_GetLocaleCountry','GUICtrlListBox_GetLocaleLang',
- 'GUICtrlListBox_GetLocalePrimLang',
- 'GUICtrlListBox_GetLocaleSubLang','GUICtrlListBox_GetSel',
- 'GUICtrlListBox_GetSelCount','GUICtrlListBox_GetSelItems',
- 'GUICtrlListBox_GetSelItemsText','GUICtrlListBox_GetText',
- 'GUICtrlListBox_GetTextLen','GUICtrlListBox_GetTopIndex',
- 'GUICtrlListBox_InitStorage','GUICtrlListBox_InsertString',
- 'GUICtrlListBox_ItemFromPoint','GUICtrlListBox_ReplaceString',
- 'GUICtrlListBox_ResetContent','GUICtrlListBox_SelectString',
- 'GUICtrlListBox_SelItemRange','GUICtrlListBox_SelItemRangeEx',
- 'GUICtrlListBox_SetAnchorIndex','GUICtrlListBox_SetCaretIndex',
- 'GUICtrlListBox_SetColumnWidth','GUICtrlListBox_SetCurSel',
- 'GUICtrlListBox_SetHorizontalExtent','GUICtrlListBox_SetItemData',
- 'GUICtrlListBox_SetItemHeight','GUICtrlListBox_SetLocale',
- 'GUICtrlListBox_SetSel','GUICtrlListBox_SetTabStops',
- 'GUICtrlListBox_SetTopIndex','GUICtrlListBox_Sort',
- 'GUICtrlListBox_SwapString','GUICtrlListBox_UpdateHScroll',
- 'GUICtrlListView_AddArray','GUICtrlListView_AddColumn',
- 'GUICtrlListView_AddItem','GUICtrlListView_AddSubItem',
- 'GUICtrlListView_ApproximateViewHeight',
- 'GUICtrlListView_ApproximateViewRect',
- 'GUICtrlListView_ApproximateViewWidth','GUICtrlListView_Arrange',
- 'GUICtrlListView_BeginUpdate','GUICtrlListView_CancelEditLabel',
- 'GUICtrlListView_ClickItem','GUICtrlListView_CopyItems',
- 'GUICtrlListView_Create','GUICtrlListView_CreateDragImage',
- 'GUICtrlListView_CreateSolidBitMap',
- 'GUICtrlListView_DeleteAllItems','GUICtrlListView_DeleteColumn',
- 'GUICtrlListView_DeleteItem','GUICtrlListView_DeleteItemsSelected',
- 'GUICtrlListView_Destroy','GUICtrlListView_DrawDragImage',
- 'GUICtrlListView_EditLabel','GUICtrlListView_EnableGroupView',
- 'GUICtrlListView_EndUpdate','GUICtrlListView_EnsureVisible',
- 'GUICtrlListView_FindInText','GUICtrlListView_FindItem',
- 'GUICtrlListView_FindNearest','GUICtrlListView_FindParam',
- 'GUICtrlListView_FindText','GUICtrlListView_GetBkColor',
- 'GUICtrlListView_GetBkImage','GUICtrlListView_GetCallbackMask',
- 'GUICtrlListView_GetColumn','GUICtrlListView_GetColumnCount',
- 'GUICtrlListView_GetColumnOrder',
- 'GUICtrlListView_GetColumnOrderArray',
- 'GUICtrlListView_GetColumnWidth','GUICtrlListView_GetCounterPage',
- 'GUICtrlListView_GetEditControl',
- 'GUICtrlListView_GetExtendedListViewStyle',
- 'GUICtrlListView_GetGroupInfo',
- 'GUICtrlListView_GetGroupViewEnabled','GUICtrlListView_GetHeader',
- 'GUICtrlListView_GetHotCursor','GUICtrlListView_GetHotItem',
- 'GUICtrlListView_GetHoverTime','GUICtrlListView_GetImageList',
- 'GUICtrlListView_GetISearchString','GUICtrlListView_GetItem',
- 'GUICtrlListView_GetItemChecked','GUICtrlListView_GetItemCount',
- 'GUICtrlListView_GetItemCut','GUICtrlListView_GetItemDropHilited',
- 'GUICtrlListView_GetItemEx','GUICtrlListView_GetItemFocused',
- 'GUICtrlListView_GetItemGroupID','GUICtrlListView_GetItemImage',
- 'GUICtrlListView_GetItemIndent','GUICtrlListView_GetItemParam',
- 'GUICtrlListView_GetItemPosition',
- 'GUICtrlListView_GetItemPositionX',
- 'GUICtrlListView_GetItemPositionY','GUICtrlListView_GetItemRect',
- 'GUICtrlListView_GetItemRectEx','GUICtrlListView_GetItemSelected',
- 'GUICtrlListView_GetItemSpacing','GUICtrlListView_GetItemSpacingX',
- 'GUICtrlListView_GetItemSpacingY','GUICtrlListView_GetItemState',
- 'GUICtrlListView_GetItemStateImage','GUICtrlListView_GetItemText',
- 'GUICtrlListView_GetItemTextArray',
- 'GUICtrlListView_GetItemTextString','GUICtrlListView_GetNextItem',
- 'GUICtrlListView_GetNumberOfWorkAreas','GUICtrlListView_GetOrigin',
- 'GUICtrlListView_GetOriginX','GUICtrlListView_GetOriginY',
- 'GUICtrlListView_GetOutlineColor',
- 'GUICtrlListView_GetSelectedColumn',
- 'GUICtrlListView_GetSelectedCount',
- 'GUICtrlListView_GetSelectedIndices',
- 'GUICtrlListView_GetSelectionMark','GUICtrlListView_GetStringWidth',
- 'GUICtrlListView_GetSubItemRect','GUICtrlListView_GetTextBkColor',
- 'GUICtrlListView_GetTextColor','GUICtrlListView_GetToolTips',
- 'GUICtrlListView_GetTopIndex','GUICtrlListView_GetUnicodeFormat',
- 'GUICtrlListView_GetView','GUICtrlListView_GetViewDetails',
- 'GUICtrlListView_GetViewLarge','GUICtrlListView_GetViewList',
- 'GUICtrlListView_GetViewRect','GUICtrlListView_GetViewSmall',
- 'GUICtrlListView_GetViewTile','GUICtrlListView_HideColumn',
- 'GUICtrlListView_HitTest','GUICtrlListView_InsertColumn',
- 'GUICtrlListView_InsertGroup','GUICtrlListView_InsertItem',
- 'GUICtrlListView_JustifyColumn','GUICtrlListView_MapIDToIndex',
- 'GUICtrlListView_MapIndexToID','GUICtrlListView_RedrawItems',
- 'GUICtrlListView_RegisterSortCallBack',
- 'GUICtrlListView_RemoveAllGroups','GUICtrlListView_RemoveGroup',
- 'GUICtrlListView_Scroll','GUICtrlListView_SetBkColor',
- 'GUICtrlListView_SetBkImage','GUICtrlListView_SetCallBackMask',
- 'GUICtrlListView_SetColumn','GUICtrlListView_SetColumnOrder',
- 'GUICtrlListView_SetColumnOrderArray',
- 'GUICtrlListView_SetColumnWidth',
- 'GUICtrlListView_SetExtendedListViewStyle',
- 'GUICtrlListView_SetGroupInfo','GUICtrlListView_SetHotItem',
- 'GUICtrlListView_SetHoverTime','GUICtrlListView_SetIconSpacing',
- 'GUICtrlListView_SetImageList','GUICtrlListView_SetItem',
- 'GUICtrlListView_SetItemChecked','GUICtrlListView_SetItemCount',
- 'GUICtrlListView_SetItemCut','GUICtrlListView_SetItemDropHilited',
- 'GUICtrlListView_SetItemEx','GUICtrlListView_SetItemFocused',
- 'GUICtrlListView_SetItemGroupID','GUICtrlListView_SetItemImage',
- 'GUICtrlListView_SetItemIndent','GUICtrlListView_SetItemParam',
- 'GUICtrlListView_SetItemPosition',
- 'GUICtrlListView_SetItemPosition32',
- 'GUICtrlListView_SetItemSelected','GUICtrlListView_SetItemState',
- 'GUICtrlListView_SetItemStateImage','GUICtrlListView_SetItemText',
- 'GUICtrlListView_SetOutlineColor',
- 'GUICtrlListView_SetSelectedColumn',
- 'GUICtrlListView_SetSelectionMark','GUICtrlListView_SetTextBkColor',
- 'GUICtrlListView_SetTextColor','GUICtrlListView_SetToolTips',
- 'GUICtrlListView_SetUnicodeFormat','GUICtrlListView_SetView',
- 'GUICtrlListView_SetWorkAreas','GUICtrlListView_SimpleSort',
- 'GUICtrlListView_SortItems','GUICtrlListView_SubItemHitTest',
- 'GUICtrlListView_UnRegisterSortCallBack',
- 'GUICtrlMenu_AddMenuItem','GUICtrlMenu_AppendMenu',
- 'GUICtrlMenu_CheckMenuItem','GUICtrlMenu_CheckRadioItem',
- 'GUICtrlMenu_CreateMenu','GUICtrlMenu_CreatePopup',
- 'GUICtrlMenu_DeleteMenu','GUICtrlMenu_DestroyMenu',
- 'GUICtrlMenu_DrawMenuBar','GUICtrlMenu_EnableMenuItem',
- 'GUICtrlMenu_FindItem','GUICtrlMenu_FindParent',
- 'GUICtrlMenu_GetItemBmp','GUICtrlMenu_GetItemBmpChecked',
- 'GUICtrlMenu_GetItemBmpUnchecked','GUICtrlMenu_GetItemChecked',
- 'GUICtrlMenu_GetItemCount','GUICtrlMenu_GetItemData',
- 'GUICtrlMenu_GetItemDefault','GUICtrlMenu_GetItemDisabled',
- 'GUICtrlMenu_GetItemEnabled','GUICtrlMenu_GetItemGrayed',
- 'GUICtrlMenu_GetItemHighlighted','GUICtrlMenu_GetItemID',
- 'GUICtrlMenu_GetItemInfo','GUICtrlMenu_GetItemRect',
- 'GUICtrlMenu_GetItemRectEx','GUICtrlMenu_GetItemState',
- 'GUICtrlMenu_GetItemStateEx','GUICtrlMenu_GetItemSubMenu',
- 'GUICtrlMenu_GetItemText','GUICtrlMenu_GetItemType',
- 'GUICtrlMenu_GetMenu','GUICtrlMenu_GetMenuBackground',
- 'GUICtrlMenu_GetMenuBarInfo','GUICtrlMenu_GetMenuContextHelpID',
- 'GUICtrlMenu_GetMenuData','GUICtrlMenu_GetMenuDefaultItem',
- 'GUICtrlMenu_GetMenuHeight','GUICtrlMenu_GetMenuInfo',
- 'GUICtrlMenu_GetMenuStyle','GUICtrlMenu_GetSystemMenu',
- 'GUICtrlMenu_InsertMenuItem','GUICtrlMenu_InsertMenuItemEx',
- 'GUICtrlMenu_IsMenu','GUICtrlMenu_LoadMenu',
- 'GUICtrlMenu_MapAccelerator','GUICtrlMenu_MenuItemFromPoint',
- 'GUICtrlMenu_RemoveMenu','GUICtrlMenu_SetItemBitmaps',
- 'GUICtrlMenu_SetItemBmp','GUICtrlMenu_SetItemBmpChecked',
- 'GUICtrlMenu_SetItemBmpUnchecked','GUICtrlMenu_SetItemChecked',
- 'GUICtrlMenu_SetItemData','GUICtrlMenu_SetItemDefault',
- 'GUICtrlMenu_SetItemDisabled','GUICtrlMenu_SetItemEnabled',
- 'GUICtrlMenu_SetItemGrayed','GUICtrlMenu_SetItemHighlighted',
- 'GUICtrlMenu_SetItemID','GUICtrlMenu_SetItemInfo',
- 'GUICtrlMenu_SetItemState','GUICtrlMenu_SetItemSubMenu',
- 'GUICtrlMenu_SetItemText','GUICtrlMenu_SetItemType',
- 'GUICtrlMenu_SetMenu','GUICtrlMenu_SetMenuBackground',
- 'GUICtrlMenu_SetMenuContextHelpID','GUICtrlMenu_SetMenuData',
- 'GUICtrlMenu_SetMenuDefaultItem','GUICtrlMenu_SetMenuHeight',
- 'GUICtrlMenu_SetMenuInfo','GUICtrlMenu_SetMenuStyle',
- 'GUICtrlMenu_TrackPopupMenu','GUICtrlMonthCal_Create',
- 'GUICtrlMonthCal_Destroy','GUICtrlMonthCal_GetColor',
- 'GUICtrlMonthCal_GetColorArray','GUICtrlMonthCal_GetCurSel',
- 'GUICtrlMonthCal_GetCurSelStr','GUICtrlMonthCal_GetFirstDOW',
- 'GUICtrlMonthCal_GetFirstDOWStr','GUICtrlMonthCal_GetMaxSelCount',
- 'GUICtrlMonthCal_GetMaxTodayWidth',
- 'GUICtrlMonthCal_GetMinReqHeight','GUICtrlMonthCal_GetMinReqRect',
- 'GUICtrlMonthCal_GetMinReqRectArray',
- 'GUICtrlMonthCal_GetMinReqWidth','GUICtrlMonthCal_GetMonthDelta',
- 'GUICtrlMonthCal_GetMonthRange','GUICtrlMonthCal_GetMonthRangeMax',
- 'GUICtrlMonthCal_GetMonthRangeMaxStr',
- 'GUICtrlMonthCal_GetMonthRangeMin',
- 'GUICtrlMonthCal_GetMonthRangeMinStr',
- 'GUICtrlMonthCal_GetMonthRangeSpan','GUICtrlMonthCal_GetRange',
- 'GUICtrlMonthCal_GetRangeMax','GUICtrlMonthCal_GetRangeMaxStr',
- 'GUICtrlMonthCal_GetRangeMin','GUICtrlMonthCal_GetRangeMinStr',
- 'GUICtrlMonthCal_GetSelRange','GUICtrlMonthCal_GetSelRangeMax',
- 'GUICtrlMonthCal_GetSelRangeMaxStr',
- 'GUICtrlMonthCal_GetSelRangeMin',
- 'GUICtrlMonthCal_GetSelRangeMinStr','GUICtrlMonthCal_GetToday',
- 'GUICtrlMonthCal_GetTodayStr','GUICtrlMonthCal_GetUnicodeFormat',
- 'GUICtrlMonthCal_HitTest','GUICtrlMonthCal_SetColor',
- 'GUICtrlMonthCal_SetCurSel','GUICtrlMonthCal_SetDayState',
- 'GUICtrlMonthCal_SetFirstDOW','GUICtrlMonthCal_SetMaxSelCount',
- 'GUICtrlMonthCal_SetMonthDelta','GUICtrlMonthCal_SetRange',
- 'GUICtrlMonthCal_SetSelRange','GUICtrlMonthCal_SetToday',
- 'GUICtrlMonthCal_SetUnicodeFormat','GUICtrlRebar_AddBand',
- 'GUICtrlRebar_AddToolBarBand','GUICtrlRebar_BeginDrag',
- 'GUICtrlRebar_Create','GUICtrlRebar_DeleteBand',
- 'GUICtrlRebar_Destroy','GUICtrlRebar_DragMove',
- 'GUICtrlRebar_EndDrag','GUICtrlRebar_GetBandBackColor',
- 'GUICtrlRebar_GetBandBorders','GUICtrlRebar_GetBandBordersEx',
- 'GUICtrlRebar_GetBandChildHandle','GUICtrlRebar_GetBandChildSize',
- 'GUICtrlRebar_GetBandCount','GUICtrlRebar_GetBandForeColor',
- 'GUICtrlRebar_GetBandHeaderSize','GUICtrlRebar_GetBandID',
- 'GUICtrlRebar_GetBandIdealSize','GUICtrlRebar_GetBandLength',
- 'GUICtrlRebar_GetBandLParam','GUICtrlRebar_GetBandMargins',
- 'GUICtrlRebar_GetBandMarginsEx','GUICtrlRebar_GetBandRect',
- 'GUICtrlRebar_GetBandRectEx','GUICtrlRebar_GetBandStyle',
- 'GUICtrlRebar_GetBandStyleBreak',
- 'GUICtrlRebar_GetBandStyleChildEdge',
- 'GUICtrlRebar_GetBandStyleFixedBMP',
- 'GUICtrlRebar_GetBandStyleFixedSize',
- 'GUICtrlRebar_GetBandStyleGripperAlways',
- 'GUICtrlRebar_GetBandStyleHidden',
- 'GUICtrlRebar_GetBandStyleHideTitle',
- 'GUICtrlRebar_GetBandStyleNoGripper',
- 'GUICtrlRebar_GetBandStyleTopAlign',
- 'GUICtrlRebar_GetBandStyleUseChevron',
- 'GUICtrlRebar_GetBandStyleVariableHeight',
- 'GUICtrlRebar_GetBandText','GUICtrlRebar_GetBarHeight',
- 'GUICtrlRebar_GetBKColor','GUICtrlRebar_GetColorScheme',
- 'GUICtrlRebar_GetRowCount','GUICtrlRebar_GetRowHeight',
- 'GUICtrlRebar_GetTextColor','GUICtrlRebar_GetToolTips',
- 'GUICtrlRebar_GetUnicodeFormat','GUICtrlRebar_HitTest',
- 'GUICtrlRebar_IDToIndex','GUICtrlRebar_MaximizeBand',
- 'GUICtrlRebar_MinimizeBand','GUICtrlRebar_MoveBand',
- 'GUICtrlRebar_SetBandBackColor','GUICtrlRebar_SetBandForeColor',
- 'GUICtrlRebar_SetBandHeaderSize','GUICtrlRebar_SetBandID',
- 'GUICtrlRebar_SetBandIdealSize','GUICtrlRebar_SetBandLength',
- 'GUICtrlRebar_SetBandLParam','GUICtrlRebar_SetBandStyle',
- 'GUICtrlRebar_SetBandStyleBreak',
- 'GUICtrlRebar_SetBandStyleChildEdge',
- 'GUICtrlRebar_SetBandStyleFixedBMP',
- 'GUICtrlRebar_SetBandStyleFixedSize',
- 'GUICtrlRebar_SetBandStyleGripperAlways',
- 'GUICtrlRebar_SetBandStyleHidden',
- 'GUICtrlRebar_SetBandStyleHideTitle',
- 'GUICtrlRebar_SetBandStyleNoGripper',
- 'GUICtrlRebar_SetBandStyleTopAlign',
- 'GUICtrlRebar_SetBandStyleUseChevron',
- 'GUICtrlRebar_SetBandStyleVariableHeight',
- 'GUICtrlRebar_SetBandText','GUICtrlRebar_SetBKColor',
- 'GUICtrlRebar_SetColorScheme','GUICtrlRebar_SetTextColor',
- 'GUICtrlRebar_SetToolTips','GUICtrlRebar_SetUnicodeFormat',
- 'GUICtrlRebar_ShowBand','GUICtrlSlider_ClearSel',
- 'GUICtrlSlider_ClearTics','GUICtrlSlider_Create',
- 'GUICtrlSlider_Destroy','GUICtrlSlider_GetBuddy',
- 'GUICtrlSlider_GetChannelRect','GUICtrlSlider_GetLineSize',
- 'GUICtrlSlider_GetNumTics','GUICtrlSlider_GetPageSize',
- 'GUICtrlSlider_GetPos','GUICtrlSlider_GetPTics',
- 'GUICtrlSlider_GetRange','GUICtrlSlider_GetRangeMax',
- 'GUICtrlSlider_GetRangeMin','GUICtrlSlider_GetSel',
- 'GUICtrlSlider_GetSelEnd','GUICtrlSlider_GetSelStart',
- 'GUICtrlSlider_GetThumbLength','GUICtrlSlider_GetThumbRect',
- 'GUICtrlSlider_GetThumbRectEx','GUICtrlSlider_GetTic',
- 'GUICtrlSlider_GetTicPos','GUICtrlSlider_GetToolTips',
- 'GUICtrlSlider_GetUnicodeFormat','GUICtrlSlider_SetBuddy',
- 'GUICtrlSlider_SetLineSize','GUICtrlSlider_SetPageSize',
- 'GUICtrlSlider_SetPos','GUICtrlSlider_SetRange',
- 'GUICtrlSlider_SetRangeMax','GUICtrlSlider_SetRangeMin',
- 'GUICtrlSlider_SetSel','GUICtrlSlider_SetSelEnd',
- 'GUICtrlSlider_SetSelStart','GUICtrlSlider_SetThumbLength',
- 'GUICtrlSlider_SetTic','GUICtrlSlider_SetTicFreq',
- 'GUICtrlSlider_SetTipSide','GUICtrlSlider_SetToolTips',
- 'GUICtrlSlider_SetUnicodeFormat','GUICtrlStatusBar_Create',
- 'GUICtrlStatusBar_Destroy','GUICtrlStatusBar_EmbedControl',
- 'GUICtrlStatusBar_GetBorders','GUICtrlStatusBar_GetBordersHorz',
- 'GUICtrlStatusBar_GetBordersRect','GUICtrlStatusBar_GetBordersVert',
- 'GUICtrlStatusBar_GetCount','GUICtrlStatusBar_GetHeight',
- 'GUICtrlStatusBar_GetIcon','GUICtrlStatusBar_GetParts',
- 'GUICtrlStatusBar_GetRect','GUICtrlStatusBar_GetRectEx',
- 'GUICtrlStatusBar_GetText','GUICtrlStatusBar_GetTextFlags',
- 'GUICtrlStatusBar_GetTextLength','GUICtrlStatusBar_GetTextLengthEx',
- 'GUICtrlStatusBar_GetTipText','GUICtrlStatusBar_GetUnicodeFormat',
- 'GUICtrlStatusBar_GetWidth','GUICtrlStatusBar_IsSimple',
- 'GUICtrlStatusBar_Resize','GUICtrlStatusBar_SetBkColor',
- 'GUICtrlStatusBar_SetIcon','GUICtrlStatusBar_SetMinHeight',
- 'GUICtrlStatusBar_SetParts','GUICtrlStatusBar_SetSimple',
- 'GUICtrlStatusBar_SetText','GUICtrlStatusBar_SetTipText',
- 'GUICtrlStatusBar_SetUnicodeFormat','GUICtrlStatusBar_ShowHide',
- 'GUICtrlTab_Create','GUICtrlTab_DeleteAllItems',
- 'GUICtrlTab_DeleteItem','GUICtrlTab_DeselectAll',
- 'GUICtrlTab_Destroy','GUICtrlTab_FindTab','GUICtrlTab_GetCurFocus',
- 'GUICtrlTab_GetCurSel','GUICtrlTab_GetDisplayRect',
- 'GUICtrlTab_GetDisplayRectEx','GUICtrlTab_GetExtendedStyle',
- 'GUICtrlTab_GetImageList','GUICtrlTab_GetItem',
- 'GUICtrlTab_GetItemCount','GUICtrlTab_GetItemImage',
- 'GUICtrlTab_GetItemParam','GUICtrlTab_GetItemRect',
- 'GUICtrlTab_GetItemRectEx','GUICtrlTab_GetItemState',
- 'GUICtrlTab_GetItemText','GUICtrlTab_GetRowCount',
- 'GUICtrlTab_GetToolTips','GUICtrlTab_GetUnicodeFormat',
- 'GUICtrlTab_HighlightItem','GUICtrlTab_HitTest',
- 'GUICtrlTab_InsertItem','GUICtrlTab_RemoveImage',
- 'GUICtrlTab_SetCurFocus','GUICtrlTab_SetCurSel',
- 'GUICtrlTab_SetExtendedStyle','GUICtrlTab_SetImageList',
- 'GUICtrlTab_SetItem','GUICtrlTab_SetItemImage',
- 'GUICtrlTab_SetItemParam','GUICtrlTab_SetItemSize',
- 'GUICtrlTab_SetItemState','GUICtrlTab_SetItemText',
- 'GUICtrlTab_SetMinTabWidth','GUICtrlTab_SetPadding',
- 'GUICtrlTab_SetToolTips','GUICtrlTab_SetUnicodeFormat',
- 'GUICtrlToolbar_AddBitmap','GUICtrlToolbar_AddButton',
- 'GUICtrlToolbar_AddButtonSep','GUICtrlToolbar_AddString',
- 'GUICtrlToolbar_ButtonCount','GUICtrlToolbar_CheckButton',
- 'GUICtrlToolbar_ClickAccel','GUICtrlToolbar_ClickButton',
- 'GUICtrlToolbar_ClickIndex','GUICtrlToolbar_CommandToIndex',
- 'GUICtrlToolbar_Create','GUICtrlToolbar_Customize',
- 'GUICtrlToolbar_DeleteButton','GUICtrlToolbar_Destroy',
- 'GUICtrlToolbar_EnableButton','GUICtrlToolbar_FindToolbar',
- 'GUICtrlToolbar_GetAnchorHighlight','GUICtrlToolbar_GetBitmapFlags',
- 'GUICtrlToolbar_GetButtonBitmap','GUICtrlToolbar_GetButtonInfo',
- 'GUICtrlToolbar_GetButtonInfoEx','GUICtrlToolbar_GetButtonParam',
- 'GUICtrlToolbar_GetButtonRect','GUICtrlToolbar_GetButtonRectEx',
- 'GUICtrlToolbar_GetButtonSize','GUICtrlToolbar_GetButtonState',
- 'GUICtrlToolbar_GetButtonStyle','GUICtrlToolbar_GetButtonText',
- 'GUICtrlToolbar_GetColorScheme',
- 'GUICtrlToolbar_GetDisabledImageList',
- 'GUICtrlToolbar_GetExtendedStyle','GUICtrlToolbar_GetHotImageList',
- 'GUICtrlToolbar_GetHotItem','GUICtrlToolbar_GetImageList',
- 'GUICtrlToolbar_GetInsertMark','GUICtrlToolbar_GetInsertMarkColor',
- 'GUICtrlToolbar_GetMaxSize','GUICtrlToolbar_GetMetrics',
- 'GUICtrlToolbar_GetPadding','GUICtrlToolbar_GetRows',
- 'GUICtrlToolbar_GetString','GUICtrlToolbar_GetStyle',
- 'GUICtrlToolbar_GetStyleAltDrag',
- 'GUICtrlToolbar_GetStyleCustomErase','GUICtrlToolbar_GetStyleFlat',
- 'GUICtrlToolbar_GetStyleList','GUICtrlToolbar_GetStyleRegisterDrop',
- 'GUICtrlToolbar_GetStyleToolTips',
- 'GUICtrlToolbar_GetStyleTransparent',
- 'GUICtrlToolbar_GetStyleWrapable','GUICtrlToolbar_GetTextRows',
- 'GUICtrlToolbar_GetToolTips','GUICtrlToolbar_GetUnicodeFormat',
- 'GUICtrlToolbar_HideButton','GUICtrlToolbar_HighlightButton',
- 'GUICtrlToolbar_HitTest','GUICtrlToolbar_IndexToCommand',
- 'GUICtrlToolbar_InsertButton','GUICtrlToolbar_InsertMarkHitTest',
- 'GUICtrlToolbar_IsButtonChecked','GUICtrlToolbar_IsButtonEnabled',
- 'GUICtrlToolbar_IsButtonHidden',
- 'GUICtrlToolbar_IsButtonHighlighted',
- 'GUICtrlToolbar_IsButtonIndeterminate',
- 'GUICtrlToolbar_IsButtonPressed','GUICtrlToolbar_LoadBitmap',
- 'GUICtrlToolbar_LoadImages','GUICtrlToolbar_MapAccelerator',
- 'GUICtrlToolbar_MoveButton','GUICtrlToolbar_PressButton',
- 'GUICtrlToolbar_SetAnchorHighlight','GUICtrlToolbar_SetBitmapSize',
- 'GUICtrlToolbar_SetButtonBitMap','GUICtrlToolbar_SetButtonInfo',
- 'GUICtrlToolbar_SetButtonInfoEx','GUICtrlToolbar_SetButtonParam',
- 'GUICtrlToolbar_SetButtonSize','GUICtrlToolbar_SetButtonState',
- 'GUICtrlToolbar_SetButtonStyle','GUICtrlToolbar_SetButtonText',
- 'GUICtrlToolbar_SetButtonWidth','GUICtrlToolbar_SetCmdID',
- 'GUICtrlToolbar_SetColorScheme',
- 'GUICtrlToolbar_SetDisabledImageList',
- 'GUICtrlToolbar_SetDrawTextFlags','GUICtrlToolbar_SetExtendedStyle',
- 'GUICtrlToolbar_SetHotImageList','GUICtrlToolbar_SetHotItem',
- 'GUICtrlToolbar_SetImageList','GUICtrlToolbar_SetIndent',
- 'GUICtrlToolbar_SetIndeterminate','GUICtrlToolbar_SetInsertMark',
- 'GUICtrlToolbar_SetInsertMarkColor','GUICtrlToolbar_SetMaxTextRows',
- 'GUICtrlToolbar_SetMetrics','GUICtrlToolbar_SetPadding',
- 'GUICtrlToolbar_SetParent','GUICtrlToolbar_SetRows',
- 'GUICtrlToolbar_SetStyle','GUICtrlToolbar_SetStyleAltDrag',
- 'GUICtrlToolbar_SetStyleCustomErase','GUICtrlToolbar_SetStyleFlat',
- 'GUICtrlToolbar_SetStyleList','GUICtrlToolbar_SetStyleRegisterDrop',
- 'GUICtrlToolbar_SetStyleToolTips',
- 'GUICtrlToolbar_SetStyleTransparent',
- 'GUICtrlToolbar_SetStyleWrapable','GUICtrlToolbar_SetToolTips',
- 'GUICtrlToolbar_SetUnicodeFormat','GUICtrlToolbar_SetWindowTheme',
- 'GUICtrlTreeView_Add','GUICtrlTreeView_AddChild',
- 'GUICtrlTreeView_AddChildFirst','GUICtrlTreeView_AddFirst',
- 'GUICtrlTreeView_BeginUpdate','GUICtrlTreeView_ClickItem',
- 'GUICtrlTreeView_Create','GUICtrlTreeView_CreateDragImage',
- 'GUICtrlTreeView_CreateSolidBitMap','GUICtrlTreeView_Delete',
- 'GUICtrlTreeView_DeleteAll','GUICtrlTreeView_DeleteChildren',
- 'GUICtrlTreeView_Destroy','GUICtrlTreeView_DisplayRect',
- 'GUICtrlTreeView_DisplayRectEx','GUICtrlTreeView_EditText',
- 'GUICtrlTreeView_EndEdit','GUICtrlTreeView_EndUpdate',
- 'GUICtrlTreeView_EnsureVisible','GUICtrlTreeView_Expand',
- 'GUICtrlTreeView_ExpandedOnce','GUICtrlTreeView_FindItem',
- 'GUICtrlTreeView_FindItemEx','GUICtrlTreeView_GetBkColor',
- 'GUICtrlTreeView_GetBold','GUICtrlTreeView_GetChecked',
- 'GUICtrlTreeView_GetChildCount','GUICtrlTreeView_GetChildren',
- 'GUICtrlTreeView_GetCount','GUICtrlTreeView_GetCut',
- 'GUICtrlTreeView_GetDropTarget','GUICtrlTreeView_GetEditControl',
- 'GUICtrlTreeView_GetExpanded','GUICtrlTreeView_GetFirstChild',
- 'GUICtrlTreeView_GetFirstItem','GUICtrlTreeView_GetFirstVisible',
- 'GUICtrlTreeView_GetFocused','GUICtrlTreeView_GetHeight',
- 'GUICtrlTreeView_GetImageIndex',
- 'GUICtrlTreeView_GetImageListIconHandle',
- 'GUICtrlTreeView_GetIndent','GUICtrlTreeView_GetInsertMarkColor',
- 'GUICtrlTreeView_GetISearchString','GUICtrlTreeView_GetItemByIndex',
- 'GUICtrlTreeView_GetItemHandle','GUICtrlTreeView_GetItemParam',
- 'GUICtrlTreeView_GetLastChild','GUICtrlTreeView_GetLineColor',
- 'GUICtrlTreeView_GetNext','GUICtrlTreeView_GetNextChild',
- 'GUICtrlTreeView_GetNextSibling','GUICtrlTreeView_GetNextVisible',
- 'GUICtrlTreeView_GetNormalImageList',
- 'GUICtrlTreeView_GetParentHandle','GUICtrlTreeView_GetParentParam',
- 'GUICtrlTreeView_GetPrev','GUICtrlTreeView_GetPrevChild',
- 'GUICtrlTreeView_GetPrevSibling','GUICtrlTreeView_GetPrevVisible',
- 'GUICtrlTreeView_GetScrollTime','GUICtrlTreeView_GetSelected',
- 'GUICtrlTreeView_GetSelectedImageIndex',
- 'GUICtrlTreeView_GetSelection','GUICtrlTreeView_GetSiblingCount',
- 'GUICtrlTreeView_GetState','GUICtrlTreeView_GetStateImageIndex',
- 'GUICtrlTreeView_GetStateImageList','GUICtrlTreeView_GetText',
- 'GUICtrlTreeView_GetTextColor','GUICtrlTreeView_GetToolTips',
- 'GUICtrlTreeView_GetTree','GUICtrlTreeView_GetUnicodeFormat',
- 'GUICtrlTreeView_GetVisible','GUICtrlTreeView_GetVisibleCount',
- 'GUICtrlTreeView_HitTest','GUICtrlTreeView_HitTestEx',
- 'GUICtrlTreeView_HitTestItem','GUICtrlTreeView_Index',
- 'GUICtrlTreeView_InsertItem','GUICtrlTreeView_IsFirstItem',
- 'GUICtrlTreeView_IsParent','GUICtrlTreeView_Level',
- 'GUICtrlTreeView_SelectItem','GUICtrlTreeView_SelectItemByIndex',
- 'GUICtrlTreeView_SetBkColor','GUICtrlTreeView_SetBold',
- 'GUICtrlTreeView_SetChecked','GUICtrlTreeView_SetCheckedByIndex',
- 'GUICtrlTreeView_SetChildren','GUICtrlTreeView_SetCut',
- 'GUICtrlTreeView_SetDropTarget','GUICtrlTreeView_SetFocused',
- 'GUICtrlTreeView_SetHeight','GUICtrlTreeView_SetIcon',
- 'GUICtrlTreeView_SetImageIndex','GUICtrlTreeView_SetIndent',
- 'GUICtrlTreeView_SetInsertMark',
- 'GUICtrlTreeView_SetInsertMarkColor',
- 'GUICtrlTreeView_SetItemHeight','GUICtrlTreeView_SetItemParam',
- 'GUICtrlTreeView_SetLineColor','GUICtrlTreeView_SetNormalImageList',
- 'GUICtrlTreeView_SetScrollTime','GUICtrlTreeView_SetSelected',
- 'GUICtrlTreeView_SetSelectedImageIndex','GUICtrlTreeView_SetState',
- 'GUICtrlTreeView_SetStateImageIndex',
- 'GUICtrlTreeView_SetStateImageList','GUICtrlTreeView_SetText',
- 'GUICtrlTreeView_SetTextColor','GUICtrlTreeView_SetToolTips',
- 'GUICtrlTreeView_SetUnicodeFormat','GUICtrlTreeView_Sort',
- 'GUIImageList_Add','GUIImageList_AddBitmap','GUIImageList_AddIcon',
- 'GUIImageList_AddMasked','GUIImageList_BeginDrag',
- 'GUIImageList_Copy','GUIImageList_Create','GUIImageList_Destroy',
- 'GUIImageList_DestroyIcon','GUIImageList_DragEnter',
- 'GUIImageList_DragLeave','GUIImageList_DragMove',
- 'GUIImageList_Draw','GUIImageList_DrawEx','GUIImageList_Duplicate',
- 'GUIImageList_EndDrag','GUIImageList_GetBkColor',
- 'GUIImageList_GetIcon','GUIImageList_GetIconHeight',
- 'GUIImageList_GetIconSize','GUIImageList_GetIconSizeEx',
- 'GUIImageList_GetIconWidth','GUIImageList_GetImageCount',
- 'GUIImageList_GetImageInfoEx','GUIImageList_Remove',
- 'GUIImageList_ReplaceIcon','GUIImageList_SetBkColor',
- 'GUIImageList_SetIconSize','GUIImageList_SetImageCount',
- 'GUIImageList_Swap','GUIScrollBars_EnableScrollBar',
- 'GUIScrollBars_GetScrollBarInfoEx','GUIScrollBars_GetScrollBarRect',
- 'GUIScrollBars_GetScrollBarRGState',
- 'GUIScrollBars_GetScrollBarXYLineButton',
- 'GUIScrollBars_GetScrollBarXYThumbBottom',
- 'GUIScrollBars_GetScrollBarXYThumbTop',
- 'GUIScrollBars_GetScrollInfo','GUIScrollBars_GetScrollInfoEx',
- 'GUIScrollBars_GetScrollInfoMax','GUIScrollBars_GetScrollInfoMin',
- 'GUIScrollBars_GetScrollInfoPage','GUIScrollBars_GetScrollInfoPos',
- 'GUIScrollBars_GetScrollInfoTrackPos','GUIScrollBars_GetScrollPos',
- 'GUIScrollBars_GetScrollRange','GUIScrollBars_Init',
- 'GUIScrollBars_ScrollWindow','GUIScrollBars_SetScrollInfo',
- 'GUIScrollBars_SetScrollInfoMax','GUIScrollBars_SetScrollInfoMin',
- 'GUIScrollBars_SetScrollInfoPage','GUIScrollBars_SetScrollInfoPos',
- 'GUIScrollBars_SetScrollRange','GUIScrollBars_ShowScrollBar',
- 'GUIToolTip_Activate','GUIToolTip_AddTool','GUIToolTip_AdjustRect',
- 'GUIToolTip_BitsToTTF','GUIToolTip_Create','GUIToolTip_DelTool',
- 'GUIToolTip_Destroy','GUIToolTip_EnumTools',
- 'GUIToolTip_GetBubbleHeight','GUIToolTip_GetBubbleSize',
- 'GUIToolTip_GetBubbleWidth','GUIToolTip_GetCurrentTool',
- 'GUIToolTip_GetDelayTime','GUIToolTip_GetMargin',
- 'GUIToolTip_GetMarginEx','GUIToolTip_GetMaxTipWidth',
- 'GUIToolTip_GetText','GUIToolTip_GetTipBkColor',
- 'GUIToolTip_GetTipTextColor','GUIToolTip_GetTitleBitMap',
- 'GUIToolTip_GetTitleText','GUIToolTip_GetToolCount',
- 'GUIToolTip_GetToolInfo','GUIToolTip_HitTest',
- 'GUIToolTip_NewToolRect','GUIToolTip_Pop','GUIToolTip_PopUp',
- 'GUIToolTip_SetDelayTime','GUIToolTip_SetMargin',
- 'GUIToolTip_SetMaxTipWidth','GUIToolTip_SetTipBkColor',
- 'GUIToolTip_SetTipTextColor','GUIToolTip_SetTitle',
- 'GUIToolTip_SetToolInfo','GUIToolTip_SetWindowTheme',
- 'GUIToolTip_ToolExists','GUIToolTip_ToolToArray',
- 'GUIToolTip_TrackActivate','GUIToolTip_TrackPosition',
- 'GUIToolTip_TTFToBits','GUIToolTip_Update',
- 'GUIToolTip_UpdateTipText','HexToString','IE_Example',
- 'IE_Introduction','IE_VersionInfo','IEAction','IEAttach',
- 'IEBodyReadHTML','IEBodyReadText','IEBodyWriteHTML','IECreate',
- 'IECreateEmbedded','IEDocGetObj','IEDocInsertHTML',
- 'IEDocInsertText','IEDocReadHTML','IEDocWriteHTML',
- 'IEErrorHandlerDeRegister','IEErrorHandlerRegister','IEErrorNotify',
- 'IEFormElementCheckBoxSelect','IEFormElementGetCollection',
- 'IEFormElementGetObjByName','IEFormElementGetValue',
- 'IEFormElementOptionSelect','IEFormElementRadioSelect',
- 'IEFormElementSetValue','IEFormGetCollection','IEFormGetObjByName',
- 'IEFormImageClick','IEFormReset','IEFormSubmit',
- 'IEFrameGetCollection','IEFrameGetObjByName','IEGetObjById',
- 'IEGetObjByName','IEHeadInsertEventScript','IEImgClick',
- 'IEImgGetCollection','IEIsFrameSet','IELinkClickByIndex',
- 'IELinkClickByText','IELinkGetCollection','IELoadWait',
- 'IELoadWaitTimeout','IENavigate','IEPropertyGet','IEPropertySet',
- 'IEQuit','IETableGetCollection','IETableWriteToArray',
- 'IETagNameAllGetCollection','IETagNameGetCollection','Iif',
- 'INetExplorerCapable','INetGetSource','INetMail','INetSmtpMail',
- 'IsPressed','MathCheckDiv','Max','MemGlobalAlloc','MemGlobalFree',
- 'MemGlobalLock','MemGlobalSize','MemGlobalUnlock','MemMoveMemory',
- 'MemMsgBox','MemShowError','MemVirtualAlloc','MemVirtualAllocEx',
- 'MemVirtualFree','MemVirtualFreeEx','Min','MouseTrap',
- 'NamedPipes_CallNamedPipe','NamedPipes_ConnectNamedPipe',
- 'NamedPipes_CreateNamedPipe','NamedPipes_CreatePipe',
- 'NamedPipes_DisconnectNamedPipe',
- 'NamedPipes_GetNamedPipeHandleState','NamedPipes_GetNamedPipeInfo',
- 'NamedPipes_PeekNamedPipe','NamedPipes_SetNamedPipeHandleState',
- 'NamedPipes_TransactNamedPipe','NamedPipes_WaitNamedPipe',
- 'Net_Share_ConnectionEnum','Net_Share_FileClose',
- 'Net_Share_FileEnum','Net_Share_FileGetInfo','Net_Share_PermStr',
- 'Net_Share_ResourceStr','Net_Share_SessionDel',
- 'Net_Share_SessionEnum','Net_Share_SessionGetInfo',
- 'Net_Share_ShareAdd','Net_Share_ShareCheck','Net_Share_ShareDel',
- 'Net_Share_ShareEnum','Net_Share_ShareGetInfo',
- 'Net_Share_ShareSetInfo','Net_Share_StatisticsGetSvr',
- 'Net_Share_StatisticsGetWrk','Now','NowCalc','NowCalcDate',
- 'NowDate','NowTime','PathFull','PathMake','PathSplit',
- 'ProcessGetName','ProcessGetPriority','Radian',
- 'ReplaceStringInFile','RunDOS','ScreenCapture_Capture',
- 'ScreenCapture_CaptureWnd','ScreenCapture_SaveImage',
- 'ScreenCapture_SetBMPFormat','ScreenCapture_SetJPGQuality',
- 'ScreenCapture_SetTIFColorDepth','ScreenCapture_SetTIFCompression',
- 'Security__AdjustTokenPrivileges','Security__GetAccountSid',
- 'Security__GetLengthSid','Security__GetTokenInformation',
- 'Security__ImpersonateSelf','Security__IsValidSid',
- 'Security__LookupAccountName','Security__LookupAccountSid',
- 'Security__LookupPrivilegeValue','Security__OpenProcessToken',
- 'Security__OpenThreadToken','Security__OpenThreadTokenEx',
- 'Security__SetPrivilege','Security__SidToStringSid',
- 'Security__SidTypeStr','Security__StringSidToSid','SendMessage',
- 'SendMessageA','SetDate','SetTime','Singleton','SoundClose',
- 'SoundLength','SoundOpen','SoundPause','SoundPlay','SoundPos',
- 'SoundResume','SoundSeek','SoundStatus','SoundStop',
- 'SQLite_Changes','SQLite_Close','SQLite_Display2DResult',
- 'SQLite_Encode','SQLite_ErrCode','SQLite_ErrMsg','SQLite_Escape',
- 'SQLite_Exec','SQLite_FetchData','SQLite_FetchNames',
- 'SQLite_GetTable','SQLite_GetTable2d','SQLite_LastInsertRowID',
- 'SQLite_LibVersion','SQLite_Open','SQLite_Query',
- 'SQLite_QueryFinalize','SQLite_QueryReset','SQLite_QuerySingleRow',
- 'SQLite_SaveMode','SQLite_SetTimeout','SQLite_Shutdown',
- 'SQLite_SQLiteExe','SQLite_Startup','SQLite_TotalChanges',
- 'StringAddComma','StringBetween','StringEncrypt','StringInsert',
- 'StringProper','StringRepeat','StringReverse','StringSplit',
- 'StringToHex','TCPIpToName','TempFile','TicksToTime','Timer_Diff',
- 'Timer_GetTimerID','Timer_Init','Timer_KillAllTimers',
- 'Timer_KillTimer','Timer_SetTimer','TimeToTicks','VersionCompare',
- 'viClose','viExecCommand','viFindGpib','viGpibBusReset','viGTL',
- 'viOpen','viSetAttribute','viSetTimeout','WeekNumberISO',
- 'WinAPI_AttachConsole','WinAPI_AttachThreadInput','WinAPI_Beep',
- 'WinAPI_BitBlt','WinAPI_CallNextHookEx','WinAPI_Check',
- 'WinAPI_ClientToScreen','WinAPI_CloseHandle',
- 'WinAPI_CommDlgExtendedError','WinAPI_CopyIcon',
- 'WinAPI_CreateBitmap','WinAPI_CreateCompatibleBitmap',
- 'WinAPI_CreateCompatibleDC','WinAPI_CreateEvent',
- 'WinAPI_CreateFile','WinAPI_CreateFont','WinAPI_CreateFontIndirect',
- 'WinAPI_CreateProcess','WinAPI_CreateSolidBitmap',
- 'WinAPI_CreateSolidBrush','WinAPI_CreateWindowEx',
- 'WinAPI_DefWindowProc','WinAPI_DeleteDC','WinAPI_DeleteObject',
- 'WinAPI_DestroyIcon','WinAPI_DestroyWindow','WinAPI_DrawEdge',
- 'WinAPI_DrawFrameControl','WinAPI_DrawIcon','WinAPI_DrawIconEx',
- 'WinAPI_DrawText','WinAPI_EnableWindow','WinAPI_EnumDisplayDevices',
- 'WinAPI_EnumWindows','WinAPI_EnumWindowsPopup',
- 'WinAPI_EnumWindowsTop','WinAPI_ExpandEnvironmentStrings',
- 'WinAPI_ExtractIconEx','WinAPI_FatalAppExit','WinAPI_FillRect',
- 'WinAPI_FindExecutable','WinAPI_FindWindow','WinAPI_FlashWindow',
- 'WinAPI_FlashWindowEx','WinAPI_FloatToInt',
- 'WinAPI_FlushFileBuffers','WinAPI_FormatMessage','WinAPI_FrameRect',
- 'WinAPI_FreeLibrary','WinAPI_GetAncestor','WinAPI_GetAsyncKeyState',
- 'WinAPI_GetClassName','WinAPI_GetClientHeight',
- 'WinAPI_GetClientRect','WinAPI_GetClientWidth',
- 'WinAPI_GetCurrentProcess','WinAPI_GetCurrentProcessID',
- 'WinAPI_GetCurrentThread','WinAPI_GetCurrentThreadId',
- 'WinAPI_GetCursorInfo','WinAPI_GetDC','WinAPI_GetDesktopWindow',
- 'WinAPI_GetDeviceCaps','WinAPI_GetDIBits','WinAPI_GetDlgCtrlID',
- 'WinAPI_GetDlgItem','WinAPI_GetFileSizeEx','WinAPI_GetFocus',
- 'WinAPI_GetForegroundWindow','WinAPI_GetIconInfo',
- 'WinAPI_GetLastError','WinAPI_GetLastErrorMessage',
- 'WinAPI_GetModuleHandle','WinAPI_GetMousePos','WinAPI_GetMousePosX',
- 'WinAPI_GetMousePosY','WinAPI_GetObject','WinAPI_GetOpenFileName',
- 'WinAPI_GetOverlappedResult','WinAPI_GetParent',
- 'WinAPI_GetProcessAffinityMask','WinAPI_GetSaveFileName',
- 'WinAPI_GetStdHandle','WinAPI_GetStockObject','WinAPI_GetSysColor',
- 'WinAPI_GetSysColorBrush','WinAPI_GetSystemMetrics',
- 'WinAPI_GetTextExtentPoint32','WinAPI_GetWindow',
- 'WinAPI_GetWindowDC','WinAPI_GetWindowHeight',
- 'WinAPI_GetWindowLong','WinAPI_GetWindowRect',
- 'WinAPI_GetWindowText','WinAPI_GetWindowThreadProcessId',
- 'WinAPI_GetWindowWidth','WinAPI_GetXYFromPoint',
- 'WinAPI_GlobalMemStatus','WinAPI_GUIDFromString',
- 'WinAPI_GUIDFromStringEx','WinAPI_HiWord','WinAPI_InProcess',
- 'WinAPI_IntToFloat','WinAPI_InvalidateRect','WinAPI_IsClassName',
- 'WinAPI_IsWindow','WinAPI_IsWindowVisible','WinAPI_LoadBitmap',
- 'WinAPI_LoadImage','WinAPI_LoadLibrary','WinAPI_LoadLibraryEx',
- 'WinAPI_LoadShell32Icon','WinAPI_LoadString','WinAPI_LocalFree',
- 'WinAPI_LoWord','WinAPI_MakeDWord','WinAPI_MAKELANGID',
- 'WinAPI_MAKELCID','WinAPI_MakeLong','WinAPI_MessageBeep',
- 'WinAPI_Mouse_Event','WinAPI_MoveWindow','WinAPI_MsgBox',
- 'WinAPI_MulDiv','WinAPI_MultiByteToWideChar',
- 'WinAPI_MultiByteToWideCharEx','WinAPI_OpenProcess',
- 'WinAPI_PointFromRect','WinAPI_PostMessage','WinAPI_PrimaryLangId',
- 'WinAPI_PtInRect','WinAPI_ReadFile','WinAPI_ReadProcessMemory',
- 'WinAPI_RectIsEmpty','WinAPI_RedrawWindow',
- 'WinAPI_RegisterWindowMessage','WinAPI_ReleaseCapture',
- 'WinAPI_ReleaseDC','WinAPI_ScreenToClient','WinAPI_SelectObject',
- 'WinAPI_SetBkColor','WinAPI_SetCapture','WinAPI_SetCursor',
- 'WinAPI_SetDefaultPrinter','WinAPI_SetDIBits','WinAPI_SetEvent',
- 'WinAPI_SetFocus','WinAPI_SetFont','WinAPI_SetHandleInformation',
- 'WinAPI_SetLastError','WinAPI_SetParent',
- 'WinAPI_SetProcessAffinityMask','WinAPI_SetSysColors',
- 'WinAPI_SetTextColor','WinAPI_SetWindowLong','WinAPI_SetWindowPos',
- 'WinAPI_SetWindowsHookEx','WinAPI_SetWindowText',
- 'WinAPI_ShowCursor','WinAPI_ShowError','WinAPI_ShowMsg',
- 'WinAPI_ShowWindow','WinAPI_StringFromGUID','WinAPI_SubLangId',
- 'WinAPI_SystemParametersInfo','WinAPI_TwipsPerPixelX',
- 'WinAPI_TwipsPerPixelY','WinAPI_UnhookWindowsHookEx',
- 'WinAPI_UpdateLayeredWindow','WinAPI_UpdateWindow',
- 'WinAPI_ValidateClassName','WinAPI_WaitForInputIdle',
- 'WinAPI_WaitForMultipleObjects','WinAPI_WaitForSingleObject',
- 'WinAPI_WideCharToMultiByte','WinAPI_WindowFromPoint',
- 'WinAPI_WriteConsole','WinAPI_WriteFile',
- 'WinAPI_WriteProcessMemory','WinNet_AddConnection',
- 'WinNet_AddConnection2','WinNet_AddConnection3',
- 'WinNet_CancelConnection','WinNet_CancelConnection2',
- 'WinNet_CloseEnum','WinNet_ConnectionDialog',
- 'WinNet_ConnectionDialog1','WinNet_DisconnectDialog',
- 'WinNet_DisconnectDialog1','WinNet_EnumResource',
- 'WinNet_GetConnection','WinNet_GetConnectionPerformance',
- 'WinNet_GetLastError','WinNet_GetNetworkInformation',
- 'WinNet_GetProviderName','WinNet_GetResourceInformation',
- 'WinNet_GetResourceParent','WinNet_GetUniversalName',
- 'WinNet_GetUser','WinNet_OpenEnum','WinNet_RestoreConnection',
- 'WinNet_UseConnection','Word_VersionInfo','WordAttach','WordCreate',
- 'WordDocAdd','WordDocAddLink','WordDocAddPicture','WordDocClose',
- 'WordDocFindReplace','WordDocGetCollection',
- 'WordDocLinkGetCollection','WordDocOpen','WordDocPrint',
- 'WordDocPropertyGet','WordDocPropertySet','WordDocSave',
- 'WordDocSaveAs','WordErrorHandlerDeRegister',
- 'WordErrorHandlerRegister','WordErrorNotify','WordMacroRun',
- 'WordPropertyGet','WordPropertySet','WordQuit'
- ),
- 5 => array(
- 'ce','comments-end','comments-start','cs','include','include-once',
- 'NoTrayIcon','RequireAdmin'
- ),
- 6 => array(
- 'AutoIt3Wrapper_Au3Check_Parameters',
- 'AutoIt3Wrapper_Au3Check_Stop_OnWarning',
- 'AutoIt3Wrapper_Change2CUI','AutoIt3Wrapper_Compression',
- 'AutoIt3Wrapper_cvsWrapper_Parameters','AutoIt3Wrapper_Icon',
- 'AutoIt3Wrapper_Outfile','AutoIt3Wrapper_Outfile_Type',
- 'AutoIt3Wrapper_Plugin_Funcs','AutoIt3Wrapper_Res_Comment',
- 'AutoIt3Wrapper_Res_Description','AutoIt3Wrapper_Res_Field',
- 'AutoIt3Wrapper_Res_File_Add','AutoIt3Wrapper_Res_Fileversion',
- 'AutoIt3Wrapper_Res_FileVersion_AutoIncrement',
- 'AutoIt3Wrapper_Res_Icon_Add','AutoIt3Wrapper_Res_Language',
- 'AutoIt3Wrapper_Res_LegalCopyright',
- 'AutoIt3Wrapper_res_requestedExecutionLevel',
- 'AutoIt3Wrapper_Res_SaveSource','AutoIt3Wrapper_Run_After',
- 'AutoIt3Wrapper_Run_Au3check','AutoIt3Wrapper_Run_Before',
- 'AutoIt3Wrapper_Run_cvsWrapper','AutoIt3Wrapper_Run_Debug_Mode',
- 'AutoIt3Wrapper_Run_Obfuscator','AutoIt3Wrapper_Run_Tidy',
- 'AutoIt3Wrapper_Tidy_Stop_OnError','AutoIt3Wrapper_UseAnsi',
- 'AutoIt3Wrapper_UseUpx','AutoIt3Wrapper_UseX64',
- 'AutoIt3Wrapper_Version','EndRegion','forceref',
- 'Obfuscator_Ignore_Funcs','Obfuscator_Ignore_Variables',
- 'Obfuscator_Parameters','Region','Tidy_Parameters'
- )
- ),
- 'SYMBOLS' => array(
- '(',')','[',']',
- '+','-','*','/','&','^',
- '=','+=','-=','*=','/=','&=',
- '==','<','<=','>','>=',
- ',','.'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF; font-weight: bold;',
- 2 => 'color: #800000; font-weight: bold;',
- 3 => 'color: #000080; font-style: italic; font-weight: bold;',
- 4 => 'color: #0080FF; font-style: italic; font-weight: bold;',
- 5 => 'color: #F000FF; font-style: italic;',
- 6 => 'color: #A00FF0; font-style: italic;'
- ),
- 'COMMENTS' => array(
- 0 => 'font-style: italic; color: #009933;',
- 'MULTI' => 'font-style: italic; color: #669900;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => 'color: #FF0000; font-weight: bold;'
- ),
- 'STRINGS' => array(
- 0 => 'font-weight: bold; color: #008080;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #AC00A9; font-style: italic; font-weight: bold;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000FF; font-style: italic; font-weight: bold;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #FF0000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'font-weight: bold; color: #AA0000;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.autoitscript.com/autoit3/docs/keywords.htm',
- 2 => 'http://www.autoitscript.com/autoit3/docs/macros.htm',
- 3 => 'http://www.autoitscript.com/autoit3/docs/functions/{FNAME}.htm',
- 4 => '',
- 5 => '',
- 6 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- //Variables
- 0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 4 => array(
- 'DISALLOWED_BEFORE' => '(?<!\w)\_'
- ),
- 5 => array(
- 'DISALLOWED_BEFORE' => '(?<!\w)\#'
- ),
- 6 => array(
- 'DISALLOWED_BEFORE' => '(?<!\w)\#'
- )
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/avisynth.php b/libvpx/examples/includes/geshi/geshi/avisynth.php
deleted file mode 100644
index a3f60d0..0000000
--- a/libvpx/examples/includes/geshi/geshi/avisynth.php
+++ /dev/null
@@ -1,194 +0,0 @@
-<?php
-/*************************************************************************************
- * avisynth.php
- * --------
- * Author: Ryan Jones (sciguyryan@gmail.com)
- * Copyright: (c) 2008 Ryan Jones
- * Release Version: 1.0.8.3
- * Date Started: 2008/10/08
- *
- * AviSynth language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/08 (1.0.8.1)
- * - First Release
- *
- * TODO (updated 2008/10/08)
- * -------------------------
- * * There are also some special words that can't currently be specified directly in GeSHi as they may
- * also be used as variables which would really mess things up.
- * * Also there is an issue with the escape character as this language uses a muti-character escape system. Escape char should be """ but has been left
- * as empty due to this restiction.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'AviSynth',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/', '[*' => '*]'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- // Reserved words.
- 1 => array(
- 'try', 'cache', 'function', 'global', 'return'
- ),
- // Constants / special variables.
- 2 => array(
- 'true', 'yes', 'false', 'no', '__END__'
- ),
- // Internal Filters.
- 3 => array(
- 'AviSource', 'AviFileSource', 'AddBorders', 'AlignedSplice', 'AssumeFPS', 'AssumeScaledFPS',
- 'AssumeFrameBased', 'AssumeFieldBased', 'AssumeBFF', 'AssumeTFF', 'Amplify', 'AmplifydB',
- 'AssumeSampleRate', 'AudioDub', 'AudioDubEx', 'Animate', 'ApplyRange',
- 'BicubicResize', 'BilinearResize', 'BlackmanResize', 'Blur', 'Bob', 'BlankClip', 'Blackness',
- 'ColorYUV', 'ConvertBackToYUY2', 'ConvertToRGB', 'ConvertToRGB24', 'ConvertToRGB32',
- 'ConvertToYUY2', 'ConvertToY8', 'ConvertToYV411', 'ConvertToYV12', 'ConvertToYV16', 'ConvertToYV24',
- 'ColorKeyMask', 'Crop', 'CropBottom', 'ChangeFPS', 'ConvertFPS', 'ComplementParity', 'ConvertAudioTo8bit',
- 'ConvertAudioTo16bit', 'ConvertAudioTo24bit', 'ConvertAudioTo32bit', 'ConvertAudioToFloat', 'ConvertToMono',
- 'ConditionalFilter', 'ConditionalReader', 'ColorBars', 'Compare',
- 'DirectShowSource', 'DeleteFrame', 'Dissolve', 'DuplicateFrame', 'DoubleWeave', 'DelayAudio',
- 'EnsureVBRMP3Sync',
- 'FixLuminance', 'FlipHorizontal', 'FlipVertical', 'FixBrokenChromaUpsampling', 'FadeIn0', 'FadeIn',
- 'FadeIn2', 'FadeOut0', 'FadeOut', 'FadeOut2', 'FadeIO0', 'FadeIO', 'FadeIO2', 'FreezeFrame', 'FrameEvaluate',
- 'GreyScale', 'GaussResize', 'GeneralConvolution', 'GetChannel', 'GetLeftChannel', 'GetRightChannel',
- 'HorizontalReduceBy2', 'Histogram',
- 'ImageReader', 'ImageSource', 'ImageWriter', 'Invert', 'Interleave', 'Info',
- 'KillAudio', 'KillVideo',
- 'Levels', 'Limiter', 'Layer', 'Letterbox', 'LanczosResize', 'Lanczos4Resize', 'Loop',
- 'MergeARGB', 'MergeRGB', 'MergeChroma', 'MergeLuma', 'Merge', 'Mask', 'MaskHS', 'MergeChannels', 'MixAudio',
- 'MonoToStereo', 'MessageClip',
- 'Normalize',
- 'OpenDMLSource', 'Overlay',
- 'PointResize', 'PeculiarBlend', 'Pulldown',
- 'RGBAdjust', 'ResetMask', 'Reverse', 'ResampleAudio', 'ReduceBy2',
- 'SegmentedAviSource', 'SegmentedDirectShowSource', 'SoundOut', 'ShowAlpha', 'ShowRed', 'ShowGreen',
- 'ShowBlue', 'SwapUV', 'Subtract', 'SincResize', 'Spline16Resize', 'Spline36Resize', 'Spline64Resize',
- 'SelectEven', 'SelectOdd', 'SelectEvery', 'SelectRangeEvery', 'Sharpen', 'SpatialSoften', 'SeparateFields',
- 'ShowFiveVersions', 'ShowFrameNumber', 'ShowSMPTE', 'ShowTime', 'StackHorizontal', 'StackVertical', 'Subtitle',
- 'SwapFields', 'SuperEQ', 'SSRC', 'ScriptClip',
- 'Tweak', 'TurnLeft', 'TurnRight', 'Turn180', 'TemporalSoften', 'TimeStretch', 'TCPServer', 'TCPSource', 'Trim',
- 'Tone',
- 'UToY', 'UToY8', 'UnalignedSplice',
- 'VToY', 'VToY8', 'VerticalReduceBy2', 'Version',
- 'WavSource', 'Weave', 'WriteFile', 'WriteFileIf', 'WriteFileStart', 'WriteFileEnd',
- 'YToUV'
- ),
- // Internal functions.
- 4 => array(
- 'Abs', 'Apply', 'Assert', 'AverageLuma', 'AverageChromaU', 'AverageChromaV',
- 'Ceil', 'Cos', 'Chr', 'ChromaUDifference', 'ChromaVDifference',
- 'Defined', 'Default',
- 'Exp', 'Exist', 'Eval',
- 'Floor', 'Frac', 'Float', 'Findstr', 'GetMTMode',
- 'HexValue',
- 'Int', 'IsBool', 'IsClip', 'IsFloat', 'IsInt', 'IsString', 'Import',
- 'LoadPlugin', 'Log', 'LCase', 'LeftStr', 'LumaDifference', 'LoadVirtualDubPlugin', 'LoadVFAPIPlugin',
- 'LoadCPlugin', 'Load_Stdcall_Plugin',
- 'Max', 'MulDiv', 'MidStr',
- 'NOP',
- 'OPT_AllowFloatAudio', 'OPT_UseWaveExtensible',
- 'Pi', 'Pow',
- 'Round', 'Rand', 'RevStr', 'RightStr', 'RGBDifference', 'RGBDifferenceFromPrevious', 'RGBDifferenceToNext',
- 'Sin', 'Sqrt', 'Sign', 'Spline', 'StrLen', 'String', 'Select', 'SetMemoryMax', 'SetWorkingDir', 'SetMTMode',
- 'SetPlanarLegacyAlignment',
- 'Time',
- 'UCase', 'UDifferenceFromPrevious', 'UDifferenceToNext', 'UPlaneMax', 'UPlaneMin', 'UPlaneMedian',
- 'UPlaneMinMaxDifference',
- 'Value', 'VersionNumber', 'VersionString', 'VDifferenceFromPrevious', 'VDifferenceToNext', 'VPlaneMax',
- 'VPlaneMin', 'VPlaneMedian', 'VPlaneMinMaxDifference',
- 'YDifferenceFromPrevious', 'YDifferenceToNext', 'YPlaneMax', 'YPlaneMin', 'YPlaneMedian',
- 'YPlaneMinMaxDifference'
- )
- ),
- 'SYMBOLS' => array(
- '+', '++', '-', '--', '/', '*', '%',
- '=', '==', '<', '<=', '>', '>=', '<>', '!=',
- '!', '?', ':',
- '|', '||', '&&',
- '\\',
- '(', ')', '{', '}',
- '.', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color:#9966CC; font-weight:bold;',
- 2 => 'color:#0000FF; font-weight:bold;',
- 3 => 'color:#CC3300; font-weight:bold;',
- 4 => 'color:#660000; font-weight:bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color:#008000; font-style:italic;',
- 'MULTI' => 'color:#000080; font-style:italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color:#000099;'
- ),
- 'BRACKETS' => array(
- 0 => 'color:#006600; font-weight:bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color:#996600;'
- ),
- 'NUMBERS' => array(
- 0 => 'color:#006666;'
- ),
- 'METHODS' => array(
- 1 => 'color:#9900CC;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color:#006600; font-weight:bold;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://avisynth.org/mediawiki/{FNAME}',
- 4 => ''
- ),
- 'REGEXPS' => array(
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/bash.php b/libvpx/examples/includes/geshi/geshi/bash.php
deleted file mode 100644
index b41f895..0000000
--- a/libvpx/examples/includes/geshi/geshi/bash.php
+++ /dev/null
@@ -1,282 +0,0 @@
-<?php
-/*************************************************************************************
- * bash.php
- * --------
- * Author: Andreas Gohr (andi@splitbrain.org)
- * Copyright: (c) 2004 Andreas Gohr, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/20
- *
- * BASH language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/06/21 (1.0.8)
- * - Added loads of keywords and commands of GNU/Linux
- * - Added support for parameters starting with a dash
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2007/09/05 (1.0.7.21)
- * - PARSER_CONTROL patch using SF #1788408 (BenBE)
- * 2007/06/11 (1.0.7.20)
- * - Added a lot of keywords (BenBE / Jan G)
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Added support for URLs
- * 2004/08/20 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Get symbols working
- * * Highlight builtin vars
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Bash',
- // Bash DOES have single line comments with # markers. But bash also has
- // the $# variable, so comments need special handling (see sf.net
- // 1564839)
- 'COMMENT_SINGLE' => array('#'),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- //Variables
- 1 => "/\\$\\{[^\\n\\}]*?\\}/i",
- //BASH-style Heredoc
- 2 => '/<<-?\s*?(\'?)([a-zA-Z0-9]+)\1\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
- //Escaped String Starters
- 3 => "/\\\\['\"]/siU"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array("\'"),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[nfrtv\\$\\\"\n]#i",
- // $var
- 2 => "#\\$[a-z_][a-z0-9_]*#i",
- // ${...}
- 3 => "/\\$\\{[^\\n\\}]*?\\}/i",
- // $(...)
- 4 => "/\\$\\([^\\n\\)]*?\\)/i",
- // `...`
- 5 => "/`[^`]*`/"
- ),
- 'KEYWORDS' => array(
- 1 => array(
- 'case', 'do', 'done', 'elif', 'else', 'esac', 'fi', 'for', 'function',
- 'if', 'in', 'select', 'set', 'then', 'until', 'while', 'time'
- ),
- 2 => array(
- 'aclocal', 'aconnect', 'aplay', 'apm', 'apmsleep', 'apropos',
- 'apt-cache', 'apt-get', 'apt-key', 'aptitude',
- 'ar', 'arch', 'arecord', 'as', 'as86', 'ash', 'autoconf',
- 'autoheader', 'automake', 'awk',
-
- 'basename', 'bash', 'bc', 'bison', 'bunzip2', 'bzcat',
- 'bzcmp', 'bzdiff', 'bzegrep', 'bzfgrep', 'bzgrep',
- 'bzip2', 'bzip2recover', 'bzless', 'bzmore',
-
- 'c++', 'cal', 'cat', 'chattr', 'cc', 'cdda2wav', 'cdparanoia',
- 'cdrdao', 'cd-read', 'cdrecord', 'chfn', 'chgrp', 'chmod',
- 'chown', 'chroot', 'chsh', 'chvt', 'clear', 'cmp', 'comm', 'co',
- 'col', 'cp', 'cpio', 'cpp', 'csh', 'cut', 'cvs', 'cvs-pserver',
-
- 'dash', 'date', 'dd', 'dc', 'dcop', 'deallocvt', 'df', 'dialog',
- 'diff', 'diff3', 'dir', 'dircolors', 'directomatic', 'dirname',
- 'dmesg', 'dnsdomainname', 'domainname', 'dpkg', 'dselect', 'du',
- 'dumpkeys',
-
- 'ed', 'egrep', 'env', 'expr',
-
- 'false', 'fbset', 'ffmpeg', 'fgconsole','fgrep', 'file', 'find',
- 'flex', 'flex++', 'fmt', 'free', 'ftp', 'funzip', 'fuser',
-
- 'g++', 'gawk', 'gc','gcc', 'gdb', 'getent', 'getkeycodes',
- 'getopt', 'gettext', 'gettextize', 'gimp', 'gimp-remote',
- 'gimptool', 'gmake', 'gocr', 'grep', 'groups', 'gs', 'gunzip',
- 'gzexe', 'gzip',
-
- 'head', 'hexdump', 'hostname',
-
- 'id', 'ifconfig', 'igawk', 'install',
-
- 'join',
-
- 'kbd_mode','kbdrate', 'kdialog', 'kfile', 'kill', 'killall',
-
- 'lame', 'last', 'lastb', 'ld', 'ld86', 'ldd', 'less', 'lex', 'link',
- 'ln', 'loadkeys', 'loadunimap', 'locate', 'lockfile', 'login',
- 'logname', 'lp', 'lpr', 'ls', 'lsattr', 'lsmod', 'lsmod.old',
- 'lspci', 'ltrace', 'lynx',
-
- 'm4', 'make', 'man', 'mapscrn', 'mesg', 'mkdir', 'mkfifo',
- 'mknod', 'mktemp', 'more', 'mount', 'mplayer', 'msgfmt', 'mv',
-
- 'namei', 'nano', 'nasm', 'nawk', 'netstat', 'nice',
- 'nisdomainname', 'nl', 'nm', 'nm86', 'nmap', 'nohup', 'nop',
-
- 'od', 'openvt',
-
- 'passwd', 'patch', 'pcregrep', 'pcretest', 'perl', 'perror',
- 'pgawk', 'pidof', 'ping', 'pr', 'procmail', 'prune', 'ps', 'pstree',
- 'ps2ascii', 'ps2epsi', 'ps2frag', 'ps2pdf', 'ps2ps', 'psbook',
- 'psmerge', 'psnup', 'psresize', 'psselect', 'pstops',
-
- 'rbash', 'rcs', 'rcs2log', 'read', 'readlink', 'red', 'resizecons',
- 'rev', 'rm', 'rmdir', 'rsh', 'run-parts',
-
- 'sash', 'scp', 'screen', 'sed', 'seq', 'sendmail', 'setfont',
- 'setkeycodes', 'setleds', 'setmetamode', 'setserial', 'setterm',
- 'sh', 'showkey', 'shred', 'size', 'size86', 'skill', 'sleep',
- 'slogin', 'snice', 'sort', 'sox', 'split', 'ssed', 'ssh', 'ssh-add',
- 'ssh-agent', 'ssh-keygen', 'ssh-keyscan', 'stat', 'strace',
- 'strings', 'strip', 'stty', 'su', 'sudo', 'suidperl', 'sum', 'svn',
- 'svnadmin', 'svndumpfilter', 'svnlook', 'svnmerge', 'svnmucc',
- 'svnserve', 'svnshell', 'svnsync', 'svnversion', 'svnwrap', 'sync',
-
- 'tac', 'tail', 'tar', 'tee', 'tempfile', 'touch', 'tr', 'tree',
- 'true',
-
- 'umount', 'uname', 'unicode_start', 'unicode_stop', 'uniq',
- 'unlink', 'unzip', 'updatedb', 'updmap', 'uptime', 'users',
- 'utmpdump', 'uuidgen',
-
- 'valgrind', 'vdir', 'vi', 'vim', 'vmstat',
-
- 'w', 'wall', 'wc', 'wget', 'whatis', 'whereis', 'which', 'whiptail',
- 'who', 'whoami', 'write',
-
- 'xargs', 'xhost', 'xmodmap', 'xset',
-
- 'yacc', 'yes', 'ypdomainname',
-
- 'zcat', 'zcmp', 'zdiff', 'zdump', 'zegrep', 'zfgrep', 'zforce',
- 'zgrep', 'zip', 'zipgrep', 'zipinfo', 'zless', 'zmore', 'znew',
- 'zsh', 'zsoelim'
- ),
- 3 => array(
- 'alias', 'bg', 'bind', 'break', 'builtin', 'cd', 'command',
- 'compgen', 'complete', 'continue', 'declare', 'dirs', 'disown',
- 'echo', 'enable', 'eval', 'exec', 'exit', 'export', 'fc',
- 'fg', 'getopts', 'hash', 'help', 'history', 'jobs', 'let',
- 'local', 'logout', 'popd', 'printf', 'pushd', 'pwd', 'readonly',
- 'return', 'shift', 'shopt', 'source', 'suspend', 'test', 'times',
- 'trap', 'type', 'typeset', 'ulimit', 'umask', 'unalias', 'unset',
- 'wait'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '!', '@', '%', '&', '*', '|', '/', '<', '>', ';;', '`'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #c20cb9; font-weight: bold;',
- 3 => 'color: #7a0874; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 0 => 'color: #666666; font-style: italic;',
- 1 => 'color: #800000;',
- 2 => 'color: #cc0000; font-style: italic;',
- 3 => 'color: #000000; font-weight: bold;'
- ),
- 'ESCAPE_CHAR' => array(
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #007800;',
- 3 => 'color: #007800;',
- 4 => 'color: #007800;',
- 5 => 'color: #780078;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #7a0874; font-weight: bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;',
- 'HARD' => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #007800;',
- 1 => 'color: #007800;',
- 2 => 'color: #007800;',
- 4 => 'color: #007800;',
- 5 => 'color: #660033;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Variables (will be handled by comment_regexps)
- 0 => "\\$\\{[a-zA-Z_][a-zA-Z0-9_]*?\\}",
- //Variables without braces
- 1 => "\\$[a-zA-Z_][a-zA-Z0-9_]*",
- //Variable assignment
- 2 => "(?<![\.a-zA-Z_\-])([a-zA-Z_][a-zA-Z0-9_]*?)(?==)",
- //Shorthand shell variables
- 4 => "\\$[*#\$\\-\\?!]",
- //Parameters of commands
- 5 => "(?<=\s)--?[0-9a-zA-Z\-]+(?=[\s=]|$)"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'COMMENTS' => array(
- 'DISALLOWED_BEFORE' => '$'
- ),
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![\.\-a-zA-Z0-9_\$\#])",
- 'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%\\/])"
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/basic4gl.php b/libvpx/examples/includes/geshi/geshi/basic4gl.php
deleted file mode 100644
index a7b00b9..0000000
--- a/libvpx/examples/includes/geshi/geshi/basic4gl.php
+++ /dev/null
@@ -1,341 +0,0 @@
-<?php
-/*************************************************************************************
- * basic4gl.php
- * ---------------------------------
- * Author: Matthew Webb (bmatthew1@blueyonder.co.uk)
- * Copyright: (c) 2004 Matthew Webb (http://matthew-4gl.wikispaces.com)
- * Release Version: 1.0.8.3
- * Date Started: 2007/09/15
- *
- * Basic4GL language file for GeSHi.
- *
- * You can find the Basic4GL Website at (http://www.basic4gl.net/)
- *
- * CHANGES
- * -------
- * 2007/09/17 (1.0.0)
- * - First Release
- *
- * TODO (updated 2007/09/17)
- * -------------------------
- * Make sure all the OpenGL and Basic4GL commands have been added and are complete.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Basic4GL',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
-
- // Navy Blue Bold Keywords
-
- 'true','rnd_max','m_pi','m_e','false','VK_ZOOM','VK_UP','VK_TAB','VK_SUBTRACT','VK_SPACE','VK_SNAPSHOT',
- 'VK_SHIFT','VK_SEPARATOR','VK_SELECT','VK_SCROLL','VK_RWIN','VK_RSHIFT','VK_RMENU','VK_RIGHT','VK_RETURN',
- 'VK_RCONTROL','VK_RBUTTON','VK_PROCESSKEY','VK_PRIOR','VK_PRINT','VK_PLAY','VK_PAUSE','VK_NUMPAD9','VK_NUMPAD8',
- 'VK_NUMPAD7','VK_NUMPAD6','VK_NUMPAD5','VK_NUMPAD4','VK_NUMPAD3','VK_NUMPAD2','VK_NUMPAD1','VK_NUMPAD0',
- 'VK_NUMLOCK','VK_NONCONVERT','VK_NEXT','VK_MULTIPLY','VK_MODECHANGE','VK_MENU','VK_MBUTTON','VK_LWIN',
- 'VK_LSHIFT','VK_LMENU','VK_LEFT','VK_LCONTROL','VK_LBUTTON','VK_KANJI','VK_KANA','VK_JUNJA','VK_INSERT',
- 'VK_HOME','VK_HELP','VK_HANJA','VK_HANGUL','VK_HANGEUL','VK_FINAL','VK_F9','VK_F8','VK_F7','VK_F6','VK_F5',
- 'VK_F4','VK_F3','VK_F24','VK_F23','VK_F22','VK_F21','VK_F20','VK_F2','VK_F19','VK_F18','VK_F17','VK_F16',
- 'VK_F15','VK_F14','VK_F13','VK_F12','VK_F11','VK_F10','VK_F1','VK_EXSEL','VK_EXECUTE','VK_ESCAPE','VK_EREOF',
- 'VK_END','VK_DOWN','VK_DIVIDE','VK_DELETE','VK_DECIMAL','VK_CRSEL','VK_CONVERT','VK_CONTROL','VK_CLEAR',
- 'VK_CAPITAL','VK_CANCEL','VK_BACK','VK_ATTN','VK_APPS','VK_ADD','VK_ACCEPT','TEXT_SIMPLE','TEXT_OVERLAID',
- 'TEXT_BUFFERED','SPR_TILEMAP','SPR_SPRITE','SPR_INVALID','MOUSE_RBUTTON','MOUSE_MBUTTON','MOUSE_LBUTTON',
- 'GL_ZOOM_Y','GL_ZOOM_X','GL_ZERO','GL_XOR','GL_WIN_swap_hint','GL_WIN_draw_range_elements','GL_VIEWPORT_BIT',
- 'GL_VIEWPORT','GL_VERTEX_ARRAY_TYPE_EXT','GL_VERTEX_ARRAY_TYPE','GL_VERTEX_ARRAY_STRIDE_EXT','GL_VERTEX_ARRAY_STRIDE',
- 'GL_VERTEX_ARRAY_SIZE_EXT','GL_VERTEX_ARRAY_SIZE','GL_VERTEX_ARRAY_POINTER_EXT','GL_VERTEX_ARRAY_POINTER',
- 'GL_VERTEX_ARRAY_EXT','GL_VERTEX_ARRAY_COUNT_EXT','GL_VERTEX_ARRAY','GL_VERSION_1_1','GL_VERSION','GL_VENDOR',
- 'GL_V3F','GL_V2F','GL_UNSIGNED_SHORT','GL_UNSIGNED_INT','GL_UNSIGNED_BYTE','GL_UNPACK_SWAP_BYTES','GL_UNPACK_SKIP_ROWS',
- 'GL_UNPACK_SKIP_PIXELS','GL_UNPACK_ROW_LENGTH','GL_UNPACK_LSB_FIRST','GL_UNPACK_ALIGNMENT','GL_TRUE','GL_TRIANGLE_STRIP',
- 'GL_TRIANGLE_FAN','GL_TRIANGLES','GL_TRANSFORM_BIT','GL_TEXTURE_WRAP_T','GL_TEXTURE_WRAP_S','GL_TEXTURE_WIDTH',
- 'GL_TEXTURE_STACK_DEPTH','GL_TEXTURE_RESIDENT','GL_TEXTURE_RED_SIZE','GL_TEXTURE_PRIORITY','GL_TEXTURE_MIN_FILTER',
- 'GL_TEXTURE_MATRIX','GL_TEXTURE_MAG_FILTER','GL_TEXTURE_LUMINANCE_SIZE','GL_TEXTURE_INTERNAL_FORMAT','GL_TEXTURE_INTENSITY_SIZE',
- 'GL_TEXTURE_HEIGHT','GL_TEXTURE_GREEN_SIZE','GL_TEXTURE_GEN_T','GL_TEXTURE_GEN_S','GL_TEXTURE_GEN_R','GL_TEXTURE_GEN_Q',
- 'GL_TEXTURE_GEN_MODE','GL_TEXTURE_ENV_MODE','GL_TEXTURE_ENV_COLOR','GL_TEXTURE_ENV','GL_TEXTURE_COORD_ARRAY_TYPE_EXT',
- 'GL_TEXTURE_COORD_ARRAY_TYPE','GL_TEXTURE_COORD_ARRAY_STRIDE_EXT','GL_TEXTURE_COORD_ARRAY_STRIDE','GL_TEXTURE_COORD_ARRAY_SIZE_EXT',
- 'GL_TEXTURE_COORD_ARRAY_SIZE','GL_TEXTURE_COORD_ARRAY_POINTER_EXT','GL_TEXTURE_COORD_ARRAY_POINTER','GL_TEXTURE_COORD_ARRAY_EXT',
- 'GL_TEXTURE_COORD_ARRAY_COUNT_EXT','GL_TEXTURE_COORD_ARRAY','GL_TEXTURE_COMPONENTS','GL_TEXTURE_BORDER_COLOR','GL_TEXTURE_BORDER',
- 'GL_TEXTURE_BLUE_SIZE','GL_TEXTURE_BIT','GL_TEXTURE_BINDING_2D','GL_TEXTURE_BINDING_1D','GL_TEXTURE_ALPHA_SIZE',
- 'GL_TEXTURE_2D','GL_TEXTURE_1D','GL_TEXTURE9_ARB','GL_TEXTURE9','GL_TEXTURE8_ARB','GL_TEXTURE8','GL_TEXTURE7_ARB',
- 'GL_TEXTURE7','GL_TEXTURE6_ARB','GL_TEXTURE6','GL_TEXTURE5_ARB','GL_TEXTURE5','GL_TEXTURE4_ARB','GL_TEXTURE4',
- 'GL_TEXTURE3_ARB','GL_TEXTURE31_ARB','GL_TEXTURE31','GL_TEXTURE30_ARB','GL_TEXTURE30','GL_TEXTURE3','GL_TEXTURE2_ARB',
- 'GL_TEXTURE29_ARB','GL_TEXTURE29','GL_TEXTURE28_ARB','GL_TEXTURE28','GL_TEXTURE27_ARB','GL_TEXTURE27','GL_TEXTURE26_ARB',
- 'GL_TEXTURE26','GL_TEXTURE25_ARB','GL_TEXTURE25','GL_TEXTURE24_ARB','GL_TEXTURE24','GL_TEXTURE23_ARB','GL_TEXTURE23',
- 'GL_TEXTURE22_ARB','GL_TEXTURE22','GL_TEXTURE21_ARB','GL_TEXTURE21','GL_TEXTURE20_ARB','GL_TEXTURE20','GL_TEXTURE2',
- 'GL_TEXTURE1_ARB','GL_TEXTURE19_ARB','GL_TEXTURE19','GL_TEXTURE18_ARB','GL_TEXTURE18','GL_TEXTURE17_ARB',
- 'GL_TEXTURE17','GL_TEXTURE16_ARB','GL_TEXTURE16','GL_TEXTURE15_ARB','GL_TEXTURE15','GL_TEXTURE14_ARB','GL_TEXTURE14',
- 'GL_TEXTURE13_ARB','GL_TEXTURE13','GL_TEXTURE12_ARB','GL_TEXTURE12','GL_TEXTURE11_ARB','GL_TEXTURE11','GL_TEXTURE10_ARB',
- 'GL_TEXTURE10','GL_TEXTURE1','GL_TEXTURE0_ARB','GL_TEXTURE0','GL_TEXTURE','GL_T4F_V4F','GL_T4F_C4F_N3F_V4F','GL_T2F_V3F',
- 'GL_T2F_N3F_V3F','GL_T2F_C4UB_V3F','GL_T2F_C4F_N3F_V3F','GL_T2F_C3F_V3F','GL_T','GL_SUBPIXEL_BITS','GL_STEREO',
- 'GL_STENCIL_WRITEMASK','GL_STENCIL_VALUE_MASK','GL_STENCIL_TEST','GL_STENCIL_REF','GL_STENCIL_PASS_DEPTH_PASS',
- 'GL_STENCIL_PASS_DEPTH_FAIL','GL_STENCIL_INDEX','GL_STENCIL_FUNC','GL_STENCIL_FAIL','GL_STENCIL_CLEAR_VALUE',
- 'GL_STENCIL_BUFFER_BIT','GL_STENCIL_BITS','GL_STENCIL','GL_STACK_UNDERFLOW','GL_STACK_OVERFLOW','GL_SRC_COLOR',
- 'GL_SRC_ALPHA_SATURATE','GL_SRC_ALPHA','GL_SPOT_EXPONENT','GL_SPOT_DIRECTION','GL_SPOT_CUTOFF','GL_SPHERE_MAP',
- 'GL_SPECULAR','GL_SOURCE2_RGB_EXT','GL_SOURCE2_RGB','GL_SOURCE2_ALPHA_EXT','GL_SOURCE2_ALPHA','GL_SOURCE1_RGB_EXT',
- 'GL_SOURCE1_RGB','GL_SOURCE1_ALPHA_EXT','GL_SOURCE1_ALPHA','GL_SOURCE0_RGB_EXT','GL_SOURCE0_RGB','GL_SOURCE0_ALPHA_EXT',
- 'GL_SOURCE0_ALPHA','GL_SMOOTH','GL_SHORT','GL_SHININESS','GL_SHADE_MODEL','GL_SET','GL_SELECTION_BUFFER_SIZE',
- 'GL_SELECTION_BUFFER_POINTER','GL_SELECT','GL_SCISSOR_TEST','GL_SCISSOR_BOX','GL_SCISSOR_BIT','GL_S','GL_RIGHT',
- 'GL_RGB_SCALE_EXT','GL_RGB_SCALE','GL_RGBA_MODE','GL_RGBA8','GL_RGBA4','GL_RGBA2','GL_RGBA16','GL_RGBA12','GL_RGBA',
- 'GL_RGB8','GL_RGB5_A1','GL_RGB5','GL_RGB4','GL_RGB16','GL_RGB12','GL_RGB10_A2','GL_RGB10','GL_RGB','GL_RETURN',
- 'GL_REPLACE','GL_REPEAT','GL_RENDER_MODE','GL_RENDERER','GL_RENDER','GL_RED_SCALE','GL_RED_BITS','GL_RED_BIAS',
- 'GL_RED','GL_READ_BUFFER','GL_R3_G3_B2','GL_R','GL_QUAD_STRIP','GL_QUADS','GL_QUADRATIC_ATTENUATION','GL_Q',
- 'GL_PROXY_TEXTURE_2D','GL_PROXY_TEXTURE_1D','GL_PROJECTION_STACK_DEPTH','GL_PROJECTION_MATRIX','GL_PROJECTION',
- 'GL_PRIMARY_COLOR_EXT','GL_PRIMARY_COLOR','GL_PREVIOUS_EXT','GL_PREVIOUS','GL_POSITION','GL_POLYGON_TOKEN',
- 'GL_POLYGON_STIPPLE_BIT','GL_POLYGON_STIPPLE','GL_POLYGON_SMOOTH_HINT','GL_POLYGON_SMOOTH','GL_POLYGON_OFFSET_UNITS',
- 'GL_POLYGON_OFFSET_POINT','GL_POLYGON_OFFSET_LINE','GL_POLYGON_OFFSET_FILL','GL_POLYGON_OFFSET_FACTOR','GL_POLYGON_MODE',
- 'GL_POLYGON_BIT','GL_POLYGON','GL_POINT_TOKEN','GL_POINT_SMOOTH_HINT','GL_POINT_SMOOTH','GL_POINT_SIZE_RANGE',
- 'GL_POINT_SIZE_GRANULARITY','GL_POINT_SIZE','GL_POINT_BIT','GL_POINTS','GL_POINT','GL_PIXEL_MODE_BIT',
- 'GL_PIXEL_MAP_S_TO_S_SIZE','GL_PIXEL_MAP_S_TO_S','GL_PIXEL_MAP_R_TO_R_SIZE','GL_PIXEL_MAP_R_TO_R','GL_PIXEL_MAP_I_TO_R_SIZE',
- 'GL_PIXEL_MAP_I_TO_R','GL_PIXEL_MAP_I_TO_I_SIZE','GL_PIXEL_MAP_I_TO_I','GL_PIXEL_MAP_I_TO_G_SIZE','GL_PIXEL_MAP_I_TO_G',
- 'GL_PIXEL_MAP_I_TO_B_SIZE','GL_PIXEL_MAP_I_TO_B','GL_PIXEL_MAP_I_TO_A_SIZE','GL_PIXEL_MAP_I_TO_A','GL_PIXEL_MAP_G_TO_G_SIZE',
- 'GL_PIXEL_MAP_G_TO_G','GL_PIXEL_MAP_B_TO_B_SIZE','GL_PIXEL_MAP_B_TO_B','GL_PIXEL_MAP_A_TO_A_SIZE','GL_PIXEL_MAP_A_TO_A',
- 'GL_PHONG_WIN','GL_PHONG_HINT_WIN','GL_PERSPECTIVE_CORRECTION_HINT','GL_PASS_THROUGH_TOKEN','GL_PACK_SWAP_BYTES',
- 'GL_PACK_SKIP_ROWS','GL_PACK_SKIP_PIXELS','GL_PACK_ROW_LENGTH','GL_PACK_LSB_FIRST','GL_PACK_ALIGNMENT','GL_OUT_OF_MEMORY',
- 'GL_OR_REVERSE','GL_OR_INVERTED','GL_ORDER','GL_OR','GL_OPERAND2_RGB_EXT','GL_OPERAND2_RGB','GL_OPERAND2_ALPHA_EXT',
- 'GL_OPERAND2_ALPHA','GL_OPERAND1_RGB_EXT','GL_OPERAND1_RGB','GL_OPERAND1_ALPHA_EXT','GL_OPERAND1_ALPHA','GL_OPERAND0_RGB_EXT',
- 'GL_OPERAND0_RGB','GL_OPERAND0_ALPHA_EXT','GL_OPERAND0_ALPHA','GL_ONE_MINUS_SRC_COLOR','GL_ONE_MINUS_SRC_ALPHA',
- 'GL_ONE_MINUS_DST_COLOR','GL_ONE_MINUS_DST_ALPHA','GL_ONE','GL_OBJECT_PLANE','GL_OBJECT_LINEAR','GL_NO_ERROR',
- 'GL_NOTEQUAL','GL_NORMAL_ARRAY_TYPE_EXT','GL_NORMAL_ARRAY_TYPE','GL_NORMAL_ARRAY_STRIDE_EXT','GL_NORMAL_ARRAY_STRIDE',
- 'GL_NORMAL_ARRAY_POINTER_EXT','GL_NORMAL_ARRAY_POINTER','GL_NORMAL_ARRAY_EXT','GL_NORMAL_ARRAY_COUNT_EXT',
- 'GL_NORMAL_ARRAY','GL_NORMALIZE','GL_NOR','GL_NOOP','GL_NONE','GL_NICEST','GL_NEVER','GL_NEAREST_MIPMAP_NEAREST','GL_NEAREST_MIPMAP_LINEAR',
- 'GL_NEAREST','GL_NAND','GL_NAME_STACK_DEPTH','GL_N3F_V3F','GL_MULT','GL_MODULATE','GL_MODELVIEW_STACK_DEPTH','GL_MODELVIEW_MATRIX',
- 'GL_MODELVIEW','GL_MAX_VIEWPORT_DIMS','GL_MAX_TEXTURE_UNITS_ARB','GL_MAX_TEXTURE_UNITS','GL_MAX_TEXTURE_STACK_DEPTH',
- 'GL_MAX_TEXTURE_SIZE','GL_MAX_PROJECTION_STACK_DEPTH','GL_MAX_PIXEL_MAP_TABLE','GL_MAX_NAME_STACK_DEPTH','GL_MAX_MODELVIEW_STACK_DEPTH',
- 'GL_MAX_LIST_NESTING','GL_MAX_LIGHTS','GL_MAX_EVAL_ORDER','GL_MAX_ELEMENTS_VERTICES_WIN','GL_MAX_ELEMENTS_INDICES_WIN',
- 'GL_MAX_CLIP_PLANES','GL_MAX_CLIENT_ATTRIB_STACK_DEPTH','GL_MAX_ATTRIB_STACK_DEPTH','GL_MATRIX_MODE','GL_MAP_STENCIL',
- 'GL_MAP_COLOR','GL_MAP2_VERTEX_4','GL_MAP2_VERTEX_3','GL_MAP2_TEXTURE_COORD_4','GL_MAP2_TEXTURE_COORD_3','GL_MAP2_TEXTURE_COORD_2',
- 'GL_MAP2_TEXTURE_COORD_1','GL_MAP2_NORMAL','GL_MAP2_INDEX','GL_MAP2_GRID_SEGMENTS','GL_MAP2_GRID_DOMAIN','GL_MAP2_COLOR_4',
- 'GL_MAP1_VERTEX_4','GL_MAP1_VERTEX_3','GL_MAP1_TEXTURE_COORD_4','GL_MAP1_TEXTURE_COORD_3','GL_MAP1_TEXTURE_COORD_2',
- 'GL_MAP1_TEXTURE_COORD_1','GL_MAP1_NORMAL','GL_MAP1_INDEX','GL_MAP1_GRID_SEGMENTS','GL_MAP1_GRID_DOMAIN',
- 'GL_MAP1_COLOR_4','GL_LUMINANCE_ALPHA','GL_LUMINANCE8_ALPHA8','GL_LUMINANCE8','GL_LUMINANCE6_ALPHA2','GL_LUMINANCE4_ALPHA4',
- 'GL_LUMINANCE4','GL_LUMINANCE16_ALPHA16','GL_LUMINANCE16','GL_LUMINANCE12_ALPHA4','GL_LUMINANCE12_ALPHA12','GL_LUMINANCE12',
- 'GL_LUMINANCE','GL_LOGIC_OP_MODE','GL_LOGIC_OP','GL_LOAD','GL_LIST_MODE','GL_LIST_INDEX','GL_LIST_BIT',
- 'GL_LIST_BASE','GL_LINE_WIDTH_RANGE','GL_LINE_WIDTH_GRANULARITY','GL_LINE_WIDTH','GL_LINE_TOKEN','GL_LINE_STRIP','GL_LINE_STIPPLE_REPEAT',
- 'GL_LINE_STIPPLE_PATTERN','GL_LINE_STIPPLE','GL_LINE_SMOOTH_HINT','GL_LINE_SMOOTH','GL_LINE_RESET_TOKEN','GL_LINE_LOOP',
- 'GL_LINE_BIT','GL_LINES','GL_LINEAR_MIPMAP_NEAREST','GL_LINEAR_MIPMAP_LINEAR','GL_LINEAR_ATTENUATION','GL_LINEAR',
- 'GL_LINE','GL_LIGHT_MODEL_TWO_SIDE','GL_LIGHT_MODEL_LOCAL_VIEWER','GL_LIGHT_MODEL_AMBIENT','GL_LIGHTING_BIT',
- 'GL_LIGHTING','GL_LIGHT7','GL_LIGHT6','GL_LIGHT5','GL_LIGHT4','GL_LIGHT3','GL_LIGHT2','GL_LIGHT1','GL_LIGHT0',
- 'GL_LESS','GL_LEQUAL','GL_LEFT','GL_KEEP','GL_INVERT','GL_INVALID_VALUE','GL_INVALID_OPERATION','GL_INVALID_ENUM','GL_INTERPOLATE_EXT',
- 'GL_INTERPOLATE','GL_INTENSITY8','GL_INTENSITY4','GL_INTENSITY16','GL_INTENSITY12','GL_INTENSITY','GL_INT',
- 'GL_INDEX_WRITEMASK','GL_INDEX_SHIFT','GL_INDEX_OFFSET','GL_INDEX_MODE','GL_INDEX_LOGIC_OP','GL_INDEX_CLEAR_VALUE','GL_INDEX_BITS',
- 'GL_INDEX_ARRAY_TYPE_EXT','GL_INDEX_ARRAY_TYPE','GL_INDEX_ARRAY_STRIDE_EXT','GL_INDEX_ARRAY_STRIDE','GL_INDEX_ARRAY_POINTER_EXT',
- 'GL_INDEX_ARRAY_POINTER','GL_INDEX_ARRAY_EXT','GL_INDEX_ARRAY_COUNT_EXT','GL_INDEX_ARRAY','GL_INCR','GL_HINT_BIT',
- 'GL_GREEN_SCALE','GL_GREEN_BITS','GL_GREEN_BIAS','GL_GREEN','GL_GREATER','GL_GEQUAL','GL_FRONT_RIGHT','GL_FRONT_LEFT',
- 'GL_FRONT_FACE','GL_FRONT_AND_BACK','GL_FRONT','GL_FOG_START','GL_FOG_SPECULAR_TEXTURE_WIN','GL_FOG_MODE','GL_FOG_INDEX',
- 'GL_FOG_HINT','GL_FOG_END','GL_FOG_DENSITY','GL_FOG_COLOR','GL_FOG_BIT','GL_FOG','GL_FLOAT','GL_FLAT','GL_FILL',
- 'GL_FEEDBACK_BUFFER_TYPE','GL_FEEDBACK_BUFFER_SIZE','GL_FEEDBACK_BUFFER_POINTER','GL_FEEDBACK','GL_FASTEST','GL_FALSE',
- 'GL_EYE_PLANE','GL_EYE_LINEAR','GL_EXT_vertex_array','GL_EXT_paletted_texture','GL_EXT_bgra','GL_EXTENSIONS','GL_EXP2',
- 'GL_EXP','GL_EVAL_BIT','GL_EQUIV','GL_EQUAL','GL_ENABLE_BIT','GL_EMISSION','GL_EDGE_FLAG_ARRAY_STRIDE_EXT','GL_EDGE_FLAG_ARRAY_STRIDE',
- 'GL_EDGE_FLAG_ARRAY_POINTER_EXT','GL_EDGE_FLAG_ARRAY_POINTER','GL_EDGE_FLAG_ARRAY_EXT','GL_EDGE_FLAG_ARRAY_COUNT_EXT','GL_EDGE_FLAG_ARRAY',
- 'GL_EDGE_FLAG','GL_DST_COLOR','GL_DST_ALPHA','GL_DRAW_PIXEL_TOKEN','GL_DRAW_BUFFER','GL_DOUBLE_EXT','GL_DOUBLEBUFFER',
- 'GL_DOUBLE','GL_DONT_CARE','GL_DOMAIN','GL_DITHER','GL_DIFFUSE','GL_DEPTH_WRITEMASK','GL_DEPTH_TEST','GL_DEPTH_SCALE',
- 'GL_DEPTH_RANGE','GL_DEPTH_FUNC','GL_DEPTH_COMPONENT','GL_DEPTH_CLEAR_VALUE','GL_DEPTH_BUFFER_BIT','GL_DEPTH_BITS',
- 'GL_DEPTH_BIAS','GL_DEPTH','GL_DECR','GL_DECAL','GL_CW','GL_CURRENT_TEXTURE_COORDS','GL_CURRENT_RASTER_TEXTURE_COORDS','GL_CURRENT_RASTER_POSITION_VALID',
- 'GL_CURRENT_RASTER_POSITION','GL_CURRENT_RASTER_INDEX','GL_CURRENT_RASTER_DISTANCE','GL_CURRENT_RASTER_COLOR','GL_CURRENT_NORMAL',
- 'GL_CURRENT_INDEX','GL_CURRENT_COLOR','GL_CURRENT_BIT','GL_CULL_FACE_MODE','GL_CULL_FACE','GL_COPY_PIXEL_TOKEN',
- 'GL_COPY_INVERTED','GL_COPY','GL_CONSTANT_EXT','GL_CONSTANT_ATTENUATION','GL_CONSTANT','GL_COMPILE_AND_EXECUTE','GL_COMPILE','GL_COMBINE_RGB_EXT',
- 'GL_COMBINE_RGB','GL_COMBINE_EXT','GL_COMBINE_ALPHA_EXT','GL_COMBINE_ALPHA','GL_COMBINE','GL_COLOR_WRITEMASK',
- 'GL_COLOR_TABLE_WIDTH_EXT','GL_COLOR_TABLE_RED_SIZE_EXT','GL_COLOR_TABLE_LUMINANCE_SIZE_EXT','GL_COLOR_TABLE_INTENSITY_SIZE_EXT',
- 'GL_COLOR_TABLE_GREEN_SIZE_EXT','GL_COLOR_TABLE_FORMAT_EXT','GL_COLOR_TABLE_BLUE_SIZE_EXT','GL_COLOR_TABLE_ALPHA_SIZE_EXT',
- 'GL_COLOR_MATERIAL_PARAMETER','GL_COLOR_MATERIAL_FACE','GL_COLOR_MATERIAL','GL_COLOR_LOGIC_OP','GL_COLOR_INDEXES',
- 'GL_COLOR_INDEX8_EXT','GL_COLOR_INDEX4_EXT','GL_COLOR_INDEX2_EXT','GL_COLOR_INDEX1_EXT','GL_COLOR_INDEX16_EXT',
- 'GL_COLOR_INDEX12_EXT','GL_COLOR_INDEX','GL_COLOR_CLEAR_VALUE','GL_COLOR_BUFFER_BIT','GL_COLOR_ARRAY_TYPE_EXT',
- 'GL_COLOR_ARRAY_TYPE','GL_COLOR_ARRAY_STRIDE_EXT','GL_COLOR_ARRAY_STRIDE','GL_COLOR_ARRAY_SIZE_EXT','GL_COLOR_ARRAY_SIZE',
- 'GL_COLOR_ARRAY_POINTER_EXT','GL_COLOR_ARRAY_POINTER','GL_COLOR_ARRAY_EXT','GL_COLOR_ARRAY_COUNT_EXT','GL_COLOR_ARRAY',
- 'GL_COLOR','GL_COEFF','GL_CLIP_PLANE5','GL_CLIP_PLANE4','GL_CLIP_PLANE3','GL_CLIP_PLANE2','GL_CLIP_PLANE1','GL_CLIP_PLANE0',
- 'GL_CLIENT_VERTEX_ARRAY_BIT','GL_CLIENT_PIXEL_STORE_BIT','GL_CLIENT_ATTRIB_STACK_DEPTH','GL_CLIENT_ALL_ATTRIB_BITS',
- 'GL_CLIENT_ACTIVE_TEXTURE_ARB','GL_CLIENT_ACTIVE_TEXTURE','GL_CLEAR','GL_CLAMP','GL_CCW','GL_C4UB_V3F','GL_C4UB_V2F',
- 'GL_C4F_N3F_V3F','GL_C3F_V3F','GL_BYTE','GL_BLUE_SCALE','GL_BLUE_BITS','GL_BLUE_BIAS','GL_BLUE','GL_BLEND_SRC','GL_BLEND_DST',
- 'GL_BLEND','GL_BITMAP_TOKEN','GL_BITMAP','GL_BGR_EXT','GL_BGRA_EXT','GL_BACK_RIGHT','GL_BACK_LEFT','GL_BACK',
- 'GL_AUX_BUFFERS','GL_AUX3','GL_AUX2','GL_AUX1','GL_AUX0','GL_AUTO_NORMAL','GL_ATTRIB_STACK_DEPTH','GL_AND_REVERSE',
- 'GL_AND_INVERTED','GL_AND','GL_AMBIENT_AND_DIFFUSE','GL_AMBIENT','GL_ALWAYS','GL_ALPHA_TEST_REF','GL_ALPHA_TEST_FUNC',
- 'GL_ALPHA_TEST','GL_ALPHA_SCALE','GL_ALPHA_BITS','GL_ALPHA_BIAS','GL_ALPHA8','GL_ALPHA4','GL_ALPHA16','GL_ALPHA12',
- 'GL_ALPHA','GL_ALL_ATTRIB_BITS','GL_ADD_SIGNED_EXT','GL_ADD_SIGNED','GL_ADD','GL_ACTIVE_TEXTURE_ARB','GL_ACTIVE_TEXTURE',
- 'GL_ACCUM_RED_BITS','GL_ACCUM_GREEN_BITS','GL_ACCUM_CLEAR_VALUE','GL_ACCUM_BUFFER_BIT','GL_ACCUM_BLUE_BITS','GL_ACCUM_ALPHA_BITS',
- 'GL_ACCUM','GL_4_BYTES','GL_4D_COLOR_TEXTURE','GL_3_BYTES','GL_3D_COLOR_TEXTURE','GL_3D_COLOR','GL_3D','GL_2_BYTES',
- 'GL_2D','GLU_V_STEP','GLU_VERTEX','GLU_VERSION_1_2','GLU_VERSION_1_1','GLU_VERSION','GLU_U_STEP','GLU_UNKNOWN','GLU_TRUE',
- 'GLU_TESS_WINDING_RULE','GLU_TESS_WINDING_POSITIVE','GLU_TESS_WINDING_ODD','GLU_TESS_WINDING_NONZERO','GLU_TESS_WINDING_NEGATIVE',
- 'GLU_TESS_WINDING_ABS_GEQ_TWO','GLU_TESS_VERTEX_DATA','GLU_TESS_VERTEX','GLU_TESS_TOLERANCE','GLU_TESS_NEED_COMBINE_CALLBACK','GLU_TESS_MISSING_END_POLYGON',
- 'GLU_TESS_MISSING_END_CONTOUR','GLU_TESS_MISSING_BEGIN_POLYGON','GLU_TESS_MISSING_BEGIN_CONTOUR','GLU_TESS_ERROR_DATA',
- 'GLU_TESS_ERROR8','GLU_TESS_ERROR7','GLU_TESS_ERROR6','GLU_TESS_ERROR5','GLU_TESS_ERROR4','GLU_TESS_ERROR3','GLU_TESS_ERROR2',
- 'GLU_TESS_ERROR1','GLU_TESS_ERROR','GLU_TESS_END_DATA','GLU_TESS_END','GLU_TESS_EDGE_FLAG_DATA','GLU_TESS_EDGE_FLAG',
- 'GLU_TESS_COORD_TOO_LARGE','GLU_TESS_COMBINE_DATA','GLU_TESS_COMBINE','GLU_TESS_BOUNDARY_ONLY','GLU_TESS_BEGIN_DATA',
- 'GLU_TESS_BEGIN','GLU_SMOOTH','GLU_SILHOUETTE','GLU_SAMPLING_TOLERANCE','GLU_SAMPLING_METHOD','GLU_POINT','GLU_PATH_LENGTH',
- 'GLU_PARAMETRIC_TOLERANCE','GLU_PARAMETRIC_ERROR','GLU_OUT_OF_MEMORY','GLU_OUTSIDE','GLU_OUTLINE_POLYGON','GLU_OUTLINE_PATCH',
- 'GLU_NURBS_ERROR9','GLU_NURBS_ERROR8','GLU_NURBS_ERROR7','GLU_NURBS_ERROR6','GLU_NURBS_ERROR5','GLU_NURBS_ERROR4',
- 'GLU_NURBS_ERROR37','GLU_NURBS_ERROR36','GLU_NURBS_ERROR35','GLU_NURBS_ERROR34','GLU_NURBS_ERROR33','GLU_NURBS_ERROR32',
- 'GLU_NURBS_ERROR31','GLU_NURBS_ERROR30','GLU_NURBS_ERROR3','GLU_NURBS_ERROR29','GLU_NURBS_ERROR28','GLU_NURBS_ERROR27','GLU_NURBS_ERROR26',
- 'GLU_NURBS_ERROR25','GLU_NURBS_ERROR24','GLU_NURBS_ERROR23','GLU_NURBS_ERROR22','GLU_NURBS_ERROR21','GLU_NURBS_ERROR20',
- 'GLU_NURBS_ERROR2','GLU_NURBS_ERROR19','GLU_NURBS_ERROR18','GLU_NURBS_ERROR17','GLU_NURBS_ERROR16','GLU_NURBS_ERROR15','GLU_NURBS_ERROR14',
- 'GLU_NURBS_ERROR13','GLU_NURBS_ERROR12','GLU_NURBS_ERROR11','GLU_NURBS_ERROR10','GLU_NURBS_ERROR1','GLU_NONE',
- 'GLU_MAP1_TRIM_3','GLU_MAP1_TRIM_2','GLU_LINE','GLU_INVALID_VALUE','GLU_INVALID_ENUM','GLU_INTERIOR','GLU_INSIDE','GLU_INCOMPATIBLE_GL_VERSION',
- 'GLU_FLAT','GLU_FILL','GLU_FALSE','GLU_EXTERIOR','GLU_EXTENSIONS','GLU_ERROR','GLU_END','GLU_EDGE_FLAG','GLU_DOMAIN_DISTANCE',
- 'GLU_DISPLAY_MODE','GLU_CW','GLU_CULLING','GLU_CCW','GLU_BEGIN','GLU_AUTO_LOAD_MATRIX','CHANNEL_UNORDERED','CHANNEL_ORDERED',
- 'CHANNEL_MAX'
- ),
- 2 => array(
-
- // Red Lowercase Keywords
-
- 'WriteWord','WriteString','WriteReal','WriteLine','WriteInt','WriteFloat','WriteDouble','WriteChar','WriteByte',
- 'windowwidth','windowheight','waittimer','Vec4','Vec3','Vec2','val','UpdateJoystick','ucase$','Transpose','tickcount',
- 'textscroll','textrows','textmode','textcols','tanh','tand','tan','synctimercatchup','synctimer','swapbuffers',
- 'str$','stopsoundvoice','stopsounds','stopmusic','sqrt','sqr','sprzorder','spryvel','sprytiles','sprysize','spryrepeat',
- 'spryflip','sprycentre','spry','sprxvel','sprxtiles','sprxsize','sprxrepeat','sprxflip','sprxcentre','sprx',
- 'sprvisible','sprvel','sprtype','sprtop','sprspin','sprsolid','sprsetzorder','sprsetyvel','sprsetysize','sprsetyrepeat',
- 'sprsetyflip','sprsetycentre','sprsety','sprsetxvel','sprsetxsize','sprsetxrepeat','sprsetxflip','sprsetxcentre',
- 'sprsetx','sprsetvisible','sprsetvel','sprsettiles','sprsettextures','sprsettexture','sprsetspin','sprsetsolid',
- 'sprsetsize','sprsetscale','sprsetpos','sprsetparallax','sprsetframe','sprsetcolor','sprsetanimspeed','sprsetanimloop',
- 'sprsetangle','sprsetalpha','sprscale','sprright','sprpos','sprparallax','sprleft','spriteareawidth','spriteareaheight',
- 'sprframe','sprcolor','sprcameraz','sprcameray','sprcamerax','sprcamerasetz','sprcamerasety','sprcamerasetx',
- 'sprcamerasetpos','sprcamerasetfov','sprcamerasetangle','sprcamerapos','sprcamerafov','sprcameraangle',
- 'sprbottom','spranimspeed','spranimloop','spranimdone','sprangle','spralpha','spraddtextures','spraddtexture',
- 'sounderror','sleep','sind','sin','showcursor','sgn','settextscroll','setmusicvolume','SendMessage','Seek',
- 'scankeydown','RTInvert','rnd','right$','resizetext','resizespritearea','RejectConnection','ReceiveMessage','ReadWord',
- 'ReadText','ReadReal','ReadLine','ReadInt','ReadFloat','ReadDouble','ReadChar','ReadByte','randomize','printr',
- 'print','pow','playsound','playmusic','performancecounter','Orthonormalize','OpenFileWrite','OpenFileRead','Normalize',
- 'newtilemap','newsprite','NewServer','NewConnection','musicplaying','mouse_yd','mouse_y','mouse_xd','mouse_x',
- 'mouse_wheel','mouse_button','mid$','MessageSmoothed','MessageReliable','MessagePending','MessageChannel','maxtextureunits',
- 'MatrixZero','MatrixTranslate','MatrixScale','MatrixRotateZ','MatrixRotateY','MatrixRotateX','MatrixRotate','MatrixIdentity',
- 'MatrixCrossProduct','MatrixBasis','log','locate','loadtexture','loadsound','loadmipmaptexture','loadmipmapimagestrip',
- 'loadimagestrip','loadimage','Length','len','left$','lcase$','keydown','Joy_Y','Joy_X','Joy_Up','Joy_Right','Joy_Left',
- 'Joy_Keys','Joy_Down','Joy_Button','Joy_3','Joy_2','Joy_1','Joy_0','int','inscankey','input$','inkey$','inittimer',
- 'imagewidth','imagestripframes','imageheight','imageformat','imagedatatype','hidecursor','glViewport','glVertex4sv',
- 'glVertex4s','glVertex4iv','glVertex4i','glVertex4fv','glVertex4f','glVertex4dv','glVertex4d','glVertex3sv','glVertex3s',
- 'glVertex3iv','glVertex3i','glVertex3fv','glVertex3f','glVertex3dv','glVertex3d','glVertex2sv','glVertex2s','glVertex2iv',
- 'glVertex2i','glVertex2fv','glVertex2f','glVertex2dv','glVertex2d','gluPerspective','gluOrtho2D','gluLookAt',
- 'glubuild2dmipmaps','glTranslatef','glTranslated','gltexsubimage2d','glTexParameteriv','glTexParameteri',
- 'glTexParameterfv','glTexParameterf','glteximage2d','glTexGeniv','glTexGeni','glTexGenfv','glTexGenf','glTexGendv',
- 'glTexGend','glTexEnviv','glTexEnvi','glTexEnvfv','glTexEnvf','glTexCoord4sv','glTexCoord4s','glTexCoord4iv','glTexCoord4i',
- 'glTexCoord4fv','glTexCoord4f','glTexCoord4dv','glTexCoord4d','glTexCoord3sv','glTexCoord3s','glTexCoord3iv','glTexCoord3i',
- 'glTexCoord3fv','glTexCoord3f','glTexCoord3dv','glTexCoord3d','glTexCoord2sv','glTexCoord2s','glTexCoord2iv','glTexCoord2i',
- 'glTexCoord2fv','glTexCoord2f','glTexCoord2dv','glTexCoord2d','glTexCoord1sv','glTexCoord1s','glTexCoord1iv','glTexCoord1i','glTexCoord1fv',
- 'glTexCoord1f','glTexCoord1dv','glTexCoord1d','glStencilOp','glStencilMask','glStencilFunc','glShadeModel','glSelectBuffer',
- 'glScissor','glScalef','glScaled','glRotatef','glRotated','glRenderMode','glRectsv','glRects','glRectiv','glRecti',
- 'glRectfv','glRectf','glRectdv','glRectd','glReadBuffer','glRasterPos4sv','glRasterPos4s','glRasterPos4iv',
- 'glRasterPos4i','glRasterPos4fv','glRasterPos4f','glRasterPos4dv','glRasterPos4d','glRasterPos3sv','glRasterPos3s',
- 'glRasterPos3iv','glRasterPos3i','glRasterPos3fv','glRasterPos3f','glRasterPos3dv','glRasterPos3d','glRasterPos2sv',
- 'glRasterPos2s','glRasterPos2iv','glRasterPos2i','glRasterPos2fv','glRasterPos2f','glRasterPos2dv','glRasterPos2d',
- 'glPushName','glPushMatrix','glPushClientAttrib','glPushAttrib','glPrioritizeTextures','glPopName','glPopMatrix',
- 'glPopClientAttrib','glPopAttrib','glpolygonstipple','glPolygonOffset','glPolygonMode','glPointSize','glPixelZoom',
- 'glPixelTransferi','glPixelTransferf','glPixelStorei','glPixelStoref','glPassThrough','glOrtho','glNormal3sv','glNormal3s',
- 'glNormal3iv','glNormal3i','glNormal3fv','glNormal3f','glNormal3dv','glNormal3d','glNormal3bv','glNormal3b','glNewList',
- 'glMultMatrixf','glMultMatrixd','glmultitexcoord2f','glmultitexcoord2d','glMatrixMode','glMaterialiv','glMateriali',
- 'glMaterialfv','glMaterialf','glMapGrid2f','glMapGrid2d','glMapGrid1f','glMapGrid1d','glLogicOp','glLoadName','glLoadMatrixf',
- 'glLoadMatrixd','glLoadIdentity','glListBase','glLineWidth','glLineStipple','glLightModeliv','glLightModeli','glLightModelfv',
- 'glLightModelf','glLightiv','glLighti','glLightfv','glLightf','glIsTexture','glIsList','glIsEnabled','glInitNames',
- 'glIndexubv','glIndexub','glIndexsv','glIndexs','glIndexMask','glIndexiv','glIndexi','glIndexfv','glIndexf','glIndexdv',
- 'glIndexd','glHint','glGetTexParameteriv','glGetTexParameterfv','glGetTexLevelParameteriv','glGetTexLevelParameterfv',
- 'glGetTexGeniv','glGetTexGenfv','glGetTexGendv','glGetTexEnviv','glGetTexEnvfv','glgetstring','glgetpolygonstipple','glGetPixelMapuiv',
- 'glGetMaterialiv','glGetMaterialfv','glGetLightiv','glGetLightfv','glGetIntegerv','glGetFloatv',
- 'glGetError','glGetDoublev','glGetClipPlane','glGetBooleanv','glgentextures','glgentexture',
- 'glgenlists','glFrustum','glFrontFace','glFogiv','glFogi','glFogfv','glFogf','glFlush','glFinish','glFeedbackBuffer',
- 'glEvalPoint2','glEvalPoint1','glEvalMesh2','glEvalMesh1','glEvalCoord2fv','glEvalCoord2f','glEvalCoord2dv','glEvalCoord2d',
- 'glEvalCoord1fv','glEvalCoord1f','glEvalCoord1dv','glEvalCoord1d','glEndList','glEnd','glEnableClientState','glEnable',
- 'glEdgeFlagv','glEdgeFlag','glDrawBuffer','glDrawArrays','glDisableClientState','glDisable','glDepthRange','glDepthMask',
- 'glDepthFunc','gldeletetextures','gldeletetexture','gldeletelists','glCullFace','glCopyTexSubImage2D','glCopyTexSubImage1D',
- 'glCopyTexImage2D','glCopyTexImage1D','glColorMaterial','glColorMask','glColor4usv','glColor4us','glColor4uiv','glColor4ui',
- 'glColor4ubv','glColor4ub','glColor4sv','glColor4s','glColor4iv','glColor4i','glColor4fv','glColor4f','glColor4dv',
- 'glColor4d','glColor4bv','glColor4b','glColor3usv','glColor3us','glColor3uiv','glColor3ui','glColor3ubv','glColor3ub',
- 'glColor3sv','glColor3s','glColor3iv','glColor3i','glColor3fv','glColor3f','glColor3dv','glColor3d','glColor3bv',
- 'glColor3b','glClipPlane','glClearStencil','glClearIndex','glClearDepth','glClearColor','glClearAccum','glClear',
- 'glcalllists','glCallList','glBlendFunc','glBindTexture','glBegin','glArrayElement','glAreTexturesResident',
- 'glAlphaFunc','glactivetexture','glAccum','font','FindNextFile','FindFirstFile','FindClose','FileError',
- 'extensionsupported','exp','execute','EndOfFile','drawtext','divbyzero','Determinant','deletesprite','deletesound',
- 'DeleteServer','deleteimage','DeleteConnection','defaultfont','CrossProduct','cosd','cos','copysprite','ConnectionPending',
- 'ConnectionHandShaking','ConnectionConnected','ConnectionAddress','compilererrorline','compilererrorcol','compilererror',
- 'compilefile','compile','color','cls','CloseFile','clearregion','clearline','clearkeys','chr$','charat$','bindsprite',
- 'beep','atnd','atn2d','atn2','atn','atand','asc','argcount','arg','animatesprites','AcceptConnection','abs'
- ),
- 3 => array(
-
- // Blue Lowercase Keywords
-
- 'xor','while','wend','until','type','traditional_print','traditional','to','then','struc','string','step','single',
- 'run','return','reset','read','or','null','not','next','lor','loop','language','land','integer','input','if',
- 'goto','gosub','for','endstruc','endif','end','elseif','else','double','do','dim','data','const','basic4gl','as',
- 'and','alloc'
- )
-
- ),
- 'SYMBOLS' => array(
- '=', '<', '>', '>=', '<=', '+', '-', '*', '/', '%', '(', ')', '{', '}', '[', ']', '&', ';', ':', '$'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000080; font-weight: bold;',
- 2 => 'color: #FF0000;',
- 3 => 'color: #0000FF;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #657CC4; font-style: italic;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000080;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #008000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000080; font-weight: bold;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #0000FF;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/bf.php b/libvpx/examples/includes/geshi/geshi/bf.php
deleted file mode 100644
index e5dcc42..0000000
--- a/libvpx/examples/includes/geshi/geshi/bf.php
+++ /dev/null
@@ -1,114 +0,0 @@
-<?php
-/*************************************************************************************
- * bf.php
- * ----------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2009/10/31
- *
- * Brainfuck language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/31 (1.0.8.1)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'Brainfuck',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(1 => '/[^\n+\-<>\[\]\.\,Y]+/s'),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => array('+', '-'),
- 1 => array('[', ']'),
- 2 => array('<', '>'),
- 3 => array('.', ','),
- 4 => array('Y') //Brainfork Extension ;-)
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #006600;',
- 1 => 'color: #660000;',
- 2 => 'color: #000066;',
- 3 => 'color: #660066;',
- 4 => 'color: #666600;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'STRINGS' => GESHI_NEVER,
- 'NUMBERS' => GESHI_NEVER
- ),
- 'KEYWORDS' => array(
- 'DISALLOW_BEFORE' => '',
- 'DISALLOW_AFTER' => ''
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/blitzbasic.php b/libvpx/examples/includes/geshi/geshi/blitzbasic.php
deleted file mode 100644
index a8c3259..0000000
--- a/libvpx/examples/includes/geshi/geshi/blitzbasic.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-/*************************************************************************************
- * blitzbasic.php
- * --------------
- * Author: P�draig O`Connel (info@moonsword.info)
- * Copyright: (c) 2005 P�draig O`Connel (http://moonsword.info)
- * Release Version: 1.0.8.3
- * Date Started: 16.10.2005
- *
- * BlitzBasic language file for GeSHi.
- *
- * It is a simple Basic dialect. Released for Games and Network Connections.
- * In this Language File are all functions included (2D BB and 3D BB)
- *
- *
- * CHANGES
- * -------
- * 2005/12/28 (1.0.1)
- * - Remove unnecessary style index for regexps
- * 2005/10/22 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/10/22)
- * -------------------------
- * * Sort out the Basic commands for splitting up.
- * * To set up the right colors.
- * (the colors are ok, but not the correct ones)
- * * Split to BlitzBasic 2D and BlitzBasic 3D.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'BlitzBasic',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'If','EndIf','ElseIf','Else If','Else','While','Wend','Return','Next','Include','End Type','End Select','End If','End Function','End','Select',
- 'Type','Forever','For','Or','And','AppTitle','Case','Goto','Gosub','Step','Stop','Int','Last','False','Then','To','True','Until','Float',
- 'String','Before','Not'
- ),
- 2 => array(
- // All Functions - 2D BB and 3D BB
- 'Xor','WriteString','WriteShort','WritePixelFast','WritePixel','WriteLine','WriteInt','WriteFloat','WriteFile','WriteBytes',
- 'WriteByte','Write','WaitTimer','WaitMouse','WaitKey','WaitJoy','VWait','Viewport',
- 'Upper','UpdateGamma','UnlockBuffer','UDPTimeouts','UDPStreamPort','UDPStreamIP','UDPMsgPort','UDPMsgIP',
- 'Trim','TotalVidMem','TileImage','TileBlock','TFormImage','TFormFilter','Text',
- 'TCPTimeouts','TCPStreamPort','TCPStreamIP','Tan','SystemProperty','StringWidth','StringHeight','Str','StopNetGame',
- 'StopChannel','StartNetGame','Sqr','SoundVolume','SoundPitch','SoundPan','Sin','Shr',
- 'ShowPointer','Shl','Sgn','SetGfxDriver','SetGamma','SetFont','SetEnv','SetBuffer','SendUDPMsg','SendNetMsg',
- 'SeekFile','SeedRnd','ScanLine','ScaleImage','SaveImage','SaveBuffer','Sar','RuntimeError','RSet',
- 'RotateImage','RndSeed','Rnd','Right','ResumeChannel','Restore','ResizeImage','ResizeBank','Replace',
- 'Repeat','RecvUDPMsg','RecvNetMsg','RectsOverlap','Rect','ReadString','ReadShort','ReadPixelFast','ReadPixel','ReadLine',
- 'ReadInt','ReadFloat','ReadFile','ReadDir','ReadBytes','ReadByte','ReadAvail','Read','Rand','Print',
- 'PokeShort','PokeInt','PokeFloat','PokeByte','Plot','PlaySound','PlayMusic','PlayCDTrack','Pi','PeekShort',
- 'PeekInt','PeekFloat','PeekByte','PauseChannel','Oval','Origin','OpenTCPStream','OpenMovie','OpenFile',
- 'Null','NextFile','New','NetPlayerName','NetPlayerLocal','NetMsgType','NetMsgTo','NetMsgFrom',
- 'NetMsgData','MovieWidth','MoviePlaying','MovieHeight','MoveMouse','MouseZSpeed','MouseZ','MouseYSpeed','MouseY','MouseXSpeed',
- 'MouseX','MouseHit','MouseDown','Mod','Millisecs','MidHandle','Mid','MaskImage','LSet','Lower',
- 'LoopSound','Log10','Log','LockBuffer','Locate','Local','LoadSound','LoadImage','LoadFont','LoadBuffer',
- 'LoadAnimImage','Line','Len','Left','KeyHit','KeyDown','JoyZDir','JoyZ','JoyYDir',
- 'JoyYaw','JoyY','JoyXDir','JoyX','JoyVDir','JoyV','JoyUDir','JoyU','JoyType','JoyRoll',
- 'JoyPitch','JoyHit','JoyHat','JoyDown','JoinNetGame','Instr','Insert','Input',
- 'ImageYHandle','ImageXHandle','ImageWidth','ImagesOverlap','ImagesCollide','ImageRectOverlap','ImageRectCollide','ImageHeight','ImageBuffer',
- 'HostNetGame','HostIP','HidePointer','Hex','HandleImage','GraphicsWidth','GraphicsHeight','GraphicsDepth','GraphicsBuffer','Graphics',
- 'GrabImage','Global','GFXModeWidth','GFXModeHeight','GfxModeExists','GFXModeDepth','GfxDriverName','GetMouse',
- 'GetKey','GetJoy','GetEnv','GetColor','GammaRed','GammaGreen','GammaBlue','Function','FrontBuffer','FreeTimer',
- 'FreeSound','FreeImage','FreeFont','FreeBank','FontWidth','FontHeight','FlushMouse','FlushKeys',
- 'FlushJoy','Floor','Flip','First','FileType','FileSize','FilePos','Field',
- 'Exp','Exit','ExecFile','Eof','EndGraphics','Each','DrawMovie','DrawImageRect','DrawImage','DrawBlockRect','DrawBlock',
- 'DottedIP','Dim','DeleteNetPlayer','DeleteFile','DeleteDir','Delete','Delay','Default','DebugLog','Data',
- 'CurrentTime','CurrentDir','CurrentDate','CreateUDPStream','CreateTimer','CreateTCPServer','CreateNetPlayer','CreateImage','CreateDir','CreateBank',
- 'CountHostIPs','CountGFXModes','CountGfxDrivers','Cos','CopyStream','CopyRect','CopyPixelFast','CopyPixel','CopyImage','CopyFile',
- 'CopyBank','Const','CommandLine','ColorRed','ColorGreen','ColorBlue','Color','ClsColor','Cls','CloseUDPStream',
- 'CloseTCPStream','CloseTCPServer','CloseMovie','CloseFile','CloseDir','Chr','ChannelVolume','ChannelPlaying','ChannelPitch','ChannelPan',
- 'ChangeDir','Ceil','CallDLL','Bin','BankSize','BackBuffer','AvailVidMem','AutoMidHandle',
- 'ATan2','ATan','ASin','Asc','After','ACos','AcceptTCPStream','Abs',
- // 3D Commands
- 'Wireframe','Windowed3D','WBuffer','VertexZ','VertexY',
- 'VertexX','VertexW','VertexV','VertexU','VertexTexCoords','VertexRed','VertexNZ','VertexNY','VertexNX','VertexNormal',
- 'VertexGreen','VertexCoords','VertexColor','VertexBlue','VertexAlpha','VectorYaw','VectorPitch','UpdateWorld','UpdateNormals','TurnEntity',
- 'TrisRendered','TriangleVertex','TranslateEntity','TFormVector','TFormPoint','TFormNormal','TFormedZ','TFormedY','TFormedX','TextureWidth',
- 'TextureName','TextureHeight','TextureFilter','TextureCoords','TextureBuffer','TextureBlend','TerrainZ','TerrainY','TerrainX','TerrainSize',
- 'TerrainShading','TerrainHeight','TerrainDetail','SpriteViewMode','ShowEntity','SetCubeFace','SetAnimTime','SetAnimKey','ScaleTexture','ScaleSprite',
- 'ScaleMesh','ScaleEntity','RotateTexture','RotateSprite','RotateMesh','RotateEntity','ResetEntity','RenderWorld','ProjectedZ','ProjectedY',
- 'ProjectedX','PositionTexture','PositionMesh','PositionEntity','PointEntity','PickedZ','PickedY','PickedX','PickedTriangle','PickedTime',
- 'PickedSurface','PickedNZ','PickedNY','PickedNX','PickedEntity','PaintSurface','PaintMesh','PaintEntity','NameEntity','MoveEntity',
- 'ModifyTerrain','MeshWidth','MeshHeight','MeshesIntersect','MeshDepth','MD2AnimTime','MD2AnimLength','MD2Animating','LoadTexture','LoadTerrain',
- 'LoadSprite','LoadMesh','LoadMD2','LoaderMatrix','LoadBSP','LoadBrush','LoadAnimTexture','LoadAnimSeq','LoadAnimMesh','Load3DSound',
- 'LinePick','LightRange','LightMesh','LightConeAngles','LightColor','HWMultiTex','HideEntity','HandleSprite','Graphics3D','GfxMode3DExists',
- 'GfxMode3D','GfxDriverCaps3D','GfxDriver3D','GetSurfaceBrush','GetSurface','GetParent','GetMatElement','GetEntityType','GetEntityBrush','GetChild',
- 'GetBrushTexture','FreeTexture','FreeEntity','FreeBrush','FlipMesh','FitMesh','FindSurface','FindChild','ExtractAnimSeq','EntityZ',
- 'EntityYaw','EntityY','EntityX','EntityVisible','EntityType','EntityTexture','EntityShininess','EntityRoll','EntityRadius','EntityPitch',
- 'EntityPickMode','EntityPick','EntityParent','EntityOrder','EntityName','EntityInView','EntityFX','EntityDistance','EntityColor','EntityCollided',
- 'EntityBox','EntityBlend','EntityAutoFade','EntityAlpha','EmitSound','Dither','DeltaYaw','DeltaPitch','CreateTexture','CreateTerrain',
- 'CreateSurface','CreateSprite','CreateSphere','CreatePlane','CreatePivot','CreateMirror','CreateMesh','CreateListener','CreateLight','CreateCylinder',
- 'CreateCube','CreateCone','CreateCamera','CreateBrush','CountVertices','CountTriangles','CountSurfaces','CountGfxModes3D','CountCollisions','CountChildren',
- 'CopyMesh','CopyEntity','CollisionZ','CollisionY','CollisionX','CollisionTriangle','CollisionTime','CollisionSurface','Collisions','CollisionNZ',
- 'CollisionNY','CollisionNX','CollisionEntity','ClearWorld','ClearTextureFilters','ClearSurface','ClearCollisions','CaptureWorld','CameraZoom','CameraViewport',
- 'CameraRange','CameraProjMode','CameraProject','CameraPick','CameraFogRange','CameraFogMode','CameraFogColor','CameraClsMode','CameraClsColor','BSPLighting',
- 'BSPAmbientLight','BrushTexture','BrushShininess','BrushFX','BrushColor','BrushBlend','BrushAlpha','AntiAlias','AnimTime','AnimSeq',
- 'AnimLength','Animating','AnimateMD2','Animate','AmbientLight','AlignToVector','AddVertex','AddTriangle','AddMesh','AddAnimSeq',
- )
- ),
- 'SYMBOLS' => array(
- '(',')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000066; font-weight: bold;',
- 2 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #D9D100; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000066;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #009900;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #CC0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- 1 => '\\'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => false,
- 1 => false
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/bnf.php b/libvpx/examples/includes/geshi/geshi/bnf.php
deleted file mode 100644
index c9b3aae..0000000
--- a/libvpx/examples/includes/geshi/geshi/bnf.php
+++ /dev/null
@@ -1,110 +0,0 @@
-<?php
-/*************************************************************************************
- * bnf.php
- * --------
- * Author: Rowan Rodrik van der Molen (rowan@bigsmoke.us)
- * Copyright: (c) 2006 Rowan Rodrik van der Molen (http://www.bigsmoke.us/)
- * Release Version: 1.0.8.3
- * Date Started: 2006/09/28
- *
- * BNF (Backus-Naur form) language file for GeSHi.
- *
- * See http://en.wikipedia.org/wiki/Backus-Naur_form for more info on BNF.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * - Removed superflicious regexps
- * 2006/09/18 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/09/18)
- * -------------------------
- * * Nothing I can think of
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'bnf',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', "'"),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(),
- 'SYMBOLS' => array(
- '(', ')', '<', '>', '::=', '|'
- ),
- 'CASE_SENSITIVE' => array(
- //GESHI_COMMENTS => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(),
- 'COMMENTS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => ''
- ),
- 'STRINGS' => array(
- 0 => 'color: #a00;',
- 1 => 'color: #a00;'
- ),
- 'NUMBERS' => array(
- 0 => ''
- ),
- 'METHODS' => array(
- 0 => ''
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066; font-weight: bold;', // Unused
- ),
- 'REGEXPS' => array(
- 0 => 'color: #007;',
- ),
- 'SCRIPT' => array(
- 0 => ''
- )
- ),
- 'URLS' => array(),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- //terminal symbols
- 0 => array(
- GESHI_SEARCH => '(&lt;)([^&]+?)(&gt;)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/boo.php b/libvpx/examples/includes/geshi/geshi/boo.php
deleted file mode 100644
index 1741d2c..0000000
--- a/libvpx/examples/includes/geshi/geshi/boo.php
+++ /dev/null
@@ -1,217 +0,0 @@
-<?php
-/*************************************************************************************
- * boo.php
- * --------
- * Author: Marcus Griep (neoeinstein+GeSHi@gmail.com)
- * Copyright: (c) 2007 Marcus Griep (http://www.xpdm.us)
- * Release Version: 1.0.8.3
- * Date Started: 2007/09/10
- *
- * Boo language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/09/10 (1.0.8)
- * - First Release
- *
- * TODO (updated 2007/09/10)
- * -------------------------
- * Regular Expression Literal matching
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Boo',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'''", "'", '"""', '"'),
- 'HARDQUOTE' => array('"""', '"""'),
- 'HARDESCAPE' => array('\"""'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(//Namespace
- 'namespace', 'import', 'from'
- ),
- 2 => array(//Jump
- 'yield', 'return', 'goto', 'continue', 'break'
- ),
- 3 => array(//Conditional
- 'while', 'unless', 'then', 'in', 'if', 'for', 'else', 'elif'
- ),
- 4 => array(//Property
- 'set', 'get'
- ),
- 5 => array(//Exception
- 'try', 'raise', 'failure', 'except', 'ensure'
- ),
- 6 => array(//Visibility
- 'public', 'private', 'protected', 'internal'
- ),
- 7 => array(//Define
- 'struct', 'ref', 'of', 'interface', 'event', 'enum', 'do', 'destructor', 'def', 'constructor', 'class'
- ),
- 8 => array(//Cast
- 'typeof', 'cast', 'as'
- ),
- 9 => array(//BiMacro
- 'yieldAll', 'using', 'unchecked', 'rawArayIndexing', 'print', 'normalArrayIndexing', 'lock',
- 'debug', 'checked', 'assert'
- ),
- 10 => array(//BiAttr
- 'required', 'property', 'meta', 'getter', 'default'
- ),
- 11 => array(//BiFunc
- 'zip', 'shellp', 'shellm', 'shell', 'reversed', 'range', 'prompt',
- 'matrix', 'map', 'len', 'join', 'iterator', 'gets', 'enumerate', 'cat', 'array'
- ),
- 12 => array(//HiFunc
- '__switch__', '__initobj__', '__eval__', '__addressof__', 'quack'
- ),
- 13 => array(//Primitive
- 'void', 'ushort', 'ulong', 'uint', 'true', 'timespan', 'string', 'single',
- 'short', 'sbyte', 'regex', 'object', 'null', 'long', 'int', 'false', 'duck',
- 'double', 'decimal', 'date', 'char', 'callable', 'byte', 'bool'
- ),
- 14 => array(//Operator
- 'not', 'or', 'and', 'is', 'isa',
- ),
- 15 => array(//Modifier
- 'virtual', 'transient', 'static', 'partial', 'override', 'final', 'abstract'
- ),
- 16 => array(//Access
- 'super', 'self'
- ),
- 17 => array(//Pass
- 'pass'
- )
- ),
- 'SYMBOLS' => array(
- '[|', '|]', '${', '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>', '+', '-', ';'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true,
- 9 => true,
- 10 => true,
- 11 => true,
- 12 => true,
- 13 => true,
- 14 => true,
- 15 => true,
- 16 => true,
- 17 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color:green;font-weight:bold;',
- 2 => 'color:navy;',
- 3 => 'color:blue;font-weight:bold;',
- 4 => 'color:#8B4513;',
- 5 => 'color:teal;font-weight:bold;',
- 6 => 'color:blue;font-weight:bold;',
- 7 => 'color:blue;font-weight:bold;',
- 8 => 'color:blue;font-weight:bold;',
- 9 => 'color:maroon;',
- 10 => 'color:maroon;',
- 11 => 'color:purple;',
- 12 => 'color:#4B0082;',
- 13 => 'color:purple;font-weight:bold;',
- 14 => 'color:#008B8B;font-weight:bold;',
- 15 => 'color:brown;',
- 16 => 'color:black;font-weight:bold;',
- 17 => 'color:gray;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #999999; font-style: italic;',
- 2 => 'color: #999999; font-style: italic;',
- 'MULTI' => 'color: #008000; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #0000FF; font-weight: bold;',
- 'HARD' => 'color: #0000FF; font-weight: bold;',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #006400;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #008000;',
- 'HARD' => 'color: #008000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #00008B;'
- ),
- 'METHODS' => array(
- 0 => 'color: 000000;',
- 1 => 'color: 000000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #006400;'
- ),
- 'REGEXPS' => array(
- #0 => 'color: #0066ff;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => '',
- 9 => '',
- 10 => '',
- 11 => '',
- 12 => '',
- 13 => '',
- 14 => '',
- 15 => '',
- 16 => '',
- 17 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 0 => '.',
- 1 => '::'
- ),
- 'REGEXPS' => array(
- #0 => '%(@)?\/(?:(?(1)[^\/\\\\\r\n]+|[^\/\\\\\r\n \t]+)|\\\\[\/\\\\\w+()|.*?$^[\]{}\d])+\/%'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/c.php b/libvpx/examples/includes/geshi/geshi/c.php
deleted file mode 100644
index 272885a..0000000
--- a/libvpx/examples/includes/geshi/geshi/c.php
+++ /dev/null
@@ -1,188 +0,0 @@
-<?php
-/*************************************************************************************
- * c.php
- * -----
- * Author: Nigel McNie (nigel@geshi.org)
- * Contributors:
- * - Jack Lloyd (lloyd@randombit.net)
- * - Michael Mol (mikemol@gmail.com)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * C language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2009/01/22 (1.0.8.3)
- * - Made keywords case-sensitive.
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/XX/XX (1.0.4)
- * - Added a couple of new keywords (Jack Lloyd)
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.2)
- * - Added support for URLs
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2009/02/08)
- * -------------------------
- * - Get a list of inbuilt functions to add (and explore C more
- * to complete this rather bare language file
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'C',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Multiline-continued single-line comments
- 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
- //Multiline-continued preprocessor define
- 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[abfnrtv\\'\"?\n]#i",
- //Hexadecimal Char Specs
- 2 => "#\\\\x[\da-fA-F]{2}#",
- //Hexadecimal Char Specs
- 3 => "#\\\\u[\da-fA-F]{4}#",
- //Hexadecimal Char Specs
- 4 => "#\\\\U[\da-fA-F]{8}#",
- //Octal Char Specs
- 5 => "#\\\\[0-7]{1,3}#"
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
- GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'if', 'return', 'while', 'case', 'continue', 'default',
- 'do', 'else', 'for', 'switch', 'goto'
- ),
- 2 => array(
- 'null', 'false', 'break', 'true', 'function', 'enum', 'extern', 'inline'
- ),
- 3 => array(
- 'printf', 'cout'
- ),
- 4 => array(
- 'auto', 'char', 'const', 'double', 'float', 'int', 'long',
- 'register', 'short', 'signed', 'sizeof', 'static', 'string', 'struct',
- 'typedef', 'union', 'unsigned', 'void', 'volatile', 'wchar_t'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']',
- '+', '-', '*', '/', '%',
- '=', '<', '>',
- '!', '^', '&', '|',
- '?', ':',
- ';', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;',
- 4 => 'color: #993333;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #339933;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #660099; font-weight: bold;',
- 3 => 'color: #660099; font-weight: bold;',
- 4 => 'color: #660099; font-weight: bold;',
- 5 => 'color: #006699; font-weight: bold;',
- 'HARD' => '',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000dd;',
- GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;',
- 2 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/c_mac.php b/libvpx/examples/includes/geshi/geshi/c_mac.php
deleted file mode 100644
index 3478fba..0000000
--- a/libvpx/examples/includes/geshi/geshi/c_mac.php
+++ /dev/null
@@ -1,212 +0,0 @@
-<?php
-/*************************************************************************************
- * c_mac.php
- * ---------
- * Author: M. Uli Kusterer (witness.of.teachtext@gmx.net)
- * Copyright: (c) 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * C for Macs language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'C (Mac)',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Multiline-continued single-line comments
- 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
- //Multiline-continued preprocessor define
- 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[abfnrtv\\'\"?\n]#i",
- //Hexadecimal Char Specs
- 2 => "#\\\\x[\da-fA-F]{2}#",
- //Hexadecimal Char Specs
- 3 => "#\\\\u[\da-fA-F]{4}#",
- //Hexadecimal Char Specs
- 4 => "#\\\\U[\da-fA-F]{8}#",
- //Octal Char Specs
- 5 => "#\\\\[0-7]{1,3}#"
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
- GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'if', 'return', 'while', 'case', 'continue', 'default',
- 'do', 'else', 'for', 'switch', 'goto'
- ),
- 2 => array(
- 'NULL', 'false', 'break', 'true', 'enum', 'errno', 'EDOM',
- 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
- 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
- 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
- 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
- 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
- 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
- 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
- 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
- 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam',
- 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'stdin', 'stdout', 'stderr',
- 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC',
- // Mac-specific constants:
- 'kCFAllocatorDefault'
- ),
- 3 => array(
- 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
- 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
- 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper',
- 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
- 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
- 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp',
- 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
- 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
- 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
- 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
- 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
- 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
- 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
- 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
- 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
- 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
- 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
- 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
- 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
- ),
- 4 => array(
- 'auto', 'char', 'const', 'double', 'float', 'int', 'long',
- 'register', 'short', 'signed', 'static', 'string', 'struct',
- 'typedef', 'union', 'unsigned', 'void', 'volatile', 'extern', 'jmp_buf',
- 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
- 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
- // Mac-specific types:
- 'CFArrayRef', 'CFDictionaryRef', 'CFMutableDictionaryRef', 'CFBundleRef', 'CFSetRef', 'CFStringRef',
- 'CFURLRef', 'CFLocaleRef', 'CFDateFormatterRef', 'CFNumberFormatterRef', 'CFPropertyListRef',
- 'CFTreeRef', 'CFWriteStreamRef', 'CFCharacterSetRef', 'CFMutableStringRef', 'CFNotificationRef',
- 'CFReadStreamRef', 'CFNull', 'CFAllocatorRef', 'CFBagRef', 'CFBinaryHeapRef',
- 'CFBitVectorRef', 'CFBooleanRef', 'CFDataRef', 'CFDateRef', 'CFMachPortRef', 'CFMessagePortRef',
- 'CFMutableArrayRef', 'CFMutableBagRef', 'CFMutableBitVectorRef', 'CFMutableCharacterSetRef',
- 'CFMutableDataRef', 'CFMutableSetRef', 'CFNumberRef', 'CFPlugInRef', 'CFPlugInInstanceRef',
- 'CFRunLoopRef', 'CFRunLoopObserverRef', 'CFRunLoopSourceRef', 'CFRunLoopTimerRef', 'CFSocketRef',
- 'CFTimeZoneRef', 'CFTypeRef', 'CFUserNotificationRef', 'CFUUIDRef', 'CFXMLNodeRef', 'CFXMLParserRef',
- 'CFXMLTreeRef'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #0000dd;',
- 4 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #ff0000;',
- 2 => 'color: #339900;',
- 'MULTI' => 'color: #ff0000; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #660099; font-weight: bold;',
- 3 => 'color: #660099; font-weight: bold;',
- 4 => 'color: #660099; font-weight: bold;',
- 5 => 'color: #006699; font-weight: bold;',
- 'HARD' => '',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #666666;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000dd;',
- GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
- ),
- 'METHODS' => array(
- 1 => 'color: #00eeff;',
- 2 => 'color: #00eeff;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/caddcl.php b/libvpx/examples/includes/geshi/geshi/caddcl.php
deleted file mode 100644
index 69d19dc..0000000
--- a/libvpx/examples/includes/geshi/geshi/caddcl.php
+++ /dev/null
@@ -1,126 +0,0 @@
-<?php
-/*************************************************************************************
- * caddcl.php
- * ----------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * CAD DCL (Dialog Control Language) language file for GeSHi.
- *
- * DCL for AutoCAD 12 or later and IntelliCAD all versions.
- *
- * CHANGES
- * -------
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/1!/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'CAD DCL',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'boxed_column','boxed_radio_column','boxed_radio_row','boxed_row',
- 'column','concatenation','button','dialog','edit_box','image','image_button',
- 'errtile','list_box','ok_cancel','ok_cancel_help','ok_cancel_help_errtile',
- 'ok_cancel_help_info','ok_only','paragraph','popup_list','radio_button',
- 'radio_column','radio_row','row','slider','spacer','spacer_0','spacer_1','text',
- 'text_part','toggle',
- 'action','alignment','allow_accept','aspect_ratio','big_increment',
- 'children_alignment','children_fixed_height',
- 'children_fixed_width','color',
- 'edit_limit','edit_width','fixed_height','fixed_width',
- 'height','initial_focus','is_cancel','is_default',
- 'is_enabled','is_tab_stop','is-bold','key','label','layout','list',
- 'max_value','min_value','mnemonic','multiple_select','password_char',
- 'small_increment','tabs','tab_truncate','value','width',
- 'false','true','left','right','centered','top','bottom',
- 'dialog_line','dialog_foreground','dialog_background',
- 'graphics_background','black','red','yellow','green','cyan',
- 'blue','magenta','whitegraphics_foreground',
- 'horizontal','vertical'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/cadlisp.php b/libvpx/examples/includes/geshi/geshi/cadlisp.php
deleted file mode 100644
index 9865840..0000000
--- a/libvpx/examples/includes/geshi/geshi/cadlisp.php
+++ /dev/null
@@ -1,186 +0,0 @@
-<?php
-/*************************************************************************************
- * cadlisp.php
- * -----------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/blog)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * AutoCAD/IntelliCAD Lisp language file for GeSHi.
- *
- * For AutoCAD V.12..2005 and IntelliCAD all versions.
- *
- * CHANGES
- * -------
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'CAD Lisp',
- 'COMMENT_SINGLE' => array(1 => ";"),
- 'COMMENT_MULTI' => array(";|" => "|;"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'abs','acad_colordlg','acad_helpdlg','acad_strlsort','action_tile',
- 'add_list','alert','alloc','and','angle','angtof','angtos','append','apply',
- 'arx','arxload','arxunload','ascii','assoc','atan','atof','atoi','atom',
- 'atoms-family','autoarxload','autoload','Boole','boundp','caddr',
- 'cadr','car','cdr','chr','client_data_tile','close','command','cond',
- 'cons','cos','cvunit','defun','defun-q','defun-q-list-ref',
- 'defun-q-list-set','dictadd','dictnext','dictremove','dictrename',
- 'dictsearch','dimx_tile','dimy_tile','distance','distof','done_dialog',
- 'end_image','end_list','entdel','entget','entlast','entmake',
- 'entmakex','entmod','entnext','entsel','entupd','eq','equal','eval','exit',
- 'exp','expand','expt','fill_image','findfile','fix','float','foreach','function',
- 'gc','gcd','get_attr','get_tile','getangle','getcfg','getcname','getcorner',
- 'getdist','getenv','getfiled','getint','getkword','getorient','getpoint',
- 'getreal','getstring','getvar','graphscr','grclear','grdraw','grread','grtext',
- 'grvecs','handent','help','if','initdia','initget','inters','itoa','lambda','last',
- 'layoutlist','length','list','listp','load','load_dialog','log','logand','logior',
- 'lsh','mapcar','max','mem','member','menucmd','menugroup','min','minusp','mode_tile',
- 'namedobjdict','nentsel','nentselp','new_dialog','nil','not','nth','null',
- 'numberp','open','or','osnap','polar','prin1','princ','print','progn','prompt',
- 'quit','quote','read','read-char','read-line','redraw','regapp','rem','repeat',
- 'reverse','rtos','set','set_tile','setcfg','setenv','setfunhelp','setq','setvar',
- 'setview','sin','slide_image','snvalid','sqrt','ssadd','ssdel','ssget','ssgetfirst',
- 'sslength','ssmemb','ssname','ssnamex','sssetfirst','start_dialog','start_image',
- 'start_list','startapp','strcase','strcat','strlen','subst','substr','t','tablet',
- 'tblnext','tblobjname','tblsearch','term_dialog','terpri','textbox','textpage',
- 'textscr','trace','trans','type','unload_dialog','untrace','vector_image','ver',
- 'vports','wcmatch','while','write-char','write-line','xdroom','xdsize','zerop',
- 'vl-acad-defun','vl-acad-undefun','vl-arx-import','vlax-3D-point',
- 'vlax-add-cmd','vlax-create-object','vlax-curve-getArea',
- 'vlax-curve-getClosestPointTo','vlax-curve-getClosestPointToProjection',
- 'vlax-curve-getDistAtParam','vlax-curve-getDistAtPoint',
- 'vlax-curve-getEndParam','vlax-curve-getEndPoint',
- 'vlax-curve-getFirstDeriv','vlax-curve-getParamAtDist',
- 'vlax-curve-getParamAtPoint','vlax-curve-getPointAtDist',
- 'vlax-curve-getPointAtParam','vlax-curve-getSecondDeriv',
- 'vlax-curve-getStartParam','vlax-curve-getStartPoint',
- 'vlax-curve-isClosed','vlax-curve-isPeriodic','vlax-curve-isPlanar',
- 'vlax-dump-object','vlax-erased-p','vlax-for','vlax-get-acad-object',
- 'vlax-get-object','vlax-get-or-create-object','vlax-get-property',
- 'vlax-import-type-library','vlax-invoke-method','vlax-ldata-delete',
- 'vlax-ldata-get','vlax-ldata-list','vlax-ldata-put','vlax-ldata-test',
- 'vlax-make-safearray','vlax-make-variant','vlax-map-collection',
- 'vlax-method-applicable-p','vlax-object-released-p','vlax-product-key',
- 'vlax-property-available-p','vlax-put-property','vlax-read-enabled-p',
- 'vlax-release-object','vlax-remove-cmd','vlax-safearray-fill',
- 'vlax-safearray-get-dim','vlax-safearray-get-element',
- 'vlax-safearray-get-l-bound','vlax-safearray-get-u-bound',
- 'vlax-safearray-put-element','vlax-safearray-type','vlax-tmatrix',
- 'vlax-typeinfo-available-p','vlax-variant-change-type',
- 'vlax-variant-type','vlax-variant-value','vlax-write-enabled-p',
- 'vl-bb-ref','vl-bb-set','vl-catch-all-apply','vl-catch-all-error-message',
- 'vl-catch-all-error-p','vl-cmdf','vl-consp','vl-directory-files','vl-doc-export',
- 'vl-doc-import','vl-doc-ref','vl-doc-set','vl-every','vl-exit-with-error',
- 'vl-exit-with-value','vl-file-copy','vl-file-delete','vl-file-directory-p',
- 'vl-filename-base','vl-filename-directory','vl-filename-extension',
- 'vl-filename-mktemp','vl-file-rename','vl-file-size','vl-file-systime',
- 'vl-get-resource','vlisp-compile','vl-list-exported-functions',
- 'vl-list-length','vl-list-loaded-vlx','vl-load-all','vl-load-com',
- 'vl-load-reactors','vl-member-if','vl-member-if-not','vl-position',
- 'vl-prin1-to-string','vl-princ-to-string','vl-propagate','vlr-acdb-reactor',
- 'vlr-add','vlr-added-p','vlr-beep-reaction','vlr-command-reactor',
- 'vlr-current-reaction-name','vlr-data','vlr-data-set',
- 'vlr-deepclone-reactor','vlr-docmanager-reactor','vlr-dwg-reactor',
- 'vlr-dxf-reactor','vlr-editor-reactor','vl-registry-delete',
- 'vl-registry-descendents','vl-registry-read','vl-registry-write',
- 'vl-remove','vl-remove-if','vl-remove-if-not','vlr-insert-reactor',
- 'vlr-linker-reactor','vlr-lisp-reactor','vlr-miscellaneous-reactor',
- 'vlr-mouse-reactor','vlr-notification','vlr-object-reactor',
- 'vlr-owner-add','vlr-owner-remove','vlr-owners','vlr-pers','vlr-pers-list',
- 'vlr-pers-p','vlr-pers-release','vlr-reaction-names','vlr-reactions',
- 'vlr-reaction-set','vlr-reactors','vlr-remove','vlr-remove-all',
- 'vlr-set-notification','vlr-sysvar-reactor','vlr-toolbar-reactor',
- 'vlr-trace-reaction','vlr-type','vlr-types','vlr-undo-reactor',
- 'vlr-wblock-reactor','vlr-window-reactor','vlr-xref-reactor',
- 'vl-some','vl-sort','vl-sort-i','vl-string-elt','vl-string-left-trim',
- 'vl-string-mismatch','vl-string-position','vl-string-right-trim',
- 'vl-string-search','vl-string-subst','vl-string-translate','vl-string-trim',
- 'vl-symbol-name','vl-symbolp','vl-symbol-value','vl-unload-vlx','vl-vbaload',
- 'vl-vbarun','vl-vlx-loaded-p'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '!', '%', '^', '&', '/','+','-','*','=','<','>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/cfdg.php b/libvpx/examples/includes/geshi/geshi/cfdg.php
deleted file mode 100644
index fc097ca..0000000
--- a/libvpx/examples/includes/geshi/geshi/cfdg.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-/*************************************************************************************
- * cfdg.php
- * --------
- * Author: John Horigan <john@glyphic.com>
- * Copyright: (c) 2006 John Horigan http://www.ozonehouse.com/john/
- * Release Version: 1.0.8.3
- * Date Started: 2006/03/11
- *
- * CFDG language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2006/03/11 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/03/11)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'CFDG',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'include', 'startshape', 'rule', 'background'
- ),
- 2 => array(
- 'SQUARE', 'CIRCLE', 'TRIANGLE',
- ),
- 3 => array(
- 'b','brightness','h','hue','sat','saturation',
- 'a','alpha','x','y','z','s','size',
- 'r','rotate','f','flip','skew','xml_set_object'
- )
- ),
- 'SYMBOLS' => array(
- '[', ']', '{', '}', '*', '|'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #717100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #006666;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/cfm.php b/libvpx/examples/includes/geshi/geshi/cfm.php
deleted file mode 100644
index e900f46..0000000
--- a/libvpx/examples/includes/geshi/geshi/cfm.php
+++ /dev/null
@@ -1,299 +0,0 @@
-<?php
-/*************************************************************************************
- * cfm.php
- * -------
- * Author: Diego
- * Copyright: (c) 2006 Diego
- * Release Version: 1.0.8.3
- * Date Started: 2006/02/25
- *
- * ColdFusion language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2006/02/25 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/02/25)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'ColdFusion',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- /* CFM Tags */
- 1 => array(
- 'cfabort', 'cfapplet', 'cfapplication', 'cfargument', 'cfassociate',
- 'cfbreak', 'cfcache', 'cfcase', 'cfcatch', 'cfchart', 'cfchartdata',
- 'cfchartseries', 'cfcol', 'cfcollection', 'cfcomponent',
- 'cfcontent', 'cfcookie', 'cfdefaultcase', 'cfdirectory',
- 'cfdocument', 'cfdocumentitem', 'cfdocumentsection', 'cfdump',
- 'cfelse', 'cfelseif', 'cferror', 'cfexecute', 'cfexit', 'cffile',
- 'cfflush', 'cfform', 'cfformgroup', 'cfformitem', 'cfftp',
- 'cffunction', 'cfgrid', 'cfgridcolumn', 'cfgridrow', 'cfgridupdate',
- 'cfheader', 'cfhtmlhead', 'cfhttp', 'cfhttpparam', 'cfif',
- 'cfimport', 'cfinclude', 'cfindex', 'cfinput', 'cfinsert',
- 'cfinvoke', 'cfinvokeargument', 'cfldap', 'cflocation', 'cflock',
- 'cflog', 'cflogin', 'cfloginuser', 'cflogout', 'cfloop', 'cfmail',
- 'cfmailparam', 'cfmailpart', 'cfmodule', 'cfNTauthenticate',
- 'cfobject', 'cfobjectcache', 'cfoutput', 'cfparam', 'cfpop',
- 'cfprocessingdirective', 'cfprocparam',
- 'cfprocresult', 'cfproperty', 'cfquery', 'cfqueryparam',
- 'cfregistry', 'cfreport', 'cfreportparam', 'cfrethrow', 'cfreturn',
- 'cfsavecontent', 'cfschedule', 'cfscript', 'cfsearch', 'cfselect',
- 'cfset', 'cfsetting', 'cfsilent', 'cfstoredproc',
- 'cfswitch', 'cftable', 'cftextarea', 'cfthrow', 'cftimer',
- 'cftrace', 'cftransaction', 'cftree', 'cftreeitem', 'cftry',
- 'cfupdate', 'cfwddx'
- ),
- /* HTML Tags */
- 2 => array(
- 'a', 'abbr', 'acronym', 'address', 'applet',
-
- 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
-
- 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
-
- 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
-
- 'em',
-
- 'fieldset', 'font', 'form', 'frame', 'frameset',
-
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
-
- 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
-
- 'kbd',
-
- 'label', 'legend', 'link', 'li',
-
- 'map', 'meta',
-
- 'noframes', 'noscript',
-
- 'object', 'ol', 'optgroup', 'option',
-
- 'param', 'pre', 'p',
-
- 'q',
-
- 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
-
- 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
-
- 'ul', 'u',
-
- 'var',
- ),
- /* HTML attributes */
- 3 => array(
- 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
- 'background', 'bgcolor', 'border',
- 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
- 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
- 'enctype',
- 'face', 'for', 'frame', 'frameborder',
- 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
- 'id', 'ismap',
- 'label', 'lang', 'language', 'link', 'longdesc',
- 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
- 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
- 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
- 'profile', 'prompt',
- 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
- 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
- 'tabindex', 'target', 'text', 'title', 'type',
- 'usemap',
- 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
- 'width'
- ),
- /* CFM Script delimeters */
- 4 => array(
- 'var', 'function', 'while', 'if','else'
- ),
- /* CFM Functions */
- 5 => array(
- 'Abs', 'GetFunctionList', 'LSTimeFormat','ACos','GetGatewayHelper','LTrim','AddSOAPRequestHeader','GetHttpRequestData',
- 'Max','AddSOAPResponseHeader','GetHttpTimeString','Mid','ArrayAppend','GetLocale','Min','ArrayAvg','GetLocaleDisplayName',
- 'Minute','ArrayClear','GetMetaData','Month','ArrayDeleteAt','GetMetricData','MonthAsString','ArrayInsertAt','GetPageContext',
- 'Now','ArrayIsEmpty','GetProfileSections','NumberFormat','ArrayLen','GetProfileString','ParagraphFormat','ArrayMax',
- 'GetLocalHostIP','ParseDateTime','ArrayMin','GetSOAPRequest','Pi','ArrayNew','GetSOAPRequestHeader','PreserveSingleQuotes',
- 'ArrayPrepend','GetSOAPResponse','Quarter','ArrayResize','GetSOAPResponseHeader','QueryAddColumn','ArraySet',
- 'GetTempDirectory','QueryAddRow','ArraySort','QueryNew','ArraySum','GetTempFile','QuerySetCell',
- 'ArraySwap','GetTickCount','QuotedValueList','ArrayToList','GetTimeZoneInfo','Rand','Asc','GetToken','Randomize',
- 'ASin','Hash','RandRange','Atn','Hour','REFind','BinaryDecode','HTMLCodeFormat','REFindNoCase','BinaryEncode',
- 'HTMLEditFormat','ReleaseComObject','BitAnd','IIf','RemoveChars','BitMaskClear','IncrementValue','RepeatString',
- 'BitMaskRead','InputBaseN','Replace','BitMaskSet','Insert','ReplaceList','BitNot','Int','ReplaceNoCase','BitOr',
- 'IsArray','REReplace','BitSHLN','IsBinary','REReplaceNoCase','BitSHRN','IsBoolean','Reverse','BitXor','IsCustomFunction',
- 'Right','Ceiling','IsDate','RJustify','CharsetDecode','IsDebugMode','Round','CharsetEncode','IsDefined','RTrim',
- 'Chr','IsLeapYear','Second','CJustify','IsLocalHost','SendGatewayMessage','Compare','IsNumeric','SetEncoding',
- 'CompareNoCase','IsNumericDate','SetLocale','Cos','IsObject','SetProfileString','CreateDate','IsQuery','SetVariable',
- 'CreateDateTime','IsSimpleValue','Sgn','CreateObject','IsSOAPRequest','Sin','CreateODBCDate','IsStruct','SpanExcluding',
- 'CreateODBCDateTime','IsUserInRole','SpanIncluding','CreateODBCTime','IsValid','Sqr','CreateTime','IsWDDX','StripCR',
- 'CreateTimeSpan','IsXML','StructAppend','CreateUUID','IsXmlAttribute','StructClear','DateAdd','IsXmlDoc','StructCopy',
- 'DateCompare','IsXmlElem','StructCount','DateConvert','IsXmlNode','StructDelete','DateDiff','IsXmlRoot','StructFind',
- 'DateFormat','JavaCast','StructFindKey','DatePart','JSStringFormat','StructFindValue','Day','LCase','StructGet',
- 'DayOfWeek','Left','StructInsert','DayOfWeekAsString','Len','StructIsEmpty','DayOfYear','ListAppend','StructKeyArray',
- 'DaysInMonth','ListChangeDelims','StructKeyExists','DaysInYear','ListContains','StructKeyList','DE','ListContainsNoCase',
- 'StructNew','DecimalFormat','ListDeleteAt','StructSort','DecrementValue','ListFind','StructUpdate','Decrypt','ListFindNoCase',
- 'Tan','DecryptBinary','ListFirst','TimeFormat','DeleteClientVariable','ListGetAt','ToBase64','DirectoryExists',
- 'ListInsertAt','ToBinary','DollarFormat','ListLast','ToScript','Duplicate','ListLen','ToString','Encrypt','ListPrepend',
- 'Trim','EncryptBinary','ListQualify','UCase','Evaluate','ListRest','URLDecode','Exp','ListSetAt','URLEncodedFormat',
- 'ExpandPath','ListSort','URLSessionFormat','FileExists','ListToArray','Val','Find','ListValueCount','ValueList',
- 'FindNoCase','ListValueCountNoCase','Week','FindOneOf','LJustify','Wrap','FirstDayOfMonth','Log','WriteOutput',
- 'Fix','Log10','XmlChildPos','FormatBaseN','LSCurrencyFormat','XmlElemNew','GetAuthUser','LSDateFormat','XmlFormat',
- 'GetBaseTagData','LSEuroCurrencyFormat','XmlGetNodeType','GetBaseTagList','LSIsCurrency','XmlNew','GetBaseTemplatePath',
- 'LSIsDate','XmlParse','GetClientVariablesList','LSIsNumeric','XmlSearch','GetCurrentTemplatePath','LSNumberFormat',
- 'XmlTransform','GetDirectoryFromPath','LSParseCurrency','XmlValidate','GetEncoding','LSParseDateTime','Year',
- 'GetException','LSParseEuroCurrency','YesNoFormat','GetFileFromPath','LSParseNumber'
- ),
- /* CFM Attributes */
- 6 => array(
- 'dbtype','connectstring','datasource','username','password','query','delimeter','description','required','hint','default','access','from','to','list','index'
- ),
- 7 => array(
- 'EQ', 'GT', 'LT', 'GTE', 'LTE', 'IS', 'LIKE', 'NEQ'
- )
- ),
- 'SYMBOLS' => array(
- '/', '=', '{', '}', '(', ')', '[', ']', '<', '>', '&'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #990000; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #0000FF;',
- 4 => 'color: #000000; font-weight: bold;',
- 5 => 'color: #0000FF;',
- 6 => 'color: #0000FF;',
- 7 => 'color: #0000FF;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #0000FF;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #009900;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #0000FF;'
- ),
- 'SCRIPT' => array(
- 0 => 'color: #808080; font-style: italic;',
- 1 => 'color: #00bbdd;',
- 2 => 'color: #0000FF;',
- 3 => 'color: #000099;',
- 4 => 'color: #333333;',
- 5 => 'color: #333333;'
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => 'http://december.com/html/4/element/{FNAMEL}.html',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<!--' => '-->'
- ),
- 1 => array(
- '<!DOCTYPE' => '>'
- ),
- 2 => "/(?!<#)(?:(?:##)*)(#)[a-zA-Z0-9_\.\(\)]+(#)/",
- 3 => array(
- '<cfscript>' => '</cfscript>'
- ),
- 4 => array(
- '<' => '>'
- ),
- 5 => '/((?!<!)<)(?:"[^"]*"|\'[^\']*\'|(?R)|[^">])+?(>)/si'
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => false,
- 1 => false,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 1 => array(
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
- ),
- 2 => array(
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
- ),
- 3 => array(
- 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>|^])', // allow ; before keywords
- 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-])', // allow & after keywords
- ),
- 7 => array(
- 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#>&|^])', // allow ; before keywords
- 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-])', // allow & after keywords
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/cil.php b/libvpx/examples/includes/geshi/geshi/cil.php
deleted file mode 100644
index 41777d6..0000000
--- a/libvpx/examples/includes/geshi/geshi/cil.php
+++ /dev/null
@@ -1,196 +0,0 @@
-<?php
-/*************************************************************************************
- * cil.php
- * --------
- * Author: Marcus Griep (neoeinstein+GeSHi@gmail.com)
- * Copyright: (c) 2007 Marcus Griep (http://www.xpdm.us)
- * Release Version: 1.0.8.3
- * Date Started: 2007/10/24
- *
- * CIL (Common Intermediate Language) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/10/24 (1.0.8)
- * - First Release
- *
- * TODO (updated 2007/10/24)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'CIL',
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'COMMENT_SINGLE' => array('//'),
- 'COMMENT_MULTI' => array(),
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(//Dotted
- '.zeroinit', '.vtfixup', '.vtentry', '.vtable', '.ver', '.try', '.subsystem', '.size', '.set', '.removeon',
- '.publickeytoken', '.publickey', '.property', '.permissionset', '.permission', '.pdirect', '.param', '.pack',
- '.override', '.other', '.namespace', '.mresource', '.module', '.method', '.maxstack', '.manifestres', '.locals',
- '.localized', '.locale', '.line', '.language', '.import', '.imagebase', '.hash', '.get', '.fire', '.file', '.field',
- '.export', '.event', '.entrypoint', '.emitbyte', '.data', '.custom', '.culture', '.ctor', '.corflags', '.class',
- '.cctor', '.assembly', '.addon'
- ),
- 2 => array(//Attributes
- 'wrapper', 'with', 'winapi', 'virtual', 'vector', 'vararg', 'value', 'userdefined', 'unused', 'unmanagedexp',
- 'unmanaged', 'unicode', 'to', 'tls', 'thiscall', 'synchronized', 'struct', 'strict', 'storage', 'stdcall',
- 'static', 'specialname', 'special', 'serializable', 'sequential', 'sealed', 'runtime', 'rtspecialname', 'request',
- 'reqsecobj', 'reqrefuse', 'reqopt', 'reqmin', 'record', 'public', 'privatescope', 'private', 'preservesig',
- 'prejitgrant', 'prejitdeny', 'platformapi', 'pinvokeimpl', 'pinned', 'permitonly', 'out', 'optil', 'opt',
- 'notserialized', 'notremotable', 'not_in_gc_heap', 'noprocess', 'noncaslinkdemand', 'noncasinheritance',
- 'noncasdemand', 'nometadata', 'nomangle', 'nomachine', 'noinlining', 'noappdomain', 'newslot', 'nested', 'native',
- 'modreq', 'modopt', 'marshal', 'managed', 'literal', 'linkcheck', 'lcid', 'lasterr', 'internalcall', 'interface',
- 'instance', 'initonly', 'init', 'inheritcheck', 'in', 'import', 'implicitres', 'implicitcom', 'implements',
- 'illegal', 'il', 'hidebysig', 'handler', 'fromunmanaged', 'forwardref', 'fixed', 'finally', 'final', 'filter',
- 'filetime', 'field', 'fault', 'fastcall', 'famorassem', 'family', 'famandassem', 'extern', 'extends', 'explicit',
- 'error', 'enum', 'endmac', 'deny', 'demand', 'default', 'custom', 'compilercontrolled', 'clsid', 'class', 'cil',
- 'cf', 'cdecl', 'catch', 'beforefieldinit', 'autochar', 'auto', 'at', 'assert', 'assembly', 'as', 'any', 'ansi',
- 'alignment', 'algorithm', 'abstract'
- ),
- 3 => array(//Types
- 'wchar', 'void', 'variant', 'unsigned', 'valuetype', 'typedref', 'tbstr', 'sysstring', 'syschar', 'string',
- 'streamed_object', 'stream', 'stored_object', 'safearray', 'objectref', 'object', 'nullref', 'method', 'lpwstr',
- 'lpvoid', 'lptstr', 'lpstruct', 'lpstr', 'iunknown', 'int64', 'int32', 'int16', 'int8', 'int', 'idispatch',
- 'hresult', 'float64', 'float32', 'float', 'decimal', 'date', 'currency', 'char', 'carray', 'byvalstr',
- 'bytearray', 'boxed', 'bool', 'blob_object', 'blob', 'array'
- ),
- 4 => array(//Prefix
- 'volatile', 'unaligned', 'tail', 'readonly', 'no', 'constrained'
- ),
- 5 => array(//Suffix
- 'un', 'u8', 'u4', 'u2', 'u1', 'u', 's', 'ref', 'r8', 'r4', 'm1', 'i8', 'i4', 'i2', 'i1', 'i'#, '.8', '.7', '.6', '.5', '.4', '.3', '.2', '.1', '.0'
- ),
- 6 => array(//Base
- 'xor', 'switch', 'sub', 'stloc',
- 'stind', 'starg',
- 'shr', 'shl', 'ret', 'rem', 'pop', 'or', 'not', 'nop', 'neg', 'mul',
- 'localloc', 'leave', 'ldnull', 'ldloca',
- 'ldloc', 'ldind', 'ldftn', 'ldc', 'ldarga',
- 'ldarg', 'jmp', 'initblk', 'endfinally', 'endfilter',
- 'endfault', 'dup', 'div', 'cpblk', 'conv', 'clt', 'ckfinite', 'cgt', 'ceq', 'calli',
- 'call', 'brzero', 'brtrue', 'brnull', 'brinst',
- 'brfalse', 'break', 'br', 'bne', 'blt', 'ble', 'bgt', 'bge', 'beq', 'arglist',
- 'and', 'add'
- ),
- 7 => array(//Object
- 'unbox.any', 'unbox', 'throw', 'stsfld', 'stobj', 'stfld', 'stelem', 'sizeof', 'rethrow', 'refanyval', 'refanytype', 'newobj',
- 'newarr', 'mkrefany', 'ldvirtftn', 'ldtoken', 'ldstr', 'ldsflda', 'ldsfld', 'ldobj', 'ldlen', 'ldflda', 'ldfld',
- 'ldelema', 'ldelem', 'isinst', 'initobj', 'cpobj', 'castclass',
- 'callvirt', 'callmostderived', 'box'
- ),
- 8 => array(//Other
- 'prefixref', 'prefix7', 'prefix6', 'prefix5', 'prefix4', 'prefix3', 'prefix2', 'prefix1', 'prefix0'
- ),
- 9 => array(//Literal
- 'true', 'null', 'false'
- ),
- 10 => array(//Comment-like
- '#line', '^THE_END^'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '!!'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true,
- 9 => true,
- 10 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color:maroon;font-weight:bold;',
- 2 => 'color:blue;font-weight:bold;',
- 3 => 'color:purple;font-weight:bold;',
- 4 => 'color:teal;',
- 5 => 'color:blue;',
- 6 => 'color:blue;',
- 7 => 'color:blue;',
- 8 => 'color:blue;',
- 9 => 'color:00008B',
- 10 => 'color:gray'
- ),
- 'COMMENTS' => array(
- 0 => 'color:gray;font-style:italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008000; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #006400;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #008000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #00008B;'
- ),
- 'METHODS' => array(
- 1 => 'color: #000033;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #006400;'
- ),
- 'REGEXPS' => array(
- 0 => 'color:blue;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => '',
- 9 => '',
- 10 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '::'
- ),
- 'REGEXPS' => array(
- 0 => '(?<=ldc\\.i4\\.)[0-8]|(?<=(?:ldarg|ldloc|stloc)\\.)[0-3]' # Pickup the opcodes that end with integers
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/cobol.php b/libvpx/examples/includes/geshi/geshi/cobol.php
deleted file mode 100644
index 71f9828..0000000
--- a/libvpx/examples/includes/geshi/geshi/cobol.php
+++ /dev/null
@@ -1,244 +0,0 @@
-<?php
-/*************************************************************************************
- * cobol.php
- * ----------
- * Author: BenBE (BenBE@omorphia.org)
- * Copyright: (c) 2007-2008 BenBE (http://www.omorphia.de/)
- * Release Version: 1.0.8.3
- * Date Started: 2007/07/02
- *
- * COBOL language file for GeSHi.
- *
- * CHANGES
- * -------
- *
- * TODO (updated 2007/07/02)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'COBOL',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(1 => '/^\*.*?$/m'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', "'"),
- 'ESCAPE_CHAR' => '\\',
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC |
- GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_SCI_SHORT |
- GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array( //Compiler Directives
- 'ANSI', 'BLANK', 'NOBLANK', 'CALL-SHARED', 'CANCEL', 'NOCANCEL',
- 'CHECK', 'CODE', 'NOCODE', 'COLUMNS', 'COMPACT', 'NOCOMPACT',
- 'COMPILE', 'CONSULT', 'NOCONSULT', 'CROSSREF', 'NOCROSSREF',
- 'DIAGNOSE-74', 'NODIAGNOSE-74', 'DIAGNOSE-85', 'NODIAGNOSE-85',
- 'DIAGNOSEALL', 'NODIAGNOSEALL', 'ENDIF', 'ENDUNIT', 'ENV',
- 'ERRORFILE', 'ERRORS', 'FIPS', 'NOFIPS', 'FMAP', 'HEADING', 'HEAP',
- 'HIGHPIN', 'HIGHREQUESTERS', 'ICODE', 'NOICODE', 'IF', 'IFNOT',
- 'INNERLIST', 'NOINNERLIST', 'INSPECT', 'NOINSPECT', 'LARGEDATA',
- 'LD', 'LESS-CODE', 'LIBRARY', 'LINES', 'LIST', 'NOLIST', 'LMAP',
- 'NOLMAP', 'MAIN', 'MAP', 'NOMAP', 'NLD', 'NONSTOP', 'NON-SHARED',
- 'OPTIMIZE', 'PERFORM-TRACE', 'PORT', 'NOPORT', 'RESETTOG',
- 'RUNNABLE', 'RUNNAMED', 'SAVE', 'SAVEABEND', 'NOSAVEABEND',
- 'SEARCH', 'NOSEARCH', 'SECTION', 'SETTOG', 'SHARED', 'SHOWCOPY',
- 'NOSHOWCOPY', 'SHOWFILE', 'NOSHOWFILE', 'SOURCE', 'SQL', 'NOSQL',
- 'SQLMEM', 'SUBSET', 'SUBTYPE', 'SUPPRESS', 'NOSUPPRESS', 'SYMBOLS',
- 'NOSYMBOLS', 'SYNTAX', 'TANDEM', 'TRAP2', 'NOTRAP2', 'TRAP2-74',
- 'NOTRAP2-74', 'UL', 'WARN', 'NOWARN'
- ),
- 2 => array( //Statement Keywords
- 'ACCEPT', 'ADD', 'TO', 'GIVING', 'CORRESPONDING', 'ALTER', 'CALL',
- 'CHECKPOINT', 'CLOSE', 'COMPUTE', 'CONTINUE', 'COPY',
- 'DELETE', 'DISPLAY', 'DIVIDE', 'INTO', 'REMAINDER', 'ENTER',
- 'COBOL', 'EVALUATE', 'EXIT', 'GO', 'INITIALIZE',
- 'TALLYING', 'REPLACING', 'CONVERTING', 'LOCKFILE', 'MERGE', 'MOVE',
- 'MULTIPLY', 'OPEN', 'PERFORM', 'TIMES',
- 'UNTIL', 'VARYING', 'RETURN',
- ),
- 3 => array( //Reserved in some contexts
- 'ACCESS', 'ADDRESS', 'ADVANCING', 'AFTER', 'ALL',
- 'ALPHABET', 'ALPHABETIC', 'ALPHABETIC-LOWER', 'ALPHABETIC-UPPER',
- 'ALPHANUMERIC', 'ALPHANUMERIC-EDITED', 'ALSO', 'ALTERNATE',
- 'AND', 'ANY', 'APPROXIMATE', 'AREA', 'AREAS', 'ASCENDING', 'ASSIGN',
- 'AT', 'AUTHOR', 'BEFORE', 'BINARY', 'BLOCK', 'BOTTOM', 'BY',
- 'CD', 'CF', 'CH', 'CHARACTER', 'CHARACTERS',
- 'CHARACTER-SET', 'CLASS', 'CLOCK-UNITS',
- 'CODE-SET', 'COLLATING', 'COLUMN', 'COMMA',
- 'COMMON', 'COMMUNICATION', 'COMP', 'COMP-3', 'COMP-5',
- 'COMPUTATIONAL', 'COMPUTATIONAL-3', 'COMPUTATIONAL-5',
- 'CONFIGURATION', 'CONTAINS', 'CONTENT', 'CONTROL',
- 'CONTROLS', 'CORR', 'COUNT',
- 'CURRENCY', 'DATA', 'DATE', 'DATE-COMPILED', 'DATE-WRITTEN', 'DAY',
- 'DAY-OF-WEEK', 'DE', 'DEBUG-CONTENTS', 'DEBUG-ITEM', 'DEBUG-LINE',
- 'DEBUG-SUB-2', 'DEBUG-SUB-3', 'DEBUGGING', 'DECIMAL-POINT',
- 'DECLARATIVES', 'DEBUG-NAME', 'DEBUG-SUB-1', 'DELIMITED',
- 'DELIMITER', 'DEPENDING', 'DESCENDING', 'DESTINATION', 'DETAIL',
- 'DISABLE', 'DIVISION', 'DOWN', 'DUPLICATES',
- 'DYNAMIC', 'EGI', 'ELSE', 'EMI', 'ENABLE', 'END', 'END-ADD',
- 'END-COMPUTE', 'END-DELETE', 'END-DIVIDE', 'END-EVALUATE', 'END-IF',
- 'END-MULTIPLY', 'END-OF-PAGE', 'END-PERFORM', 'END-READ',
- 'END-RECEIVE', 'END-RETURN', 'END-REWRITE', 'END-SEARCH',
- 'END-START', 'END-STRING', 'END-SUBTRACT', 'END-UNSTRING',
- 'END-WRITE', 'EOP', 'EQUAL', 'ERROR', 'ESI',
- 'EVERY', 'EXCEPTION', 'EXCLUSIVE', 'EXTEND',
- 'EXTENDED-STORAGE', 'EXTERNAL', 'FALSE', 'FD', 'FILE',
- 'FILE-CONTROL', 'FILLER', 'FINAL', 'FIRST', 'FOOTING', 'FOR',
- 'FROM', 'FUNCTION', 'GENERATE', 'GENERIC', 'GLOBAL',
- 'GREATER', 'GROUP', 'GUARDIAN-ERR', 'HIGH-VALUE',
- 'HIGH-VALUES', 'I-O', 'I-O-CONTROL', 'IDENTIFICATION', 'IN',
- 'INDEX', 'INDEXED', 'INDICATE', 'INITIAL', 'INITIATE',
- 'INPUT', 'INPUT-OUTPUT', 'INSTALLATION',
- 'INVALID', 'IS', 'JUST', 'JUSTIFIED', 'KEY', 'LABEL', 'LAST',
- 'LEADING', 'LEFT', 'LESS', 'LIMIT', 'LIMITS', 'LINAGE',
- 'LINAGE-COUNTER', 'LINE', 'LINE-COUNTER', 'LINKAGE', 'LOCK',
- 'LOW-VALUE', 'LOW-VALUES', 'MEMORY', 'MESSAGE',
- 'MODE', 'MODULES', 'MULTIPLE', 'NATIVE',
- 'NEGATIVE', 'NEXT', 'NO', 'NOT', 'NULL', 'NULLS', 'NUMBER',
- 'NUMERIC', 'NUMERIC-EDITED', 'OBJECT-COMPUTER', 'OCCURS', 'OF',
- 'OFF', 'OMITTED', 'ON', 'OPTIONAL', 'OR', 'ORDER',
- 'ORGANIZATION', 'OTHER', 'OUTPUT', 'OVERFLOW', 'PACKED-DECIMAL',
- 'PADDING', 'PAGE', 'PAGE-COUNTER', 'PF', 'PH', 'PIC',
- 'PICTURE', 'PLUS', 'POINTER', 'POSITION', 'POSITIVE', 'PRINTING',
- 'PROCEDURE', 'PROCEDURES', 'PROCEED', 'PROGRAM', 'PROGRAM-ID',
- 'PROGRAM-STATUS', 'PROGRAM-STATUS-1', 'PROGRAM-STATUS-2', 'PROMPT',
- 'PROTECTED', 'PURGE', 'QUEUE', 'QUOTE', 'QUOTES', 'RD',
- 'RECEIVE', 'RECEIVE-CONTROL', 'RECORD', 'RECORDS',
- 'REDEFINES', 'REEL', 'REFERENCE', 'REFERENCES', 'RELATIVE',
- 'REMOVAL', 'RENAMES', 'REPLACE',
- 'REPLY', 'REPORT', 'REPORTING', 'REPORTS', 'RERUN',
- 'RESERVE', 'RESET', 'REVERSED', 'REWIND', 'REWRITE', 'RF',
- 'RH', 'RIGHT', 'ROUNDED', 'RUN', 'SAME', 'SD',
- 'SECURITY', 'SEGMENT', 'SEGMENT-LIMIT', 'SELECT', 'SEND',
- 'SENTENCE', 'SEPARATE', 'SEQUENCE', 'SEQUENTIAL', 'SET',
- 'SIGN', 'SIZE', 'SORT', 'SORT-MERGE', 'SOURCE-COMPUTER',
- 'SPACE', 'SPACES', 'SPECIAL-NAMES', 'STANDARD', 'STANDARD-1',
- 'STANDARD-2', 'START', 'STARTBACKUP', 'STATUS', 'STOP', 'STRING',
- 'SUB-QUEUE-1', 'SUB-QUEUE-2', 'SUB-QUEUE-3', 'SUBTRACT',
- 'SYMBOLIC', 'SYNC', 'SYNCDEPTH', 'SYNCHRONIZED',
- 'TABLE', 'TAL', 'TAPE', 'TERMINAL', 'TERMINATE', 'TEST',
- 'TEXT', 'THAN', 'THEN', 'THROUGH', 'THRU', 'TIME',
- 'TOP', 'TRAILING', 'TRUE', 'TYPE', 'UNIT', 'UNLOCK', 'UNLOCKFILE',
- 'UNLOCKRECORD', 'UNSTRING', 'UP', 'UPON', 'USAGE', 'USE',
- 'USING', 'VALUE', 'VALUES', 'WHEN', 'WITH', 'WORDS',
- 'WORKING-STORAGE', 'WRITE', 'ZERO', 'ZEROES'
- ),
- 4 => array( //Standard functions
- 'ACOS', 'ANNUITY', 'ASIN', 'ATAN', 'CHAR', 'COS', 'CURRENT-DATE',
- 'DATE-OF-INTEGER', 'DAY-OF-INTEGER', 'FACTORIAL', 'INTEGER',
- 'INTEGER-OF-DATE', 'INTEGER-OF-DAY', 'INTEGER-PART', 'LENGTH',
- 'LOG', 'LOG10', 'LOWER-CASE', 'MAX', 'MEAN', 'MEDIAN', 'MIDRANGE',
- 'MIN', 'MOD', 'NUMVAL', 'NUMVAL-C', 'ORD', 'ORD-MAX', 'ORD-MIN',
- 'PRESENT-VALUE', 'RANDOM', 'RANGE', 'REM', 'REVERSE', 'SIN', 'SQRT',
- 'STANDARD-DEVIATION', 'SUM', 'TAN', 'UPPER-CASE', 'VARIANCE',
- 'WHEN-COMPILED'
- ),
- 5 => array( //Privileged Built-in Functions
- '#IN', '#OUT', '#TERM', '#TEMP', '#DYNAMIC', 'COBOL85^ARMTRAP',
- 'COBOL85^COMPLETION', 'COBOL_COMPLETION_', 'COBOL_CONTROL_',
- 'COBOL_GETENV_', 'COBOL_PUTENV_', 'COBOL85^RETURN^SORT^ERRORS',
- 'COBOL_RETURN_SORT_ERRORS_', 'COBOL85^REWIND^SEQUENTIAL',
- 'COBOL_REWIND_SEQUENTIAL_', 'COBOL85^SET^SORT^PARAM^TEXT',
- 'COBOL_SET_SORT_PARAM_TEXT_', 'COBOL85^SET^SORT^PARAM^VALUE',
- 'COBOL_SET_SORT_PARAM_VALUE_', 'COBOL_SET_MAX_RECORD_',
- 'COBOL_SETMODE_', 'COBOL85^SPECIAL^OPEN', 'COBOL_SPECIAL_OPEN_',
- 'COBOLASSIGN', 'COBOL_ASSIGN_', 'COBOLFILEINFO', 'COBOL_FILE_INFO_',
- 'COBOLSPOOLOPEN', 'CREATEPROCESS', 'ALTERPARAMTEXT',
- 'CHECKLOGICALNAME', 'CHECKMESSAGE', 'DELETEASSIGN', 'DELETEPARAM',
- 'DELETESTARTUP', 'GETASSIGNTEXT', 'GETASSIGNVALUE', 'GETBACKUPCPU',
- 'GETPARAMTEXT', 'GETSTARTUPTEXT', 'PUTASSIGNTEXT', 'PUTASSIGNVALUE',
- 'PUTPARAMTEXT', 'PUTSTARTUPTEXT'
- )
- ),
- 'SYMBOLS' => array(
- //Avoid having - in identifiers marked as symbols
- ' + ', ' - ', ' * ', ' / ', ' ** ',
- '.', ',',
- '=',
- '(', ')', '[', ']'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000080; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #008000; font-weight: bold;',
- 4 => 'color: #000080;',
- 5 => 'color: #008000;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #a0a0a0; font-style: italic;',
- 'MULTI' => 'color: #a0a0a0; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #339933;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #993399;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
- );
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/cpp-qt.php b/libvpx/examples/includes/geshi/geshi/cpp-qt.php
deleted file mode 100644
index 79ec3c6..0000000
--- a/libvpx/examples/includes/geshi/geshi/cpp-qt.php
+++ /dev/null
@@ -1,315 +0,0 @@
-<?php
-/*************************************************************************************
- * cpp.php
- * -------
- * Author: Iulian M
- * Copyright: (c) 2006 Iulian M
- * Release Version: 1.0.8.3
- * Date Started: 2004/09/27
- *
- * C++ (with QT extensions) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'C++ (QT)',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Multiline-continued single-line comments
- 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
- //Multiline-continued preprocessor define
- 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[abfnrtv\\'\"?\n]#i",
- //Hexadecimal Char Specs
- 2 => "#\\\\x[\da-fA-F]{2}#",
- //Hexadecimal Char Specs
- 3 => "#\\\\u[\da-fA-F]{4}#",
- //Hexadecimal Char Specs
- 4 => "#\\\\U[\da-fA-F]{8}#",
- //Octal Char Specs
- 5 => "#\\\\[0-7]{1,3}#"
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
- GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'case', 'continue', 'default', 'do', 'else', 'for', 'goto', 'if', 'return',
- 'switch', 'while', 'delete', 'new', 'this'
- ),
- 2 => array(
- 'NULL', 'false', 'break', 'true', 'enum', 'errno', 'EDOM',
- 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
- 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
- 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
- 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
- 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
- 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
- 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
- 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
- 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam',
- 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'stdin', 'stdout', 'stderr',
- 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC',
- 'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
- 'try', 'catch', 'inline', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
- 'static_cast', 'explicit', 'friend', 'wchar_t', 'typename', 'typeid', 'class' ,
- 'foreach','connect', 'Q_OBJECT' , 'slots' , 'signals'
- ),
- 3 => array(
- 'cin', 'cerr', 'clog', 'cout',
- 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
- 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
- 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper',
- 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
- 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
- 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp',
- 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
- 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
- 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
- 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
- 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
- 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
- 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
- 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
- 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
- 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
- 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
- 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
- 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
- ),
- 4 => array(
- 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'long', 'longint',
- 'register', 'short', 'shortint', 'signed', 'static', 'struct',
- 'typedef', 'union', 'unsigned', 'void', 'volatile', 'extern', 'jmp_buf',
- 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
- 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
- ),
- 5 => array(
- 'QAbstractButton','QDir','QIntValidator','QRegExpValidator','QTabWidget','QAbstractEventDispatcher',
- 'QDirectPainter','QIODevice','QRegion','QTcpServer','QAbstractExtensionFactory','QDirModel',
- 'QItemDelegate','QResizeEvent','QTcpSocket','QAbstractExtensionManager','QDockWidget',
- 'QItemEditorCreatorBase','QResource','QTemporaryFile','QAbstractFileEngine','QDomAttr',
- 'QItemEditorFactory','QRubberBand','QTestEventList','QAbstractFileEngineHandler','QDomCDATASection',
- 'QItemSelection','QScreen','QTextBlock','QAbstractFormBuilder','QDomCharacterData','QItemSelectionModel',
- 'QScreenCursor','QTextBlockFormat','QAbstractGraphicsShapeItem','QDomComment','QItemSelectionRange',
- 'QScreenDriverFactory','QTextBlockGroup','QAbstractItemDelegate','QDomDocument','QKbdDriverFactory',
- 'QScreenDriverPlugin','QTextBlockUserData','QAbstractItemModel','QDomDocumentFragment','QKbdDriverPlugin',
- 'QScrollArea','QTextBrowser','QAbstractItemView','QDomDocumentType','QKeyEvent','QScrollBar',
- 'QTextCharFormat','QAbstractListModel','QDomElement','QKeySequence','QSemaphore','QTextCodec',
- 'QAbstractPrintDialog','QDomEntity','QLabel','QSessionManager','QTextCodecPlugin','QAbstractProxyModel',
- 'QDomEntityReference','QLatin1Char','QSet','QTextCursor','QAbstractScrollArea','QDomImplementation',
- 'QLatin1String','QSetIterator','QTextDecoder','QAbstractSlider','QDomNamedNodeMap','QLayout','QSettings',
- 'QTextDocument','QAbstractSocket','QDomNode','QLayoutItem','QSharedData','QTextDocumentFragment',
- 'QAbstractSpinBox','QDomNodeList','QLCDNumber','QSharedDataPointer','QTextEdit','QAbstractTableModel',
- 'QDomNotation','QLibrary','QShortcut','QTextEncoder','QAbstractTextDocumentLayout',
- 'QDomProcessingInstruction','QLibraryInfo','QShortcutEvent','QTextFormat','QAccessible','QDomText',
- 'QLine','QShowEvent','QTextFragment','QAccessibleBridge','QDoubleSpinBox','QLinearGradient',
- 'QSignalMapper','QTextFrame','QAccessibleBridgePlugin','QDoubleValidator','QLineEdit','QSignalSpy',
- 'QTextFrameFormat','QAccessibleEvent','QDrag','QLineF','QSize','QTextImageFormat','QAccessibleInterface',
- 'QDragEnterEvent','QLinkedList','QSizeF','QTextInlineObject','QAccessibleObject','QDragLeaveEvent',
- 'QLinkedListIterator','QSizeGrip','QTextLayout','QAccessiblePlugin','QDragMoveEvent','QLinuxFbScreen',
- 'QSizePolicy','QTextLength','QAccessibleWidget','QDropEvent','QList','QSlider','QTextLine','QAction',
- 'QDynamicPropertyChangeEvent','QListIterator','QSocketNotifier','QTextList','QActionEvent','QErrorMessage',
- 'QListView','QSortFilterProxyModel','QTextListFormat','QActionGroup','QEvent','QListWidget','QSound',
- 'QTextObject','QApplication','QEventLoop','QListWidgetItem','QSpacerItem','QTextOption','QAssistantClient',
- 'QExtensionFactory','QLocale','QSpinBox','QTextStream','QAxAggregated','QExtensionManager',
- 'QMacPasteboardMime','QSplashScreen','QTextTable','QAxBase','QFile','QMacStyle','QSplitter',
- 'QTextTableCell','QAxBindable','QFileDialog','QMainWindow','QSplitterHandle','QTextTableFormat',
- 'QAxFactory','QFileIconProvider','QMap','QSqlDatabase','QThread','QAxObject','QFileInfo','QMapIterator',
- 'QSqlDriver','QThreadStorage','QAxScript','QFileOpenEvent','QMatrix','QSqlDriverCreator','QTime',
- 'QAxScriptEngine','QFileSystemWatcher','QMenu','QSqlDriverCreatorBase','QTimeEdit','QAxScriptManager',
- 'QFlag','QMenuBar','QSqlDriverPlugin','QTimeLine','QAxWidget','QFlags','QMessageBox','QSqlError','QTimer',
- 'QBasicTimer','QFocusEvent','QMetaClassInfo','QSqlField','QTimerEvent','QBitArray','QFocusFrame',
- 'QMetaEnum','QSqlIndex','QToolBar','QBitmap','QFont','QMetaMethod','QSqlQuery','QToolBox','QBoxLayout',
- 'QFontComboBox','QMetaObject','QSqlQueryModel','QToolButton','QBrush','QFontDatabase','QMetaProperty',
- 'QSqlRecord','QToolTip','QBuffer','QFontDialog','QMetaType','QSqlRelation','QTransformedScreen',
- 'QButtonGroup','QFontInfo','QMimeData','QSqlRelationalDelegate','QTranslator','QByteArray','QFontMetrics',
- 'QMimeSource','QSqlRelationalTableModel','QTreeView','QByteArrayMatcher','QFontMetricsF','QModelIndex',
- 'QSqlResult','QTreeWidget','QCache','QFormBuilder','QMotifStyle','QSqlTableModel','QTreeWidgetItem',
- 'QCalendarWidget','QFrame','QMouseDriverFactory','QStack','QTreeWidgetItemIterator','QCDEStyle',
- 'QFSFileEngine','QMouseDriverPlugin','QStackedLayout','QUdpSocket','QChar','QFtp','QMouseEvent',
- 'QStackedWidget','QUiLoader','QCheckBox','QGenericArgument','QMoveEvent','QStandardItem','QUndoCommand',
- 'QChildEvent','QGenericReturnArgument','QMovie','QStandardItemEditorCreator','QUndoGroup',
- 'QCleanlooksStyle','QGLColormap','QMultiHash','QStandardItemModel','QUndoStack','QClipboard',
- 'QGLContext','QMultiMap','QStatusBar','QUndoView','QCloseEvent','QGLFormat','QMutableHashIterator',
- 'QStatusTipEvent','QUrl','QColor','QGLFramebufferObject','QMutableLinkedListIterator','QString',
- 'QUrlInfo','QColorDialog','QGLPixelBuffer','QMutableListIterator','QStringList','QUuid','QColormap',
- 'QGLWidget','QMutableMapIterator','QStringListModel','QValidator','QComboBox','QGradient',
- 'QMutableSetIterator','QStringMatcher','QVariant','QCommonStyle','QGraphicsEllipseItem',
- 'QMutableVectorIterator','QStyle','QVarLengthArray','QCompleter','QGraphicsItem','QMutex',
- 'QStyleFactory','QVBoxLayout','QConicalGradient','QGraphicsItemAnimation','QMutexLocker',
- 'QStyleHintReturn','QVector','QContextMenuEvent','QGraphicsItemGroup','QNetworkAddressEntry',
- 'QStyleHintReturnMask','QVectorIterator','QCopChannel','QGraphicsLineItem','QNetworkInterface',
- 'QStyleOption','QVFbScreen','QCoreApplication','QGraphicsPathItem','QNetworkProxy','QStyleOptionButton',
- 'QVNCScreen','QCursor','QGraphicsPixmapItem','QObject','QStyleOptionComboBox','QWaitCondition',
- 'QCustomRasterPaintDevice','QGraphicsPolygonItem','QObjectCleanupHandler','QStyleOptionComplex',
- 'QWhatsThis','QDataStream','QGraphicsRectItem','QPageSetupDialog','QStyleOptionDockWidget',
- 'QWhatsThisClickedEvent','QDataWidgetMapper','QGraphicsScene','QPaintDevice','QStyleOptionFocusRect',
- 'QWheelEvent','QDate','QGraphicsSceneContextMenuEvent','QPaintEngine','QStyleOptionFrame','QWidget',
- 'QDateEdit','QGraphicsSceneEvent','QPaintEngineState','QStyleOptionFrameV2','QWidgetAction','QDateTime',
- 'QGraphicsSceneHoverEvent','QPainter','QStyleOptionGraphicsItem','QWidgetItem','QDateTimeEdit',
- 'QGraphicsSceneMouseEvent','QPainterPath','QStyleOptionGroupBox','QWindowsMime','QDBusAbstractAdaptor',
- 'QGraphicsSceneWheelEvent','QPainterPathStroker','QStyleOptionHeader','QWindowsStyle',
- 'QDBusAbstractInterface','QGraphicsSimpleTextItem','QPaintEvent','QStyleOptionMenuItem',
- 'QWindowStateChangeEvent','QDBusArgument','QGraphicsSvgItem','QPair','QStyleOptionProgressBar',
- 'QWindowsXPStyle','QDBusConnection','QGraphicsTextItem','QPalette','QStyleOptionProgressBarV2',
- 'QWorkspace','QDBusConnectionInterface','QGraphicsView','QPen','QStyleOptionQ3DockWindow','QWriteLocker',
- 'QDBusError','QGridLayout','QPersistentModelIndex','QStyleOptionQ3ListView','QWSCalibratedMouseHandler',
- 'QDBusInterface','QGroupBox','QPicture','QStyleOptionQ3ListViewItem','QWSClient','QDBusMessage','QHash',
- 'QPictureFormatPlugin','QStyleOptionRubberBand','QWSEmbedWidget','QDBusObjectPath','QHashIterator',
- 'QPictureIO','QStyleOptionSizeGrip','QWSEvent','QDBusReply','QHBoxLayout','QPixmap','QStyleOptionSlider',
- 'QWSInputMethod','QDBusServer','QHeaderView','QPixmapCache','QStyleOptionSpinBox','QWSKeyboardHandler',
- 'QDBusSignature','QHelpEvent','QPlastiqueStyle','QStyleOptionTab','QWSMouseHandler','QDBusVariant',
- 'QHideEvent','QPluginLoader','QStyleOptionTabBarBase','QWSPointerCalibrationData','QDecoration',
- 'QHostAddress','QPoint','QStyleOptionTabV2','QWSScreenSaver','QDecorationFactory','QHostInfo','QPointer',
- 'QStyleOptionTabWidgetFrame','QWSServer','QDecorationPlugin','QHoverEvent','QPointF','QStyleOptionTitleBar',
- 'QWSTslibMouseHandler','QDesignerActionEditorInterface','QHttp','QPolygon','QStyleOptionToolBar','QWSWindow',
- 'QDesignerContainerExtension','QHttpHeader','QPolygonF','QStyleOptionToolBox','QWSWindowSurface',
- 'QDesignerCustomWidgetCollectionInterface','QHttpRequestHeader','QPrintDialog','QStyleOptionToolButton',
- 'QX11EmbedContainer','QDesignerCustomWidgetInterface','QHttpResponseHeader','QPrintEngine',
- 'QStyleOptionViewItem','QX11EmbedWidget','QDesignerFormEditorInterface','QIcon','QPrinter',
- 'QStyleOptionViewItemV2','QX11Info','QDesignerFormWindowCursorInterface','QIconDragEvent','QProcess',
- 'QStylePainter','QXmlAttributes','QDesignerFormWindowInterface','QIconEngine','QProgressBar',
- 'QStylePlugin','QXmlContentHandler','QDesignerFormWindowManagerInterface','QIconEnginePlugin',
- 'QProgressDialog','QSvgRenderer','QXmlDeclHandler','QDesignerMemberSheetExtension','QImage',
- 'QProxyModel','QSvgWidget','QXmlDefaultHandler','QDesignerObjectInspectorInterface','QImageIOHandler',
- 'QPushButton','QSyntaxHighlighter','QXmlDTDHandler','QDesignerPropertyEditorInterface','QImageIOPlugin',
- 'QQueue','QSysInfo','QXmlEntityResolver','QDesignerPropertySheetExtension','QImageReader','QRadialGradient',
- 'QSystemLocale','QXmlErrorHandler','QDesignerTaskMenuExtension','QImageWriter','QRadioButton',
- 'QSystemTrayIcon','QXmlInputSource','QDesignerWidgetBoxInterface','QInputContext','QRasterPaintEngine',
- 'QTabBar','QXmlLexicalHandler','QDesktopServices','QInputContextFactory','QReadLocker','QTabletEvent',
- 'QXmlLocator','QDesktopWidget','QInputContextPlugin','QReadWriteLock','QTableView','QXmlNamespaceSupport',
- 'QDial','QInputDialog','QRect','QTableWidget','QXmlParseException','QDialog','QInputEvent','QRectF',
- 'QTableWidgetItem','QXmlReader','QDialogButtonBox','QInputMethodEvent','QRegExp',
- 'QTableWidgetSelectionRange','QXmlSimpleReader'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':', ',', ';', '|', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight:bold;',
- 2 => 'color: #0057AE;',
- 3 => 'color: #2B74C7;',
- 4 => 'color: #0057AE;',
- 5 => 'color: #22aadd;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #888888;',
- 2 => 'color: #006E28;',
- 'MULTI' => 'color: #888888; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #660099; font-weight: bold;',
- 3 => 'color: #660099; font-weight: bold;',
- 4 => 'color: #660099; font-weight: bold;',
- 5 => 'color: #006699; font-weight: bold;',
- 'HARD' => '',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #006E28;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #BF0303;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #B08000;',
- GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
- ),
- 'METHODS' => array(
- 1 => 'color: #2B74C7;',
- 2 => 'color: #2B74C7;',
- 3 => 'color: #2B74C7;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #006E28;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => 'http://doc.trolltech.com/latest/{FNAMEL}.html'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::',
- 3 => '-&gt;',
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
- 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_<\|%\\-])"
- ),
- 'OOLANG' => array(
- 'MATCH_AFTER' => '~?[a-zA-Z][a-zA-Z0-9_]*',
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/cpp.php b/libvpx/examples/includes/geshi/geshi/cpp.php
deleted file mode 100644
index 28b585d..0000000
--- a/libvpx/examples/includes/geshi/geshi/cpp.php
+++ /dev/null
@@ -1,226 +0,0 @@
-<?php
-/*************************************************************************************
- * cpp.php
- * -------
- * Author: Dennis Bayer (Dennis.Bayer@mnifh-giessen.de)
- * Contributors:
- * - M. Uli Kusterer (witness.of.teachtext@gmx.net)
- * - Jack Lloyd (lloyd@randombit.net)
- * Copyright: (c) 2004 Dennis Bayer, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/09/27
- *
- * C++ language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/XX/XX (1.0.2)
- * - Added several new keywords (Jack Lloyd)
- * 2004/11/27 (1.0.1)
- * - Added StdCLib function and constant names, changed color scheme to
- * a cleaner one. (M. Uli Kusterer)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'C++',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Multiline-continued single-line comments
- 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
- //Multiline-continued preprocessor define
- 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[abfnrtv\\'\"?\n]#i",
- //Hexadecimal Char Specs
- 2 => "#\\\\x[\da-fA-F]{2}#",
- //Hexadecimal Char Specs
- 3 => "#\\\\u[\da-fA-F]{4}#",
- //Hexadecimal Char Specs
- 4 => "#\\\\U[\da-fA-F]{8}#",
- //Octal Char Specs
- 5 => "#\\\\[0-7]{1,3}#"
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
- GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'break', 'case', 'continue', 'default', 'do', 'else', 'for', 'goto', 'if', 'return',
- 'switch', 'throw', 'while'
- ),
- 2 => array(
- 'NULL', 'false', 'true', 'enum', 'errno', 'EDOM',
- 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
- 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
- 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
- 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
- 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
- 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
- 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
- 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
- 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam',
- 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX', 'stdin', 'stdout', 'stderr',
- 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC',
- 'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
- 'try', 'catch', 'inline', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
- 'static_cast', 'explicit', 'friend', 'wchar_t', 'typename', 'typeid', 'class'
- ),
- 3 => array(
- 'cin', 'cerr', 'clog', 'cout', 'delete', 'new', 'this',
- 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
- 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
- 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper',
- 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
- 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
- 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp',
- 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
- 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
- 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
- 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
- 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
- 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
- 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
- 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
- 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
- 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
- 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
- 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
- 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
- ),
- 4 => array(
- 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'long', 'longint',
- 'register', 'short', 'shortint', 'signed', 'static', 'struct',
- 'typedef', 'union', 'unsigned', 'void', 'volatile', 'extern', 'jmp_buf',
- 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
- 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
- ),
- ),
- 'SYMBOLS' => array(
- 0 => array('(', ')', '{', '}', '[', ']'),
- 1 => array('<', '>','='),
- 2 => array('+', '-', '*', '/', '%'),
- 3 => array('!', '^', '&', '|'),
- 4 => array('?', ':', ';')
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #0000dd;',
- 4 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666;',
- 2 => 'color: #339900;',
- 'MULTI' => 'color: #ff0000; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #660099; font-weight: bold;',
- 3 => 'color: #660099; font-weight: bold;',
- 4 => 'color: #660099; font-weight: bold;',
- 5 => 'color: #006699; font-weight: bold;',
- 'HARD' => '',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #008000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000dd;',
- GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
- ),
- 'METHODS' => array(
- 1 => 'color: #007788;',
- 2 => 'color: #007788;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;',
- 1 => 'color: #000080;',
- 2 => 'color: #000040;',
- 3 => 'color: #000040;',
- 4 => 'color: #008080;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#])",
- 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_\|%\\-])"
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/csharp.php b/libvpx/examples/includes/geshi/geshi/csharp.php
deleted file mode 100644
index 2d79ee2..0000000
--- a/libvpx/examples/includes/geshi/geshi/csharp.php
+++ /dev/null
@@ -1,249 +0,0 @@
-<?php
-/*************************************************************************************
- * csharp.php
- * ----------
- * Author: Alan Juden (alan@judenware.org)
- * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * C# language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/25 (1.0.7.22)
- * - Added highlighting of using and namespace directives as non-OOP
- * 2005/01/05 (1.0.1)
- * - Used hardquote support for @"..." strings (Cliff Stanford)
- * 2004/11/27 (1.0.0)
- * - Initial release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'C#',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Using and Namespace directives (basic support)
- //Please note that the alias syntax for using is not supported
- 3 => '/(?:(?<=using[\\n\\s])|(?<=namespace[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*[a-zA-Z0-9_]+[\n\s]*(?=[;=])/i'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'HARDQUOTE' => array('@"', '"'),
- 'HARDESCAPE' => array('""'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'as', 'auto', 'base', 'break', 'case', 'catch', 'const', 'continue',
- 'default', 'do', 'else', 'event', 'explicit', 'extern', 'false',
- 'finally', 'fixed', 'for', 'foreach', 'goto', 'if', 'implicit',
- 'in', 'internal', 'lock', 'namespace', 'null', 'operator', 'out',
- 'override', 'params', 'partial', 'private', 'protected', 'public',
- 'readonly', 'ref', 'return', 'sealed', 'stackalloc', 'static',
- 'switch', 'this', 'throw', 'true', 'try', 'unsafe', 'using',
- 'virtual', 'void', 'while'
- ),
- 2 => array(
- '#elif', '#endif', '#endregion', '#else', '#error', '#define', '#if',
- '#line', '#region', '#undef', '#warning'
- ),
- 3 => array(
- 'checked', 'is', 'new', 'sizeof', 'typeof', 'unchecked'
- ),
- 4 => array(
- 'bool', 'byte', 'char', 'class', 'decimal', 'delegate', 'double',
- 'enum', 'float', 'int', 'interface', 'long', 'object', 'sbyte',
- 'short', 'string', 'struct', 'uint', 'ulong', 'ushort'
- ),
- 5 => array(
- 'Microsoft.Win32',
- 'System',
- 'System.CodeDOM',
- 'System.CodeDOM.Compiler',
- 'System.Collections',
- 'System.Collections.Bases',
- 'System.ComponentModel',
- 'System.ComponentModel.Design',
- 'System.ComponentModel.Design.CodeModel',
- 'System.Configuration',
- 'System.Configuration.Assemblies',
- 'System.Configuration.Core',
- 'System.Configuration.Install',
- 'System.Configuration.Interceptors',
- 'System.Configuration.Schema',
- 'System.Configuration.Web',
- 'System.Core',
- 'System.Data',
- 'System.Data.ADO',
- 'System.Data.Design',
- 'System.Data.Internal',
- 'System.Data.SQL',
- 'System.Data.SQLTypes',
- 'System.Data.XML',
- 'System.Data.XML.DOM',
- 'System.Data.XML.XPath',
- 'System.Data.XML.XSLT',
- 'System.Diagnostics',
- 'System.Diagnostics.SymbolStore',
- 'System.DirectoryServices',
- 'System.Drawing',
- 'System.Drawing.Design',
- 'System.Drawing.Drawing2D',
- 'System.Drawing.Imaging',
- 'System.Drawing.Printing',
- 'System.Drawing.Text',
- 'System.Globalization',
- 'System.IO',
- 'System.IO.IsolatedStorage',
- 'System.Messaging',
- 'System.Net',
- 'System.Net.Sockets',
- 'System.NewXml',
- 'System.NewXml.XPath',
- 'System.NewXml.Xsl',
- 'System.Reflection',
- 'System.Reflection.Emit',
- 'System.Resources',
- 'System.Runtime.InteropServices',
- 'System.Runtime.InteropServices.Expando',
- 'System.Runtime.Remoting',
- 'System.Runtime.Serialization',
- 'System.Runtime.Serialization.Formatters',
- 'System.Runtime.Serialization.Formatters.Binary',
- 'System.Security',
- 'System.Security.Cryptography',
- 'System.Security.Cryptography.X509Certificates',
- 'System.Security.Permissions',
- 'System.Security.Policy',
- 'System.Security.Principal',
- 'System.ServiceProcess',
- 'System.Text',
- 'System.Text.RegularExpressions',
- 'System.Threading',
- 'System.Timers',
- 'System.Web',
- 'System.Web.Caching',
- 'System.Web.Configuration',
- 'System.Web.Security',
- 'System.Web.Services',
- 'System.Web.Services.Description',
- 'System.Web.Services.Discovery',
- 'System.Web.Services.Protocols',
- 'System.Web.UI',
- 'System.Web.UI.Design',
- 'System.Web.UI.Design.WebControls',
- 'System.Web.UI.Design.WebControls.ListControls',
- 'System.Web.UI.HtmlControls',
- 'System.Web.UI.WebControls',
- 'System.WinForms',
- 'System.WinForms.ComponentModel',
- 'System.WinForms.Design',
- 'System.Xml',
- 'System.Xml.Serialization',
- 'System.Xml.Serialization.Code',
- 'System.Xml.Serialization.Schema'
- ),
- ),
- 'SYMBOLS' => array(
- '+', '-', '*', '?', '=', '/', '%', '&', '>', '<', '^', '!', ':', ';',
- '(', ')', '{', '}', '[', ']', '|'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0600FF;',
- 2 => 'color: #FF8000; font-weight: bold;',
- 3 => 'color: #008000;',
- 4 => 'color: #FF0000;',
- 5 => 'color: #000000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008080; font-style: italic;',
- 2 => 'color: #008080;',
- 3 => 'color: #008080;',
- 'MULTI' => 'color: #008080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008080; font-weight: bold;',
- 'HARD' => 'color: #008080; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #666666;',
- 'HARD' => 'color: #666666;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000FF;',
- 2 => 'color: #0000FF;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.google.com/search?q={FNAMEL}+msdn.microsoft.com',
- 4 => '',
- 5 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#>|^])",
- 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_<\|%\\-])"
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/css.php b/libvpx/examples/includes/geshi/geshi/css.php
deleted file mode 100644
index 0080325..0000000
--- a/libvpx/examples/includes/geshi/geshi/css.php
+++ /dev/null
@@ -1,212 +0,0 @@
-<?php
-/*************************************************************************************
- * css.php
- * -------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/18
- *
- * CSS language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.2)
- * - Changed regexps to catch "-" symbols
- * - Added support for URLs
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Improve or drop regexps for class/id/psuedoclass highlighting
- * * Re-look at keywords - possibly to make several CSS language
- * files, all with different versions of CSS in them
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'CSS',
- 'COMMENT_SINGLE' => array(1 => '@'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- 2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', "'"),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'aqua', 'azimuth', 'background-attachment', 'background-color',
- 'background-image', 'background-position', 'background-repeat',
- 'background', 'black', 'blue', 'border-bottom-color',
- 'border-bottom-style', 'border-bottom-width', 'border-left-color',
- 'border-left-style', 'border-left-width', 'border-right',
- 'border-right-color', 'border-right-style', 'border-right-width',
- 'border-top-color', 'border-top-style',
- 'border-top-width','border-bottom', 'border-collapse',
- 'border-left', 'border-width', 'border-color', 'border-spacing',
- 'border-style', 'border-top', 'border', 'caption-side', 'clear',
- 'clip', 'color', 'content', 'counter-increment', 'counter-reset',
- 'cue-after', 'cue-before', 'cue', 'cursor', 'direction', 'display',
- 'elevation', 'empty-cells', 'float', 'font-family', 'font-size',
- 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant',
- 'font-weight', 'font', 'line-height', 'letter-spacing',
- 'list-style', 'list-style-image', 'list-style-position',
- 'list-style-type', 'margin-bottom', 'margin-left', 'margin-right',
- 'margin-top', 'margin', 'marker-offset', 'marks', 'max-height',
- 'max-width', 'min-height', 'min-width', 'orphans', 'outline',
- 'outline-color', 'outline-style', 'outline-width', 'overflow',
- 'padding-bottom', 'padding-left', 'padding-right', 'padding-top',
- 'padding', 'page', 'page-break-after', 'page-break-before',
- 'page-break-inside', 'pause-after', 'pause-before', 'pause',
- 'pitch', 'pitch-range', 'play-during', 'position', 'quotes',
- 'richness', 'right', 'size', 'speak-header', 'speak-numeral',
- 'speak-punctuation', 'speak', 'speech-rate', 'stress',
- 'table-layout', 'text-align', 'text-decoration', 'text-indent',
- 'text-shadow', 'text-transform', 'top', 'unicode-bidi',
- 'vertical-align', 'visibility', 'voice-family', 'volume',
- 'white-space', 'widows', 'width', 'word-spacing', 'z-index',
- 'bottom', 'left', 'height'
- ),
- 2 => array(
- 'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
- 'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
- 'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
- 'center-right', 'center', 'circle', 'cjk-ideographic',
- 'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
- 'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
- 'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
- 'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
- 'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
- 'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
- 'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
- 'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
- 'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
- 'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
- 'left-side', 'leftwards', 'level', 'lighter', 'lime',
- 'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
- 'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
- 'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
- 'narrower', 'navy', 'ne-resize', 'no-close-quote',
- 'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
- 'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
- 'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
- 'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
- 'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
- 'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
- 'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
- 'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
- 'spell-out', 'square', 'static', 'status-bar', 'super',
- 'sw-resize', 'table-caption', 'table-cell', 'table-column',
- 'table-column-group', 'table-footer-group', 'table-header-group',
- 'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
- 'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
- 'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
- 'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
- 'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
- 'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
- 'yes'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', ':', ';',
- '>', '+', '*', ',', '^', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #993333;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #a1a100;',
- 2 => 'color: #ff0000; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #00AA00;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #00AA00;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 0 => 'color: #cc00cc;',
- 1 => 'color: #6666ff;',
- 2 => 'color: #3333ff;',
- 3 => 'color: #933;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //DOM Node ID
- 0 => '\#[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*',
- //CSS classname
- 1 => '\.(?!\d)[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*\b(?=[\{\.#\s,:].|<\|)',
- //CSS Pseudo classes
- //note: & is needed for &gt; (i.e. > )
- 2 => '(?<!\\\\):(?!\d)[a-zA-Z0-9\-]+\b(?:\s*(?=[\{\.#a-zA-Z,:+*&](.|\n)|<\|))',
- //Measurements
- 3 => '[+\-]?(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\.])'
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/d.php b/libvpx/examples/includes/geshi/geshi/d.php
deleted file mode 100644
index 9711a6e..0000000
--- a/libvpx/examples/includes/geshi/geshi/d.php
+++ /dev/null
@@ -1,272 +0,0 @@
-<?php
-/*************************************************************************************
- * d.php
- * -----
- * Author: Thomas Kuehne (thomas@kuehne.cn)
- * Copyright: (c) 2005 Thomas Kuehne (http://thomas.kuehne.cn/)
- * Release Version: 1.0.8.3
- * Date Started: 2005/04/22
- *
- * D language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/04/22 (0.0.2)
- * - added _d_* and sizeof/ptrdiff_t
- * 2005/04/20 (0.0.1)
- * - First release
- *
- * TODO (updated 2005/04/22)
- * -------------------------
- * * nested comments
- * * correct handling of r"" and ``
- * * correct handling of ... and ..
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'D',
- 'COMMENT_SINGLE' => array(2 => '///', 1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- // doxygen comments
- 3 => '#/\*\*(?![\*\/]).*\*/#sU',
- // raw strings
- 4 => '#r"[^"]*"#s',
- // Script Style interpreter comment
- 5 => "/\A#!(?=\\/).*?$/m"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', "'"),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[abfnrtv\\'\"?\n\\\\]#i",
- //Hexadecimal Char Specs
- 2 => "#\\\\x[\da-fA-F]{2}#",
- //Hexadecimal Char Specs
- 3 => "#\\\\u[\da-fA-F]{4}#",
- //Hexadecimal Char Specs
- 4 => "#\\\\U[\da-fA-F]{8}#",
- //Octal Char Specs
- 5 => "#\\\\[0-7]{1,3}#",
- //Named entity escapes
- /*6 => "#\\\\&(?:quot|amp|lt|gt|OElig|oelig|Scaron|scaron|Yuml|circ|tilde|".
- "ensp|emsp|thinsp|zwnj|zwj|lrm|rlm|ndash|mdash|lsquo|rsquo|sbquo|".
- "ldquo|rdquo|bdquo|dagger|Dagger|permil|lsaquo|rsaquo|euro|nbsp|".
- "iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|".
- "shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|".
- "sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|".
- "Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|".
- "Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|".
- "times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|".
- "aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|".
- "euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|".
- "otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|".
- "yuml|fnof|Alpha|Beta|Gamma|Delta|Epsilon|Zeta|Eta|Theta|Iota|".
- "Kappa|Lambda|Mu|Nu|Xi|Omicron|Pi|Rho|Sigma|Tau|Upsilon|Phi|Chi|".
- "Psi|Omega|alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|".
- "kappa|lambda|mu|nu|xi|omicron|pi|rho|sigmaf|sigma|tau|upsilon|".
- "phi|chi|psi|omega|thetasym|upsih|piv|bull|hellip|prime|Prime|".
- "oline|frasl|weierp|image|real|trade|alefsym|larr|uarr|rarr|darr|".
- "harr|crarr|lArr|uArr|rArr|dArr|hArr|forall|part|exist|empty|".
- "nabla|isin|notin|ni|prod|sum|minus|lowast|radic|prop|infin|ang|".
- "and|or|cap|cup|int|there4|sim|cong|asymp|ne|equiv|le|ge|sub|sup|".
- "nsub|sube|supe|oplus|otimes|perp|sdot|lceil|rceil|lfloor|rfloor|".
- "lang|rang|loz|spades|clubs|hearts|diams);#",*/
- // optimized:
- 6 => "#\\\\&(?:A(?:Elig|acute|circ|grave|lpha|ring|tilde|uml)|Beta|".
- "C(?:cedil|hi)|D(?:agger|elta)|E(?:TH|acute|circ|grave|psilon|ta|uml)|".
- "Gamma|I(?:acute|circ|grave|ota|uml)|Kappa|Lambda|Mu|N(?:tilde|u)|".
- "O(?:Elig|acute|circ|grave|m(?:ega|icron)|slash|tilde|uml)|".
- "P(?:hi|i|rime|si)|Rho|S(?:caron|igma)|T(?:HORN|au|heta)|".
- "U(?:acute|circ|grave|psilon|uml)|Xi|Y(?:acute|uml)|Zeta|".
- "a(?:acute|c(?:irc|ute)|elig|grave|l(?:efsym|pha)|mp|n[dg]|ring|".
- "symp|tilde|uml)|b(?:dquo|eta|rvbar|ull)|c(?:ap|cedil|e(?:dil|nt)|".
- "hi|irc|lubs|o(?:ng|py)|rarr|u(?:p|rren))|d(?:Arr|a(?:gger|rr)|".
- "e(?:g|lta)|i(?:ams|vide))|e(?:acute|circ|grave|m(?:pty|sp)|nsp|".
- "psilon|quiv|t[ah]|u(?:ml|ro)|xist)|f(?:nof|orall|ra(?:c(?:1[24]|34)|sl))|".
- "g(?:amma|e|t)|h(?:Arr|arr|e(?:arts|llip))|i(?:acute|circ|excl|grave|mage|".
- "n(?:fin|t)|ota|quest|sin|uml)|kappa|l(?:Arr|a(?:mbda|ng|quo|rr)|ceil|".
- "dquo|e|floor|o(?:wast|z)|rm|s(?:aquo|quo)|t)|m(?:acr|dash|".
- "i(?:cro|ddot|nus)|u)|n(?:abla|bsp|dash|e|i|ot(?:in)?|sub|tilde|u)|".
- "o(?:acute|circ|elig|grave|line|m(?:ega|icron)|plus|r(?:d[fm])?|".
- "slash|ti(?:lde|mes)|uml)|p(?:ar[at]|er(?:mil|p)|hi|iv?|lusmn|ound|".
- "r(?:ime|o[dp])|si)|quot|r(?:Arr|a(?:dic|ng|quo|rr)|ceil|dquo|e(?:al|g)|".
- "floor|ho|lm|s(?:aquo|quo))|s(?:bquo|caron|dot|ect|hy|i(?:gmaf?|m)|".
- "pades|u(?:be?|m|p[123e]?)|zlig)|t(?:au|h(?:e(?:re4|ta(?:sym)?)|insp|".
- "orn)|i(?:lde|mes)|rade)|u(?:Arr|a(?:cute|rr)|circ|grave|ml|".
- "psi(?:h|lon)|uml)|weierp|xi|y(?:acute|en|uml)|z(?:eta|w(?:j|nj)));#",
- ),
- 'HARDQUOTE' => array('`', '`'),
- 'HARDESCAPE' => array(),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_INT_CSTYLE | GESHI_NUMBER_BIN_PREFIX_0B |
- GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX | GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_NONSCI_F | GESHI_NUMBER_FLT_SCI_SHORT | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'break', 'case', 'continue', 'do', 'else',
- 'for', 'foreach', 'goto', 'if', 'return',
- 'switch', 'while'
- ),
- 2 => array(
- 'alias', 'asm', 'assert', 'body', 'cast',
- 'catch', 'default', 'delegate', 'delete',
- 'extern', 'false', 'finally', 'function',
- 'import', 'in', 'inout', 'interface',
- 'invariant', 'is', 'mixin', 'module', 'new',
- 'null', 'out', 'pragma', 'ref', 'super', 'this',
- 'throw', 'true', 'try', 'typedef', 'typeid',
- 'typeof', 'union', 'with'
- ),
- 3 => array(
- 'ArrayBoundsError', 'AssertError',
- 'ClassInfo', 'Error', 'Exception',
- 'Interface', 'ModuleInfo', 'Object',
- 'OutOfMemoryException', 'SwitchError',
- 'TypeInfo', '_d_arrayappend',
- '_d_arrayappendb', '_d_arrayappendc',
- '_d_arrayappendcb', '_d_arraycast',
- '_d_arraycast_frombit', '_d_arraycat',
- '_d_arraycatb', '_d_arraycatn',
- '_d_arraycopy', '_d_arraycopybit',
- '_d_arraysetbit', '_d_arraysetbit2',
- '_d_arraysetlength', '_d_arraysetlengthb',
- '_d_callfinalizer',
- '_d_create_exception_object',
- '_d_criticalenter', '_d_criticalexit',
- '_d_delarray', '_d_delclass',
- '_d_delinterface', '_d_delmemory',
- '_d_dynamic_cast', '_d_exception',
- '_d_exception_filter', '_d_framehandler',
- '_d_interface_cast', '_d_interface_vtbl',
- '_d_invariant', '_d_isbaseof',
- '_d_isbaseof2', '_d_local_unwind',
- '_d_monitorenter', '_d_monitorexit',
- '_d_monitorrelease', '_d_monitor_epilog',
- '_d_monitor_handler', '_d_monitor_prolog',
- '_d_new', '_d_newarrayi', '_d_newbitarray',
- '_d_newclass', '_d_obj_cmp', '_d_obj_eq',
- '_d_OutOfMemory', '_d_switch_dstring',
- '_d_switch_string', '_d_switch_ustring',
- '_d_throw',
- ),
- 4 => array(
- 'abstract', 'align', 'auto', 'bit', 'bool',
- 'byte', 'cdouble', 'cent', 'cfloat', 'char',
- 'class', 'const', 'creal', 'dchar', 'debug',
- 'deprecated', 'double', 'enum', 'export',
- 'final', 'float', 'idouble', 'ifloat', 'int',
- 'ireal', 'long', 'override', 'package',
- 'private', 'protected', 'ptrdiff_t',
- 'public', 'real', 'short', 'size_t',
- 'static', 'struct', 'synchronized',
- 'template', 'ubyte', 'ucent', 'uint',
- 'ulong', 'unittest', 'ushort', 'version',
- 'void', 'volatile', 'wchar'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '?', '!', ';', ':', ',', '...', '..',
- '+', '-', '*', '/', '%', '&', '|', '^', '<', '>', '=', '~',
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #aaaadd; font-weight: bold;',
- 4 => 'color: #993333;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #009933; font-style: italic;',
- 3 => 'color: #009933; font-style: italic;',
- 4 => 'color: #ff0000;',
- 5 => 'color: #0040ff;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #660099; font-weight: bold;',
- 3 => 'color: #660099; font-weight: bold;',
- 4 => 'color: #660099; font-weight: bold;',
- 5 => 'color: #006699; font-weight: bold;',
- 6 => 'color: #666699; font-weight: bold; font-style: italic;',
- 'HARD' => '',
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;',
- 'HARD' => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000dd;',
- GESHI_NUMBER_BIN_PREFIX_0B => 'color: #208080;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_SHORT => 'color:#800080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI_F => 'color:#800080;',
- GESHI_NUMBER_FLT_NONSCI => 'color:#800080;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/dcs.php b/libvpx/examples/includes/geshi/geshi/dcs.php
deleted file mode 100644
index b9fe581..0000000
--- a/libvpx/examples/includes/geshi/geshi/dcs.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-/*************************************************************************************
- * dcs.php
- * ---------------------------------
- * Author: Stelio Passaris (GeSHi@stelio.net)
- * Copyright: (c) 2009 Stelio Passaris (http://stelio.net/stiki/GeSHi)
- * Release Version: 1.0.8.3
- * Date Started: 2009/01/20
- *
- * DCS language file for GeSHi.
- *
- * DCS (Data Conversion System) is part of Sungard iWorks' Prophet suite and is used
- * to convert external data files into a format that Prophet and Glean can read.
- * See http://www.prophet-web.com/Products/DCS for product information.
- * This language file is current for DCS version 7.3.2.
- *
- * Note that the DCS IDE does not handle escape characters correctly. The IDE thinks
- * that a backslash '\' is an escape character, but in practice the backslash does
- * not escape the string delimiter character '"' when the program runs. A '\\' is
- * escaped to '\' when the program runs, but '\"' is treated as '\' at the end of a
- * string. Therefore in this language file, we do not recognise the backslash as an
- * escape character. For the purposes of GeSHi, there is no character escaping.
- *
- * CHANGES
- * -------
- * 2009/02/21 (1.0.8.3)
- * - First Release
- *
- * TODO (updated 2009/02/21)
- * -------------------------
- * * Add handling for embedded C code. Note that the DCS IDE does not highlight C code
- * correctly, but that doesn't mean that we can't! This will be included for a
- * stable release of GeSHi of version 1.1.x (or later) that allows for highlighting
- * embedded code using that code's appropriate language file.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'DCS',
- 'COMMENT_SINGLE' => array(
- 1 => ';'
- ),
- 'COMMENT_MULTI' => array(
- ),
- 'HARDQUOTE' => array(
- ),
- 'HARDESCAPE' => '',
- 'COMMENT_REGEXP' => array(
- // Highlight embedded C code in a separate color:
- 2 => '/\bINSERT_C_CODE\b.*?\bEND_C_CODE\b/ims'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array(
- '"'
- ),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => '',
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'abs', 'ascii_value', 'bit_value', 'blank_date', 'calc_unit_values', 'cm',
- 'complete_months', 'complete_years', 'correct', 'create_input_file', 'cy',
- 'date_convert', 'day', 'del_output_separator',
- 'delete_existing_output_files', 'div', 'ex', 'exact_years', 'exp',
- 'extract_date', 'failed_validation', 'file_number', 'first_record',
- 'fract', 'fund_fac_a', 'fund_fac_b', 'fund_fac_c', 'fund_fac_d',
- 'fund_fac_e', 'fund_fac_f', 'fund_fac_g', 'fund_fac_h', 'fund_fac_i',
- 'fund_fac_j', 'fund_fac_k', 'fund_fac_l', 'fund_fac_m', 'fund_fac_n',
- 'fund_fac_o', 'fund_fac_p', 'fund_fac_q', 'fund_fac_r', 'fund_fac_s',
- 'fund_fac_t', 'fund_fac_u', 'fund_fac_v', 'fund_fac_w', 'fund_fac_x',
- 'fund_fac_y', 'fund_fac_z', 'group', 'group_record',
- 'input_file_date_time', 'input_file_extension', 'input_file_location',
- 'input_file_name', 'int', 'invalid', 'last_record', 'leap_year', 'len',
- 'ln', 'log', 'main_format_name', 'max', 'max_num_subrecords', 'message',
- 'min', 'mod', 'month', 'months_add', 'months_sub', 'nearest_months',
- 'nearest_years', 'next_record', 'nm', 'no_of_current_records',
- 'no_of_records', 'numval', 'ny', 'output', 'output_array_as_constants',
- 'output_file_path', 'output_record', 'pmdf_output', 'previous', 'rand',
- 're_start', 'read_generic_table', 'read_generic_table_text',
- 'read_input_footer', 'read_input_footer_text', 'read_input_header',
- 'read_input_header_text', 'record_count', 'record_suppressed', 'round',
- 'round_down', 'round_near', 'round_up', 'run_dcs_program', 'run_parameter',
- 'run_parameter_text', 'set_main_record', 'set_num_subrecords',
- 'sort_array', 'sort_current_records', 'sort_input', 'strval', 'substr',
- 'summarise', 'summarise_record', 'summarise_units',
- 'summarise_units_record', 'suppress_record', 'table_correct',
- 'table_validate', 'terminate', 'time', 'today', 'trim', 'ubound', 'year',
- 'years_add', 'years_sub'
- ),
- 2 => array(
- 'and', 'as', 'begin', 'boolean', 'byref', 'byval', 'call', 'case', 'date',
- 'default', 'do', 'else', 'elseif', 'end_c_code', 'endfor', 'endfunction',
- 'endif', 'endproc', 'endswitch', 'endwhile', 'eq',
- 'explicit_declarations', 'false', 'for', 'from', 'function', 'ge', 'gt',
- 'if', 'insert_c_code', 'integer', 'le', 'loop', 'lt', 'ne', 'not',
- 'number', 'or', 'private', 'proc', 'public', 'quitloop', 'return',
- 'short', 'step', 'switch', 'text', 'then', 'to', 'true', 'while'
- ),
- 3 => array(
- // These keywords are not highlighted by the DCS IDE but we may as well
- // keep track of them anyway:
- 'mp_file', 'odbc_file'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']',
- '=', '<', '>',
- '+', '-', '*', '/', '^',
- ':', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: red;',
- 2 => 'color: blue;',
- 3 => 'color: black;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: black; background-color: silver;',
- // Colors for highlighting embedded C code:
- 2 => 'color: maroon; background-color: pink;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: black;'
- ),
- 'STRINGS' => array(
- 0 => 'color: green;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: green;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: black;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- ),
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/delphi.php b/libvpx/examples/includes/geshi/geshi/delphi.php
deleted file mode 100644
index 7de1f8c..0000000
--- a/libvpx/examples/includes/geshi/geshi/delphi.php
+++ /dev/null
@@ -1,289 +0,0 @@
-<?php
-/*************************************************************************************
- * delphi.php
- * ----------
- * Author: J�rja Norbert (jnorbi@vipmail.hu), Benny Baumann (BenBE@omorphia.de)
- * Copyright: (c) 2004 J�rja Norbert, Benny Baumann (BenBE@omorphia.de), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/26
- *
- * Delphi (Object Pascal) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2005/11/19 (1.0.3)
- * - Updated the very incomplete keyword and type lists
- * 2005/09/03 (1.0.2)
- * - Added support for hex numbers and string entities
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Delphi',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('(*' => '*)', '{' => '}'),
- //Compiler directives
- 'COMMENT_REGEXP' => array(2 => '/{\\$.*?}|\\(\\*\\$.*?\\*\\)/U'),
- 'CASE_KEYWORDS' => 0,
- 'QUOTEMARKS' => array("'"),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'Abstract', 'And', 'Array', 'As', 'Asm', 'At', 'Begin', 'Case',
- 'Class', 'Const', 'Constructor', 'Contains', 'Destructor',
- 'DispInterface', 'Div', 'Do', 'DownTo', 'Else', 'End', 'Except',
- 'Export', 'Exports', 'External', 'File', 'Finalization', 'Finally',
- 'For', 'Function', 'Goto', 'If', 'Implementation', 'In', 'Inherited',
- 'Initialization', 'Inline', 'Interface', 'Is', 'Label', 'Library',
- 'Mod', 'Not', 'Object', 'Of', 'On', 'Or', 'Overload', 'Override',
- 'Package', 'Packed', 'Private', 'Procedure', 'Program', 'Property',
- 'Protected', 'Public', 'Published', 'Raise', 'Record', 'Register',
- 'Repeat', 'Requires', 'Resourcestring', 'Set', 'Shl', 'Shr', 'Then',
- 'ThreadVar', 'To', 'Try', 'Type', 'Unit', 'Until', 'Uses', 'Var',
- 'Virtual', 'While', 'With', 'Xor', 'assembler', 'far',
- 'near', 'pascal', 'register', 'cdecl', 'safecall', 'stdcall', 'varargs'
- ),
- 2 => array(
- 'nil', 'false', 'self', 'true', 'var', 'type', 'const'
- ),
- 3 => array(
- 'Abs', 'AcquireExceptionObject', 'Addr', 'AnsiToUtf8', 'Append', 'ArcTan',
- 'Assert', 'AssignFile', 'Assigned', 'BeginThread', 'BlockRead',
- 'BlockWrite', 'Break', 'ChDir', 'Chr', 'Close', 'CloseFile',
- 'CompToCurrency', 'CompToDouble', 'Concat', 'Continue', 'Copy', 'Cos',
- 'Dec', 'Delete', 'Dispose', 'DoubleToComp', 'EndThread', 'EnumModules',
- 'EnumResourceModules', 'Eof', 'Eoln', 'Erase', 'ExceptAddr',
- 'ExceptObject', 'Exclude', 'Exit', 'Exp', 'FilePos', 'FileSize',
- 'FillChar', 'Finalize', 'FindClassHInstance', 'FindHInstance',
- 'FindResourceHInstance', 'Flush', 'Frac', 'FreeMem', 'Get8087CW',
- 'GetDir', 'GetLastError', 'GetMem', 'GetMemoryManager',
- 'GetModuleFileName', 'GetVariantManager', 'Halt', 'Hi', 'High',
- 'IOResult', 'Inc', 'Include', 'Initialize', 'Insert', 'Int',
- 'IsMemoryManagerSet', 'IsVariantManagerSet', 'Length', 'Ln', 'Lo', 'Low',
- 'MkDir', 'Move', 'New', 'Odd', 'OleStrToStrVar', 'OleStrToString', 'Ord',
- 'PUCS4Chars', 'ParamCount', 'ParamStr', 'Pi', 'Pos', 'Pred', 'Ptr',
- 'Random', 'Randomize', 'Read', 'ReadLn', 'ReallocMem',
- 'ReleaseExceptionObject', 'Rename', 'Reset', 'Rewrite', 'RmDir', 'Round',
- 'RunError', 'Seek', 'SeekEof', 'SeekEoln', 'Set8087CW', 'SetLength',
- 'SetLineBreakStyle', 'SetMemoryManager', 'SetString', 'SetTextBuf',
- 'SetVariantManager', 'Sin', 'SizeOf', 'Slice', 'Sqr', 'Sqrt', 'Str',
- 'StringOfChar', 'StringToOleStr', 'StringToWideChar', 'Succ', 'Swap',
- 'Trunc', 'Truncate', 'TypeInfo', 'UCS4StringToWideString', 'UTF8Decode',
- 'UTF8Encode', 'UnicodeToUtf8', 'UniqueString', 'UpCase', 'Utf8ToAnsi',
- 'Utf8ToUnicode', 'Val', 'VarArrayRedim', 'VarClear',
- 'WideCharLenToStrVar', 'WideCharLenToString', 'WideCharToStrVar',
- 'WideCharToString', 'WideStringToUCS4String', 'Write', 'WriteLn',
-
- 'Abort', 'AddExitProc', 'AddTerminateProc', 'AdjustLineBreaks', 'AllocMem',
- 'AnsiCompareFileName', 'AnsiCompareStr', 'AnsiCompareText',
- 'AnsiDequotedStr', 'AnsiExtractQuotedStr', 'AnsiLastChar',
- 'AnsiLowerCase', 'AnsiLowerCaseFileName', 'AnsiPos', 'AnsiQuotedStr',
- 'AnsiSameStr', 'AnsiSameText', 'AnsiStrComp', 'AnsiStrIComp',
- 'AnsiStrLComp', 'AnsiStrLIComp', 'AnsiStrLastChar', 'AnsiStrLower',
- 'AnsiStrPos', 'AnsiStrRScan', 'AnsiStrScan', 'AnsiStrUpper',
- 'AnsiUpperCase', 'AnsiUpperCaseFileName', 'AppendStr', 'AssignStr',
- 'Beep', 'BoolToStr', 'ByteToCharIndex', 'ByteToCharLen', 'ByteType',
- 'CallTerminateProcs', 'ChangeFileExt', 'CharLength', 'CharToByteIndex',
- 'CharToByteLen', 'CompareMem', 'CompareStr', 'CompareText', 'CreateDir',
- 'CreateGUID', 'CurrToStr', 'CurrToStrF', 'CurrentYear', 'Date',
- 'DateTimeToFileDate', 'DateTimeToStr', 'DateTimeToString',
- 'DateTimeToSystemTime', 'DateTimeToTimeStamp', 'DateToStr', 'DayOfWeek',
- 'DecodeDate', 'DecodeDateFully', 'DecodeTime', 'DeleteFile',
- 'DirectoryExists', 'DiskFree', 'DiskSize', 'DisposeStr', 'EncodeDate',
- 'EncodeTime', 'ExceptionErrorMessage', 'ExcludeTrailingBackslash',
- 'ExcludeTrailingPathDelimiter', 'ExpandFileName', 'ExpandFileNameCase',
- 'ExpandUNCFileName', 'ExtractFileDir', 'ExtractFileDrive',
- 'ExtractFileExt', 'ExtractFileName', 'ExtractFilePath',
- 'ExtractRelativePath', 'ExtractShortPathName', 'FileAge', 'FileClose',
- 'FileCreate', 'FileDateToDateTime', 'FileExists', 'FileGetAttr',
- 'FileGetDate', 'FileIsReadOnly', 'FileOpen', 'FileRead', 'FileSearch',
- 'FileSeek', 'FileSetAttr', 'FileSetDate', 'FileSetReadOnly', 'FileWrite',
- 'FinalizePackage', 'FindClose', 'FindCmdLineSwitch', 'FindFirst',
- 'FindNext', 'FloatToCurr', 'FloatToDateTime', 'FloatToDecimal',
- 'FloatToStr', 'FloatToStrF', 'FloatToText', 'FloatToTextFmt',
- 'FmtLoadStr', 'FmtStr', 'ForceDirectories', 'Format', 'FormatBuf',
- 'FormatCurr', 'FormatDateTime', 'FormatFloat', 'FreeAndNil',
- 'GUIDToString', 'GetCurrentDir', 'GetEnvironmentVariable',
- 'GetFileVersion', 'GetFormatSettings', 'GetLocaleFormatSettings',
- 'GetModuleName', 'GetPackageDescription', 'GetPackageInfo', 'GetTime',
- 'IncAMonth', 'IncMonth', 'IncludeTrailingBackslash',
- 'IncludeTrailingPathDelimiter', 'InitializePackage', 'IntToHex',
- 'IntToStr', 'InterlockedDecrement', 'InterlockedExchange',
- 'InterlockedExchangeAdd', 'InterlockedIncrement', 'IsDelimiter',
- 'IsEqualGUID', 'IsLeapYear', 'IsPathDelimiter', 'IsValidIdent',
- 'Languages', 'LastDelimiter', 'LoadPackage', 'LoadStr', 'LowerCase',
- 'MSecsToTimeStamp', 'NewStr', 'NextCharIndex', 'Now', 'OutOfMemoryError',
- 'QuotedStr', 'RaiseLastOSError', 'RaiseLastWin32Error', 'RemoveDir',
- 'RenameFile', 'ReplaceDate', 'ReplaceTime', 'SafeLoadLibrary',
- 'SameFileName', 'SameText', 'SetCurrentDir', 'ShowException', 'Sleep',
- 'StrAlloc', 'StrBufSize', 'StrByteType', 'StrCat', 'StrCharLength',
- 'StrComp', 'StrCopy', 'StrDispose', 'StrECopy', 'StrEnd', 'StrFmt',
- 'StrIComp', 'StrLCat', 'StrLComp', 'StrLCopy', 'StrLFmt', 'StrLIComp',
- 'StrLen', 'StrLower', 'StrMove', 'StrNew', 'StrNextChar', 'StrPCopy',
- 'StrPLCopy', 'StrPas', 'StrPos', 'StrRScan', 'StrScan', 'StrToBool',
- 'StrToBoolDef', 'StrToCurr', 'StrToCurrDef', 'StrToDate', 'StrToDateDef',
- 'StrToDateTime', 'StrToDateTimeDef', 'StrToFloat', 'StrToFloatDef',
- 'StrToInt', 'StrToInt64', 'StrToInt64Def', 'StrToIntDef', 'StrToTime',
- 'StrToTimeDef', 'StrUpper', 'StringReplace', 'StringToGUID', 'Supports',
- 'SysErrorMessage', 'SystemTimeToDateTime', 'TextToFloat', 'Time',
- 'TimeStampToDateTime', 'TimeStampToMSecs', 'TimeToStr', 'Trim',
- 'TrimLeft', 'TrimRight', 'TryEncodeDate', 'TryEncodeTime',
- 'TryFloatToCurr', 'TryFloatToDateTime', 'TryStrToBool', 'TryStrToCurr',
- 'TryStrToDate', 'TryStrToDateTime', 'TryStrToFloat', 'TryStrToInt',
- 'TryStrToInt64', 'TryStrToTime', 'UnloadPackage', 'UpperCase',
- 'WideCompareStr', 'WideCompareText', 'WideFmtStr', 'WideFormat',
- 'WideFormatBuf', 'WideLowerCase', 'WideSameStr', 'WideSameText',
- 'WideUpperCase', 'Win32Check', 'WrapText',
-
- 'ActivateClassGroup', 'AllocateHwnd', 'BinToHex', 'CheckSynchronize',
- 'CollectionsEqual', 'CountGenerations', 'DeallocateHwnd', 'EqualRect',
- 'ExtractStrings', 'FindClass', 'FindGlobalComponent', 'GetClass',
- 'GroupDescendantsWith', 'HexToBin', 'IdentToInt',
- 'InitInheritedComponent', 'IntToIdent', 'InvalidPoint',
- 'IsUniqueGlobalComponentName', 'LineStart', 'ObjectBinaryToText',
- 'ObjectResourceToText', 'ObjectTextToBinary', 'ObjectTextToResource',
- 'PointsEqual', 'ReadComponentRes', 'ReadComponentResEx',
- 'ReadComponentResFile', 'Rect', 'RegisterClass', 'RegisterClassAlias',
- 'RegisterClasses', 'RegisterComponents', 'RegisterIntegerConsts',
- 'RegisterNoIcon', 'RegisterNonActiveX', 'SmallPoint', 'StartClassGroup',
- 'TestStreamFormat', 'UnregisterClass', 'UnregisterClasses',
- 'UnregisterIntegerConsts', 'UnregisterModuleClasses',
- 'WriteComponentResFile',
-
- 'ArcCos', 'ArcCosh', 'ArcCot', 'ArcCotH', 'ArcCsc', 'ArcCscH', 'ArcSec',
- 'ArcSecH', 'ArcSin', 'ArcSinh', 'ArcTan2', 'ArcTanh', 'Ceil',
- 'CompareValue', 'Cosecant', 'Cosh', 'Cot', 'CotH', 'Cotan', 'Csc', 'CscH',
- 'CycleToDeg', 'CycleToGrad', 'CycleToRad', 'DegToCycle', 'DegToGrad',
- 'DegToRad', 'DivMod', 'DoubleDecliningBalance', 'EnsureRange', 'Floor',
- 'Frexp', 'FutureValue', 'GetExceptionMask', 'GetPrecisionMode',
- 'GetRoundMode', 'GradToCycle', 'GradToDeg', 'GradToRad', 'Hypot',
- 'InRange', 'IntPower', 'InterestPayment', 'InterestRate',
- 'InternalRateOfReturn', 'IsInfinite', 'IsNan', 'IsZero', 'Ldexp', 'LnXP1',
- 'Log10', 'Log2', 'LogN', 'Max', 'MaxIntValue', 'MaxValue', 'Mean',
- 'MeanAndStdDev', 'Min', 'MinIntValue', 'MinValue', 'MomentSkewKurtosis',
- 'NetPresentValue', 'Norm', 'NumberOfPeriods', 'Payment', 'PeriodPayment',
- 'Poly', 'PopnStdDev', 'PopnVariance', 'Power', 'PresentValue',
- 'RadToCycle', 'RadToDeg', 'RadToGrad', 'RandG', 'RandomRange', 'RoundTo',
- 'SLNDepreciation', 'SYDDepreciation', 'SameValue', 'Sec', 'SecH',
- 'Secant', 'SetExceptionMask', 'SetPrecisionMode', 'SetRoundMode', 'Sign',
- 'SimpleRoundTo', 'SinCos', 'Sinh', 'StdDev', 'Sum', 'SumInt',
- 'SumOfSquares', 'SumsAndSquares', 'Tan', 'Tanh', 'TotalVariance',
- 'Variance'
- ),
- 4 => array(
- 'AnsiChar', 'AnsiString', 'Bool', 'Boolean', 'Byte', 'ByteBool', 'Cardinal', 'Char',
- 'Comp', 'Currency', 'DWORD', 'Double', 'Extended', 'Int64', 'Integer', 'IUnknown',
- 'LongBool', 'LongInt', 'LongWord', 'PAnsiChar', 'PAnsiString', 'PBool', 'PBoolean', 'PByte',
- 'PByteArray', 'PCardinal', 'PChar', 'PComp', 'PCurrency', 'PDWORD', 'PDate', 'PDateTime',
- 'PDouble', 'PExtended', 'PInt64', 'PInteger', 'PLongInt', 'PLongWord', 'Pointer', 'PPointer',
- 'PShortInt', 'PShortString', 'PSingle', 'PSmallInt', 'PString', 'PHandle', 'PVariant', 'PWord',
- 'PWordArray', 'PWordBool', 'PWideChar', 'PWideString', 'Real', 'Real48', 'ShortInt', 'ShortString',
- 'Single', 'SmallInt', 'String', 'TClass', 'TDate', 'TDateTime', 'TextFile', 'THandle',
- 'TObject', 'TTime', 'Variant', 'WideChar', 'WideString', 'Word', 'WordBool'
- ),
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'SYMBOLS' => array(
- 0 => array('(', ')', '[', ']'),
- 1 => array('.', ',', ':', ';'),
- 2 => array('@', '^'),
- 3 => array('=', '+', '-', '*', '/')
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;',
- 4 => 'color: #000066; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #008000; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #ff0000; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000066;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #9ac;',
- 1 => 'color: #ff0000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066;',
- 1 => 'color: #000066;',
- 2 => 'color: #000066;',
- 3 => 'color: #000066;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- //Hex numbers
- 0 => '\$[0-9a-fA-F]+',
- //Characters
- 1 => '\#\$?[0-9]{1,3}'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 2
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/diff.php b/libvpx/examples/includes/geshi/geshi/diff.php
deleted file mode 100644
index c82e65c..0000000
--- a/libvpx/examples/includes/geshi/geshi/diff.php
+++ /dev/null
@@ -1,196 +0,0 @@
-<?php
-/*************************************************************************************
- * diff.php
- * --------
- * Author: Conny Brunnkvist (conny@fuchsia.se), W. Tasin (tasin@fhm.edu)
- * Copyright: (c) 2004 Fuchsia Open Source Solutions (http://www.fuchsia.se/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/12/29
- *
- * Diff-output language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2006/02/27
- * - changing language file to use matching of start (^) and end ($) (wt)
- * 2004/12/29 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/02/27)
- * -------------------------
- *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-
-$language_data = array (
- 'LANG_NAME' => 'Diff',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => ' ',
- 'KEYWORDS' => array(
- 1 => array(
- '\ No newline at end of file'
- ),
-// 2 => array(
-// '***************' /* This only seems to works in some cases? */
-// ),
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- 1 => false,
-// 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #aaaaaa; font-style: italic;',
-// 2 => 'color: #dd6611;',
- ),
- 'COMMENTS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => ''
- ),
- 'STRINGS' => array(
- 0 => ''
- ),
- 'NUMBERS' => array(
- 0 => ''
- ),
- 'METHODS' => array(
- 0 => ''
- ),
- 'SYMBOLS' => array(
- 0 => ''
- ),
- 'SCRIPT' => array(
- 0 => ''
- ),
- 'REGEXPS' => array(
- 0 => 'color: #440088;',
- 1 => 'color: #991111;',
- 2 => 'color: #00b000;',
- 3 => 'color: #888822;',
- 4 => 'color: #888822;',
- 5 => 'color: #0011dd;',
- 6 => 'color: #440088;',
- 7 => 'color: #991111;',
- 8 => 'color: #00b000;',
- 9 => 'color: #888822;',
- ),
- ),
- 'URLS' => array(
- 1 => '',
-// 2 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- 0 => "[0-9,]+[acd][0-9,]+",
- //Removed lines
- 1 => array(
- GESHI_SEARCH => '^\\&lt;.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //Inserted lines
- 2 => array(
- GESHI_SEARCH => '^\\&gt;.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //Location line
- 3 => array(
- GESHI_SEARCH => '^[\\-]{3}\\s.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //Inserted line
- 4 => array(
- GESHI_SEARCH => '^(\\+){3}\\s.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //Modified line
- 5 => array(
- GESHI_SEARCH => '^\\!.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //File specification
- 6 => array(
- GESHI_SEARCH => '^[\\@]{2}.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //Removed line
- 7 => array(
- GESHI_SEARCH => '^\\-.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //Inserted line
- 8 => array(
- GESHI_SEARCH => '^\\+.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- //File specification
- 9 => array(
- GESHI_SEARCH => '^(\\*){3}\\s.*$',
- GESHI_REPLACE => '\\0',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/div.php b/libvpx/examples/includes/geshi/geshi/div.php
deleted file mode 100644
index d3d506d..0000000
--- a/libvpx/examples/includes/geshi/geshi/div.php
+++ /dev/null
@@ -1,126 +0,0 @@
-<?php
-/*************************************************************************************
- * div.php
- * ---------------------------------
- * Author: Gabriel Lorenzo (ermakina@gmail.com)
- * Copyright: (c) 2005 Gabriel Lorenzo (http://ermakina.gazpachito.net)
- * Release Version: 1.0.8.3
- * Date Started: 2005/06/19
- *
- * DIV language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/06/22 (1.0.0)
- * - First Release, includes "2nd gen" ELSEIF statement
- *
- * TODO (updated 2005/06/22)
- * -------------------------
- * - I'm pretty satisfied with this, so nothing for now... :P
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'DIV',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'while','until','to','switch','step','return','repeat','loop','if','from','frame','for','end','elseif',
- 'else','default','debug','continue','clone','case','break','begin'
- ),
- 2 => array(
- 'xor','whoami','type','sizeof','pointer','or','offset','not','neg','mod','id','dup','and','_ne','_lt',
- '_le','_gt','_ge','_eq'
- ),
- 3 => array(
- 'setup_program','program','process','private','local','import','global','function','const',
- 'compiler_options'
- ),
- 4 => array(
- 'word','struct','string','int','byte'
- ),
- ),
- 'SYMBOLS' => array(
- '(',')','[',']','=','+','-','*','/','!','%','^','&',':',';',',','<','>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0040b1;',
- 2 => 'color: #000000;',
- 3 => 'color: #000066; font-weight: bold;',
- 4 => 'color: #993333;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => 'color: #44aa44;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #202020;',
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #44aa44;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/dos.php b/libvpx/examples/includes/geshi/geshi/dos.php
deleted file mode 100644
index af8fdae..0000000
--- a/libvpx/examples/includes/geshi/geshi/dos.php
+++ /dev/null
@@ -1,198 +0,0 @@
-<?php
-/*************************************************************************************
- * dos.php
- * -------
- * Author: Alessandro Staltari (staltari@geocities.com)
- * Copyright: (c) 2005 Alessandro Staltari (http://www.geocities.com/SiliconValley/Vista/8155/)
- * Release Version: 1.0.8.3
- * Date Started: 2005/07/05
- *
- * DOS language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2005/07/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/07/05)
- * -------------------------
- *
- * - Highlight pipes and redirection (do we really need this?)
- * - Add missing keywords.
- * - Find a good hyperlink for keywords.
- * - Improve styles.
- *
- * KNOWN ISSUES (updated 2005/07/07)
- * ---------------------------------
- *
- * - Doesn't even try to handle spaces in variables name or labels (I can't
- * find a reliable way to establish if a sting is a name or not, in some
- * cases it depends on the contex or enviroment status).
- * - Doesn't handle %%[letter] pseudo variable used inside FOR constructs
- * (it should be done only into its scope: how to handle variable it?).
- * - Doesn't handle %~[something] pseudo arguments.
- * - If the same keyword is placed at the end of the line and the
- * beginning of the next, the second occourrence is not highlighted
- * (this should be a GeSHi bug, not related to the language definition).
- * - I can't avoid to have keyword highlighted even when they are not used
- * as keywords but, for example, as arguments to the echo command.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'DOS',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- //DOS comment lines
- 'COMMENT_REGEXP' => array(1 => "/^\s*@?REM.*$/mi"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /* Flow control keywords */
- 1 => array(
- 'if', 'else', 'goto', 'shift',
- 'for', 'in', 'do',
- 'call', 'exit'
- ),
- /* IF statement keywords */
- 2 => array(
- 'not', 'exist', 'errorlevel',
- 'defined',
- 'equ', 'neq', 'lss', 'leq', 'gtr', 'geq'
- ),
- /* Internal commands */
- 3 => array(
- 'cd', 'md', 'rd', 'chdir', 'mkdir', 'rmdir', 'dir',
- 'del', 'copy', 'move', 'ren', 'rename',
- 'echo',
- 'setlocal', 'endlocal', 'set',
- 'pause',
- 'pushd', 'popd', 'title', 'verify'
- ),
- /* Special files */
- 4 => array(
- 'prn', 'nul', 'lpt3', 'lpt2', 'lpt1', 'con',
- 'com4', 'com3', 'com2', 'com1', 'aux'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '@', '%'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00b100; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #b1b100; font-weight: bold;',
- 4 => 'color: #0000ff; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #ff0000; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #33cc33;',
- 1 => 'color: #33cc33;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 0 => 'color: #b100b1; font-weight: bold;',
- 1 => 'color: #448844;',
- 2 => 'color: #448888;'
- )
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'URLS' => array(
- 1 => 'http://www.ss64.com/nt/{FNAMEL}.html',
- 2 => 'http://www.ss64.com/nt/{FNAMEL}.html',
- 3 => 'http://www.ss64.com/nt/{FNAMEL}.html',
- 4 => 'http://www.ss64.com/nt/{FNAMEL}.html'
- ),
- 'REGEXPS' => array(
- /* Label */
- 0 => array(
-/* GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\s\n]*)',*/
- GESHI_SEARCH => '((?si:[@\s]+GOTO\s+|\s+:)[\s]*)((?<!\n)[^\n]*)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'si',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- /* Variable assignement */
- 1 => array(
-/* GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\s\n]+)([\s]*=)',*/
- GESHI_SEARCH => '(SET[\s]+(?si:\/A[\s]+|\/P[\s]+|))([^=\n]+)([\s]*=)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'si',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- /* Arguments or variable evaluation */
- 2 => array(
-/* GESHI_SEARCH => '(%)([\d*]|[^%\s]*(?=%))((?<!%\d)%|)',*/
- GESHI_SEARCH => '(%(?:%(?=[a-z0-9]))?)([\d*]|(?:~[adfnpstxz]*(?:$\w+:)?)?[a-z0-9](?!\w)|[^%\n]*(?=%))((?<!%\d)%|)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'si',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 4 => array(
- 'DISALLOWED_BEFORE' => '(?<!\w)'
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/dot.php b/libvpx/examples/includes/geshi/geshi/dot.php
deleted file mode 100644
index 35d3d9b..0000000
--- a/libvpx/examples/includes/geshi/geshi/dot.php
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/*************************************************************************************
- * dot.php
- * ---------------------------------
- * Author: Adrien Friggeri (adrien@friggeri.net)
- * Copyright: (c) 2007 Adrien Friggeri (http://www.friggeri.net)
- * Release Version: 1.0.8.3
- * Date Started: 2007/05/30
- *
- * dot language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2007/05/30 (1.0.0)
- * - First Release
- *
- * TODO (updated 2007/05/30)
- * -------------------------
- * Everything
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'dot',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'URL', 'arrowhead', 'arrowsize', 'arrowtail', 'bb', 'bgcolor', 'bottomlabel',
- 'center', 'clusterrank', 'color', 'comment', 'constraint', 'decorate',
- 'dir', 'distortion', 'fillcolor', 'fixedsize', 'fontcolor',
- 'fontname', 'fontsize', 'group', 'headclip', 'headlabel', 'headport',
- 'height', 'id', 'label', 'labelangle', 'labeldistance', 'labelfontcolor',
- 'labelfontname', 'labelfontsize', 'layer', 'layers', 'margin', 'mclimit',
- 'minlen', 'nodesep', 'nslimit', 'ordering', 'orientation', 'page',
- 'pagedir', 'peripheries', 'port_label_distance', 'quantum', 'rank', 'rankdir',
- 'ranksep', 'ratio', 'regular', 'rotate', 'samehead', 'sametail', 'searchsize',
- 'shape', 'shapefile', 'showboxes', 'sides', 'size', 'skew', 'style',
- 'tailclip', 'taillabel', 'tailport', 'toplabel', 'weight', 'width'
- ),
- 2 => array(
- 'node', 'graph', 'digraph', 'strict', 'edge', 'subgraph'
- ),
- 3 => array(
- 'Mcircle', 'Mdiamond', 'Mrecord', 'Msquare', 'TRUE', 'auto', 'back',
- 'bold', 'both', 'box', 'circle', 'compress', 'dashed', 'diamond', 'dot',
- 'dotted', 'doublecircle', 'doubleoctagon', 'egg', 'ellipse', 'epsf', 'false',
- 'fill', 'filled', 'forward', 'global', 'hexagon', 'house', 'inv', 'invdot',
- 'invhouse', 'invis', 'invodot', 'invtrapezium', 'invtriangle', 'local', 'max',
- 'min', 'none', 'normal', 'octagon', 'odot', 'out', 'parallelogram', 'plaintext',
- 'polygon', 'record', 'same', 'solid', 'trapezium', 'triangle', 'tripleoctagon',
- 'true'
- ),
- 4 => array(
- 'aliceblue', 'antiquewhite', 'aquamarine', 'azure', 'beige', 'bisque', 'black',
- 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue',
- 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson',
- 'cyan', 'darkgoldenrod', 'darkgreen', 'darkkhaki', 'darkolivegreen',
- 'darkorange', 'darkorchid', 'darksalmon', 'darkseagreen', 'darkslateblue',
- 'darkslategray', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue',
- 'dimgray', 'dodgerblue', 'firebrick', 'forestgreen', 'gainsboro', 'ghostwhite',
- 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'honeydew', 'hotpink',
- 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush',
- 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcyan', 'lightgoldenrod',
- 'lightgoldenrodyellow', 'lightgray', 'lightpink', 'lightsalmon',
- 'lightseagreen', 'lightskyblue', 'lightslateblue', 'lightslategray',
- 'lightyellow', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine',
- 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen',
- 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred',
- 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy',
- 'navyblue', 'oldlace', 'olivedrab', 'oralwhite', 'orange', 'orangered',
- 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred',
- 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple',
- 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'salmon2', 'sandybrown',
- 'seagreen', 'seashell', 'sienna', 'skyblue', 'slateblue', 'slategray', 'snow',
- 'springgreen', 'steelblue', 'tan', 'thistle', 'tomato', 'turquoise', 'violet',
- 'violetred', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen'
- )
- ),
- 'SYMBOLS' => array(
- '[', ']', '{', '}', '-', '+', '*', '/', '<', '>', '!', '~', '%', '&', '|', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000066;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #993333;',
- 4 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #339933;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #af624d; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'METHODS' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- ),
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/eiffel.php b/libvpx/examples/includes/geshi/geshi/eiffel.php
deleted file mode 100644
index 7a9a61e..0000000
--- a/libvpx/examples/includes/geshi/geshi/eiffel.php
+++ /dev/null
@@ -1,395 +0,0 @@
-<?php
-/*************************************************************************************
- * eiffel.php
- * ----------
- * Author: Zoran Simic (zsimic@axarosenberg.com)
- * Copyright: (c) 2005 Zoran Simic
- * Release Version: 1.0.8.3
- * Date Started: 2005/06/30
- *
- * Eiffel language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/06/30 (1.0.7)
- * - Initial release
- *
- * TODO (updated 2005/06/30)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Eiffel',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '%',
- 'KEYWORDS' => array(
- 1 => array(
- 'separate',
- 'invariant',
- 'inherit',
- 'indexing',
- 'feature',
- 'expanded',
- 'deferred',
- 'class'
- ),
- 2 => array(
- 'xor',
- 'when',
- 'variant',
- 'until',
- 'unique',
- 'undefine',
- 'then',
- 'strip',
- 'select',
- 'retry',
- 'rescue',
- 'require',
- 'rename',
- 'reference',
- 'redefine',
- 'prefix',
- 'or',
- 'once',
- 'old',
- 'obsolete',
- 'not',
- 'loop',
- 'local',
- 'like',
- 'is',
- 'inspect',
- 'infix',
- 'include',
- 'implies',
- 'if',
- 'frozen',
- 'from',
- 'external',
- 'export',
- 'ensure',
- 'end',
- 'elseif',
- 'else',
- 'do',
- 'creation',
- 'create',
- 'check',
- 'as',
- 'and',
- 'alias',
- 'agent'
- ),
- 3 => array(
- 'Void',
- 'True',
- 'Result',
- 'Precursor',
- 'False',
- 'Current'
- ),
- 4 => array(
- 'UNIX_SIGNALS',
- 'UNIX_FILE_INFO',
- 'UNBOUNDED',
- 'TWO_WAY_TREE_CURSOR',
- 'TWO_WAY_TREE',
- 'TWO_WAY_SORTED_SET',
- 'TWO_WAY_LIST',
- 'TWO_WAY_CURSOR_TREE',
- 'TWO_WAY_CIRCULAR',
- 'TWO_WAY_CHAIN_ITERATOR',
- 'TUPLE',
- 'TREE',
- 'TRAVERSABLE',
- 'TO_SPECIAL',
- 'THREAD_CONTROL',
- 'THREAD_ATTRIBUTES',
- 'THREAD',
- 'TABLE',
- 'SUBSET',
- 'STRING_HANDLER',
- 'STRING',
- 'STREAM',
- 'STORABLE',
- 'STD_FILES',
- 'STACK',
- 'SPECIAL',
- 'SORTED_TWO_WAY_LIST',
- 'SORTED_STRUCT',
- 'SORTED_LIST',
- 'SINGLE_MATH',
- 'SET',
- 'SEQUENCE',
- 'SEQ_STRING',
- 'SEMAPHORE',
- 'ROUTINE',
- 'RESIZABLE',
- 'RECURSIVE_TREE_CURSOR',
- 'RECURSIVE_CURSOR_TREE',
- 'REAL_REF',
- 'REAL',
- 'RAW_FILE',
- 'RANDOM',
- 'QUEUE',
- 'PROXY',
- 'PROFILING_SETTING',
- 'PROCEDURE',
- 'PRIORITY_QUEUE',
- 'PRIMES',
- 'PRECOMP',
- 'POINTER_REF',
- 'POINTER',
- 'PLATFORM',
- 'PLAIN_TEXT_FILE',
- 'PATH_NAME',
- 'PART_SORTED_TWO_WAY_LIST',
- 'PART_SORTED_SET',
- 'PART_SORTED_LIST',
- 'PART_COMPARABLE',
- 'OPERATING_ENVIRONMENT',
- 'ONCE_CONTROL',
- 'OBJECT_OWNER',
- 'OBJECT_CONTROL',
- 'NUMERIC',
- 'NONE',
- 'MUTEX',
- 'MULTI_ARRAY_LIST',
- 'MULTAR_LIST_CURSOR',
- 'MEMORY',
- 'MEM_INFO',
- 'MEM_CONST',
- 'MATH_CONST',
- 'LIST',
- 'LINKED_TREE_CURSOR',
- 'LINKED_TREE',
- 'LINKED_STACK',
- 'LINKED_SET',
- 'LINKED_QUEUE',
- 'LINKED_PRIORITY_QUEUE',
- 'LINKED_LIST_CURSOR',
- 'LINKED_LIST',
- 'LINKED_CURSOR_TREE',
- 'LINKED_CIRCULAR',
- 'LINKABLE',
- 'LINEAR_ITERATOR',
- 'LINEAR',
- 'ITERATOR',
- 'IO_MEDIUM',
- 'INTERNAL',
- 'INTEGER_REF',
- 'INTEGER_INTERVAL',
- 'INTEGER',
- 'INFINITE',
- 'INDEXABLE',
- 'IDENTIFIED_CONTROLLER',
- 'IDENTIFIED',
- 'HIERARCHICAL',
- 'HEAP_PRIORITY_QUEUE',
- 'HASHABLE',
- 'HASH_TABLE_CURSOR',
- 'HASH_TABLE',
- 'GENERAL',
- 'GC_INFO',
- 'FUNCTION',
- 'FORMAT_INTEGER',
- 'FORMAT_DOUBLE',
- 'FIXED_TREE',
- 'FIXED_LIST',
- 'FIXED',
- 'FINITE',
- 'FILE_NAME',
- 'FILE',
- 'FIBONACCI',
- 'EXECUTION_ENVIRONMENT',
- 'EXCEPTIONS',
- 'EXCEP_CONST',
- 'DYNAMIC_TREE',
- 'DYNAMIC_LIST',
- 'DYNAMIC_CIRCULAR',
- 'DYNAMIC_CHAIN',
- 'DOUBLE_REF',
- 'DOUBLE_MATH',
- 'DOUBLE',
- 'DISPENSER',
- 'DIRECTORY_NAME',
- 'DIRECTORY',
- 'DECLARATOR',
- 'DEBUG_OUTPUT',
- 'CURSOR_TREE_ITERATOR',
- 'CURSOR_TREE',
- 'CURSOR_STRUCTURE',
- 'CURSOR',
- 'COUNTABLE_SEQUENCE',
- 'COUNTABLE',
- 'CONTAINER',
- 'CONSOLE',
- 'CONDITION_VARIABLE',
- 'COMPARABLE_STRUCT',
- 'COMPARABLE_SET',
- 'COMPARABLE',
- 'COMPACT_TREE_CURSOR',
- 'COMPACT_CURSOR_TREE',
- 'COLLECTION',
- 'CIRCULAR_CURSOR',
- 'CIRCULAR',
- 'CHARACTER_REF',
- 'CHARACTER',
- 'CHAIN',
- 'CELL',
- 'BOX',
- 'BOUNDED_STACK',
- 'BOUNDED_QUEUE',
- 'BOUNDED',
- 'BOOLEAN_REF',
- 'BOOLEAN',
- 'BOOL_STRING',
- 'BIT_REF',
- 'BINARY_TREE',
- 'BINARY_SEARCH_TREE_SET',
- 'BINARY_SEARCH_TREE',
- 'BILINEAR',
- 'BI_LINKABLE',
- 'BASIC_ROUTINES',
- 'BAG',
- 'ASCII',
- 'ARRAYED_TREE',
- 'ARRAYED_STACK',
- 'ARRAYED_QUEUE',
- 'ARRAYED_LIST_CURSOR',
- 'ARRAYED_LIST',
- 'ARRAYED_CIRCULAR',
- 'ARRAY2',
- 'ARRAY',
- 'ARGUMENTS',
- 'ANY',
- 'ACTIVE'
- ),
- 5 => array(
- 'yes',
- 'visible',
- 'trace',
- 'system',
- 'root',
- 'profile',
- 'override_cluster',
- 'object',
- 'no',
- 'multithreaded',
- 'msil_generation_type',
- 'line_generation',
- 'library',
- 'inlining_size',
- 'inlining',
- 'include_path',
- 'il_verifiable',
- 'exclude',
- 'exception_trace',
- 'dynamic_runtime',
- 'dotnet_naming_convention',
- 'disabled_debug',
- 'default',
- 'debug',
- 'dead_code_removal',
- 'console_application',
- 'cluster',
- 'cls_compliant',
- 'check_vape',
- 'assertion',
- 'array_optimization',
- 'all',
- 'address_expression'
- ),
- ),
- 'SYMBOLS' => array(
- '+', '-', '*', '?', '=', '/', '%', '&', '>', '<', '^', '!', '|', ':',
- '(', ')', '{', '}', '[', ']', '#'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => true,
- 5 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0600FF; font-weight: bold;',
- 2 => 'color: #0600FF; font-weight: bold;',
- 3 => 'color: #800080;',
- 4 => 'color: #800000',
- 5 => 'color: #603000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000; font-style: italic;',
- 'MULTI' => ''
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #005070; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0080A0;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #000060;',
- 2 => 'color: #000050;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #600000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => 'http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+{FNAMEL}&amp;btnI=I%27m+Feeling+Lucky',
- 5 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/email.php b/libvpx/examples/includes/geshi/geshi/email.php
deleted file mode 100644
index 26466dc..0000000
--- a/libvpx/examples/includes/geshi/geshi/email.php
+++ /dev/null
@@ -1,209 +0,0 @@
-<?php
-/*************************************************************************************
- * email.php
- * ---------------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2008/10/19
- *
- * Email (mbox \ eml \ RFC format) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/19 (1.0.8.1)
- * - First Release
- *
- * TODO (updated 2008/10/19)
- * -------------------------
- * * Better checks when a header field should be expected
- * * Fix the bound checks for kw groups 2 and 3, as well as rx group 1
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'eMail (mbox)',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'HTTP', 'SMTP', 'ASMTP', 'ESMTP'
- ),
- 2 => array(
- 'Content-Type','Content-Transfer-Encoding','Content-Disposition',
- 'Delivered-To','Dkim-Signature','Domainkey-Signature','In-Reply-To',
- 'Message-Id','MIME-Version','Received','Received-SPF','References',
- 'Resend-From','Resend-To','Return-Path'
- ),
- 3 => array(
- 'Date','From','Subject','To',
- ),
- 4 => array(
- 'by', 'for', 'from', 'id', 'with'
- )
- ),
- 'SYMBOLS' => array(
- ':', ';', '<', '>', '[', ']'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => false,
- 3 => false,
- 4 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #800000; font-weight: bold;',
- 4 => 'font-weight: bold;',
- ),
- 'COMMENTS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- 0 => 'color: #000040;',
- ),
- 'REGEXPS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #0000FF;',
- 3 => 'color: #008000;',
- 4 => 'color: #0000FF; font-weight: bold;',
- 5 => 'font-weight: bold;',
- 6 => 'color: #400080;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- // Non-Standard-Header
- 1 => array(
- GESHI_SEARCH => "(?<=\A\x20|\n)x-[a-z0-9\-]*(?=\s*:|\s*<)",
- GESHI_REPLACE => "\\0",
- GESHI_MODIFIERS => "smi",
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- //Email-Adresses or Mail-IDs
- 2 => array(
- GESHI_SEARCH => "\b[\w\.]+@\w+(?:(?:\.\w+)*\.\w{2,4})?",
- GESHI_REPLACE => "\\0",
- GESHI_MODIFIERS => "mi",
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- //Date values in RFC format
- 3 => array(
- GESHI_SEARCH => "\b(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s+\d\d?\s+" .
- "(?:Jan|Feb|Mar|apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+" .
- "\d{4}\s+\d\d?:\d\d:\d\d\s+[+\-]\d{4}(?:\s+\(\w+\))?",
- GESHI_REPLACE => "\\0",
- GESHI_MODIFIERS => "mi",
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- //IP addresses
- 4 => array(
- GESHI_SEARCH => "(?<=\s)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=\s)|".
- "(?<=\[)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=\])|".
- "(?<==)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=<)",
- GESHI_REPLACE => "\\0",
- GESHI_MODIFIERS => "i",
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- //Field-Assignments
- 5 => array(
- GESHI_SEARCH => "(?<=\s)[A-Z0-9\-]+(?==(?!\s|$))",
- GESHI_REPLACE => "\\0",
- GESHI_MODIFIERS => "mi",
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- //MIME type
- 6 => array(
- GESHI_SEARCH => "(?<=\s)(?:audio|application|image|multipart|text|".
- "video|x-[a-z0-9\-]+)\/[a-z0-9][a-z0-9\-]*(?=\s|<|$)",
- GESHI_REPLACE => "\\0",
- GESHI_MODIFIERS => "m",
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- 0 => "/(^)[A-Z][a-zA-Z0-9\-]*\s*:\s*(?:.|(?=\n\s)\n)*($)/m"
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 2 => array(
- 'DISALLOWED_BEFORE' => '(?<=\A\x20|\n)',
- 'DISALLOWED_AFTER' => '(?=\s*:)',
- ),
- 3 => array(
- 'DISALLOWED_BEFORE' => '(?<=\A\x20|\n)',
- 'DISALLOWED_AFTER' => '(?=\s*:)',
- ),
- 4 => array(
- 'DISALLOWED_BEFORE' => '(?<=\s)',
- 'DISALLOWED_AFTER' => '(?=\s|\b)',
- )
- ),
- 'ENABLE_FLAGS' => array(
- 'BRACKETS' => GESHI_NEVER,
- 'COMMENTS' => GESHI_NEVER,
- 'NUMBERS' => GESHI_NEVER
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/fortran.php b/libvpx/examples/includes/geshi/geshi/fortran.php
deleted file mode 100644
index 1caf09d..0000000
--- a/libvpx/examples/includes/geshi/geshi/fortran.php
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-/*************************************************************************************
- * fortran.php
- * -----------
- * Author: Cedric Arrabie (cedric.arrabie@univ-pau.fr)
- * Copyright: (C) 2006 Cetric Arrabie
- * Release Version: 1.0.8.3
- * Date Started: 2006/04/22
- *
- * Fortran language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2006/04/20 (1.0.0)
- * - First Release
- *
- * TODO
- * -------------------------
- * - Get a list of inbuilt functions to add (and explore fortran more
- * to complete this rather bare language file)
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME'=>'Fortran',
- 'COMMENT_SINGLE'=> array(1 =>'!',2=>'Cf2py'),
- 'COMMENT_MULTI'=> array(),
- //Fortran Comments
- 'COMMENT_REGEXP' => array(1 => '/^C.*?$/mi'),
- 'CASE_KEYWORDS'=> GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS'=> array("'",'"'),
- 'ESCAPE_CHAR'=>'\\',
- 'KEYWORDS'=> array(
- 1 => array(
- 'allocate','block','call','case','contains','continue','cycle','deallocate',
- 'default','do','else','elseif','elsewhere','end','enddo','endif','endwhere',
- 'entry','exit','function','go','goto','if','interface','module','nullify','only',
- 'operator','procedure','program','recursive','return','select','stop',
- 'subroutine','then','to','where','while',
- 'access','action','advance','blank','blocksize','carriagecontrol',
- 'delim','direct','eor','err','exist','file','flen','fmt','form','formatted',
- 'iostat','name','named','nextrec','nml','number','opened','pad','position',
- 'readwrite','recl','sequential','status','unformatted','unit'
- ),
- 2 => array(
- '.AND.','.EQ.','.EQV.','.GE.','.GT.','.LE.','.LT.','.NE.','.NEQV.','.NOT.',
- '.OR.','.TRUE.','.FALSE.'
- ),
- 3 => array(
- 'allocatable','character','common','complex','data','dimension','double',
- 'equivalence','external','implicit','in','inout','integer','intent','intrinsic',
- 'kind','logical','namelist','none','optional','out','parameter','pointer',
- 'private','public','real','result','save','sequence','target','type','use'
- ),
- 4 => array(
- 'abs','achar','acos','adjustl','adjustr','aimag','aint','all','allocated',
- 'anint','any','asin','atan','atan2','bit_size','break','btest','carg',
- 'ceiling','char','cmplx','conjg','cos','cosh','cpu_time','count','cshift',
- 'date_and_time','dble','digits','dim','dot_product','dprod dvchk',
- 'eoshift','epsilon','error','exp','exponent','floor','flush','fraction',
- 'getcl','huge','iachar','iand','ibclr','ibits','ibset','ichar','ieor','index',
- 'int','intrup','invalop','ior','iostat_msg','ishft','ishftc','lbound',
- 'len','len_trim','lge','lgt','lle','llt','log','log10','matmul','max','maxexponent',
- 'maxloc','maxval','merge','min','minexponent','minloc','minval','mod','modulo',
- 'mvbits','nbreak','ndperr','ndpexc','nearest','nint','not','offset','ovefl',
- 'pack','precfill','precision','present','product','prompt','radix',
- 'random_number','random_seed','range','repeat','reshape','rrspacing',
- 'scale','scan','segment','selected_int_kind','selected_real_kind',
- 'set_exponent','shape','sign','sin','sinh','size','spacing','spread','sqrt',
- 'sum system','system_clock','tan','tanh','timer','tiny','transfer','transpose',
- 'trim','ubound','undfl','unpack','val','verify'
- ),
- ),
- 'SYMBOLS'=> array(
- '(',')','{','}','[',']','=','+','-','*','/','!','%','^','&',':'
- ),
- 'CASE_SENSITIVE'=> array(
- GESHI_COMMENTS => true,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES'=> array(
- 'KEYWORDS'=> array(
- 1 =>'color: #b1b100;',
- 2 =>'color: #000000; font-weight: bold;',
- 3 =>'color: #000066;',
- 4 =>'color: #993333;'
- ),
- 'COMMENTS'=> array(
- 1 =>'color: #666666; font-style: italic;',
- 2 =>'color: #339933;',
- 'MULTI'=>'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR'=> array(
- 0 =>'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS'=> array(
- 0 =>'color: #009900;'
- ),
- 'STRINGS'=> array(
- 0 =>'color: #ff0000;'
- ),
- 'NUMBERS'=> array(
- 0 =>'color: #cc66cc;'
- ),
- 'METHODS'=> array(
- 1 =>'color: #202020;',
- 2 =>'color: #202020;'
- ),
- 'SYMBOLS'=> array(
- 0 =>'color: #339933;'
- ),
- 'REGEXPS'=> array(
- ),
- 'SCRIPT'=> array(
- )
- ),
- 'URLS'=> array(
- 1 =>'',
- 2 =>'',
- 3 =>'',
- 4 =>''
- ),
- 'OOLANG'=> true,
- 'OBJECT_SPLITTERS'=> array(
- 1 =>'.',
- 2 =>'::'
- ),
- 'REGEXPS'=> array(
- ),
- 'STRICT_MODE_APPLIES'=> GESHI_NEVER,
- 'SCRIPT_DELIMITERS'=> array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK'=> array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/freebasic.php b/libvpx/examples/includes/geshi/geshi/freebasic.php
deleted file mode 100644
index 0ddc46c..0000000
--- a/libvpx/examples/includes/geshi/geshi/freebasic.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/*************************************************************************************
- * freebasic.php
- * -------------
- * Author: Roberto Rossi
- * Copyright: (c) 2005 Roberto Rossi (http://rsoftware.altervista.org)
- * Release Version: 1.0.8.3
- * Date Started: 2005/08/19
- *
- * FreeBasic (http://www.freebasic.net/) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/08/19 (1.0.0)
- * - First Release
- *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'FreeBasic',
- 'COMMENT_SINGLE' => array(1 => "'", 2 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- "append", "as", "asc", "asin", "asm", "atan2", "atn", "beep", "bin", "binary", "bit",
- "bitreset", "bitset", "bload", "bsave", "byref", "byte", "byval", "call",
- "callocate", "case", "cbyte", "cdbl", "cdecl", "chain", "chdir", "chr", "cint",
- "circle", "clear", "clng", "clngint", "close", "cls", "color", "command",
- "common", "cons", "const", "continue", "cos", "cshort", "csign", "csng",
- "csrlin", "cubyte", "cuint", "culngint", "cunsg", "curdir", "cushort", "custom",
- "cvd", "cvi", "cvl", "cvlongint", "cvs", "cvshort", "data", "date",
- "deallocate", "declare", "defbyte", "defdbl", "defined", "defint", "deflng",
- "deflngint", "defshort", "defsng", "defstr", "defubyte", "defuint",
- "defulngint", "defushort", "dim", "dir", "do", "double", "draw", "dylibload",
- "dylibsymbol", "else", "elseif", "end", "enum", "environ", 'environ$', "eof",
- "eqv", "erase", "err", "error", "exec", "exepath", "exit", "exp", "export",
- "extern", "field", "fix", "flip", "for", "fre", "freefile", "function", "get",
- "getjoystick", "getkey", "getmouse", "gosub", "goto", "hex", "hibyte", "hiword",
- "if", "iif", "imagecreate", "imagedestroy", "imp", "inkey", "inp", "input",
- "instr", "int", "integer", "is", "kill", "lbound", "lcase", "left", "len",
- "let", "lib", "line", "lobyte", "loc", "local", "locate", "lock", "lof", "log",
- "long", "longint", "loop", "loword", "lset", "ltrim", "mid", "mkd", "mkdir",
- "mki", "mkl", "mklongint", "mks", "mkshort", "mod", "multikey", "mutexcreate",
- "mutexdestroy", "mutexlock", "mutexunlock", "name", "next", "not", "oct", "on",
- "once", "open", "option", "or", "out", "output", "overload", "paint", "palette",
- "pascal", "pcopy", "peek", "peeki", "peeks", "pipe", "pmap", "point", "pointer",
- "poke", "pokei", "pokes", "pos", "preserve", "preset", "print", "private",
- "procptr", "pset", "ptr", "public", "put", "random", "randomize", "read",
- "reallocate", "redim", "rem", "reset", "restore", "resume",
- "return", "rgb", "rgba", "right", "rmdir", "rnd", "rset", "rtrim", "run",
- "sadd", "screen", "screencopy", "screeninfo", "screenlock", "screenptr",
- "screenres", "screenset", "screensync", "screenunlock", "seek", "statement",
- "selectcase", "setdate", "setenviron", "setmouse",
- "settime", "sgn", "shared", "shell", "shl", "short", "shr", "sin", "single",
- "sizeof", "sleep", "space", "spc", "sqr", "static", "stdcall", "step", "stop",
- "str", "string", "strptr", "sub", "swap", "system", "tab", "tan",
- "then", "threadcreate", "threadwait", "time", "timer", "to", "trans",
- "trim", "type", "ubound", "ubyte", "ucase", "uinteger", "ulongint", "union",
- "unlock", "unsigned", "until", "ushort", "using", "va_arg", "va_first",
- "va_next", "val", "val64", "valint", "varptr", "view", "viewprint", "wait",
- "wend", "while", "width", "window", "windowtitle", "with", "write", "xor",
- "zstring", "explicit", "escape", "true", "false"
- )
- ),
- 'SYMBOLS' => array(
- '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080;',
- 2 => 'color: #339933;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/genero.php b/libvpx/examples/includes/geshi/geshi/genero.php
deleted file mode 100644
index 997e21f..0000000
--- a/libvpx/examples/includes/geshi/geshi/genero.php
+++ /dev/null
@@ -1,463 +0,0 @@
-<?php
-/*************************************************************************************
- * genero.php
- * ----------
- * Author: Lars Gersmann (lars.gersmann@gmail.com)
- * Copyright: (c) 2007 Lars Gersmann, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2007/07/01
- *
- * Genero (FOURJ's Genero 4GL) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2007/07/01 (1.0.0)
- * - Initial release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'genero',
- 'COMMENT_SINGLE' => array(1 => '--', 2 => '#'),
- 'COMMENT_MULTI' => array('{' => '}'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- "ABSOLUTE",
- "ACCEPT",
- "ACTION",
- "ADD",
- "AFTER",
- "ALL",
- "ALTER",
- "AND",
- "ANY",
- "APPEND",
- "APPLICATION",
- "AS",
- "AT",
- "ATTRIBUTE",
- "ATTRIBUTES",
- "AUDIT",
- "AVG",
- "BEFORE",
- "BEGIN",
- "BETWEEN",
- "BORDER",
- "BOTTOM",
- "BREAKPOINT",
- "BUFFER",
- "BUFFERED",
- "BY",
- "CALL",
- "CANCEL",
- "CASE",
- "CENTURY",
- "CHANGE",
- "CHECK",
- "CLEAR",
- "CLIPPED",
- "CLOSE",
- "CLUSTER",
- "COLUMN",
- "COLUMNS",
- "COMMAND",
- "COMMENT",
- "COMMIT",
- "COMMITTED",
- "CONCURRENT ",
- "CONNECT",
- "CONNECTION",
- "CONSTANT",
- "CONSTRAINED",
- "CONSTRAINT",
- "CONSTRUCT",
- "CONTINUE",
- "CONTROL",
- "COUNT",
- "CREATE",
- "CROSS",
- "CURRENT",
- "DATABASE",
- "DBA",
- "DEC",
- "DECLARE",
- "DEFAULT",
- "DEFAULTS",
- "DEFER",
- "DEFINE",
- "DELETE",
- "DELIMITER",
- "DESCRIBE",
- "DESTINATION",
- "DIM",
- "DIALOG",
- "DIMENSION",
- "DIRTY",
- "DISCONNECT",
- "DISPLAY",
- "DISTINCT",
- "DORMANT",
- "DOWN",
- "DROP",
- "DYNAMIC",
- "ELSE",
- "END",
- "ERROR",
- "ESCAPE",
- "EVERY",
- "EXCLUSIVE",
- "EXECUTE",
- "EXISTS",
- "EXIT",
- "EXPLAIN",
- "EXTEND",
- "EXTENT",
- "EXTERNAL",
- "FETCH",
- "FGL_DRAWBOX",
- "FIELD",
- "FIELD_TOUCHED",
- "FILE",
- "FILL",
- "FINISH",
- "FIRST",
- "FLOAT",
- "FLUSH",
- "FOR",
- "FOREACH",
- "FORM",
- "FORMAT",
- "FOUND",
- "FRACTION",
- "FREE",
- "FROM",
- "FULL",
- "FUNCTION",
- "GET_FLDBUF",
- "GLOBALS",
- "GO",
- "GOTO",
- "GRANT",
- "GROUP",
- "HAVING",
- "HEADER",
- "HELP",
- "HIDE",
- "HOLD",
- "HOUR",
- "IDLE",
- "IF",
- "IMAGE",
- "IMMEDIATE",
- "IN",
- "INDEX",
- "INFIELD",
- "INITIALIZE",
- "INNER",
- "INPUT",
- "INSERT",
- "INTERRUPT",
- "INTERVAL",
- "INTO",
- "INVISIBLE",
- "IS",
- "ISOLATION",
- "JOIN",
- "KEEP",
- "KEY",
- "LABEL",
- "LAST",
- "LEFT",
- "LENGTH",
- "LET",
- "LIKE",
- "LINE",
- "LINENO",
- "LINES",
- "LOAD",
- "LOCATE",
- "LOCK",
- "LOG",
- "LSTR",
- "MAIN",
- "MARGIN",
- "MATCHES",
- "MAX",
- "MAXCOUNT",
- "MDY",
- "MEMORY",
- "MENU",
- "MESSAGE",
- "MIN",
- "MINUTE",
- "MOD",
- "MODE",
- "MODIFY",
- "MONEY",
- "NAME",
- "NEED",
- "NEXT",
- "NO",
- "NORMAL",
- "NOT",
- "NOTFOUND",
- "NULL",
- "NUMERIC",
- "OF",
- "ON",
- "OPEN",
- "OPTION",
- "OPTIONS",
- "OR",
- "ORDER",
- "OTHERWISE",
- "OUTER",
- "OUTPUT",
- "PAGE",
- "PAGENO",
- "PAUSE",
- "PERCENT",
- "PICTURE",
- "PIPE",
- "PRECISION",
- "PREPARE",
- "PREVIOUS",
- "PRINT",
- "PRINTER",
- "PRINTX",
- "PRIOR",
- "PRIVILEGES",
- "PROCEDURE",
- "PROGRAM",
- "PROMPT",
- "PUBLIC",
- "PUT",
- "QUIT",
- "READ",
- "REAL",
- "RECORD",
- "RECOVER",
- "RED ",
- "RELATIVE",
- "RENAME",
- "REOPTIMIZATION",
- "REPEATABLE",
- "REPORT",
- "RESOURCE",
- "RETURN",
- "RETURNING",
- "REVERSE",
- "REVOKE",
- "RIGHT",
- "ROLLBACK",
- "ROLLFORWARD",
- "ROW",
- "ROWS",
- "RUN",
- "SCHEMA",
- "SCREEN",
- "SCROLL",
- "SECOND",
- "SELECT",
- "SERIAL",
- "SET",
- "SFMT",
- "SHARE",
- "SHIFT",
- "SHOW",
- "SIGNAL ",
- "SIZE",
- "SKIP",
- "SLEEP",
- "SOME",
- "SPACE",
- "SPACES",
- "SQL",
- "SQLERRMESSAGE",
- "SQLERROR",
- "SQLSTATE",
- "STABILITY",
- "START",
- "STATISTICS",
- "STEP",
- "STOP",
- "STYLE",
- "SUM",
- "SYNONYM",
- "TABLE",
- "TEMP",
- "TERMINATE",
- "TEXT",
- "THEN",
- "THROUGH",
- "THRU",
- "TO",
- "TODAY",
- "TOP",
- "TRAILER",
- "TRANSACTION ",
- "UNBUFFERED",
- "UNCONSTRAINED",
- "UNDERLINE",
- "UNION",
- "UNIQUE",
- "UNITS",
- "UNLOAD",
- "UNLOCK",
- "UP",
- "UPDATE",
- "USE",
- "USER",
- "USING",
- "VALIDATE",
- "VALUE",
- "VALUES",
- "VARCHAR",
- "VIEW",
- "WAIT",
- "WAITING",
- "WARNING",
- "WHEN",
- "WHENEVER",
- "WHERE",
- "WHILE",
- "WINDOW",
- "WITH",
- "WITHOUT",
- "WORDWRAP",
- "WORK",
- "WRAP"
- ),
- 2 => array(
- '&amp;IFDEF', '&amp;ENDIF'
- ),
- 3 => array(
- "ARRAY",
- "BYTE",
- "CHAR",
- "CHARACTER",
- "CURSOR",
- "DATE",
- "DATETIME",
- "DECIMAL",
- "DOUBLE",
- "FALSE",
- "INT",
- "INTEGER",
- "SMALLFLOAT",
- "SMALLINT",
- "STRING",
- "TIME",
- "TRUE"
- ),
- 4 => array(
- "BLACK",
- "BLINK",
- "BLUE",
- "BOLD",
- "ANSI",
- "ASC",
- "ASCENDING",
- "ASCII",
- "CYAN",
- "DESC",
- "DESCENDING",
- "GREEN",
- "MAGENTA",
- "OFF",
- "WHITE",
- "YELLOW",
- "YEAR",
- "DAY",
- "MONTH",
- "WEEKDAY"
- ),
- ),
- 'SYMBOLS' => array(
- '+', '-', '*', '?', '=', '/', '%', '>', '<', '^', '!', '|', ':',
- '(', ')', '[', ']'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0600FF;',
- 2 => 'color: #0000FF; font-weight: bold;',
- 3 => 'color: #008000;',
- 4 => 'color: #FF0000;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008080; font-style: italic;',
- 2 => 'color: #008080;',
- 'MULTI' => 'color: #008080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008080; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #808080;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000FF;',
- 2 => 'color: #0000FF;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/gettext.php b/libvpx/examples/includes/geshi/geshi/gettext.php
deleted file mode 100644
index 78e8bff..0000000
--- a/libvpx/examples/includes/geshi/geshi/gettext.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-/*************************************************************************************
- * gettext.php
- * --------
- * Author: Milian Wolff (mail@milianw.de)
- * Copyright: (c) 2008 Milian Wolff
- * Release Version: 1.0.8.3
- * Date Started: 2008/05/25
- *
- * GNU Gettext .po/.pot language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/08/02 (1.0.8)
- * - New comments: flags and previous-fields
- * - New keywords: msgctxt, msgid_plural
- * - Msgstr array indices
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'GNU Gettext',
- 'COMMENT_SINGLE' => array('#:', '#.', '#,', '#|', '#'),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array('msgctxt', 'msgid_plural', 'msgid', 'msgstr'),
- ),
- 'SYMBOLS' => array(),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 0 => 'color: #000099;',
- 1 => 'color: #000099;',
- 2 => 'color: #000099;',
- 3 => 'color: #006666;',
- 4 => 'color: #666666; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'REGEXPS' => array(),
- 'SYMBOLS' => array(),
- 'NUMBERS' => array(
- 0 => 'color: #000099;'
- ),
- 'METHODS' => array(),
- 'SCRIPT' => array(),
- 'BRACKETS' => array(
- 0 => 'color: #000099;'
- ),
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/glsl.php b/libvpx/examples/includes/geshi/geshi/glsl.php
deleted file mode 100644
index 1f10cf8..0000000
--- a/libvpx/examples/includes/geshi/geshi/glsl.php
+++ /dev/null
@@ -1,205 +0,0 @@
-<?php
-/*************************************************************************************
- * glsl.php
- * -----
- * Author: Benny Baumann (BenBE@omorphia.de)
- * Copyright: (c) 2008 Benny Baumann (BenBE@omorphia.de)
- * Release Version: 1.0.8.3
- * Date Started: 2008/03/20
- *
- * glSlang language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/03/20 (1.0.7.21)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'glSlang',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Multiline-continued single-line comments
- 1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
- //Multiline-continued preprocessor define
- 2 => '/#(?:\\\\\\\\|\\\\\\n|.)*$/m'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'if', 'else', 'for', 'while', 'do', 'break', 'continue', 'asm',
- 'switch', 'case', 'default', 'return', 'discard',
- 'namespace', 'using', 'sizeof', 'cast'
- ),
- 2 => array(
- 'const', 'uniform', 'attribute', 'centroid', 'varying', 'invariant',
- 'in', 'out', 'inout', 'input', 'output', 'typedef', 'volatile',
- 'public', 'static', 'extern', 'external', 'packed',
- 'inline', 'noinline', 'noperspective', 'flat'
- ),
- 3 => array(
- 'void', 'bool', 'int', 'long', 'short', 'float', 'half', 'fixed',
- 'unsigned', 'lowp', 'mediump', 'highp', 'precision',
- 'vec2', 'vec3', 'vec4', 'bvec2', 'bvec3', 'bvec4',
- 'dvec2', 'dvec3', 'dvec4', 'fvec2', 'fvec3', 'fvec4',
- 'hvec2', 'hvec3', 'hvec4', 'ivec2', 'ivec3', 'ivec4',
- 'mat2', 'mat3', 'mat4', 'mat2x2', 'mat3x2', 'mat4x2',
- 'mat2x3', 'mat3x3', 'mat4x3', 'mat2x4', 'mat3x4', 'mat4x4',
- 'sampler1D', 'sampler2D', 'sampler3D', 'samplerCube',
- 'sampler1DShadow', 'sampler2DShadow',
- 'struct', 'class', 'union', 'enum', 'interface', 'template'
- ),
- 4 => array(
- 'this', 'false', 'true'
- ),
- 5 => array(
- 'radians', 'degrees', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan',
- 'pow', 'exp2', 'log2', 'sqrt', 'inversesqrt', 'abs', 'sign', 'ceil',
- 'floor', 'fract', 'mod', 'min', 'max', 'clamp', 'mix', 'step',
- 'smoothstep', 'length', 'distance', 'dot', 'cross', 'normalize',
- 'ftransform', 'faceforward', 'reflect', 'matrixCompMult', 'equal',
- 'lessThan', 'lessThanEqual', 'greaterThan', 'greaterThanEqual',
- 'notEqual', 'any', 'all', 'not', 'texture1D', 'texture1DProj',
- 'texture1DLod', 'texture1DProjLod', 'texture2D', 'texture2DProj',
- 'texture2DLod', 'texture2DProjLod', 'texture3D', 'texture3DProj',
- 'texture3DLod', 'texture3DProjLod', 'textureCube', 'textureCubeLod',
- 'shadow1D', 'shadow1DProj', 'shadow1DLod', 'shadow1DProjLod',
- 'shadow2D', 'shadow2DProj', 'shadow2DLod', 'shadow2DProjLod',
- 'noise1', 'noise2', 'noise3', 'noise4'
- ),
- 6 => array(
- 'gl_Position', 'gl_PointSize', 'gl_ClipVertex', 'gl_FragColor',
- 'gl_FragData', 'gl_FragDepth', 'gl_FragCoord', 'gl_FrontFacing',
- 'gl_Color', 'gl_SecondaryColor', 'gl_Normal', 'gl_Vertex',
- 'gl_MultiTexCoord0', 'gl_MultiTexCoord1', 'gl_MultiTexCoord2',
- 'gl_MultiTexCoord3', 'gl_MultiTexCoord4', 'gl_MultiTexCoord5',
- 'gl_MultiTexCoord6', 'gl_MultiTexCoord7', 'gl_FogCoord',
- 'gl_MaxLights', 'gl_MaxClipPlanes', 'gl_MaxTextureUnits',
- 'gl_MaxTextureCoords', 'gl_MaxVertexAttribs', 'gl_MaxVaryingFloats',
- 'gl_MaxVertexUniformComponents', 'gl_MaxVertexTextureImageUnits',
- 'gl_MaxCombinedTextureImageUnits', 'gl_MaxTextureImageUnits',
- 'gl_MaxFragmentUniformComponents', 'gl_MaxDrawBuffers', 'gl_Point',
- 'gl_ModelViewMatrix', 'gl_ProjectionMatrix', 'gl_FrontMaterial',
- 'gl_ModelViewProjectionMatrix', 'gl_TextureMatrix', 'gl_ClipPlane',
- 'gl_NormalMatrix', 'gl_ModelViewMatrixInverse', 'gl_BackMaterial',
- 'gl_ProjectionMatrixInverse', 'gl_ModelViewProjectionMatrixInverse',
- 'gl_TextureMatrixInverse', 'gl_ModelViewMatrixTranspose', 'gl_Fog',
- 'gl_ProjectionMatrixTranspose', 'gl_NormalScale', 'gl_DepthRange',
- 'gl_odelViewProjectionMatrixTranspose', 'gl_TextureMatrixTranspose',
- 'gl_ModelViewMatrixInverseTranspose', 'gl_LightSource',
- 'gl_ProjectionMatrixInverseTranspose', 'gl_LightModel',
- 'gl_ModelViewProjectionMatrixInverseTranspose', 'gl_TexCoord',
- 'gl_TextureMatrixInverseTranspose', 'gl_TextureEnvColor',
- 'gl_FrontLightModelProduct', 'gl_BackLightModelProduct',
- 'gl_FrontLightProduct', 'gl_BackLightProduct', 'gl_ObjectPlaneS',
- 'gl_ObjectPlaneT', 'gl_ObjectPlaneR', 'gl_ObjectPlaneQ',
- 'gl_EyePlaneS', 'gl_EyePlaneT', 'gl_EyePlaneR', 'gl_EyePlaneQ',
- 'gl_FrontColor', 'gl_BackColor', 'gl_FrontSecondaryColor',
- 'gl_BackSecondaryColor', 'gl_FogFragCoord', 'gl_PointCoord'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^',
- '&', '?', ':', '.', '|', ';', ',', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #333399; font-weight: bold;',
- 3 => 'color: #000066; font-weight: bold;',
- 4 => 'color: #333399; font-weight: bold;',
- 5 => 'color: #993333; font-weight: bold;',
- 6 => 'color: #551111;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #009900;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000066;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'OOLANG' => array(
- 'MATCH_BEFORE' => '',
- 'MATCH_AFTER' => '[a-zA-Z_][a-zA-Z0-9_]*',
- 'MATCH_SPACES' => '[\s]*'
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/gml.php b/libvpx/examples/includes/geshi/geshi/gml.php
deleted file mode 100644
index 77966bc..0000000
--- a/libvpx/examples/includes/geshi/geshi/gml.php
+++ /dev/null
@@ -1,506 +0,0 @@
-<?php
-/*************************************************************************************
- * gml.php
- * --------
- * Author: Jos� Jorge Enr�quez (jenriquez@users.sourceforge.net)
- * Copyright: (c) 2005 Jos� Jorge Enr�quez Rodr�guez (http://www.zonamakers.com)
- * Release Version: 1.0.8.3
- * Date Started: 2005/06/21
- *
- * GML language file for GeSHi.
- *
- * GML (Game Maker Language) is a script language that is built-in into Game Maker,
- * a game creation program, more info about Game Maker can be found at
- * http://www.gamemaker.nl/
- * All GML keywords were extracted from the Game Maker HTML Help file using a PHP
- * script (one section at a time). I love PHP for saving me that bunch of work :P!.
- * I think all GML functions have been indexed here, but I'm not sure about it, so
- * please let me know of any issue you may find.
- *
- * CHANGES
- * -------
- * 2005/11/11
- * - Changed 'CASE_KEYWORDS' fom 'GESHI_CAPS_LOWER' to 'GESHI_CAPS_NO_CHANGE',
- * so that MCI_command appears correctly (the only GML function using capitals).
- * - Changed 'CASE_SENSITIVE' options, 'GESHI_COMMENTS' from true to false and all
- * of the others from false to true.
- * - Deleted repeated entries.
- * - div and mod are language keywords, moved (from symbols) to the appropiate section (1).
- * - Moved self, other, all, noone and global identifiers to language keywords section 1.
- * - Edited this file lines to a maximum width of 100 characters (as stated in
- * the GeSHi docs). Well, not strictly to 100 but around it.
- * - Corrected some minor issues (the vk_f1...vk_f12 keys and similar).
- * - Deleted the KEYWORDS=>5 and KEYWORDS=>6 sections (actually, they were empty).
- * I was planning of using those for the GML functions available only in the
- * registered version of the program, but not anymore.
- *
- * 2005/06/26 (1.0.3)
- * - First Release.
- *
- * TODO (updated 2005/11/11)
- * -------------------------
- * - Test it for a while and make the appropiate corrections.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'GML',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'"),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- // language keywords
- 1 => array(
- 'break', 'continue', 'do', 'until', 'if', 'else',
- 'exit', 'for', 'repeat', 'return', 'switch',
- 'case', 'default', 'var', 'while', 'with', 'div', 'mod',
- // GML Language overview
- 'self', 'other', 'all', 'noone', 'global',
- ),
- // modifiers and built-in variables
- 2 => array(
- // Game play
- 'x','y','xprevious','yprevious','xstart','ystart','hspeed','vspeed','direction','speed',
- 'friction','gravity','gravity_direction',
- 'path_index','path_position','path_positionprevious','path_speed','path_orientation',
- 'path_endaction',
- 'object_index','id','mask_index','solid','persistent','instance_count','instance_id',
- 'room_speed','fps','current_time','current_year','current_month','current_day','current_weekday',
- 'current_hour','current_minute','current_second','alarm','timeline_index','timeline_position',
- 'timeline_speed',
- 'room','room_first','room_last','room_width','room_height','room_caption','room_persistent',
- 'score','lives','health','show_score','show_lives','show_health','caption_score','caption_lives',
- 'caption_health',
- 'event_type','event_number','event_object','event_action',
- 'error_occurred','error_last',
- // User interaction
- 'keyboard_lastkey','keyboard_key','keyboard_lastchar','keyboard_string',
- 'mouse_x','mouse_y','mouse_button','mouse_lastbutton',
- // Game Graphics
- 'sprite_index','sprite_width','sprite_height','sprite_xoffset','sprite_yoffset',
- 'image_number','image_index','image_speed','image_xscale','image_yscale','image_angle',
- 'image_alpha','image_blend','bbox_left','bbox_right','bbox_top','bbox_bottom',
- 'background_color','background_showcolor','background_visible','background_foreground',
- 'background_index','background_x','background_y','background_width','background_height',
- 'background_htiled','background_vtiled','background_xscale','background_yscale',
- 'background_hspeed','background_vspeed','background_blend','background_alpha',
- 'background','left, top, width, height','depth','visible','xscale','yscale','blend','alpha',
- 'view_enabled','view_current','view_visible','view_yview','view_wview','view_hview','view_xport',
- 'view_yport','view_wport','view_hport','view_angle','view_hborder','view_vborder','view_hspeed',
- 'view_vspeed','view_object',
- 'transition_kind',
- // Files, registry and executing programs
- 'game_id','working_directory','temp_directory',
- 'secure_mode',
- // Creating particles
- 'xmin', 'xmax', 'ymin', 'ymax','shape','distribution','particle type','number',
- 'force','dist','kind','additive', 'parttype1', 'parttype2'
- ),
- // functions
- 3 => array(
- // Computing things
- 'random','choose','abs','sign','round','floor','ceil','frac','sqrt','sqr','power','exp','ln',
- 'log2','log10','logn','sin','cos','tan','arcsin','arccos','arctan','arctan2','degtorad',
- 'radtodeg','min','max','mean','median','point_distance','point_direction','lengthdir_x',
- 'lengthdir_y','is_real','is_string',
- 'chr','ord','real','string','string_format','string_length','string_pos','string_copy',
- 'string_char_at','string_delete','string_insert','string_replace','string_replace_all',
- 'string_count','string_lower','string_upper','string_repeat','string_letters','string_digits',
- 'string_lettersdigits','clipboard_has_text','clipboard_get_text','clipboard_set_text',
- 'date_current_datetime','date_current_date','date_current_time','date_create_datetime',
- 'date_create_date','date_create_time','date_valid_datetime','date_valid_date','date_valid_time',
- 'date_inc_year','date_inc_month','date_inc_week','date_inc_day','date_inc_hour',
- 'date_inc_minute','date_inc_second','date_get_year','date_get_month','date_get_week',
- 'date_get_day','date_get_hour', 'date_get_minute','date_get_second','date_get_weekday',
- 'date_get_day_of_year','date_get_hour_of_year','date_get_minute_of_year',
- 'date_get_second_of_year','date_year_span','date_month_span','date_week_span','date_day_span',
- 'date_hour_span','date_minute_span','date_second_span','date_compare_datetime',
- 'date_compare_date','date_compare_time','date_date_of','date_time_of','date_datetime_string',
- 'date_date_string','date_time_string','date_days_in_month','date_days_in_year','date_leap_year',
- 'date_is_today',
- // Game play
- 'motion_set','motion_add','place_free','place_empty','place_meeting','place_snapped',
- 'move_random','move_snap','move_wrap','move_towards_point','move_bounce_solid','move_bounce_all',
- 'move_contact_solid','move_contact_all','move_outside_solid','move_outside_all',
- 'distance_to_point','distance_to_object','position_empty','position_meeting',
- 'path_start','path_end',
- 'mp_linear_step','mp_linear_step_object','mp_potential_step','mp_potential_step_object',
- 'mp_potential_settings','mp_linear_path','mp_linear_path_object', 'mp_potential_path',
- 'mp_potential_path_object','mp_grid_create','mp_grid_destroy','mp_grid_clear_all',
- 'mp_grid_clear_cell','mp_grid_clear_rectangle','mp_grid_add_cell','mp_grid_add_rectangle',
- 'mp_grid_add_instances','mp_grid_path','mp_grid_draw',
- 'collision_point','collision_rectangle','collision_circle','collision_ellipse','collision_line',
- 'instance_find','instance_exists','instance_number','instance_position','instance_nearest',
- 'instance_furthest','instance_place','instance_create','instance_copy','instance_destroy',
- 'instance_change','position_destroy','position_change',
- 'instance_deactivate_all','instance_deactivate_object','instance_deactivate_region',
- 'instance_activate_all','instance_activate_object','instance_activate_region',
- 'sleep',
- 'room_goto','room_goto_previous','room_goto_next','room_restart','room_previous','room_next',
- 'game_end','game_restart','game_save','game_load',
- 'event_perform', 'event_perform_object','event_user','event_inherited',
- 'show_debug_message','variable_global_exists','variable_local_exists','variable_global_get',
- 'variable_global_array_get','variable_global_array2_get','variable_local_get',
- 'variable_local_array_get','variable_local_array2_get','variable_global_set',
- 'variable_global_array_set','variable_global_array2_set','variable_local_set',
- 'variable_local_array_set','variable_local_array2_set','set_program_priority',
- // User interaction
- 'keyboard_set_map','keyboard_get_map','keyboard_unset_map','keyboard_check',
- 'keyboard_check_pressed','keyboard_check_released','keyboard_check_direct',
- 'keyboard_get_numlock','keyboard_set_numlock','keyboard_key_press','keyboard_key_release',
- 'keyboard_clear','io_clear','io_handle','keyboard_wait',
- 'mouse_check_button','mouse_check_button_pressed','mouse_check_button_released','mouse_clear',
- 'mouse_wait',
- 'joystick_exists','joystick_name','joystick_axes','joystick_buttons','joystick_has_pov',
- 'joystick_direction','joystick_check_button','joystick_xpos','joystick_ypos','joystick_zpos',
- 'joystick_rpos','joystick_upos','joystick_vpos','joystick_pov',
- // Game Graphics
- 'draw_sprite','draw_sprite_stretched','draw_sprite_tiled','draw_sprite_part','draw_background',
- 'draw_background_stretched','draw_background_tiled','draw_background_part','draw_sprite_ext',
- 'draw_sprite_stretched_ext','draw_sprite_tiled_ext','draw_sprite_part_ext','draw_sprite_general',
- 'draw_background_ext','draw_background_stretched_ext','draw_background_tiled_ext',
- 'draw_background_part_ext','draw_background_general',
- 'draw_clear','draw_clear_alpha','draw_point','draw_line','draw_rectangle','draw_roundrect',
- 'draw_triangle','draw_circle','draw_ellipse','draw_arrow','draw_button','draw_path',
- 'draw_healthbar','draw_set_color','draw_set_alpha','draw_get_color','draw_get_alpha',
- 'make_color_rgb','make_color_hsv','color_get_red','color_get_green','color_get_blue',
- 'color_get_hue','color_get_saturation','color_get_value','merge_color','draw_getpixel',
- 'screen_save','screen_save_part',
- 'draw_set_font','draw_set_halign','draw_set_valign','draw_text','draw_text_ext','string_width',
- 'string_height','string_width_ext','string_height_ext','draw_text_transformed',
- 'draw_text_ext_transformed','draw_text_color','draw_text_ext_color',
- 'draw_text_transformed_color','draw_text_ext_transformed_color',
- 'draw_point_color','draw_line_color','draw_rectangle_color','draw_roundrect_color',
- 'draw_triangle_color','draw_circle_color','draw_ellipse_color','draw_primitive_begin',
- 'draw_vertex','draw_vertex_color','draw_primitive_end','sprite_get_texture',
- 'background_get_texture','texture_preload','texture_set_priority',
- 'texture_get_width','texture_get_height','draw_primitive_begin_texture','draw_vertex_texture',
- 'draw_vertex_texture_color','texture_set_interpolation',
- 'texture_set_blending','texture_set_repeat','draw_set_blend_mode','draw_set_blend_mode_ext',
- 'surface_create','surface_free','surface_exists','surface_get_width','surface_get_height',
- 'surface_get_texture','surface_set_target','surface_reset_target','surface_getpixel',
- 'surface_save','surface_save_part','draw_surface','draw_surface_stretched','draw_surface_tiled',
- 'draw_surface_part','draw_surface_ext','draw_surface_stretched_ext','draw_surface_tiled_ext',
- 'draw_surface_part_ext','draw_surface_general','surface_copy','surface_copy_part',
- 'tile_add','tile_delete','tile_exists','tile_get_x','tile_get_y','tile_get_left','tile_get_top',
- 'tile_get_width','tile_get_height','tile_get_depth','tile_get_visible','tile_get_xscale',
- 'tile_get_yscale','tile_get_background','tile_get_blend','tile_get_alpha','tile_set_position',
- 'tile_set_region','tile_set_background','tile_set_visible','tile_set_depth','tile_set_scale',
- 'tile_set_blend','tile_set_alpha','tile_layer_hide','tile_layer_show','tile_layer_delete',
- 'tile_layer_shift','tile_layer_find','tile_layer_delete_at','tile_layer_depth',
- 'display_get_width','display_get_height','display_get_colordepth','display_get_frequency',
- 'display_set_size','display_set_colordepth','display_set_frequency','display_set_all',
- 'display_test_all','display_reset','display_mouse_get_x','display_mouse_get_y','display_mouse_set',
- 'window_set_visible','window_get_visible','window_set_fullscreen','window_get_fullscreen',
- 'window_set_showborder','window_get_showborder','window_set_showicons','window_get_showicons',
- 'window_set_stayontop','window_get_stayontop','window_set_sizeable','window_get_sizeable',
- 'window_set_caption','window_get_caption','window_set_cursor', 'window_get_cursor',
- 'window_set_color','window_get_color','window_set_region_scale','window_get_region_scale',
- 'window_set_position','window_set_size','window_set_rectangle','window_center','window_default',
- 'window_get_x','window_get_y','window_get_width','window_get_height','window_mouse_get_x',
- 'window_mouse_get_y','window_mouse_set',
- 'window_set_region_size','window_get_region_width','window_get_region_height',
- 'window_view_mouse_get_x','window_view_mouse_get_y','window_view_mouse_set',
- 'window_views_mouse_get_x','window_views_mouse_get_y','window_views_mouse_set',
- 'screen_redraw','screen_refresh','set_automatic_draw','set_synchronization','screen_wait_vsync',
- // Sound and music)
- 'sound_play','sound_loop','sound_stop','sound_stop_all','sound_isplaying','sound_volume',
- 'sound_global_volume','sound_fade','sound_pan','sound_background_tempo','sound_set_search_directory',
- 'sound_effect_set','sound_effect_chorus','sound_effect_echo', 'sound_effect_flanger',
- 'sound_effect_gargle','sound_effect_reverb','sound_effect_compressor','sound_effect_equalizer',
- 'sound_3d_set_sound_position','sound_3d_set_sound_velocity','sound_3d_set_sound_distance',
- 'sound_3d_set_sound_cone',
- 'cd_init','cd_present','cd_number','cd_playing','cd_paused','cd_track','cd_length',
- 'cd_track_length','cd_position','cd_track_position','cd_play','cd_stop','cd_pause','cd_resume',
- 'cd_set_position','cd_set_track_position','cd_open_door','cd_close_door','MCI_command',
- // Splash screens, highscores, and other pop-ups
- 'show_text','show_image','show_video','show_info','load_info',
- 'show_message','show_message_ext','show_question','get_integer','get_string',
- 'message_background','message_alpha','message_button','message_text_font','message_button_font',
- 'message_input_font','message_mouse_color','message_input_color','message_caption',
- 'message_position','message_size','show_menu','show_menu_pos','get_color','get_open_filename',
- 'get_save_filename','get_directory','get_directory_alt','show_error',
- 'highscore_show','highscore_set_background','highscore_set_border','highscore_set_font',
- 'highscore_set_colors','highscore_set_strings','highscore_show_ext','highscore_clear',
- 'highscore_add','highscore_add_current','highscore_value','highscore_name','draw_highscore',
- // Resources
- 'sprite_exists','sprite_get_name','sprite_get_number','sprite_get_width','sprite_get_height',
- 'sprite_get_transparent','sprite_get_smooth','sprite_get_preload','sprite_get_xoffset',
- 'sprite_get_yoffset','sprite_get_bbox_left','sprite_get_bbox_right','sprite_get_bbox_top',
- 'sprite_get_bbox_bottom','sprite_get_bbox_mode','sprite_get_precise',
- 'sound_exists','sound_get_name','sound_get_kind','sound_get_preload','sound_discard',
- 'sound_restore',
- 'background_exists','background_get_name','background_get_width','background_get_height',
- 'background_get_transparent','background_get_smooth','background_get_preload',
- 'font_exists','font_get_name','font_get_fontname','font_get_bold','font_get_italic',
- 'font_get_first','font_get_last',
- 'path_exists','path_get_name','path_get_length','path_get_kind','path_get_closed',
- 'path_get_precision','path_get_number','path_get_point_x','path_get_point_y',
- 'path_get_point_speed','path_get_x','path_get_y','path_get_speed',
- 'script_exists','script_get_name','script_get_text',
- 'timeline_exists','timeline_get_name',
- 'object_exists','object_get_name','object_get_sprite','object_get_solid','object_get_visible',
- 'object_get_depth','object_get_persistent','object_get_mask','object_get_parent',
- 'object_is_ancestor',
- 'room_exists','room_get_name',
- // Changing resources
- 'sprite_set_offset','sprite_set_bbox_mode','sprite_set_bbox','sprite_set_precise',
- 'sprite_duplicate','sprite_assign','sprite_merge','sprite_add','sprite_replace',
- 'sprite_create_from_screen','sprite_add_from_screen','sprite_create_from_surface',
- 'sprite_add_from_surface','sprite_delete','sprite_set_alpha_from_sprite',
- 'sound_add','sound_replace','sound_delete',
- 'background_duplicate','background_assign','background_add','background_replace',
- 'background_create_color','background_create_gradient','background_create_from_screen',
- 'background_create_from_surface','background_delete','background_set_alpha_from_background',
- 'font_add','font_add_sprite','font_replace_sprite','font_delete',
- 'path_set_kind','path_set_closed','path_set_precision','path_add','path_delete','path_duplicate',
- 'path_assign','path_append','path_add_point','path_insert_point','path_change_point',
- 'path_delete_point','path_clear_points','path_reverse','path_mirror','path_flip','path_rotate',
- 'path_scale','path_shift',
- 'execute_string','execute_file','script_execute',
- 'timeline_add','timeline_delete','timeline_moment_add','timeline_moment_clear',
- 'object_set_sprite','object_set_solid','object_set_visible','object_set_depth',
- 'object_set_persistent','object_set_mask','object_set_parent','object_add','object_delete',
- 'object_event_add','object_event_clear',
- 'room_set_width','room_set_height','room_set_caption','room_set_persistent','room_set_code',
- 'room_set_background_color','room_set_background','room_set_view','room_set_view_enabled',
- 'room_add','room_duplicate','room_assign','room_instance_add','room_instance_clear',
- 'room_tile_add','room_tile_add_ext','room_tile_clear',
- // Files, registry and executing programs
- 'file_text_open_read','file_text_open_write','file_text_open_append','file_text_close',
- 'file_text_write_string','file_text_write_real','file_text_writeln','file_text_read_string',
- 'file_text_read_real','file_text_readln','file_text_eof','file_exists','file_delete',
- 'file_rename','file_copy','directory_exists','directory_create','file_find_first',
- 'file_find_next','file_find_close','file_attributes', 'filename_name','filename_path',
- 'filename_dir','filename_drive','filename_ext','filename_change_ext','file_bin_open',
- 'file_bin_rewrite','file_bin_close','file_bin_size','file_bin_position','file_bin_seek',
- 'file_bin_write_byte','file_bin_read_byte','parameter_count','parameter_string',
- 'environment_get_variable',
- 'registry_write_string','registry_write_real','registry_read_string','registry_read_real',
- 'registry_exists','registry_write_string_ext','registry_write_real_ext',
- 'registry_read_string_ext','registry_read_real_ext','registry_exists_ext','registry_set_root',
- 'ini_open','ini_close','ini_read_string','ini_read_real','ini_write_string','ini_write_real',
- 'ini_key_exists','ini_section_exists','ini_key_delete','ini_section_delete',
- 'execute_program','execute_shell',
- // Data structures
- 'ds_stack_create','ds_stack_destroy','ds_stack_clear','ds_stack_size','ds_stack_empty',
- 'ds_stack_push','ds_stack_pop','ds_stack_top',
- 'ds_queue_create','ds_queue_destroy','ds_queue_clear','ds_queue_size','ds_queue_empty',
- 'ds_queue_enqueue','ds_queue_dequeue','ds_queue_head','ds_queue_tail',
- 'ds_list_create','ds_list_destroy','ds_list_clear','ds_list_size','ds_list_empty','ds_list_add',
- 'ds_list_insert','ds_list_replace','ds_list_delete','ds_list_find_index','ds_list_find_value',
- 'ds_list_sort',
- 'ds_map_create','ds_map_destroy','ds_map_clear','ds_map_size','ds_map_empty','ds_map_add',
- 'ds_map_replace','ds_map_delete','ds_map_exists','ds_map_find_value','ds_map_find_previous',
- 'ds_map_find_next','ds_map_find_first','ds_map_find_last',
- 'ds_priority_create','ds_priority_destroy','ds_priority_clear','ds_priority_size',
- 'ds_priority_empty','ds_priority_add','ds_priority_change_priority','ds_priority_find_priority',
- 'ds_priority_delete_value','ds_priority_delete_min','ds_priority_find_min',
- 'ds_priority_delete_max','ds_priority_find_max',
- 'ds_grid_create','ds_grid_destroy','ds_grid_resize','ds_grid_width','ds_grid_height',
- 'ds_grid_clear','ds_grid_set','ds_grid_add','ds_grid_multiply','ds_grid_set_region',
- 'ds_grid_add_region','ds_grid_multiply_region','ds_grid_set_disk','ds_grid_add_disk',
- 'ds_grid_multiply_disk','ds_grid_get','ds_grid_get_sum','ds_grid_get_max','ds_grid_get_min',
- 'ds_grid_get_mean','ds_grid_get_disk_sum','ds_grid_get_disk_min','ds_grid_get_disk_max',
- 'ds_grid_get_disk_mean','ds_grid_value_exists','ds_grid_value_x','ds_grid_value_y',
- 'ds_grid_value_disk_exists','ds_grid_value_disk_x','ds_grid_value_disk_y',
- // Creating particles
- 'effect_create_below','effect_create_above','effect_clear',
- 'part_type_create','part_type_destroy','part_type_exists','part_type_clear','part_type_shape',
- 'part_type_sprite','part_type_size','part_type_scale',
- 'part_type_orientation','part_type_color1','part_type_color2','part_type_color3',
- 'part_type_color_mix','part_type_color_rgb','part_type_color_hsv',
- 'part_type_alpha1','part_type_alpha2','part_type_alpha3','part_type_blend','part_type_life',
- 'part_type_step','part_type_death','part_type_speed','part_type_direction','part_type_gravity',
- 'part_system_create','part_system_destroy','part_system_exists','part_system_clear',
- 'part_system_draw_order','part_system_depth','part_system_position',
- 'part_system_automatic_update','part_system_automatic_draw','part_system_update',
- 'part_system_drawit','part_particles_create','part_particles_create_color',
- 'part_particles_clear','part_particles_count',
- 'part_emitter_create','part_emitter_destroy','part_emitter_destroy_all','part_emitter_exists',
- 'part_emitter_clear','part_emitter_region','part_emitter_burst','part_emitter_stream',
- 'part_attractor_create','part_attractor_destroy','part_attractor_destroy_all',
- 'part_attractor_exists','part_attractor_clear','part_attractor_position','part_attractor_force',
- 'part_destroyer_create','part_destroyer_destroy','part_destroyer_destroy_all',
- 'part_destroyer_exists','part_destroyer_clear','part_destroyer_region',
- 'part_deflector_create','part_deflector_destroy','part_deflector_destroy_all',
- 'part_deflector_exists','part_deflector_clear','part_deflector_region','part_deflector_kind',
- 'part_deflector_friction',
- 'part_changer_create','part_changer_destroy','part_changer_destroy_all','part_changer_exists',
- 'part_changer_clear','part_changer_region','part_changer_types','part_changer_kind',
- // Multiplayer games
- 'mplay_init_ipx','mplay_init_tcpip','mplay_init_modem','mplay_init_serial',
- 'mplay_connect_status','mplay_end','mplay_ipaddress',
- 'mplay_session_create','mplay_session_find','mplay_session_name','mplay_session_join',
- 'mplay_session_mode','mplay_session_status','mplay_session_end',
- 'mplay_player_find','mplay_player_name','mplay_player_id',
- 'mplay_data_write','mplay_data_read','mplay_data_mode',
- 'mplay_message_send','mplay_message_send_guaranteed','mplay_message_receive','mplay_message_id',
- 'mplay_message_value','mplay_message_player','mplay_message_name','mplay_message_count',
- 'mplay_message_clear',
- // Using DLL's
- 'external_define','external_call','external_free','window_handle',
- // 3D Graphics
- 'd3d_start','d3d_end','d3d_set_hidden','d3d_set_perspective',
- 'd3d_set_depth',
- 'd3d_primitive_begin','d3d_vertex','d3d_vertex_color','d3d_primitive_end',
- 'd3d_primitive_begin_texture','d3d_vertex_texture','d3d_vertex_texture_color','d3d_set_culling',
- 'd3d_draw_block','d3d_draw_cylinder','d3d_draw_cone','d3d_draw_ellipsoid','d3d_draw_wall',
- 'd3d_draw_floor',
- 'd3d_set_projection','d3d_set_projection_ext','d3d_set_projection_ortho',
- 'd3d_set_projection_perspective',
- 'd3d_transform_set_identity','d3d_transform_set_translation','d3d_transform_set_scaling',
- 'd3d_transform_set_rotation_x','d3d_transform_set_rotation_y','d3d_transform_set_rotation_z',
- 'd3d_transform_set_rotation_axis','d3d_transform_add_translation','d3d_transform_add_scaling',
- 'd3d_transform_add_rotation_x','d3d_transform_add_rotation_y','d3d_transform_add_rotation_z',
- 'd3d_transform_add_rotation_axis','d3d_transform_stack_clear','d3d_transform_stack_empty',
- 'd3d_transform_stack_push','d3d_transform_stack_pop','d3d_transform_stack_top',
- 'd3d_transform_stack_discard',
- 'd3d_set_fog',
- 'd3d_set_lighting','d3d_set_shading','d3d_light_define_direction','d3d_light_define_point',
- 'd3d_light_enable','d3d_vertex_normal','d3d_vertex_normal_color','d3d_vertex_normal_texture',
- 'd3d_vertex_normal_texture_color',
- 'd3d_model_create','d3d_model_destroy','d3d_model_clear','d3d_model_save','d3d_model_load',
- 'd3d_model_draw','d3d_model_primitive_begin','d3d_model_vertex','d3d_model_vertex_color',
- 'd3d_model_vertex_texture','d3d_model_vertex_texture_color','d3d_model_vertex_normal',
- 'd3d_model_vertex_normal_color','d3d_model_vertex_normal_texture',
- 'd3d_model_vertex_normal_texture_color','d3d_model_primitive_end','d3d_model_block',
- 'd3d_model_cylinder','d3d_model_cone','d3d_model_ellipsoid','d3d_model_wall','d3d_model_floor'
- ),
- // constants
- 4 => array(
- 'true', 'false', 'pi',
- 'ev_destroy','ev_step','ev_alarm','ev_keyboard','ev_mouse','ev_collision','ev_other','ev_draw',
- 'ev_keypress','ev_keyrelease','ev_left_button','ev_right_button','ev_middle_button',
- 'ev_no_button','ev_left_press','ev_right_press','ev_middle_press','ev_left_release',
- 'ev_right_release','ev_middle_release','ev_mouse_enter','ev_mouse_leave','ev_mouse_wheel_up',
- 'ev_mouse_wheel_down','ev_global_left_button','ev_global_right_button','ev_global_middle_button',
- 'ev_global_left_press','ev_global_right_press','ev_global_middle_press','ev_global_left_release',
- 'ev_global_right_release','ev_global_middle_release','ev_joystick1_left','ev_joystick1_right',
- 'ev_joystick1_up','ev_joystick1_down','ev_joystick1_button1','ev_joystick1_button2',
- 'ev_joystick1_button3','ev_joystick1_button4','ev_joystick1_button5','ev_joystick1_button6',
- 'ev_joystick1_button7','ev_joystick1_button8','ev_joystick2_left','ev_joystick2_right',
- 'ev_joystick2_up','ev_joystick2_down','ev_joystick2_button1','ev_joystick2_button2',
- 'ev_joystick2_button3','ev_joystick2_button4','ev_joystick2_button5','ev_joystick2_button6',
- 'ev_joystick2_button7','ev_joystick2_button8',
- 'ev_outside','ev_boundary','ev_game_start','ev_game_end','ev_room_start','ev_room_end',
- 'ev_no_more_lives','ev_no_more_health','ev_animation_end','ev_end_of_path','ev_user0','ev_user1',
- 'ev_user2','ev_user3','ev_user4','ev_user5','ev_user6','ev_user7','ev_user8','ev_user9',
- 'ev_user10','ev_user11','ev_user12','ev_user13','ev_user14','ev_user15','ev_step_normal',
- 'ev_step_begin','ev_step_end',
- 'vk_nokey','vk_anykey','vk_left','vk_right','vk_up','vk_down','vk_enter','vk_escape','vk_space',
- 'vk_shift','vk_control','vk_alt','vk_backspace','vk_tab','vk_home','vk_end','vk_delete',
- 'vk_insert','vk_pageup','vk_pagedown','vk_pause','vk_printscreen',
- 'vk_f1','vk_f2','vk_f3','vk_f4','vk_f5','vk_f6','vk_f7','vk_f8','vk_f9','vk_f10','vk_f11','vk_f12',
- 'vk_numpad0','vk_numpad1','vk_numpad2','vk_numpad3','vk_numpad4','vk_numpad5','vk_numpad6',
- 'vk_numpad7','vk_numpad8','vk_numpad9', 'vk_multiply','vk_divide','vk_add','vk_subtract',
- 'vk_decimal','vk_lshift','vk_lcontrol','vk_lalt','vk_rshift','vk_rcontrol','vk_ralt',
- 'c_aqua','c_black','c_blue','c_dkgray','c_fuchsia','c_gray','c_green','c_lime','c_ltgray',
- 'c_maroon','c_navy','c_olive','c_purple','c_red','c_silver','c_teal','c_white','c_yellow',
- 'fa_left', 'fa_center','fa_right','fa_top','fa_middle','fa_bottom',
- 'pr_pointlist','pr_linelist','pr_linestrip','pr_trianglelist','pr_trianglestrip',
- 'pr_trianglefan',
- 'cr_none','cr_arrow','cr_cross','cr_beam','cr_size_nesw','cr_size_ns','cr_size_nwse',
- 'cr_size_we','cr_uparrow','cr_hourglass','cr_drag','cr_nodrop','cr_hsplit','cr_vsplit',
- 'cr_multidrag','cr_sqlwait','cr_no','cr_appstart','cr_help','cr_handpoint','cr_size_all',
- 'se_chorus','se_echo','se_flanger','se_gargle','se_reverb','se_compressor','se_equalizer',
- 'fa_readonly','fa_hidden','fa_sysfile','fa_volumeid','fa_directory','fa_archive',
- 'pt_shape_pixel','pt_shape_disk','pt_shape_square','pt_shape_line','pt_shape_star',
- 'pt_shape_circle','pt_shape_ring','pt_shape_sphere','pt_shape_flare','pt_shape_spark',
- 'pt_shape_explosion','pt_shape_cloud','pt_shape_smoke','pt_shape_snow',
- 'ps_shape_rectangle','ps_shape_ellipse ','ps_shape_diamond','ps_shape_line',
- 'ps_distr_linear','ps_distr_gaussian','ps_force_constant','ps_force_linear','ps_force_quadratic',
- 'ps_deflect_horizontal', 'ps_deflect_vertical',
- 'ps_change_motion','ps_change_shape','ps_change_all'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']',
- '&&', '||', '^^', '&', '|', '^',
- '<', '<=', '==', '!=', '>', '>=', '=',
- '<<', '>>',
- '+=', '-=', '*=', '/=',
- '+', '-', '*', '/',
- '!', '~', ',', ';'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'font-weight: bold; color: #000000;',
- 2 => 'font-weight: bold; color: #000000;',
- 3 => 'color: navy;',
- 4 => 'color: #663300;',
- ),
- 'COMMENTS' => array(
- 1 => 'font-style: italic; color: green;',
- 'MULTI' => 'font-style: italic; color: green;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;' //'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/gnuplot.php b/libvpx/examples/includes/geshi/geshi/gnuplot.php
deleted file mode 100644
index 3b67fb6..0000000
--- a/libvpx/examples/includes/geshi/geshi/gnuplot.php
+++ /dev/null
@@ -1,296 +0,0 @@
-<?php
-/*************************************************************************************
- * gnuplot.php
- * ----------
- * Author: Milian Wolff (mail@milianw.de)
- * Copyright: (c) 2008 Milian Wolff (http://milianw.de)
- * Release Version: 1.0.8.3
- * Date Started: 2008/07/07
- *
- * Gnuplot script language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/07/07 (1.0.8)
- * - Initial import
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Gnuplot',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('`', '"', "'"),
- 'ESCAPE_CHAR' => '\\',
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC |
- GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_SCI_SHORT |
- GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- // copy output of help command, indent properly and use this replace regexp:
- // ([a-z0-9_\-]+)(( )+|$) => '\1',\3
-
- // commands as found in `help commands`
- 1 => array(
- 'bind', 'call', 'cd', 'clear',
- 'exit', 'fit', 'help', 'history',
- 'if', 'load', 'lower', 'pause',
- 'plot', 'print', 'pwd', 'quit',
- 'raise', 'replot', 'reread', 'reset',
- 'save', 'set', 'shell', 'show',
- 'splot', 'system', 'test', 'unset',
- 'update'
- ),
- 2 => array(
- // set commands as returned by `help set`
- 'angles', 'arrow', 'autoscale', 'bars',
- 'bmargin', 'border', 'boxwidth', 'cbdata',
- 'cbdtics', 'cblabel', 'cbmtics', 'cbrange',
- 'cbtics', 'clabel', 'clip', 'cntrparam',
- 'colorbox', 'contour', 'datafile', 'date_specifiers',
- 'decimalsign', 'dgrid3d', 'dummy', 'encoding',
- 'fontpath', 'format', 'grid',
- 'hidden3d', 'historysize', 'isosamples', 'key',
- 'label', 'lmargin', 'loadpath', 'locale',
- 'log', 'logscale', 'macros', 'mapping',
- 'margin', 'missing', 'mouse', 'multiplot',
- 'mx2tics', 'mxtics', 'my2tics', 'mytics',
- 'mztics', 'object', 'offsets', 'origin',
- 'output', 'palette', 'parametric', 'pm3d',
- 'pointsize', 'polar', 'rmargin',
- 'rrange', 'samples', 'size', 'style',
- 'surface', 'table', 'term', 'terminal',
- 'termoption', 'tics', 'ticscale', 'ticslevel',
- 'time_specifiers', 'timefmt', 'timestamp', 'title',
- 'trange', 'urange', 'view',
- 'vrange', 'x2data', 'x2dtics', 'x2label',
- 'x2mtics', 'x2range', 'x2tics', 'x2zeroaxis',
- 'xdata', 'xdtics', 'xlabel', 'xmtics',
- 'xrange', 'xtics', 'xyplane', 'xzeroaxis',
- 'y2data', 'y2dtics', 'y2label', 'y2mtics',
- 'y2range', 'y2tics', 'y2zeroaxis', 'ydata',
- 'ydtics', 'ylabel', 'ymtics', 'yrange',
- 'ytics', 'yzeroaxis', 'zdata', 'zdtics',
- 'zero', 'zeroaxis', 'zlabel', 'zmtics',
- 'zrange', 'ztics', 'zzeroaxis',
- // same but with leading no
- 'noangles', 'noarrow', 'noautoscale', 'nobars',
- 'nobmargin', 'noborder', 'noboxwidth', 'nocbdata',
- 'nocbdtics', 'nocblabel', 'nocbmtics', 'nocbrange',
- 'nocbtics', 'noclabel', 'noclip', 'nocntrparam',
- 'nocolorbox', 'nocontour', 'nodatafile', 'nodate_specifiers',
- 'nodecimalsign', 'nodgrid3d', 'nodummy', 'noencoding',
- 'nofit', 'nofontpath', 'noformat', 'nogrid',
- 'nohidden3d', 'nohistorysize', 'noisosamples', 'nokey',
- 'nolabel', 'nolmargin', 'noloadpath', 'nolocale',
- 'nolog', 'nologscale', 'nomacros', 'nomapping',
- 'nomargin', 'nomissing', 'nomouse', 'nomultiplot',
- 'nomx2tics', 'nomxtics', 'nomy2tics', 'nomytics',
- 'nomztics', 'noobject', 'nooffsets', 'noorigin',
- 'nooutput', 'nopalette', 'noparametric', 'nopm3d',
- 'nopointsize', 'nopolar', 'noprint', 'normargin',
- 'norrange', 'nosamples', 'nosize', 'nostyle',
- 'nosurface', 'notable', 'noterm', 'noterminal',
- 'notermoption', 'notics', 'noticscale', 'noticslevel',
- 'notime_specifiers', 'notimefmt', 'notimestamp', 'notitle',
- 'notmargin', 'notrange', 'nourange', 'noview',
- 'novrange', 'nox2data', 'nox2dtics', 'nox2label',
- 'nox2mtics', 'nox2range', 'nox2tics', 'nox2zeroaxis',
- 'noxdata', 'noxdtics', 'noxlabel', 'noxmtics',
- 'noxrange', 'noxtics', 'noxyplane', 'noxzeroaxis',
- 'noy2data', 'noy2dtics', 'noy2label', 'noy2mtics',
- 'noy2range', 'noy2tics', 'noy2zeroaxis', 'noydata',
- 'noydtics', 'noylabel', 'noymtics', 'noyrange',
- 'noytics', 'noyzeroaxis', 'nozdata', 'nozdtics',
- 'nozero', 'nozeroaxis', 'nozlabel', 'nozmtics',
- 'nozrange', 'noztics', 'nozzeroaxis',
- ),
- 3 => array(
- // predefined variables
- 'pi', 'NaN', 'GNUTERM',
- 'GPVAL_X_MIN', 'GPVAL_X_MAX', 'GPVAL_Y_MIN', 'GPVAL_Y_MAX',
- 'GPVAL_TERM', 'GPVAL_TERMOPTIONS', 'GPVAL_OUTPUT',
- 'GPVAL_VERSION', 'GPVAL_PATcHLEVEL', 'GPVAL_COMPILE_OPTIONS',
- 'MOUSE_KEY', 'MOUSE_X', 'MOUSE_X2', 'MOUSE_Y', 'MOUSE_Y2',
- 'MOUSE_BUTTON', 'MOUSE_SHIFT', 'MOUSE_ALT', 'MOUSE_CTRL'
- ),
- 4 => array(
- // predefined functions `help functions`
- 'abs', 'acos', 'acosh', 'arg',
- 'asin', 'asinh', 'atan', 'atan2',
- 'atanh', 'besj0', 'besj1', 'besy0',
- 'besy1', 'ceil', 'column', 'cos',
- 'cosh', 'defined', 'erf', 'erfc',
- 'exists', 'exp', 'floor', 'gamma',
- 'gprintf', 'ibeta', 'igamma', 'imag',
- 'int', 'inverf', 'invnorm', 'lambertw',
- 'lgamma', 'log10', 'norm',
- 'rand', 'random', 'real', 'sgn',
- 'sin', 'sinh', 'sprintf', 'sqrt',
- 'stringcolumn', 'strlen', 'strstrt', 'substr',
- 'tan', 'tanh', 'timecolumn',
- 'tm_hour', 'tm_mday', 'tm_min', 'tm_mon',
- 'tm_sec', 'tm_wday', 'tm_yday', 'tm_year',
- 'valid', 'word', 'words',
- ),
- 5 => array(
- // mixed arguments
- // there is no sane way to get these ones easily...
- 'autofreq', 'x', 'y', 'z',
- 'lt', 'linetype', 'lw', 'linewidth', 'ls', 'linestyle',
- 'out', 'rotate by', 'screen',
- 'enhanced', 'via',
- // `help set key`
- 'on', 'off', 'default', 'inside', 'outside', 'tmargin',
- 'at', 'left', 'right', 'center', 'top', 'bottom', 'vertical', 'horizontal', 'Left', 'Right',
- 'noreverse', 'reverse', 'noinvert', 'invert', 'samplen', 'spacing', 'width', 'height',
- 'noautotitle', 'autotitle', 'noenhanced', 'nobox', 'box',
-
- // help set terminal postscript
- 'landscape', 'portrait', 'eps', 'defaultplex', 'simplex', 'duplex',
- 'fontfile', 'add', 'delete', 'nofontfiles', 'level1', 'leveldefault',
- 'color', 'colour', 'monochrome', 'solid', 'dashed', 'dashlength', 'dl',
- 'rounded', 'butt', 'palfuncparam', 'blacktext', 'colortext', 'colourtext',
- 'font',
-
- // help set terminal png
- 'notransparent', 'transparent', 'nointerlace', 'interlace',
- 'notruecolor', 'truecolor', 'tiny', 'small', 'medium', 'large', 'giant',
- 'nocrop', 'crop',
-
- // `help plot`
- 'acsplines', 'bezier', 'binary', 'csplines',
- 'every',
- 'example', 'frequency', 'index', 'matrix',
- 'ranges', 'sbezier', 'smooth',
- 'special-filenames', 'thru',
- 'unique', 'using', 'with',
-
- // `help plotting styles`
- 'boxerrorbars', 'boxes', 'boxxyerrorbars', 'candlesticks',
- 'dots', 'errorbars', 'errorlines', 'filledcurves',
- 'financebars', 'fsteps', 'histeps', 'histograms',
- 'image', 'impulses', 'labels', 'lines',
- 'linespoints', 'points', 'rgbimage', 'steps',
- 'vectors', 'xerrorbars', 'xerrorlines', 'xyerrorbars',
- 'xyerrorlines', 'yerrorbars', 'yerrorlines',
-
-
- // terminals `help terminals`
- 'aed512', 'aed767', 'aifm', 'bitgraph',
- 'cgm', 'corel', 'dumb', 'dxf',
- 'eepic', 'emf', 'emtex', 'epslatex',
- 'epson-180dpi', 'epson-60dpi', 'epson-lx800', 'fig',
- 'gif', 'gpic', 'hp2623a', 'hp2648',
- 'hp500c', 'hpdj', 'hpgl', 'hpljii',
- 'hppj', 'imagen', 'jpeg', 'kc-tek40xx',
- 'km-tek40xx', 'latex', 'mf', 'mif',
- 'mp', 'nec-cp6', 'okidata', 'pbm',
- 'pcl5', 'png', 'pop', 'postscript',
- 'pslatex', 'pstex', 'pstricks', 'push',
- 'qms', 'regis', 'selanar', 'starc',
- 'svg', 'tandy-60dpi', 'tek40xx', 'tek410x',
- 'texdraw', 'tgif', 'tkcanvas', 'tpic',
- 'vttek', 'x11', 'xlib',
- )
- ),
- 'REGEXPS' => array(
- //Variable assignment
- 0 => "([a-zA-Z_][a-zA-Z0-9_]*)\s*=",
- //Numbers with unit
- 1 => "(?<=^|\s)([0-9]*\.?[0-9]+\s*cm)"
- ),
- 'SYMBOLS' => array(
- '-', '+', '~', '!', '$',
- '*', '/', '%', '=', '<', '>', '&',
- '^', '|', '.', 'eq', 'ne', '?:', ':', '`', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #990000;',
- 3 => 'color: #550000;',
- 4 => 'color: #7a0874;',
- 5 => 'color: #448888;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight:bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000099; font-weight:bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;',
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #007800;',
- 1 => 'color: #cc66cc;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => 'http://www.google.com/search?q=%22set+{FNAME}%22+site%3Ahttp%3A%2F%2Fwww.gnuplot.info%2Fdocs%2F&amp;btnI=lucky',
- 3 => '',
- 4 => '',
- 5 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 4 => array(
- 'DISALLOWED_AFTER' => "(?![\.\-a-zA-Z0-9_%])"
- )
- )
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/groovy.php b/libvpx/examples/includes/geshi/geshi/groovy.php
deleted file mode 100644
index 332f163..0000000
--- a/libvpx/examples/includes/geshi/geshi/groovy.php
+++ /dev/null
@@ -1,1011 +0,0 @@
-<?php
-/*************************************************************************************
- * groovy.php
- * ----------
- * Author: Ivan F. Villanueva B. (geshi_groovy@artificialidea.com)
- * Copyright: (c) 2006 Ivan F. Villanueva B.(http://www.artificialidea.com)
- * Release Version: 1.0.8.3
- * Date Started: 2006/04/29
- *
- * Groovy language file for GeSHi.
- *
- * Keywords from http: http://docs.codehaus.org/download/attachments/2715/groovy-reference-card.pdf?version=1
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2006/04/29 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/04/29)
- * -------------------------
- * Testing
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Groovy',
- 'COMMENT_SINGLE' => array(1 => '//', 3 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Import and Package directives (Basic Support only)
- 2 => '/(?:(?<=import[\\n\\s])|(?<=package[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*([a-zA-Z0-9_]+|\*)(?=[\n\s;])/i',
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'''", '"""', "'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'case', 'do', 'else', 'for', 'foreach', 'if', 'in', 'switch',
- 'while',
- ),
- 2 => array(
- 'abstract', 'as', 'assert', 'break', 'catch', 'class', 'const',
- 'continue', 'def', 'default', 'enum', 'extends',
- 'false', 'final', 'finally', 'goto', 'implements', 'import',
- 'instanceof', 'interface', 'native', 'new', 'null',
- 'package', 'private', 'property', 'protected',
- 'public', 'return', 'static', 'strictfp', 'super',
- 'synchronized', 'this', 'throw', 'throws',
- 'transient', 'true', 'try', 'volatile'
- ),
- 3 => array(
- 'AbstractAction', 'AbstractBorder', 'AbstractButton',
- 'AbstractCellEditor', 'AbstractCollection',
- 'AbstractColorChooserPanel', 'AbstractDocument',
- 'AbstractDocument.AttributeContext',
- 'AbstractDocument.Content',
- 'AbstractDocument.ElementEdit',
- 'AbstractLayoutCache',
- 'AbstractLayoutCache.NodeDimensions', 'AbstractList',
- 'AbstractListModel', 'AbstractMap',
- 'AbstractMethodError', 'AbstractSequentialList',
- 'AbstractSet', 'AbstractTableModel',
- 'AbstractUndoableEdit', 'AbstractWriter',
- 'AccessControlContext', 'AccessControlException',
- 'AccessController', 'AccessException', 'Accessible',
- 'AccessibleAction', 'AccessibleBundle',
- 'AccessibleComponent', 'AccessibleContext',
- 'AccessibleHyperlink', 'AccessibleHypertext',
- 'AccessibleIcon', 'AccessibleObject',
- 'AccessibleRelation', 'AccessibleRelationSet',
- 'AccessibleResourceBundle', 'AccessibleRole',
- 'AccessibleSelection', 'AccessibleState',
- 'AccessibleStateSet', 'AccessibleTable',
- 'AccessibleTableModelChange', 'AccessibleText',
- 'AccessibleValue', 'Acl', 'AclEntry',
- 'AclNotFoundException', 'Action', 'ActionEvent',
- 'ActionListener', 'ActionMap', 'ActionMapUIResource',
- 'Activatable', 'ActivateFailedException',
- 'ActivationDesc', 'ActivationException',
- 'ActivationGroup', 'ActivationGroupDesc',
- 'ActivationGroupDesc.CommandEnvironment',
- 'ActivationGroupID', 'ActivationID',
- 'ActivationInstantiator', 'ActivationMonitor',
- 'ActivationSystem', 'Activator', 'ActiveEvent',
- 'Adjustable', 'AdjustmentEvent',
- 'AdjustmentListener', 'Adler32', 'AffineTransform',
- 'AffineTransformOp', 'AlgorithmParameterGenerator',
- 'AlgorithmParameterGeneratorSpi',
- 'AlgorithmParameters', 'AlgorithmParameterSpec',
- 'AlgorithmParametersSpi', 'AllPermission',
- 'AlphaComposite', 'AlreadyBound',
- 'AlreadyBoundException', 'AlreadyBoundHelper',
- 'AlreadyBoundHolder', 'AncestorEvent',
- 'AncestorListener', 'Annotation', 'Any', 'AnyHolder',
- 'AnySeqHelper', 'AnySeqHolder', 'Applet',
- 'AppletContext', 'AppletInitializer', 'AppletStub',
- 'ApplicationException', 'Arc2D', 'Arc2D.Double',
- 'Arc2D.Float', 'Area', 'AreaAveragingScaleFilter',
- 'ARG_IN', 'ARG_INOUT', 'ARG_OUT',
- 'ArithmeticException', 'Array',
- 'ArrayIndexOutOfBoundsException', 'ArrayList',
- 'Arrays', 'ArrayStoreException', 'AsyncBoxView',
- 'Attribute', 'AttributedCharacterIterator',
- 'AttributedCharacterIterator.Attribute',
- 'AttributedString', 'AttributeInUseException',
- 'AttributeList', 'AttributeModificationException',
- 'Attributes', 'Attributes.Name', 'AttributeSet',
- 'AttributeSet.CharacterAttribute',
- 'AttributeSet.ColorAttribute',
- 'AttributeSet.FontAttribute',
- 'AttributeSet.ParagraphAttribute', 'AudioClip',
- 'AudioFileFormat', 'AudioFileFormat.Type',
- 'AudioFileReader', 'AudioFileWriter', 'AudioFormat',
- 'AudioFormat.Encoding', 'AudioInputStream',
- 'AudioPermission', 'AudioSystem',
- 'AuthenticationException',
- 'AuthenticationNotSupportedException',
- 'Authenticator', 'Autoscroll', 'AWTError',
- 'AWTEvent', 'AWTEventListener',
- 'AWTEventMulticaster', 'AWTException',
- 'AWTPermission', 'BadKind', 'BadLocationException',
- 'BAD_CONTEXT', 'BAD_INV_ORDER', 'BAD_OPERATION',
- 'BAD_PARAM', 'BAD_POLICY', 'BAD_POLICY_TYPE',
- 'BAD_POLICY_VALUE', 'BAD_TYPECODE', 'BandCombineOp',
- 'BandedSampleModel', 'BasicArrowButton',
- 'BasicAttribute', 'BasicAttributes', 'BasicBorders',
- 'BasicBorders.ButtonBorder',
- 'BasicBorders.FieldBorder',
- 'BasicBorders.MarginBorder',
- 'BasicBorders.MenuBarBorder',
- 'BasicBorders.RadioButtonBorder',
- 'BasicBorders.SplitPaneBorder',
- 'BasicBorders.ToggleButtonBorder',
- 'BasicButtonListener', 'BasicButtonUI',
- 'BasicCheckBoxMenuItemUI', 'BasicCheckBoxUI',
- 'BasicColorChooserUI', 'BasicComboBoxEditor',
- 'BasicComboBoxEditor.UIResource',
- 'BasicComboBoxRenderer',
- 'BasicComboBoxRenderer.UIResource',
- 'BasicComboBoxUI', 'BasicComboPopup',
- 'BasicDesktopIconUI', 'BasicDesktopPaneUI',
- 'BasicDirectoryModel', 'BasicEditorPaneUI',
- 'BasicFileChooserUI', 'BasicGraphicsUtils',
- 'BasicHTML', 'BasicIconFactory',
- 'BasicInternalFrameTitlePane',
- 'BasicInternalFrameUI', 'BasicLabelUI',
- 'BasicListUI', 'BasicLookAndFeel', 'BasicMenuBarUI',
- 'BasicMenuItemUI', 'BasicMenuUI',
- 'BasicOptionPaneUI',
- 'BasicOptionPaneUI.ButtonAreaLayout', 'BasicPanelUI',
- 'BasicPasswordFieldUI', 'BasicPermission',
- 'BasicPopupMenuSeparatorUI', 'BasicPopupMenuUI',
- 'BasicProgressBarUI', 'BasicRadioButtonMenuItemUI',
- 'BasicRadioButtonUI', 'BasicRootPaneUI',
- 'BasicScrollBarUI', 'BasicScrollPaneUI',
- 'BasicSeparatorUI', 'BasicSliderUI',
- 'BasicSplitPaneDivider', 'BasicSplitPaneUI',
- 'BasicStroke', 'BasicTabbedPaneUI',
- 'BasicTableHeaderUI', 'BasicTableUI',
- 'BasicTextAreaUI', 'BasicTextFieldUI',
- 'BasicTextPaneUI', 'BasicTextUI',
- 'BasicTextUI.BasicCaret',
- 'BasicTextUI.BasicHighlighter',
- 'BasicToggleButtonUI', 'BasicToolBarSeparatorUI',
- 'BasicToolBarUI', 'BasicToolTipUI', 'BasicTreeUI',
- 'BasicViewportUI', 'BatchUpdateException',
- 'BeanContext', 'BeanContextChild',
- 'BeanContextChildComponentProxy',
- 'BeanContextChildSupport',
- 'BeanContextContainerProxy', 'BeanContextEvent',
- 'BeanContextMembershipEvent',
- 'BeanContextMembershipListener', 'BeanContextProxy',
- 'BeanContextServiceAvailableEvent',
- 'BeanContextServiceProvider',
- 'BeanContextServiceProviderBeanInfo',
- 'BeanContextServiceRevokedEvent',
- 'BeanContextServiceRevokedListener',
- 'BeanContextServices', 'BeanContextServicesListener',
- 'BeanContextServicesSupport',
- 'BeanContextServicesSupport.BCSSServiceProvider',
- 'BeanContextSupport',
- 'BeanContextSupport.BCSIterator', 'BeanDescriptor',
- 'BeanInfo', 'Beans', 'BevelBorder', 'BigDecimal',
- 'BigInteger', 'BinaryRefAddr', 'BindException',
- 'Binding', 'BindingHelper', 'BindingHolder',
- 'BindingIterator', 'BindingIteratorHelper',
- 'BindingIteratorHolder', 'BindingIteratorOperations',
- 'BindingListHelper', 'BindingListHolder',
- 'BindingType', 'BindingTypeHelper',
- 'BindingTypeHolder', 'BitSet', 'Blob', 'BlockView',
- 'Book', 'Boolean', 'BooleanControl',
- 'BooleanControl.Type', 'BooleanHolder',
- 'BooleanSeqHelper', 'BooleanSeqHolder', 'Border',
- 'BorderFactory', 'BorderLayout', 'BorderUIResource',
- 'BorderUIResource.BevelBorderUIResource',
- 'BorderUIResource.CompoundBorderUIResource',
- 'BorderUIResource.EmptyBorderUIResource',
- 'BorderUIResource.EtchedBorderUIResource',
- 'BorderUIResource.LineBorderUIResource',
- 'BorderUIResource.MatteBorderUIResource',
- 'BorderUIResource.TitledBorderUIResource',
- 'BoundedRangeModel', 'Bounds', 'Box', 'Box.Filler',
- 'BoxedValueHelper', 'BoxLayout', 'BoxView',
- 'BreakIterator', 'BufferedImage',
- 'BufferedImageFilter', 'BufferedImageOp',
- 'BufferedInputStream', 'BufferedOutputStream',
- 'BufferedReader', 'BufferedWriter', 'Button',
- 'ButtonGroup', 'ButtonModel', 'ButtonUI', 'Byte',
- 'ByteArrayInputStream', 'ByteArrayOutputStream',
- 'ByteHolder', 'ByteLookupTable', 'Calendar',
- 'CallableStatement', 'CannotProceed',
- 'CannotProceedException', 'CannotProceedHelper',
- 'CannotProceedHolder', 'CannotRedoException',
- 'CannotUndoException', 'Canvas', 'CardLayout',
- 'Caret', 'CaretEvent', 'CaretListener', 'CellEditor',
- 'CellEditorListener', 'CellRendererPane',
- 'Certificate', 'Certificate.CertificateRep',
- 'CertificateEncodingException',
- 'CertificateException',
- 'CertificateExpiredException', 'CertificateFactory',
- 'CertificateFactorySpi',
- 'CertificateNotYetValidException',
- 'CertificateParsingException',
- 'ChangedCharSetException', 'ChangeEvent',
- 'ChangeListener', 'Character', 'Character.Subset',
- 'Character.UnicodeBlock', 'CharacterIterator',
- 'CharArrayReader', 'CharArrayWriter',
- 'CharConversionException', 'CharHolder',
- 'CharSeqHelper', 'CharSeqHolder', 'Checkbox',
- 'CheckboxGroup', 'CheckboxMenuItem',
- 'CheckedInputStream', 'CheckedOutputStream',
- 'Checksum', 'Choice', 'ChoiceFormat', 'Class',
- 'ClassCastException', 'ClassCircularityError',
- 'ClassDesc', 'ClassFormatError', 'ClassLoader',
- 'ClassNotFoundException', 'Clip', 'Clipboard',
- 'ClipboardOwner', 'Clob', 'Cloneable',
- 'CloneNotSupportedException', 'CMMException',
- 'CodeSource', 'CollationElementIterator',
- 'CollationKey', 'Collator', 'Collection',
- 'Collections', 'Color',
- 'ColorChooserComponentFactory', 'ColorChooserUI',
- 'ColorConvertOp', 'ColorModel',
- 'ColorSelectionModel', 'ColorSpace',
- 'ColorUIResource', 'ComboBoxEditor', 'ComboBoxModel',
- 'ComboBoxUI', 'ComboPopup', 'CommunicationException',
- 'COMM_FAILURE', 'Comparable', 'Comparator',
- 'Compiler', 'CompletionStatus',
- 'CompletionStatusHelper', 'Component',
- 'ComponentAdapter', 'ComponentColorModel',
- 'ComponentEvent', 'ComponentInputMap',
- 'ComponentInputMapUIResource', 'ComponentListener',
- 'ComponentOrientation', 'ComponentSampleModel',
- 'ComponentUI', 'ComponentView', 'Composite',
- 'CompositeContext', 'CompositeName', 'CompositeView',
- 'CompoundBorder', 'CompoundControl',
- 'CompoundControl.Type', 'CompoundEdit',
- 'CompoundName', 'ConcurrentModificationException',
- 'ConfigurationException', 'ConnectException',
- 'ConnectIOException', 'Connection', 'Constructor',
- 'Container', 'ContainerAdapter', 'ContainerEvent',
- 'ContainerListener', 'ContentHandler',
- 'ContentHandlerFactory', 'ContentModel', 'Context',
- 'ContextList', 'ContextNotEmptyException',
- 'ContextualRenderedImageFactory', 'Control',
- 'Control.Type', 'ControlFactory',
- 'ControllerEventListener', 'ConvolveOp', 'CRC32',
- 'CRL', 'CRLException', 'CropImageFilter', 'CSS',
- 'CSS.Attribute', 'CTX_RESTRICT_SCOPE',
- 'CubicCurve2D', 'CubicCurve2D.Double',
- 'CubicCurve2D.Float', 'Current', 'CurrentHelper',
- 'CurrentHolder', 'CurrentOperations', 'Cursor',
- 'Customizer', 'CustomMarshal', 'CustomValue',
- 'DatabaseMetaData', 'DataBuffer', 'DataBufferByte',
- 'DataBufferInt', 'DataBufferShort',
- 'DataBufferUShort', 'DataFlavor',
- 'DataFormatException', 'DatagramPacket',
- 'DatagramSocket', 'DatagramSocketImpl',
- 'DatagramSocketImplFactory', 'DataInput',
- 'DataInputStream', 'DataLine', 'DataLine.Info',
- 'DataOutput', 'DataOutputStream', 'DataTruncation',
- 'DATA_CONVERSION', 'Date', 'DateFormat',
- 'DateFormatSymbols', 'DebugGraphics',
- 'DecimalFormat', 'DecimalFormatSymbols',
- 'DefaultBoundedRangeModel', 'DefaultButtonModel',
- 'DefaultCaret', 'DefaultCellEditor',
- 'DefaultColorSelectionModel', 'DefaultComboBoxModel',
- 'DefaultDesktopManager', 'DefaultEditorKit',
- 'DefaultEditorKit.BeepAction',
- 'DefaultEditorKit.CopyAction',
- 'DefaultEditorKit.CutAction',
- 'DefaultEditorKit.DefaultKeyTypedAction',
- 'DefaultEditorKit.InsertBreakAction',
- 'DefaultEditorKit.InsertContentAction',
- 'DefaultEditorKit.InsertTabAction',
- 'DefaultEditorKit.PasteAction,',
- 'DefaultFocusManager', 'DefaultHighlighter',
- 'DefaultHighlighter.DefaultHighlightPainter',
- 'DefaultListCellRenderer',
- 'DefaultListCellRenderer.UIResource',
- 'DefaultListModel', 'DefaultListSelectionModel',
- 'DefaultMenuLayout', 'DefaultMetalTheme',
- 'DefaultMutableTreeNode',
- 'DefaultSingleSelectionModel',
- 'DefaultStyledDocument',
- 'DefaultStyledDocument.AttributeUndoableEdit',
- 'DefaultStyledDocument.ElementSpec',
- 'DefaultTableCellRenderer',
- 'DefaultTableCellRenderer.UIResource',
- 'DefaultTableColumnModel', 'DefaultTableModel',
- 'DefaultTextUI', 'DefaultTreeCellEditor',
- 'DefaultTreeCellRenderer', 'DefaultTreeModel',
- 'DefaultTreeSelectionModel', 'DefinitionKind',
- 'DefinitionKindHelper', 'Deflater',
- 'DeflaterOutputStream', 'Delegate', 'DesignMode',
- 'DesktopIconUI', 'DesktopManager', 'DesktopPaneUI',
- 'DGC', 'Dialog', 'Dictionary', 'DigestException',
- 'DigestInputStream', 'DigestOutputStream',
- 'Dimension', 'Dimension2D', 'DimensionUIResource',
- 'DirContext', 'DirectColorModel', 'DirectoryManager',
- 'DirObjectFactory', 'DirStateFactory',
- 'DirStateFactory.Result', 'DnDConstants', 'Document',
- 'DocumentEvent', 'DocumentEvent.ElementChange',
- 'DocumentEvent.EventType', 'DocumentListener',
- 'DocumentParser', 'DomainCombiner', 'DomainManager',
- 'DomainManagerOperations', 'Double', 'DoubleHolder',
- 'DoubleSeqHelper', 'DoubleSeqHolder',
- 'DragGestureEvent', 'DragGestureListener',
- 'DragGestureRecognizer', 'DragSource',
- 'DragSourceContext', 'DragSourceDragEvent',
- 'DragSourceDropEvent', 'DragSourceEvent',
- 'DragSourceListener', 'Driver', 'DriverManager',
- 'DriverPropertyInfo', 'DropTarget',
- 'DropTarget.DropTargetAutoScroller',
- 'DropTargetContext', 'DropTargetDragEvent',
- 'DropTargetDropEvent', 'DropTargetEvent',
- 'DropTargetListener', 'DSAKey',
- 'DSAKeyPairGenerator', 'DSAParameterSpec',
- 'DSAParams', 'DSAPrivateKey', 'DSAPrivateKeySpec',
- 'DSAPublicKey', 'DSAPublicKeySpec', 'DTD',
- 'DTDConstants', 'DynamicImplementation', 'DynAny',
- 'DynArray', 'DynEnum', 'DynFixed', 'DynSequence',
- 'DynStruct', 'DynUnion', 'DynValue', 'EditorKit',
- 'Element', 'ElementIterator', 'Ellipse2D',
- 'Ellipse2D.Double', 'Ellipse2D.Float', 'EmptyBorder',
- 'EmptyStackException', 'EncodedKeySpec', 'Entity',
- 'EnumControl', 'EnumControl.Type', 'Enumeration',
- 'Environment', 'EOFException', 'Error',
- 'EtchedBorder', 'Event', 'EventContext',
- 'EventDirContext', 'EventListener',
- 'EventListenerList', 'EventObject', 'EventQueue',
- 'EventSetDescriptor', 'Exception',
- 'ExceptionInInitializerError', 'ExceptionList',
- 'ExpandVetoException', 'ExportException',
- 'ExtendedRequest', 'ExtendedResponse',
- 'Externalizable', 'FeatureDescriptor', 'Field',
- 'FieldNameHelper', 'FieldPosition', 'FieldView',
- 'File', 'FileChooserUI', 'FileDescriptor',
- 'FileDialog', 'FileFilter', 'FileInputStream',
- 'FilenameFilter', 'FileNameMap',
- 'FileNotFoundException', 'FileOutputStream',
- 'FilePermission', 'FileReader', 'FileSystemView',
- 'FileView', 'FileWriter', 'FilteredImageSource',
- 'FilterInputStream', 'FilterOutputStream',
- 'FilterReader', 'FilterWriter',
- 'FixedHeightLayoutCache', 'FixedHolder',
- 'FlatteningPathIterator', 'FlavorMap', 'Float',
- 'FloatControl', 'FloatControl.Type', 'FloatHolder',
- 'FloatSeqHelper', 'FloatSeqHolder', 'FlowLayout',
- 'FlowView', 'FlowView.FlowStrategy', 'FocusAdapter',
- 'FocusEvent', 'FocusListener', 'FocusManager',
- 'Font', 'FontFormatException', 'FontMetrics',
- 'FontRenderContext', 'FontUIResource', 'Format',
- 'FormatConversionProvider', 'FormView', 'Frame',
- 'FREE_MEM', 'GapContent', 'GeneralPath',
- 'GeneralSecurityException', 'GlyphJustificationInfo',
- 'GlyphMetrics', 'GlyphVector', 'GlyphView',
- 'GlyphView.GlyphPainter', 'GradientPaint',
- 'GraphicAttribute', 'Graphics', 'Graphics2D',
- 'GraphicsConfigTemplate', 'GraphicsConfiguration',
- 'GraphicsDevice', 'GraphicsEnvironment',
- 'GrayFilter', 'GregorianCalendar',
- 'GridBagConstraints', 'GridBagLayout', 'GridLayout',
- 'Group', 'Guard', 'GuardedObject', 'GZIPInputStream',
- 'GZIPOutputStream', 'HasControls', 'HashMap',
- 'HashSet', 'Hashtable', 'HierarchyBoundsAdapter',
- 'HierarchyBoundsListener', 'HierarchyEvent',
- 'HierarchyListener', 'Highlighter',
- 'Highlighter.Highlight',
- 'Highlighter.HighlightPainter', 'HTML',
- 'HTML.Attribute', 'HTML.Tag', 'HTML.UnknownTag',
- 'HTMLDocument', 'HTMLDocument.Iterator',
- 'HTMLEditorKit', 'HTMLEditorKit.HTMLFactory',
- 'HTMLEditorKit.HTMLTextAction',
- 'HTMLEditorKit.InsertHTMLTextAction',
- 'HTMLEditorKit.LinkController',
- 'HTMLEditorKit.Parser',
- 'HTMLEditorKit.ParserCallback',
- 'HTMLFrameHyperlinkEvent', 'HTMLWriter',
- 'HttpURLConnection', 'HyperlinkEvent',
- 'HyperlinkEvent.EventType', 'HyperlinkListener',
- 'ICC_ColorSpace', 'ICC_Profile', 'ICC_ProfileGray',
- 'ICC_ProfileRGB', 'Icon', 'IconUIResource',
- 'IconView', 'IdentifierHelper', 'Identity',
- 'IdentityScope', 'IDLEntity', 'IDLType',
- 'IDLTypeHelper', 'IDLTypeOperations',
- 'IllegalAccessError', 'IllegalAccessException',
- 'IllegalArgumentException',
- 'IllegalComponentStateException',
- 'IllegalMonitorStateException',
- 'IllegalPathStateException', 'IllegalStateException',
- 'IllegalThreadStateException', 'Image',
- 'ImageConsumer', 'ImageFilter',
- 'ImageGraphicAttribute', 'ImageIcon',
- 'ImageObserver', 'ImageProducer',
- 'ImagingOpException', 'IMP_LIMIT',
- 'IncompatibleClassChangeError',
- 'InconsistentTypeCode', 'IndexColorModel',
- 'IndexedPropertyDescriptor',
- 'IndexOutOfBoundsException', 'IndirectionException',
- 'InetAddress', 'Inflater', 'InflaterInputStream',
- 'InheritableThreadLocal', 'InitialContext',
- 'InitialContextFactory',
- 'InitialContextFactoryBuilder', 'InitialDirContext',
- 'INITIALIZE', 'Initializer', 'InitialLdapContext',
- 'InlineView', 'InputContext', 'InputEvent',
- 'InputMap', 'InputMapUIResource', 'InputMethod',
- 'InputMethodContext', 'InputMethodDescriptor',
- 'InputMethodEvent', 'InputMethodHighlight',
- 'InputMethodListener', 'InputMethodRequests',
- 'InputStream', 'InputStreamReader', 'InputSubset',
- 'InputVerifier', 'Insets', 'InsetsUIResource',
- 'InstantiationError', 'InstantiationException',
- 'Instrument', 'InsufficientResourcesException',
- 'Integer', 'INTERNAL', 'InternalError',
- 'InternalFrameAdapter', 'InternalFrameEvent',
- 'InternalFrameListener', 'InternalFrameUI',
- 'InterruptedException', 'InterruptedIOException',
- 'InterruptedNamingException', 'INTF_REPOS',
- 'IntHolder', 'IntrospectionException',
- 'Introspector', 'Invalid',
- 'InvalidAlgorithmParameterException',
- 'InvalidAttributeIdentifierException',
- 'InvalidAttributesException',
- 'InvalidAttributeValueException',
- 'InvalidClassException',
- 'InvalidDnDOperationException',
- 'InvalidKeyException', 'InvalidKeySpecException',
- 'InvalidMidiDataException', 'InvalidName',
- 'InvalidNameException', 'InvalidNameHelper',
- 'InvalidNameHolder', 'InvalidObjectException',
- 'InvalidParameterException',
- 'InvalidParameterSpecException',
- 'InvalidSearchControlsException',
- 'InvalidSearchFilterException', 'InvalidSeq',
- 'InvalidTransactionException', 'InvalidValue',
- 'INVALID_TRANSACTION', 'InvocationEvent',
- 'InvocationHandler', 'InvocationTargetException',
- 'InvokeHandler', 'INV_FLAG', 'INV_IDENT',
- 'INV_OBJREF', 'INV_POLICY', 'IOException',
- 'IRObject', 'IRObjectOperations', 'IstringHelper',
- 'ItemEvent', 'ItemListener', 'ItemSelectable',
- 'Iterator', 'JApplet', 'JarEntry', 'JarException',
- 'JarFile', 'JarInputStream', 'JarOutputStream',
- 'JarURLConnection', 'JButton', 'JCheckBox',
- 'JCheckBoxMenuItem', 'JColorChooser', 'JComboBox',
- 'JComboBox.KeySelectionManager', 'JComponent',
- 'JDesktopPane', 'JDialog', 'JEditorPane',
- 'JFileChooser', 'JFrame', 'JInternalFrame',
- 'JInternalFrame.JDesktopIcon', 'JLabel',
- 'JLayeredPane', 'JList', 'JMenu', 'JMenuBar',
- 'JMenuItem', 'JobAttributes',
- 'JobAttributes.DefaultSelectionType',
- 'JobAttributes.DestinationType',
- 'JobAttributes.DialogType',
- 'JobAttributes.MultipleDocumentHandlingType',
- 'JobAttributes.SidesType', 'JOptionPane', 'JPanel',
- 'JPasswordField', 'JPopupMenu',
- 'JPopupMenu.Separator', 'JProgressBar',
- 'JRadioButton', 'JRadioButtonMenuItem', 'JRootPane',
- 'JScrollBar', 'JScrollPane', 'JSeparator', 'JSlider',
- 'JSplitPane', 'JTabbedPane', 'JTable',
- 'JTableHeader', 'JTextArea', 'JTextComponent',
- 'JTextComponent.KeyBinding', 'JTextField',
- 'JTextPane', 'JToggleButton',
- 'JToggleButton.ToggleButtonModel', 'JToolBar',
- 'JToolBar.Separator', 'JToolTip', 'JTree',
- 'JTree.DynamicUtilTreeNode',
- 'JTree.EmptySelectionModel', 'JViewport', 'JWindow',
- 'Kernel', 'Key', 'KeyAdapter', 'KeyEvent',
- 'KeyException', 'KeyFactory', 'KeyFactorySpi',
- 'KeyListener', 'KeyManagementException', 'Keymap',
- 'KeyPair', 'KeyPairGenerator', 'KeyPairGeneratorSpi',
- 'KeySpec', 'KeyStore', 'KeyStoreException',
- 'KeyStoreSpi', 'KeyStroke', 'Label', 'LabelUI',
- 'LabelView', 'LastOwnerException',
- 'LayeredHighlighter',
- 'LayeredHighlighter.LayerPainter', 'LayoutManager',
- 'LayoutManager2', 'LayoutQueue', 'LdapContext',
- 'LdapReferralException', 'Lease',
- 'LimitExceededException', 'Line', 'Line.Info',
- 'Line2D', 'Line2D.Double', 'Line2D.Float',
- 'LineBorder', 'LineBreakMeasurer', 'LineEvent',
- 'LineEvent.Type', 'LineListener', 'LineMetrics',
- 'LineNumberInputStream', 'LineNumberReader',
- 'LineUnavailableException', 'LinkageError',
- 'LinkedList', 'LinkException', 'LinkLoopException',
- 'LinkRef', 'List', 'ListCellRenderer',
- 'ListDataEvent', 'ListDataListener', 'ListIterator',
- 'ListModel', 'ListResourceBundle',
- 'ListSelectionEvent', 'ListSelectionListener',
- 'ListSelectionModel', 'ListUI', 'ListView',
- 'LoaderHandler', 'Locale', 'LocateRegistry',
- 'LogStream', 'Long', 'LongHolder',
- 'LongLongSeqHelper', 'LongLongSeqHolder',
- 'LongSeqHelper', 'LongSeqHolder', 'LookAndFeel',
- 'LookupOp', 'LookupTable', 'MalformedLinkException',
- 'MalformedURLException', 'Manifest', 'Map',
- 'Map.Entry', 'MARSHAL', 'MarshalException',
- 'MarshalledObject', 'Math', 'MatteBorder',
- 'MediaTracker', 'Member', 'MemoryImageSource',
- 'Menu', 'MenuBar', 'MenuBarUI', 'MenuComponent',
- 'MenuContainer', 'MenuDragMouseEvent',
- 'MenuDragMouseListener', 'MenuElement', 'MenuEvent',
- 'MenuItem', 'MenuItemUI', 'MenuKeyEvent',
- 'MenuKeyListener', 'MenuListener',
- 'MenuSelectionManager', 'MenuShortcut',
- 'MessageDigest', 'MessageDigestSpi', 'MessageFormat',
- 'MetaEventListener', 'MetalBorders',
- 'MetalBorders.ButtonBorder',
- 'MetalBorders.Flush3DBorder',
- 'MetalBorders.InternalFrameBorder',
- 'MetalBorders.MenuBarBorder',
- 'MetalBorders.MenuItemBorder',
- 'MetalBorders.OptionDialogBorder',
- 'MetalBorders.PaletteBorder',
- 'MetalBorders.PopupMenuBorder',
- 'MetalBorders.RolloverButtonBorder',
- 'MetalBorders.ScrollPaneBorder',
- 'MetalBorders.TableHeaderBorder',
- 'MetalBorders.TextFieldBorder',
- 'MetalBorders.ToggleButtonBorder',
- 'MetalBorders.ToolBarBorder', 'MetalButtonUI',
- 'MetalCheckBoxIcon', 'MetalCheckBoxUI',
- 'MetalComboBoxButton', 'MetalComboBoxEditor',
- 'MetalComboBoxEditor.UIResource',
- 'MetalComboBoxIcon', 'MetalComboBoxUI',
- 'MetalDesktopIconUI', 'MetalFileChooserUI',
- 'MetalIconFactory', 'MetalIconFactory.FileIcon16',
- 'MetalIconFactory.FolderIcon16',
- 'MetalIconFactory.PaletteCloseIcon',
- 'MetalIconFactory.TreeControlIcon',
- 'MetalIconFactory.TreeFolderIcon',
- 'MetalIconFactory.TreeLeafIcon',
- 'MetalInternalFrameTitlePane',
- 'MetalInternalFrameUI', 'MetalLabelUI',
- 'MetalLookAndFeel', 'MetalPopupMenuSeparatorUI',
- 'MetalProgressBarUI', 'MetalRadioButtonUI',
- 'MetalScrollBarUI', 'MetalScrollButton',
- 'MetalScrollPaneUI', 'MetalSeparatorUI',
- 'MetalSliderUI', 'MetalSplitPaneUI',
- 'MetalTabbedPaneUI', 'MetalTextFieldUI',
- 'MetalTheme', 'MetalToggleButtonUI',
- 'MetalToolBarUI', 'MetalToolTipUI', 'MetalTreeUI',
- 'MetaMessage', 'Method', 'MethodDescriptor',
- 'MidiChannel', 'MidiDevice', 'MidiDevice.Info',
- 'MidiDeviceProvider', 'MidiEvent', 'MidiFileFormat',
- 'MidiFileReader', 'MidiFileWriter', 'MidiMessage',
- 'MidiSystem', 'MidiUnavailableException',
- 'MimeTypeParseException', 'MinimalHTMLWriter',
- 'MissingResourceException', 'Mixer', 'Mixer.Info',
- 'MixerProvider', 'ModificationItem', 'Modifier',
- 'MouseAdapter', 'MouseDragGestureRecognizer',
- 'MouseEvent', 'MouseInputAdapter',
- 'MouseInputListener', 'MouseListener',
- 'MouseMotionAdapter', 'MouseMotionListener',
- 'MultiButtonUI', 'MulticastSocket',
- 'MultiColorChooserUI', 'MultiComboBoxUI',
- 'MultiDesktopIconUI', 'MultiDesktopPaneUI',
- 'MultiFileChooserUI', 'MultiInternalFrameUI',
- 'MultiLabelUI', 'MultiListUI', 'MultiLookAndFeel',
- 'MultiMenuBarUI', 'MultiMenuItemUI',
- 'MultiOptionPaneUI', 'MultiPanelUI',
- 'MultiPixelPackedSampleModel', 'MultipleMaster',
- 'MultiPopupMenuUI', 'MultiProgressBarUI',
- 'MultiScrollBarUI', 'MultiScrollPaneUI',
- 'MultiSeparatorUI', 'MultiSliderUI',
- 'MultiSplitPaneUI', 'MultiTabbedPaneUI',
- 'MultiTableHeaderUI', 'MultiTableUI', 'MultiTextUI',
- 'MultiToolBarUI', 'MultiToolTipUI', 'MultiTreeUI',
- 'MultiViewportUI', 'MutableAttributeSet',
- 'MutableComboBoxModel', 'MutableTreeNode', 'Name',
- 'NameAlreadyBoundException', 'NameClassPair',
- 'NameComponent', 'NameComponentHelper',
- 'NameComponentHolder', 'NamedValue', 'NameHelper',
- 'NameHolder', 'NameNotFoundException', 'NameParser',
- 'NamespaceChangeListener', 'NameValuePair',
- 'NameValuePairHelper', 'Naming', 'NamingContext',
- 'NamingContextHelper', 'NamingContextHolder',
- 'NamingContextOperations', 'NamingEnumeration',
- 'NamingEvent', 'NamingException',
- 'NamingExceptionEvent', 'NamingListener',
- 'NamingManager', 'NamingSecurityException',
- 'NegativeArraySizeException', 'NetPermission',
- 'NoClassDefFoundError', 'NoInitialContextException',
- 'NoninvertibleTransformException',
- 'NoPermissionException', 'NoRouteToHostException',
- 'NoSuchAlgorithmException',
- 'NoSuchAttributeException', 'NoSuchElementException',
- 'NoSuchFieldError', 'NoSuchFieldException',
- 'NoSuchMethodError', 'NoSuchMethodException',
- 'NoSuchObjectException', 'NoSuchProviderException',
- 'NotActiveException', 'NotBoundException',
- 'NotContextException', 'NotEmpty', 'NotEmptyHelper',
- 'NotEmptyHolder', 'NotFound', 'NotFoundHelper',
- 'NotFoundHolder', 'NotFoundReason',
- 'NotFoundReasonHelper', 'NotFoundReasonHolder',
- 'NotOwnerException', 'NotSerializableException',
- 'NO_IMPLEMENT', 'NO_MEMORY', 'NO_PERMISSION',
- 'NO_RESOURCES', 'NO_RESPONSE',
- 'NullPointerException', 'Number', 'NumberFormat',
- 'NumberFormatException', 'NVList', 'Object',
- 'ObjectChangeListener', 'ObjectFactory',
- 'ObjectFactoryBuilder', 'ObjectHelper',
- 'ObjectHolder', 'ObjectImpl', 'ObjectInput',
- 'ObjectInputStream', 'ObjectInputStream.GetField',
- 'ObjectInputValidation', 'ObjectOutput',
- 'ObjectOutputStream', 'ObjectOutputStream.PutField',
- 'ObjectStreamClass', 'ObjectStreamConstants',
- 'ObjectStreamException', 'ObjectStreamField',
- 'ObjectView', 'OBJECT_NOT_EXIST', 'ObjID',
- 'OBJ_ADAPTER', 'Observable', 'Observer',
- 'OctetSeqHelper', 'OctetSeqHolder', 'OMGVMCID',
- 'OpenType', 'Operation',
- 'OperationNotSupportedException', 'Option',
- 'OptionalDataException', 'OptionPaneUI', 'ORB',
- 'OutOfMemoryError', 'OutputStream',
- 'OutputStreamWriter', 'OverlayLayout', 'Owner',
- 'Package', 'PackedColorModel', 'Pageable',
- 'PageAttributes', 'PageAttributes.ColorType',
- 'PageAttributes.MediaType',
- 'PageAttributes.OrientationRequestedType',
- 'PageAttributes.OriginType',
- 'PageAttributes.PrintQualityType', 'PageFormat',
- 'Paint', 'PaintContext', 'PaintEvent', 'Panel',
- 'PanelUI', 'Paper', 'ParagraphView',
- 'ParameterBlock', 'ParameterDescriptor',
- 'ParseException', 'ParsePosition', 'Parser',
- 'ParserDelegator', 'PartialResultException',
- 'PasswordAuthentication', 'PasswordView', 'Patch',
- 'PathIterator', 'Permission', 'PermissionCollection',
- 'Permissions', 'PERSIST_STORE', 'PhantomReference',
- 'PipedInputStream', 'PipedOutputStream',
- 'PipedReader', 'PipedWriter', 'PixelGrabber',
- 'PixelInterleavedSampleModel', 'PKCS8EncodedKeySpec',
- 'PlainDocument', 'PlainView', 'Point', 'Point2D',
- 'Point2D.Double', 'Point2D.Float', 'Policy',
- 'PolicyError', 'PolicyHelper', 'PolicyHolder',
- 'PolicyListHelper', 'PolicyListHolder',
- 'PolicyOperations', 'PolicyTypeHelper', 'Polygon',
- 'PopupMenu', 'PopupMenuEvent', 'PopupMenuListener',
- 'PopupMenuUI', 'Port', 'Port.Info',
- 'PortableRemoteObject',
- 'PortableRemoteObjectDelegate', 'Position',
- 'Position.Bias', 'PreparedStatement', 'Principal',
- 'PrincipalHolder', 'Printable',
- 'PrinterAbortException', 'PrinterException',
- 'PrinterGraphics', 'PrinterIOException',
- 'PrinterJob', 'PrintGraphics', 'PrintJob',
- 'PrintStream', 'PrintWriter', 'PrivateKey',
- 'PRIVATE_MEMBER', 'PrivilegedAction',
- 'PrivilegedActionException',
- 'PrivilegedExceptionAction', 'Process',
- 'ProfileDataException', 'ProgressBarUI',
- 'ProgressMonitor', 'ProgressMonitorInputStream',
- 'Properties', 'PropertyChangeEvent',
- 'PropertyChangeListener', 'PropertyChangeSupport',
- 'PropertyDescriptor', 'PropertyEditor',
- 'PropertyEditorManager', 'PropertyEditorSupport',
- 'PropertyPermission', 'PropertyResourceBundle',
- 'PropertyVetoException', 'ProtectionDomain',
- 'ProtocolException', 'Provider', 'ProviderException',
- 'Proxy', 'PublicKey', 'PUBLIC_MEMBER',
- 'PushbackInputStream', 'PushbackReader',
- 'QuadCurve2D', 'QuadCurve2D.Double',
- 'QuadCurve2D.Float', 'Random', 'RandomAccessFile',
- 'Raster', 'RasterFormatException', 'RasterOp',
- 'Reader', 'Receiver', 'Rectangle', 'Rectangle2D',
- 'Rectangle2D.Double', 'Rectangle2D.Float',
- 'RectangularShape', 'Ref', 'RefAddr', 'Reference',
- 'Referenceable', 'ReferenceQueue',
- 'ReferralException', 'ReflectPermission', 'Registry',
- 'RegistryHandler', 'RemarshalException', 'Remote',
- 'RemoteCall', 'RemoteException', 'RemoteObject',
- 'RemoteRef', 'RemoteServer', 'RemoteStub',
- 'RenderableImage', 'RenderableImageOp',
- 'RenderableImageProducer', 'RenderContext',
- 'RenderedImage', 'RenderedImageFactory', 'Renderer',
- 'RenderingHints', 'RenderingHints.Key',
- 'RepaintManager', 'ReplicateScaleFilter',
- 'Repository', 'RepositoryIdHelper', 'Request',
- 'RescaleOp', 'Resolver', 'ResolveResult',
- 'ResourceBundle', 'ResponseHandler', 'ResultSet',
- 'ResultSetMetaData', 'ReverbType', 'RGBImageFilter',
- 'RMIClassLoader', 'RMIClientSocketFactory',
- 'RMIFailureHandler', 'RMISecurityException',
- 'RMISecurityManager', 'RMIServerSocketFactory',
- 'RMISocketFactory', 'Robot', 'RootPaneContainer',
- 'RootPaneUI', 'RoundRectangle2D',
- 'RoundRectangle2D.Double', 'RoundRectangle2D.Float',
- 'RowMapper', 'RSAKey', 'RSAKeyGenParameterSpec',
- 'RSAPrivateCrtKey', 'RSAPrivateCrtKeySpec',
- 'RSAPrivateKey', 'RSAPrivateKeySpec', 'RSAPublicKey',
- 'RSAPublicKeySpec', 'RTFEditorKit',
- 'RuleBasedCollator', 'Runnable', 'Runtime',
- 'RunTime', 'RuntimeException', 'RunTimeOperations',
- 'RuntimePermission', 'SampleModel',
- 'SchemaViolationException', 'Scrollable',
- 'Scrollbar', 'ScrollBarUI', 'ScrollPane',
- 'ScrollPaneConstants', 'ScrollPaneLayout',
- 'ScrollPaneLayout.UIResource', 'ScrollPaneUI',
- 'SearchControls', 'SearchResult',
- 'SecureClassLoader', 'SecureRandom',
- 'SecureRandomSpi', 'Security', 'SecurityException',
- 'SecurityManager', 'SecurityPermission', 'Segment',
- 'SeparatorUI', 'Sequence', 'SequenceInputStream',
- 'Sequencer', 'Sequencer.SyncMode', 'Serializable',
- 'SerializablePermission', 'ServantObject',
- 'ServerCloneException', 'ServerError',
- 'ServerException', 'ServerNotActiveException',
- 'ServerRef', 'ServerRequest',
- 'ServerRuntimeException', 'ServerSocket',
- 'ServiceDetail', 'ServiceDetailHelper',
- 'ServiceInformation', 'ServiceInformationHelper',
- 'ServiceInformationHolder',
- 'ServiceUnavailableException', 'Set',
- 'SetOverrideType', 'SetOverrideTypeHelper', 'Shape',
- 'ShapeGraphicAttribute', 'Short', 'ShortHolder',
- 'ShortLookupTable', 'ShortMessage', 'ShortSeqHelper',
- 'ShortSeqHolder', 'Signature', 'SignatureException',
- 'SignatureSpi', 'SignedObject', 'Signer',
- 'SimpleAttributeSet', 'SimpleBeanInfo',
- 'SimpleDateFormat', 'SimpleTimeZone',
- 'SinglePixelPackedSampleModel',
- 'SingleSelectionModel', 'SizeLimitExceededException',
- 'SizeRequirements', 'SizeSequence', 'Skeleton',
- 'SkeletonMismatchException',
- 'SkeletonNotFoundException', 'SliderUI', 'Socket',
- 'SocketException', 'SocketImpl', 'SocketImplFactory',
- 'SocketOptions', 'SocketPermission',
- 'SocketSecurityException', 'SoftBevelBorder',
- 'SoftReference', 'SortedMap', 'SortedSet',
- 'Soundbank', 'SoundbankReader', 'SoundbankResource',
- 'SourceDataLine', 'SplitPaneUI', 'SQLData',
- 'SQLException', 'SQLInput', 'SQLOutput',
- 'SQLPermission', 'SQLWarning', 'Stack',
- 'StackOverflowError', 'StateEdit', 'StateEditable',
- 'StateFactory', 'Statement', 'Streamable',
- 'StreamableValue', 'StreamCorruptedException',
- 'StreamTokenizer', 'StrictMath', 'String',
- 'StringBuffer', 'StringBufferInputStream',
- 'StringCharacterIterator', 'StringContent',
- 'StringHolder', 'StringIndexOutOfBoundsException',
- 'StringReader', 'StringRefAddr', 'StringSelection',
- 'StringTokenizer', 'StringValueHelper',
- 'StringWriter', 'Stroke', 'Struct', 'StructMember',
- 'StructMemberHelper', 'Stub', 'StubDelegate',
- 'StubNotFoundException', 'Style', 'StyleConstants',
- 'StyleConstants.CharacterConstants',
- 'StyleConstants.ColorConstants',
- 'StyleConstants.FontConstants',
- 'StyleConstants.ParagraphConstants', 'StyleContext',
- 'StyledDocument', 'StyledEditorKit',
- 'StyledEditorKit.AlignmentAction',
- 'StyledEditorKit.BoldAction',
- 'StyledEditorKit.FontFamilyAction',
- 'StyledEditorKit.FontSizeAction',
- 'StyledEditorKit.ForegroundAction',
- 'StyledEditorKit.ItalicAction',
- 'StyledEditorKit.StyledTextAction',
- 'StyledEditorKit.UnderlineAction', 'StyleSheet',
- 'StyleSheet.BoxPainter', 'StyleSheet.ListPainter',
- 'SwingConstants', 'SwingPropertyChangeSupport',
- 'SwingUtilities', 'SyncFailedException',
- 'Synthesizer', 'SysexMessage', 'System',
- 'SystemColor', 'SystemException', 'SystemFlavorMap',
- 'TabableView', 'TabbedPaneUI', 'TabExpander',
- 'TableCellEditor', 'TableCellRenderer',
- 'TableColumn', 'TableColumnModel',
- 'TableColumnModelEvent', 'TableColumnModelListener',
- 'TableHeaderUI', 'TableModel', 'TableModelEvent',
- 'TableModelListener', 'TableUI', 'TableView',
- 'TabSet', 'TabStop', 'TagElement', 'TargetDataLine',
- 'TCKind', 'TextAction', 'TextArea', 'TextAttribute',
- 'TextComponent', 'TextEvent', 'TextField',
- 'TextHitInfo', 'TextLayout',
- 'TextLayout.CaretPolicy', 'TextListener',
- 'TextMeasurer', 'TextUI', 'TexturePaint', 'Thread',
- 'ThreadDeath', 'ThreadGroup', 'ThreadLocal',
- 'Throwable', 'Tie', 'TileObserver', 'Time',
- 'TimeLimitExceededException', 'Timer', 'TimerTask',
- 'Timestamp', 'TimeZone', 'TitledBorder', 'ToolBarUI',
- 'Toolkit', 'ToolTipManager', 'ToolTipUI',
- 'TooManyListenersException', 'Track',
- 'TransactionRequiredException',
- 'TransactionRolledbackException',
- 'TRANSACTION_REQUIRED', 'TRANSACTION_ROLLEDBACK',
- 'Transferable', 'TransformAttribute', 'TRANSIENT',
- 'Transmitter', 'Transparency', 'TreeCellEditor',
- 'TreeCellRenderer', 'TreeExpansionEvent',
- 'TreeExpansionListener', 'TreeMap', 'TreeModel',
- 'TreeModelEvent', 'TreeModelListener', 'TreeNode',
- 'TreePath', 'TreeSelectionEvent',
- 'TreeSelectionListener', 'TreeSelectionModel',
- 'TreeSet', 'TreeUI', 'TreeWillExpandListener',
- 'TypeCode', 'TypeCodeHolder', 'TypeMismatch',
- 'Types', 'UID', 'UIDefaults',
- 'UIDefaults.ActiveValue', 'UIDefaults.LazyInputMap',
- 'UIDefaults.LazyValue', 'UIDefaults.ProxyLazyValue',
- 'UIManager', 'UIManager.LookAndFeelInfo',
- 'UIResource', 'ULongLongSeqHelper',
- 'ULongLongSeqHolder', 'ULongSeqHelper',
- 'ULongSeqHolder', 'UndeclaredThrowableException',
- 'UndoableEdit', 'UndoableEditEvent',
- 'UndoableEditListener', 'UndoableEditSupport',
- 'UndoManager', 'UnexpectedException',
- 'UnicastRemoteObject', 'UnionMember',
- 'UnionMemberHelper', 'UNKNOWN', 'UnknownError',
- 'UnknownException', 'UnknownGroupException',
- 'UnknownHostException', 'UnknownObjectException',
- 'UnknownServiceException', 'UnknownUserException',
- 'UnmarshalException', 'UnrecoverableKeyException',
- 'Unreferenced', 'UnresolvedPermission',
- 'UnsatisfiedLinkError', 'UnsolicitedNotification',
- 'UnsolicitedNotificationEvent',
- 'UnsolicitedNotificationListener',
- 'UnsupportedAudioFileException',
- 'UnsupportedClassVersionError',
- 'UnsupportedEncodingException',
- 'UnsupportedFlavorException',
- 'UnsupportedLookAndFeelException',
- 'UnsupportedOperationException',
- 'UNSUPPORTED_POLICY', 'UNSUPPORTED_POLICY_VALUE',
- 'URL', 'URLClassLoader', 'URLConnection',
- 'URLDecoder', 'URLEncoder', 'URLStreamHandler',
- 'URLStreamHandlerFactory', 'UserException',
- 'UShortSeqHelper', 'UShortSeqHolder',
- 'UTFDataFormatException', 'Util', 'UtilDelegate',
- 'Utilities', 'ValueBase', 'ValueBaseHelper',
- 'ValueBaseHolder', 'ValueFactory', 'ValueHandler',
- 'ValueMember', 'ValueMemberHelper',
- 'VariableHeightLayoutCache', 'Vector', 'VerifyError',
- 'VersionSpecHelper', 'VetoableChangeListener',
- 'VetoableChangeSupport', 'View', 'ViewFactory',
- 'ViewportLayout', 'ViewportUI',
- 'VirtualMachineError', 'Visibility',
- 'VisibilityHelper', 'VMID', 'VM_ABSTRACT',
- 'VM_CUSTOM', 'VM_NONE', 'VM_TRUNCATABLE',
- 'VoiceStatus', 'Void', 'WCharSeqHelper',
- 'WCharSeqHolder', 'WeakHashMap', 'WeakReference',
- 'Window', 'WindowAdapter', 'WindowConstants',
- 'WindowEvent', 'WindowListener', 'WrappedPlainView',
- 'WritableRaster', 'WritableRenderedImage',
- 'WriteAbortedException', 'Writer',
- 'WrongTransaction', 'WStringValueHelper',
- 'X509Certificate', 'X509CRL', 'X509CRLEntry',
- 'X509EncodedKeySpec', 'X509Extension', 'ZipEntry',
- 'ZipException', 'ZipFile', 'ZipInputStream',
- 'ZipOutputStream', 'ZoneView',
- '_BindingIteratorImplBase', '_BindingIteratorStub',
- '_IDLTypeStub', '_NamingContextImplBase',
- '_NamingContextStub', '_PolicyStub', '_Remote_Stub'
- ),
- 4 => array(
- 'boolean', 'byte', 'char', 'double', 'float', 'int', 'long',
- 'short', 'void'
- ),
- 5 => array(
- 'allProperties', 'asImmutable', 'asSynchronized', 'collect',
- 'count', 'each', 'eachProperty', 'eachPropertyName',
- 'eachWithIndex', 'find', 'findAll', 'findIndexOf',
- 'flatten', 'get', 'grep', 'inject', 'intersect',
- 'join', 'max', 'min', 'pop', 'reverse',
- 'reverseEach', 'size', 'sort', 'subMap', 'toList'
- ),
- 6 => array(
- 'center', 'contains', 'eachMatch', 'padLeft', 'padRight',
- 'toCharacter', 'tokenize', 'toLong', 'toURL'
- ),
- 7 => array(
- 'append', 'eachByte', 'eachFile', 'eachFileRecurse', 'eachLine',
- 'eachLines', 'encodeBase64', 'filterLine', 'getText',
- 'splitEachLine', 'transformChar', 'transformLine',
- 'withOutputStream', 'withPrintWriter', 'withReader',
- 'withStream', 'withStreams', 'withWriter',
- 'withWriterAppend', 'write', 'writeLine'
- ),
- 8 => array(
- 'dump', 'getLastMatcher', 'inspect', 'invokeMethod', 'print',
- 'println', 'start', 'startDaemon', 'step', 'times',
- 'upto', 'use'
- ),
- 9 => array(
- 'call', 'close', 'eachRow', 'execute', 'executeUpdate', 'Sql'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?', '|', '=',
- '=>', '||', '-', '+', '<<', '<<<', '&&'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => true,
- 1 => false,
- 2 => false,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true,
- 9 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #aaaadd; font-weight: bold;',
- 4 => 'color: #993333;',
- 5 => 'color: #663399;',
- 6 => 'color: #CC0099;',
- 7 => 'color: #FFCC33;',
- 8 => 'color: #993399;',
- 9 => 'color: #993399; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1=> 'color: #808080; font-style: italic;',
- 2=> 'color: #a1a100;',
- 3=> 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;'
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAMEL}',
- 2 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAMEL}',
- 3 => 'http://www.google.de/search?as_q={FNAME}&amp;num=100&amp;hl=en&amp;as_occt=url&amp;as_sitesearch=java.sun.com%2Fj2se%2F1.5.0%2Fdocs%2Fapi%2F',
- 4 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAME}',
- 5 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAME}',
- 6 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAME}',
- 7 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAME}',
- 8 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAME}',
- 9 => 'http://www.google.de/search?q=site%3Adocs.codehaus.org/%20{FNAME}'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- //Variables
- 0 => '\\$\\{[a-zA-Z_][a-zA-Z0-9_]*\\}'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/haskell.php b/libvpx/examples/includes/geshi/geshi/haskell.php
deleted file mode 100644
index a6841dd..0000000
--- a/libvpx/examples/includes/geshi/geshi/haskell.php
+++ /dev/null
@@ -1,198 +0,0 @@
-<?php
-/*************************************************************************************
- * haskell.php
- * ----------
- * Author: Jason Dagit (dagit@codersbase.com) based on ocaml.php by Flaie (fireflaie@gmail.com)
- * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2005/08/27
- *
- * Haskell language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/08/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/08/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Haskell',
- 'COMMENT_SINGLE' => array( 1 => '--'),
- 'COMMENT_MULTI' => array('{-' => '-}'),
- 'COMMENT_REGEXP' => array(2 => "/-->/"),
- 'CASE_KEYWORDS' => 0,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => "\\",
- 'KEYWORDS' => array(
- /* main haskell keywords */
- 1 => array(
- 'as',
- 'case', 'of', 'class', 'data', 'default',
- 'deriving', 'do', 'forall', 'hiding', 'if', 'then',
- 'else', 'import', 'infix', 'infixl', 'infixr',
- 'instance', 'let', 'in', 'module', 'newtype',
- 'qualified', 'type', 'where'
- ),
- /* define names of main librarys, so we can link to it */
- 2 => array(
- 'Foreign', 'Numeric', 'Prelude'
- ),
- /* just link to Prelude functions, cause it's the default opened library when starting Haskell */
- 3 => array(
- 'not', 'otherwise', 'maybe',
- 'either', 'fst', 'snd', 'curry', 'uncurry',
- 'compare',
- 'max', 'min', 'succ', 'pred', 'toEnum', 'fromEnum',
- 'enumFrom', 'enumFromThen', 'enumFromTo',
- 'enumFromThenTo', 'minBound', 'maxBound',
- 'negate', 'abs', 'signum',
- 'fromInteger', 'toRational', 'quot', 'rem',
- 'div', 'mod', 'quotRem', 'divMod', 'toInteger',
- 'recip', 'fromRational', 'pi', 'exp',
- 'log', 'sqrt', 'logBase', 'sin', 'cos',
- 'tan', 'asin', 'acos', 'atan', 'sinh', 'cosh',
- 'tanh', 'asinh', 'acosh', 'atanh',
- 'properFraction', 'truncate', 'round', 'ceiling',
- 'floor', 'floatRadix', 'floatDigits', 'floatRange',
- 'decodeFloat', 'encodeFloat', 'exponent',
- 'significand', 'scaleFloat', 'isNaN', 'isInfinite',
- 'isDenomalized', 'isNegativeZero', 'isIEEE',
- 'atan2', 'subtract', 'even', 'odd', 'gcd',
- 'lcm', 'fromIntegral', 'realToFrac',
- 'return', 'fail', 'fmap',
- 'mapM', 'mapM_', 'sequence', 'sequence_',
- 'id', 'const','flip',
- 'until', 'asTypeOf', 'error', 'undefined',
- 'seq','map','filter', 'head',
- 'last', 'tail', 'init', 'null', 'length',
- 'reverse', 'foldl', 'foldl1', 'foldr',
- 'foldr1', 'and', 'or', 'any', 'all', 'sum',
- 'product', 'concat', 'concatMap', 'maximum',
- 'minimum', 'scanl', 'scanl1', 'scanr', 'scanr1',
- 'iterate', 'repeat', 'cycle', 'take', 'drop',
- 'splitAt', 'teakWhile', 'dropWhile', 'span',
- 'break', 'elem', 'notElem', 'lookup', 'zip',
- 'zip3', 'zipWith', 'zipWith3', 'unzip', 'unzip3',
- 'lines', 'words', 'unlines',
- 'unwords', 'showPrec', 'show', 'showList',
- 'shows', 'showChar', 'showString', 'showParen',
- 'readsPrec', 'readList', 'reads', 'readParen',
- 'read', 'lex', 'putChar', 'putStr', 'putStrLn',
- 'print', 'getChar', 'getLine', 'getContents',
- 'interact', 'readFile', 'writeFile', 'appendFile',
- 'readIO', 'readLn', 'ioError', 'userError', 'catch'
- ),
- /* here Prelude Types */
- 4 => array (
- 'Bool', 'Maybe', 'Either', 'Ord', 'Ordering',
- 'Char', 'String', 'Eq', 'Enum', 'Bounded',
- 'Int', 'Integer', 'Float', 'Double', 'Rational',
- 'Num', 'Real', 'Integral', 'Fractional',
- 'Floating', 'RealFrac', 'RealFloat', 'Monad',
- 'Functor', 'Show', 'ShowS', 'Read', 'ReadS',
- 'IO'
- ),
- /* finally Prelude Exceptions */
- 5 => array (
- 'IOError', 'IOException'
- )
- ),
- /* highlighting symbols is really important in Haskell */
- 'SYMBOLS' => array(
- '|', '->', '<-', '@', '!', '::', '_', '~', '=', '?',
- '&&', '||', '==', '/=', '<', '<=', '>',
- '>=','+', '-', '*','/', '%', '**', '^', '^^',
- '>>=', '>>', '=<<', '$', '.', ',', '$!',
- '++', '!!'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true, /* functions name are case seinsitive */
- 3 => true, /* types name too */
- 4 => true, /* finally exceptions too */
- 5 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #06c; font-weight: bold;', /* nice blue */
- 2 => 'color: #06c; font-weight: bold;', /* blue as well */
- 3 => 'font-weight: bold;', /* make the preduled functions bold */
- 4 => 'color: #cccc00; font-weight: bold;', /* give types a different bg */
- 5 => 'color: maroon;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #5d478b; font-style: italic;',
- 2 => 'color: #339933; font-weight: bold;',
- 'MULTI' => 'color: #5d478b; font-style: italic;' /* light purpHle */
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'background-color: #3cb371; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: green;'
- ),
- 'STRINGS' => array(
- 0 => 'background-color: #3cb371;' /* nice green */
- ),
- 'NUMBERS' => array(
- 0 => 'color: red;' /* pink */
- ),
- 'METHODS' => array(
- 1 => 'color: #060;' /* dark green */
- ),
- 'REGEXPS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933; font-weight: bold;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- /* some of keywords are Prelude functions */
- 1 => '',
- /* link to the wanted library */
- 2 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/{FNAME}.html',
- /* link to Prelude functions */
- 3 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:{FNAME}',
- /* link to Prelude types */
- 4 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}',
- /* link to Prelude exceptions */
- 5 => 'http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#t:{FNAME}',
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/hq9plus.php b/libvpx/examples/includes/geshi/geshi/hq9plus.php
deleted file mode 100644
index 89e0434..0000000
--- a/libvpx/examples/includes/geshi/geshi/hq9plus.php
+++ /dev/null
@@ -1,104 +0,0 @@
-<?php
-/*************************************************************************************
- * hq9plus.php
- * ----------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2009/10/31
- *
- * HQ9+ language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/31 (1.0.8.1)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'HQ9+',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- ),
- 'SYMBOLS' => array(
- 'H', 'Q', '9', '+', 'h', 'q'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- ),
- 'COMMENTS' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #a16000;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'KEYWORDS' => GESHI_NEVER,
- 'COMMENTS' => GESHI_NEVER,
- 'STRINGS' => GESHI_NEVER,
- 'REGEXPS' => GESHI_NEVER,
- 'NUMBERS' => GESHI_NEVER
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/html4strict.php b/libvpx/examples/includes/geshi/geshi/html4strict.php
deleted file mode 100644
index 68a0e51..0000000
--- a/libvpx/examples/includes/geshi/geshi/html4strict.php
+++ /dev/null
@@ -1,203 +0,0 @@
-<?php
-/*************************************************************************************
- * html4strict.php
- * ---------------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/10
- *
- * HTML 4.01 strict language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/12/28 (1.0.4)
- * - Removed escape character for strings
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.2)
- * - Added support for URLs
- * 2004/08/05 (1.0.1)
- * - Added INS and DEL
- * - Removed the background colour from tags' styles
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Check that only HTML4 strict attributes are highlighted
- * * Eliminate empty tags that aren't allowed in HTML4 strict
- * * Split to several files - html4trans, xhtml1 etc
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'HTML',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 2 => array(
- 'a', 'abbr', 'acronym', 'address', 'applet',
-
- 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
-
- 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
-
- 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
-
- 'em',
-
- 'fieldset', 'font', 'form', 'frame', 'frameset',
-
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
-
- 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
-
- 'kbd',
-
- 'label', 'legend', 'link', 'li',
-
- 'map', 'meta',
-
- 'noframes', 'noscript',
-
- 'object', 'ol', 'optgroup', 'option',
-
- 'param', 'pre', 'p',
-
- 'q',
-
- 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
-
- 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
-
- 'ul', 'u',
-
- 'var',
- ),
- 3 => array(
- 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
- 'background', 'bgcolor', 'border',
- 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
- 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
- 'enctype',
- 'face', 'for', 'frame', 'frameborder',
- 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
- 'id', 'ismap',
- 'label', 'lang', 'language', 'link', 'longdesc',
- 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
- 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
- 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
- 'profile', 'prompt',
- 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
- 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
- 'tabindex', 'target', 'text', 'title', 'type',
- 'usemap',
- 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
- 'width'
- )
- ),
- 'SYMBOLS' => array(
- '/', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- -1 => 'color: #808080; font-style: italic;', // comments
- 0 => 'color: #00bbdd;',
- 1 => 'color: #ddbb00;',
- 2 => 'color: #009900;'
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 2 => 'http://december.com/html/4/element/{FNAMEL}.html',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- -1 => array(
- '<!--' => '-->'
- ),
- 0 => array(
- '<!DOCTYPE' => '>'
- ),
- 1 => array(
- '&' => ';'
- ),
- 2 => array(
- '<' => '>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- -1 => false,
- 0 => false,
- 1 => false,
- 2 => true
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 2 => array(
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/idl.php b/libvpx/examples/includes/geshi/geshi/idl.php
deleted file mode 100644
index a641554..0000000
--- a/libvpx/examples/includes/geshi/geshi/idl.php
+++ /dev/null
@@ -1,123 +0,0 @@
-<?php
-/*************************************************************************************
- * idl.php
- * -------
- * Author: Cedric Bosdonnat (cedricbosdo@openoffice.org)
- * Copyright: (c) 2006 Cedric Bosdonnat
- * Release Version: 1.0.8.3
- * Date Started: 2006/08/20
- *
- * Unoidl language file for GeSHi.
- *
- * 2006/08/20 (1.0.0)
- * - First Release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-
-$language_data = array (
- 'LANG_NAME' => 'Uno Idl',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'published', 'get', 'set', 'service', 'singleton', 'type', 'module', 'interface', 'struct',
- 'const', 'constants', 'exception', 'enum', 'raises', 'typedef'
- ),
- 2 => array(
- 'bound', 'maybeambiguous', 'maybedefault', 'maybevoid', 'oneway', 'optional',
- 'readonly', 'in', 'out', 'inout', 'attribute', 'transient', 'removable'
- ),
- 3 => array(
- 'True', 'False', 'TRUE', 'FALSE'
- ),
- 4 => array(
- 'string', 'long', 'byte', 'hyper', 'boolean', 'any', 'char', 'double',
- 'void', 'sequence', 'unsigned'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':', ';', '...'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #990078; font-weight: bold',
- 2 => 'color: #36dd1c;',
- 3 => 'color: #990078; font-weight: bold',
- 4 => 'color: #0000ec;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #3f7f5f;',
- 2 => 'color: #808080;',
- 'MULTI' => 'color: #4080ff; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #666666; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #808080;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000dd;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- 1 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/ini.php b/libvpx/examples/includes/geshi/geshi/ini.php
deleted file mode 100644
index b6e3a38..0000000
--- a/libvpx/examples/includes/geshi/geshi/ini.php
+++ /dev/null
@@ -1,128 +0,0 @@
-<?php
-/*************************************************************************************
- * ini.php
- * --------
- * Author: deguix (cevo_deguix@yahoo.com.br)
- * Copyright: (c) 2005 deguix
- * Release Version: 1.0.8.3
- * Date Started: 2005/03/27
- *
- * INI language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2005/12/28 (1.0.1)
- * - Removed unnecessary keyword style index
- * - Added support for " strings
- * 2005/04/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/03/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'INI',
- 'COMMENT_SINGLE' => array(0 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- ),
- 'SYMBOLS' => array(
- '[', ']', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- ),
- 'COMMENTS' => array(
- 0 => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => ''
- ),
- 'STRINGS' => array(
- 0 => 'color: #933;'
- ),
- 'NUMBERS' => array(
- 0 => ''
- ),
- 'METHODS' => array(
- 0 => ''
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066; font-weight:bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #000066; font-weight:bold;',
- 1 => 'color: #000099;',
- 2 => 'color: #660066;'
- ),
- 'SCRIPT' => array(
- 0 => ''
- )
- ),
- 'URLS' => array(
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Section names
- 0 => '\[.+\]',
- //Entry names
- 1 => array(
- GESHI_SEARCH => '^(\s*)([a-zA-Z0-9_\-]+)(\s*=)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- //Entry values
- 2 => array(
- // Evil hackery to get around GeSHi bug: <>" and ; are added so <span>s can be matched
- // Explicit match on variable names because if a comment is before the first < of the span
- // gets chewed up...
- GESHI_SEARCH => '([<>";a-zA-Z0-9_]+\s*)=(.*)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1=',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/inno.php b/libvpx/examples/includes/geshi/geshi/inno.php
deleted file mode 100644
index 5cead10..0000000
--- a/libvpx/examples/includes/geshi/geshi/inno.php
+++ /dev/null
@@ -1,212 +0,0 @@
-<?php
-/*************************************************************************************
- * Inno.php
- * ----------
- * Author: Thomas Klingler (hotline@theratech.de) based on delphi.php from J�rja Norbert (jnorbi@vipmail.hu)
- * Copyright: (c) 2004 J�rja Norbert, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2005/07/29
- *
- * Inno Script language inkl. Delphi (Object Pascal) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/09/03
- * - First Release
- *
- * TODO (updated 2005/07/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Inno',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('(*' => '*)'),
- 'CASE_KEYWORDS' => 0,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'Setup','Types','Components','Tasks','Dirs','Files','Icons','INI',
- 'InstallDelete','Languages','Messages','CustomMessage',
- 'LangOptions','Registry','RUN','UninstallDelete','UninstallRun',
- 'app','win','sys','syswow64','src','sd','pf','pf32','pf64','cf',
- 'cf32','cf64','tmp','fonts','dao','group','localappdata','sendto',
- 'userappdata','commonappdata','userdesktop','commondesktop',
- 'userdocs','commondocs','userfavorites','commonfavorites',
- 'userprograms','commonprograms','userstartmenu','commonstartmenu',
- 'userstartup','commonstartup','usertemplates','commontemplates'
- ),
- 2 => array(
- 'nil', 'false', 'true', 'var', 'type', 'const','And', 'Array', 'As', 'Begin', 'Case', 'Class', 'Constructor', 'Destructor', 'Div', 'Do', 'DownTo', 'Else',
- 'End', 'Except', 'File', 'Finally', 'For', 'Function', 'Goto', 'If', 'Implementation', 'In', 'Inherited', 'Interface',
- 'Is', 'Mod', 'Not', 'Object', 'Of', 'On', 'Or', 'Packed', 'Procedure', 'Property', 'Raise', 'Record',
- 'Repeat', 'Set', 'Shl', 'Shr', 'Then', 'ThreadVar', 'To', 'Try', 'Unit', 'Until', 'Uses', 'While', 'With', 'Xor',
-
- 'HKCC','HKCR','HKCU','HKLM','HKU','alwaysoverwrite','alwaysskipifsameorolder','append',
- 'binary','classic','closeonexit','comparetimestamp','confirmoverwrite',
- 'createkeyifdoesntexist','createonlyiffileexists','createvalueifdoesntexist',
- 'deleteafterinstall','deletekey','deletevalue','dirifempty','dontcloseonexit',
- 'dontcopy','dontcreatekey','disablenouninstallwarning','dword','exclusive','expandsz',
- 'external','files','filesandordirs','fixed','fontisnttruetype','ignoreversion','iscustom','isreadme',
- 'modern','multisz','new','noerror','none','normal','nowait','onlyifdestfileexists',
- 'onlyifdoesntexist','onlyifnewer','overwrite','overwritereadonly','postinstall',
- 'preservestringtype','promptifolder','regserver','regtypelib','restart','restartreplace',
- 'runhidden','runmaximized','runminimized','sharedfile','shellexec','showcheckbox',
- 'skipifnotsilent','skipifsilent','silent','skipifdoesntexist',
- 'skipifsourcedoesntexist','sortfilesbyextension','unchecked','uninsalwaysuninstall',
- 'uninsclearvalue','uninsdeleteentry','uninsdeletekey','uninsdeletekeyifempty',
- 'uninsdeletesection','uninsdeletesectionifempty','uninsdeletevalue',
- 'uninsneveruninstall','useapppaths','verysilent','waituntilidle'
- ),
- 3 => array(
- 'Abs', 'Addr', 'AnsiCompareStr', 'AnsiCompareText', 'AnsiContainsStr', 'AnsiEndsStr', 'AnsiIndexStr', 'AnsiLeftStr',
- 'AnsiLowerCase', 'AnsiMatchStr', 'AnsiMidStr', 'AnsiPos', 'AnsiReplaceStr', 'AnsiReverseString', 'AnsiRightStr',
- 'AnsiStartsStr', 'AnsiUpperCase', 'ArcCos', 'ArcSin', 'ArcTan', 'Assigned', 'BeginThread', 'Bounds', 'CelsiusToFahrenheit',
- 'ChangeFileExt', 'Chr', 'CompareStr', 'CompareText', 'Concat', 'Convert', 'Copy', 'Cos', 'CreateDir', 'CurrToStr',
- 'CurrToStrF', 'Date', 'DateTimeToFileDate', 'DateTimeToStr', 'DateToStr', 'DayOfTheMonth', 'DayOfTheWeek', 'DayOfTheYear',
- 'DayOfWeek', 'DaysBetween', 'DaysInAMonth', 'DaysInAYear', 'DaySpan', 'DegToRad', 'DeleteFile', 'DiskFree', 'DiskSize',
- 'DupeString', 'EncodeDate', 'EncodeDateTime', 'EncodeTime', 'EndOfADay', 'EndOfAMonth', 'Eof', 'Eoln', 'Exp', 'ExtractFileDir',
- 'ExtractFileDrive', 'ExtractFileExt', 'ExtractFileName', 'ExtractFilePath', 'FahrenheitToCelsius', 'FileAge',
- 'FileDateToDateTime', 'FileExists', 'FilePos', 'FileSearch', 'FileSetDate', 'FileSize', 'FindClose', 'FindCmdLineSwitch',
- 'FindFirst', 'FindNext', 'FloatToStr', 'FloatToStrF', 'Format', 'FormatCurr', 'FormatDateTime', 'FormatFloat', 'Frac',
- 'GetCurrentDir', 'GetLastError', 'GetMem', 'High', 'IncDay', 'IncMinute', 'IncMonth', 'IncYear', 'InputBox',
- 'InputQuery', 'Int', 'IntToHex', 'IntToStr', 'IOResult', 'IsInfinite', 'IsLeapYear', 'IsMultiThread', 'IsNaN',
- 'LastDelimiter', 'Length', 'Ln', 'Lo', 'Log10', 'Low', 'LowerCase', 'Max', 'Mean', 'MessageDlg', 'MessageDlgPos',
- 'MonthOfTheYear', 'Now', 'Odd', 'Ord', 'ParamCount', 'ParamStr', 'Pi', 'Point', 'PointsEqual', 'Pos', 'Pred',
- 'Printer', 'PromptForFileName', 'PtInRect', 'RadToDeg', 'Random', 'RandomRange', 'RecodeDate', 'RecodeTime', 'Rect',
- 'RemoveDir', 'RenameFile', 'Round', 'SeekEof', 'SeekEoln', 'SelectDirectory', 'SetCurrentDir', 'Sin', 'SizeOf',
- 'Slice', 'Sqr', 'Sqrt', 'StringOfChar', 'StringReplace', 'StringToWideChar', 'StrToCurr', 'StrToDate', 'StrToDateTime',
- 'StrToFloat', 'StrToInt', 'StrToInt64', 'StrToInt64Def', 'StrToIntDef', 'StrToTime', 'StuffString', 'Succ', 'Sum', 'Tan',
- 'Time', 'TimeToStr', 'Tomorrow', 'Trunc', 'UpCase', 'UpperCase', 'VarType', 'WideCharToString', 'WrapText', 'Yesterday',
- 'Append', 'AppendStr', 'Assign', 'AssignFile', 'AssignPrn', 'Beep', 'BlockRead', 'BlockWrite', 'Break',
- 'ChDir', 'Close', 'CloseFile', 'Continue', 'DateTimeToString', 'Dec', 'DecodeDate', 'DecodeDateTime',
- 'DecodeTime', 'Delete', 'Dispose', 'EndThread', 'Erase', 'Exclude', 'Exit', 'FillChar', 'Flush', 'FreeAndNil',
- 'FreeMem', 'GetDir', 'GetLocaleFormatSettings', 'Halt', 'Inc', 'Include', 'Insert', 'MkDir', 'Move', 'New',
- 'ProcessPath', 'Randomize', 'Read', 'ReadLn', 'ReallocMem', 'Rename', 'ReplaceDate', 'ReplaceTime',
- 'Reset', 'ReWrite', 'RmDir', 'RunError', 'Seek', 'SetLength', 'SetString', 'ShowMessage', 'ShowMessageFmt',
- 'ShowMessagePos', 'Str', 'Truncate', 'Val', 'Write', 'WriteLn',
-
- 'AdminPrivilegesRequired','AfterInstall','AllowCancelDuringInstall','AllowNoIcons','AllowRootDirectory','AllowUNCPath','AlwaysRestart','AlwaysShowComponentsList','AlwaysShowDirOnReadyPage','AlwaysShowGroupOnReadyPage ','AlwaysUsePersonalGroup','AppComments','AppContact','AppCopyright','AppendDefaultDirName',
- 'AppendDefaultGroupName','AppId','AppModifyPath','AppMutex','AppName','AppPublisher',
- 'AppPublisherURL','AppReadmeFile','AppSupportURL','AppUpdatesURL','AppVerName','AppVersion',
- 'Attribs','BackColor','BackColor2','BackColorDirection','BackSolid','BeforeInstall',
- 'ChangesAssociations','ChangesEnvironment','Check','CodeFile','Comment','Compression','CopyMode',
- 'CreateAppDir','CreateUninstallRegKey','DefaultDirName','DefaultGroupName',
- 'DefaultUserInfoName','DefaultUserInfoOrg','DefaultUserInfoSerial',
- 'Description','DestDir','DestName','DirExistsWarning',
- 'DisableDirPage','DisableFinishedPage',
- 'DisableProgramGroupPage','DisableReadyMemo','DisableReadyPage',
- 'DisableStartupPrompt','DiskClusterSize','DiskSliceSize','DiskSpaceMBLabel',
- 'DiskSpanning','DontMergeDuplicateFiles','EnableDirDoesntExistWarning','Encryption',
- 'Excludes','ExtraDiskSpaceRequired','Filename','Flags','FlatComponentsList','FontInstall',
- 'GroupDescription','HotKey','IconFilename','IconIndex','InfoAfterFile','InfoBeforeFile',
- 'InternalCompressLevel','Key','LanguageDetectionMethod',
- 'LicenseFile','MergeDuplicateFiles','MessagesFile','MinVersion','Name',
- 'OnlyBelowVersion','OutputBaseFilename','OutputManifestFile','OutputDir',
- 'Parameters','Password','Permissions','PrivilegesRequired','ReserveBytes',
- 'RestartIfNeededByRun','Root','RunOnceId','Section','SetupIconFile',
- 'ShowComponentSizes','ShowLanguageDialog','ShowTasksTreeLines','SlicesPerDisk',
- 'SolidCompression','Source','SourceDir','StatusMsg','Subkey',
- 'TimeStampRounding','TimeStampsInUTC','TouchDate','TouchTime','Type',
- 'UninstallDisplayIcon','UninstallDisplayName','UninstallFilesDir','UninstallIconFile',
- 'UninstallLogMode','UninstallRestartComputer','UninstallStyle','Uninstallable',
- 'UpdateUninstallLogAppName','UsePreviousAppDir','UsePreviousGroup',
- 'UsePreviousTasks','UsePreviousSetupType','UsePreviousUserInfo',
- 'UserInfoPage','UseSetupLdr','ValueData','ValueName','ValueType',
- 'VersionInfoVersion','VersionInfoCompany','VersionInfoDescription','VersionInfoTextVersion',
- 'WindowResizable','WindowShowCaption','WindowStartMaximized',
- 'WindowVisible','WizardImageBackColor','WizardImageFile','WizardImageStretch','WizardSmallImageBackColor','WizardSmallImageFile','WizardStyle','WorkingDir'
- ),
- 4 => array(
- 'AnsiChar', 'AnsiString', 'Boolean', 'Byte', 'Cardinal', 'Char', 'Comp', 'Currency', 'Double', 'Extended',
- 'Int64', 'Integer', 'LongInt', 'LongWord', 'PAnsiChar', 'PAnsiString', 'PChar', 'PCurrency', 'PDateTime',
- 'PExtended', 'PInt64', 'Pointer', 'PShortString', 'PString', 'PVariant', 'PWideChar', 'PWideString',
- 'Real', 'Real48', 'ShortInt', 'ShortString', 'Single', 'SmallInt', 'String', 'TBits', 'TConvType', 'TDateTime',
- 'Text', 'TextFile', 'TFloatFormat', 'TFormatSettings', 'TList', 'TObject', 'TOpenDialog', 'TPoint',
- 'TPrintDialog', 'TRect', 'TReplaceFlags', 'TSaveDialog', 'TSearchRec', 'TStringList', 'TSysCharSet',
- 'TThreadFunc', 'Variant', 'WideChar', 'WideString', 'Word'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '@', '%', '&', '*', '|', '/', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',/*bold Black*/
- 2 => 'color: #000000;font-style: italic;',/*Black*/
- 3 => 'color: #0000FF;',/*blue*/
- 4 => 'color: #CC0000;'/*red*/
- ),
- 'COMMENTS' => array(
- 1 => 'color: #33FF00; font-style: italic;',
- 'MULTI' => 'color: #33FF00; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'REGEXPS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000; font-weight: bold;',
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/intercal.php b/libvpx/examples/includes/geshi/geshi/intercal.php
deleted file mode 100644
index b4ad049..0000000
--- a/libvpx/examples/includes/geshi/geshi/intercal.php
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/*************************************************************************************
- * intercal.php
- * ----------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2009/10/31
- *
- * INTERCAL language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/31 (1.0.8.1)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'INTERCAL',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- //Politeness
- 1 => array(
- 'DO', 'DOES', 'DONT', 'DON\'T', 'NOT', 'PLEASE', 'PLEASENT', 'PLEASEN\'T', 'MAYBE'
- ),
- //Statements
- 2 => array(
- 'STASH', 'RETRIEVE', 'NEXT', 'RESUME', 'FORGET', 'ABSTAIN', 'ABSTAINING',
- 'COME', 'FROM', 'CALCULATING', 'REINSTATE', 'IGNORE', 'REMEMBER',
- 'WRITE', 'IN', 'READ', 'OUT', 'GIVE', 'UP'
- )
- ),
- 'SYMBOLS' => array(
- '.', ',', ':', ';', '#',
- '~', '$', '&', '?',
- '\'', '"', '<-'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000080; font-weight: bold;',
- 2 => 'color: #000080; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 1 => 'color: #808080; font-style: italic;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 1 => '^\(\d+\)'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'COMMENTS' => GESHI_NEVER,
- 'STRINGS' => GESHI_NEVER,
- 'NUMBERS' => GESHI_NEVER
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/io.php b/libvpx/examples/includes/geshi/geshi/io.php
deleted file mode 100644
index e9117ab..0000000
--- a/libvpx/examples/includes/geshi/geshi/io.php
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-/*************************************************************************************
- * io.php
- * -------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2006 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2006/09/23
- *
- * Io language file for GeSHi. Thanks to Johnathan Wright for the suggestion and help
- * with this language :)
- *
- * CHANGES
- * -------
- * 2006/09/23(1.0.0)
- * - First Release
- *
- * TODO
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Io',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'and', 'break', 'else', 'elseif', 'exit', 'for', 'foreach', 'if', 'ifFalse', 'ifNil',
- 'ifTrue', 'or', 'pass', 'raise', 'return', 'then', 'try', 'wait', 'while', 'yield'
- ),
- 2 => array(
- 'activate', 'activeCoroCount', 'asString', 'block', 'catch', 'clone', 'collectGarbage',
- 'compileString', 'continue', 'do', 'doFile', 'doMessage', 'doString', 'forward',
- 'getSlot', 'getenv', 'hasSlot', 'isActive', 'isNil', 'isResumable', 'list', 'message',
- 'method', 'parent', 'pause', 'perform', 'performWithArgList', 'print', 'proto',
- 'raiseResumable', 'removeSlot', 'resend', 'resume', 'schedulerSleepSeconds', 'self',
- 'sender', 'setSchedulerSleepSeconds', 'setSlot', 'shallowCopy', 'slotNames', 'super',
- 'system', 'thisBlock', 'thisContext', 'thisMessage', 'type', 'uniqueId', 'updateSlot',
- 'write'
- ),
- 3 => array(
- 'Array', 'AudioDevice', 'AudioMixer', 'Block', 'Box', 'Buffer', 'CFunction', 'CGI',
- 'Color', 'Curses', 'DBM', 'DNSResolver', 'DOConnection', 'DOProxy', 'DOServer',
- 'Date', 'Directory', 'Duration', 'DynLib', 'Error', 'Exception', 'FFT', 'File',
- 'Fnmatch', 'Font', 'Future', 'GL', 'GLE', 'GLScissor', 'GLU', 'GLUCylinder',
- 'GLUQuadric', 'GLUSphere', 'GLUT', 'Host', 'Image', 'Importer', 'LinkList', 'List',
- 'Lobby', 'Locals', 'MD5', 'MP3Decoder', 'MP3Encoder', 'Map', 'Message', 'Movie',
- 'NULL', 'Nil', 'Nop', 'Notifiction', 'Number', 'Object', 'OpenGL', 'Point', 'Protos',
- 'Regex', 'SGMLTag', 'SQLite', 'Server', 'ShowMessage', 'SleepyCat', 'SleepyCatCursor',
- 'Socket', 'SocketManager', 'Sound', 'Soup', 'Store', 'String', 'Tree', 'UDPSender',
- 'UDPReceiver', 'URL', 'User', 'Warning', 'WeakLink'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- 0 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/java.php b/libvpx/examples/includes/geshi/geshi/java.php
deleted file mode 100644
index 7e5dc08..0000000
--- a/libvpx/examples/includes/geshi/geshi/java.php
+++ /dev/null
@@ -1,983 +0,0 @@
-<?php
-/*************************************************************************************
- * java.php
- * --------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/10
- *
- * Java language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/25 (1.0.7.22)
- * - Added highlighting of import and package directives as non-OOP
- * 2005/12/28 (1.0.4)
- * - Added instanceof keyword
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/08/05 (1.0.2)
- * - Added URL support
- * - Added keyword "this", as bugs in GeSHi class ironed out
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * - Added extra missed keywords
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Compact the class names like the first few have been
- * and eliminate repeats
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Java',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Import and Package directives (Basic Support only)
- 2 => '/(?:(?<=import[\\n\\s])|(?<=package[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*([a-zA-Z0-9_]+|\*)(?=[\n\s;])/i',
- // javadoc comments
- 3 => '#/\*\*(?![\*\/]).*\*/#sU'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'for', 'foreach', 'if', 'else', 'while', 'do',
- 'switch', 'case', 'return', 'public',
- 'private', 'protected', 'extends', 'break', 'class',
- 'new', 'try', 'catch', 'throws', 'finally', 'implements',
- 'interface', 'throw', 'final', 'native', 'synchronized', 'this',
- 'abstract', 'transient', 'instanceof', 'assert', 'continue',
- 'default', 'enum', 'package', 'static', 'strictfp', 'super',
- 'volatile', 'const', 'goto', 'import'
- ),
- 2 => array(
- 'null', 'false', 'true'
- ),
- 3 => array(
- 'AbstractAction', 'AbstractBorder', 'AbstractButton',
- 'AbstractCellEditor', 'AbstractCollection',
- 'AbstractColorChooserPanel', 'AbstractDocument',
- 'AbstractDocument.AttributeContext',
- 'AbstractDocument.Content',
- 'AbstractDocument.ElementEdit',
- 'AbstractLayoutCache',
- 'AbstractLayoutCache.NodeDimensions', 'AbstractList',
- 'AbstractListModel', 'AbstractMap',
- 'AbstractMethodError', 'AbstractSequentialList',
- 'AbstractSet', 'AbstractTableModel',
- 'AbstractUndoableEdit', 'AbstractWriter',
- 'AccessControlContext', 'AccessControlException',
- 'AccessController', 'AccessException', 'Accessible',
- 'AccessibleAction', 'AccessibleBundle',
- 'AccessibleComponent', 'AccessibleContext',
- 'AccessibleHyperlink', 'AccessibleHypertext',
- 'AccessibleIcon', 'AccessibleObject',
- 'AccessibleRelation', 'AccessibleRelationSet',
- 'AccessibleResourceBundle', 'AccessibleRole',
- 'AccessibleSelection', 'AccessibleState',
- 'AccessibleStateSet', 'AccessibleTable',
- 'AccessibleTableModelChange', 'AccessibleText',
- 'AccessibleValue', 'Acl', 'AclEntry',
- 'AclNotFoundException', 'Action', 'ActionEvent',
- 'ActionListener', 'ActionMap', 'ActionMapUIResource',
- 'Activatable', 'ActivateFailedException',
- 'ActivationDesc', 'ActivationException',
- 'ActivationGroup', 'ActivationGroupDesc',
- 'ActivationGroupDesc.CommandEnvironment',
- 'ActivationGroupID', 'ActivationID',
- 'ActivationInstantiator', 'ActivationMonitor',
- 'ActivationSystem', 'Activator', 'ActiveEvent',
- 'Adjustable', 'AdjustmentEvent',
- 'AdjustmentListener', 'Adler32', 'AffineTransform',
- 'AffineTransformOp', 'AlgorithmParameterGenerator',
- 'AlgorithmParameterGeneratorSpi',
- 'AlgorithmParameters', 'AlgorithmParameterSpec',
- 'AlgorithmParametersSpi', 'AllPermission',
- 'AlphaComposite', 'AlreadyBound',
- 'AlreadyBoundException', 'AlreadyBoundHelper',
- 'AlreadyBoundHolder', 'AncestorEvent',
- 'AncestorListener', 'Annotation', 'Any', 'AnyHolder',
- 'AnySeqHelper', 'AnySeqHolder', 'Applet',
- 'AppletContext', 'AppletInitializer', 'AppletStub',
- 'ApplicationException', 'Arc2D', 'Arc2D.Double',
- 'Arc2D.Float', 'Area', 'AreaAveragingScaleFilter',
- 'ARG_IN', 'ARG_INOUT', 'ARG_OUT',
- 'ArithmeticException', 'Array',
- 'ArrayIndexOutOfBoundsException', 'ArrayList',
- 'Arrays', 'ArrayStoreException', 'AsyncBoxView',
- 'Attribute', 'AttributedCharacterIterator',
- 'AttributedCharacterIterator.Attribute',
- 'AttributedString', 'AttributeInUseException',
- 'AttributeList', 'AttributeModificationException',
- 'Attributes', 'Attributes.Name', 'AttributeSet',
- 'AttributeSet.CharacterAttribute',
- 'AttributeSet.ColorAttribute',
- 'AttributeSet.FontAttribute',
- 'AttributeSet.ParagraphAttribute', 'AudioClip',
- 'AudioFileFormat', 'AudioFileFormat.Type',
- 'AudioFileReader', 'AudioFileWriter', 'AudioFormat',
- 'AudioFormat.Encoding', 'AudioInputStream',
- 'AudioPermission', 'AudioSystem',
- 'AuthenticationException',
- 'AuthenticationNotSupportedException',
- 'Authenticator', 'Autoscroll', 'AWTError',
- 'AWTEvent', 'AWTEventListener',
- 'AWTEventMulticaster', 'AWTException',
- 'AWTPermission', 'BadKind', 'BadLocationException',
- 'BAD_CONTEXT', 'BAD_INV_ORDER', 'BAD_OPERATION',
- 'BAD_PARAM', 'BAD_POLICY', 'BAD_POLICY_TYPE',
- 'BAD_POLICY_VALUE', 'BAD_TYPECODE', 'BandCombineOp',
- 'BandedSampleModel', 'BasicArrowButton',
- 'BasicAttribute', 'BasicAttributes', 'BasicBorders',
- 'BasicBorders.ButtonBorder',
- 'BasicBorders.FieldBorder',
- 'BasicBorders.MarginBorder',
- 'BasicBorders.MenuBarBorder',
- 'BasicBorders.RadioButtonBorder',
- 'BasicBorders.SplitPaneBorder',
- 'BasicBorders.ToggleButtonBorder',
- 'BasicButtonListener', 'BasicButtonUI',
- 'BasicCheckBoxMenuItemUI', 'BasicCheckBoxUI',
- 'BasicColorChooserUI', 'BasicComboBoxEditor',
- 'BasicComboBoxEditor.UIResource',
- 'BasicComboBoxRenderer',
- 'BasicComboBoxRenderer.UIResource',
- 'BasicComboBoxUI', 'BasicComboPopup',
- 'BasicDesktopIconUI', 'BasicDesktopPaneUI',
- 'BasicDirectoryModel', 'BasicEditorPaneUI',
- 'BasicFileChooserUI', 'BasicGraphicsUtils',
- 'BasicHTML', 'BasicIconFactory',
- 'BasicInternalFrameTitlePane',
- 'BasicInternalFrameUI', 'BasicLabelUI',
- 'BasicListUI', 'BasicLookAndFeel', 'BasicMenuBarUI',
- 'BasicMenuItemUI', 'BasicMenuUI',
- 'BasicOptionPaneUI',
- 'BasicOptionPaneUI.ButtonAreaLayout', 'BasicPanelUI',
- 'BasicPasswordFieldUI', 'BasicPermission',
- 'BasicPopupMenuSeparatorUI', 'BasicPopupMenuUI',
- 'BasicProgressBarUI', 'BasicRadioButtonMenuItemUI',
- 'BasicRadioButtonUI', 'BasicRootPaneUI',
- 'BasicScrollBarUI', 'BasicScrollPaneUI',
- 'BasicSeparatorUI', 'BasicSliderUI',
- 'BasicSplitPaneDivider', 'BasicSplitPaneUI',
- 'BasicStroke', 'BasicTabbedPaneUI',
- 'BasicTableHeaderUI', 'BasicTableUI',
- 'BasicTextAreaUI', 'BasicTextFieldUI',
- 'BasicTextPaneUI', 'BasicTextUI',
- 'BasicTextUI.BasicCaret',
- 'BasicTextUI.BasicHighlighter',
- 'BasicToggleButtonUI', 'BasicToolBarSeparatorUI',
- 'BasicToolBarUI', 'BasicToolTipUI', 'BasicTreeUI',
- 'BasicViewportUI', 'BatchUpdateException',
- 'BeanContext', 'BeanContextChild',
- 'BeanContextChildComponentProxy',
- 'BeanContextChildSupport',
- 'BeanContextContainerProxy', 'BeanContextEvent',
- 'BeanContextMembershipEvent',
- 'BeanContextMembershipListener', 'BeanContextProxy',
- 'BeanContextServiceAvailableEvent',
- 'BeanContextServiceProvider',
- 'BeanContextServiceProviderBeanInfo',
- 'BeanContextServiceRevokedEvent',
- 'BeanContextServiceRevokedListener',
- 'BeanContextServices', 'BeanContextServicesListener',
- 'BeanContextServicesSupport',
- 'BeanContextServicesSupport.BCSSServiceProvider',
- 'BeanContextSupport',
- 'BeanContextSupport.BCSIterator', 'BeanDescriptor',
- 'BeanInfo', 'Beans', 'BevelBorder', 'BigDecimal',
- 'BigInteger', 'BinaryRefAddr', 'BindException',
- 'Binding', 'BindingHelper', 'BindingHolder',
- 'BindingIterator', 'BindingIteratorHelper',
- 'BindingIteratorHolder', 'BindingIteratorOperations',
- 'BindingListHelper', 'BindingListHolder',
- 'BindingType', 'BindingTypeHelper',
- 'BindingTypeHolder', 'BitSet', 'Blob', 'BlockView',
- 'Book', 'Boolean', 'BooleanControl',
- 'BooleanControl.Type', 'BooleanHolder',
- 'BooleanSeqHelper', 'BooleanSeqHolder', 'Border',
- 'BorderFactory', 'BorderLayout', 'BorderUIResource',
- 'BorderUIResource.BevelBorderUIResource',
- 'BorderUIResource.CompoundBorderUIResource',
- 'BorderUIResource.EmptyBorderUIResource',
- 'BorderUIResource.EtchedBorderUIResource',
- 'BorderUIResource.LineBorderUIResource',
- 'BorderUIResource.MatteBorderUIResource',
- 'BorderUIResource.TitledBorderUIResource',
- 'BoundedRangeModel', 'Bounds', 'Box', 'Box.Filler',
- 'BoxedValueHelper', 'BoxLayout', 'BoxView',
- 'BreakIterator', 'BufferedImage',
- 'BufferedImageFilter', 'BufferedImageOp',
- 'BufferedInputStream', 'BufferedOutputStream',
- 'BufferedReader', 'BufferedWriter', 'Button',
- 'ButtonGroup', 'ButtonModel', 'ButtonUI', 'Byte',
- 'ByteArrayInputStream', 'ByteArrayOutputStream',
- 'ByteHolder', 'ByteLookupTable', 'Calendar',
- 'CallableStatement', 'CannotProceed',
- 'CannotProceedException', 'CannotProceedHelper',
- 'CannotProceedHolder', 'CannotRedoException',
- 'CannotUndoException', 'Canvas', 'CardLayout',
- 'Caret', 'CaretEvent', 'CaretListener', 'CellEditor',
- 'CellEditorListener', 'CellRendererPane',
- 'Certificate', 'Certificate.CertificateRep',
- 'CertificateEncodingException',
- 'CertificateException',
- 'CertificateExpiredException', 'CertificateFactory',
- 'CertificateFactorySpi',
- 'CertificateNotYetValidException',
- 'CertificateParsingException',
- 'ChangedCharSetException', 'ChangeEvent',
- 'ChangeListener', 'Character', 'Character.Subset',
- 'Character.UnicodeBlock', 'CharacterIterator',
- 'CharArrayReader', 'CharArrayWriter',
- 'CharConversionException', 'CharHolder',
- 'CharSeqHelper', 'CharSeqHolder', 'Checkbox',
- 'CheckboxGroup', 'CheckboxMenuItem',
- 'CheckedInputStream', 'CheckedOutputStream',
- 'Checksum', 'Choice', 'ChoiceFormat', 'Class',
- 'ClassCastException', 'ClassCircularityError',
- 'ClassDesc', 'ClassFormatError', 'ClassLoader',
- 'ClassNotFoundException', 'Clip', 'Clipboard',
- 'ClipboardOwner', 'Clob', 'Cloneable',
- 'CloneNotSupportedException', 'CMMException',
- 'CodeSource', 'CollationElementIterator',
- 'CollationKey', 'Collator', 'Collection',
- 'Collections', 'Color',
- 'ColorChooserComponentFactory', 'ColorChooserUI',
- 'ColorConvertOp', 'ColorModel',
- 'ColorSelectionModel', 'ColorSpace',
- 'ColorUIResource', 'ComboBoxEditor', 'ComboBoxModel',
- 'ComboBoxUI', 'ComboPopup', 'CommunicationException',
- 'COMM_FAILURE', 'Comparable', 'Comparator',
- 'Compiler', 'CompletionStatus',
- 'CompletionStatusHelper', 'Component',
- 'ComponentAdapter', 'ComponentColorModel',
- 'ComponentEvent', 'ComponentInputMap',
- 'ComponentInputMapUIResource', 'ComponentListener',
- 'ComponentOrientation', 'ComponentSampleModel',
- 'ComponentUI', 'ComponentView', 'Composite',
- 'CompositeContext', 'CompositeName', 'CompositeView',
- 'CompoundBorder', 'CompoundControl',
- 'CompoundControl.Type', 'CompoundEdit',
- 'CompoundName', 'ConcurrentModificationException',
- 'ConfigurationException', 'ConnectException',
- 'ConnectIOException', 'Connection', 'Constructor', 'Container',
- 'ContainerAdapter', 'ContainerEvent',
- 'ContainerListener', 'ContentHandler',
- 'ContentHandlerFactory', 'ContentModel', 'Context',
- 'ContextList', 'ContextNotEmptyException',
- 'ContextualRenderedImageFactory', 'Control',
- 'Control.Type', 'ControlFactory',
- 'ControllerEventListener', 'ConvolveOp', 'CRC32',
- 'CRL', 'CRLException', 'CropImageFilter', 'CSS',
- 'CSS.Attribute', 'CTX_RESTRICT_SCOPE',
- 'CubicCurve2D', 'CubicCurve2D.Double',
- 'CubicCurve2D.Float', 'Current', 'CurrentHelper',
- 'CurrentHolder', 'CurrentOperations', 'Cursor',
- 'Customizer', 'CustomMarshal', 'CustomValue',
- 'DatabaseMetaData', 'DataBuffer', 'DataBufferByte',
- 'DataBufferInt', 'DataBufferShort',
- 'DataBufferUShort', 'DataFlavor',
- 'DataFormatException', 'DatagramPacket',
- 'DatagramSocket', 'DatagramSocketImpl',
- 'DatagramSocketImplFactory', 'DataInput',
- 'DataInputStream', 'DataLine', 'DataLine.Info',
- 'DataOutput', 'DataOutputStream',
- 'DataTruncation', 'DATA_CONVERSION', 'Date',
- 'DateFormat', 'DateFormatSymbols', 'DebugGraphics',
- 'DecimalFormat', 'DecimalFormatSymbols',
- 'DefaultBoundedRangeModel', 'DefaultButtonModel',
- 'DefaultCaret', 'DefaultCellEditor',
- 'DefaultColorSelectionModel', 'DefaultComboBoxModel',
- 'DefaultDesktopManager', 'DefaultEditorKit',
- 'DefaultEditorKit.BeepAction',
- 'DefaultEditorKit.CopyAction',
- 'DefaultEditorKit.CutAction',
- 'DefaultEditorKit.DefaultKeyTypedAction',
- 'DefaultEditorKit.InsertBreakAction',
- 'DefaultEditorKit.InsertContentAction',
- 'DefaultEditorKit.InsertTabAction',
- 'DefaultEditorKit.PasteAction,',
- 'DefaultFocusManager', 'DefaultHighlighter',
- 'DefaultHighlighter.DefaultHighlightPainter',
- 'DefaultListCellRenderer',
- 'DefaultListCellRenderer.UIResource',
- 'DefaultListModel', 'DefaultListSelectionModel',
- 'DefaultMenuLayout', 'DefaultMetalTheme',
- 'DefaultMutableTreeNode',
- 'DefaultSingleSelectionModel',
- 'DefaultStyledDocument',
- 'DefaultStyledDocument.AttributeUndoableEdit',
- 'DefaultStyledDocument.ElementSpec',
- 'DefaultTableCellRenderer',
- 'DefaultTableCellRenderer.UIResource',
- 'DefaultTableColumnModel', 'DefaultTableModel',
- 'DefaultTextUI', 'DefaultTreeCellEditor',
- 'DefaultTreeCellRenderer', 'DefaultTreeModel',
- 'DefaultTreeSelectionModel', 'DefinitionKind',
- 'DefinitionKindHelper', 'Deflater',
- 'DeflaterOutputStream', 'Delegate', 'DesignMode',
- 'DesktopIconUI', 'DesktopManager', 'DesktopPaneUI',
- 'DGC', 'Dialog', 'Dictionary', 'DigestException',
- 'DigestInputStream', 'DigestOutputStream',
- 'Dimension', 'Dimension2D', 'DimensionUIResource',
- 'DirContext', 'DirectColorModel', 'DirectoryManager',
- 'DirObjectFactory', 'DirStateFactory',
- 'DirStateFactory.Result', 'DnDConstants', 'Document',
- 'DocumentEvent', 'DocumentEvent.ElementChange',
- 'DocumentEvent.EventType', 'DocumentListener',
- 'DocumentParser', 'DomainCombiner', 'DomainManager',
- 'DomainManagerOperations', 'Double', 'DoubleHolder',
- 'DoubleSeqHelper', 'DoubleSeqHolder',
- 'DragGestureEvent', 'DragGestureListener',
- 'DragGestureRecognizer', 'DragSource',
- 'DragSourceContext', 'DragSourceDragEvent',
- 'DragSourceDropEvent', 'DragSourceEvent',
- 'DragSourceListener', 'Driver', 'DriverManager',
- 'DriverPropertyInfo', 'DropTarget',
- 'DropTarget.DropTargetAutoScroller',
- 'DropTargetContext', 'DropTargetDragEvent',
- 'DropTargetDropEvent', 'DropTargetEvent',
- 'DropTargetListener', 'DSAKey',
- 'DSAKeyPairGenerator', 'DSAParameterSpec',
- 'DSAParams', 'DSAPrivateKey', 'DSAPrivateKeySpec',
- 'DSAPublicKey', 'DSAPublicKeySpec', 'DTD',
- 'DTDConstants', 'DynamicImplementation', 'DynAny',
- 'DynArray', 'DynEnum', 'DynFixed', 'DynSequence',
- 'DynStruct', 'DynUnion', 'DynValue', 'EditorKit',
- 'Element', 'ElementIterator', 'Ellipse2D',
- 'Ellipse2D.Double', 'Ellipse2D.Float', 'EmptyBorder',
- 'EmptyStackException', 'EncodedKeySpec', 'Entity',
- 'EnumControl', 'EnumControl.Type', 'Enumeration',
- 'Environment', 'EOFException', 'Error',
- 'EtchedBorder', 'Event', 'EventContext',
- 'EventDirContext', 'EventListener',
- 'EventListenerList', 'EventObject', 'EventQueue',
- 'EventSetDescriptor', 'Exception',
- 'ExceptionInInitializerError', 'ExceptionList',
- 'ExpandVetoException', 'ExportException',
- 'ExtendedRequest', 'ExtendedResponse',
- 'Externalizable', 'FeatureDescriptor', 'Field',
- 'FieldNameHelper', 'FieldPosition', 'FieldView',
- 'File', 'FileChooserUI', 'FileDescriptor',
- 'FileDialog', 'FileFilter',
- 'FileInputStream', 'FilenameFilter', 'FileNameMap',
- 'FileNotFoundException', 'FileOutputStream',
- 'FilePermission', 'FileReader', 'FileSystemView',
- 'FileView', 'FileWriter', 'FilteredImageSource',
- 'FilterInputStream', 'FilterOutputStream',
- 'FilterReader', 'FilterWriter',
- 'FixedHeightLayoutCache', 'FixedHolder',
- 'FlatteningPathIterator', 'FlavorMap', 'Float',
- 'FloatControl', 'FloatControl.Type', 'FloatHolder',
- 'FloatSeqHelper', 'FloatSeqHolder', 'FlowLayout',
- 'FlowView', 'FlowView.FlowStrategy', 'FocusAdapter',
- 'FocusEvent', 'FocusListener', 'FocusManager',
- 'Font', 'FontFormatException', 'FontMetrics',
- 'FontRenderContext', 'FontUIResource', 'Format',
- 'FormatConversionProvider', 'FormView', 'Frame',
- 'FREE_MEM', 'GapContent', 'GeneralPath',
- 'GeneralSecurityException', 'GlyphJustificationInfo',
- 'GlyphMetrics', 'GlyphVector', 'GlyphView',
- 'GlyphView.GlyphPainter', 'GradientPaint',
- 'GraphicAttribute', 'Graphics', 'Graphics2D',
- 'GraphicsConfigTemplate', 'GraphicsConfiguration',
- 'GraphicsDevice', 'GraphicsEnvironment',
- 'GrayFilter', 'GregorianCalendar',
- 'GridBagConstraints', 'GridBagLayout', 'GridLayout',
- 'Group', 'Guard', 'GuardedObject', 'GZIPInputStream',
- 'GZIPOutputStream', 'HasControls', 'HashMap',
- 'HashSet', 'Hashtable', 'HierarchyBoundsAdapter',
- 'HierarchyBoundsListener', 'HierarchyEvent',
- 'HierarchyListener', 'Highlighter',
- 'Highlighter.Highlight',
- 'Highlighter.HighlightPainter', 'HTML',
- 'HTML.Attribute', 'HTML.Tag', 'HTML.UnknownTag',
- 'HTMLDocument', 'HTMLDocument.Iterator',
- 'HTMLEditorKit', 'HTMLEditorKit.HTMLFactory',
- 'HTMLEditorKit.HTMLTextAction',
- 'HTMLEditorKit.InsertHTMLTextAction',
- 'HTMLEditorKit.LinkController',
- 'HTMLEditorKit.Parser',
- 'HTMLEditorKit.ParserCallback',
- 'HTMLFrameHyperlinkEvent', 'HTMLWriter',
- 'HttpURLConnection', 'HyperlinkEvent',
- 'HyperlinkEvent.EventType', 'HyperlinkListener',
- 'ICC_ColorSpace', 'ICC_Profile', 'ICC_ProfileGray',
- 'ICC_ProfileRGB', 'Icon', 'IconUIResource',
- 'IconView', 'IdentifierHelper', 'Identity',
- 'IdentityScope', 'IDLEntity', 'IDLType',
- 'IDLTypeHelper', 'IDLTypeOperations',
- 'IllegalAccessError', 'IllegalAccessException',
- 'IllegalArgumentException',
- 'IllegalComponentStateException',
- 'IllegalMonitorStateException',
- 'IllegalPathStateException', 'IllegalStateException',
- 'IllegalThreadStateException', 'Image',
- 'ImageConsumer', 'ImageFilter',
- 'ImageGraphicAttribute', 'ImageIcon',
- 'ImageObserver', 'ImageProducer',
- 'ImagingOpException', 'IMP_LIMIT',
- 'IncompatibleClassChangeError',
- 'InconsistentTypeCode', 'IndexColorModel',
- 'IndexedPropertyDescriptor',
- 'IndexOutOfBoundsException', 'IndirectionException',
- 'InetAddress', 'Inflater', 'InflaterInputStream',
- 'InheritableThreadLocal', 'InitialContext',
- 'InitialContextFactory',
- 'InitialContextFactoryBuilder', 'InitialDirContext',
- 'INITIALIZE', 'Initializer', 'InitialLdapContext',
- 'InlineView', 'InputContext', 'InputEvent',
- 'InputMap', 'InputMapUIResource', 'InputMethod',
- 'InputMethodContext', 'InputMethodDescriptor',
- 'InputMethodEvent', 'InputMethodHighlight',
- 'InputMethodListener', 'InputMethodRequests',
- 'InputStream',
- 'InputStreamReader', 'InputSubset', 'InputVerifier',
- 'Insets', 'InsetsUIResource', 'InstantiationError',
- 'InstantiationException', 'Instrument',
- 'InsufficientResourcesException', 'Integer',
- 'INTERNAL', 'InternalError', 'InternalFrameAdapter',
- 'InternalFrameEvent', 'InternalFrameListener',
- 'InternalFrameUI', 'InterruptedException',
- 'InterruptedIOException',
- 'InterruptedNamingException', 'INTF_REPOS',
- 'IntHolder', 'IntrospectionException',
- 'Introspector', 'Invalid',
- 'InvalidAlgorithmParameterException',
- 'InvalidAttributeIdentifierException',
- 'InvalidAttributesException',
- 'InvalidAttributeValueException',
- 'InvalidClassException',
- 'InvalidDnDOperationException',
- 'InvalidKeyException', 'InvalidKeySpecException',
- 'InvalidMidiDataException', 'InvalidName',
- 'InvalidNameException',
- 'InvalidNameHelper', 'InvalidNameHolder',
- 'InvalidObjectException',
- 'InvalidParameterException',
- 'InvalidParameterSpecException',
- 'InvalidSearchControlsException',
- 'InvalidSearchFilterException', 'InvalidSeq',
- 'InvalidTransactionException', 'InvalidValue',
- 'INVALID_TRANSACTION', 'InvocationEvent',
- 'InvocationHandler', 'InvocationTargetException',
- 'InvokeHandler', 'INV_FLAG', 'INV_IDENT',
- 'INV_OBJREF', 'INV_POLICY', 'IOException',
- 'IRObject', 'IRObjectOperations', 'IstringHelper',
- 'ItemEvent', 'ItemListener', 'ItemSelectable',
- 'Iterator', 'JApplet', 'JarEntry', 'JarException',
- 'JarFile', 'JarInputStream', 'JarOutputStream',
- 'JarURLConnection', 'JButton', 'JCheckBox',
- 'JCheckBoxMenuItem', 'JColorChooser', 'JComboBox',
- 'JComboBox.KeySelectionManager', 'JComponent',
- 'JDesktopPane', 'JDialog', 'JEditorPane',
- 'JFileChooser', 'JFrame', 'JInternalFrame',
- 'JInternalFrame.JDesktopIcon', 'JLabel',
- 'JLayeredPane', 'JList', 'JMenu', 'JMenuBar',
- 'JMenuItem', 'JobAttributes',
- 'JobAttributes.DefaultSelectionType',
- 'JobAttributes.DestinationType',
- 'JobAttributes.DialogType',
- 'JobAttributes.MultipleDocumentHandlingType',
- 'JobAttributes.SidesType', 'JOptionPane', 'JPanel',
- 'JPasswordField', 'JPopupMenu',
- 'JPopupMenu.Separator', 'JProgressBar',
- 'JRadioButton', 'JRadioButtonMenuItem', 'JRootPane',
- 'JScrollBar', 'JScrollPane', 'JSeparator', 'JSlider',
- 'JSplitPane', 'JTabbedPane', 'JTable',
- 'JTableHeader', 'JTextArea', 'JTextComponent',
- 'JTextComponent.KeyBinding', 'JTextField',
- 'JTextPane', 'JToggleButton',
- 'JToggleButton.ToggleButtonModel', 'JToolBar',
- 'JToolBar.Separator', 'JToolTip', 'JTree',
- 'JTree.DynamicUtilTreeNode',
- 'JTree.EmptySelectionModel', 'JViewport', 'JWindow',
- 'Kernel', 'Key', 'KeyAdapter', 'KeyEvent',
- 'KeyException', 'KeyFactory', 'KeyFactorySpi',
- 'KeyListener', 'KeyManagementException', 'Keymap',
- 'KeyPair', 'KeyPairGenerator', 'KeyPairGeneratorSpi',
- 'KeySpec', 'KeyStore', 'KeyStoreException',
- 'KeyStoreSpi', 'KeyStroke', 'Label', 'LabelUI',
- 'LabelView', 'LastOwnerException',
- 'LayeredHighlighter',
- 'LayeredHighlighter.LayerPainter', 'LayoutManager',
- 'LayoutManager2', 'LayoutQueue', 'LdapContext',
- 'LdapReferralException', 'Lease',
- 'LimitExceededException', 'Line', 'Line.Info',
- 'Line2D', 'Line2D.Double', 'Line2D.Float',
- 'LineBorder', 'LineBreakMeasurer', 'LineEvent',
- 'LineEvent.Type', 'LineListener', 'LineMetrics',
- 'LineNumberInputStream', 'LineNumberReader',
- 'LineUnavailableException', 'LinkageError',
- 'LinkedList', 'LinkException', 'LinkLoopException',
- 'LinkRef', 'List', 'ListCellRenderer',
- 'ListDataEvent', 'ListDataListener', 'ListIterator',
- 'ListModel', 'ListResourceBundle',
- 'ListSelectionEvent', 'ListSelectionListener',
- 'ListSelectionModel', 'ListUI', 'ListView',
- 'LoaderHandler', 'Locale', 'LocateRegistry',
- 'LogStream', 'Long', 'LongHolder',
- 'LongLongSeqHelper', 'LongLongSeqHolder',
- 'LongSeqHelper', 'LongSeqHolder', 'LookAndFeel',
- 'LookupOp', 'LookupTable', 'MalformedLinkException',
- 'MalformedURLException', 'Manifest', 'Map',
- 'Map.Entry', 'MARSHAL', 'MarshalException',
- 'MarshalledObject', 'Math', 'MatteBorder',
- 'MediaTracker', 'Member', 'MemoryImageSource',
- 'Menu', 'MenuBar', 'MenuBarUI', 'MenuComponent',
- 'MenuContainer', 'MenuDragMouseEvent',
- 'MenuDragMouseListener', 'MenuElement', 'MenuEvent',
- 'MenuItem', 'MenuItemUI', 'MenuKeyEvent',
- 'MenuKeyListener', 'MenuListener',
- 'MenuSelectionManager', 'MenuShortcut',
- 'MessageDigest', 'MessageDigestSpi', 'MessageFormat',
- 'MetaEventListener', 'MetalBorders',
- 'MetalBorders.ButtonBorder',
- 'MetalBorders.Flush3DBorder',
- 'MetalBorders.InternalFrameBorder',
- 'MetalBorders.MenuBarBorder',
- 'MetalBorders.MenuItemBorder',
- 'MetalBorders.OptionDialogBorder',
- 'MetalBorders.PaletteBorder',
- 'MetalBorders.PopupMenuBorder',
- 'MetalBorders.RolloverButtonBorder',
- 'MetalBorders.ScrollPaneBorder',
- 'MetalBorders.TableHeaderBorder',
- 'MetalBorders.TextFieldBorder',
- 'MetalBorders.ToggleButtonBorder',
- 'MetalBorders.ToolBarBorder', 'MetalButtonUI',
- 'MetalCheckBoxIcon', 'MetalCheckBoxUI',
- 'MetalComboBoxButton', 'MetalComboBoxEditor',
- 'MetalComboBoxEditor.UIResource',
- 'MetalComboBoxIcon', 'MetalComboBoxUI',
- 'MetalDesktopIconUI', 'MetalFileChooserUI',
- 'MetalIconFactory', 'MetalIconFactory.FileIcon16',
- 'MetalIconFactory.FolderIcon16',
- 'MetalIconFactory.PaletteCloseIcon',
- 'MetalIconFactory.TreeControlIcon',
- 'MetalIconFactory.TreeFolderIcon',
- 'MetalIconFactory.TreeLeafIcon',
- 'MetalInternalFrameTitlePane',
- 'MetalInternalFrameUI', 'MetalLabelUI',
- 'MetalLookAndFeel', 'MetalPopupMenuSeparatorUI',
- 'MetalProgressBarUI', 'MetalRadioButtonUI',
- 'MetalScrollBarUI', 'MetalScrollButton',
- 'MetalScrollPaneUI', 'MetalSeparatorUI',
- 'MetalSliderUI', 'MetalSplitPaneUI',
- 'MetalTabbedPaneUI', 'MetalTextFieldUI',
- 'MetalTheme', 'MetalToggleButtonUI',
- 'MetalToolBarUI', 'MetalToolTipUI', 'MetalTreeUI',
- 'MetaMessage', 'Method', 'MethodDescriptor',
- 'MidiChannel', 'MidiDevice', 'MidiDevice.Info',
- 'MidiDeviceProvider', 'MidiEvent', 'MidiFileFormat',
- 'MidiFileReader', 'MidiFileWriter', 'MidiMessage',
- 'MidiSystem', 'MidiUnavailableException',
- 'MimeTypeParseException', 'MinimalHTMLWriter',
- 'MissingResourceException', 'Mixer', 'Mixer.Info',
- 'MixerProvider', 'ModificationItem', 'Modifier',
- 'MouseAdapter', 'MouseDragGestureRecognizer',
- 'MouseEvent', 'MouseInputAdapter',
- 'MouseInputListener', 'MouseListener',
- 'MouseMotionAdapter', 'MouseMotionListener',
- 'MultiButtonUI', 'MulticastSocket',
- 'MultiColorChooserUI', 'MultiComboBoxUI',
- 'MultiDesktopIconUI', 'MultiDesktopPaneUI',
- 'MultiFileChooserUI', 'MultiInternalFrameUI',
- 'MultiLabelUI', 'MultiListUI', 'MultiLookAndFeel',
- 'MultiMenuBarUI', 'MultiMenuItemUI',
- 'MultiOptionPaneUI', 'MultiPanelUI',
- 'MultiPixelPackedSampleModel', 'MultipleMaster',
- 'MultiPopupMenuUI', 'MultiProgressBarUI',
- 'MultiScrollBarUI', 'MultiScrollPaneUI',
- 'MultiSeparatorUI', 'MultiSliderUI',
- 'MultiSplitPaneUI', 'MultiTabbedPaneUI',
- 'MultiTableHeaderUI', 'MultiTableUI', 'MultiTextUI',
- 'MultiToolBarUI', 'MultiToolTipUI', 'MultiTreeUI',
- 'MultiViewportUI', 'MutableAttributeSet',
- 'MutableComboBoxModel', 'MutableTreeNode', 'Name',
- 'NameAlreadyBoundException', 'NameClassPair',
- 'NameComponent', 'NameComponentHelper',
- 'NameComponentHolder', 'NamedValue', 'NameHelper',
- 'NameHolder', 'NameNotFoundException', 'NameParser',
- 'NamespaceChangeListener', 'NameValuePair',
- 'NameValuePairHelper', 'Naming', 'NamingContext',
- 'NamingContextHelper', 'NamingContextHolder',
- 'NamingContextOperations', 'NamingEnumeration',
- 'NamingEvent', 'NamingException',
- 'NamingExceptionEvent', 'NamingListener',
- 'NamingManager', 'NamingSecurityException',
- 'NegativeArraySizeException', 'NetPermission',
- 'NoClassDefFoundError', 'NoInitialContextException',
- 'NoninvertibleTransformException',
- 'NoPermissionException', 'NoRouteToHostException',
- 'NoSuchAlgorithmException',
- 'NoSuchAttributeException', 'NoSuchElementException',
- 'NoSuchFieldError', 'NoSuchFieldException',
- 'NoSuchMethodError', 'NoSuchMethodException',
- 'NoSuchObjectException', 'NoSuchProviderException',
- 'NotActiveException', 'NotBoundException',
- 'NotContextException', 'NotEmpty', 'NotEmptyHelper',
- 'NotEmptyHolder', 'NotFound', 'NotFoundHelper',
- 'NotFoundHolder', 'NotFoundReason',
- 'NotFoundReasonHelper', 'NotFoundReasonHolder',
- 'NotOwnerException', 'NotSerializableException',
- 'NO_IMPLEMENT', 'NO_MEMORY', 'NO_PERMISSION',
- 'NO_RESOURCES', 'NO_RESPONSE',
- 'NullPointerException', 'Number', 'NumberFormat',
- 'NumberFormatException', 'NVList', 'Object',
- 'ObjectChangeListener', 'ObjectFactory',
- 'ObjectFactoryBuilder', 'ObjectHelper',
- 'ObjectHolder', 'ObjectImpl',
- 'ObjectInput', 'ObjectInputStream',
- 'ObjectInputStream.GetField',
- 'ObjectInputValidation', 'ObjectOutput',
- 'ObjectOutputStream', 'ObjectOutputStream.PutField',
- 'ObjectStreamClass', 'ObjectStreamConstants',
- 'ObjectStreamException', 'ObjectStreamField',
- 'ObjectView', 'OBJECT_NOT_EXIST', 'ObjID',
- 'OBJ_ADAPTER', 'Observable', 'Observer',
- 'OctetSeqHelper', 'OctetSeqHolder', 'OMGVMCID',
- 'OpenType', 'Operation',
- 'OperationNotSupportedException', 'Option',
- 'OptionalDataException', 'OptionPaneUI', 'ORB',
- 'OutOfMemoryError', 'OutputStream',
- 'OutputStreamWriter', 'OverlayLayout', 'Owner',
- 'Package', 'PackedColorModel', 'Pageable',
- 'PageAttributes', 'PageAttributes.ColorType',
- 'PageAttributes.MediaType',
- 'PageAttributes.OrientationRequestedType',
- 'PageAttributes.OriginType',
- 'PageAttributes.PrintQualityType', 'PageFormat',
- 'Paint', 'PaintContext', 'PaintEvent', 'Panel',
- 'PanelUI', 'Paper', 'ParagraphView',
- 'ParameterBlock', 'ParameterDescriptor',
- 'ParseException', 'ParsePosition', 'Parser',
- 'ParserDelegator', 'PartialResultException',
- 'PasswordAuthentication', 'PasswordView', 'Patch',
- 'PathIterator', 'Permission',
- 'PermissionCollection', 'Permissions',
- 'PERSIST_STORE', 'PhantomReference',
- 'PipedInputStream', 'PipedOutputStream',
- 'PipedReader', 'PipedWriter', 'PixelGrabber',
- 'PixelInterleavedSampleModel', 'PKCS8EncodedKeySpec',
- 'PlainDocument', 'PlainView', 'Point', 'Point2D',
- 'Point2D.Double', 'Point2D.Float', 'Policy',
- 'PolicyError', 'PolicyHelper',
- 'PolicyHolder', 'PolicyListHelper',
- 'PolicyListHolder', 'PolicyOperations',
- 'PolicyTypeHelper', 'Polygon', 'PopupMenu',
- 'PopupMenuEvent', 'PopupMenuListener', 'PopupMenuUI',
- 'Port', 'Port.Info', 'PortableRemoteObject',
- 'PortableRemoteObjectDelegate', 'Position',
- 'Position.Bias', 'PreparedStatement', 'Principal',
- 'PrincipalHolder', 'Printable',
- 'PrinterAbortException', 'PrinterException',
- 'PrinterGraphics', 'PrinterIOException',
- 'PrinterJob', 'PrintGraphics', 'PrintJob',
- 'PrintStream', 'PrintWriter', 'PrivateKey',
- 'PRIVATE_MEMBER', 'PrivilegedAction',
- 'PrivilegedActionException',
- 'PrivilegedExceptionAction', 'Process',
- 'ProfileDataException', 'ProgressBarUI',
- 'ProgressMonitor', 'ProgressMonitorInputStream',
- 'Properties', 'PropertyChangeEvent',
- 'PropertyChangeListener', 'PropertyChangeSupport',
- 'PropertyDescriptor', 'PropertyEditor',
- 'PropertyEditorManager', 'PropertyEditorSupport',
- 'PropertyPermission', 'PropertyResourceBundle',
- 'PropertyVetoException', 'ProtectionDomain',
- 'ProtocolException', 'Provider', 'ProviderException',
- 'Proxy', 'PublicKey', 'PUBLIC_MEMBER',
- 'PushbackInputStream', 'PushbackReader',
- 'QuadCurve2D', 'QuadCurve2D.Double',
- 'QuadCurve2D.Float', 'Random', 'RandomAccessFile',
- 'Raster', 'RasterFormatException', 'RasterOp',
- 'Reader', 'Receiver', 'Rectangle', 'Rectangle2D',
- 'Rectangle2D.Double', 'Rectangle2D.Float',
- 'RectangularShape', 'Ref', 'RefAddr', 'Reference',
- 'Referenceable', 'ReferenceQueue',
- 'ReferralException', 'ReflectPermission', 'Registry',
- 'RegistryHandler', 'RemarshalException', 'Remote',
- 'RemoteCall', 'RemoteException', 'RemoteObject',
- 'RemoteRef', 'RemoteServer', 'RemoteStub',
- 'RenderableImage', 'RenderableImageOp',
- 'RenderableImageProducer', 'RenderContext',
- 'RenderedImage', 'RenderedImageFactory', 'Renderer',
- 'RenderingHints', 'RenderingHints.Key',
- 'RepaintManager', 'ReplicateScaleFilter',
- 'Repository', 'RepositoryIdHelper', 'Request',
- 'RescaleOp', 'Resolver', 'ResolveResult',
- 'ResourceBundle', 'ResponseHandler', 'ResultSet',
- 'ResultSetMetaData', 'ReverbType', 'RGBImageFilter',
- 'RMIClassLoader', 'RMIClientSocketFactory',
- 'RMIFailureHandler', 'RMISecurityException',
- 'RMISecurityManager', 'RMIServerSocketFactory',
- 'RMISocketFactory', 'Robot', 'RootPaneContainer',
- 'RootPaneUI', 'RoundRectangle2D',
- 'RoundRectangle2D.Double', 'RoundRectangle2D.Float',
- 'RowMapper', 'RSAKey', 'RSAKeyGenParameterSpec',
- 'RSAPrivateCrtKey', 'RSAPrivateCrtKeySpec',
- 'RSAPrivateKey', 'RSAPrivateKeySpec', 'RSAPublicKey',
- 'RSAPublicKeySpec', 'RTFEditorKit',
- 'RuleBasedCollator', 'Runnable', 'RunTime',
- 'Runtime', 'RuntimeException', 'RunTimeOperations',
- 'RuntimePermission', 'SampleModel',
- 'SchemaViolationException', 'Scrollable',
- 'Scrollbar', 'ScrollBarUI', 'ScrollPane',
- 'ScrollPaneConstants', 'ScrollPaneLayout',
- 'ScrollPaneLayout.UIResource', 'ScrollPaneUI',
- 'SearchControls', 'SearchResult',
- 'SecureClassLoader', 'SecureRandom',
- 'SecureRandomSpi', 'Security', 'SecurityException',
- 'SecurityManager', 'SecurityPermission', 'Segment',
- 'SeparatorUI', 'Sequence', 'SequenceInputStream',
- 'Sequencer', 'Sequencer.SyncMode', 'Serializable',
- 'SerializablePermission', 'ServantObject',
- 'ServerCloneException', 'ServerError',
- 'ServerException', 'ServerNotActiveException',
- 'ServerRef', 'ServerRequest',
- 'ServerRuntimeException', 'ServerSocket',
- 'ServiceDetail', 'ServiceDetailHelper',
- 'ServiceInformation', 'ServiceInformationHelper',
- 'ServiceInformationHolder',
- 'ServiceUnavailableException', 'Set',
- 'SetOverrideType', 'SetOverrideTypeHelper', 'Shape',
- 'ShapeGraphicAttribute', 'Short', 'ShortHolder',
- 'ShortLookupTable', 'ShortMessage', 'ShortSeqHelper',
- 'ShortSeqHolder', 'Signature', 'SignatureException',
- 'SignatureSpi', 'SignedObject', 'Signer',
- 'SimpleAttributeSet', 'SimpleBeanInfo',
- 'SimpleDateFormat', 'SimpleTimeZone',
- 'SinglePixelPackedSampleModel',
- 'SingleSelectionModel', 'SizeLimitExceededException',
- 'SizeRequirements', 'SizeSequence', 'Skeleton',
- 'SkeletonMismatchException',
- 'SkeletonNotFoundException', 'SliderUI', 'Socket',
- 'SocketException', 'SocketImpl', 'SocketImplFactory',
- 'SocketOptions', 'SocketPermission',
- 'SocketSecurityException', 'SoftBevelBorder',
- 'SoftReference', 'SortedMap', 'SortedSet',
- 'Soundbank', 'SoundbankReader', 'SoundbankResource',
- 'SourceDataLine', 'SplitPaneUI', 'SQLData',
- 'SQLException', 'SQLInput', 'SQLOutput',
- 'SQLPermission', 'SQLWarning', 'Stack',
- 'StackOverflowError', 'StateEdit', 'StateEditable',
- 'StateFactory', 'Statement', 'Streamable',
- 'StreamableValue', 'StreamCorruptedException',
- 'StreamTokenizer', 'StrictMath', 'String',
- 'StringBuffer', 'StringBufferInputStream',
- 'StringCharacterIterator', 'StringContent',
- 'StringHolder', 'StringIndexOutOfBoundsException',
- 'StringReader', 'StringRefAddr', 'StringSelection',
- 'StringTokenizer', 'StringValueHelper',
- 'StringWriter', 'Stroke', 'Struct', 'StructMember',
- 'StructMemberHelper', 'Stub', 'StubDelegate',
- 'StubNotFoundException', 'Style', 'StyleConstants',
- 'StyleConstants.CharacterConstants',
- 'StyleConstants.ColorConstants',
- 'StyleConstants.FontConstants',
- 'StyleConstants.ParagraphConstants', 'StyleContext',
- 'StyledDocument', 'StyledEditorKit',
- 'StyledEditorKit.AlignmentAction',
- 'StyledEditorKit.BoldAction',
- 'StyledEditorKit.FontFamilyAction',
- 'StyledEditorKit.FontSizeAction',
- 'StyledEditorKit.ForegroundAction',
- 'StyledEditorKit.ItalicAction',
- 'StyledEditorKit.StyledTextAction',
- 'StyledEditorKit.UnderlineAction', 'StyleSheet',
- 'StyleSheet.BoxPainter', 'StyleSheet.ListPainter',
- 'SwingConstants', 'SwingPropertyChangeSupport',
- 'SwingUtilities', 'SyncFailedException',
- 'Synthesizer', 'SysexMessage', 'System',
- 'SystemColor', 'SystemException', 'SystemFlavorMap',
- 'TabableView', 'TabbedPaneUI', 'TabExpander',
- 'TableCellEditor', 'TableCellRenderer',
- 'TableColumn', 'TableColumnModel',
- 'TableColumnModelEvent', 'TableColumnModelListener',
- 'TableHeaderUI', 'TableModel', 'TableModelEvent',
- 'TableModelListener', 'TableUI', 'TableView',
- 'TabSet', 'TabStop', 'TagElement', 'TargetDataLine',
- 'TCKind', 'TextAction', 'TextArea', 'TextAttribute',
- 'TextComponent', 'TextEvent', 'TextField',
- 'TextHitInfo', 'TextLayout',
- 'TextLayout.CaretPolicy', 'TextListener',
- 'TextMeasurer', 'TextUI', 'TexturePaint', 'Thread',
- 'ThreadDeath', 'ThreadGroup', 'ThreadLocal',
- 'Throwable', 'Tie', 'TileObserver', 'Time',
- 'TimeLimitExceededException', 'Timer',
- 'TimerTask', 'Timestamp', 'TimeZone', 'TitledBorder',
- 'ToolBarUI', 'Toolkit', 'ToolTipManager',
- 'ToolTipUI', 'TooManyListenersException', 'Track',
- 'TransactionRequiredException',
- 'TransactionRolledbackException',
- 'TRANSACTION_REQUIRED', 'TRANSACTION_ROLLEDBACK',
- 'Transferable', 'TransformAttribute', 'TRANSIENT',
- 'Transmitter', 'Transparency', 'TreeCellEditor',
- 'TreeCellRenderer', 'TreeExpansionEvent',
- 'TreeExpansionListener', 'TreeMap', 'TreeModel',
- 'TreeModelEvent', 'TreeModelListener', 'TreeNode',
- 'TreePath', 'TreeSelectionEvent',
- 'TreeSelectionListener', 'TreeSelectionModel',
- 'TreeSet', 'TreeUI', 'TreeWillExpandListener',
- 'TypeCode', 'TypeCodeHolder', 'TypeMismatch',
- 'Types', 'UID', 'UIDefaults',
- 'UIDefaults.ActiveValue', 'UIDefaults.LazyInputMap',
- 'UIDefaults.LazyValue', 'UIDefaults.ProxyLazyValue',
- 'UIManager', 'UIManager.LookAndFeelInfo',
- 'UIResource', 'ULongLongSeqHelper',
- 'ULongLongSeqHolder', 'ULongSeqHelper',
- 'ULongSeqHolder', 'UndeclaredThrowableException',
- 'UndoableEdit', 'UndoableEditEvent',
- 'UndoableEditListener', 'UndoableEditSupport',
- 'UndoManager', 'UnexpectedException',
- 'UnicastRemoteObject', 'UnionMember',
- 'UnionMemberHelper', 'UNKNOWN', 'UnknownError',
- 'UnknownException', 'UnknownGroupException',
- 'UnknownHostException',
- 'UnknownObjectException', 'UnknownServiceException',
- 'UnknownUserException', 'UnmarshalException',
- 'UnrecoverableKeyException', 'Unreferenced',
- 'UnresolvedPermission', 'UnsatisfiedLinkError',
- 'UnsolicitedNotification',
- 'UnsolicitedNotificationEvent',
- 'UnsolicitedNotificationListener',
- 'UnsupportedAudioFileException',
- 'UnsupportedClassVersionError',
- 'UnsupportedEncodingException',
- 'UnsupportedFlavorException',
- 'UnsupportedLookAndFeelException',
- 'UnsupportedOperationException',
- 'UNSUPPORTED_POLICY', 'UNSUPPORTED_POLICY_VALUE',
- 'URL', 'URLClassLoader', 'URLConnection',
- 'URLDecoder', 'URLEncoder', 'URLStreamHandler',
- 'URLStreamHandlerFactory', 'UserException',
- 'UShortSeqHelper', 'UShortSeqHolder',
- 'UTFDataFormatException', 'Util', 'UtilDelegate',
- 'Utilities', 'ValueBase', 'ValueBaseHelper',
- 'ValueBaseHolder', 'ValueFactory', 'ValueHandler',
- 'ValueMember', 'ValueMemberHelper',
- 'VariableHeightLayoutCache', 'Vector', 'VerifyError',
- 'VersionSpecHelper', 'VetoableChangeListener',
- 'VetoableChangeSupport', 'View', 'ViewFactory',
- 'ViewportLayout', 'ViewportUI',
- 'VirtualMachineError', 'Visibility',
- 'VisibilityHelper', 'VMID', 'VM_ABSTRACT',
- 'VM_CUSTOM', 'VM_NONE', 'VM_TRUNCATABLE',
- 'VoiceStatus', 'Void', 'WCharSeqHelper',
- 'WCharSeqHolder', 'WeakHashMap', 'WeakReference',
- 'Window', 'WindowAdapter', 'WindowConstants',
- 'WindowEvent', 'WindowListener', 'WrappedPlainView',
- 'WritableRaster', 'WritableRenderedImage',
- 'WriteAbortedException', 'Writer',
- 'WrongTransaction', 'WStringValueHelper',
- 'X509Certificate', 'X509CRL', 'X509CRLEntry',
- 'X509EncodedKeySpec', 'X509Extension', 'ZipEntry',
- 'ZipException', 'ZipFile', 'ZipInputStream',
- 'ZipOutputStream', 'ZoneView',
- '_BindingIteratorImplBase', '_BindingIteratorStub',
- '_IDLTypeStub', '_NamingContextImplBase',
- '_NamingContextStub', '_PolicyStub', '_Remote_Stub'
- ),
- 4 => array(
- 'void', 'double', 'int', 'boolean', 'byte', 'short', 'long', 'char', 'float'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}',
- '+', '-', '*', '/', '%',
- '!', '&', '|', '^',
- '<', '>', '=',
- '?', ':', ';',
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => true,
- 4 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #000066; font-weight: bold;',
- 3 => 'color: #003399;',
- 4 => 'color: #000066; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #006699;',
- 3 => 'color: #008000; font-style: italic; font-weight: bold;',
- 3 => 'color: #008000; font-style: italic; font-weight: bold;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006633;',
- 2 => 'color: #006633;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.google.com/search?hl=en&amp;q=allinurl%3A{FNAMEL}+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/java5.php b/libvpx/examples/includes/geshi/geshi/java5.php
deleted file mode 100644
index 1766ef9..0000000
--- a/libvpx/examples/includes/geshi/geshi/java5.php
+++ /dev/null
@@ -1,1031 +0,0 @@
-<?php
-/*************************************************************************************
- * java.php
- * --------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/10
- *
- * Java language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/25 (1.0.7.22)
- * - Added highlighting of import and package directives as non-OOP
- * 2005/12/28 (1.0.4)
- * - Added instanceof keyword
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/08/05 (1.0.2)
- * - Added URL support
- * - Added keyword "this", as bugs in GeSHi class ironed out
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * - Added extra missed keywords
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO
- * -------------------------
- * *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Java(TM) 2 Platform Standard Edition 5.0',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Import and Package directives (Basic Support only)
- 2 => '/(?:(?<=import[\\n\\s])|(?<=package[\\n\\s]))[\\n\\s]*([a-zA-Z0-9_]+\\.)*([a-zA-Z0-9_]+|\*)(?=[\n\s;])/i',
- // javadoc comments
- 3 => '#/\*\*(?![\*\/]).*\*/#sU'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- /* see the authoritative list of all 50 Java keywords at */
- /* http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#229308 */
-
- /* java keywords, part 1: control flow */
- 'case', 'default', 'do', 'else', 'for',
- 'goto', 'if', 'switch', 'while'
-
- /* IMO 'break', 'continue', 'return' and 'throw' */
- /* should also be added to this group, as they */
- /* also manage the control flow, */
- /* arguably 'try'/'catch'/'finally' as well */
- ),
- 2 => array(
- /* java keywords, part 2 */
-
- 'break', 'continue', 'return', 'throw',
- 'try', 'catch', 'finally',
-
- 'abstract', 'assert', 'class', 'const', 'enum', 'extends',
- 'final', 'implements', 'import', 'instanceof', 'interface',
- 'native', 'new', 'package', 'private', 'protected',
- 'public', 'static', 'strictfp', 'super', 'synchronized',
- 'this', 'throws', 'transient', 'volatile'
- ),
- 3 => array(
- /* Java keywords, part 3: primitive data types and 'void' */
- 'boolean', 'byte', 'char', 'double',
- 'float', 'int', 'long', 'short', 'void'
- ),
- 4 => array(
- /* other reserved words in Java: literals */
- /* should be styled to look similar to numbers and Strings */
- 'false', 'null', 'true'
- ),
- 5 => array (
- 'Applet', 'AppletContext', 'AppletStub', 'AudioClip'
- ),
- 6 => array (
- 'AWTError', 'AWTEvent', 'AWTEventMulticaster', 'AWTException', 'AWTKeyStroke', 'AWTPermission', 'ActiveEvent', 'Adjustable', 'AlphaComposite', 'BasicStroke', 'BorderLayout', 'BufferCapabilities', 'BufferCapabilities.FlipContents', 'Button', 'Canvas', 'CardLayout', 'Checkbox', 'CheckboxGroup', 'CheckboxMenuItem', 'Choice', 'Color', 'Component', 'ComponentOrientation', 'Composite', 'CompositeContext', 'Container', 'ContainerOrderFocusTraversalPolicy', 'Cursor', 'DefaultFocusTraversalPolicy', 'DefaultKeyboardFocusManager', 'Dialog', 'Dimension', 'DisplayMode', 'EventQueue', 'FileDialog', 'FlowLayout', 'FocusTraversalPolicy', 'Font', 'FontFormatException', 'FontMetrics', 'Frame', 'GradientPaint', 'Graphics', 'Graphics2D', 'GraphicsConfigTemplate', 'GraphicsConfiguration', 'GraphicsDevice', 'GraphicsEnvironment', 'GridBagConstraints', 'GridBagLayout', 'GridLayout', 'HeadlessException', 'IllegalComponentStateException', 'Image', 'ImageCapabilities', 'Insets', 'ItemSelectable', 'JobAttributes',
- 'JobAttributes.DefaultSelectionType', 'JobAttributes.DestinationType', 'JobAttributes.DialogType', 'JobAttributes.MultipleDocumentHandlingType', 'JobAttributes.SidesType', 'KeyEventDispatcher', 'KeyEventPostProcessor', 'KeyboardFocusManager', 'Label', 'LayoutManager', 'LayoutManager2', 'MediaTracker', 'Menu', 'MenuBar', 'MenuComponent', 'MenuContainer', 'MenuItem', 'MenuShortcut', 'MouseInfo', 'PageAttributes', 'PageAttributes.ColorType', 'PageAttributes.MediaType', 'PageAttributes.OrientationRequestedType', 'PageAttributes.OriginType', 'PageAttributes.PrintQualityType', 'Paint', 'PaintContext', 'Panel', 'Point', 'PointerInfo', 'Polygon', 'PopupMenu', 'PrintGraphics', 'PrintJob', 'Rectangle', 'RenderingHints', 'RenderingHints.Key', 'Robot', 'ScrollPane', 'ScrollPaneAdjustable', 'Scrollbar', 'Shape', 'Stroke', 'SystemColor', 'TextArea', 'TextComponent', 'TextField', 'TexturePaint', 'Toolkit', 'Transparency', 'Window'
- ),
- 7 => array (
- 'CMMException', 'ColorSpace', 'ICC_ColorSpace', 'ICC_Profile', 'ICC_ProfileGray', 'ICC_ProfileRGB', 'ProfileDataException'
- ),
- 8 => array (
- 'Clipboard', 'ClipboardOwner', 'DataFlavor', 'FlavorEvent', 'FlavorListener', 'FlavorMap', 'FlavorTable', 'MimeTypeParseException', 'StringSelection', 'SystemFlavorMap', 'Transferable', 'UnsupportedFlavorException'
- ),
- 9 => array (
- 'Autoscroll', 'DnDConstants', 'DragGestureEvent', 'DragGestureListener', 'DragGestureRecognizer', 'DragSource', 'DragSourceAdapter', 'DragSourceContext', 'DragSourceDragEvent', 'DragSourceDropEvent', 'DragSourceEvent', 'DragSourceListener', 'DragSourceMotionListener', 'DropTarget', 'DropTarget.DropTargetAutoScroller', 'DropTargetAdapter', 'DropTargetContext', 'DropTargetDragEvent', 'DropTargetDropEvent', 'DropTargetEvent', 'DropTargetListener', 'InvalidDnDOperationException', 'MouseDragGestureRecognizer'
- ),
- 10 => array (
- 'AWTEventListener', 'AWTEventListenerProxy', 'ActionEvent', 'ActionListener', 'AdjustmentEvent', 'AdjustmentListener', 'ComponentAdapter', 'ComponentEvent', 'ComponentListener', 'ContainerAdapter', 'ContainerEvent', 'ContainerListener', 'FocusAdapter', 'FocusEvent', 'FocusListener', 'HierarchyBoundsAdapter', 'HierarchyBoundsListener', 'HierarchyEvent', 'HierarchyListener', 'InputEvent', 'InputMethodEvent', 'InputMethodListener', 'InvocationEvent', 'ItemEvent', 'ItemListener', 'KeyAdapter', 'KeyEvent', 'KeyListener', 'MouseAdapter', 'MouseListener', 'MouseMotionAdapter', 'MouseMotionListener', 'MouseWheelEvent', 'MouseWheelListener', 'PaintEvent', 'TextEvent', 'TextListener', 'WindowAdapter', 'WindowEvent', 'WindowFocusListener', 'WindowListener', 'WindowStateListener'
- ),
- 11 => array (
- 'FontRenderContext', 'GlyphJustificationInfo', 'GlyphMetrics', 'GlyphVector', 'GraphicAttribute', 'ImageGraphicAttribute', 'LineBreakMeasurer', 'LineMetrics', 'MultipleMaster', 'NumericShaper', 'ShapeGraphicAttribute', 'TextAttribute', 'TextHitInfo', 'TextLayout', 'TextLayout.CaretPolicy', 'TextMeasurer', 'TransformAttribute'
- ),
- 12 => array (
- 'AffineTransform', 'Arc2D', 'Arc2D.Double', 'Arc2D.Float', 'Area', 'CubicCurve2D', 'CubicCurve2D.Double', 'CubicCurve2D.Float', 'Dimension2D', 'Ellipse2D', 'Ellipse2D.Double', 'Ellipse2D.Float', 'FlatteningPathIterator', 'GeneralPath', 'IllegalPathStateException', 'Line2D', 'Line2D.Double', 'Line2D.Float', 'NoninvertibleTransformException', 'PathIterator', 'Point2D', 'Point2D.Double', 'Point2D.Float', 'QuadCurve2D', 'QuadCurve2D.Double', 'QuadCurve2D.Float', 'Rectangle2D', 'Rectangle2D.Double', 'Rectangle2D.Float', 'RectangularShape', 'RoundRectangle2D', 'RoundRectangle2D.Double', 'RoundRectangle2D.Float'
- ),
- 13 => array (
- 'InputContext', 'InputMethodHighlight', 'InputMethodRequests', 'InputSubset'
- ),
- 14 => array (
- 'InputMethod', 'InputMethodContext', 'InputMethodDescriptor'
- ),
- 15 => array (
- 'AffineTransformOp', 'AreaAveragingScaleFilter', 'BandCombineOp', 'BandedSampleModel', 'BufferStrategy', 'BufferedImage', 'BufferedImageFilter', 'BufferedImageOp', 'ByteLookupTable', 'ColorConvertOp', 'ColorModel', 'ComponentColorModel', 'ComponentSampleModel', 'ConvolveOp', 'CropImageFilter', 'DataBuffer', 'DataBufferByte', 'DataBufferDouble', 'DataBufferFloat', 'DataBufferInt', 'DataBufferShort', 'DataBufferUShort', 'DirectColorModel', 'FilteredImageSource', 'ImageConsumer', 'ImageFilter', 'ImageObserver', 'ImageProducer', 'ImagingOpException', 'IndexColorModel', 'Kernel', 'LookupOp', 'LookupTable', 'MemoryImageSource', 'MultiPixelPackedSampleModel', 'PackedColorModel', 'PixelGrabber', 'PixelInterleavedSampleModel', 'RGBImageFilter', 'Raster', 'RasterFormatException', 'RasterOp', 'RenderedImage', 'ReplicateScaleFilter', 'RescaleOp', 'SampleModel', 'ShortLookupTable', 'SinglePixelPackedSampleModel', 'TileObserver', 'VolatileImage', 'WritableRaster', 'WritableRenderedImage'
- ),
- 16 => array (
- 'ContextualRenderedImageFactory', 'ParameterBlock', 'RenderContext', 'RenderableImage', 'RenderableImageOp', 'RenderableImageProducer', 'RenderedImageFactory'
- ),
- 17 => array (
- 'Book', 'PageFormat', 'Pageable', 'Paper', 'Printable', 'PrinterAbortException', 'PrinterException', 'PrinterGraphics', 'PrinterIOException', 'PrinterJob'
- ),
- 18 => array (
- 'AppletInitializer', 'BeanDescriptor', 'BeanInfo', 'Beans', 'Customizer', 'DefaultPersistenceDelegate', 'DesignMode', 'Encoder', 'EventHandler', 'EventSetDescriptor', 'ExceptionListener', 'Expression', 'FeatureDescriptor', 'IndexedPropertyChangeEvent', 'IndexedPropertyDescriptor', 'Introspector', 'MethodDescriptor', 'ParameterDescriptor', 'PersistenceDelegate', 'PropertyChangeEvent', 'PropertyChangeListener', 'PropertyChangeListenerProxy', 'PropertyChangeSupport', 'PropertyDescriptor', 'PropertyEditor', 'PropertyEditorManager', 'PropertyEditorSupport', 'PropertyVetoException', 'SimpleBeanInfo', 'VetoableChangeListener', 'VetoableChangeListenerProxy', 'VetoableChangeSupport', 'Visibility', 'XMLDecoder', 'XMLEncoder'
- ),
- 19 => array (
- 'BeanContext', 'BeanContextChild', 'BeanContextChildComponentProxy', 'BeanContextChildSupport', 'BeanContextContainerProxy', 'BeanContextEvent', 'BeanContextMembershipEvent', 'BeanContextMembershipListener', 'BeanContextProxy', 'BeanContextServiceAvailableEvent', 'BeanContextServiceProvider', 'BeanContextServiceProviderBeanInfo', 'BeanContextServiceRevokedEvent', 'BeanContextServiceRevokedListener', 'BeanContextServices', 'BeanContextServicesListener', 'BeanContextServicesSupport', 'BeanContextServicesSupport.BCSSServiceProvider', 'BeanContextSupport', 'BeanContextSupport.BCSIterator'
- ),
- 20 => array (
- 'BufferedInputStream', 'BufferedOutputStream', 'BufferedReader', 'BufferedWriter', 'ByteArrayInputStream', 'ByteArrayOutputStream', 'CharArrayReader', 'CharArrayWriter', 'CharConversionException', 'Closeable', 'DataInput', 'DataOutput', 'EOFException', 'Externalizable', 'File', 'FileDescriptor', 'FileInputStream', 'FileNotFoundException', 'FileOutputStream', 'FilePermission', 'FileReader', 'FileWriter', 'FilenameFilter', 'FilterInputStream', 'FilterOutputStream', 'FilterReader', 'FilterWriter', 'Flushable', 'IOException', 'InputStreamReader', 'InterruptedIOException', 'InvalidClassException', 'InvalidObjectException', 'LineNumberInputStream', 'LineNumberReader', 'NotActiveException', 'NotSerializableException', 'ObjectInput', 'ObjectInputStream', 'ObjectInputStream.GetField', 'ObjectInputValidation', 'ObjectOutput', 'ObjectOutputStream', 'ObjectOutputStream.PutField', 'ObjectStreamClass', 'ObjectStreamConstants', 'ObjectStreamException', 'ObjectStreamField', 'OptionalDataException', 'OutputStreamWriter',
- 'PipedInputStream', 'PipedOutputStream', 'PipedReader', 'PipedWriter', 'PrintStream', 'PrintWriter', 'PushbackInputStream', 'PushbackReader', 'RandomAccessFile', 'Reader', 'SequenceInputStream', 'Serializable', 'SerializablePermission', 'StreamCorruptedException', 'StreamTokenizer', 'StringBufferInputStream', 'StringReader', 'StringWriter', 'SyncFailedException', 'UTFDataFormatException', 'UnsupportedEncodingException', 'WriteAbortedException', 'Writer'
- ),
- 21 => array (
- 'AbstractMethodError', 'Appendable', 'ArithmeticException', 'ArrayIndexOutOfBoundsException', 'ArrayStoreException', 'AssertionError', 'Boolean', 'Byte', 'CharSequence', 'Character', 'Character.Subset', 'Character.UnicodeBlock', 'Class', 'ClassCastException', 'ClassCircularityError', 'ClassFormatError', 'ClassLoader', 'ClassNotFoundException', 'CloneNotSupportedException', 'Cloneable', 'Comparable', 'Compiler', 'Deprecated', 'Double', 'Enum', 'EnumConstantNotPresentException', 'Error', 'Exception', 'ExceptionInInitializerError', 'Float', 'IllegalAccessError', 'IllegalAccessException', 'IllegalArgumentException', 'IllegalMonitorStateException', 'IllegalStateException', 'IllegalThreadStateException', 'IncompatibleClassChangeError', 'IndexOutOfBoundsException', 'InheritableThreadLocal', 'InstantiationError', 'InstantiationException', 'Integer', 'InternalError', 'InterruptedException', 'Iterable', 'LinkageError', 'Long', 'Math', 'NegativeArraySizeException', 'NoClassDefFoundError', 'NoSuchFieldError',
- 'NoSuchFieldException', 'NoSuchMethodError', 'NoSuchMethodException', 'NullPointerException', 'Number', 'NumberFormatException', 'OutOfMemoryError', 'Override', 'Package', 'Process', 'ProcessBuilder', 'Readable', 'Runnable', 'Runtime', 'RuntimeException', 'RuntimePermission', 'SecurityException', 'SecurityManager', 'Short', 'StackOverflowError', 'StackTraceElement', 'StrictMath', 'String', 'StringBuffer', 'StringBuilder', 'StringIndexOutOfBoundsException', 'SuppressWarnings', 'System', 'Thread', 'Thread.State', 'Thread.UncaughtExceptionHandler', 'ThreadDeath', 'ThreadGroup', 'ThreadLocal', 'Throwable', 'TypeNotPresentException', 'UnknownError', 'UnsatisfiedLinkError', 'UnsupportedClassVersionError', 'UnsupportedOperationException', 'VerifyError', 'VirtualMachineError', 'Void'
- ),
- 22 => array (
- 'AnnotationFormatError', 'AnnotationTypeMismatchException', 'Documented', 'ElementType', 'IncompleteAnnotationException', 'Inherited', 'Retention', 'RetentionPolicy', 'Target'
- ),
- 23 => array (
- 'ClassDefinition', 'ClassFileTransformer', 'IllegalClassFormatException', 'Instrumentation', 'UnmodifiableClassException'
- ),
- 24 => array (
- 'ClassLoadingMXBean', 'CompilationMXBean', 'GarbageCollectorMXBean', 'ManagementFactory', 'ManagementPermission', 'MemoryMXBean', 'MemoryManagerMXBean', 'MemoryNotificationInfo', 'MemoryPoolMXBean', 'MemoryType', 'MemoryUsage', 'OperatingSystemMXBean', 'RuntimeMXBean', 'ThreadInfo', 'ThreadMXBean'
- ),
- 25 => array (
- 'PhantomReference', 'ReferenceQueue', 'SoftReference', 'WeakReference'
- ),
- 26 => array (
- 'AccessibleObject', 'AnnotatedElement', 'Constructor', 'Field', 'GenericArrayType', 'GenericDeclaration', 'GenericSignatureFormatError', 'InvocationHandler', 'InvocationTargetException', 'MalformedParameterizedTypeException', 'Member', 'Method', 'Modifier', 'ParameterizedType', 'ReflectPermission', 'Type', 'TypeVariable', 'UndeclaredThrowableException', 'WildcardType'
- ),
- 27 => array (
- 'BigDecimal', 'BigInteger', 'MathContext', 'RoundingMode'
- ),
- 28 => array (
- 'Authenticator', 'Authenticator.RequestorType', 'BindException', 'CacheRequest', 'CacheResponse', 'ContentHandlerFactory', 'CookieHandler', 'DatagramPacket', 'DatagramSocket', 'DatagramSocketImpl', 'DatagramSocketImplFactory', 'FileNameMap', 'HttpRetryException', 'HttpURLConnection', 'Inet4Address', 'Inet6Address', 'InetAddress', 'InetSocketAddress', 'JarURLConnection', 'MalformedURLException', 'MulticastSocket', 'NetPermission', 'NetworkInterface', 'NoRouteToHostException', 'PasswordAuthentication', 'PortUnreachableException', 'ProtocolException', 'Proxy.Type', 'ProxySelector', 'ResponseCache', 'SecureCacheResponse', 'ServerSocket', 'Socket', 'SocketAddress', 'SocketException', 'SocketImpl', 'SocketImplFactory', 'SocketOptions', 'SocketPermission', 'SocketTimeoutException', 'URI', 'URISyntaxException', 'URL', 'URLClassLoader', 'URLConnection', 'URLDecoder', 'URLEncoder', 'URLStreamHandler', 'URLStreamHandlerFactory', 'UnknownServiceException'
- ),
- 29 => array (
- 'Buffer', 'BufferOverflowException', 'BufferUnderflowException', 'ByteBuffer', 'ByteOrder', 'CharBuffer', 'DoubleBuffer', 'FloatBuffer', 'IntBuffer', 'InvalidMarkException', 'LongBuffer', 'MappedByteBuffer', 'ReadOnlyBufferException', 'ShortBuffer'
- ),
- 30 => array (
- 'AlreadyConnectedException', 'AsynchronousCloseException', 'ByteChannel', 'CancelledKeyException', 'Channel', 'Channels', 'ClosedByInterruptException', 'ClosedChannelException', 'ClosedSelectorException', 'ConnectionPendingException', 'DatagramChannel', 'FileChannel', 'FileChannel.MapMode', 'FileLock', 'FileLockInterruptionException', 'GatheringByteChannel', 'IllegalBlockingModeException', 'IllegalSelectorException', 'InterruptibleChannel', 'NoConnectionPendingException', 'NonReadableChannelException', 'NonWritableChannelException', 'NotYetBoundException', 'NotYetConnectedException', 'OverlappingFileLockException', 'Pipe', 'Pipe.SinkChannel', 'Pipe.SourceChannel', 'ReadableByteChannel', 'ScatteringByteChannel', 'SelectableChannel', 'SelectionKey', 'Selector', 'ServerSocketChannel', 'SocketChannel', 'UnresolvedAddressException', 'UnsupportedAddressTypeException', 'WritableByteChannel'
- ),
- 31 => array (
- 'AbstractInterruptibleChannel', 'AbstractSelectableChannel', 'AbstractSelectionKey', 'AbstractSelector', 'SelectorProvider'
- ),
- 32 => array (
- 'CharacterCodingException', 'Charset', 'CharsetDecoder', 'CharsetEncoder', 'CoderMalfunctionError', 'CoderResult', 'CodingErrorAction', 'IllegalCharsetNameException', 'MalformedInputException', 'UnmappableCharacterException', 'UnsupportedCharsetException'
- ),
- 33 => array (
- 'CharsetProvider'
- ),
- 34 => array (
- 'AccessException', 'AlreadyBoundException', 'ConnectIOException', 'MarshalException', 'MarshalledObject', 'Naming', 'NoSuchObjectException', 'NotBoundException', 'RMISecurityException', 'RMISecurityManager', 'Remote', 'RemoteException', 'ServerError', 'ServerException', 'ServerRuntimeException', 'StubNotFoundException', 'UnexpectedException', 'UnmarshalException'
- ),
- 35 => array (
- 'Activatable', 'ActivateFailedException', 'ActivationDesc', 'ActivationException', 'ActivationGroup', 'ActivationGroupDesc', 'ActivationGroupDesc.CommandEnvironment', 'ActivationGroupID', 'ActivationGroup_Stub', 'ActivationID', 'ActivationInstantiator', 'ActivationMonitor', 'ActivationSystem', 'Activator', 'UnknownGroupException', 'UnknownObjectException'
- ),
- 36 => array (
- 'DGC', 'Lease', 'VMID'
- ),
- 37 => array (
- 'LocateRegistry', 'Registry', 'RegistryHandler'
- ),
- 38 => array (
- 'ExportException', 'LoaderHandler', 'LogStream', 'ObjID', 'Operation', 'RMIClassLoader', 'RMIClassLoaderSpi', 'RMIClientSocketFactory', 'RMIFailureHandler', 'RMIServerSocketFactory', 'RMISocketFactory', 'RemoteCall', 'RemoteObject', 'RemoteObjectInvocationHandler', 'RemoteRef', 'RemoteServer', 'RemoteStub', 'ServerCloneException', 'ServerNotActiveException', 'ServerRef', 'Skeleton', 'SkeletonMismatchException', 'SkeletonNotFoundException', 'SocketSecurityException', 'UID', 'UnicastRemoteObject', 'Unreferenced'
- ),
- 39 => array (
- 'AccessControlContext', 'AccessControlException', 'AccessController', 'AlgorithmParameterGenerator', 'AlgorithmParameterGeneratorSpi', 'AlgorithmParameters', 'AlgorithmParametersSpi', 'AllPermission', 'AuthProvider', 'BasicPermission', 'CodeSigner', 'CodeSource', 'DigestException', 'DigestInputStream', 'DigestOutputStream', 'DomainCombiner', 'GeneralSecurityException', 'Guard', 'GuardedObject', 'Identity', 'IdentityScope', 'InvalidAlgorithmParameterException', 'InvalidParameterException', 'Key', 'KeyException', 'KeyFactory', 'KeyFactorySpi', 'KeyManagementException', 'KeyPair', 'KeyPairGenerator', 'KeyPairGeneratorSpi', 'KeyRep', 'KeyRep.Type', 'KeyStore', 'KeyStore.Builder', 'KeyStore.CallbackHandlerProtection', 'KeyStore.Entry', 'KeyStore.LoadStoreParameter', 'KeyStore.PasswordProtection', 'KeyStore.PrivateKeyEntry', 'KeyStore.ProtectionParameter', 'KeyStore.SecretKeyEntry', 'KeyStore.TrustedCertificateEntry', 'KeyStoreException', 'KeyStoreSpi', 'MessageDigest', 'MessageDigestSpi',
- 'NoSuchAlgorithmException', 'NoSuchProviderException', 'PermissionCollection', 'Permissions', 'PrivateKey', 'PrivilegedAction', 'PrivilegedActionException', 'PrivilegedExceptionAction', 'ProtectionDomain', 'Provider', 'Provider.Service', 'ProviderException', 'PublicKey', 'SecureClassLoader', 'SecureRandom', 'SecureRandomSpi', 'Security', 'SecurityPermission', 'Signature', 'SignatureException', 'SignatureSpi', 'SignedObject', 'Signer', 'UnrecoverableEntryException', 'UnrecoverableKeyException', 'UnresolvedPermission'
- ),
- 40 => array (
- 'Acl', 'AclEntry', 'AclNotFoundException', 'Group', 'LastOwnerException', 'NotOwnerException', 'Owner'
- ),
- 41 => array (
- 'CRL', 'CRLException', 'CRLSelector', 'CertPath', 'CertPath.CertPathRep', 'CertPathBuilder', 'CertPathBuilderException', 'CertPathBuilderResult', 'CertPathBuilderSpi', 'CertPathParameters', 'CertPathValidator', 'CertPathValidatorException', 'CertPathValidatorResult', 'CertPathValidatorSpi', 'CertSelector', 'CertStore', 'CertStoreException', 'CertStoreParameters', 'CertStoreSpi', 'Certificate.CertificateRep', 'CertificateFactory', 'CertificateFactorySpi', 'CollectionCertStoreParameters', 'LDAPCertStoreParameters', 'PKIXBuilderParameters', 'PKIXCertPathBuilderResult', 'PKIXCertPathChecker', 'PKIXCertPathValidatorResult', 'PKIXParameters', 'PolicyNode', 'PolicyQualifierInfo', 'TrustAnchor', 'X509CRL', 'X509CRLEntry', 'X509CRLSelector', 'X509CertSelector', 'X509Extension'
- ),
- 42 => array (
- 'DSAKey', 'DSAKeyPairGenerator', 'DSAParams', 'DSAPrivateKey', 'DSAPublicKey', 'ECKey', 'ECPrivateKey', 'ECPublicKey', 'RSAKey', 'RSAMultiPrimePrivateCrtKey', 'RSAPrivateCrtKey', 'RSAPrivateKey', 'RSAPublicKey'
- ),
- 43 => array (
- 'AlgorithmParameterSpec', 'DSAParameterSpec', 'DSAPrivateKeySpec', 'DSAPublicKeySpec', 'ECField', 'ECFieldF2m', 'ECFieldFp', 'ECGenParameterSpec', 'ECParameterSpec', 'ECPoint', 'ECPrivateKeySpec', 'ECPublicKeySpec', 'EllipticCurve', 'EncodedKeySpec', 'InvalidKeySpecException', 'InvalidParameterSpecException', 'KeySpec', 'MGF1ParameterSpec', 'PKCS8EncodedKeySpec', 'PSSParameterSpec', 'RSAKeyGenParameterSpec', 'RSAMultiPrimePrivateCrtKeySpec', 'RSAOtherPrimeInfo', 'RSAPrivateCrtKeySpec', 'RSAPrivateKeySpec', 'RSAPublicKeySpec', 'X509EncodedKeySpec'
- ),
- 44 => array (
- 'BatchUpdateException', 'Blob', 'CallableStatement', 'Clob', 'Connection', 'DataTruncation', 'DatabaseMetaData', 'Driver', 'DriverManager', 'DriverPropertyInfo', 'ParameterMetaData', 'PreparedStatement', 'Ref', 'ResultSet', 'ResultSetMetaData', 'SQLData', 'SQLException', 'SQLInput', 'SQLOutput', 'SQLPermission', 'SQLWarning', 'Savepoint', 'Struct', 'Time', 'Types'
- ),
- 45 => array (
- 'AttributedCharacterIterator', 'AttributedCharacterIterator.Attribute', 'AttributedString', 'Bidi', 'BreakIterator', 'CharacterIterator', 'ChoiceFormat', 'CollationElementIterator', 'CollationKey', 'Collator', 'DateFormat', 'DateFormat.Field', 'DateFormatSymbols', 'DecimalFormat', 'DecimalFormatSymbols', 'FieldPosition', 'Format', 'Format.Field', 'MessageFormat', 'MessageFormat.Field', 'NumberFormat', 'NumberFormat.Field', 'ParseException', 'ParsePosition', 'RuleBasedCollator', 'SimpleDateFormat', 'StringCharacterIterator'
- ),
- 46 => array (
- 'AbstractCollection', 'AbstractList', 'AbstractMap', 'AbstractQueue', 'AbstractSequentialList', 'AbstractSet', 'ArrayList', 'Arrays', 'BitSet', 'Calendar', 'Collection', 'Collections', 'Comparator', 'ConcurrentModificationException', 'Currency', 'Dictionary', 'DuplicateFormatFlagsException', 'EmptyStackException', 'EnumMap', 'EnumSet', 'Enumeration', 'EventListenerProxy', 'EventObject', 'FormatFlagsConversionMismatchException', 'Formattable', 'FormattableFlags', 'Formatter.BigDecimalLayoutForm', 'FormatterClosedException', 'GregorianCalendar', 'HashMap', 'HashSet', 'Hashtable', 'IdentityHashMap', 'IllegalFormatCodePointException', 'IllegalFormatConversionException', 'IllegalFormatException', 'IllegalFormatFlagsException', 'IllegalFormatPrecisionException', 'IllegalFormatWidthException', 'InputMismatchException', 'InvalidPropertiesFormatException', 'Iterator', 'LinkedHashMap', 'LinkedHashSet', 'LinkedList', 'ListIterator', 'ListResourceBundle', 'Locale', 'Map', 'Map.Entry', 'MissingFormatArgumentException',
- 'MissingFormatWidthException', 'MissingResourceException', 'NoSuchElementException', 'Observable', 'Observer', 'PriorityQueue', 'Properties', 'PropertyPermission', 'PropertyResourceBundle', 'Queue', 'Random', 'RandomAccess', 'ResourceBundle', 'Scanner', 'Set', 'SimpleTimeZone', 'SortedMap', 'SortedSet', 'Stack', 'StringTokenizer', 'TimeZone', 'TimerTask', 'TooManyListenersException', 'TreeMap', 'TreeSet', 'UUID', 'UnknownFormatConversionException', 'UnknownFormatFlagsException', 'Vector', 'WeakHashMap'
- ),
- 47 => array (
- 'AbstractExecutorService', 'ArrayBlockingQueue', 'BlockingQueue', 'BrokenBarrierException', 'Callable', 'CancellationException', 'CompletionService', 'ConcurrentHashMap', 'ConcurrentLinkedQueue', 'ConcurrentMap', 'CopyOnWriteArrayList', 'CopyOnWriteArraySet', 'CountDownLatch', 'CyclicBarrier', 'DelayQueue', 'Delayed', 'Exchanger', 'ExecutionException', 'Executor', 'ExecutorCompletionService', 'ExecutorService', 'Executors', 'Future', 'FutureTask', 'LinkedBlockingQueue', 'PriorityBlockingQueue', 'RejectedExecutionException', 'RejectedExecutionHandler', 'ScheduledExecutorService', 'ScheduledFuture', 'ScheduledThreadPoolExecutor', 'Semaphore', 'SynchronousQueue', 'ThreadFactory', 'ThreadPoolExecutor', 'ThreadPoolExecutor.AbortPolicy', 'ThreadPoolExecutor.CallerRunsPolicy', 'ThreadPoolExecutor.DiscardOldestPolicy', 'ThreadPoolExecutor.DiscardPolicy', 'TimeUnit', 'TimeoutException'
- ),
- 48 => array (
- 'AtomicBoolean', 'AtomicInteger', 'AtomicIntegerArray', 'AtomicIntegerFieldUpdater', 'AtomicLong', 'AtomicLongArray', 'AtomicLongFieldUpdater', 'AtomicMarkableReference', 'AtomicReference', 'AtomicReferenceArray', 'AtomicReferenceFieldUpdater', 'AtomicStampedReference'
- ),
- 49 => array (
- 'AbstractQueuedSynchronizer', 'Condition', 'Lock', 'LockSupport', 'ReadWriteLock', 'ReentrantLock', 'ReentrantReadWriteLock', 'ReentrantReadWriteLock.ReadLock', 'ReentrantReadWriteLock.WriteLock'
- ),
- 50 => array (
- 'Attributes.Name', 'JarEntry', 'JarException', 'JarFile', 'JarInputStream', 'JarOutputStream', 'Manifest', 'Pack200', 'Pack200.Packer', 'Pack200.Unpacker'
- ),
- 51 => array (
- 'ConsoleHandler', 'ErrorManager', 'FileHandler', 'Filter', 'Handler', 'Level', 'LogManager', 'LogRecord', 'Logger', 'LoggingMXBean', 'LoggingPermission', 'MemoryHandler', 'SimpleFormatter', 'SocketHandler', 'StreamHandler', 'XMLFormatter'
- ),
- 52 => array (
- 'AbstractPreferences', 'BackingStoreException', 'InvalidPreferencesFormatException', 'NodeChangeEvent', 'NodeChangeListener', 'PreferenceChangeEvent', 'PreferenceChangeListener', 'Preferences', 'PreferencesFactory'
- ),
- 53 => array (
- 'MatchResult', 'Matcher', 'Pattern', 'PatternSyntaxException'
- ),
- 54 => array (
- 'Adler32', 'CRC32', 'CheckedInputStream', 'CheckedOutputStream', 'Checksum', 'DataFormatException', 'Deflater', 'DeflaterOutputStream', 'GZIPInputStream', 'GZIPOutputStream', 'Inflater', 'InflaterInputStream', 'ZipEntry', 'ZipException', 'ZipFile', 'ZipInputStream', 'ZipOutputStream'
- ),
- 55 => array (
- 'Accessible', 'AccessibleAction', 'AccessibleAttributeSequence', 'AccessibleBundle', 'AccessibleComponent', 'AccessibleContext', 'AccessibleEditableText', 'AccessibleExtendedComponent', 'AccessibleExtendedTable', 'AccessibleExtendedText', 'AccessibleHyperlink', 'AccessibleHypertext', 'AccessibleIcon', 'AccessibleKeyBinding', 'AccessibleRelation', 'AccessibleRelationSet', 'AccessibleResourceBundle', 'AccessibleRole', 'AccessibleSelection', 'AccessibleState', 'AccessibleStateSet', 'AccessibleStreamable', 'AccessibleTable', 'AccessibleTableModelChange', 'AccessibleText', 'AccessibleTextSequence', 'AccessibleValue'
- ),
- 56 => array (
- 'ActivityCompletedException', 'ActivityRequiredException', 'InvalidActivityException'
- ),
- 57 => array (
- 'BadPaddingException', 'Cipher', 'CipherInputStream', 'CipherOutputStream', 'CipherSpi', 'EncryptedPrivateKeyInfo', 'ExemptionMechanism', 'ExemptionMechanismException', 'ExemptionMechanismSpi', 'IllegalBlockSizeException', 'KeyAgreement', 'KeyAgreementSpi', 'KeyGenerator', 'KeyGeneratorSpi', 'Mac', 'MacSpi', 'NoSuchPaddingException', 'NullCipher', 'SealedObject', 'SecretKey', 'SecretKeyFactory', 'SecretKeyFactorySpi', 'ShortBufferException'
- ),
- 58 => array (
- 'DHKey', 'DHPrivateKey', 'DHPublicKey', 'PBEKey'
- ),
- 59 => array (
- 'DESKeySpec', 'DESedeKeySpec', 'DHGenParameterSpec', 'DHParameterSpec', 'DHPrivateKeySpec', 'DHPublicKeySpec', 'IvParameterSpec', 'OAEPParameterSpec', 'PBEKeySpec', 'PBEParameterSpec', 'PSource', 'PSource.PSpecified', 'RC2ParameterSpec', 'RC5ParameterSpec', 'SecretKeySpec'
- ),
- 60 => array (
- 'IIOException', 'IIOImage', 'IIOParam', 'IIOParamController', 'ImageIO', 'ImageReadParam', 'ImageReader', 'ImageTranscoder', 'ImageTypeSpecifier', 'ImageWriteParam', 'ImageWriter'
- ),
- 61 => array (
- 'IIOReadProgressListener', 'IIOReadUpdateListener', 'IIOReadWarningListener', 'IIOWriteProgressListener', 'IIOWriteWarningListener'
- ),
- 62 => array (
- 'IIOInvalidTreeException', 'IIOMetadata', 'IIOMetadataController', 'IIOMetadataFormat', 'IIOMetadataFormatImpl', 'IIOMetadataNode'
- ),
- 63 => array (
- 'BMPImageWriteParam'
- ),
- 64 => array (
- 'JPEGHuffmanTable', 'JPEGImageReadParam', 'JPEGImageWriteParam', 'JPEGQTable'
- ),
- 65 => array (
- 'IIORegistry', 'IIOServiceProvider', 'ImageInputStreamSpi', 'ImageOutputStreamSpi', 'ImageReaderSpi', 'ImageReaderWriterSpi', 'ImageTranscoderSpi', 'ImageWriterSpi', 'RegisterableService', 'ServiceRegistry', 'ServiceRegistry.Filter'
- ),
- 66 => array (
- 'FileCacheImageInputStream', 'FileCacheImageOutputStream', 'FileImageInputStream', 'FileImageOutputStream', 'IIOByteBuffer', 'ImageInputStream', 'ImageInputStreamImpl', 'ImageOutputStream', 'ImageOutputStreamImpl', 'MemoryCacheImageInputStream', 'MemoryCacheImageOutputStream'
- ),
- 67 => array (
- 'AttributeChangeNotification', 'AttributeChangeNotificationFilter', 'AttributeNotFoundException', 'AttributeValueExp', 'BadAttributeValueExpException', 'BadBinaryOpValueExpException', 'BadStringOperationException', 'Descriptor', 'DescriptorAccess', 'DynamicMBean', 'InstanceAlreadyExistsException', 'InstanceNotFoundException', 'InvalidApplicationException', 'JMException', 'JMRuntimeException', 'ListenerNotFoundException', 'MBeanAttributeInfo', 'MBeanConstructorInfo', 'MBeanException', 'MBeanFeatureInfo', 'MBeanInfo', 'MBeanNotificationInfo', 'MBeanOperationInfo', 'MBeanParameterInfo', 'MBeanPermission', 'MBeanRegistration', 'MBeanRegistrationException', 'MBeanServer', 'MBeanServerBuilder', 'MBeanServerConnection', 'MBeanServerDelegate', 'MBeanServerDelegateMBean', 'MBeanServerFactory', 'MBeanServerInvocationHandler', 'MBeanServerNotification', 'MBeanServerPermission', 'MBeanTrustPermission', 'MalformedObjectNameException', 'NotCompliantMBeanException', 'Notification', 'NotificationBroadcaster',
- 'NotificationBroadcasterSupport', 'NotificationEmitter', 'NotificationFilter', 'NotificationFilterSupport', 'NotificationListener', 'ObjectInstance', 'ObjectName', 'OperationsException', 'PersistentMBean', 'Query', 'QueryEval', 'QueryExp', 'ReflectionException', 'RuntimeErrorException', 'RuntimeMBeanException', 'RuntimeOperationsException', 'ServiceNotFoundException', 'StandardMBean', 'StringValueExp', 'ValueExp'
- ),
- 68 => array (
- 'ClassLoaderRepository', 'MLet', 'MLetMBean', 'PrivateClassLoader', 'PrivateMLet'
- ),
- 69 => array (
- 'DescriptorSupport', 'InvalidTargetObjectTypeException', 'ModelMBean', 'ModelMBeanAttributeInfo', 'ModelMBeanConstructorInfo', 'ModelMBeanInfo', 'ModelMBeanInfoSupport', 'ModelMBeanNotificationBroadcaster', 'ModelMBeanNotificationInfo', 'ModelMBeanOperationInfo', 'RequiredModelMBean', 'XMLParseException'
- ),
- 70 => array (
- 'CounterMonitor', 'CounterMonitorMBean', 'GaugeMonitor', 'GaugeMonitorMBean', 'Monitor', 'MonitorMBean', 'MonitorNotification', 'MonitorSettingException', 'StringMonitor', 'StringMonitorMBean'
- ),
- 71 => array (
- 'ArrayType', 'CompositeData', 'CompositeDataSupport', 'CompositeType', 'InvalidOpenTypeException', 'KeyAlreadyExistsException', 'OpenDataException', 'OpenMBeanAttributeInfo', 'OpenMBeanAttributeInfoSupport', 'OpenMBeanConstructorInfo', 'OpenMBeanConstructorInfoSupport', 'OpenMBeanInfo', 'OpenMBeanInfoSupport', 'OpenMBeanOperationInfo', 'OpenMBeanOperationInfoSupport', 'OpenMBeanParameterInfo', 'OpenMBeanParameterInfoSupport', 'SimpleType', 'TabularData', 'TabularDataSupport', 'TabularType'
- ),
- 72 => array (
- 'InvalidRelationIdException', 'InvalidRelationServiceException', 'InvalidRelationTypeException', 'InvalidRoleInfoException', 'InvalidRoleValueException', 'MBeanServerNotificationFilter', 'Relation', 'RelationException', 'RelationNotFoundException', 'RelationNotification', 'RelationService', 'RelationServiceMBean', 'RelationServiceNotRegisteredException', 'RelationSupport', 'RelationSupportMBean', 'RelationType', 'RelationTypeNotFoundException', 'RelationTypeSupport', 'Role', 'RoleInfo', 'RoleInfoNotFoundException', 'RoleList', 'RoleNotFoundException', 'RoleResult', 'RoleStatus', 'RoleUnresolved', 'RoleUnresolvedList'
- ),
- 73 => array (
- 'JMXAuthenticator', 'JMXConnectionNotification', 'JMXConnector', 'JMXConnectorFactory', 'JMXConnectorProvider', 'JMXConnectorServer', 'JMXConnectorServerFactory', 'JMXConnectorServerMBean', 'JMXConnectorServerProvider', 'JMXPrincipal', 'JMXProviderException', 'JMXServerErrorException', 'JMXServiceURL', 'MBeanServerForwarder', 'NotificationResult', 'SubjectDelegationPermission', 'TargetedNotification'
- ),
- 74 => array (
- 'RMIConnection', 'RMIConnectionImpl', 'RMIConnectionImpl_Stub', 'RMIConnector', 'RMIConnectorServer', 'RMIIIOPServerImpl', 'RMIJRMPServerImpl', 'RMIServer', 'RMIServerImpl', 'RMIServerImpl_Stub'
- ),
- 75 => array (
- 'TimerAlarmClockNotification', 'TimerMBean', 'TimerNotification'
- ),
- 76 => array (
- 'AuthenticationNotSupportedException', 'BinaryRefAddr', 'CannotProceedException', 'CommunicationException', 'CompositeName', 'CompoundName', 'ConfigurationException', 'ContextNotEmptyException', 'InitialContext', 'InsufficientResourcesException', 'InterruptedNamingException', 'InvalidNameException', 'LimitExceededException', 'LinkException', 'LinkLoopException', 'LinkRef', 'MalformedLinkException', 'Name', 'NameAlreadyBoundException', 'NameClassPair', 'NameNotFoundException', 'NameParser', 'NamingEnumeration', 'NamingException', 'NamingSecurityException', 'NoInitialContextException', 'NoPermissionException', 'NotContextException', 'OperationNotSupportedException', 'PartialResultException', 'RefAddr', 'Referenceable', 'ReferralException', 'ServiceUnavailableException', 'SizeLimitExceededException', 'StringRefAddr', 'TimeLimitExceededException'
- ),
- 77 => array (
- 'AttributeInUseException', 'AttributeModificationException', 'BasicAttribute', 'BasicAttributes', 'DirContext', 'InitialDirContext', 'InvalidAttributeIdentifierException', 'InvalidAttributesException', 'InvalidSearchControlsException', 'InvalidSearchFilterException', 'ModificationItem', 'NoSuchAttributeException', 'SchemaViolationException', 'SearchControls', 'SearchResult'
- ),
- 78 => array (
- 'EventContext', 'EventDirContext', 'NamespaceChangeListener', 'NamingEvent', 'NamingExceptionEvent', 'NamingListener', 'ObjectChangeListener'
- ),
- 79 => array (
- 'BasicControl', 'ControlFactory', 'ExtendedRequest', 'ExtendedResponse', 'HasControls', 'InitialLdapContext', 'LdapContext', 'LdapName', 'LdapReferralException', 'ManageReferralControl', 'PagedResultsControl', 'PagedResultsResponseControl', 'Rdn', 'SortControl', 'SortKey', 'SortResponseControl', 'StartTlsRequest', 'StartTlsResponse', 'UnsolicitedNotification', 'UnsolicitedNotificationEvent', 'UnsolicitedNotificationListener'
- ),
- 80 => array (
- 'DirObjectFactory', 'DirStateFactory', 'DirStateFactory.Result', 'DirectoryManager', 'InitialContextFactory', 'InitialContextFactoryBuilder', 'NamingManager', 'ObjectFactory', 'ObjectFactoryBuilder', 'ResolveResult', 'Resolver', 'StateFactory'
- ),
- 81 => array (
- 'ServerSocketFactory', 'SocketFactory'
- ),
- 82 => array (
- 'CertPathTrustManagerParameters', 'HandshakeCompletedEvent', 'HandshakeCompletedListener', 'HostnameVerifier', 'HttpsURLConnection', 'KeyManager', 'KeyManagerFactory', 'KeyManagerFactorySpi', 'KeyStoreBuilderParameters', 'ManagerFactoryParameters', 'SSLContext', 'SSLContextSpi', 'SSLEngine', 'SSLEngineResult', 'SSLEngineResult.HandshakeStatus', 'SSLEngineResult.Status', 'SSLException', 'SSLHandshakeException', 'SSLKeyException', 'SSLPeerUnverifiedException', 'SSLPermission', 'SSLProtocolException', 'SSLServerSocket', 'SSLServerSocketFactory', 'SSLSession', 'SSLSessionBindingEvent', 'SSLSessionBindingListener', 'SSLSessionContext', 'SSLSocket', 'SSLSocketFactory', 'TrustManager', 'TrustManagerFactory', 'TrustManagerFactorySpi', 'X509ExtendedKeyManager', 'X509KeyManager', 'X509TrustManager'
- ),
- 83 => array (
- 'AttributeException', 'CancelablePrintJob', 'Doc', 'DocFlavor', 'DocFlavor.BYTE_ARRAY', 'DocFlavor.CHAR_ARRAY', 'DocFlavor.INPUT_STREAM', 'DocFlavor.READER', 'DocFlavor.SERVICE_FORMATTED', 'DocFlavor.STRING', 'DocFlavor.URL', 'DocPrintJob', 'FlavorException', 'MultiDoc', 'MultiDocPrintJob', 'MultiDocPrintService', 'PrintException', 'PrintService', 'PrintServiceLookup', 'ServiceUI', 'ServiceUIFactory', 'SimpleDoc', 'StreamPrintService', 'StreamPrintServiceFactory', 'URIException'
- ),
- 84 => array (
- 'AttributeSetUtilities', 'DateTimeSyntax', 'DocAttribute', 'DocAttributeSet', 'EnumSyntax', 'HashAttributeSet', 'HashDocAttributeSet', 'HashPrintJobAttributeSet', 'HashPrintRequestAttributeSet', 'HashPrintServiceAttributeSet', 'IntegerSyntax', 'PrintJobAttribute', 'PrintJobAttributeSet', 'PrintRequestAttribute', 'PrintRequestAttributeSet', 'PrintServiceAttribute', 'PrintServiceAttributeSet', 'ResolutionSyntax', 'SetOfIntegerSyntax', 'Size2DSyntax', 'SupportedValuesAttribute', 'TextSyntax', 'URISyntax', 'UnmodifiableSetException'
- ),
- 85 => array (
- 'Chromaticity', 'ColorSupported', 'Compression', 'Copies', 'CopiesSupported', 'DateTimeAtCompleted', 'DateTimeAtCreation', 'DateTimeAtProcessing', 'Destination', 'DocumentName', 'Fidelity', 'Finishings', 'JobHoldUntil', 'JobImpressions', 'JobImpressionsCompleted', 'JobImpressionsSupported', 'JobKOctets', 'JobKOctetsProcessed', 'JobKOctetsSupported', 'JobMediaSheets', 'JobMediaSheetsCompleted', 'JobMediaSheetsSupported', 'JobMessageFromOperator', 'JobName', 'JobOriginatingUserName', 'JobPriority', 'JobPrioritySupported', 'JobSheets', 'JobState', 'JobStateReason', 'JobStateReasons', 'Media', 'MediaName', 'MediaPrintableArea', 'MediaSize', 'MediaSize.Engineering', 'MediaSize.ISO', 'MediaSize.JIS', 'MediaSize.NA', 'MediaSize.Other', 'MediaSizeName', 'MediaTray', 'MultipleDocumentHandling', 'NumberOfDocuments', 'NumberOfInterveningJobs', 'NumberUp', 'NumberUpSupported', 'OrientationRequested', 'OutputDeviceAssigned', 'PDLOverrideSupported', 'PageRanges', 'PagesPerMinute', 'PagesPerMinuteColor',
- 'PresentationDirection', 'PrintQuality', 'PrinterInfo', 'PrinterIsAcceptingJobs', 'PrinterLocation', 'PrinterMakeAndModel', 'PrinterMessageFromOperator', 'PrinterMoreInfo', 'PrinterMoreInfoManufacturer', 'PrinterName', 'PrinterResolution', 'PrinterState', 'PrinterStateReason', 'PrinterStateReasons', 'PrinterURI', 'QueuedJobCount', 'ReferenceUriSchemesSupported', 'RequestingUserName', 'Severity', 'SheetCollate', 'Sides'
- ),
- 86 => array (
- 'PrintEvent', 'PrintJobAdapter', 'PrintJobAttributeEvent', 'PrintJobAttributeListener', 'PrintJobEvent', 'PrintJobListener', 'PrintServiceAttributeEvent', 'PrintServiceAttributeListener'
- ),
- 87 => array (
- 'PortableRemoteObject'
- ),
- 88 => array (
- 'ClassDesc', 'PortableRemoteObjectDelegate', 'Stub', 'StubDelegate', 'Tie', 'Util', 'UtilDelegate', 'ValueHandler', 'ValueHandlerMultiFormat'
- ),
- 89 => array (
- 'SslRMIClientSocketFactory', 'SslRMIServerSocketFactory'
- ),
- 90 => array (
- 'AuthPermission', 'DestroyFailedException', 'Destroyable', 'PrivateCredentialPermission', 'RefreshFailedException', 'Refreshable', 'Subject', 'SubjectDomainCombiner'
- ),
- 91 => array (
- 'Callback', 'CallbackHandler', 'ChoiceCallback', 'ConfirmationCallback', 'LanguageCallback', 'NameCallback', 'PasswordCallback', 'TextInputCallback', 'TextOutputCallback', 'UnsupportedCallbackException'
- ),
- 92 => array (
- 'DelegationPermission', 'KerberosKey', 'KerberosPrincipal', 'KerberosTicket', 'ServicePermission'
- ),
- 93 => array (
- 'AccountException', 'AccountExpiredException', 'AccountLockedException', 'AccountNotFoundException', 'AppConfigurationEntry', 'AppConfigurationEntry.LoginModuleControlFlag', 'Configuration', 'CredentialException', 'CredentialExpiredException', 'CredentialNotFoundException', 'FailedLoginException', 'LoginContext', 'LoginException'
- ),
- 94 => array (
- 'LoginModule'
- ),
- 95 => array (
- 'X500Principal', 'X500PrivateCredential'
- ),
- 96 => array (
- 'AuthorizeCallback', 'RealmCallback', 'RealmChoiceCallback', 'Sasl', 'SaslClient', 'SaslClientFactory', 'SaslException', 'SaslServer', 'SaslServerFactory'
- ),
- 97 => array (
- 'ControllerEventListener', 'Instrument', 'InvalidMidiDataException', 'MetaEventListener', 'MetaMessage', 'MidiChannel', 'MidiDevice', 'MidiDevice.Info', 'MidiEvent', 'MidiFileFormat', 'MidiMessage', 'MidiSystem', 'MidiUnavailableException', 'Patch', 'Receiver', 'Sequence', 'Sequencer', 'Sequencer.SyncMode', 'ShortMessage', 'Soundbank', 'SoundbankResource', 'Synthesizer', 'SysexMessage', 'Track', 'Transmitter', 'VoiceStatus'
- ),
- 98 => array (
- 'MidiDeviceProvider', 'MidiFileReader', 'MidiFileWriter', 'SoundbankReader'
- ),
- 99 => array (
- 'AudioFileFormat', 'AudioFileFormat.Type', 'AudioFormat', 'AudioFormat.Encoding', 'AudioInputStream', 'AudioPermission', 'AudioSystem', 'BooleanControl', 'BooleanControl.Type', 'Clip', 'CompoundControl', 'CompoundControl.Type', 'Control.Type', 'DataLine', 'DataLine.Info', 'EnumControl', 'EnumControl.Type', 'FloatControl', 'FloatControl.Type', 'Line', 'Line.Info', 'LineEvent', 'LineEvent.Type', 'LineListener', 'LineUnavailableException', 'Mixer', 'Mixer.Info', 'Port', 'Port.Info', 'ReverbType', 'SourceDataLine', 'TargetDataLine', 'UnsupportedAudioFileException'
- ),
- 100 => array (
- 'AudioFileReader', 'AudioFileWriter', 'FormatConversionProvider', 'MixerProvider'
- ),
- 101 => array (
- 'ConnectionEvent', 'ConnectionEventListener', 'ConnectionPoolDataSource', 'DataSource', 'PooledConnection', 'RowSet', 'RowSetEvent', 'RowSetInternal', 'RowSetListener', 'RowSetMetaData', 'RowSetReader', 'RowSetWriter', 'XAConnection', 'XADataSource'
- ),
- 102 => array (
- 'BaseRowSet', 'CachedRowSet', 'FilteredRowSet', 'JdbcRowSet', 'JoinRowSet', 'Joinable', 'Predicate', 'RowSetMetaDataImpl', 'RowSetWarning', 'WebRowSet'
- ),
- 103 => array (
- 'SQLInputImpl', 'SQLOutputImpl', 'SerialArray', 'SerialBlob', 'SerialClob', 'SerialDatalink', 'SerialException', 'SerialJavaObject', 'SerialRef', 'SerialStruct'
- ),
- 104 => array (
- 'SyncFactory', 'SyncFactoryException', 'SyncProvider', 'SyncProviderException', 'SyncResolver', 'TransactionalWriter', 'XmlReader', 'XmlWriter'
- ),
- 105 => array (
- 'AbstractAction', 'AbstractButton', 'AbstractCellEditor', 'AbstractListModel', 'AbstractSpinnerModel', 'Action', 'ActionMap', 'BorderFactory', 'BoundedRangeModel', 'Box', 'Box.Filler', 'BoxLayout', 'ButtonGroup', 'ButtonModel', 'CellEditor', 'CellRendererPane', 'ComboBoxEditor', 'ComboBoxModel', 'ComponentInputMap', 'DebugGraphics', 'DefaultBoundedRangeModel', 'DefaultButtonModel', 'DefaultCellEditor', 'DefaultComboBoxModel', 'DefaultDesktopManager', 'DefaultFocusManager', 'DefaultListCellRenderer', 'DefaultListCellRenderer.UIResource', 'DefaultListModel', 'DefaultListSelectionModel', 'DefaultSingleSelectionModel', 'DesktopManager', 'FocusManager', 'GrayFilter', 'Icon', 'ImageIcon', 'InputMap', 'InputVerifier', 'InternalFrameFocusTraversalPolicy', 'JApplet', 'JButton', 'JCheckBox', 'JCheckBoxMenuItem', 'JColorChooser', 'JComboBox', 'JComboBox.KeySelectionManager', 'JComponent', 'JDesktopPane', 'JDialog', 'JEditorPane', 'JFileChooser', 'JFormattedTextField', 'JFormattedTextField.AbstractFormatter',
- 'JFormattedTextField.AbstractFormatterFactory', 'JFrame', 'JInternalFrame', 'JInternalFrame.JDesktopIcon', 'JLabel', 'JLayeredPane', 'JList', 'JMenu', 'JMenuBar', 'JMenuItem', 'JOptionPane', 'JPanel', 'JPasswordField', 'JPopupMenu', 'JPopupMenu.Separator', 'JProgressBar', 'JRadioButton', 'JRadioButtonMenuItem', 'JRootPane', 'JScrollBar', 'JScrollPane', 'JSeparator', 'JSlider', 'JSpinner', 'JSpinner.DateEditor', 'JSpinner.DefaultEditor', 'JSpinner.ListEditor', 'JSpinner.NumberEditor', 'JSplitPane', 'JTabbedPane', 'JTable', 'JTable.PrintMode', 'JTextArea', 'JTextField', 'JTextPane', 'JToggleButton', 'JToggleButton.ToggleButtonModel', 'JToolBar', 'JToolBar.Separator', 'JToolTip', 'JTree', 'JTree.DynamicUtilTreeNode', 'JTree.EmptySelectionModel', 'JViewport', 'JWindow', 'KeyStroke', 'LayoutFocusTraversalPolicy', 'ListCellRenderer', 'ListModel', 'ListSelectionModel', 'LookAndFeel', 'MenuElement', 'MenuSelectionManager', 'MutableComboBoxModel', 'OverlayLayout', 'Popup', 'PopupFactory', 'ProgressMonitor',
- 'ProgressMonitorInputStream', 'Renderer', 'RepaintManager', 'RootPaneContainer', 'ScrollPaneConstants', 'ScrollPaneLayout', 'ScrollPaneLayout.UIResource', 'Scrollable', 'SingleSelectionModel', 'SizeRequirements', 'SizeSequence', 'SortingFocusTraversalPolicy', 'SpinnerDateModel', 'SpinnerListModel', 'SpinnerModel', 'SpinnerNumberModel', 'Spring', 'SpringLayout', 'SpringLayout.Constraints', 'SwingConstants', 'SwingUtilities', 'ToolTipManager', 'TransferHandler', 'UIDefaults', 'UIDefaults.ActiveValue', 'UIDefaults.LazyInputMap', 'UIDefaults.LazyValue', 'UIDefaults.ProxyLazyValue', 'UIManager', 'UIManager.LookAndFeelInfo', 'UnsupportedLookAndFeelException', 'ViewportLayout', 'WindowConstants'
- ),
- 106 => array (
- 'AbstractBorder', 'BevelBorder', 'Border', 'CompoundBorder', 'EmptyBorder', 'EtchedBorder', 'LineBorder', 'MatteBorder', 'SoftBevelBorder', 'TitledBorder'
- ),
- 107 => array (
- 'AbstractColorChooserPanel', 'ColorChooserComponentFactory', 'ColorSelectionModel', 'DefaultColorSelectionModel'
- ),
- 108 => array (
- 'AncestorEvent', 'AncestorListener', 'CaretEvent', 'CaretListener', 'CellEditorListener', 'ChangeEvent', 'ChangeListener', 'DocumentEvent.ElementChange', 'DocumentEvent.EventType', 'DocumentListener', 'EventListenerList', 'HyperlinkEvent', 'HyperlinkEvent.EventType', 'HyperlinkListener', 'InternalFrameAdapter', 'InternalFrameEvent', 'InternalFrameListener', 'ListDataEvent', 'ListDataListener', 'ListSelectionEvent', 'ListSelectionListener', 'MenuDragMouseEvent', 'MenuDragMouseListener', 'MenuEvent', 'MenuKeyEvent', 'MenuKeyListener', 'MenuListener', 'MouseInputAdapter', 'MouseInputListener', 'PopupMenuEvent', 'PopupMenuListener', 'SwingPropertyChangeSupport', 'TableColumnModelEvent', 'TableColumnModelListener', 'TableModelEvent', 'TableModelListener', 'TreeExpansionEvent', 'TreeExpansionListener', 'TreeModelEvent', 'TreeModelListener', 'TreeSelectionEvent', 'TreeSelectionListener', 'TreeWillExpandListener', 'UndoableEditEvent', 'UndoableEditListener'
- ),
- 109 => array (
- 'FileSystemView', 'FileView'
- ),
- 110 => array (
- 'ActionMapUIResource', 'BorderUIResource', 'BorderUIResource.BevelBorderUIResource', 'BorderUIResource.CompoundBorderUIResource', 'BorderUIResource.EmptyBorderUIResource', 'BorderUIResource.EtchedBorderUIResource', 'BorderUIResource.LineBorderUIResource', 'BorderUIResource.MatteBorderUIResource', 'BorderUIResource.TitledBorderUIResource', 'ButtonUI', 'ColorChooserUI', 'ColorUIResource', 'ComboBoxUI', 'ComponentInputMapUIResource', 'ComponentUI', 'DesktopIconUI', 'DesktopPaneUI', 'DimensionUIResource', 'FileChooserUI', 'FontUIResource', 'IconUIResource', 'InputMapUIResource', 'InsetsUIResource', 'InternalFrameUI', 'LabelUI', 'ListUI', 'MenuBarUI', 'MenuItemUI', 'OptionPaneUI', 'PanelUI', 'PopupMenuUI', 'ProgressBarUI', 'RootPaneUI', 'ScrollBarUI', 'ScrollPaneUI', 'SeparatorUI', 'SliderUI', 'SpinnerUI', 'SplitPaneUI', 'TabbedPaneUI', 'TableHeaderUI', 'TableUI', 'TextUI', 'ToolBarUI', 'ToolTipUI', 'TreeUI', 'UIResource', 'ViewportUI'
- ),
- 111 => array (
- 'BasicArrowButton', 'BasicBorders', 'BasicBorders.ButtonBorder', 'BasicBorders.FieldBorder', 'BasicBorders.MarginBorder', 'BasicBorders.MenuBarBorder', 'BasicBorders.RadioButtonBorder', 'BasicBorders.RolloverButtonBorder', 'BasicBorders.SplitPaneBorder', 'BasicBorders.ToggleButtonBorder', 'BasicButtonListener', 'BasicButtonUI', 'BasicCheckBoxMenuItemUI', 'BasicCheckBoxUI', 'BasicColorChooserUI', 'BasicComboBoxEditor', 'BasicComboBoxEditor.UIResource', 'BasicComboBoxRenderer', 'BasicComboBoxRenderer.UIResource', 'BasicComboBoxUI', 'BasicComboPopup', 'BasicDesktopIconUI', 'BasicDesktopPaneUI', 'BasicDirectoryModel', 'BasicEditorPaneUI', 'BasicFileChooserUI', 'BasicFormattedTextFieldUI', 'BasicGraphicsUtils', 'BasicHTML', 'BasicIconFactory', 'BasicInternalFrameTitlePane', 'BasicInternalFrameUI', 'BasicLabelUI', 'BasicListUI', 'BasicLookAndFeel', 'BasicMenuBarUI', 'BasicMenuItemUI', 'BasicMenuUI', 'BasicOptionPaneUI', 'BasicOptionPaneUI.ButtonAreaLayout', 'BasicPanelUI', 'BasicPasswordFieldUI',
- 'BasicPopupMenuSeparatorUI', 'BasicPopupMenuUI', 'BasicProgressBarUI', 'BasicRadioButtonMenuItemUI', 'BasicRadioButtonUI', 'BasicRootPaneUI', 'BasicScrollBarUI', 'BasicScrollPaneUI', 'BasicSeparatorUI', 'BasicSliderUI', 'BasicSpinnerUI', 'BasicSplitPaneDivider', 'BasicSplitPaneUI', 'BasicTabbedPaneUI', 'BasicTableHeaderUI', 'BasicTableUI', 'BasicTextAreaUI', 'BasicTextFieldUI', 'BasicTextPaneUI', 'BasicTextUI', 'BasicTextUI.BasicCaret', 'BasicTextUI.BasicHighlighter', 'BasicToggleButtonUI', 'BasicToolBarSeparatorUI', 'BasicToolBarUI', 'BasicToolTipUI', 'BasicTreeUI', 'BasicViewportUI', 'ComboPopup', 'DefaultMenuLayout'
- ),
- 112 => array (
- 'DefaultMetalTheme', 'MetalBorders', 'MetalBorders.ButtonBorder', 'MetalBorders.Flush3DBorder', 'MetalBorders.InternalFrameBorder', 'MetalBorders.MenuBarBorder', 'MetalBorders.MenuItemBorder', 'MetalBorders.OptionDialogBorder', 'MetalBorders.PaletteBorder', 'MetalBorders.PopupMenuBorder', 'MetalBorders.RolloverButtonBorder', 'MetalBorders.ScrollPaneBorder', 'MetalBorders.TableHeaderBorder', 'MetalBorders.TextFieldBorder', 'MetalBorders.ToggleButtonBorder', 'MetalBorders.ToolBarBorder', 'MetalButtonUI', 'MetalCheckBoxIcon', 'MetalCheckBoxUI', 'MetalComboBoxButton', 'MetalComboBoxEditor', 'MetalComboBoxEditor.UIResource', 'MetalComboBoxIcon', 'MetalComboBoxUI', 'MetalDesktopIconUI', 'MetalFileChooserUI', 'MetalIconFactory', 'MetalIconFactory.FileIcon16', 'MetalIconFactory.FolderIcon16', 'MetalIconFactory.PaletteCloseIcon', 'MetalIconFactory.TreeControlIcon', 'MetalIconFactory.TreeFolderIcon', 'MetalIconFactory.TreeLeafIcon', 'MetalInternalFrameTitlePane', 'MetalInternalFrameUI', 'MetalLabelUI',
- 'MetalLookAndFeel', 'MetalMenuBarUI', 'MetalPopupMenuSeparatorUI', 'MetalProgressBarUI', 'MetalRadioButtonUI', 'MetalRootPaneUI', 'MetalScrollBarUI', 'MetalScrollButton', 'MetalScrollPaneUI', 'MetalSeparatorUI', 'MetalSliderUI', 'MetalSplitPaneUI', 'MetalTabbedPaneUI', 'MetalTextFieldUI', 'MetalTheme', 'MetalToggleButtonUI', 'MetalToolBarUI', 'MetalToolTipUI', 'MetalTreeUI', 'OceanTheme'
- ),
- 113 => array (
- 'MultiButtonUI', 'MultiColorChooserUI', 'MultiComboBoxUI', 'MultiDesktopIconUI', 'MultiDesktopPaneUI', 'MultiFileChooserUI', 'MultiInternalFrameUI', 'MultiLabelUI', 'MultiListUI', 'MultiLookAndFeel', 'MultiMenuBarUI', 'MultiMenuItemUI', 'MultiOptionPaneUI', 'MultiPanelUI', 'MultiPopupMenuUI', 'MultiProgressBarUI', 'MultiRootPaneUI', 'MultiScrollBarUI', 'MultiScrollPaneUI', 'MultiSeparatorUI', 'MultiSliderUI', 'MultiSpinnerUI', 'MultiSplitPaneUI', 'MultiTabbedPaneUI', 'MultiTableHeaderUI', 'MultiTableUI', 'MultiTextUI', 'MultiToolBarUI', 'MultiToolTipUI', 'MultiTreeUI', 'MultiViewportUI'
- ),
- 114 => array (
- 'ColorType', 'Region', 'SynthConstants', 'SynthContext', 'SynthGraphicsUtils', 'SynthLookAndFeel', 'SynthPainter', 'SynthStyle', 'SynthStyleFactory'
- ),
- 115 => array (
- 'AbstractTableModel', 'DefaultTableCellRenderer', 'DefaultTableCellRenderer.UIResource', 'DefaultTableColumnModel', 'DefaultTableModel', 'JTableHeader', 'TableCellEditor', 'TableCellRenderer', 'TableColumn', 'TableColumnModel', 'TableModel'
- ),
- 116 => array (
- 'AbstractDocument', 'AbstractDocument.AttributeContext', 'AbstractDocument.Content', 'AbstractDocument.ElementEdit', 'AbstractWriter', 'AsyncBoxView', 'AttributeSet.CharacterAttribute', 'AttributeSet.ColorAttribute', 'AttributeSet.FontAttribute', 'AttributeSet.ParagraphAttribute', 'BadLocationException', 'BoxView', 'Caret', 'ChangedCharSetException', 'ComponentView', 'CompositeView', 'DateFormatter', 'DefaultCaret', 'DefaultEditorKit', 'DefaultEditorKit.BeepAction', 'DefaultEditorKit.CopyAction', 'DefaultEditorKit.CutAction', 'DefaultEditorKit.DefaultKeyTypedAction', 'DefaultEditorKit.InsertBreakAction', 'DefaultEditorKit.InsertContentAction', 'DefaultEditorKit.InsertTabAction', 'DefaultEditorKit.PasteAction', 'DefaultFormatter', 'DefaultFormatterFactory', 'DefaultHighlighter', 'DefaultHighlighter.DefaultHighlightPainter', 'DefaultStyledDocument', 'DefaultStyledDocument.AttributeUndoableEdit', 'DefaultStyledDocument.ElementSpec', 'DefaultTextUI', 'DocumentFilter', 'DocumentFilter.FilterBypass',
- 'EditorKit', 'ElementIterator', 'FieldView', 'FlowView', 'FlowView.FlowStrategy', 'GapContent', 'GlyphView', 'GlyphView.GlyphPainter', 'Highlighter', 'Highlighter.Highlight', 'Highlighter.HighlightPainter', 'IconView', 'InternationalFormatter', 'JTextComponent', 'JTextComponent.KeyBinding', 'Keymap', 'LabelView', 'LayeredHighlighter', 'LayeredHighlighter.LayerPainter', 'LayoutQueue', 'MaskFormatter', 'MutableAttributeSet', 'NavigationFilter', 'NavigationFilter.FilterBypass', 'NumberFormatter', 'PasswordView', 'PlainDocument', 'PlainView', 'Position', 'Position.Bias', 'Segment', 'SimpleAttributeSet', 'StringContent', 'Style', 'StyleConstants', 'StyleConstants.CharacterConstants', 'StyleConstants.ColorConstants', 'StyleConstants.FontConstants', 'StyleConstants.ParagraphConstants', 'StyleContext', 'StyledDocument', 'StyledEditorKit', 'StyledEditorKit.AlignmentAction', 'StyledEditorKit.BoldAction', 'StyledEditorKit.FontFamilyAction', 'StyledEditorKit.FontSizeAction', 'StyledEditorKit.ForegroundAction',
- 'StyledEditorKit.ItalicAction', 'StyledEditorKit.StyledTextAction', 'StyledEditorKit.UnderlineAction', 'TabExpander', 'TabSet', 'TabStop', 'TabableView', 'TableView', 'TextAction', 'Utilities', 'View', 'ViewFactory', 'WrappedPlainView', 'ZoneView'
- ),
- 117 => array (
- 'BlockView', 'CSS', 'CSS.Attribute', 'FormSubmitEvent', 'FormSubmitEvent.MethodType', 'FormView', 'HTML', 'HTML.Attribute', 'HTML.Tag', 'HTML.UnknownTag', 'HTMLDocument', 'HTMLDocument.Iterator', 'HTMLEditorKit', 'HTMLEditorKit.HTMLFactory', 'HTMLEditorKit.HTMLTextAction', 'HTMLEditorKit.InsertHTMLTextAction', 'HTMLEditorKit.LinkController', 'HTMLEditorKit.Parser', 'HTMLEditorKit.ParserCallback', 'HTMLFrameHyperlinkEvent', 'HTMLWriter', 'ImageView', 'InlineView', 'ListView', 'MinimalHTMLWriter', 'ObjectView', 'Option', 'StyleSheet', 'StyleSheet.BoxPainter', 'StyleSheet.ListPainter'
- ),
- 118 => array (
- 'ContentModel', 'DTD', 'DTDConstants', 'DocumentParser', 'ParserDelegator', 'TagElement'
- ),
- 119 => array (
- 'RTFEditorKit'
- ),
- 120 => array (
- 'AbstractLayoutCache', 'AbstractLayoutCache.NodeDimensions', 'DefaultMutableTreeNode', 'DefaultTreeCellEditor', 'DefaultTreeCellRenderer', 'DefaultTreeModel', 'DefaultTreeSelectionModel', 'ExpandVetoException', 'FixedHeightLayoutCache', 'MutableTreeNode', 'RowMapper', 'TreeCellEditor', 'TreeCellRenderer', 'TreeModel', 'TreeNode', 'TreePath', 'TreeSelectionModel', 'VariableHeightLayoutCache'
- ),
- 121 => array (
- 'AbstractUndoableEdit', 'CannotRedoException', 'CannotUndoException', 'CompoundEdit', 'StateEdit', 'StateEditable', 'UndoManager', 'UndoableEdit', 'UndoableEditSupport'
- ),
- 122 => array (
- 'InvalidTransactionException', 'TransactionRequiredException', 'TransactionRolledbackException'
- ),
- 123 => array (
- 'XAException', 'XAResource', 'Xid'
- ),
- 124 => array (
- 'XMLConstants'
- ),
- 125 => array (
- 'DatatypeConfigurationException', 'DatatypeConstants', 'DatatypeConstants.Field', 'DatatypeFactory', 'Duration', 'XMLGregorianCalendar'
- ),
- 126 => array (
- 'NamespaceContext', 'QName'
- ),
- 127 => array (
- 'DocumentBuilder', 'DocumentBuilderFactory', 'FactoryConfigurationError', 'ParserConfigurationException', 'SAXParser', 'SAXParserFactory'
- ),
- 128 => array (
- 'ErrorListener', 'OutputKeys', 'Result', 'Source', 'SourceLocator', 'Templates', 'Transformer', 'TransformerConfigurationException', 'TransformerException', 'TransformerFactory', 'TransformerFactoryConfigurationError', 'URIResolver'
- ),
- 129 => array (
- 'DOMResult', 'DOMSource'
- ),
- 130 => array (
- 'SAXResult', 'SAXSource', 'SAXTransformerFactory', 'TemplatesHandler', 'TransformerHandler'
- ),
- 131 => array (
- 'StreamResult', 'StreamSource'
- ),
- 132 => array (
- 'Schema', 'SchemaFactory', 'SchemaFactoryLoader', 'TypeInfoProvider', 'Validator', 'ValidatorHandler'
- ),
- 133 => array (
- 'XPath', 'XPathConstants', 'XPathException', 'XPathExpression', 'XPathExpressionException', 'XPathFactory', 'XPathFactoryConfigurationException', 'XPathFunction', 'XPathFunctionException', 'XPathFunctionResolver', 'XPathVariableResolver'
- ),
- 134 => array (
- 'ChannelBinding', 'GSSContext', 'GSSCredential', 'GSSException', 'GSSManager', 'GSSName', 'MessageProp', 'Oid'
- ),
- 135 => array (
- 'ACTIVITY_COMPLETED', 'ACTIVITY_REQUIRED', 'ARG_IN', 'ARG_INOUT', 'ARG_OUT', 'Any', 'AnyHolder', 'AnySeqHolder', 'BAD_CONTEXT', 'BAD_INV_ORDER', 'BAD_OPERATION', 'BAD_PARAM', 'BAD_POLICY', 'BAD_POLICY_TYPE', 'BAD_POLICY_VALUE', 'BAD_QOS', 'BAD_TYPECODE', 'BooleanHolder', 'BooleanSeqHelper', 'BooleanSeqHolder', 'ByteHolder', 'CODESET_INCOMPATIBLE', 'COMM_FAILURE', 'CTX_RESTRICT_SCOPE', 'CharHolder', 'CharSeqHelper', 'CharSeqHolder', 'CompletionStatus', 'CompletionStatusHelper', 'ContextList', 'CurrentHolder', 'CustomMarshal', 'DATA_CONVERSION', 'DefinitionKind', 'DefinitionKindHelper', 'DomainManager', 'DomainManagerOperations', 'DoubleHolder', 'DoubleSeqHelper', 'DoubleSeqHolder', 'Environment', 'ExceptionList', 'FREE_MEM', 'FixedHolder', 'FloatHolder', 'FloatSeqHelper', 'FloatSeqHolder', 'IDLType', 'IDLTypeHelper', 'IDLTypeOperations', 'IMP_LIMIT', 'INITIALIZE', 'INTERNAL', 'INTF_REPOS', 'INVALID_ACTIVITY', 'INVALID_TRANSACTION', 'INV_FLAG', 'INV_IDENT', 'INV_OBJREF', 'INV_POLICY', 'IRObject',
- 'IRObjectOperations', 'IdentifierHelper', 'IntHolder', 'LocalObject', 'LongHolder', 'LongLongSeqHelper', 'LongLongSeqHolder', 'LongSeqHelper', 'LongSeqHolder', 'MARSHAL', 'NO_IMPLEMENT', 'NO_MEMORY', 'NO_PERMISSION', 'NO_RESOURCES', 'NO_RESPONSE', 'NVList', 'NamedValue', 'OBJECT_NOT_EXIST', 'OBJ_ADAPTER', 'OMGVMCID', 'ObjectHelper', 'ObjectHolder', 'OctetSeqHelper', 'OctetSeqHolder', 'PERSIST_STORE', 'PRIVATE_MEMBER', 'PUBLIC_MEMBER', 'ParameterMode', 'ParameterModeHelper', 'ParameterModeHolder', 'PolicyError', 'PolicyErrorCodeHelper', 'PolicyErrorHelper', 'PolicyErrorHolder', 'PolicyHelper', 'PolicyHolder', 'PolicyListHelper', 'PolicyListHolder', 'PolicyOperations', 'PolicyTypeHelper', 'PrincipalHolder', 'REBIND', 'RepositoryIdHelper', 'Request', 'ServerRequest', 'ServiceDetail', 'ServiceDetailHelper', 'ServiceInformation', 'ServiceInformationHelper', 'ServiceInformationHolder', 'SetOverrideType', 'SetOverrideTypeHelper', 'ShortHolder', 'ShortSeqHelper', 'ShortSeqHolder', 'StringHolder',
- 'StringSeqHelper', 'StringSeqHolder', 'StringValueHelper', 'StructMember', 'StructMemberHelper', 'SystemException', 'TCKind', 'TIMEOUT', 'TRANSACTION_MODE', 'TRANSACTION_REQUIRED', 'TRANSACTION_ROLLEDBACK', 'TRANSACTION_UNAVAILABLE', 'TRANSIENT', 'TypeCode', 'TypeCodeHolder', 'ULongLongSeqHelper', 'ULongLongSeqHolder', 'ULongSeqHelper', 'ULongSeqHolder', 'UNSUPPORTED_POLICY', 'UNSUPPORTED_POLICY_VALUE', 'UShortSeqHelper', 'UShortSeqHolder', 'UnionMember', 'UnionMemberHelper', 'UnknownUserException', 'UnknownUserExceptionHelper', 'UnknownUserExceptionHolder', 'UserException', 'VM_ABSTRACT', 'VM_CUSTOM', 'VM_NONE', 'VM_TRUNCATABLE', 'ValueBaseHelper', 'ValueBaseHolder', 'ValueMember', 'ValueMemberHelper', 'VersionSpecHelper', 'VisibilityHelper', 'WCharSeqHelper', 'WCharSeqHolder', 'WStringSeqHelper', 'WStringSeqHolder', 'WStringValueHelper', 'WrongTransaction', 'WrongTransactionHelper', 'WrongTransactionHolder', '_IDLTypeStub', '_PolicyStub'
- ),
- 136 => array (
- 'Invalid', 'InvalidSeq'
- ),
- 137 => array (
- 'BadKind'
- ),
- 138 => array (
- 'ApplicationException', 'BoxedValueHelper', 'CustomValue', 'IDLEntity', 'IndirectionException', 'InvokeHandler', 'RemarshalException', 'ResponseHandler', 'ServantObject', 'Streamable', 'StreamableValue', 'UnknownException', 'ValueBase', 'ValueFactory', 'ValueInputStream', 'ValueOutputStream'
- ),
- 139 => array (
- 'BindingHelper', 'BindingHolder', 'BindingIterator', 'BindingIteratorHelper', 'BindingIteratorHolder', 'BindingIteratorOperations', 'BindingIteratorPOA', 'BindingListHelper', 'BindingListHolder', 'BindingType', 'BindingTypeHelper', 'BindingTypeHolder', 'IstringHelper', 'NameComponent', 'NameComponentHelper', 'NameComponentHolder', 'NameHelper', 'NameHolder', 'NamingContext', 'NamingContextExt', 'NamingContextExtHelper', 'NamingContextExtHolder', 'NamingContextExtOperations', 'NamingContextExtPOA', 'NamingContextHelper', 'NamingContextHolder', 'NamingContextOperations', 'NamingContextPOA', '_BindingIteratorImplBase', '_BindingIteratorStub', '_NamingContextExtStub', '_NamingContextImplBase', '_NamingContextStub'
- ),
- 140 => array (
- 'AddressHelper', 'InvalidAddress', 'InvalidAddressHelper', 'InvalidAddressHolder', 'StringNameHelper', 'URLStringHelper'
- ),
- 141 => array (
- 'AlreadyBound', 'AlreadyBoundHelper', 'AlreadyBoundHolder', 'CannotProceed', 'CannotProceedHelper', 'CannotProceedHolder', 'InvalidNameHolder', 'NotEmpty', 'NotEmptyHelper', 'NotEmptyHolder', 'NotFound', 'NotFoundHelper', 'NotFoundHolder', 'NotFoundReason', 'NotFoundReasonHelper', 'NotFoundReasonHolder'
- ),
- 142 => array (
- 'Parameter'
- ),
- 143 => array (
- 'DynAnyFactory', 'DynAnyFactoryHelper', 'DynAnyFactoryOperations', 'DynAnyHelper', 'DynAnyOperations', 'DynAnySeqHelper', 'DynArrayHelper', 'DynArrayOperations', 'DynEnumHelper', 'DynEnumOperations', 'DynFixedHelper', 'DynFixedOperations', 'DynSequenceHelper', 'DynSequenceOperations', 'DynStructHelper', 'DynStructOperations', 'DynUnionHelper', 'DynUnionOperations', 'DynValueBox', 'DynValueBoxOperations', 'DynValueCommon', 'DynValueCommonOperations', 'DynValueHelper', 'DynValueOperations', 'NameDynAnyPair', 'NameDynAnyPairHelper', 'NameDynAnyPairSeqHelper', 'NameValuePairSeqHelper', '_DynAnyFactoryStub', '_DynAnyStub', '_DynArrayStub', '_DynEnumStub', '_DynFixedStub', '_DynSequenceStub', '_DynStructStub', '_DynUnionStub', '_DynValueStub'
- ),
- 144 => array (
- 'InconsistentTypeCodeHelper'
- ),
- 145 => array (
- 'InvalidValueHelper'
- ),
- 146 => array (
- 'CodeSets', 'Codec', 'CodecFactory', 'CodecFactoryHelper', 'CodecFactoryOperations', 'CodecOperations', 'ComponentIdHelper', 'ENCODING_CDR_ENCAPS', 'Encoding', 'ExceptionDetailMessage', 'IOR', 'IORHelper', 'IORHolder', 'MultipleComponentProfileHelper', 'MultipleComponentProfileHolder', 'ProfileIdHelper', 'RMICustomMaxStreamFormat', 'ServiceContext', 'ServiceContextHelper', 'ServiceContextHolder', 'ServiceContextListHelper', 'ServiceContextListHolder', 'ServiceIdHelper', 'TAG_ALTERNATE_IIOP_ADDRESS', 'TAG_CODE_SETS', 'TAG_INTERNET_IOP', 'TAG_JAVA_CODEBASE', 'TAG_MULTIPLE_COMPONENTS', 'TAG_ORB_TYPE', 'TAG_POLICIES', 'TAG_RMI_CUSTOM_MAX_STREAM_FORMAT', 'TaggedComponent', 'TaggedComponentHelper', 'TaggedComponentHolder', 'TaggedProfile', 'TaggedProfileHelper', 'TaggedProfileHolder', 'TransactionService'
- ),
- 147 => array (
- 'UnknownEncoding', 'UnknownEncodingHelper'
- ),
- 148 => array (
- 'FormatMismatch', 'FormatMismatchHelper', 'InvalidTypeForEncoding', 'InvalidTypeForEncodingHelper'
- ),
- 149 => array (
- 'SYNC_WITH_TRANSPORT', 'SyncScopeHelper'
- ),
- 150 => array (
- 'ACTIVE', 'AdapterManagerIdHelper', 'AdapterNameHelper', 'AdapterStateHelper', 'ClientRequestInfo', 'ClientRequestInfoOperations', 'ClientRequestInterceptor', 'ClientRequestInterceptorOperations', 'DISCARDING', 'HOLDING', 'INACTIVE', 'IORInfo', 'IORInfoOperations', 'IORInterceptor', 'IORInterceptorOperations', 'IORInterceptor_3_0', 'IORInterceptor_3_0Helper', 'IORInterceptor_3_0Holder', 'IORInterceptor_3_0Operations', 'Interceptor', 'InterceptorOperations', 'InvalidSlot', 'InvalidSlotHelper', 'LOCATION_FORWARD', 'NON_EXISTENT', 'ORBIdHelper', 'ORBInitInfo', 'ORBInitInfoOperations', 'ORBInitializer', 'ORBInitializerOperations', 'ObjectReferenceFactory', 'ObjectReferenceFactoryHelper', 'ObjectReferenceFactoryHolder', 'ObjectReferenceTemplate', 'ObjectReferenceTemplateHelper', 'ObjectReferenceTemplateHolder', 'ObjectReferenceTemplateSeqHelper', 'ObjectReferenceTemplateSeqHolder', 'PolicyFactory', 'PolicyFactoryOperations', 'RequestInfo', 'RequestInfoOperations', 'SUCCESSFUL', 'SYSTEM_EXCEPTION',
- 'ServerIdHelper', 'ServerRequestInfo', 'ServerRequestInfoOperations', 'ServerRequestInterceptor', 'ServerRequestInterceptorOperations', 'TRANSPORT_RETRY', 'USER_EXCEPTION'
- ),
- 151 => array (
- 'DuplicateName', 'DuplicateNameHelper'
- ),
- 152 => array (
- 'AdapterActivator', 'AdapterActivatorOperations', 'ID_ASSIGNMENT_POLICY_ID', 'ID_UNIQUENESS_POLICY_ID', 'IMPLICIT_ACTIVATION_POLICY_ID', 'IdAssignmentPolicy', 'IdAssignmentPolicyOperations', 'IdAssignmentPolicyValue', 'IdUniquenessPolicy', 'IdUniquenessPolicyOperations', 'IdUniquenessPolicyValue', 'ImplicitActivationPolicy', 'ImplicitActivationPolicyOperations', 'ImplicitActivationPolicyValue', 'LIFESPAN_POLICY_ID', 'LifespanPolicy', 'LifespanPolicyOperations', 'LifespanPolicyValue', 'POA', 'POAHelper', 'POAManager', 'POAManagerOperations', 'POAOperations', 'REQUEST_PROCESSING_POLICY_ID', 'RequestProcessingPolicy', 'RequestProcessingPolicyOperations', 'RequestProcessingPolicyValue', 'SERVANT_RETENTION_POLICY_ID', 'Servant', 'ServantActivator', 'ServantActivatorHelper', 'ServantActivatorOperations', 'ServantActivatorPOA', 'ServantLocator', 'ServantLocatorHelper', 'ServantLocatorOperations', 'ServantLocatorPOA', 'ServantManager', 'ServantManagerOperations', 'ServantRetentionPolicy',
- 'ServantRetentionPolicyOperations', 'ServantRetentionPolicyValue', 'THREAD_POLICY_ID', 'ThreadPolicy', 'ThreadPolicyOperations', 'ThreadPolicyValue', '_ServantActivatorStub', '_ServantLocatorStub'
- ),
- 153 => array (
- 'NoContext', 'NoContextHelper'
- ),
- 154 => array (
- 'AdapterInactive', 'AdapterInactiveHelper', 'State'
- ),
- 155 => array (
- 'AdapterAlreadyExists', 'AdapterAlreadyExistsHelper', 'AdapterNonExistent', 'AdapterNonExistentHelper', 'InvalidPolicy', 'InvalidPolicyHelper', 'NoServant', 'NoServantHelper', 'ObjectAlreadyActive', 'ObjectAlreadyActiveHelper', 'ObjectNotActive', 'ObjectNotActiveHelper', 'ServantAlreadyActive', 'ServantAlreadyActiveHelper', 'ServantNotActive', 'ServantNotActiveHelper', 'WrongAdapter', 'WrongAdapterHelper', 'WrongPolicy', 'WrongPolicyHelper'
- ),
- 156 => array (
- 'CookieHolder'
- ),
- 157 => array (
- 'RunTime', 'RunTimeOperations'
- ),
- 158 => array (
- '_Remote_Stub'
- ),
- 159 => array (
- 'Attr', 'CDATASection', 'CharacterData', 'Comment', 'DOMConfiguration', 'DOMError', 'DOMErrorHandler', 'DOMException', 'DOMImplementation', 'DOMImplementationList', 'DOMImplementationSource', 'DOMStringList', 'DocumentFragment', 'DocumentType', 'EntityReference', 'NameList', 'NamedNodeMap', 'Node', 'NodeList', 'Notation', 'ProcessingInstruction', 'Text', 'TypeInfo', 'UserDataHandler'
- ),
- 160 => array (
- 'DOMImplementationRegistry'
- ),
- 161 => array (
- 'EventException', 'EventTarget', 'MutationEvent', 'UIEvent'
- ),
- 162 => array (
- 'DOMImplementationLS', 'LSException', 'LSInput', 'LSLoadEvent', 'LSOutput', 'LSParser', 'LSParserFilter', 'LSProgressEvent', 'LSResourceResolver', 'LSSerializer', 'LSSerializerFilter'
- ),
- 163 => array (
- 'DTDHandler', 'DocumentHandler', 'EntityResolver', 'ErrorHandler', 'HandlerBase', 'InputSource', 'Locator', 'SAXException', 'SAXNotRecognizedException', 'SAXNotSupportedException', 'SAXParseException', 'XMLFilter', 'XMLReader'
- ),
- 164 => array (
- 'Attributes2', 'Attributes2Impl', 'DeclHandler', 'DefaultHandler2', 'EntityResolver2', 'LexicalHandler', 'Locator2', 'Locator2Impl'
- ),
- 165 => array (
- 'AttributeListImpl', 'AttributesImpl', 'DefaultHandler', 'LocatorImpl', 'NamespaceSupport', 'ParserAdapter', 'ParserFactory', 'XMLFilterImpl', 'XMLReaderAdapter', 'XMLReaderFactory'
- ),
- /* ambiguous class names (appear in more than one package) */
- 166 => array (
- 'Annotation', 'AnySeqHelper', 'Array', 'Attribute', 'AttributeList', 'AttributeSet', 'Attributes', 'AuthenticationException', 'Binding', 'Bounds', 'Certificate', 'CertificateEncodingException', 'CertificateException', 'CertificateExpiredException', 'CertificateNotYetValidException', 'CertificateParsingException', 'ConnectException', 'ContentHandler', 'Context', 'Control', 'Current', 'CurrentHelper', 'CurrentOperations', 'DOMLocator', 'DataInputStream', 'DataOutputStream', 'Date', 'DefaultLoaderRepository', 'Delegate', 'Document', 'DocumentEvent', 'DynAny', 'DynArray', 'DynEnum', 'DynFixed', 'DynSequence', 'DynStruct', 'DynUnion', 'DynValue', 'DynamicImplementation', 'Element', 'Entity', 'Event', 'EventListener', 'FieldNameHelper', 'FileFilter', 'Formatter', 'ForwardRequest', 'ForwardRequestHelper', 'InconsistentTypeCode', 'InputStream', 'IntrospectionException', 'InvalidAttributeValueException', 'InvalidKeyException', 'InvalidName', 'InvalidNameHelper', 'InvalidValue', 'List', 'MouseEvent',
- 'NameValuePair', 'NameValuePairHelper', 'ORB', 'Object', 'ObjectIdHelper', 'ObjectImpl', 'OpenType', 'OutputStream', 'ParagraphView', 'Parser', 'Permission', 'Policy', 'Principal', 'Proxy', 'Reference', 'Statement', 'Timer', 'Timestamp', 'TypeMismatch', 'TypeMismatchHelper', 'UNKNOWN', 'UnknownHostException', 'X509Certificate'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- /* all Java keywords are case sensitive */
- 1 => true, 2 => true, 3 => true, 4 => true,
- 5 => true, 6 => true, 7 => true, 8 => true, 9 => true,
- 10 => true, 11 => true, 12 => true, 13 => true, 14 => true,
- 15 => true, 16 => true, 17 => true, 18 => true, 19 => true,
- 20 => true, 21 => true, 22 => true, 23 => true, 24 => true,
- 25 => true, 26 => true, 27 => true, 28 => true, 29 => true,
- 30 => true, 31 => true, 32 => true, 33 => true, 34 => true,
- 35 => true, 36 => true, 37 => true, 38 => true, 39 => true,
- 40 => true, 41 => true, 42 => true, 43 => true, 44 => true,
- 45 => true, 46 => true, 47 => true, 48 => true, 49 => true,
- 50 => true, 51 => true, 52 => true, 53 => true, 54 => true,
- 55 => true, 56 => true, 57 => true, 58 => true, 59 => true,
- 60 => true, 61 => true, 62 => true, 63 => true, 64 => true,
- 65 => true, 66 => true, 67 => true, 68 => true, 69 => true,
- 70 => true, 71 => true, 72 => true, 73 => true, 74 => true,
- 75 => true, 76 => true, 77 => true, 78 => true, 79 => true,
- 80 => true, 81 => true, 82 => true, 83 => true, 84 => true,
- 85 => true, 86 => true, 87 => true, 88 => true, 89 => true,
- 90 => true, 91 => true, 92 => true, 93 => true, 94 => true,
- 95 => true, 96 => true, 97 => true, 98 => true, 99 => true,
- 100 => true, 101 => true, 102 => true, 103 => true, 104 => true,
- 105 => true, 106 => true, 107 => true, 108 => true, 109 => true,
- 110 => true, 111 => true, 112 => true, 113 => true, 114 => true,
- 115 => true, 116 => true, 117 => true, 118 => true, 119 => true,
- 120 => true, 121 => true, 122 => true, 123 => true, 124 => true,
- 125 => true, 126 => true, 127 => true, 128 => true, 129 => true,
- 130 => true, 131 => true, 132 => true, 133 => true, 134 => true,
- 135 => true, 136 => true, 137 => true, 138 => true, 139 => true,
- 140 => true, 141 => true, 142 => true, 143 => true, 144 => true,
- 145 => true, 146 => true, 147 => true, 148 => true, 149 => true,
- 150 => true, 151 => true, 152 => true, 153 => true, 154 => true,
- 155 => true, 156 => true, 157 => true, 158 => true, 159 => true,
- 160 => true, 161 => true, 162 => true, 163 => true, 164 => true,
- 165 => true, 166 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #006600; font-weight: bold;',
- 4 => 'color: #006600; font-weight: bold;',
- 5 => 'color: #003399; font-weight: bold;',
- 6 => 'color: #003399; font-weight: bold;',
- 7 => 'color: #003399; font-weight: bold;',
- 8 => 'color: #003399; font-weight: bold;',
- 9 => 'color: #003399; font-weight: bold;',
- 10 => 'color: #003399; font-weight: bold;',
- 11 => 'color: #003399; font-weight: bold;',
- 12 => 'color: #003399; font-weight: bold;',
- 13 => 'color: #003399; font-weight: bold;',
- 14 => 'color: #003399; font-weight: bold;',
- 15 => 'color: #003399; font-weight: bold;',
- 16 => 'color: #003399; font-weight: bold;',
- 17 => 'color: #003399; font-weight: bold;',
- 18 => 'color: #003399; font-weight: bold;',
- 19 => 'color: #003399; font-weight: bold;',
- 20 => 'color: #003399; font-weight: bold;',
- 21 => 'color: #003399; font-weight: bold;',
- 22 => 'color: #003399; font-weight: bold;',
- 23 => 'color: #003399; font-weight: bold;',
- 24 => 'color: #003399; font-weight: bold;',
- 25 => 'color: #003399; font-weight: bold;',
- 26 => 'color: #003399; font-weight: bold;',
- 27 => 'color: #003399; font-weight: bold;',
- 28 => 'color: #003399; font-weight: bold;',
- 29 => 'color: #003399; font-weight: bold;',
- 30 => 'color: #003399; font-weight: bold;',
- 31 => 'color: #003399; font-weight: bold;',
- 32 => 'color: #003399; font-weight: bold;',
- 33 => 'color: #003399; font-weight: bold;',
- 34 => 'color: #003399; font-weight: bold;',
- 35 => 'color: #003399; font-weight: bold;',
- 36 => 'color: #003399; font-weight: bold;',
- 37 => 'color: #003399; font-weight: bold;',
- 38 => 'color: #003399; font-weight: bold;',
- 39 => 'color: #003399; font-weight: bold;',
- 40 => 'color: #003399; font-weight: bold;',
- 41 => 'color: #003399; font-weight: bold;',
- 42 => 'color: #003399; font-weight: bold;',
- 43 => 'color: #003399; font-weight: bold;',
- 44 => 'color: #003399; font-weight: bold;',
- 45 => 'color: #003399; font-weight: bold;',
- 46 => 'color: #003399; font-weight: bold;',
- 47 => 'color: #003399; font-weight: bold;',
- 48 => 'color: #003399; font-weight: bold;',
- 49 => 'color: #003399; font-weight: bold;',
- 50 => 'color: #003399; font-weight: bold;',
- 51 => 'color: #003399; font-weight: bold;',
- 52 => 'color: #003399; font-weight: bold;',
- 53 => 'color: #003399; font-weight: bold;',
- 54 => 'color: #003399; font-weight: bold;',
- 55 => 'color: #003399; font-weight: bold;',
- 56 => 'color: #003399; font-weight: bold;',
- 57 => 'color: #003399; font-weight: bold;',
- 58 => 'color: #003399; font-weight: bold;',
- 59 => 'color: #003399; font-weight: bold;',
- 60 => 'color: #003399; font-weight: bold;',
- 61 => 'color: #003399; font-weight: bold;',
- 62 => 'color: #003399; font-weight: bold;',
- 63 => 'color: #003399; font-weight: bold;',
- 64 => 'color: #003399; font-weight: bold;',
- 65 => 'color: #003399; font-weight: bold;',
- 66 => 'color: #003399; font-weight: bold;',
- 67 => 'color: #003399; font-weight: bold;',
- 68 => 'color: #003399; font-weight: bold;',
- 69 => 'color: #003399; font-weight: bold;',
- 70 => 'color: #003399; font-weight: bold;',
- 71 => 'color: #003399; font-weight: bold;',
- 72 => 'color: #003399; font-weight: bold;',
- 73 => 'color: #003399; font-weight: bold;',
- 74 => 'color: #003399; font-weight: bold;',
- 75 => 'color: #003399; font-weight: bold;',
- 76 => 'color: #003399; font-weight: bold;',
- 77 => 'color: #003399; font-weight: bold;',
- 78 => 'color: #003399; font-weight: bold;',
- 79 => 'color: #003399; font-weight: bold;',
- 80 => 'color: #003399; font-weight: bold;',
- 81 => 'color: #003399; font-weight: bold;',
- 82 => 'color: #003399; font-weight: bold;',
- 83 => 'color: #003399; font-weight: bold;',
- 84 => 'color: #003399; font-weight: bold;',
- 85 => 'color: #003399; font-weight: bold;',
- 86 => 'color: #003399; font-weight: bold;',
- 87 => 'color: #003399; font-weight: bold;',
- 88 => 'color: #003399; font-weight: bold;',
- 89 => 'color: #003399; font-weight: bold;',
- 90 => 'color: #003399; font-weight: bold;',
- 91 => 'color: #003399; font-weight: bold;',
- 92 => 'color: #003399; font-weight: bold;',
- 93 => 'color: #003399; font-weight: bold;',
- 94 => 'color: #003399; font-weight: bold;',
- 95 => 'color: #003399; font-weight: bold;',
- 96 => 'color: #003399; font-weight: bold;',
- 97 => 'color: #003399; font-weight: bold;',
- 98 => 'color: #003399; font-weight: bold;',
- 99 => 'color: #003399; font-weight: bold;',
- 100 => 'color: #003399; font-weight: bold;',
- 101 => 'color: #003399; font-weight: bold;',
- 102 => 'color: #003399; font-weight: bold;',
- 103 => 'color: #003399; font-weight: bold;',
- 104 => 'color: #003399; font-weight: bold;',
- 105 => 'color: #003399; font-weight: bold;',
- 106 => 'color: #003399; font-weight: bold;',
- 107 => 'color: #003399; font-weight: bold;',
- 108 => 'color: #003399; font-weight: bold;',
- 109 => 'color: #003399; font-weight: bold;',
- 110 => 'color: #003399; font-weight: bold;',
- 111 => 'color: #003399; font-weight: bold;',
- 112 => 'color: #003399; font-weight: bold;',
- 113 => 'color: #003399; font-weight: bold;',
- 114 => 'color: #003399; font-weight: bold;',
- 115 => 'color: #003399; font-weight: bold;',
- 116 => 'color: #003399; font-weight: bold;',
- 117 => 'color: #003399; font-weight: bold;',
- 118 => 'color: #003399; font-weight: bold;',
- 119 => 'color: #003399; font-weight: bold;',
- 120 => 'color: #003399; font-weight: bold;',
- 121 => 'color: #003399; font-weight: bold;',
- 122 => 'color: #003399; font-weight: bold;',
- 123 => 'color: #003399; font-weight: bold;',
- 124 => 'color: #003399; font-weight: bold;',
- 125 => 'color: #003399; font-weight: bold;',
- 126 => 'color: #003399; font-weight: bold;',
- 127 => 'color: #003399; font-weight: bold;',
- 128 => 'color: #003399; font-weight: bold;',
- 129 => 'color: #003399; font-weight: bold;',
- 130 => 'color: #003399; font-weight: bold;',
- 131 => 'color: #003399; font-weight: bold;',
- 132 => 'color: #003399; font-weight: bold;',
- 133 => 'color: #003399; font-weight: bold;',
- 134 => 'color: #003399; font-weight: bold;',
- 135 => 'color: #003399; font-weight: bold;',
- 136 => 'color: #003399; font-weight: bold;',
- 137 => 'color: #003399; font-weight: bold;',
- 138 => 'color: #003399; font-weight: bold;',
- 139 => 'color: #003399; font-weight: bold;',
- 140 => 'color: #003399; font-weight: bold;',
- 141 => 'color: #003399; font-weight: bold;',
- 142 => 'color: #003399; font-weight: bold;',
- 143 => 'color: #003399; font-weight: bold;',
- 144 => 'color: #003399; font-weight: bold;',
- 145 => 'color: #003399; font-weight: bold;',
- 146 => 'color: #003399; font-weight: bold;',
- 147 => 'color: #003399; font-weight: bold;',
- 148 => 'color: #003399; font-weight: bold;',
- 149 => 'color: #003399; font-weight: bold;',
- 150 => 'color: #003399; font-weight: bold;',
- 151 => 'color: #003399; font-weight: bold;',
- 152 => 'color: #003399; font-weight: bold;',
- 153 => 'color: #003399; font-weight: bold;',
- 154 => 'color: #003399; font-weight: bold;',
- 155 => 'color: #003399; font-weight: bold;',
- 156 => 'color: #003399; font-weight: bold;',
- 157 => 'color: #003399; font-weight: bold;',
- 158 => 'color: #003399; font-weight: bold;',
- 159 => 'color: #003399; font-weight: bold;',
- 160 => 'color: #003399; font-weight: bold;',
- 161 => 'color: #003399; font-weight: bold;',
- 162 => 'color: #003399; font-weight: bold;',
- 163 => 'color: #003399; font-weight: bold;',
- 164 => 'color: #003399; font-weight: bold;',
- 165 => 'color: #003399; font-weight: bold;',
- 166 => 'color: #003399; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #006699;',
- 3 => 'color: #008000; font-style: italic; font-weight: bold;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006633;',
- 2 => 'color: #006633;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/applet/{FNAME}.html',
- 6 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/{FNAME}.html',
- 7 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/color/{FNAME}.html',
- 8 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/datatransfer/{FNAME}.html',
- 9 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/dnd/{FNAME}.html',
- 10 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/{FNAME}.html',
- 11 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/font/{FNAME}.html',
- 12 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/geom/{FNAME}.html',
- 13 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/im/{FNAME}.html',
- 14 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/im/spi/{FNAME}.html',
- 15 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/{FNAME}.html',
- 16 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/renderable/{FNAME}.html',
- 17 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/awt/print/{FNAME}.html',
- 18 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/beans/{FNAME}.html',
- 19 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/beans/beancontext/{FNAME}.html',
- 20 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/io/{FNAME}.html',
- 21 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/lang/{FNAME}.html',
- 22 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/{FNAME}.html',
- 23 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/{FNAME}.html',
- 24 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/{FNAME}.html',
- 25 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/{FNAME}.html',
- 26 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/{FNAME}.html',
- 27 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/math/{FNAME}.html',
- 28 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/net/{FNAME}.html',
- 29 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/nio/{FNAME}.html',
- 30 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/nio/channels/{FNAME}.html',
- 31 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/nio/channels/spi/{FNAME}.html',
- 32 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/{FNAME}.html',
- 33 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/nio/charset/spi/{FNAME}.html',
- 34 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/{FNAME}.html',
- 35 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/activation/{FNAME}.html',
- 36 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/dgc/{FNAME}.html',
- 37 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/registry/{FNAME}.html',
- 38 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/rmi/server/{FNAME}.html',
- 39 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/security/{FNAME}.html',
- 40 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/security/acl/{FNAME}.html',
- 41 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/security/cert/{FNAME}.html',
- 42 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/security/interfaces/{FNAME}.html',
- 43 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/security/spec/{FNAME}.html',
- 44 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/sql/{FNAME}.html',
- 45 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/text/{FNAME}.html',
- 46 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/{FNAME}.html',
- 47 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/{FNAME}.html',
- 48 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/atomic/{FNAME}.html',
- 49 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/{FNAME}.html',
- 50 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/jar/{FNAME}.html',
- 51 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/logging/{FNAME}.html',
- 52 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/prefs/{FNAME}.html',
- 53 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/{FNAME}.html',
- 54 => 'http://java.sun.com/j2se/1.5.0/docs/api/java/util/zip/{FNAME}.html',
- 55 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/accessibility/{FNAME}.html',
- 56 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/activity/{FNAME}.html',
- 57 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/crypto/{FNAME}.html',
- 58 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/crypto/interfaces/{FNAME}.html',
- 59 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/crypto/spec/{FNAME}.html',
- 60 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/{FNAME}.html',
- 61 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/event/{FNAME}.html',
- 62 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/metadata/{FNAME}.html',
- 63 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/plugins/bmp/{FNAME}.html',
- 64 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/plugins/jpeg/{FNAME}.html',
- 65 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/spi/{FNAME}.html',
- 66 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/imageio/stream/{FNAME}.html',
- 67 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/{FNAME}.html',
- 68 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/loading/{FNAME}.html',
- 69 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/modelmbean/{FNAME}.html',
- 70 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/monitor/{FNAME}.html',
- 71 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/openmbean/{FNAME}.html',
- 72 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/relation/{FNAME}.html',
- 73 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/remote/{FNAME}.html',
- 74 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/remote/rmi/{FNAME}.html',
- 75 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/management/timer/{FNAME}.html',
- 76 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/{FNAME}.html',
- 77 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/directory/{FNAME}.html',
- 78 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/event/{FNAME}.html',
- 79 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/ldap/{FNAME}.html',
- 80 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/naming/spi/{FNAME}.html',
- 81 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/net/{FNAME}.html',
- 82 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/net/ssl/{FNAME}.html',
- 83 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/print/{FNAME}.html',
- 84 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/print/attribute/{FNAME}.html',
- 85 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/print/attribute/standard/{FNAME}.html',
- 86 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/print/event/{FNAME}.html',
- 87 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/rmi/{FNAME}.html',
- 88 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/rmi/CORBA/{FNAME}.html',
- 89 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/rmi/ssl/{FNAME}.html',
- 90 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/{FNAME}.html',
- 91 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/callback/{FNAME}.html',
- 92 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/kerberos/{FNAME}.html',
- 93 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/login/{FNAME}.html',
- 94 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/spi/{FNAME}.html',
- 95 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/auth/x500/{FNAME}.html',
- 96 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/security/sasl/{FNAME}.html',
- 97 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/midi/{FNAME}.html',
- 98 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/midi/spi/{FNAME}.html',
- 99 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/sampled/{FNAME}.html',
- 100 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sound/sampled/spi/{FNAME}.html',
- 101 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/{FNAME}.html',
- 102 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/{FNAME}.html',
- 103 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/serial/{FNAME}.html',
- 104 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/sql/rowset/spi/{FNAME}.html',
- 105 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/{FNAME}.html',
- 106 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/border/{FNAME}.html',
- 107 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/colorchooser/{FNAME}.html',
- 108 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/event/{FNAME}.html',
- 109 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/filechooser/{FNAME}.html',
- 110 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/{FNAME}.html',
- 111 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/basic/{FNAME}.html',
- 112 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/metal/{FNAME}.html',
- 113 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/multi/{FNAME}.html',
- 114 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/plaf/synth/{FNAME}.html',
- 115 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/table/{FNAME}.html',
- 116 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/{FNAME}.html',
- 117 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/html/{FNAME}.html',
- 118 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/html/parser/{FNAME}.html',
- 119 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/text/rtf/{FNAME}.html',
- 120 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/tree/{FNAME}.html',
- 121 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/undo/{FNAME}.html',
- 122 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/transaction/{FNAME}.html',
- 123 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/transaction/xa/{FNAME}.html',
- 124 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/{FNAME}.html',
- 125 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/datatype/{FNAME}.html',
- 126 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/namespace/{FNAME}.html',
- 127 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/parsers/{FNAME}.html',
- 128 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/{FNAME}.html',
- 129 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/dom/{FNAME}.html',
- 130 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/sax/{FNAME}.html',
- 131 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/transform/stream/{FNAME}.html',
- 132 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/validation/{FNAME}.html',
- 133 => 'http://java.sun.com/j2se/1.5.0/docs/api/javax/xml/xpath/{FNAME}.html',
- 134 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/ietf/jgss/{FNAME}.html',
- 135 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CORBA/{FNAME}.html',
- 136 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CORBA/DynAnyPackage/{FNAME}.html',
- 137 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CORBA/TypeCodePackage/{FNAME}.html',
- 138 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CORBA/portable/{FNAME}.html',
- 139 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CosNaming/{FNAME}.html',
- 140 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CosNaming/NamingContextExtPackage/{FNAME}.html',
- 141 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/CosNaming/NamingContextPackage/{FNAME}.html',
- 142 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/Dynamic/{FNAME}.html',
- 143 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/DynamicAny/{FNAME}.html',
- 144 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/DynamicAny/DynAnyFactoryPackage/{FNAME}.html',
- 145 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/DynamicAny/DynAnyPackage/{FNAME}.html',
- 146 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/IOP/{FNAME}.html',
- 147 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/IOP/CodecFactoryPackage/{FNAME}.html',
- 148 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/IOP/CodecPackage/{FNAME}.html',
- 149 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/Messaging/{FNAME}.html',
- 150 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableInterceptor/{FNAME}.html',
- 151 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableInterceptor/ORBInitInfoPackage/{FNAME}.html',
- 152 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableServer/{FNAME}.html',
- 153 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableServer/CurrentPackage/{FNAME}.html',
- 154 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/{FNAME}.html',
- 155 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableServer/POAPackage/{FNAME}.html',
- 156 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/PortableServer/ServantLocatorPackage/{FNAME}.html',
- 157 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/SendingContext/{FNAME}.html',
- 158 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/omg/stub/java/rmi/{FNAME}.html',
- 159 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/{FNAME}.html',
- 160 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/bootstrap/{FNAME}.html',
- 161 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/events/{FNAME}.html',
- 162 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/ls/{FNAME}.html',
- 163 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/{FNAME}.html',
- 164 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/ext/{FNAME}.html',
- 165 => 'http://java.sun.com/j2se/1.5.0/docs/api/org/xml/sax/helpers/{FNAME}.html',
- /* ambiguous class names (appear in more than one package) */
- 166 => 'http://www.google.com/search?sitesearch=java.sun.com&amp;q=allinurl%3Aj2se%2F1+5+0%2Fdocs%2Fapi+{FNAME}'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- /* Java does not use '::' */
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/javascript.php b/libvpx/examples/includes/geshi/geshi/javascript.php
deleted file mode 100644
index 1232a8a..0000000
--- a/libvpx/examples/includes/geshi/geshi/javascript.php
+++ /dev/null
@@ -1,150 +0,0 @@
-<?php
-/*************************************************************************************
- * javascript.php
- * --------------
- * Author: Ben Keen (ben.keen@gmail.com)
- * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/20
- *
- * JavaScript language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Javascript',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- //Regular Expressions
- 'COMMENT_REGEXP' => array(2 => "/(?<=[\\s^])s\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])m?\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[gimsu]*(?=[\\s$\\.\\,\\;\\)])/iU"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
- 'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
- 'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
- 'while', 'write', 'with'
- ),
- 2 => array(
- 'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
- 'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
- 'protected', 'public', 'super', 'true', 'use', 'var'
- ),
- 3 => array(
- // common functions for Window object
- 'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
- 'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
- 'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
- 'stop',
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}',
- '+', '-', '*', '/', '%',
- '!', '@', '&', '|', '^',
- '<', '>', '=',
- ',', ';', '?', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000066; font-weight: bold;',
- 2 => 'color: #003366; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #006600; font-style: italic;',
- 2 => 'color: #009966; font-style: italic;',
- 'MULTI' => 'color: #006600; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #3366CC;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #CC0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #660066;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<script type="text/javascript">' => '</script>'
- ),
- 1 => array(
- '<script language="javascript">' => '</script>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/kixtart.php b/libvpx/examples/includes/geshi/geshi/kixtart.php
deleted file mode 100644
index 3b4dc4c..0000000
--- a/libvpx/examples/includes/geshi/geshi/kixtart.php
+++ /dev/null
@@ -1,329 +0,0 @@
-<?php
-/*************************************************************************************
- * kixtart.php
- * --------
- * Author: Riley McArdle (riley@glyff.net)
- * Copyright: (c) 2007 Riley McArdle (http://www.glyff.net/)
- * Release Version: 1.0.8.3
- * Date Started: 2007/08/31
- *
- * PHP language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2007/08/31 (1.0.7.22)
- * - First Release
- *
- * TODO (updated 2007/08/31)
- * -------------------------
- * *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'KiXtart',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'While', 'Loop',
- 'Use',
- 'Small',
- 'Sleep',
- 'Shell',
- 'SetTime',
- 'SetM',
- 'SetL',
- 'Set',
- 'Select', 'Case',
- 'Run',
- 'Return',
- 'Redim',
- 'RD',
- 'Quit',
- 'Play',
- 'Move',
- 'MD',
- 'Include',
- 'If', 'Else', 'Endif',
- 'GoTo',
- 'GoSub',
- 'Go',
- 'Global',
- 'GetS',
- 'Get',
- 'Function', 'Endfunction',
- 'For', 'Next',
- 'Each',
- 'FlushKb',
- 'Exit',
- 'Do', 'Until',
- 'Display',
- 'Dim',
- 'Del',
- 'Debug',
- 'Copy',
- 'Cookie1',
- 'Color',
- 'CLS',
- 'CD',
- 'Call',
- 'Break',
- 'Big',
- 'Beep',
- ),
- 2 => array(
- '@Address',
- '@Build',
- '@Color',
- '@Comment',
- '@CPU',
- '@CRLF',
- '@CSD',
- '@CurDir',
- '@Date',
- '@Day',
- '@Domain',
- '@DOS',
- '@Error',
- '@FullName',
- '@HomeDir',
- '@HomeDrive',
- '@HomeShr',
- '@HostName',
- '@InWin',
- '@IPaddressX',
- '@KiX',
- '@LanRoot',
- '@LDomain',
- '@LDrive',
- '@LM',
- '@LogonMode',
- '@LongHomeDir',
- '@LServer',
- '@MaxPWAge',
- '@MDayNo',
- '@MHz',
- '@MonthNo',
- '@Month',
- '@MSecs',
- '@OnWoW64',
- '@PID',
- '@PrimaryGroup',
- '@Priv',
- '@ProductSuite',
- '@ProductType',
- '@PWAge',
- '@RAS',
- '@Result',
- '@RServer',
- '@ScriptDir',
- '@ScriptExe',
- '@ScriptName',
- '@SError',
- '@SID',
- '@Site',
- '@StartDir',
- '@SysLang',
- '@Ticks',
- '@Time',
- '@TsSession',
- '@UserID',
- '@UserLang',
- '@WDayNo',
- '@Wksta',
- '@WUserID',
- '@YDayNo',
- '@Year',
- ),
- 3 => array(
- 'WriteValue',
- 'WriteProfileString',
- 'WriteLine',
- 'VarTypeName',
- 'VarType',
- 'Val',
- 'UnloadHive',
- 'UCase',
- 'Ubound',
- 'Trim',
- 'Substr',
- 'SRnd',
- 'Split',
- 'SidToName',
- 'ShutDown',
- 'ShowProgramGroup',
- 'SetWallpaper',
- 'SetTitle',
- 'SetSystemState',
- 'SetOption',
- 'SetFocus',
- 'SetFileAttr',
- 'SetDefaultPrinter',
- 'SetConsole',
- 'SetAscii',
- 'SendMessage',
- 'SendKeys',
- 'SaveKey',
- 'RTrim',
- 'Round',
- 'Rnd',
- 'Right',
- 'RedirectOutput',
- 'ReadValue',
- 'ReadType',
- 'ReadProfileString',
- 'ReadLine',
- 'Open',
- 'MessageBox',
- 'MemorySize',
- 'LTrim',
- 'Logoff',
- 'LogEvent',
- 'LoadKey',
- 'LoadHive',
- 'Len',
- 'Left',
- 'LCase',
- 'KeyExist',
- 'KbHit',
- 'Join',
- 'IsDeclared',
- 'Int',
- 'InStrRev',
- 'InStr',
- 'InGroup',
- 'IIF',
- 'GetObject',
- 'GetFileVersion',
- 'GetFileTime',
- 'GetFileSize',
- 'GetFileAttr',
- 'GetDiskSpace',
- 'FreeFileHandle',
- 'FormatNumber',
- 'Fix',
- 'ExpandEnvironmentVars',
- 'Exist',
- 'Execute',
- 'EnumValue',
- 'EnumLocalGroup',
- 'EnumKey',
- 'EnumIpInfo',
- 'EnumGroup',
- 'Dir',
- 'DelValue',
- 'DelTree',
- 'DelProgramItem',
- 'DelProgramGroup',
- 'DelPrinterConnection',
- 'DelKey',
- 'DecToHex',
- 'CStr',
- 'CreateObject',
- 'CompareFileTimes',
- 'Close',
- 'ClearEventLog',
- 'CInt',
- 'Chr',
- 'CDbl',
- 'Box',
- 'BackupEventLog',
- 'At',
- 'AScan',
- 'Asc',
- 'AddProgramItem',
- 'AddProgramGroup',
- 'AddPrinterConnection',
- 'AddKey',
- 'Abs'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '?', ':', '+', '-', '*', '/', '&', '|', '^', '~', '<', '>', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.kixtart.org/manual/Commands/{FNAMEL}.htm',
- 2 => '',
- 3 => 'http://www.kixtart.org/manual/Functions/{FNAMEL}.htm'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/klonec.php b/libvpx/examples/includes/geshi/geshi/klonec.php
deleted file mode 100644
index 599f56b..0000000
--- a/libvpx/examples/includes/geshi/geshi/klonec.php
+++ /dev/null
@@ -1,282 +0,0 @@
-<?php
-/*************************************************************************************
- * klonec.php
- * --------
- * Author: AUGER Mickael
- * Copyright: Synchronic
- * Release Version: 1.0.8.3
- * Date Started: 2008/04/16
- *
- * KLone with C language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/04/16 (1.0.8)
- * - First Release
- *
- * TODO (updated 2008/04/16)
- * -------------------------
- * A tester et a completer si besoin
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'KLone C',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),//#pour precede les include de C
- 'COMMENT_MULTI' => array('/*' => '*/', '<!--' => '-->' ),//comentaires C et KLone suivi de ceux pour HTML
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(//mots-cles C
- 'if', 'return', 'while', 'case', 'class', 'continue', 'default',
- 'do', 'else', 'for', 'switch', 'goto',
- 'null', 'break', 'true', 'enum', 'extern', 'inline', 'false'
- ),
- 2 => array(//mots-cles KLone
- 'out', 'request', 'response',
- ),
- 3 => array(//fonctions C usuelles
- 'printf', 'malloc', 'fopen', 'fclose', 'free', 'fputs', 'fgets', 'feof', 'fwrite',
- 'perror', 'ferror', 'qsort', 'stats', 'sscanf', 'scanf',
- 'strdup', 'strcpy', 'strcmp', 'strncpy', 'strcasecmp', 'cat', 'strcat', 'strstr',
- 'strlen', 'strtof', 'strtod', 'strtok', 'towlower', 'towupper',
- 'cd', 'system', 'exit', 'exec', 'fork', 'vfork', 'kill', 'signal', 'syslog',
- 'usleep', 'utime', 'wait', 'waitpid', 'waitid',
- 'ceil', 'eval', 'round', 'floor',
- 'atoi', 'atol', 'abs', 'cos', 'sin', 'tan', 'acos', 'asin', 'atan', 'exp',
- 'time', 'ctime', 'localtime', 'asctime', 'gmtime', 'difftime', 'date'
- ),
- 4 => array(//fonctions KLone usuelles
- 'request_get_cookies', 'request_get_cookie', 'request_get_args', 'request_get_arg',
- 'request_io', 'request_get_uri', 'request_get_filename', 'request_get_query_string', 'request_get_path_info',
- 'request_get_if_modified_since', 'request_get_http', 'request_get_client_request',
- 'request_get_content_length', 'request_get_uploads', 'request_get_uploaded_file',
- 'request_get_method', 'request_get_protocol', 'request_get_resolved_filename',
- 'request_get_resolved_path_info', 'request_get_addr', 'request_get_peer_addr',
- 'request_get_header', 'request_get_field', 'request_get_field_value',
- 'response_set_content_encoding', 'response_disable_caching', 'response_enable_caching',
- 'response_set_cookie', 'response_set_method', 'response_get_method',
- 'response_print_header', 'response_set_field', 'response_del_field',
- 'response_set_content_type', 'response_set_date', 'response_set_last_modified',
- 'response_set_content_length', 'response_get_status', 'response_get_header',
- 'response_io', 'response_redirect', 'response_set_status',
- 'session_get_vars', 'session_get', 'session_set', 'session_age', 'session_clean', 'session_del',
- 'io_type', 'io_pipe', 'io_dup', 'io_copy', 'io_seek', 'io_tell', 'io_close',
- 'io_free', 'io_read', 'io_printf', 'io_flush', 'io_write', 'io_putc', 'io_getc',
- 'io_get_until', 'io_gets', 'io_codec_add_head', 'io_codec_add_tail',
- 'io_codecs_remove', 'io_name_set', 'io_name_get'
- ),
- 5 => array(//types C
- 'auto', 'char', 'const', 'double', 'float', 'int', 'long',
- 'register', 'short', 'signed', 'sizeof', 'static', 'string', 'struct',
- 'typedef', 'union', 'unsigned', 'void', 'volatile',
- 'wchar_t', 'time_t', 'FILE'
- ),
- 6 => array(//mots-cles HTML
- 'a', 'abbr', 'acronym', 'address', 'applet',
-
- 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
-
- 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
-
- 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
-
- 'em',
-
- 'fieldset', 'font', 'form', 'frame', 'frameset',
-
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
-
- 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
-
- 'kbd',
-
- 'label', 'legend', 'link', 'li',
-
- 'map', 'meta',
-
- 'noframes', 'noscript',
-
- 'object', 'ol', 'optgroup', 'option',
-
- 'param', 'pre', 'p',
-
- 'q',
-
- 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
-
- 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
-
- 'ul', 'u',
-
- 'var',
- ),
- 7 => array(//autres mots-cles HTML
- 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
- 'background', 'bgcolor', 'border',
- 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
- 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
- 'enctype',
- 'face', 'for', 'frame', 'frameborder',
- 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
- 'id', 'ismap',
- 'label', 'lang', 'language', 'link', 'longdesc',
- 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
- 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
- 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
- 'profile', 'prompt',
- 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
- 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
- 'tabindex', 'target', 'text', 'title', 'type',
- 'usemap',
- 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
- 'width'
- )
- ),
- 'SYMBOLS' => array(
- 1 => array(
- '<%=', '<%!', '<%', '%>'
- ),
- 0 => array(
- '(', ')', '[', ']', '{', '}',
- '!', '%', '&', '|', '/',
- '<', '>',
- '=', '-', '+', '*',
- '.', ':', ',', ';', '^'
- )
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100; font-weight: bold;',//pour les mots-cles C
- 2 => 'color: #000000; font-weight: bold;',//pour les mots-cles KLone
- 3 => 'color: #6600FF;',//pour les fonctions C
- 4 => 'color: #6600FF;',//pour les fonctions Klone
- 5 => 'color: #0099FF; font-weight: bold;',//pour les types C
- 6 => 'color: #990099; font-weight: bold;',//pour les mots-cles HTML
- 7 => 'color: #000066;'//pour les autres mots-cles HTML
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',//commentaire sur une ligne C et KLone
- 2 => 'color: #339933;',//pour les #... en C
- 'MULTI' => 'color: #808080; font-style: italic;'//commentaire sur plusieurs lignes C et KLone
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;',
- 1 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(),
- 'SCRIPT' => array(
- 0 => 'background-color:#ffccff; font-weight: bold; color:#000000;',
- 1 => '',
- 2 => '',
- 3 => 'color: #00bbdd; font-weight: bold;',
- 4 => 'color: #ddbb00;',
- 5 => 'color: #009900;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
- 4 => 'http://www.koanlogic.com/klone/api/html/globals.html',
- 5 => '',
- 6 => 'http://december.com/html/4/element/{FNAMEL}.html',
- 7 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- //delimiteurs pour KLone
- 0 => array(
- '<%=' => '%>'
- ),
- 1 => array(
- '<%!' => '%>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- //delimiteur pour HTML
- 3 => array(
- '<!DOCTYPE' => '>'
- ),
- 4 => array(
- '&' => ';'
- ),
- 5 => array(
- '<' => '>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => false,
- 1 => true,
- 2 => true,
- 3 => false,
- 4 => false,
- 5 => true
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 6 => array(
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
- ),
- 7 => array(
- 'DISALLOWED_AFTER' => '(?=\s*=)',
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/klonecpp.php b/libvpx/examples/includes/geshi/geshi/klonecpp.php
deleted file mode 100644
index 7be4f40..0000000
--- a/libvpx/examples/includes/geshi/geshi/klonecpp.php
+++ /dev/null
@@ -1,310 +0,0 @@
-<?php
-/*************************************************************************************
- * klonecpp.php
- * --------
- * Author: AUGER Mickael
- * Copyright: Synchronic
- * Release Version: 1.0.8.3
- * Date Started: 2008/04/16
- *
- * KLone with C++ language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/04/16 (1.0.8)
- * - First Release
- *
- * TODO (updated 2008/04/16)
- * -------------------------
- * A tester et a completer si besoin
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'KLone C++',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),//#pour precede les include de C
- 'COMMENT_MULTI' => array('/*' => '*/', '<!--' => '-->' ),//comentaires C et KLone suivi de ceux pour HTML
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(//mots-cles C++
- 'if', 'return', 'while', 'case', 'continue', 'default',
- 'do', 'else', 'for', 'switch', 'goto',
- 'break', 'true', 'enum', 'extern', 'inline', 'false',
- 'errno', 'stdin', 'stdout', 'stderr',
- 'virtual', 'public', 'private', 'protected', 'template', 'using', 'namespace',
- 'try', 'catch', 'dynamic_cast', 'const_cast', 'reinterpret_cast',
- 'static_cast', 'explicit', 'friend', 'typename', 'typeid', 'class',
- 'EDOM', 'ERANGE', 'FLT_RADIX', 'FLT_ROUNDS', 'FLT_DIG', 'DBL_DIG', 'LDBL_DIG',
- 'FLT_EPSILON', 'DBL_EPSILON', 'LDBL_EPSILON', 'FLT_MANT_DIG', 'DBL_MANT_DIG',
- 'LDBL_MANT_DIG', 'FLT_MAX', 'DBL_MAX', 'LDBL_MAX', 'FLT_MAX_EXP', 'DBL_MAX_EXP',
- 'LDBL_MAX_EXP', 'FLT_MIN', 'DBL_MIN', 'LDBL_MIN', 'FLT_MIN_EXP', 'DBL_MIN_EXP',
- 'LDBL_MIN_EXP', 'CHAR_BIT', 'CHAR_MAX', 'CHAR_MIN', 'SCHAR_MAX', 'SCHAR_MIN',
- 'UCHAR_MAX', 'SHRT_MAX', 'SHRT_MIN', 'USHRT_MAX', 'INT_MAX', 'INT_MIN',
- 'UINT_MAX', 'LONG_MAX', 'LONG_MIN', 'ULONG_MAX', 'HUGE_VAL', 'SIGABRT',
- 'SIGFPE', 'SIGILL', 'SIGINT', 'SIGSEGV', 'SIGTERM', 'SIG_DFL', 'SIG_ERR',
- 'SIG_IGN', 'BUFSIZ', 'EOF', 'FILENAME_MAX', 'FOPEN_MAX', 'L_tmpnam', 'NULL',
- 'SEEK_CUR', 'SEEK_END', 'SEEK_SET', 'TMP_MAX',
- 'EXIT_FAILURE', 'EXIT_SUCCESS', 'RAND_MAX', 'CLOCKS_PER_SEC'
- ),
- 2 => array(//mots-cles KLone
- 'out', 'request', 'response',
- ),
- 3 => array(//fonctions C++ usuelles
- 'cin', 'cerr', 'clog', 'cout', 'delete', 'new', 'this',
- 'printf', 'fprintf', 'snprintf', 'sprintf', 'assert',
- 'isalnum', 'isalpha', 'isdigit', 'iscntrl', 'isgraph', 'islower', 'isprint',
- 'ispunct', 'isspace', 'isupper', 'isxdigit', 'tolower', 'toupper',
- 'exp', 'log', 'log10', 'pow', 'sqrt', 'ceil', 'floor', 'fabs', 'ldexp',
- 'frexp', 'modf', 'fmod', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'atan2',
- 'sinh', 'cosh', 'tanh', 'setjmp', 'longjmp',
- 'va_start', 'va_arg', 'va_end', 'offsetof', 'sizeof', 'fopen', 'freopen',
- 'fflush', 'fclose', 'remove', 'rename', 'tmpfile', 'tmpname', 'setvbuf',
- 'setbuf', 'vfprintf', 'vprintf', 'vsprintf', 'fscanf', 'scanf', 'sscanf',
- 'fgetc', 'fgets', 'fputc', 'fputs', 'getc', 'getchar', 'gets', 'putc',
- 'putchar', 'puts', 'ungetc', 'fread', 'fwrite', 'fseek', 'ftell', 'rewind',
- 'fgetpos', 'fsetpos', 'clearerr', 'feof', 'ferror', 'perror', 'abs', 'labs',
- 'div', 'ldiv', 'atof', 'atoi', 'atol', 'strtod', 'strtol', 'strtoul', 'calloc',
- 'malloc', 'realloc', 'free', 'abort', 'exit', 'atexit', 'system', 'getenv',
- 'bsearch', 'qsort', 'rand', 'srand', 'strcpy', 'strncpy', 'strcat', 'strncat',
- 'strcmp', 'strncmp', 'strcoll', 'strchr', 'strrchr', 'strspn', 'strcspn',
- 'strpbrk', 'strstr', 'strlen', 'strerror', 'strtok', 'strxfrm', 'memcpy',
- 'memmove', 'memcmp', 'memchr', 'memset', 'clock', 'time', 'difftime', 'mktime',
- 'asctime', 'ctime', 'gmtime', 'localtime', 'strftime'
- ),
- 4 => array(//fonctions KLone usuelles
- 'request_get_cookies', 'request_get_cookie', 'request_get_args', 'request_get_arg',
- 'request_io', 'request_get_uri', 'request_get_filename', 'request_get_query_string', 'request_get_path_info',
- 'request_get_if_modified_since', 'request_get_http', 'request_get_client_request',
- 'request_get_content_length', 'request_get_uploads', 'request_get_uploaded_file',
- 'request_get_method', 'request_get_protocol', 'request_get_resolved_filename',
- 'request_get_resolved_path_info', 'request_get_addr', 'request_get_peer_addr',
- 'request_get_header', 'request_get_field', 'request_get_field_value',
- 'response_set_content_encoding', 'response_disable_caching', 'response_enable_caching',
- 'response_set_cookie', 'response_set_method', 'response_get_method',
- 'response_print_header', 'response_set_field', 'response_del_field',
- 'response_set_content_type', 'response_set_date', 'response_set_last_modified',
- 'response_set_content_length', 'response_get_status', 'response_get_header',
- 'response_io', 'response_redirect', 'response_set_status',
- 'session_get_vars', 'session_get', 'session_set', 'session_age', 'session_clean', 'session_del',
- 'io_type', 'io_pipe', 'io_dup', 'io_copy', 'io_seek', 'io_tell', 'io_close',
- 'io_free', 'io_read', 'io_printf', 'io_flush', 'io_write', 'io_putc', 'io_getc',
- 'io_get_until', 'io_gets', 'io_codec_add_head', 'io_codec_add_tail',
- 'io_codecs_remove', 'io_name_set', 'io_name_get'
- ),
- 5 => array(//types C++
- 'auto', 'bool', 'char', 'const', 'double', 'float', 'int', 'long', 'longint',
- 'register', 'short', 'shortint', 'signed', 'static', 'struct',
- 'typedef', 'union', 'unsigned', 'void', 'volatile', 'jmp_buf',
- 'signal', 'raise', 'va_list', 'ptrdiff_t', 'size_t', 'FILE', 'fpos_t',
- 'div_t', 'ldiv_t', 'clock_t', 'time_t', 'tm',
- 'string', 'wchar_t'
- ),
- 6 => array(//mots-cles HTML
- 'a', 'abbr', 'acronym', 'address', 'applet',
-
- 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
-
- 'caption', 'center', 'cite', 'code', 'colgroup', 'col',
-
- 'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
-
- 'em',
-
- 'fieldset', 'font', 'form', 'frame', 'frameset',
-
- 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
-
- 'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
-
- 'kbd',
-
- 'label', 'legend', 'link', 'li',
-
- 'map', 'meta',
-
- 'noframes', 'noscript',
-
- 'object', 'ol', 'optgroup', 'option',
-
- 'param', 'pre', 'p',
-
- 'q',
-
- 'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
-
- 'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
-
- 'ul', 'u',
-
- 'var',
- ),
- 7 => array(//autres mots-cles HTML
- 'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
- 'background', 'bgcolor', 'border',
- 'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
- 'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
- 'enctype',
- 'face', 'for', 'frame', 'frameborder',
- 'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
- 'id', 'ismap',
- 'label', 'lang', 'language', 'link', 'longdesc',
- 'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
- 'name', 'nohref', 'noresize', 'noshade', 'nowrap',
- 'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
- 'profile', 'prompt',
- 'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
- 'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
- 'tabindex', 'target', 'text', 'title', 'type',
- 'usemap',
- 'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
- 'width'
- )
- ),
- 'SYMBOLS' => array(
- 1 => array(
- '<%=', '<%!', '<%', '%>'
- ),
- 0 => array(
- '(', ')', '[', ']', '{', '}',
- '!', '%', '&', '|', '/',
- '<', '>',
- '=', '-', '+', '*',
- '.', ':', ',', ';', '^'
- )
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100; font-weight: bold;',//pour les mots-cles C++
- 2 => 'color: #000000; font-weight: bold;',//pour les mots-cles KLone
- 3 => 'color: #6600FF;',//pour les fonctions C++
- 4 => 'color: #6600FF;',//pour les fonctions Klone
- 5 => 'color: #0099FF; font-weight: bold;',//pour les types C++
- 6 => 'color: #990099; font-weight: bold;',//pour les mots-cles HTML
- 7 => 'color: #000066;'//pour les autres mots-cles HTML
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',//commentaire sur une ligne C++ et KLone
- 2 => 'color: #339933;',//pour les #... en C++
- 'MULTI' => 'color: #808080; font-style: italic;'//commentaire sur plusieurs lignes C++ et KLone
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;',
- 1 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(),
- 'SCRIPT' => array(
- 0 => 'background-color:#ffccff; font-weight: bold; color:#000000;',
- 1 => '',
- 2 => '',
- 3 => 'color: #00bbdd; font-weight: bold;',
- 4 => 'color: #ddbb00;',
- 5 => 'color: #009900;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAMEL}.html',
- 4 => 'http://www.koanlogic.com/klone/api/html/globals.html',
- 5 => '',
- 6 => 'http://december.com/html/4/element/{FNAMEL}.html',
- 7 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- //delimiteurs pour KLone
- 0 => array(
- '<%=' => '%>'
- ),
- 1 => array(
- '<%!' => '%>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- //delimiteur pour HTML
- 3 => array(
- '<!DOCTYPE' => '>'
- ),
- 4 => array(
- '&' => ';'
- ),
- 5 => array(
- '<' => '>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => false,
- 1 => true,
- 2 => true,
- 3 => false,
- 4 => false,
- 5 => true
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 6 => array(
- 'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
- 'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
- ),
- 7 => array(
- 'DISALLOWED_AFTER' => '(?=\s*=)',
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/latex.php b/libvpx/examples/includes/geshi/geshi/latex.php
deleted file mode 100644
index e4926d9..0000000
--- a/libvpx/examples/includes/geshi/geshi/latex.php
+++ /dev/null
@@ -1,209 +0,0 @@
-<?php
-/*************************************************************************************
- * latex.php
- * -----
- * Author: efi, Matthias Pospiech (matthias@pospiech.eu)
- * Copyright: (c) 2006 efi, Matthias Pospiech (matthias@pospiech.eu), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2006/09/23
- *
- * LaTeX language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/08/18 (1.0.8.1)
- * - Changes in color and some additional command recognition
- * - No special Color for Brackets, it is only distracting
- * if color should be reintroduced it should be less bright
- * - Math color changed from green to violett, since green is now used for comments
- * - Comments are now colored and the only green. The reason for coloring the comments
- * is that often important information is in the comments und was merely unvisible before.
- * - New Color for [Options]
- * - color for labels not specialised anymore. It makes sence in large documents but less in
- * small web examples.
- * - \@keyword introduced
- * - Fixed \& escaped ampersand
- * 2006/09/23 (1.0.0)
- * - First Release
- *
- * TODO
- * -------------------------
- * *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'LaTeX',
- 'COMMENT_SINGLE' => array(
- 1 => '%'
- ),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'appendix','backmatter','caption','captionabove','captionbelow',
- 'def','documentclass','edef','equation','flushleft','flushright',
- 'footnote','frontmatter','hline','include','input','item','label',
- 'let','listfiles','listoffigures','listoftables','mainmatter',
- 'makeatletter','makeatother','makebox','mbox','par','raggedleft',
- 'raggedright','raisebox','ref','rule','table','tableofcontents',
- 'textbf','textit','texttt','today'
- )
- ),
- 'SYMBOLS' => array(
- "&", "\\", "{", "}", "[", "]"
- ),
- 'CASE_SENSITIVE' => array(
- 1 => true,
- GESHI_COMMENTS => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #800000; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #2C922C; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000000; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- ),
- 'STRINGS' => array(
- 0 => 'color: #000000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #E02020; '
- ),
- 'REGEXPS' => array(
- 1 => 'color: #8020E0; font-weight: normal;', // Math inner
- 2 => 'color: #C08020; font-weight: normal;', // [Option]
- 3 => 'color: #8020E0; font-weight: normal;', // Maths
- 4 => 'color: #800000; font-weight: normal;', // Structure: Labels
- 5 => 'color: #00008B; font-weight: bold;', // Structure (\section{->x<-})
- 6 => 'color: #800000; font-weight: normal;', // Structure (\section)
- 7 => 'color: #0000D0; font-weight: normal;', // Environment \end or \begin{->x<-} (brighter blue)
- 8 => 'color: #C00000; font-weight: normal;', // Structure \end or \begin
- 9 => 'color: #2020C0; font-weight: normal;', // {...}
- 10 => 'color: #800000; font-weight: normal;', // \%, \& etc.
- 11 => 'color: #E00000; font-weight: normal;', // \@keyword
- 12 => 'color: #800000; font-weight: normal;', // \keyword
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.golatex.de/wiki/index.php?title=\\{FNAME}',
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- // Math inner
- 1 => array(
- GESHI_SEARCH => "(\\\\begin\\{(equation|displaymath|eqnarray|subeqnarray|math|multline|gather|align|alignat|flalign)\\})(.*)(\\\\end\\{\\2\\})",
- GESHI_REPLACE => '\3',
- GESHI_MODIFIERS => 'Us',
- GESHI_BEFORE => '\1',
- GESHI_AFTER => '\4'
- ),
- // [options]
- 2 => array(
- GESHI_SEARCH => "(?<=\[).+(?=\])",
- GESHI_REPLACE => '\0',
- GESHI_MODIFIERS => 'Us',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- // Math mode with $ ... $
- 3 => array(
- GESHI_SEARCH => "\\$.+\\$",
- GESHI_REPLACE => '\0',
- GESHI_MODIFIERS => 'Us',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- // Structure: Label
- 4 => "\\\\(?:label|pageref|ref|cite)(?=[^a-zA-Z])",
- // Structure: sections
- 5 => array(
- GESHI_SEARCH => "(\\\\(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph|addpart|addchap|addsec)\*?\\{)(.*)(?=\\})",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'U',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- // Structure: sections
- 6 => "\\\\(?:part|chapter|(?:sub){0,2}section|(?:sub)?paragraph|addpart|addchap|addsec)\*?(?=[^a-zA-Z])",
- // environment \begin{} and \end{} (i.e. the things inside the {})
- 7 => array(
- GESHI_SEARCH => "(\\\\(?:begin|end)\\{)(.*)(?=\\})",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'U',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- // Structure \begin and \end
- 8 => "\\\\(?:end|begin)(?=[^a-zA-Z])",
- // {parameters}
- 9 => array(
- GESHI_SEARCH => "(?<=\\{)(?!<\|!REG3XP5!>).*(?=\\})",
- GESHI_REPLACE => '\0',
- GESHI_MODIFIERS => 'Us',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- // \%, \& usw.
- 10 => "\\\\(?:[_$%]|&amp;)",
- // \@keywords
- 11 => "(?<!<\|!REG3XP[8]!>)\\\\@[a-zA-Z]+\*?",
- // \keywords
- 12 => "(?<!<\|!REG3XP[468]!>)\\\\[a-zA-Z]+\*?",
-
-// ---------------------------------------------
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'COMMENTS' => array(
- 'DISALLOWED_BEFORE' => '\\'
- ),
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<=\\\\)",
- 'DISALLOWED_AFTER' => "(?=\b)(?!\w)"
- ),
- 'ENABLE_FLAGS' => array(
- 'NUMBERS' => GESHI_NEVER,
- 'BRACKETS' => GESHI_NEVER
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/lisp.php b/libvpx/examples/includes/geshi/geshi/lisp.php
deleted file mode 100644
index de08d9c..0000000
--- a/libvpx/examples/includes/geshi/geshi/lisp.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/*************************************************************************************
- * lisp.php
- * --------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * Generic Lisp language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/12/9 (1.0.2)
- * - Added support for :keywords and ::access (Denis Mashkevich)
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/08/30 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Lisp',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(';|' => '|;'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'not','defun','princ','when',
- 'eval','apply','funcall','quote','identity','function',
- 'complement','backquote','lambda','set','setq','setf',
- 'defmacro','gensym','make','symbol','intern',
- 'name','value','plist','get',
- 'getf','putprop','remprop','hash','array','aref',
- 'car','cdr','caar','cadr','cdar','cddr','caaar','caadr','cadar',
- 'caddr','cdaar','cdadr','cddar','cdddr','caaaar','caaadr',
- 'caadar','caaddr','cadaar','cadadr','caddar','cadddr',
- 'cdaaar','cdaadr','cdadar','cdaddr','cddaar','cddadr',
- 'cdddar','cddddr','cons','list','append','reverse','last','nth',
- 'nthcdr','member','assoc','subst','sublis','nsubst',
- 'nsublis','remove','length',
- 'mapc','mapcar','mapl','maplist','mapcan','mapcon','rplaca',
- 'rplacd','nconc','delete','atom','symbolp','numberp',
- 'boundp','null','listp','consp','minusp','zerop','plusp',
- 'evenp','oddp','eq','eql','equal','cond','case','and','or',
- 'let','l','if','prog','prog1','prog2','progn','go','return',
- 'do','dolist','dotimes','catch','throw','error','cerror','break',
- 'continue','errset','baktrace','evalhook','truncate','float',
- 'rem','min','max','abs','sin','cos','tan','expt','exp','sqrt',
- 'random','logand','logior','logxor','lognot','bignums','logeqv',
- 'lognand','lognor','logorc2','logtest','logbitp','logcount',
- 'integer','nil','parse-integer'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']',
- '!', '%', '^', '&',
- ' + ',' - ',' * ',' / ',
- '=','<','>',
- '.',':',',',';',
- '|'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #555;',
- 1 => 'color: #555;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- '::', ':'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'OOLANG' => array(
- 'MATCH_AFTER' => '[a-zA-Z][a-zA-Z0-9_\-]*'
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/locobasic.php b/libvpx/examples/includes/geshi/geshi/locobasic.php
deleted file mode 100644
index 02e6a7a..0000000
--- a/libvpx/examples/includes/geshi/geshi/locobasic.php
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-/*************************************************************************************
- * locobasic.php
- * -------------
- * Author: Nacho Cabanes
- * Copyright: (c) 2009 Nacho Cabanes (http://www.nachocabanes.com)
- * Release Version: 1.0.8.3
- * Date Started: 2009/03/22
- *
- * Locomotive Basic (Amstrad CPC series) language file for GeSHi.
- *
- * More details at http://en.wikipedia.org/wiki/Locomotive_BASIC
- *
- * CHANGES
- * -------
- * 2009/03/22 (1.0.8.3)
- * - First Release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Locomotive Basic',
- 'COMMENT_SINGLE' => array(1 => "'", 2 => 'REM'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- "AFTER", "AND", "AUTO", "BORDER", "BREAK", "CALL", "CAT", "CHAIN",
- "CLEAR", "CLG", "CLS", "CLOSEIN", "CLOSEOUT", "CONT", "CURSOR",
- "DATA", "DEF", "DEFINT", "DEFREAL", "DEFSTR", "DEG", "DELETE",
- "DERR", "DI", "DIM", "DRAW", "DRAWR", "EDIT", "EI", "ELSE", "END",
- "ENV", "ENT", "EOF", "ERASE", "ERL", "ERR", "ERROR", "EVERY",
- "FILL", "FN", "FOR", "FRAME", "GOSUB", "GOTO", "GRAPHICS", "HIMEM",
- "IF", "INK", "INPUT", "KEY", "LET", "LINE", "LIST", "LOAD",
- "LOCATE", "MASK", "MEMORY", "MERGE", "MODE", "MOVE", "MOVER", "NEW",
- "NEXT", "NOT", "ON", "OPENIN", "OPENOUT", "OR", "ORIGIN", "PAPER",
- "PEEK", "PEN", "PLOT", "PLOTR", "POKE", "PRINT", "RAD", "RANDOMIZE",
- "READ", "RELEASE", "REMAIN", "RENUM", "RESTORE", "RESUME", "RETURN",
- "RUN", "SAVE", "SPEED", "SOUND", "SPC", "SQ", "STEP", "STOP", "SWAP",
- "SYMBOL", "TAB", "TAG", "TAGOFF", "TEST", "TESTR", "TIME", "TO",
- "THEN", "TRON", "TROFF", "USING", "WAIT", "WEND", "WHILE", "WIDTH",
- "WINDOW", "WRITE", "XOR", "ZONE"
- ),
- 2 => array(
- "ABS", "ASC", "ATN", "BIN", "CHR", "CINT", "COPYCHR", "COS",
- "CREAL", "DEC", "FIX", "FRE", "EXP", "HEX", "INKEY", "INP", "INSTR",
- "INT", "JOY", "LEFT", "LEN", "LOG", "LOG10", "LOWER", "MAX", "MID",
- "MIN", "MOD", "OUT", "PI", "POS", "RIGHT", "RND", "ROUND", "SGN",
- "SIN", "SPACE", "SQR", "STR", "STRING", "TAN", "UNT", "UPPER",
- "VAL", "VPOS", "XPOS", "YPOS"
- )
- ),
- 'SYMBOLS' => array(
- '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff; font-weight: bold;',
- 2 => 'color: #008888; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080;',
- 2 => 'color: #808080;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0044ff;'
- ),
- 'METHODS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/lolcode.php b/libvpx/examples/includes/geshi/geshi/lolcode.php
deleted file mode 100644
index 19b42f5..0000000
--- a/libvpx/examples/includes/geshi/geshi/lolcode.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-/*************************************************************************************
- * lolcode.php
- * ----------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2009/10/31
- *
- * LOLcode language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/31 (1.0.8.1)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'LOLcode',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- 1 => "/\bBTW\b.*$/im",
- 2 => "/(^|\b)(?:OBTW\b.+?\bTLDR|LOL\b.+?\/LOL)(\b|$)/si"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- 1 => '/:[)>o":]/',
- 2 => '/:\([\da-f]+\)/i',
- 3 => '/:\{\w+\}/i',
- 4 => '/:\[\w+\]/i',
- ),
- 'KEYWORDS' => array(
- //Statements
- 1 => array(
- 'VISIBLE', 'HAI', 'KTHX', 'KTHXBYE', 'SMOOSH', 'GIMMEH', 'PLZ',
- 'ON', 'INVISIBLE', 'R', 'ITZ', 'GTFO', 'COMPLAIN', 'GIMME',
-
- 'OPEN', 'FILE', 'I HAS A', 'AWSUM THX', 'O NOES', 'CAN', 'HAS', 'HAZ',
- 'HOW DOES I', 'IF U SAY SO', 'FOUND YR', 'BORROW', 'OWN', 'ALONG',
- 'WITH', 'WIT', 'LOOK', 'AT', 'AWSUM', 'THX'
- ),
- //Conditionals
- 2 => array(
- 'IZ', 'YARLY', 'NOWAI', 'WTF?', 'MEBBE', 'OMG', 'OMGWTF',
- 'ORLY?', 'OF', 'NOPE', 'SO', 'IM', 'MAI',
-
- 'O RLY?', 'SUM', 'BOTH SAEM', 'DIFFRINT', 'BOTH', 'EITHER', 'WON',
- 'DIFF', 'PRODUKT', 'QUOSHUNT', 'MOD', 'MKAY', 'OK', 'THING',
- 'BIGNESS'
- ),
- //Repetition
- 3 => array(
- 'IN', 'OUTTA', 'LOOP', 'WHILE'
- ),
- //Operators \Math
- 4 => array(
- 'AN', 'AND', 'NOT', 'UP', 'YR', 'UPPIN', 'NERF', 'NERFIN', 'NERFZ',
- 'SMASHING', 'UR', 'KINDA', 'LIKE', 'SAEM', 'BIG', 'SMALL',
- 'BIGGR', 'SMALLR', 'BIGGER', 'SMALLER', 'GOOD', 'CUTE', 'THAN'
- )
- ),
- 'SYMBOLS' => array(
- '.', ',', '?',
- '!!'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #008000;',
- 2 => 'color: #000080;',
- 3 => 'color: #000080;',
- 4 => 'color: #800000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; style: italic;',
- 2 => 'color: #666666; style: italic;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'SPACE_AS_WHITESPACE' => true
- )
- ),
- 'TAB_WIDTH' => 4
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/lotusformulas.php b/libvpx/examples/includes/geshi/geshi/lotusformulas.php
deleted file mode 100644
index 010fb22..0000000
--- a/libvpx/examples/includes/geshi/geshi/lotusformulas.php
+++ /dev/null
@@ -1,318 +0,0 @@
-<?php
-/*************************************************************************************
- * lotusformulas.php
- * ------------------------
- * Author: Richard Civil (info@richardcivil.net)
- * Copyright: (c) 2008 Richard Civil (info@richardcivil.net), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2008/04/12
- *
- * @Formula/@Command language file for GeSHi.
- *
- * @Formula/@Command source: IBM Lotus Notes/Domino 8 Designer Help
- *
- * CHANGES
- * -------
- * 2008/04/12 (1.0.7.22)
- * - First Release
- *
- * TODO (updated 2008/04/12)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Lotus Notes @Formulas',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array('REM' => ';'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array (
- '[ZoomPreview]', '[WorkspaceStackReplicaIcons]',
- '[WorkspaceProperties]', '[WindowWorkspace]',
- '[WindowTile]', '[WindowRestore]', '[WindowNext]',
- '[WindowMinimizeAll]', '[WindowMinimize]', '[WindowMaximizeAll]',
- '[WindowMaximize]', '[WindowCascade]', '[ViewSwitchForm]',
- '[ViewShowUnread]', '[ViewShowServerNames]', '[ViewShowSearchBar]',
- '[ViewShowRuler]', '[ViewShowPageBreaks]', '[ViewShowOnlyUnread]',
- '[ViewShowOnlySelected]', '[ViewShowOnlySearchResults]',
- '[ViewShowOnlyCategories]', '[ViewShowObject]',
- '[ViewShowFieldHelp]', '[ViewRenamePerson]', '[ViewRefreshUnread]',
- '[ViewRefreshFields]', '[ViewNavigatorsNone]',
- '[ViewNavigatorsFolders]', '[ViewMoveName]', '[ViewHorizScrollbar]',
- '[ViewExpandWithChildren]', '[ViewExpandAll]', '[ViewExpand]',
- '[ViewCollapseAll]', '[ViewCollapse]', '[ViewChange]',
- '[ViewCertify]', '[ViewBesideFolders]', '[ViewBelowFolders]',
- '[ViewArrangeIcons]', '[V3EditPrevField]', '[V3EditNextField]',
- '[UserIDSwitch]', '[UserIDSetPassword]', '[UserIDMergeCopy]',
- '[UserIDInfo]', '[UserIDEncryptionKeys]', '[UserIDCreateSafeCopy]',
- '[UserIDClearPassword]', '[UserIDCertificates]',
- '[ToolsUserLogoff]', '[ToolsSpellCheck]', '[ToolsSmartIcons]',
- '[ToolsSetupUserSetup]', '[ToolsSetupPorts]', '[ToolsSetupMail]',
- '[ToolsSetupLocation]', '[ToolsScanUnreadSelected]',
- '[ToolsScanUnreadPreferred]', '[ToolsScanUnreadChoose]',
- '[ToolsRunMacro]', '[ToolsRunBackgroundMacros]', '[ToolsReplicate]',
- '[ToolsRefreshSelectedDocs]', '[ToolsRefreshAllDocs]',
- '[ToolsMarkSelectedUnread]', '[ToolsMarkSelectedRead]',
- '[ToolsMarkAllUnread]', '[ToolsMarkAllRead]', '[ToolsHangUp]',
- '[ToolsCategorize]', '[ToolsCall]', '[TextUnderline]',
- '[TextSpacingSingle]', '[TextSpacingOneAndaHalf]',
- '[TextSpacingDouble]', '[TextSetFontSize]', '[TextSetFontFace]',
- '[TextSetFontColor]', '[TextReduceFont]', '[TextPermanentPen]',
- '[TextParagraphStyles]', '[TextParagraph]', '[TextOutdent]',
- '[TextNumbers]', '[TextNormal]', '[TextItalic]', '[TextFont]',
- '[TextEnlargeFont]', '[TextCycleSpacing]', '[TextBullet]',
- '[TextBold]', '[TextAlignRight]', '[TextAlignNone]',
- '[TextAlignLeft]', '[TextAlignFull]', '[TextAlignCenter]',
- '[SwitchView]', '[SwitchForm]', '[StyleCycleKey]',
- '[SmartIconsNextSet]', '[SmartIconsFloating]', '[ShowProperties]',
- '[ShowHidePreviewPane]', '[ShowHideParentPreview]',
- '[ShowHideLinkPreview]', '[ShowHideIMContactList]',
- '[SetCurrentLocation]', '[SendInstantMessage]',
- '[SectionRemoveHeader]', '[SectionProperties]',
- '[SectionExpandAll]', '[SectionExpand]', '[SectionDefineEditors]',
- '[SectionCollapseAll]', '[SectionCollapse]', '[RunScheduledAgents]',
- '[RunAgent]', '[ReplicatorStop]', '[ReplicatorStart]',
- '[ReplicatorSendReceiveMail]', '[ReplicatorSendMail]',
- '[ReplicatorReplicateWithServer]', '[ReplicatorReplicateSelected]',
- '[ReplicatorReplicateNext]', '[ReplicatorReplicateHigh]',
- '[Replicator]', '[RenameDatabase]', '[RemoveFromFolder]',
- '[RemoteDebugLotusScript]', '[ReloadWindow]', '[RefreshWindow]',
- '[RefreshParentNote]', '[RefreshHideFormulas]', '[RefreshFrame]',
- '[PublishDatabase]', '[PictureProperties]', '[PasteBitmapAsObject]',
- '[PasteBitmapAsBackground]', '[OpenView]', '[OpenPage]',
- '[OpenNavigator]', '[OpenInNewWindow]', '[OpenHelpDocument]',
- '[OpenFrameset]', '[OpenDocument]', '[OpenCalendar]',
- '[ObjectProperties]', '[ObjectOpen]', '[ObjectDisplayAs]',
- '[NavPrevUnread]', '[NavPrevSelected]', '[NavPrevMain]',
- '[NavPrev]', '[NavNextUnread]', '[NavNextSelected]',
- '[NavNextMain]', '[NavNext]', '[NavigatorTest]',
- '[NavigatorProperties]', '[NavigateToBacklink]',
- '[NavigatePrevUnread]', '[NavigatePrevSelected]',
- '[NavigatePrevMain]', '[NavigatePrevHighlight]', '[NavigatePrev]',
- '[NavigateNextUnread]', '[NavigateNextSelected]',
- '[NavigateNextMain]', '[NavigateNextHighlight]', '[NavigateNext]',
- '[MoveToTrash]', '[MailSendPublicKey]', '[MailSendEncryptionKey]',
- '[MailSendCertificateRequest]', '[MailSend]', '[MailScanUnread]',
- '[MailRequestNewPublicKey]', '[MailRequestNewName]',
- '[MailRequestCrossCert]', '[MailOpen]', '[MailForwardAsAttachment]',
- '[MailForward]', '[MailComposeMemo]', '[MailAddress]',
- '[LayoutProperties]', '[LayoutElementSendToBack]',
- '[LayoutElementProperties]', '[LayoutElementBringToFront]',
- '[LayoutAddText]', '[LayoutAddGraphic]', '[InsertSubform]',
- '[HotspotProperties]', '[HotspotClear]', '[HelpUsingDatabase]',
- '[HelpAboutNotes]', '[HelpAboutDatabase]', '[GoUpLevel]',
- '[FormTestDocument]', '[FormActions]', '[FolderRename]',
- '[FolderProperties]', '[FolderMove]', '[FolderExpandWithChildren]',
- '[FolderExpandAll]', '[FolderExpand]', '[FolderDocuments]',
- '[FolderCustomize]', '[FolderCollapse]', '[Folder]',
- '[FindFreeTimeDialog]', '[FileSaveNewVersion]', '[FileSave]',
- '[FilePrintSetup]', '[FilePrint]', '[FilePageSetup]',
- '[FileOpenDBRepID]', '[FileOpenDatabase]', '[FileNewReplica]',
- '[FileNewDatabase]', '[FileImport]', '[FileFullTextUpdate]',
- '[FileFullTextInfo]', '[FileFullTextDelete]',
- '[FileFullTextCreate]', '[FileExport]', '[FileExit]',
- '[FileDatabaseUseServer]', '[FileDatabaseRemove]',
- '[FileDatabaseInfo]', '[FileDatabaseDelete]', '[FileDatabaseCopy]',
- '[FileDatabaseCompact]', '[FileDatabaseACL]', '[FileCloseWindow]',
- '[ExitNotes]', '[Execute]', '[ExchangeUnreadMarks]', '[EmptyTrash]',
- '[EditUp]', '[EditUntruncate]', '[EditUndo]', '[EditTop]',
- '[EditTableInsertRowColumn]', '[EditTableFormat]',
- '[EditTableDeleteRowColumn]', '[EditShowHideHiddenChars]',
- '[EditSelectByDate]', '[EditSelectAll]', '[EditRight]',
- '[EditRestoreDocument]', '[EditResizePicture]',
- '[EditQuoteSelection]', '[EditProfileDocument]', '[EditProfile]',
- '[EditPrevField]', '[EditPhoneNumbers]', '[EditPasteSpecial]',
- '[EditPaste]', '[EditOpenLink]', '[EditNextField]',
- '[EditMakeDocLink]', '[EditLocations]', '[EditLinks]', '[EditLeft]',
- '[EditInsertText]', '[EditInsertTable]', '[EditInsertPopup]',
- '[EditInsertPageBreak]', '[EditInsertObject]',
- '[EditInsertFileAttachment]', '[EditInsertButton]',
- '[EditIndentFirstLine]', '[EditIndent]', '[EditHorizScrollbar]',
- '[EditHeaderFooter]', '[EditGotoField]', '[EditFindNext]',
- '[EditFindInPreview]', '[EditFind]', '[EditEncryptionKeys]',
- '[EditDown]', '[EditDocument]', '[EditDetach]', '[EditDeselectAll]',
- '[EditCut]', '[EditCopy]', '[EditClear]', '[EditButton]',
- '[EditBottom]', '[DiscoverFolders]', '[Directories]',
- '[DialingRules]', '[DesignViewSelectFormula]', '[DesignViews]',
- '[DesignViewNewColumn]', '[DesignViewFormFormula]',
- '[DesignViewEditActions]', '[DesignViewColumnDef]',
- '[DesignViewAttributes]', '[DesignViewAppendColumn]',
- '[DesignSynopsis]', '[DesignSharedFields]', '[DesignReplace]',
- '[DesignRefresh]', '[DesignMacros]', '[DesignIcon]',
- '[DesignHelpUsingDocument]', '[DesignHelpAboutDocument]',
- '[DesignFormWindowTitle]', '[DesignFormUseField]',
- '[DesignFormShareField]', '[DesignForms]', '[DesignFormNewField]',
- '[DesignFormFieldDef]', '[DesignFormAttributes]',
- '[DesignDocumentInfo]', '[DebugLotusScript]',
- '[DatabaseReplSettings]', '[DatabaseDelete]', '[CreateView]',
- '[CreateTextbox]', '[CreateSubForm]', '[CreateSection]',
- '[CreateRectangularHotspot]', '[CreateRectangle]',
- '[CreatePolyline]', '[CreatePolygon]', '[CreateNavigator]',
- '[CreateLayoutRegion]', '[CreateForm]', '[CreateFolder]',
- '[CreateEllipse]', '[CreateControlledAccessSection]',
- '[CreateAgent]', '[CreateAction]', '[CopySelectedAsTable]',
- '[ComposeWithReference]', '[Compose]', '[CloseWindow]', '[Clear]',
- '[ChooseFolders]', '[CalendarGoTo]', '[CalendarFormat]',
- '[AttachmentView]', '[AttachmentProperties]', '[AttachmentLaunch]',
- '[AttachmentDetachAll]', '[AgentTestRun]', '[AgentSetServerName]',
- '[AgentRun]', '[AgentLog]', '[AgentEnableDisable]', '[AgentEdit]',
- '[AdminTraceConnection]', '[AdminStatisticsConfig]',
- '[AdminSendMailTrace]', '[AdminRemoteConsole]',
- '[AdminRegisterUser]', '[AdminRegisterServer]',
- '[AdminRegisterFromFile]', '[AdminOutgoingMail]',
- '[AdminOpenUsersView]', '[AdminOpenStatistics]',
- '[AdminOpenServersView]', '[AdminOpenServerLog]',
- '[AdminOpenGroupsView]', '[AdminOpenCertLog]', '[AdminOpenCatalog]',
- '[AdminOpenAddressBook]', '[AdminNewOrgUnit]',
- '[AdminNewOrganization]', '[Administration]',
- '[AdminIDFileSetPassword]', '[AdminIDFileExamine]',
- '[AdminIDFileClearPassword]', '[AdminDatabaseQuotas]',
- '[AdminDatabaseAnalysis]', '[AdminCrossCertifyKey]',
- '[AdminCrossCertifyIDFile]', '[AdminCreateGroup]', '[AdminCertify]',
- '[AddToIMContactList]', '[AddDatabaseRepID]', '[AddDatabase]',
- '[AddBookmark]'
- ),
- 2 => array(
- 'SELECT', 'FIELD', 'ENVIRONMENT', 'DEFAULT', '@Zone ', '@Yesterday',
- '@Yes', '@Year', '@Word', '@Wide', '@While', '@Weekday',
- '@WebDbName', '@ViewTitle', '@ViewShowThisUnread', '@Version',
- '@VerifyPassword', '@ValidateInternetAddress', '@V4UserAccess',
- '@V3UserName', '@V2If', '@UserRoles', '@UserPrivileges',
- '@UserNamesList', '@UserNameLanguage', '@UserName', '@UserAccess',
- '@UrlQueryString', '@URLOpen', '@URLHistory', '@URLGetHeader',
- '@URLEncode', '@URLDecode', '@UpperCase', '@UpdateFormulaContext',
- '@Unique', '@UndeleteDocument', '@Unavailable', '@True', '@Trim',
- '@Transform', '@ToTime', '@ToNumber', '@Tomorrow', '@Today',
- '@TimeZoneToText', '@TimeToTextInZone', '@TimeMerge', '@Time',
- '@ThisValue', '@ThisName', '@TextToTime', '@TextToNumber', '@Text',
- '@TemplateVersion', '@Tan', '@Sum', '@Success', '@Subset',
- '@StatusBar', '@Sqrt', '@Soundex', '@Sort', '@Sin', '@Sign',
- '@SetViewInfo', '@SetTargetFrame', '@SetProfileField',
- '@SetHTTPHeader', '@SetField', '@SetEnvironment', '@SetDocField',
- '@Set', '@ServerName', '@ServerAccess', '@Select', '@Second',
- '@Round', '@RightBack', '@Right', '@Return', '@Responses',
- '@ReplicaID', '@ReplaceSubstring', '@Replace', '@Repeat',
- '@RegQueryValue', '@RefreshECL', '@Random', '@ProperCase',
- '@Prompt', '@Power', '@PostedCommand', '@PolicyIsFieldLocked',
- '@Platform', '@PickList', '@Pi', '@PasswordQuality', '@Password',
- '@OrgDir', '@OptimizeMailAddress', '@OpenInNewWindow', '@Now',
- '@Nothing', '@NoteID', '@No', '@NewLine', '@Narrow', '@NameLookup',
- '@Name', '@Month', '@Modulo', '@Modified', '@Minute', '@Min',
- '@MiddleBack', '@Middle', '@Member', '@Max', '@Matches',
- '@MailSignPreference', '@MailSend', '@MailSavePreference',
- '@MailEncryptSentPreference', '@MailEncryptSavedPreference',
- '@MailDbName', '@LowerCase', '@Log', '@Locale', '@Ln', '@Like',
- '@Length', '@LeftBack', '@Left', '@LDAPServer', '@LaunchApp',
- '@LanguagePreference', '@Keywords', '@IsVirtualizedDirectory',
- '@IsValid', '@IsUsingJavaElement', '@IsUnavailable', '@IsTime',
- '@IsText', '@IsResponseDoc', '@IsNumber', '@IsNull', '@IsNotMember',
- '@IsNewDoc', '@IsModalHelp', '@IsMember', '@IsExpandable',
- '@IsError', '@IsEmbeddedInsideWCT', '@IsDocTruncated',
- '@IsDocBeingSaved', '@IsDocBeingRecalculated', '@IsDocBeingMailed',
- '@IsDocBeingLoaded', '@IsDocBeingEdited', '@IsDB2', '@IsCategory',
- '@IsAvailable', '@IsAppInstalled', '@IsAgentEnabled', '@Integer',
- '@InheritedDocumentUniqueID', '@Implode', '@IfError', '@If',
- '@Hour', '@HashPassword', '@HardDeleteDocument', '@GetViewInfo',
- '@GetProfileField', '@GetPortsList', '@GetIMContactListGroupNames',
- '@GetHTTPHeader', '@GetFocusTable', '@GetField', '@GetDocField',
- '@GetCurrentTimeZone', '@GetAddressBooks', '@FormLanguage', '@For',
- '@FontList', '@FloatEq', '@FileDir', '@False', '@Failure',
- '@Explode', '@Exp', '@Eval', '@Error', '@Environment', '@Ends',
- '@EnableAlarms', '@Elements', '@EditUserECL', '@EditECL',
- '@DoWhile', '@Domain', '@DocumentUniqueID', '@DocSiblings',
- '@DocParentNumber', '@DocOmmittedLength', '@DocNumber', '@DocMark',
- '@DocLock', '@DocLevel', '@DocLength', '@DocFields',
- '@DocDescendants', '@DocChildren', '@Do', '@DialogBox',
- '@DeleteField', '@DeleteDocument', '@DDETerminate', '@DDEPoke',
- '@DDEInitiate', '@DDEExecute', '@DbTitle', '@DbName', '@DbManager',
- '@DbLookup', '@DbExists', '@DbCommand', '@DbColumn', '@DB2Schema',
- '@Day', '@Date', '@Created', '@Count', '@Cos', '@Contains',
- '@ConfigFile', '@Compare', '@Command', '@ClientType',
- '@CheckFormulaSyntax', '@CheckAlarms', '@Char', '@Certificate',
- '@BusinessDays', '@BrowserInfo', '@Begins', '@Author',
- '@Attachments', '@AttachmentNames', '@AttachmentModifiedTimes',
- '@AttachmentLengths', '@ATan2', '@ATan', '@ASin', '@Ascii',
- '@AllDescendants', '@AllChildren', '@All', '@AdminECLIsLocked',
- '@Adjust', '@AddToFolder', '@ACos', '@Accessed', '@AbstractSimple',
- '@Abstract', '@Abs'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #800000;',
- 2 => 'color: #0000FF;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #FF00FF;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF00FF;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000AA;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 2
- );
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/lotusscript.php b/libvpx/examples/includes/geshi/geshi/lotusscript.php
deleted file mode 100644
index 598da3b..0000000
--- a/libvpx/examples/includes/geshi/geshi/lotusscript.php
+++ /dev/null
@@ -1,191 +0,0 @@
-<?php
-/**
- * lotusscript.php
- * ------------------------
- * Author: Richard Civil (info@richardcivil.net)
- * Copyright: (c) 2008 Richard Civil (info@richardcivil.net), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2008/04/12
- *
- * LotusScript language file for GeSHi.
- *
- * LotusScript source: IBM Lotus Notes/Domino 8 Designer Help
- *
- * CHANGES
- * -------
- * 2008/04/12 (1.0.7.22)
- * - First Release
- *
- * TODO (2008/04/12)
- * -----------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'LotusScript',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array('%REM' => '%END REM'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"' , "|"),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array (
- 'Yield', 'Year', 'Xor', 'Write', 'With', 'Width', 'While', 'Wend',
- 'Weekday', 'VarType', 'Variant', 'Val', 'UString', 'UString$',
- 'UseLSX', 'Use', 'Until', 'Unlock', 'Unicode', 'Uni', 'UChr',
- 'UChr$', 'UCase', 'UCase$', 'UBound', 'TypeName', 'Type', 'TRUE',
- 'Trim', 'Trim$', 'Today', 'To', 'TimeValue', 'TimeSerial', 'Timer',
- 'TimeNumber', 'Time', 'Time$', 'Then', 'Text', 'Tan', 'Tab', 'Sub',
- 'StrToken', 'StrToken$', 'StrRightBack', 'StrRightBack$',
- 'StrRight', 'StrRight$', 'StrLeftBack', 'StrLeftBack$', 'StrLeft',
- 'StrLeft$', 'String', 'String$', 'StrConv', 'StrCompare', 'StrComp',
- 'Str', 'Str$', 'Stop', 'Step', 'Static', 'Sqr', 'Split', 'Spc',
- 'Space', 'Space$', 'Sleep', 'Single', 'Sin', 'Shell', 'Shared',
- 'Sgn', 'SetFileAttr', 'SetAttr', 'Set', 'SendKeys', 'Select',
- 'Seek', 'Second', 'RTrim', 'RTrim$', 'RSet', 'Round', 'Rnd',
- 'RmDir', 'RightC', 'RightC$', 'RightBP', 'RightBP$', 'RightB',
- 'RightB$', 'Right', 'Right$', 'Return', 'Resume', 'Reset',
- 'Replace', 'Remove', 'Rem', 'ReDim', 'Read', 'Randomize',
- 'Random', 'Put', 'Public', 'Property', 'Private', 'Print',
- 'Preserve', 'Pitch', 'PI', 'Output', 'Or', 'Option', 'Open', 'On',
- 'Oct', 'Oct$', 'NULL', 'Now', 'NOTHING', 'Not', 'NoPitch', 'NoCase',
- 'Next', 'New', 'Name', 'MsgBox', 'Month', 'Mod', 'MkDir', 'Minute',
- 'MidC', 'MidC$', 'MidBP', 'MidBP$', 'MidB', 'MidB$', 'Mid', 'Mid$',
- 'MessageBox', 'Me', 'LTrim', 'LTrim$', 'LSServer', 'LSI_Info',
- 'LSet', 'Loop', 'Long', 'Log', 'LOF', 'Lock', 'LOC', 'LMBCS',
- 'ListTag', 'List', 'Line', 'Like', 'Lib', 'Let', 'LenC', 'LenBP',
- 'LenB', 'Len', 'LeftC', 'LeftC$', 'LeftBP', 'LeftBP$', 'LeftB',
- 'LeftB$', 'Left', 'Left$', 'LCase', 'LCase$', 'LBound', 'Kill',
- 'Join', 'IsUnknown', 'IsScalar', 'IsObject', 'IsNumeric', 'IsNull',
- 'IsList', 'IsEmpty', 'IsElement', 'IsDate', 'IsArray', 'IsA', 'Is',
- 'Integer', 'Int', 'InStrC', 'InStrBP', 'InStrB', 'InStr', 'InputBP',
- 'InputBP$', 'InputBox', 'InputBox$', 'InputB', 'InputB$', 'Input',
- 'Input$', 'In', 'IMSetMode', 'Implode', 'Implode$', 'Imp',
- 'IMEStatus', 'If', 'Hour', 'Hex', 'Hex$', 'Goto', 'GoSub',
- 'GetThreadInfo', 'GetFileAttr', 'GetAttr', 'Get', 'Function',
- 'FullTrim', 'From', 'FreeFile', 'Fraction', 'Format', 'Format$',
- 'ForAll', 'For', 'Fix', 'FileLen', 'FileDateTime', 'FileCopy',
- 'FileAttr', 'FALSE', 'Explicit', 'Exp', 'Exit', 'Execute', 'Event',
- 'Evaluate', 'Error', 'Error$', 'Err', 'Erl', 'Erase', 'Eqv', 'EOF',
- 'Environ', 'Environ$', 'End', 'ElseIf', 'Else', 'Double', 'DoEvents',
- 'Do', 'Dir', 'Dir$', 'Dim', 'DestroyLock', 'Delete', 'DefVar',
- 'DefStr', 'DefSng', 'DefLng', 'DefInt', 'DefDbl', 'DefCur',
- 'DefByte', 'DefBool', 'Declare', 'Day', 'DateValue', 'DateSerial',
- 'DateNumber', 'Date', 'Date$', 'DataType', 'CVDate', 'CVar',
- 'Currency', 'CurDrive', 'CurDrive$', 'CurDir', 'CurDir$', 'CStr',
- 'CSng', 'CreateLock', 'Cos', 'Const', 'Compare', 'Command',
- 'Command$', 'CodeUnlock', 'CodeLockCheck', 'CodeLock', 'Close',
- 'CLng', 'Class', 'CInt', 'Chr', 'Chr$', 'ChDrive', 'ChDir', 'CDbl',
- 'CDat', 'CCur', 'CByte', 'CBool', 'Case', 'Call', 'ByVal', 'Byte',
- 'Boolean', 'Bind', 'Binary', 'Bin', 'Bin$', 'Beep', 'Base', 'Atn2',
- 'Atn', 'ASin', 'Asc', 'As', 'ArrayUnique', 'ArrayReplace',
- 'ArrayGetIndex', 'ArrayAppend', 'Append', 'AppActivate', 'Any',
- 'And', 'Alias', 'ActivateApp', 'ACos', 'Access', 'Abs', '%Include',
- '%If', '%END', '%ElseIf', '%Else'
- ),
- 2 => array (
- 'NotesXSLTransformer', 'NotesXMLProcessor', 'NotesViewNavigator',
- 'NotesViewEntryCollection', 'NotesViewEntry', 'NotesViewColumn',
- 'NotesView', 'NotesUIWorkspace', 'NotesUIView', 'NotesUIScheduler',
- 'NotesUIDocument', 'NotesUIDatabase', 'NotesTimer', 'NotesStream',
- 'NotesSession', 'NotesSAXParser', 'NotesSAXException',
- 'NotesSAXAttributeList', 'NotesRichTextTable', 'NotesRichTextTab',
- 'NotesRichTextStyle', 'NotesRichTextSection', 'NotesRichTextRange',
- 'NotesRichTextParagraphStyle', 'NotesRichTextNavigator',
- 'NotesRichTextItem', 'NotesRichTextDocLink',
- 'NotesReplicationEntry', 'NotesReplication', 'NotesRegistration',
- 'NotesOutlineEntry', 'NotesOutline', 'NotesNoteCollection',
- 'NotesNewsLetter', 'NotesName', 'NotesMIMEHeader',
- 'NotesMIMEEntity', 'NotesLog', 'NotesItem', 'NotesInternational',
- 'NotesForm', 'NotesEmbeddedObject', 'NotesDXLImporter',
- 'NotesDXLExporter', 'NotesDOMXMLDeclNode', 'NotesDOMTextNode',
- 'NotesDOMProcessingInstructionNode', 'NotesDOMParser',
- 'NotesDOMNotationNode', 'NotesDOMNodeList', 'NotesDOMNode',
- 'NotesDOMNamedNodeMap', 'NotesDOMEntityReferenceNode',
- 'NotesDOMEntityNode', 'NotesDOMElementNode',
- 'NotesDOMDocumentTypeNode', 'NotesDOMDocumentNode',
- 'NotesDOMDocumentFragmentNode', 'NotesDOMCommentNode',
- 'NotesDOMCharacterDataNote', 'NotesDOMCDATASectionNode',
- 'NotesDOMAttributeNode', 'NotesDocumentCollection', 'NotesDocument',
- 'NotesDbDirectory', 'NotesDateTime', 'NotesDateRange',
- 'NotesDatabase', 'NotesColorObject', 'NotesAgent',
- 'NotesAdministrationProcess', 'NotesACLEntry', 'NotesACL',
- 'Navigator', 'Field', 'Button'
- )
- ) ,
- 'SYMBOLS' => array(
- '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF;',
- 2 => 'color: #0000EE;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #000000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF00FF;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000AA;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #006600;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 2
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/lscript.php b/libvpx/examples/includes/geshi/geshi/lscript.php
deleted file mode 100644
index 57bb2ba..0000000
--- a/libvpx/examples/includes/geshi/geshi/lscript.php
+++ /dev/null
@@ -1,387 +0,0 @@
-<?php
-/*************************************************************************************
- * lscript.php
- * ---------
- * Author: Arendedwinter (admin@arendedwinter.com)
- * Copyright: (c) 2008 Beau McGuigan (http://www.arendedwinter.com)
- * Release Version: 1.0.8.3
- * Date Started: 15/11/2008
- *
- * Lightwave Script language file for GeSHi.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'LScript',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- //Yes, I'm aware these are out of order,
- //I had to rearrange and couldn't be bothered changing the numbers...
- 7 => array(
- '@data', '@define', '@else', '@end', '@fpdepth', '@if', '@include',
- '@insert', '@library', '@localipc', '@name', '@save', '@script',
- '@sequence', '@version', '@warnings'
- ),
- 1 => array(
- 'break', 'case', 'continue', 'else', 'end', 'false', 'for',
- 'foreach', 'if', 'return', 'switch', 'true', 'while',
- ),
- 3 => array(
- 'active', 'alertlevel', 'alpha', 'alphaprefix', 'animfilename', 'autokeycreate',
- 'backdroptype', 'blue', 'boxthreshold', 'button',
- 'channelsvisible', 'childrenvisible', 'compfg', 'compbg', 'compfgalpha',
- 'coneangles', 'cosine', 'count', 'ctl', 'curFilename', 'curFrame',
- 'currenttime', 'curTime', 'curType',
- 'depth', 'diffshade', 'diffuse', 'dimensions', 'displayopts', 'dynamicupdate',
- 'end', 'eta',
- 'filename', 'flags', 'fogtype', 'fps', 'frame', 'frameend', 'frameheight',
- 'framestart', 'framestep', 'framewidth',
- 'generalopts', 'genus', 'geometry', 'gNorm', 'goal', 'green',
- 'h', 'hasAlpha', 'height',
- 'id', 'innerlimit', 'isColor',
- 'keyCount', 'keys',
- 'limiteregion', 'locked', 'luminous',
- 'maxsamplesperpixel', 'minsamplesperpixel', 'mirror', 'motionx', 'motiony',
- 'name', 'newFilename', 'newFrame', 'newTime', 'newType', 'null', 'numthreads',
- 'objID', 'oPos', 'outerlimit', 'oXfrm',
- 'parent', 'pixel', 'pixelaspect', 'point', 'points', 'pointcount', 'polNum',
- 'polycount', 'polygon', 'polygons', 'postBehavior', 'preBehavior', 'previewend',
- 'previewstart', 'previewstep',
- 'range', 'rawblue', 'rawgreen', 'rawred', 'rayLength', 'raySource', 'red',
- 'reflectblue', 'reflectgreen', 'reflectred', 'recursiondepth', 'renderend',
- 'renderopts', 'renderstart', 'renderstep', 'rendertype', 'restlength',
- 'rgbprefix', 'roughness',
- 'selected', 'setColor', 'setPattern', 'shading', 'shadow', 'shadows',
- 'shadowtype', 'size', 'source', 'special', 'specshade', 'specular',
- 'spotsize', 'start', 'sx', 'sy', 'sz',
- 'target', 'totallayers', 'totalpoints', 'totalpolygons', 'trans', 'transparency',
- 'type',
- 'value', 'view', 'visible', 'visibility',
- 'w', 'width', 'wNorm', 'wPos', 'wXfrm',
- 'x', 'xoffset',
- 'y', 'yoffset',
- 'z'
- ),
- 4 => array(
- 'addLayer', 'addParticle', 'alphaspot', 'ambient', 'asAsc', 'asBin',
- 'asInt', 'asNum', 'asStr', 'asVec', 'attach', 'axislocks',
- 'backdropColor', 'backdropRay', 'backdropSqueeze', 'bone', 'blurLength',
- 'close', 'color', 'contains', 'copy', 'createKey',
- 'deleteKey', 'detach', 'drawCircle', 'drawLine', 'drawPoint', 'drawText',
- 'drawTriangle',
- 'edit', 'eof', 'event',
- 'firstChannel', 'firstLayer', 'firstSelect', 'focalLength', 'fogColor',
- 'fogMaxAmount', 'fogMaxDist', 'fogMinAmount', 'fogMinDist',
- 'fovAngles', 'fStop', 'firstChild', 'focalDistance',
- 'get', 'getChannelGroup', 'getEnvelope', 'getForward', 'getKeyBias',
- 'getKeyContinuity', 'getKeyCurve', 'getKeyHermite', 'getKeyTension',
- 'getKeyTime', 'getKeyValue', 'getParticle', 'getPivot', 'getPosition',
- 'getRight', 'getRotation', 'getSelect', 'getScaling', 'getTag', 'getTexture',
- 'getUp', 'getValue', 'getWorldPosition', 'getWorldForward', 'getWorldRight',
- 'getWorldRotation', 'getWorldUp', 'globalBlur', 'globalMask', 'globalResolution',
- 'hasCCEnd', 'hasCCStart',
- 'illuminate', 'indexOf', 'isAscii', 'isAlnum', 'isAlpha', 'isBone',
- 'isCamera', 'isChannel', 'isChannelGroup', 'isCntrl', 'isCurve', 'isDigit',
- 'isEnvelope', 'isImage', 'isInt', 'isLight', 'isLower', 'isMapped', 'isMesh',
- 'isNil', 'isNum', 'IsOpen', 'isOriginal', 'isPrint', 'isPunct', 'isScene',
- 'isSpace', 'isStr', 'isUpper', 'isValid', 'isVMap', 'isVec', 'isXDigit',
- 'keyExists',
- 'layer', 'layerName', 'layerVisible', 'limits', 'line', 'linecount', 'load', 'luma',
- 'next', 'nextLayer', 'nextSelect', 'nextChannel', 'nextChild', 'nl',
- 'offset', 'open',
- 'pack', 'param', 'parse', 'paste', 'persist', 'polygonCount', 'position',
- 'rayCast', 'rayTrace', 'read', 'readByte', 'readInt', 'readNumber',
- 'readDouble', 'readShort', 'readString', 'readVector', 'reduce',
- 'remParticle', 'renderCamera', 'reopen', 'replace', 'reset', 'restParam',
- 'rewind', 'rgb', 'rgbambient', 'rgbcolor', 'rgbspot',
- 'save', 'schemaPosition', 'select', 'set', 'setChannelGroup', 'setKeyBias',
- 'setKeyContinuity', 'setKeyCurve',
- 'setKeyHermite', 'setKeyTension', 'setKeyValue', 'setParticle', 'setPoints',
- 'setTag', 'setValue', 'server', 'serverFlags', 'sortA', 'sortD', 'surface',
- 'trunc',
- 'write', 'writeln', 'writeByte', 'writeData', 'writeNumber', 'writeDouble',
- 'writeShort', 'writeString', 'writeVector',
- 'vertex', 'vertexCount',
- 'zoomFactor'
- ),
- 2 => array(
- 'abs', 'acos', 'angle', 'append', 'ascii', 'asin', 'atan',
- 'binary',
- 'ceil', 'center', 'chdir', 'clearimage', 'cloned', 'comringattach',
- 'comringdecode', 'comringdetach', 'comringencode', 'comringmsg', 'cos',
- 'cosh', 'cot', 'cross2d', 'cross3d', 'csc', 'ctlstring', 'ctlinteger',
- 'ctlnumber', 'ctlvector', 'ctldistance', 'ctlchoice', 'ctltext',
- 'ctlcolor', 'ctlsurface', 'ctlfont', 'ctlpopup', 'ctledit', 'ctlpercent',
- 'ctlangle', 'ctlrgb', 'ctlhsv', 'ctlcheckbox', 'ctlstate', 'ctlfilename',
- 'ctlbutton', 'ctllistbox', 'ctlslider', 'ctlminislider', 'ctlsep', 'ctlimage',
- 'ctltab', 'ctlallitems', 'ctlmeshitems', 'ctlcameraitems', 'ctllightitems',
- 'ctlboneitems', 'ctlimageitems', 'ctlchannel', 'ctlviewport', 'Control_Management',
- 'ctlpage', 'ctlgroup', 'ctlposition', 'ctlactive', 'ctlvisible', 'ctlalign',
- 'ctlrefresh', 'ctlmenu', 'ctlinfo',
- 'date', 'debug', 'deg', 'dot2d', 'dot3d', 'drawborder', 'drawbox', 'drawcircle',
- 'drawelipse', 'drawerase', 'drawfillcircle', 'drawfillelipse', 'drawline',
- 'drawpixel', 'drawtext', 'drawtextwidth', 'drawtextheight', 'dump',
- 'error', 'exp', 'expose', 'extent',
- 'fac', 'filecrc', 'filedelete', 'fileexists', 'filefind', 'filerename',
- 'filestat', 'floor', 'format', 'frac', 'fullpath',
- 'gamma', 'getdir', 'getenv', 'getfile', 'getfirstitem', 'getsep', 'getvalue',
- 'globalrecall', 'globalstore',
- 'hash', 'hex', 'hostBuild', 'hostVersion', 'hypot',
- 'info', 'integer',
- 'library', 'licenseId', 'lscriptVersion', 'load', 'loadimage', 'log', 'log10',
- 'matchdirs', 'matchfiles', 'max', 'min', 'mkdir', 'mod', 'monend', 'moninit', 'monstep',
- 'nil', 'normalize', 'number',
- 'octal', 'overlayglyph',
- 'parse', 'platform', 'pow',
- 'rad', 'random', 'randu', 'range', 'read', 'readdouble', 'readInt', 'readNumber',
- 'readShort', 'recall', 'regexp', 'reqabort', 'reqbegin', 'reqend', 'reqisopen',
- 'reqkeyboard', 'reqopen', 'reqposition', 'reqpost', 'reqredraw',
- 'reqsize', 'reqresize', 'requpdate', 'rmdir', 'round', 'runningUnder',
- 'save', 'sec', 'select', 'selector', 'setdesc', 'setvalue', 'sin', 'sinh', 'size',
- 'sizeof', 'sleep', 'spawn', 'split', 'sqrt', 'step', 'store', 'string', 'strleft',
- 'strlower', 'strright', 'strsub', 'strupper',
- 'tan', 'tanh', 'targetobject', 'terminate', 'text', 'time',
- 'wait', 'warn', 'when', 'write', 'writeDouble', 'writeInt', 'writeNumber', 'writeShort',
- 'var', 'vector', 'visitnodes', 'vmag',
- ),
- 5 => array(
- 'addcurve', 'addpoint', 'addpolygon', 'addquad', 'addtriangle', 'alignpols',
- 'autoflex', 'axisdrill',
- 'bend', 'bevel', 'boolean', 'boundingbox',
- 'changepart', 'changesurface', 'close', 'closeall', 'cmdseq', 'copy', 'copysurface',
- 'createsurface', 'cut',
- 'deformregion', 'delete',
- 'editbegin', 'editend', 'exit', 'extrude',
- 'fixedflex', 'flip', 'fontclear', 'fontcount', 'fontindex', 'fontload',
- 'fontname', 'fracsubdivide', 'freezecurves',
- 'getdefaultsurface',
- 'jitter',
- 'lathe', 'layerName', 'layerVisible', 'lyrbg', 'lyrdata', 'lyrempty', 'lyremptybg',
- 'lyremptyfg', 'lyrfg', 'lyrsetbg', 'lyrsetfg', 'lyrswap',
- 'magnet', 'make4patch', 'makeball', 'makebox', 'makecone', 'makedisc',
- 'maketesball', 'maketext', 'mergepoints', 'mergepols', 'meshedit', 'mirror',
- 'morphpols', 'move',
- 'new', 'nextsurface',
- 'paste', 'pathclone', 'pathextrude', 'pixel', 'pointcount', 'pointinfo',
- 'pointmove', 'pole', 'polycount', 'polyinfo', 'polynormal', 'polypointcount',
- 'polypoints', 'polysurface',
- 'quantize',
- 'railclone', 'railextrude', 'redo', 'removepols', 'rempoint', 'rempoly',
- 'renamesurface', 'revert', 'rotate',
- 'scale', 'selhide', 'selinvert', 'selmode', 'selpoint', 'selpolygon', 'selunhide',
- 'selectvmap', 'setlayername', 'setobject', 'setpivot', 'setsurface', 'shapebevel',
- 'shear', 'skinpols', 'smooth', 'smoothcurves', 'smoothscale', 'smoothshift',
- 'soliddrill', 'splitpols', 'subdivide', 'swaphidden',
- 'taper', 'triple', 'toggleCCend', 'toggleCCstart', 'togglepatches', 'twist',
- 'undo', 'undogroupend', 'undogroupbegin', 'unifypols', 'unweld',
- 'vortex',
- 'weldaverage', 'weldpoints'
- ),
- 6 => array(
- 'About', 'AboutOpenGL', 'AdaptiveSampling', 'AdaptiveThreshold',
- 'AddAreaLight', 'AddBone', 'AddButton', 'AddCamera', 'AddChildBone',
- 'AddDistantLight', 'AddEnvelope', 'AddLinearLight', 'AddNull',
- 'AddPartigon', 'AddPlugins', 'AddPointLight', 'AddPosition',
- 'AddRotation', 'AddScale', 'AddSpotlight', 'AddToSelection',
- 'AdjustRegionTool', 'AffectCaustics', 'AffectDiffuse', 'AffectOpenGL',
- 'AffectSpecular', 'AlertLevel', 'AmbientColor', 'AmbientIntensity',
- 'Antialiasing', 'ApertureHeight', 'ApplyServer', 'AreaLight',
- 'AutoConfirm', 'AutoFrameAdvance', 'AutoKey',
- 'BackdropColor', 'BackView', 'BController', 'BLimits', 'BLurLength', 'BoneActive',
- 'BoneFalloffType', 'BoneJointComp', 'BoneJointCompAmounts', 'BoneJointCompParent',
- 'BoneLimitedRange', 'BoneMaxRange', 'BoneMinRange', 'BoneMuscleFlex',
- 'BoneMuscleFlexAmounts', 'BoneMuscleFlexParent', 'BoneNormalization',
- 'BoneRestLength', 'BoneRestPosition', 'BoneRestRotation', 'BoneSource',
- 'BoneStrength', 'BoneStrengthMultiply', 'BoneWeightMapName', 'BoneWeightMapOnly',
- 'BoneWeightShade', 'BoneXRay', 'BottomView', 'BoundingBoxThreshold',
- 'BStiffness',
- 'CacheCaustics', 'CacheRadiosity', 'CacheShadowMap',
- 'CameraMask', 'CameraView', 'CameraZoomTool', 'CastShadow', 'CausticIntensity',
- 'CenterItem', 'CenterMouse', 'ChangeTool', 'ClearAllBones', 'ClearAllCameras',
- 'ClearAllLights', 'ClearAllObjects', 'ClearAudio', 'ClearScene', 'ClearSelected',
- 'Clone', 'CommandHistory', 'CommandInput', 'Compositing', 'ConeAngleTool',
- 'ContentDirectory', 'CreateKey',
- 'DecreaseGrid', 'DeleteKey', 'DepthBufferAA', 'DepthOfField', 'DisplayOptions',
- 'DistantLight', 'DrawAntialiasing', 'DrawBones', 'DrawChildBones', 'DynamicUpdate',
- 'EditBones', 'EditCameras', 'EditKeys', 'EditLights',
- 'EditMenus', 'EditObjects', 'EditPlugins', 'EditServer', 'EnableCaustics',
- 'EnableDeformations', 'EnableIK', 'EnableLensFlares', 'EnableRadiosity', 'EnableServer',
- 'EnableShadowMaps', 'EnableVIPER', 'EnableVolumetricLights', 'EnableXH',
- 'EnableYP', 'EnableZB', 'EnahancedAA', 'ExcludeLight', 'ExcludeObject',
- 'EyeSeparation',
- 'FasterBones', 'FirstFrame', 'FirstItem', 'FitAll', 'FitSelected',
- 'FlareIntensity', 'FlareOptions', 'FocalDistance', 'FogColor', 'FogMaxAmount',
- 'FogMaxDistance', 'FogMinAmount', 'FogMinDistance', 'FogType', 'FractionalFrames',
- 'FrameSize', 'FramesPerSecond', 'FrameStep', 'FreePreview', 'FrontView', 'FullTimeIK',
- 'GeneralOptions', 'Generics', 'GlobalApertureHeight', 'GlobalBlurLength',
- 'GlobalFrameSize', 'GlobalIllumination', 'GlobalMaskPosition', 'GlobalMotionBlur',
- 'GlobalParticleBlur', 'GlobalPixelAspect', 'GlobalResolutionMulitplier', 'GoalItem',
- 'GoalStrength', 'GoToFrame', 'GradientBackdrop', 'GraphEditor', 'GridSize', 'GroundColor',
- 'HController', 'HideToolbar', 'HideWindows', 'HLimits', 'HStiffness',
- 'ImageEditor', 'ImageProcessing', 'IncludeLight', 'IncludeObject', 'IncreaseGrid',
- 'IndirectBounces', 'Item_SetWindowPos', 'ItemActive', 'ItemColor', 'ItemLock',
- 'ItemProperties', 'ItemVisibilty',
- 'KeepGoalWithinReach',
- 'LastFrame', 'LastItem', 'LastPluginInterface', 'Layout_SetWindowPos',
- 'Layout_SetWindowSize', 'LeftView', 'LensFlare', 'LensFStop', 'LightColor',
- 'LightConeAngle', 'LightEdgeAngle', 'LightFalloffType', 'LightIntensity',
- 'LightIntensityTool', 'LightQuality', 'LightRange', 'LightView', 'LimitB',
- 'LimitDynamicRange', 'LimitedRegion', 'LimitH', 'LimitP', 'LinearLight',
- 'LoadAudio', 'LoadFromScene', 'LoadMotion', 'LoadObject', 'LoadObjectLayer',
- 'LoadPreview', 'LoadScene', 'LocalCoordinateSystem',
- 'MakePreview', 'MaskColor', 'MaskPosition', 'MasterPlugins', 'MatchGoalOrientation',
- 'MatteColor', 'MatteObject', 'MetaballResolution', 'Model', 'MorphAmount',
- 'MorphAmountTool', 'MorphMTSE', 'MorphSurfaces', 'MorphTarget', 'MotionBlur',
- 'MotionBlurDOFPreview', 'MotionOptions', 'MovePathTool', 'MovePivotTool', 'MoveTool',
- 'NadirColor', 'NetRender', 'NextFrame', 'NextItem', 'NextKey', 'NextSibling',
- 'NextViewLayout', 'NoiseReduction', 'Numeric',
- 'ObjectDissolve',
- 'ParentCoordinateSystem', 'ParentInPlace', 'ParentItem',
- 'ParticleBlur', 'PathAlignLookAhead', 'PathAlignMaxLookSteps', 'PathAlignReliableDist',
- 'Pause', 'PController', 'PerspectiveView',
- 'PivotPosition', 'PivotRotation', 'PixelAspect', 'PlayAudio', 'PlayBackward',
- 'PlayForward', 'PlayPreview', 'PLimits', 'PointLight', 'PolygonEdgeColor',
- 'PolygonEdgeFlags', 'PolygonEdgeThickness', 'PolygonEdgeZScale', 'PolygonSize',
- 'Position', 'Presets', 'PreviewFirstFrame', 'PreviewFrameStep', 'PreviewLastFrame',
- 'PreviewOptions', 'PreviousFrame', 'PreviousItem', 'PreviousKey', 'PreviousSibling',
- 'PreviousViewLayout', 'PStiffness',
- 'Quit',
- 'RadiosityIntensity', 'RadiosityTolerance', 'RadiosityType', 'RayRecursionLimit',
- 'RayTraceReflection', 'RayTraceShadows',
- 'RayTraceTransparency', 'ReceiveShadow', 'RecentContentDirs', 'RecentScenes',
- 'ReconstructionFilter', 'RecordMaxAngles', 'RecordMinAngles', 'RecordPivotRotation',
- 'RecordRestPosition', 'Redraw', 'RedrawNow', 'Refresh', 'RefreshNow', 'RegionPosition',
- 'RemoveEnvelope', 'RemoveFromSelection', 'RemoveServer', 'Rename', 'RenderFrame',
- 'RenderOptions', 'RenderScene', 'RenderSelected', 'RenderThreads',
- 'ReplaceObjectLayer', 'ReplaceWithNull', 'ReplaceWithObject', 'Reset',
- 'ResolutionMultiplier', 'RestLengthTool', 'RightView', 'RotatePivotTool',
- 'RotateTool', 'Rotation',
- 'SaveAllObjects', 'SaveCommandList', 'SaveCommandMessages',
- 'SaveEndomorph', 'SaveLight', 'SaveLWSC1', 'SaveMotion', 'SaveObject', 'SaveObjectCopy',
- 'SavePreview', 'SaveScene', 'SaveSceneAs', 'SaveSceneCopy', 'SaveTransformed',
- 'SaveViewLayout', 'Scale', 'Scene_SetWindowPos', 'Scene_SetWindowSize',
- 'SceneEditor', 'SchematicPosition', 'SchematicView', 'SelectAllBones',
- 'SelectAllCameras', 'SelectAllLights', 'SelectAllObjects', 'SelectByName',
- 'SelectChild', 'SelectItem', 'SelectParent', 'SelfShadow', 'ShadowColor',
- 'ShadowExclusion', 'ShadowMapAngle', 'ShadowMapFitCone', 'ShadowMapFuzziness',
- 'ShadowMapSize', 'ShadowType', 'ShowCages', 'ShowFieldChart', 'ShowHandles',
- 'ShowIKChains', 'ShowMotionPaths', 'ShowSafeAreas', 'ShowTargetLines',
- 'ShrinkEdgesWithDistance', 'SingleView', 'SizeTool', 'SkelegonsToBones', 'SkyColor',
- 'Spotlight', 'SquashTool', 'Statistics', 'StatusMsg', 'Stereoscopic', 'StretchTool',
- 'SubdivisionOrder', 'SubPatchLevel', 'SurfaceEditor', 'Synchronize',
- 'TargetItem', 'TopView',
- 'UnaffectedByFog', 'UnaffectedByIK', 'Undo', 'UnseenByAlphaChannel', 'UnseenByCamera',
- 'UnseenByRays', 'UseGlobalResolution', 'UseGlobalBlur', 'UseGlobalMask',
- 'UseMorphedPositions',
- 'ViewLayout', 'VIPER', 'VolumetricLighting',
- 'VolumetricLightingOptions', 'VolumetricRadiosity', 'Volumetrics',
- 'WorldCoordinateSystem',
- 'XYView', 'XZView',
- 'ZenithColor', 'ZoomFactor', 'ZoomIn', 'ZoomInX2', 'ZoomOut', 'ZoomOutX2', 'ZYView',
- 'Camera', 'Channel', 'ChannelGroup', 'Envelope', 'File', 'Glyph', 'Icon', 'Image',
- 'Light', 'Mesh', 'Scene', 'Surface', 'VMap'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '<', '>', '+', '-', '*', '/', '!', '%', '&', '@'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => true,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #FF6820; font-weight: bold;', //LS_COMMANDS
- 3 => 'color: #007F7F; font-weight: bold;', //LS_MEMBERS
- 4 => 'color: #800080; font-weight: bold;', //LS_METHODS
- 5 => 'color: #51BD95; font-weight: bold;', //LS_MODELER
- 6 => 'color: #416F85; font-weight: bold;', //LS_GENERAL
- 7 => 'color: #C92929; font-weight: bold;' //LS_COMMANDS (cont)
- ),
- 'COMMENTS' => array(
- 1 => 'color: #7F7F7F;',
- 'MULTI' => 'color: #7F7F7F;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #0040A0;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #00C800;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #6953AC;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #0040A0;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'ESCAPE_CHAR' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 3 => array(
- 'DISALLOWED_BEFORE' => '(?<=\.)'
- ),
- 4 => array(
- 'DISALLOWED_BEFORE' => '(?<=\.)'
- )
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/lsl2.php b/libvpx/examples/includes/geshi/geshi/lsl2.php
deleted file mode 100644
index 27c5580..0000000
--- a/libvpx/examples/includes/geshi/geshi/lsl2.php
+++ /dev/null
@@ -1,898 +0,0 @@
-<?php
-/*************************************************************************************
- * lsl2.php
- * --------
- * Author: William Fry (william.fry@nyu.edu)
- * Copyright: (c) 2009 William Fry
- * Release Version: 1.0.8.3
- * Date Started: 2009/02/04
- *
- * Linden Scripting Language (LSL2) language file for GeSHi.
- *
- * Data derived and validated against the following:
- * http://wiki.secondlife.com/wiki/LSL_Portal
- * http://www.lslwiki.net/lslwiki/wakka.php?wakka=HomePage
- * http://rpgstats.com/wiki/index.php?title=Main_Page
- *
- * CHANGES
- * -------
- * 2009/02/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2009/02/05)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'LSL2',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array( // flow control
- 'do',
- 'else',
- 'for',
- 'if',
- 'jump',
- 'return',
- 'state',
- 'while',
- ),
- 2 => array( // manifest constants
- 'ACTIVE',
- 'AGENT',
- 'AGENT_ALWAYS_RUN',
- 'AGENT_ATTACHMENTS',
- 'AGENT_AWAY',
- 'AGENT_BUSY',
- 'AGENT_CROUCHING',
- 'AGENT_FLYING',
- 'AGENT_IN_AIR',
- 'AGENT_MOUSELOOK',
- 'AGENT_ON_OBJECT',
- 'AGENT_SCRIPTED',
- 'AGENT_SITTING',
- 'AGENT_TYPING',
- 'AGENT_WALKING',
- 'ALL_SIDES',
- 'ANIM_ON',
- 'ATTACH_BACK',
- 'ATTACH_BELLY',
- 'ATTACH_CHEST',
- 'ATTACH_CHIN',
- 'ATTACH_HEAD',
- 'ATTACH_HUD_BOTTOM',
- 'ATTACH_HUD_BOTTOM_LEFT',
- 'ATTACH_HUD_BOTTOM_RIGHT',
- 'ATTACH_HUD_CENTER_1',
- 'ATTACH_HUD_CENTER_2',
- 'ATTACH_HUD_TOP_CENTER',
- 'ATTACH_HUD_TOP_LEFT',
- 'ATTACH_HUD_TOP_RIGHT',
- 'ATTACH_LEAR',
- 'ATTACH_LEYE',
- 'ATTACH_LFOOT',
- 'ATTACH_LHAND',
- 'ATTACH_LHIP',
- 'ATTACH_LLARM',
- 'ATTACH_LLLEG',
- 'ATTACH_LPEC',
- 'ATTACH_LSHOULDER',
- 'ATTACH_LUARM',
- 'ATTACH_LULEG',
- 'ATTACH_MOUTH',
- 'ATTACH_NOSE',
- 'ATTACH_PELVIS',
- 'ATTACH_REAR',
- 'ATTACH_REYE',
- 'ATTACH_RFOOT',
- 'ATTACH_RHAND',
- 'ATTACH_RHIP',
- 'ATTACH_RLARM',
- 'ATTACH_RLLEG',
- 'ATTACH_RPEC',
- 'ATTACH_RSHOULDER',
- 'ATTACH_RUARM',
- 'ATTACH_RULEG',
- 'CAMERA_ACTIVE',
- 'CAMERA_BEHINDNESS_ANGLE',
- 'CAMERA_BEHINDNESS_LAG',
- 'CAMERA_DISTANCE',
- 'CAMERA_FOCUS',
- 'CAMERA_FOCUS_LAG',
- 'CAMERA_FOCUS_LOCKED',
- 'CAMERA_FOCUS_OFFSET',
- 'CAMERA_FOCUS_THRESHOLD',
- 'CAMERA_PITCH',
- 'CAMERA_POSITION',
- 'CAMERA_POSITION_LAG',
- 'CAMERA_POSITION_LOCKED',
- 'CAMERA_POSITION_THRESHOLD',
- 'CHANGED_ALLOWED_DROP',
- 'CHANGED_COLOR',
- 'CHANGED_INVENTORY',
- 'CHANGED_LINK',
- 'CHANGED_OWNER',
- 'CHANGED_REGION',
- 'CHANGED_SCALE',
- 'CHANGED_SHAPE',
- 'CHANGED_TELEPORT',
- 'CHANGED_TEXTURE',
- 'CLICK_ACTION_NONE',
- 'CLICK_ACTION_OPEN',
- 'CLICK_ACTION_OPEN_MEDIA',
- 'CLICK_ACTION_PAY',
- 'CLICK_ACTION_SIT',
- 'CLICK_ACTION_TOUCH',
- 'CONTROL_BACK',
- 'CONTROL_DOWN',
- 'CONTROL_FWD',
- 'CONTROL_LBUTTON',
- 'CONTROL_LEFT',
- 'CONTROL_ML_LBUTTON',
- 'CONTROL_RIGHT',
- 'CONTROL_ROT_LEFT',
- 'CONTROL_ROT_RIGHT',
- 'CONTROL_UP',
- 'DATA_BORN',
- 'DATA_NAME',
- 'DATA_ONLINE',
- 'DATA_PAYINFO',
- 'DATA_RATING',
- 'DATA_SIM_POS',
- 'DATA_SIM_RATING',
- 'DATA_SIM_STATUS',
- 'DEBUG_CHANNEL',
- 'DEG_TO_RAD',
- 'EOF',
- 'FALSE',
- 'HTTP_BODY_MAXLENGTH',
- 'HTTP_BODY_TRUNCATED',
- 'HTTP_METHOD',
- 'HTTP_MIMETYPE',
- 'HTTP_VERIFY_CERT',
- 'INVENTORY_ALL',
- 'INVENTORY_ANIMATION',
- 'INVENTORY_BODYPART',
- 'INVENTORY_CLOTHING',
- 'INVENTORY_GESTURE',
- 'INVENTORY_LANDMARK',
- 'INVENTORY_NONE',
- 'INVENTORY_NOTECARD',
- 'INVENTORY_OBJECT',
- 'INVENTORY_SCRIPT',
- 'INVENTORY_SOUND',
- 'INVENTORY_TEXTURE',
- 'LAND_LEVEL',
- 'LAND_LOWER',
- 'LAND_NOISE',
- 'LAND_RAISE',
- 'LAND_REVERT',
- 'LAND_SMOOTH',
- 'LINK_ALL_CHILDREN',
- 'LINK_ALL_OTHERS',
- 'LINK_ROOT',
- 'LINK_SET',
- 'LINK_THIS',
- 'LIST_STAT_GEOMETRIC_MEAN',
- 'LIST_STAT_MAX',
- 'LIST_STAT_MEAN',
- 'LIST_STAT_MEDIAN',
- 'LIST_STAT_MIN',
- 'LIST_STAT_NUM_COUNT',
- 'LIST_STAT_RANGE',
- 'LIST_STAT_STD_DEV',
- 'LIST_STAT_SUM',
- 'LIST_STAT_SUM_SQUARES',
- 'LOOP',
- 'MASK_BASE',
- 'MASK_EVERYONE',
- 'MASK_GROUP',
- 'MASK_NEXT',
- 'MASK_OWNER',
- 'NULL_KEY',
- 'OBJECT_CREATOR',
- 'OBJECT_DESC',
- 'OBJECT_GROUP',
- 'OBJECT_NAME',
- 'OBJECT_OWNER',
- 'OBJECT_POS',
- 'OBJECT_ROT',
- 'OBJECT_UNKNOWN_DETAIL',
- 'OBJECT_VELOCITY',
- 'PARCEL_DETAILS_AREA',
- 'PARCEL_DETAILS_DESC',
- 'PARCEL_DETAILS_GROUP',
- 'PARCEL_DETAILS_NAME',
- 'PARCEL_DETAILS_OWNER',
- 'PARCEL_FLAG_ALLOW_ALL_OBJECT_ENTRY',
- 'PARCEL_FLAG_ALLOW_CREATE_GROUP_OBJECTS',
- 'PARCEL_FLAG_ALLOW_CREATE_OBJECTS',
- 'PARCEL_FLAG_ALLOW_DAMAGE',
- 'PARCEL_FLAG_ALLOW_FLY',
- 'PARCEL_FLAG_ALLOW_GROUP_OBJECT_ENTRY',
- 'PARCEL_FLAG_ALLOW_GROUP_SCRIPTS',
- 'PARCEL_FLAG_ALLOW_LANDMARK',
- 'PARCEL_FLAG_ALLOW_SCRIPTS',
- 'PARCEL_FLAG_ALLOW_TERRAFORM',
- 'PARCEL_FLAG_LOCAL_SOUND_ONLY',
- 'PARCEL_FLAG_RESTRICT_PUSHOBJECT',
- 'PARCEL_FLAG_USE_ACCESS_GROUP',
- 'PARCEL_FLAG_USE_ACCESS_LIST',
- 'PARCEL_FLAG_USE_BAN_LIST',
- 'PARCEL_FLAG_USE_LAND_PASS_LIST',
- 'PARCEL_MEDIA_COMMAND_AGENT',
- 'PARCEL_MEDIA_COMMAND_AUTO_ALIGN',
- 'PARCEL_MEDIA_COMMAND_DESC',
- 'PARCEL_MEDIA_COMMAND_LOOP_SET',
- 'PARCEL_MEDIA_COMMAND_PAUSE',
- 'PARCEL_MEDIA_COMMAND_PLAY',
- 'PARCEL_MEDIA_COMMAND_SIZE',
- 'PARCEL_MEDIA_COMMAND_STOP',
- 'PARCEL_MEDIA_COMMAND_TEXTURE',
- 'PARCEL_MEDIA_COMMAND_TIME',
- 'PARCEL_MEDIA_COMMAND_TYPE',
- 'PARCEL_MEDIA_COMMAND_URL',
- 'PASSIVE',
- 'PAYMENT_INFO_ON_FILE',
- 'PAYMENT_INFO_USED',
- 'PAY_DEFAULT',
- 'PAY_HIDE',
- 'PERMISSION_ATTACH',
- 'PERMISSION_CHANGE_LINKS',
- 'PERMISSION_CONTROL_CAMERA',
- 'PERMISSION_DEBIT',
- 'PERMISSION_TAKE_CONTROLS',
- 'PERMISSION_TRACK_CAMERA',
- 'PERMISSION_TRIGGER_ANIMATION',
- 'PERM_ALL',
- 'PERM_COPY',
- 'PERM_MODIFY',
- 'PERM_MOVE',
- 'PERM_TRANSFER',
- 'PI',
- 'PI_BY_TWO',
- 'PRIM_BUMP_BARK',
- 'PRIM_BUMP_BLOBS',
- 'PRIM_BUMP_BRICKS',
- 'PRIM_BUMP_BRIGHT',
- 'PRIM_BUMP_CHECKER',
- 'PRIM_BUMP_CONCRETE',
- 'PRIM_BUMP_DARK',
- 'PRIM_BUMP_DISKS',
- 'PRIM_BUMP_GRAVEL',
- 'PRIM_BUMP_LARGETILE',
- 'PRIM_BUMP_NONE',
- 'PRIM_BUMP_SHINY',
- 'PRIM_BUMP_SIDING',
- 'PRIM_BUMP_STONE',
- 'PRIM_BUMP_STUCCO',
- 'PRIM_BUMP_SUCTION',
- 'PRIM_BUMP_TILE',
- 'PRIM_BUMP_WEAVE',
- 'PRIM_BUMP_WOOD',
- 'PRIM_COLOR',
- 'PRIM_FULLBRIGHT',
- 'PRIM_HOLE_CIRCLE',
- 'PRIM_HOLE_DEFAULT',
- 'PRIM_HOLE_SQUARE',
- 'PRIM_HOLE_TRIANGLE',
- 'PRIM_MATERIAL',
- 'PRIM_MATERIAL_FLESH',
- 'PRIM_MATERIAL_GLASS',
- 'PRIM_MATERIAL_LIGHT',
- 'PRIM_MATERIAL_METAL',
- 'PRIM_MATERIAL_PLASTIC',
- 'PRIM_MATERIAL_RUBBER',
- 'PRIM_MATERIAL_STONE',
- 'PRIM_MATERIAL_WOOD',
- 'PRIM_PHANTOM',
- 'PRIM_PHYSICS',
- 'PRIM_POSITION',
- 'PRIM_ROTATION',
- 'PRIM_SHINY_HIGH',
- 'PRIM_SHINY_LOW',
- 'PRIM_SHINY_MEDIUM',
- 'PRIM_SHINY_NONE',
- 'PRIM_SIZE',
- 'PRIM_TEMP_ON_REZ',
- 'PRIM_TEXTURE',
- 'PRIM_TYPE',
- 'PRIM_TYPE_BOX',
- 'PRIM_TYPE_CYLINDER',
- 'PRIM_TYPE_PRISM',
- 'PRIM_TYPE_RING',
- 'PRIM_TYPE_SPHERE',
- 'PRIM_TYPE_TORUS',
- 'PRIM_TYPE_TUBE',
- 'PSYS_PART_BOUNCE_MASK',
- 'PSYS_PART_EMISSIVE_MASK',
- 'PSYS_PART_END_ALPHA',
- 'PSYS_PART_END_COLOR',
- 'PSYS_PART_END_SCALE',
- 'PSYS_PART_FLAGS',
- 'PSYS_PART_FOLLOW_SRC_MASK',
- 'PSYS_PART_FOLLOW_VELOCITY_MASK',
- 'PSYS_PART_INTERP_COLOR_MASK',
- 'PSYS_PART_INTERP_SCALE_MASK',
- 'PSYS_PART_MAX_AGE',
- 'PSYS_PART_START_ALPHA',
- 'PSYS_PART_START_COLOR',
- 'PSYS_PART_START_SCALE',
- 'PSYS_PART_TARGET_LINEAR_MASK',
- 'PSYS_PART_TARGET_POS_MASK',
- 'PSYS_PART_WIND_MASK',
- 'PSYS_SRC_ACCEL',
- 'PSYS_SRC_ANGLE_BEGIN',
- 'PSYS_SRC_ANGLE_END',
- 'PSYS_SRC_BURST_PART_COUNT',
- 'PSYS_SRC_BURST_RADIUS',
- 'PSYS_SRC_BURST_RATE',
- 'PSYS_SRC_BURST_SPEED_MAX',
- 'PSYS_SRC_BURST_SPEED_MIN',
- 'PSYS_SRC_INNERANGLE',
- 'PSYS_SRC_MAX_AGE',
- 'PSYS_SRC_OMEGA',
- 'PSYS_SRC_OUTERANGLE',
- 'PSYS_SRC_PATTERN',
- 'PSYS_SRC_PATTERN_ANGLE',
- 'PSYS_SRC_PATTERN_ANGLE_CONE',
- 'PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY',
- 'PSYS_SRC_PATTERN_DROP',
- 'PSYS_SRC_PATTERN_EXPLODE',
- 'PSYS_SRC_TARGET_KEY',
- 'PSYS_SRC_TEXTURE',
- 'RAD_TO_DEG',
- 'REMOTE_DATA_CHANNEL',
- 'REMOTE_DATA_REQUEST',
- 'SCRIPTED',
- 'SQRT2',
- 'STATUS_BLOCK_GRAB',
- 'STATUS_DIE_AT_EDGE',
- 'STATUS_PHANTOM',
- 'STATUS_PHYSICS',
- 'STATUS_RETURN_AT_EDGE',
- 'STATUS_ROTATE_X',
- 'STATUS_ROTATE_Y',
- 'STATUS_ROTATE_Z',
- 'STATUS_SANDBOX',
- 'TRUE',
- 'TWO_PI',
- 'VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY',
- 'VEHICLE_ANGULAR_DEFLECTION_TIMESCALE',
- 'VEHICLE_ANGULAR_FRICTION_TIMESCALE',
- 'VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE',
- 'VEHICLE_ANGULAR_MOTOR_DIRECTION',
- 'VEHICLE_ANGULAR_MOTOR_TIMESCALE',
- 'VEHICLE_BANKING_EFFICIENCY',
- 'VEHICLE_BANKING_MIX',
- 'VEHICLE_BANKING_TIMESCALE',
- 'VEHICLE_BUOYANCY',
- 'VEHICLE_FLAG_CAMERA_DECOUPLED',
- 'VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT',
- 'VEHICLE_FLAG_HOVER_TERRAIN_ONLY',
- 'VEHICLE_FLAG_HOVER_UP_ONLY',
- 'VEHICLE_FLAG_HOVER_WATER_ONLY',
- 'VEHICLE_FLAG_LIMIT_MOTOR_UP',
- 'VEHICLE_FLAG_LIMIT_ROLL_ONLY',
- 'VEHICLE_FLAG_MOUSELOOK_BANK',
- 'VEHICLE_FLAG_MOUSELOOK_STEER',
- 'VEHICLE_FLAG_NO_DEFLECTION_UP',
- 'VEHICLE_HOVER_EFFICIENCY',
- 'VEHICLE_HOVER_HEIGHT',
- 'VEHICLE_HOVER_TIMESCALE',
- 'VEHICLE_LINEAR_DEFLECTION_EFFICIENCY',
- 'VEHICLE_LINEAR_DEFLECTION_TIMESCALE',
- 'VEHICLE_LINEAR_FRICTION_TIMESCALE',
- 'VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE',
- 'VEHICLE_LINEAR_MOTOR_DIRECTION',
- 'VEHICLE_LINEAR_MOTOR_OFFSET',
- 'VEHICLE_LINEAR_MOTOR_TIMESCALE',
- 'VEHICLE_REFERENCE_FRAME',
- 'VEHICLE_TYPE_AIRPLANE',
- 'VEHICLE_TYPE_BALLOON',
- 'VEHICLE_TYPE_BOAT',
- 'VEHICLE_TYPE_CAR',
- 'VEHICLE_TYPE_NONE',
- 'VEHICLE_TYPE_SLED',
- 'VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY',
- 'VEHICLE_VERTICAL_ATTRACTION_TIMESCALE',
- 'ZERO_ROTATION',
- 'ZERO_VECTOR',
- ),
- 3 => array( // handlers
- 'at_rot_target',
- 'at_target',
- 'attached',
- 'changed',
- 'collision',
- 'collision_end',
- 'collision_start',
- 'control',
- 'dataserver',
- 'email',
- 'http_response',
- 'land_collision',
- 'land_collision_end',
- 'land_collision_start',
- 'link_message',
- 'listen',
- 'money',
- 'moving_end',
- 'moving_start',
- 'no_sensor',
- 'not_at_rot_target',
- 'not_at_target',
- 'object_rez',
- 'on_rez',
- 'remote_data',
- 'run_time_permissions',
- 'sensor',
- 'state_entry',
- 'state_exit',
- 'timer',
- 'touch',
- 'touch_end',
- 'touch_start',
- ),
- 4 => array( // data types
- 'float',
- 'integer',
- 'key',
- 'list',
- 'rotation',
- 'string',
- 'vector',
- ),
- 5 => array( // library
- 'default',
- 'llAbs',
- 'llAcos',
- 'llAddToLandBanList',
- 'llAddToLandPassList',
- 'llAdjustSoundVolume',
- 'llAllowInventoryDrop',
- 'llAngleBetween',
- 'llApplyImpulse',
- 'llApplyRotationalImpulse',
- 'llAsin',
- 'llAtan2',
- 'llAttachToAvatar',
- 'llAvatarOnSitTarget',
- 'llAxes2Rot',
- 'llAxisAngle2Rot',
- 'llBase64ToInteger',
- 'llBase64ToString',
- 'llBreakAllLinks',
- 'llBreakLink',
- 'llCeil',
- 'llClearCameraParams',
- 'llCloseRemoteDataChannel',
- 'llCloud',
- 'llCollisionFilter',
- 'llCollisionSound',
- 'llCollisionSprite',
- 'llCos',
- 'llCreateLink',
- 'llCSV2List',
- 'llDeleteSubList',
- 'llDeleteSubString',
- 'llDetachFromAvatar',
- 'llDetectedGrab',
- 'llDetectedGroup',
- 'llDetectedKey',
- 'llDetectedLinkNumber',
- 'llDetectedName',
- 'llDetectedOwner',
- 'llDetectedPos',
- 'llDetectedRot',
- 'llDetectedTouchBinormal',
- 'llDetectedTouchFace',
- 'llDetectedTouchNormal',
- 'llDetectedTouchPos',
- 'llDetectedTouchST',
- 'llDetectedTouchUV',
- 'llDetectedType',
- 'llDetectedVel',
- 'llDialog',
- 'llDie',
- 'llDumpList2String',
- 'llEdgeOfWorld',
- 'llEjectFromLand',
- 'llEmail',
- 'llEscapeURL',
- 'llEuler2Rot',
- 'llFabs',
- 'llFloor',
- 'llForceMouselook',
- 'llFrand',
- 'llGetAccel',
- 'llGetAgentInfo',
- 'llGetAgentLanguage',
- 'llGetAgentSize',
- 'llGetAlpha',
- 'llGetAndResetTime',
- 'llGetAnimation',
- 'llGetAnimationList',
- 'llGetAttached',
- 'llGetBoundingBox',
- 'llGetCameraPos',
- 'llGetCameraRot',
- 'llGetCenterOfMass',
- 'llGetColor',
- 'llGetCreator',
- 'llGetDate',
- 'llGetEnergy',
- 'llGetForce',
- 'llGetFreeMemory',
- 'llGetGeometricCenter',
- 'llGetGMTclock',
- 'llGetInventoryCreator',
- 'llGetInventoryKey',
- 'llGetInventoryName',
- 'llGetInventoryNumber',
- 'llGetInventoryPermMask',
- 'llGetInventoryType',
- 'llGetKey',
- 'llGetLandOwnerAt',
- 'llGetLinkKey',
- 'llGetLinkName',
- 'llGetLinkNumber',
- 'llGetListEntryType',
- 'llGetListLength',
- 'llGetLocalPos',
- 'llGetLocalRot',
- 'llGetMass',
- 'llGetNextEmail',
- 'llGetNotecardLine',
- 'llGetNumberOfNotecardLines',
- 'llGetNumberOfPrims',
- 'llGetNumberOfSides',
- 'llGetObjectDesc',
- 'llGetObjectDetails',
- 'llGetObjectMass',
- 'llGetObjectName',
- 'llGetObjectPermMask',
- 'llGetObjectPrimCount',
- 'llGetOmega',
- 'llGetOwner',
- 'llGetOwnerKey',
- 'llGetParcelDetails',
- 'llGetParcelFlags',
- 'llGetParcelMaxPrims',
- 'llGetParcelPrimCount',
- 'llGetParcelPrimOwners',
- 'llGetPermissions',
- 'llGetPermissionsKey',
- 'llGetPos',
- 'llGetPrimitiveParams',
- 'llGetRegionAgentCount',
- 'llGetRegionCorner',
- 'llGetRegionFlags',
- 'llGetRegionFPS',
- 'llGetRegionName',
- 'llGetRegionTimeDilation',
- 'llGetRootPosition',
- 'llGetRootRotation',
- 'llGetRot',
- 'llGetScale',
- 'llGetScriptName',
- 'llGetScriptState',
- 'llGetSimulatorHostname',
- 'llGetStartParameter',
- 'llGetStatus',
- 'llGetSubString',
- 'llGetSunDirection',
- 'llGetTexture',
- 'llGetTextureOffset',
- 'llGetTextureRot',
- 'llGetTextureScale',
- 'llGetTime',
- 'llGetTimeOfDay',
- 'llGetTimestamp',
- 'llGetTorque',
- 'llGetUnixTime',
- 'llGetVel',
- 'llGetWallclock',
- 'llGiveInventory',
- 'llGiveInventoryList',
- 'llGiveMoney',
- 'llGround',
- 'llGroundContour',
- 'llGroundNormal',
- 'llGroundRepel',
- 'llGroundSlope',
- 'llHTTPRequest',
- 'llInsertString',
- 'llInstantMessage',
- 'llIntegerToBase64',
- 'llKey2Name',
- 'llList2CSV',
- 'llList2Float',
- 'llList2Integer',
- 'llList2Key',
- 'llList2List',
- 'llList2ListStrided',
- 'llList2Rot',
- 'llList2String',
- 'llList2Vector',
- 'llListen',
- 'llListenControl',
- 'llListenRemove',
- 'llListFindList',
- 'llListInsertList',
- 'llListRandomize',
- 'llListReplaceList',
- 'llListSort',
- 'llListStatistics',
- 'llLoadURL',
- 'llLog',
- 'llLog10',
- 'llLookAt',
- 'llLoopSound',
- 'llLoopSoundMaster',
- 'llLoopSoundSlave',
- 'llMapDestination',
- 'llMD5String',
- 'llMessageLinked',
- 'llMinEventDelay',
- 'llModifyLand',
- 'llModPow',
- 'llMoveToTarget',
- 'llOffsetTexture',
- 'llOpenRemoteDataChannel',
- 'llOverMyLand',
- 'llOwnerSay',
- 'llParcelMediaCommandList',
- 'llParcelMediaQuery',
- 'llParseString2List',
- 'llParseStringKeepNulls',
- 'llParticleSystem',
- 'llPassCollisions',
- 'llPassTouches',
- 'llPlaySound',
- 'llPlaySoundSlave',
- 'llPow',
- 'llPreloadSound',
- 'llPushObject',
- 'llRegionSay',
- 'llReleaseControls',
- 'llRemoteDataReply',
- 'llRemoteDataSetRegion',
- 'llRemoteLoadScriptPin',
- 'llRemoveFromLandBanList',
- 'llRemoveFromLandPassList',
- 'llRemoveInventory',
- 'llRemoveVehicleFlags',
- 'llRequestAgentData',
- 'llRequestInventoryData',
- 'llRequestPermissions',
- 'llRequestSimulatorData',
- 'llResetLandBanList',
- 'llResetLandPassList',
- 'llResetOtherScript',
- 'llResetScript',
- 'llResetTime',
- 'llRezAtRoot',
- 'llRezObject',
- 'llRot2Angle',
- 'llRot2Axis',
- 'llRot2Euler',
- 'llRot2Fwd',
- 'llRot2Left',
- 'llRot2Up',
- 'llRotateTexture',
- 'llRotBetween',
- 'llRotLookAt',
- 'llRotTarget',
- 'llRotTargetRemove',
- 'llRound',
- 'llSameGroup',
- 'llSay',
- 'llScaleTexture',
- 'llScriptDanger',
- 'llSendRemoteData',
- 'llSensor',
- 'llSensorRemove',
- 'llSensorRepeat',
- 'llSetAlpha',
- 'llSetBuoyancy',
- 'llSetCameraAtOffset',
- 'llSetCameraEyeOffset',
- 'llSetCameraParams',
- 'llSetClickAction',
- 'llSetColor',
- 'llSetDamage',
- 'llSetForce',
- 'llSetForceAndTorque',
- 'llSetHoverHeight',
- 'llSetLinkAlpha',
- 'llSetLinkColor',
- 'llSetLinkPrimitiveParams',
- 'llSetLinkTexture',
- 'llSetLocalRot',
- 'llSetObjectDesc',
- 'llSetObjectName',
- 'llSetParcelMusicURL',
- 'llSetPayPrice',
- 'llSetPos',
- 'llSetPrimitiveParams',
- 'llSetRemoteScriptAccessPin',
- 'llSetRot',
- 'llSetScale',
- 'llSetScriptState',
- 'llSetSitText',
- 'llSetSoundQueueing',
- 'llSetSoundRadius',
- 'llSetStatus',
- 'llSetText',
- 'llSetTexture',
- 'llSetTextureAnim',
- 'llSetTimerEvent',
- 'llSetTorque',
- 'llSetTouchText',
- 'llSetVehicleFlags',
- 'llSetVehicleFloatParam',
- 'llSetVehicleRotationParam',
- 'llSetVehicleType',
- 'llSetVehicleVectorParam',
- 'llSHA1String',
- 'llShout',
- 'llSin',
- 'llSitTarget',
- 'llSleep',
- 'llSqrt',
- 'llStartAnimation',
- 'llStopAnimation',
- 'llStopHover',
- 'llStopLookAt',
- 'llStopMoveToTarget',
- 'llStopSound',
- 'llStringLength',
- 'llStringToBase64',
- 'llStringTrim',
- 'llSubStringIndex',
- 'llTakeControls',
- 'llTan',
- 'llTarget',
- 'llTargetOmega',
- 'llTargetRemove',
- 'llTeleportAgentHome',
- 'llToLower',
- 'llToUpper',
- 'llTriggerSound',
- 'llTriggerSoundLimited',
- 'llUnescapeURL',
- 'llUnSit',
- 'llVecDist',
- 'llVecMag',
- 'llVecNorm',
- 'llVolumeDetect',
- 'llWater',
- 'llWhisper',
- 'llWind',
- 'llXorBase64StringsCorrect',
- ),
- 6 => array( // deprecated
- 'llMakeExplosion',
- 'llMakeFire',
- 'llMakeFountain',
- 'llMakeSmoke',
- 'llSound',
- 'llSoundPreload',
- 'llXorBase64Strings',
- ),
- 7 => array( // unimplemented
- 'llPointAt',
- 'llRefreshPrimURL',
- 'llReleaseCamera',
- 'llRemoteLoadScript',
- 'llSetPrimURL',
- 'llStopPointAt',
- 'llTakeCamera',
- 'llTextBox',
- ),
- 8 => array( // God mode
- 'llGodLikeRezObject',
- 'llSetInventoryPermMask',
- 'llSetObjectPermMask',
- ),
- ),
- 'SYMBOLS' => array(
- '{', '}', '(', ')', '[', ']',
- '=', '+', '-', '*', '/',
- '+=', '-=', '*=', '/=', '++', '--',
- '!', '%', '&amp;', '|', '&amp;&amp;', '||',
- '==', '!=', '&lt;', '&gt;', '&lt;=', '&gt;=',
- '~', '&lt;&lt;', '&gt;&gt;', '^', ':',
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => true,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff;',
- 2 => 'color: #000080;',
- 3 => 'color: #008080;',
- 4 => 'color: #228b22;',
- 5 => 'color: #b22222;',
- 6 => 'color: #8b0000; background-color: #ffff00;',
- 7 => 'color: #8b0000; background-color: #fa8072;',
- 8 => 'color: #000000; background-color: #ba55d3;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #ff7f50; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #006400;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.lslwiki.net/lslwiki/wakka.php?wakka={FNAME}', // http://wiki.secondlife.com/wiki/{FNAME}
- 4 => 'http://www.lslwiki.net/lslwiki/wakka.php?wakka={FNAME}', // http://wiki.secondlife.com/wiki/{FNAME}
- 5 => 'http://www.lslwiki.net/lslwiki/wakka.php?wakka={FNAME}', // http://wiki.secondlife.com/wiki/{FNAME}
- 6 => 'http://www.lslwiki.net/lslwiki/wakka.php?wakka={FNAME}', // http://wiki.secondlife.com/wiki/{FNAME}
- 7 => 'http://www.lslwiki.net/lslwiki/wakka.php?wakka={FNAME}', // http://wiki.secondlife.com/wiki/{FNAME}
- 8 => 'http://www.lslwiki.net/lslwiki/wakka.php?wakka={FNAME}', // http://wiki.secondlife.com/wiki/{FNAME}
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/lua.php b/libvpx/examples/includes/geshi/geshi/lua.php
deleted file mode 100644
index 58ed30a..0000000
--- a/libvpx/examples/includes/geshi/geshi/lua.php
+++ /dev/null
@@ -1,137 +0,0 @@
-<?php
-/*************************************************************************************
- * lua.php
- * -------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/10
- *
- * LUA language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/08/26 (1.0.2)
- * - Added support for objects and methods
- * - Removed unusable keywords
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Lua',
- 'COMMENT_SINGLE' => array(1 => "--"),
- 'COMMENT_MULTI' => array('--[[' => ']]'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'and','break','do','else','elseif','end','false','for','function','if',
- 'in','local','nil','not','or','repeat','return','then','true','until','while',
- '_VERSION','assert','collectgarbage','dofile','error','gcinfo','loadfile','loadstring',
- 'print','tonumber','tostring','type','unpack',
- '_ALERT','_ERRORMESSAGE','_INPUT','_PROMPT','_OUTPUT',
- '_STDERR','_STDIN','_STDOUT','call','dostring','foreach','foreachi','getn','globals','newtype',
- 'rawget','rawset','require','sort','tinsert','tremove',
- 'abs','acos','asin','atan','atan2','ceil','cos','deg','exp',
- 'floor','format','frexp','gsub','ldexp','log','log10','max','min','mod','rad','random','randomseed',
- 'sin','sqrt','strbyte','strchar','strfind','strlen','strlower','strrep','strsub','strupper','tan',
- 'openfile','closefile','readfrom','writeto','appendto',
- 'remove','rename','flush','seek','tmpfile','tmpname','read','write',
- 'clock','date','difftime','execute','exit','getenv','setlocale','time',
- '_G','getfenv','getmetatable','ipairs','loadlib','next','pairs','pcall',
- 'rawegal','setfenv','setmetatable','xpcall',
- 'string.byte','string.char','string.dump','string.find','string.len',
- 'string.lower','string.rep','string.sub','string.upper','string.format','string.gfind','string.gsub',
- 'table.concat','table.foreach','table.foreachi','table.getn','table.sort','table.insert','table.remove','table.setn',
- 'math.abs','math.acos','math.asin','math.atan','math.atan2','math.ceil','math.cos','math.deg','math.exp',
- 'math.floor','math.frexp','math.ldexp','math.log','math.log10','math.max','math.min','math.mod',
- 'math.pi','math.rad','math.random','math.randomseed','math.sin','math.sqrt','math.tan',
- 'coroutine.create','coroutine.resume','coroutine.status',
- 'coroutine.wrap','coroutine.yield',
- 'io.close','io.flush','io.input','io.lines','io.open','io.output','io.read','io.tmpfile','io.type','io.write',
- 'io.stdin','io.stdout','io.stderr',
- 'os.clock','os.date','os.difftime','os.execute','os.exit','os.getenv','os.remove','os.rename',
- 'os.setlocale','os.time','os.tmpname',
- 'string','table','math','coroutine','io','os','debug'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>', '=', ';'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #b1b100;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/m68k.php b/libvpx/examples/includes/geshi/geshi/m68k.php
deleted file mode 100644
index 9c16d7d..0000000
--- a/libvpx/examples/includes/geshi/geshi/m68k.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/*************************************************************************************
- * m68k.php
- * --------
- * Author: Benny Baumann (BenBE@omorphia.de)
- * Copyright: (c) 2007 Benny Baumann (http://www.omorphia.de/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2007/02/06
- *
- * Motorola 68000 Assembler language file for GeSHi.
- *
- * Syntax definition as commonly used by the motorola documentation for the
- * MC68HC908GP32 Microcontroller (and maybe others).
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2007/06/02 (1.0.0)
- * - First Release
- *
- * TODO (updated 2007/06/02)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Motorola 68000 Assembler',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /*CPU*/
- 1 => array(
- 'adc','add','ais','aix','and','asl','asr','bcc','bclr','bcs','beq',
- 'bge','bgt','bhcc','bhcs','bhi','bhs','bih','bil','bit','ble','blo',
- 'bls','blt','bmc','bmi','bms','bne','bpl','bra','brclr','brn',
- 'brset','bset','bsr','cbeq','clc','cli','clr','cmp','com','cphx',
- 'cpx','daa','dbnz','dec','div','eor','inc','jmp','jsr','lda','ldhx',
- 'ldx','lsl','lsr','mov','mul','neg','nop','nsa','ora','psha','pshh',
- 'pshx','pula','pulh','pulx','rol','ror','rsp','rti','rts','sbc',
- 'sec','sei','sta','sthx','stop','stx','sub','swi','tap','tax','tpa',
- 'tst','tsx','txa','txs','wait'
- ),
- /*registers*/
- 2 => array(
- 'a','h','x',
- 'hx','sp'
- ),
- /*Directive*/
- 3 => array(
- '#define','#endif','#else','#ifdef','#ifndef','#include','#undef',
- '.db','.dd','.df','.dq','.dt','.dw','.end','.org','equ'
- ),
- ),
- 'SYMBOLS' => array(
- ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff; font-weight:bold;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #46aa03; font-weight:bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #dd22dd;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #22bbff;',
- 1 => 'color: #22bbff;',
- 2 => 'color: #993333;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Hex numbers
- 0 => '#?0[0-9a-fA-F]{1,32}[hH]',
- //Binary numbers
- 1 => '\%[01]{1,64}[bB]',
- //Labels
- 2 => '^[_a-zA-Z][_a-zA-Z0-9]*?\:'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 8
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/make.php b/libvpx/examples/includes/geshi/geshi/make.php
deleted file mode 100644
index b15f459..0000000
--- a/libvpx/examples/includes/geshi/geshi/make.php
+++ /dev/null
@@ -1,151 +0,0 @@
-<?php
-/*************************************************************************************
- * make.php
- * --------
- * Author: Neil Bird <phoenix@fnxweb.com>
- * Copyright: (c) 2008 Neil Bird
- * Release Version: 1.0.8.3
- * Date Started: 2008/08/26
- *
- * make language file for GeSHi.
- *
- * (GNU make specific)
- *
- * CHANGES
- * -------
- * 2008/09/05 (1.0.0)
- * - First Release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'GNU make',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_REGEXP' => array(
- //Escaped String Starters
- 2 => "/\\\\['\"]/siU"
- ),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- // core
- 'ifeq', 'else', 'endif', 'ifneq', 'ifdef', 'ifndef',
- 'include', 'vpath', 'export', 'unexport', 'override',
- 'info', 'warning', 'error'
- ),
- 2 => array(
- // macros, literals
- '.SUFFIXES', '.PHONY', '.DEFAULT', '.PRECIOUS', '.IGNORE', '.SILENT', '.EXPORT_ALL_VARIABLES', '.KEEP_STATE',
- '.LIBPATTERNS', '.NOTPARALLEL', '.DELETE_ON_ERROR', '.INTERMEDIATE', '.POSIX', '.SECONDARY'
- ),
- /*
- 3 => array(
- // funcs - see regex
- //'subst', 'addprefix', 'addsuffix', 'basename', 'call', 'dir', 'error', 'eval', 'filter-out', 'filter',
- //'findstring', 'firstword', 'foreach', 'if', 'join', 'notdir', 'origin', 'patsubst', 'shell', 'sort', 'strip',
- //'suffix', 'warning', 'wildcard', 'word', 'wordlist', 'words'
- )*/
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}',
- '!', '@', '%', '&', '|', '/',
- '<', '>',
- '=', '-', '+', '*',
- '.', ':', ',', ';',
- '$'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- //3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #666622; font-weight: bold;',
- 2 => 'color: #990000;',
- //3 => 'color: #000000; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #339900; font-style: italic;',
- 2 => 'color: #000099; font-weight: bold;',
- 'MULTI' => ''
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array( # keep same as symbols so as to make ${} and $() equiv.
- 0 => 'color: #004400;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #CC2200;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #CC2200;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #004400;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #000088; font-weight: bold;',
- 1 => 'color: #0000CC; font-weight: bold;',
- 2 => 'color: #000088;'
- ),
- 'SCRIPT' => array(),
- 'METHODS' => array()
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- //3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- //Simple variables
- 0 => "\\$(?:[^{(&]|&(?:amp|lt|gt);)",
- //Complex variables/functions [built-ins]
- 1 => array(
- GESHI_SEARCH => '(\\$[({])(subst|addprefix|addsuffix|basename|call|dir|error|eval|filter-out|filter,|findstring|firstword|foreach|if|join|notdir|origin|patsubst|shell|sort|strip,|suffix|warning|wildcard|word|wordlist|words)([ })])',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- //Complex variables/functions [others]
- 2 => array(
- GESHI_SEARCH => '(\\$[({])([A-Za-z_][A-Za-z_0-9]*)([ })])',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array(),
- 'TAB_WIDTH' => 8
-// vim: set sw=4 sts=4 :
-);
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/matlab.php b/libvpx/examples/includes/geshi/geshi/matlab.php
deleted file mode 100644
index d3963ef..0000000
--- a/libvpx/examples/includes/geshi/geshi/matlab.php
+++ /dev/null
@@ -1,227 +0,0 @@
-<?php
-/*************************************************************************************
- * matlab.php
- * -----------
- * Author: Florian Knorn (floz@gmx.de)
- * Copyright: (c) 2004 Florian Knorn (http://www.florian-knorn.com)
- * Release Version: 1.0.8.3
- * Date Started: 2005/02/09
- *
- * Matlab M-file language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2006-03-25 (1.0.7.22)
- * - support for the transpose operator
- * - many keywords added
- * - links to the matlab documentation at mathworks
- * by: Olivier Verdier (olivier.verdier@free.fr)
- * 2005/05/07 (1.0.0)
- * - First Release
- *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Matlab M',
- 'COMMENT_SINGLE' => array(1 => '%'),
- 'COMMENT_MULTI' => array(),
- //Matlab Strings
- 'COMMENT_REGEXP' => array(
- 2 => "/(?<![\\w\\)\\]\\}\\.])('[^\\n']*?')/"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'break', 'case', 'catch', 'continue', 'elseif', 'else', 'end', 'for',
- 'function', 'global', 'if', 'otherwise', 'persistent', 'return',
- 'switch', 'try', 'while'
- ),
- 2 => array(
- 'all','any','exist','is','logical','mislocked',
-
- 'abs','acos','acosh','acot','acoth','acsc','acsch','airy','angle',
- 'ans','area','asec','asech','asin','asinh','atan','atan2','atanh',
- 'auread','autumn','auwrite','axes','axis','balance','bar','bar3',
- 'bar3h','barh','besselh','besseli','besselj','besselk','Bessely',
- 'beta','betainc','betaln','bicg','bicgstab','bin2dec','bitand',
- 'bitcmp','bitget','bitmax','bitor','bitset','bitshift','bitxor',
- 'blkdiag','bone','box','brighten','builtin','bwcontr','calendar',
- 'camdolly','camlight','camlookat','camorbit','campan','campos',
- 'camproj','camroll','camtarget','camup','camva','camzoom','capture',
- 'cart2pol','cart2sph','cat','caxis','cdf2rdf','ceil','cell',
- 'cell2struct','celldisp','cellfun','cellplot','cellstr','cgs',
- 'char','chol','cholinc','cholupdate','cla','clabel','class','clc',
- 'clf','clg','clock','close','colmmd','colorbar','colorcube',
- 'colordef','colormap','colperm','comet','comet3','compan','compass',
- 'complex','computer','cond','condeig','condest','coneplot','conj',
- 'contour','contourc','contourf','contourslice','contrast','conv',
- 'conv2','convhull','cool','copper','copyobj','corrcoef','cos',
- 'cosh','cot','coth','cov','cplxpair','cputime','cross','csc','csch',
- 'cumprod','cumsum','cumtrapz','cylinder','daspect','date','datenum',
- 'datestr','datetick','datevec','dbclear','dbcont','dbdown',
- 'dblquad','dbmex','dbquit','dbstack','dbstatus','dbstep','dbstop',
- 'dbtype','dbup','deblank','dec2bin','dec2hex','deconv','del2',
- 'delaunay','det','diag','dialog','diff','diffuse','dlmread',
- 'dlmwrite','dmperm','double','dragrect','drawnow','dsearch','eig',
- 'eigs','ellipj','ellipke','eomday','eps','erf','erfc','erfcx',
- 'erfiny','error','errorbar','errordlg','etime','eval','evalc',
- 'evalin','exp','expint','expm','eye','ezcontour','ezcontourf',
- 'ezmesh','ezmeshc','ezplot','ezplot3','ezpolar','ezsurf','ezsurfc',
- 'factor','factorial','fclose','feather','feof','ferror','feval',
- 'fft','fft2','fftshift','fgetl','fgets','fieldnames','figure',
- 'fill','fill3','filter','filter2','find','findfigs','findobj',
- 'findstr','fix','flag','flipdim','fliplr','flipud','floor','flops',
- 'fmin','fmins','fopen','fplot','fprintf','fread','frewind','fscanf',
- 'fseek','ftell','full','funm','fwrite','fzero','gallery','gamma',
- 'gammainc','gammaln','gca','gcbo','gcd','gcf','gco','get',
- 'getfield','ginput','gmres','gradient','gray','graymon','grid',
- 'griddata','gsvd','gtext','hadamard','hankel','hdf','helpdlg',
- 'hess','hex2dec','hex2num','hidden','hilb','hist','hold','hot',
- 'hsv','hsv2rgb','i','ifft','ifft2','ifftn','ifftshift','imag',
- 'image','imfinfo','imread','imwrite','ind2sub','Inf','inferiorto',
- 'inline','inpolygon','input','inputdlg','inputname','int16',
- 'int2str','int32','int8','interp1','interp2','interp3','interpft',
- 'interpn','intersect','inv','invhilb','ipermute','isa','ishandle',
- 'ismember','isocaps','isonormals','isosurface','j','jet','keyboard',
- 'lcm','legend','legendre','light','lighting','lightingangle',
- 'lin2mu','line','lines','linspace','listdlg','loadobj','log',
- 'log10','log2','loglog','logm','logspace','lower','lscov','lu',
- 'luinc','magic','mat2str','material','max','mean','median','menu',
- 'menuedit','mesh','meshc','meshgrid','min','mod','msgbox','mu2lin',
- 'NaN','nargchk','nargin','nargout','nchoosek','ndgrid','ndims',
- 'newplot','nextpow2','nnls','nnz','nonzeros','norm','normest','now',
- 'null','num2cell','num2str','nzmax','ode113,','ode15s,','ode23s,',
- 'ode23t,','ode23tb','ode45,','odefile','odeget','odeset','ones',
- 'orient','orth','pagedlg','pareto','pascal','patch','pause',
- 'pbaspect','pcg','pcolor','peaks','perms','permute','pi','pie',
- 'pie3','pinv','plot','plot3','plotmatrix','plotyy','pol2cart',
- 'polar','poly','polyarea','polyder','polyeig','polyfit','polyval',
- 'polyvalm','pow2','primes','print','printdlg','printopt','prism',
- 'prod','propedit','qmr','qr','qrdelete','qrinsert','qrupdate',
- 'quad','questdlg','quiver','quiver3','qz','rand','randn','randperm',
- 'rank','rat','rats','rbbox','rcond','real','realmax','realmin',
- 'rectangle','reducepatch','reducevolume','refresh','rem','repmat',
- 'reset','reshape','residue','rgb2hsv','rgbplot','ribbon','rmfield',
- 'roots','rose','rot90','rotate','rotate3d','round','rref',
- 'rrefmovie','rsf2csf','saveobj','scatter','scatter3','schur',
- 'script','sec','sech','selectmoveresize','semilogx','semilogy',
- 'set','setdiff','setfield','setxor','shading','shg','shiftdim',
- 'shrinkfaces','sign','sin','single','sinh','slice','smooth3','sort',
- 'sortrows','sound','soundsc','spalloc','sparse','spconvert',
- 'spdiags','specular','speye','spfun','sph2cart','sphere','spinmap',
- 'spline','spones','spparms','sprand','sprandn','sprandsym','spring',
- 'sprintf','sqrt','sqrtm','squeeze','sscanf','stairs','std','stem',
- 'stem3','str2double','str2num','strcat','strcmp','strcmpi',
- 'stream2','stream3','streamline','strings','strjust','strmatch',
- 'strncmp','strrep','strtok','struct','struct2cell','strvcat',
- 'sub2ind','subplot','subspace','subvolume','sum','summer',
- 'superiorto','surf','surf2patch','surface','surfc','surfl',
- 'surfnorm','svd','svds','symmmd','symrcm','symvar','tan','tanh',
- 'texlabel','text Create','textread','textwrap','tic','title','toc',
- 'toeplitz','trace','trapz','tril','trimesh','trisurf','triu',
- 'tsearch','uicontext Create','uicontextmenu','uicontrol',
- 'uigetfile','uimenu','uint32','uint8','uiputfile','uiresume',
- 'uisetcolor','uisetfont','uiwait Used','union','unique','unwrap',
- 'upper','var','varargin','varargout','vectorize','view','viewmtx',
- 'voronoi','waitbar','waitforbuttonpress','warndlg','warning',
- 'waterfall','wavread','wavwrite','weekday','whitebg','wilkinson',
- 'winter','wk1read','wk1write','xlabel','xlim','ylabel','ylim',
- 'zeros','zlabel','zlim','zoom',
- //'[Keywords 6]',
- 'addpath','cd','clear','copyfile','delete','diary','dir','disp',
- 'doc','docopt','echo','edit','fileparts','format','fullfile','help',
- 'helpdesk','helpwin','home','inmem','lasterr','lastwarn','length',
- 'load','lookfor','ls','matlabrc','matlabroot','mkdir','mlock',
- 'more','munlock','open','openvar','pack','partialpath','path',
- 'pathtool','profile','profreport','pwd','quit','rmpath','save',
- 'saveas','size','tempdir','tempname','type','ver','version','web',
- 'what','whatsnew','which','who','whos','workspace'
- )
- ),
- 'SYMBOLS' => array(
- '...'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- //3 => false,
- //4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF;',
- 2 => 'color: #0000FF;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #228B22;',
- 2 => 'color:#A020F0;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => 'color: #080;'
- ),
- 'STRINGS' => array(
- //0 => 'color: #A020F0;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #33f;'
- ),
- 'METHODS' => array(
- 1 => '',
- 2 => ''
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #080;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #33f;'
- ),
- 'SCRIPT' => array(
- 0 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => 'http://www.mathworks.com/access/helpdesk/help/techdoc/ref/{FNAMEL}.html'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- //Complex numbers
- 0 => '(?<![\\w])[+-]?[\\d]*([\\d]\\.|\\.[\\d])?[\\d]*[ij](?![\\w])'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/mirc.php b/libvpx/examples/includes/geshi/geshi/mirc.php
deleted file mode 100644
index 1547ff4..0000000
--- a/libvpx/examples/includes/geshi/geshi/mirc.php
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/*************************************************************************************
- * mirc.php
- * -----
- * Author: Alberto 'Birckin' de Areba (Birckin@hotmail.com)
- * Copyright: (c) 2006 Alberto de Areba
- * Release Version: 1.0.8.3
- * Date Started: 2006/05/29
- *
- * mIRC Scripting language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2006/05/29 (1.0.0)
- * - First Release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'mIRC Scripting',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'alias', 'menu', 'dialog',
- ),
- 2 => array(
- 'if', 'elseif', 'else', 'while', 'return', 'goto','var'
- ),
- 3 => array(
- 'action','ajinvite','amsg','ame','anick','aop','auser',
- 'avoice','auto','autojoin','away','background','ban','beep',
- 'channel','clear','clearall','clipboard','close','closemsg','color',
- 'copy','creq','ctcp','ctcpreply','ctcps','dcc','dde','ddeserver',
- 'debug','describe','disable','disconnect','dlevel','dll','dns',
- 'dqwindow','ebeeps','echo','editbox','emailaddr','enable','events',
- 'exit','filter','findtext','finger','flash','flood','flush',
- 'flushini','font','fsend','fserve','fullname','ghide','gload',
- 'gmove','gopts','gplay','gpoint','gqreq','groups','gshow','gsize',
- 'gstop','gtalk','gunload','guser','help','hop','ignore','invite',
- 'join','kick','linesep','links','list','load','loadbuf','localinfo',
- 'log','me','mdi','mkdir','mnick','mode','msg','names','nick','noop',
- 'notice','notify','omsg','onotice','part','partall','pdcc',
- 'perform','ping','play','pop','protect','pvoice','qmsg','qme',
- 'query','queryrn','quit','raw','remini','remote','remove','rename',
- 'enwin','resetidle','rlevel','rmdir','run','ruser','save','savebuf',
- 'saveini','say','server','showmirc','sline','sound','speak','splay',
- 'sreq','strip','time',
- //'timer[N/name]', //Handled as a regular expression below ...
- 'timers','timestamp','titlebar','tnick','tokenize','topic','ulist',
- 'unload','updatenl','url','uwho','window','winhelp','write',
- 'writeini','who','whois','whowas'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #994444;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #990000; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #FF0000;',
- ),
- 'STRINGS' => array(
- ),
- 'NUMBERS' => array(
- 0 => '',
- ),
- 'METHODS' => array(
- 0 => 'color: #008000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #FF0000;',
- ),
- 'REGEXPS' => array(
- 0 => 'color: #000099;',
- 1 => 'color: #990000;',
- 2 => 'color: #000099;',
- 3 => 'color: #888800;',
- 4 => 'color: #888800;',
- 5 => 'color: #000099;',
- 6 => 'color: #990000; font-weight: bold;',
- 7 => 'color: #990000; font-weight: bold;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.mirc.com/{FNAMEL}'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array('.'),
- 'REGEXPS' => array(
- //Variable names
- 0 => '\$[a-zA-Z0-9]+',
- //Variable names
- 1 => '(%|&amp;)[a-zA-Z0-9äöü]+',
- //Client to Client Protocol handling
- 2 => '(on|ctcp) (!|@|&amp;)?(\d|\*):[a-zA-Z]+:',
- /*4 => array(
- GESHI_SEARCH => '((on|ctcp) (!|@|&)?(\d|\*):(Action|Active|Agent|AppActive|Ban|Chat|Close|Connect|Ctcp|CtcpReply|DccServer|DeHelp|DeOp|DeVoice|Dialog|Dns|Error|Exit|FileRcvd|FileSent|GetFail|Help|Hotlink|Input|Invite|Join|KeyDown|KeyUp|Kick|Load|Logon|MidiEnd|Mode|Mp3End|Nick|NoSound|Notice|Notify|Op|Open|Part|Ping|Pong|PlayEnd|Quit|Raw|RawMode|SendFail|Serv|ServerMode|ServerOp|Signal|Snotice|Start|Text|Topic|UnBan|Unload|Unotify|User|Mode|Voice|Wallops|WaveEnd):)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),*/
- //Channel names
- 3 => '(#|@)[a-zA-Z0-9]+',
- 4 => '-[a-z\d]+',
- //Raw protocol handling
- 5 => 'raw (\d|\*):',
- //Timer handling
- 6 => '\/timer(?!s\b)[0-9a-zA-Z_]+',
- // /...
- 7 => '\/[a-zA-Z0-9]+'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'NUMBERS' => GESHI_NEVER
- ),
- 'KEYWORDS' => array(
- 2 => array(
- 'DISALLOWED_BEFORE' => '(?<![a-zA-Z0-9\$_\|\#;>^&\/])'
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/modula3.php b/libvpx/examples/includes/geshi/geshi/modula3.php
deleted file mode 100644
index a136442..0000000
--- a/libvpx/examples/includes/geshi/geshi/modula3.php
+++ /dev/null
@@ -1,135 +0,0 @@
-<?php
-/*************************************************************************************
- * modula3.php
- * ----------
- * Author: mbishop (mbishop@esoteriq.org)
- * Copyright: (c) 2009 mbishop (mbishop@esoteriq.org)
- * Release Version: 1.0.8.3
- * Date Started: 2009/01/21
- *
- * Modula-3 language file for GeSHi.
- *
- * CHANGES
- * -------
- *
- * TODO
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Modula-3',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('(*' => '*)'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array("''"),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'AND', 'ANY', 'ARRAY', 'AS', 'BEGIN', 'BITS', 'BRANDED', 'BY', 'CASE',
- 'CONST', 'DIV', 'DO', 'ELSE', 'ELSIF', 'END', 'EVAL', 'EXCEPT', 'EXCEPTION',
- 'EXIT', 'EXPORTS', 'FINALLY', 'FOR', 'FROM', 'GENERIC', 'IF', 'IMPORT', 'IN',
- 'INTERFACE', 'LOCK', 'LOOP', 'METHODS', 'MOD', 'MODULE', 'NOT', 'OBJECT', 'OF',
- 'OR', 'OVERRIDE', 'PROCEDURE', 'RAISE', 'RAISES', 'READONLY', 'RECORD', 'REF',
- 'REPEAT', 'RETURN', 'REVEAL', 'ROOT', 'SET', 'THEN', 'TO', 'TRY', 'TYPE', 'TYPECASE',
- 'UNSAFE', 'UNTIL', 'UNTRACED', 'VALUE', 'VAR', 'WHILE', 'WITH'
- ),
- 2 => array(
- 'NIL', 'NULL', 'FALSE', 'TRUE',
- ),
- 3 => array(
- 'ABS','ADR','ADRSIZE','BITSIZE','BYTESIZE','CEILING','DEC','DISPOSE',
- 'EXTENDED','FIRST','FLOAT','FLOOR','INC','ISTYPE','LAST','LOOPHOLE','MAX','MIN',
- 'NARROW','NEW','NUMBER','ORD','ROUND','SUBARRAY','TRUNC','TYPECODE', 'VAL'
- ),
- 4 => array(
- 'ADDRESS', 'BOOLEAN', 'CARDINAL', 'CHAR', 'INTEGER',
- 'LONGREAL', 'MUTEX', 'REAL', 'REFANY', 'TEXT'
- ),
- ),
- 'SYMBOLS' => array(
- ',', ':', '=', '+', '-', '*', '/', '#'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;',
- 4 => 'color: #000066; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;',
- 'HARD' => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0066ee;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/mpasm.php b/libvpx/examples/includes/geshi/geshi/mpasm.php
deleted file mode 100644
index 30b192c..0000000
--- a/libvpx/examples/includes/geshi/geshi/mpasm.php
+++ /dev/null
@@ -1,164 +0,0 @@
-<?php
-/*************************************************************************************
- * mpasm.php
- * ---------
- * Author: Bakalex (bakalex@gmail.com)
- * Copyright: (c) 2004 Bakalex, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/12/6
- *
- * Microchip Assembler language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2005/01/29 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/12/6)
- * -------------------------
- *
- * For the moment, i've only added PIC16C6X registers. We need more (PIC16F/C7x/8x,
- * PIC10, PIC18 and dsPIC registers).
- * Must take a look to dsPIC instructions.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Microchip Assembler',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /*Directive Language*/
- 4 => array(
- 'CONSTANT', '#DEFINE', 'END', 'EQU', 'ERROR', 'ERROR-LEVEL', '#INCLUDE', 'LIST',
- 'MESSG', 'NOLIST', 'ORG', 'PAGE', 'PROCESSOR', 'RADIX', 'SET', 'SPACE', 'SUBTITLE',
- 'TITLE', '#UNDEFINE', 'VARIABLE', 'ELSE', 'ENDIF', 'ENDW', 'IF', 'IFDEF', 'IFNDEF',
- 'WHILE', '__BADRAM', 'CBLOCK', '__CONFIG', 'DA', 'DATA', 'DB', 'DE', 'DT', 'DW',
- 'ENDC', 'FILL', '__IDLOCS', '__MAXRAM', 'RES', 'ENDM', 'EXITM', 'EXPAND', 'LOCAL',
- 'MACRO', 'NOEXPAND', 'BANKISEL', 'BANKSEL', 'CODE', 'EXTERN', 'GLOBAL', 'IDATA',
- 'PAGESEL', 'UDATA', 'UDATA_ACS', 'UDATA_OVR', 'UDATA_SHR'
- ),
- /* 12&14-bit Specific Instruction Set*/
- 1 => array(
- 'andlw', 'call', 'clrwdt', 'goto', 'iorlw', 'movlw', 'option', 'retlw', 'sleep',
- 'tris', 'xorlw', 'addwf', 'andwf', 'clrf', 'clrw', 'comf', 'decf', 'decfsz', 'incf',
- 'incfsz', 'iorwf', 'movf', 'nop', 'rlf', 'rrf', 'subwf', 'swapf', 'xorwf',
- 'bcf', 'bsf', 'btfsc', 'btfss',
- 'addlw', 'retfie', 'return', 'sublw', 'addcf', 'adddcf', 'b', 'bc', 'bdc',
- 'bnc', 'bndc', 'bnz', 'bz', 'clrc', 'clrdc', 'clrz', 'lcall', 'lgoto', 'movfw',
- 'negf', 'setc', 'setdc', 'setz', 'skpc', 'skpdc', 'skpnc', 'skpndc', 'skpnz', 'skpz',
- 'subcf', 'subdcf', 'tstf'
- ),
- /* 16-bit Specific Instructiob Set */
- 2 => array (
- 'movfp', 'movlb', 'movlp', 'movpf', 'movwf', 'tablrd', 'tablwt', 'tlrd', 'tlwt',
- 'addwfc', 'daw', 'mullw', 'negw', 'rlcf', 'rlncf', 'rrcf', 'rrncf', 'setf', 'subwfb',
- 'btg', 'cpfseq', 'cpfsgt', 'cpfslt', 'dcfsnz', 'infsnz', 'tstfsz', 'lfsr', 'bnn',
- 'bnov', 'bra', 'pop', 'push', 'rcall', 'reset'
- ),
- /* Registers */
- 3 => array(
- 'INDF', 'TMR0', 'PCL', 'STATUS', 'FSR', 'PORTA', 'PORTB', 'PORTC', 'PORTD', 'PORTE',
- 'PCLATH', 'INTCON', 'PIR1', 'PIR2', 'TMR1L', 'TMR1H', 'T1CON', 'TMR2', 'T2CON', 'TMR2L',
- 'TMR2H', 'TMR0H', 'TMR0L', 'SSPBUF', 'SSPCON', 'CCPR1L', 'CCPR1H', 'CCP1CON', 'RCSTA',
- 'TXREG', 'RCREG', 'CCPR2L', 'CCPR2H', 'CCP2CON', 'OPTION', 'TRISA', 'TRISB', 'TRISC',
- 'TRISD', 'TRISE', 'PIE2', 'PIE1', 'PR2', 'SSPADD', 'SSPSTAT', 'TXSTA', 'SPBRG'
- ),
- /*Operands*/
- 5 => array(
- 'high','low'
- )
- ),
- 'SYMBOLS' => array(
- '[', ']', '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00007f;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #007f00;',
- 4 => 'color: #46aa03; font-weight:bold;',
- 5 => 'color: #7f0000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #ff0000;',
- 1 => 'color: #ff0000;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Hex numbers
- 0 => '[0-9a-fA-F]{1,32}[hH]',
- //Binary numbers
- 1 => '[01]{1,64}[bB]'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/mxml.php b/libvpx/examples/includes/geshi/geshi/mxml.php
deleted file mode 100644
index 939632b..0000000
--- a/libvpx/examples/includes/geshi/geshi/mxml.php
+++ /dev/null
@@ -1,145 +0,0 @@
-<?php
-/*************************************************************************************
- * mxml.php
- * -------
- * Author: David Spurr
- * Copyright: (c) 2007 David Spurr (http://www.defusion.org.uk/)
- * Release Version: 1.0.8.3
- * Date Started: 2007/10/04
- *
- * MXML language file for GeSHi. Based on the XML file by Nigel McNie
- *
- * CHANGES
- * -------
- * 2007/10/04 (1.0.7.22)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'MXML',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('<!--' => '-->'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- 0 => 'color: #00bbdd;',
- 1 => 'color: #ddbb00;',
- 2 => 'color: #339933;',
- 3 => 'color: #000000;'
- ),
- 'REGEXPS' => array(
- 0 => 'font-weight: bold; color: black;',
- 1 => 'color: #7400FF;',
- 2 => 'color: #7400FF;'
- )
- ),
- 'URLS' => array(
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- // xml declaration
- 0 => array(
- GESHI_SEARCH => '(&lt;[\/?|(\?xml)]?[a-z0-9_\-:]*(\?&gt;))',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- // opening tags
- 1 => array(
- GESHI_SEARCH => '(&lt;\/?[a-z]+:[a-z]+)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- // closing tags
- 2 => array(
- GESHI_SEARCH => '(\/?&gt;)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<!DOCTYPE' => '>'
- ),
- 1 => array(
- '&' => ';'
- ),
- 2 => array(
- //'<![CDATA[' => ']]>'
- '<mx:Script>' => '</mx:Script>'
- ),
- 3 => array(
- '<' => '>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => false,
- 1 => false,
- 2 => false,
- 3 => true
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/mysql.php b/libvpx/examples/includes/geshi/geshi/mysql.php
deleted file mode 100644
index 0017eef..0000000
--- a/libvpx/examples/includes/geshi/geshi/mysql.php
+++ /dev/null
@@ -1,475 +0,0 @@
-<?php
-/*************************************************************************************
- * mysql.php
- * ---------
- * Author: Marjolein Katsma (marjolein.is.back@gmail.com)
- * Copyright: (c) 2008 Marjolein Katsma (http://blog.marjoleinkatsma.com/)
- * Release Version: 1.0.8.3
- * Date Started: 2008-12-12
- *
- * MySQL language file for GeSHi.
- *
- * Based on original MySQL language file by Carl Fürstenberg (2004); brought
- * up-to-date for current MySQL versions, and with more classes for different
- * types of keywords; several minor errors were corrected as well.
- *
- * Some "classes" have two groups here: this is to allow for the fact that some
- * keywords in MySQL have a double function: many of those are either a function
- * (must be immediately followed by an opening bracket) or some other keyword:
- * so they can be distinguished by the presence (or not) of that opening bracket.
- * (An immediately following opening bracket is a default rule for functions in
- * MySQL, though this may be overridden; because it's only a default, we use a
- * regex lookahead only where necessary to distinguish homonyms, not generally
- * to match any function.)
- * Other keywords with double usage cannot be distinguished and are classified
- * in the "Mix" category.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'MySQL',
- //'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'), // '--' MUST be folowed by whitespace,not necessarily a space
- 'COMMENT_SINGLE' => array(
- 1 =>'-- ',
- 2 => '#'
- ),
- 'COMMENT_REGEXP' => array(
- 1 => "/(?:--\s).*?$/", // double dash followed by any whitespace
- ),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE, // @@@ would be nice if this could be defined per group!
- 'QUOTEMARKS' => array("'", '"', '`'),
- 'ESCAPE_CHAR' => '\\', // by default only, can be specified
- 'ESCAPE_REGEXP' => array(
- 1 => "/[_%]/", // search wildcards
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC |
- GESHI_NUMBER_OCT_PREFIX |
- GESHI_NUMBER_HEX_PREFIX |
- GESHI_NUMBER_FLT_NONSCI |
- GESHI_NUMBER_FLT_SCI_SHORT |
- GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- // Mix: statement keywords and keywords that don't fit in any other
- // category, or have multiple usage/meanings
- 'ACTION','ADD','AFTER','ALGORITHM','ALL','ALTER','ANALYZE','ANY',
- 'ASC','AS','BDB','BEGIN','BERKELEYDB','BINARY','BTREE','CALL',
- 'CASCADED','CASCADE','CHAIN','CHECK','COLUMNS','COLUMN','COMMENT',
- 'COMMIT','COMMITTED','CONSTRAINT','CONTAINS SQL','CONSISTENT',
- 'CONVERT','CREATE','CROSS','DATA','DATABASES',
- 'DECLARE','DEFINER','DELAYED','DELETE','DESCRIBE','DESC',
- 'DETERMINISTIC','DISABLE','DISCARD','DISTINCTROW','DISTINCT','DO',
- 'DROP','DUMPFILE','DUPLICATE KEY','ENABLE','ENCLOSED BY','ENGINE',
- 'ERRORS','ESCAPED BY','EXISTS','EXPLAIN','EXTENDED','FIELDS',
- 'FIRST','FOR EACH ROW','FORCE','FOREIGN KEY','FROM','FULL',
- 'FUNCTION','GLOBAL','GRANT','GROUP BY','HANDLER','HASH','HAVING',
- 'HELP','HIGH_PRIORITY','IF NOT EXISTS','IGNORE','IMPORT','INDEX',
- 'INFILE','INNER','INNODB','INOUT','INTO','INVOKER',
- 'ISOLATION LEVEL','JOIN','KEYS','KEY','KILL','LANGUAGE SQL','LAST',
- 'LIMIT','LINES','LOAD','LOCAL','LOCK','LOW_PRIORITY',
- 'MASTER_SERVER_ID','MATCH','MERGE','MIDDLEINT','MODIFIES SQL DATA',
- 'MODIFY','MRG_MYISAM','NATURAL','NEXT','NO SQL','NO','ON',
- 'OPTIMIZE','OPTIONALLY','OPTION','ORDER BY','OUTER','OUTFILE','OUT',
- 'PARTIAL','PREV','PRIMARY KEY','PRIVILEGES','PROCEDURE','PURGE',
- 'QUICK','READS SQL DATA','READ','REFERENCES','RELEASE','RENAME',
- 'REPEATABLE','REQUIRE','RESTRICT','RETURNS','REVOKE',
- 'ROLLBACK','ROUTINE','RTREE','SAVEPOINT','SELECT',
- 'SERIALIZABLE','SESSION','SET','SHARE MODE','SHOW','SIMPLE',
- 'SNAPSHOT','SOME','SONAME','SQL SECURITY','SQL_BIG_RESULT',
- 'SQL_BUFFER_RESULT','SQL_CACHE','SQL_CALC_FOUND_ROWS',
- 'SQL_NO_CACHE','SQL_SMALL_RESULT','SSL','START','STARTING BY',
- 'STATUS','STRAIGHT_JOIN','STRIPED','TABLESPACE','TABLES','TABLE',
- 'TEMPORARY','TEMPTABLE','TERMINATED BY','TO','TRANSACTIONS',
- 'TRANSACTION','TRIGGER','TYPES','TYPE','UNCOMMITTED','UNDEFINED',
- 'UNION','UNLOCK_TABLES','UPDATE','USAGE','USE','USER_RESOURCES',
- 'USING','VALUES','VALUE','VIEW','WARNINGS','WHERE','WITH ROLLUP',
- 'WITH','WORK','WRITE',
- ),
- 2 => array( //No ( must follow
- // Mix: statement keywords distinguished from functions by the same name
- "CURRENT_USER", "DATABASE", "IN", "INSERT", "DEFAULT", "REPLACE", "SCHEMA", "TRUNCATE"
- ),
- 3 => array(
- // Values (Constants)
- 'FALSE','NULL','TRUE',
- ),
- 4 => array(
- // Column Data Types
- 'BIGINT','BIT','BLOB','BOOLEAN','BOOL','CHARACTER VARYING',
- 'CHAR VARYING','DATETIME','DECIMAL','DEC','DOUBLE PRECISION',
- 'DOUBLE','ENUM','FIXED','FLOAT','GEOMETRYCOLLECTION','GEOMETRY',
- 'INTEGER','INT','LINESTRING','LONGBLOB','LONGTEXT','MEDIUMBLOB',
- 'MEDIUMINT','MEDIUMTEXT','MULTIPOINT','MULTILINESTRING',
- 'MULTIPOLYGON','NATIONAL CHARACTER','NATIONAL CHARACTER VARYING',
- 'NATIONAL CHAR VARYING','NATIONAL VARCHAR','NCHAR VARCHAR','NCHAR',
- 'NUMERIC','POINT','POLYGON','REAL','SERIAL',
- 'SMALLINT','TEXT','TIMESTAMP','TINYBLOB','TINYINT',
- 'TINYTEXT','VARBINARY','VARCHARACTER','VARCHAR',
- ),
- 5 => array( //No ( must follow
- // Column data types distinguished from functions by the same name
- "CHAR", "DATE", "TIME"
- ),
- 6 => array(
- // Table, Column & Index Attributes
- 'AUTO_INCREMENT','AVG_ROW_LENGTH','BOTH','CHECKSUM','CONNECTION',
- 'DATA DIRECTORY','DEFAULT NULL','DELAY_KEY_WRITE','FULLTEXT',
- 'INDEX DIRECTORY','INSERT_METHOD','LEADING','MAX_ROWS','MIN_ROWS',
- 'NOT NULL','PACK_KEYS','ROW_FORMAT','SERIAL DEFAULT VALUE','SIGNED',
- 'SPATIAL','TRAILING','UNIQUE','UNSIGNED','ZEROFILL'
- ),
- 7 => array( //No ( must follow
- // Column attribute distinguished from function by the same name
- "CHARSET"
- ),
- 8 => array(
- // Date and Time Unit Specifiers
- 'DAY_HOUR','DAY_MICROSECOND','DAY_MINUTE','DAY_SECOND',
- 'HOUR_MICROSECOND','HOUR_MINUTE','HOUR_SECOND',
- 'MINUTE_MICROSECOND','MINUTE_SECOND',
- 'SECOND_MICROSECOND','YEAR_MONTH'
- ),
- 9 => array( //No ( must follow
- // Date-time unit specifiers distinguished from functions by the same name
- "DAY", "HOUR", "MICROSECOND", "MINUTE", "MONTH", "QUARTER", "SECOND", "WEEK", "YEAR"
- ),
- 10 => array(
- // Operators (see also Symbols)
- 'AND','BETWEEN','CHARACTER SET','COLLATE','DIV','IS NOT NULL',
- 'IS NOT','IS NULL','IS','LIKE','NOT','OFFSET','OR','REGEXP','RLIKE',
- 'SOUNDS LIKE','XOR'
- ),
- 11 => array( //No ( must follow
- // Operator distinghuished from function by the same name
- "INTERVAL"
- ),
- 12 => array(
- // Control Flow (functions)
- 'CASE','ELSE','END','IFNULL','IF','NULLIF','THEN','WHEN',
- ),
- 13 => array(
- // String Functions
- 'ASCII','BIN','BIT_LENGTH','CHAR_LENGTH','CHARACTER_LENGTH',
- 'CONCAT_WS','CONCAT','ELT','EXPORT_SET','FIELD',
- 'FIND_IN_SET','FORMAT','HEX','INSTR','LCASE','LEFT','LENGTH',
- 'LOAD_FILE','LOCATE','LOWER','LPAD','LTRIM','MAKE_SET','MID',
- 'OCTET_LENGTH','ORD','POSITION','QUOTE','REPEAT','REVERSE',
- 'RIGHT','RPAD','RTRIM','SOUNDEX','SPACE','STRCMP','SUBSTRING_INDEX',
- 'SUBSTRING','TRIM','UCASE','UNHEX','UPPER',
- ),
- 14 => array( //A ( must follow
- // String functions distinguished from other keywords by the same name
- "INSERT", "REPLACE", "CHAR"
- ),
- 15 => array(
- // Numeric Functions
- 'ABS','ACOS','ASIN','ATAN2','ATAN','CEILING','CEIL',
- 'CONV','COS','COT','CRC32','DEGREES','EXP','FLOOR','LN','LOG10',
- 'LOG2','LOG','MOD','OCT','PI','POWER','POW','RADIANS','RAND',
- 'ROUND','SIGN','SIN','SQRT','TAN',
- ),
- 16 => array( //A ( must follow
- // Numeric function distinguished from other keyword by the same name
- "TRUNCATE"
- ),
- 17 => array(
- // Date and Time Functions
- 'ADDDATE','ADDTIME','CONVERT_TZ','CURDATE','CURRENT_DATE',
- 'CURRENT_TIME','CURRENT_TIMESTAMP','CURTIME','DATE_ADD',
- 'DATE_FORMAT','DATE_SUB','DATEDIFF','DAYNAME','DAYOFMONTH',
- 'DAYOFWEEK','DAYOFYEAR','EXTRACT','FROM_DAYS','FROM_UNIXTIME',
- 'GET_FORMAT','LAST_DAY','LOCALTIME','LOCALTIMESTAMP','MAKEDATE',
- 'MAKETIME','MONTHNAME','NOW','PERIOD_ADD',
- 'PERIOD_DIFF','SEC_TO_TIME','STR_TO_DATE','SUBDATE','SUBTIME',
- 'SYSDATE','TIME_FORMAT','TIME_TO_SEC',
- 'TIMESTAMPADD','TIMESTAMPDIFF','TO_DAYS',
- 'UNIX_TIMESTAMP','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','WEEKDAY',
- 'WEEKOFYEAR','YEARWEEK',
- ),
- 18 => array( //A ( must follow
- // Date-time functions distinguished from other keywords by the same name
- "DATE", "DAY", "HOUR", "MICROSECOND", "MINUTE", "MONTH", "QUARTER",
- "SECOND", "TIME", "WEEK", "YEAR"
- ),
- 19 => array(
- // Comparison Functions
- 'COALESCE','GREATEST','ISNULL','LEAST',
- ),
- 20 => array( //A ( must follow
- // Comparison functions distinguished from other keywords by the same name
- "IN", "INTERVAL"
- ),
- 21 => array(
- // Encryption and Compression Functions
- 'AES_DECRYPT','AES_ENCRYPT','COMPRESS','DECODE','DES_DECRYPT',
- 'DES_ENCRYPT','ENCODE','ENCRYPT','MD5','OLD_PASSWORD','PASSWORD',
- 'SHA1','SHA','UNCOMPRESS','UNCOMPRESSED_LENGTH',
- ),
- 22 => array(
- // GROUP BY (aggregate) Functions
- 'AVG','BIT_AND','BIT_OR','BIT_XOR','COUNT','GROUP_CONCAT',
- 'MAX','MIN','STDDEV_POP','STDDEV_SAMP','STDDEV','STD','SUM',
- 'VAR_POP','VAR_SAMP','VARIANCE',
- ),
- 23 => array(
- // Information Functions
- 'BENCHMARK','COERCIBILITY','COLLATION','CONNECTION_ID',
- 'FOUND_ROWS','LAST_INSERT_ID','ROW_COUNT',
- 'SESSION_USER','SYSTEM_USER','USER','VERSION',
- ),
- 24 => array( //A ( must follow
- // Information functions distinguished from other keywords by the same name
- "CURRENT_USER", "DATABASE", "SCHEMA", "CHARSET"
- ),
- 25 => array(
- // Miscellaneous Functions
- 'ExtractValue','BIT_COUNT','GET_LOCK','INET_ATON','INET_NTOA',
- 'IS_FREE_LOCK','IS_USED_LOCK','MASTER_POS_WAIT','NAME_CONST',
- 'RELEASE_LOCK','SLEEP','UpdateXML','UUID',
- ),
- 26 => array( //A ( must follow
- // Miscellaneous function distinguished from other keyword by the same name
- "DEFAULT"
- ),
- 27 => array(
- // Geometry Functions
- 'Area','AsBinary','AsText','AsWKB','AsWKT','Boundary','Buffer',
- 'Centroid','Contains','ConvexHull','Crosses',
- 'Difference','Dimension','Disjoint','Distance',
- 'EndPoint','Envelope','Equals','ExteriorRing',
- 'GLength','GeomCollFromText','GeomCollFromWKB','GeomFromText',
- 'GeomFromWKB','GeometryCollectionFromText',
- 'GeometryCollectionFromWKB','GeometryFromText','GeometryFromWKB',
- 'GeometryN','GeometryType',
- 'InteriorRingN','Intersection','Intersects','IsClosed','IsEmpty',
- 'IsRing','IsSimple',
- 'LineFromText','LineFromWKB','LineStringFromText',
- 'LineStringFromWKB',
- 'MBRContains','MBRDisjoint','MBREqual','MBRIntersects',
- 'MBROverlaps','MBRTouches','MBRWithin','MLineFromText',
- 'MLineFromWKB','MPointFromText','MPointFromWKB','MPolyFromText',
- 'MPolyFromWKB','MultiLineStringFromText','MultiLineStringFromWKB',
- 'MultiPointFromText','MultiPointFromWKB','MultiPolygonFromText',
- 'MultiPolygonFromWKB',
- 'NumGeometries','NumInteriorRings','NumPoints',
- 'Overlaps',
- 'PointFromText','PointFromWKB','PointN','PointOnSurface',
- 'PolyFromText','PolyFromWKB','PolygonFromText','PolygonFromWKB',
- 'Related','SRID','StartPoint','SymDifference',
- 'Touches',
- 'Union',
- 'Within',
- 'X',
- 'Y',
- ),
- ),
- 'SYMBOLS' => array(
- 1 => array(
- /* Operators */
- '=', ':=', // assignment operators
- '||', '&&', '!', // locical operators
- '=', '<=>', '>=', '>', '<=', '<', '<>', '!=', // comparison operators
- '|', '&', '^', '~', '<<', '>>', // bitwise operators
- '-', '+', '*', '/', '%', // numerical operators
- ),
- 2 => array(
- /* Other syntactical symbols */
- '(', ')',
- ',', ';',
- ),
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => false,
- 9 => false,
- 10 => false,
- 11 => false,
- 12 => false,
- 13 => false,
- 13 => false,
- 14 => false,
- 15 => false,
- 16 => false,
- 17 => false,
- 18 => false,
- 19 => false,
- 20 => false,
- 21 => false,
- 22 => false,
- 23 => false,
- 24 => false,
- 25 => false,
- 26 => false,
- 27 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #990099; font-weight: bold;', // mix
- 2 => 'color: #990099; font-weight: bold;', // mix
- 3 => 'color: #9900FF; font-weight: bold;', // constants
- 4 => 'color: #999900; font-weight: bold;', // column data types
- 5 => 'color: #999900; font-weight: bold;', // column data types
- 6 => 'color: #FF9900; font-weight: bold;', // attributes
- 7 => 'color: #FF9900; font-weight: bold;', // attributes
- 8 => 'color: #9900FF; font-weight: bold;', // date-time units
- 9 => 'color: #9900FF; font-weight: bold;', // date-time units
-
- 10 => 'color: #CC0099; font-weight: bold;', // operators
- 11 => 'color: #CC0099; font-weight: bold;', // operators
-
- 12 => 'color: #009900;', // control flow (functions)
- 13 => 'color: #000099;', // string functions
- 14 => 'color: #000099;', // string functions
- 15 => 'color: #000099;', // numeric functions
- 16 => 'color: #000099;', // numeric functions
- 17 => 'color: #000099;', // date-time functions
- 18 => 'color: #000099;', // date-time functions
- 19 => 'color: #000099;', // comparison functions
- 20 => 'color: #000099;', // comparison functions
- 21 => 'color: #000099;', // encryption functions
- 22 => 'color: #000099;', // aggregate functions
- 23 => 'color: #000099;', // information functions
- 24 => 'color: #000099;', // information functions
- 25 => 'color: #000099;', // miscellaneous functions
- 26 => 'color: #000099;', // miscellaneous functions
- 27 => 'color: #00CC00;', // geometry functions
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #808000; font-style: italic;',
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #004000; font-weight: bold;',
- 1 => 'color: #008080; font-weight: bold;' // search wildcards
- ),
- 'BRACKETS' => array(
- 0 => 'color: #FF00FF;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #008000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #008080;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 1 => 'color: #CC0099;', // operators
- 2 => 'color: #000033;', // syntax
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 2 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 3 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 4 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 5 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 6 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 7 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 8 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
- 9 => 'http://search.mysql.com/search?site=refman-51&amp;q={FNAME}&amp;lr=lang_en',
-
- 10 => 'http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html',
- 11 => 'http://dev.mysql.com/doc/refman/5.1/en/non-typed-operators.html',
-
- 12 => 'http://dev.mysql.com/doc/refman/5.1/en/control-flow-functions.html',
- 13 => 'http://dev.mysql.com/doc/refman/5.1/en/string-functions.html',
- 14 => 'http://dev.mysql.com/doc/refman/5.1/en/string-functions.html',
- 15 => 'http://dev.mysql.com/doc/refman/5.1/en/numeric-functions.html',
- 16 => 'http://dev.mysql.com/doc/refman/5.1/en/numeric-functions.html',
- 17 => 'http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html',
- 18 => 'http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html',
- 19 => 'http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html',
- 20 => 'http://dev.mysql.com/doc/refman/5.1/en/comparison-operators.html',
- 21 => 'http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html',
- 22 => 'http://dev.mysql.com/doc/refman/5.1/en/group-by-functions-and-modifiers.html',
- 23 => 'http://dev.mysql.com/doc/refman/5.1/en/information-functions.html',
- 24 => 'http://dev.mysql.com/doc/refman/5.1/en/information-functions.html',
- 25 => 'http://dev.mysql.com/doc/refman/5.1/en/func-op-summary-ref.html',
- 26 => 'http://dev.mysql.com/doc/refman/5.1/en/func-op-summary-ref.html',
- 27 => 'http://dev.mysql.com/doc/refman/5.1/en/analysing-spatial-information.html',
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 2 => array(
- 'DISALLOWED_AFTER' => '(?![\(\w])'
- ),
- 5 => array(
- 'DISALLOWED_AFTER' => '(?![\(\w])'
- ),
- 7 => array(
- 'DISALLOWED_AFTER' => '(?![\(\w])'
- ),
- 9 => array(
- 'DISALLOWED_AFTER' => '(?![\(\w])'
- ),
- 11 => array(
- 'DISALLOWED_AFTER' => '(?![\(\w])'
- ),
-
- 14 => array(
- 'DISALLOWED_AFTER' => '(?=\()'
- ),
- 16 => array(
- 'DISALLOWED_AFTER' => '(?=\()'
- ),
- 18 => array(
- 'DISALLOWED_AFTER' => '(?=\()'
- ),
- 20 => array(
- 'DISALLOWED_AFTER' => '(?=\()'
- ),
- 24 => array(
- 'DISALLOWED_AFTER' => '(?=\()'
- ),
- 26 => array(
- 'DISALLOWED_AFTER' => '(?=\()'
- )
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/nsis.php b/libvpx/examples/includes/geshi/geshi/nsis.php
deleted file mode 100644
index 9f3e1cc..0000000
--- a/libvpx/examples/includes/geshi/geshi/nsis.php
+++ /dev/null
@@ -1,351 +0,0 @@
-<?php
-/*************************************************************************************
- * nsis.php
- * --------
- * Author: deguix (cevo_deguix@yahoo.com.br), Tux (http://tux.a4.cz/)
- * Copyright: (c) 2005 deguix, 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2005/12/03
- *
- * Nullsoft Scriptable Install System language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/12/03 (2.0.2)
- * - Updated to NSIS 2.11.
- * 2005/06/17 (2.0.1)
- * - Updated to NSIS 2.07b0.
- * 2005/04/05 (2.0.0)
- * - Updated to NSIS 2.06.
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Added support for URLs
- * 2004/08/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'NSIS',
- 'COMMENT_SINGLE' => array(1 => ';', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'",'"','`'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- '!appendfile', '!addIncludeDir', '!addplugindir', '!cd', '!define', '!delfile', '!echo', '!else',
- '!endif', '!error', '!execute', '!ifdef', '!ifmacrodef', '!ifmacrondef', '!ifndef', '!include',
- '!insertmacro', '!macro', '!macroend', '!packhdr', '!tempfile', '!system', '!undef', '!verbose',
- '!warning'
- ),
- 2 => array(
- 'AddBrandingImage', 'AllowRootDirInstall', 'AutoCloseWindow', 'BGFont',
- 'BGGradient', 'BrandingText', 'Caption', 'ChangeUI', 'CheckBitmap', 'CompletedText', 'ComponentText',
- 'CRCCheck', 'DetailsButtonText', 'DirShow', 'DirText', 'DirVar', 'DirVerify', 'FileErrorText',
- 'Function', 'FunctionEnd', 'Icon', 'InstallButtonText', 'InstallColors', 'InstallDir',
- 'InstallDirRegKey', 'InstProgressFlags', 'InstType', 'LangString', 'LangStringUP', 'LicenseBkColor',
- 'LicenseData', 'LicenseForceSelection', 'LicenseLangString', 'LicenseText', 'LoadLanguageFile',
- 'MiscButtonText', 'Name', 'OutFile', 'Page', 'PageEx', 'PageExEnd', 'Section',
- 'SectionEnd', 'SectionGroup', 'SectionGroupEnd', 'SetCompressor', 'SetFont', 'ShowInstDetails',
- 'ShowUninstDetails', 'SilentInstall', 'SilentUnInstall', 'SpaceTexts', 'SubCaption', 'SubSection',
- 'SubSectionEnd', 'UninstallButtonText', 'UninstallCaption', 'UninstallIcon', 'UninstallSubCaption',
- 'UninstallText', 'UninstPage', 'Var', 'VIAddVersionKey', 'VIProductVersion', 'WindowIcon', 'XPStyle'
- ),
- 3 => array(
- 'AddSize', 'AllowSkipFiles', 'FileBufSize', 'GetInstDirError', 'PageCallbacks',
- 'SectionIn', 'SetCompress', 'SetCompressionLevel', 'SetCompressorDictSize',
- 'SetDatablockOptimize', 'SetDateSave', 'SetOverwrite', 'SetPluginUnload'
- ),
- 4 => array(
- 'Abort', 'BringToFront', 'Call', 'CallInstDLL', 'ClearErrors', 'CopyFiles','CreateDirectory',
- 'CreateFont', 'CreateShortCut', 'Delete', 'DeleteINISec', 'DeleteINIStr', 'DeleteRegKey',
- 'DeleteRegValue', 'DetailPrint', 'EnableWindow', 'EnumRegKey', 'EnumRegValue', 'Exch', 'Exec',
- 'ExecShell', 'ExecWait', 'ExpandEnvStrings', 'File', 'FileClose', 'FileOpen', 'FileRead',
- 'FileReadByte', 'FileSeek', 'FileWrite', 'FileWriteByte', 'FindClose', 'FindFirst', 'FindNext',
- 'FindWindow', 'FlushINI', 'GetCurInstType', 'GetCurrentAddress', 'GetDlgItem', 'GetDLLVersion',
- 'GetDLLVersionLocal', 'GetErrorLevel', 'GetFileTime', 'GetFileTimeLocal', 'GetFullPathName',
- 'GetFunctionAddress', 'GetLabelAddress', 'GetTempFileName', 'GetWindowText', 'Goto', 'HideWindow',
- 'IfAbort', 'IfErrors', 'IfFileExists', 'IfRebootFlag', 'IfSilent', 'InitPluginsDir', 'InstTypeGetText',
- 'InstTypeSetText', 'IntCmp', 'IntCmpU', 'IntFmt', 'IntOp', 'IsWindow', 'LockWindow', 'LogSet', 'LogText',
- 'MessageBox', 'Nop', 'Pop', 'Push', 'Quit', 'ReadEnvStr', 'ReadIniStr', 'ReadRegDWORD', 'ReadRegStr',
- 'Reboot', 'RegDLL', 'Rename', 'ReserveFile', 'Return', 'RMDir', 'SearchPath', 'SectionGetFlags',
- 'SectionGetInstTypes', 'SectionGetSize', 'SectionGetText', 'SectionSetFlags', 'SectionSetInstTypes',
- 'SectionSetSize', 'SectionSetText', 'SendMessage', 'SetAutoClose', 'SetBrandingImage', 'SetCtlColors',
- 'SetCurInstType', 'SetDetailsPrint', 'SetDetailsView', 'SetErrorLevel', 'SetErrors', 'SetFileAttributes',
- 'SetOutPath', 'SetRebootFlag', 'SetShellVarContext', 'SetSilent', 'ShowWindow', 'Sleep', 'StrCmp',
- 'StrCpy', 'StrLen', 'UnRegDLL', 'WriteINIStr', 'WriteRegBin', 'WriteRegDWORD', 'WriteRegExpandStr',
- 'WriteRegStr', 'WriteUninstaller'
- ),
- 5 => array(
- 'all', 'alwaysoff', 'ARCHIVE', 'auto', 'both', 'bzip2', 'checkbox', 'components', 'current',
- 'custom', 'directory', 'false', 'FILE_ATTRIBUTE_ARCHIVE', 'FILE_ATTRIBUTE_HIDDEN', 'FILE_ATTRIBUTE_NORMAL',
- 'FILE_ATTRIBUTE_OFFLINE', 'FILE_ATTRIBUTE_READONLY', 'FILE_ATTRIBUTE_SYSTEM,TEMPORARY',
- 'FILE_ATTRIBUTE_TEMPORARY', 'force', 'HIDDEN', 'hide', 'HKCC', 'HKCR', 'HKCU', 'HKDD', 'HKEY_CLASSES_ROOT',
- 'HKEY_CURRENT_CONFIG', 'HKEY_CURRENT_USER', 'HKEY_DYN_DATA', 'HKEY_LOCAL_MACHINE', 'HKEY_PERFORMANCE_DATA',
- 'HKEY_USERS', 'HKLM', 'HKPD', 'HKU', 'IDABORT', 'IDCANCEL', 'IDIGNORE', 'IDNO', 'IDOK', 'IDRETRY', 'IDYES',
- 'ifdiff', 'ifnewer', 'instfiles', 'lastused', 'leave', 'license', 'listonly', 'lzma', 'manual',
- 'MB_ABORTRETRYIGNORE', 'MB_DEFBUTTON1', 'MB_DEFBUTTON2', 'MB_DEFBUTTON3', 'MB_DEFBUTTON4',
- 'MB_ICONEXCLAMATION', 'MB_ICONINFORMATION', 'MB_ICONQUESTION', 'MB_ICONSTOP', 'MB_OK', 'MB_OKCANCEL',
- 'MB_RETRYCANCEL', 'MB_RIGHT', 'MB_SETFOREGROUND', 'MB_TOPMOST', 'MB_YESNO', 'MB_YESNOCANCEL', 'nevershow',
- 'none', 'normal', 'off', 'OFFLINE', 'on', 'radiobuttons', 'READONLY', 'RO', 'SHCTX', 'SHELL_CONTEXT', 'show',
- 'silent', 'silentlog', 'SW_HIDE', 'SW_SHOWMAXIMIZED', 'SW_SHOWMINIMIZED', 'SW_SHOWNORMAL', 'SYSTEM',
- 'textonly', 'true', 'try', 'uninstConfirm', 'zlib'
- ),
- 6 => array(
- '/a', '/components', '/COMPONENTSONLYONCUSTOM', '/CUSTOMSTRING', '/e', '/FILESONLY', '/FINAL', '/gray', '/GLOBAL',
- '/ifempty', '/IMGID', '/ITALIC', '/lang', '/NOCUSTOM', '/nonfatal', '/NOUNLOAD', '/oname', '/r', '/REBOOTOK',
- '/RESIZETOFIT', '/SOLID', '/SD', '/SHORT', '/silent', '/STRIKE', '/TIMEOUT', '/TRIMCENTER', '/TRIMLEFT',
- '/TRIMRIGHT', '/UNDERLINE', '/windows', '/x'
- ),
- 7 => array(
- '.onGUIEnd', '.onGUIInit', '.onInit', '.onInstFailed', '.onInstSuccess', '.onMouseOverSection',
- '.onRebootFailed', '.onSelChange', '.onUserAbort', '.onVerifyInstDir', 'un.onGUIEnd', 'un.onGUIInit',
- 'un.onInit', 'un.onRebootFailed', 'un.onUninstFailed', 'un.onUninstSuccess', 'un.onUserAbort'
- ),
- 8 => array(
- 'MUI.nsh', '"${NSISDIR}\Contrib\Modern UI\System.nsh"', 'MUI_SYSVERSION', 'MUI_ICON', 'MUI_UNICON',
- 'MUI_HEADERIMAGE', 'MUI_HEADERIMAGE_BITMAP', 'MUI_HEADERIMAGE_BITMAP_NOSTRETCH', 'MUI_HEADERIMAGE_BITMAP_RTL',
- 'MUI_HEADERIMAGE_BITMAP_RTL_NOSTRETCH', 'MUI_HEADERIMAGE_UNBITMAP', 'MUI_HEADERIMAGE_UNBITMAP_NOSTRETCH',
- 'MUI_HEADERIMAGE_UNBITMAP_RTL', 'MUI_HEADERIMAGE_UNBITMAP_RTL_NOSTRETCH', 'MUI_HEADERIMAGE_RIGHT', 'MUI_BGCOLOR',
- 'MUI_UI', 'MUI_UI_HEADERIMAGE', 'MUI_UI_HEADERIMAGE_RIGHT', 'MUI_UI_COMPONENTSPAGE_SMALLDESC',
- 'MUI_UI_COMPONENTSPAGE_NODESC', 'MUI_WELCOMEFINISHPAGE_BITMAP', 'MUI_WELCOMEFINISHPAGE_BITMAP_NOSTRETCH',
- 'MUI_WELCOMEFINISHPAGE_INI', 'MUI_UNWELCOMEFINISHPAGE_BITMAP', 'MUI_UNWELCOMEFINISHPAGE_BITMAP_NOSTRETCH',
- 'MUI_UNWELCOMEFINISHPAGE_INI', 'MUI_LICENSEPAGE_BGCOLOR', 'MUI_COMPONENTSPAGE_CHECKBITMAP',
- 'MUI_COMPONENTSPAGE_SMALLDESC', 'MUI_COMPONENTSPAGE_NODESC', 'MUI_INSTFILESPAGE_COLORS',
- 'MUI_INSTFILESPAGE_PROGRESSBAR', 'MUI_FINISHPAGE_NOAUTOCLOSE', 'MUI_UNFINISHPAGE_NOAUTOCLOSE',
- 'MUI_ABORTWARNING', 'MUI_ABORTWARNING_TEXT', 'MUI_UNABORTWARNING', 'MUI_UNABORTWARNING_TEXT',
- 'MUI_PAGE_WELCOME', 'MUI_PAGE_LICENSE', 'MUI_PAGE_COMPONENTS', 'MUI_PAGE_DIRECTORY',
- 'MUI_PAGE_STARTMENU', 'MUI_PAGE_INSTFILES', 'MUI_PAGE_FINISH', 'MUI_UNPAGE_WELCOME',
- 'MUI_UNPAGE_CONFIRM', 'MUI_UNPAGE_LICENSE', 'MUI_UNPAGE_COMPONENTS', 'MUI_UNPAGE_DIRECTORY',
- 'MUI_UNPAGE_INSTFILES', 'MUI_UNPAGE_FINISH', 'MUI_PAGE_HEADER_TEXT', 'MUI_PAGE_HEADER_SUBTEXT',
- 'MUI_WELCOMEPAGE_TITLE', 'MUI_WELCOMEPAGE_TITLE_3LINES', 'MUI_WELCOMEPAGE_TEXT',
- 'MUI_LICENSEPAGE_TEXT_TOP', 'MUI_LICENSEPAGE_TEXT_BOTTOM', 'MUI_LICENSEPAGE_BUTTON',
- 'MUI_LICENSEPAGE_CHECKBOX', 'MUI_LICENSEPAGE_CHECKBOX_TEXT', 'MUI_LICENSEPAGE_RADIOBUTTONS',
- 'MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_ACCEPT', 'MUI_LICENSEPAGE_RADIOBUTTONS_TEXT_DECLINE',
- 'MUI_COMPONENTSPAGE_TEXT_TOP', 'MUI_COMPONENTSPAGE_TEXT_COMPLIST', 'MUI_COMPONENTSPAGE_TEXT_INSTTYPE',
- 'MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE', 'MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO',
- 'MUI_DIRECTORYPAGE_TEXT_TOP', 'MUI_DIRECTORYPAGE_TEXT_DESTINATION', 'MUI_DIRECTORYPAGE_VARIABLE',
- 'MUI_DIRECTORYPAGE_VERIFYONLEAVE', 'MUI_STARTMENU_WRITE_BEGIN', 'MUI_STARTMENU_WRITE_END',
- 'MUI_STARTMENUPAGE_TEXT_TOP', 'MUI_STARTMENUPAGE_TEXT_CHECKBOX', 'MUI_STARTMENUPAGE_DEFAULTFOLDER',
- 'MUI_STARTMENUPAGE_NODISABLE', 'MUI_STARTMENUPAGE_REGISTRY_ROOT', 'MUI_STARTMENUPAGE_REGISTRY_KEY',
- 'MUI_STARTMENUPAGE_REGISTRY_VALUENAME', 'MUI_INSTFILESPAGE_FINISHHEADER_TEXT',
- 'MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT', 'MUI_INSTFILESPAGE_ABORTHEADER_TEXT',
- 'MUI_INSTFILESPAGE_ABORTHEADER_SUBTEXT', 'MUI_FINISHPAGE_TITLE', 'MUI_FINISHPAGE_TITLE_3LINES',
- 'MUI_FINISHPAGE_TEXT', 'MUI_FINISHPAGE_TEXT_LARGE', 'MUI_FINISHPAGE_BUTTON',
- 'MUI_FINISHPAGE_TEXT_REBOOT', 'MUI_FINISHPAGE_TEXT_REBOOTNOW', 'MUI_FINISHPAGE_TEXT_REBOOTLATER',
- 'MUI_FINISHPAGE_RUN', 'MUI_FINISHPAGE_RUN_TEXT', 'MUI_FINISHPAGE_RUN_PARAMETERS',
- 'MUI_FINISHPAGE_RUN_NOTCHECKED', 'MUI_FINISHPAGE_RUN_FUNCTION', 'MUI_FINISHPAGE_SHOWREADME',
- 'MUI_FINISHPAGE_SHOWREADME_TEXT', 'MUI_FINISHPAGE_SHOWREADME_NOTCHECKED',
- 'MUI_FINISHPAGE_SHOWREADME_FUNCTION', 'MUI_FINISHPAGE_LINK', 'MUI_FINISHPAGE_LINK_LOCATION',
- 'MUI_FINISHPAGE_LINK_COLOR', 'MUI_FINISHPAGE_NOREBOOTSUPPORT', 'MUI_UNCONFIRMPAGE_TEXT_TOP',
- 'MUI_UNCONFIRMPAGE_TEXT_LOCATION', 'MUI_LANGUAGE', 'MUI_LANGDLL_DISPLAY',
- 'MUI_LANGDLL_REGISTRY_ROOT', 'MUI_LANGDLL_REGISTRY_KEY', 'MUI_LANGDLL_REGISTRY_VALUENAME',
- 'MUI_LANGDLL_WINDOWTITLE', 'MUI_LANGDLL_INFO', 'MUI_LANGDLL_ALWAYSSHOW',
- 'MUI_RESERVEFILE_INSTALLOPTIONS', 'MUI_RESERVEFILE_LANGDLL', 'MUI_FUNCTION_DESCRIPTION_BEGIN',
- 'MUI_DESCRIPTION_TEXT', 'MUI_FUNCTION_DESCRIPTION_END', 'MUI_INSTALLOPTIONS_EXTRACT',
- 'MUI_INSTALLOPTIONS_EXTRACT_AS', 'MUI_HEADER_TEXT', 'MUI_INSTALLOPTIONS_DISPLAY',
- 'MUI_INSTALLOPTIONS_INITDIALOG', 'MUI_INSTALLOPTIONS_SHOW',
- 'MUI_INSTALLOPTIONS_DISPLAY_RETURN', 'MUI_INSTALLOPTIONS_SHOW_RETURN',
- 'MUI_INSTALLOPTIONS_READ', 'MUI_INSTALLOPTIONS_WRITE',
- 'MUI_CUSTOMFUNCTION_GUIINIT', 'MUI_CUSTOMFUNCTION_UNGUIINIT',
- 'MUI_CUSTOMFUNCTION_ABORT', 'MUI_CUSTOMFUNCTION_UNABORT',
- 'MUI_PAGE_CUSTOMFUNCTION_PRE', 'MUI_PAGE_CUSTOMFUNCTION_SHOW', 'MUI_PAGE_CUSTOMFUNCTION_LEAVE',
- 'MUI_WELCOMEFINISHPAGE_CUSTOMFUNCTION_INIT'
- ),
- 9 => array(
- 'LogicLib.nsh', '${LOGICLIB}', 'LOGICLIB_STRCMP', 'LOGICLIB_INT64CMP', 'LOGICLIB_SECTIONCMP', '${If}', '${Unless}',
- '${ElseIf}', '${ElseUnless}', '${Else}', '${EndIf}', '${EndUnless}', '${AndIf}', '${AndUnless}',
- '${OrIf}', '${OrUnless}', '${IfThen}', '${IfCmd}', '${Select}', '${Case2}', '${Case3}',
- '${Case4}', '${Case5}', '${CaseElse}', '${Default}', '${EndSelect}', '${Switch}',
- '${Case}', '${EndSwitch}', '${Do}', '${DoWhile}', '${UntilWhile}', '${Continue}', '${Break}',
- '${Loop}', '${LoopWhile}', '${LoopUntil}', '${While}', '${ExitWhile}', '${EndWhile}', '${For}',
- '${ForEach}', '${ExitFor}', '${Next}', '${Abort}', '${Errors}', '${RebootFlag}', '${Silent}',
- '${FileExists}', '${Cmd}', '${SectionIsSelected}', '${SectionIsSectionGroup}',
- '${SectionIsSectionGroupEnd}', '${SectionIsBold}', '${SectionIsReadOnly}',
- '${SectionIsExpanded}', '${SectionIsPartiallySelected}'
- ),
- 10 => array(
- 'StrFunc.nsh', '${STRFUNC}', '${StrCase}', '${StrClb}', '${StrIOToNSIS}', '${StrLoc}', '${StrNSISToIO}', '${StrRep}',
- '${StrSort}', '${StrStr}', '${StrStrAdv}', '${StrTok}', '${StrTrimNewLines}'
- ),
- 11 => array(
- 'UpgradeDLL.nsh', 'UPGRADEDLL_INCLUDED', 'UpgradeDLL'
- ),
- 12 => array(
- 'Sections.nsh', 'SECTIONS_INCLUDED', '${SF_SELECTED}', '${SF_SECGRP}', '${SF_SUBSEC}', '${SF_SECGRPEND}',
- '${SF_SUBSECEND}', '${SF_BOLD}', '${SF_RO}', '${SF_EXPAND}', '${SF_PSELECTED}', '${SF_TOGGLED}',
- '${SF_NAMECHG}', '${SECTION_OFF}', 'SelectSection', 'UnselectSection', 'ReverseSection',
- 'StartRadioButtons', 'RadioButton', 'EndRadioButtons', '${INSTTYPE_0}', '${INSTTYPE_1}', '${INSTTYPE_2}',
- '${INSTTYPE_3}', '${INSTTYPE_4}', '${INSTTYPE_5}', '${INSTTYPE_6}', '${INSTTYPE_7}', '${INSTTYPE_8}',
- '${INSTTYPE_9}', '${INSTTYPE_10}', '${INSTTYPE_11}', '${INSTTYPE_12}', '${INSTTYPE_13}', '${INSTTYPE_14}',
- '${INSTTYPE_15}', '${INSTTYPE_16}', '${INSTTYPE_17}', '${INSTTYPE_18}', '${INSTTYPE_19}', '${INSTTYPE_20}',
- '${INSTTYPE_21}', '${INSTTYPE_22}', '${INSTTYPE_23}', '${INSTTYPE_24}', '${INSTTYPE_25}', '${INSTTYPE_26}',
- '${INSTTYPE_27}', '${INSTTYPE_28}', '${INSTTYPE_29}', '${INSTTYPE_30}', '${INSTTYPE_31}', '${INSTTYPE_32}',
- 'SetSectionInInstType', 'ClearSectionInInstType', 'SetSectionFlag', 'ClearSectionFlag', 'SectionFlagIsSet'
- ),
- 13 => array(
- 'Colors.nsh', 'WHITE', 'BLACK', 'YELLOW', 'RED', 'GREEN', 'BLUE', 'MAGENTA', 'CYAN', 'rgb2hex'
- ),
- 14 => array(
- 'FileFunc.nsh', '${Locate}', '${GetSize}', '${DriveSpace}', '${GetDrives}', '${GetTime}', '${GetFileAttributes}', '${GetFileVersion}', '${GetExeName}', '${GetExePath}', '${GetParameters}', '${GetOptions}', '${GetRoot}', '${GetParent}', '${GetFileName}', '${GetBaseName}', '${GetFileExt}', '${BannerTrimPath}', '${DirState}', '${RefreshShellIcons}'
- ),
- 15 => array(
- 'TextFunc.nsh', '${LineFind}', '${LineRead}', '${FileReadFromEnd}', '${LineSum}', '${FileJoin}', '${TextCompare}', '${ConfigRead}', '${ConfigWrite}', '${FileRecode}', '${TrimNewLines}'
- ),
- 16 => array(
- 'WordFunc.nsh', '${WordFind}', '${WordFind2X}', '${WordFind3X}', '${WordReplace}', '${WordAdd}', '${WordInsert}', '${StrFilter}', '${VersionCompare}', '${VersionConvert}'
- )
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => false,
- 9 => false,
- 10 => false,
- 11 => false,
- 12 => false,
- 13 => false,
- 14 => false,
- 15 => false,
- 16 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000066; font-weight:bold;',
- 2 => 'color: #000066;',
- 3 => 'color: #003366;',
- 4 => 'color: #000099;',
- 5 => 'color: #ff6600;',
- 6 => 'color: #ff6600;',
- 7 => 'color: #006600;',
- 8 => 'color: #006600;',
- 9 => 'color: #006600;',
- 10 => 'color: #006600;',
- 11 => 'color: #006600;',
- 12 => 'color: #006600;',
- 13 => 'color: #006600;',
- 14 => 'color: #006600;',
- 15 => 'color: #006600;',
- 16 => 'color: #006600;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #666666; font-style: italic;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #660066; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => ''
- ),
- 'STRINGS' => array(
- 0 => 'color: #660066;'
- ),
- 'NUMBERS' => array(
- 0 => ''
- ),
- 'METHODS' => array(
- 0 => ''
- ),
- 'SYMBOLS' => array(
- 0 => ''
- ),
- 'REGEXPS' => array(
- 0 => 'color: #660000;',
- 1 => 'color: #660000;',
- 2 => 'color: #660000;',
- 3 => 'color: #660000;',
- 4 => 'color: #660000;',
- 5 => 'color: #660000;',
- 6 => 'color: #660000;',
- 7 => 'color: #000099;',
- 8 => 'color: #003399;'
- ),
- 'SCRIPT' => array(
- 0 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => '',
- 9 => '',
- 10 => '',
- 11 => '',
- 12 => '',
- 13 => '',
- 14 => '',
- 15 => '',
- 16 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 0 => '\$\$',
- 1 => '\$\\r',
- 2 => '\$\\n',
- 3 => '\$\\t',
- 4 => '\$[a-zA-Z0-9_]+',
- 5 => '\$\{.{1,256}\}',
- 6 => '\$\\\(.{1,256}\\\)',
- 7 => array(
- GESHI_SEARCH => '([^:\/\\\*\?\"\<\>(?:<PIPE>)\s]*?)(::)([^:\/\\\*\?\"\<\>(?:<PIPE>)\s]*?)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => '\\2\\3'
- ),
- 8 => array(
- GESHI_SEARCH => '([^:\/\\\*\?\"\<\>(?:<PIPE>)\s]*?)(::)([^:\/\\\*\?\"\<\>(?:<PIPE>)]*?\s)',
- GESHI_REPLACE => '\\3',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1\\2',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/objc.php b/libvpx/examples/includes/geshi/geshi/objc.php
deleted file mode 100644
index 668f14b..0000000
--- a/libvpx/examples/includes/geshi/geshi/objc.php
+++ /dev/null
@@ -1,358 +0,0 @@
-<?php
-/*************************************************************************************
- * objc.php
- * --------
- * Author: M. Uli Kusterer (witness.of.teachtext@gmx.net)
- * Contributors: Quinn Taylor (quinntaylor@mac.com)
- * Copyright: (c) 2008 Quinn Taylor, 2004 M. Uli Kusterer, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * Objective-C language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/07/11 (1.0.8)
- * - Added support for @ before strings being highlighted
- * 2008/06/10 (1.0.7.22)
- * - Added keywords for Objective-C 2.0 (Leopard+).
- * - Changed colors to match Xcode 3 highlighting more closely.
- * - Updated API for AppKit and Foundation; added CoreData classes.
- * - Updated URLs for AppKit and Foundation; split classes and protocols.
- * - Sorted all keyword group in reverse-alpha order for correct matching.
- * - Changed all keyword groups to be case-sensitive.
- * 2004/11/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Objective-C',
- 'COMMENT_SINGLE' => array(
- //Compiler directives
- 1 => '#',
- //Single line C-Comments
- 2 => '//'
- ),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- //Multiline Continuation for single-line comment
- 2 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m',
- //Pseudo-Highlighting of the @-sign before strings
- 3 => "/@(?=\")/"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', "'"),
- 'ESCAPE_CHAR' => '\\',
-
- 'KEYWORDS' => array(
- // Objective-C keywords
- 1 => array(
- 'while', 'switch', 'return', 'in', 'if', 'goto', 'foreach', 'for',
- 'else', 'do', 'default', 'continue', 'case', '@try', '@throw',
- '@synthesize', '@synchronized', '@selector', '@public', '@protocol',
- '@protected', '@property', '@private', '@interface',
- '@implementation', '@finally', '@end', '@encode', '@defs', '@class',
- '@catch'
- ),
- // Macros and constants
- 2 => array(
- 'YES', 'USHRT_MAX', 'ULONG_MAX', 'UINT_MAX', 'UCHAR_MAX', 'true',
- 'TMP_MAX', 'stdout', 'stdin', 'stderr', 'SIGTERM', 'SIGSEGV',
- 'SIGINT', 'SIGILL', 'SIG_IGN', 'SIGFPE', 'SIG_ERR', 'SIG_DFL',
- 'SIGABRT', 'SHRT_MIN', 'SHRT_MAX', 'SEEK_SET', 'SEEK_END',
- 'SEEK_CUR', 'SCHAR_MIN', 'SCHAR_MAX', 'RAND_MAX', 'NULL',
- 'NO', 'nil', 'Nil', 'L_tmpnam', 'LONG_MIN', 'LONG_MAX',
- 'LDBL_MIN_EXP', 'LDBL_MIN', 'LDBL_MAX_EXP', 'LDBL_MAX',
- 'LDBL_MANT_DIG', 'LDBL_EPSILON', 'LDBL_DIG', 'INT_MIN', 'INT_MAX',
- 'HUGE_VAL', 'FOPEN_MAX', 'FLT_ROUNDS', 'FLT_RADIX', 'FLT_MIN_EXP',
- 'FLT_MIN', 'FLT_MAX_EXP', 'FLT_MAX', 'FLT_MANT_DIG', 'FLT_EPSILON',
- 'FLT_DIG', 'FILENAME_MAX', 'false', 'EXIT_SUCCESS', 'EXIT_FAILURE',
- 'errno', 'ERANGE', 'EOF', 'enum', 'EDOM', 'DBL_MIN_EXP', 'DBL_MIN',
- 'DBL_MAX_EXP', 'DBL_MAX', 'DBL_MANT_DIG', 'DBL_EPSILON', 'DBL_DIG',
- 'CLOCKS_PER_SEC', 'CHAR_MIN', 'CHAR_MAX', 'CHAR_BIT', 'BUFSIZ',
- 'break'
- ),
- // C standard library functions
- 3 => array(
- 'vsprintf', 'vprintf', 'vfprintf', 'va_start', 'va_end', 'va_arg',
- 'ungetc', 'toupper', 'tolower', 'tmpname', 'tmpfile', 'time',
- 'tanh', 'tan', 'system', 'strxfrm', 'strtoul', 'strtol', 'strtok',
- 'strtod', 'strstr', 'strspn', 'strrchr', 'strpbrk', 'strncpy',
- 'strncmp', 'strncat', 'strlen', 'strftime', 'strerror', 'strcspn',
- 'strcpy', 'strcoll', 'strcmp', 'strchr', 'strcat', 'sscanf',
- 'srand', 'sqrt', 'sprintf', 'snprintf', 'sizeof', 'sinh', 'sin',
- 'setvbuf', 'setjmp', 'setbuf', 'scanf', 'rewind', 'rename',
- 'remove', 'realloc', 'rand', 'qsort', 'puts', 'putchar', 'putc',
- 'printf', 'pow', 'perror', 'offsetof', 'modf', 'mktime', 'memset',
- 'memmove', 'memcpy', 'memcmp', 'memchr', 'malloc', 'longjmp',
- 'log10', 'log', 'localtime', 'ldiv', 'ldexp', 'labs', 'isxdigit',
- 'isupper', 'isspace', 'ispunct', 'isprint', 'islower',
- 'isgraph', 'isdigit', 'iscntrl', 'isalpha', 'isalnum', 'gmtime',
- 'gets', 'getenv', 'getchar', 'getc', 'fwrite', 'ftell', 'fsetpos',
- 'fseek', 'fscanf', 'frexp', 'freopen', 'free', 'fread', 'fputs',
- 'fputc', 'fprintf', 'fopen', 'fmod', 'floor', 'fgets', 'fgetpos',
- 'fgetc', 'fflush', 'ferror', 'feof', 'fclose', 'fabs', 'exp',
- 'exit', 'div', 'difftime', 'ctime', 'cosh', 'cos', 'clock',
- 'clearerr', 'ceil', 'calloc', 'bsearch', 'atol', 'atoi', 'atof',
- 'atexit', 'atan2', 'atan', 'assert', 'asin', 'asctime', 'acos',
- 'abs', 'abort'
- ),
- // Data types (C, Objective-C, Cocoa)
- 4 => array(
- 'volatile', 'void', 'va_list', 'unsigned', 'union', 'typedef', 'tm',
- 'time_t', 'struct', 'string', 'static', 'size_t',
- 'signed', 'signal', 'short', 'SEL', 'register', 'raise',
- 'ptrdiff_t', 'NSZone', 'NSRect', 'NSRange', 'NSPoint', 'long',
- 'ldiv_t', 'jmp_buf', 'int', 'IMP', 'id', 'fpos_t', 'float', 'FILE',
- 'extern', 'double', 'div_t', 'const', 'clock_t', 'Class', 'char',
- 'BOOL', 'auto'
- ),
- // Foundation classes
- 5 => array(
- 'NSXMLParser', 'NSXMLNode', 'NSXMLElement', 'NSXMLDTDNode',
- 'NSXMLDTD', 'NSXMLDocument', 'NSWhoseSpecifier',
- 'NSValueTransformer', 'NSValue', 'NSUserDefaults', 'NSURLResponse',
- 'NSURLRequest', 'NSURLProtocol', 'NSURLProtectionSpace',
- 'NSURLHandle', 'NSURLDownload', 'NSURLCredentialStorage',
- 'NSURLCredential', 'NSURLConnection', 'NSURLCache',
- 'NSURLAuthenticationChallenge', 'NSURL', 'NSUniqueIDSpecifier',
- 'NSUndoManager', 'NSUnarchiver', 'NSTimeZone', 'NSTimer',
- 'NSThread', 'NSTask', 'NSString', 'NSStream', 'NSSpellServer',
- 'NSSpecifierTest', 'NSSortDescriptor', 'NSSocketPortNameServer',
- 'NSSocketPort', 'NSSetCommand', 'NSSet', 'NSSerializer',
- 'NSScriptWhoseTest', 'NSScriptSuiteRegistry',
- 'NSScriptObjectSpecifier', 'NSScriptExecutionContext',
- 'NSScriptCommandDescription', 'NSScriptCommand',
- 'NSScriptCoercionHandler', 'NSScriptClassDescription', 'NSScanner',
- 'NSRunLoop', 'NSRelativeSpecifier', 'NSRecursiveLock',
- 'NSRangeSpecifier', 'NSRandomSpecifier', 'NSQuitCommand', 'NSProxy',
- 'NSProtocolChecker', 'NSPropertySpecifier',
- 'NSPropertyListSerialization', 'NSProcessInfo', 'NSPredicate',
- 'NSPositionalSpecifier', 'NSPortNameServer', 'NSPortMessage',
- 'NSPortCoder', 'NSPort', 'NSPointerFunctions', 'NSPointerArray',
- 'NSPipe', 'NSOutputStream', 'NSOperationQueue', 'NSOperation',
- 'NSObject', 'NSNumberFormatter', 'NSNumber', 'NSNull',
- 'NSNotificationQueue', 'NSNotificationCenter', 'NSNotification',
- 'NSNetServiceBrowser', 'NSNetService', 'NSNameSpecifier',
- 'NSMutableURLRequest', 'NSMutableString', 'NSMutableSet',
- 'NSMutableIndexSet', 'NSMutableDictionary', 'NSMutableData',
- 'NSMutableCharacterSet', 'NSMutableAttributedString',
- 'NSMutableArray', 'NSMoveCommand', 'NSMiddleSpecifier',
- 'NSMethodSignature', 'NSMetadataQueryResultGroup',
- 'NSMetadataQueryAttributeValueTuple', 'NSMetadataQuery',
- 'NSMetadataItem', 'NSMessagePortNameServer', 'NSMessagePort',
- 'NSMapTable', 'NSMachPort', 'NSMachBootstrapServer',
- 'NSLogicalTest', 'NSLock', 'NSLocale', 'NSKeyedUnarchiver',
- 'NSKeyedArchiver', 'NSInvocationOperation', 'NSInvocation',
- 'NSInputStream', 'NSIndexSpecifier', 'NSIndexSet', 'NSIndexPath',
- 'NSHTTPURLResponse', 'NSHTTPCookieStorage', 'NSHTTPCookie',
- 'NSHost', 'NSHashTable', 'NSGetCommand', 'NSGarbageCollector',
- 'NSFormatter', 'NSFileManager', 'NSFileHandle', 'NSExpression',
- 'NSExistsCommand', 'NSException', 'NSError', 'NSEnumerator',
- 'NSDistributedNotificationCenter', 'NSDistributedLock',
- 'NSDistantObjectRequest', 'NSDistantObject',
- 'NSDirectoryEnumerator', 'NSDictionary', 'NSDeserializer',
- 'NSDeleteCommand', 'NSDecimalNumberHandler', 'NSDecimalNumber',
- 'NSDateFormatter', 'NSDateComponents', 'NSDate', 'NSData',
- 'NSCreateCommand', 'NSCountedSet', 'NSCountCommand', 'NSConnection',
- 'NSConditionLock', 'NSCondition', 'NSCompoundPredicate',
- 'NSComparisonPredicate', 'NSCoder', 'NSCloseCommand',
- 'NSCloneCommand', 'NSClassDescription', 'NSCharacterSet',
- 'NSCalendarDate', 'NSCalendar', 'NSCachedURLResponse', 'NSBundle',
- 'NSAutoreleasePool', 'NSAttributedString', 'NSAssertionHandler',
- 'NSArray', 'NSArchiver', 'NSAppleScript', 'NSAppleEventManager',
- 'NSAppleEventDescriptor', 'NSAffineTransform'
- ),
- // Foundation protocols
- 6 => array(
- 'NSURLProtocolClient', 'NSURLHandleClient', 'NSURLClient',
- 'NSURLAuthenticationChallengeSender', 'NSScriptObjectSpecifiers',
- 'NSScriptKeyValueCoding', 'NSScriptingComparisonMethods',
- 'NSObjCTypeSerializationCallBack', 'NSMutableCopying',
- 'NSLocking', 'NSKeyValueObserving', 'NSKeyValueCoding',
- 'NSFastEnumeration', 'NSErrorRecoveryAttempting',
- 'NSDecimalNumberBehaviors', 'NSCopying', 'NSComparisonMethods',
- 'NSCoding'
- ),
- // AppKit classes
- 7 => array(
- 'NSWorkspace', 'NSWindowController', 'NSWindow', 'NSViewController',
- 'NSViewAnimation', 'NSView', 'NSUserDefaultsController',
- 'NSTypesetter', 'NSTreeNode', 'NSTreeController', 'NSTrackingArea',
- 'NSToolbarItemGroup', 'NSToolbarItem', 'NSToolbar',
- 'NSTokenFieldCell', 'NSTokenField', 'NSTextView',
- 'NSTextTableBlock', 'NSTextTable', 'NSTextTab', 'NSTextStorage',
- 'NSTextList', 'NSTextFieldCell', 'NSTextField', 'NSTextContainer',
- 'NSTextBlock', 'NSTextAttachmentCell', 'NSTextAttachment', 'NSText',
- 'NSTabViewItem', 'NSTabView', 'NSTableView', 'NSTableHeaderView',
- 'NSTableHeaderCell', 'NSTableColumn', 'NSStepperCell', 'NSStepper',
- 'NSStatusItem', 'NSStatusBar', 'NSSplitView', 'NSSpellChecker',
- 'NSSpeechSynthesizer', 'NSSpeechRecognizer', 'NSSound',
- 'NSSliderCell', 'NSSlider', 'NSSimpleHorizontalTypesetter',
- 'NSShadow', 'NSSegmentedControl', 'NSSegmentedCell',
- 'NSSecureTextFieldCell', 'NSSecureTextField', 'NSSearchFieldCell',
- 'NSSearchField', 'NSScrollView', 'NSScroller', 'NSScreen',
- 'NSSavePanel', 'NSRulerView', 'NSRulerMarker', 'NSRuleEditor',
- 'NSResponder', 'NSQuickDrawView', 'NSProgressIndicator',
- 'NSPrintPanel', 'NSPrintOperation', 'NSPrintInfo', 'NSPrinter',
- 'NSPredicateEditorRowTemplate', 'NSPredicateEditor',
- 'NSPopUpButtonCell', 'NSPopUpButton', 'NSPICTImageRep',
- 'NSPersistentDocument', 'NSPDFImageRep', 'NSPathControl',
- 'NSPathComponentCell', 'NSPathCell', 'NSPasteboard',
- 'NSParagraphStyle', 'NSPanel', 'NSPageLayout', 'NSOutlineView',
- 'NSOpenPanel', 'NSOpenGLView', 'NSOpenGLPixelFormat',
- 'NSOpenGLPixelBuffer', 'NSOpenGLContext', 'NSObjectController',
- 'NSNibOutletConnector', 'NSNibControlConnector', 'NSNibConnector',
- 'NSNib', 'NSMutableParagraphStyle', 'NSMovieView', 'NSMovie',
- 'NSMenuView', 'NSMenuItemCell', 'NSMenuItem', 'NSMenu', 'NSMatrix',
- 'NSLevelIndicatorCell', 'NSLevelIndicator', 'NSLayoutManager',
- 'NSInputServer', 'NSInputManager', 'NSImageView', 'NSImageRep',
- 'NSImageCell', 'NSImage', 'NSHelpManager', 'NSGraphicsContext',
- 'NSGradient', 'NSGlyphInfo', 'NSGlyphGenerator', 'NSFormCell',
- 'NSForm', 'NSFontPanel', 'NSFontManager', 'NSFontDescriptor',
- 'NSFont', 'NSFileWrapper', 'NSEvent', 'NSEPSImageRep', 'NSDrawer',
- 'NSDocumentController', 'NSDocument', 'NSDockTile',
- 'NSDictionaryController', 'NSDatePickerCell', 'NSDatePicker',
- 'NSCustomImageRep', 'NSCursor', 'NSController', 'NSControl',
- 'NSComboBoxCell', 'NSComboBox', 'NSColorWell', 'NSColorSpace',
- 'NSColorPicker', 'NSColorPanel', 'NSColorList', 'NSColor',
- 'NSCollectionViewItem', 'NSCollectionView', 'NSClipView',
- 'NSCIImageRep', 'NSCell', 'NSCachedImageRep', 'NSButtonCell',
- 'NSButton', 'NSBrowserCell', 'NSBrowser', 'NSBox',
- 'NSBitmapImageRep', 'NSBezierPath', 'NSATSTypesetter',
- 'NSArrayController', 'NSApplication', 'NSAnimationContext',
- 'NSAnimation', 'NSAlert', 'NSActionCell'
- ),
- // AppKit protocols
- 8 => array(
- 'NSWindowScripting', 'NSValidatedUserInterfaceItem',
- 'NSUserInterfaceValidations', 'NSToolTipOwner',
- 'NSToolbarItemValidation', 'NSTextInput',
- 'NSTableDataSource', 'NSServicesRequests',
- 'NSPrintPanelAccessorizing', 'NSPlaceholders',
- 'NSPathControlDelegate', 'NSPathCellDelegate',
- 'NSOutlineViewDataSource', 'NSNibAwaking', 'NSMenuValidation',
- 'NSKeyValueBindingCreation', 'NSInputServiceProvider',
- 'NSInputServerMouseTracker', 'NSIgnoreMisspelledWords',
- 'NSGlyphStorage', 'NSFontPanelValidation', 'NSEditorRegistration',
- 'NSEditor', 'NSDraggingSource', 'NSDraggingInfo',
- 'NSDraggingDestination', 'NSDictionaryControllerKeyValuePair',
- 'NSComboBoxDataSource', 'NSComboBoxCellDataSource',
- 'NSColorPickingDefault', 'NSColorPickingCustom', 'NSChangeSpelling',
- 'NSAnimatablePropertyContainer', 'NSAccessibility'
- ),
- // CoreData classes
- 9 => array(
- 'NSRelationshipDescription', 'NSPropertyMapping',
- 'NSPropertyDescription', 'NSPersistentStoreCoordinator',
- 'NSPersistentStore', 'NSMigrationManager', 'NSMappingModel',
- 'NSManagedObjectModel', 'NSManagedObjectID',
- 'NSManagedObjectContext', 'NSManagedObject',
- 'NSFetchRequestExpression', 'NSFetchRequest',
- 'NSFetchedPropertyDescription', 'NSEntityMigrationPolicy',
- 'NSEntityMapping', 'NSEntityDescription', 'NSAttributeDescription',
- 'NSAtomicStoreCacheNode', 'NSAtomicStore'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => true,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true,
- 9 => true
- ),
- // Define the colors for the groups listed above
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #a61390;', // Objective-C keywords
- 2 => 'color: #a61390;', // Macros and constants
- 3 => 'color: #a61390;', // C standard library functions
- 4 => 'color: #a61390;', // data types
- 5 => 'color: #400080;', // Foundation classes
- 6 => 'color: #2a6f76;', // Foundation protocols
- 7 => 'color: #400080;', // AppKit classes
- 8 => 'color: #2a6f76;', // AppKit protocols
- 9 => 'color: #400080;' // CoreData classes
- ),
- 'COMMENTS' => array(
- 1 => 'color: #6e371a;', // Preprocessor directives
- 2 => 'color: #11740a; font-style: italic;', // Normal C single-line comments
- 3 => 'color: #bf1d1a;', // Q-sign in front of Strings
- 'MULTI' => 'color: #11740a; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #2400d9;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #002200;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #bf1d1a;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #2400d9;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #002200;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.opengroup.org/onlinepubs/009695399/functions/{FNAME}.html',
- 4 => '',
- 5 => 'http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/{FNAME}_Class/',
- 6 => 'http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/{FNAME}_Protocol/',
- 7 => 'http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/{FNAME}_Class/',
- 8 => 'http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Protocols/{FNAME}_Protocol/',
- 9 => 'http://developer.apple.com/documentation/Cocoa/Reference/CoreDataFramework/Classes/{FNAME}_Class/'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/ocaml-brief.php b/libvpx/examples/includes/geshi/geshi/ocaml-brief.php
deleted file mode 100644
index 8c15519..0000000
--- a/libvpx/examples/includes/geshi/geshi/ocaml-brief.php
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-/*************************************************************************************
- * ocaml.php
- * ----------
- * Author: Flaie (fireflaie@gmail.com)
- * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2005/08/27
- *
- * OCaml (Objective Caml) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/08/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/08/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'OCaml (brief)',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('(*' => '*)'),
- 'CASE_KEYWORDS' => 0,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => "",
- 'KEYWORDS' => array(
- /* main OCaml keywords */
- 1 => array(
- 'and', 'as', 'asr', 'begin', 'class', 'closed', 'constraint', 'do', 'done', 'downto', 'else',
- 'end', 'exception', 'external', 'failwith', 'false', 'flush', 'for', 'fun', 'function', 'functor',
- 'if', 'in', 'include', 'inherit', 'incr', 'land', 'let', 'load', 'los', 'lsl', 'lsr', 'lxor',
- 'match', 'method', 'mod', 'module', 'mutable', 'new', 'not', 'of', 'open', 'option', 'or', 'parser',
- 'private', 'ref', 'rec', 'raise', 'regexp', 'sig', 'struct', 'stdout', 'stdin', 'stderr', 'then',
- 'to', 'true', 'try', 'type', 'val', 'virtual', 'when', 'while', 'with'
- )
- ),
- /* highlighting symbols is really important in OCaml */
- 'SYMBOLS' => array(
- ';', '!', ':', '.', '=', '%', '^', '*', '-', '/', '+',
- '>', '<', '(', ')', '[', ']', '&', '|', '#', "'"
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #06c; font-weight: bold;' /* nice blue */
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #5d478b; font-style: italic;' /* light purple */
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #6c6;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #3cb371;' /* nice green */
- ),
- 'NUMBERS' => array(
- 0 => 'color: #c6c;' /* pink */
- ),
- 'METHODS' => array(
- 1 => 'color: #060;' /* dark green */
- ),
- 'REGEXPS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #a52a2a;' /* maroon */
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/ocaml.php b/libvpx/examples/includes/geshi/geshi/ocaml.php
deleted file mode 100644
index e21ca7f..0000000
--- a/libvpx/examples/includes/geshi/geshi/ocaml.php
+++ /dev/null
@@ -1,174 +0,0 @@
-<?php
-/*************************************************************************************
- * ocaml.php
- * ----------
- * Author: Flaie (fireflaie@gmail.com)
- * Copyright: (c) 2005 Flaie, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2005/08/27
- *
- * OCaml (Objective Caml) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/03/29 (1.0.7.22)
- * - Fixed warnings resulting from missing style information
- * 2005/08/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/08/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'OCaml',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('(*' => '*)'),
- 'CASE_KEYWORDS' => 0,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => "",
- 'KEYWORDS' => array(
- /* main OCaml keywords */
- 1 => array(
- 'and', 'as', 'asr', 'begin', 'class', 'closed', 'constraint', 'do', 'done', 'downto', 'else',
- 'end', 'exception', 'external', 'failwith', 'false', 'for', 'fun', 'function', 'functor',
- 'if', 'in', 'include', 'inherit', 'incr', 'land', 'let', 'load', 'los', 'lsl', 'lsr', 'lxor',
- 'match', 'method', 'mod', 'module', 'mutable', 'new', 'not', 'of', 'open', 'option', 'or', 'parser',
- 'private', 'ref', 'rec', 'raise', 'regexp', 'sig', 'struct', 'stdout', 'stdin', 'stderr', 'then',
- 'to', 'true', 'try', 'type', 'val', 'virtual', 'when', 'while', 'with'
- ),
- /* define names of main librarys, so we can link to it */
- 2 => array(
- 'Arg', 'Arith_status', 'Array', 'ArrayLabels', 'Big_int', 'Bigarray', 'Buffer', 'Callback',
- 'CamlinternalOO', 'Char', 'Complex', 'Condition', 'Dbm', 'Digest', 'Dynlink', 'Event',
- 'Filename', 'Format', 'Gc', 'Genlex', 'Graphics', 'GraphicsX11', 'Hashtbl', 'Int32', 'Int64',
- 'Lazy', 'Lexing', 'List', 'ListLabels', 'Map', 'Marshal', 'MoreLabels', 'Mutex', 'Nativeint',
- 'Num', 'Obj', 'Oo', 'Parsing', 'Pervasives', 'Printexc', 'Printf', 'Queue', 'Random', 'Scanf',
- 'Set', 'Sort', 'Stack', 'StdLabels', 'Str', 'Stream', 'String', 'StringLabels', 'Sys', 'Thread',
- 'ThreadUnix', 'Tk'
- ),
- /* just link to the Pervasives functions library, cause it's the default opened library when starting OCaml */
- 3 => array(
- 'abs', 'abs_float', 'acos', 'asin', 'at_exit', 'atan', 'atan2',
- 'bool_of_string', 'ceil', 'char_of_int', 'classify_float',
- 'close_in', 'close_in_noerr', 'close_out', 'close_out_noerr',
- 'compare', 'cos', 'cosh', 'decr', 'epsilon_float', 'exit', 'exp',
- 'float', 'float_of_int', 'float_of_string', 'floor', 'flush',
- 'flush_all', 'format_of_string', 'frexp', 'fst', 'ignore',
- 'in_channel_length', 'infinity', 'input', 'input_binary_int',
- 'input_byte', 'input_char', 'input_line', 'input_value',
- 'int_of_char', 'int_of_float', 'int_of_string', 'invalid_arg',
- 'ldexp', 'log', 'log10', 'max', 'max_float', 'max_int', 'min',
- 'min_float', 'min_int', 'mod_float', 'modf', 'nan', 'open_in',
- 'open_in_bin', 'open_in_gen', 'open_out', 'open_out_bin',
- 'open_out_gen', 'out_channel_length', 'output', 'output_binary_int',
- 'output_byte', 'output_char', 'output_string', 'output_value',
- 'pos_in', 'pos_out', 'pred', 'prerr_char', 'prerr_endline',
- 'prerr_float', 'prerr_int', 'prerr_newline', 'prerr_string',
- 'print_char', 'print_endline', 'print_float', 'print_int',
- 'print_newline', 'print_string', 'read_float', 'read_int',
- 'read_line', 'really_input', 'seek_in', 'seek_out',
- 'set_binary_mode_in', 'set_binary_mode_out', 'sin', 'sinh', 'snd',
- 'sqrt', 'string_of_bool', 'string_of_float', 'string_of_format',
- 'string_of_int', 'succ', 'tan', 'tanh', 'truncate'
- ),
- /* here Pervasives Types */
- 4 => array (
- 'fpclass', 'in_channel', 'out_channel', 'open_flag', 'Sys_error', 'format'
- ),
- /* finally Pervasives Exceptions */
- 5 => array (
- 'Exit', 'Invalid_Argument', 'Failure', 'Division_by_zero'
- )
- ),
- /* highlighting symbols is really important in OCaml */
- 'SYMBOLS' => array(
- ';', '!', ':', '.', '=', '%', '^', '*', '-', '/', '+',
- '>', '<', '(', ')', '[', ']', '&', '|', '#', "'"
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => true, /* functions name are case sensitive */
- 3 => true, /* types name too */
- 4 => true, /* pervasives types */
- 5 => true /* pervasives exceptions */
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #06c; font-weight: bold;', /* nice blue */
- 2 => 'color: #06c; font-weight: bold;', /* nice blue */
- 3 => 'color: #06c; font-weight: bold;', /* nice blue */
- 4 => 'color: #06c; font-weight: bold;', /* nice blue */
- 5 => 'color: #06c; font-weight: bold;' /* nice blue */
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #5d478b; font-style: italic;' /* light purple */
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #6c6;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #3cb371;' /* nice green */
- ),
- 'NUMBERS' => array(
- 0 => 'color: #c6c;' /* pink */
- ),
- 'METHODS' => array(
- 1 => 'color: #060;' /* dark green */
- ),
- 'REGEXPS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #a52a2a;' /* maroon */
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- /* some of keywords are Pervasives functions (land, lxor, asr, ...) */
- 1 => '',
- /* link to the wanted library */
- 2 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/{FNAME}.html',
- /* link to Pervasives functions */
- 3 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#VAL{FNAME}',
- /* link to Pervasives type */
- 4 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#TYPE{FNAME}',
- /* link to Pervasives exceptions */
- 5 => 'http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#EXCEPTION{FNAME}'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/oobas.php b/libvpx/examples/includes/geshi/geshi/oobas.php
deleted file mode 100644
index 5ca65cd..0000000
--- a/libvpx/examples/includes/geshi/geshi/oobas.php
+++ /dev/null
@@ -1,135 +0,0 @@
-<?php
-/*************************************************************************************
- * oobas.php
- * ---------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * OpenOffice.org Basic language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'OpenOffice.org Basic',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array(),
- //Single-Line comments using REM keyword
- 'COMMENT_REGEXP' => array(2 => '/\bREM.*?$/i'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'dim','private','public','global','as','if','redim','true','set','byval',
- 'false','bool','double','integer','long','object','single','variant',
- 'msgbox','print','inputbox','green','blue','red','qbcolor',
- 'rgb','open','close','reset','freefile','get','input','line',
- 'put','write','loc','seek','eof','lof','chdir','chdrive',
- 'curdir','dir','fileattr','filecopy','filedatetime','fileexists',
- 'filelen','getattr','kill','mkdir','name','rmdir','setattr',
- 'dateserial','datevalue','day','month','weekday','year','cdatetoiso',
- 'cdatefromiso','hour','minute','second','timeserial','timevalue',
- 'date','now','time','timer','erl','err','error','on','goto','resume',
- 'and','eqv','imp','not','or','xor','mod','atn','cos','sin','tan','log',
- 'exp','rnd','randomize','sqr','fix','int','abs','sgn','hex','oct',
- 'it','then','else','select','case','iif','do','loop','for','next','to',
- 'while','wend','gosub','return','call','choose','declare',
- 'end','exit','freelibrary','function','rem','stop','sub','switch','with',
- 'cbool','cdate','cdbl','cint','clng','const','csng','cstr','defbool',
- 'defdate','defdbl','defint','deflng','asc','chr','str','val','cbyte',
- 'space','string','format','lcase','left','lset','ltrim','mid','right',
- 'rset','rtrim','trim','ucase','split','join','converttourl','convertfromurl',
- 'instr','len','strcomp','beep','shell','wait','getsystemticks','environ',
- 'getsolarversion','getguitype','twipsperpixelx','twipsperpixely',
- 'createunostruct','createunoservice','getprocessservicemanager',
- 'createunodialog','createunolistener','createunovalue','thiscomponent',
- 'globalscope'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080;',
- 2 => 'color: #808080;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/oracle11.php b/libvpx/examples/includes/geshi/geshi/oracle11.php
deleted file mode 100644
index 7d267b1..0000000
--- a/libvpx/examples/includes/geshi/geshi/oracle11.php
+++ /dev/null
@@ -1,614 +0,0 @@
-<?php
-/*************************************************************************************
- * oracle11.php
- * -----------
- * Author: Guy Wicks (Guy.Wicks@rbs.co.uk)
- * Contributions:
- * - Updated for 11i by Simon Redhead
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * Oracle 11i language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/04/08 (1.0.8)
- * - SR changes to oracle8.php to support Oracle 11i reserved words.
- * 2005/01/29 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Oracle 11 SQL',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array("'", '"', '`'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
-//Put your package names here - e.g. select distinct ''''|| lower(name) || ''',' from user_source;
-// 6 => array(
-// ),
-
-//Put your table names here - e.g. select distinct ''''|| lower(table_name) || ''',' from user_tables;
-// 5 => array(
-// ),
-
-//Put your view names here - e.g. select distinct ''''|| lower(view_name) || ''',' from user_views;
-// 4 => array(
-// ),
-
-//Put your table field names here - e.g. select distinct ''''|| lower(column_name) || ''',' from user_tab_columns;
-// 3 => array(
-// ),
-
- //Put ORACLE reserved keywords here (11i). I like mine uppercase.
- 1 => array(
- 'ABS',
- 'ACCESS',
- 'ACOS',
- 'ADD',
- 'ADD_MONTHS',
- 'ALL',
- 'ALTER',
- 'ANALYZE',
- 'AND',
- 'ANY',
- 'APPENDCHILDXML',
- 'ARRAY',
- 'AS',
- 'ASC',
- 'ASCII',
- 'ASCIISTR',
- 'ASIN',
- 'ASSOCIATE',
- 'AT',
- 'ATAN',
- 'ATAN2',
- 'AUDIT',
- 'AUTHID',
- 'AVG',
- 'BEGIN',
- 'BETWEEN',
- 'BFILENAME',
- 'BIN_TO_NUM',
- 'BINARY_INTEGER',
- 'BITAND',
- 'BODY',
- 'BOOLEAN',
- 'BULK',
- 'BY',
- 'CALL',
- 'CARDINALITY',
- 'CASCADE',
- 'CASE',
- 'CAST',
- 'CEIL',
- 'CHAR',
- 'CHAR_BASE',
- 'CHARTOROWID',
- 'CHECK',
- 'CHR',
- 'CLOSE',
- 'CLUSTER',
- 'CLUSTER_ID',
- 'CLUSTER_PROBABILITY',
- 'CLUSTER_SET',
- 'COALESCE',
- 'COLLECT',
- 'COLUMN',
- 'COMMENT',
- 'COMMIT',
- 'COMPOSE',
- 'COMPRESS',
- 'CONCAT',
- 'CONNECT',
- 'CONSTANT',
- 'CONSTRAINT',
- 'CONSTRAINTS',
- 'CONTEXT',
- 'CONTROLFILE',
- 'CONVERT',
- 'CORR',
- 'CORR_K',
- 'CORR_S',
- 'COS',
- 'COSH',
- 'COST',
- 'COUNT',
- 'COVAR_POP',
- 'COVAR_SAMP',
- 'CREATE',
- 'CUBE_TABLE',
- 'CUME_DIST',
- 'CURRENT',
- 'CURRENT_DATE',
- 'CURRENT_TIMESTAMP',
- 'CURRVAL',
- 'CURSOR',
- 'CV',
- 'DATABASE',
- 'DATAOBJ_TO_PARTITION',
- 'DATE',
- 'DAY',
- 'DBTIMEZONE',
- 'DECIMAL',
- 'DECLARE',
- 'DECODE',
- 'DECOMPOSE',
- 'DEFAULT',
- 'DELETE',
- 'DELETEXML',
- 'DENSE_RANK',
- 'DEPTH',
- 'DEREF',
- 'DESC',
- 'DIMENSION',
- 'DIRECTORY',
- 'DISASSOCIATE',
- 'DISTINCT',
- 'DO',
- 'DROP',
- 'DUMP',
- 'ELSE',
- 'ELSIF',
- 'EMPTY_BLOB',
- 'EMPTY_CLOB',
- 'END',
- 'EXCEPTION',
- 'EXCLUSIVE',
- 'EXEC',
- 'EXECUTE',
- 'EXISTS',
- 'EXISTSNODE',
- 'EXIT',
- 'EXP',
- 'EXPLAIN',
- 'EXTENDS',
- 'EXTRACT',
- 'EXTRACTVALUE',
- 'FALSE',
- 'FEATURE_ID',
- 'FEATURE_SET',
- 'FEATURE_VALUE',
- 'FETCH',
- 'FILE',
- 'FIRST',
- 'FIRST_VALUE',
- 'FLOAT',
- 'FLOOR',
- 'FOR',
- 'FORALL',
- 'FROM',
- 'FROM_TZ',
- 'FUNCTION',
- 'GOTO',
- 'GRANT',
- 'GREATEST',
- 'GROUP',
- 'GROUP_ID',
- 'GROUPING',
- 'GROUPING_ID',
- 'HAVING',
- 'HEAP',
- 'HEXTORAW',
- 'HOUR',
- 'IDENTIFIED',
- 'IF',
- 'IMMEDIATE',
- 'IN',
- 'INCREMENT',
- 'INDEX',
- 'INDEXTYPE',
- 'INDICATOR',
- 'INITCAP',
- 'INITIAL',
- 'INSERT',
- 'INSERTCHILDXML',
- 'INSERTXMLBEFORE',
- 'INSTR',
- 'INSTRB',
- 'INTEGER',
- 'INTERFACE',
- 'INTERSECT',
- 'INTERVAL',
- 'INTO',
- 'IS',
- 'ISOLATION',
- 'ITERATION_NUMBER',
- 'JAVA',
- 'KEY',
- 'LAG',
- 'LAST',
- 'LAST_DAY',
- 'LAST_VALUE',
- 'LEAD',
- 'LEAST',
- 'LENGTH',
- 'LENGTHB',
- 'LEVEL',
- 'LIBRARY',
- 'LIKE',
- 'LIMITED',
- 'LINK',
- 'LN',
- 'LNNVL',
- 'LOCALTIMESTAMP',
- 'LOCK',
- 'LOG',
- 'LONG',
- 'LOOP',
- 'LOWER',
- 'LPAD',
- 'LTRIM',
- 'MAKE_REF',
- 'MATERIALIZED',
- 'MAX',
- 'MAXEXTENTS',
- 'MEDIAN',
- 'MIN',
- 'MINUS',
- 'MINUTE',
- 'MLSLABEL',
- 'MOD',
- 'MODE',
- 'MODIFY',
- 'MONTH',
- 'MONTHS_BETWEEN',
- 'NANVL',
- 'NATURAL',
- 'NATURALN',
- 'NCHR',
- 'NEW',
- 'NEW_TIME',
- 'NEXT_DAY',
- 'NEXTVAL',
- 'NLS_CHARSET_DECL_LEN',
- 'NLS_CHARSET_ID',
- 'NLS_CHARSET_NAME',
- 'NLS_INITCAP',
- 'NLS_LOWER',
- 'NLS_UPPER',
- 'NLSSORT',
- 'NOAUDIT',
- 'NOCOMPRESS',
- 'NOCOPY',
- 'NOT',
- 'NOWAIT',
- 'NTILE',
- 'NULL',
- 'NULLIF',
- 'NUMBER',
- 'NUMBER_BASE',
- 'NUMTODSINTERVAL',
- 'NUMTOYMINTERVAL',
- 'NVL',
- 'NVL2',
- 'OCIROWID',
- 'OF',
- 'OFFLINE',
- 'ON',
- 'ONLINE',
- 'OPAQUE',
- 'OPEN',
- 'OPERATOR',
- 'OPTION',
- 'OR',
- 'ORA_HASH',
- 'ORDER',
- 'ORGANIZATION',
- 'OTHERS',
- 'OUT',
- 'OUTLINE',
- 'PACKAGE',
- 'PARTITION',
- 'PATH',
- 'PCTFREE',
- 'PERCENT_RANK',
- 'PERCENTILE_CONT',
- 'PERCENTILE_DISC',
- 'PLAN',
- 'PLS_INTEGER',
- 'POSITIVE',
- 'POSITIVEN',
- 'POWER',
- 'POWERMULTISET',
- 'POWERMULTISET_BY_CARDINALITY',
- 'PRAGMA',
- 'PREDICTION',
- 'PREDICTION_BOUNDS',
- 'PREDICTION_COST',
- 'PREDICTION_DETAILS',
- 'PREDICTION_PROBABILITY',
- 'PREDICTION_SET',
- 'PRESENTNNV',
- 'PRESENTV',
- 'PREVIOUS',
- 'PRIMARY',
- 'PRIOR',
- 'PRIVATE',
- 'PRIVILEGES',
- 'PROCEDURE',
- 'PROFILE',
- 'PUBLIC',
- 'RAISE',
- 'RANGE',
- 'RANK',
- 'RATIO_TO_REPORT',
- 'RAW',
- 'RAWTOHEX',
- 'RAWTONHEX',
- 'REAL',
- 'RECORD',
- 'REF',
- 'REFTOHEX',
- 'REGEXP_COUNT',
- 'REGEXP_INSTR',
- 'REGEXP_REPLACE',
- 'REGEXP_SUBSTR',
- 'REGR_AVGX',
- 'REGR_AVGY',
- 'REGR_COUNT',
- 'REGR_INTERCEPT',
- 'REGR_R2',
- 'REGR_SLOPE',
- 'REGR_SXX',
- 'REGR_SXY',
- 'REGR_SYY',
- 'RELEASE',
- 'REMAINDER',
- 'RENAME',
- 'REPLACE',
- 'RESOURCE',
- 'RETURN',
- 'RETURNING',
- 'REVERSE',
- 'REVOKE',
- 'ROLE',
- 'ROLLBACK',
- 'ROUND',
- 'ROW',
- 'ROW_NUMBER',
- 'ROWID',
- 'ROWIDTOCHAR',
- 'ROWIDTONCHAR',
- 'ROWNUM',
- 'ROWS',
- 'ROWTYPE',
- 'RPAD',
- 'RTRIM',
- 'SAVEPOINT',
- 'SCHEMA',
- 'SCN_TO_TIMESTAMP',
- 'SECOND',
- 'SEGMENT',
- 'SELECT',
- 'SEPERATE',
- 'SEQUENCE',
- 'SESSION',
- 'SESSIONTIMEZONE',
- 'SET',
- 'SHARE',
- 'SIGN',
- 'SIN',
- 'SINH',
- 'SIZE',
- 'SMALLINT',
- 'SOUNDEX',
- 'SPACE',
- 'SQL',
- 'SQLCODE',
- 'SQLERRM',
- 'SQRT',
- 'START',
- 'STATISTICS',
- 'STATS_BINOMIAL_TEST',
- 'STATS_CROSSTAB',
- 'STATS_F_TEST',
- 'STATS_KS_TEST',
- 'STATS_MODE',
- 'STATS_MW_TEST',
- 'STATS_ONE_WAY_ANOVA',
- 'STATS_T_TEST_INDEP',
- 'STATS_T_TEST_INDEPU',
- 'STATS_T_TEST_ONE',
- 'STATS_T_TEST_PAIRED',
- 'STATS_WSR_TEST',
- 'STDDEV',
- 'STDDEV_POP',
- 'STDDEV_SAMP',
- 'STOP',
- 'SUBSTR',
- 'SUBSTRB',
- 'SUBTYPE',
- 'SUCCESSFUL',
- 'SUM',
- 'SYNONYM',
- 'SYS_CONNECT_BY_PATH',
- 'SYS_CONTEXT',
- 'SYS_DBURIGEN',
- 'SYS_EXTRACT_UTC',
- 'SYS_GUID',
- 'SYS_TYPEID',
- 'SYS_XMLAGG',
- 'SYS_XMLGEN',
- 'SYSDATE',
- 'SYSTEM',
- 'SYSTIMESTAMP',
- 'TABLE',
- 'TABLESPACE',
- 'TAN',
- 'TANH',
- 'TEMPORARY',
- 'THEN',
- 'TIME',
- 'TIMESTAMP',
- 'TIMESTAMP_TO_SCN',
- 'TIMEZONE_ABBR',
- 'TIMEZONE_HOUR',
- 'TIMEZONE_MINUTE',
- 'TIMEZONE_REGION',
- 'TIMING',
- 'TO',
- 'TO_BINARY_DOUBLE',
- 'TO_BINARY_FLOAT',
- 'TO_CHAR',
- 'TO_CLOB',
- 'TO_DATE',
- 'TO_DSINTERVAL',
- 'TO_LOB',
- 'TO_MULTI_BYTE',
- 'TO_NCHAR',
- 'TO_NCLOB',
- 'TO_NUMBER',
- 'TO_SINGLE_BYTE',
- 'TO_TIMESTAMP',
- 'TO_TIMESTAMP_TZ',
- 'TO_YMINTERVAL',
- 'TRANSACTION',
- 'TRANSLATE',
- 'TREAT',
- 'TRIGGER',
- 'TRIM',
- 'TRUE',
- 'TRUNC',
- 'TRUNCATE',
- 'TYPE',
- 'TZ_OFFSET',
- 'UI',
- 'UID',
- 'UNION',
- 'UNIQUE',
- 'UNISTR',
- 'UPDATE',
- 'UPDATEXML',
- 'UPPER',
- 'USE',
- 'USER',
- 'USERENV',
- 'USING',
- 'VALIDATE',
- 'VALUE',
- 'VALUES',
- 'VAR_POP',
- 'VAR_SAMP',
- 'VARCHAR',
- 'VARCHAR2',
- 'VARIANCE',
- 'VIEW',
- 'VSIZE',
- 'WHEN',
- 'WHENEVER',
- 'WHERE',
- 'WHILE',
- 'WIDTH_BUCKET',
- 'WITH',
- 'WORK',
- 'WRITE',
- 'XMLAGG',
- 'XMLCAST',
- 'XMLCDATA',
- 'XMLCOLATTVAL',
- 'XMLCOMMENT',
- 'XMLCONCAT',
- 'XMLDIFF',
- 'XMLELEMENT',
- 'XMLEXISTS',
- 'XMLFOREST',
- 'XMLPARSE',
- 'XMLPATCH',
- 'XMLPI',
- 'XMLQUERY',
- 'XMLROOT',
- 'XMLSEQUENCE',
- 'XMLSERIALIZE',
- 'XMLTABLE',
- 'XMLTRANSFORM',
- 'YEAR',
- 'ZONE'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '=', '<', '>', '|', '+', '-', '*', '/', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
-// 3 => false,
-// 4 => false,
-// 5 => false,
-// 6 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #993333; font-weight: bold; text-transform: uppercase;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #ff0000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
-// 3 => '',
-// 4 => '',
-// 5 => '',
-// 6 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/oracle8.php b/libvpx/examples/includes/geshi/geshi/oracle8.php
deleted file mode 100644
index d54b1e3..0000000
--- a/libvpx/examples/includes/geshi/geshi/oracle8.php
+++ /dev/null
@@ -1,496 +0,0 @@
-<?php
-/*************************************************************************************
- * oracle8.php
- * -----------
- * Author: Guy Wicks (Guy.Wicks@rbs.co.uk)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * Oracle 8 language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/01/29 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Oracle 8 SQL',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array("'", '"', '`'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
-//Put your package names here - e.g. select distinct ''''|| lower(name) || ''',' from user_source;
-// 6 => array(
-// ),
-
-//Put your table names here - e.g. select distinct ''''|| lower(table_name) || ''',' from user_tables;
-// 5 => array(
-// ),
-
-//Put your view names here - e.g. select distinct ''''|| lower(view_name) || ''',' from user_views;
-// 4 => array(
-// ),
-
-//Put your table field names here - e.g. select distinct ''''|| lower(column_name) || ''',' from user_tab_columns;
-// 3 => array(
-// ),
-
-//Put ORACLE reserved keywords here (8.1.7). I like mine uppercase.
- 1 => array(
- 'ABS',
- 'ACCESS',
- 'ACOS',
- 'ADD',
- 'ADD_MONTHS',
- 'ALL',
- 'ALTER',
- 'ANALYZE',
- 'AND',
- 'ANY',
- 'ARRAY',
- 'AS',
- 'ASC',
- 'ASCII',
- 'ASIN',
- 'ASSOCIATE',
- 'AT',
- 'ATAN',
- 'ATAN2',
- 'AUDIT',
- 'AUTHID',
- 'AVG',
- 'BEGIN',
- 'BETWEEN',
- 'BFILENAME',
- 'BINARY_INTEGER',
- 'BITAND',
- 'BODY',
- 'BOOLEAN',
- 'BULK',
- 'BY',
- 'CALL',
- 'CASCADE',
- 'CASE',
- 'CEIL',
- 'CHAR',
- 'CHAR_BASE',
- 'CHARTOROWID',
- 'CHECK',
- 'CHR',
- 'CLOSE',
- 'CLUSTER',
- 'COALESCE',
- 'COLLECT',
- 'COLUMN',
- 'COMMENT',
- 'COMMIT',
- 'COMPRESS',
- 'CONCAT',
- 'CONNECT',
- 'CONSTANT',
- 'CONSTRAINT',
- 'CONSTRAINTS',
- 'CONTEXT',
- 'CONTROLFILE',
- 'CONVERT',
- 'CORR',
- 'COS',
- 'COSH',
- 'COST',
- 'COUNT',
- 'COVAR_POP',
- 'COVAR_SAMP',
- 'CREATE',
- 'CUME_DIST',
- 'CURRENT',
- 'CURRVAL',
- 'CURSOR',
- 'DATABASE',
- 'DATE',
- 'DAY',
- 'DECIMAL',
- 'DECLARE',
- 'DECODE',
- 'DEFAULT',
- 'DELETE',
- 'DENSE_RANK',
- 'DEREF',
- 'DESC',
- 'DIMENSION',
- 'DIRECTORY',
- 'DISASSOCIATE',
- 'DISTINCT',
- 'DO',
- 'DROP',
- 'DUMP',
- 'ELSE',
- 'ELSIF',
- 'EMPTY_BLOB',
- 'EMPTY_CLOB',
- 'END',
- 'EXCEPTION',
- 'EXCLUSIVE',
- 'EXEC',
- 'EXECUTE',
- 'EXISTS',
- 'EXIT',
- 'EXP',
- 'EXPLAIN',
- 'EXTENDS',
- 'EXTRACT',
- 'FALSE',
- 'FETCH',
- 'FILE',
- 'FIRST_VALUE',
- 'FLOAT',
- 'FLOOR',
- 'FOR',
- 'FORALL',
- 'FROM',
- 'FUNCTION',
- 'GOTO',
- 'GRANT',
- 'GREATEST',
- 'GROUP',
- 'GROUPING',
- 'HAVING',
- 'HEAP',
- 'HEXTORAW',
- 'HOUR',
- 'IDENTIFIED',
- 'IF',
- 'IMMEDIATE',
- 'IN',
- 'INCREMENT',
- 'INDEX',
- 'INDEXTYPE',
- 'INDICATOR',
- 'INITCAP',
- 'INITIAL',
- 'INSERT',
- 'INSTR',
- 'INSTRB',
- 'INTEGER',
- 'INTERFACE',
- 'INTERSECT',
- 'INTERVAL',
- 'INTO',
- 'IS',
- 'ISOLATION',
- 'JAVA',
- 'KEY',
- 'LAG',
- 'LAST_DAY',
- 'LAST_VALUE',
- 'LEAD',
- 'LEAST',
- 'LENGTH',
- 'LENGTHB',
- 'LEVEL',
- 'LIBRARY',
- 'LIKE',
- 'LIMITED',
- 'LINK',
- 'LN',
- 'LOCK',
- 'LOG',
- 'LONG',
- 'LOOP',
- 'LOWER',
- 'LPAD',
- 'LTRIM',
- 'MAKE_REF',
- 'MATERIALIZED',
- 'MAX',
- 'MAXEXTENTS',
- 'MIN',
- 'MINUS',
- 'MINUTE',
- 'MLSLABEL',
- 'MOD',
- 'MODE',
- 'MODIFY',
- 'MONTH',
- 'MONTHS_BETWEEN',
- 'NATURAL',
- 'NATURALN',
- 'NEW',
- 'NEW_TIME',
- 'NEXT_DAY',
- 'NEXTVAL',
- 'NLS_CHARSET_DECL_LEN',
- 'NLS_CHARSET_ID',
- 'NLS_CHARSET_NAME',
- 'NLS_INITCAP',
- 'NLS_LOWER',
- 'NLS_UPPER',
- 'NLSSORT',
- 'NOAUDIT',
- 'NOCOMPRESS',
- 'NOCOPY',
- 'NOT',
- 'NOWAIT',
- 'NTILE',
- 'NULL',
- 'NULLIF',
- 'NUMBER',
- 'NUMBER_BASE',
- 'NUMTODSINTERVAL',
- 'NUMTOYMINTERVAL',
- 'NVL',
- 'NVL2',
- 'OCIROWID',
- 'OF',
- 'OFFLINE',
- 'ON',
- 'ONLINE',
- 'OPAQUE',
- 'OPEN',
- 'OPERATOR',
- 'OPTION',
- 'OR',
- 'ORDER',
- 'ORGANIZATION',
- 'OTHERS',
- 'OUT',
- 'OUTLINE',
- 'PACKAGE',
- 'PARTITION',
- 'PCTFREE',
- 'PERCENT_RANK',
- 'PLAN',
- 'PLS_INTEGER',
- 'POSITIVE',
- 'POSITIVEN',
- 'POWER',
- 'PRAGMA',
- 'PRIMARY',
- 'PRIOR',
- 'PRIVATE',
- 'PRIVILEGES',
- 'PROCEDURE',
- 'PROFILE',
- 'PUBLIC',
- 'RAISE',
- 'RANGE',
- 'RANK',
- 'RATIO_TO_REPORT',
- 'RAW',
- 'RAWTOHEX',
- 'REAL',
- 'RECORD',
- 'REF',
- 'REFTOHEX',
- 'REGR_AVGX',
- 'REGR_AVGY',
- 'REGR_COUNT',
- 'REGR_INTERCEPT',
- 'REGR_R2',
- 'REGR_SLOPE',
- 'REGR_SXX',
- 'REGR_SXY',
- 'REGR_SYY',
- 'RELEASE',
- 'RENAME',
- 'REPLACE',
- 'RESOURCE',
- 'RETURN',
- 'RETURNING',
- 'REVERSE',
- 'REVOKE',
- 'ROLE',
- 'ROLLBACK',
- 'ROUND',
- 'ROW',
- 'ROW_NUMBER',
- 'ROWID',
- 'ROWIDTOCHAR',
- 'ROWNUM',
- 'ROWS',
- 'ROWTYPE',
- 'RPAD',
- 'RTRIM',
- 'SAVEPOINT',
- 'SCHEMA',
- 'SECOND',
- 'SEGMENT',
- 'SELECT',
- 'SEPERATE',
- 'SEQUENCE',
- 'SESSION',
- 'SET',
- 'SHARE',
- 'SIGN',
- 'SIN',
- 'SINH',
- 'SIZE',
- 'SMALLINT',
- 'SOUNDEX',
- 'SPACE',
- 'SQL',
- 'SQLCODE',
- 'SQLERRM',
- 'SQRT',
- 'START',
- 'STATISTICS',
- 'STDDEV',
- 'STDDEV_POP',
- 'STDDEV_SAMP',
- 'STOP',
- 'SUBSTR',
- 'SUBSTRB',
- 'SUBTYPE',
- 'SUCCESSFUL',
- 'SUM',
- 'SYNONYM',
- 'SYS_CONTEXT',
- 'SYS_GUID',
- 'SYSDATE',
- 'SYSTEM',
- 'TABLE',
- 'TABLESPACE',
- 'TAN',
- 'TANH',
- 'TEMPORARY',
- 'THEN',
- 'TIME',
- 'TIMESTAMP',
- 'TIMEZONE_ABBR',
- 'TIMEZONE_HOUR',
- 'TIMEZONE_MINUTE',
- 'TIMEZONE_REGION',
- 'TIMING',
- 'TO',
- 'TO_CHAR',
- 'TO_DATE',
- 'TO_LOB',
- 'TO_MULTI_BYTE',
- 'TO_NUMBER',
- 'TO_SINGLE_BYTE',
- 'TRANSACTION',
- 'TRANSLATE',
- 'TRIGGER',
- 'TRIM',
- 'TRUE',
- 'TRUNC',
- 'TRUNCATE',
- 'TYPE',
- 'UI',
- 'UID',
- 'UNION',
- 'UNIQUE',
- 'UPDATE',
- 'UPPER',
- 'USE',
- 'USER',
- 'USERENV',
- 'USING',
- 'VALIDATE',
- 'VALUE',
- 'VALUES',
- 'VAR_POP',
- 'VAR_SAMP',
- 'VARCHAR',
- 'VARCHAR2',
- 'VARIANCE',
- 'VIEW',
- 'VSIZE',
- 'WHEN',
- 'WHENEVER',
- 'WHERE',
- 'WHILE',
- 'WITH',
- 'WORK',
- 'WRITE',
- 'YEAR',
- 'ZONE'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '=', '<', '>', '|', '+', '-', '*', '/', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
-// 3 => false,
-// 4 => false,
-// 5 => false,
-// 6 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #993333; font-weight: bold; text-transform: uppercase;'
-//Add the styles for groups 3-6 here when used
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #ff0000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
-// 3 => '',
-// 4 => '',
-// 5 => '',
-// 6 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/pascal.php b/libvpx/examples/includes/geshi/geshi/pascal.php
deleted file mode 100644
index d2acd0f..0000000
--- a/libvpx/examples/includes/geshi/geshi/pascal.php
+++ /dev/null
@@ -1,152 +0,0 @@
-<?php
-/*************************************************************************************
- * pascal.php
- * ----------
- * Author: Tux (tux@inamil.cz)
- * Copyright: (c) 2004 Tux (http://tux.a4.cz/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/26
- *
- * Pascal language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.2)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.1)
- * - Added support for URLs
- * 2004/08/05 (1.0.0)
- * - Added support for symbols
- * 2004/07/27 (0.9.1)
- * - Pascal is OO language. Some new words.
- * 2004/07/26 (0.9.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Pascal',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('{' => '}','(*' => '*)'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array("''"),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'absolute','asm','assembler','begin','break','case','catch','cdecl',
- 'const','constructor','default','destructor','div','do','downto',
- 'else','end','except','export','exports','external','far',
- 'finalization','finally','for','forward','function','goto','if',
- 'implementation','in','index','inherited','initialization','inline',
- 'interface','interrupt','label','library','mod','name','not','of',
- 'or','overload','override','private','procedure','program',
- 'property','protected','public','published','raise','repeat',
- 'resourcestring','shl','shr','stdcall','stored','switch','then',
- 'to','try','type','unit','until','uses','var','while','xor'
- ),
- 2 => array(
- 'nil', 'false', 'true',
- ),
- 3 => array(
- 'abs','and','arc','arctan','blockread','blockwrite','chr','dispose',
- 'cos','eof','eoln','exp','get','ln','new','odd','ord','ordinal',
- 'pred','read','readln','sin','sqrt','succ','write','writeln'
- ),
- 4 => array(
- 'ansistring','array','boolean','byte','bytebool','char','file',
- 'integer','longbool','longint','object','packed','pointer','real',
- 'record','set','shortint','smallint','string','union','word'
- ),
- ),
- 'SYMBOLS' => array(
- ',', ':', '=', '+', '-', '*', '/'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;',
- 4 => 'color: #000066; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;',
- 'HARD' => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0066ee;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/per.php b/libvpx/examples/includes/geshi/geshi/per.php
deleted file mode 100644
index 092aae0..0000000
--- a/libvpx/examples/includes/geshi/geshi/per.php
+++ /dev/null
@@ -1,302 +0,0 @@
-<?php
-/*************************************************************************************
- * per.php
- * --------
- * Author: Lars Gersmann (lars.gersmann@gmail.com)
- * Copyright: (c) 2007 Lars Gersmann
- * Release Version: 1.0.8.3
- * Date Started: 2007/06/03
- *
- * Per (forms) (FOURJ's Genero 4GL) language file for GeSHi.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'per',
- 'COMMENT_SINGLE' => array(1 => '--', 2 => '#'),
- 'COMMENT_MULTI' => array('{' => '}'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- "ACCELERATOR",
- "ACCELERATOR2",
- "ACTION",
- "ALT",
- "AND",
- "AUTO",
- "AUTONEXT",
- "AUTOSCALE",
- "BETWEEN",
- "BOTH",
- "BUTTON",
- "BUTTONEDIT",
- "BUTTONTEXTHIDDEN",
- "BY",
- "BYTE",
- "CANVAS",
- "CENTER",
- "CHECKBOX",
- "CLASS",
- "COLOR",
- "COLUMNS",
- "COMBOBOX",
- "COMMAND",
- "COMMENT",
- "COMMENTS",
- "COMPACT",
- "COMPRESS",
- "CONFIG",
- "CONTROL",
- "CURRENT",
- "DATABASE",
- "DATEEDIT",
- "DEC",
- "DEFAULT",
- "DEFAULTS",
- "DELIMITERS",
- "DISPLAY",
- "DISPLAYONLY",
- "DOWNSHIFT",
- "DYNAMIC",
- "EDIT",
- "FIXED",
- "FOLDER",
- "FONTPITCH",
- "FORMAT",
- "FORMONLY",
- "GRID",
- "GRIDCHILDRENINPARENT",
- "GROUP",
- "HBOX",
- "HEIGHT",
- "HIDDEN",
- "HORIZONTAL",
- "INCLUDE",
- "INITIAL",
- "INITIALIZER",
- "INPUT",
- "INSTRUCTIONS",
- "INTERVAL",
- "INVISIBLE",
- "IS",
- "ITEM",
- "ITEMS",
- "JUSTIFY",
- "KEY",
- "KEYS",
- "LABEL",
- "LEFT",
- "LIKE",
- "LINES",
- "MATCHES",
- "NAME",
- "NOENTRY",
- "NONCOMPRESS",
- "NORMAL",
- "NOT",
- "NOUPDATE",
- "OPTIONS",
- "OR",
- "ORIENTATION",
- "PACKED",
- "PAGE",
- "PICTURE",
- "PIXELHEIGHT",
- "PIXELS",
- "PIXELWIDTH",
- "POINTS",
- "PROGRAM",
- "PROGRESSBAR",
- "QUERYCLEAR",
- "QUERYEDITABLE",
- "RADIOGROUP",
- "RECORD",
- "REQUIRED",
- "REVERSE",
- "RIGHT",
- "SAMPLE",
- "SCREEN",
- "SCROLL",
- "SCROLLBARS",
- "SCROLLGRID",
- "SECOND",
- "SEPARATOR",
- "SHIFT",
- "SIZE",
- "SIZEPOLICY",
- "SMALLFLOAT",
- "SMALLINT",
- "SPACING",
- "STRETCH",
- "STYLE",
- "TABINDEX",
- "TABLE",
- "TAG",
- "TEXT",
- "TEXTEDIT",
- "THROUGH",
- "THRU",
- "TITLE",
- "TO",
- "TOOLBAR",
- "TOPMENU",
- "TYPE",
- "UNHIDABLE",
- "UNHIDABLECOLUMNS",
- "UNMOVABLE",
- "UNMOVABLECOLUMNS",
- "UNSIZABLE",
- "UNSIZABLECOLUMNS",
- "UNSORTABLE",
- "UNSORTABLECOLUMNS",
- "UPSHIFT",
- "USER",
- "VALIDATE",
- "VALUECHECKED",
- "VALUEMAX",
- "VALUEMIN",
- "VALUEUNCHECKED",
- "VARCHAR",
- "VARIABLE",
- "VBOX",
- "VERIFY",
- "VERSION",
- "VERTICAL",
- "TIMESTAMP",
- "WANTCOLUMNSANCHORED", /* to be removed! */
- "WANTFIXEDPAGESIZE",
- "WANTNORETURNS",
- "WANTTABS",
- "WHERE",
- "WIDGET",
- "WIDTH",
- "WINDOWSTYLE",
- "WITHOUT",
- "WORDWRAP",
- "X",
- "Y",
- "ZEROFILL",
- "SCHEMA",
- "ATTRIBUTES",
- "TABLES",
- "LAYOUT",
- "END"
- ),
- 2 => array(
- "YEAR",
- "BLACK",
- "BLINK",
- "BLUE",
- "YELLOW",
- "WHITE",
- "UNDERLINE",
- "CENTURY",
- "FRACTION",
- "CHAR",
- "CHARACTER",
- "CHARACTERS",
- "CYAN",
- "DATE",
- "DATETIME",
- "DAY",
- "DECIMAL",
- "FALSE",
- "FLOAT",
- "GREEN",
- "HOUR",
- "INT",
- "INTEGER",
- "MAGENTA",
- "MINUTE",
- "MONEY",
- "NONE",
- "NULL",
- "REAL",
- "RED",
- "TRUE",
- "TODAY",
- "MONTH",
- "IMAGE"
- ),
- ),
- 'SYMBOLS' => array(
- '+', '-', '*', '?', '=', '/', '%', '>', '<', '^', '!', '|', ':',
- '(', ')', '[', ']'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0600FF;',
- 2 => 'color: #0000FF; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008080; font-style: italic;',
- 2 => 'color: #008080;',
- 'MULTI' => 'color: green'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008080; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #808080;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000FF;',
- 2 => 'color: #0000FF;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/perl.php b/libvpx/examples/includes/geshi/geshi/perl.php
deleted file mode 100644
index f8ac096..0000000
--- a/libvpx/examples/includes/geshi/geshi/perl.php
+++ /dev/null
@@ -1,213 +0,0 @@
-<?php
-/*************************************************************************************
- * perl.php
- * --------
- * Author: Andreas Gohr (andi@splitbrain.org), Ben Keen (ben.keen@gmail.com)
- * Copyright: (c) 2004 Andreas Gohr, Ben Keen (http://www.benjaminkeen.org/), Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/20
- *
- * Perl language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/06/22 (1.0.8)
- * - Added support for system calls in backticks (Corley Kinnane)
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * - Added comment_regexp for predefined variables
- * 2008/02/15 (1.003)
- * - Fixed SF#1891630 with placebo patch
- * 2006/01/05 (1.0.2)
- * - Used hardescape feature for ' strings (Cliff Stanford)
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/08/20 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * LABEL:
- * * string comparison operators
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Perl',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(
- '=back' => '=cut',
- '=head' => '=cut',
- '=item' => '=cut',
- '=over' => '=cut',
- '=begin' => '=cut',
- '=end' => '=cut',
- '=for' => '=cut',
- '=encoding' => '=cut',
- '=pod' => '=cut'
- ),
- 'COMMENT_REGEXP' => array(
- //Regular expressions
- 2 => "/(?<=[\\s^])(s|tr|y)\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/(?:\\\\.|(?!\n)[^\\/\\\\])*\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?:\\\\.|(?!\n)[^\\/\\\\])+\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU",
- //Regular expression match variables
- 3 => '/\$\d+/',
- //Heredoc
- 4 => '/<<\s*?([\'"]?)([a-zA-Z0-9]+)\1;[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
- //Predefined variables
- 5 => '/\$(\^[a-zA-Z]?|[\*\$`\'&_\.,+\-~:;\\\\\/"\|%=\?!@#<>\(\)\[\]])(?!\w)|@[_+\-]|%[!]|\$(?=\{)/',
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"','`'),
- 'HARDQUOTE' => array("'", "'"), // An optional 2-element array defining the beginning and end of a hard-quoted string
- 'HARDESCAPE' => array('\\\'',),
- // Things that must still be escaped inside a hard-quoted string
- // If HARDQUOTE is defined, HARDESCAPE must be defined
- // This will not work unless the first character of each element is either in the
- // QUOTEMARKS array or is the ESCAPE_CHAR
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'case', 'do', 'else', 'elsif', 'for', 'if', 'then', 'until', 'while', 'foreach', 'my',
- 'xor', 'or', 'and', 'unless', 'next', 'last', 'redo', 'not', 'our',
- 'reset', 'continue', 'cmp', 'ne', 'eq', 'lt', 'gt', 'le', 'ge',
- ),
- 2 => array(
- 'use', 'sub', 'new', '__END__', '__DATA__', '__DIE__', '__WARN__', 'BEGIN',
- 'STDIN', 'STDOUT', 'STDERR', 'ARGV', 'ARGVOUT'
- ),
- 3 => array(
- 'abs', 'accept', 'alarm', 'atan2', 'bind', 'binmode', 'bless',
- 'caller', 'chdir', 'chmod', 'chomp', 'chop', 'chown', 'chr',
- 'chroot', 'close', 'closedir', 'connect', 'cos',
- 'crypt', 'dbmclose', 'dbmopen', 'defined', 'delete', 'die',
- 'dump', 'each', 'endgrent', 'endhostent', 'endnetent', 'endprotoent',
- 'endpwent', 'endservent', 'eof', 'eval', 'exec', 'exists', 'exit',
- 'exp', 'fcntl', 'fileno', 'flock', 'fork', 'format', 'formline',
- 'getc', 'getgrent', 'getgrgid', 'getgrnam', 'gethostbyaddr',
- 'gethostbyname', 'gethostent', 'getlogin', 'getnetbyaddr', 'getnetbyname',
- 'getnetent', 'getpeername', 'getpgrp', 'getppid', 'getpriority',
- 'getprotobyname', 'getprotobynumber', 'getprotoent', 'getpwent',
- 'getpwnam', 'getpwuid', 'getservbyname', 'getservbyport', 'getservent',
- 'getsockname', 'getsockopt', 'glob', 'gmtime', 'goto', 'grep',
- 'hex', 'import', 'index', 'int', 'ioctl', 'join', 'keys', 'kill',
- 'lc', 'lcfirst', 'length', 'link', 'listen', 'local',
- 'localtime', 'log', 'lstat', 'm', 'map', 'mkdir', 'msgctl', 'msgget',
- 'msgrcv', 'msgsnd', 'no', 'oct', 'open', 'opendir',
- 'ord', 'pack', 'package', 'pipe', 'pop', 'pos', 'print',
- 'printf', 'prototype', 'push', 'qq', 'qr', 'quotemeta', 'qw',
- 'qx', 'q', 'rand', 'read', 'readdir', 'readline', 'readlink', 'readpipe',
- 'recv', 'ref', 'rename', 'require', 'return',
- 'reverse', 'rewinddir', 'rindex', 'rmdir', 's', 'scalar', 'seek',
- 'seekdir', 'select', 'semctl', 'semget', 'semop', 'send', 'setgrent',
- 'sethostent', 'setnetent', 'setpgrp', 'setpriority', 'setprotoent',
- 'setpwent', 'setservent', 'setsockopt', 'shift', 'shmctl', 'shmget',
- 'shmread', 'shmwrite', 'shutdown', 'sin', 'sleep', 'socket', 'socketpair',
- 'sort', 'splice', 'split', 'sprintf', 'sqrt', 'srand', 'stat',
- 'study', 'substr', 'symlink', 'syscall', 'sysopen', 'sysread',
- 'sysseek', 'system', 'syswrite', 'tell', 'telldir', 'tie', 'tied',
- 'time', 'times', 'tr', 'truncate', 'uc', 'ucfirst', 'umask', 'undef',
- 'unlink', 'unpack', 'unshift', 'untie', 'utime', 'values',
- 'vec', 'wait', 'waitpid', 'wantarray', 'warn', 'write', 'y'
- )
- ),
- 'SYMBOLS' => array(
- '<', '>', '=',
- '!', '@', '~', '&', '|', '^',
- '+','-', '*', '/', '%',
- ',', ';', '?', '.', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #009966; font-style: italic;',
- 3 => 'color: #0000ff;',
- 4 => 'color: #cc0000; font-style: italic;',
- 5 => 'color: #0000ff;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;',
- 'HARD' => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;',
- 4 => 'color: #009999;',
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://perldoc.perl.org/functions/{FNAMEL}.html'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '-&gt;',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- //Variable
- 0 => '(?:\$[\$#]?|\\\\(?:[@%*]?|\\\\*\$|&amp;)|%[$]?|@[$]?|\*[$]?|&amp;[$]?)[a-zA-Z_][a-zA-Z0-9_]*',
- //File Descriptor
- 4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'COMMENTS' => array(
- 'DISALLOWED_BEFORE' => '$'
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/php-brief.php b/libvpx/examples/includes/geshi/geshi/php-brief.php
deleted file mode 100644
index dd6781d..0000000
--- a/libvpx/examples/includes/geshi/geshi/php-brief.php
+++ /dev/null
@@ -1,202 +0,0 @@
-<?php
-/*************************************************************************************
- * php-brief.php
- * -------------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/02
- *
- * PHP (brief version) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * - Fixed &new problem
- * 2004/10/27 (1.0.2)
- * - Added support for URLs
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/14)
- * -------------------------
- * * Remove more functions that are hardly used
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'PHP (brief)',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- //Heredoc and Nowdoc syntax
- 'COMMENT_REGEXP' => array(3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array("\'"),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |
- GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'include', 'require', 'include_once', 'require_once',
- 'for', 'as', 'foreach', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch',
- 'return', 'break'
- ),
- 2 => array(
- 'null', '__LINE__', '__FILE__',
- 'false', '&lt;?php',
- 'true', 'var', 'default',
- 'function', 'class', 'new', '&amp;new', 'public', 'private', 'interface', 'extends',
- 'const', 'self'
- ),
- 3 => array(
- 'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
- 'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
- 'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
- 'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
- 'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
- 'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
- 'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
- 'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
- 'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
- 'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
- 'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
- 'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
- 'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
- )
- ),
- 'SYMBOLS' => array(
- 1 => array(
- '<%', '<%=', '%>', '<?', '<?=', '?>'
- ),
- 0 => array(
- '(', ')', '[', ']', '{', '}',
- '!', '@', '%', '&', '|', '/',
- '<', '>',
- '=', '-', '+', '*',
- '.', ':', ',', ';'
- )
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #990000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #666666; font-style: italic;',
- 3 => 'color: #0000cc; font-style: italic;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;',
- 'HARD' => 'color: #0000ff;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- ),
- 'METHODS' => array(
- 1 => 'color: #004000;',
- 2 => 'color: #004000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;',
- 1 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.php.net/{FNAMEL}'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '-&gt;',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- //Variables
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<?php' => '?>'
- ),
- 1 => array(
- '<?' => '?>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- 3 => array(
- '<script language="php">' => '</script>'
- ),
- 4 => "/(<\?(?:php)?)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(\?>|\Z)/sm",
- 5 => "/(<%)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(%>|\Z)/sm"
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/php.php b/libvpx/examples/includes/geshi/geshi/php.php
deleted file mode 100644
index fc6be6c..0000000
--- a/libvpx/examples/includes/geshi/geshi/php.php
+++ /dev/null
@@ -1,1094 +0,0 @@
-<?php
-/*************************************************************************************
- * php.php
- * --------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/20
- *
- * PHP language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/25 (1.0.3)
- * - Added support for multiple object splitters
- * - Fixed &new problem
- * 2004/10/27 (1.0.2)
- * - Added URL support
- * - Added extra constants
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/14)
- * -------------------------
- * * Make sure the last few function I may have missed
- * (like eval()) are included for highlighting
- * * Split to several files - php4, php5 etc
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array(
- 'LANG_NAME' => 'PHP',
- 'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array("'", "\\"),
- 'HARDCHAR' => "\\",
- 'COMMENT_REGEXP' => array(
- //Heredoc and Nowdoc syntax
- 3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+?)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
- // phpdoc comments
- 4 => '#/\*\*(?![\*\/]).*\*/#sU',
- // Advanced # handling
- 2 => "/#.*?(?:(?=\?\>)|^)/smi"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'ESCAPE_REGEXP' => array(
- //Simple Single Char Escapes
- 1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
- //Hexadecimal Char Specs
- 2 => "#\\\\x[\da-fA-F]{1,2}#i",
- //Octal Char Specs
- 3 => "#\\\\[0-7]{1,3}#",
- //String Parsing of Variable Names
- 4 => "#\\$[a-z0-9_]+(?:\\[[a-z0-9_]+\\]|->[a-z0-9_]+)?|(?:\\{\\$|\\$\\{)[a-z0-9_]+(?:\\[('?)[a-z0-9_]*\\1\\]|->[a-z0-9_]+)*\\}#i",
- //Experimental extension supporting cascaded {${$var}} syntax
- 5 => "#\$[a-z0-9_]+(?:\[[a-z0-9_]+\]|->[a-z0-9_]+)?|(?:\{\$|\$\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*\\1\]|->[a-z0-9_]+)*\}|\{\$(?R)\}#i",
- //Format String support in ""-Strings
- 6 => "#%(?:%|(?:\d+\\\\\\\$)?\\+?(?:\x20|0|'.)?-?(?:\d+|\\*)?(?:\.\d+)?[bcdefFosuxX])#"
- ),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |
- GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'as','break','case','continue','default','do','else','elseif',
- 'endfor','endforeach','endif','endswitch','endwhile','for',
- 'foreach','if','include','include_once','require','require_once',
- 'return','switch','while',
-
- 'echo','print'
- ),
- 2 => array(
- '&amp;new','&lt;/script&gt;','&lt;?php','&lt;script language',
- 'class','const','declare','extends','function','global','interface',
- 'namespace','new','private','public','self','var'
- ),
- 3 => array(
- 'abs','acos','acosh','addcslashes','addslashes','aggregate',
- 'aggregate_methods','aggregate_methods_by_list',
- 'aggregate_methods_by_regexp','aggregate_properties',
- 'aggregate_properties_by_list','aggregate_properties_by_regexp',
- 'aggregation_info','apache_child_terminate','apache_get_modules',
- 'apache_get_version','apache_getenv','apache_lookup_uri',
- 'apache_note','apache_request_headers','apache_response_headers',
- 'apache_setenv','array','array_change_key_case','array_chunk',
- 'array_combine','array_count_values','array_diff',
- 'array_diff_assoc','array_diff_key','array_diff_uassoc',
- 'array_diff_ukey','array_fill','array_fill_keys','array_filter',
- 'array_flip','array_intersect','array_intersect_assoc',
- 'array_intersect_key','array_intersect_uassoc',
- 'array_intersect_ukey','array_key_exists','array_keys','array_map',
- 'array_merge','array_merge_recursive','array_multisort','array_pad',
- 'array_pop','array_product','array_push','array_rand',
- 'array_reduce','array_reverse','array_search','array_shift',
- 'array_slice','array_splice','array_sum','array_udiff',
- 'array_udiff_assoc','array_udiff_uassoc','array_uintersect',
- 'array_uintersect_assoc','array_uintersect_uassoc','array_unique',
- 'array_unshift','array_values','array_walk','array_walk_recursive',
- 'arsort','asin','asinh','asort','assert','assert_options','atan',
- 'atan2','atanh','base_convert','base64_decode','base64_encode',
- 'basename','bcadd','bccomp','bcdiv','bcmod','bcmul',
- 'bcompiler_load','bcompiler_load_exe','bcompiler_parse_class',
- 'bcompiler_read','bcompiler_write_class','bcompiler_write_constant',
- 'bcompiler_write_exe_footer','bcompiler_write_file',
- 'bcompiler_write_footer','bcompiler_write_function',
- 'bcompiler_write_functions_from_file','bcompiler_write_header',
- 'bcompiler_write_included_filename','bcpow','bcpowmod','bcscale',
- 'bcsqrt','bcsub','bin2hex','bindec','bindtextdomain',
- 'bind_textdomain_codeset','bitset_empty','bitset_equal',
- 'bitset_excl','bitset_fill','bitset_from_array','bitset_from_hash',
- 'bitset_from_string','bitset_in','bitset_incl',
- 'bitset_intersection','bitset_invert','bitset_is_empty',
- 'bitset_subset','bitset_to_array','bitset_to_hash',
- 'bitset_to_string','bitset_union','blenc_encrypt','bzclose',
- 'bzcompress','bzdecompress','bzerrno','bzerror','bzerrstr',
- 'bzflush','bzopen','bzread','bzwrite','cal_days_in_month',
- 'cal_from_jd','cal_info','cal_to_jd','call_user_func',
- 'call_user_func_array','call_user_method','call_user_method_array',
- 'ceil','chdir','checkdate','checkdnsrr','chgrp','chmod','chop',
- 'chown','chr','chunk_split','class_exists','class_implements',
- 'class_parents','classkit_aggregate_methods',
- 'classkit_doc_comments','classkit_import','classkit_method_add',
- 'classkit_method_copy','classkit_method_redefine',
- 'classkit_method_remove','classkit_method_rename','clearstatcache',
- 'closedir','closelog','com_create_guid','com_event_sink',
- 'com_get_active_object','com_load_typelib','com_message_pump',
- 'com_print_typeinfo','compact','confirm_phpdoc_compiled',
- 'connection_aborted','connection_status','constant',
- 'convert_cyr_string','convert_uudecode','convert_uuencode','copy',
- 'cos','cosh','count','count_chars','cpdf_add_annotation',
- 'cpdf_add_outline','cpdf_arc','cpdf_begin_text','cpdf_circle',
- 'cpdf_clip','cpdf_close','cpdf_closepath',
- 'cpdf_closepath_fill_stroke','cpdf_closepath_stroke',
- 'cpdf_continue_text','cpdf_curveto','cpdf_end_text','cpdf_fill',
- 'cpdf_fill_stroke','cpdf_finalize','cpdf_finalize_page',
- 'cpdf_global_set_document_limits','cpdf_import_jpeg','cpdf_lineto',
- 'cpdf_moveto','cpdf_newpath','cpdf_open','cpdf_output_buffer',
- 'cpdf_page_init','cpdf_rect','cpdf_restore','cpdf_rlineto',
- 'cpdf_rmoveto','cpdf_rotate','cpdf_rotate_text','cpdf_save',
- 'cpdf_save_to_file','cpdf_scale','cpdf_set_action_url',
- 'cpdf_set_char_spacing','cpdf_set_creator','cpdf_set_current_page',
- 'cpdf_set_font','cpdf_set_font_directories',
- 'cpdf_set_font_map_file','cpdf_set_horiz_scaling',
- 'cpdf_set_keywords','cpdf_set_leading','cpdf_set_page_animation',
- 'cpdf_set_subject','cpdf_set_text_matrix','cpdf_set_text_pos',
- 'cpdf_set_text_rendering','cpdf_set_text_rise','cpdf_set_title',
- 'cpdf_set_viewer_preferences','cpdf_set_word_spacing',
- 'cpdf_setdash','cpdf_setflat','cpdf_setgray','cpdf_setgray_fill',
- 'cpdf_setgray_stroke','cpdf_setlinecap','cpdf_setlinejoin',
- 'cpdf_setlinewidth','cpdf_setmiterlimit','cpdf_setrgbcolor',
- 'cpdf_setrgbcolor_fill','cpdf_setrgbcolor_stroke','cpdf_show',
- 'cpdf_show_xy','cpdf_stringwidth','cpdf_stroke','cpdf_text',
- 'cpdf_translate','crack_check','crack_closedict',
- 'crack_getlastmessage','crack_opendict','crc32','create_function',
- 'crypt','ctype_alnum','ctype_alpha','ctype_cntrl','ctype_digit',
- 'ctype_graph','ctype_lower','ctype_print','ctype_punct',
- 'ctype_space','ctype_upper','ctype_xdigit','curl_close',
- 'curl_copy_handle','curl_errno','curl_error','curl_exec',
- 'curl_getinfo','curl_init','curl_multi_add_handle',
- 'curl_multi_close','curl_multi_exec','curl_multi_getcontent',
- 'curl_multi_info_read','curl_multi_init','curl_multi_remove_handle',
- 'curl_multi_select','curl_setopt','curl_setopt_array',
- 'curl_version','current','cvsclient_connect','cvsclient_log',
- 'cvsclient_login','cvsclient_retrieve','date','date_create',
- 'date_date_set','date_default_timezone_get',
- 'date_default_timezone_set','date_format','date_isodate_set',
- 'date_modify','date_offset_get','date_parse','date_sun_info',
- 'date_sunrise','date_sunset','date_time_set','date_timezone_get',
- 'date_timezone_set','db_id_list','dba_close','dba_delete',
- 'dba_exists','dba_fetch','dba_firstkey','dba_handlers','dba_insert',
- 'dba_key_split','dba_list','dba_nextkey','dba_open','dba_optimize',
- 'dba_popen','dba_replace','dba_sync','dbase_add_record',
- 'dbase_close','dbase_create','dbase_delete_record',
- 'dbase_get_header_info','dbase_get_record',
- 'dbase_get_record_with_names','dbase_numfields','dbase_numrecords',
- 'dbase_open','dbase_pack','dbase_replace_record',
- 'dbg_get_all_contexts','dbg_get_all_module_names',
- 'dbg_get_all_source_lines','dbg_get_context_name',
- 'dbg_get_module_name','dbg_get_profiler_results',
- 'dbg_get_source_context','dblist','dbmclose','dbmdelete',
- 'dbmexists','dbmfetch','dbmfirstkey','dbminsert','dbmnextkey',
- 'dbmopen','dbmreplace','dbx_close','dbx_compare','dbx_connect',
- 'dbx_error','dbx_escape_string','dbx_fetch_row','dbx_query',
- 'dbx_sort','dcgettext','dcngettext','deaggregate','debug_backtrace',
- 'debug_zval_dump','debugbreak','decbin','dechex','decoct','define',
- 'defined','define_syslog_variables','deg2rad','dgettext','die',
- 'dio_close','dio_open','dio_read','dio_seek','dio_stat','dio_write',
- 'dir','dirname','disk_free_space','disk_total_space',
- 'diskfreespace','dl','dngettext','docblock_token_name',
- 'docblock_tokenize','dom_import_simplexml','domxml_add_root',
- 'domxml_attributes','domxml_children','domxml_doc_add_root',
- 'domxml_doc_document_element','domxml_doc_get_element_by_id',
- 'domxml_doc_get_elements_by_tagname','domxml_doc_get_root',
- 'domxml_doc_set_root','domxml_doc_validate','domxml_doc_xinclude',
- 'domxml_dump_mem','domxml_dump_mem_file','domxml_dump_node',
- 'domxml_dumpmem','domxml_elem_get_attribute',
- 'domxml_elem_set_attribute','domxml_get_attribute','domxml_getattr',
- 'domxml_html_dump_mem','domxml_new_child','domxml_new_doc',
- 'domxml_new_xmldoc','domxml_node','domxml_node_add_namespace',
- 'domxml_node_attributes','domxml_node_children',
- 'domxml_node_get_content','domxml_node_has_attributes',
- 'domxml_node_new_child','domxml_node_set_content',
- 'domxml_node_set_namespace','domxml_node_unlink_node',
- 'domxml_open_file','domxml_open_mem','domxml_parser',
- 'domxml_parser_add_chunk','domxml_parser_cdata_section',
- 'domxml_parser_characters','domxml_parser_comment',
- 'domxml_parser_end','domxml_parser_end_document',
- 'domxml_parser_end_element','domxml_parser_entity_reference',
- 'domxml_parser_get_document','domxml_parser_namespace_decl',
- 'domxml_parser_processing_instruction',
- 'domxml_parser_start_document','domxml_parser_start_element',
- 'domxml_root','domxml_set_attribute','domxml_setattr',
- 'domxml_substitute_entities_default','domxml_unlink_node',
- 'domxml_version','domxml_xmltree','doubleval','each','easter_date',
- 'easter_days','empty','end','ereg','ereg_replace','eregi',
- 'eregi_replace','error_get_last','error_log','error_reporting',
- 'escapeshellarg','escapeshellcmd','eval','event_deschedule',
- 'event_dispatch','event_free','event_handle_signal',
- 'event_have_events','event_init','event_new','event_pending',
- 'event_priority_set','event_schedule','event_set','event_timeout',
- 'exec','exif_imagetype','exif_read_data','exif_tagname',
- 'exif_thumbnail','exit','exp','explode','expm1','extension_loaded',
- 'extract','ezmlm_hash','fbird_add_user','fbird_affected_rows',
- 'fbird_backup','fbird_blob_add','fbird_blob_cancel',
- 'fbird_blob_close','fbird_blob_create','fbird_blob_echo',
- 'fbird_blob_get','fbird_blob_import','fbird_blob_info',
- 'fbird_blob_open','fbird_close','fbird_commit','fbird_commit_ret',
- 'fbird_connect','fbird_db_info','fbird_delete_user','fbird_drop_db',
- 'fbird_errcode','fbird_errmsg','fbird_execute','fbird_fetch_assoc',
- 'fbird_fetch_object','fbird_fetch_row','fbird_field_info',
- 'fbird_free_event_handler','fbird_free_query','fbird_free_result',
- 'fbird_gen_id','fbird_maintain_db','fbird_modify_user',
- 'fbird_name_result','fbird_num_fields','fbird_num_params',
- 'fbird_param_info','fbird_pconnect','fbird_prepare','fbird_query',
- 'fbird_restore','fbird_rollback','fbird_rollback_ret',
- 'fbird_server_info','fbird_service_attach','fbird_service_detach',
- 'fbird_set_event_handler','fbird_trans','fbird_wait_event','fclose',
- 'fdf_add_doc_javascript','fdf_add_template','fdf_close',
- 'fdf_create','fdf_enum_values','fdf_errno','fdf_error','fdf_get_ap',
- 'fdf_get_attachment','fdf_get_encoding','fdf_get_file',
- 'fdf_get_flags','fdf_get_opt','fdf_get_status','fdf_get_value',
- 'fdf_get_version','fdf_header','fdf_next_field_name','fdf_open',
- 'fdf_open_string','fdf_remove_item','fdf_save','fdf_save_string',
- 'fdf_set_ap','fdf_set_encoding','fdf_set_file','fdf_set_flags',
- 'fdf_set_javascript_action','fdf_set_on_import_javascript',
- 'fdf_set_opt','fdf_set_status','fdf_set_submit_form_action',
- 'fdf_set_target_frame','fdf_set_value','fdf_set_version','feof',
- 'fflush','fgetc','fgetcsv','fgets','fgetss','file','file_exists',
- 'file_get_contents','file_put_contents','fileatime','filectime',
- 'filegroup','fileinode','filemtime','fileowner','fileperms',
- 'filepro','filepro_fieldcount','filepro_fieldname',
- 'filepro_fieldtype','filepro_fieldwidth','filepro_retrieve',
- 'filepro_rowcount','filesize','filetype','filter_has_var',
- 'filter_id','filter_input','filter_input_array','filter_list',
- 'filter_var','filter_var_array','finfo_buffer','finfo_close',
- 'finfo_file','finfo_open','finfo_set_flags','floatval','flock',
- 'floor','flush','fmod','fnmatch','fopen','fpassthru','fprintf',
- 'fputcsv','fputs','fread','frenchtojd','fribidi_charset_info',
- 'fribidi_get_charsets','fribidi_log2vis','fscanf','fseek',
- 'fsockopen','fstat','ftell','ftok','ftp_alloc','ftp_cdup',
- 'ftp_chdir','ftp_chmod','ftp_close','ftp_connect','ftp_delete',
- 'ftp_exec','ftp_fget','ftp_fput','ftp_get','ftp_get_option',
- 'ftp_login','ftp_mdtm','ftp_mkdir','ftp_nb_continue','ftp_nb_fget',
- 'ftp_nb_fput','ftp_nb_get','ftp_nb_put','ftp_nlist','ftp_pasv',
- 'ftp_put','ftp_pwd','ftp_quit','ftp_raw','ftp_rawlist','ftp_rename',
- 'ftp_rmdir','ftp_set_option','ftp_site','ftp_size',
- 'ftp_ssl_connect','ftp_systype','ftruncate','function_exists',
- 'func_get_arg','func_get_args','func_num_args','fwrite','gd_info',
- 'getallheaders','getcwd','getdate','getenv','gethostbyaddr',
- 'gethostbyname','gethostbynamel','getimagesize','getlastmod',
- 'getmxrr','getmygid','getmyinode','getmypid','getmyuid','getopt',
- 'getprotobyname','getprotobynumber','getrandmax','getrusage',
- 'getservbyname','getservbyport','gettext','gettimeofday','gettype',
- 'get_browser','get_cfg_var','get_class','get_class_methods',
- 'get_class_vars','get_current_user','get_declared_classes',
- 'get_defined_constants','get_defined_functions','get_defined_vars',
- 'get_extension_funcs','get_headers','get_html_translation_table',
- 'get_included_files','get_include_path','get_loaded_extensions',
- 'get_magic_quotes_gpc','get_magic_quotes_runtime','get_meta_tags',
- 'get_object_vars','get_parent_class','get_required_files',
- 'get_resource_type','glob','gmdate','gmmktime','gmp_abs','gmp_add',
- 'gmp_and','gmp_clrbit','gmp_cmp','gmp_com','gmp_div','gmp_div_q',
- 'gmp_div_qr','gmp_div_r','gmp_divexact','gmp_fact','gmp_gcd',
- 'gmp_gcdext','gmp_hamdist','gmp_init','gmp_intval','gmp_invert',
- 'gmp_jacobi','gmp_legendre','gmp_mod','gmp_mul','gmp_neg',
- 'gmp_nextprime','gmp_or','gmp_perfect_square','gmp_popcount',
- 'gmp_pow','gmp_powm','gmp_prob_prime','gmp_random','gmp_scan0',
- 'gmp_scan1','gmp_setbit','gmp_sign','gmp_sqrt','gmp_sqrtrem',
- 'gmp_strval','gmp_sub','gmp_xor','gmstrftime','gopher_parsedir',
- 'gregoriantojd','gzclose','gzcompress','gzdeflate','gzencode',
- 'gzeof','gzfile','gzgetc','gzgets','gzgetss','gzinflate','gzopen',
- 'gzpassthru','gzputs','gzread','gzrewind','gzseek','gztell',
- 'gzuncompress','gzwrite','hash','hash_algos','hash_file',
- 'hash_final','hash_hmac','hash_hmac_file','hash_init','hash_update',
- 'hash_update_file','hash_update_stream','header','headers_list',
- 'headers_sent','hebrev','hebrevc','hexdec','highlight_file',
- 'highlight_string','html_doc','html_doc_file','html_entity_decode',
- 'htmlentities','htmlspecialchars','htmlspecialchars_decode',
- 'http_build_cookie','http_build_query','http_build_str',
- 'http_build_url','http_cache_etag','http_cache_last_modified',
- 'http_chunked_decode','http_date','http_deflate','http_get',
- 'http_get_request_body','http_get_request_body_stream',
- 'http_get_request_headers','http_head','http_inflate',
- 'http_match_etag','http_match_modified','http_match_request_header',
- 'http_negotiate_charset','http_negotiate_content_type',
- 'http_negotiate_language','http_parse_cookie','http_parse_headers',
- 'http_parse_message','http_parse_params',
- 'http_persistent_handles_clean','http_persistent_handles_count',
- 'http_persistent_handles_ident','http_post_data','http_post_fields',
- 'http_put_data','http_put_file','http_put_stream','http_redirect',
- 'http_request','http_request_body_encode',
- 'http_request_method_exists','http_request_method_name',
- 'http_request_method_register','http_request_method_unregister',
- 'http_send_content_disposition','http_send_content_type',
- 'http_send_data','http_send_file','http_send_last_modified',
- 'http_send_status','http_send_stream','http_support',
- 'http_throttle','hypot','i18n_convert','i18n_discover_encoding',
- 'i18n_http_input','i18n_http_output','i18n_internal_encoding',
- 'i18n_ja_jp_hantozen','i18n_mime_header_decode',
- 'i18n_mime_header_encode','ibase_add_user','ibase_affected_rows',
- 'ibase_backup','ibase_blob_add','ibase_blob_cancel',
- 'ibase_blob_close','ibase_blob_create','ibase_blob_echo',
- 'ibase_blob_get','ibase_blob_import','ibase_blob_info',
- 'ibase_blob_open','ibase_close','ibase_commit','ibase_commit_ret',
- 'ibase_connect','ibase_db_info','ibase_delete_user','ibase_drop_db',
- 'ibase_errcode','ibase_errmsg','ibase_execute','ibase_fetch_assoc',
- 'ibase_fetch_object','ibase_fetch_row','ibase_field_info',
- 'ibase_free_event_handler','ibase_free_query','ibase_free_result',
- 'ibase_gen_id','ibase_maintain_db','ibase_modify_user',
- 'ibase_name_result','ibase_num_fields','ibase_num_params',
- 'ibase_param_info','ibase_pconnect','ibase_prepare','ibase_query',
- 'ibase_restore','ibase_rollback','ibase_rollback_ret',
- 'ibase_server_info','ibase_service_attach','ibase_service_detach',
- 'ibase_set_event_handler','ibase_trans','ibase_wait_event','iconv',
- 'iconv_get_encoding','iconv_mime_decode',
- 'iconv_mime_decode_headers','iconv_mime_encode',
- 'iconv_set_encoding','iconv_strlen','iconv_strpos','iconv_strrpos',
- 'iconv_substr','id3_get_frame_long_name','id3_get_frame_short_name',
- 'id3_get_genre_id','id3_get_genre_list','id3_get_genre_name',
- 'id3_get_tag','id3_get_version','id3_remove_tag','id3_set_tag',
- 'idate','ignore_user_abort','image_type_to_extension',
- 'image_type_to_mime_type','image2wbmp','imagealphablending',
- 'imageantialias','imagearc','imagechar','imagecharup',
- 'imagecolorallocate','imagecolorallocatealpha','imagecolorat',
- 'imagecolorclosest','imagecolorclosestalpha','imagecolordeallocate',
- 'imagecolorexact','imagecolorexactalpha','imagecolormatch',
- 'imagecolorresolve','imagecolorresolvealpha','imagecolorset',
- 'imagecolorsforindex','imagecolorstotal','imagecolortransparent',
- 'imageconvolution','imagecopy','imagecopymerge',
- 'imagecopymergegray','imagecopyresampled','imagecopyresized',
- 'imagecreate','imagecreatefromgd','imagecreatefromgd2',
- 'imagecreatefromgd2part','imagecreatefromgif','imagecreatefromjpeg',
- 'imagecreatefrompng','imagecreatefromstring','imagecreatefromwbmp',
- 'imagecreatefromxbm','imagecreatetruecolor','imagedashedline',
- 'imagedestroy','imageellipse','imagefill','imagefilledarc',
- 'imagefilledellipse','imagefilledpolygon','imagefilledrectangle',
- 'imagefilltoborder','imagefilter','imagefontheight',
- 'imagefontwidth','imageftbbox','imagefttext','imagegammacorrect',
- 'imagegd','imagegd2','imagegif','imagegrabscreen','imagegrabwindow',
- 'imageinterlace','imageistruecolor','imagejpeg','imagelayereffect',
- 'imageline','imageloadfont','imagepalettecopy','imagepng',
- 'imagepolygon','imagepsbbox','imagepsencodefont',
- 'imagepsextendfont','imagepsfreefont','imagepsloadfont',
- 'imagepsslantfont','imagepstext','imagerectangle','imagerotate',
- 'imagesavealpha','imagesetbrush','imagesetpixel','imagesetstyle',
- 'imagesetthickness','imagesettile','imagestring','imagestringup',
- 'imagesx','imagesy','imagetruecolortopalette','imagettfbbox',
- 'imagettftext','imagetypes','imagewbmp','imagexbm','imap_8bit',
- 'imap_alerts','imap_append','imap_base64','imap_binary','imap_body',
- 'imap_bodystruct','imap_check','imap_clearflag_full','imap_close',
- 'imap_create','imap_createmailbox','imap_delete',
- 'imap_deletemailbox','imap_errors','imap_expunge',
- 'imap_fetch_overview','imap_fetchbody','imap_fetchheader',
- 'imap_fetchstructure','imap_fetchtext','imap_get_quota',
- 'imap_get_quotaroot','imap_getacl','imap_getmailboxes',
- 'imap_getsubscribed','imap_header','imap_headerinfo','imap_headers',
- 'imap_last_error','imap_list','imap_listmailbox',
- 'imap_listsubscribed','imap_lsub','imap_mail','imap_mail_compose',
- 'imap_mail_copy','imap_mail_move','imap_mailboxmsginfo',
- 'imap_mime_header_decode','imap_msgno','imap_num_msg',
- 'imap_num_recent','imap_open','imap_ping','imap_qprint',
- 'imap_rename','imap_renamemailbox','imap_reopen',
- 'imap_rfc822_parse_adrlist','imap_rfc822_parse_headers',
- 'imap_rfc822_write_address','imap_savebody','imap_scan',
- 'imap_scanmailbox','imap_search','imap_set_quota','imap_setacl',
- 'imap_setflag_full','imap_sort','imap_status','imap_subscribe',
- 'imap_thread','imap_timeout','imap_uid','imap_undelete',
- 'imap_unsubscribe','imap_utf7_decode','imap_utf7_encode',
- 'imap_utf8','implode','import_request_variables','in_array',
- 'ini_alter','ini_get','ini_get_all','ini_restore','ini_set',
- 'intval','ip2long','iptcembed','iptcparse','isset','is_a',
- 'is_array','is_bool','is_callable','is_dir','is_double',
- 'is_executable','is_file','is_finite','is_float','is_infinite',
- 'is_int','is_integer','is_link','is_long','is_nan','is_null',
- 'is_numeric','is_object','is_readable','is_real','is_resource',
- 'is_scalar','is_soap_fault','is_string','is_subclass_of',
- 'is_uploaded_file','is_writable','is_writeable','iterator_apply',
- 'iterator_count','iterator_to_array','java_last_exception_clear',
- 'java_last_exception_get','jddayofweek','jdmonthname','jdtofrench',
- 'jdtogregorian','jdtojewish','jdtojulian','jdtounix','jewishtojd',
- 'join','jpeg2wbmp','json_decode','json_encode','juliantojd','key',
- 'key_exists','krsort','ksort','lcg_value','ldap_add','ldap_bind',
- 'ldap_close','ldap_compare','ldap_connect','ldap_count_entries',
- 'ldap_delete','ldap_dn2ufn','ldap_err2str','ldap_errno',
- 'ldap_error','ldap_explode_dn','ldap_first_attribute',
- 'ldap_first_entry','ldap_first_reference','ldap_free_result',
- 'ldap_get_attributes','ldap_get_dn','ldap_get_entries',
- 'ldap_get_option','ldap_get_values','ldap_get_values_len',
- 'ldap_list','ldap_mod_add','ldap_mod_del','ldap_mod_replace',
- 'ldap_modify','ldap_next_attribute','ldap_next_entry',
- 'ldap_next_reference','ldap_parse_reference','ldap_parse_result',
- 'ldap_read','ldap_rename','ldap_search','ldap_set_option',
- 'ldap_sort','ldap_start_tls','ldap_unbind','levenshtein',
- 'libxml_clear_errors','libxml_get_errors','libxml_get_last_error',
- 'libxml_set_streams_context','libxml_use_internal_errors','link',
- 'linkinfo','list','localeconv','localtime','log','log1p','log10',
- 'long2ip','lstat','ltrim','lzf_compress','lzf_decompress',
- 'lzf_optimized_for','magic_quotes_runtime','mail','max','mbereg',
- 'mberegi','mberegi_replace','mbereg_match','mbereg_replace',
- 'mbereg_search','mbereg_search_getpos','mbereg_search_getregs',
- 'mbereg_search_init','mbereg_search_pos','mbereg_search_regs',
- 'mbereg_search_setpos','mbregex_encoding','mbsplit','mbstrcut',
- 'mbstrlen','mbstrpos','mbstrrpos','mbsubstr','mb_check_encoding',
- 'mb_convert_case','mb_convert_encoding','mb_convert_kana',
- 'mb_convert_variables','mb_decode_mimeheader',
- 'mb_decode_numericentity','mb_detect_encoding','mb_detect_order',
- 'mb_encode_mimeheader','mb_encode_numericentity','mb_ereg',
- 'mb_eregi','mb_eregi_replace','mb_ereg_match','mb_ereg_replace',
- 'mb_ereg_search','mb_ereg_search_getpos','mb_ereg_search_getregs',
- 'mb_ereg_search_init','mb_ereg_search_pos','mb_ereg_search_regs',
- 'mb_ereg_search_setpos','mb_get_info','mb_http_input',
- 'mb_http_output','mb_internal_encoding','mb_language',
- 'mb_list_encodings','mb_output_handler','mb_parse_str',
- 'mb_preferred_mime_name','mb_regex_encoding','mb_regex_set_options',
- 'mb_send_mail','mb_split','mb_strcut','mb_strimwidth','mb_stripos',
- 'mb_stristr','mb_strlen','mb_strpos','mb_strrchr','mb_strrichr',
- 'mb_strripos','mb_strrpos','mb_strstr','mb_strtolower',
- 'mb_strtoupper','mb_strwidth','mb_substitute_character','mb_substr',
- 'mb_substr_count','mcrypt_cbc','mcrypt_cfb','mcrypt_create_iv',
- 'mcrypt_decrypt','mcrypt_ecb','mcrypt_enc_get_algorithms_name',
- 'mcrypt_enc_get_block_size','mcrypt_enc_get_iv_size',
- 'mcrypt_enc_get_key_size','mcrypt_enc_get_modes_name',
- 'mcrypt_enc_get_supported_key_sizes',
- 'mcrypt_enc_is_block_algorithm',
- 'mcrypt_enc_is_block_algorithm_mode','mcrypt_enc_is_block_mode',
- 'mcrypt_enc_self_test','mcrypt_encrypt','mcrypt_generic',
- 'mcrypt_generic_deinit','mcrypt_generic_end','mcrypt_generic_init',
- 'mcrypt_get_block_size','mcrypt_get_cipher_name',
- 'mcrypt_get_iv_size','mcrypt_get_key_size','mcrypt_list_algorithms',
- 'mcrypt_list_modes','mcrypt_module_close',
- 'mcrypt_module_get_algo_block_size',
- 'mcrypt_module_get_algo_key_size',
- 'mcrypt_module_get_supported_key_sizes',
- 'mcrypt_module_is_block_algorithm',
- 'mcrypt_module_is_block_algorithm_mode',
- 'mcrypt_module_is_block_mode','mcrypt_module_open',
- 'mcrypt_module_self_test','mcrypt_ofb','md5','md5_file',
- 'mdecrypt_generic','memcache_add','memcache_add_server',
- 'memcache_close','memcache_connect','memcache_debug',
- 'memcache_decrement','memcache_delete','memcache_flush',
- 'memcache_get','memcache_get_extended_stats',
- 'memcache_get_server_status','memcache_get_stats',
- 'memcache_get_version','memcache_increment','memcache_pconnect',
- 'memcache_replace','memcache_set','memcache_set_compress_threshold',
- 'memcache_set_server_params','memory_get_peak_usage',
- 'memory_get_usage','metaphone','mhash','mhash_count',
- 'mhash_get_block_size','mhash_get_hash_name','mhash_keygen_s2k',
- 'method_exists','microtime','mime_content_type','min',
- 'ming_keypress','ming_setcubicthreshold','ming_setscale',
- 'ming_useconstants','ming_useswfversion','mkdir','mktime',
- 'money_format','move_uploaded_file','msql','msql_affected_rows',
- 'msql_close','msql_connect','msql_create_db','msql_createdb',
- 'msql_data_seek','msql_db_query','msql_dbname','msql_drop_db',
- 'msql_dropdb','msql_error','msql_fetch_array','msql_fetch_field',
- 'msql_fetch_object','msql_fetch_row','msql_field_flags',
- 'msql_field_len','msql_field_name','msql_field_seek',
- 'msql_field_table','msql_field_type','msql_fieldflags',
- 'msql_fieldlen','msql_fieldname','msql_fieldtable','msql_fieldtype',
- 'msql_free_result','msql_freeresult','msql_list_dbs',
- 'msql_list_fields','msql_list_tables','msql_listdbs',
- 'msql_listfields','msql_listtables','msql_num_fields',
- 'msql_num_rows','msql_numfields','msql_numrows','msql_pconnect',
- 'msql_query','msql_regcase','msql_result','msql_select_db',
- 'msql_selectdb','msql_tablename','mssql_bind','mssql_close',
- 'mssql_connect','mssql_data_seek','mssql_execute',
- 'mssql_fetch_array','mssql_fetch_assoc','mssql_fetch_batch',
- 'mssql_fetch_field','mssql_fetch_object','mssql_fetch_row',
- 'mssql_field_length','mssql_field_name','mssql_field_seek',
- 'mssql_field_type','mssql_free_result','mssql_free_statement',
- 'mssql_get_last_message','mssql_guid_string','mssql_init',
- 'mssql_min_error_severity','mssql_min_message_severity',
- 'mssql_next_result','mssql_num_fields','mssql_num_rows',
- 'mssql_pconnect','mssql_query','mssql_result','mssql_rows_affected',
- 'mssql_select_db','mt_getrandmax','mt_rand','mt_srand','mysql',
- 'mysql_affected_rows','mysql_client_encoding','mysql_close',
- 'mysql_connect','mysql_createdb','mysql_create_db',
- 'mysql_data_seek','mysql_dbname','mysql_db_name','mysql_db_query',
- 'mysql_dropdb','mysql_drop_db','mysql_errno','mysql_error',
- 'mysql_escape_string','mysql_fetch_array','mysql_fetch_assoc',
- 'mysql_fetch_field','mysql_fetch_lengths','mysql_fetch_object',
- 'mysql_fetch_row','mysql_fieldflags','mysql_fieldlen',
- 'mysql_fieldname','mysql_fieldtable','mysql_fieldtype',
- 'mysql_field_flags','mysql_field_len','mysql_field_name',
- 'mysql_field_seek','mysql_field_table','mysql_field_type',
- 'mysql_freeresult','mysql_free_result','mysql_get_client_info',
- 'mysql_get_host_info','mysql_get_proto_info',
- 'mysql_get_server_info','mysql_info','mysql_insert_id',
- 'mysql_listdbs','mysql_listfields','mysql_listtables',
- 'mysql_list_dbs','mysql_list_fields','mysql_list_processes',
- 'mysql_list_tables','mysql_numfields','mysql_numrows',
- 'mysql_num_fields','mysql_num_rows','mysql_pconnect','mysql_ping',
- 'mysql_query','mysql_real_escape_string','mysql_result',
- 'mysql_selectdb','mysql_select_db','mysql_set_charset','mysql_stat',
- 'mysql_tablename','mysql_table_name','mysql_thread_id',
- 'mysql_unbuffered_query','mysqli_affected_rows','mysqli_autocommit',
- 'mysqli_bind_param','mysqli_bind_result','mysqli_change_user',
- 'mysqli_character_set_name','mysqli_client_encoding','mysqli_close',
- 'mysqli_commit','mysqli_connect','mysqli_connect_errno',
- 'mysqli_connect_error','mysqli_data_seek','mysqli_debug',
- 'mysqli_disable_reads_from_master','mysqli_disable_rpl_parse',
- 'mysqli_dump_debug_info','mysqli_embedded_server_end',
- 'mysqli_embedded_server_start','mysqli_enable_reads_from_master',
- 'mysqli_enable_rpl_parse','mysqli_errno','mysqli_error',
- 'mysqli_escape_string','mysqli_execute','mysqli_fetch',
- 'mysqli_fetch_array','mysqli_fetch_assoc','mysqli_fetch_field',
- 'mysqli_fetch_field_direct','mysqli_fetch_fields',
- 'mysqli_fetch_lengths','mysqli_fetch_object','mysqli_fetch_row',
- 'mysqli_field_count','mysqli_field_seek','mysqli_field_tell',
- 'mysqli_free_result','mysqli_get_charset','mysqli_get_client_info',
- 'mysqli_get_client_version','mysqli_get_host_info',
- 'mysqli_get_metadata','mysqli_get_proto_info',
- 'mysqli_get_server_info','mysqli_get_server_version',
- 'mysqli_get_warnings','mysqli_info','mysqli_init',
- 'mysqli_insert_id','mysqli_kill','mysqli_master_query',
- 'mysqli_more_results','mysqli_multi_query','mysqli_next_result',
- 'mysqli_num_fields','mysqli_num_rows','mysqli_options',
- 'mysqli_param_count','mysqli_ping','mysqli_prepare','mysqli_query',
- 'mysqli_real_connect','mysqli_real_escape_string',
- 'mysqli_real_query','mysqli_report','mysqli_rollback',
- 'mysqli_rpl_parse_enabled','mysqli_rpl_probe',
- 'mysqli_rpl_query_type','mysqli_select_db','mysqli_send_long_data',
- 'mysqli_send_query','mysqli_set_charset',
- 'mysqli_set_local_infile_default','mysqli_set_local_infile_handler',
- 'mysqli_set_opt','mysqli_slave_query','mysqli_sqlstate',
- 'mysqli_ssl_set','mysqli_stat','mysqli_stmt_affected_rows',
- 'mysqli_stmt_attr_get','mysqli_stmt_attr_set',
- 'mysqli_stmt_bind_param','mysqli_stmt_bind_result',
- 'mysqli_stmt_close','mysqli_stmt_data_seek','mysqli_stmt_errno',
- 'mysqli_stmt_error','mysqli_stmt_execute','mysqli_stmt_fetch',
- 'mysqli_stmt_field_count','mysqli_stmt_free_result',
- 'mysqli_stmt_get_warnings','mysqli_stmt_init',
- 'mysqli_stmt_insert_id','mysqli_stmt_num_rows',
- 'mysqli_stmt_param_count','mysqli_stmt_prepare','mysqli_stmt_reset',
- 'mysqli_stmt_result_metadata','mysqli_stmt_send_long_data',
- 'mysqli_stmt_sqlstate','mysqli_stmt_store_result',
- 'mysqli_store_result','mysqli_thread_id','mysqli_thread_safe',
- 'mysqli_use_result','mysqli_warning_count','natcasesort','natsort',
- 'new_xmldoc','next','ngettext','nl2br','nl_langinfo',
- 'ntuser_getdomaincontroller','ntuser_getusergroups',
- 'ntuser_getuserinfo','ntuser_getuserlist','number_format',
- 'ob_clean','ob_deflatehandler','ob_end_clean','ob_end_flush',
- 'ob_etaghandler','ob_flush','ob_get_clean','ob_get_contents',
- 'ob_get_flush','ob_get_length','ob_get_level','ob_get_status',
- 'ob_gzhandler','ob_iconv_handler','ob_implicit_flush',
- 'ob_inflatehandler','ob_list_handlers','ob_start','ob_tidyhandler',
- 'octdec','odbc_autocommit','odbc_binmode','odbc_close',
- 'odbc_close_all','odbc_columnprivileges','odbc_columns',
- 'odbc_commit','odbc_connect','odbc_cursor','odbc_data_source',
- 'odbc_do','odbc_error','odbc_errormsg','odbc_exec','odbc_execute',
- 'odbc_fetch_array','odbc_fetch_into','odbc_fetch_object',
- 'odbc_fetch_row','odbc_field_len','odbc_field_name',
- 'odbc_field_num','odbc_field_precision','odbc_field_scale',
- 'odbc_field_type','odbc_foreignkeys','odbc_free_result',
- 'odbc_gettypeinfo','odbc_longreadlen','odbc_next_result',
- 'odbc_num_fields','odbc_num_rows','odbc_pconnect','odbc_prepare',
- 'odbc_primarykeys','odbc_procedurecolumns','odbc_procedures',
- 'odbc_result','odbc_result_all','odbc_rollback','odbc_setoption',
- 'odbc_specialcolumns','odbc_statistics','odbc_tableprivileges',
- 'odbc_tables','opendir','openlog','openssl_csr_export',
- 'openssl_csr_export_to_file','openssl_csr_get_public_key',
- 'openssl_csr_get_subject','openssl_csr_new','openssl_csr_sign',
- 'openssl_error_string','openssl_free_key','openssl_get_privatekey',
- 'openssl_get_publickey','openssl_open','openssl_pkcs12_export',
- 'openssl_pkcs12_export_to_file','openssl_pkcs12_read',
- 'openssl_pkcs7_decrypt','openssl_pkcs7_encrypt',
- 'openssl_pkcs7_sign','openssl_pkcs7_verify','openssl_pkey_export',
- 'openssl_pkey_export_to_file','openssl_pkey_free',
- 'openssl_pkey_get_details','openssl_pkey_get_private',
- 'openssl_pkey_get_public','openssl_pkey_new',
- 'openssl_private_decrypt','openssl_private_encrypt',
- 'openssl_public_decrypt','openssl_public_encrypt','openssl_seal',
- 'openssl_sign','openssl_verify','openssl_x509_checkpurpose',
- 'openssl_x509_check_private_key','openssl_x509_export',
- 'openssl_x509_export_to_file','openssl_x509_free',
- 'openssl_x509_parse','openssl_x509_read','ord',
- 'output_add_rewrite_var','output_reset_rewrite_vars','overload',
- 'outputdebugstring','pack','parse_ini_file','parse_str','parse_url',
- 'parsekit_compile_file','parsekit_compile_string',
- 'parsekit_func_arginfo','parsekit_opcode_flags',
- 'parsekit_opcode_name','passthru','pathinfo','pclose',
- 'pdf_add_bookmark','pdf_add_launchlink','pdf_add_locallink',
- 'pdf_add_nameddest','pdf_add_note','pdf_add_pdflink',
- 'pdf_add_thumbnail','pdf_add_weblink','pdf_arc','pdf_arcn',
- 'pdf_attach_file','pdf_begin_font','pdf_begin_glyph',
- 'pdf_begin_page','pdf_begin_pattern','pdf_begin_template',
- 'pdf_circle','pdf_clip','pdf_close','pdf_close_image',
- 'pdf_close_pdi','pdf_close_pdi_page','pdf_closepath',
- 'pdf_closepath_fill_stroke','pdf_closepath_stroke','pdf_concat',
- 'pdf_continue_text','pdf_create_gstate','pdf_create_pvf',
- 'pdf_curveto','pdf_delete','pdf_delete_pvf','pdf_encoding_set_char',
- 'pdf_end_font','pdf_end_glyph','pdf_end_page','pdf_end_pattern',
- 'pdf_end_template','pdf_endpath','pdf_fill','pdf_fill_imageblock',
- 'pdf_fill_pdfblock','pdf_fill_stroke','pdf_fill_textblock',
- 'pdf_findfont','pdf_fit_image','pdf_fit_pdi_page',
- 'pdf_fit_textline','pdf_get_apiname','pdf_get_buffer',
- 'pdf_get_errmsg','pdf_get_errnum','pdf_get_parameter',
- 'pdf_get_pdi_parameter','pdf_get_pdi_value','pdf_get_value',
- 'pdf_initgraphics','pdf_lineto','pdf_load_font',
- 'pdf_load_iccprofile','pdf_load_image','pdf_makespotcolor',
- 'pdf_moveto','pdf_new','pdf_open_ccitt','pdf_open_file',
- 'pdf_open_image','pdf_open_image_file','pdf_open_pdi',
- 'pdf_open_pdi_page','pdf_place_image','pdf_place_pdi_page',
- 'pdf_process_pdi','pdf_rect','pdf_restore','pdf_rotate','pdf_save',
- 'pdf_scale','pdf_set_border_color','pdf_set_border_dash',
- 'pdf_set_border_style','pdf_set_gstate','pdf_set_info',
- 'pdf_set_parameter','pdf_set_text_pos','pdf_set_value',
- 'pdf_setcolor','pdf_setdash','pdf_setdashpattern','pdf_setflat',
- 'pdf_setfont','pdf_setlinecap','pdf_setlinejoin','pdf_setlinewidth',
- 'pdf_setmatrix','pdf_setmiterlimit','pdf_setpolydash','pdf_shading',
- 'pdf_shading_pattern','pdf_shfill','pdf_show','pdf_show_boxed',
- 'pdf_show_xy','pdf_skew','pdf_stringwidth','pdf_stroke',
- 'pdf_translate','pdo_drivers','pfsockopen','pg_affected_rows',
- 'pg_cancel_query','pg_clientencoding','pg_client_encoding',
- 'pg_close','pg_cmdtuples','pg_connect','pg_connection_busy',
- 'pg_connection_reset','pg_connection_status','pg_convert',
- 'pg_copy_from','pg_copy_to','pg_dbname','pg_delete','pg_end_copy',
- 'pg_errormessage','pg_escape_bytea','pg_escape_string','pg_exec',
- 'pg_execute','pg_fetch_all','pg_fetch_all_columns','pg_fetch_array',
- 'pg_fetch_assoc','pg_fetch_object','pg_fetch_result','pg_fetch_row',
- 'pg_fieldisnull','pg_fieldname','pg_fieldnum','pg_fieldprtlen',
- 'pg_fieldsize','pg_fieldtype','pg_field_is_null','pg_field_name',
- 'pg_field_num','pg_field_prtlen','pg_field_size','pg_field_table',
- 'pg_field_type','pg_field_type_oid','pg_free_result',
- 'pg_freeresult','pg_get_notify','pg_get_pid','pg_get_result',
- 'pg_getlastoid','pg_host','pg_insert','pg_last_error',
- 'pg_last_notice','pg_last_oid','pg_loclose','pg_locreate',
- 'pg_loexport','pg_loimport','pg_loopen','pg_loread','pg_loreadall',
- 'pg_lounlink','pg_lowrite','pg_lo_close','pg_lo_create',
- 'pg_lo_export','pg_lo_import','pg_lo_open','pg_lo_read',
- 'pg_lo_read_all','pg_lo_seek','pg_lo_tell','pg_lo_unlink',
- 'pg_lo_write','pg_meta_data','pg_numfields','pg_numrows',
- 'pg_num_fields','pg_num_rows','pg_options','pg_parameter_status',
- 'pg_pconnect','pg_ping','pg_port','pg_prepare','pg_put_line',
- 'pg_query','pg_query_params','pg_result','pg_result_error',
- 'pg_result_error_field','pg_result_seek','pg_result_status',
- 'pg_select','pg_send_execute','pg_send_prepare','pg_send_query',
- 'pg_send_query_params','pg_set_client_encoding',
- 'pg_set_error_verbosity','pg_setclientencoding','pg_trace',
- 'pg_transaction_status','pg_tty','pg_unescape_bytea','pg_untrace',
- 'pg_update','pg_version','php_egg_logo_guid','php_ini_loaded_file',
- 'php_ini_scanned_files','php_logo_guid','php_real_logo_guid',
- 'php_sapi_name','php_strip_whitespace','php_uname','phpcredits',
- 'phpdoc_xml_from_string','phpinfo','phpversion','pi','png2wbmp',
- 'pop3_close','pop3_delete_message','pop3_get_account_size',
- 'pop3_get_message','pop3_get_message_count',
- 'pop3_get_message_header','pop3_get_message_ids',
- 'pop3_get_message_size','pop3_get_message_sizes','pop3_open',
- 'pop3_undelete','popen','pos','posix_ctermid','posix_errno',
- 'posix_getcwd','posix_getegid','posix_geteuid','posix_getgid',
- 'posix_getgrgid','posix_getgrnam','posix_getgroups',
- 'posix_getlogin','posix_getpgid','posix_getpgrp','posix_getpid',
- 'posix_getppid','posix_getpwnam','posix_getpwuid','posix_getrlimit',
- 'posix_getsid','posix_getuid','posix_get_last_error','posix_isatty',
- 'posix_kill','posix_mkfifo','posix_setegid','posix_seteuid',
- 'posix_setgid','posix_setpgid','posix_setsid','posix_setuid',
- 'posix_strerror','posix_times','posix_ttyname','posix_uname','pow',
- 'preg_grep','preg_last_error','preg_match','preg_match_all',
- 'preg_quote','preg_replace','preg_replace_callback','preg_split',
- 'prev','print_r','printf','proc_close','proc_get_status',
- 'proc_open','proc_terminate','putenv','quoted_printable_decode',
- 'quotemeta','rad2deg','radius_acct_open','radius_add_server',
- 'radius_auth_open','radius_close','radius_config',
- 'radius_create_request','radius_cvt_addr','radius_cvt_int',
- 'radius_cvt_string','radius_demangle','radius_demangle_mppe_key',
- 'radius_get_attr','radius_get_vendor_attr','radius_put_addr',
- 'radius_put_attr','radius_put_int','radius_put_string',
- 'radius_put_vendor_addr','radius_put_vendor_attr',
- 'radius_put_vendor_int','radius_put_vendor_string',
- 'radius_request_authenticator','radius_send_request',
- 'radius_server_secret','radius_strerror','rand','range',
- 'rawurldecode','rawurlencode','read_exif_data','readdir','readfile',
- 'readgzfile','readlink','realpath','reg_close_key','reg_create_key',
- 'reg_enum_key','reg_enum_value','reg_get_value','reg_open_key',
- 'reg_set_value','register_shutdown_function',
- 'register_tick_function','rename','res_close','res_get','res_list',
- 'res_list_type','res_open','res_set','reset',
- 'restore_error_handler','restore_include_path','rewind','rewinddir',
- 'rmdir','round','rsort','rtrim','runkit_class_adopt',
- 'runkit_class_emancipate','runkit_constant_add',
- 'runkit_constant_redefine','runkit_constant_remove',
- 'runkit_default_property_add','runkit_function_add',
- 'runkit_function_copy','runkit_function_redefine',
- 'runkit_function_remove','runkit_function_rename','runkit_import',
- 'runkit_lint','runkit_lint_file','runkit_method_add',
- 'runkit_method_copy','runkit_method_redefine',
- 'runkit_method_remove','runkit_method_rename','runkit_object_id',
- 'runkit_return_value_used','runkit_sandbox_output_handler',
- 'runkit_superglobals','runkit_zval_inspect','scandir','sem_acquire',
- 'sem_get','sem_release','sem_remove','serialize',
- 'session_cache_expire','session_cache_limiter','session_commit',
- 'session_decode','session_destroy','session_encode',
- 'session_get_cookie_params','session_id','session_is_registered',
- 'session_module_name','session_name','session_regenerate_id',
- 'session_register','session_save_path','session_set_cookie_params',
- 'session_set_save_handler','session_start','session_unregister',
- 'session_unset','session_write_close','set_content',
- 'set_error_handler','set_file_buffer','set_include_path',
- 'set_magic_quotes_runtime','set_socket_blocking','set_time_limit',
- 'setcookie','setlocale','setrawcookie','settype','sha1','sha1_file',
- 'shell_exec','shmop_close','shmop_delete','shmop_open','shmop_read',
- 'shmop_size','shmop_write','shm_attach','shm_detach','shm_get_var',
- 'shm_put_var','shm_remove','shm_remove_var','show_source','shuffle',
- 'similar_text','simplexml_import_dom','simplexml_load_file',
- 'simplexml_load_string','sin','sinh','sizeof','sleep','smtp_close',
- 'smtp_cmd_data','smtp_cmd_mail','smtp_cmd_rcpt','smtp_connect',
- 'snmp_get_quick_print','snmp_get_valueretrieval','snmp_read_mib',
- 'snmp_set_quick_print','snmp_set_valueretrieval','snmp2_get',
- 'snmp2_getnext','snmp2_real_walk','snmp2_set','snmp2_walk',
- 'snmp3_get','snmp3_getnext','snmp3_real_walk','snmp3_set',
- 'snmp3_walk','snmpget','snmpgetnext','snmprealwalk','snmpset',
- 'snmpwalk','snmpwalkoid','socket_accept','socket_bind',
- 'socket_clear_error','socket_close','socket_connect',
- 'socket_create','socket_create_listen','socket_create_pair',
- 'socket_getopt','socket_getpeername','socket_getsockname',
- 'socket_get_option','socket_get_status','socket_iovec_add',
- 'socket_iovec_alloc','socket_iovec_delete','socket_iovec_fetch',
- 'socket_iovec_free','socket_iovec_set','socket_last_error',
- 'socket_listen','socket_read','socket_readv','socket_recv',
- 'socket_recvfrom','socket_recvmsg','socket_select','socket_send',
- 'socket_sendmsg','socket_sendto','socket_setopt','socket_set_block',
- 'socket_set_blocking','socket_set_nonblock','socket_set_option',
- 'socket_set_timeout','socket_shutdown','socket_strerror',
- 'socket_write','socket_writev','sort','soundex','spl_autoload',
- 'spl_autoload_call','spl_autoload_extensions',
- 'spl_autoload_functions','spl_autoload_register',
- 'spl_autoload_unregister','spl_classes','spl_object_hash','split',
- 'spliti','sprintf','sql_regcase','sqlite_array_query',
- 'sqlite_busy_timeout','sqlite_changes','sqlite_close',
- 'sqlite_column','sqlite_create_aggregate','sqlite_create_function',
- 'sqlite_current','sqlite_error_string','sqlite_escape_string',
- 'sqlite_exec','sqlite_factory','sqlite_fetch_all',
- 'sqlite_fetch_array','sqlite_fetch_column_types',
- 'sqlite_fetch_object','sqlite_fetch_single','sqlite_fetch_string',
- 'sqlite_field_name','sqlite_has_more','sqlite_has_prev',
- 'sqlite_last_error','sqlite_last_insert_rowid','sqlite_libencoding',
- 'sqlite_libversion','sqlite_next','sqlite_num_fields',
- 'sqlite_num_rows','sqlite_open','sqlite_popen','sqlite_prev',
- 'sqlite_query','sqlite_rewind','sqlite_seek','sqlite_single_query',
- 'sqlite_udf_decode_binary','sqlite_udf_encode_binary',
- 'sqlite_unbuffered_query','sqlite_valid','sqrt','srand','sscanf',
- 'ssh2_auth_hostbased_file','ssh2_auth_none','ssh2_auth_password',
- 'ssh2_auth_pubkey_file','ssh2_connect','ssh2_exec',
- 'ssh2_fetch_stream','ssh2_fingerprint','ssh2_forward_accept',
- 'ssh2_forward_listen','ssh2_methods_negotiated','ssh2_poll',
- 'ssh2_publickey_add','ssh2_publickey_init','ssh2_publickey_list',
- 'ssh2_publickey_remove','ssh2_scp_recv','ssh2_scp_send','ssh2_sftp',
- 'ssh2_sftp_lstat','ssh2_sftp_mkdir','ssh2_sftp_readlink',
- 'ssh2_sftp_realpath','ssh2_sftp_rename','ssh2_sftp_rmdir',
- 'ssh2_sftp_stat','ssh2_sftp_symlink','ssh2_sftp_unlink',
- 'ssh2_shell','ssh2_tunnel','stat','stats_absolute_deviation',
- 'stats_cdf_beta','stats_cdf_binomial','stats_cdf_cauchy',
- 'stats_cdf_chisquare','stats_cdf_exponential','stats_cdf_f',
- 'stats_cdf_gamma','stats_cdf_laplace','stats_cdf_logistic',
- 'stats_cdf_negative_binomial','stats_cdf_noncentral_chisquare',
- 'stats_cdf_noncentral_f','stats_cdf_noncentral_t',
- 'stats_cdf_normal','stats_cdf_poisson','stats_cdf_t',
- 'stats_cdf_uniform','stats_cdf_weibull','stats_covariance',
- 'stats_dens_beta','stats_dens_cauchy','stats_dens_chisquare',
- 'stats_dens_exponential','stats_dens_f','stats_dens_gamma',
- 'stats_dens_laplace','stats_dens_logistic','stats_dens_normal',
- 'stats_dens_pmf_binomial','stats_dens_pmf_hypergeometric',
- 'stats_dens_pmf_negative_binomial','stats_dens_pmf_poisson',
- 'stats_dens_t','stats_dens_uniform','stats_dens_weibull',
- 'stats_harmonic_mean','stats_kurtosis','stats_rand_gen_beta',
- 'stats_rand_gen_chisquare','stats_rand_gen_exponential',
- 'stats_rand_gen_f','stats_rand_gen_funiform','stats_rand_gen_gamma',
- 'stats_rand_gen_ipoisson','stats_rand_gen_iuniform',
- 'stats_rand_gen_noncenral_f','stats_rand_gen_noncentral_chisquare',
- 'stats_rand_gen_noncentral_t','stats_rand_gen_normal',
- 'stats_rand_gen_t','stats_rand_getsd','stats_rand_ibinomial',
- 'stats_rand_ibinomial_negative','stats_rand_ignlgi',
- 'stats_rand_phrase_to_seeds','stats_rand_ranf','stats_rand_setall',
- 'stats_skew','stats_standard_deviation','stats_stat_binomial_coef',
- 'stats_stat_correlation','stats_stat_factorial',
- 'stats_stat_independent_t','stats_stat_innerproduct',
- 'stats_stat_paired_t','stats_stat_percentile','stats_stat_powersum',
- 'stats_variance','strcasecmp','strchr','strcmp','strcoll','strcspn',
- 'stream_bucket_append','stream_bucket_make_writeable',
- 'stream_bucket_new','stream_bucket_prepend','stream_context_create',
- 'stream_context_get_default','stream_context_get_options',
- 'stream_context_set_default','stream_context_set_option',
- 'stream_context_set_params','stream_copy_to_stream',
- 'stream_encoding','stream_filter_append','stream_filter_prepend',
- 'stream_filter_register','stream_filter_remove',
- 'stream_get_contents','stream_get_filters','stream_get_line',
- 'stream_get_meta_data','stream_get_transports',
- 'stream_get_wrappers','stream_is_local',
- 'stream_notification_callback','stream_register_wrapper',
- 'stream_resolve_include_path','stream_select','stream_set_blocking',
- 'stream_set_timeout','stream_set_write_buffer',
- 'stream_socket_accept','stream_socket_client',
- 'stream_socket_enable_crypto','stream_socket_get_name',
- 'stream_socket_pair','stream_socket_recvfrom',
- 'stream_socket_sendto','stream_socket_server',
- 'stream_socket_shutdown','stream_supports_lock',
- 'stream_wrapper_register','stream_wrapper_restore',
- 'stream_wrapper_unregister','strftime','stripcslashes','stripos',
- 'stripslashes','strip_tags','stristr','strlen','strnatcasecmp',
- 'strnatcmp','strpbrk','strncasecmp','strncmp','strpos','strrchr',
- 'strrev','strripos','strrpos','strspn','strstr','strtok',
- 'strtolower','strtotime','strtoupper','strtr','strval',
- 'str_ireplace','str_pad','str_repeat','str_replace','str_rot13',
- 'str_split','str_shuffle','str_word_count','substr',
- 'substr_compare','substr_count','substr_replace','svn_add',
- 'svn_auth_get_parameter','svn_auth_set_parameter','svn_cat',
- 'svn_checkout','svn_cleanup','svn_client_version','svn_commit',
- 'svn_diff','svn_export','svn_fs_abort_txn','svn_fs_apply_text',
- 'svn_fs_begin_txn2','svn_fs_change_node_prop','svn_fs_check_path',
- 'svn_fs_contents_changed','svn_fs_copy','svn_fs_delete',
- 'svn_fs_dir_entries','svn_fs_file_contents','svn_fs_file_length',
- 'svn_fs_is_dir','svn_fs_is_file','svn_fs_make_dir',
- 'svn_fs_make_file','svn_fs_node_created_rev','svn_fs_node_prop',
- 'svn_fs_props_changed','svn_fs_revision_prop',
- 'svn_fs_revision_root','svn_fs_txn_root','svn_fs_youngest_rev',
- 'svn_import','svn_info','svn_log','svn_ls','svn_repos_create',
- 'svn_repos_fs','svn_repos_fs_begin_txn_for_commit',
- 'svn_repos_fs_commit_txn','svn_repos_hotcopy','svn_repos_open',
- 'svn_repos_recover','svn_status','svn_update','symlink',
- 'sys_get_temp_dir','syslog','system','tan','tanh','tempnam',
- 'textdomain','thread_get','thread_include','thread_lock',
- 'thread_lock_try','thread_mutex_destroy','thread_mutex_init',
- 'thread_set','thread_start','thread_unlock','tidy_access_count',
- 'tidy_clean_repair','tidy_config_count','tidy_diagnose',
- 'tidy_error_count','tidy_get_body','tidy_get_config',
- 'tidy_get_error_buffer','tidy_get_head','tidy_get_html',
- 'tidy_get_html_ver','tidy_get_output','tidy_get_release',
- 'tidy_get_root','tidy_get_status','tidy_getopt','tidy_is_xhtml',
- 'tidy_is_xml','tidy_parse_file','tidy_parse_string',
- 'tidy_repair_file','tidy_repair_string','tidy_warning_count','time',
- 'timezone_abbreviations_list','timezone_identifiers_list',
- 'timezone_name_from_abbr','timezone_name_get','timezone_offset_get',
- 'timezone_open','timezone_transitions_get','tmpfile',
- 'token_get_all','token_name','touch','trigger_error',
- 'transliterate','transliterate_filters_get','trim','uasort',
- 'ucfirst','ucwords','uksort','umask','uniqid','unixtojd','unlink',
- 'unpack','unregister_tick_function','unserialize','unset',
- 'urldecode','urlencode','user_error','use_soap_error_handler',
- 'usleep','usort','utf8_decode','utf8_encode','var_dump',
- 'var_export','variant_abs','variant_add','variant_and',
- 'variant_cast','variant_cat','variant_cmp',
- 'variant_date_from_timestamp','variant_date_to_timestamp',
- 'variant_div','variant_eqv','variant_fix','variant_get_type',
- 'variant_idiv','variant_imp','variant_int','variant_mod',
- 'variant_mul','variant_neg','variant_not','variant_or',
- 'variant_pow','variant_round','variant_set','variant_set_type',
- 'variant_sub','variant_xor','version_compare','virtual','vfprintf',
- 'vprintf','vsprintf','wddx_add_vars','wddx_deserialize',
- 'wddx_packet_end','wddx_packet_start','wddx_serialize_value',
- 'wddx_serialize_vars','win_beep','win_browse_file',
- 'win_browse_folder','win_create_link','win_message_box',
- 'win_play_wav','win_shell_execute','win32_create_service',
- 'win32_delete_service','win32_get_last_control_message',
- 'win32_ps_list_procs','win32_ps_stat_mem','win32_ps_stat_proc',
- 'win32_query_service_status','win32_scheduler_delete_task',
- 'win32_scheduler_enum_tasks','win32_scheduler_get_task_info',
- 'win32_scheduler_run','win32_scheduler_set_task_info',
- 'win32_set_service_status','win32_start_service',
- 'win32_start_service_ctrl_dispatcher','win32_stop_service',
- 'wordwrap','xml_error_string','xml_get_current_byte_index',
- 'xml_get_current_column_number','xml_get_current_line_number',
- 'xml_get_error_code','xml_parse','xml_parser_create',
- 'xml_parser_create_ns','xml_parser_free','xml_parser_get_option',
- 'xml_parser_set_option','xml_parse_into_struct',
- 'xml_set_character_data_handler','xml_set_default_handler',
- 'xml_set_element_handler','xml_set_end_namespace_decl_handler',
- 'xml_set_external_entity_ref_handler',
- 'xml_set_notation_decl_handler','xml_set_object',
- 'xml_set_processing_instruction_handler',
- 'xml_set_start_namespace_decl_handler',
- 'xml_set_unparsed_entity_decl_handler','xmldoc','xmldocfile',
- 'xmlrpc_decode','xmlrpc_decode_request','xmlrpc_encode',
- 'xmlrpc_encode_request','xmlrpc_get_type','xmlrpc_is_fault',
- 'xmlrpc_parse_method_descriptions',
- 'xmlrpc_server_add_introspection_data','xmlrpc_server_call_method',
- 'xmlrpc_server_create','xmlrpc_server_destroy',
- 'xmlrpc_server_register_introspection_callback',
- 'xmlrpc_server_register_method','xmlrpc_set_type','xmltree',
- 'xmlwriter_end_attribute','xmlwriter_end_cdata',
- 'xmlwriter_end_comment','xmlwriter_end_document',
- 'xmlwriter_end_dtd','xmlwriter_end_dtd_attlist',
- 'xmlwriter_end_dtd_element','xmlwriter_end_dtd_entity',
- 'xmlwriter_end_element','xmlwriter_end_pi','xmlwriter_flush',
- 'xmlwriter_full_end_element','xmlwriter_open_memory',
- 'xmlwriter_open_uri','xmlwriter_output_memory',
- 'xmlwriter_set_indent','xmlwriter_set_indent_string',
- 'xmlwriter_start_attribute','xmlwriter_start_attribute_ns',
- 'xmlwriter_start_cdata','xmlwriter_start_comment',
- 'xmlwriter_start_document','xmlwriter_start_dtd',
- 'xmlwriter_start_dtd_attlist','xmlwriter_start_dtd_element',
- 'xmlwriter_start_dtd_entity','xmlwriter_start_element',
- 'xmlwriter_start_element_ns','xmlwriter_start_pi','xmlwriter_text',
- 'xmlwriter_write_attribute','xmlwriter_write_attribute_ns',
- 'xmlwriter_write_cdata','xmlwriter_write_comment',
- 'xmlwriter_write_dtd','xmlwriter_write_dtd_attlist',
- 'xmlwriter_write_dtd_element','xmlwriter_write_dtd_entity',
- 'xmlwriter_write_element','xmlwriter_write_element_ns',
- 'xmlwriter_write_pi','xmlwriter_write_raw','xpath_eval',
- 'xpath_eval_expression','xpath_new_context','xpath_register_ns',
- 'xpath_register_ns_auto','xptr_eval','xptr_new_context','yp_all',
- 'yp_cat','yp_errno','yp_err_string','yp_first',
- 'yp_get_default_domain','yp_master','yp_match','yp_next','yp_order',
- 'zend_current_obfuscation_level','zend_get_cfg_var','zend_get_id',
- 'zend_loader_current_file','zend_loader_enabled',
- 'zend_loader_file_encoded','zend_loader_file_licensed',
- 'zend_loader_install_license','zend_loader_version',
- 'zend_logo_guid','zend_match_hostmasks','zend_obfuscate_class_name',
- 'zend_obfuscate_function_name','zend_optimizer_version',
- 'zend_runtime_obfuscate','zend_version','zip_close',
- 'zip_entry_close','zip_entry_compressedsize',
- 'zip_entry_compressionmethod','zip_entry_filesize','zip_entry_name',
- 'zip_entry_open','zip_entry_read','zip_open','zip_read',
- 'zlib_get_coding_type'
- ),
- 4 => array(
- 'DEFAULT_INCLUDE_PATH', 'DIRECTORY_SEPARATOR', 'E_ALL',
- 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_CORE_ERROR',
- 'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', 'E_STRICT',
- 'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', 'E_WARNING',
- 'ENT_COMPAT','ENT_QUOTES','ENT_NOQUOTES',
- 'false', 'null', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR',
- 'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR',
- 'PHP_EXTENSION_DIR', 'PHP_LIBDIR',
- 'PHP_LOCALSTATEDIR', 'PHP_OS',
- 'PHP_OUTPUT_HANDLER_CONT', 'PHP_OUTPUT_HANDLER_END',
- 'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR',
- 'PHP_VERSION', 'true', '__CLASS__', '__FILE__', '__FUNCTION__',
- '__LINE__', '__METHOD__'
- )
- ),
- 'SYMBOLS' => array(
- 1 => array(
- '<%', '<%=', '%>', '<?', '<?=', '?>'
- ),
- 0 => array(
- '(', ')', '[', ']', '{', '}',
- '!', '@', '%', '&', '|', '/',
- '<', '>',
- '=', '-', '+', '*',
- '.', ':', ',', ';'
- )
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #990000;',
- 4 => 'color: #009900; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => 'color: #666666; font-style: italic;',
- 3 => 'color: #0000cc; font-style: italic;',
- 4 => 'color: #009933; font-style: italic;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 1 => 'color: #000099; font-weight: bold;',
- 2 => 'color: #660099; font-weight: bold;',
- 3 => 'color: #660099; font-weight: bold;',
- 4 => 'color: #006699; font-weight: bold;',
- 5 => 'color: #006699; font-weight: bold; font-style: italic;',
- 6 => 'color: #009933; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;',
- 'HARD' => 'color: #0000ff;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;',
- GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
- GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
- GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
- ),
- 'METHODS' => array(
- 1 => 'color: #004000;',
- 2 => 'color: #004000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;',
- 1 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #000088;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.php.net/{FNAMEL}',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '-&gt;',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- //Variables
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<?php' => '?>'
- ),
- 1 => array(
- '<?' => '?>'
- ),
- 2 => array(
- '<%' => '%>'
- ),
- 3 => array(
- '<script language="php">' => '</script>'
- ),
- 4 => "/(<\?(?:php)?)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(\?>|\Z)/sm",
- 5 => "/(<%)(?:'(?:[^'\\\\]|\\\\.)*?'|\"(?:[^\"\\\\]|\\\\.)*?\"|\/\*(?!\*\/).*?\*\/|.)*?(%>|\Z)/sm"
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true
- ),
- 'TAB_WIDTH' => 4
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/pic16.php b/libvpx/examples/includes/geshi/geshi/pic16.php
deleted file mode 100644
index 2679788..0000000
--- a/libvpx/examples/includes/geshi/geshi/pic16.php
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-/*************************************************************************************
- * pic16.php
- * -------
- * Author: Phil Mattison (mattison@ohmikron.com)
- * Copyright: (c) 2008 Ohmikron Corp. (http://www.ohmikron.com/)
- * Release Version: 1.0.8.3
- * Date Started: 2008/07/30
- *
- * PIC16 Assembler language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/07/30 (1.0.8)
- * - First Release
- *
- * TODO (updated 2008/07/30)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'PIC16',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- /*Instructions*/
- 1 => array(
- 'addcf','adddcf','addlw','addwf','andlw','andwf','bc','bcf','bdc',
- 'bnc','bndc','bnz','bsf','btfsc','btfss','bz','call','clrc','clrdc',
- 'clrf','clrw','clrwdt','clrz','comf','decf','goto','incf','incfsz',
- 'iorlw','iorwf','lcall','lgoto','movf','movfw','movlw','movwf',
- 'option','negf','nop','retfie','retlw','return','rlf','rrf','setc',
- 'setdc','setz','skpc','skpdc','skpnc','skpndc','skpnz','skpz',
- 'sleep','subcf','subdcf','sublw','subwf','swapf','tris','tstf',
- 'xorlw','xorwf'
- ),
- /*Registers*/
- 2 => array(
- 'INDF','TMR0','OPTION','PCL','STATUS','FSR','PORTA','PORTB','PORTC',
- 'PORTD','PORTE','PORTF','TRISA','TRISB','TRISC','TRISD','TRISE',
- 'TRISF','PCLATH','INTCON','PIR1','PIE1','PCON','CMCON','VRCON',
- 'F','W'
- ),
- /*Directives*/
- 3 => array(
- '_BADRAM','BANKISEL','BANKSEL','CBLOCK','CODE','_CONFIG','CONSTANT',
- 'DA','DATA','DB','DE','#DEFINE','DT','DW','ELSE','END','ENDC',
- 'ENDIF','ENDM','ENDW','EQU','ERROR','ERRORLEVEL','EXITM','EXPAND',
- 'EXTERN','FILL','GLOBAL','IDATA','_IDLOCS','IF','IFDEF','IFNDEF',
- 'INCLUDE','#INCLUDE','LIST','LOCAL','MACRO','_MAXRAM','MESSG',
- 'NOEXPAND','NOLIST','ORG','PAGE','PAGESEL','PROCESSOR','RADIX',
- 'RES','SET','SPACE','SUBTITLE','TITLE','UDATA','UDATA_ACS',
- 'UDATA_OVR','UDATA_SHR','#UNDEFINE','VARIABLE','WHILE',
- 'D','H','O','B','A'
- ),
- ),
- 'SYMBOLS' => array('=','.',',',':'),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000a0; font-weight: bold;',
- 2 => 'color: #aa3300; font-weight: bold;',
- 3 => 'color: #0000ff;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #00a000;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #ff0000;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff7700;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff7700;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #7777ff;'
- ),
- 'REGEXPS' => array(),
- 'SCRIPT' => array()
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC |
- GESHI_NUMBER_BIN_SUFFIX |
- GESHI_NUMBER_HEX_PREFIX |
- GESHI_NUMBER_HEX_SUFFIX,
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array(),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "a-zA-Z0-9\$_\|\#>|^",
- 'DISALLOWED_AFTER' => "a-zA-Z0-9_<\|%"
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/pixelbender.php b/libvpx/examples/includes/geshi/geshi/pixelbender.php
deleted file mode 100644
index 93da0df..0000000
--- a/libvpx/examples/includes/geshi/geshi/pixelbender.php
+++ /dev/null
@@ -1,176 +0,0 @@
-<?php
-/*************************************************************************************
- * pixelbender.php
- * ----------------
- * Author: Richard Olsson (r@richardolsson.se)
- * Copyright: (c) 2008 Richard Olsson (richardolsson.se)
- * Release Version: 1.0.8.3
- * Date Started: 2008/11/16
- *
- * Pixel Bender 1.0 language file for GeSHi.
- *
- *
- * Please feel free to modify this file, although I would greatly appreciate
- * it if you would then send some feedback on why the file needed to be
- * changed, using the e-mail address above.
- *
- *
- * The colors are inspired by those used in the Pixel Bender Toolkit, with
- * some slight modifications.
- *
- * For more info on Pixel Bender, see the Adobe Labs Wiki article at
- * http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit.
- *
- * Keyword groups are defined as follows (groups marked with an asterisk
- * inherit their names from terminology used in the language specification
- * included with the Pixel Bender Toolkit, see URL above.)
- *
- * 1. languageVersion & kernel keywords
- * 2. Kernel Members *
- * 3. Types *
- * 4. Statements * & qualifiers (in, out, inout)
- * 5. Built-in functions *
- * 6. Meta-data names
- * 7. Preprocessor & Pre-defined symbols *
- *
- *
- * CHANGES
- * -------
- * 2008/11/16 (1.0.8.2)
- * - Initial release
- *
- * TODO (updated 2008/11/16)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array(
- 'LANG_NAME' => 'Pixel Bender 1.0',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'languageVersion', 'kernel'
- ),
- 2 => array(
- 'import', 'parameter', 'dependent', 'const', 'input', 'output',
- 'evaluatePixel', 'evaluateDependents', 'needed', 'changed', 'generated'
- ),
- 3 => array(
- 'bool', 'bool2', 'bool3', 'bool4', 'int', 'int2', 'int3', 'int4',
- 'float', 'float2', 'float3', 'float4', 'float2x2', 'float3x3', 'float4x4',
- 'pixel2', 'pixel3', 'pixel4', 'region', 'image1', 'image2', 'image3', 'image4',
- 'imageRef', 'void'
- ),
- 4 => array(
- 'in', 'out', 'inout', 'if', 'else', 'for', 'while', 'do', 'break',
- 'continue', 'return'
- ),
- 5 => array(
- 'radians', 'degrees', 'sin', 'cos', 'tan', 'asin', 'acos', 'atan', 'pow',
- 'exp', 'exp2', 'log', 'log2', 'sqrt', 'inverseSqrt', 'abs', 'sign', 'floor',
- 'ceil', 'fract', 'mod', 'min', 'max', 'step', 'clamp', 'mix', 'smoothStep',
- 'length', 'distance', 'dot', 'cross', 'normalize', 'matrixCompMult', 'lessThan',
- 'lessThanEqual', 'greaterThan', 'greaterThanEqual', 'equal', 'notEqual', 'any',
- 'all', 'not', 'nowhere', 'everywhere', 'transform', 'union', 'intersect',
- 'outset', 'inset', 'bounds', 'isEmpty', 'sample', 'sampleLinear', 'sampleNearest',
- 'outCoord', 'dod', 'pixelSize', 'pixelAspectRatio'
- ),
- 6 => array(
- 'namespace', 'vendor', 'version', 'minValue', 'maxValue', 'defaultValue', 'description'
- ),
- 7 => array(
- '#if', '#endif', '#ifdef', '#elif', 'defined', '#define',
- 'AIF_ATI', 'AIF_NVIDIA', 'AIF_FLASH_TARGET'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '%', '&', '|', '+', '-', '*', '/', '=', '<', '>', '?', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0033ff;',
- 2 => 'color: #0033ff; font-weight: bold;',
- 3 => 'color: #0033ff;',
- 4 => 'color: #9900cc; font-weight: bold;',
- 5 => 'color: #333333;',
- 6 => 'color: #666666;',
- 7 => 'color: #990000;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #009900;',
- 'MULTI' => 'color: #3f5fbf;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #990000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000; font-weight:bold;'
- ),
- 'METHODS' => array(
- 0 => 'color: #000000;',
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array('.'),
- 'REGEXPS' => array(),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array()
-);
-
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/plsql.php b/libvpx/examples/includes/geshi/geshi/plsql.php
deleted file mode 100644
index 2f3a2b6..0000000
--- a/libvpx/examples/includes/geshi/geshi/plsql.php
+++ /dev/null
@@ -1,256 +0,0 @@
-<?php
-/*************************************************************************************
- * plsql.php
- * -------
- * Author: Victor Engmark <victor.engmark@gmail.com>
- * Copyright: (c) 2006 Victor Engmark (http://l0b0.net/)
- * Release Version: 1.0.8.3
- * Date Started: 2006/10/26
- *
- * Oracle 9.2 PL/SQL language file for GeSHi.
- * Formatting is based on the default setup of TOAD 8.6.
- *
- * CHANGES
- * -------
- * 2006/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/10/27)
- * -------------------------
- * * Add < and > to brackets
- * * Remove symbols which are also comment delimiters / quote marks?
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'PL/SQL',
- 'COMMENT_SINGLE' => array(1 =>'--'), //http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#2930
- 'COMMENT_MULTI' => array('/*' => '*/'), //http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#2950
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array("'", '"'), //http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- //PL/SQL reserved keywords (http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/f_words.htm#LNPLS019)
- 1 => array('ZONE', 'YEAR', 'WRITE', 'WORK', 'WITH', 'WHILE', 'WHERE',
- 'WHENEVER', 'WHEN', 'VIEW', 'VARCHAR2', 'VARCHAR', 'VALUES',
- 'VALIDATE', 'USE', 'UPDATE', 'UNIQUE', 'UNION', 'TYPE', 'TRUE',
- 'TRIGGER', 'TO', 'TIMEZONE_REGION', 'TIMEZONE_MINUTE', 'TIMEZONE_HOUR',
- 'TIMEZONE_ABBR', 'TIMESTAMP', 'TIME', 'THEN', 'TABLE', 'SYNONYM',
- 'SUCCESSFUL', 'SUBTYPE', 'START', 'SQLERRM', 'SQLCODE', 'SQL', 'SPACE',
- 'SMALLINT', 'SHARE', 'SET', 'SEPARATE', 'SELECT', 'SECOND',
- 'SAVEPOINT', 'ROWTYPE', 'ROWNUM', 'ROWID', 'ROW', 'ROLLBACK',
- 'REVERSE', 'RETURN', 'RELEASE', 'RECORD', 'REAL', 'RAW', 'RANGE',
- 'RAISE', 'PUBLIC', 'PROCEDURE', 'PRIVATE', 'PRIOR', 'PRAGMA',
- 'POSITIVEN', 'POSITIVE', 'PLS_INTEGER', 'PCTFREE', 'PARTITION',
- 'PACKAGE', 'OUT', 'OTHERS', 'ORGANIZATION', 'ORDER', 'OR', 'OPTION',
- 'OPERATOR', 'OPEN', 'OPAQUE', 'ON', 'OF', 'OCIROWID', 'NUMBER_BASE',
- 'NUMBER', 'NULL', 'NOWAIT', 'NOT', 'NOCOPY', 'NEXTVAL', 'NEW',
- 'NATURALN', 'NATURAL', 'MONTH', 'MODE', 'MLSLABEL', 'MINUTE', 'MINUS',
- 'LOOP', 'LONG', 'LOCK', 'LIMITED', 'LIKE', 'LEVEL', 'JAVA',
- 'ISOLATION', 'IS', 'INTO', 'INTERVAL', 'INTERSECT', 'INTERFACE',
- 'INTEGER', 'INSERT', 'INDICATOR', 'INDEX', 'IN', 'IMMEDIATE', 'IF',
- 'HOUR', 'HEAP', 'HAVING', 'GROUP', 'GOTO', 'FUNCTION', 'FROM',
- 'FORALL', 'FOR', 'FLOAT', 'FETCH', 'FALSE', 'EXTENDS', 'EXIT',
- 'EXISTS', 'EXECUTE', 'EXCLUSIVE', 'EXCEPTION', 'END', 'ELSIF', 'ELSE',
- 'DROP', 'DO', 'DISTINCT', 'DESC', 'DELETE', 'DEFAULT', 'DECLARE',
- 'DECIMAL', 'DAY', 'DATE', 'CURSOR', 'CURRVAL', 'CURRENT', 'CREATE',
- 'CONSTANT', 'CONNECT', 'COMPRESS', 'COMMIT', 'COMMENT', 'COLLECT',
- 'CLUSTER', 'CLOSE', 'CHECK', 'CHAR_BASE', 'CHAR', 'CASE', 'BY', 'BULK',
- 'BOOLEAN', 'BODY', 'BINARY_INTEGER', 'BETWEEN', 'BEGIN', 'AUTHID',
- 'AT', 'ASC', 'AS', 'ARRAY', 'ANY', 'AND', 'ALTER', 'ALL'),
- //SQL functions (http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/toc.htm & http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96540/functions101a.htm#85925)
- 2 => array('XMLTRANSFORM', 'XMLSEQUENCE', 'XMLFOREST', 'XMLELEMENT',
- 'XMLCONCAT', 'XMLCOLATTVAL', 'XMLAGG', 'WIDTH_BUCKET', 'VSIZE',
- 'VARIANCE', 'VAR_SAMP', 'VAR_POP', 'VALUE', 'USERENV', 'USER', 'UPPER',
- 'UPDATEXML', 'UNISTR', 'UID', 'TZ_OFFSET', 'TRUNC', 'TRIM', 'TREAT',
- 'TRANSLATE', 'TO_YMINTERVAL', 'TO_TIMESTAMP_TZ', 'TO_TIMESTAMP',
- 'TO_SINGLE_BYTE', 'TO_NUMBER', 'TO_NCLOB', 'TO_NCHAR', 'TO_MULTI_BYTE',
- 'TO_LOB', 'TO_DSINTERVAL', 'TO_DATE', 'TO_CLOB', 'TO_CHAR', 'TANH',
- 'TAN', 'SYSTIMESTAMP', 'SYSDATE', 'SYS_XMLGEN', 'SYS_XMLAGG',
- 'SYS_TYPEID', 'SYS_GUID', 'SYS_EXTRACT_UTC', 'SYS_DBURIGEN',
- 'SYS_CONTEXT', 'SYS_CONNECT_BY_PATH', 'SUM', 'SUBSTR', 'STDDEV_SAMP',
- 'STDDEV_POP', 'STDDEV', 'SQRT', 'SOUNDEX', 'SINH', 'SIN', 'SIGN',
- 'SESSIONTIMEZONE', 'RTRIM', 'RPAD', 'ROWIDTONCHAR', 'ROWIDTOCHAR',
- 'ROW_NUMBER', 'ROUND', 'REPLACE', 'REGR_SYY', 'REGR_SXY', 'REGR_SXX',
- 'REGR_SLOPE', 'REGR_R2', 'REGR_INTERCEPT', 'REGR_COUNT', 'REGR_AVGY',
- 'REGR_AVGX', 'REFTOHEX', 'REF', 'RAWTONHEX', 'RAWTOHEX',
- 'RATIO_TO_REPORT', 'RANK', 'POWER', 'PERCENTILE_DISC',
- 'PERCENTILE_CONT', 'PERCENT_RANK', 'PATH', 'NVL2', 'NVL',
- 'NUMTOYMINTERVAL', 'NUMTODSINTERVAL', 'NULLIF', 'NTILE', 'NLSSORT',
- 'NLS_UPPER', 'NLS_LOWER', 'NLS_INITCAP', 'NLS_CHARSET_NAME',
- 'NLS_CHARSET_ID', 'NLS_CHARSET_DECL_LEN', 'NEXT_DAY', 'NEW_TIME',
- 'NCHR', 'MONTHS_BETWEEN', 'MOD', 'MIN', 'MAX', 'MAKE_REF', 'LTRIM',
- 'LPAD', 'LOWER', 'LOG', 'LOCALTIMESTAMP', 'LN', 'LENGTH', 'LEAST',
- 'LEAD', 'LAST_VALUE', 'LAST_DAY', 'LAST', 'LAG', 'INSTR', 'INITCAP',
- 'HEXTORAW', 'GROUPING_ID', 'GROUPING', 'GROUP_ID', 'GREATEST',
- 'FROM_TZ', 'FLOOR', 'FIRST_VALUE', 'FIRST', 'EXTRACTVALUE', 'EXTRACT',
- 'EXP', 'EXISTSNODE', 'EMPTY_CLOB', 'EMPTY_BLOB', 'DUMP', 'DEREF',
- 'DEPTH', 'DENSE_RANK', 'DECOMPOSE', 'DECODE', 'DBTIMEZONE',
- 'CURRENT_TIMESTAMP', 'CURRENT_DATE', 'CUME_DIST', 'COVAR_SAMP',
- 'COVAR_POP', 'COUNT', 'COSH', 'COS', 'CORR', 'CONVERT', 'CONCAT',
- 'COMPOSE', 'COALESCE', 'CHR', 'CHARTOROWID', 'CEIL', 'CAST', 'BITAND',
- 'BIN_TO_NUM', 'BFILENAME', 'AVG', 'ATAN2', 'ATAN', 'ASIN', 'ASCIISTR',
- 'ASCII', 'ADD_MONTHS', 'ACOS', 'ABS'),
- //PL/SQL packages (http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96612/intro2.htm#1025672)
- 3 => array('UTL_URL', 'UTL_TCP', 'UTL_SMTP', 'UTL_REF', 'UTL_RAW',
- 'UTL_PG', 'UTL_INADDR', 'UTL_HTTP', 'UTL_FILE', 'UTL_ENCODE',
- 'UTL_COLL', 'SDO_UTIL', 'SDO_TUNE', 'SDO_MIGRATE', 'SDO_LRS',
- 'SDO_GEOM', 'SDO_CS', 'DMBS_XMLQUERY', 'DMBS_FLASHBACK',
- 'DMBS_DEFER_SYS', 'DEBUG_EXTPROC', 'DBMS_XSLPROCESSOR', 'DBMS_XPLAN',
- 'DBMS_XMLSCHEMA', 'DBMS_XMLSAVE', 'DBMS_XMLPARSER', 'DBMS_XMLGEN',
- 'DBMS_XMLDOM', 'DBMS_XDBT', 'DBMS_XDB_VERSION', 'DBMS_XDB', 'DBMS_WM',
- 'DBMS_UTILITY', 'DBMS_TYPES', 'DBMS_TTS', 'DBMS_TRANSFORM',
- 'DBMS_TRANSACTION', 'DBMS_TRACE', 'DBMS_STRM_A', 'DBMS_STRM',
- 'DBMS_STORAGE_MAP', 'DBMS_STATS', 'DBMS_SQL', 'DBMS_SPACE_ADMIN',
- 'DBMS_SPACE', 'DBMS_SHARED_POOL', 'DBMS_SESSION', 'DBMS_RULE_ADM',
- 'DBMS_RULE', 'DBMS_ROWID', 'DBMS_RLS', 'DBMS_RESUMABLE',
- 'DBMS_RESOURCE_MANAGER_PRIVS', 'DBMS_RESOURCE_MANAGER', 'DBMS_REPUTIL',
- 'DBMS_REPCAT_RGT', 'DBMS_REPCAT_INSTATIATE', 'DBMS_REPCAT_ADMIN',
- 'DBMS_REPCAT', 'DBMS_REPAIR', 'DBMS_REFRESH', 'DBMS_REDEFINITION',
- 'DBMS_RECTIFIER_DIFF', 'DBMS_RANDOM', 'DBMS_PROPAGATION_ADM',
- 'DBMS_PROFILER', 'DBMS_PIPE', 'DBMS_PCLXUTIL', 'DBMS_OUTPUT',
- 'DBMS_OUTLN_EDIT', 'DBMS_OUTLN', 'DBMS_ORACLE_TRACE_USER',
- 'DBMS_ORACLE_TRACE_AGENT', 'DBMS_OLAP', 'DBMS_OFFLINE_SNAPSHOT',
- 'DBMS_OFFLINE_OG', 'DBMS_ODCI', 'DBMS_OBFUSCATION_TOOLKIT',
- 'DBMS_MVIEW', 'DBMS_MGWMSG', 'DBMS_MGWADM', 'DBMS_METADATA',
- 'DBMS_LOGSTDBY', 'DBMS_LOGMNR_D', 'DBMS_LOGMNR_CDC_SUBSCRIBE',
- 'DBMS_LOGMNR_CDC_PUBLISH', 'DBMS_LOGMNR', 'DBMS_LOCK', 'DBMS_LOB',
- 'DBMS_LIBCACHE', 'DBMS_LDAP', 'DBMS_JOB', 'DBMS_IOT',
- 'DBMS_HS_PASSTHROUGH', 'DBMS_FGA', 'DBMS_DISTRIBUTED_TRUST_ADMIN',
- 'DBMS_DESCRIBE', 'DBMS_DEFER_QUERY', 'DBMS_DEFER', 'DBMS_DEBUG',
- 'DBMS_DDL', 'DBMS_CAPTURE_ADM', 'DBMS_AW', 'DBMS_AQELM', 'DBMS_AQADM',
- 'DBMS_AQ', 'DBMS_APPLY_ADM', 'DBMS_APPLICATION_INFO', 'DBMS_ALERT',
- 'CWM2_OLAP_AW_ACCESS'),
- //PL/SQL predefined exceptions (http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/07_errs.htm#784)
- 4 => array('ZERO_DIVIDE', 'VALUE_ERROR', 'TOO_MANY_ROWS',
- 'TIMEOUT_ON_RESOURCE', 'SYS_INVALID_ROWID', 'SUBSCRIPT_OUTSIDE_LIMIT',
- 'SUBSCRIPT_BEYOND_COUNT', 'STORAGE_ERROR', 'SELF_IS_NULL',
- 'ROWTYPE_MISMATCH', 'PROGRAM_ERROR', 'NOT_LOGGED_ON', 'NO_DATA_FOUND',
- 'LOGIN_DENIED', 'INVALID_NUMBER', 'INVALID_CURSOR', 'DUP_VAL_ON_INDEX',
- 'CURSOR_ALREADY_OPEN', 'COLLECTION_IS_NULL', 'CASE_NOT_FOUND',
- 'ACCESS_INTO_NULL'),
- //Static data dictionary views (http://download-uk.oracle.com/docs/cd/B10501_01/server.920/a96536/ch2.htm)
- 5 => array('USER_REPSITES', 'USER_REPSCHEMA',
- 'USER_REPRESOLUTION_STATISTICS', 'USER_REPRESOLUTION_METHOD',
- 'USER_REPRESOLUTION', 'USER_REPRESOL_STATS_CONTROL', 'USER_REPPROP',
- 'USER_REPPRIORITY_GROUP', 'USER_REPPRIORITY',
- 'USER_REPPARAMETER_COLUMN', 'USER_REPOBJECT', 'USER_REPKEY_COLUMNS',
- 'USER_REPGROUPED_COLUMN', 'USER_REPGROUP_PRIVILEGES', 'USER_REPGROUP',
- 'USER_REPGENOBJECTS', 'USER_REPGENERATED', 'USER_REPFLAVORS',
- 'USER_REPFLAVOR_OBJECTS', 'USER_REPFLAVOR_COLUMNS', 'USER_REPDDL',
- 'USER_REPCONFLICT', 'USER_REPCOLUMN_GROUP', 'USER_REPCOLUMN',
- 'USER_REPCATLOG', 'USER_REPCAT_USER_PARM_VALUES',
- 'USER_REPCAT_USER_AUTHORIZATIONS', 'USER_REPCAT_TEMPLATE_SITES',
- 'USER_REPCAT_TEMPLATE_PARMS', 'USER_REPCAT_TEMPLATE_OBJECTS',
- 'USER_REPCAT_REFRESH_TEMPLATES', 'USER_REPCAT', 'USER_REPAUDIT_COLUMN',
- 'USER_REPAUDIT_ATTRIBUTE', 'DBA_REPSITES_NEW', 'DBA_REPSITES',
- 'DBA_REPSCHEMA', 'DBA_REPRESOLUTION_STATISTICS',
- 'DBA_REPRESOLUTION_METHOD', 'DBA_REPRESOLUTION',
- 'DBA_REPRESOL_STATS_CONTROL', 'DBA_REPPROP', 'DBA_REPPRIORITY_GROUP',
- 'DBA_REPPRIORITY', 'DBA_REPPARAMETER_COLUMN', 'DBA_REPOBJECT',
- 'DBA_REPKEY_COLUMNS', 'DBA_REPGROUPED_COLUMN',
- 'DBA_REPGROUP_PRIVILEGES', 'DBA_REPGROUP', 'DBA_REPGENOBJECTS',
- 'DBA_REPGENERATED', 'DBA_REPFLAVORS', 'DBA_REPFLAVOR_OBJECTS',
- 'DBA_REPFLAVOR_COLUMNS', 'DBA_REPEXTENSIONS', 'DBA_REPDDL',
- 'DBA_REPCONFLICT', 'DBA_REPCOLUMN_GROUP', 'DBA_REPCOLUMN',
- 'DBA_REPCATLOG', 'DBA_REPCAT_USER_PARM_VALUES',
- 'DBA_REPCAT_USER_AUTHORIZATIONS', 'DBA_REPCAT_TEMPLATE_SITES',
- 'DBA_REPCAT_TEMPLATE_PARMS', 'DBA_REPCAT_TEMPLATE_OBJECTS',
- 'DBA_REPCAT_REFRESH_TEMPLATES', 'DBA_REPCAT_EXCEPTIONS', 'DBA_REPCAT',
- 'DBA_REPAUDIT_COLUMN', 'DBA_REPAUDIT_ATTRIBUTE', 'ALL_REPSITES',
- 'ALL_REPSCHEMA', 'ALL_REPRESOLUTION_STATISTICS',
- 'ALL_REPRESOLUTION_METHOD', 'ALL_REPRESOLUTION',
- 'ALL_REPRESOL_STATS_CONTROL', 'ALL_REPPROP', 'ALL_REPPRIORITY_GROUP',
- 'ALL_REPPRIORITY', 'ALL_REPPARAMETER_COLUMN', 'ALL_REPOBJECT',
- 'ALL_REPKEY_COLUMNS', 'ALL_REPGROUPED_COLUMN',
- 'ALL_REPGROUP_PRIVILEGES', 'ALL_REPGROUP', 'ALL_REPGENOBJECTS',
- 'ALL_REPGENERATED', 'ALL_REPFLAVORS', 'ALL_REPFLAVOR_OBJECTS',
- 'ALL_REPFLAVOR_COLUMNS', 'ALL_REPDDL', 'ALL_REPCONFLICT',
- 'ALL_REPCOLUMN_GROUP', 'ALL_REPCOLUMN', 'ALL_REPCATLOG',
- 'ALL_REPCAT_USER_PARM_VALUES', 'ALL_REPCAT_USER_AUTHORIZATIONS',
- 'ALL_REPCAT_TEMPLATE_SITES', 'ALL_REPCAT_TEMPLATE_PARMS',
- 'ALL_REPCAT_TEMPLATE_OBJECTS', 'ALL_REPCAT_REFRESH_TEMPLATES',
- 'ALL_REPCAT', 'ALL_REPAUDIT_COLUMN', 'ALL_REPAUDIT_ATTRIBUTE')
- ),
- 'SYMBOLS' => array(
- //PL/SQL delimiters (http://download-uk.oracle.com/docs/cd/B10501_01/appdev.920/a96624/02_funds.htm#2732)
- '+', '%', "'", '.', '/', '(', ')', ':', ',', '*', '"', '=', '<', '>', '@', ';', '-', ':=', '=>', '||', '**', '<<', '>>', '/*', '*/', '..', '<>', '!=', '~=', '^=', '<=', '>='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #00F;',
- 2 => 'color: #000;',
- 3 => 'color: #00F;',
- 4 => 'color: #F00;',
- 5 => 'color: #800;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #080; font-style: italic;',
- 'MULTI' => 'color: #080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #00F;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #F00;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #800;'
- ),
- 'METHODS' => array(
- 0 => 'color: #0F0;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #00F;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- 0 => 'color: #0F0;'
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.oracle.com/pls/db92/db92.drilldown?word={FNAMEU}',
- 2 => 'http://www.oracle.com/pls/db92/db92.drilldown?word={FNAMEU}',
- 3 => 'http://www.oracle.com/pls/db92/db92.drilldown?word={FNAMEU}',
- 4 => 'http://www.oracle.com/pls/db92/db92.drilldown?word={FNAMEU}',
- 5 => 'http://www.oracle.com/pls/db92/db92.drilldown?word={FNAMEU}'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array()
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/povray.php b/libvpx/examples/includes/geshi/geshi/povray.php
deleted file mode 100644
index 09a8b01..0000000
--- a/libvpx/examples/includes/geshi/geshi/povray.php
+++ /dev/null
@@ -1,199 +0,0 @@
-<?php
-/*************************************************************************************
- * povray.php
- * --------
- * Author: Carl Fürstenberg (azatoth@gmail.com)
- * Copyright: © 2007 Carl Fürstenberg
- * Release Version: 1.0.8.3
- * Date Started: 2008/07/11
- *
- * Povray language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/07/11 (1.0.8)
- * - initial import to GeSHi SVN
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'POVRAY',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'yes', 'wrinkles', 'wood', 'width', 'waves', 'water_level', 'warp', 'vturbulence',
- 'vstr', 'vrotate', 'vnormalize', 'vlength', 'vcross', 'vaxis_rotate', 'variance', 'v_steps',
- 'uv_mapping', 'utf8', 'use_index', 'use_colour', 'use_color', 'use_alpha', 'up', 'undef',
- 'ultra_wide_angle', 'u_steps', 'type', 'turbulence', 'turb_depth', 'ttf', 'true', 'triangle_wave',
- 'translate', 'transform', 'trace', 'toroidal', 'tolerance', 'tiles', 'tile2', 'tightness',
- 'tiff', 'threshold', 'thickness', 'tga', 'texture_map', 'target', 'sys', 'sum',
- 'substr', 'sturm', 'strupr', 'strlwr', 'strength', 'str', 'statistics', 'sqr',
- 'spotted', 'spotlight', 'split_union', 'spline', 'spiral2', 'spiral1', 'spherical', 'specular',
- 'spacing', 'solid', 'smooth', 'slope', 'slice', 'sky', 'size', 'sine_wave',
- 'shadowless', 'scattering', 'scallop_wave', 'scale', 'save_file', 'samples', 'roughness', 'rotate',
- 'ripples', 'right', 'rgbt', 'rgbft', 'rgbf', 'rgb', 'repeat', 'render',
- 'refraction', 'reflection_exponent', 'recursion_limit', 'reciprocal', 'ratio', 'ramp_wave', 'radius', 'radial',
- 'quilted', 'quick_colour', 'quick_color', 'quaternion', 'quadratic_spline', 'pwr', 'projected_through', 'prod',
- 'pretrace_start', 'pretrace_end', 'precompute', 'precision', 'ppm', 'pow', 'pot', 'poly_wave',
- 'point_at', 'png', 'planar', 'pigment_pattern', 'pi', 'phong_size', 'phong', 'phase',
- 'pgm', 'perspective', 'pattern', 'pass_through', 'parallel', 'panoramic', 'orthographic', 'orientation',
- 'orient', 'open', 'onion', 'once', 'on', 'omnimax', 'omega', 'offset',
- 'off', 'octaves', 'number_of_waves', 'noise_generator', 'no_shadow', 'no_reflection', 'no_image', 'no_bump_scale',
- 'no', 'nearest_count', 'natural_spline', 'mortar', 'minimum_reuse', 'min_extent', 'metric', 'method',
- 'metallic', 'media_interaction', 'media_attenuation', 'media', 'max_trace_level', 'max_trace', 'max_sample', 'max_iteration',
- 'max_intersections', 'max_gradient', 'max_extent', 'matrix', 'material_map', 'marble', 'map_type', 'mandel',
- 'major_radius', 'magnet', 'low_error_factor', 'look_at', 'location', 'load_file', 'linear_sweep', 'linear_spline',
- 'leopard', 'lambda', 'julia', 'jpeg', 'jitter', 'irid_wavelength', 'ior', 'inverse',
- 'intervals', 'interpolate', 'internal', 'inside_vector', 'inside', 'initial_frame', 'initial_clock', 'image_width',
- 'image_pattern', 'image_height', 'iff', 'hypercomplex', 'hollow', 'hierarchy', 'hf_gray_16', 'hexagon',
- 'gray_threshold', 'granite', 'gradient', 'global_lights', 'gif', 'gather', 'fresnel', 'frequency',
- 'frame_number', 'form', 'fog_type', 'fog_offset', 'fog_alt', 'focal_point', 'flip', 'flatness',
- 'fisheye', 'final_frame', 'final_clock', 'false', 'falloff_angle', 'falloff', 'fade_power', 'fade_distance',
- 'fade_colour', 'fade_color', 'facets', 'extinction', 'exterior', 'exponent', 'expand_thresholds', 'evaluate',
- 'error_bound', 'emission', 'eccentricity', 'double_illuminate', 'distance', 'dist_exp', 'dispersion_samples', 'dispersion',
- 'direction', 'diffuse', 'df3', 'dents', 'density_map', 'density_file', 'density', 'cylindrical',
- 'cutaway_textures', 'cubic_wave', 'cubic_spline', 'cube', 'crand', 'crackle', 'count', 'coords',
- 'control1', 'control0', 'conserve_energy', 'conic_sweep', 'confidence', 'concat', 'composite', 'component',
- 'colour_map', 'colour', 'color', 'collect', 'clock_on', 'clock_delta', 'clock', 'circular',
- 'chr', 'checker', 'charset', 'cells', 'caustics', 'bumps', 'bump_size', 'brilliance',
- 'brightness', 'brick_size', 'brick', 'bozo', 'boxed', 'blur_samples', 'black_hole', 'bezier_spline',
- 'b_spline', 'average', 'autostop', 'assumed_gamma', 'ascii', 'array', 'area_light', 'arc_angle',
- 'append', 'aperture', 'angle', 'ambient_light', 'ambient', 'always_sample', 'altitude', 'alpha',
- 'all_intersections', 'all', 'agate_turb', 'agate', 'adc_bailout', 'adaptive', 'accuracy', 'absorption',
- 'aa_threshold', 'aa_level', 'reflection'
- ),
- 2 => array(
- 'abs', 'acos', 'acosh', 'asc', 'asin', 'asinh', 'atan', 'atanh',
- 'atan2', 'ceil', 'cos', 'cosh', 'defined', 'degrees', 'dimensions', 'dimension_size',
- 'div', 'exp', 'file_exists', 'floor', 'int', 'ln', 'log', 'max',
- 'min', 'mod', 'pov', 'radians', 'rand', 'seed', 'select', 'sin',
- 'sinh', 'sqrt', 'strcmp', 'strlen', 'tan', 'tanh', 'val', 'vdot',
- 'vlenght',
- ),
- 3 => array (
- 'x', 'y', 'z', 't', 'u', 'v', 'red', 'blue',
- 'green', 'filter', 'transmit', 'gray', 'e',
- ),
- 4 => array (
- 'camera', 'background', 'fog', 'sky_sphere', 'rainbow', 'global_settings', 'radiosity', 'photon',
- 'object', 'blob', 'sphere', 'cylinder', 'box', 'cone', 'height_field', 'julia_fractal',
- 'lathe', 'prism', 'sphere_sweep', 'superellipsoid', 'sor', 'text', 'torus', 'bicubic_patch',
- 'disc', 'mesh', 'triangle', 'smooth_triangle', 'mesh2', 'vertex_vectors', 'normal_vectors', 'uv_vectors',
- 'texture_list', 'face_indices', 'normal_indices', 'uv_indices', 'texture', 'polygon', 'plane', 'poly',
- 'cubic', 'quartic', 'quadric', 'isosurface', 'function', 'contained_by', 'parametric', 'pigment',
- 'union', 'intersection', 'difference', 'merge', 'light_source', 'looks_like', 'light_group', 'clipped_by',
- 'bounded_by', 'interior', 'material', 'interior_texture', 'normal', 'finish', 'color_map', 'pigment_map',
- 'image_map', 'bump_map', 'slope_map', 'normal_map', 'irid', 'photons',
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!',
- '@', '%', '&', '*', '|', '/', '<',
- '>', '+', '-', '.', '=', '<=', '>=',
- '!=',
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #a63123;',
- 2 => 'color: #2312bc;',
- 3 => 'color: #cc1122; font-weight: bold;',
- 4 => 'color: #116688; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
-// 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66aa;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #6666cc; font-weight: bold;',
- 1 => 'color: #66cc66; font-weight: bold;',
- 2 => 'color: #66cc66; font-weight: bold;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- # normal hash lines
- 0 => '\#(?!(include|declare|local|fopen|fclose|read|write|default|version|if|else|end|ifdef|ifndef|switch|case|range|break|while|debug|error|warning|macro) )[[:word:]]*',
- # syntax functions hash thingis
- 1 => "\#(include|declare|local|fopen|fclose|read|write|default|version|if|else|end|ifdef|ifndef|switch|case|range|break|while|debug|error|warning|macro)",
- 2 => array(
- GESHI_SEARCH => "([a-zA-Z]+)(\n)(.*)(\n)(\\1;?)",
- GESHI_REPLACE => '\3',
- GESHI_BEFORE => '\1\2',
- GESHI_AFTER => '\4\5',
- GESHI_MODIFIERS => 'siU'
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'TAB_WIDTH' => 4
-);
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/powershell.php b/libvpx/examples/includes/geshi/geshi/powershell.php
deleted file mode 100644
index 5b9e16b..0000000
--- a/libvpx/examples/includes/geshi/geshi/powershell.php
+++ /dev/null
@@ -1,279 +0,0 @@
-<?php
-/*************************************************************************************
- * powershell.php
- * ---------------------------------
- * Author: Frode Aarebrot (frode@aarebrot.net)
- * Copyright: (c) 2008 Frode Aarebrot (http://www.aarebrot.net)
- * Release Version: 1.0.8.3
- * Date Started: 2008/06/20
- *
- * PowerShell language file for GeSHi.
- *
- * I've tried to make this language file as true to the highlighting in PowerGUI as
- * possible. Unfortunately it's not 100% complete, although it is pretty close.
- *
- * I've included some classes and their members, but there's tons and tons of these.
- * I suggest you add the ones you need yourself. I've included a few Sharepoint ones
- * in this language file.
- *
- * CHANGES
- * -------
- * 2008/06/20 (1.0.8)
- * - First Release
- *
- * TODO (updated 2008/06/20)
- * -------------------------
- * - Color text between Cmdlets/Aliases and pipe/end-of-line
- * - Try and get -- and ++ to work in the KEYWORDS array with the other operators
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'posh',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '`',
- 'KEYWORDS' => array(
- 1 => array(
- // Cmdlets
- 'Add-Content', 'Add-History', 'Add-Member', 'Add-PSSnapin', 'Clear-Content', 'Clear-Item',
- 'Clear-ItemProperty', 'Clear-Variable', 'Compare-Object', 'ConvertFrom-SecureString',
- 'Convert-Path', 'ConvertTo-Html', 'ConvertTo-SecureString', 'Copy-Item', 'Copy-ItemProperty',
- 'Export-Alias', 'Export-Clixml', 'Export-Console', 'Export-Csv', 'ForEach-Object',
- 'Format-Custom', 'Format-List', 'Format-Table', 'Format-Wide', 'Get-Acl', 'Get-Alias',
- 'Get-AuthenticodeSignature', 'Get-ChildItem', 'Get-Command', 'Get-Content', 'Get-Credential',
- 'Get-Culture', 'Get-Date', 'Get-EventLog', 'Get-ExecutionPolicy', 'Get-Help', 'Get-History',
- 'Get-Host', 'Get-Item', 'Get-ItemProperty', 'Get-Location', 'Get-Member',
- 'Get-PfxCertificate', 'Get-Process', 'Get-PSDrive', 'Get-PSProvider', 'Get-PSSnapin',
- 'Get-Service', 'Get-TraceSource', 'Get-UICulture', 'Get-Unique', 'Get-Variable',
- 'Get-WmiObject', 'Group-Object', 'Import-Alias', 'Import-Clixml', 'Import-Csv',
- 'Invoke-Expression', 'Invoke-History', 'Invoke-Item', 'Join-Path', 'Measure-Command',
- 'Measure-Object', 'Move-Item', 'Move-ItemProperty', 'New-Alias', 'New-Item',
- 'New-ItemProperty', 'New-Object', 'New-PSDrive', 'New-Service', 'New-TimeSpan',
- 'New-Variable', 'Out-Default', 'Out-File', 'Out-Host', 'Out-Null', 'Out-Printer',
- 'Out-String', 'Pop-Location', 'Push-Location', 'Read-Host', 'Remove-Item',
- 'Remove-ItemProperty', 'Remove-PSDrive', 'Remove-PSSnapin', 'Remove-Variable', 'Rename-Item',
- 'Rename-ItemProperty', 'Resolve-Path', 'Restart-Service', 'Resume-Service', 'Select-Object',
- 'Select-String', 'Set-Acl', 'Set-Alias', 'Set-AuthenticodeSignature', 'Set-Content',
- 'Set-Date', 'Set-ExecutionPolicy', 'Set-Item', 'Set-ItemProperty', 'Set-Location',
- 'Set-PSDebug', 'Set-Service', 'Set-TraceSource', 'Set-Variable', 'Sort-Object', 'Split-Path',
- 'Start-Service', 'Start-Sleep', 'Start-Transcript', 'Stop-Process', 'Stop-Service',
- 'Stop-Transcript', 'Suspend-Service', 'Tee-Object', 'Test-Path', 'Trace-Command',
- 'Update-FormatData', 'Update-TypeData', 'Where-Object', 'Write-Debug', 'Write-Error',
- 'Write-Host', 'Write-Output', 'Write-Progress', 'Write-Verbose', 'Write-Warning'
- ),
- 2 => array(
- // Aliases
- 'ac', 'asnp', 'clc', 'cli', 'clp', 'clv', 'cpi', 'cpp', 'cvpa', 'diff', 'epal', 'epcsv', 'fc',
- 'fl', 'ft', 'fw', 'gal', 'gc', 'gci', 'gcm', 'gdr', 'ghy', 'gi', 'gl', 'gm',
- 'gp', 'gps', 'group', 'gsv', 'gsnp', 'gu', 'gv', 'gwmi', 'iex', 'ihy', 'ii', 'ipal', 'ipcsv',
- 'mi', 'mp', 'nal', 'ndr', 'ni', 'nv', 'oh', 'rdr', 'ri', 'rni', 'rnp', 'rp', 'rsnp', 'rv',
- 'rvpa', 'sal', 'sasv', 'sc', 'select', 'si', 'sl', 'sleep', 'sort', 'sp', 'spps', 'spsv', 'sv',
- 'tee', 'write', 'cat', 'cd', 'clear', 'cp', 'h', 'history', 'kill', 'lp', 'ls',
- 'mount', 'mv', 'popd', 'ps', 'pushd', 'pwd', 'r', 'rm', 'rmdir', 'echo', 'cls', 'chdir',
- 'copy', 'del', 'dir', 'erase', 'move', 'rd', 'ren', 'set', 'type'
- ),
- 3 => array(
- // Reserved words
- 'break', 'continue', 'do', 'for', 'foreach', 'while', 'if', 'switch', 'until', 'where',
- 'function', 'filter', 'else', 'elseif', 'in', 'return', 'param', 'throw', 'trap'
- ),
- 4 => array(
- // Operators
- '-eq', '-ne', '-gt', '-ge', '-lt', '-le', '-ieq', '-ine', '-igt', '-ige', '-ilt', '-ile',
- '-ceq', '-cne', '-cgt', '-cge', '-clt', '-cle', '-like', '-notlike', '-match', '-notmatch',
- '-ilike', '-inotlike', '-imatch', '-inotmatch', '-clike', '-cnotlike', '-cmatch', '-cnotmatch',
- '-contains', '-notcontains', '-icontains', '-inotcontains', '-ccontains', '-cnotcontains',
- '-isnot', '-is', '-as', '-replace', '-ireplace', '-creplace', '-and', '-or', '-band', '-bor',
- '-not', '-bnot', '-f', '-casesensitive', '-exact', '-file', '-regex', '-wildcard'
- ),
- 5 => array(
- // Options
- '-Year', '-Wrap', '-Word', '-Width', '-WhatIf', '-Wait', '-View', '-Verbose', '-Verb',
- '-Variable', '-ValueOnly', '-Value', '-Unique', '-UFormat', '-TypeName', '-Trace', '-TotalCount',
- '-Title', '-TimestampServer', '-TargetObject', '-Syntax', '-SyncWindow', '-Sum', '-String',
- '-Strict', '-Stream', '-Step', '-Status', '-Static', '-StartupType', '-Start', '-StackName',
- '-Stack', '-SourceId', '-SimpleMatch', '-ShowError', '-Separator', '-SecureString', '-SecureKey',
- '-SecondValue', '-SecondsRemaining', '-Seconds', '-Second', '-Scope', '-Root', '-Role',
- '-Resolve', '-RemoveListener', '-RemoveFileListener', '-Registered', '-ReferenceObject',
- '-Recurse', '-RecommendedAction', '-ReadCount', '-Quiet', '-Query', '-Qualifier', '-PSSnapin',
- '-PSProvider', '-PSHost', '-PSDrive', '-PropertyType', '-Property', '-Prompt', '-Process',
- '-PrependPath', '-PercentComplete', '-Pattern', '-PathType', '-Path', '-PassThru', '-ParentId',
- '-Parent', '-Parameter', '-Paging', '-OutVariable', '-OutBuffer', '-Option', '-OnType', '-Off',
- '-Object', '-Noun', '-NoTypeInformation', '-NoQualifier', '-NoNewline', '-NoElement',
- '-NoClobber', '-NewName', '-Newest', '-Namespace', '-Name', '-Month', '-Minutes', '-Minute',
- '-Minimum', '-Milliseconds', '-Message', '-MemberType', '-Maximum', '-LogName', '-LiteralPath',
- '-LiteralName', '-ListenerOption', '-List', '-Line', '-Leaf', '-Last', '-Key', '-ItemType',
- '-IsValid', '-IsAbsolute', '-InputObject', '-IncludeEqual', '-IncludeChain', '-Include',
- '-IgnoreWhiteSpace', '-Id', '-Hours', '-Hour', '-HideTableHeaders', '-Head', '-GroupBy',
- '-Functionality', '-Full', '-Format', '-ForegroundColor', '-Force', '-First', '-FilterScript',
- '-Filter', '-FilePath', '-Expression', '-ExpandProperty', '-Expand', '-ExecutionPolicy',
- '-ExcludeProperty', '-ExcludeDifferent', '-Exclude', '-Exception', '-Examples', '-ErrorVariable',
- '-ErrorRecord', '-ErrorId', '-ErrorAction', '-End', '-Encoding', '-DisplayName', '-DisplayHint',
- '-DisplayError', '-DifferenceObject', '-Detailed', '-Destination', '-Description', '-Descending',
- '-Depth', '-DependsOn', '-Delimiter', '-Debugger', '-Debug', '-Days', '-Day', '-Date',
- '-CurrentOperation', '-Culture', '-Credential', '-Count', '-Container', '-Confirm',
- '-ComputerName', '-Component', '-Completed', '-ComObject', '-CommandType', '-Command',
- '-Column', '-Class', '-ChildPath', '-Character', '-Certificate', '-CategoryTargetType',
- '-CategoryTargetName', '-CategoryReason', '-CategoryActivity', '-Category', '-CaseSensitive',
- '-Body', '-BinaryPathName', '-Begin', '-BackgroundColor', '-Average', '-AutoSize', '-Audit',
- '-AsString', '-AsSecureString', '-AsPlainText', '-As', '-ArgumentList', '-AppendPath', '-Append',
- '-Adjust', '-Activity', '-AclObject'
- ),
- 6 => array(
- '_','args','DebugPreference','Error','ErrorActionPreference',
- 'foreach','Home','Host','Input','LASTEXITCODE','MaximumAliasCount',
- 'MaximumDriveCount','MaximumFunctionCount','MaximumHistoryCount',
- 'MaximumVariableCount','OFS','PsHome',
- 'ReportErrorShowExceptionClass','ReportErrorShowInnerException',
- 'ReportErrorShowSource','ReportErrorShowStackTrace',
- 'ShouldProcessPreference','ShouldProcessReturnPreference',
- 'StackTrace','VerbosePreference','WarningPreference','PWD'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '=', '<', '>', '@', '|', '&', ',', '?',
- '+=', '-=', '*=', '/=', '%=', '*', '/', '%', '!', '+', '-', '++', '--'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #008080; font-weight: bold;',
- 2 => 'color: #008080; font-weight: bold;',
- 3 => 'color: #0000FF;',
- 4 => 'color: #FF0000;',
- 5 => 'color: #008080; font-style: italic;',
- 6 => 'color: #000080;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000;',
- 'MULTI' => 'color: #008000;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008080; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #800000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000;'
- ),
- 'METHODS' => array(
- 0 => 'color: pink;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: pink;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #800080;',
- 3 => 'color: #008080;',
- 4 => 'color: #008080;',
- 5 => 'color: #800000;',
- 6 => 'color: #000080;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- // special after pipe
- 3 => array(
- GESHI_SEARCH => '(\[)(int|long|string|char|bool|byte|double|decimal|float|single|regex|array|xml|scriptblock|switch|hashtable|type|ref|psobject|wmi|wmisearcher|wmiclass|object)((\[.*\])?\])',
- GESHI_REPLACE => '\2',
- GESHI_MODIFIERS => 'si',
- GESHI_BEFORE => '\1',
- GESHI_AFTER => '\3'
- ),
- // Classes
- 4 => array(
- GESHI_SEARCH => '(\[)(System\.Reflection\.Assembly|System\.Net\.CredentialCache|Microsoft\.SharePoint\.SPFileLevel|Microsoft\.SharePoint\.Publishing\.PublishingWeb|Microsoft\.SharePoint\.Publishing|Microsoft\.SharePoint\.SPWeb)(\])',
- GESHI_REPLACE => '\2',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '\1',
- GESHI_AFTER => '\3'
- ),
- // Members
- // There's about a hundred million of these, add the ones you need as you need them
- 5 => array (
- GESHI_SEARCH => '(::)(ReflectionOnlyLoadFrom|ReflectionOnlyLoad|ReferenceEquals|LoadWithPartialName|LoadFrom|LoadFile|Load|GetExecutingAssembly|GetEntryAssembly|GetCallingAssembly|GetAssembly|Equals|DefaultNetworkCredentials|DefaultCredentials|CreateQualifiedName|Checkout|Draft|Published|IsPublishingWeb)',
- GESHI_REPLACE => '\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\1',
- GESHI_AFTER => ''
- ),
- // Special variables
- 6 => array(
- GESHI_SEARCH => '(\$)(\$[_\^]?|\?)(?!\w)',
- GESHI_REPLACE => '\1\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- // variables
- //BenBE: Please note that changes here and in Keyword group 6 have to be synchronized in order to work properly.
- //This Regexp must only match, if keyword group 6 doesn't. If this assumption fails
- //Highlighting of the keywords will be incomplete or incorrect!
- 0 => "(?<!\\\$|>)[\\\$](?!(?:DebugPreference|Error(?:ActionPreference)?|".
- "Ho(?:me|st)|Input|LASTEXITCODE|Maximum(?:AliasCount|DriveCount|".
- "FunctionCount|HistoryCount|VariableCount)|OFS|P(?:WD|sHome)|".
- "ReportErrorShow(?:ExceptionClass|InnerException|S(?:ource|".
- "tackTrace))|S(?:houldProcess(?:Preference|ReturnPreference)|".
- "tackTrace)|VerbosePreference|WarningPreference|_|args|foreach)\W)".
- "(\w+)(?=[^|\w])",
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 6 => array(
- 'DISALLOWED_BEFORE' => '(?<!\$)\$'
- )
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/progress.php b/libvpx/examples/includes/geshi/geshi/progress.php
deleted file mode 100644
index abd5bcb..0000000
--- a/libvpx/examples/includes/geshi/geshi/progress.php
+++ /dev/null
@@ -1,479 +0,0 @@
-<?php
-/*************************************************************************************
- * progress.php
- * --------
- * Author: Marco Aurelio de Pasqual (marcop@hdi.com.br)
- * Copyright: (c) 2008 Marco Aurelio de Pasqual, Benny Baumann (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2008/07/11
- *
- * Progress language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/07/11 (1.0.8)
- * - First Release
- *
- * TODO (updated 2008/07/11)
- * -------------------------
- * * Clean up the keyword list
- * * Sort Keyword lists by Control Structures, Predefined functions and other important keywords
- * * Complete language support
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array(
- 'LANG_NAME' => 'Progress',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array (
- 1 => array(
- 'ACCUMULATE','APPLY','ASSIGN','BELL','QUERY',
- 'BUFFER-COMPARE','BUFFER-COPY','CALL','CASE',
- 'CHOOSE','CLASS','CLEAR','CLOSE QUERY','each','WHERE',
- 'CLOSE STORED-PROCEDURE','COLOR','COMPILE','CONNECT',
- 'CONSTRUCTOR','COPY-LOB','CREATE','CREATE ALIAS',
- 'CREATE BROWSE','CREATE BUFFER','CREATE CALL','CREATE CLIENT-PRINCIPAL',
- 'CREATE DATABASE','CREATE DATASET','CREATE DATA-SOURCE','CREATE QUERY',
- 'CREATE SAX-attributeS','CREATE SAX-READER','CREATE SAX-WRITER','CREATE SERVER',
- 'CREATE SERVER-SOCKET','CREATE SOAP-HEADER','CREATE SOAP-HEADER-ENTRYREF','CREATE SOCKET',
- 'CREATE TEMP-TABLE','CREATE WIDGET','CREATE widget-POOL','CREATE X-DOCUMENT',
- 'CREATE X-NODEREF','CURRENT-LANGUAGE','CURRENT-VALUE','DDE ADVISE',
- 'DDE EXECUTE','DDE GET','DDE INITIATE','DDE REQUEST',
- 'DDE SEND','DDE TERMINATE','DEFINE BROWSE','DEFINE BUFFER','DEFINE',
- 'DEFINE BUTTON','DEFINE DATASET','DEFINE DATA-SOURCE','DEFINE FRAME','DEF','VAR',
- 'DEFINE IMAGE','DEFINE MENU','DEFINE PARAMETER','DEFINE property','PARAM',
- 'DEFINE QUERY','DEFINE RECTANGLE','DEFINE STREAM','DEFINE SUB-MENU',
- 'DEFINE TEMP-TABLE','DEFINE WORKFILE','DEFINE WORK-TABLE',
- 'DELETE','DELETE ALIAS','DELETE object','DELETE PROCEDURE',
- 'DELETE widget','DELETE widget-POOL','DESTRUCTOR','DICTIONARY',
- 'DISABLE','DISABLE TRIGGERS','DISCONNECT','DISPLAY',
- 'DO','DOS','DOWN','DYNAMIC-CURRENT-VALUE',
- 'ELSE','EMPTY TEMP-TABLE','ENABLE','END',
- 'ENTRY','EXPORT','FIND','AND',
- 'FIX-CODEPAGE','FOR','FORM','FRAME-VALUE',
- 'GET','GET-KEY-VALUE','HIDE','IF',
- 'IMPORT','INPUT CLEAR','INPUT CLOSE','INPUT FROM','input',
- 'INPUT THROUGH','INPUT-OUTPUT CLOSE','INPUT-OUTPUT THROUGH','INSERT',
- 'INTERFACE','LEAVE','LOAD','BREAK',
- 'LOAD-PICTURE','MESSAGE','method','NEXT','prev',
- 'NEXT-PROMPT','ON','OPEN QUERY','OS-APPEND',
- 'OS-COMMAND','OS-COPY','OS-CREATE-DIR','OS-DELETE',
- 'OS-RENAME','OUTPUT CLOSE','OUTPUT THROUGH','OUTPUT TO',
- 'OVERLAY','PAGE','PAUSE','PROCEDURE',
- 'PROCESS EVENTS','PROMPT-FOR','PROMSGS','PROPATH',
- 'PUBLISH','PUT','PUT CURSOR','PUT SCREEN',
- 'PUT-BITS','PUT-BYTE','PUT-BYTES','PUT-DOUBLE',
- 'PUT-FLOAT','PUT-INT64','PUT-KEY-VALUE','PUT-LONG',
- 'PUT-SHORT','PUT-STRING','PUT-UNSIGNED-LONG','PUT-UNSIGNED-SHORT',
- 'QUIT','RAW-TRANSFER','READKEY','RELEASE',
- 'RELEASE EXTERNAL','RELEASE object','REPEAT','REPOSITION',
- 'RUN','RUN STORED-PROCEDURE','RUN SUPER',
- 'SAVE CACHE','SCROLL','SEEK','SET',
- 'SET-BYTE-ORDER','SET-POINTER-VALUE','SET-SIZE','SHOW-STATS',
- 'STATUS','STOP','SUBSCRIBE','SUBSTRING',
- 'system-DIALOG COLOR','system-DIALOG FONT','system-DIALOG GET-DIR','system-DIALOG GET-FILE',
- 'system-DIALOG PRINTER-SETUP','system-HELP','THEN','THIS-object',
- 'TRANSACTION-MODE AUTOMATIC','TRIGGER PROCEDURE','UNDERLINE','UNDO',
- 'UNIX','UNLOAD','UNSUBSCRIBE','UP','STRING',
- 'UPDATE','USE','USING','VALIDATE','substr','SKIP','CLOSE',
- 'VIEW','WAIT-FOR','MODULO','NE','AVAIL',
- 'NOT','OR','&GLOBAL-DEFINE','&IF','UNFORMATTED','NO-PAUSE',
- '&THEN','&ELSEIF','&ELSE','&ENDIF','OPEN','NO-WAIT',
- '&MESSAGE','&SCOPED-DEFINE','&UNDEFINE','DEFINED',
- 'BROWSE','BUTTON','COMBO-BOX','CONTROL-FRAME',
- 'DIALOG-BOX','EDITOR','FIELD-GROUP','FILL-IN',
- 'FRAME','IMAGE','LITERAL','MENU',
- 'MENU-ITEM','RADIO-SET','RECTANGLE','SELECTION-LIST',
- 'SLIDER','SUB-MENU','TEXT','TOGGLE-BOX',
- 'WINDOW','WITH','AT','OF','EDITING','ON ENDKEY','output',
- 'ON ERROR','ON QUIT','ON STOP','PRESELECT',
- 'QUERY-TUNING','SIZE','Trigger','VIEW-AS','ALERT-BOX',
- 'Buffer','Data-relation','ProDataSet','SAX-attributes',
- 'SAX-reader','SAX-writer','Server socket','SOAP-fault',
- 'SOAP-header','SOAP-header-entryref','Socket','Temp-table',
- 'X-noderef','Height','Left','Top','TO',
- 'Width','ACTIVE-WINDOW','AUDIT-CONTROL','FIRST','LAST',
- 'AUDIT-POLICY','CLIPBOARD','CODEBASE-LOCATOR','COLOR-TABLE',
- 'COMPILER','COM-SELF','DEBUGGER','DEFAULT-WINDOW',
- 'ERROR-STATUS','FILE-INFO','FOCUS','FONT-TABLE',
- 'LAST-EVENT','LOG-MANAGER','RCODE-INFO','SECURITY-POLICY',
- 'SELF','SESSION','SOURCE-PROCEDURE','TARGET-PROCEDURE','NO-LOCK','NO-error',
- 'THIS-PROCEDURE','WEB-CONTEXT','FUNCTION','RETURNS','NO-UNDO'
- ),
- 2 => array(
- 'ACCEPT-CHANGES','ACCEPT-ROW-CHANGES','ADD-BUFFER','ADD-CALC-COLUMN',
- 'ADD-COLUMNS-FROM','ADD-EVENTS-PROCEDURE','ADD-FIELDS-FROM','ADD-FIRST',
- 'ADD-HEADER-ENTRY','ADD-INDEX-FIELD','ADD-LAST','ADD-LIKE-COLUMN',
- 'ADD-LIKE-FIELD','ADD-LIKE-INDEX','ADD-NEW-FIELD','ADD-NEW-INDEX',
- 'ADD-RELATION','ADD-SCHEMA-LOCATION','ADD-SOURCE-BUFFER','ADD-SUPER-PROCEDURE',
- 'APPEND-CHILD','APPLY-CALLBACK','ATTACH-DATA-SOURCE','AUTHENTICATION-FAILED',
- 'BEGIN-EVENT-GROUP','BUFFER-COMPARE','BUFFER-COPY','BUFFER-CREATE',
- 'BUFFER-DELETE','BUFFER-FIELD','BUFFER-RELEASE','BUFFER-VALIDATE',
- 'CANCEL-BREAK','CANCEL-REQUESTS','CLEAR','CLEAR-APPL-CONTEXT',
- 'CLEAR-LOG','CLEAR-SELECTION','CLEAR-SORT-ARROWS','CLONE-NODE',
- 'CLOSE-LOG','CONNECT','CONNECTED','CONVERT-TO-OFFSET',
- 'COPY-DATASET','COPY-SAX-attributeS','COPY-TEMP-TABLE','CREATE-LIKE',
- 'CREATE-NODE','CREATE-NODE-NAMESPACE','CREATE-RESULT-LIST-ENTRY','DEBUG',
- 'DECLARE-NAMESPACE','DELETE-CHAR','DELETE-CURRENT-ROW',
- 'DELETE-HEADER-ENTRY','DELETE-LINE','DELETE-NODE','DELETE-RESULT-LIST-ENTRY',
- 'DELETE-SELECTED-ROW','DELETE-SELECTED-ROWS','DESELECT-FOCUSED-ROW','DESELECT-ROWS',
- 'DESELECT-SELECTED-ROW','DETACH-DATA-SOURCE','DISABLE','DISABLE-CONNECTIONS',
- 'DISABLE-DUMP-TRIGGERS','DISABLE-LOAD-TRIGGERS','DISCONNECT','DISPLAY-MESSAGE',
- 'DUMP-LOGGING-NOW','EDIT-CLEAR','EDIT-COPY','EDIT-CUT',
- 'EDIT-PASTE','EDIT-UNDO','EMPTY-DATASET','EMPTY-TEMP-TABLE',
- 'ENABLE','ENABLE-CONNECTIONS','ENABLE-EVENTS','ENCRYPT-AUDIT-MAC-KEY',
- 'END-DOCUMENT','END-ELEMENT','END-EVENT-GROUP','END-FILE-DROP',
- 'EXPORT','EXPORT-PRINCIPAL','FETCH-SELECTED-ROW',
- 'FILL','FIND-BY-ROWID','FIND-CURRENT','FIND-FIRST',
- 'FIND-LAST','FIND-UNIQUE','GET-attribute','GET-attribute-NODE',
- 'GET-BINARY-DATA','GET-BLUE-VALUE','GET-BROWSE-COLUMN','GET-BUFFER-HANDLE',
- 'GET-BYTES-AVAILABLE','GET-CALLBACK-PROC-CONTEXT','GET-CALLBACK-PROC-NAME','GET-CGI-LIST',
- 'GET-CGI-LONG-VALUE','GET-CGI-VALUE','GET-CHANGES','GET-CHILD',
- 'GET-CHILD-RELATION','GET-CONFIG-VALUE','GET-CURRENT','GET-DATASET-BUFFER',
- 'GET-DOCUMENT-ELEMENT','GET-DROPPED-FILE','GET-DYNAMIC','GET-ERROR-COLUMN ',
- 'GET-ERROR-ROW ','GET-FILE-NAME ','GET-FILE-OFFSET ','GET-FIRST',
- 'GET-GREEN-VALUE','GET-HEADER-ENTRY','GET-INDEX-BY-NAMESPACE-NAME','GET-INDEX-BY-QNAME',
- 'GET-ITERATION','GET-LAST','GET-LOCALNAME-BY-INDEX','GET-MESSAGE',
- 'GET-NEXT','GET-NODE','GET-NUMBER','GET-PARENT',
- 'GET-PREV','GET-PRINTERS','GET-property','GET-QNAME-BY-INDEX',
- 'GET-RED-VALUE','GET-RELATION','GET-REPOSITIONED-ROW','GET-RGB-VALUE',
- 'GET-SELECTED-widget','GET-SERIALIZED','GET-SIGNATURE','GET-SOCKET-OPTION',
- 'GET-SOURCE-BUFFER','GET-TAB-ITEM','GET-TEXT-HEIGHT-CHARS','GET-TEXT-HEIGHT-PIXELS',
- 'GET-TEXT-WIDTH-CHARS','GET-TEXT-WIDTH-PIXELS','GET-TOP-BUFFER','GET-TYPE-BY-INDEX',
- 'GET-TYPE-BY-NAMESPACE-NAME','GET-TYPE-BY-QNAME','GET-URI-BY-INDEX','GET-VALUE-BY-INDEX',
- 'GET-VALUE-BY-NAMESPACE-NAME','GET-VALUE-BY-QNAME','GET-WAIT-STATE','IMPORT-NODE',
- 'IMPORT-PRINCIPAL','INCREMENT-EXCLUSIVE-ID','INDEX-INFORMATION','INITIALIZE-DOCUMENT-TYPE',
- 'INITIATE','INSERT','INSERT-attribute','INSERT-BACKTAB',
- 'INSERT-BEFORE','INSERT-FILE','INSERT-ROW','INSERT-STRING',
- 'INSERT-TAB','INVOKE','IS-ROW-SELECTED','IS-SELECTED',
- 'LIST-property-NAMES','LOAD','LoadControls','LOAD-DOMAINS',
- 'LOAD-ICON','LOAD-IMAGE','LOAD-IMAGE-DOWN','LOAD-IMAGE-INSENSITIVE',
- 'LOAD-IMAGE-UP','LOAD-MOUSE-POINTER','LOAD-SMALL-ICON','LOCK-REGISTRATION',
- 'LOG-AUDIT-EVENT','LOGOUT','LONGCHAR-TO-NODE-VALUE','LOOKUP',
- 'MEMPTR-TO-NODE-VALUE','MERGE-CHANGES','MERGE-ROW-CHANGES','MOVE-AFTER-TAB-ITEM',
- 'MOVE-BEFORE-TAB-ITEM','MOVE-COLUMN','MOVE-TO-BOTTOM','MOVE-TO-EOF',
- 'MOVE-TO-TOP','NODE-VALUE-TO-LONGCHAR','NODE-VALUE-TO-MEMPTR','NORMALIZE',
- 'QUERY-CLOSE','QUERY-OPEN','QUERY-PREPARE','RAW-TRANSFER',
- 'READ','READ-FILE','READ-XML','READ-XMLSCHEMA',
- 'REFRESH','REFRESH-AUDIT-POLICY','REGISTER-DOMAIN','REJECT-CHANGES',
- 'REJECT-ROW-CHANGES','REMOVE-attribute','REMOVE-CHILD','REMOVE-EVENTS-PROCEDURE',
- 'REMOVE-SUPER-PROCEDURE','REPLACE','REPLACE-CHILD','REPLACE-SELECTION-TEXT',
- 'REPOSITION-BACKWARD','REPOSITION-FORWARD','REPOSITION-TO-ROW','REPOSITION-TO-ROWID',
- 'RESET','SAVE','SAVE-FILE','SAVE-ROW-CHANGES',
- 'SAX-PARSE','SAX-PARSE-FIRST','SAX-PARSE-NEXT','SCROLL-TO-CURRENT-ROW',
- 'SCROLL-TO-ITEM','SCROLL-TO-SELECTED-ROW','SEAL','SEARCH',
- 'SELECT-ALL','SELECT-FOCUSED-ROW','SELECT-NEXT-ROW','SELECT-PREV-ROW',
- 'SELECT-ROW','SET-ACTOR','SET-APPL-CONTEXT','SET-attribute',
- 'SET-attribute-NODE','SET-BLUE-VALUE','SET-BREAK','SET-BUFFERS',
- 'SET-CALLBACK','SET-CALLBACK-PROCEDURE','SET-CLIENT','SET-COMMIT',
- 'SET-CONNECT-PROCEDURE','SET-DYNAMIC','SET-GREEN-VALUE','SET-INPUT-SOURCE',
- 'SET-MUST-UNDERSTAND','SET-NODE','SET-NUMERIC-FORMAT','SET-OUTPUT-DESTINATION',
- 'SET-PARAMETER','SET-property','SET-READ-RESPONSE-PROCEDURE','SET-RED-VALUE',
- 'SET-REPOSITIONED-ROW','SET-RGB-VALUE','SET-ROLLBACK','SET-SELECTION',
- 'SET-SERIALIZED','SET-SOCKET-OPTION','SET-SORT-ARROW','SET-WAIT-STATE',
- 'START-DOCUMENT','START-ELEMENT','STOP-PARSING','SYNCHRONIZE',
- 'TEMP-TABLE-PREPARE','UPDATE-attribute','URL-DECODE','URL-ENCODE',
- 'VALIDATE','VALIDATE-SEAL','WRITE','WRITE-CDATA','USE-INDEX',
- 'WRITE-CHARACTERS','WRITE-COMMENT','WRITE-DATA-ELEMENT','WRITE-EMPTY-ELEMENT',
- 'WRITE-ENTITY-REF','WRITE-EXTERNAL-DTD','WRITE-FRAGMENT','WRITE-MESSAGE',
- 'WRITE-PROCESSING-INSTRUCTION','WRITE-XML','WRITE-XMLSCHEMA','FALSE','true'
- ),
- 3 => array(
- 'ABSOLUTE','ACCUM','ADD-INTERVAL','ALIAS','mod',
- 'AMBIGUOUS','ASC','AUDIT-ENABLED','AVAILABLE',
- 'BASE64-DECODE','BASE64-ENCODE','CAN-DO','CAN-FIND',
- 'CAN-QUERY','CAN-SET','CAPS','CAST','OS-DIR',
- 'CHR','CODEPAGE-CONVERT','COMPARE','CONNECTED',
- 'COUNT-OF','CURRENT-CHANGED','CURRENT-RESULT-ROW','DATASERVERS',
- 'DATA-SOURCE-MODIFIED','DATETIME','DATETIME-TZ',
- 'DAY','DBCODEPAGE','DBCOLLATION','DBNAME',
- 'DBPARAM','DBRESTRICTIONS','DBTASKID','DBTYPE',
- 'DBVERSION','DECIMAL','DECRYPT','DYNAMIC-function',
- 'DYNAMIC-NEXT-VALUE','ENCODE','ENCRYPT','ENTERED',
- 'ERROR','ETIME','EXP','FILL','ENDKEY','END-error',
- 'FIRST-OF','FRAME-DB','FRAME-DOWN',
- 'FRAME-FIELD','FRAME-FILE','FRAME-INDEX','FRAME-LINE',
- 'GATEWAYS','GENERATE-PBE-KEY','GENERATE-PBE-SALT','GENERATE-RANDOM-KEY',
- 'GENERATE-UUID','GET-BITS','GET-BYTE','GET-BYTE-ORDER',
- 'GET-BYTES','GET-CODEPAGE','GET-CODEPAGES','GET-COLLATION',
- 'GET-COLLATIONS','GET-DOUBLE','GET-FLOAT','GET-INT64',
- 'GET-LONG','GET-POINTER-VALUE','GET-SHORT','GET-SIZE',
- 'GET-STRING','GET-UNSIGNED-LONG','GET-UNSIGNED-SHORT','GO-PENDING',
- 'GUID','HEX-DECODE','INDEX',
- 'INT64','INTEGER','INTERVAL','IS-ATTR-SPACE',
- 'IS-CODEPAGE-FIXED','IS-COLUMN-CODEPAGE','IS-LEAD-BYTE','ISO-DATE',
- 'KBLABEL','KEYCODE','KEYFUNCTION','KEYLABEL',
- 'KEYWORD','KEYWORD-ALL','LASTKEY',
- 'LAST-OF','LC','LDBNAME','LEFT-TRIM',
- 'LIBRARY','LINE-COUNTER','LIST-EVENTS','LIST-QUERY-ATTRS',
- 'LIST-SET-ATTRS','LIST-widgetS','LOCKED','LOG',
- 'LOGICAL','LOOKUP','MAXIMUM','MD5-DIGEST',
- 'MEMBER','MESSAGE-LINES','MINIMUM','MONTH',
- 'MTIME','NEW','NEXT-VALUE','NORMALIZE','SHARED',
- 'NOT ENTERED','NOW','NUM-ALIASES','NUM-DBS',
- 'NUM-ENTRIES','NUM-RESULTS','OPSYS','OS-DRIVES',
- 'OS-ERROR','OS-GETENV','PAGE-NUMBER','PAGE-SIZE',
- 'PDBNAME','PROC-HANDLE','PROC-STATUS','PROGRAM-NAME',
- 'PROGRESS','PROVERSION','QUERY-OFF-END','QUOTER',
- 'RANDOM','RAW','RECID','REJECTED',
- 'REPLACE','RETRY','RETURN-VALUE','RGB-VALUE',
- 'RIGHT-TRIM','R-INDEX','ROUND','ROWID','LENGTH',
- 'SDBNAME','SEARCH','SET-DB-CLIENT','SETUSERID',
- 'SHA1-DIGEST','SQRT','SUBSTITUTE','VARIABLE',
- 'SUPER','TERMINAL','TIME','TIMEZONE','external','ENTRY',
- 'TODAY','TO-ROWID','TRIM','TRUNCATE','return',
- 'TYPE-OF','USERID','VALID-EVENT','VALID-HANDLE',
- 'VALID-object','WEEKDAY','YEAR','BEGINS','VALUE',
- 'EQ','GE','GT','LE','LT','MATCHES','AS','BY','LIKE'
- ),
- 4 => array(
- 'ACCELERATOR','ACTIVE','ACTOR','ADM-DATA',
- 'AFTER-BUFFER','AFTER-ROWID','AFTER-TABLE','ALLOW-COLUMN-SEARCHING',
- 'ALWAYS-ON-TOP','APPL-ALERT-BOXES','APPL-CONTEXT-ID','APPSERVER-INFO',
- 'APPSERVER-PASSWORD','APPSERVER-USERID','ASYNCHRONOUS','ASYNC-REQUEST-COUNT',
- 'ASYNC-REQUEST-HANDLE','ATTACHED-PAIRLIST','attribute-NAMES','ATTR-SPACE',
- 'AUDIT-EVENT-CONTEXT','AUTO-COMPLETION','AUTO-DELETE','AUTO-DELETE-XML',
- 'AUTO-END-KEY','AUTO-GO','AUTO-INDENT','AUTO-RESIZE',
- 'AUTO-RETURN','AUTO-SYNCHRONIZE','AUTO-VALIDATE','AUTO-ZAP',
- 'AVAILABLE-FORMATS','BACKGROUND','BASE-ADE','BASIC-LOGGING',
- 'BATCH-MODE','BATCH-SIZE','BEFORE-BUFFER','BEFORE-ROWID',
- 'BEFORE-TABLE','BGCOLOR','BLANK','BLOCK-ITERATION-DISPLAY',
- 'BORDER-BOTTOM-CHARS','BORDER-BOTTOM-PIXELS','BORDER-LEFT-CHARS','BORDER-LEFT-PIXELS',
- 'BORDER-RIGHT-CHARS','BORDER-RIGHT-PIXELS','BORDER-TOP-CHARS','BORDER-TOP-PIXELS',
- 'BOX','BOX-SELECTABLE','BUFFER-CHARS','BUFFER-FIELD',
- 'BUFFER-HANDLE','BUFFER-LINES','BUFFER-NAME','BUFFER-VALUE',
- 'BYTES-READ','BYTES-WRITTEN','CACHE','CALL-NAME',
- 'CALL-TYPE','CANCEL-BUTTON','CANCELLED','CAN-CREATE',
- 'CAN-DELETE','CAN-READ','CAN-WRITE','CAREFUL-PAINT',
- 'CASE-SENSITIVE','CENTERED','CHARSET','CHECKED',
- 'CHILD-BUFFER','CHILD-NUM','CLASS-TYPE','CLIENT-CONNECTION-ID',
- 'CLIENT-TTY','CLIENT-TYPE','CLIENT-WORKSTATION','CODE',
- 'CODEPAGE','COLUMN','COLUMN-BGCOLOR','COLUMN-DCOLOR',
- 'COLUMN-FGCOLOR','COLUMN-FONT','COLUMN-LABEL','COLUMN-MOVABLE',
- 'COLUMN-PFCOLOR','COLUMN-READ-ONLY','COLUMN-RESIZABLE','COLUMN-SCROLLING',
- 'COM-HANDLE','COMPLETE','CONFIG-NAME','CONTEXT-HELP',
- 'CONTEXT-HELP-FILE','CONTEXT-HELP-ID','CONTROL-BOX','CONVERT-3D-COLORS',
- 'CPCASE','CPCOLL','CPINTERNAL','CPLOG',
- 'CPPRINT','CPRCODEIN','CPRCODEOUT','CPSTREAM',
- 'CPTERM','CRC-VALUE','CURRENT-COLUMN','CURRENT-ENVIRONMENT',
- 'CURRENT-ITERATION','CURRENT-ROW-MODIFIED','CURRENT-WINDOW','CURSOR-CHAR',
- 'CURSOR-LINE','CURSOR-OFFSET','DATA-ENTRY-RETURN','DATASET',
- 'DATA-SOURCE','DATA-SOURCE-COMPLETE-MAP','DATA-TYPE','DATE-FORMAT',
- 'DB-REFERENCES','DCOLOR','DDE-ERROR','DDE-ID',
- 'DDE-ITEM','DDE-NAME','DDE-TOPIC','DEBLANK',
- 'DEBUG-ALERT','DECIMALS','DEFAULT','DEFAULT-BUFFER-HANDLE',
- 'DEFAULT-BUTTON','DEFAULT-COMMIT','DELIMITER','DISABLE-AUTO-ZAP',
- 'DISPLAY-TIMEZONE','DISPLAY-TYPE','DOMAIN-DESCRIPTION','DOMAIN-NAME',
- 'DOMAIN-TYPE','DRAG-ENABLED','DROP-TARGET','DYNAMIC',
- 'EDGE-CHARS','EDGE-PIXELS','EDIT-CAN-PASTE','EDIT-CAN-UNDO',
- 'EMPTY','ENCODING','ENCRYPTION-SALT','END-USER-PROMPT',
- 'ENTRY-TYPES-LIST','ERROR-COLUMN','ERROR-object-DETAIL','ERROR-ROW',
- 'ERROR-STRING','EVENT-GROUP-ID','EVENT-PROCEDURE','EVENT-PROCEDURE-CONTEXT',
- 'EVENT-TYPE','EXCLUSIVE-ID','EXECUTION-LOG','EXPAND',
- 'EXPANDABLE','FGCOLOR','FILE-CREATE-DATE','FILE-CREATE-TIME',
- 'FILE-MOD-DATE','FILE-MOD-TIME','FILE-NAME','FILE-OFFSET',
- 'FILE-SIZE','FILE-TYPE','FILLED','FILL-MODE',
- 'FILL-WHERE-STRING','FIRST-ASYNC-REQUEST','FIRST-BUFFER','FIRST-CHILD',
- 'FIRST-COLUMN','FIRST-DATASET','FIRST-DATA-SOURCE','FIRST-object',
- 'FIRST-PROCEDURE','FIRST-QUERY','FIRST-SERVER','FIRST-SERVER-SOCKET',
- 'FIRST-SOCKET','FIRST-TAB-ITEM','FIT-LAST-COLUMN','FLAT-BUTTON',
- 'FOCUSED-ROW','FOCUSED-ROW-SELECTED','FONT','FOREGROUND',
- 'FORMAT','FORMATTED','FORM-INPUT','FORM-LONG-INPUT',
- 'FORWARD-ONLY','FRAGMENT','FRAME-COL','FRAME-NAME',
- 'FRAME-ROW','FRAME-SPACING','FRAME-X','FRAME-Y',
- 'FREQUENCY','FULL-HEIGHT-CHARS','FULL-HEIGHT-PIXELS','FULL-PATHNAME',
- 'FULL-WIDTH-CHARS','FULL-WIDTH-PIXELS','GRAPHIC-EDGE',
- 'GRID-FACTOR-HORIZONTAL','GRID-FACTOR-VERTICAL','GRID-SNAP','GRID-UNIT-HEIGHT-CHARS',
- 'GRID-UNIT-HEIGHT-PIXELS','GRID-UNIT-WIDTH-CHARS','GRID-UNIT-WIDTH-PIXELS','GRID-VISIBLE',
- 'GROUP-BOX','HANDLE','HANDLER','HAS-LOBS',
- 'HAS-RECORDS','HEIGHT-CHARS','HEIGHT-PIXELS','HELP',
- 'HIDDEN','HORIZONTAL','HTML-CHARSET','HTML-END-OF-LINE',
- 'HTML-END-OF-PAGE','HTML-FRAME-BEGIN','HTML-FRAME-END','HTML-HEADER-BEGIN',
- 'HTML-HEADER-END','HTML-TITLE-BEGIN','HTML-TITLE-END','HWND',
- 'ICFPARAMETER','ICON','IGNORE-CURRENT-MODIFIED','IMAGE-DOWN',
- 'IMAGE-INSENSITIVE','IMAGE-UP','IMMEDIATE-DISPLAY','INDEX-INFORMATION',
- 'IN-HANDLE','INHERIT-BGCOLOR','INHERIT-FGCOLOR','INITIAL','INIT',
- 'INNER-CHARS','INNER-LINES','INPUT-VALUE','INSTANTIATING-PROCEDURE',
- 'INTERNAL-ENTRIES','IS-CLASS','IS-OPEN','IS-PARAMETER-SET',
- 'IS-XML','ITEMS-PER-ROW','KEEP-CONNECTION-OPEN','KEEP-FRAME-Z-ORDER',
- 'KEEP-SECURITY-CACHE','KEY','KEYS','LABEL',
- 'LABEL-BGCOLOR','LABEL-DCOLOR','LABEL-FGCOLOR','LABEL-FONT',
- 'LABELS','LANGUAGES','LARGE','LARGE-TO-SMALL',
- 'LAST-ASYNC-REQUEST','LAST-BATCH','LAST-CHILD','LAST-object',
- 'LAST-PROCEDURE','LAST-SERVER','LAST-SERVER-SOCKET','LAST-SOCKET',
- 'LAST-TAB-ITEM','LINE','LIST-ITEM-PAIRS','LIST-ITEMS',
- 'LITERAL-QUESTION','LOCAL-HOST','LOCAL-NAME','LOCAL-PORT',
- 'LOCATOR-COLUMN-NUMBER','LOCATOR-LINE-NUMBER','LOCATOR-PUBLIC-ID','LOCATOR-system-ID',
- 'LOCATOR-TYPE','LOG-ENTRY-TYPES','LOGFILE-NAME','LOGGING-LEVEL',
- 'LOGIN-EXPIRATION-TIMESTAMP','LOGIN-HOST','LOGIN-STATE','LOG-THRESHOLD',
- 'MANDATORY','MANUAL-HIGHLIGHT','MAX-BUTTON','MAX-CHARS',
- 'MAX-DATA-GUESS','MAX-HEIGHT-CHARS','MAX-HEIGHT-PIXELS','MAX-VALUE',
- 'MAX-WIDTH-CHARS','MAX-WIDTH-PIXELS','MD5-VALUE','MENU-BAR',
- 'MENU-KEY','MENU-MOUSE','MERGE-BY-FIELD','MESSAGE-AREA',
- 'MESSAGE-AREA-FONT','MIN-BUTTON','MIN-COLUMN-WIDTH-CHARS','MIN-COLUMN-WIDTH-PIXELS',
- 'MIN-HEIGHT-CHARS','MIN-HEIGHT-PIXELS','MIN-SCHEMA-MARSHAL','MIN-VALUE',
- 'MIN-WIDTH-CHARS','MIN-WIDTH-PIXELS','MODIFIED','MOUSE-POINTER',
- 'MOVABLE','MULTI-COMPILE','MULTIPLE','MULTITASKING-INTERVAL',
- 'MUST-UNDERSTAND','NAME','NAMESPACE-PREFIX','NAMESPACE-URI',
- 'NEEDS-APPSERVER-PROMPT','NEEDS-PROMPT','NESTED','NEW-ROW',
- 'NEXT-COLUMN','NEXT-ROWID','NEXT-SIBLING','NEXT-TAB-ITEM', 'NO-BOX',
- 'NO-CURRENT-VALUE','NODE-VALUE','NO-EMPTY-SPACE','NO-FOCUS',
- 'NONAMESPACE-SCHEMA-LOCATION','NO-SCHEMA-MARSHAL','NO-VALIDATE','NUM-BUFFERS',
- 'NUM-BUTTONS','NUM-CHILD-RELATIONS','NUM-CHILDREN','NUM-COLUMNS',
- 'NUM-DROPPED-FILES','NUMERIC-DECIMAL-POINT','NUMERIC-FORMAT','NUMERIC-SEPARATOR',
- 'NUM-FIELDS','NUM-FORMATS','NUM-HEADER-ENTRIES','NUM-ITEMS',
- 'NUM-ITERATIONS','NUM-LINES','NUM-LOCKED-COLUMNS','NUM-LOG-FILES',
- 'NUM-MESSAGES','NUM-PARAMETERS','NUM-REFERENCES','NUM-RELATIONS',
- 'NUM-REPLACED','NUM-SELECTED-ROWS','NUM-SELECTED-WIDGETS','NUM-SOURCE-BUFFERS',
- 'NUM-TABS','NUM-TOP-BUFFERS','NUM-TO-RETAIN','NUM-VISIBLE-COLUMNS',
- 'ON-FRAME-BORDER','ORIGIN-HANDLE','ORIGIN-ROWID','OWNER',
- 'OWNER-DOCUMENT','PAGE-BOTTOM','PAGE-TOP','PARAMETER',
- 'PARENT','PARENT-BUFFER','PARENT-RELATION','PARSE-STATUS',
- 'PASSWORD-FIELD','PATHNAME','PBE-HASH-ALGORITHM','PBE-KEY-ROUNDS',
- 'PERSISTENT','PERSISTENT-CACHE-DISABLED','PERSISTENT-PROCEDURE','PFCOLOR',
- 'PIXELS-PER-COLUMN','PIXELS-PER-ROW','POPUP-MENU','POPUP-ONLY',
- 'POSITION','PREFER-DATASET','PREPARED','PREPARE-STRING',
- 'PREV-COLUMN','PREV-SIBLING','PREV-TAB-ITEM','PRIMARY',
- 'PRINTER-CONTROL-HANDLE','PRINTER-HDC','PRINTER-NAME','PRINTER-PORT',
- 'PRIVATE-DATA','PROCEDURE-NAME','PROGRESS-SOURCE','PROXY',
- 'PROXY-PASSWORD','PROXY-USERID','PUBLIC-ID','PUBLISHED-EVENTS',
- 'RADIO-BUTTONS','READ-ONLY','RECORD-LENGTH',
- 'REFRESHABLE','RELATION-FIELDS','RELATIONS-ACTIVE','REMOTE',
- 'REMOTE-HOST','REMOTE-PORT','RESIZABLE','RESIZE',
- 'RESTART-ROWID','RETAIN-SHAPE','RETURN-INSERTED','RETURN-VALUE-DATA-TYPE',
- 'ROLES','ROUNDED','COL','ROW','ROW-HEIGHT-CHARS',
- 'ROW-HEIGHT-PIXELS','ROW-MARKERS','ROW-RESIZABLE','ROW-STATE',
- 'SAVE-WHERE-STRING','SCHEMA-CHANGE','SCHEMA-LOCATION','SCHEMA-MARSHAL',
- 'SCHEMA-PATH','SCREEN-LINES','SCREEN-VALUE','SCROLLABLE',
- 'SCROLLBAR-HORIZONTAL','SCROLL-BARS','SCROLLBAR-VERTICAL','SEAL-TIMESTAMP',
- 'SELECTABLE','SELECTED','SELECTION-END','SELECTION-START',
- 'SELECTION-TEXT','SENSITIVE','SEPARATOR-FGCOLOR','SEPARATORS',
- 'SERVER','SERVER-CONNECTION-BOUND','SERVER-CONNECTION-BOUND-REQUEST','SERVER-CONNECTION-CONTEXT',
- 'SERVER-CONNECTION-ID','SERVER-OPERATING-MODE','SESSION-END','SESSION-ID',
- 'SHOW-IN-TASKBAR','SIDE-LABEL-HANDLE','SIDE-LABELS','SKIP-DELETED-RECORD',
- 'SMALL-ICON','SMALL-TITLE','SOAP-FAULT-ACTOR','SOAP-FAULT-CODE',
- 'SOAP-FAULT-DETAIL','SOAP-FAULT-STRING','SORT','SORT-ASCENDING',
- 'SORT-NUMBER','SSL-SERVER-NAME','STANDALONE','STARTUP-PARAMETERS',
- 'STATE-DETAIL','STATUS-AREA','STATUS-AREA-FONT','STOPPED',
- 'STREAM','STRETCH-TO-FIT','STRICT','STRING-VALUE',
- 'SUBTYPE','SUPER-PROCEDURES','SUPPRESS-NAMESPACE-PROCESSING','SUPPRESS-WARNINGS',
- 'SYMMETRIC-ENCRYPTION-ALGORITHM','SYMMETRIC-ENCRYPTION-IV','SYMMETRIC-ENCRYPTION-KEY','SYMMETRIC-SUPPORT',
- 'system-ALERT-BOXES','system-ID','TABLE','TABLE-CRC-LIST',
- 'TABLE-HANDLE','TABLE-LIST','TABLE-NUMBER','TAB-POSITION',
- 'TAB-STOP','TEMP-DIRECTORY','TEXT-SELECTED','THREE-D',
- 'TIC-MARKS','TIME-SOURCE','TITLE','TITLE-BGCOLOR','FIELD',
- 'TITLE-DCOLOR','TITLE-FGCOLOR','TITLE-FONT','TOOLTIP',
- 'TOOLTIPS','TOP-ONLY','TRACKING-CHANGES','TRANSACTION',
- 'TRANS-INIT-PROCEDURE','TRANSPARENT','TYPE','UNIQUE-ID',
- 'UNIQUE-MATCH','URL','URL-PASSWORD','URL-USERID','EXTENT',
- 'USER-ID','V6DISPLAY','VALIDATE-EXPRESSION','VALIDATE-MESSAGE',
- 'VALIDATE-XML','VALIDATION-ENABLED','VIEW-FIRST-COLUMN-ON-REOPEN',
- 'VIRTUAL-HEIGHT-CHARS','VIRTUAL-HEIGHT-PIXELS','VIRTUAL-WIDTH-CHARS','VIRTUAL-WIDTH-PIXELS',
- 'VISIBLE','WARNING','WHERE-STRING','widget-ENTER','DATE',
- 'widget-LEAVE','WIDTH-CHARS','WIDTH-PIXELS','WINDOW-STATE',
- 'WINDOW-system','WORD-WRAP','WORK-AREA-HEIGHT-PIXELS','WORK-AREA-WIDTH-PIXELS',
- 'WORK-AREA-X','WORK-AREA-Y','WRITE-STATUS','X','widget-Handle',
- 'X-DOCUMENT','XML-DATA-TYPE','XML-NODE-TYPE','XML-SCHEMA-PATH',
- 'XML-SUPPRESS-NAMESPACE-PROCESSING','Y','YEAR-OFFSET','CHARACTER','INTEGER','LOGICAL',
- 'LONGCHAR','MEMPTR','DECIMAL','CHAR','DEC','INT','LOG','DECI','INTE','LOGI','long'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}',
- '<', '>', '=',
- '+', '-', '*', '/',
- '!', '@', '%', '|', '$',
- ':', '.', ';', ',',
- '?', '<=','<>','>=', '\\'
- ),
- 'CASE_SENSITIVE' => array (
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array (
- 'KEYWORDS' => array (
- 1 => 'color: #0000ff; font-weight: bold;',
- 2 => 'color: #1D16B2;',
- 3 => 'color: #993333;',
- 4 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array (
-// 1 => 'color: #808080; font-style: italic;',
-// 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array (
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array (
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array (
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array (
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array (
- 0 => 'color: #006600;'
- ),
- 'SYMBOLS' => array (
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array (
- ),
- 'SCRIPT' => array (
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 0 => ':'
- ),
- 'REGEXPS' => array (
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array (
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array (
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![\.\-a-zA-Z0-9_\$\#&])",
- 'DISALLOWED_AFTER' => "(?![\-a-zA-Z0-9_%])"
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/prolog.php b/libvpx/examples/includes/geshi/geshi/prolog.php
deleted file mode 100644
index e3a07c1..0000000
--- a/libvpx/examples/includes/geshi/geshi/prolog.php
+++ /dev/null
@@ -1,143 +0,0 @@
-<?php
-/*************************************************************************************
- * prolog.php
- * --------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2008/10/02
- *
- * Prolog language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/02 (1.0.8.1)
- * - First Release
- *
- * TODO (updated 2008/10/02)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Prolog',
- 'COMMENT_SINGLE' => array(1 => '%'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array("\'"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'NUMBERS' =>
- GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_FLT_SCI_ZERO,
- 'KEYWORDS' => array(
- 1 => array(
- 'abolish','abs','arg','asserta','assertz','at_end_of_stream','atan',
- 'atom','atom_chars','atom_codes','atom_concat','atom_length',
- 'atomic','bagof','call','catch','ceiling','char_code',
- 'char_conversion','clause','close','compound','consult','copy_term',
- 'cos','current_char_conversion','current_input','current_op',
- 'current_output','current_predicate','current_prolog_flag',
- 'discontiguous','dynamic','ensure_loaded','exp','fail','findall',
- 'float','float_fractional_part','float_integer_part','floor',
- 'flush_output','functor','get_byte','get_char','get_code','halt',
- 'include','initialization','integer','is','listing','log','mod',
- 'multifile','nl','nonvar','notrace','number','number_chars',
- 'number_codes','once','op','open','peek_byte','peek_char',
- 'peek_code','put_byte','put_char','put_code','read','read_term',
- 'rem','repeat','retract','round','set_input','set_output',
- 'set_prolog_flag','set_stream_position','setof','sign','sin','sqrt',
- 'stream_property','sub_atom','throw','trace','true','truncate',
- 'unify_with_occurs_check','univ','var','write','write_canonical',
- 'write_term','writeq'
- )
- ),
- 'SYMBOLS' => array(
- 0 => array('(', ')', '[', ']', '{', '}',),
- 1 => array('?-', ':-', '=:='),
- 2 => array('\-', '\+', '\*', '\/'),
- 3 => array('-', '+', '*', '/'),
- 4 => array('.', ':', ',', ';'),
- 5 => array('!', '@', '&', '|'),
- 6 => array('<', '>', '=')
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #990000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;',
- 'HARD' => 'color: #0000ff;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #800080;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;',
- 1 => 'color: #339933;',
- 2 => 'color: #339933;',
- 3 => 'color: #339933;',
- 4 => 'color: #339933;',
- 5 => 'color: #339933;',
- 6 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #008080;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://pauillac.inria.fr/~deransar/prolog/bips.html'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Variables
- 0 => "(?<![A-Z_])(?!(?:PIPE|SEMI)[^a-zA-Z0-9_])[A-Z_][a-zA-Z0-9_]*(?![a-zA-Z0-9_])"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/providex.php b/libvpx/examples/includes/geshi/geshi/providex.php
deleted file mode 100644
index d8b918e..0000000
--- a/libvpx/examples/includes/geshi/geshi/providex.php
+++ /dev/null
@@ -1,299 +0,0 @@
-<?php
-/******************************************************************************
- * providex.php
- * ----------
- * Author: Jeff Wilder (jeff@coastallogix.com)
- * Copyright: (c) 2008 Coastal Logix (http://www.coastallogix.com)
- * Release Version: 1.0.8.3
- * Date Started: 2008/10/18
- *
- * ProvideX language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/21 (1.0.0)
- * - First Release
- *
- * TODO
- * -------------------------
- * 1. Create a regexp for numeric global variables (ex: %VarName = 3)
- * 2. Add standard object control properties
- *
- ******************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *****************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'ProvideX',
- 'COMMENT_SINGLE' => array(1 => '!'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(
- // Single-Line Comments using REM command
- 2 => "/\bREM\b.*?$/i"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- // Directives
- '*break', '*continue', '*end', '*escape', '*next', '*proceed',
- '*retry', '*return', '*same', 'accept', 'add index', 'addr',
- 'auto', 'begin', 'break', 'button', 'bye', 'call', 'case',
- 'chart', 'check_box', 'class', 'clear', 'clip_board', 'close',
- 'continue', 'control', 'create required', 'create table',
- 'cwdir', 'data', 'day_format', 'def', 'default', 'defctl',
- 'defprt', 'deftty', 'delete required', 'dictionary', 'dim', 'direct',
- 'directory', 'disable', 'drop', 'drop_box', 'dump', 'edit',
- 'else', 'enable', 'end switch', 'end', 'end_if', 'endtrace',
- 'enter', 'erase', 'error_handler', 'escape', 'event', 'execute',
- 'exit', 'exitto', 'extract', 'file', 'find', 'floating point',
- 'for', 'function', 'get_file_box', 'gosub', 'goto', 'grid',
- 'h_scrollbar', 'hide', 'if', 'index', 'indexed', 'input',
- 'insert', 'invoke', 'iolist', 'keyed', 'let', 'like',
- 'line_switch', 'list', 'list_box', 'load', 'local', 'lock',
- 'long_form', 'menu_bar', 'merge', 'message_lib', 'mnemonic',
- 'msgbox', 'multi_line', 'multi_media', 'next', 'object', 'obtain',
- 'on', 'open', 'password', 'perform', 'pop', 'popup_menu',
- 'precision', 'prefix', 'preinput', 'print', 'process', 'program',
- 'property', 'purge', 'quit', 'radio_button', 'randomize',
- 'read', 'record', 'redim', 'refile', 'release', 'rem', 'remove',
- 'rename', 'renumber', 'repeat', 'reset', 'restore', 'retry',
- 'return', 'round', 'run', 'save', 'select', 'serial', 'server',
- 'set_focus', 'set_nbf', 'set_param', 'setctl', 'setday', 'setdev',
- 'setdrive', 'seterr', 'setesc', 'setfid', 'setmouse', 'settime',
- 'settrace', 'short_form', 'show', 'sort', 'start', 'static',
- 'step', 'stop', 'switch', 'system_help', 'system_jrnl', 'table',
- 'then', 'to', 'translate', 'tristate_box', 'unlock', 'until',
- 'update', 'user_lex', 'v_scrollbar', 'vardrop_box', 'varlist_box',
- 'via', 'video_palette', 'wait', 'wend', 'while', 'winprt_setup',
- 'with', 'write'
- ),
- 2 => array(
- // System Functions
- '@x', '@y', 'abs', 'acs', 'and', 'arg', 'asc', 'asn', 'ath',
- 'atn', 'bin', 'bsz', 'chg', 'chr', 'cmp', 'cos', 'cpl',
- 'crc', 'cse', 'ctl', 'cvs', 'dec', 'dir', 'dll', 'dsk',
- 'dte', 'env', 'ept', 'err', 'evn', 'evs', 'exp', 'ffn',
- 'fib', 'fid', 'fin', 'fpt', 'gap', 'gbl', 'gep', 'hsa',
- 'hsh', 'hta', 'hwn', 'i3e', 'ind', 'int', 'iol', 'ior',
- 'jul', 'jst', 'kec', 'kef', 'kel', 'ken', 'kep', 'key',
- 'kgn', 'lcs', 'len', 'lno', 'log', 'lrc', 'lst', 'max',
- 'mem', 'mid', 'min', 'mnm', 'mod', 'msg', 'msk', 'mxc',
- 'mxl', 'new', 'not', 'nul', 'num', 'obj', 'opt', 'pad',
- 'pck', 'pfx', 'pgm', 'pos', 'prc', 'prm', 'pth', 'pub',
- 'rcd', 'rdx', 'rec', 'ref', 'rnd', 'rno', 'sep', 'sgn',
- 'sin', 'sqr', 'srt', 'ssz', 'stk', 'stp', 'str', 'sub',
- 'swp', 'sys', 'tan', 'tbl', 'tcb', 'tmr', 'trx', 'tsk',
- 'txh', 'txw', 'ucp', 'ucs', 'upk', 'vin', 'vis', 'xeq',
- 'xfa', 'xor', '_obj'
- ),
- 3 => array(
- // System Variables
- // Vars that are duplicates of functions
- // 'ctl', 'err', 'pfx', 'prm', 'rnd', 'sep', 'sys',
- 'bkg', 'chn', 'day', 'dlm', 'dsz', 'eom', 'ers', 'esc',
- 'gfn', 'gid', 'hfn', 'hlp', 'hwd', 'lfa', 'lfo', 'lip',
- 'lpg', 'lwd', 'mse', 'msl', 'nar', 'nid', 'pgn', 'psz',
- 'quo', 'ret', 'sid', 'ssn', 'tim', 'tme', 'tms', 'tsm',
- 'uid', 'unt', 'who'
-
- ),
- 4 => array(
- // Nomads Variables
- '%Flmaint_Lib$', '%Flmaint_Msg$', '%Nomads_Activation_Ok',
- '%Nomads_Auto_Qry', '%Nomads_Disable_Debug',
- '%Nomads_Disable_Trace', '%Nomads_Fkey_Handler$',
- '%Nomads_Fkey_Tbl$', '%Nomads_Notest', '%Nomads_Onexit$',
- '%Nomads_Post_Display', '%Nomads_Pre_Display$',
- '%Nomads_Process$', '%Nomads_Trace_File$',
- '%Nomad_Actv_Folder_Colors$', '%Nomad_Automation_Enabled',
- '%Nomad_Auto_Close', '%Nomad_Center_Wdw', '%Nomad_Concurrent_Wdw',
- '%Nomad_Custom_Define', '%Nomad_Custom_Dir$',
- '%Nomad_Custom_Genmtc', '%Nomad_Custom_Skip_Definition',
- '%Nomad_Def_Sfx$', '%Nomad_Enter_Tab', '%Nomad_Esc_Sel',
- '%Nomad_Isjavx', '%Nomad_Iswindx', '%Nomad_Iswindx$',
- '%Nomad_Menu$', '%Nomad_Menu_Leftedge_Clr$',
- '%Nomad_Menu_Textbackground_Clr$', '%Nomad_Mln_Sep$',
- '%Nomad_Msgmnt$', '%Nomad_Noplusw', '%Nomad_No_Customize',
- '%Nomad_Object_Persistence', '%Nomad_Object_Resize',
- '%Nomad_Open_Load', '%Nomad_Override_Font$',
- '%Nomad_Palette_Loaded', '%Nomad_Panel_Info_Force',
- '%Nomad_Panel_Info_Prog$', '%Nomad_Pnl_Def_Colour$',
- '%Nomad_Pnl_Def_Font$', '%Nomad_Prg_Cache', '%Nomad_Qry_Attr$',
- '%Nomad_Qry_Btn$', '%Nomad_Qry_Clear_Start', '%Nomad_Qry_Tip$',
- '%Nomad_Qry_Wide', '%Nomad_Query_Clear_Status', '%Nomad_Query_Kno',
- '%Nomad_Query_No_Gray', '%Nomad_Query_Odb_Ignore',
- '%Nomad_Query_Retkno', '%Nomad_Query_Sbar_Max',
- '%Nomad_Relative_Wdw', '%Nomad_Save_Qry_Path', '%Nomad_Script_Fn',
- '%Nomad_Script_Log', '%Nomad_Script_Wdw',
- '%Nomad_Skip_Change_Logic', '%Nomad_Skip_Onselect_Logic',
- '%Nomad_Stk$', '%Nomad_Tab_Dir', '%Nomad_Timeout',
- '%Nomad_Turbo_Off', '%Nomad_Visual_Effect',
- '%Nomad_Visual_Override', '%Nomad_Win_Ver', '%Nomad_Xchar',
- '%Nomad_Xmax', '%Nomad_Ychar', '%Nomad_Ymax', '%Scr_Def_Attr$',
- '%Scr_Def_H_Fl$', '%Scr_Def_H_Id$', '%Scr_Lib', '%Scr_Lib$',
- '%Z__Usr_Sec$', 'Alternate_Panel$', 'Alternate_Panel_Type$',
- 'Arg_1$', 'Arg_10$', 'Arg_11$', 'Arg_12$', 'Arg_13$', 'Arg_14$',
- 'Arg_15$', 'Arg_16$', 'Arg_17$', 'Arg_18$', 'Arg_19$', 'Arg_2$',
- 'Arg_20$', 'Arg_3$', 'Arg_4$', 'Arg_5$', 'Arg_6$', 'Arg_7$',
- 'Arg_8$', 'Arg_9$', 'Change_Flg', 'Cmd_Str$', 'Default_Prog$',
- 'Disp_Cmd$', 'Entire_Record$', 'Exit_Cmd$', 'Fldr_Default_Prog$',
- 'Folder_Id$', 'Id', 'Id$', 'Ignore_Exit', 'Initialize_Flg',
- 'Init_Text$', 'Init_Val$', 'Main_Scrn_K$', 'Mnu_Ln$',
- 'Next_Folder', 'Next_Id', 'Next_Id$', 'No_Flush', 'Prime_Key$',
- 'Prior_Val', 'Prior_Val$', 'Qry_Val$', 'Refresh_Flg',
- 'Replacement_Folder$', 'Replacement_Lib$', 'Replacement_Scrn$',
- 'Scrn_Id$', 'Scrn_K$', 'Scrn_Lib$', 'Tab_Table$', '_Eom$'
- ),
- 5 => array(
- // Mnemonics
- "'!w'", "'*c'", "'*h'", "'*i'", "'*o'", "'*r'", "'*x'",
- "'+b'", "'+d'", "'+e'", "'+f'", "'+i'", "'+n'",
- "'+p'", "'+s'", "'+t'", "'+u'", "'+v'", "'+w'", "'+x'",
- "'+z'", "'-b'", "'-d'", "'-e'", "'-f'", "'-i'",
- "'-n'", "'-p'", "'-s'", "'-t'", "'-u'", "'-v'", "'-w'",
- "'-x'", "'-z'", "'2d'", "'3d'", "'4d'", "'@@'", "'ab'",
- "'arc'", "'at'", "'backgr'", "'bb'", "'be'", "'beep'",
- "'bg'", "'bi'", "'bj'", "'bk'", "'black'", "'blue'",
- "'bm'", "'bo'", "'box'", "'br'", "'bs'", "'bt'", "'bu'",
- "'bw'", "'bx'", "'caption'", "'ce'", "'cf'", "'ch'",
- "'ci'", "'circle'", "'cl'", "'colour'", "'cp'", "'cpi'",
- "'cr'", "'cs'", "'cursor'", "'cyan''_cyan'", "'dc'",
- "'default'", "'df'", "'dialogue'", "'dn'", "'do'",
- "'drop'", "'eb'", "'ee'", "'ef'", "'eg'", "'ei'", "'ej'",
- "'el'", "'em'", "'eo'", "'ep'", "'er'", "'es'", "'et'",
- "'eu'", "'ew'", "'ff'", "'fill'", "'fl'", "'font'",
- "'frame'", "'gd'", "'ge'", "'gf'", "'goto'", "'green'",
- "'gs'", "'hide'", "'ic'", "'image'", "'jc'",
- "'jd'", "'jl'", "'jn'", "'jr'", "'js'", "'l6'", "'l8'",
- "'lc'", "'ld'", "'lf'", "'li'", "'line'", "'lm'",
- "'lpi'", "'lt'", "'magenta'", "'maxsize'", "'me'",
- "'message'", "'minsize'", "'mn'", "'mode'",
- "'move'", "'mp'", "'ms'", "'ni'", "'offset'", "'option'",
- "'pe'", "'pen'", "'picture'", "'pie'", "'pm'", "'polygon'",
- "'pop'", "'ps'", "'push'", "'rb'", "'rc'", "'rectangle'",
- "'red'", "'rl'", "'rm'", "'rp'", "'rs'", "'rt'", "'sb'",
- "'scroll'", "'sd'", "'se'", "'sf'", "'show'", "'size'",
- "'sl'", "'sn'", "'sp'", "'sr'", "'swap'", "'sx'", "'text'",
- "'textwdw'", "'tr'", "'tw'", "'uc'", "'up'", "'vt'", "'wa'",
- "'wc'", "'wd'", "'wg'", "'white'", "'window'", "'wm'",
- "'wp'", "'wr'", "'wrap'", "'ws'", "'wx'", "'xp'", "'yellow'",
- "'zx'", "'_black'", "'_blue'", "'_colour'", "'_green'",
- "'_magenta'", "'_red'", "'_white'", "'_yellow'"
- ),
- ),
- 'SYMBOLS' => array(
- 0 => array('+', '-', '*', '/', '^', '|'),
- 1 => array('++', '--', '+=', '-=', '*=', '/=', '^=', '|='),
- 2 => array('&lt;', '&gt;', '='),
- 3 => array('(', ')', '[', ']', '{', '}'),
- 4 => array(',', '@', ';', '\\')
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: navy;', // Directives
- 2 => 'color: blue;', // System Functions
- 3 => 'color: blue;', // System Variables
- 4 => 'color: #6A5ACD; font-style: italic;', // Nomads Global Variables
- 5 => 'color: #BDB76B;', // Mnemonics
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008080; font-style: italic;',
- 2 => 'color: #008080;',
- 'MULTI' => 'color: #008080; font-style: italic;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000066;'
- ),
- 'STRINGS' => array(
- 0 => 'color: green;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #00008B;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;',
- 1 => 'color: #000099;',
- 2 => 'color: #000099;',
- 3 => 'color: #0000C9;',
- 4 => 'color: #000099;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 1 => 'color: #006400; font-weight: bold',
- 2 => 'color: #6A5ACD;'
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.allbasic.info./wiki/index.php/PX:Directive_{FNAME}',
- 2 => 'http://www.allbasic.info./wiki/index.php/PX:System_function_{FNAME}',
- 3 => 'http://www.allbasic.info./wiki/index.php/PX:System_variable_{FNAME}',
- 4 => 'http://www.allbasic.info./wiki/index.php/PX:Nomads_{FNAME}',
- 5 => 'http://www.allbasic.info./wiki/index.php/PX:Mnemonic_{FNAMEU}'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => "'"
- ),
- 'REGEXPS' => array(
- 1 => array(
- // Line Labels
- GESHI_SEARCH => '([[:space:]])([a-zA-Z_][a-zA-Z0-9_]+)(:)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- 2 => array(
- // Global String Variables
- GESHI_SEARCH => '(\%)([a-zA-Z_][a-zA-Z0-9_]+)(\$)',
- GESHI_REPLACE => '\\1\\2\\3',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'NUMBERS' => GESHI_NEVER
- )
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/python.php b/libvpx/examples/includes/geshi/geshi/python.php
deleted file mode 100644
index fbc6cab..0000000
--- a/libvpx/examples/includes/geshi/geshi/python.php
+++ /dev/null
@@ -1,237 +0,0 @@
-<?php
-/*************************************************************************************
- * python.php
- * ----------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * Python language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/12/18
- * - Added missing functions and keywords. Also added two new Python 3.0 types. SF#2441839
- * 2005/05/26
- * - Modifications by Tim (tim@skreak.com): added more keyword categories, tweaked colors
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/08/30 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Python',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- //Longest quotemarks ALWAYS first
- 'QUOTEMARKS' => array('"""', '"', "'"),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
-
- /*
- ** Set 1: reserved words
- ** http://python.org/doc/current/ref/keywords.html
- */
- 1 => array(
- 'and', 'del', 'for', 'is', 'raise', 'assert', 'elif', 'from', 'lambda', 'return', 'break',
- 'else', 'global', 'not', 'try', 'class', 'except', 'if', 'or', 'while', 'continue', 'exec',
- 'import', 'pass', 'yield', 'def', 'finally', 'in', 'print', 'with', 'as'
- ),
-
- /*
- ** Set 2: builtins
- ** http://python.org/doc/current/lib/built-in-funcs.html
- */
- 2 => array(
- '__import__', 'abs', 'basestring', 'bool', 'callable', 'chr', 'classmethod', 'cmp',
- 'compile', 'complex', 'delattr', 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'execfile',
- 'file', 'filter', 'float', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help',
- 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len', 'list', 'locals',
- 'long', 'map', 'max', 'min', 'object', 'oct', 'open', 'ord', 'pow', 'property', 'range',
- 'raw_input', 'reduce', 'reload', 'reversed', 'round', 'set', 'setattr', 'slice',
- 'sorted', 'staticmethod', 'str', 'sum', 'super', 'tuple', 'type', 'unichr', 'unicode',
- 'vars', 'xrange', 'zip',
- // Built-in constants: http://python.org/doc/current/lib/node35.html
- 'False', 'True', 'None', 'NotImplemented', 'Ellipsis',
- // Built-in Exceptions: http://python.org/doc/current/lib/module-exceptions.html
- 'Exception', 'StandardError', 'ArithmeticError', 'LookupError', 'EnvironmentError',
- 'AssertionError', 'AttributeError', 'EOFError', 'FloatingPointError', 'IOError',
- 'ImportError', 'IndexError', 'KeyError', 'KeyboardInterrupt', 'MemoryError', 'NameError',
- 'NotImplementedError', 'OSError', 'OverflowError', 'ReferenceError', 'RuntimeError',
- 'StopIteration', 'SyntaxError', 'SystemError', 'SystemExit', 'TypeError',
- 'UnboundlocalError', 'UnicodeError', 'UnicodeEncodeError', 'UnicodeDecodeError',
- 'UnicodeTranslateError', 'ValueError', 'WindowsError', 'ZeroDivisionError', 'Warning',
- 'UserWarning', 'DeprecationWarning', 'PendingDeprecationWarning', 'SyntaxWarning',
- 'RuntimeWarning', 'FutureWarning',
- // self: this is a common python convention (but not a reserved word)
- 'self',
- // other
- 'any', 'all'
- ),
-
- /*
- ** Set 3: standard library
- ** http://python.org/doc/current/lib/modindex.html
- */
- 3 => array(
- '__builtin__', '__future__', '__main__', '_winreg', 'aifc', 'AL', 'al', 'anydbm',
- 'array', 'asynchat', 'asyncore', 'atexit', 'audioop', 'base64', 'BaseHTTPServer',
- 'Bastion', 'binascii', 'binhex', 'bisect', 'bsddb', 'bz2', 'calendar', 'cd', 'cgi',
- 'CGIHTTPServer', 'cgitb', 'chunk', 'cmath', 'cmd', 'code', 'codecs', 'codeop',
- 'collections', 'colorsys', 'commands', 'compileall', 'compiler',
- 'ConfigParser', 'Cookie', 'cookielib', 'copy', 'copy_reg', 'cPickle', 'crypt',
- 'cStringIO', 'csv', 'curses', 'datetime', 'dbhash', 'dbm', 'decimal', 'DEVICE',
- 'difflib', 'dircache', 'dis', 'distutils', 'dl', 'doctest', 'DocXMLRPCServer', 'dumbdbm',
- 'dummy_thread', 'dummy_threading', 'email', 'encodings', 'errno', 'exceptions', 'fcntl',
- 'filecmp', 'fileinput', 'FL', 'fl', 'flp', 'fm', 'fnmatch', 'formatter', 'fpectl',
- 'fpformat', 'ftplib', 'gc', 'gdbm', 'getopt', 'getpass', 'gettext', 'GL', 'gl', 'glob',
- 'gopherlib', 'grp', 'gzip', 'heapq', 'hmac', 'hotshot', 'htmlentitydefs', 'htmllib',
- 'HTMLParser', 'httplib', 'imageop', 'imaplib', 'imgfile', 'imghdr', 'imp', 'inspect',
- 'itertools', 'jpeg', 'keyword', 'linecache', 'locale', 'logging', 'mailbox', 'mailcap',
- 'marshal', 'math', 'md5', 'mhlib', 'mimetools', 'mimetypes', 'MimeWriter', 'mimify',
- 'mmap', 'msvcrt', 'multifile', 'mutex', 'netrc', 'new', 'nis', 'nntplib', 'operator',
- 'optparse', 'os', 'ossaudiodev', 'parser', 'pdb', 'pickle', 'pickletools', 'pipes',
- 'pkgutil', 'platform', 'popen2', 'poplib', 'posix', 'posixfile', 'pprint', 'profile',
- 'pstats', 'pty', 'pwd', 'py_compile', 'pyclbr', 'pydoc', 'Queue', 'quopri', 'random',
- 're', 'readline', 'repr', 'resource', 'rexec', 'rfc822', 'rgbimg', 'rlcompleter',
- 'robotparser', 'sched', 'ScrolledText', 'select', 'sets', 'sgmllib', 'sha', 'shelve',
- 'shlex', 'shutil', 'signal', 'SimpleHTTPServer', 'SimpleXMLRPCServer', 'site', 'smtpd',
- 'smtplib', 'sndhdr', 'socket', 'SocketServer', 'stat', 'statcache', 'statvfs', 'string',
- 'StringIO', 'stringprep', 'struct', 'subprocess', 'sunau', 'SUNAUDIODEV', 'sunaudiodev',
- 'symbol', 'sys', 'syslog', 'tabnanny', 'tarfile', 'telnetlib', 'tempfile', 'termios',
- 'test', 'textwrap', 'thread', 'threading', 'time', 'timeit', 'Tix', 'Tkinter', 'token',
- 'tokenize', 'traceback', 'tty', 'turtle', 'types', 'unicodedata', 'unittest', 'urllib2',
- 'urllib', 'urlparse', 'user', 'UserDict', 'UserList', 'UserString', 'uu', 'warnings',
- 'wave', 'weakref', 'webbrowser', 'whichdb', 'whrandom', 'winsound', 'xdrlib', 'xml',
- 'xmllib', 'xmlrpclib', 'zipfile', 'zipimport', 'zlib',
- // Python 3.0
- 'bytes', 'bytearray'
- ),
-
- /*
- ** Set 4: special methods
- ** http://python.org/doc/current/ref/specialnames.html
- */
- 4 => array(
- /*
- // Iterator types: http://python.org/doc/current/lib/typeiter.html
- '__iter__', 'next',
- // String types: http://python.org/doc/current/lib/string-methods.html
- 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs',
- 'find', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle',
- 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'replace', 'rfind', 'rindex', 'rjust',
- 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
- 'translate', 'upper', 'zfill',
- */
- // Basic customization: http://python.org/doc/current/ref/customization.html
- '__new__', '__init__', '__del__', '__repr__', '__str__',
- '__lt__', '__le__', '__eq__', '__ne__', '__gt__', '__ge__', '__cmp__', '__rcmp__',
- '__hash__', '__nonzero__', '__unicode__', '__dict__',
- // Attribute access: http://python.org/doc/current/ref/attribute-access.html
- '__setattr__', '__delattr__', '__getattr__', '__getattribute__', '__get__', '__set__',
- '__delete__', '__slots__',
- // Class creation, callable objects
- '__metaclass__', '__call__',
- // Container types: http://python.org/doc/current/ref/sequence-types.html
- '__len__', '__getitem__', '__setitem__', '__delitem__', '__iter__', '__contains__',
- '__getslice__', '__setslice__', '__delslice__',
- // Numeric types: http://python.org/doc/current/ref/numeric-types.html
- '__abs__','__add__','__and__','__coerce__','__div__','__divmod__','__float__',
- '__hex__','__iadd__','__isub__','__imod__','__idiv__','__ipow__','__iand__',
- '__ior__','__ixor__', '__ilshift__','__irshift__','__invert__','__int__',
- '__long__','__lshift__',
- '__mod__','__mul__','__neg__','__oct__','__or__','__pos__','__pow__',
- '__radd__','__rdiv__','__rdivmod__','__rmod__','__rpow__','__rlshift__','__rrshift__',
- '__rshift__','__rsub__','__rmul__','__rand__','__rxor__','__ror__',
- '__sub__','__xor__'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?', '`'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #ff7700;font-weight:bold;', // Reserved
- 2 => 'color: #008000;', // Built-ins + self
- 3 => 'color: #dc143c;', // Standard lib
- 4 => 'color: #0000cd;' // Special methods
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: black;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #483d8b;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff4500;'
- ),
- 'METHODS' => array(
- 1 => 'color: black;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/qbasic.php b/libvpx/examples/includes/geshi/geshi/qbasic.php
deleted file mode 100644
index f6531f7..0000000
--- a/libvpx/examples/includes/geshi/geshi/qbasic.php
+++ /dev/null
@@ -1,151 +0,0 @@
-<?php
-/*************************************************************************************
- * qbasic.php
- * ----------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/20
- *
- * QBasic/QuickBASIC language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.2)
- * - Added support for URLs
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * - Removed unnessecary slashes from some keywords
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Make sure all possible combinations of keywords with
- * a space in them (EXIT FOR, END SELECT) are added
- * to the first keyword group
- * * Update colours, especially for the first keyword group
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'QBasic/QuickBASIC',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- //Single-Line Comments using REM command
- 2 => "/\bREM.*?$/i"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'DO', 'LOOP', 'WHILE', 'WEND', 'THEN', 'ELSE', 'ELSEIF', 'IF',
- 'FOR', 'TO', 'NEXT', 'STEP', 'GOTO', 'GOSUB', 'CALL', 'CALLS',
- 'SUB', 'FUNCTION', 'RETURN', 'RESUME', 'SELECT', 'CASE', 'UNTIL'
- ),
- 3 => array(
- 'ABS', 'ABSOLUTE', 'ACCESS', 'ALIAS', 'AND', 'ANY', 'APPEND', 'AS', 'ASC', 'ATN',
- 'BASE', 'BEEP', 'BINARY', 'BLOAD', 'BSAVE', 'BYVAL',
- 'CDBL', 'CDECL', 'CHAIN', 'CHDIR', 'CHR$', 'CINT', 'CIRCLE', 'CLEAR',
- 'CLNG', 'CLOSE', 'CLS', 'COM', 'COMMAND$', 'COMMON', 'CONST', 'COS', 'CSNG',
- 'CSRLIN', 'CVD', 'CVDMBF', 'CVI', 'CVL', 'CVS', 'CVSMDF', 'DATA', 'DATE$',
- 'DECLARE', 'DEF', 'FN', 'SEG', 'DEFDBL', 'DEFINT', 'DEFLNG', 'DEFSNG', 'DEFSTR',
- 'DIM', 'DOUBLE', 'DRAW', 'END', 'ENVIRON', 'ENVIRON$', 'EOF', 'EQV', 'ERASE',
- 'ERDEV', 'ERDEV$', 'ERL', 'ERR', 'ERROR', 'EXIT', 'EXP', 'FIELD', 'FILEATTR',
- 'FILES', 'FIX', 'FRE', 'FREEFILE', 'GET', 'HEX$', 'IMP', 'INKEY$',
- 'INP', 'INPUT', 'INPUT$', 'INSTR', 'INT', 'INTEGER', 'IOCTL', 'IOCTL$', 'IS',
- 'KEY', 'KILL', 'LBOUND', 'LCASE$', 'LEFT$', 'LEN', 'LET', 'LINE', 'LIST', 'LOC',
- 'LOCAL', 'LOCATE', 'LOCK', 'LOF', 'LOG', 'LONG', 'LPOS', 'LPRINT',
- 'LSET', 'LTRIM$', 'MID$', 'MKD$', 'MKDIR', 'MKDMBF$', 'MKI$', 'MKL$',
- 'MKS$', 'MKSMBF$', 'MOD', 'NAME', 'NOT', 'OCT$', 'OFF', 'ON', 'PEN', 'PLAY',
- 'OPEN', 'OPTION', 'OR', 'OUT', 'OUTPUT',
- 'PAINT', 'PALETTE', 'PCOPY', 'PEEK', 'PMAP', 'POINT', 'POKE', 'POS', 'PRESET',
- 'PRINT', 'PSET', 'PUT', 'RANDOM', 'RANDOMIZE', 'READ', 'REDIM', 'RESET',
- 'RESTORE', 'RIGHT$', 'RMDIR', 'RND', 'RSET', 'RTRIM$', 'RUN', 'SADD', 'SCREEN',
- 'SEEK', 'SETMEM', 'SGN', 'SHARED', 'SHELL', 'SIGNAL', 'SIN', 'SINGLE', 'SLEEP',
- 'SOUND', 'SPACE$', 'SPC', 'SQR', 'STATIC', 'STICK', 'STOP', 'STR$', 'STRIG',
- 'STRING', 'STRING$', 'SWAP', 'SYSTEM', 'TAB', 'TAN', 'TIME$', 'TIMER',
- 'TROFF', 'TRON', 'TYPE', 'UBOUND', 'UCASE$', 'UEVENT', 'UNLOCK', 'USING', 'VAL',
- 'VARPTR', 'VARPTR$', 'VARSEG', 'VIEW', 'WAIT', 'WIDTH', 'WINDOW', 'WRITE', 'XOR'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', ',', '+', '-', '*', '/', '=', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #a1a100;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080;',
- 2 => 'color: #808080;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 3 => 'http://www.qbasicnews.com/qboho/qck{FNAMEL}.shtml'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 8
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/rails.php b/libvpx/examples/includes/geshi/geshi/rails.php
deleted file mode 100644
index 52c70a6..0000000
--- a/libvpx/examples/includes/geshi/geshi/rails.php
+++ /dev/null
@@ -1,406 +0,0 @@
-<?php
-/*************************************************************************************
- * rails.php
- * ---------
- * Author: Moises Deniz
- * Copyright: (c) 2005 Moises Deniz
- * Release Version: 1.0.8.3
- * Date Started: 2007/03/21
- *
- * Ruby (with Ruby on Rails Framework) language file for GeSHi.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Rails',
- 'COMMENT_SINGLE' => array(1 => "#"),
- 'COMMENT_MULTI' => array("=begin" => "=end"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', '`','\''),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'alias', 'and', 'begin', 'break', 'case', 'class',
- 'def', 'defined', 'do', 'else', 'elsif', 'end',
- 'ensure', 'for', 'if', 'in', 'module', 'while',
- 'next', 'not', 'or', 'redo', 'rescue', 'yield',
- 'retry', 'super', 'then', 'undef', 'unless',
- 'until', 'when', 'BEGIN', 'END', 'include'
- ),
- 2 => array(
- '__FILE__', '__LINE__', 'false', 'nil', 'self', 'true',
- 'return'
- ),
- 3 => array(
- 'Array', 'Float', 'Integer', 'String', 'at_exit',
- 'autoload', 'binding', 'caller', 'catch', 'chop', 'chop!',
- 'chomp', 'chomp!', 'eval', 'exec', 'exit', 'exit!', 'fail',
- 'fork', 'format', 'gets', 'global_variables', 'gsub', 'gsub!',
- 'iterator?', 'lambda', 'load', 'local_variables', 'loop',
- 'open', 'p', 'print', 'printf', 'proc', 'putc', 'puts',
- 'raise', 'rand', 'readline', 'readlines', 'require', 'select',
- 'sleep', 'split', 'sprintf', 'srand', 'sub', 'sub!', 'syscall',
- 'system', 'trace_var', 'trap', 'untrace_var'
- ),
- 4 => array(
- 'Abbrev', 'ArgumentError', 'Base64', 'Benchmark',
- 'Benchmark::Tms', 'Bignum', 'Binding', 'CGI', 'CGI::Cookie',
- 'CGI::HtmlExtension', 'CGI::QueryExtension',
- 'CGI::Session', 'CGI::Session::FileStore',
- 'CGI::Session::MemoryStore', 'Class', 'Comparable', 'Complex',
- 'ConditionVariable', 'Continuation', 'Data',
- 'Date', 'DateTime', 'Delegator', 'Dir', 'EOFError', 'ERB',
- 'ERB::Util', 'Enumerable', 'Enumerable::Enumerator', 'Errno',
- 'Exception', 'FalseClass', 'File',
- 'File::Constants', 'File::Stat', 'FileTest', 'FileUtils',
- 'FileUtils::DryRun', 'FileUtils::NoWrite',
- 'FileUtils::StreamUtils_', 'FileUtils::Verbose', 'Find',
- 'Fixnum', 'FloatDomainError', 'Forwardable', 'GC', 'Generator',
- 'Hash', 'IO', 'IOError', 'Iconv', 'Iconv::BrokenLibrary',
- 'Iconv::Failure', 'Iconv::IllegalSequence',
- 'Iconv::InvalidCharacter', 'Iconv::InvalidEncoding',
- 'Iconv::OutOfRange', 'IndexError', 'Interrupt', 'Kernel',
- 'LoadError', 'LocalJumpError', 'Logger', 'Logger::Application',
- 'Logger::Error', 'Logger::Formatter', 'Logger::LogDevice',
- 'Logger::LogDevice::LogDeviceMutex', 'Logger::Severity',
- 'Logger::ShiftingError', 'Marshal', 'MatchData',
- 'Math', 'Matrix', 'Method', 'Module', 'Mutex', 'NameError',
- 'NameError::message', 'NilClass', 'NoMemoryError',
- 'NoMethodError', 'NotImplementedError', 'Numeric', 'Object',
- 'ObjectSpace', 'Observable', 'PStore', 'PStore::Error',
- 'Pathname', 'Precision', 'Proc', 'Process', 'Process::GID',
- 'Process::Status', 'Process::Sys', 'Process::UID', 'Queue',
- 'Range', 'RangeError', 'Rational', 'Regexp', 'RegexpError',
- 'RuntimeError', 'ScriptError', 'SecurityError', 'Set',
- 'Shellwords', 'Signal', 'SignalException', 'SimpleDelegator',
- 'SingleForwardable', 'Singleton', 'SingletonClassMethods',
- 'SizedQueue', 'SortedSet', 'StandardError', 'StringIO',
- 'StringScanner', 'StringScanner::Error', 'Struct', 'Symbol',
- 'SyncEnumerator', 'SyntaxError', 'SystemCallError',
- 'SystemExit', 'SystemStackError', 'Tempfile',
- 'Test::Unit::TestCase', 'Test::Unit', 'Test', 'Thread',
- 'ThreadError', 'ThreadGroup',
- 'ThreadsWait', 'Time', 'TrueClass', 'TypeError', 'URI',
- 'URI::BadURIError', 'URI::Error', 'URI::Escape', 'URI::FTP',
- 'URI::Generic', 'URI::HTTP', 'URI::HTTPS',
- 'URI::InvalidComponentError', 'URI::InvalidURIError',
- 'URI::LDAP', 'URI::MailTo', 'URI::REGEXP',
- 'URI::REGEXP::PATTERN', 'UnboundMethod', 'Vector', 'YAML',
- 'ZeroDivisionError', 'Zlib',
- 'Zlib::BufError', 'Zlib::DataError', 'Zlib::Deflate',
- 'Zlib::Error', 'Zlib::GzipFile', 'Zlib::GzipFile::CRCError',
- 'Zlib::GzipFile::Error', 'Zlib::GzipFile::LengthError',
- 'Zlib::GzipFile::NoFooter', 'Zlib::GzipReader',
- 'Zlib::GzipWriter', 'Zlib::Inflate', 'Zlib::MemError',
- 'Zlib::NeedDict', 'Zlib::StreamEnd', 'Zlib::StreamError',
- 'Zlib::VersionError',
- 'Zlib::ZStream',
- 'ActionController::AbstractRequest',
- 'ActionController::Assertions::DomAssertions',
- 'ActionController::Assertions::ModelAssertions',
- 'ActionController::Assertions::ResponseAssertions',
- 'ActionController::Assertions::RoutingAssertions',
- 'ActionController::Assertions::SelectorAssertions',
- 'ActionController::Assertions::TagAssertions',
- 'ActionController::Base',
- 'ActionController::Benchmarking::ClassMethods',
- 'ActionController::Caching',
- 'ActionController::Caching::Actions',
- 'ActionController::Caching::Actions::ActionCachePath',
- 'ActionController::Caching::Fragments',
- 'ActionController::Caching::Pages',
- 'ActionController::Caching::Pages::ClassMethods',
- 'ActionController::Caching::Sweeping',
- 'ActionController::Components',
- 'ActionController::Components::ClassMethods',
- 'ActionController::Components::InstanceMethods',
- 'ActionController::Cookies',
- 'ActionController::Filters::ClassMethods',
- 'ActionController::Flash',
- 'ActionController::Flash::FlashHash',
- 'ActionController::Helpers::ClassMethods',
- 'ActionController::Integration::Session',
- 'ActionController::IntegrationTest',
- 'ActionController::Layout::ClassMethods',
- 'ActionController::Macros',
- 'ActionController::Macros::AutoComplete::ClassMethods',
- 'ActionController::Macros::InPlaceEditing::ClassMethods',
- 'ActionController::MimeResponds::InstanceMethods',
- 'ActionController::Pagination',
- 'ActionController::Pagination::ClassMethods',
- 'ActionController::Pagination::Paginator',
- 'ActionController::Pagination::Paginator::Page',
- 'ActionController::Pagination::Paginator::Window',
- 'ActionController::Rescue', 'ActionController::Resources',
- 'ActionController::Routing',
- 'ActionController::Scaffolding::ClassMethods',
- 'ActionController::SessionManagement::ClassMethods',
- 'ActionController::Streaming', 'ActionController::TestProcess',
- 'ActionController::TestUploadedFile',
- 'ActionController::UrlWriter',
- 'ActionController::Verification::ClassMethods',
- 'ActionMailer::Base', 'ActionView::Base',
- 'ActionView::Helpers::ActiveRecordHelper',
- 'ActionView::Helpers::AssetTagHelper',
- 'ActionView::Helpers::BenchmarkHelper',
- 'ActionView::Helpers::CacheHelper',
- 'ActionView::Helpers::CaptureHelper',
- 'ActionView::Helpers::DateHelper',
- 'ActionView::Helpers::DebugHelper',
- 'ActionView::Helpers::FormHelper',
- 'ActionView::Helpers::FormOptionsHelper',
- 'ActionView::Helpers::FormTagHelper',
- 'ActionView::Helpers::JavaScriptHelper',
- 'ActionView::Helpers::JavaScriptMacrosHelper',
- 'ActionView::Helpers::NumberHelper',
- 'ActionView::Helpers::PaginationHelper',
- 'ActionView::Helpers::PrototypeHelper',
- 'ActionView::Helpers::PrototypeHelper::JavaScriptGenerator::GeneratorMethods',
- 'ActionView::Helpers::ScriptaculousHelper',
- 'ActionView::Helpers::TagHelper',
- 'ActionView::Helpers::TextHelper',
- 'ActionView::Helpers::UrlHelper', 'ActionView::Partials',
- 'ActionWebService::API::Method', 'ActionWebService::Base',
- 'ActionWebService::Client::Soap',
- 'ActionWebService::Client::XmlRpc',
- 'ActionWebService::Container::ActionController::ClassMethods',
- 'ActionWebService::Container::Delegated::ClassMethods',
- 'ActionWebService::Container::Direct::ClassMethods',
- 'ActionWebService::Invocation::ClassMethods',
- 'ActionWebService::Scaffolding::ClassMethods',
- 'ActionWebService::SignatureTypes', 'ActionWebService::Struct',
- 'ActiveRecord::Acts::List::ClassMethods',
- 'ActiveRecord::Acts::List::InstanceMethods',
- 'ActiveRecord::Acts::NestedSet::ClassMethods',
- 'ActiveRecord::Acts::NestedSet::InstanceMethods',
- 'ActiveRecord::Acts::Tree::ClassMethods',
- 'ActiveRecord::Acts::Tree::InstanceMethods',
- 'ActiveRecord::Aggregations::ClassMethods',
- 'ActiveRecord::Associations::ClassMethods',
- 'ActiveRecord::AttributeMethods::ClassMethods',
- 'ActiveRecord::Base',
- 'ActiveRecord::Calculations::ClassMethods',
- 'ActiveRecord::Callbacks',
- 'ActiveRecord::ConnectionAdapters::AbstractAdapter',
- 'ActiveRecord::ConnectionAdapters::Column',
- 'ActiveRecord::ConnectionAdapters::DB2Adapter',
- 'ActiveRecord::ConnectionAdapters::DatabaseStatements',
- 'ActiveRecord::ConnectionAdapters::FirebirdAdapter',
- 'ActiveRecord::ConnectionAdapters::FrontBaseAdapter',
- 'ActiveRecord::ConnectionAdapters::MysqlAdapter',
- 'ActiveRecord::ConnectionAdapters::OpenBaseAdapter',
- 'ActiveRecord::ConnectionAdapters::OracleAdapter',
- 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter',
- 'ActiveRecord::ConnectionAdapters::Quoting',
- 'ActiveRecord::ConnectionAdapters::SQLServerAdapter',
- 'ActiveRecord::ConnectionAdapters::SQLiteAdapter',
- 'ActiveRecord::ConnectionAdapters::SchemaStatements',
- 'ActiveRecord::ConnectionAdapters::SybaseAdapter::ColumnWithIdentity',
- 'ActiveRecord::ConnectionAdapters::SybaseAdapterContext',
- 'ActiveRecord::ConnectionAdapters::TableDefinition',
- 'ActiveRecord::Errors', 'ActiveRecord::Locking',
- 'ActiveRecord::Locking::Optimistic',
- 'ActiveRecord::Locking::Optimistic::ClassMethods',
- 'ActiveRecord::Locking::Pessimistic',
- 'ActiveRecord::Migration', 'ActiveRecord::Observer',
- 'ActiveRecord::Observing::ClassMethods',
- 'ActiveRecord::Reflection::ClassMethods',
- 'ActiveRecord::Reflection::MacroReflection',
- 'ActiveRecord::Schema', 'ActiveRecord::Timestamp',
- 'ActiveRecord::Transactions::ClassMethods',
- 'ActiveRecord::Validations',
- 'ActiveRecord::Validations::ClassMethods',
- 'ActiveRecord::XmlSerialization',
- 'ActiveSupport::CachingTools::HashCaching',
- 'ActiveSupport::CoreExtensions::Array::Conversions',
- 'ActiveSupport::CoreExtensions::Array::Grouping',
- 'ActiveSupport::CoreExtensions::Date::Conversions',
- 'ActiveSupport::CoreExtensions::Hash::Conversions',
- 'ActiveSupport::CoreExtensions::Hash::Conversions::ClassMethods',
- 'ActiveSupport::CoreExtensions::Hash::Diff',
- 'ActiveSupport::CoreExtensions::Hash::Keys',
- 'ActiveSupport::CoreExtensions::Hash::ReverseMerge',
- 'ActiveSupport::CoreExtensions::Integer::EvenOdd',
- 'ActiveSupport::CoreExtensions::Integer::Inflections',
- 'ActiveSupport::CoreExtensions::Numeric::Bytes',
- 'ActiveSupport::CoreExtensions::Numeric::Time',
- 'ActiveSupport::CoreExtensions::Pathname::CleanWithin',
- 'ActiveSupport::CoreExtensions::Range::Conversions',
- 'ActiveSupport::CoreExtensions::String::Access',
- 'ActiveSupport::CoreExtensions::String::Conversions',
- 'ActiveSupport::CoreExtensions::String::Inflections',
- 'ActiveSupport::CoreExtensions::String::Iterators',
- 'ActiveSupport::CoreExtensions::String::StartsEndsWith',
- 'ActiveSupport::CoreExtensions::String::Unicode',
- 'ActiveSupport::CoreExtensions::Time::Calculations',
- 'ActiveSupport::CoreExtensions::Time::Calculations::ClassMethods',
- 'ActiveSupport::CoreExtensions::Time::Conversions',
- 'ActiveSupport::Multibyte::Chars',
- 'ActiveSupport::Multibyte::Handlers::UTF8Handler',
- 'Breakpoint', 'Builder::BlankSlate', 'Builder::XmlMarkup',
- 'Fixtures',
- 'HTML::Selector', 'HashWithIndifferentAccess', 'Inflector',
- 'Inflector::Inflections', 'Mime', 'Mime::Type',
- 'OCI8AutoRecover', 'TimeZone', 'XmlSimple'
- ),
- 5 => array(
- 'image_tag', 'link_to', 'link_to_remote', 'javascript_include_tag',
- 'assert_equal', 'assert_not_equal', 'before_filter',
- 'after_filter', 'render', 'redirect_to', 'hide_action',
- 'render_to_string', 'url_for', 'controller_name',
- 'controller_class_name', 'controller_path', 'session',
- 'render_component', 'render_component_as_string', 'cookie',
- 'layout', 'flash', 'auto_complete_for', 'in_place_editor_for',
- 'respond_to', 'paginate', 'current_page', 'each', 'first',
- 'first_page', 'last_page', 'last', 'length', 'new', 'page_count',
- 'previous', 'scaffold', 'send_data',
- 'send_file', 'deliver', 'receive', 'error_messages_for',
- 'error_message_on', 'form', 'input', 'stylesheet_link_tag',
- 'stylesheet_path', 'content_for', 'select_date', 'ago',
- 'month', 'day', 'check_box', 'fields_for', 'file_field',
- 'form_for', 'hidden_field', 'text_area', 'password_field',
- 'collection_select', 'options_for_select',
- 'options_from_collection_for_select', 'file_field_tag',
- 'form_for_tag', 'hidden_field_tag', 'text_area_tag',
- 'password_field_tag', 'link_to_function', 'javascript_tag',
- 'human_size', 'number_to_currency', 'pagination_links',
- 'form_remote_tag', 'form_remote_for',
- 'submit_to_remote', 'remote_function', 'observe_form',
- 'observe_field', 'remote_form_for', 'options_for_ajax', 'alert',
- 'call', 'assign', 'show', 'hide', 'insert_html', 'sortable',
- 'toggle', 'visual_effect', 'replace', 'replace_html', 'remove',
- 'save', 'save!', 'draggable', 'drop_receiving', 'literal',
- 'draggable_element', 'drop_receiving_element', 'sortable_element',
- 'content_tag', 'tag', 'link_to_image', 'link_to_if',
- 'link_to_unless', 'mail_to', 'link_image_to', 'button_to',
- 'current_page?', 'act_as_list', 'act_as_nested', 'act_as_tree',
- 'has_many', 'has_one', 'belongs_to', 'has_many_and_belogns_to',
- 'delete', 'destroy', 'destroy_all', 'clone', 'deep_clone', 'copy',
- 'update', 'table_name', 'primary_key', 'sum', 'maximun', 'minimum',
- 'count', 'size', 'after_save', 'after_create', 'before_save',
- 'before_create', 'add_to_base', 'errors', 'add', 'validate',
- 'validates_presence_of', 'validates_numericality_of',
- 'validates_uniqueness_of', 'validates_length_of',
- 'validates_format_of', 'validates_size_of', 'to_a', 'to_s',
- 'to_xml', 'to_i'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '%', '&', '*', '|', '/', '<', '>',
- '+', '-', '=>', '<<'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color:#9966CC; font-weight:bold;',
- 2 => 'color:#0000FF; font-weight:bold;',
- 3 => 'color:#CC0066; font-weight:bold;',
- 4 => 'color:#CC00FF; font-weight:bold;',
- 5 => 'color:#5A0A0A; font-weight:bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color:#008000; font-style:italic;',
- 'MULTI' => 'color:#000080; font-style:italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color:#000099;'
- ),
- 'BRACKETS' => array(
- 0 => 'color:#006600; font-weight:bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color:#996600;'
- ),
- 'NUMBERS' => array(
- 0 => 'color:#006666;'
- ),
- 'METHODS' => array(
- 1 => 'color:#9900CC;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color:#006600; font-weight:bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color:#ff6633; font-weight:bold;',
- 1 => 'color:#0066ff; font-weight:bold;',
- 2 => 'color:#6666ff; font-weight:bold;',
- 3 => 'color:#ff3333; font-weight:bold;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- 0 => array(
- GESHI_SEARCH => "([[:space:]])(\\$[a-zA-Z_][a-zA-Z0-9_]*)",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 1 => array(
- GESHI_SEARCH => "([[:space:]])(@[a-zA-Z_][a-zA-Z0-9_]*)",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 2 => "([A-Z][a-zA-Z0-9_]*::)+[A-Z][a-zA-Z0-9_]*", //Static OOP References
- 3 => array(
- GESHI_SEARCH => "([[:space:]]|\[|\()(:[a-zA-Z_][a-zA-Z0-9_]*)",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<%' => '%>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/rebol.php b/libvpx/examples/includes/geshi/geshi/rebol.php
deleted file mode 100644
index 6f57137..0000000
--- a/libvpx/examples/includes/geshi/geshi/rebol.php
+++ /dev/null
@@ -1,196 +0,0 @@
-<?php
-/*************************************************************************************
- * rebol.php
- * --------
- * Author: Lecanu Guillaume (Guillaume@LyA.fr)
- * Copyright: (c) 2004-2005 Lecanu Guillaume (Guillaume@LyA.fr)
- * Release Version: 1.0.8.3
- * Date Started: 2004/12/22
- *
- * Rebol language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2009/01/26 (1.0.8.3)
- * - Adapted language file to comply to GeSHi language file guidelines
- * 2004/11/25 (1.0.3)
- * - Added support for multiple object splitters
- * - Fixed &new problem
- * 2004/10/27 (1.0.2)
- * - Added URL support
- * - Added extra constants
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/14)
- * -------------------------
- * * Make sure the last few function I may have missed
- * (like eval()) are included for highlighting
- * * Split to several files - php4, php5 etc
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'REBOL',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array('rebol [' => ']', 'comment [' => ']'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'binary!','block!','char!','date!','decimal!','email!','file!',
- 'hash!','integer!','issue!','list!','logic!','money!','none!',
- 'object!','paren!','pair!','path!','string!','tag!','time!',
- 'tuple!','url!',
- ),
- 2 => array(
- 'all','any','attempt','break','catch','compose','disarm','dispatch',
- 'do','do-events','does','either','else','exit','for','forall',
- 'foreach','forever','forskip','func','function','halt','has','if',
- 'launch','loop','next','quit','reduce','remove-each','repeat',
- 'return','secure','switch','throw','try','until','wait','while',
- ),
- 3 => array(
- 'about','abs','absolute','add','alert','alias','alter','and',
- 'any-block?','any-function?','any-string?','any-type?','any-word?',
- 'append','arccosine','arcsine','arctangent','array','as-pair',
- 'ask','at','back','binary?','bind','bitset?','block?','brightness?',
- 'browse','build-tag','caret-to-offset','center-face','change',
- 'change-dir','char?','charset','checksum','choose','clean-path',
- 'clear','clear-fields','close','comment','complement','component?',
- 'compress','confirm','connected?','construct','context','copy',
- 'cosine','datatype?','date?','debase','decimal?','decode-cgi',
- 'decompress','dehex','delete','detab','difference','dir?','dirize',
- 'divide','dump-face','dump-obj','echo','email?','empty?','enbase',
- 'entab','equal?','error?','even?','event?','exclude','exists?',
- 'exp','extract','fifth','file?','find','first','flash','focus',
- 'form','found?','fourth','free','function?','get','get-modes',
- 'get-word?','greater-or-equal?','greater?','hash?','head','head?',
- 'help','hide','hide-popup','image?','import-email','in',
- 'in-window?','index?','info?','inform','input','input?','insert',
- 'integer?','intersect','issue?','join','last','layout','length?',
- 'lesser-or-equal?','lesser?','library?','license','link?',
- 'list-dir','list?','lit-path?','lit-word?','load','load-image',
- 'log-10','log-2','log-e','logic?','lowercase','make','make-dir',
- 'make-face','max','maximum','maximum-of','min','minimum',
- 'minimum-of','modified?','mold','money?','multiply','native?',
- 'negate','negative?','none?','not','not-equal?','now','number?',
- 'object?','odd?','offset-to-caret','offset?','op?','open','or',
- 'pair?','paren?','parse','parse-xml','path?','pick','poke','port?',
- 'positive?','power','prin','print','probe','protect',
- 'protect-system','query','random','read','read-io','recycle',
- 'refinement?','reform','rejoin','remainder','remold','remove',
- 'rename',
- //'repeat',
- 'repend','replace','request','request-color','request-date',
- 'request-download','request-file','request-list','request-pass',
- 'request-text','resend','reverse','routine?','same?','save',
- 'script?','second','select','send','series?','set','set-modes',
- 'set-net','set-path?','set-word?','show','show-popup','sign?',
- 'sine','size-text','size?','skip','sort','source','span?',
- 'split-path','square-root','strict-equal?','strict-not-equal?',
- 'string?','struct?','stylize','subtract','suffix?','tag?','tail',
- 'tail?','tangent','third','time?','to','to-binary','to-bitset',
- 'to-block','to-char','to-date','to-decimal','to-email','to-file',
- 'to-get-word','to-hash','to-hex','to-idate','to-image','to-integer',
- 'to-issue','to-list','to-lit-path','to-lit-word','to-local-file',
- 'to-logic','to-money','to-pair','to-paren','to-path',
- 'to-rebol-file','to-refinement','to-set-path','to-set-word',
- 'to-string','to-tag','to-time','to-tuple','to-url','to-word',
- 'trace','trim','tuple?','type?','unfocus','union','unique',
- 'unprotect','unset','unset?','unview','update','upgrade',
- 'uppercase','url?','usage','use','value?','view','viewed?','what',
- 'what-dir','within?','word?','write','write-io','xor','zero?',
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
-// 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
-// 2 => 'includes/dico_rebol.php?word={FNAME}',
-// 3 => 'includes/dico_rebol.php?word={FNAME}'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*",
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/reg.php b/libvpx/examples/includes/geshi/geshi/reg.php
deleted file mode 100644
index 9c85a15..0000000
--- a/libvpx/examples/includes/geshi/geshi/reg.php
+++ /dev/null
@@ -1,233 +0,0 @@
-<?php
-/*************************************************************************************
- * reg.php
- * -------
- * Author: Sean Hanna (smokingrope@gmail.com)
- * Copyright: (c) 2006 Sean Hanna
- * Release Version: 1.0.8.3
- * Date Started: 03/15/2006
- *
- * Microsoft Registry Editor language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * - Updated and optimized most regular expressions
- * 03/15/2006 (0.5.0)
- * - Syntax File Created
- * 04/27/2006 (0.9.5)
- * - Syntax Coloring Cleaned Up
- * - First Release
- * 04/29/2006 (1.0.0)
- * - Updated a few coloring settings
- *
- * TODO (updated 4/27/2006)
- * -------------------------
- * - Add a verification to the multi-line portion of the hex field regex
- * for a '\' character on the line preceding the line of the multi-line
- * hex field.
- *
- * KNOWN ISSUES (updated 4/27/2006)
- * ---------------------------------
- *
- * - There are two regexes for the multiline hex value regex. The regex for
- * all lines after the first does not verify that the previous line contains
- * a line continuation character '\'. This regex also does not check for
- * end of line as it should.
- *
- * - If number_highlighting is enabled during processing of this syntax file
- * many of the regexps used will appear slightly incorrect.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
-
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'Microsoft Registry',
- 'COMMENT_SINGLE' => array(1 =>';'),
- 'COMMENT_MULTI' => array( ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
-// 1 => array(),
-// 2 => array(),
- /* Registry Key Constants Not Used */
- 3 => array(
- 'HKEY_LOCAL_MACHINE',
- 'HKEY_CLASSES_ROOT',
- 'HKEY_CURRENT_USER',
- 'HKEY_USERS',
- 'HKEY_CURRENT_CONFIG',
- 'HKEY_DYN_DATA',
- 'HKLM', 'HKCR', 'HKCU', 'HKU', 'HKCC', 'HKDD'
- )
- ),
- 'SYMBOLS' => array(
- '='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
-// 1 => false,
-// 2 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
-// 1 => 'color: #00CCFF;',
-// 2 => 'color: #0000FF;',
- 3 => 'color: #800000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #009900;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #009900;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 0 => 'color: #00CCFF;',
- 1 => 'color: #0000FF;',
- 2 => '',
- 3 => 'color: #0000FF;',
- 4 => 'color: #0000FF;',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => 'color: #FF6600;',
- )
- ),
- 'URLS' => array(
-// 1 => '',
-// 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- // Highlight Key Delimiters
- 0 => array(
- GESHI_SEARCH => '((^|\\n)\\s*)(\\\\\\[(.*)\\\\\\])(\\s*(\\n|$))',
- GESHI_REPLACE => '\\3',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\5'
-// GESHI_CLASS => 'kw1'
- ),
- // Highlight File Format Header Version 5
- 1 => array(
- GESHI_SEARCH => '(^\s*)(Windows Registry Editor Version \d+\.\d+)(\s*$)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3',
- GESHI_CLASS => 'geshi_registry_header'
- ),
- // Highlight File Format Header Version 4
- 2 => array(
- GESHI_SEARCH => '(^\\s*)(REGEDIT\s?\d+)(\s*$)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3',
- GESHI_CLASS => 'geshi_registry_header'
- ),
- // Highlight dword: 32 bit integer values
- 3 => array(
- GESHI_SEARCH => '(=\s*)(dword:[0-9a-fA-F]{8})(\s*$)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
-// GESHI_CLASS => 'kw2'
- ),
- // Highlight variable names
- 4 => array(
- GESHI_SEARCH => '(^\s*)(\&quot;.*?\&quot;)(\s*=)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3',
- GESHI_CLASS => 'geshi_variable'
- ),
- // Highlight String Values
- 5 => array(
- GESHI_SEARCH => '(=\s*)(\&quot;.*?\&quot;)(\s*$)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3',
- GESHI_CLASS => 'st0'
- ),
- // Highlight Hexadecimal Values (Single-Line and Multi-Line)
- 6 => array(
- GESHI_SEARCH => '(=\s*\n?\s*)(hex:[0-9a-fA-F]{2}(,(\\\s*\n\s*)?[0-9a-fA-F]{2})*)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '',
- GESHI_CLASS => 'kw2'
- ),
- // Highlight Default Variable
- 7 => array(
- GESHI_SEARCH => '(^\s*)(@)(\s*=)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'm',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3',
- GESHI_CLASS => 'geshi_variable'
- ),
- // Highlight GUID's found anywhere.
- 8 => array(
- GESHI_SEARCH => '(\{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\})',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => '',
- GESHI_CLASS => 'geshi_guid'
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'NUMBERS' => GESHI_NEVER,
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/robots.php b/libvpx/examples/includes/geshi/geshi/robots.php
deleted file mode 100644
index 7bb2b20..0000000
--- a/libvpx/examples/includes/geshi/geshi/robots.php
+++ /dev/null
@@ -1,98 +0,0 @@
-<?php
-/*************************************************************************************
- * robots.php
- * --------
- * Author: Christian Lescuyer (cl@goelette.net)
- * Copyright: (c) 2006 Christian Lescuyer http://xtian.goelette.info
- * Release Version: 1.0.8.3
- * Date Started: 2006/02/17
- *
- * robots.txt language file for GeSHi.
- *
- * 2006/02/17 (1.0.0)
- * - First Release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'robots.txt',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'User-agent', 'Disallow'
- )
- ),
- 'SYMBOLS' => array(
- ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.robotstxt.org/wc/norobots.html'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/ruby.php b/libvpx/examples/includes/geshi/geshi/ruby.php
deleted file mode 100644
index 8928557..0000000
--- a/libvpx/examples/includes/geshi/geshi/ruby.php
+++ /dev/null
@@ -1,226 +0,0 @@
-<?php
-/*************************************************************************************
- * ruby.php
- * --------
- * Author: Moises Deniz
- * Copyright: (c) 2007 Moises Deniz
- * Release Version: 1.0.8.3
- * Date Started: 2007/03/21
- *
- * Ruby language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2007/03/21 (1.0.7.19)
- * - Initial release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Ruby',
- 'COMMENT_SINGLE' => array(1 => "#"),
- 'COMMENT_MULTI' => array("=begin" => "=end"),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', '`','\''),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'alias', 'and', 'begin', 'break', 'case', 'class',
- 'def', 'defined', 'do', 'else', 'elsif', 'end',
- 'ensure', 'for', 'if', 'in', 'module', 'while',
- 'next', 'not', 'or', 'redo', 'rescue', 'yield',
- 'retry', 'super', 'then', 'undef', 'unless',
- 'until', 'when', 'BEGIN', 'END', 'include'
- ),
- 2 => array(
- '__FILE__', '__LINE__', 'false', 'nil', 'self', 'true',
- 'return'
- ),
- 3 => array(
- 'Array', 'Float', 'Integer', 'String', 'at_exit',
- 'autoload', 'binding', 'caller', 'catch', 'chop', 'chop!',
- 'chomp', 'chomp!', 'eval', 'exec', 'exit', 'exit!', 'fail',
- 'fork', 'format', 'gets', 'global_variables', 'gsub', 'gsub!',
- 'iterator?', 'lambda', 'load', 'local_variables', 'loop',
- 'open', 'p', 'print', 'printf', 'proc', 'putc', 'puts',
- 'raise', 'rand', 'readline', 'readlines', 'require', 'select',
- 'sleep', 'split', 'sprintf', 'srand', 'sub', 'sub!', 'syscall',
- 'system', 'trace_var', 'trap', 'untrace_var'
- ),
- 4 => array(
- 'Abbrev', 'ArgumentError', 'Base64', 'Benchmark',
- 'Benchmark::Tms', 'Bignum', 'Binding', 'CGI', 'CGI::Cookie',
- 'CGI::HtmlExtension', 'CGI::QueryExtension',
- 'CGI::Session', 'CGI::Session::FileStore',
- 'CGI::Session::MemoryStore', 'Class', 'Comparable', 'Complex',
- 'ConditionVariable', 'Continuation', 'Data',
- 'Date', 'DateTime', 'Delegator', 'Dir', 'EOFError', 'ERB',
- 'ERB::Util', 'Enumerable', 'Enumerable::Enumerator', 'Errno',
- 'Exception', 'FalseClass', 'File',
- 'File::Constants', 'File::Stat', 'FileTest', 'FileUtils',
- 'FileUtils::DryRun', 'FileUtils::NoWrite',
- 'FileUtils::StreamUtils_', 'FileUtils::Verbose', 'Find',
- 'Fixnum', 'FloatDomainError', 'Forwardable', 'GC', 'Generator',
- 'Hash', 'IO', 'IOError', 'Iconv', 'Iconv::BrokenLibrary',
- 'Iconv::Failure', 'Iconv::IllegalSequence',
- 'Iconv::InvalidCharacter', 'Iconv::InvalidEncoding',
- 'Iconv::OutOfRange', 'IndexError', 'Interrupt', 'Kernel',
- 'LoadError', 'LocalJumpError', 'Logger', 'Logger::Application',
- 'Logger::Error', 'Logger::Formatter', 'Logger::LogDevice',
- 'Logger::LogDevice::LogDeviceMutex', 'Logger::Severity',
- 'Logger::ShiftingError', 'Marshal', 'MatchData',
- 'Math', 'Matrix', 'Method', 'Module', 'Mutex', 'NameError',
- 'NameError::message', 'NilClass', 'NoMemoryError',
- 'NoMethodError', 'NotImplementedError', 'Numeric', 'Object',
- 'ObjectSpace', 'Observable', 'PStore', 'PStore::Error',
- 'Pathname', 'Precision', 'Proc', 'Process', 'Process::GID',
- 'Process::Status', 'Process::Sys', 'Process::UID', 'Queue',
- 'Range', 'RangeError', 'Rational', 'Regexp', 'RegexpError',
- 'RuntimeError', 'ScriptError', 'SecurityError', 'Set',
- 'Shellwords', 'Signal', 'SignalException', 'SimpleDelegator',
- 'SingleForwardable', 'Singleton', 'SingletonClassMethods',
- 'SizedQueue', 'SortedSet', 'StandardError', 'StringIO',
- 'StringScanner', 'StringScanner::Error', 'Struct', 'Symbol',
- 'SyncEnumerator', 'SyntaxError', 'SystemCallError',
- 'SystemExit', 'SystemStackError', 'Tempfile',
- 'Test::Unit::TestCase', 'Test::Unit', 'Test', 'Thread',
- 'ThreadError', 'ThreadGroup',
- 'ThreadsWait', 'Time', 'TrueClass', 'TypeError', 'URI',
- 'URI::BadURIError', 'URI::Error', 'URI::Escape', 'URI::FTP',
- 'URI::Generic', 'URI::HTTP', 'URI::HTTPS',
- 'URI::InvalidComponentError', 'URI::InvalidURIError',
- 'URI::LDAP', 'URI::MailTo', 'URI::REGEXP',
- 'URI::REGEXP::PATTERN', 'UnboundMethod', 'Vector', 'YAML',
- 'ZeroDivisionError', 'Zlib',
- 'Zlib::BufError', 'Zlib::DataError', 'Zlib::Deflate',
- 'Zlib::Error', 'Zlib::GzipFile', 'Zlib::GzipFile::CRCError',
- 'Zlib::GzipFile::Error', 'Zlib::GzipFile::LengthError',
- 'Zlib::GzipFile::NoFooter', 'Zlib::GzipReader',
- 'Zlib::GzipWriter', 'Zlib::Inflate', 'Zlib::MemError',
- 'Zlib::NeedDict', 'Zlib::StreamEnd', 'Zlib::StreamError',
- 'Zlib::VersionError',
- 'Zlib::ZStream',
- 'HTML::Selector', 'HashWithIndifferentAccess', 'Inflector',
- 'Inflector::Inflections', 'Mime', 'Mime::Type',
- 'OCI8AutoRecover', 'TimeZone', 'XmlSimple'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '%', '&', '*', '|', '/', '<', '>',
- '+', '-', '=>', '<<'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color:#9966CC; font-weight:bold;',
- 2 => 'color:#0000FF; font-weight:bold;',
- 3 => 'color:#CC0066; font-weight:bold;',
- 4 => 'color:#CC00FF; font-weight:bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color:#008000; font-style:italic;',
- 'MULTI' => 'color:#000080; font-style:italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color:#000099;'
- ),
- 'BRACKETS' => array(
- 0 => 'color:#006600; font-weight:bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color:#996600;'
- ),
- 'NUMBERS' => array(
- 0 => 'color:#006666;'
- ),
- 'METHODS' => array(
- 1 => 'color:#9900CC;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color:#006600; font-weight:bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color:#ff6633; font-weight:bold;',
- 1 => 'color:#0066ff; font-weight:bold;',
- 2 => 'color:#6666ff; font-weight:bold;',
- 3 => 'color:#ff3333; font-weight:bold;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- 0 => array(//Variables
- GESHI_SEARCH => "([[:space:]])(\\$[a-zA-Z_][a-zA-Z0-9_]*)",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 1 => array(//Arrays
- GESHI_SEARCH => "([[:space:]])(@[a-zA-Z_][a-zA-Z0-9_]*)",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 2 => "([A-Z][a-zA-Z0-9_]*::)+[A-Z][a-zA-Z0-9_]*",//Static OOP symbols
- 3 => array(
- GESHI_SEARCH => "([[:space:]]|\[|\()(:[a-zA-Z_][a-zA-Z0-9_]*)",
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '<%' => '%>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- ),
- 'TAB_WIDTH' => 2
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/sas.php b/libvpx/examples/includes/geshi/geshi/sas.php
deleted file mode 100644
index d4ee828..0000000
--- a/libvpx/examples/includes/geshi/geshi/sas.php
+++ /dev/null
@@ -1,290 +0,0 @@
-<?php
-/*************************************************************************************
- * sas.php
- * -------
- * Author: Galen Johnson (solitaryr@gmail.com)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2005/12/27
- *
- * SAS language file for GeSHi. Based on the sas vim file.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * - Cleaned up code style
- * 2005/12/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/12/27)
- * -------------------------
- * * Check highlighting stuff works
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'SAS',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- '_ALL_','_CHARACTER_','_INFILE_','_N_','_NULL_','_NUMERIC_',
- '_WEBOUT_'
- ),
- 2 => array(
- '%BQUOTE','%CMPRES','%COMPSTOR','%DATATYP','%DISPLAY','%DO','%ELSE',
- '%END','%EVAL','%GLOBAL','%GOTO','%IF','%INDEX','%INPUT','%KEYDEF',
- '%LABEL','%LEFT','%LENGTH','%LET','%LOCAL','%LOWCASE','%MACRO',
- '%MEND','%NRBQUOTE','%NRQUOTE','%NRSTR','%PUT','%QCMPRES','%QLEFT',
- '%QLOWCASE','%QSCAN','%QSUBSTR','%QSYSFUNC','%QTRIM','%QUOTE',
- '%QUPCASE','%SCAN','%STR','%SUBSTR','%SUPERQ','%SYSCALL',
- '%SYSEVALF','%SYSEXEC','%SYSFUNC','%SYSGET','%SYSLPUT','%SYSPROD',
- '%SYSRC','%SYSRPUT','%THEN','%TO','%TRIM','%UNQUOTE','%UNTIL',
- '%UPCASE','%VERIFY','%WHILE','%WINDOW'
- ),
- 3 => array(
- 'ABS','ADDR','AIRY','ARCOS','ARSIN','ATAN','ATTRC','ATTRN','BAND',
- 'BETAINV','BLSHIFT','BNOT','BOR','BRSHIFT','BXOR','BYTE','CDF',
- 'CEIL','CEXIST','CINV','CLOSE','CNONCT','COLLATE','COMPBL',
- 'COMPOUND','COMPRESS','COSH','COS','CSS','CUROBS','CV','DACCDBSL',
- 'DACCDB','DACCSL','DACCSYD','DACCTAB','DAIRY','DATETIME','DATEJUL',
- 'DATEPART','DATE','DAY','DCLOSE','DEPDBSL','DEPDB','DEPSL','DEPSYD',
- 'DEPTAB','DEQUOTE','DHMS','DIF','DIGAMMA','DIM','DINFO','DNUM',
- 'DOPEN','DOPTNAME','DOPTNUM','DREAD','DROPNOTE','DSNAME','ERFC',
- 'ERF','EXIST','EXP','FAPPEND','FCLOSE','FCOL','FDELETE','FETCHOBS',
- 'FETCH','FEXIST','FGET','FILEEXIST','FILENAME','FILEREF','FINFO',
- 'FINV','FIPNAMEL','FIPNAME','FIPSTATE','FLOOR','FNONCT','FNOTE',
- 'FOPEN','FOPTNAME','FOPTNUM','FPOINT','FPOS','FPUT','FREAD',
- 'FREWIND','FRLEN','FSEP','FUZZ','FWRITE','GAMINV','GAMMA',
- 'GETOPTION','GETVARC','GETVARN','HBOUND','HMS','HOSTHELP','HOUR',
- 'IBESSEL','INDEXW','INDEXC','INDEX','INPUTN','INPUTC','INPUT',
- 'INTRR','INTCK','INTNX','INT','IRR','JBESSEL','JULDATE','KURTOSIS',
- 'LAG','LBOUND','LEFT','LENGTH','LGAMMA','LIBNAME','LIBREF','LOG10',
- 'LOG2','LOGPDF','LOGPMF','LOGSDF','LOG','LOWCASE','MAX','MDY',
- 'MEAN','MINUTE','MIN','MOD','MONTH','MOPEN','MORT','NETPV','NMISS',
- 'NORMAL','NPV','N','OPEN','ORDINAL','PATHNAME','PDF','PEEKC','PEEK',
- 'PMF','POINT','POISSON','POKE','PROBBETA','PROBBNML','PROBCHI',
- 'PROBF','PROBGAM','PROBHYPR','PROBIT','PROBNEGB','PROBNORM','PROBT',
- 'PUTN','PUTC','PUT','QTR','QUOTE','RANBIN','RANCAU','RANEXP',
- 'RANGAM','RANGE','RANK','RANNOR','RANPOI','RANTBL','RANTRI',
- 'RANUNI','REPEAT','RESOLVE','REVERSE','REWIND','RIGHT','ROUND',
- 'SAVING','SCAN','SDF','SECOND','SIGN','SINH','SIN','SKEWNESS',
- 'SOUNDEX','SPEDIS','SQRT','STDERR','STD','STFIPS','STNAME',
- 'STNAMEL','SUBSTR','SUM','SYMGET','SYSGET','SYSMSG','SYSPROD',
- 'SYSRC','SYSTEM','TANH','TAN','TIMEPART','TIME','TINV','TNONCT',
- 'TODAY','TRANSLATE','TRANWRD','TRIGAMMA','TRIMN','TRIM','TRUNC',
- 'UNIFORM','UPCASE','USS','VARFMT','VARINFMT','VARLABEL','VARLEN',
- 'VARNAME','VARNUM','VARRAYX','VARRAY','VARTYPE','VAR','VERIFY',
- 'VFORMATX','VFORMATDX','VFORMATD','VFORMATNX','VFORMATN',
- 'VFORMATWX','VFORMATW','VFORMAT','VINARRAYX','VINARRAY',
- 'VINFORMATX','VINFORMATDX','VINFORMATD','VINFORMATNX','VINFORMATN',
- 'VINFORMATWX','VINFORMATW','VINFORMAT','VLABELX','VLABEL',
- 'VLENGTHX','VLENGTH','VNAMEX','VNAME','VTYPEX','VTYPE','WEEKDAY',
- 'YEAR','YYQ','ZIPFIPS','ZIPNAME','ZIPNAMEL','ZIPSTATE'
- ),
- 4 => array(
- 'ABORT','ADD','ALTER','AND','ARRAY','AS','ATTRIB','BY','CALL',
- 'CARDS4','CASCADE','CATNAME','CHECK','CONTINUE','CREATE',
- 'DATALINES4','DELETE','DESCRIBE','DISPLAY','DISTINCT','DM','DROP',
- 'ENDSAS','FILE','FOOTNOTE','FOREIGN','FORMAT','FROM',
- 'GOTO','GROUP','HAVING','IN','INFILE','INFORMAT',
- 'INSERT','INTO','KEEP','KEY','LABEL','LEAVE',
- 'LIKE','LINK','LIST','LOSTCARD','MERGE','MESSAGE','MISSING',
- 'MODIFY','MSGTYPE','NOT','NULL','ON','OPTIONS','OR','ORDER',
- 'OUTPUT','PAGE','PRIMARY','REDIRECT','REFERENCES','REMOVE',
- 'RENAME','REPLACE','RESET','RESTRICT','RETAIN','RETURN','SELECT',
- 'SET','SKIP','STARTSAS','STOP','SYSTASK','TABLE','TITLE','UNIQUE',
- 'UPDATE','VALIDATE','VIEW','WAITSAS','WHERE','WINDOW','X'
- ),
- 5 => array(
- 'DO','ELSE','END','IF','THEN','UNTIL','WHILE'
- ),
- 6 => array(
- 'RUN','QUIT','DATA'
- ),
- 7 => array(
- 'ERROR'
- ),
- 8 => array(
- 'WARNING'
- ),
- 9 => array(
- 'NOTE'
- )
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => false,
- 9 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #0000ff;',
- 4 => 'color: #0000ff;',
- 5 => 'color: #0000ff;',
- 6 => 'color: #000080; font-weight: bold;',
- 7 => 'color: #ff0000;',
- 8 => 'color: #00ff00;',
- 9 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array(
-// 1 => 'color: #006400; font-style: italic;',
- 'MULTI' => 'color: #006400; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #a020f0;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #2e8b57; font-weight: bold;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff; font-weight: bold;',
- 1 => 'color: #000080; font-weight: bold;',
- 2 => 'color: #006400; font-style: italic;',
- 3 => 'color: #006400; font-style: italic;',
- 4 => 'color: #006400; font-style: italic;',
- 5 => 'color: #ff0000; font-weight: bold;',
- 6 => 'color: #00ff00; font-style: italic;',
- 7 => 'color: #0000ff; font-style: normal;',
- 8 => 'color: #b218b2; font-weight: bold;',
- 9 => 'color: #b218b2; font-weight: bold;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => '',
- 9 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 0 => "&amp;[a-zA-Z_][a-zA-Z0-9_]*",
- 1 => array(//Procedures
- GESHI_SEARCH => '(^\\s*)(PROC \\w+)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 2 => array(
- GESHI_SEARCH => '(^\\s*)(\\*.*;)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 3 => array(
- GESHI_SEARCH => '(.*;\\s*)(\\*.*;)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 4 => array(
- GESHI_SEARCH => '(^\\s*)(%\\*.*;)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 5 => array(//Error messages
- GESHI_SEARCH => '(^ERROR.*)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 6 => array(//Warning messages
- GESHI_SEARCH => '(^WARNING.*)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 7 => array(//Notice messages
- GESHI_SEARCH => '(^NOTE.*)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'im',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 8 => array(
- GESHI_SEARCH => '(^\\s*)(CARDS.*)(^\\s*;\\s*$)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'sim',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
- 9 => array(
- GESHI_SEARCH => '(^\\s*)(DATALINES.*)(^\\s*;\\s*$)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'sim',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/scala.php b/libvpx/examples/includes/geshi/geshi/scala.php
deleted file mode 100644
index c72de33..0000000
--- a/libvpx/examples/includes/geshi/geshi/scala.php
+++ /dev/null
@@ -1,122 +0,0 @@
-<?php
-/*************************************************************************************
- * scala.php
- * ----------
- * Author: Franco Lombardo (franco@francolombardo.net)
- * Copyright: (c) 2008 Franco Lombardo, Benny Baumann
- * Release Version: 1.0.8.3
- * Date Started: 2008/02/08
- *
- * Scala language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/02/08 (1.0.7.22)
- * - First Release
- *
- * TODO (updated 2007/04/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Scala',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'abstract', 'case', 'catch', 'class', 'def',
- 'do', 'else', 'extends', 'false', 'final',
- 'finally', 'for', 'forSome', 'if', 'implicit',
- 'import', 'match', 'new', 'null', 'object',
- 'override', 'package', 'private', 'protected', 'requires',
- 'return', 'sealed', 'super', 'this', 'throw',
- 'trait', 'try', 'true', 'type', 'val',
- 'var', 'while', 'with', 'yield'
- ),
- 2 => array(
- 'void', 'double', 'int', 'boolean', 'byte', 'short', 'long', 'char', 'float'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '*', '&', '%', '!', ';', '<', '>', '?',
- '_', ':', '=', '=>', '<<:',
- '<%', '>:', '#', '@'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff; font-weight: bold;',
- 2 => 'color: #9999cc; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 1=> 'color: #008000; font-style: italic;',
- 'MULTI' => 'color: #00ff00; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #0000ff; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #F78811;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #6666FF;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #F78811;'
- ),
- 'METHODS' => array(
- 1 => 'color: #000000;',
- 2 => 'color: #000000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000080;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://scala-lang.org',
- 2 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/scheme.php b/libvpx/examples/includes/geshi/geshi/scheme.php
deleted file mode 100644
index 1c85f80..0000000
--- a/libvpx/examples/includes/geshi/geshi/scheme.php
+++ /dev/null
@@ -1,170 +0,0 @@
-<?php
-/*************************************************************************************
- * scheme.php
- * ----------
- * Author: Jon Raphaelson (jonraphaelson@gmail.com)
- * Copyright: (c) 2005 Jon Raphaelson, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * Scheme language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/09/22 (1.0.0)
- * - First Release
- *
- * TODO (updated 2005/09/22)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Scheme',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array('#|' => '|#'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'abs', 'acos', 'and', 'angle', 'append', 'appply', 'approximate',
- 'asin', 'assoc', 'assq', 'assv', 'atan',
-
- 'begin', 'boolean?', 'bound-identifier=?',
-
- 'caar', 'caddr', 'cadr', 'call-with-current-continuation',
- 'call-with-input-file', 'call-with-output-file', 'call/cc', 'car',
- 'case', 'catch', 'cdddar', 'cddddr', 'cdr', 'ceiling', 'char->integer',
- 'char-alphabetic?', 'char-ci<=?', 'char-ci<?', 'char-ci?', 'char-ci>=?',
- 'char-ci>?', 'char-ci=?', 'char-downcase', 'char-lower-case?',
- 'char-numeric', 'char-ready', 'char-ready?', 'char-upcase',
- 'char-upper-case?', 'char-whitespace?', 'char<=?', 'char<?', 'char=?',
- 'char>=?', 'char>?', 'char?', 'close-input-port', 'close-output-port',
- 'complex?', 'cond', 'cons', 'construct-identifier', 'cos',
- 'current-input-port', 'current-output-port',
-
- 'd', 'define', 'define-syntax', 'delay', 'denominator', 'display', 'do',
-
- 'e', 'eof-object?', 'eq?', 'equal?', 'eqv?', 'even?', 'exact->inexact',
- 'exact?', 'exp', 'expt', 'else',
-
- 'f', 'floor', 'for-each', 'force', 'free-identifer=?',
-
- 'gcd', 'gen-counter', 'gen-loser', 'generate-identifier',
-
- 'identifier->symbol', 'identifier', 'if', 'imag-part', 'inexact->exact',
- 'inexact?', 'input-port?', 'integer->char', 'integer?', 'integrate-system',
-
- 'l', 'lambda', 'last-pair', 'lcm', 'length', 'let', 'let*', 'letrec',
- 'list', 'list->string', 'list->vector', 'list-ref', 'list-tail', 'list?',
- 'load', 'log',
-
- 'magnitude', 'make-polar', 'make-promise', 'make-rectangular',
- 'make-string', 'make-vector', 'map', 'map-streams', 'max', 'member',
- 'memq', 'memv', 'min', 'modulo',
-
- 'negative', 'newline', 'nil', 'not', 'null?', 'number->string', 'number?',
- 'numerator',
-
- 'odd?', 'open-input-file', 'open-output-file', 'or', 'output-port',
-
- 'pair?', 'peek-char', 'positive?', 'procedure?',
-
- 'quasiquote', 'quote', 'quotient',
-
- 'rational', 'rationalize', 'read', 'read-char', 'real-part', 'real?',
- 'remainder', 'return', 'reverse',
-
- 's', 'sequence', 'set!', 'set-char!', 'set-cdr!', 'sin', 'sqrt', 'string',
- 'string->list', 'string->number', 'string->symbol', 'string-append',
- 'string-ci<=?', 'string-ci<?', 'string-ci=?', 'string-ci>=?',
- 'string-ci>?', 'string-copy', 'string-fill!', 'string-length',
- 'string-ref', 'string-set!', 'string<=?', 'string<?', 'string=?',
- 'string>=?', 'string>?', 'string?', 'substring', 'symbol->string',
- 'symbol?', 'syntax', 'syntax-rules',
-
- 't', 'tan', 'template', 'transcript-off', 'transcript-on', 'truncate',
-
- 'unquote', 'unquote-splicing', 'unwrap-syntax',
-
- 'vector', 'vector->list', 'vector-fill!', 'vector-length', 'vector-ref',
- 'vector-set!', 'vector?',
-
- 'with-input-from-file', 'with-output-to-file', 'write', 'write-char',
-
- 'zero?'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '!', '%', '^', '&', '/','+','-','*','=','<','>',';','|'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/scilab.php b/libvpx/examples/includes/geshi/geshi/scilab.php
deleted file mode 100644
index bfe72ad..0000000
--- a/libvpx/examples/includes/geshi/geshi/scilab.php
+++ /dev/null
@@ -1,295 +0,0 @@
-<?php
-/*************************************************************************************
- * scilab.php
- * --------
- * Author: Christophe David (geshi@christophedavid.org)
- * Copyright: (c) 2008 Christophe David (geshi@christophedavid.org)
- * Release Version: 1.0.8.3
- * Date Started: 2008/08/04
- *
- * SciLab language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/08/25 (1.0.8.1)
- * - Corrected with the help of Benny Baumann (BenBE@geshi.org)
- * 2008/08/04 (0.0.0.1)
- * - First beta Release - known problem with ' used to transpose matrices considered as start of strings
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'SciLab',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- 2 => "/\w+'/"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'HARDQUOTE' => array("'", "'"),
- 'HARDESCAPE' => array(),
- 'KEYWORDS' => array(
- 1 => array(
- 'if', 'else', 'elseif', 'end', 'select', 'case', 'for', 'while', 'break'
- ),
- 2 => array(
- 'STDIN', 'STDOUT', 'STDERR',
- '%i', '%pi', '%e', '%eps', '%nan', '%inf', '%s', '%t', '%f',
- 'usual', 'polynomial', 'boolean', 'character', 'function', 'rational', 'state-space',
- 'sparse', 'boolean sparse', 'list', 'tlist', 'library', 'endfunction'
- ),
- 3 => array(
- '%asn', '%helps', '%k', '%sn', 'abcd', 'abinv', 'abort', 'about', 'About_M2SCI_tools',
- 'abs', 'acos', 'acosh', 'acoshm', 'acosm', 'AdCommunications', 'add_demo', 'add_edge',
- 'add_help_chapter', 'add_node', 'add_palette', 'addcolor', 'addf', 'addinter', 'addmenu',
- 'adj_lists', 'adj2sp', 'aff2ab', 'alufunctions', 'amell', 'analpf', 'analyze', 'and',
- 'ans', 'apropos', 'arc_graph', 'arc_number', 'arc_properties', 'argn', 'arhnk', 'arl2',
- 'arma', 'arma2p', 'armac', 'armax', 'armax1', 'arsimul', 'artest', 'articul', 'ascii',
- 'asciimat', 'asin', 'asinh', 'asinhm', 'asinm', 'assignation', 'atan', 'atanh', 'atanhm',
- 'atanm', 'augment', 'auread', 'auwrite', 'axes_properties', 'axis_properties', 'backslash',
- 'balanc', 'balreal', 'bandwr', 'banner','bar', 'barh', 'barhomogenize', 'basename', 'bdiag',
- 'beep', 'besselh', 'besseli', 'besselj', 'besselk', 'bessely', 'best_match', 'beta','bezout',
- 'bifish', 'bilin', 'binomial', 'black', 'bloc2exp', 'bloc2ss', 'bode', 'bool2s',
- 'boucle', 'brackets', 'browsevar', 'bsplin3val', 'bstap', 'buttmag', 'buttondialog',
- 'bvode', 'bvodeS', 'c_link', 'cainv', 'calendar', 'calerf', 'calfrq', 'call', 'canon', 'casc',
- 'cat', 'catch', 'ccontrg', 'cd', 'cdfbet', 'cdfbin', 'cdfchi', 'cdfchn', 'cdff', 'cdffnc',
- 'cdfgam', 'cdfnbn', 'cdfnor', 'cdfpoi', 'cdft', 'ceil', 'cell', 'cell2mat', 'cellstr', 'center',
- 'cepstrum', 'chain_struct', 'chaintest', 'champ', 'champ_properties', 'champ1', 'char', 'chart',
- 'chartooem', 'chdir', 'cheb1mag', 'cheb2mag', 'check_graph', 'chepol', 'chfact', 'chol', 'chsolve',
- 'circuit', 'classmarkov', 'clc', 'clean', 'clear', 'clear_pixmap', 'clearfun', 'clearglobal','clf',
- 'clipboard', 'close', 'cls2dls', 'cmb_lin', 'cmndred', 'cmoment', 'code2str', 'coeff', 'coff', 'coffg',
- 'colcomp', 'colcompr', 'colinout', 'colon', 'color', 'color_list', 'colorbar', 'colordef', 'colormap',
- 'colregul', 'comma', 'comments', 'comp', 'companion', 'comparison', 'Compound_properties', 'con_nodes',
- 'cond', 'config', 'configure_msvc', 'conj', 'connex', 'console', 'cont_frm', 'cont_mat', 'Contents',
- 'continue', 'contour', 'contour2d', 'contour2di', 'contourf', 'contr', 'contract_edge', 'contrss',
- 'convex_hull', 'convol', 'convstr', 'copfac', 'copy', 'corr', 'correl', 'cos', 'cosh', 'coshm',
- 'cosm', 'cotg', 'coth', 'cothm', 'covar', 'create_palette', 'cshep2d', 'csim', 'cspect', 'Cste',
- 'ctr_gram', 'cumprod', 'cumsum', 'cycle_basis', 'czt', 'dasrt', 'dassl', 'datafit', 'date', 'datenum',
- 'datevec', 'dbphi', 'dcf', 'ddp', 'debug', 'dec2hex', 'deff', 'definedfields', 'degree', 'delbpt',
- 'delete', 'delete_arcs', 'delete_nodes', 'delip', 'delmenu', 'demoplay', 'denom', 'derivat', 'derivative',
- 'des2ss', 'des2tf', 'det', 'determ', 'detr', 'detrend', 'dft', 'dhinf', 'dhnorm', 'diag', 'diary',
- 'diff', 'diophant', 'dir', 'dirname', 'disp', 'dispbpt', 'dispfiles', 'dlgamma', 'dnaupd', 'do', 'dot',
- 'double', 'dragrect', 'draw', 'drawaxis', 'drawlater', 'drawnow', 'driver', 'dsaupd', 'dscr',
- 'dsearch', 'dsimul', 'dt_ility', 'dtsi', 'edge_number', 'edit', 'edit_curv', 'edit_error',
- 'edit_graph', 'edit_graph_menus', 'editvar', 'eigenmarkov', 'ell1mag',
- 'empty', 'emptystr', 'eqfir', 'eqiir', 'equal', 'Equal', 'equil', 'equil1',
- 'ereduc', 'erf', 'erfc', 'erfcx', 'errbar', 'errcatch', 'errclear', 'error', 'error_table', 'etime',
- 'eval', 'eval_cshep2d', 'eval3d', 'eval3dp', 'evans', 'evstr', 'excel2sci', 'exec', 'execstr', 'exists',
- 'exit', 'exp', 'expm', 'external', 'extraction', 'eye', 'fac3d', 'factorial', 'factors', 'faurre', 'fchamp',
- 'fcontour', 'fcontour2d', 'fec', 'fec_properties', 'feedback', 'feval', 'ffilt', 'fft', 'fft2', 'fftshift',
- 'fgrayplot', 'figure', 'figure_properties', 'figure_style', 'file', 'fileinfo', 'fileparts', 'filter', 'find',
- 'find_freq', 'find_path', 'findABCD', 'findAC', 'findBD', 'findBDK', 'findm', 'findmsvccompiler', 'findobj',
- 'findR', 'findx0BD', 'firstnonsingleton', 'fit_dat', 'fix', 'floor', 'flts', 'foo', 'format',
- 'formatman', 'fort', 'fourplan', 'fplot2d', 'fplot3d', 'fplot3d1', 'fprintf', 'fprintfMat', 'frep2tf',
- 'freq', 'freson', 'frexp', 'frfit', 'frmag', 'fscanf', 'fscanfMat', 'fsfirlin', 'fsolve', 'fspecg',
- 'fstabst', 'fstair', 'ftest', 'ftuneq', 'full', 'fullfile', 'fullrf', 'fullrfk', 'fun2string', 'Funcall',
- 'funcprot', 'functions', 'funptr', 'fusee', 'G_make', 'g_margin', 'gainplot', 'gamitg',
- 'gamma', 'gammaln', 'gca', 'gcare', 'gcd', 'gce', 'gcf', 'gda', 'gdf', 'gen_net', 'genfac3d', 'genlib',
- 'genmarkov', 'geom3d', 'geomean', 'get', 'get_contents_infer', 'get_function_path', 'getcolor', 'getcwd',
- 'getd', 'getdate', 'getenv', 'getf', 'getfield', 'getfont', 'gethistory', 'getio', 'getlinestyle',
- 'getlongpathname', 'getmark', 'getmemory', 'getos', 'getpid', 'getscilabkeywords', 'getshell',
- 'getshortpathname', 'getsymbol', 'getvalue', 'getversion', 'gfare', 'gfrancis', 'girth', 'givens',
- 'glever', 'glist', 'global', 'GlobalProperty', 'glue', 'gmres', 'gpeche', 'gr_menu', 'graduate', 'grand',
- 'graph_2_mat', 'graph_center', 'graph_complement', 'graph_diameter', 'graph_power', 'graph_simp', 'graph_sum',
- 'graph_union', 'graphic', 'Graphics', 'graphics_entities', 'graph-list', 'graycolormap', 'grayplot',
- 'grayplot_properties', 'graypolarplot', 'great', 'grep', 'group', 'gschur', 'gsort', 'gspec', 'gstacksize',
- 'gtild', 'h_cl', 'h_inf', 'h_inf_st', 'h_norm', 'h2norm', 'halt', 'hamilton', 'hank', 'hankelsv', 'harmean',
- 'hat', 'havewindow', 'head_comments', 'help', 'help_skeleton', 'hermit', 'hess', 'hex2dec', 'hilb', 'hinf',
- 'hist3d', 'histplot', 'horner', 'host', 'hotcolormap', 'householder', 'hrmt', 'hsv2rgb', 'hsvcolormap',
- 'htrianr', 'hypermat', 'hypermatrices', 'iconvert', 'ieee', 'ifft', 'iir', 'iirgroup', 'iirlp',
- 'ilib_build', 'ilib_compile', 'ilib_for_link', 'ilib_gen_gateway', 'ilib_gen_loader', 'ilib_gen_Make',
- 'im_inv', 'imag', 'impl', 'imrep2ss', 'imult', 'ind2sub', 'Infer', 'inistate', 'input', 'insertion', 'int',
- 'int16', 'int2d', 'int32', 'int3d', 'int8', 'intc', 'intdec', 'integrate', 'interp', 'interp1', 'interp2d',
- 'interp3d', 'interpln', 'intersci', 'intersect', 'intg', 'intl', 'intppty', 'intsplin', 'inttrap', 'inttype',
- 'inv', 'inv_coeff', 'invr', 'invsyslin', 'iqr', 'is_connex', 'iscellstr', 'isdef', 'isdir', 'isempty',
- 'isequal', 'isequalbitwise', 'iserror', 'isglobal', 'isinf', 'isnan', 'isoview', 'isreal', 'javasci',
- 'jetcolormap', 'jmat', 'justify', 'kalm', 'karmarkar', 'kernel', 'keyboard', 'knapsack', 'kpure', 'krac2',
- 'kron', 'kroneck', 'label_properties', 'labostat', 'LANGUAGE', 'lasterror', 'lattn', 'lattp', 'lcf', 'lcm',
- 'lcmdiag', 'ldiv', 'ldivf', 'leastsq', 'left', 'legend', 'legend_properties', 'legendre', 'legends', 'length',
- 'leqr', 'less', 'lev', 'levin', 'lex_sort', 'lft', 'lgfft', 'lib', 'lin', 'lin2mu', 'lindquist',
- 'line_graph', 'linear_interpn', 'lines', 'LineSpec', 'linf', 'linfn', 'link', 'linmeq', 'linpro', 'linsolve',
- 'linspace', 'listfiles', 'listvarinfile', 'lmisolver', 'lmitool', 'load', 'load_graph', 'loadhistory',
- 'loadmatfile', 'loadplots', 'loadwave', 'locate', 'log', 'log10', 'log1p', 'log2', 'logm', 'logspace',
- 'lotest', 'lqe', 'lqg', 'lqg_ltr', 'lqg2stan', 'lqr', 'ls', 'lsq', 'lsq_splin', 'lsqrsolve', 'lsslist',
- 'lstcat', 'lstsize', 'ltitr', 'lu', 'ludel', 'lufact', 'luget', 'lusolve', 'lyap', 'm_circle', 'm2scideclare',
- 'macglov', 'macr2lst', 'macr2tree', 'macro', 'macrovar', 'mad', 'make_graph', 'make_index', 'makecell', 'man',
- 'manedit', 'mapsound', 'markp2ss', 'mat_2_graph', 'matfile2sci', 'Matlab-Scilab_character_strings', 'Matplot',
- 'Matplot_properties', 'Matplot1', 'matrices', 'matrix', 'max', 'max_cap_path', 'max_clique', 'max_flow',
- 'maxi', 'mcisendstring', 'mclearerr', 'mclose', 'mdelete', 'mean', 'meanf', 'median', 'menus', 'meof',
- 'merror', 'mese', 'mesh', 'mesh2d', 'meshgrid', 'mfft', 'mfile2sci', 'mfprintf', 'mfscanf', 'mget', 'mgeti',
- 'mgetl', 'mgetstr', 'milk_drop', 'min', 'min_lcost_cflow', 'min_lcost_flow1', 'min_lcost_flow2',
- 'min_qcost_flow', 'min_weight_tree', 'mine', 'mini', 'minreal', 'minss', 'minus', 'mkdir', 'mlist', 'mode',
- 'modulo', 'moment', 'mopen', 'move', 'mprintf', 'mps2linpro', 'mput', 'mputl', 'mputstr', 'mrfit', 'mscanf',
- 'msd', 'mseek', 'msprintf', 'msscanf', 'mstr2sci', 'mtell', 'mtlb_0', 'mtlb_a', 'mtlb_all', 'mtlb_any',
- 'mtlb_axis', 'mtlb_beta', 'mtlb_box', 'mtlb_close', 'mtlb_colordef', 'mtlb_conv', 'mtlb_cumprod', 'mtlb_cumsum',
- 'mtlb_dec2hex', 'mtlb_delete', 'mtlb_diag', 'mtlb_diff', 'mtlb_dir', 'mtlb_double', 'mtlb_e', 'mtlb_echo',
- 'mtlb_eig', 'mtlb_eval', 'mtlb_exist', 'mtlb_eye', 'mtlb_false', 'mtlb_fft', 'mtlb_fftshift', 'mtlb_find',
- 'mtlb_findstr', 'mtlb_fliplr', 'mtlb_fopen', 'mtlb_format', 'mtlb_fprintf', 'mtlb_fread', 'mtlb_fscanf',
- 'mtlb_full', 'mtlb_fwrite', 'mtlb_grid', 'mtlb_hold', 'mtlb_i', 'mtlb_ifft', 'mtlb_imp', 'mtlb_int16',
- 'mtlb_int32', 'mtlb_int8', 'mtlb_is', 'mtlb_isa', 'mtlb_isfield', 'mtlb_isletter', 'mtlb_isspace', 'mtlb_l',
- 'mtlb_legendre', 'mtlb_linspace', 'mtlb_load', 'mtlb_logic', 'mtlb_logical', 'mtlb_lower', 'mtlb_max',
- 'mtlb_min', 'mtlb_mode', 'mtlb_more', 'mtlb_num2str', 'mtlb_ones', 'mtlb_plot', 'mtlb_prod', 'mtlb_rand',
- 'mtlb_randn', 'mtlb_rcond', 'mtlb_realmax', 'mtlb_realmin', 'mtlb_repmat', 'mtlb_s', 'mtlb_save',
- 'mtlb_setstr', 'mtlb_size', 'mtlb_sort', 'mtlb_sparse', 'mtlb_strcmp', 'mtlb_strcmpi', 'mtlb_strfind',
- 'mtlb_strrep', 'mtlb_sum', 'mtlb_t', 'mtlb_toeplitz', 'mtlb_tril', 'mtlb_triu', 'mtlb_true', 'mtlb_uint16',
- 'mtlb_uint32', 'mtlb_uint8', 'mtlb_upper', 'mtlb_zeros', 'mu2lin', 'mucomp', 'mulf', 'mvvacov', 'name2rgb',
- 'names', 'nancumsum', 'nand2mean', 'nanmax', 'nanmean', 'nanmeanf', 'nanmedian', 'nanmin', 'nanstdev',
- 'nansum', 'narsimul', 'NDcost', 'ndgrid', 'ndims', 'nearfloat', 'nehari', 'neighbors', 'netclose', 'netwindow',
- 'netwindows', 'new', 'newaxes', 'newest', 'newfun', 'nextpow2', 'nf3d', 'nfreq', 'nlev', 'nnz', 'node_number',
- 'nodes_2_path', 'nodes_degrees', 'noisegen', 'norm', 'not', 'null', 'number_properties', 'numdiff', 'numer',
- 'nyquist', 'object_editor', 'obs_gram', 'obscont', 'obscont1', 'observer', 'obsv_mat', 'obsvss', 'ode',
- 'ode_discrete', 'ode_optional_output', 'ode_root', 'odedc', 'odeoptions', 'oemtochar', 'old_style',
- 'oldbesseli', 'oldbesselj', 'oldbesselk', 'oldbessely', 'oldload', 'oldplot', 'oldsave', 'ones',
- 'Operation', 'optim', 'or', 'orth', 'overloading', 'p_margin', 'param3d', 'param3d_properties',
- 'param3d1', 'paramfplot2d', 'parents', 'parrot', 'part', 'path_2_nodes', 'pathconvert', 'pause', 'pbig',
- 'pca', 'pcg', 'pdiv', 'pen2ea', 'pencan', 'penlaur', 'percent', 'perctl', 'perfect_match', 'perl',
- 'perms', 'permute', 'pertrans', 'pfss', 'phasemag', 'phc', 'pie', 'pinv', 'pipe_network', 'playsnd', 'plot',
- 'plot_graph', 'plot2d', 'plot2d_old_version', 'plot2d1', 'plot2d2', 'plot2d3', 'plot2d4', 'plot3d',
- 'plot3d_old_version', 'plot3d1', 'plot3d2', 'plot3d3', 'plotframe', 'plotprofile', 'plus', 'plzr',
- 'pmodulo', 'pol2des', 'pol2str', 'pol2tex', 'polar', 'polarplot', 'polfact', 'poly', 'polyline_properties',
- 'portr3d', 'portrait', 'power', 'ppol', 'prbs_a', 'predecessors', 'predef', 'print', 'printf',
- 'printf_conversion', 'printing', 'printsetupbox', 'prod', 'profile', 'progressionbar', 'proj', 'projsl',
- 'projspec', 'psmall', 'pspect', 'pvm', 'pvm_addhosts', 'pvm_barrier', 'pvm_bcast', 'pvm_bufinfo', 'pvm_config',
- 'pvm_delhosts', 'pvm_error', 'pvm_exit', 'pvm_f772sci', 'pvm_get_timer', 'pvm_getinst', 'pvm_gettid',
- 'pvm_gsize', 'pvm_halt', 'pvm_joingroup', 'pvm_kill', 'pvm_lvgroup', 'pvm_mytid', 'pvm_parent', 'pvm_probe',
- 'pvm_recv', 'pvm_reduce', 'pvm_sci2f77', 'pvm_send', 'pvm_set_timer', 'pvm_spawn', 'pvm_spawn_independent',
- 'pvm_start', 'pvm_tasks', 'pvm_tidtohost', 'pvmd3', 'pwd', 'qassign', 'qld', 'qmr', 'qr', 'quapro', 'quart',
- 'quaskro', 'quit', 'quote', 'rand', 'randpencil', 'range', 'rank', 'rankqr', 'rat', 'rcond',
- 'rdivf', 'read', 'read4b', 'readb', 'readc_', 'readmps', 'readxls', 'real', 'realtime', 'realtimeinit',
- 'rectangle_properties', 'recur', 'reglin', 'regress', 'remez', 'remezb', 'repfreq', 'replot', 'resethistory',
- 'residu', 'resume', 'return', 'rgb2name', 'ric_desc', 'ricc', 'riccati', 'rlist', 'rmdir', 'roots', 'rotate',
- 'round', 'routh_t', 'rowcomp', 'rowcompr', 'rowinout', 'rowregul', 'rowshuff', 'rpem', 'rref', 'rtitr',
- 'rubberbox', 'salesman', 'sample', 'samplef', 'samwr', 'save', 'save_format', 'save_graph', 'savehistory',
- 'savematfile', 'savewave', 'sca', 'scaling', 'scanf', 'scanf_conversion', 'scf', 'schur', 'sci_files',
- 'sci2exp', 'sci2for', 'sci2map', 'sciargs', 'SciComplex', 'SciComplexArray', 'SciDouble', 'SciDoubleArray',
- 'scilab', 'Scilab', 'ScilabEval', 'scilink', 'scipad', 'SciString', 'SciStringArray', 'sd2sci', 'sda', 'sdf',
- 'secto3d', 'segs_properties', 'semi', 'semicolon', 'semidef', 'sensi', 'set', 'set_posfig_dim',
- 'setbpt', 'setdiff', 'setenv', 'seteventhandler', 'setfield', 'sethomedirectory', 'setlanguage', 'setmenu',
- 'sfact', 'Sfgrayplot', 'Sgrayplot', 'sgrid', 'shortest_path', 'show_arcs', 'show_graph', 'show_nodes',
- 'show_pixmap', 'showprofile', 'sident', 'sign', 'Signal', 'signm', 'simp', 'simp_mode', 'sin', 'sinc',
- 'sincd', 'sinh', 'sinhm', 'sinm', 'size', 'slash', 'sleep', 'sm2des', 'sm2ss', 'smooth', 'solve',
- 'sorder', 'sort', 'sound', 'soundsec', 'sp2adj', 'spaninter', 'spanplus', 'spantwo', 'spchol',
- 'spcompack', 'spec', 'specfact', 'speye', 'spget', 'splin', 'splin2d', 'splin3d', 'split_edge', 'spones',
- 'sprand', 'sprintf', 'spzeros', 'sqroot', 'sqrt', 'sqrtm', 'square', 'squarewave', 'srfaur', 'srkf', 'ss2des',
- 'ss2ss', 'ss2tf', 'sscanf', 'sskf', 'ssprint', 'ssrand', 'st_deviation', 'st_ility', 'stabil', 'stacksize',
- 'star', 'startup', 'stdev', 'stdevf', 'str2code', 'strange', 'strcat', 'strindex', 'string', 'stringbox',
- 'strings', 'stripblanks', 'strong_con_nodes', 'strong_connex', 'strsplit', 'strsubst', 'struct', 'sub2ind',
- 'subf', 'subgraph', 'subplot', 'successors', 'sum', 'supernode', 'surf', 'surface_properties', 'sva',
- 'svd', 'svplot', 'sylm', 'sylv', 'symbols', 'sysconv', 'sysdiag', 'sysfact', 'syslin', 'syssize', 'system',
- 'systems', 'systmat', 'tabul', 'tan', 'tangent', 'tanh', 'tanhm', 'tanm', 'TCL_CreateSlave', 'TCL_DeleteInterp',
- 'TCL_EvalFile', 'TCL_EvalStr', 'TCL_ExistInterp', 'TCL_ExistVar', 'TCL_GetVar', 'TCL_GetVersion', 'TCL_SetVar',
- 'TCL_UnsetVar', 'TCL_UpVar', 'tdinit', 'testmatrix', 'texprint', 'text_properties', 'tf2des', 'tf2ss', 'then',
- 'thrownan', 'tic', 'tilda', 'time_id', 'timer', 'title', 'titlepage', 'TK_EvalFile', 'TK_EvalStr', 'tk_getdir',
- 'tk_getfile', 'TK_GetVar', 'tk_savefile', 'TK_SetVar', 'toc', 'toeplitz', 'tohome', 'tokenpos',
- 'tokens', 'toolbar', 'toprint', 'trace', 'trans', 'trans_closure', 'translatepaths', 'tree2code', 'trfmod',
- 'trianfml', 'tril', 'trimmean', 'trisolve', 'triu', 'try', 'trzeros', 'twinkle', 'type', 'Type', 'typename',
- 'typeof', 'ui_observer', 'uicontrol', 'uimenu', 'uint16', 'uint32', 'uint8', 'ulink', 'unglue', 'union',
- 'unique', 'unix', 'unix_g', 'unix_s', 'unix_w', 'unix_x', 'unobs', 'unsetmenu', 'unzoom', 'user', 'varargin',
- 'varargout', 'Variable', 'variance', 'variancef', 'varn', 'vectorfind', 'waitbar', 'warning', 'wavread',
- 'wavwrite', 'wcenter', 'wfir', 'what', 'where', 'whereami', 'whereis', 'who', 'who_user', 'whos',
- 'wiener', 'wigner', 'winclose', 'window', 'winlist', 'winopen', 'winqueryreg', 'winsid', 'with_atlas',
- 'with_gtk', 'with_javasci', 'with_pvm', 'with_texmacs', 'with_tk', 'writb', 'write', 'write4b', 'x_choices',
- 'x_choose', 'x_dialog', 'x_matrix', 'x_mdialog', 'x_message', 'x_message_modeless', 'xarc', 'xarcs', 'xarrows',
- 'xaxis', 'xbasc', 'xbasimp', 'xbasr', 'xchange', 'xclea', 'xclear', 'xclick', 'xclip', 'xdel', 'xend',
- 'xfarc', 'xfarcs', 'xfpoly', 'xfpolys', 'xfrect', 'xget', 'xgetech', 'xgetfile', 'xgetmouse', 'xgraduate',
- 'xgrid', 'xinfo', 'xinit', 'xlfont', 'xload', 'xls_open', 'xls_read', 'xmltohtml', 'xname', 'xnumb', 'xpause',
- 'xpoly', 'xpolys', 'xrect', 'xrects', 'xrpoly', 'xs2bmp', 'xs2emf', 'xs2eps', 'xs2fig', 'xs2gif', 'xs2ppm',
- 'xs2ps', 'xsave', 'xsegs', 'xselect', 'xset', 'xsetech', 'xsetm', 'xstring', 'xstringb', 'xstringl', 'xtape',
- 'xtitle', 'yulewalk', 'zeropen', 'zeros', 'zgrid', 'zoom_rect', 'zpbutt', 'zpch1', 'zpch2', 'zpell'
- )
- ),
- 'SYMBOLS' => array(
- '<', '>', '=',
- '!', '@', '~', '&', '|',
- '+','-', '*', '/', '%',
- ',', ';', '?', ':', "'"
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => true,
- 1 => true,
- 2 => true,
- 3 => true,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #000000; font-weight: bold;',
- 3 => 'color: #000066;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #666666; font-style: italic;',
- 2 => '',
- 'MULTI' => 'color: #666666; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;',
- 'HARD' => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;',
- 'HARD' => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;',
- 2 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;',
- 4 => 'color: #009999;',
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://www.scilab.org/product/dic-mat-sci/M2SCI_doc.htm',
- 2 => 'http://www.scilab.org/product/dic-mat-sci/M2SCI_doc.htm',
- 3 => 'http://www.scilab.org/product/dic-mat-sci/M2SCI_doc.htm'
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '-&gt;',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- //Variable
- 0 => '[\\$%@]+[a-zA-Z_][a-zA-Z0-9_]*',
- //File Descriptor
- 4 => '&lt;[a-zA-Z_][a-zA-Z0-9_]*&gt;',
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/sdlbasic.php b/libvpx/examples/includes/geshi/geshi/sdlbasic.php
deleted file mode 100644
index 2e85964..0000000
--- a/libvpx/examples/includes/geshi/geshi/sdlbasic.php
+++ /dev/null
@@ -1,165 +0,0 @@
-<?php
-/*************************************************************************************
- * sdlbasic.php
- * ------------
- * Author: Roberto Rossi
- * Copyright: (c) 2005 Roberto Rossi (http://rsoftware.altervista.org)
- * Release Version: 1.0.8.3
- * Date Started: 2005/08/19
- *
- * sdlBasic (http://sdlbasic.sf.net) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2005/08/19 (1.0.0)
- * - First Release
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'sdlBasic',
- 'COMMENT_SINGLE' => array(1 => "'", 2 => "rem", 3 => "!", 4 => "#"),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'const', 'option', 'explicit', 'qbasic', 'include', 'argc',
- 'argv', 'command', 'command$', 'run', 'shell', 'os', 'declare',
- 'sub', 'function', 'return', 'while', 'wend', 'exit', 'end',
- 'continue', 'if', 'then', 'else', 'elseif',
- 'select', 'case', 'for', 'each', 'step',
- 'next', 'to', 'dim', 'shared', 'common', 'lbound', 'bound',
- 'erase', 'asc', 'chr', 'chr$', 'insert', 'insert$', 'instr', 'lcase',
- 'lcase$', 'left', 'left$', 'len', 'length', 'ltrim', 'ltrim$', 'mid',
- 'mid$', 'replace', 'replace$', 'replacesubstr', 'replacesubstr$',
- 'reverse', 'reverse$', 'right', 'right$', 'rinstr', 'rtrim', 'rtrim$',
- 'space', 'space$', 'str', 'str$', 'strf', 'strf$', 'string', 'string$',
- 'tally', 'trim', 'trim$', 'typeof', 'typeof$', 'ucase', 'ucase$', 'val',
- 'abs', 'acos', 'andbit', 'asin', 'atan', 'bitwiseand', 'bitwiseor',
- 'bitwisexor', 'cos', 'exp', 'fix', 'floor', 'frac', 'hex', 'hex$', 'int',
- 'log', 'min', 'max', 'orbit', 'randomize', 'rnd', 'round', 'sgn', 'sin',
- 'sqr', 'tan', 'xorbit', 'open', 'as', 'file', 'input', 'close', 'output',
- 'append', 'eof', 'fileexists', 'filecopy', 'filemove', 'filerename',
- 'freefile', 'kill', 'loc', 'lof', 'readbyte', 'rename', 'seek',
- 'writebyte', 'chdir', 'dir', 'dir$', 'direxists', 'dirfirst', 'dirnext',
- 'mkdir', 'rmdir', 'print', 'date', 'date$', 'time', 'time$', 'ticks',
- 'data', 'read', 'reservebank', 'freebank', 'copybank', 'loadbank',
- 'savebank', 'setbank', 'sizebank', 'poke', 'doke', 'loke', 'peek', 'deek',
- 'leek', 'memcopy', 'setdisplay', 'setcaption', 'caption', 'displaywidth',
- 'displayheight', 'displaybpp', 'screen', 'directscreen', 'screenopen',
- 'screenclose', 'screenclone', 'screencopy', 'screenfade', 'screenfadein',
- 'screencrossfade', 'screenalpha', 'screenlock', 'screenunlock',
- 'screenrect', 'xscreenrect', 'yscreenrect', 'wscreenrect', 'hscreenrect',
- 'flagscreenrect', 'screenwidth', 'screenheight', 'offset', 'xoffset',
- 'yoffset', 'cls', 'screenswap', 'autoback', 'setautoback',
- 'dualplayfield', 'waitvbl', 'fps', 'rgb', 'enablepalette', 'color',
- 'palette', 'colorcycling', 'ink', 'point', 'dot', 'plot', 'line', 'box',
- 'bar', 'circle', 'fillcircle', 'ellipse', 'fillellipse', 'paint',
- 'loadimage', 'saveimage', 'loadsound', 'savesound', 'loadmusic',
- 'hotspot', 'setcolorkey', 'imageexists', 'imagewidth', 'imageheight',
- 'deleteimage', 'copyimage', 'setalpha', 'zoomimage', 'rotateimage',
- 'rotozoomimage', 'blt', 'pastebob', 'pasteicon', 'grab', 'spriteclip',
- 'sprite', 'deletesprite', 'xsprite', 'ysprite', 'spritewidth',
- 'spriteheight', 'frsprite', 'livesprite', 'spritehit', 'autoupdatesprite',
- 'updatesprite', 'setbob', 'bob', 'deletebob', 'xbob', 'ybob', 'bobwidth',
- 'bobheight', 'frbob', 'livebob', 'bobhit', 'autoupdatebob', 'updatebob',
- 'text', 'setfont', 'textrender', 'pen', 'paper', 'prints', 'locate',
- 'atx', 'aty', 'curson', 'cursoff', 'inputs', 'zoneinputs',
- 'isenabledsound', 'soundexists', 'deletesound', 'copysound',
- 'musicexists', 'playsound', 'volumesound', 'stopsound', 'pausesound',
- 'resumesound', 'vumetersound', 'positionsound', 'soundchannels',
- 'playmusic', 'positionmusic', 'stopmusic', 'fademusic', 'pausemusic',
- 'resumemusic', 'rewindmusic', 'volumemusic', 'speedmusic', 'numdrivescd',
- 'namecd', 'getfreecd', 'opencd', 'indrivecd', 'trackscd', 'curtrackcd',
- 'curframecd', 'playcd', 'playtrackscd',
- 'pausecd', 'resumecd', 'stopcd', 'ejectcd', 'closecd', 'tracktypecd',
- 'tracklengthcd', 'trackoffsetcd', 'key', 'inkey', 'waitkey', 'xmouse',
- 'ymouse', 'xmousescreen', 'ymousescreen', 'bmouse', 'changemouse',
- 'locatemouse', 'mouseshow', 'mousehide', 'mousezone', 'numjoysticks',
- 'namejoystick', 'numaxesjoystick', 'numballsjoystick', 'numhatsjoystick',
- 'numbuttonsjoystick', 'getaxisjoystick', 'gethatjoystick',
- 'getbuttonjoystick', 'xgetballjoystick', 'ygetballjoystick', 'joy',
- 'bjoy', 'wait', 'timer', 'isenabledsock', 'getfreesock', 'opensock',
- 'acceptsock', 'isserverready', 'connectsock', 'connectionreadysock',
- 'isclientready', 'losesock', 'peeksock', 'readsock', 'readbytesock',
- 'readlinesock', 'writesock', 'writebytesock', 'writelinesock',
- 'getremoteip', 'getremoteport', 'getlocalip'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080;',
- 2 => 'color: #808080;',
- 3 => 'color: #808080;',
- 4 => 'color: #808080;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/smalltalk.php b/libvpx/examples/includes/geshi/geshi/smalltalk.php
deleted file mode 100644
index 9316773..0000000
--- a/libvpx/examples/includes/geshi/geshi/smalltalk.php
+++ /dev/null
@@ -1,160 +0,0 @@
-<?php
-/*************************************************************************************
- * smalltalk.php
- * --------
- * Author: Bananeweizen (Bananeweizen@gmx.de)
- * Copyright: (c) 2005 Bananeweizen (www.bananeweizen.de)
- * Release Version: 1.0.8.3
- * Date Started: 2005/03/27
- *
- * Smalltalk language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2006-05-24 (1.0.0)
- * - First Release
- *
- * TODO
- * -------------------------
- * * recognize nested array symbols correctly
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Smalltalk',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('"' => '"'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'"),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array('self','super','true','false','nil')
- ),
- 'SYMBOLS' => array(
- '[', ']', '=' , ':=', '(', ')', '#'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #7f007f;'
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #007f00; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'BRACKETS' => array(
- 0 => ''
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #7f0000;'
- ),
- 'METHODS' => array(
- 0 => ''
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066; font-weight:bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;',
- 1 => 'color: #7f0000;',
- 2 => 'color: #7f0000;',
- 3 => 'color: #00007f;',
- 4 => 'color: #7f007f;',
- 5 => 'color: #00007f;',
- 6 => 'color: #00007f;'
- ),
- 'SCRIPT' => array(
- 0 => ''
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 0 => array(
- GESHI_SEARCH => '([^a-zA-Z0-9_#<])([A-Z]+[a-zA-Z0-9_]*)(?!>)', //class names
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 1 => array(
- GESHI_SEARCH => '(#+)([a-zA-Z0-9_]+)', //symbols
- GESHI_REPLACE => '\\1\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 2 => array(
- GESHI_SEARCH => '(#\s*\([^)]*\))', //array symbols
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 3 => array(
- GESHI_SEARCH => '<PIPE>([a-zA-Z0-9_\s]+)<PIPE>', //temporary variables
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '|',
- GESHI_AFTER => '|'
- ),
- 4 => array(
- GESHI_SEARCH => '(self|super|true|false|nil)', //keywords again (to avoid matching in next regexp)
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 5 => array(
- GESHI_SEARCH => '([:(,=[.*\/+-]\s*)([a-zA-Z0-9_]+)', //message parameters, message receivers
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 's',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
- 6 => array(
- GESHI_SEARCH => '([a-zA-Z0-9_]+)(\s*:=)', //assignment targets
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => '\\2'
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/smarty.php b/libvpx/examples/includes/geshi/geshi/smarty.php
deleted file mode 100644
index 112ab5a..0000000
--- a/libvpx/examples/includes/geshi/geshi/smarty.php
+++ /dev/null
@@ -1,192 +0,0 @@
-<?php
-/*************************************************************************************
- * smarty.php
- * ----------
- * Author: Alan Juden (alan@judenware.org)
- * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/07/10
- *
- * Smarty template language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/11/27 (1.0.0)
- * - Initial Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Smarty',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array('{*' => '*}'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- '$smarty', 'now', 'const', 'capture', 'config', 'section', 'foreach', 'template', 'version', 'ldelim', 'rdelim',
- 'foreachelse', 'include', 'include_php', 'insert', 'if', 'elseif', 'else', 'php',
- 'sectionelse', 'is_cached',
- ),
- 2 => array(
- 'capitalize', 'count_characters', 'cat', 'count_paragraphs', 'count_sentences', 'count_words', 'date_format',
- 'default', 'escape', 'indent', 'lower', 'nl2br', 'regex_replace', 'replace', 'spacify', 'string_format',
- 'strip', 'strip_tags', 'truncate', 'upper', 'wordwrap',
- ),
- 3 => array(
- 'counter', 'cycle', 'debug', 'eval', 'html_checkboxes', 'html_image', 'html_options',
- 'html_radios', 'html_select_date', 'html_select_time', 'html_table', 'math', 'mailto', 'popup_init',
- 'popup', 'textformat'
- ),
- 4 => array(
- '$template_dir', '$compile_dir', '$config_dir', '$plugins_dir', '$debugging', '$debug_tpl',
- '$debugging_ctrl', '$autoload_filters', '$compile_check', '$force_compile', '$caching', '$cache_dir',
- '$cache_lifetime', '$cache_handler_func', '$cache_modified_check', '$config_overwrite',
- '$config_booleanize', '$config_read_hidden', '$config_fix_newlines', '$default_template_handler_func',
- '$php_handling', '$security', '$secure_dir', '$security_settings', '$trusted_dir', '$left_delimiter',
- '$right_delimiter', '$compiler_class', '$request_vars_order', '$request_use_auto_globals',
- '$error_reporting', '$compile_id', '$use_sub_dirs', '$default_modifiers', '$default_resource_type'
- ),
- 5 => array(
- 'append', 'append_by_ref', 'assign', 'assign_by_ref', 'clear_all_assign', 'clear_all_cache',
- 'clear_assign', 'clear_cache', 'clear_compiled_tpl', 'clear_config', 'config_load', 'display',
- 'fetch', 'get_config_vars', 'get_registered_object', 'get_template_vars',
- 'load_filter', 'register_block', 'register_compiler_function', 'register_function',
- 'register_modifier', 'register_object', 'register_outputfilter', 'register_postfilter',
- 'register_prefilter', 'register_resource', 'trigger_error', 'template_exists', 'unregister_block',
- 'unregister_compiler_function', 'unregister_function', 'unregister_modifier', 'unregister_object',
- 'unregister_outputfilter', 'unregister_postfilter', 'unregister_prefilter', 'unregister_resource'
- ),
- 6 => array(
- 'name', 'file', 'scope', 'global', 'key', 'once', 'script',
- 'loop', 'start', 'step', 'max', 'show', 'values', 'value', 'from', 'item'
- ),
- 7 => array(
- 'eq', 'neq', 'ne', 'lte', 'gte', 'ge', 'le', 'not', 'mod'
- ),
- 8 => array(
- // some common php functions
- 'isset', 'is_array', 'empty', 'count', 'sizeof'
- )
- ),
- 'SYMBOLS' => array(
- '/', '=', '==', '!=', '>', '<', '>=', '<=', '!', '%'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0600FF;', //Functions
- 2 => 'color: #008000;', //Modifiers
- 3 => 'color: #0600FF;', //Custom Functions
- 4 => 'color: #804040;', //Variables
- 5 => 'color: #008000;', //Methods
- 6 => 'color: #6A0A0A;', //Attributes
- 7 => 'color: #D36900;', //Text-based symbols
- 8 => 'color: #0600FF;' //php functions
- ),
- 'COMMENTS' => array(
- 'MULTI' => 'color: #008080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #D36900;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #D36900;'
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #009000;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #00aaff;'
- )
- ),
- 'URLS' => array(
- 1 => 'http://smarty.php.net/{FNAMEL}',
- 2 => 'http://smarty.php.net/{FNAMEL}',
- 3 => 'http://smarty.php.net/{FNAMEL}',
- 4 => 'http://smarty.php.net/{FNAMEL}',
- 5 => 'http://smarty.php.net/{FNAMEL}',
- 6 => '',
- 7 => 'http://smarty.php.net/{FNAMEL}',
- 8 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- // variables
- 0 => '\$[a-zA-Z][a-zA-Z0-9_]*'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- 0 => array(
- '{' => '}'
- ),
- 1 => array(
- '<!--' => '-->',
- ),
- 2 => array(
- '<' => '>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => false,
- 2 => false
- ),
- 'PARSER_CONTROL' => array(
- 'KEYWORDS' => array(
- 'DISALLOWED_BEFORE' => "(?<![a-zA-Z0-9\$_\|\#;>|^])",
- 'DISALLOWED_AFTER' => "(?![a-zA-Z0-9_<\|%\\-&])"
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/sql.php b/libvpx/examples/includes/geshi/geshi/sql.php
deleted file mode 100644
index 00e4fd2..0000000
--- a/libvpx/examples/includes/geshi/geshi/sql.php
+++ /dev/null
@@ -1,140 +0,0 @@
-<?php
-/*************************************************************************************
- * sql.php
- * -------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * SQL language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added additional symbols for highlighting
- * 2004/11/27 (1.0.3)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.2)
- * - Added "`" string delimiter
- * - Added "#" single comment starter
- * 2004/08/05 (1.0.1)
- * - Added support for symbols
- * - Added many more keywords (mostly MYSQL keywords)
- * 2004/07/14 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Add all keywords
- * * Split this to several sql files - mysql-sql, ansi-sql etc
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'SQL',
- 'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => 1,
- 'QUOTEMARKS' => array("'", '"', '`'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'ADD', 'ALL', 'ALTER', 'AND', 'AS', 'ASC',
- 'AUTO_INCREMENT', 'BETWEEN', 'BINARY', 'BOOLEAN',
- 'BOTH', 'BY', 'CHANGE', 'CHECK', 'COLUMN', 'COLUMNS',
- 'CREATE', 'CROSS', 'DATA', 'DATABASE', 'DATABASES',
- 'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE',
- 'DISTINCT', 'DROP', 'ENCLOSED', 'ESCAPED', 'EXISTS',
- 'EXPLAIN', 'FIELD', 'FIELDS', 'FLUSH', 'FOR',
- 'FOREIGN', 'FROM', 'FULL', 'FUNCTION', 'GRANT',
- 'GROUP', 'HAVING', 'IDENTIFIED', 'IF', 'IGNORE',
- 'IN', 'INDEX', 'INFILE', 'INNER', 'INSERT', 'INTO',
- 'IS', 'JOIN', 'KEY', 'KEYS', 'KILL', 'LANGUAGE',
- 'LEADING', 'LEFT', 'LIKE', 'LIMIT', 'LINES', 'LOAD',
- 'LOCAL', 'LOCK', 'LOW_PRIORITY', 'MODIFY', 'NATURAL',
- 'NEXTVAL', 'NOT', 'NULL', 'ON', 'OPTIMIZE', 'OPTION',
- 'OPTIONALLY', 'OR', 'ORDER', 'OUTER', 'OUTFILE',
- 'PRIMARY', 'PROCEDURAL', 'PROCEEDURE', 'READ',
- 'REFERENCES', 'REGEXP', 'RENAME', 'REPLACE',
- 'RETURN', 'REVOKE', 'RIGHT', 'RLIKE', 'SELECT',
- 'SET', 'SETVAL', 'SHOW', 'SONAME', 'STATUS',
- 'STRAIGHT_JOIN', 'TABLE', 'TABLES', 'TEMINATED',
- 'TEMPORARY', 'TO', 'TRAILING', 'TRIGGER', 'TRUNCATE',
- 'TRUSTED', 'UNION', 'UNIQUE', 'UNLOCK', 'UNSIGNED',
- 'UPDATE', 'USE', 'USING', 'VALUES', 'VARIABLES',
- 'VIEW', 'WHERE', 'WITH', 'WRITE', 'XOR', 'ZEROFILL'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '=', '<', '>', '|', ',', '.', '+', '-', '*', '/'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #993333; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #808080; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/tcl.php b/libvpx/examples/includes/geshi/geshi/tcl.php
deleted file mode 100644
index 9badb21..0000000
--- a/libvpx/examples/includes/geshi/geshi/tcl.php
+++ /dev/null
@@ -1,194 +0,0 @@
-<?php
-/*************************************************************************************
- * tcl.php
- * ---------------------------------
- * Author: Reid van Melle (rvanmelle@gmail.com)
- * Copyright: (c) 2004 Reid van Melle (sorry@nowhere)
- * Release Version: 1.0.8.3
- * Date Started: 2006/05/05
- *
- * TCL/iTCL language file for GeSHi.
- *
- * This was thrown together in about an hour so I don't expect
- * really great things. However, it is a good start. I never
- * got a change to try out the iTCL or object-based support but
- * this is not widely used anyway.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2006/05/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/05/05)
- * -------------------------
- * - Get TCL built-in special variables highlighted with a new color..
- * currently, these are listed in //special variables in the keywords
- * section, but they get covered by the general REGEXP for symbols
- * - General cleanup, testing, and verification
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'TCL',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- 1 => '/(?<!\\\\)#(?:\\\\\\\\|\\\\\\n|.)*$/m',
- 2 => '/{[^}\n]+}/'
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"', "'"),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- /*
- * Set 1: reserved words
- * http://python.org/doc/current/ref/keywords.html
- */
- 1 => array(
- 'proc', 'global', 'upvar', 'if', 'then', 'else', 'elseif', 'for', 'foreach',
- 'break', 'continue', 'while', 'set', 'eval', 'case', 'in', 'switch',
- 'default', 'exit', 'error', 'return', 'uplevel', 'loop',
- 'for_array_keys', 'for_recursive_glob', 'for_file', 'unwind_protect',
- 'expr', 'catch', 'namespace', 'rename', 'variable',
- // itcl
- 'method', 'itcl_class', 'public', 'protected'),
-
- /*
- * Set 2: builtins
- * http://asps.activatestate.com/ASPN/docs/ActiveTcl/8.4/tcl/tcl_2_contents.htm
- */
- 2 => array(
- // string handling
- 'append', 'binary', 'format', 're_syntax', 'regexp', 'regsub',
- 'scan', 'string', 'subst',
- // list handling
- 'concat', 'join', 'lappend', 'lindex', 'list', 'llength', 'lrange',
- 'lreplace', 'lsearch', 'lset', 'lsort', 'split',
- // procedures and output
- 'incr', 'close', 'eof', 'fblocked', 'fconfigure', 'fcopy', 'file',
- 'fileevent', 'flush', 'gets', 'open', 'puts', 'read', 'seek',
- 'socket', 'tell',
- // packages and source files
- 'load', 'loadTk', 'package', 'pgk::create', 'pgk_mkIndex', 'source',
- // interpreter routines
- 'bgerror', 'history', 'info', 'interp', 'memory', 'unknown',
- // library routines
- 'enconding', 'http', 'msgcat',
- // system related
- 'cd', 'clock', 'exec', 'glob', 'pid', 'pwd', 'time',
- // platform specified
- 'dde', 'registry', 'resource',
- // special variables
- '$argc', '$argv', '$errorCode', '$errorInfo', '$argv0',
- '$auto_index', '$auto_oldpath', '$auto_path', '$env',
- '$tcl_interactive', '$tcl_libpath', '$tcl_library',
- '$tcl_pkgPath', '$tcl_platform', '$tcl_precision', '$tcl_traceExec',
- ),
-
- /*
- * Set 3: standard library
- */
- 3 => array(
- 'comment', 'filename', 'library', 'packagens', 'tcltest', 'tclvars',
- ),
-
- /*
- * Set 4: special methods
- */
-// 4 => array(
-// )
-
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '$', '*', '&', '%', '!', ';', '<', '>', '?'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
-// 4 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #ff7700;font-weight:bold;', // Reserved
- 2 => 'color: #008000;', // Built-ins + self
- 3 => 'color: #dc143c;', // Standard lib
-// 4 => 'color: #0000cd;' // Special methods
- ),
- 'COMMENTS' => array(
- 1 => 'color: #808080; font-style: italic;',
- 2 => 'color: #483d8b;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: black;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #483d8b;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff4500;'
- ),
- 'METHODS' => array(
- 1 => 'color: black;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #ff3333;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
-// 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '::'
- ),
- 'REGEXPS' => array(
- //Special variables
- 0 => '[\\$]+[a-zA-Z_][a-zA-Z0-9_]*',
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'COMMENTS' => array(
- 'DISALLOWED_BEFORE' => '\\'
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/teraterm.php b/libvpx/examples/includes/geshi/geshi/teraterm.php
deleted file mode 100644
index f2938ca..0000000
--- a/libvpx/examples/includes/geshi/geshi/teraterm.php
+++ /dev/null
@@ -1,317 +0,0 @@
-<?php
-/*************************************************************************************
- * teraterm.php
- * --------
- * Author: Boris Maisuradze (boris at logmett.com)
- * Copyright: (c) 2008 Boris Maisuradze (http://logmett.com)
- * Release Version: 1.0.8.3
- * Date Started: 2008/09/26
- *
- * Tera Term Macro language file for GeSHi.
- *
- *
- * This version of ttl.php was created for Tera Term 4.60 and LogMeTT 2.9.4.
- * Newer versions of these application can contain additional Macro commands
- * and/or keywords that are not listed here. The latest release of ttl.php
- * can be downloaded from Download section of LogMeTT.com
- *
- * CHANGES
- * -------
- * 2008/09/26 (1.0.8)
- * - First Release for Tera Term 4.60 and below.
- *
- * TODO (updated 2008/09/26)
- * -------------------------
- * *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Tera Term Macro',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /* Commands */
- 1 => array(
- 'Beep',
- 'BplusRecv',
- 'BplusSend',
- 'Break', // (version 4.53 or later)
- 'Call',
- 'CallMenu', // (version 4.56 or later)
- 'ChangeDir',
- 'ClearScreen',
- 'Clipb2Var', //(version 4.46 or later)
- 'ClosesBox',
- 'CloseTT',
- 'Code2Str',
- 'Connect',
- 'CRC32', // (version 4.60 or later)
- 'CRC32File', // (version 4.60 or later)
- 'CygConnect', // (version 4.57 or later)
- 'DelPassword',
- 'Disconnect',
- 'Do', // (version 4.56 or later)
- 'Else',
- 'EnableKeyb',
- 'End',
- 'EndIf',
- 'EndUntil', // (version 4.56 or later)
- 'EndWhile',
- 'Exec',
- 'ExecCmnd',
- 'Exit',
- 'FileClose',
- 'FileConcat',
- 'FileCopy',
- 'FileCreate',
- 'FileDelete',
- 'FileMarkPtr',
- 'FilenameBox', //(version 4.54 or later)
- 'FileOpen',
- 'FileRead',
- 'FileReadln', // (version 4.48 or later)
- 'FileRename',
- 'FileSearch',
- 'FileSeek',
- 'FileSeekBack',
- 'FileStrSeek',
- 'FileStrSeek2',
- 'FileWrite',
- 'FileWriteln',
- 'FindOperations',
- 'FlushRecv',
- 'ForNext',
- 'GetDate',
- 'GetDir', //(version 4.46 or later)
- 'GetEnv',
- 'GetPassword',
- 'GetTime',
- 'GetTitle',
- 'GetVer', //(version 4.58 or later)
- 'GoTo',
- 'If',
- 'IfDefined', // (version 4.46 or later)
- 'IfThenElseIf',
- 'Include',
- 'InputBox',
- 'Int2Str',
- 'KmtFinish',
- 'KmtGet',
- 'KmtRecv',
- 'KmtSend',
- 'LoadKeyMap',
- 'LogClose',
- 'LogOpen',
- 'LogPause',
- 'LogStart',
- 'LogWrite',
- 'Loop', // (version 4.56 or later)
- 'MakePath',
- 'MessageBox',
- 'MPause', // (version 4.27 or later)
- 'PasswordBox',
- 'Pause',
- 'QuickvanRecv',
- 'QuickvanSend',
- 'Random', //(version 4.27 or later)
- 'Recvln',
- 'RestoreSetup',
- 'Return',
- 'RotateLeft', //(version 4.54 or later)
- 'RotateRight', //(version 4.54 or later)
- 'ScpRecv', // (version 4.57 or later)
- 'ScpSend', // (version 4.57 or later)
- 'Send',
- 'SendBreak',
- 'SendFile',
- 'SendKcode',
- 'Sendln',
- 'SetBaud', // (version 4.58 or later)
- 'SetDate',
- 'SetDir',
- 'SetDlgPos',
- 'SetDTR', // (version 4.59 or later)
- 'SetRTS', // (version 4.59 or later)
- 'SetEnv', // (version 4.54 or later)
- 'SetEcho',
- 'SetExitCode',
- 'SetSync',
- 'SetTime',
- 'SetTitle',
- 'Show',
- 'ShowTT',
- 'Sprintf', // (version 4.52 or later)
- 'StatusBox',
- 'Str2Code',
- 'Str2Int',
- 'StrCompare',
- 'StrConcat',
- 'StrCopy',
- 'StrLen',
- 'StrMatch', // (version 4.59 or later)
- 'StrScan',
- 'Testlink',
- 'Then',
- 'ToLower', //(version 4.53 or later)
- 'ToUpper', //(version 4.53 or later)
- 'Unlink',
- 'Until', // (version 4.56 or later)
- 'Var2Clipb', //(version 4.46 or later)
- 'Wait',
- 'WaitEvent',
- 'Waitln',
- 'WaitRecv',
- 'WaitRegex', // (version 4.21 or later)
- 'While',
- 'XmodemRecv',
- 'XmodemSend',
- 'YesNoBox',
- 'ZmodemRecv',
- 'ZmodemSend'
- ),
- /* System Variables */
- 2 => array(
- 'groupmatchstr1',
- 'groupmatchstr2',
- 'groupmatchstr3',
- 'groupmatchstr4',
- 'groupmatchstr5',
- 'groupmatchstr6',
- 'groupmatchstr7',
- 'groupmatchstr8',
- 'groupmatchstr9',
- 'inputstr',
- 'matchstr',
- 'param2',
- 'param3',
- 'param4',
- 'param5',
- 'param6',
- 'param7',
- 'param8',
- 'param9',
- 'result',
- 'timeout'
- ),
- /* LogMeTT Key Words */
- 3 => array(
- '$[1]',
- '$[2]',
- '$[3]',
- '$[4]',
- '$[5]',
- '$[6]',
- '$[7]',
- '$[8]',
- '$connection$',
- '$email$',
- '$logdir$',
- '$logfilename$',
- '$logit$',
- '$mobile$',
- '$name$',
- '$pager$',
- '$parent$',
- '$phone$',
- '$snippet$',
- '$ttdir$',
- '$user$',
- '$windir$',
- ),
- /* Keyword Symbols */
- 4 => array(
- 'and',
- 'not',
- 'or',
- 'xor'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']',
- '~', '!', '+', '-', '*', '/', '%', '>>', '<<', '<<<', '>>>', '&', '^', '|',
- '<>', '<=', '>=', '=', '==', '<>', '!=', '&&', '||'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000080; font-weight: bold!important;',
- 2 => 'color: #808000; font-weight: bold;', // System Variables
- 3 => 'color: #ff0000; font-weight: bold;', // LogMeTT Key Words
- 4 => 'color: #ff00ff; font-weight: bold;' // Keyword Symbols
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(),
- 'BRACKETS' => array(
- 0 => 'color: #ff00ff; font-weight: bold;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #800080;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #008080;'
- ),
- 'SCRIPT' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #ff00ff; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff; font-weight: bold;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- 0 => array (
- GESHI_SEARCH => '(\:[_a-zA-Z][_a-zA-Z0-9]+)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array(),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/text.php b/libvpx/examples/includes/geshi/geshi/text.php
deleted file mode 100644
index 6c6e260..0000000
--- a/libvpx/examples/includes/geshi/geshi/text.php
+++ /dev/null
@@ -1,84 +0,0 @@
-<?php
-/*************************************************************************************
- * text.php
- * --------
- * Author: Sean Hanna (smokingrope@gmail.com)
- * Copyright: (c) 2006 Sean Hanna
- * Release Version: 1.0.8.3
- * Date Started: 04/23/2006
- *
- * Standard Text File (No Syntax Highlighting).
- * Plaintext language file for GeSHi.
- *
- * CHANGES
- * -------
- * 04/23/2006 (0.5.0)
- * - Syntax File Created
- *
- * 04/27/2006 (1.0.0)
- * - Documentation Cleaned Up
- * - First Release
- *
- * TODO (updated 04/27/2006)
- * -------------------------
- *
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Text',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(),
- 'SYMBOLS' => array(),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(),
- 'COMMENTS' => array(),
- 'ESCAPE_CHAR' => array(),
- 'BRACKETS' => array(),
- 'STRINGS' => array(),
- 'NUMBERS' => array(),
- 'METHODS' => array(),
- 'SYMBOLS' => array(),
- 'SCRIPT' => array(),
- 'REGEXPS' => array()
- ),
- 'URLS' => array(),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array(),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'ALL' => GESHI_NEVER
- ),
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/thinbasic.php b/libvpx/examples/includes/geshi/geshi/thinbasic.php
deleted file mode 100644
index caa6edf..0000000
--- a/libvpx/examples/includes/geshi/geshi/thinbasic.php
+++ /dev/null
@@ -1,868 +0,0 @@
-<?php
-/*************************************************************************************
- * thinbasic.php
- * ------
- * Author: Eros Olmi (eros.olmi@thinbasic.com)
- * Copyright: (c) 2006 Eros Olmi (http://www.thinbasic.com), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2006/05/12
- *
- * thinBasic language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2006/05/12 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/05/12)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'thinBasic',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'XOR','XML_TREETOSTRING','XML_PARSEFILE','XML_PARSE','XML_PARENT','XML_NODETYPE','XML_NODETOSTRING','XML_NEXTSIBLING',
- 'XML_LASTERROR','XML_GETTAG','XML_FREE','XML_FINDNODE','XML_DECODEPARAM','XML_CHILDDATA','XML_CHILD','XML_ATTRIBVALUE',
- 'XML_ATTRIBNAME','XML_ATTRIBCOUNT','WORD','WITH','WIN_SHOW','WIN_SETTITLE','WIN_SETFOREGROUND','WIN_ISZOOMED',
- 'WIN_ISVISIBLE','WIN_ISICONIC','WIN_GETTITLE','WIN_GETFOREGROUND','WIN_GETCLASS','WIN_GETACTIVE','WIN_FLASH','WIN_FINDBYTITLE',
- 'WIN_FINDBYCLASS','WHILE','WEND','VERIFY','VARPTR','VARIANTVT$','VARIANTVT','VARIANT',
- 'VARIABLE_GETINFO','VARIABLE_EXISTS','VARIABLE_EXIST','VALUE','VAL','USING$','USING','USES',
- 'USER','UNTIL','UNITS','UNION','UNICODE2ASCII','UDP_SEND','UDP_RECV','UDP_OPENSERVER',
- 'UDP_OPEN','UDP_FREEFILE','UDP_CLOSE','UCODE$','UCASE$','UBOUND','TYPE','TRIMFULL$',
- 'TRIM$','TOOLTIP','TOKENIZER_MOVETOEOL','TOKENIZER_KEYSETUSERSTRING','TOKENIZER_KEYSETUSERNUMBER','TOKENIZER_KEYGETUSERSTRING','TOKENIZER_KEYGETUSERNUMBER','TOKENIZER_KEYGETSUBTYPE',
- 'TOKENIZER_KEYGETNAME','TOKENIZER_KEYGETMAINTYPE','TOKENIZER_KEYFIND','TOKENIZER_KEYADD','TOKENIZER_GETNEXTTOKEN','TOKENIZER_DEFAULT_SET','TOKENIZER_DEFAULT_GET','TOKENIZER_DEFAULT_CODE',
- 'TOKENIZER_DEFAULT_CHAR','TO','TIMER','TIME$','THEN','TEXTBOX','TEXT','TCP_SEND',
- 'TCP_RECV','TCP_PRINT','TCP_OPEN','TCP_LINEINPUT','TCP_FREEFILE','TCP_CLOSE','TB_IMGCTX_SETIMAGEADJUSTMENT','TB_IMGCTX_LOADIMAGE',
- 'TB_IMGCTX_GETIMAGEADJUSTMENT','TBGL_VIEWPORT','TBGL_VERTEX','TBGL_USETEXTUREFLAG','TBGL_USETEXTURE','TBGL_USELINESTIPPLEFLAG','TBGL_USELINESTIPPLE','TBGL_USELIGHTSOURCEFLAG',
- 'TBGL_USELIGHTSOURCE','TBGL_USELIGHTINGFLAG','TBGL_USELIGHTING','TBGL_USEFOGFLAG','TBGL_USEFOG','TBGL_USEDEPTHMASK','TBGL_USEDEPTHFLAG','TBGL_USEDEPTH',
- 'TBGL_USECLIPPLANEFLAG','TBGL_USECLIPPLANE','TBGL_USEBLENDFLAG','TBGL_USEBLEND','TBGL_USEALPHATEST','TBGL_TRANSLATE','TBGL_TORUS','TBGL_TEXCOORD2D',
- 'TBGL_SPHERE','TBGL_SHOWWINDOW','TBGL_SHOWCURSOR','TBGL_SETWINDOWTITLE','TBGL_SETUPLIGHTSOURCE','TBGL_SETUPFOG','TBGL_SETUPCLIPPLANE','TBGL_SETPRIMITIVEQUALITY',
- 'TBGL_SETLIGHTPARAMETER','TBGL_SETDRAWDISTANCE','TBGL_SCALE','TBGL_SAVESCREENSHOT','TBGL_ROTATEXYZ','TBGL_ROTATE','TBGL_RESETMATRIX','TBGL_RENDERTOTEXTURE',
- 'TBGL_RENDERMATRIX3D','TBGL_RENDERMATRIX2D','TBGL_PUSHMATRIX','TBGL_PRINTFONT','TBGL_PRINTBMP','TBGL_PRINT','TBGL_POS3DTOPOS2D','TBGL_POPMATRIX',
- 'TBGL_POLYGONLOOK','TBGL_POINTSIZE','TBGL_POINTINSIDE3D','TBGL_NORMAL','TBGL_NEWLIST','TBGL_MOUSEGETWHEELDELTA','TBGL_MOUSEGETRBUTTON','TBGL_MOUSEGETPOSY',
- 'TBGL_MOUSEGETPOSX','TBGL_MOUSEGETMBUTTON','TBGL_MOUSEGETLBUTTON','TBGL_M15SETVERTEXZ','TBGL_M15SETVERTEXY','TBGL_M15SETVERTEXXYZ','TBGL_M15SETVERTEXX','TBGL_M15SETVERTEXTEXY',
- 'TBGL_M15SETVERTEXTEXXY','TBGL_M15SETVERTEXTEXX','TBGL_M15SETVERTEXTEXN','TBGL_M15SETVERTEXRGB','TBGL_M15SETVERTEXR','TBGL_M15SETVERTEXPSTOP','TBGL_M15SETVERTEXPARAM','TBGL_M15SETVERTEXLAYER',
- 'TBGL_M15SETVERTEXG','TBGL_M15SETVERTEXB','TBGL_M15SETMODELVERTEXCOUNT','TBGL_M15SETBONECHILD','TBGL_M15ROTBONEZ','TBGL_M15ROTBONEY','TBGL_M15ROTBONEX','TBGL_M15ROTBONE',
- 'TBGL_M15RESETBONES','TBGL_M15RECALCNORMALS','TBGL_M15LOADMODEL','TBGL_M15INITMODELBUFFERS','TBGL_M15GETVERTEXZ','TBGL_M15GETVERTEXY','TBGL_M15GETVERTEXXYZ','TBGL_M15GETVERTEXX',
- 'TBGL_M15GETVERTEXTEXY','TBGL_M15GETVERTEXTEXXY','TBGL_M15GETVERTEXTEXX','TBGL_M15GETVERTEXTEXN','TBGL_M15GETVERTEXRGB','TBGL_M15GETVERTEXR','TBGL_M15GETVERTEXPSTOP','TBGL_M15GETVERTEXPARAM',
- 'TBGL_M15GETVERTEXLAYER','TBGL_M15GETVERTEXG','TBGL_M15GETVERTEXB','TBGL_M15GETMODELVERTEXCOUNT','TBGL_M15GETMODELPOLYCOUNT','TBGL_M15ERASECHILDBONES','TBGL_M15DRAWMODEL','TBGL_M15DEFBONERESET',
- 'TBGL_M15DEFBONELAYER','TBGL_M15DEFBONEBOX','TBGL_M15DEFBONEANCHOR','TBGL_M15DEFBONEADDVERTEX','TBGL_M15CLEARMODEL','TBGL_M15APPLYBONES','TBGL_M15ADDBONETREEITEM','TBGL_LOADTEXTURE',
- 'TBGL_LOADFONT','TBGL_LOADBMPFONT','TBGL_LINEWIDTH','TBGL_LINESTIPPLE','TBGL_KILLFONT','TBGL_ISWINDOW','TBGL_ISPOINTVISIBLE','TBGL_ISPOINTBEHINDVIEW',
- 'TBGL_GETWINDOWMULTIKEYSTATE','TBGL_GETWINDOWKEYSTATE','TBGL_GETWINDOWKEYONCE','TBGL_GETWINDOWCLIENT','TBGL_GETTEXTURENAME','TBGL_GETTEXTURELIST','TBGL_GETPIXELINFO','TBGL_GETMULTIASYNCKEYSTATE',
- 'TBGL_GETLASTGLERROR','TBGL_GETFRAMERATE','TBGL_GETDESKTOPINFO','TBGL_GETASYNCKEYSTATE','TBGL_ERRORMESSAGES','TBGL_ENDPOLY','TBGL_ENDLIST','TBGL_DRAWFRAME',
- 'TBGL_DESTROYWINDOW','TBGL_DELETELIST','TBGL_CYLINDER','TBGL_CREATEWINDOWEX','TBGL_CREATEWINDOW','TBGL_COLORALPHA','TBGL_COLOR','TBGL_CLEARFRAME',
- 'TBGL_CAMERA','TBGL_CALLLIST','TBGL_BUILDFONT','TBGL_BOX','TBGL_BLENDFUNC','TBGL_BINDTEXTURE','TBGL_BEGINPOLY','TBGL_BACKCOLOR',
- 'TBGL_ALPHAFUNC','TBDI_JOYZ','TBDI_JOYY','TBDI_JOYX','TBDI_JOYSTOPEFFECT','TBDI_JOYSLIDER','TBDI_JOYSETRANGEZ','TBDI_JOYSETRANGEY',
- 'TBDI_JOYSETRANGEXYZ','TBDI_JOYSETRANGEX','TBDI_JOYSETDEADZONEZ','TBDI_JOYSETDEADZONEY','TBDI_JOYSETDEADZONEXYZ','TBDI_JOYSETDEADZONEX','TBDI_JOYSETAUTOCENTER','TBDI_JOYRZ',
- 'TBDI_JOYRY','TBDI_JOYRX','TBDI_JOYPOV','TBDI_JOYPLAYEFFECT','TBDI_JOYLOADEFFECT','TBDI_JOYHASFF','TBDI_JOYHASEFFECT','TBDI_JOYGETEFFECTNAME',
- 'TBDI_JOYGETEFFECTGUID','TBDI_JOYCREATEEFFECT','TBDI_JOYCOUNTPOV','TBDI_JOYCOUNTEFFECTS','TBDI_JOYCOUNTBTN','TBDI_JOYCOUNTAXES','TBDI_JOYBUTTON','TBDI_JOYAVAIL',
- 'TBDI_INIT','TBASS_STREAMFREE','TBASS_STREAMCREATEFILE','TBASS_SETVOLUME','TBASS_SETEAXPRESET','TBASS_SETEAXPARAMETERS','TBASS_SETCONFIG','TBASS_SET3DPOSITION',
- 'TBASS_SET3DFACTORS','TBASS_SAMPLELOAD','TBASS_SAMPLEGETCHANNEL','TBASS_MUSICLOAD','TBASS_MUSICFREE','TBASS_INIT','TBASS_GETVOLUME','TBASS_GETVERSION',
- 'TBASS_GETCONFIG','TBASS_FREE','TBASS_ERRORGETCODE','TBASS_CHANNELSTOP','TBASS_CHANNELSETPOSITION','TBASS_CHANNELSETATTRIBUTES','TBASS_CHANNELSET3DPOSITION','TBASS_CHANNELPLAY',
- 'TBASS_CHANNELPAUSE','TBASS_CHANNELISACTIVE','TBASS_CHANNELGETPOSITION','TBASS_CHANNELGETLENGTH','TBASS_CHANNELGETATTRIBUTES','TBASS_APPLY3D','TANH','TANGENT',
- 'TAN','TALLY','TABCTRL_ONNOTIFY','TABCTRL_INSERTITEM','TABCTRL_GETCURSEL','SWAP','SUB','STRZIP$',
- 'STRUNZIP$','STRREVERSE$','STRPTRLEN','STRPTR','STRINSERT$','STRING$','STRING','STRDELETE$',
- 'STR$','STOP','STEP','STDOUT','STDIN','STAT_SUM','STAT_STDERROR','STAT_STDDEVIATION',
- 'STAT_RANDOM','STAT_PRODUCT','STAT_MIN','STAT_MEDIAN','STAT_MEANHARMONIC','STAT_MEANGEOMETRIC','STAT_MEANARITHMETIC','STAT_MAX',
- 'STAT_INVERSESUM','STAT_HISTOGRAM','STAT_FILLARRAY','STAT_COUNT','STAT_COPYARRAY','STAT_CLONEARRAY','STAT_CHISQUARE','STATIC',
- 'STATE','SQR','SPLIT','SORT','SMTP_STATISTICS','SMTP_SETOPTION','SMTP_SETLOGFILE','SMTP_SENDHTML',
- 'SMTP_SENDEMAIL','SMTP_GETERROR','SMTP_FINISHED','SMTP_DEBUG','SMTP_CONNECT','SMTP_CLOSE','SLEEP','SIZEOF',
- 'SIZE','SINH','SINGLE','SIN','SIGNED','SHOW','SHIFT','SHAPETOBMP',
- 'SGN','SETAT','SET','SENDMESSAGE','SENDKEYSBULK','SENDKEYS','SEND','SELECTEXPRESSION',
- 'SELECT','SECH','SEC','SCAN','SAPI_SPEAK','SAPI_SETVOLUME','SAPI_SETRATE','SAPI_MODULELOADED',
- 'SAPI_GETVOLUME','SAPI_GETRATE','RTRIM$','RTF_SETTEXT','RTF_SETFONTSIZE','RTF_SETFONTNAME','RTF_SETFGCOLOR','RTF_SETEFFECT',
- 'RTF_SETBGCOLOR','RTF_SETALIGN','RTF_SAVETOFILE','RTF_LOADFROMFILE','RTF_GETTEXT','RTF_GETFONTSIZE','RTF_GETFONTNAME','RTF_GETEFFECT',
- 'RTF_GETCLASS','RTF_APPENDTEXT','RSET$','ROUND','RNDF','RND','RIGHT$','RIGHT',
- 'RGB','RESOURCE','RESIZE','RESET','REPLACE$','REPEAT$','REMOVE$','REM',
- 'REGISTRY_SETVALUE','REGISTRY_SETTXTNUM','REGISTRY_SETTXTBOOL','REGISTRY_SETDWORD','REGISTRY_GETVALUE','REGISTRY_GETTXTNUM','REGISTRY_GETTXTBOOL','REGISTRY_GETDWORD',
- 'REGISTRY_GETALLKEYS','REGISTRY_DELVALUE','REGISTRY_DELKEY','REFERENCE','REF','REDRAW','REDIM','RAS_SETPARAMS',
- 'RAS_OPENDIALUPDIALOG','RAS_LOADENTRIES','RAS_HANGUPALL','RAS_HANGUP','RAS_GETENTRY','RAS_BEGINDIAL','RANDOMIZE','RADTODEG',
- 'QUERYPERFORMANCEFREQUENCY','QUERYPERFORMANCECOUNTER','QUAD','PTR','PRESERVE','POST','POPUP','POKE$',
- 'POKE','PIXELS','PI','PERMUTATIONS','PEEKMESSAGE','PEEK$','PEEK','PC_SYSTEMUPFROM',
- 'PC_SUSPENDSTATE','PC_SHUTDOWN','PC_SHOWCARET','PC_SETCARETBLINKTIME','PC_RESTARTDIALOG','PC_PREVENTSHUTDOWN','PC_LOCK','PC_INSERTCD',
- 'PC_HIDECARET','PC_GETSTATEONOFF','PC_GETSCROLLLOCKKEYSTATE','PC_GETNUMLOCKKEYSTATE','PC_GETCARETBLINKTIME','PC_GETCAPSLOCKKEYSTATE','PC_EMPTYBIN','PC_EJECTCD',
- 'PC_DECODECDERROR','PCT','PARSESET$','PARSECOUNT','PARSE$','PARSE','PARAMETERS','OUTSIDE',
- 'OS_WINVERSIONTEXT','OS_WINGETVERSIONTIMELINE','OS_SHELLEXECUTE','OS_SHELLABOUT','OS_SHELL','OS_SETLASTCALLDLLERROR','OS_SERVICESTOP','OS_SERVICESTATUSDESCRIPTION',
- 'OS_SERVICESTARTTYPEDESCRIPTION','OS_SERVICESTART','OS_SERVICESETSTARTTYPE','OS_SERVICEQUERY','OS_SERVICEGETSTARTTYPE','OS_SERVICEGETLIST','OS_PROCESSKILLBYNAME','OS_PROCESSKILLBYID',
- 'OS_PROCESSISRUNNING','OS_PROCESSGETLIST','OS_PROCESSGETID','OS_PROCESSARERUNNING','OS_MESSAGEBEEP','OS_ISWOW64','OS_ISFEATUREPRESENT','OS_IEVERSION',
- 'OS_GETWINDOWSDIR','OS_GETUSERNAME','OS_GETTEMPDIR','OS_GETSYSTEMDIR','OS_GETSPECIALFOLDER','OS_GETLASTCALLDLLSTATUS','OS_GETLASTCALLDLLERROR','OS_GETCURRENTTHREADID',
- 'OS_GETCURRENTPROCESSID','OS_GETCOMPUTERNAME','OS_GETCOMMANDS','OS_GETCOMMAND','OS_FLASHWINDOW','OS_FATALAPPEXIT','OS_ENVIRON','OS_CALLDLL',
- 'OR','OPTIONAL','OPTION','OPT','ONCE','ON','OFF','NUMBER',
- 'NOT','NEXT','NEW','MSGBOX','MOUSEPTR','MODULE','MODELESS','MODAL',
- 'MOD','MKWRD$','MKS$','MKQ$','MKL$','MKI$','MKE$','MKDWD$',
- 'MKD$','MKCUX$','MKCUR$','MKBYT$','MIN$','MIN','MID$','MENU',
- 'MDI_CREATE','MCASE$','MAX$','MAX','MAKWRD','MAKLNG','MAKINT','MAKDWR',
- 'LTRIM$','LSET$','LOWRD','LOOP','LONG','LOINT','LOG_WRITE','LOGB',
- 'LOG2','LOG10','LOG','LOCAL','LOC','LL_UPDATEBYNAME','LL_UPDATE','LL_TOSTRING',
- 'LL_TOFILE','LL_NAME','LL_GETITEM','LL_GETBYNUMBER','LL_FROMFILE','LL_FREE','LL_FINDLAST','LL_FINDBYNAME',
- 'LL_FINDBYDATA','LL_DELETELIKE','LL_DELETEBYNAME','LL_DELETE','LL_DATABYNAME','LL_DATA','LL_COUNT','LL_ADD',
- 'LISTBOX','LINE','LIBRARY_EXISTS','LIB','LEN','LEFT$','LEFT','LCASE$',
- 'LBOUND','LABEL','KILL','JOIN$','ITERATE','ISWINDOW','ISUNICODE','ISTRUE',
- 'ISODD','ISLIKE','ISFALSE','ISEVEN','IP_TOSTRING','IP_ADDR','INTERNALINFO','INTEGER',
- 'INT','INSTR','INSIDE','INPUTBOX$','INI_SETKEY','INI_GETSECTIONSLIST','INI_GETSECTIONKEYLIST','INI_GETKEY',
- 'INET_URLDOWNLOAD','INET_PING','INET_OPENDIALUPDIALOG','INET_GETSTATE','INET_GETREMOTEMACADDRESS','INET_GETIP','INET_GETCONNECTIONMODE','INCR',
- 'IN','IMAGE','IIF$','IIF','IF','ICRYPTO_TESTSHA1','ICRYPTO_TESTMD5','ICRYPTO_TESTCRC32',
- 'ICRYPTO_TESTCRC16','ICRYPTO_STRING2ASCII','ICRYPTO_SHA1','ICRYPTO_MD5','ICRYPTO_ENCRYPTRIJNDAEL','ICRYPTO_ENCRYPTRC4','ICRYPTO_DECRYPTRIJNDAEL','ICRYPTO_DECRYPTRC4',
- 'ICRYPTO_CRC32','ICRYPTO_CRC16','ICRYPTO_BYTEXOR','ICRYPTO_BIN2ASCII','ICRYPTO_ASCII2STRING','ICRYPTO_ASCII2BIN','HOST_ADDR','HOSTNAME_TOIP',
- 'HOSTIP_TONAME','HIWRD','HIINT','HEX$','HASH','HANDLE','GUIDTXT$','GUID$',
- 'GRAPHIC','GLVOID','GLUSHORT','GLUINT','GLUBYTE','GLSIZEI','GLSHORT','GLOBAL',
- 'GLINT','GLFLOAT','GLENUM','GLDOUBLE','GLCLAMPF','GLCLAMPD','GLBYTE','GLBOOLEAN',
- 'GLBITFIELD','GETWINDOWMULTIKEYSTATE','GETWINDOWKEYSTATE','GETTICKCOUNT','GETS','GETMULTIASYNCKEYSTATE','GETMESSAGE','GETCURRENTINSTANCE',
- 'GETAT','GETASYNCKEYSTATE','GET','FUNCTION_NPARAMS','FUNCTION_EXISTS','FUNCTION_CPARAMS','FUNCTION','FTP_SETSTRING',
- 'FTP_SETSERVERDIR','FTP_SETNUMBER','FTP_SETMODE','FTP_SETLOGFILE','FTP_SETLOCALDIR','FTP_QUIT','FTP_PUTFILE','FTP_GETSTRING',
- 'FTP_GETSERVERDIR','FTP_GETNUMBER','FTP_GETLOCALDIR','FTP_GETLIST','FTP_GETFILE','FTP_GETERRORSTRING','FTP_GETERRORNUMBER','FTP_FINISHED',
- 'FTP_EXTRACT','FTP_DELFILE','FTP_CONNECT','FTP_COMMAND','FRAME','FRAC','FORMAT$','FOR',
- 'FONT_LIST','FONT_CREATE','FONT','FOCUS','FLUSH','FIX','FILE_SIZE','FILE_SHELLDELETE',
- 'FILE_SHELLCOPY','FILE_SETDATETIME','FILE_SEEK','FILE_SAVE','FILE_RENAME','FILE_PUT','FILE_PATHSPLIT','FILE_OPEN',
- 'FILE_LOF','FILE_LOAD','FILE_LINEPRINT','FILE_LINEINPUT','FILE_KILL','FILE_GETVERSIONSTRING','FILE_GETVERSION','FILE_GETTIME',
- 'FILE_GETDATETIMESTAMP','FILE_GETDATETIME','FILE_GETDATE','FILE_GET','FILE_EXISTS','FILE_EOF','FILE_COPY','FILE_CLOSE',
- 'FILE_CHANGED','FILE_APPEND','FACTORIAL','EXTRACT$','EXT','EXPORT','EXP2','EXP10',
- 'EXP','EXIT','EVAL_STRING','EVAL_SETSTRING','EVAL_SETNUMBER','EVAL_MATH','EVAL_LINKEXT','EVAL_GETSTRING',
- 'EVAL_GETNUMBER','EVAL_ERRORGETTOKEN','EVAL_ERRORDESCRIPTION','EVAL_ERRORCLEAR','EVAL','ERRCLEAR','ERR','ENGINE_GETCURRENTTOKEN',
- 'ENDIF','END','ENABLE','ELSEIF','ELSE','ECHO','DWORD','DT_YEAR',
- 'DT_TIMETOSEC','DT_TIMESUBSECONDS','DT_TIMEFORMAT','DT_TIMEADDSECONDS','DT_SETTIMESEPARATOR','DT_SETDATESEPARATOR','DT_SETDATECENTURY','DT_SECTOTIME',
- 'DT_SECTODATE','DT_SECOND','DT_MONTH','DT_MINUTE','DT_LASTDAYOFMONTH','DT_ISVALIDDATE','DT_ISLEAPYEAR','DT_HOUR',
- 'DT_GETWEEKDAYNAME','DT_GETWEEKDAY','DT_GETTIMESTAMP','DT_GETTIMESEPARATOR','DT_GETMONTHNAME','DT_GETDATESEPARATOR','DT_GETDATECENTURY','DT_DAY',
- 'DT_DATETOSEC','DT_DATETIMESUBSECONDS','DT_DATETIMEADDSECONDS','DT_DATESUBDAYS','DT_DATEFORMAT','DT_DATEDIFF','DT_DATEADDDAYS','DT_COOKIEDATE',
- 'DRAW','DOUBLE','DOEVENTS','DO','DISABLE','DIR_REMOVE','DIR_MAKEALL','DIR_MAKE',
- 'DIR_LISTARRAY','DIR_LIST','DIR_ISEMPTY','DIR_ISDIR','DIR_GETCURRENT','DIR_EXISTS','DIR_CHANGEDRIVE','DIR_CHANGE',
- 'DIM','DICTIONARY_MEMINFO','DICTIONARY_LISTKEYS','DICTIONARY_FREE','DICTIONARY_FIND','DICTIONARY_EXISTS','DICTIONARY_CREATE','DICTIONARY_COUNT',
- 'DICTIONARY_ADD','DIALOG_STOPEVENTS','DIALOG_SAVEFILE','DIALOG_OPENFILE','DIALOG_GETCONTROL','DIALOG_CHOOSECOLOR','DIALOG_BROWSEFORFOLDER','DIALOG',
- 'DESKTOP','DESCENDING','DESCEND','DELETEOBJECT','DELETE','DEGTORAD','DECR','DECLARE',
- 'DATE$','CVWRD','CVS','CVQ','CVL','CVI','CVE','CVDWD',
- 'CVD','CVCUX','CVCUR','CVBYT','CURRENCY','CUR','CSET$','CSCH',
- 'CSC','CRYPTO_GETPROVIDERTYPESCOUNT','CRYPTO_GETPROVIDERSCOUNT','CRYPTO_GETDEFAULTPROVIDER','CRYPTO_GENRANDOMSTRING','CRYPTO_ENUMPROVIDERTYPES','CRYPTO_ENUMPROVIDERS','CRYPTO_ENCRYPT',
- 'CRYPTO_DECRYPT','CREATEFONT','COTH','COTAN','COSH','COS','CONTROL_SETTEXT','CONTROL_GETTEXT',
- 'CONTROL_GETNUMBER','CONTROL','CONST','CONSOLE_WRITELINE','CONSOLE_WRITE','CONSOLE_WAITKEY','CONSOLE_SHOWWINDOW','CONSOLE_SHOWCURSOR',
- 'CONSOLE_SETTITLE','CONSOLE_SETTEXTATTRIBUTE','CONSOLE_SETSTDHANDLE','CONSOLE_SETSCREENBUFFERSIZE','CONSOLE_SETPROGRESSBARCHAR','CONSOLE_SETOUTPUTMODE','CONSOLE_SETOUTPUTCP','CONSOLE_SETINPUTMODE',
- 'CONSOLE_SETFILEAPISTOOEM','CONSOLE_SETFILEAPISTOANSI','CONSOLE_SETCURSORSIZE','CONSOLE_SETCURSORPOSITION','CONSOLE_SETCP','CONSOLE_SETACTIVESCREENBUFFER','CONSOLE_SCROLLWINDOW','CONSOLE_SCROLLBUFFERONEROW',
- 'CONSOLE_SCROLLBUFFER','CONSOLE_SAVESCREEN','CONSOLE_RESTORESCREEN','CONSOLE_READLINE','CONSOLE_READ','CONSOLE_PROGRESSBAR','CONSOLE_PRINTLINE','CONSOLE_PRINTAT',
- 'CONSOLE_PRINT','CONSOLE_NORMALSCREEN','CONSOLE_LINE','CONSOLE_INKEYB','CONSOLE_INKEY','CONSOLE_HIDECURSOR','CONSOLE_GETTITLE','CONSOLE_GETTEXTATTRIBUTE',
- 'CONSOLE_GETSTDHANDLE','CONSOLE_GETSIZEY','CONSOLE_GETSIZEX','CONSOLE_GETPROGRESSBARCHAR','CONSOLE_GETOUTPUTMODE','CONSOLE_GETOUTPUTCP','CONSOLE_GETNUMBEROFMOUSEBUTTONS','CONSOLE_GETINPUTMODE',
- 'CONSOLE_GETCURSORY','CONSOLE_GETCURSORX','CONSOLE_GETCURSORSIZE','CONSOLE_GETCURRENTFONTINDEX','CONSOLE_GETCP','CONSOLE_GENERATECTRLEVENT','CONSOLE_FULLSCREEN','CONSOLE_FREE',
- 'CONSOLE_FOREGROUNDRGB','CONSOLE_ENABLECTRLC','CONSOLE_DISABLECTRLC','CONSOLE_CREATESCREENBUFFER','CONSOLE_COLORAT','CONSOLE_CLS','CONSOLE_BOX','CONSOLE_BACKGROUNDRGB',
- 'CONSOLE_ATTACH','CONSOLE_AREFILEAPISANSI','CONSOLE_ALLOC','COM_VARIANTINIT','COM_VARIANTCOPY','COM_VARIANTCLEAR','COM_SUCCEEDED','COM_STRINGFROMCLSID',
- 'COM_RELEASE','COM_QUERYINTERFACE','COM_PROGIDFROMCLSID','COM_ISEQUALIID','COM_ISEQUALGUID','COM_ISEQUALCLSID','COM_GETOBJECT','COM_GETENGINEGUID',
- 'COM_EXECUTE','COM_DISPLAYERROR','COM_CREATEOBJECT','COM_CLSIDFROMSTRING','COM_CLSIDFROMPROGID','COM_BUILDVARIANT','COMBOBOX','COMBINATIONS',
- 'COLOR','CLIPBOARD_SETTEXT','CLIPBOARD_GETTEXT','CLIENT','CLEARMESSAGES','CHR$','CHOOSE$','CHOOSE',
- 'CHECKBOX','CHECK3STATE','CHECK','CGI_WRITELOGFILE','CGI_WRITE','CGI_URLDECODESTRING','CGI_UPLOADFILESTIME','CGI_UPLOADFILESNUMBER',
- 'CGI_UPLOADFILESIZE','CGI_STARTSESSION','CGI_SETSESSIONVARIABLE','CGI_RESETDEFAULTSETTINGS','CGI_REMOVESPECIALCHARSPREFIX','CGI_REMOVEQUOTE','CGI_READ','CGI_LOADCONFIGFILE',
- 'CGI_HEADER','CGI_GETSESSIONVARIABLE','CGI_GETREQUESTMETHOD','CGI_GETQUERYVALUE','CGI_GETCURRENTSESSION','CGI_GETCURRENTGUID','CGI_ENVIRON','CGI_CFGSETOPTION',
- 'CGI_CFGGETOPTION','CGI_ADDSPECIALCHARSPREFIX','CGI_ADDQUOTE','CEIL','CASE','CALL','BYVAL','BYTE',
- 'BYREF','BYCMD','BUTTON','BUNDLE_SETSCRIPTPARAMETERS','BUNDLE_SETSCRIPTNAME','BUNDLE_SETFLAGOBFUSCATEMAINSCRIPT','BUNDLE_SETFLAGDELETEAFTERRUN','BUNDLE_SETFLAGCOMPRESSALLFILES',
- 'BUNDLE_SETFLAGASKBEFOREEXTRACT','BUNDLE_SETEXTRACTIONFOLDER','BUNDLE_SETCREATIONFOLDER','BUNDLE_SETBUNDLENAME','BUNDLE_RESET','BUNDLE_MAKE','BUNDLE_BUILDER','BUNDLE_ADDFOLDER',
- 'BUNDLE_ADDFILE','BOUNDCHECK','BIN$','BIFF_WRITETEXT','BIFF_WRITENUMBER','BIFF_WRITEDATE','BIFF_SETROWHEIGHT','BIFF_SETCOLWIDTH',
- 'BIFF_SETBUFFER','BIFF_CREATEFILE','BIFF_CLOSEFILE','BETWEEN','BEEP','BAR','ATTACH','ATN',
- 'AT','ASSIGN','ASCIZ','ASCIIZ','ASCII2UNICODE','ASCENDING','ASCEND','ASC',
- 'AS','ARRAY','ARCTANH','ARCSINH','ARCSIN','ARCSECH','ARCSEC','ARCCSCH',
- 'ARCCSC','ARCCOTH','ARCCOT','ARCCOSH','ARCCOS','APP_TIMER','APP_SOURCEPATH','APP_SOURCENAME',
- 'APP_SOURCEFULLNAME','APP_PATH','APP_NAME','APP_LISTVARIABLES','APP_LISTKEYWORDS','APP_LISTFUNCTIONS','APP_LISTEQUATES','APP_INCLUDEPATH',
- 'APP_GETMODULEFULLPATH','APP_COUNTER','APPEND','ANY','ANIMATE_STOP','ANIMATE_PLAY','ANIMATE_OPEN','AND',
- 'ALIAS','ALERT','ADD','ACODE$','ABS','%DEF','#MINVERSION','#IF',
- '#ENDIF','#ELSEIF','#ELSE','#DEFAULT','#DEF','SQLWRITEPRIVATEPROFILESTRING','SQLWRITEFILEDSN','SQLWRITEDSNTOINI',
- 'SQLVALIDDSN','SQLTRANSACT','SQLTABLES','SQLTABLEPRIVILEGES','SQLSTATISTICS','SQLSPECIALCOLUMNS','SQLSETSTMTOPTION','SQLSETSTMTATTR',
- 'SQLSETSCROLLOPTIONS','SQLSETPOS','SQLSETPARAM','SQLSETENVATTR','SQLSETDESCREC','SQLSETDESCFIELD','SQLSETCURSORNAME','SQLSETCONNECTOPTION',
- 'SQLSETCONNECTATTR','SQLSETCONFIGMODE','SQLROWCOUNT','SQLREMOVETRANSLATOR','SQLREMOVEDSNFROMINI','SQLREMOVEDRIVERMANAGER','SQLREMOVEDRIVER','SQLREADFILEDSN',
- 'SQLPUTDATA','SQLPROCEDURES','SQLPROCEDURECOLUMNS','SQLPRIMARYKEYS','SQLPREPARE','SQLPOSTINSTALLERERROR','SQLPARAMOPTIONS','SQLPARAMDATA',
- 'SQLNUMRESULTCOLS','SQLNUMPARAMS','SQLNATIVESQL','SQLMORERESULTS','SQLMANAGEDATASOURCES','SQLINSTALLTRANSLATOREX','SQLINSTALLERERROR','SQLINSTALLDRIVERMANAGER',
- 'SQLINSTALLDRIVEREX','SQLGETTYPEINFO','SQLGETTRANSLATOR','SQLGETSTMTOPTION','SQLGETSTMTATTR','SQLGETPRIVATEPROFILESTRING','SQLGETINSTALLEDDRIVERS','SQLGETINFO',
- 'SQLGETFUNCTIONS','SQLGETENVATTR','SQLGETDIAGREC','SQLGETDIAGFIELD','SQLGETDESCREC','SQLGETDESCFIELD','SQLGETDATA','SQLGETCURSORNAME',
- 'SQLGETCONNECTOPTION','SQLGETCONNECTATTR','SQLGETCONFIGMODE','SQLFREESTMT','SQLFREEHANDLE','SQLFREEENV','SQLFREECONNECT','SQLFOREIGNKEYS',
- 'SQLFETCHSCROLL','SQLFETCH','SQLEXTENDEDFETCH','SQLEXECUTE','SQLEXECDIRECT','SQLERROR','SQLENDTRAN','SQLDRIVERS',
- 'SQLDRIVERCONNECT','SQLDISCONNECT','SQLDESCRIBEPARAM','SQLDESCRIBECOL','SQLDATASOURCES','SQLCREATEDATASOURCE','SQLCOPYDESC','SQLCONNECT',
- 'SQLCONFIGDRIVER','SQLCONFIGDATASOURCE','SQLCOLUMNS','SQLCOLUMNPRIVILEGES','SQLCOLATTRIBUTES','SQLCOLATTRIBUTE','SQLCLOSECURSOR','SQLCANCEL',
- 'SQLBULKOPERATIONS','SQLBROWSECONNECT','SQLBINDPARAMETER','SQLBINDPARAM','SQLBINDCOL','SQLALLOCSTMT','SQLALLOCHANDLE','SQLALLOCENV',
- 'SQLALLOCCONNECT','ODBCWRONGDRIVER','ODBCWRITEPRIVATEPROFILESTRING','ODBCWRITEFILEDSN','ODBCWRITEDSNTOINI','ODBCVALIDDSN','ODBCUPDATERECORD','ODBCUPDATEBYBOOKMARK',
- 'ODBCUNLOCKRECORD','ODBCUNBINDCOLUMNS','ODBCUNBINDCOL','ODBCTABLESCOUNT','ODBCTABLES','ODBCTABLEPRIVILEGESCOUNT','ODBCTABLEPRIVILEGES','ODBCSUPPORTS',
- 'ODBCSTATTABLESCHEMANAME','ODBCSTATTABLEPAGES','ODBCSTATTABLECATALOGNAME','ODBCSTATTABLECARDINALITY','ODBCSTATISTICSCOUNT','ODBCSTATISTICS','ODBCSTATINDEXSORTSEQUENCE','ODBCSTATINDEXSCHEMANAME',
- 'ODBCSTATINDEXQUALIFIER','ODBCSTATINDEXPAGES','ODBCSTATINDEXFILTERCONDITION','ODBCSTATINDEXCOLUMNORDINALPOSITION','ODBCSTATINDEXCOLUMNNAME','ODBCSTATINDEXCATALOGNAME','ODBCSTATINDEXCARDINALITY','ODBCSTATINDEXALLOWDUPLICATES',
- 'ODBCSPECIALCOLUMNSCOUNT','ODBCSPECIALCOLUMNS','ODBCSETTXNISOLATION','ODBCSETTRANSLATELIB','ODBCSETTRACEFILE','ODBCSETTRACE','ODBCSETSTMTUSEBOOKMARKS','ODBCSETSTMTSIMULATECURSOR',
- 'ODBCSETSTMTROWSTATUSPTR','ODBCSETSTMTROWSFETCHEDPTR','ODBCSETSTMTROWOPERATIONPTR','ODBCSETSTMTROWBINDTYPE','ODBCSETSTMTROWBINDOFFSETPTR','ODBCSETSTMTROWARRAYSIZE','ODBCSETSTMTRETRIEVEDATA','ODBCSETSTMTQUERYTIMEOUT',
- 'ODBCSETSTMTPARAMSTATUSPTR','ODBCSETSTMTPARAMSPROCESSEDPTR','ODBCSETSTMTPARAMSETSIZE','ODBCSETSTMTPARAMOPERATIONPTR','ODBCSETSTMTPARAMBINDTYPE','ODBCSETSTMTPARAMBINDOFFSETPTR','ODBCSETSTMTNOSCAN','ODBCSETSTMTMETADATAID',
- 'ODBCSETSTMTMAXROWS','ODBCSETSTMTMAXLENGTH','ODBCSETSTMTKEYSETSIZE','ODBCSETSTMTFETCHBOOKMARKPTR','ODBCSETSTMTENABLEAUTOIPD','ODBCSETSTMTCURSORTYPE','ODBCSETSTMTCURSORSENSITIVITY','ODBCSETSTMTCURSORSCROLLABLE',
- 'ODBCSETSTMTCONCURRENCY','ODBCSETSTMTATTR','ODBCSETSTMTASYNCENABLE','ODBCSETSTMTAPPROWDESC','ODBCSETSTMTAPPPARAMDESC','ODBCSETSTATICCURSOR','ODBCSETROWVERCONCURRENCY','ODBCSETRESULT',
- 'ODBCSETRELATIVEPOSITION','ODBCSETREADONLYCONCURRENCY','ODBCSETQUIETMODE','ODBCSETPOSITION','ODBCSETPOS','ODBCSETPACKETMODE','ODBCSETOPTIMISTICCONCURRENCY','ODBCSETODBCCURSORS',
- 'ODBCSETMULTIUSERKEYSETCURSOR','ODBCSETMETADATAID','ODBCSETLOGINTIMEOUT','ODBCSETLOCKCONCURRENCY','ODBCSETKEYSETDRIVENCURSOR','ODBCSETFORWARDONLYCURSOR','ODBCSETENVOUTPUTNTS','ODBCSETENVODBCVERSION',
- 'ODBCSETENVCPMATCH','ODBCSETENVCONNECTIONPOOLING','ODBCSETENVATTR','ODBCSETDYNAMICCURSOR','ODBCSETDESCREC','ODBCSETDESCFIELD','ODBCSETCURSORTYPE','ODBCSETCURSORSENSITIVITY',
- 'ODBCSETCURSORSCROLLABILITY','ODBCSETCURSORNAME','ODBCSETCURSORLOCKTYPE','ODBCSETCURSORKEYSETSIZE','ODBCSETCURSORCONCURRENCY','ODBCSETCURRENTCATALOG','ODBCSETCONNECTIONTIMEOUT','ODBCSETCONNECTATTR',
- 'ODBCSETCONFIGMODE','ODBCSETCONCURVALUESCONCURRENCY','ODBCSETAUTOCOMMITON','ODBCSETAUTOCOMMITOFF','ODBCSETAUTOCOMMIT','ODBCSETASYNCENABLE','ODBCSETACCESSMODE','ODBCSETABSOLUTEPOSITION',
- 'ODBCROWCOUNT','ODBCROLLBACKTRAN','ODBCROLLBACKENVTRAN','ODBCROLLBACKDBCTRAN','ODBCRESULT','ODBCRESETPARAMS','ODBCREMOVETRANSLATOR','ODBCREMOVEDSNFROMINI',
- 'ODBCREMOVEDRIVERMANAGER','ODBCREMOVEDRIVER','ODBCREFRESHRECORD','ODBCRECORDCOUNT','ODBCREADFILEDSN','ODBCQUOTEDIDENTIFIERCASE','ODBCPUTDATA','ODBCPROCEDURESCOUNT',
- 'ODBCPROCEDURES','ODBCPROCEDURECOLUMNSCOUNT','ODBCPROCEDURECOLUMNS','ODBCPRIMARYKEYSCOUNT','ODBCPRIMARYKEYS','ODBCPREPARE','ODBCPOSTINSTALLERERROR','ODBCPARAMDATA',
- 'ODBCOPENSTMT','ODBCOPENCONNECTION','ODBCNUMRESULTCOLS','ODBCNUMPARAMS','ODBCNATIVESQL','ODBCMOVEPREVIOUS','ODBCMOVENEXT','ODBCMOVELAST',
- 'ODBCMOVEFIRST','ODBCMOVE','ODBCMORERESULTS','ODBCMANAGEDATASOURCES','ODBCLOCKRECORD','ODBCINSTALLTRANSLATOREX','ODBCINSTALLERERROR','ODBCINSTALLDRIVERMANAGER',
- 'ODBCINSTALLDRIVEREX','ODBCGETXOPENCLIYEAR','ODBCGETUSERNAME','ODBCGETUNION','ODBCGETTYPEINFOCOUNT','ODBCGETTYPEINFO','ODBCGETTXNISOLATIONOPTION','ODBCGETTXNISOLATION',
- 'ODBCGETTXNCAPABLE','ODBCGETTRANSLATOR','ODBCGETTRANSLATELIB','ODBCGETTRACEFILE','ODBCGETTRACE','ODBCGETTIMEDATEFUNCTIONS','ODBCGETTIMEDATEDIFFINTERVALS','ODBCGETTIMEDATEADDINTERVALS',
- 'ODBCGETTABLETERM','ODBCGETSYSTEMFUNCTIONS','ODBCGETSUBQUERIES','ODBCGETSTRINGFUNCTIONS','ODBCGETSTMTUSEBOOKMARKS','ODBCGETSTMTSQLSTATE','ODBCGETSTMTSIMULATECURSOR','ODBCGETSTMTROWSTATUSPTR',
- 'ODBCGETSTMTROWSFETCHEDPTR','ODBCGETSTMTROWOPERATIONPTR','ODBCGETSTMTROWNUMBER','ODBCGETSTMTROWBINDTYPE','ODBCGETSTMTROWBINDOFFSETPTR','ODBCGETSTMTROWARRAYSIZE','ODBCGETSTMTRETRIEVEDATA','ODBCGETSTMTQUERYTIMEOUT',
- 'ODBCGETSTMTPARAMSTATUSPTR','ODBCGETSTMTPARAMSPROCESSEDPTR','ODBCGETSTMTPARAMSETSIZE','ODBCGETSTMTPARAMOPERATIONPTR','ODBCGETSTMTPARAMBINDTYPE','ODBCGETSTMTPARAMBINDOFFSETPTR','ODBCGETSTMTNOSCAN','ODBCGETSTMTMETADATAID',
- 'ODBCGETSTMTMAXROWS','ODBCGETSTMTMAXLENGTH','ODBCGETSTMTKEYSETSIZE','ODBCGETSTMTIMPROWDESC','ODBCGETSTMTIMPPARAMDESC','ODBCGETSTMTFETCHBOOKMARKPTR','ODBCGETSTMTERRORINFO','ODBCGETSTMTENABLEAUTOIPD',
- 'ODBCGETSTMTCURSORTYPE','ODBCGETSTMTCURSORSENSITIVITY','ODBCGETSTMTCURSORSCROLLABLE','ODBCGETSTMTCONCURRENCY','ODBCGETSTMTATTR','ODBCGETSTMTASYNCENABLE','ODBCGETSTMTAPPROWDESC','ODBCGETSTMTAPPPARAMDESC',
- 'ODBCGETSTATICCURSORATTRIBUTES2','ODBCGETSTATICCURSORATTRIBUTES1','ODBCGETSTATEMENTSQLSTATE','ODBCGETSTATEMENTERRORINFO','ODBCGETSTANDARDCLICONFORMANCE','ODBCGETSQLSTATE','ODBCGETSQLCONFORMANCE','ODBCGETSQL92VALUEEXPRESSIONS',
- 'ODBCGETSQL92STRINGFUNCTIONS','ODBCGETSQL92ROWVALUECONSTRUCTOR','ODBCGETSQL92REVOKE','ODBCGETSQL92RELATIONALJOINOPERATORS','ODBCGETSQL92PREDICATES','ODBCGETSQL92NUMERICVALUEFUNCTIONS','ODBCGETSQL92GRANT','ODBCGETSQL92FOREIGNKEYUPDATERULE',
- 'ODBCGETSQL92FOREIGNKEYDELETERULE','ODBCGETSQL92DATETIMEFUNCTIONS','ODBCGETSPECIALCHARACTERS','ODBCGETSERVERNAME','ODBCGETSEARCHPATTERNESCAPE','ODBCGETSCROLLOPTIONS','ODBCGETSCHEMAUSAGE','ODBCGETSCHEMATERM',
- 'ODBCGETROWUPDATES','ODBCGETQUIETMODE','ODBCGETPROCEDURETERM','ODBCGETPROCEDURESSUPPORT','ODBCGETPRIVATEPROFILESTRING','ODBCGETPOSOPERATIONS','ODBCGETPARAMARRAYSELECTS','ODBCGETPARAMARRAYROWCOUNTS',
- 'ODBCGETPACKETMODE','ODBCGETOUTERJOINS','ODBCGETORDERBYCOLUMNSINSELECT','ODBCGETOJCAPABILITIES','ODBCGETODBCVER','ODBCGETODBCINTERFACECONFORMANCE','ODBCGETODBCCURSORS','ODBCGETNUMERICFUNCTIONS',
- 'ODBCGETNULLCOLLATION','ODBCGETNONNULLABLECOLUMNS','ODBCGETNEEDLONGDATALEN','ODBCGETMULTRESULTSETS','ODBCGETMULTIPLEACTIVETXN','ODBCGETMETADATAID','ODBCGETMAXUSERNAMELEN','ODBCGETMAXTABLESINSELECT',
- 'ODBCGETMAXTABLENAMELEN','ODBCGETMAXSTATEMENTLEN','ODBCGETMAXSCHEMANAMELEN','ODBCGETMAXROWSIZEINCLUDESLONG','ODBCGETMAXROWSIZE','ODBCGETMAXPROCEDURENAMELEN','ODBCGETMAXINDEXSIZE','ODBCGETMAXIDENTIFIERLEN',
- 'ODBCGETMAXDRIVERCONNECTIONS','ODBCGETMAXCURSORNAMELEN','ODBCGETMAXCONCURRENTACTIVITIES','ODBCGETMAXCOLUMNSINTABLE','ODBCGETMAXCOLUMNSINSELECT','ODBCGETMAXCOLUMNSINORDERBY','ODBCGETMAXCOLUMNSININDEX','ODBCGETMAXCOLUMNSINGROUPBY',
- 'ODBCGETMAXCOLUMNNAMELEN','ODBCGETMAXCHARLITERALLEN','ODBCGETMAXCATALOGNAMELEN','ODBCGETMAXBINARYLITERALLEN','ODBCGETMAXASYNCCONCURRENTSTATEMENTS','ODBCGETLONGVARCHARDATABYCOLNAME','ODBCGETLONGVARCHARDATA','ODBCGETLOGINTIMEOUT',
- 'ODBCGETLIKEESCAPECLAUSE','ODBCGETKEYWORDS','ODBCGETKEYSETCURSORATTRIBUTES2','ODBCGETKEYSETCURSORATTRIBUTES1','ODBCGETINTEGRITY','ODBCGETINSTALLERERRORMESSAGE','ODBCGETINSTALLERERRORCODE','ODBCGETINSTALLEDDRIVERS',
- 'ODBCGETINSERTSTATEMENT','ODBCGETINFOSTR','ODBCGETINFOSCHEMAVIEWS','ODBCGETINFOLONG','ODBCGETINFOINT','ODBCGETINFO','ODBCGETINDEXKEYWORDS','ODBCGETIMPROWDESCREC',
- 'ODBCGETIMPROWDESCFIELDTYPE','ODBCGETIMPROWDESCFIELDSCALE','ODBCGETIMPROWDESCFIELDPRECISION','ODBCGETIMPROWDESCFIELDOCTETLENGTH','ODBCGETIMPROWDESCFIELDNULLABLE','ODBCGETIMPROWDESCFIELDNAME','ODBCGETIMPROWDESCFIELD','ODBCGETIMPPARAMDESCREC',
- 'ODBCGETIMPPARAMDESCFIELDTYPE','ODBCGETIMPPARAMDESCFIELDSCALE','ODBCGETIMPPARAMDESCFIELDPRECISION','ODBCGETIMPPARAMDESCFIELDOCTETLENGTH','ODBCGETIMPPARAMDESCFIELDNULLABLE','ODBCGETIMPPARAMDESCFIELDNAME','ODBCGETIMPPARAMDESCFIELD','ODBCGETIDENTIFIERQUOTECHAR',
- 'ODBCGETIDENTIFIERCASE','ODBCGETGROUPBY','ODBCGETFUNCTIONS','ODBCGETFORWARDONLYCURSORATTRIBUTES2','ODBCGETFORWARDONLYCURSORATTRIBUTES1','ODBCGETFILEUSAGE','ODBCGETEXPRESSIONSINORDERBY','ODBCGETERRORINFO',
- 'ODBCGETENVSQLSTATE','ODBCGETENVOUTPUTNTS','ODBCGETENVODBCVERSION','ODBCGETENVIRONMENTSQLSTATE','ODBCGETENVIRONMENTERRORINFO','ODBCGETENVERRORINFO','ODBCGETENVCPMATCH','ODBCGETENVCONNECTIONPOOLING',
- 'ODBCGETENVATTR','ODBCGETDYNAMICCURSORATTRIBUTES2','ODBCGETDYNAMICCURSORATTRIBUTES1','ODBCGETDROPVIEW','ODBCGETDROPTRANSLATION','ODBCGETDROPTABLE','ODBCGETDROPSCHEMA','ODBCGETDROPDOMAIN',
- 'ODBCGETDROPCOLLATION','ODBCGETDROPCHARACTERSET','ODBCGETDROPASSERTION','ODBCGETDRIVERVER','ODBCGETDRIVERODBCVER','ODBCGETDRIVERNAME','ODBCGETDRIVERMANAGERINSTALLPATH','ODBCGETDRIVERHLIB',
- 'ODBCGETDRIVERHENV','ODBCGETDRIVERHDBC','ODBCGETDMVERMINOR','ODBCGETDMVERMAJOR','ODBCGETDMVER','ODBCGETDIAGREC','ODBCGETDIAGFIELD','ODBCGETDESCSQLSTATE',
- 'ODBCGETDESCRIPTORSQLSTATE','ODBCGETDESCRIPTORERRORINFO','ODBCGETDESCRIBEPARAMETER','ODBCGETDESCREC','ODBCGETDESCFIELD','ODBCGETDESCERRORINFO','ODBCGETDEFAULTTXNISOLATION','ODBCGETDDLINDEX',
- 'ODBCGETDBMSVER','ODBCGETDBMSNAME','ODBCGETDBCSQLSTATE','ODBCGETDBCERRORINFO','ODBCGETDATETIMELITERALS','ODBCGETDATASTRINGBYCOLNAME','ODBCGETDATASTRING','ODBCGETDATASOURCEREADONLY',
- 'ODBCGETDATASOURCENAME','ODBCGETDATAEXTENSIONS','ODBCGETDATABASENAME','ODBCGETDATA','ODBCGETCURSORTYPE','ODBCGETCURSORSENSITIVITYSUPPORT','ODBCGETCURSORSENSITIVITY','ODBCGETCURSORSCROLLABILITY',
- 'ODBCGETCURSORROLLBACKBEHAVIOR','ODBCGETCURSORNAME','ODBCGETCURSORLOCKTYPE','ODBCGETCURSORKEYSETSIZE','ODBCGETCURSORCONCURRENCY','ODBCGETCURSORCOMMITBEHAVIOR','ODBCGETCURRENTCATALOG','ODBCGETCREATEVIEW',
- 'ODBCGETCREATETRANSLATION','ODBCGETCREATETABLE','ODBCGETCREATESCHEMA','ODBCGETCREATEDOMAIN','ODBCGETCREATECOLLATION','ODBCGETCREATECHARACTERSET','ODBCGETCREATEASSERTION','ODBCGETCORRELATIONNAME',
- 'ODBCGETCONVERTVARCHAR','ODBCGETCONVERTVARBINARY','ODBCGETCONVERTTINYINT','ODBCGETCONVERTTIMESTAMP','ODBCGETCONVERTTIME','ODBCGETCONVERTSMALLINT','ODBCGETCONVERTREAL','ODBCGETCONVERTNUMERIC',
- 'ODBCGETCONVERTLONGVARCHAR','ODBCGETCONVERTLONGVARBINARY','ODBCGETCONVERTINTERVALYEARMONTH','ODBCGETCONVERTINTERVALDAYTIME','ODBCGETCONVERTINTEGER','ODBCGETCONVERTFUNCTIONS','ODBCGETCONVERTFLOAT','ODBCGETCONVERTDOUBLE',
- 'ODBCGETCONVERTDECIMAL','ODBCGETCONVERTDATE','ODBCGETCONVERTCHAR','ODBCGETCONVERTBIT','ODBCGETCONVERTBINARY','ODBCGETCONVERTBIGINT','ODBCGETCONNECTIONTIMEOUT','ODBCGETCONNECTIONSQLSTATE',
- 'ODBCGETCONNECTIONERRORINFO','ODBCGETCONNECTIONDEAD','ODBCGETCONNECTATTR','ODBCGETCONFIGMODE','ODBCGETCONCATNULLBEHAVIOR','ODBCGETCOLUMNALIAS','ODBCGETCOLLATIONSEQ','ODBCGETCATALOGUSAGE',
- 'ODBCGETCATALOGTERM','ODBCGETCATALOGNAMESEPARATOR','ODBCGETCATALOGNAME','ODBCGETCATALOGLOCATION','ODBCGETBOOKMARKPERSISTENCE','ODBCGETBATCHSUPPORT','ODBCGETBATCHROWCOUNT','ODBCGETAUTOIPD',
- 'ODBCGETAUTOCOMMIT','ODBCGETASYNCMODE','ODBCGETASYNCENABLE','ODBCGETALTERTABLE','ODBCGETALTERDOMAIN','ODBCGETAGGREGATEFUNCTIONS','ODBCGETACTIVEENVIRONMENTS','ODBCGETACCESSMODE',
- 'ODBCGETACCESSIBLETABLES','ODBCGETACCESSIBLEPROCEDURES','ODBCFREESTMT','ODBCFREEHANDLE','ODBCFREEENV','ODBCFREEDESC','ODBCFREEDBC','ODBCFREECONNECT',
- 'ODBCFOREIGNKEYSCOUNT','ODBCFOREIGNKEYS','ODBCFETCHSCROLL','ODBCFETCHBYBOOKMARK','ODBCFETCH','ODBCEXTENDEDFETCH','ODBCEXECUTE','ODBCEXECDIRECT',
- 'ODBCERROR','ODBCEOF','ODBCENDTRAN','ODBCDRIVERSCOUNT','ODBCDRIVERS','ODBCDRIVERCONNECT','ODBCDISCONNECT','ODBCDESCRIBEPARAM',
- 'ODBCDESCRIBECOL','ODBCDELETERECORD','ODBCDELETEBYBOOKMARK','ODBCDATASOURCES','ODBCCREATEDATASOURCE','ODBCCOPYDESC','ODBCCONNECTIONISDEAD','ODBCCONNECTIONISALIVE',
- 'ODBCCONNECT','ODBCCONFIGDRIVER','ODBCCONFIGDATASOURCE','ODBCCOMMITTRAN','ODBCCOMMITENVTRAN','ODBCCOMMITDBCTRAN','ODBCCOLUPDATABLE','ODBCCOLUNSIGNED',
- 'ODBCCOLUNNAMED','ODBCCOLUMNSCOUNT','ODBCCOLUMNS','ODBCCOLUMNPRIVILEGESCOUNT','ODBCCOLUMNPRIVILEGES','ODBCCOLUMN','ODBCCOLTYPENAME','ODBCCOLTYPE',
- 'ODBCCOLTABLENAME','ODBCCOLSEARCHABLE','ODBCCOLSCHEMANAME','ODBCCOLSCALE','ODBCCOLPRECISION','ODBCCOLOCTETLENGTH','ODBCCOLNUMPRECRADIX','ODBCCOLNULLABLE',
- 'ODBCCOLNAME','ODBCCOLLOCALTYPENAME','ODBCCOLLITERALSUFFIX','ODBCCOLLITERALPREFIX','ODBCCOLLENGTH','ODBCCOLLABEL','ODBCCOLISNULL','ODBCCOLFIXEDPRECSCALE',
- 'ODBCCOLDISPLAYSIZE','ODBCCOLCOUNT','ODBCCOLCONCISETYPE','ODBCCOLCATALOGNAME','ODBCCOLCASESENSITIVE','ODBCCOLBASETABLENAME','ODBCCOLBASECOLUMNNAME','ODBCCOLAUTOUNIQUEVALUE',
- 'ODBCCOLATTRIBUTE','ODBCCLOSESTMTCURSOR','ODBCCLOSESTMT','ODBCCLOSECURSOR','ODBCCLOSECONNECTION','ODBCCLEARRESULT','ODBCCANCEL','ODBCBULKOPERATIONS',
- 'ODBCBROWSECONNECT','ODBCBINDPARAMETER','ODBCBINDCOLTOWORD','ODBCBINDCOLTOTIMESTAMP','ODBCBINDCOLTOTIME','ODBCBINDCOLTOSTRING','ODBCBINDCOLTOSINGLE','ODBCBINDCOLTOQUAD',
- 'ODBCBINDCOLTONUMERIC','ODBCBINDCOLTOLONG','ODBCBINDCOLTOINTEGER','ODBCBINDCOLTODWORD','ODBCBINDCOLTODOUBLE','ODBCBINDCOLTODECIMAL','ODBCBINDCOLTODATE','ODBCBINDCOLTOCURRENCY',
- 'ODBCBINDCOLTOBYTE','ODBCBINDCOLTOBIT','ODBCBINDCOLTOBINARY','ODBCBINDCOL','ODBCALLOCSTMT','ODBCALLOCHANDLE','ODBCALLOCENV','ODBCALLOCDESC',
- 'ODBCALLOCDBC','ODBCALLOCCONNECT','ODBCADDRECORD','GLVIEWPORT','GLVERTEXPOINTER','GLVERTEX4SV','GLVERTEX4S','GLVERTEX4IV',
- 'GLVERTEX4I','GLVERTEX4FV','GLVERTEX4F','GLVERTEX4DV','GLVERTEX4D','GLVERTEX3SV','GLVERTEX3S','GLVERTEX3IV',
- 'GLVERTEX3I','GLVERTEX3FV','GLVERTEX3F','GLVERTEX3DV','GLVERTEX3D','GLVERTEX2SV','GLVERTEX2S','GLVERTEX2IV',
- 'GLVERTEX2I','GLVERTEX2FV','GLVERTEX2F','GLVERTEX2DV','GLVERTEX2D','GLUUNPROJECT','GLUTESSVERTEX','GLUTESSPROPERTY',
- 'GLUTESSNORMAL','GLUTESSENDPOLYGON','GLUTESSENDCONTOUR','GLUTESSCALLBACK','GLUTESSBEGINPOLYGON','GLUTESSBEGINCONTOUR','GLUSPHERE','GLUSCALEIMAGE',
- 'GLUQUADRICTEXTURE','GLUQUADRICORIENTATION','GLUQUADRICNORMALS','GLUQUADRICDRAWSTYLE','GLUQUADRICCALLBACK','GLUPWLCURVE','GLUPROJECT','GLUPICKMATRIX',
- 'GLUPERSPECTIVE','GLUPARTIALDISK','GLUORTHO2D','GLUNURBSSURFACE','GLUNURBSPROPERTY','GLUNURBSCURVE','GLUNURBSCALLBACK','GLUNEXTCONTOUR',
- 'GLUNEWTESS','GLUNEWQUADRIC','GLUNEWNURBSRENDERER','GLULOOKAT','GLULOADSAMPLINGMATRICES','GLUGETTESSPROPERTY','GLUGETSTRING','GLUGETNURBSPROPERTY',
- 'GLUERRORSTRING','GLUENDTRIM','GLUENDSURFACE','GLUENDPOLYGON','GLUENDCURVE','GLUDISK','GLUDELETETESS','GLUDELETEQUADRIC',
- 'GLUDELETENURBSRENDERER','GLUCYLINDER','GLUBUILD2DMIPMAPS','GLUBUILD1DMIPMAPS','GLUBEGINTRIM','GLUBEGINSURFACE','GLUBEGINPOLYGON','GLUBEGINCURVE',
- 'GLTRANSLATEF','GLTRANSLATED','GLTEXSUBIMAGE2D','GLTEXSUBIMAGE1D','GLTEXPARAMETERIV','GLTEXPARAMETERI','GLTEXPARAMETERFV','GLTEXPARAMETERF',
- 'GLTEXIMAGE2D','GLTEXIMAGE1D','GLTEXGENIV','GLTEXGENI','GLTEXGENFV','GLTEXGENF','GLTEXGENDV','GLTEXGEND',
- 'GLTEXENVIV','GLTEXENVI','GLTEXENVFV','GLTEXENVF','GLTEXCOORDPOINTER','GLTEXCOORD4SV','GLTEXCOORD4S','GLTEXCOORD4IV',
- 'GLTEXCOORD4I','GLTEXCOORD4FV','GLTEXCOORD4F','GLTEXCOORD4DV','GLTEXCOORD4D','GLTEXCOORD3SV','GLTEXCOORD3S','GLTEXCOORD3IV',
- 'GLTEXCOORD3I','GLTEXCOORD3FV','GLTEXCOORD3F','GLTEXCOORD3DV','GLTEXCOORD3D','GLTEXCOORD2SV','GLTEXCOORD2S','GLTEXCOORD2IV',
- 'GLTEXCOORD2I','GLTEXCOORD2FV','GLTEXCOORD2F','GLTEXCOORD2DV','GLTEXCOORD2D','GLTEXCOORD1SV','GLTEXCOORD1S','GLTEXCOORD1IV',
- 'GLTEXCOORD1I','GLTEXCOORD1FV','GLTEXCOORD1F','GLTEXCOORD1DV','GLTEXCOORD1D','GLSTENCILOP','GLSTENCILMASK','GLSTENCILFUNC',
- 'GLSHADEMODEL','GLSELECTBUFFER','GLSCISSOR','GLSCALEF','GLSCALED','GLROTATEF','GLROTATED','GLRENDERMODE',
- 'GLRECTSV','GLRECTS','GLRECTIV','GLRECTI','GLRECTFV','GLRECTF','GLRECTDV','GLRECTD',
- 'GLREADPIXELS','GLREADBUFFER','GLRASTERPOS4SV','GLRASTERPOS4S','GLRASTERPOS4IV','GLRASTERPOS4I','GLRASTERPOS4FV','GLRASTERPOS4F',
- 'GLRASTERPOS4DV','GLRASTERPOS4D','GLRASTERPOS3SV','GLRASTERPOS3S','GLRASTERPOS3IV','GLRASTERPOS3I','GLRASTERPOS3FV','GLRASTERPOS3F',
- 'GLRASTERPOS3DV','GLRASTERPOS3D','GLRASTERPOS2SV','GLRASTERPOS2S','GLRASTERPOS2IV','GLRASTERPOS2I','GLRASTERPOS2FV','GLRASTERPOS2F',
- 'GLRASTERPOS2DV','GLRASTERPOS2D','GLPUSHNAME','GLPUSHMATRIX','GLPUSHCLIENTATTRIB','GLPUSHATTRIB','GLPRIORITIZETEXTURES','GLPOPNAME',
- 'GLPOPMATRIX','GLPOPCLIENTATTRIB','GLPOPATTRIB','GLPOLYGONSTIPPLE','GLPOLYGONOFFSET','GLPOLYGONMODE','GLPOINTSIZE','GLPIXELZOOM',
- 'GLPIXELTRANSFERI','GLPIXELTRANSFERF','GLPIXELSTOREI','GLPIXELSTOREF','GLPIXELMAPUSV','GLPIXELMAPUIV','GLPIXELMAPFV','GLPASSTHROUGH',
- 'GLORTHO','GLNORMALPOINTER','GLNORMAL3SV','GLNORMAL3S','GLNORMAL3IV','GLNORMAL3I','GLNORMAL3FV','GLNORMAL3F',
- 'GLNORMAL3DV','GLNORMAL3D','GLNORMAL3BV','GLNORMAL3B','GLNEWLIST','GLMULTMATRIXF','GLMULTMATRIXD','GLMATRIXMODE',
- 'GLMATERIALIV','GLMATERIALI','GLMATERIALFV','GLMATERIALF','GLMAPGRID2F','GLMAPGRID2D','GLMAPGRID1F','GLMAPGRID1D',
- 'GLMAP2F','GLMAP2D','GLMAP1F','GLMAP1D','GLLOGICOP','GLLOADNAME','GLLOADMATRIXF','GLLOADMATRIXD',
- 'GLLOADIDENTITY','GLLISTBASE','GLLINEWIDTH','GLLINESTIPPLE','GLLIGHTMODELIV','GLLIGHTMODELI','GLLIGHTMODELFV','GLLIGHTMODELF',
- 'GLLIGHTIV','GLLIGHTI','GLLIGHTFV','GLLIGHTF','GLISTEXTURE','GLISLIST','GLISENABLED','GLINTERLEAVEDARRAYS',
- 'GLINITNAMES','GLINDEXUBV','GLINDEXUB','GLINDEXSV','GLINDEXS','GLINDEXPOINTER','GLINDEXMASK','GLINDEXIV',
- 'GLINDEXI','GLINDEXFV','GLINDEXF','GLINDEXDV','GLINDEXD','GLHINT','GLGETTEXPARAMETERIV','GLGETTEXPARAMETERFV',
- 'GLGETTEXLEVELPARAMETERIV','GLGETTEXLEVELPARAMETERFV','GLGETTEXIMAGE','GLGETTEXGENIV','GLGETTEXGENFV','GLGETTEXGENDV','GLGETTEXENVIV','GLGETTEXENVFV',
- 'GLGETSTRING','GLGETPOLYGONSTIPPLE','GLGETPOINTERV','GLGETPIXELMAPUSV','GLGETPIXELMAPUIV','GLGETPIXELMAPFV','GLGETMATERIALIV','GLGETMATERIALFV',
- 'GLGETMAPIV','GLGETMAPFV','GLGETMAPDV','GLGETLIGHTIV','GLGETLIGHTFV','GLGETINTEGERV','GLGETFLOATV','GLGETERROR',
- 'GLGETDOUBLEV','GLGETCLIPPLANE','GLGETBOOLEANV','GLGENTEXTURES','GLGENLISTS','GLFRUSTUM','GLFRONTFACE','GLFOGIV',
- 'GLFOGI','GLFOGFV','GLFOGF','GLFLUSH','GLFINISH','GLFEEDBACKBUFFER','GLEVALPOINT2','GLEVALPOINT1',
- 'GLEVALMESH2','GLEVALMESH1','GLEVALCOORD2FV','GLEVALCOORD2F','GLEVALCOORD2DV','GLEVALCOORD2D','GLEVALCOORD1FV','GLEVALCOORD1F',
- 'GLEVALCOORD1DV','GLEVALCOORD1D','GLENDLIST','GLEND','GLENABLECLIENTSTATE','GLENABLE','GLEDGEFLAGV','GLEDGEFLAGPOINTER',
- 'GLEDGEFLAG','GLDRAWPIXELS','GLDRAWELEMENTS','GLDRAWBUFFER','GLDRAWARRAYS','GLDISABLECLIENTSTATE','GLDISABLE','GLDEPTHRANGE',
- 'GLDEPTHMASK','GLDEPTHFUNC','GLDELETETEXTURES','GLDELETELISTS','GLCULLFACE','GLCOPYTEXSUBIMAGE2D','GLCOPYTEXSUBIMAGE1D','GLCOPYTEXIMAGE2D',
- 'GLCOPYTEXIMAGE1D','GLCOPYPIXELS','GLCOLORPOINTER','GLCOLORMATERIAL','GLCOLORMASK','GLCOLOR4USV','GLCOLOR4US','GLCOLOR4UIV',
- 'GLCOLOR4UI','GLCOLOR4UBV','GLCOLOR4UB','GLCOLOR4SV','GLCOLOR4S','GLCOLOR4IV','GLCOLOR4I','GLCOLOR4FV',
- 'GLCOLOR4F','GLCOLOR4DV','GLCOLOR4D','GLCOLOR4BV','GLCOLOR4B','GLCOLOR3USV','GLCOLOR3US','GLCOLOR3UIV',
- 'GLCOLOR3UI','GLCOLOR3UBV','GLCOLOR3UB','GLCOLOR3SV','GLCOLOR3S','GLCOLOR3IV','GLCOLOR3I','GLCOLOR3FV',
- 'GLCOLOR3F','GLCOLOR3DV','GLCOLOR3D','GLCOLOR3BV','GLCOLOR3B','GLCLIPPLANE','GLCLEARSTENCIL','GLCLEARINDEX',
- 'GLCLEARDEPTH','GLCLEARCOLOR','GLCLEARACCUM','GLCLEAR','GLCALLLISTS','GLCALLLIST','GLBLENDFUNC','GLBITMAP',
- 'GLBINDTEXTURE','GLBEGIN','GLARRAYELEMENT','GLARETEXTURESRESIDENT','GLALPHAFUNC','GLACCUM'),
- 2 => array(
- '$BEL','$BS','$CR','$CRLF','$DQ','$DT_DATE_SEPARATOR','$DT_LANGUAGE','$DT_TIME_SEPARATOR',
- '$ESC','$FF','$LF','$NUL','$PC_SD_MY_PC','$SPC','$SQL_OPT_TRACE_FILE_DEFAULT','$SQL_SPEC_STRING',
- '$TAB','$TRACKBAR_CLASS','$VT','%ACM_OPEN','%ACM_OPENW','%ACM_PLAY','%ACM_STOP','%ACN_START',
- '%ACN_STOP','%ACS_AUTOPLAY','%ACS_CENTER','%ACS_TIMER','%ACS_TRANSPARENT','%APP_COUNTER_FUNLOOKUP','%APP_COUNTER_KEYLOOKUP','%APP_COUNTER_LOOKUP',
- '%APP_COUNTER_TESTALPHA','%APP_COUNTER_UDTLOOKUP','%APP_COUNTER_VARLOOKUP','%APP_TIMER_EXECTOTAL','%APP_TIMER_INIT','%APP_TIMER_LOAD','%APP_TIMER_PREPROCESSOR','%AW_ACTIVATE',
- '%AW_BLEND','%AW_CENTER','%AW_HIDE','%AW_HOR_NEGATIVE','%AW_HOR_POSITIVE','%AW_SLIDE','%AW_VER_NEGATIVE','%AW_VER_POSITIVE',
- '%BCM_FIRST','%BLACK','%BLUE','%BM_GETCHECK','%BM_SETCHECK','%BST_CHECKED','%BST_UNCHECKED','%BS_AUTOCHECKBOX',
- '%BS_BOTTOM','%BS_CENTER','%BS_DEFAULT','%BS_DEFPUSHBUTTON','%BS_FLAT','%BS_LEFT','%BS_LEFTTEXT','%BS_MULTILINE',
- '%BS_NOTIFY','%BS_OWNERDRAW','%BS_PUSHLIKE','%BS_RIGHT','%BS_TOP','%BS_VCENTER','%BUNDLE_BUILDER_CANCELLED','%CBM_FIRST',
- '%CBN_CLOSEUP','%CBN_DBLCLK','%CBN_DROPDOWN','%CBN_EDITCHANGE','%CBN_EDITUPDATE','%CBN_ERRSPACE','%CBN_KILLFOCUS','%CBN_SELCANCEL',
- '%CBN_SELCHANGE','%CBN_SELENDCANCEL','%CBN_SELENDOK','%CBN_SETFOCUS','%CBS_AUTOHSCROLL','%CBS_DISABLENOSCROLL','%CBS_DROPDOWN','%CBS_DROPDOWNLIST',
- '%CBS_HASSTRINGS','%CBS_LOWERCASE','%CBS_NOINTEGRALHEIGHT','%CBS_SIMPLE','%CBS_SORT','%CBS_UPPERCASE','%CB_SELECTSTRING','%CCM_FIRST',
- '%CC_ANYCOLOR','%CC_ENABLEHOOK','%CC_ENABLETEMPLATE','%CC_ENABLETEMPLATEHANDLE','%CC_FULLOPEN','%CC_PREVENTFULLOPEN','%CC_RGBINIT','%CC_SHOWHELP',
- '%CC_SOLIDCOLOR','%CFE_BOLD','%CFE_ITALIC','%CFE_LINK','%CFE_PROTECTED','%CFE_STRIKEOUT','%CFE_UNDERLINE','%CFM_ANIMATION',
- '%CFM_BACKCOLOR','%CFM_BOLD','%CFM_CHARSET','%CFM_COLOR','%CFM_FACE','%CFM_ITALIC','%CFM_KERNING','%CFM_LCID',
- '%CFM_LINK','%CFM_OFFSET','%CFM_PROTECTED','%CFM_REVAUTHOR','%CFM_SIZE','%CFM_SPACING','%CFM_STRIKEOUT','%CFM_STYLE',
- '%CFM_UNDERLINE','%CFM_UNDERLINETYPE','%CFM_WEIGHT','%CGI_ACCEPT_FILE_UPLOAD','%CGI_AUTO_ADD_SPECIAL_CHARS_PREFIX','%CGI_AUTO_CREATE_VARS','%CGI_BUFFERIZE_OUTPUT','%CGI_DOUBLE_QUOTE',
- '%CGI_FILE_UPLOAD_BASEPATH','%CGI_FORCE_SESSION_VALIDATION','%CGI_MAX_BYTE_FROM_STD_IN','%CGI_REQUEST_METHOD_GET','%CGI_REQUEST_METHOD_POST','%CGI_SESSION_FILE_BASEPATH','%CGI_SINGLE_QUOTE','%CGI_SPECIAL_CHARS_PREFIX',
- '%CGI_TEMPORARY_UPLOAD_PATH','%CGI_UPLOAD_CAN_OVERWRITE','%CGI_WRITE_LOG_FILE','%CGI_WRITE_VARS_INTO_LOG_FILE','%CONOLE_ATTACH_PARENT_PROCESS','%CONSOLE_BACKGROUND_BLUE','%CONSOLE_BACKGROUND_GREEN','%CONSOLE_BACKGROUND_INTENSITY',
- '%CONSOLE_BACKGROUND_RED','%CONSOLE_BOX_FLAG_3DOFF','%CONSOLE_BOX_FLAG_3DON','%CONSOLE_BOX_FLAG_SHADOW','%CONSOLE_COMMON_LVB_GRID_HORIZONTAL','%CONSOLE_COMMON_LVB_GRID_LVERTICAL','%CONSOLE_COMMON_LVB_GRID_RVERTICAL','%CONSOLE_COMMON_LVB_LEADING_BYTE',
- '%CONSOLE_COMMON_LVB_REVERSE_VIDEO','%CONSOLE_COMMON_LVB_TRAILING_BYTE','%CONSOLE_COMMON_LVB_UNDERSCORE','%CONSOLE_CTRL_BREAK_EVENT','%CONSOLE_CTRL_C_EVENT','%CONSOLE_DOUBLE_CLICK','%CONSOLE_ENABLE_AUTO_POSITION','%CONSOLE_ENABLE_ECHO_INPUT',
- '%CONSOLE_ENABLE_EXTENDED_FLAGS','%CONSOLE_ENABLE_INSERT_MODE','%CONSOLE_ENABLE_LINE_INPUT','%CONSOLE_ENABLE_MOUSE_INPUT','%CONSOLE_ENABLE_PROCESSED_INPUT','%CONSOLE_ENABLE_PROCESSED_OUTPUT','%CONSOLE_ENABLE_QUICK_EDIT_MODE','%CONSOLE_ENABLE_WINDOW_INPUT',
- '%CONSOLE_ENABLE_WRAP_AT_EOL_OUTPUT','%CONSOLE_FOREGROUND_BLUE','%CONSOLE_FOREGROUND_GREEN','%CONSOLE_FOREGROUND_INTENSITY','%CONSOLE_FOREGROUND_RED','%CONSOLE_LBUTTON','%CONSOLE_LINE_HORIZONTAL','%CONSOLE_LINE_VERTICAL',
- '%CONSOLE_MBUTTON','%CONSOLE_MOUSE_MOVED','%CONSOLE_MOUSE_WHEELED','%CONSOLE_RBUTTON','%CONSOLE_SCROLLBUF_DOWN','%CONSOLE_SCROLLBUF_UP','%CONSOLE_SCROLLWND_ABSOLUTE','%CONSOLE_SCROLLWND_RELATIVE',
- '%CONSOLE_STD_ERROR_HANDLE','%CONSOLE_STD_INPUT_HANDLE','%CONSOLE_STD_OUTPUT_HANDLE','%CONSOLE_SW_FORCEMINIMIZE','%CONSOLE_SW_HIDE','%CONSOLE_SW_MAXIMIZE','%CONSOLE_SW_MINIMIZE','%CONSOLE_SW_RESTORE',
- '%CONSOLE_SW_SHOW','%CONSOLE_SW_SHOWDEFAULT','%CONSOLE_SW_SHOWMAXIMIZED','%CONSOLE_SW_SHOWMINIMIZED','%CONSOLE_SW_SHOWMINNOACTIVE','%CONSOLE_SW_SHOWNA','%CONSOLE_SW_SHOWNOACTIVATE','%CONSOLE_SW_SHOWNORMAL',
- '%CONSOLE_UNAVAILABLE','%CRYPTO_CALG_DES','%CRYPTO_CALG_RC2','%CRYPTO_CALG_RC4','%CRYPTO_PROV_DH_SCHANNEL','%CRYPTO_PROV_DSS','%CRYPTO_PROV_DSS_DH','%CRYPTO_PROV_FORTEZZA',
- '%CRYPTO_PROV_MS_EXCHANGE','%CRYPTO_PROV_RSA_FULL','%CRYPTO_PROV_RSA_SCHANNEL','%CRYPTO_PROV_RSA_SIG','%CRYPTO_PROV_SSL','%CSIDL_ADMINTOOLS','%CSIDL_ALTSTARTUP','%CSIDL_APPDATA',
- '%CSIDL_BITBUCKET','%CSIDL_CDBURN_AREA','%CSIDL_COMMON_ADMINTOOLS','%CSIDL_COMMON_ALTSTARTUP','%CSIDL_COMMON_APPDATA','%CSIDL_COMMON_DESKTOPDIRECTORY','%CSIDL_COMMON_DOCUMENTS','%CSIDL_COMMON_FAVORITES',
- '%CSIDL_COMMON_MUSIC','%CSIDL_COMMON_PICTURES','%CSIDL_COMMON_PROGRAMS','%CSIDL_COMMON_STARTMENU','%CSIDL_COMMON_STARTUP','%CSIDL_COMMON_TEMPLATES','%CSIDL_COMMON_VIDEO','%CSIDL_CONTROLS',
- '%CSIDL_COOKIES','%CSIDL_DESKTOP','%CSIDL_DESKTOPDIRECTORY','%CSIDL_DRIVES','%CSIDL_FAVORITES','%CSIDL_FLAG_CREATE','%CSIDL_FONTS','%CSIDL_HISTORY',
- '%CSIDL_INTERNET','%CSIDL_INTERNET_CACHE','%CSIDL_LOCAL_APPDATA','%CSIDL_MYDOCUMENTS','%CSIDL_MYMUSIC','%CSIDL_MYPICTURES','%CSIDL_MYVIDEO','%CSIDL_NETHOOD',
- '%CSIDL_NETWORK','%CSIDL_PERSONAL','%CSIDL_PRINTERS','%CSIDL_PRINTHOOD','%CSIDL_PROFILE','%CSIDL_PROGRAMS','%CSIDL_PROGRAM_FILES','%CSIDL_PROGRAM_FILES_COMMON',
- '%CSIDL_RECENT','%CSIDL_SENDTO','%CSIDL_STARTMENU','%CSIDL_STARTUP','%CSIDL_SYSTEM','%CSIDL_TEMPLATES','%CSIDL_WINDOWS','%CW_USEDEFAULT',
- '%CYAN','%DATE_TIME_FILE_CREATION','%DATE_TIME_LAST_FILE_ACCESS','%DATE_TIME_LAST_FILE_WRITE','%DICTIONARY_MEMINFO_DATA','%DICTIONARY_MEMINFO_KEYS','%DICTIONARY_MEMINFO_TOTAL','%DICTIONARY_SORTDESCENDING',
- '%DICTIONARY_SORTKEYS','%DSCAPS_CERTIFIED','%DSCAPS_CONTINUOUSRATE','%DSCAPS_EMULDRIVER','%DSCAPS_SECONDARY16BIT','%DSCAPS_SECONDARY8BIT','%DSCAPS_SECONDARYMONO','%DSCAPS_SECONDARYSTEREO',
- '%DSCCAPS_CERTIFIED','%DSCCAPS_EMULDRIVER','%DS_3DLOOK','%DS_ABSALIGN','%DS_CENTER','%DS_CENTERMOUSE','%DS_CONTEXTHELP','%DS_CONTROL',
- '%DS_MODALFRAME','%DS_NOFAILCREATE','%DS_SETFONT','%DS_SETFOREGROUND','%DS_SYSMODAL','%DTM_FIRST','%DTM_GETMCCOLOR','%DTM_GETMCFONT',
- '%DTM_GETMONTHCAL','%DTM_GETRANGE','%DTM_GETSYSTEMTIME','%DTM_SETFORMAT','%DTM_SETFORMATW','%DTM_SETMCCOLOR','%DTM_SETMCFONT','%DTM_SETRANGE',
- '%DTM_SETSYSTEMTIME','%DTN_CLOSEUP','%DTN_DATETIMECHANGE','%DTN_DROPDOWN','%DTN_FORMAT','%DTN_FORMATQUERY','%DTN_FORMATQUERYW','%DTN_FORMATW',
- '%DTN_USERSTRING','%DTN_USERSTRINGW','%DTN_WMKEYDOWN','%DTN_WMKEYDOWNW','%DTS_APPCANPARSE','%DTS_LONGDATEFORMAT','%DTS_RIGHTALIGN','%DTS_SHORTDATECENTURYFORMAT',
- '%DTS_SHORTDATEFORMAT','%DTS_SHOWNONE','%DTS_TIMEFORMAT','%DTS_UPDOWN','%DT_DATE_CENTURY','%DT_DATE_OK','%DT_DAY_IN_YEAR','%DT_DIFF_IN_DAYS',
- '%DT_DIFF_IN_HOURS','%DT_DIFF_IN_MINUTES','%DT_DIFF_IN_SECONDS','%DT_HOURS_IN_DAY','%DT_MINUTES_IN_HOUR','%DT_SECONDS_IN_DAY','%DT_SECONDS_IN_HOUR','%DT_SECONDS_IN_MINUTE',
- '%DT_SECONDS_IN_YEAR','%DT_USE_LONG_FORM','%DT_USE_SHORT_FORM','%DT_WRONG_DATE','%DT_WRONG_DAY','%DT_WRONG_MONTH','%ECM_FIRST','%ECOOP_AND',
- '%ECOOP_OR','%ECOOP_SET','%ECOOP_XOR','%ECO_AUTOHSCROLL','%ECO_AUTOVSCROLL','%ECO_AUTOWORDSELECTION','%ECO_NOHIDESEL','%ECO_READONLY',
- '%ECO_SELECTIONBAR','%ECO_WANTRETURN','%EM_AUTOURLDETECT','%EM_CANPASTE','%EM_CANREDO','%EM_CANUNDO','%EM_CHARFROMPOS','%EM_DISPLAYBAND',
- '%EM_EMPTYUNDOBUFFER','%EM_EXGETSEL','%EM_EXLIMITTEXT','%EM_EXLINEFROMCHAR','%EM_EXSETSEL','%EM_FINDTEXT','%EM_FINDTEXTEX','%EM_FINDWORDBREAK',
- '%EM_FMTLINES','%EM_FORMATRANGE','%EM_GETAUTOURLDETECT','%EM_GETCHARFORMAT','%EM_GETEDITSTYLE','%EM_GETEVENTMASK','%EM_GETFIRSTVISIBLELINE','%EM_GETHANDLE',
- '%EM_GETIMESTATUS','%EM_GETLIMITTEXT','%EM_GETLINE','%EM_GETLINECOUNT','%EM_GETMARGINS','%EM_GETMODIFY','%EM_GETOLEINTERFACE','%EM_GETOPTIONS',
- '%EM_GETPARAFORMAT','%EM_GETPASSWORDCHAR','%EM_GETRECT','%EM_GETREDONAME','%EM_GETSCROLLPOS','%EM_GETSEL','%EM_GETSELTEXT','%EM_GETTEXTMODE',
- '%EM_GETTEXTRANGE','%EM_GETTHUMB','%EM_GETUNDONAME','%EM_GETWORDBREAKPROC','%EM_GETWORDBREAKPROCEX','%EM_HIDESELECTION','%EM_LIMITTEXT','%EM_LINEFROMCHAR',
- '%EM_LINEINDEX','%EM_LINELENGTH','%EM_LINESCROLL','%EM_PASTESPECIAL','%EM_POSFROMCHAR','%EM_REDO','%EM_REPLACESEL','%EM_REQUESTRESIZE',
- '%EM_SCROLL','%EM_SCROLLCARET','%EM_SELECTIONTYPE','%EM_SETBKGNDCOLOR','%EM_SETCHARFORMAT','%EM_SETEDITSTYLE','%EM_SETEVENTMASK','%EM_SETHANDLE',
- '%EM_SETIMESTATUS','%EM_SETLIMITTEXT','%EM_SETMARGINS','%EM_SETMODIFY','%EM_SETOLECALLBACK','%EM_SETOPTIONS','%EM_SETPARAFORMAT','%EM_SETPASSWORDCHAR',
- '%EM_SETREADONLY','%EM_SETRECT','%EM_SETRECTNP','%EM_SETSCROLLPOS','%EM_SETSEL','%EM_SETTABSTOPS','%EM_SETTARGETDEVICE','%EM_SETTEXTMODE',
- '%EM_SETUNDOLIMIT','%EM_SETWORDBREAKPROC','%EM_SETWORDBREAKPROCEX','%EM_SETWORDWRAPMODE','%EM_SETZOOM','%EM_STOPGROUPTYPING','%EM_STREAMIN','%EM_STREAMOUT',
- '%EM_UNDO','%ENM_CHANGE','%ENM_CORRECTTEXT','%ENM_DRAGDROPDONE','%ENM_DROPFILES','%ENM_KEYEVENTS','%ENM_MOUSEEVENTS','%ENM_NONE',
- '%ENM_PARAGRAPHEXPANDED','%ENM_PROTECTED','%ENM_REQUESTRESIZE','%ENM_SCROLL','%ENM_SCROLLEVENTS','%ENM_SELCHANGE','%ENM_UPDATE','%EN_CHANGE',
- '%EN_MSGFILTER','%EN_SELCHANGE','%EN_UPDATE','%ES_AUTOHSCROLL','%ES_AUTOVSCROLL','%ES_CENTER','%ES_DISABLENOSCROLL','%ES_EX_NOCALLOLEINIT',
- '%ES_LEFT','%ES_LOWERCASE','%ES_MULTILINE','%ES_NOHIDESEL','%ES_NOOLEDRAGDROP','%ES_NUMBER','%ES_OEMCONVERT','%ES_PASSWORD',
- '%ES_READONLY','%ES_RIGHT','%ES_SAVESEL','%ES_SELECTIONBAR','%ES_SUNKEN','%ES_UPPERCASE','%ES_WANTRETURN','%EVAL_EXEC_STRING',
- '%FALSE','%FILE_ADDPATH','%FILE_ARCHIVE','%FILE_BUILDVERSION','%FILE_HIDDEN','%FILE_MAJORVERSION','%FILE_MINORVERSION','%FILE_NORMAL',
- '%FILE_READONLY','%FILE_REVISIONVERSION','%FILE_SUBDIR','%FILE_SYSTEM','%FILE_VLABEL','%FTP_GET_CONNECT_STATUS','%FTP_GET_FILE_BYTES_RCVD','%FTP_GET_FILE_BYTES_SENT',
- '%FTP_GET_LAST_RESPONSE','%FTP_GET_LOCAL_IP','%FTP_GET_SERVER_IP','%FTP_GET_TOTAL_BYTES_RCVD','%FTP_GET_TOTAL_BYTES_SENT','%FTP_LIST_FULLLIST','%FTP_LIST_FULLLISTDIR','%FTP_LIST_FULLLISTFILE',
- '%FTP_SET_ASYNC','%FTP_SET_CONNECT_WAIT','%FTP_SET_MAX_LISTEN_WAIT','%FTP_SET_MAX_RESPONSE_WAIT','%FTP_SET_PASSIVE','%FTP_SET_SYNC','%FW_BLACK','%FW_BOLD',
- '%FW_DEMIBOLD','%FW_DONTCARE','%FW_EXTRABOLD','%FW_EXTRALIGHT','%FW_HEAVY','%FW_LIGHT','%FW_MEDIUM','%FW_NORMAL',
- '%FW_REGULAR','%FW_SEMIBOLD','%FW_THIN','%FW_ULTRABOLD','%FW_ULTRALIGHT','%GDTR_MAX','%GDTR_MIN','%GLU_AUTO_LOAD_MATRIX',
- '%GLU_BEGIN','%GLU_CCW','%GLU_CULLING','%GLU_CW','%GLU_DISPLAY_MODE','%GLU_DOMAIN_DISTANCE','%GLU_EDGE_FLAG','%GLU_END',
- '%GLU_ERROR','%GLU_EXTENSIONS','%GLU_EXTERIOR','%GLU_FALSE','%GLU_FILL','%GLU_FLAT','%GLU_INCOMPATIBLE_GL_VERSION','%GLU_INSIDE',
- '%GLU_INTERIOR','%GLU_INVALID_ENUM','%GLU_INVALID_VALUE','%GLU_LINE','%GLU_MAP1_TRIM_2','%GLU_MAP1_TRIM_3','%GLU_NONE','%GLU_NURBS_ERROR1',
- '%GLU_NURBS_ERROR10','%GLU_NURBS_ERROR11','%GLU_NURBS_ERROR12','%GLU_NURBS_ERROR13','%GLU_NURBS_ERROR14','%GLU_NURBS_ERROR15','%GLU_NURBS_ERROR16','%GLU_NURBS_ERROR17',
- '%GLU_NURBS_ERROR18','%GLU_NURBS_ERROR19','%GLU_NURBS_ERROR2','%GLU_NURBS_ERROR20','%GLU_NURBS_ERROR21','%GLU_NURBS_ERROR22','%GLU_NURBS_ERROR23','%GLU_NURBS_ERROR24',
- '%GLU_NURBS_ERROR25','%GLU_NURBS_ERROR26','%GLU_NURBS_ERROR27','%GLU_NURBS_ERROR28','%GLU_NURBS_ERROR29','%GLU_NURBS_ERROR3','%GLU_NURBS_ERROR30','%GLU_NURBS_ERROR31',
- '%GLU_NURBS_ERROR32','%GLU_NURBS_ERROR33','%GLU_NURBS_ERROR34','%GLU_NURBS_ERROR35','%GLU_NURBS_ERROR36','%GLU_NURBS_ERROR37','%GLU_NURBS_ERROR4','%GLU_NURBS_ERROR5',
- '%GLU_NURBS_ERROR6','%GLU_NURBS_ERROR7','%GLU_NURBS_ERROR8','%GLU_NURBS_ERROR9','%GLU_OUTLINE_PATCH','%GLU_OUTLINE_POLYGON','%GLU_OUTSIDE','%GLU_OUT_OF_MEMORY',
- '%GLU_PARAMETRIC_ERROR','%GLU_PARAMETRIC_TOLERANCE','%GLU_PATH_LENGTH','%GLU_POINT','%GLU_SAMPLING_METHOD','%GLU_SAMPLING_TOLERANCE','%GLU_SILHOUETTE','%GLU_SMOOTH',
- '%GLU_TESS_BEGIN','%GLU_TESS_BEGIN_DATA','%GLU_TESS_BOUNDARY_ONLY','%GLU_TESS_COMBINE','%GLU_TESS_COMBINE_DATA','%GLU_TESS_COORD_TOO_LARGE','%GLU_TESS_EDGE_FLAG','%GLU_TESS_EDGE_FLAG_DATA',
- '%GLU_TESS_END','%GLU_TESS_END_DATA','%GLU_TESS_ERROR','%GLU_TESS_ERROR1','%GLU_TESS_ERROR2','%GLU_TESS_ERROR3','%GLU_TESS_ERROR4','%GLU_TESS_ERROR5',
- '%GLU_TESS_ERROR6','%GLU_TESS_ERROR7','%GLU_TESS_ERROR8','%GLU_TESS_ERROR_DATA','%GLU_TESS_MISSING_BEGIN_CONTOUR','%GLU_TESS_MISSING_BEGIN_POLYGON','%GLU_TESS_MISSING_END_CONTOUR','%GLU_TESS_MISSING_END_POLYGON',
- '%GLU_TESS_NEED_COMBINE_CALLBACK','%GLU_TESS_TOLERANCE','%GLU_TESS_VERTEX','%GLU_TESS_VERTEX_DATA','%GLU_TESS_WINDING_ABS_GEQ_TWO','%GLU_TESS_WINDING_NEGATIVE','%GLU_TESS_WINDING_NONZERO','%GLU_TESS_WINDING_ODD',
- '%GLU_TESS_WINDING_POSITIVE','%GLU_TESS_WINDING_RULE','%GLU_TRUE','%GLU_UNKNOWN','%GLU_U_STEP','%GLU_VERSION','%GLU_VERSION_1_1','%GLU_VERSION_1_2',
- '%GLU_VERTEX','%GLU_V_STEP','%GL_2D','%GL_2_BYTES','%GL_3D','%GL_3D_COLOR','%GL_3D_COLOR_TEXTURE','%GL_3_BYTES',
- '%GL_4D_COLOR_TEXTURE','%GL_4_BYTES','%GL_ABGR_EXT','%GL_ACCUM','%GL_ACCUM_ALPHA_BITS','%GL_ACCUM_BLUE_BITS','%GL_ACCUM_BUFFER_BIT','%GL_ACCUM_CLEAR_VALUE',
- '%GL_ACCUM_GREEN_BITS','%GL_ACCUM_RED_BITS','%GL_ADD','%GL_ALL_ATTRIB_BITS','%GL_ALPHA','%GL_ALPHA12','%GL_ALPHA16','%GL_ALPHA4',
- '%GL_ALPHA8','%GL_ALPHA_BIAS','%GL_ALPHA_BITS','%GL_ALPHA_SCALE','%GL_ALPHA_TEST','%GL_ALPHA_TEST_FUNC','%GL_ALPHA_TEST_REF','%GL_ALWAYS',
- '%GL_AMBIENT','%GL_AMBIENT_AND_DIFFUSE','%GL_AND','%GL_AND_INVERTED','%GL_AND_REVERSE','%GL_ARRAY_ELEMENT_LOCK_COUNT_EXT','%GL_ARRAY_ELEMENT_LOCK_FIRST_EXT','%GL_ATTRIB_STACK_DEPTH',
- '%GL_AUTO_NORMAL','%GL_AUX0','%GL_AUX1','%GL_AUX2','%GL_AUX3','%GL_AUX_BUFFERS','%GL_BACK','%GL_BACK_LEFT',
- '%GL_BACK_RIGHT','%GL_BGRA_EXT','%GL_BGR_EXT','%GL_BITMAP','%GL_BITMAP_TOKEN','%GL_BLEND','%GL_BLEND_COLOR_EXT','%GL_BLEND_DST',
- '%GL_BLEND_EQUATION_EXT','%GL_BLEND_SRC','%GL_BLUE','%GL_BLUE_BIAS','%GL_BLUE_BITS','%GL_BLUE_SCALE','%GL_BYTE','%GL_C3F_V3F',
- '%GL_C4F_N3F_V3F','%GL_C4UB_V2F','%GL_C4UB_V3F','%GL_CCW','%GL_CLAMP','%GL_CLEAR','%GL_CLIENT_ALL_ATTRIB_BITS','%GL_CLIENT_ATTRIB_STACK_DEPTH',
- '%GL_CLIENT_PIXEL_STORE_BIT','%GL_CLIENT_VERTEX_ARRAY_BIT','%GL_CLIP_PLANE0','%GL_CLIP_PLANE1','%GL_CLIP_PLANE2','%GL_CLIP_PLANE3','%GL_CLIP_PLANE4','%GL_CLIP_PLANE5',
- '%GL_CLIP_VOLUME_CLIPPING_HINT_EXT','%GL_COEFF','%GL_COLOR','%GL_COLOR_ARRAY','%GL_COLOR_ARRAY_COUNT_EXT','%GL_COLOR_ARRAY_EXT','%GL_COLOR_ARRAY_POINTER','%GL_COLOR_ARRAY_POINTER_EXT',
- '%GL_COLOR_ARRAY_SIZE','%GL_COLOR_ARRAY_SIZE_EXT','%GL_COLOR_ARRAY_STRIDE','%GL_COLOR_ARRAY_STRIDE_EXT','%GL_COLOR_ARRAY_TYPE','%GL_COLOR_ARRAY_TYPE_EXT','%GL_COLOR_BUFFER_BIT','%GL_COLOR_CLEAR_VALUE',
- '%GL_COLOR_INDEX','%GL_COLOR_INDEX12_EXT','%GL_COLOR_INDEX16_EXT','%GL_COLOR_INDEX1_EXT','%GL_COLOR_INDEX2_EXT','%GL_COLOR_INDEX4_EXT','%GL_COLOR_INDEX8_EXT','%GL_COLOR_INDEXES',
- '%GL_COLOR_LOGIC_OP','%GL_COLOR_MATERIAL','%GL_COLOR_MATERIAL_FACE','%GL_COLOR_MATERIAL_PARAMETER','%GL_COLOR_SUM_EXT','%GL_COLOR_TABLE_ALPHA_SIZE_EXT','%GL_COLOR_TABLE_BIAS_EXT','%GL_COLOR_TABLE_BLUE_SIZE_EXT',
- '%GL_COLOR_TABLE_EXT','%GL_COLOR_TABLE_FORMAT_EXT','%GL_COLOR_TABLE_GREEN_SIZE_EXT','%GL_COLOR_TABLE_INTENSITY_SIZE_EXT','%GL_COLOR_TABLE_LUMINANCE_SIZE_EXT','%GL_COLOR_TABLE_RED_SIZE_EXT','%GL_COLOR_TABLE_SCALE_EXT','%GL_COLOR_TABLE_WIDTH_EXT',
- '%GL_COLOR_WRITEMASK','%GL_COMPILE','%GL_COMPILE_AND_EXECUTE','%GL_CONSTANT_ALPHA_EXT','%GL_CONSTANT_ATTENUATION','%GL_CONSTANT_COLOR_EXT','%GL_CONVOLUTION_1D_EXT','%GL_CONVOLUTION_2D_EXT',
- '%GL_CONVOLUTION_BORDER_MODE_EXT','%GL_CONVOLUTION_FILTER_BIAS_EXT','%GL_CONVOLUTION_FILTER_SCALE_EXT','%GL_CONVOLUTION_FORMAT_EXT','%GL_CONVOLUTION_HEIGHT_EXT','%GL_CONVOLUTION_WIDTH_EXT','%GL_COPY','%GL_COPY_INVERTED',
- '%GL_COPY_PIXEL_TOKEN','%GL_CULL_FACE','%GL_CULL_FACE_MODE','%GL_CULL_VERTEX_EXT','%GL_CULL_VERTEX_EYE_POSITION_EXT','%GL_CULL_VERTEX_OBJECT_POSITION_EXT','%GL_CURRENT_BIT','%GL_CURRENT_COLOR',
- '%GL_CURRENT_INDEX','%GL_CURRENT_NORMAL','%GL_CURRENT_RASTER_COLOR','%GL_CURRENT_RASTER_DISTANCE','%GL_CURRENT_RASTER_INDEX','%GL_CURRENT_RASTER_POSITION','%GL_CURRENT_RASTER_POSITION_VALID','%GL_CURRENT_RASTER_TEXTURE_COORDS',
- '%GL_CURRENT_SECONDARY_COLOR_EXT','%GL_CURRENT_TEXTURE_COORDS','%GL_CW','%GL_DECAL','%GL_DECR','%GL_DEPTH','%GL_DEPTH_BIAS','%GL_DEPTH_BITS',
- '%GL_DEPTH_BUFFER_BIT','%GL_DEPTH_CLEAR_VALUE','%GL_DEPTH_COMPONENT','%GL_DEPTH_FUNC','%GL_DEPTH_RANGE','%GL_DEPTH_SCALE','%GL_DEPTH_TEST','%GL_DEPTH_WRITEMASK',
- '%GL_DIFFUSE','%GL_DITHER','%GL_DOMAIN','%GL_DONT_CARE','%GL_DOUBLE','%GL_DOUBLEBUFFER','%GL_DOUBLE_EXT','%GL_DRAW_BUFFER',
- '%GL_DRAW_PIXEL_TOKEN','%GL_DST_ALPHA','%GL_DST_COLOR','%GL_EDGE_FLAG','%GL_EDGE_FLAG_ARRAY','%GL_EDGE_FLAG_ARRAY_COUNT_EXT','%GL_EDGE_FLAG_ARRAY_EXT','%GL_EDGE_FLAG_ARRAY_POINTER',
- '%GL_EDGE_FLAG_ARRAY_POINTER_EXT','%GL_EDGE_FLAG_ARRAY_STRIDE','%GL_EDGE_FLAG_ARRAY_STRIDE_EXT','%GL_EMISSION','%GL_ENABLE_BIT','%GL_EQUAL','%GL_EQUIV','%GL_EVAL_BIT',
- '%GL_EXP','%GL_EXP2','%GL_EXTENSIONS','%GL_EXT_ABGR','%GL_EXT_BGRA','%GL_EXT_BLEND_COLOR','%GL_EXT_BLEND_MINMAX','%GL_EXT_BLEND_SUBTRACT',
- '%GL_EXT_CLIP_VOLUME_HINT','%GL_EXT_COLOR_TABLE','%GL_EXT_COMPILED_VERTEX_ARRAY','%GL_EXT_CONVOLUTION','%GL_EXT_CULL_VERTEX','%GL_EXT_HISTOGRAM','%GL_EXT_PACKED_PIXELS','%GL_EXT_PALETTED_TEXTURE',
- '%GL_EXT_POLYGON_OFFSET','%GL_EXT_SECONDARY_COLOR','%GL_EXT_SEPARATE_SPECULAR_COLOR','%GL_EXT_VERTEX_ARRAY','%GL_EYE_LINEAR','%GL_EYE_PLANE','%GL_FALSE','%GL_FASTEST',
- '%GL_FEEDBACK','%GL_FEEDBACK_BUFFER_POINTER','%GL_FEEDBACK_BUFFER_SIZE','%GL_FEEDBACK_BUFFER_TYPE','%GL_FILL','%GL_FLAT','%GL_FLOAT','%GL_FOG',
- '%GL_FOG_BIT','%GL_FOG_COLOR','%GL_FOG_DENSITY','%GL_FOG_END','%GL_FOG_HINT','%GL_FOG_INDEX','%GL_FOG_MODE','%GL_FOG_START',
- '%GL_FRONT','%GL_FRONT_AND_BACK','%GL_FRONT_FACE','%GL_FRONT_LEFT','%GL_FRONT_RIGHT','%GL_FUNC_ADD_EXT','%GL_FUNC_REVERSE_SUBTRACT_EXT','%GL_FUNC_SUBTRACT_EXT',
- '%GL_GEQUAL','%GL_GREATER','%GL_GREEN','%GL_GREEN_BIAS','%GL_GREEN_BITS','%GL_GREEN_SCALE','%GL_HINT_BIT','%GL_HISTOGRAM_ALPHA_SIZE_EXT',
- '%GL_HISTOGRAM_BLUE_SIZE_EXT','%GL_HISTOGRAM_EXT','%GL_HISTOGRAM_FORMAT_EXT','%GL_HISTOGRAM_GREEN_SIZE_EXT','%GL_HISTOGRAM_LUMINANCE_SIZE_EXT','%GL_HISTOGRAM_RED_SIZE_EXT','%GL_HISTOGRAM_SINK_EXT','%GL_HISTOGRAM_WIDTH_EXT',
- '%GL_INCR','%GL_INDEX_ARRAY','%GL_INDEX_ARRAY_COUNT_EXT','%GL_INDEX_ARRAY_EXT','%GL_INDEX_ARRAY_POINTER','%GL_INDEX_ARRAY_POINTER_EXT','%GL_INDEX_ARRAY_STRIDE','%GL_INDEX_ARRAY_STRIDE_EXT',
- '%GL_INDEX_ARRAY_TYPE','%GL_INDEX_ARRAY_TYPE_EXT','%GL_INDEX_BITS','%GL_INDEX_CLEAR_VALUE','%GL_INDEX_LOGIC_OP','%GL_INDEX_MODE','%GL_INDEX_OFFSET','%GL_INDEX_SHIFT',
- '%GL_INDEX_WRITEMASK','%GL_INT','%GL_INTENSITY','%GL_INTENSITY12','%GL_INTENSITY16','%GL_INTENSITY4','%GL_INTENSITY8','%GL_INVALID_ENUM',
- '%GL_INVALID_OPERATION','%GL_INVALID_VALUE','%GL_INVERT','%GL_KEEP','%GL_LEFT','%GL_LEQUAL','%GL_LESS','%GL_LIGHT0',
- '%GL_LIGHT1','%GL_LIGHT2','%GL_LIGHT3','%GL_LIGHT4','%GL_LIGHT5','%GL_LIGHT6','%GL_LIGHT7','%GL_LIGHTING',
- '%GL_LIGHTING_BIT','%GL_LIGHT_MODEL_AMBIENT','%GL_LIGHT_MODEL_COLOR_CONTROL_EXT','%GL_LIGHT_MODEL_LOCAL_VIEWER','%GL_LIGHT_MODEL_TWO_SIDE','%GL_LINE','%GL_LINEAR','%GL_LINEAR_ATTENUATION',
- '%GL_LINEAR_MIPMAP_LINEAR','%GL_LINEAR_MIPMAP_NEAREST','%GL_LINES','%GL_LINE_BIT','%GL_LINE_LOOP','%GL_LINE_RESET_TOKEN','%GL_LINE_SMOOTH','%GL_LINE_SMOOTH_HINT',
- '%GL_LINE_STIPPLE','%GL_LINE_STIPPLE_PATTERN','%GL_LINE_STIPPLE_REPEAT','%GL_LINE_STRIP','%GL_LINE_TOKEN','%GL_LINE_WIDTH','%GL_LINE_WIDTH_GRANULARITY','%GL_LINE_WIDTH_RANGE',
- '%GL_LIST_BASE','%GL_LIST_BIT','%GL_LIST_INDEX','%GL_LIST_MODE','%GL_LOAD','%GL_LOGIC_OP','%GL_LOGIC_OP_MODE','%GL_LUMINANCE',
- '%GL_LUMINANCE12','%GL_LUMINANCE12_ALPHA12','%GL_LUMINANCE12_ALPHA4','%GL_LUMINANCE16','%GL_LUMINANCE16_ALPHA16','%GL_LUMINANCE4','%GL_LUMINANCE4_ALPHA4','%GL_LUMINANCE6_ALPHA2',
- '%GL_LUMINANCE8','%GL_LUMINANCE8_ALPHA8','%GL_LUMINANCE_ALPHA','%GL_MAP1_COLOR_4','%GL_MAP1_GRID_DOMAIN','%GL_MAP1_GRID_SEGMENTS','%GL_MAP1_INDEX','%GL_MAP1_NORMAL',
- '%GL_MAP1_TEXTURE_COORD_1','%GL_MAP1_TEXTURE_COORD_2','%GL_MAP1_TEXTURE_COORD_3','%GL_MAP1_TEXTURE_COORD_4','%GL_MAP1_VERTEX_3','%GL_MAP1_VERTEX_4','%GL_MAP2_COLOR_4','%GL_MAP2_GRID_DOMAIN',
- '%GL_MAP2_GRID_SEGMENTS','%GL_MAP2_INDEX','%GL_MAP2_NORMAL','%GL_MAP2_TEXTURE_COORD_1','%GL_MAP2_TEXTURE_COORD_2','%GL_MAP2_TEXTURE_COORD_3','%GL_MAP2_TEXTURE_COORD_4','%GL_MAP2_VERTEX_3',
- '%GL_MAP2_VERTEX_4','%GL_MAP_COLOR','%GL_MAP_STENCIL','%GL_MATRIX_MODE','%GL_MAX_ATTRIB_STACK_DEPTH','%GL_MAX_CLIENT_ATTRIB_STACK_DEPTH','%GL_MAX_CLIP_PLANES','%GL_MAX_CONVOLUTION_HEIGHT_EXT',
- '%GL_MAX_CONVOLUTION_WIDTH_EXT','%GL_MAX_EVAL_ORDER','%GL_MAX_EXT','%GL_MAX_LIGHTS','%GL_MAX_LIST_NESTING','%GL_MAX_MODELVIEW_STACK_DEPTH','%GL_MAX_NAME_STACK_DEPTH','%GL_MAX_PIXEL_MAP_TABLE',
- '%GL_MAX_PROJECTION_STACK_DEPTH','%GL_MAX_TEXTURE_SIZE','%GL_MAX_TEXTURE_STACK_DEPTH','%GL_MAX_VIEWPORT_DIMS','%GL_MINMAX_EXT','%GL_MINMAX_FORMAT_EXT','%GL_MINMAX_SINK_EXT','%GL_MIN_EXT',
- '%GL_MODELVIEW','%GL_MODELVIEW_MATRIX','%GL_MODELVIEW_STACK_DEPTH','%GL_MODULATE','%GL_MULT','%GL_N3F_V3F','%GL_NAME_STACK_DEPTH','%GL_NAND',
- '%GL_NEAREST','%GL_NEAREST_MIPMAP_LINEAR','%GL_NEAREST_MIPMAP_NEAREST','%GL_NEVER','%GL_NICEST','%GL_NONE','%GL_NOOP','%GL_NOR',
- '%GL_NORMALIZE','%GL_NORMAL_ARRAY','%GL_NORMAL_ARRAY_COUNT_EXT','%GL_NORMAL_ARRAY_EXT','%GL_NORMAL_ARRAY_POINTER','%GL_NORMAL_ARRAY_POINTER_EXT','%GL_NORMAL_ARRAY_STRIDE','%GL_NORMAL_ARRAY_STRIDE_EXT',
- '%GL_NORMAL_ARRAY_TYPE','%GL_NORMAL_ARRAY_TYPE_EXT','%GL_NOTEQUAL','%GL_NO_ERROR','%GL_OBJECT_LINEAR','%GL_OBJECT_PLANE','%GL_ONE','%GL_ONE_MINUS_CONSTANT_ALPHA_EXT',
- '%GL_ONE_MINUS_CONSTANT_COLOR_EXT','%GL_ONE_MINUS_DST_ALPHA','%GL_ONE_MINUS_DST_COLOR','%GL_ONE_MINUS_SRC_ALPHA','%GL_ONE_MINUS_SRC_COLOR','%GL_OR','%GL_ORDER','%GL_OR_INVERTED',
- '%GL_OR_REVERSE','%GL_OUT_OF_MEMORY','%GL_PACK_ALIGNMENT','%GL_PACK_LSB_FIRST','%GL_PACK_ROW_LENGTH','%GL_PACK_SKIP_PIXELS','%GL_PACK_SKIP_ROWS','%GL_PACK_SWAP_BYTES',
- '%GL_PASS_THROUGH_TOKEN','%GL_PERSPECTIVE_CORRECTION_HINT','%GL_PIXEL_MAP_A_TO_A','%GL_PIXEL_MAP_A_TO_A_SIZE','%GL_PIXEL_MAP_B_TO_B','%GL_PIXEL_MAP_B_TO_B_SIZE','%GL_PIXEL_MAP_G_TO_G','%GL_PIXEL_MAP_G_TO_G_SIZE',
- '%GL_PIXEL_MAP_I_TO_A','%GL_PIXEL_MAP_I_TO_A_SIZE','%GL_PIXEL_MAP_I_TO_B','%GL_PIXEL_MAP_I_TO_B_SIZE','%GL_PIXEL_MAP_I_TO_G','%GL_PIXEL_MAP_I_TO_G_SIZE','%GL_PIXEL_MAP_I_TO_I','%GL_PIXEL_MAP_I_TO_I_SIZE',
- '%GL_PIXEL_MAP_I_TO_R','%GL_PIXEL_MAP_I_TO_R_SIZE','%GL_PIXEL_MAP_R_TO_R','%GL_PIXEL_MAP_R_TO_R_SIZE','%GL_PIXEL_MAP_S_TO_S','%GL_PIXEL_MAP_S_TO_S_SIZE','%GL_PIXEL_MODE_BIT','%GL_POINT',
- '%GL_POINTS','%GL_POINT_BIT','%GL_POINT_SIZE','%GL_POINT_SIZE_GRANULARITY','%GL_POINT_SIZE_RANGE','%GL_POINT_SMOOTH','%GL_POINT_SMOOTH_HINT','%GL_POINT_TOKEN',
- '%GL_POLYGON','%GL_POLYGON_BIT','%GL_POLYGON_MODE','%GL_POLYGON_OFFSET_BIAS_EXT','%GL_POLYGON_OFFSET_EXT','%GL_POLYGON_OFFSET_FACTOR','%GL_POLYGON_OFFSET_FACTOR_EXT','%GL_POLYGON_OFFSET_FILL',
- '%GL_POLYGON_OFFSET_LINE','%GL_POLYGON_OFFSET_POINT','%GL_POLYGON_OFFSET_UNITS','%GL_POLYGON_SMOOTH','%GL_POLYGON_SMOOTH_HINT','%GL_POLYGON_STIPPLE','%GL_POLYGON_STIPPLE_BIT','%GL_POLYGON_TOKEN',
- '%GL_POSITION','%GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT','%GL_POST_CONVOLUTION_ALPHA_BIAS_EXT','%GL_POST_CONVOLUTION_ALPHA_SCALE_EXT','%GL_POST_CONVOLUTION_BLUE_BIAS_EXT','%GL_POST_CONVOLUTION_BLUE_SCALE_EXT','%GL_POST_CONVOLUTION_COLOR_TABLE_EXT','%GL_POST_CONVOLUTION_GREEN_BIAS_EXT',
- '%GL_POST_CONVOLUTION_GREEN_SCALE_EXT','%GL_POST_CONVOLUTION_RED_BIAS_EXT','%GL_POST_CONVOLUTION_RED_SCALE_EXT','%GL_PROJECTION','%GL_PROJECTION_MATRIX','%GL_PROJECTION_STACK_DEPTH','%GL_PROXY_COLOR_TABLE_EXT','%GL_PROXY_HISTOGRAM_EXT',
- '%GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_EXT','%GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_EXT','%GL_PROXY_TEXTURE_1D','%GL_PROXY_TEXTURE_2D','%GL_Q','%GL_QUADRATIC_ATTENUATION','%GL_QUADS','%GL_QUAD_STRIP',
- '%GL_R','%GL_R3_G3_B2','%GL_READ_BUFFER','%GL_RED','%GL_REDUCE_EXT','%GL_RED_BIAS','%GL_RED_BITS','%GL_RED_SCALE',
- '%GL_RENDER','%GL_RENDERER','%GL_RENDER_MODE','%GL_REPEAT','%GL_REPLACE','%GL_RETURN','%GL_RGB','%GL_RGB10',
- '%GL_RGB10_A2','%GL_RGB12','%GL_RGB16','%GL_RGB4','%GL_RGB5','%GL_RGB5_A1','%GL_RGB8','%GL_RGBA',
- '%GL_RGBA12','%GL_RGBA16','%GL_RGBA2','%GL_RGBA4','%GL_RGBA8','%GL_RGBA_MODE','%GL_RIGHT','%GL_S',
- '%GL_SCISSOR_BIT','%GL_SCISSOR_BOX','%GL_SCISSOR_TEST','%GL_SECONDARY_COLOR_ARRAY_EXT','%GL_SECONDARY_COLOR_ARRAY_POINTER_EXT','%GL_SECONDARY_COLOR_ARRAY_SIZE_EXT','%GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT','%GL_SECONDARY_COLOR_ARRAY_TYPE_EXT',
- '%GL_SELECT','%GL_SELECTION_BUFFER_POINTER','%GL_SELECTION_BUFFER_SIZE','%GL_SEPARABLE_2D_EXT','%GL_SEPARATE_SPECULAR_COLOR_EXT','%GL_SET','%GL_SHADE_MODEL','%GL_SHININESS',
- '%GL_SHORT','%GL_SINGLE_COLOR_EXT','%GL_SMOOTH','%GL_SPECULAR','%GL_SPHERE_MAP','%GL_SPOT_CUTOFF','%GL_SPOT_DIRECTION','%GL_SPOT_EXPONENT',
- '%GL_SRC_ALPHA','%GL_SRC_ALPHA_SATURATE','%GL_SRC_COLOR','%GL_STACK_OVERFLOW','%GL_STACK_UNDERFLOW','%GL_STENCIL','%GL_STENCIL_BITS','%GL_STENCIL_BUFFER_BIT',
- '%GL_STENCIL_CLEAR_VALUE','%GL_STENCIL_FAIL','%GL_STENCIL_FUNC','%GL_STENCIL_INDEX','%GL_STENCIL_PASS_DEPTH_FAIL','%GL_STENCIL_PASS_DEPTH_PASS','%GL_STENCIL_REF','%GL_STENCIL_TEST',
- '%GL_STENCIL_VALUE_MASK','%GL_STENCIL_WRITEMASK','%GL_STEREO','%GL_SUBPIXEL_BITS','%GL_T','%GL_T2F_C3F_V3F','%GL_T2F_C4F_N3F_V3F','%GL_T2F_C4UB_V3F',
- '%GL_T2F_N3F_V3F','%GL_T2F_V3F','%GL_T4F_C4F_N3F_V4F','%GL_T4F_V4F','%GL_TABLE_TOO_LARGE_EXT','%GL_TEXTURE','%GL_TEXTURE_1D','%GL_TEXTURE_2D',
- '%GL_TEXTURE_ALPHA_SIZE','%GL_TEXTURE_BINDING_1D','%GL_TEXTURE_BINDING_2D','%GL_TEXTURE_BIT','%GL_TEXTURE_BLUE_SIZE','%GL_TEXTURE_BORDER','%GL_TEXTURE_BORDER_COLOR','%GL_TEXTURE_COMPONENTS',
- '%GL_TEXTURE_COORD_ARRAY','%GL_TEXTURE_COORD_ARRAY_COUNT_EXT','%GL_TEXTURE_COORD_ARRAY_EXT','%GL_TEXTURE_COORD_ARRAY_POINTER','%GL_TEXTURE_COORD_ARRAY_POINTER_EXT','%GL_TEXTURE_COORD_ARRAY_SIZE','%GL_TEXTURE_COORD_ARRAY_SIZE_EXT','%GL_TEXTURE_COORD_ARRAY_STRIDE',
- '%GL_TEXTURE_COORD_ARRAY_STRIDE_EXT','%GL_TEXTURE_COORD_ARRAY_TYPE','%GL_TEXTURE_COORD_ARRAY_TYPE_EXT','%GL_TEXTURE_ENV','%GL_TEXTURE_ENV_COLOR','%GL_TEXTURE_ENV_MODE','%GL_TEXTURE_GEN_MODE','%GL_TEXTURE_GEN_Q',
- '%GL_TEXTURE_GEN_R','%GL_TEXTURE_GEN_S','%GL_TEXTURE_GEN_T','%GL_TEXTURE_GREEN_SIZE','%GL_TEXTURE_HEIGHT','%GL_TEXTURE_INTENSITY_SIZE','%GL_TEXTURE_INTERNAL_FORMAT','%GL_TEXTURE_LUMINANCE_SIZE',
- '%GL_TEXTURE_MAG_FILTER','%GL_TEXTURE_MATRIX','%GL_TEXTURE_MIN_FILTER','%GL_TEXTURE_PRIORITY','%GL_TEXTURE_RED_SIZE','%GL_TEXTURE_RESIDENT','%GL_TEXTURE_STACK_DEPTH','%GL_TEXTURE_WIDTH',
- '%GL_TEXTURE_WRAP_S','%GL_TEXTURE_WRAP_T','%GL_TRANSFORM_BIT','%GL_TRIANGLES','%GL_TRIANGLE_FAN','%GL_TRIANGLE_STRIP','%GL_TRUE','%GL_UNPACK_ALIGNMENT',
- '%GL_UNPACK_LSB_FIRST','%GL_UNPACK_ROW_LENGTH','%GL_UNPACK_SKIP_PIXELS','%GL_UNPACK_SKIP_ROWS','%GL_UNPACK_SWAP_BYTES','%GL_UNSIGNED_BYTE','%GL_UNSIGNED_BYTE_3_3_2_EXT','%GL_UNSIGNED_INT',
- '%GL_UNSIGNED_INT_10_10_10_2_EXT','%GL_UNSIGNED_INT_8_8_8_8_EXT','%GL_UNSIGNED_SHORT','%GL_UNSIGNED_SHORT_4_4_4_4_EXT','%GL_UNSIGNED_SHORT_5_5_5_1_EXT','%GL_V2F','%GL_V3F','%GL_VENDOR',
- '%GL_VERSION','%GL_VERSION_1_1','%GL_VERTEX_ARRAY','%GL_VERTEX_ARRAY_COUNT_EXT','%GL_VERTEX_ARRAY_EXT','%GL_VERTEX_ARRAY_POINTER','%GL_VERTEX_ARRAY_POINTER_EXT','%GL_VERTEX_ARRAY_SIZE',
- '%GL_VERTEX_ARRAY_SIZE_EXT','%GL_VERTEX_ARRAY_STRIDE','%GL_VERTEX_ARRAY_STRIDE_EXT','%GL_VERTEX_ARRAY_TYPE','%GL_VERTEX_ARRAY_TYPE_EXT','%GL_VIEWPORT','%GL_VIEWPORT_BIT','%GL_WIN_SWAP_HINT',
- '%GL_XOR','%GL_ZERO','%GL_ZOOM_X','%GL_ZOOM_Y','%GRAY','%GREEN','%GWLP_HINSTANCE','%GWLP_HWNDPARENT',
- '%GWLP_ID','%GWLP_USERDATA','%GWLP_WNDPROC','%GWL_EXSTYLE','%GWL_HINSTANCE','%GWL_HWNDPARENT','%GWL_ID','%GWL_STYLE',
- '%GWL_USERDATA','%GWL_WNDPROC','%HDM_FIRST','%HTCAPTION','%HWND_BOTTOM','%HWND_DESKTOP','%HWND_MESSAGE','%HWND_NOTOPMOST',
- '%HWND_TOP','%HWND_TOPMOST','%ICRYPTO_XOR_DECREASE','%ICRYPTO_XOR_INCREASE','%ICRYPTO_XOR_NORMAL','%IDABORT','%IDCANCEL','%IDCONTINUE',
- '%IDIGNORE','%IDNO','%IDOK','%IDRETRY','%IDTIMEOUT','%IDTRYAGAIN','%IDYES','%INTERNET_CONNECTION_CONFIGURED',
- '%INTERNET_CONNECTION_LAN','%INTERNET_CONNECTION_MODEM','%INTERNET_CONNECTION_MODEM_BUSY','%INTERNET_CONNECTION_OFFLINE','%INTERNET_CONNECTION_PROXY','%INTERNET_RAS_INSTALLED','%LBN_DBLCLK','%LBN_KILLFOCUS',
- '%LBN_SELCANCEL','%LBN_SELCHANGE','%LBN_SETFOCUS','%LBS_DISABLENOSCROLL','%LBS_EXTENDEDSEL','%LBS_MULTICOLUMN','%LBS_MULTIPLESEL','%LBS_NOINTEGRALHEIGHT',
- '%LBS_NOSEL','%LBS_NOTIFY','%LBS_SORT','%LBS_STANDARD','%LBS_USETABSTOPS','%LB_ADDFILE','%LB_ADDSTRING','%LB_DELETESTRING',
- '%LB_DIR','%LB_FINDSTRING','%LB_FINDSTRINGEXACT','%LB_GETANCHORINDEX','%LB_GETCARETINDEX','%LB_GETCOUNT','%LB_GETCURSEL','%LB_GETHORIZONTALEXTENT',
- '%LB_GETITEMDATA','%LB_GETITEMHEIGHT','%LB_GETITEMRECT','%LB_GETLISTBOXINFO','%LB_GETLOCALE','%LB_GETSEL','%LB_GETSELCOUNT','%LB_GETSELITEMS',
- '%LB_GETTEXT','%LB_GETTEXTLEN','%LB_GETTOPINDEX','%LB_INITSTORAGE','%LB_INSERTSTRING','%LB_ITEMFROMPOINT','%LB_MULTIPLEADDSTRING','%LB_RESETCONTENT',
- '%LB_SELECTSTRING','%LB_SELITEMRANGE','%LB_SELITEMRANGEEX','%LB_SETANCHORINDEX','%LB_SETCARETINDEX','%LB_SETCOLUMNWIDTH','%LB_SETCOUNT','%LB_SETCURSEL',
- '%LB_SETHORIZONTALEXTENT','%LB_SETITEMDATA','%LB_SETITEMHEIGHT','%LB_SETLOCALE','%LB_SETSEL','%LB_SETTABSTOPS','%LB_SETTOPINDEX','%LF_FACESIZE',
- '%LTGRAY','%LVM_FIRST','%LWA_ALPHA','%LWA_COLORKEY','%MAGENTA','%MAXBYTE','%MAXCHAR','%MAXDWORD',
- '%MAXSHORT','%MAXWORD','%MAX_PATH','%MB_ABORTRETRYIGNORE','%MB_APPLMODAL','%MB_CANCELTRYCONTINUE','%MB_DEFBUTTON1','%MB_DEFBUTTON2',
- '%MB_DEFBUTTON3','%MB_HELP','%MB_ICONASTERISK','%MB_ICONERROR','%MB_ICONEXCLAMATION','%MB_ICONHAND','%MB_ICONINFORMATION','%MB_ICONQUESTION',
- '%MB_ICONSTOP','%MB_ICONWARNING','%MB_OK','%MB_OKCANCEL','%MB_RETRYCANCEL','%MB_SIMPLE','%MB_SYSTEMMODAL','%MB_TOPMOST',
- '%MB_YESNO','%MB_YESNOCANCEL','%MF_CHECKED','%MF_DISABLED','%MF_ENABLED','%MF_GRAYED','%MF_SEPARATOR','%MF_UNCHECKED',
- '%MINCHAR','%MINLONG','%MINSHORT','%NULL','%ODBC352_INC','%ODBCVER','%ODBC_ADD_DSN','%ODBC_ADD_SYS_DSN',
- '%ODBC_BOTH_DSN','%ODBC_CONFIG_DRIVER','%ODBC_CONFIG_DRIVER_MAX','%ODBC_CONFIG_DSN','%ODBC_CONFIG_SYS_DSN','%ODBC_DRIVER_VERSION','%ODBC_ERROR_COMPONENT_NOT_FOUND','%ODBC_ERROR_CREATE_DSN_FAILED',
- '%ODBC_ERROR_GENERAL_ERR','%ODBC_ERROR_INVALID_BUFF_LEN','%ODBC_ERROR_INVALID_DSN','%ODBC_ERROR_INVALID_HWND','%ODBC_ERROR_INVALID_INF','%ODBC_ERROR_INVALID_KEYWORD_VALUE','%ODBC_ERROR_INVALID_LOG_FILE','%ODBC_ERROR_INVALID_NAME',
- '%ODBC_ERROR_INVALID_PARAM_SEQUENCE','%ODBC_ERROR_INVALID_PATH','%ODBC_ERROR_INVALID_REQUEST_TYPE','%ODBC_ERROR_INVALID_STR','%ODBC_ERROR_LOAD_LIB_FAILED','%ODBC_ERROR_OUTPUT_STRING_TRUNCATED','%ODBC_ERROR_OUT_OF_MEM','%ODBC_ERROR_REMOVE_DSN_FAILED',
- '%ODBC_ERROR_REQUEST_FAILED','%ODBC_ERROR_USAGE_UPDATE_FAILED','%ODBC_ERROR_USER_CANCELED','%ODBC_ERROR_WRITING_SYSINFO_FAILED','%ODBC_INSTALL_COMPLETE','%ODBC_INSTALL_DRIVER','%ODBC_INSTALL_INQUIRY','%ODBC_REMOVE_DEFAULT_DSN',
- '%ODBC_REMOVE_DRIVER','%ODBC_REMOVE_DSN','%ODBC_REMOVE_SYS_DSN','%ODBC_SYSTEM_DSN','%ODBC_USER_DSN','%OFN_ALLOWMULTISELECT','%OFN_CREATEPROMPT','%OFN_ENABLEHOOK',
- '%OFN_ENABLEINCLUDENOTIFY','%OFN_ENABLESIZING','%OFN_ENABLETEMPLATE','%OFN_ENABLETEMPLATEHANDLE','%OFN_EXPLORER','%OFN_EXTENSIONDIFFERENT','%OFN_FILEMUSTEXIST','%OFN_HIDEREADONLY',
- '%OFN_LONGNAMES','%OFN_NOCHANGEDIR','%OFN_NODEREFERENCELINKS','%OFN_NOLONGNAMES','%OFN_NONETWORKBUTTON','%OFN_NOREADONLYRETURN','%OFN_NOTESTFILECREATE','%OFN_NOVALIDATE',
- '%OFN_OVERWRITEPROMPT','%OFN_PATHMUSTEXIST','%OFN_READONLY','%OFN_SHAREAWARE','%OFN_SHOWHELP','%OS_ERROR_CALLFUNCTION','%OS_ERROR_EMPTYSTRING','%OS_ERROR_LOADLIBRARY',
- '%OS_ERROR_SUCCESS','%OS_ERROR_WRONGPARAMETER','%OS_SHELL_ASYNC','%OS_SHELL_SYNC','%OS_WINDOWS_2K','%OS_WINDOWS_95','%OS_WINDOWS_95_OSR2','%OS_WINDOWS_98',
- '%OS_WINDOWS_98_SE','%OS_WINDOWS_ME','%OS_WINDOWS_NT','%OS_WINDOWS_SERVER_2003','%OS_WINDOWS_SERVER_LONGHORN','%OS_WINDOWS_SERVER_LONGHORN_DC','%OS_WINDOWS_VISTA','%OS_WINDOWS_XP',
- '%OS_WNDSTYLE_HIDE','%OS_WNDSTYLE_MAXIMIZED','%OS_WNDSTYLE_MINIMIZED','%OS_WNDSTYLE_MINIMIZEDNOFOCUS','%OS_WNDSTYLE_NORMAL','%OS_WNDSTYLE_NORMALNOFOCUS','%PATH_EXT','%PATH_FILE',
- '%PATH_FILEEXT','%PATH_ROOT','%PATH_ROOTPATH','%PATH_ROOTPATHPROG','%PATH_ROOTPATHPROGEXT','%PBM_DELTAPOS','%PBM_GETPOS','%PBM_GETRANGE',
- '%PBM_SETBARCOLOR','%PBM_SETBKCOLOR','%PBM_SETPOS','%PBM_SETRANGE','%PBM_SETRANGE32','%PBM_SETSTEP','%PBM_STEPIT','%PBS_SMOOTH',
- '%PBS_VERTICAL','%PC_DISABLEWAKEEVENT_OFF','%PC_DISABLEWAKEEVENT_ON','%PC_EB_NOCONFIRMATION','%PC_EB_NOPROGRESSUI','%PC_EB_NORMAL','%PC_EB_NOSOUND','%PC_FORCECRITICAL_OFF',
- '%PC_FORCECRITICAL_ON','%PC_HIBERNATE_OFF','%PC_HIBERNATE_ON','%PC_RD_FORCE','%PC_RD_FORCEIFHUNG','%PC_RD_LOGOFF','%PC_RD_POWEROFF','%PC_RD_REBOOT',
- '%PC_RD_SHUTDOWN','%PC_SD_DONOT_FORCE','%PC_SD_DONOT_REBOOT','%PC_SD_FORCE','%PC_SD_REBOOT','%PFA_CENTER','%PFA_LEFT','%PFA_RIGHT',
- '%PF_3DNOW_INSTRUCTIONS_AVAILABLE','%PF_CHANNELS_ENABLED','%PF_COMPARE64_EXCHANGE128','%PF_COMPARE_EXCHANGE128','%PF_COMPARE_EXCHANGE_DOUBLE','%PF_FLOATING_POINT_EMULATED','%PF_FLOATING_POINT_PRECISION_ERRATA','%PF_MMX_INSTRUCTIONS_AVAILABLE',
- '%PF_NX_ENABLED','%PF_PAE_ENABLED','%PF_RDTSC_INSTRUCTION_AVAILABLE','%PF_SSE3_INSTRUCTIONS_AVAILABLE','%PF_XMMI64_INSTRUCTIONS_AVAILABLE','%PF_XMMI_INSTRUCTIONS_AVAILABLE','%PGM_FIRST','%RED',
- '%RTF_UBB','%SAPI_SVSFDEFAULT','%SAPI_SVSFISFILENAME','%SAPI_SVSFISNOTXML','%SAPI_SVSFISXML','%SAPI_SVSFLAGSASYNC','%SAPI_SVSFNLPMASK','%SAPI_SVSFNLPSPEAKPUNC',
- '%SAPI_SVSFPERSISTXML','%SAPI_SVSFPURGEBEFORESPEAK','%SAPI_SVSFUNUSEDFLAGS','%SAPI_SVSFVOICEMASK','%SBS_SIZEGRIP','%SB_BOTTOM','%SB_ENDSCROLL','%SB_LEFT',
- '%SB_LINEDOWN','%SB_LINELEFT','%SB_LINERIGHT','%SB_LINEUP','%SB_PAGEDOWN','%SB_PAGELEFT','%SB_PAGERIGHT','%SB_PAGEUP',
- '%SB_RIGHT','%SB_SETPARTS','%SB_SETTEXT','%SB_THUMBPOSITION','%SB_THUMBTRACK','%SB_TOP','%SCF_ALL','%SCF_ASSOCIATEFONT',
- '%SCF_DEFAULT','%SCF_NOKBUPDATE','%SCF_SELECTION','%SCF_USEUIRULES','%SCF_WORD','%SC_CLOSE','%SC_CONTEXTHELP','%SC_HOTKEY',
- '%SC_HSCROLL','%SC_KEYMENU','%SC_MAXIMIZE','%SC_MINIMIZE','%SC_MONITORPOWER','%SC_MOUSEMENU','%SC_MOVE','%SC_NEXTWINDOW',
- '%SC_PREVWINDOW','%SC_RESTORE','%SC_SCREENSAVE','%SC_SIZE','%SC_TASKLIST','%SC_VSCROLL','%SERVICE_ACTIVE','%SERVICE_AUTO_START',
- '%SERVICE_BOOT_START','%SERVICE_CONTINUE_PENDING','%SERVICE_DEMAND_START','%SERVICE_DISABLED','%SERVICE_DRIVER','%SERVICE_INACTIVE','%SERVICE_INFO_DISPLAY_NAME','%SERVICE_INFO_NAME',
- '%SERVICE_PAUSED','%SERVICE_PAUSE_PENDING','%SERVICE_RUNNING','%SERVICE_START_PENDING','%SERVICE_STATE_ALL','%SERVICE_STOPPED','%SERVICE_STOP_PENDING','%SERVICE_SYSTEM_START',
- '%SERVICE_TYPE_ALL','%SERVICE_WIN32','%SES_ALLOWBEEPS','%SES_BEEPONMAXTEXT','%SES_BIDI','%SES_EMULATE10','%SES_EMULATESYSEDIT','%SES_EXTENDBACKCOLOR',
- '%SES_LOWERCASE','%SES_MAPCPS','%SES_NOIME','%SES_NOINPUTSEQUENCECHK','%SES_SCROLLONKILLFOCUS','%SES_UPPERCASE','%SES_USEAIMM','%SES_USECRLF',
- '%SES_XLTCRCRLFTOCR','%SF_RTF','%SF_TEXT','%SMTP_SET_ATTACH_CONTENT_TYPE','%SMTP_SET_CONTENT_TYPE_PREFIX','%SQL_AA_FALSE','%SQL_AA_TRUE','%SQL_ACCESSIBLE_PROCEDURES',
- '%SQL_ACCESSIBLE_TABLES','%SQL_ACCESS_MODE','%SQL_ACTIVE_CONNECTIONS','%SQL_ACTIVE_ENVIRONMENTS','%SQL_ACTIVE_STATEMENTS','%SQL_ADD','%SQL_AD_ADD_CONSTRAINT_DEFERRABLE','%SQL_AD_ADD_CONSTRAINT_INITIALLY_DEFERRED',
- '%SQL_AD_ADD_CONSTRAINT_INITIALLY_IMMEDIATE','%SQL_AD_ADD_CONSTRAINT_NON_DEFERRABLE','%SQL_AD_ADD_DOMAIN_CONSTRAINT','%SQL_AD_ADD_DOMAIN_DEFAULT','%SQL_AD_CONSTRAINT_NAME_DEFINITION','%SQL_AD_DROP_DOMAIN_CONSTRAINT','%SQL_AD_DROP_DOMAIN_DEFAULT','%SQL_AF_ALL',
- '%SQL_AF_AVG','%SQL_AF_COUNT','%SQL_AF_DISTINCT','%SQL_AF_MAX','%SQL_AF_MIN','%SQL_AF_SUM','%SQL_AGGREGATE_FUNCTIONS','%SQL_ALL_EXCEPT_LIKE',
- '%SQL_ALL_TYPES','%SQL_ALTER_DOMAIN','%SQL_ALTER_TABLE','%SQL_AM_CONNECTION','%SQL_AM_NONE','%SQL_AM_STATEMENT','%SQL_API_ALL_FUNCTIONS','%SQL_API_LOADBYORDINAL',
- '%SQL_API_ODBC3_ALL_FUNCTIONS','%SQL_API_ODBC3_ALL_FUNCTIONS_SIZE','%SQL_API_SQLALLOCCONNECT','%SQL_API_SQLALLOCENV','%SQL_API_SQLALLOCHANDLE','%SQL_API_SQLALLOCHANDLESTD','%SQL_API_SQLALLOCSTMT','%SQL_API_SQLBINDCOL',
- '%SQL_API_SQLBINDPARAM','%SQL_API_SQLBINDPARAMETER','%SQL_API_SQLBROWSECONNECT','%SQL_API_SQLBULKOPERATIONS','%SQL_API_SQLCANCEL','%SQL_API_SQLCLOSECURSOR','%SQL_API_SQLCOLATTRIBUTE','%SQL_API_SQLCOLATTRIBUTES',
- '%SQL_API_SQLCOLUMNPRIVILEGES','%SQL_API_SQLCOLUMNS','%SQL_API_SQLCONNECT','%SQL_API_SQLCOPYDESC','%SQL_API_SQLDATASOURCES','%SQL_API_SQLDESCRIBECOL','%SQL_API_SQLDESCRIBEPARAM','%SQL_API_SQLDISCONNECT',
- '%SQL_API_SQLDRIVERCONNECT','%SQL_API_SQLDRIVERS','%SQL_API_SQLENDTRAN','%SQL_API_SQLERROR','%SQL_API_SQLEXECDIRECT','%SQL_API_SQLEXECUTE','%SQL_API_SQLEXTENDEDFETCH','%SQL_API_SQLFETCH',
- '%SQL_API_SQLFETCHSCROLL','%SQL_API_SQLFOREIGNKEYS','%SQL_API_SQLFREECONNECT','%SQL_API_SQLFREEENV','%SQL_API_SQLFREEHANDLE','%SQL_API_SQLFREESTMT','%SQL_API_SQLGETCONNECTATTR','%SQL_API_SQLGETCONNECTOPTION',
- '%SQL_API_SQLGETCURSORNAME','%SQL_API_SQLGETDATA','%SQL_API_SQLGETDESCFIELD','%SQL_API_SQLGETDESCREC','%SQL_API_SQLGETDIAGFIELD','%SQL_API_SQLGETDIAGREC','%SQL_API_SQLGETENVATTR','%SQL_API_SQLGETFUNCTIONS',
- '%SQL_API_SQLGETINFO','%SQL_API_SQLGETSTMTATTR','%SQL_API_SQLGETSTMTOPTION','%SQL_API_SQLGETTYPEINFO','%SQL_API_SQLMORERESULTS','%SQL_API_SQLNATIVESQL','%SQL_API_SQLNUMPARAMS','%SQL_API_SQLNUMRESULTCOLS',
- '%SQL_API_SQLPARAMDATA','%SQL_API_SQLPARAMOPTIONS','%SQL_API_SQLPREPARE','%SQL_API_SQLPRIMARYKEYS','%SQL_API_SQLPROCEDURECOLUMNS','%SQL_API_SQLPROCEDURES','%SQL_API_SQLPUTDATA','%SQL_API_SQLROWCOUNT',
- '%SQL_API_SQLSETCONNECTATTR','%SQL_API_SQLSETCONNECTOPTION','%SQL_API_SQLSETCURSORNAME','%SQL_API_SQLSETDESCFIELD','%SQL_API_SQLSETDESCREC','%SQL_API_SQLSETENVATTR','%SQL_API_SQLSETPARAM','%SQL_API_SQLSETPOS',
- '%SQL_API_SQLSETSCROLLOPTIONS','%SQL_API_SQLSETSTMTATTR','%SQL_API_SQLSETSTMTOPTION','%SQL_API_SQLSPECIALCOLUMNS','%SQL_API_SQLSTATISTICS','%SQL_API_SQLTABLEPRIVILEGES','%SQL_API_SQLTABLES','%SQL_API_SQLTRANSACT',
- '%SQL_ARD_TYPE','%SQL_ASYNC_ENABLE','%SQL_ASYNC_ENABLE_DEFAULT','%SQL_ASYNC_ENABLE_OFF','%SQL_ASYNC_ENABLE_ON','%SQL_ASYNC_MODE','%SQL_ATTR_ACCESS_MODE','%SQL_ATTR_ANSI_APP',
- '%SQL_ATTR_APP_PARAM_DESC','%SQL_ATTR_APP_ROW_DESC','%SQL_ATTR_ASYNC_ENABLE','%SQL_ATTR_AUTOCOMMIT','%SQL_ATTR_AUTO_IPD','%SQL_ATTR_CONCURRENCY','%SQL_ATTR_CONNECTION_DEAD','%SQL_ATTR_CONNECTION_POOLING',
- '%SQL_ATTR_CONNECTION_TIMEOUT','%SQL_ATTR_CP_MATCH','%SQL_ATTR_CURRENT_CATALOG','%SQL_ATTR_CURSOR_SCROLLABLE','%SQL_ATTR_CURSOR_SENSITIVITY','%SQL_ATTR_CURSOR_TYPE','%SQL_ATTR_DISCONNECT_BEHAVIOR','%SQL_ATTR_ENABLE_AUTO_IPD',
- '%SQL_ATTR_ENLIST_IN_DTC','%SQL_ATTR_ENLIST_IN_XA','%SQL_ATTR_FETCH_BOOKMARK_PTR','%SQL_ATTR_IMP_PARAM_DESC','%SQL_ATTR_IMP_ROW_DESC','%SQL_ATTR_KEYSET_SIZE','%SQL_ATTR_LOGIN_TIMEOUT','%SQL_ATTR_MAX_LENGTH',
- '%SQL_ATTR_MAX_ROWS','%SQL_ATTR_METADATA_ID','%SQL_ATTR_NOSCAN','%SQL_ATTR_ODBC_CURSORS','%SQL_ATTR_ODBC_VERSION','%SQL_ATTR_OUTPUT_NTS','%SQL_ATTR_PACKET_SIZE','%SQL_ATTR_PARAMSET_SIZE',
- '%SQL_ATTR_PARAMS_PROCESSED_PTR','%SQL_ATTR_PARAM_BIND_OFFSET_PTR','%SQL_ATTR_PARAM_BIND_TYPE','%SQL_ATTR_PARAM_OPERATION_PTR','%SQL_ATTR_PARAM_STATUS_PTR','%SQL_ATTR_QUERY_TIMEOUT','%SQL_ATTR_QUIET_MODE','%SQL_ATTR_READONLY',
- '%SQL_ATTR_READWRITE_UNKNOWN','%SQL_ATTR_RETRIEVE_DATA','%SQL_ATTR_ROWS_FETCHED_PTR','%SQL_ATTR_ROW_ARRAY_SIZE','%SQL_ATTR_ROW_BIND_OFFSET_PTR','%SQL_ATTR_ROW_BIND_TYPE','%SQL_ATTR_ROW_NUMBER','%SQL_ATTR_ROW_OPERATION_PTR',
- '%SQL_ATTR_ROW_STATUS_PTR','%SQL_ATTR_SIMULATE_CURSOR','%SQL_ATTR_TRACE','%SQL_ATTR_TRACEFILE','%SQL_ATTR_TRANSLATE_LIB','%SQL_ATTR_TRANSLATE_OPTION','%SQL_ATTR_TXN_ISOLATION','%SQL_ATTR_USE_BOOKMARKS',
- '%SQL_ATTR_WRITE','%SQL_AT_ADD_COLUMN','%SQL_AT_ADD_COLUMN_COLLATION','%SQL_AT_ADD_COLUMN_DEFAULT','%SQL_AT_ADD_COLUMN_SINGLE','%SQL_AT_ADD_CONSTRAINT','%SQL_AT_ADD_TABLE_CONSTRAINT','%SQL_AT_CONSTRAINT_DEFERRABLE',
- '%SQL_AT_CONSTRAINT_INITIALLY_DEFERRED','%SQL_AT_CONSTRAINT_INITIALLY_IMMEDIATE','%SQL_AT_CONSTRAINT_NAME_DEFINITION','%SQL_AT_CONSTRAINT_NON_DEFERRABLE','%SQL_AT_DROP_COLUMN','%SQL_AT_DROP_COLUMN_CASCADE','%SQL_AT_DROP_COLUMN_DEFAULT','%SQL_AT_DROP_COLUMN_RESTRICT',
- '%SQL_AT_DROP_TABLE_CONSTRAINT_CASCADE','%SQL_AT_DROP_TABLE_CONSTRAINT_RESTRICT','%SQL_AT_SET_COLUMN_DEFAULT','%SQL_AUTOCOMMIT','%SQL_AUTOCOMMIT_DEFAULT','%SQL_AUTOCOMMIT_OFF','%SQL_AUTOCOMMIT_ON','%SQL_BATCH_ROW_COUNT',
- '%SQL_BATCH_SUPPORT','%SQL_BEST_ROWID','%SQL_BIGINT','%SQL_BINARY','%SQL_BIND_BY_COLUMN','%SQL_BIND_TYPE','%SQL_BIND_TYPE_DEFAULT','%SQL_BIT',
- '%SQL_BOOKMARK_PERSISTENCE','%SQL_BP_CLOSE','%SQL_BP_DELETE','%SQL_BP_DROP','%SQL_BP_OTHER_HSTMT','%SQL_BP_SCROLL','%SQL_BP_TRANSACTION','%SQL_BP_UPDATE',
- '%SQL_BRC_EXPLICIT','%SQL_BRC_PROCEDURES','%SQL_BRC_ROLLED_UP','%SQL_BS_ROW_COUNT_EXPLICIT','%SQL_BS_ROW_COUNT_PROC','%SQL_BS_SELECT_EXPLICIT','%SQL_BS_SELECT_PROC','%SQL_CA1_ABSOLUTE',
- '%SQL_CA1_BOOKMARK','%SQL_CA1_BULK_ADD','%SQL_CA1_BULK_DELETE_BY_BOOKMARK','%SQL_CA1_BULK_FETCH_BY_BOOKMARK','%SQL_CA1_BULK_UPDATE_BY_BOOKMARK','%SQL_CA1_LOCK_EXCLUSIVE','%SQL_CA1_LOCK_NO_CHANGE','%SQL_CA1_LOCK_UNLOCK',
- '%SQL_CA1_NEXT','%SQL_CA1_POSITIONED_DELETE','%SQL_CA1_POSITIONED_UPDATE','%SQL_CA1_POS_DELETE','%SQL_CA1_POS_POSITION','%SQL_CA1_POS_REFRESH','%SQL_CA1_POS_UPDATE','%SQL_CA1_RELATIVE',
- '%SQL_CA1_SELECT_FOR_UPDATE','%SQL_CA2_CRC_APPROXIMATE','%SQL_CA2_CRC_EXACT','%SQL_CA2_LOCK_CONCURRENCY','%SQL_CA2_MAX_ROWS_AFFECTS_ALL','%SQL_CA2_MAX_ROWS_CATALOG','%SQL_CA2_MAX_ROWS_DELETE','%SQL_CA2_MAX_ROWS_INSERT',
- '%SQL_CA2_MAX_ROWS_SELECT','%SQL_CA2_MAX_ROWS_UPDATE','%SQL_CA2_OPT_ROWVER_CONCURRENCY','%SQL_CA2_OPT_VALUES_CONCURRENCY','%SQL_CA2_READ_ONLY_CONCURRENCY','%SQL_CA2_SENSITIVITY_ADDITIONS','%SQL_CA2_SENSITIVITY_DELETIONS','%SQL_CA2_SENSITIVITY_UPDATES',
- '%SQL_CA2_SIMULATE_NON_UNIQUE','%SQL_CA2_SIMULATE_TRY_UNIQUE','%SQL_CA2_SIMULATE_UNIQUE','%SQL_CASCADE','%SQL_CATALOG_LOCATION','%SQL_CATALOG_NAME','%SQL_CATALOG_NAME_SEPARATOR','%SQL_CATALOG_TERM',
- '%SQL_CATALOG_USAGE','%SQL_CA_CONSTRAINT_DEFERRABLE','%SQL_CA_CONSTRAINT_INITIALLY_DEFERRED','%SQL_CA_CONSTRAINT_INITIALLY_IMMEDIATE','%SQL_CA_CONSTRAINT_NON_DEFERRABLE','%SQL_CA_CREATE_ASSERTION','%SQL_CB_CLOSE','%SQL_CB_DELETE',
- '%SQL_CB_NON_NULL','%SQL_CB_NULL','%SQL_CB_PRESERVE','%SQL_CCOL_CREATE_COLLATION','%SQL_CCS_COLLATE_CLAUSE','%SQL_CCS_CREATE_CHARACTER_SET','%SQL_CCS_LIMITED_COLLATION','%SQL_CC_CLOSE',
- '%SQL_CC_DELETE','%SQL_CC_PRESERVE','%SQL_CDO_COLLATION','%SQL_CDO_CONSTRAINT','%SQL_CDO_CONSTRAINT_DEFERRABLE','%SQL_CDO_CONSTRAINT_INITIALLY_DEFERRED','%SQL_CDO_CONSTRAINT_INITIALLY_IMMEDIATE','%SQL_CDO_CONSTRAINT_NAME_DEFINITION',
- '%SQL_CDO_CONSTRAINT_NON_DEFERRABLE','%SQL_CDO_CREATE_DOMAIN','%SQL_CDO_DEFAULT','%SQL_CD_FALSE','%SQL_CD_TRUE','%SQL_CHAR','%SQL_CLOSE','%SQL_CL_END',
- '%SQL_CL_START','%SQL_CN_ANY','%SQL_CN_DIFFERENT','%SQL_CN_NONE','%SQL_CODE_DATE','%SQL_CODE_DAY','%SQL_CODE_DAY_TO_HOUR','%SQL_CODE_DAY_TO_MINUTE',
- '%SQL_CODE_DAY_TO_SECOND','%SQL_CODE_HOUR','%SQL_CODE_HOUR_TO_MINUTE','%SQL_CODE_HOUR_TO_SECOND','%SQL_CODE_MINUTE','%SQL_CODE_MINUTE_TO_SECOND','%SQL_CODE_MONTH','%SQL_CODE_SECOND',
- '%SQL_CODE_TIME','%SQL_CODE_TIMESTAMP','%SQL_CODE_YEAR','%SQL_CODE_YEAR_TO_MONTH','%SQL_COLATT_OPT_MAX','%SQL_COLATT_OPT_MIN','%SQL_COLLATION_SEQ','%SQL_COLUMN_ALIAS',
- '%SQL_COLUMN_AUTO_INCREMENT','%SQL_COLUMN_CASE_SENSITIVE','%SQL_COLUMN_COUNT','%SQL_COLUMN_DISPLAY_SIZE','%SQL_COLUMN_IGNORE','%SQL_COLUMN_LABEL','%SQL_COLUMN_LENGTH','%SQL_COLUMN_MONEY',
- '%SQL_COLUMN_NAME','%SQL_COLUMN_NULLABLE','%SQL_COLUMN_NUMBER_UNKNOWN','%SQL_COLUMN_OWNER_NAME','%SQL_COLUMN_PRECISION','%SQL_COLUMN_QUALIFIER_NAME','%SQL_COLUMN_SCALE','%SQL_COLUMN_SEARCHABLE',
- '%SQL_COLUMN_TABLE_NAME','%SQL_COLUMN_TYPE','%SQL_COLUMN_TYPE_NAME','%SQL_COLUMN_UNSIGNED','%SQL_COLUMN_UPDATABLE','%SQL_COL_PRED_BASIC','%SQL_COL_PRED_CHAR','%SQL_COMMIT',
- '%SQL_CONCAT_NULL_BEHAVIOR','%SQL_CONCURRENCY','%SQL_CONCUR_DEFAULT','%SQL_CONCUR_LOCK','%SQL_CONCUR_READ_ONLY','%SQL_CONCUR_ROWVER','%SQL_CONCUR_TIMESTAMP','%SQL_CONCUR_VALUES',
- '%SQL_CONVERT_BIGINT','%SQL_CONVERT_BINARY','%SQL_CONVERT_BIT','%SQL_CONVERT_CHAR','%SQL_CONVERT_DATE','%SQL_CONVERT_DECIMAL','%SQL_CONVERT_DOUBLE','%SQL_CONVERT_FLOAT',
- '%SQL_CONVERT_FUNCTIONS','%SQL_CONVERT_GUID','%SQL_CONVERT_INTEGER','%SQL_CONVERT_INTERVAL_DAY_TIME','%SQL_CONVERT_INTERVAL_YEAR_MONTH','%SQL_CONVERT_LONGVARBINARY','%SQL_CONVERT_LONGVARCHAR','%SQL_CONVERT_NUMERIC',
- '%SQL_CONVERT_REAL','%SQL_CONVERT_SMALLINT','%SQL_CONVERT_TIME','%SQL_CONVERT_TIMESTAMP','%SQL_CONVERT_TINYINT','%SQL_CONVERT_VARBINARY','%SQL_CONVERT_VARCHAR','%SQL_CONVERT_WCHAR',
- '%SQL_CONVERT_WLONGVARCHAR','%SQL_CONVERT_WVARCHAR','%SQL_CORRELATION_NAME','%SQL_CP_DEFAULT','%SQL_CP_MATCH_DEFAULT','%SQL_CP_OFF','%SQL_CP_ONE_PER_DRIVER','%SQL_CP_ONE_PER_HENV',
- '%SQL_CP_RELAXED_MATCH','%SQL_CP_STRICT_MATCH','%SQL_CREATE_ASSERTION','%SQL_CREATE_CHARACTER_SET','%SQL_CREATE_COLLATION','%SQL_CREATE_DOMAIN','%SQL_CREATE_SCHEMA','%SQL_CREATE_TABLE',
- '%SQL_CREATE_TRANSLATION','%SQL_CREATE_VIEW','%SQL_CR_CLOSE','%SQL_CR_DELETE','%SQL_CR_PRESERVE','%SQL_CS_AUTHORIZATION','%SQL_CS_CREATE_SCHEMA','%SQL_CS_DEFAULT_CHARACTER_SET',
- '%SQL_CTR_CREATE_TRANSLATION','%SQL_CT_COLUMN_COLLATION','%SQL_CT_COLUMN_CONSTRAINT','%SQL_CT_COLUMN_DEFAULT','%SQL_CT_COMMIT_DELETE','%SQL_CT_COMMIT_PRESERVE','%SQL_CT_CONSTRAINT_DEFERRABLE','%SQL_CT_CONSTRAINT_INITIALLY_DEFERRED',
- '%SQL_CT_CONSTRAINT_INITIALLY_IMMEDIATE','%SQL_CT_CONSTRAINT_NAME_DEFINITION','%SQL_CT_CONSTRAINT_NON_DEFERRABLE','%SQL_CT_CREATE_TABLE','%SQL_CT_GLOBAL_TEMPORARY','%SQL_CT_LOCAL_TEMPORARY','%SQL_CT_TABLE_CONSTRAINT','%SQL_CURRENT_QUALIFIER',
- '%SQL_CURSOR_COMMIT_BEHAVIOR','%SQL_CURSOR_DYNAMIC','%SQL_CURSOR_FORWARD_ONLY','%SQL_CURSOR_KEYSET_DRIVEN','%SQL_CURSOR_ROLLBACK_BEHAVIOR','%SQL_CURSOR_SENSITIVITY','%SQL_CURSOR_STATIC','%SQL_CURSOR_TYPE',
- '%SQL_CURSOR_TYPE_DEFAULT','%SQL_CUR_DEFAULT','%SQL_CUR_USE_DRIVER','%SQL_CUR_USE_IF_NEEDED','%SQL_CUR_USE_ODBC','%SQL_CU_DML_STATEMENTS','%SQL_CU_INDEX_DEFINITION','%SQL_CU_PRIVILEGE_DEFINITION',
- '%SQL_CU_PROCEDURE_INVOCATION','%SQL_CU_TABLE_DEFINITION','%SQL_CVT_BIGINT','%SQL_CVT_BINARY','%SQL_CVT_BIT','%SQL_CVT_CHAR','%SQL_CVT_DATE','%SQL_CVT_DECIMAL',
- '%SQL_CVT_DOUBLE','%SQL_CVT_FLOAT','%SQL_CVT_GUID','%SQL_CVT_INTEGER','%SQL_CVT_INTERVAL_DAY_TIME','%SQL_CVT_INTERVAL_YEAR_MONTH','%SQL_CVT_LONGVARBINARY','%SQL_CVT_LONGVARCHAR',
- '%SQL_CVT_NUMERIC','%SQL_CVT_REAL','%SQL_CVT_SMALLINT','%SQL_CVT_TIME','%SQL_CVT_TIMESTAMP','%SQL_CVT_TINYINT','%SQL_CVT_VARBINARY','%SQL_CVT_VARCHAR',
- '%SQL_CVT_WCHAR','%SQL_CVT_WLONGVARCHAR','%SQL_CVT_WVARCHAR','%SQL_CV_CASCADED','%SQL_CV_CHECK_OPTION','%SQL_CV_CREATE_VIEW','%SQL_CV_LOCAL','%SQL_C_BINARY',
- '%SQL_C_BIT','%SQL_C_BOOKMARK','%SQL_C_CHAR','%SQL_C_DATE','%SQL_C_DEFAULT','%SQL_C_DOUBLE','%SQL_C_FLOAT','%SQL_C_GUID',
- '%SQL_C_INTERVAL_DAY','%SQL_C_INTERVAL_DAY_TO_HOUR','%SQL_C_INTERVAL_DAY_TO_MINUTE','%SQL_C_INTERVAL_DAY_TO_SECOND','%SQL_C_INTERVAL_HOUR','%SQL_C_INTERVAL_HOUR_TO_MINUTE','%SQL_C_INTERVAL_HOUR_TO_SECOND','%SQL_C_INTERVAL_MINUTE',
- '%SQL_C_INTERVAL_MINUTE_TO_SECOND','%SQL_C_INTERVAL_MONTH','%SQL_C_INTERVAL_SECOND','%SQL_C_INTERVAL_YEAR','%SQL_C_INTERVAL_YEAR_TO_MONTH','%SQL_C_LONG','%SQL_C_NUMERIC','%SQL_C_SBIGINT',
- '%SQL_C_SHORT','%SQL_C_SLONG','%SQL_C_SSHORT','%SQL_C_STINYINT','%SQL_C_TIME','%SQL_C_TIMESTAMP','%SQL_C_TINYINT','%SQL_C_TYPE_DATE',
- '%SQL_C_TYPE_TIME','%SQL_C_TYPE_TIMESTAMP','%SQL_C_UBIGINT','%SQL_C_ULONG','%SQL_C_USHORT','%SQL_C_UTINYINT','%SQL_C_VARBOOKMARK','%SQL_DATABASE_NAME',
- '%SQL_DATA_AT_EXEC','%SQL_DATA_SOURCE_NAME','%SQL_DATA_SOURCE_READ_ONLY','%SQL_DATE','%SQL_DATETIME','%SQL_DATETIME_LITERALS','%SQL_DATE_LEN','%SQL_DAY',
- '%SQL_DAY_TO_HOUR','%SQL_DAY_TO_MINUTE','%SQL_DAY_TO_SECOND','%SQL_DA_DROP_ASSERTION','%SQL_DBMS_NAME','%SQL_DBMS_VER','%SQL_DB_DEFAULT','%SQL_DB_DISCONNECT',
- '%SQL_DB_RETURN_TO_POOL','%SQL_DCS_DROP_CHARACTER_SET','%SQL_DC_DROP_COLLATION','%SQL_DDL_INDEX','%SQL_DD_CASCADE','%SQL_DD_DROP_DOMAIN','%SQL_DD_RESTRICT','%SQL_DECIMAL',
- '%SQL_DEFAULT','%SQL_DEFAULT_PARAM','%SQL_DEFAULT_TXN_ISOLATION','%SQL_DELETE','%SQL_DELETE_BY_BOOKMARK','%SQL_DESCRIBE_PARAMETER','%SQL_DESC_ALLOC_AUTO','%SQL_DESC_ALLOC_TYPE',
- '%SQL_DESC_ALLOC_USER','%SQL_DESC_ARRAY_SIZE','%SQL_DESC_ARRAY_STATUS_PTR','%SQL_DESC_AUTO_UNIQUE_VALUE','%SQL_DESC_BASE_COLUMN_NAME','%SQL_DESC_BASE_TABLE_NAME','%SQL_DESC_BIND_OFFSET_PTR','%SQL_DESC_BIND_TYPE',
- '%SQL_DESC_CASE_SENSITIVE','%SQL_DESC_CATALOG_NAME','%SQL_DESC_CONCISE_TYPE','%SQL_DESC_COUNT','%SQL_DESC_DATA_PTR','%SQL_DESC_DATETIME_INTERVAL_CODE','%SQL_DESC_DATETIME_INTERVAL_PRECISION','%SQL_DESC_DISPLAY_SIZE',
- '%SQL_DESC_FIXED_PREC_SCALE','%SQL_DESC_INDICATOR_PTR','%SQL_DESC_LABEL','%SQL_DESC_LENGTH','%SQL_DESC_LITERAL_PREFIX','%SQL_DESC_LITERAL_SUFFIX','%SQL_DESC_LOCAL_TYPE_NAME','%SQL_DESC_MAXIMUM_SCALE',
- '%SQL_DESC_MINIMUM_SCALE','%SQL_DESC_NAME','%SQL_DESC_NULLABLE','%SQL_DESC_NUM_PREC_RADIX','%SQL_DESC_OCTET_LENGTH','%SQL_DESC_OCTET_LENGTH_PTR','%SQL_DESC_PARAMETER_TYPE','%SQL_DESC_PRECISION',
- '%SQL_DESC_ROWS_PROCESSED_PTR','%SQL_DESC_SCALE','%SQL_DESC_SCHEMA_NAME','%SQL_DESC_SEARCHABLE','%SQL_DESC_TABLE_NAME','%SQL_DESC_TYPE','%SQL_DESC_TYPE_NAME','%SQL_DESC_UNNAMED',
- '%SQL_DESC_UNSIGNED','%SQL_DESC_UPDATABLE','%SQL_DIAG_ALTER_TABLE','%SQL_DIAG_CALL','%SQL_DIAG_CLASS_ORIGIN','%SQL_DIAG_COLUMN_NUMBER','%SQL_DIAG_CONNECTION_NAME','%SQL_DIAG_CREATE_INDEX',
- '%SQL_DIAG_CREATE_TABLE','%SQL_DIAG_CREATE_VIEW','%SQL_DIAG_CURSOR_ROW_COUNT','%SQL_DIAG_DELETE_WHERE','%SQL_DIAG_DROP_INDEX','%SQL_DIAG_DROP_TABLE','%SQL_DIAG_DROP_VIEW','%SQL_DIAG_DYNAMIC_DELETE_CURSOR',
- '%SQL_DIAG_DYNAMIC_FUNCTION','%SQL_DIAG_DYNAMIC_FUNCTION_CODE','%SQL_DIAG_DYNAMIC_UPDATE_CURSOR','%SQL_DIAG_GRANT','%SQL_DIAG_INSERT','%SQL_DIAG_MESSAGE_TEXT','%SQL_DIAG_NATIVE','%SQL_DIAG_NUMBER',
- '%SQL_DIAG_RETURNCODE','%SQL_DIAG_REVOKE','%SQL_DIAG_ROW_COUNT','%SQL_DIAG_ROW_NUMBER','%SQL_DIAG_SELECT_CURSOR','%SQL_DIAG_SERVER_NAME','%SQL_DIAG_SQLSTATE','%SQL_DIAG_SUBCLASS_ORIGIN',
- '%SQL_DIAG_UNKNOWN_STATEMENT','%SQL_DIAG_UPDATE_WHERE','%SQL_DI_CREATE_INDEX','%SQL_DI_DROP_INDEX','%SQL_DL_SQL92_DATE','%SQL_DL_SQL92_INTERVAL_DAY','%SQL_DL_SQL92_INTERVAL_DAY_TO_HOUR','%SQL_DL_SQL92_INTERVAL_DAY_TO_MINUTE',
- '%SQL_DL_SQL92_INTERVAL_DAY_TO_SECOND','%SQL_DL_SQL92_INTERVAL_HOUR','%SQL_DL_SQL92_INTERVAL_HOUR_TO_MINUTE','%SQL_DL_SQL92_INTERVAL_HOUR_TO_SECOND','%SQL_DL_SQL92_INTERVAL_MINUTE','%SQL_DL_SQL92_INTERVAL_MINUTE_TO_SECOND','%SQL_DL_SQL92_INTERVAL_MONTH','%SQL_DL_SQL92_INTERVAL_SECOND',
- '%SQL_DL_SQL92_INTERVAL_YEAR','%SQL_DL_SQL92_INTERVAL_YEAR_TO_MONTH','%SQL_DL_SQL92_TIME','%SQL_DL_SQL92_TIMESTAMP','%SQL_DM_VER','%SQL_DOUBLE','%SQL_DRIVER_COMPLETE','%SQL_DRIVER_COMPLETE_REQUIRED',
- '%SQL_DRIVER_HDBC','%SQL_DRIVER_HDESC','%SQL_DRIVER_HENV','%SQL_DRIVER_HLIB','%SQL_DRIVER_HSTMT','%SQL_DRIVER_NAME','%SQL_DRIVER_NOPROMPT','%SQL_DRIVER_ODBC_VER',
- '%SQL_DRIVER_PROMPT','%SQL_DRIVER_VER','%SQL_DROP','%SQL_DROP_ASSERTION','%SQL_DROP_CHARACTER_SET','%SQL_DROP_COLLATION','%SQL_DROP_DOMAIN','%SQL_DROP_SCHEMA',
- '%SQL_DROP_TABLE','%SQL_DROP_TRANSLATION','%SQL_DROP_VIEW','%SQL_DS_CASCADE','%SQL_DS_DROP_SCHEMA','%SQL_DS_RESTRICT','%SQL_DTC_DONE','%SQL_DTC_ENLIST_EXPENSIVE',
- '%SQL_DTC_TRANSITION_COST','%SQL_DTC_UNENLIST_EXPENSIVE','%SQL_DTR_DROP_TRANSLATION','%SQL_DT_CASCADE','%SQL_DT_DROP_TABLE','%SQL_DT_RESTRICT','%SQL_DV_CASCADE','%SQL_DV_DROP_VIEW',
- '%SQL_DV_RESTRICT','%SQL_DYNAMIC_CURSOR_ATTRIBUTES1','%SQL_DYNAMIC_CURSOR_ATTRIBUTES2','%SQL_ENSURE','%SQL_ENTIRE_ROWSET','%SQL_ERROR','%SQL_EXPRESSIONS_IN_ORDERBY','%SQL_FALSE',
- '%SQL_FD_FETCH_ABSOLUTE','%SQL_FD_FETCH_BOOKMARK','%SQL_FD_FETCH_FIRST','%SQL_FD_FETCH_LAST','%SQL_FD_FETCH_NEXT','%SQL_FD_FETCH_PREV','%SQL_FD_FETCH_PRIOR','%SQL_FD_FETCH_RELATIVE',
- '%SQL_FETCH_ABSOLUTE','%SQL_FETCH_BOOKMARK','%SQL_FETCH_BY_BOOKMARK','%SQL_FETCH_DIRECTION','%SQL_FETCH_FIRST','%SQL_FETCH_FIRST_SYSTEM','%SQL_FETCH_FIRST_USER','%SQL_FETCH_LAST',
- '%SQL_FETCH_NEXT','%SQL_FETCH_PREV','%SQL_FETCH_PRIOR','%SQL_FETCH_RELATIVE','%SQL_FILE_CATALOG','%SQL_FILE_NOT_SUPPORTED','%SQL_FILE_QUALIFIER','%SQL_FILE_TABLE',
- '%SQL_FILE_USAGE','%SQL_FLOAT','%SQL_FN_CVT_CAST','%SQL_FN_CVT_CONVERT','%SQL_FN_NUM_ABS','%SQL_FN_NUM_ACOS','%SQL_FN_NUM_ASIN','%SQL_FN_NUM_ATAN',
- '%SQL_FN_NUM_ATAN2','%SQL_FN_NUM_CEILING','%SQL_FN_NUM_COS','%SQL_FN_NUM_COT','%SQL_FN_NUM_DEGREES','%SQL_FN_NUM_EXP','%SQL_FN_NUM_FLOOR','%SQL_FN_NUM_LOG',
- '%SQL_FN_NUM_LOG10','%SQL_FN_NUM_MOD','%SQL_FN_NUM_PI','%SQL_FN_NUM_POWER','%SQL_FN_NUM_RADIANS','%SQL_FN_NUM_RAND','%SQL_FN_NUM_ROUND','%SQL_FN_NUM_SIGN',
- '%SQL_FN_NUM_SIN','%SQL_FN_NUM_SQRT','%SQL_FN_NUM_TAN','%SQL_FN_NUM_TRUNCATE','%SQL_FN_STR_ASCII','%SQL_FN_STR_BIT_LENGTH','%SQL_FN_STR_CHAR','%SQL_FN_STR_CHARACTER_LENGTH',
- '%SQL_FN_STR_CHAR_LENGTH','%SQL_FN_STR_CONCAT','%SQL_FN_STR_DIFFERENCE','%SQL_FN_STR_INSERT','%SQL_FN_STR_LCASE','%SQL_FN_STR_LEFT','%SQL_FN_STR_LENGTH','%SQL_FN_STR_LOCATE',
- '%SQL_FN_STR_LOCATE_2','%SQL_FN_STR_LTRIM','%SQL_FN_STR_OCTET_LENGTH','%SQL_FN_STR_POSITION','%SQL_FN_STR_REPEAT','%SQL_FN_STR_REPLACE','%SQL_FN_STR_RIGHT','%SQL_FN_STR_RTRIM',
- '%SQL_FN_STR_SOUNDEX','%SQL_FN_STR_SPACE','%SQL_FN_STR_SUBSTRING','%SQL_FN_STR_UCASE','%SQL_FN_SYS_DBNAME','%SQL_FN_SYS_IFNULL','%SQL_FN_SYS_USERNAME','%SQL_FN_TD_CURDATE',
- '%SQL_FN_TD_CURRENT_DATE','%SQL_FN_TD_CURRENT_TIME','%SQL_FN_TD_CURRENT_TIMESTAMP','%SQL_FN_TD_CURTIME','%SQL_FN_TD_DAYNAME','%SQL_FN_TD_DAYOFMONTH','%SQL_FN_TD_DAYOFWEEK','%SQL_FN_TD_DAYOFYEAR',
- '%SQL_FN_TD_EXTRACT','%SQL_FN_TD_HOUR','%SQL_FN_TD_MINUTE','%SQL_FN_TD_MONTH','%SQL_FN_TD_MONTHNAME','%SQL_FN_TD_NOW','%SQL_FN_TD_QUARTER','%SQL_FN_TD_SECOND',
- '%SQL_FN_TD_TIMESTAMPADD','%SQL_FN_TD_TIMESTAMPDIFF','%SQL_FN_TD_WEEK','%SQL_FN_TD_YEAR','%SQL_FN_TSI_DAY','%SQL_FN_TSI_FRAC_SECOND','%SQL_FN_TSI_HOUR','%SQL_FN_TSI_MINUTE',
- '%SQL_FN_TSI_MONTH','%SQL_FN_TSI_QUARTER','%SQL_FN_TSI_SECOND','%SQL_FN_TSI_WEEK','%SQL_FN_TSI_YEAR','%SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1','%SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2','%SQL_GB_COLLATE',
- '%SQL_GB_GROUP_BY_CONTAINS_SELECT','%SQL_GB_GROUP_BY_EQUALS_SELECT','%SQL_GB_NOT_SUPPORTED','%SQL_GB_NO_RELATION','%SQL_GD_ANY_COLUMN','%SQL_GD_ANY_ORDER','%SQL_GD_BLOCK','%SQL_GD_BOUND',
- '%SQL_GETDATA_EXTENSIONS','%SQL_GET_BOOKMARK','%SQL_GROUP_BY','%SQL_GUID','%SQL_HANDLE_DBC','%SQL_HANDLE_DESC','%SQL_HANDLE_ENV','%SQL_HANDLE_SENV',
- '%SQL_HANDLE_STMT','%SQL_HOUR','%SQL_HOUR_TO_MINUTE','%SQL_HOUR_TO_SECOND','%SQL_IC_LOWER','%SQL_IC_MIXED','%SQL_IC_SENSITIVE','%SQL_IC_UPPER',
- '%SQL_IDENTIFIER_CASE','%SQL_IDENTIFIER_QUOTE_CHAR','%SQL_IGNORE','%SQL_IK_ALL','%SQL_IK_ASC','%SQL_IK_DESC','%SQL_IK_NONE','%SQL_INDEX_ALL',
- '%SQL_INDEX_CLUSTERED','%SQL_INDEX_HASHED','%SQL_INDEX_KEYWORDS','%SQL_INDEX_OTHER','%SQL_INDEX_UNIQUE','%SQL_INFO_FIRST','%SQL_INFO_SCHEMA_VIEWS','%SQL_INITIALLY_DEFERRED',
- '%SQL_INITIALLY_IMMEDIATE','%SQL_INSENSITIVE','%SQL_INSERT_STATEMENT','%SQL_INTEGER','%SQL_INTEGRITY','%SQL_INTERVAL','%SQL_INTERVAL_DAY','%SQL_INTERVAL_DAY_TO_HOUR',
- '%SQL_INTERVAL_DAY_TO_MINUTE','%SQL_INTERVAL_DAY_TO_SECOND','%SQL_INTERVAL_HOUR','%SQL_INTERVAL_HOUR_TO_MINUTE','%SQL_INTERVAL_HOUR_TO_SECOND','%SQL_INTERVAL_MINUTE','%SQL_INTERVAL_MINUTE_TO_SECOND','%SQL_INTERVAL_MONTH',
- '%SQL_INTERVAL_SECOND','%SQL_INTERVAL_YEAR','%SQL_INTERVAL_YEAR_TO_MONTH','%SQL_INVALID_HANDLE','%SQL_ISV_ASSERTIONS','%SQL_ISV_CHARACTER_SETS','%SQL_ISV_CHECK_CONSTRAINTS','%SQL_ISV_COLLATIONS',
- '%SQL_ISV_COLUMNS','%SQL_ISV_COLUMN_DOMAIN_USAGE','%SQL_ISV_COLUMN_PRIVILEGES','%SQL_ISV_CONSTRAINT_COLUMN_USAGE','%SQL_ISV_CONSTRAINT_TABLE_USAGE','%SQL_ISV_DOMAINS','%SQL_ISV_DOMAIN_CONSTRAINTS','%SQL_ISV_KEY_COLUMN_USAGE',
- '%SQL_ISV_REFERENTIAL_CONSTRAINTS','%SQL_ISV_SCHEMATA','%SQL_ISV_SQL_LANGUAGES','%SQL_ISV_TABLES','%SQL_ISV_TABLE_CONSTRAINTS','%SQL_ISV_TABLE_PRIVILEGES','%SQL_ISV_TRANSLATIONS','%SQL_ISV_USAGE_PRIVILEGES',
- '%SQL_ISV_VIEWS','%SQL_ISV_VIEW_COLUMN_USAGE','%SQL_ISV_VIEW_TABLE_USAGE','%SQL_IS_DAY','%SQL_IS_DAY_TO_HOUR','%SQL_IS_DAY_TO_MINUTE','%SQL_IS_DAY_TO_SECOND','%SQL_IS_HOUR',
- '%SQL_IS_HOUR_TO_MINUTE','%SQL_IS_HOUR_TO_SECOND','%SQL_IS_INSERT_LITERALS','%SQL_IS_INSERT_SEARCHED','%SQL_IS_INTEGER','%SQL_IS_MINUTE','%SQL_IS_MINUTE_TO_SECOND','%SQL_IS_MONTH',
- '%SQL_IS_POINTER','%SQL_IS_SECOND','%SQL_IS_SELECT_INTO','%SQL_IS_SMALLINT','%SQL_IS_UINTEGER','%SQL_IS_USMALLINT','%SQL_IS_YEAR','%SQL_IS_YEAR_TO_MONTH',
- '%SQL_KEYSET_CURSOR_ATTRIBUTES1','%SQL_KEYSET_CURSOR_ATTRIBUTES2','%SQL_KEYSET_SIZE','%SQL_KEYSET_SIZE_DEFAULT','%SQL_KEYWORDS','%SQL_LCK_EXCLUSIVE','%SQL_LCK_NO_CHANGE','%SQL_LCK_UNLOCK',
- '%SQL_LEN_BINARY_ATTR_OFFSET','%SQL_LEN_DATA_AT_EXEC_OFFSET','%SQL_LIKE_ESCAPE_CLAUSE','%SQL_LIKE_ONLY','%SQL_LOCK_EXCLUSIVE','%SQL_LOCK_NO_CHANGE','%SQL_LOCK_TYPES','%SQL_LOCK_UNLOCK',
- '%SQL_LOGIN_TIMEOUT','%SQL_LOGIN_TIMEOUT_DEFAULT','%SQL_LONGVARBINARY','%SQL_LONGVARCHAR','%SQL_MAXIMUM_CATALOG_NAME_LENGTH','%SQL_MAXIMUM_COLUMNS_IN_GROUP_BY','%SQL_MAXIMUM_COLUMNS_IN_INDEX','%SQL_MAXIMUM_COLUMNS_IN_ORDER_BY',
- '%SQL_MAXIMUM_COLUMNS_IN_SELECT','%SQL_MAXIMUM_COLUMN_NAME_LENGTH','%SQL_MAXIMUM_CONCURRENT_ACTIVITIES','%SQL_MAXIMUM_CURSOR_NAME_LENGTH','%SQL_MAXIMUM_DRIVER_CONNECTIONS','%SQL_MAXIMUM_IDENTIFIER_LENGTH','%SQL_MAXIMUM_INDEX_SIZE','%SQL_MAXIMUM_ROW_SIZE',
- '%SQL_MAXIMUM_SCHEMA_NAME_LENGTH','%SQL_MAXIMUM_STATEMENT_LENGTH','%SQL_MAXIMUM_TABLES_IN_SELECT','%SQL_MAXIMUM_USER_NAME_LENGTH','%SQL_MAX_ASYNC_CONCURRENT_STATEMENTS','%SQL_MAX_BINARY_LITERAL_LEN','%SQL_MAX_CATALOG_NAME_LEN','%SQL_MAX_CHAR_LITERAL_LEN',
- '%SQL_MAX_COLUMNS_IN_GROUP_BY','%SQL_MAX_COLUMNS_IN_INDEX','%SQL_MAX_COLUMNS_IN_ORDER_BY','%SQL_MAX_COLUMNS_IN_SELECT','%SQL_MAX_COLUMNS_IN_TABLE','%SQL_MAX_COLUMN_NAME_LEN','%SQL_MAX_CONCURRENT_ACTIVITIES','%SQL_MAX_CURSOR_NAME_LEN',
- '%SQL_MAX_DRIVER_CONNECTIONS','%SQL_MAX_DSN_LENGTH','%SQL_MAX_IDENTIFIER_LEN','%SQL_MAX_INDEX_SIZE','%SQL_MAX_LENGTH','%SQL_MAX_LENGTH_DEFAULT','%SQL_MAX_MESSAGE_LENGTH','%SQL_MAX_NUMERIC_LEN',
- '%SQL_MAX_OPTION_STRING_LENGTH','%SQL_MAX_OWNER_NAME_LEN','%SQL_MAX_PROCEDURE_NAME_LEN','%SQL_MAX_QUALIFIER_NAME_LEN','%SQL_MAX_ROWS','%SQL_MAX_ROWS_DEFAULT','%SQL_MAX_ROW_SIZE','%SQL_MAX_ROW_SIZE_INCLUDES_LONG',
- '%SQL_MAX_SCHEMA_NAME_LEN','%SQL_MAX_STATEMENT_LEN','%SQL_MAX_TABLES_IN_SELECT','%SQL_MAX_TABLE_NAME_LEN','%SQL_MAX_USER_NAME_LEN','%SQL_MINUTE','%SQL_MINUTE_TO_SECOND','%SQL_MODE_DEFAULT',
- '%SQL_MODE_READ_ONLY','%SQL_MODE_READ_WRITE','%SQL_MONTH','%SQL_MULTIPLE_ACTIVE_TXN','%SQL_MULT_RESULT_SETS','%SQL_NAMED','%SQL_NC_END','%SQL_NC_HIGH',
- '%SQL_NC_LOW','%SQL_NC_START','%SQL_NEED_DATA','%SQL_NEED_LONG_DATA_LEN','%SQL_NNC_NON_NULL','%SQL_NNC_NULL','%SQL_NONSCROLLABLE','%SQL_NON_NULLABLE_COLUMNS',
- '%SQL_NOSCAN','%SQL_NOSCAN_DEFAULT','%SQL_NOSCAN_OFF','%SQL_NOSCAN_ON','%SQL_NOT_DEFERRABLE','%SQL_NO_ACTION','%SQL_NO_COLUMN_NUMBER','%SQL_NO_DATA',
- '%SQL_NO_DATA_FOUND','%SQL_NO_NULLS','%SQL_NO_ROW_NUMBER','%SQL_NO_TOTAL','%SQL_NTS','%SQL_NTSL','%SQL_NULLABLE','%SQL_NULLABLE_UNKNOWN',
- '%SQL_NULL_COLLATION','%SQL_NULL_DATA','%SQL_NULL_HANDLE','%SQL_NULL_HDBC','%SQL_NULL_HDESC','%SQL_NULL_HENV','%SQL_NULL_HSTMT','%SQL_NUMERIC',
- '%SQL_NUMERIC_FUNCTIONS','%SQL_OAC_LEVEL1','%SQL_OAC_LEVEL2','%SQL_OAC_NONE','%SQL_ODBC_API_CONFORMANCE','%SQL_ODBC_CURSORS','%SQL_ODBC_INTERFACE_CONFORMANCE','%SQL_ODBC_SAG_CLI_CONFORMANCE',
- '%SQL_ODBC_SQL_CONFORMANCE','%SQL_ODBC_SQL_OPT_IEF','%SQL_ODBC_VER','%SQL_OIC_CORE','%SQL_OIC_LEVEL1','%SQL_OIC_LEVEL2','%SQL_OJ_ALL_COMPARISON_OPS','%SQL_OJ_CAPABILITIES',
- '%SQL_OJ_FULL','%SQL_OJ_INNER','%SQL_OJ_LEFT','%SQL_OJ_NESTED','%SQL_OJ_NOT_ORDERED','%SQL_OJ_RIGHT','%SQL_OPT_TRACE','%SQL_OPT_TRACEFILE',
- '%SQL_OPT_TRACE_DEFAULT','%SQL_OPT_TRACE_OFF','%SQL_OPT_TRACE_ON','%SQL_ORDER_BY_COLUMNS_IN_SELECT','%SQL_OSCC_COMPLIANT','%SQL_OSCC_NOT_COMPLIANT','%SQL_OSC_CORE','%SQL_OSC_EXTENDED',
- '%SQL_OSC_MINIMUM','%SQL_OUTER_JOINS','%SQL_OUTER_JOIN_CAPABILITIES','%SQL_OU_DML_STATEMENTS','%SQL_OU_INDEX_DEFINITION','%SQL_OU_PRIVILEGE_DEFINITION','%SQL_OU_PROCEDURE_INVOCATION','%SQL_OU_TABLE_DEFINITION',
- '%SQL_OV_ODBC2','%SQL_OV_ODBC3','%SQL_OWNER_TERM','%SQL_OWNER_USAGE','%SQL_PACKET_SIZE','%SQL_PARAM_ARRAY_ROW_COUNTS','%SQL_PARAM_ARRAY_SELECTS','%SQL_PARAM_BIND_BY_COLUMN',
- '%SQL_PARAM_BIND_TYPE_DEFAULT','%SQL_PARAM_DIAG_UNAVAILABLE','%SQL_PARAM_ERROR','%SQL_PARAM_IGNORE','%SQL_PARAM_INPUT','%SQL_PARAM_INPUT_OUTPUT','%SQL_PARAM_OUTPUT','%SQL_PARAM_PROCEED',
- '%SQL_PARAM_SUCCESS','%SQL_PARAM_SUCCESS_WITH_INFO','%SQL_PARAM_TYPE_DEFAULT','%SQL_PARAM_TYPE_UNKNOWN','%SQL_PARAM_UNUSED','%SQL_PARC_BATCH','%SQL_PARC_NO_BATCH','%SQL_PAS_BATCH',
- '%SQL_PAS_NO_BATCH','%SQL_PAS_NO_SELECT','%SQL_PC_NON_PSEUDO','%SQL_PC_NOT_PSEUDO','%SQL_PC_PSEUDO','%SQL_PC_UNKNOWN','%SQL_POSITION','%SQL_POSITIONED_STATEMENTS',
- '%SQL_POS_ADD','%SQL_POS_DELETE','%SQL_POS_OPERATIONS','%SQL_POS_POSITION','%SQL_POS_REFRESH','%SQL_POS_UPDATE','%SQL_PRED_BASIC','%SQL_PRED_CHAR',
- '%SQL_PRED_NONE','%SQL_PRED_SEARCHABLE','%SQL_PROCEDURES','%SQL_PROCEDURE_TERM','%SQL_PS_POSITIONED_DELETE','%SQL_PS_POSITIONED_UPDATE','%SQL_PS_SELECT_FOR_UPDATE','%SQL_PT_FUNCTION',
- '%SQL_PT_PROCEDURE','%SQL_PT_UNKNOWN','%SQL_QL_END','%SQL_QL_START','%SQL_QUALIFIER_LOCATION','%SQL_QUALIFIER_NAME_SEPARATOR','%SQL_QUALIFIER_TERM','%SQL_QUALIFIER_USAGE',
- '%SQL_QUERY_TIMEOUT','%SQL_QUERY_TIMEOUT_DEFAULT','%SQL_QUICK','%SQL_QUIET_MODE','%SQL_QUOTED_IDENTIFIER_CASE','%SQL_QU_DML_STATEMENTS','%SQL_QU_INDEX_DEFINITION','%SQL_QU_PRIVILEGE_DEFINITION',
- '%SQL_QU_PROCEDURE_INVOCATION','%SQL_QU_TABLE_DEFINITION','%SQL_RD_DEFAULT','%SQL_RD_OFF','%SQL_RD_ON','%SQL_REAL','%SQL_REFRESH','%SQL_RESET_PARAMS',
- '%SQL_RESTRICT','%SQL_RESULT_COL','%SQL_RETRIEVE_DATA','%SQL_RETURN_VALUE','%SQL_ROLLBACK','%SQL_ROWSET_SIZE','%SQL_ROWSET_SIZE_DEFAULT','%SQL_ROWVER',
- '%SQL_ROW_ADDED','%SQL_ROW_DELETED','%SQL_ROW_ERROR','%SQL_ROW_IDENTIFIER','%SQL_ROW_IGNORE','%SQL_ROW_NOROW','%SQL_ROW_NUMBER','%SQL_ROW_NUMBER_UNKNOWN',
- '%SQL_ROW_PROCEED','%SQL_ROW_SUCCESS','%SQL_ROW_SUCCESS_WITH_INFO','%SQL_ROW_UPDATED','%SQL_ROW_UPDATES','%SQL_SCCO_LOCK','%SQL_SCCO_OPT_ROWVER','%SQL_SCCO_OPT_TIMESTAMP',
- '%SQL_SCCO_OPT_VALUES','%SQL_SCCO_READ_ONLY','%SQL_SCC_ISO92_CLI','%SQL_SCC_XOPEN_CLI_VERSION1','%SQL_SCHEMA_TERM','%SQL_SCHEMA_USAGE','%SQL_SCOPE_CURROW','%SQL_SCOPE_SESSION',
- '%SQL_SCOPE_TRANSACTION','%SQL_SCROLLABLE','%SQL_SCROLL_CONCURRENCY','%SQL_SCROLL_DYNAMIC','%SQL_SCROLL_FORWARD_ONLY','%SQL_SCROLL_KEYSET_DRIVEN','%SQL_SCROLL_OPTIONS','%SQL_SCROLL_STATIC',
- '%SQL_SC_FIPS127_2_TRANSITIONAL','%SQL_SC_NON_UNIQUE','%SQL_SC_SQL92_ENTRY','%SQL_SC_SQL92_FULL','%SQL_SC_SQL92_INTERMEDIATE','%SQL_SC_TRY_UNIQUE','%SQL_SC_UNIQUE','%SQL_SDF_CURRENT_DATE',
- '%SQL_SDF_CURRENT_TIME','%SQL_SDF_CURRENT_TIMESTAMP','%SQL_SEARCHABLE','%SQL_SEARCH_PATTERN_ESCAPE','%SQL_SECOND','%SQL_SENSITIVE','%SQL_SERVER_NAME','%SQL_SETPARAM_VALUE_MAX',
- '%SQL_SETPOS_MAX_LOCK_VALUE','%SQL_SETPOS_MAX_OPTION_VALUE','%SQL_SET_DEFAULT','%SQL_SET_NULL','%SQL_SFKD_CASCADE','%SQL_SFKD_NO_ACTION','%SQL_SFKD_SET_DEFAULT','%SQL_SFKD_SET_NULL',
- '%SQL_SFKU_CASCADE','%SQL_SFKU_NO_ACTION','%SQL_SFKU_SET_DEFAULT','%SQL_SFKU_SET_NULL','%SQL_SG_DELETE_TABLE','%SQL_SG_INSERT_COLUMN','%SQL_SG_INSERT_TABLE','%SQL_SG_REFERENCES_COLUMN',
- '%SQL_SG_REFERENCES_TABLE','%SQL_SG_SELECT_TABLE','%SQL_SG_UPDATE_COLUMN','%SQL_SG_UPDATE_TABLE','%SQL_SG_USAGE_ON_CHARACTER_SET','%SQL_SG_USAGE_ON_COLLATION','%SQL_SG_USAGE_ON_DOMAIN','%SQL_SG_USAGE_ON_TRANSLATION',
- '%SQL_SG_WITH_GRANT_OPTION','%SQL_SIGNED_OFFSET','%SQL_SIMULATE_CURSOR','%SQL_SMALLINT','%SQL_SNVF_BIT_LENGTH','%SQL_SNVF_CHARACTER_LENGTH','%SQL_SNVF_CHAR_LENGTH','%SQL_SNVF_EXTRACT',
- '%SQL_SNVF_OCTET_LENGTH','%SQL_SNVF_POSITION','%SQL_SO_DYNAMIC','%SQL_SO_FORWARD_ONLY','%SQL_SO_KEYSET_DRIVEN','%SQL_SO_MIXED','%SQL_SO_STATIC','%SQL_SPECIAL_CHARACTERS',
- '%SQL_SPEC_MAJOR','%SQL_SPEC_MINOR','%SQL_SP_BETWEEN','%SQL_SP_COMPARISON','%SQL_SP_EXISTS','%SQL_SP_IN','%SQL_SP_ISNOTNULL','%SQL_SP_ISNULL',
- '%SQL_SP_LIKE','%SQL_SP_MATCH_FULL','%SQL_SP_MATCH_PARTIAL','%SQL_SP_MATCH_UNIQUE_FULL','%SQL_SP_MATCH_UNIQUE_PARTIAL','%SQL_SP_OVERLAPS','%SQL_SP_QUANTIFIED_COMPARISON','%SQL_SP_UNIQUE',
- '%SQL_SQL92_DATETIME_FUNCTIONS','%SQL_SQL92_FOREIGN_KEY_DELETE_RULE','%SQL_SQL92_FOREIGN_KEY_UPDATE_RULE','%SQL_SQL92_GRANT','%SQL_SQL92_NUMERIC_VALUE_FUNCTIONS','%SQL_SQL92_PREDICATES','%SQL_SQL92_RELATIONAL_JOIN_OPERATORS','%SQL_SQL92_REVOKE',
- '%SQL_SQL92_ROW_VALUE_CONSTRUCTOR','%SQL_SQL92_STRING_FUNCTIONS','%SQL_SQL92_VALUE_EXPRESSIONS','%SQL_SQLSTATE_SIZE','%SQL_SQL_CONFORMANCE','%SQL_SQ_COMPARISON','%SQL_SQ_CORRELATED_SUBQUERIES','%SQL_SQ_EXISTS',
- '%SQL_SQ_IN','%SQL_SQ_QUANTIFIED','%SQL_SRJO_CORRESPONDING_CLAUSE','%SQL_SRJO_CROSS_JOIN','%SQL_SRJO_EXCEPT_JOIN','%SQL_SRJO_FULL_OUTER_JOIN','%SQL_SRJO_INNER_JOIN','%SQL_SRJO_INTERSECT_JOIN',
- '%SQL_SRJO_LEFT_OUTER_JOIN','%SQL_SRJO_NATURAL_JOIN','%SQL_SRJO_RIGHT_OUTER_JOIN','%SQL_SRJO_UNION_JOIN','%SQL_SRVC_DEFAULT','%SQL_SRVC_NULL','%SQL_SRVC_ROW_SUBQUERY','%SQL_SRVC_VALUE_EXPRESSION',
- '%SQL_SR_CASCADE','%SQL_SR_DELETE_TABLE','%SQL_SR_GRANT_OPTION_FOR','%SQL_SR_INSERT_COLUMN','%SQL_SR_INSERT_TABLE','%SQL_SR_REFERENCES_COLUMN','%SQL_SR_REFERENCES_TABLE','%SQL_SR_RESTRICT',
- '%SQL_SR_SELECT_TABLE','%SQL_SR_UPDATE_COLUMN','%SQL_SR_UPDATE_TABLE','%SQL_SR_USAGE_ON_CHARACTER_SET','%SQL_SR_USAGE_ON_COLLATION','%SQL_SR_USAGE_ON_DOMAIN','%SQL_SR_USAGE_ON_TRANSLATION','%SQL_SSF_CONVERT',
- '%SQL_SSF_LOWER','%SQL_SSF_SUBSTRING','%SQL_SSF_TRANSLATE','%SQL_SSF_TRIM_BOTH','%SQL_SSF_TRIM_LEADING','%SQL_SSF_TRIM_TRAILING','%SQL_SSF_UPPER','%SQL_SS_ADDITIONS',
- '%SQL_SS_DELETIONS','%SQL_SS_UPDATES','%SQL_STANDARD_CLI_CONFORMANCE','%SQL_STATIC_CURSOR_ATTRIBUTES1','%SQL_STATIC_CURSOR_ATTRIBUTES2','%SQL_STATIC_SENSITIVITY','%SQL_STILL_EXECUTING','%SQL_STRING_FUNCTIONS',
- '%SQL_SUBQUERIES','%SQL_SUCCESS','%SQL_SUCCESS_WITH_INFO','%SQL_SU_DML_STATEMENTS','%SQL_SU_INDEX_DEFINITION','%SQL_SU_PRIVILEGE_DEFINITION','%SQL_SU_PROCEDURE_INVOCATION','%SQL_SU_TABLE_DEFINITION',
- '%SQL_SVE_CASE','%SQL_SVE_CAST','%SQL_SVE_COALESCE','%SQL_SVE_NULLIF','%SQL_SYSTEM_FUNCTIONS','%SQL_TABLE_STAT','%SQL_TABLE_TERM','%SQL_TC_ALL',
- '%SQL_TC_DDL_COMMIT','%SQL_TC_DDL_IGNORE','%SQL_TC_DML','%SQL_TC_NONE','%SQL_TIME','%SQL_TIMEDATE_ADD_INTERVALS','%SQL_TIMEDATE_DIFF_INTERVALS','%SQL_TIMEDATE_FUNCTIONS',
- '%SQL_TIMESTAMP','%SQL_TIMESTAMP_LEN','%SQL_TIME_LEN','%SQL_TINYINT','%SQL_TRANSACTION_CAPABLE','%SQL_TRANSACTION_ISOLATION_OPTION','%SQL_TRANSACTION_READ_COMMITTED','%SQL_TRANSACTION_READ_UNCOMMITTED',
- '%SQL_TRANSACTION_REPEATABLE_READ','%SQL_TRANSACTION_SERIALIZABLE','%SQL_TRANSLATE_DLL','%SQL_TRANSLATE_OPTION','%SQL_TRUE','%SQL_TXN_CAPABLE','%SQL_TXN_ISOLATION','%SQL_TXN_ISOLATION_OPTION',
- '%SQL_TXN_READ_COMMITTED','%SQL_TXN_READ_UNCOMMITTED','%SQL_TXN_REPEATABLE_READ','%SQL_TXN_SERIALIZABLE','%SQL_TYPE_DATE','%SQL_TYPE_NULL','%SQL_TYPE_TIME','%SQL_TYPE_TIMESTAMP',
- '%SQL_UB_DEFAULT','%SQL_UB_FIXED','%SQL_UB_OFF','%SQL_UB_ON','%SQL_UB_VARIABLE','%SQL_UNBIND','%SQL_UNICODE','%SQL_UNICODE_CHAR',
- '%SQL_UNICODE_LONGVARCHAR','%SQL_UNICODE_VARCHAR','%SQL_UNION','%SQL_UNION_STATEMENT','%SQL_UNKNOWN_TYPE','%SQL_UNNAMED','%SQL_UNSEARCHABLE','%SQL_UNSIGNED_OFFSET',
- '%SQL_UNSPECIFIED','%SQL_UPDATE','%SQL_UPDATE_BY_BOOKMARK','%SQL_USER_NAME','%SQL_USE_BOOKMARKS','%SQL_US_UNION','%SQL_US_UNION_ALL','%SQL_U_UNION',
- '%SQL_U_UNION_ALL','%SQL_VARBINARY','%SQL_VARCHAR','%SQL_XOPEN_CLI_YEAR','%SQL_YEAR','%SQL_YEAR_TO_MONTH','%SRCCOPY','%SS_BITMAP',
- '%SS_BLACKFRAME','%SS_BLACKRECT','%SS_CENTER','%SS_CENTERIMAGE','%SS_ENDELLIPSIS','%SS_ETCHEDFRAME','%SS_ETCHEDHORZ','%SS_ETCHEDVERT',
- '%SS_GRAYFRAME','%SS_GRAYRECT','%SS_LEFT','%SS_NOPREFIX','%SS_NOTIFY','%SS_NOWORDWRAP','%SS_PATHELLIPSIS','%SS_RIGHT',
- '%SS_RIGHTJUST','%SS_SIMPLE','%SS_SUNKEN','%SS_WHITEFRAME','%SS_WHITERECT','%SS_WORDELLIPSIS','%STAT_FILL_FROM_MEMORY','%STAT_FILL_NATURAL',
- '%STAT_FILL_NATURAL_ERASTONE','%STAT_FILL_NATURAL_EVEN','%STAT_FILL_NATURAL_FIBONACCI','%STAT_FILL_NATURAL_ODD','%STAT_FILL_WITH_NUMBER','%STAT_MINMAX_INDEX','%STAT_MINMAX_VALUE','%STAT_TYPE_BYTE',
- '%STAT_TYPE_CURRENCY','%STAT_TYPE_DOUBLE','%STAT_TYPE_DWORD','%STAT_TYPE_EXT','%STAT_TYPE_INTEGER','%STAT_TYPE_LONG','%STAT_TYPE_QUAD','%STAT_TYPE_SINGLE',
- '%STAT_TYPE_WORD','%SWP_ASYNCWINDOWPOS','%SWP_DEFERERASE','%SWP_DRAWFRAME','%SWP_FRAMECHANGED','%SWP_HIDEWINDOW','%SWP_NOACTIVATE','%SWP_NOCOPYBITS',
- '%SWP_NOMOVE','%SWP_NOOWNERZORDER','%SWP_NOREDRAW','%SWP_NOREPOSITION','%SWP_NOSENDCHANGING','%SWP_NOSIZE','%SWP_NOZORDER','%SWP_SHOWWINDOW',
- '%SW_FORCEMINIMIZE','%SW_HIDE','%SW_MAXIMIZE','%SW_MINIMIZE','%SW_NORMAL','%SW_RESTORE','%SW_SHOW','%SW_SHOWDEFAULT',
- '%SW_SHOWMAXIMIZED','%SW_SHOWMINIMIZED','%SW_SHOWMINNOACTIVE','%SW_SHOWNA','%SW_SHOWNOACTIVATE','%SW_SHOWNORMAL','%TBASS_3DALG_DEFAULT','%TBASS_3DALG_FULL',
- '%TBASS_3DALG_LIGHT','%TBASS_3DALG_OFF','%TBASS_3DMODE_NORMAL','%TBASS_3DMODE_OFF','%TBASS_3DMODE_RELATIVE','%TBASS_ACTIVE_PAUSED','%TBASS_ACTIVE_PLAYING','%TBASS_ACTIVE_STALLED',
- '%TBASS_ACTIVE_STOPPED','%TBASS_CONFIG_3DALGORITHM','%TBASS_CONFIG_BUFFER','%TBASS_CONFIG_CURVE_PAN','%TBASS_CONFIG_CURVE_VOL','%TBASS_CONFIG_FLOATDSP','%TBASS_CONFIG_GVOL_MUSIC','%TBASS_CONFIG_GVOL_SAMPLE',
- '%TBASS_CONFIG_GVOL_STREAM','%TBASS_CONFIG_MAXVOL','%TBASS_CONFIG_MP3_CODEC','%TBASS_CONFIG_NET_AGENT','%TBASS_CONFIG_NET_BUFFER','%TBASS_CONFIG_NET_PASSIVE','%TBASS_CONFIG_NET_PREBUF','%TBASS_CONFIG_NET_PROXY',
- '%TBASS_CONFIG_NET_TIMEOUT','%TBASS_CONFIG_PAUSE_NOPLAY','%TBASS_CONFIG_UPDATEPERIOD','%TBASS_CTYPE_MUSIC_IT','%TBASS_CTYPE_MUSIC_MO3','%TBASS_CTYPE_MUSIC_MOD','%TBASS_CTYPE_MUSIC_MTM','%TBASS_CTYPE_MUSIC_S3M',
- '%TBASS_CTYPE_MUSIC_XM','%TBASS_CTYPE_RECORD','%TBASS_CTYPE_SAMPLE','%TBASS_CTYPE_STREAM','%TBASS_CTYPE_STREAM_AIFF','%TBASS_CTYPE_STREAM_MP1','%TBASS_CTYPE_STREAM_MP2','%TBASS_CTYPE_STREAM_MP3',
- '%TBASS_CTYPE_STREAM_OGG','%TBASS_CTYPE_STREAM_WAV','%TBASS_CTYPE_STREAM_WAV_FLOAT','%TBASS_CTYPE_STREAM_WAV_PCM','%TBASS_DATA_AVAILABLE','%TBASS_DATA_FFT1024','%TBASS_DATA_FFT2048','%TBASS_DATA_FFT4096',
- '%TBASS_DATA_FFT512','%TBASS_DATA_FFT_INDIVIDUAL','%TBASS_DATA_FFT_NOWINDOW','%TBASS_DATA_FLOAT','%TBASS_DEVICE_3D','%TBASS_DEVICE_8BITS','%TBASS_DEVICE_LATENCY','%TBASS_DEVICE_MONO',
- '%TBASS_DEVICE_NOSPEAKER','%TBASS_DEVICE_SPEAKERS','%TBASS_EAX_ENVIRONMENT_ALLEY','%TBASS_EAX_ENVIRONMENT_ARENA','%TBASS_EAX_ENVIRONMENT_AUDITORIUM','%TBASS_EAX_ENVIRONMENT_BATHROOM','%TBASS_EAX_ENVIRONMENT_CARPETEDHALLWAY','%TBASS_EAX_ENVIRONMENT_CAVE',
- '%TBASS_EAX_ENVIRONMENT_CITY','%TBASS_EAX_ENVIRONMENT_CONCERTHALL','%TBASS_EAX_ENVIRONMENT_COUNT','%TBASS_EAX_ENVIRONMENT_DIZZY','%TBASS_EAX_ENVIRONMENT_DRUGGED','%TBASS_EAX_ENVIRONMENT_FOREST','%TBASS_EAX_ENVIRONMENT_GENERIC','%TBASS_EAX_ENVIRONMENT_HALLWAY',
- '%TBASS_EAX_ENVIRONMENT_HANGAR','%TBASS_EAX_ENVIRONMENT_LIVINGROOM','%TBASS_EAX_ENVIRONMENT_MOUNTAINS','%TBASS_EAX_ENVIRONMENT_PADDEDCELL','%TBASS_EAX_ENVIRONMENT_PARKINGLOT','%TBASS_EAX_ENVIRONMENT_PLAIN','%TBASS_EAX_ENVIRONMENT_PSYCHOTIC','%TBASS_EAX_ENVIRONMENT_QUARRY',
- '%TBASS_EAX_ENVIRONMENT_ROOM','%TBASS_EAX_ENVIRONMENT_SEWERPIPE','%TBASS_EAX_ENVIRONMENT_STONECORRIDOR','%TBASS_EAX_ENVIRONMENT_STONEROOM','%TBASS_EAX_ENVIRONMENT_UNDERWATER','%TBASS_ERROR_ALREADY','%TBASS_ERROR_BUFLOST','%TBASS_ERROR_CODEC',
- '%TBASS_ERROR_CREATE','%TBASS_ERROR_DECODE','%TBASS_ERROR_DEVICE','%TBASS_ERROR_DRIVER','%TBASS_ERROR_DX','%TBASS_ERROR_EMPTY','%TBASS_ERROR_FILEFORM','%TBASS_ERROR_FILEOPEN',
- '%TBASS_ERROR_FORMAT','%TBASS_ERROR_FREQ','%TBASS_ERROR_HANDLE','%TBASS_ERROR_ILLPARAM','%TBASS_ERROR_ILLTYPE','%TBASS_ERROR_INIT','%TBASS_ERROR_MEM','%TBASS_ERROR_NO3D',
- '%TBASS_ERROR_NOCHAN','%TBASS_ERROR_NOEAX','%TBASS_ERROR_NOFX','%TBASS_ERROR_NOHW','%TBASS_ERROR_NONET','%TBASS_ERROR_NOPAUSE','%TBASS_ERROR_NOPLAY','%TBASS_ERROR_NOTAVAIL',
- '%TBASS_ERROR_NOTFILE','%TBASS_ERROR_PLAYING','%TBASS_ERROR_POSITION','%TBASS_ERROR_SPEAKER','%TBASS_ERROR_START','%TBASS_ERROR_TIMEOUT','%TBASS_ERROR_UNKNOWN','%TBASS_ERROR_VERSION',
- '%TBASS_FALSE','%TBASS_FILEPOS_CURRENT','%TBASS_FILEPOS_DECODE','%TBASS_FILEPOS_DOWNLOAD','%TBASS_FILEPOS_END','%TBASS_FILEPOS_START','%TBASS_FILE_CLOSE','%TBASS_FILE_LEN',
- '%TBASS_FILE_READ','%TBASS_FILE_SEEK','%TBASS_FX_CHORUS','%TBASS_FX_COMPRESSOR','%TBASS_FX_DISTORTION','%TBASS_FX_ECHO','%TBASS_FX_FLANGER','%TBASS_FX_GARGLE',
- '%TBASS_FX_I3DL2REVERB','%TBASS_FX_PARAMEQ','%TBASS_FX_PHASE_180','%TBASS_FX_PHASE_90','%TBASS_FX_PHASE_NEG_180','%TBASS_FX_PHASE_NEG_90','%TBASS_FX_PHASE_ZERO','%TBASS_FX_REVERB',
- '%TBASS_INPUT_LEVEL','%TBASS_INPUT_OFF','%TBASS_INPUT_ON','%TBASS_INPUT_TYPE_ANALOG','%TBASS_INPUT_TYPE_AUX','%TBASS_INPUT_TYPE_CD','%TBASS_INPUT_TYPE_DIGITAL','%TBASS_INPUT_TYPE_LINE',
- '%TBASS_INPUT_TYPE_MASK','%TBASS_INPUT_TYPE_MIC','%TBASS_INPUT_TYPE_PHONE','%TBASS_INPUT_TYPE_SPEAKER','%TBASS_INPUT_TYPE_SYNTH','%TBASS_INPUT_TYPE_UNDEF','%TBASS_INPUT_TYPE_WAVE','%TBASS_MP3_SETPOS',
- '%TBASS_MUSIC_3D','%TBASS_MUSIC_ATTRIB_AMPLIFY','%TBASS_MUSIC_ATTRIB_BPM','%TBASS_MUSIC_ATTRIB_PANSEP','%TBASS_MUSIC_ATTRIB_PSCALER','%TBASS_MUSIC_ATTRIB_SPEED','%TBASS_MUSIC_ATTRIB_VOL_CHAN','%TBASS_MUSIC_ATTRIB_VOL_GLOBAL',
- '%TBASS_MUSIC_ATTRIB_VOL_INST','%TBASS_MUSIC_AUTOFREE','%TBASS_MUSIC_CALCLEN','%TBASS_MUSIC_DECODE','%TBASS_MUSIC_FLOAT','%TBASS_MUSIC_FT2MOD','%TBASS_MUSIC_FX','%TBASS_MUSIC_LOOP',
- '%TBASS_MUSIC_MONO','%TBASS_MUSIC_NONINTER','%TBASS_MUSIC_NOSAMPLE','%TBASS_MUSIC_POSRESET','%TBASS_MUSIC_POSRESETEX','%TBASS_MUSIC_PRESCAN','%TBASS_MUSIC_PT1MOD','%TBASS_MUSIC_RAMP',
- '%TBASS_MUSIC_RAMPS','%TBASS_MUSIC_STOPBACK','%TBASS_MUSIC_SURROUND','%TBASS_MUSIC_SURROUND2','%TBASS_OBJECT_DS','%TBASS_OBJECT_DS3DL','%TBASS_OK','%TBASS_RECORD_PAUSE',
- '%TBASS_SAMPLE_3D','%TBASS_SAMPLE_8BITS','%TBASS_SAMPLE_FLOAT','%TBASS_SAMPLE_FX','%TBASS_SAMPLE_LOOP','%TBASS_SAMPLE_MONO','%TBASS_SAMPLE_MUTEMAX','%TBASS_SAMPLE_OVER_DIST',
- '%TBASS_SAMPLE_OVER_POS','%TBASS_SAMPLE_OVER_VOL','%TBASS_SAMPLE_SOFTWARE','%TBASS_SAMPLE_VAM','%TBASS_SLIDE_FREQ','%TBASS_SLIDE_PAN','%TBASS_SLIDE_VOL','%TBASS_SPEAKER_CENLFE',
- '%TBASS_SPEAKER_CENTER','%TBASS_SPEAKER_FRONT','%TBASS_SPEAKER_FRONTLEFT','%TBASS_SPEAKER_FRONTRIGHT','%TBASS_SPEAKER_LEFT','%TBASS_SPEAKER_LFE','%TBASS_SPEAKER_REAR','%TBASS_SPEAKER_REAR2',
- '%TBASS_SPEAKER_REAR2LEFT','%TBASS_SPEAKER_REAR2RIGHT','%TBASS_SPEAKER_REARLEFT','%TBASS_SPEAKER_REARRIGHT','%TBASS_SPEAKER_RIGHT','%TBASS_STREAMPROC_END','%TBASS_STREAM_AUTOFREE','%TBASS_STREAM_BLOCK',
- '%TBASS_STREAM_DECODE','%TBASS_STREAM_PRESCAN','%TBASS_STREAM_RESTRATE','%TBASS_STREAM_STATUS','%TBASS_SYNC_DOWNLOAD','%TBASS_SYNC_END','%TBASS_SYNC_FREE','%TBASS_SYNC_MESSAGE',
- '%TBASS_SYNC_META','%TBASS_SYNC_MIXTIME','%TBASS_SYNC_MUSICFX','%TBASS_SYNC_MUSICINST','%TBASS_SYNC_MUSICPOS','%TBASS_SYNC_ONETIME','%TBASS_SYNC_POS','%TBASS_SYNC_SLIDE',
- '%TBASS_SYNC_STALL','%TBASS_TAG_HTTP','%TBASS_TAG_ICY','%TBASS_TAG_ID3','%TBASS_TAG_ID3V2','%TBASS_TAG_META','%TBASS_TAG_MUSIC_INST','%TBASS_TAG_MUSIC_MESSAGE',
- '%TBASS_TAG_MUSIC_NAME','%TBASS_TAG_MUSIC_SAMPLE','%TBASS_TAG_OGG','%TBASS_TAG_RIFF_INFO','%TBASS_TAG_VENDOR','%TBASS_TRUE','%TBASS_UNICODE','%TBASS_VAM_HARDWARE',
- '%TBASS_VAM_SOFTWARE','%TBASS_VAM_TERM_DIST','%TBASS_VAM_TERM_PRIO','%TBASS_VAM_TERM_TIME','%TBASS_VERSION','%TBCD_CHANNEL','%TBCD_THUMB','%TBCD_TICS',
- '%TBGL_ALIGN_CENTER','%TBGL_ALIGN_CENTER_CENTER','%TBGL_ALIGN_CENTER_DOWN','%TBGL_ALIGN_CENTER_UP','%TBGL_ALIGN_LEFT','%TBGL_ALIGN_LEFT_CENTER','%TBGL_ALIGN_LEFT_DOWN','%TBGL_ALIGN_LEFT_UP',
- '%TBGL_ALIGN_RIGHT','%TBGL_ALIGN_RIGHT_CENTER','%TBGL_ALIGN_RIGHT_DOWN','%TBGL_ALIGN_RIGHT_UP','%TBGL_ALWAYS','%TBGL_EQUAL','%TBGL_ERROR_FILE','%TBGL_ERROR_MSGBOX',
- '%TBGL_ERROR_NONE','%TBGL_GEQUAL','%TBGL_GREATER','%TBGL_LEQUAL','%TBGL_LESS','%TBGL_LIGHT_AMBIENT','%TBGL_LIGHT_CONSTANT_ATTENUATION','%TBGL_LIGHT_DIFFUSE',
- '%TBGL_LIGHT_LINEAR_ATTENUATION','%TBGL_LIGHT_POSITION','%TBGL_LIGHT_QUADRATIC_ATTENUATION','%TBGL_LIGHT_SPECULAR','%TBGL_LIGHT_SPOT_CUTOFF','%TBGL_LIGHT_SPOT_DIRECTION','%TBGL_LIGHT_SPOT_EXPONENT','%TBGL_M15B',
- '%TBGL_M15G','%TBGL_M15LAYER','%TBGL_M15PSTOP','%TBGL_M15R','%TBGL_M15TEXN','%TBGL_M15TEXX','%TBGL_M15TEXY','%TBGL_M15X',
- '%TBGL_M15Y','%TBGL_M15Z','%TBGL_NEVER','%TBGL_NORMAL_NONE','%TBGL_NORMAL_PRECISE','%TBGL_NORMAL_SMOOTH','%TBGL_NOTEQUAL','%TBGL_OBJ_CUBE',
- '%TBGL_OBJ_CUBE3','%TBGL_OBJ_CYLINDER','%TBGL_OBJ_SPHERE','%TBGL_PINFO_RGB','%TBGL_PINFO_XYZ','%TBGL_TEX_LINEAR','%TBGL_TEX_MIPMAP','%TBGL_TEX_NEAREST',
- '%TBM_CLEARSEL','%TBM_CLEARTICS','%TBM_GETBUDDY','%TBM_GETCHANNELRECT','%TBM_GETLINESIZE','%TBM_GETNUMTICS','%TBM_GETPAGESIZE','%TBM_GETPOS',
- '%TBM_GETPTICS','%TBM_GETRANGEMAX','%TBM_GETRANGEMIN','%TBM_GETSELEND','%TBM_GETSELSTART','%TBM_GETTHUMBLENGTH','%TBM_GETTHUMBRECT','%TBM_GETTIC',
- '%TBM_GETTICPOS','%TBM_GETTOOLTIPS','%TBM_GETUNICODEFORMAT','%TBM_SETBUDDY','%TBM_SETLINESIZE','%TBM_SETPAGESIZE','%TBM_SETPOS','%TBM_SETRANGE',
- '%TBM_SETRANGEMAX','%TBM_SETRANGEMIN','%TBM_SETSEL','%TBM_SETSELEND','%TBM_SETSELSTART','%TBM_SETTHUMBLENGTH','%TBM_SETTIC','%TBM_SETTICFREQ',
- '%TBM_SETTIPSIDE','%TBM_SETTOOLTIPS','%TBM_SETUNICODEFORMAT','%TBS_AUTOTICKS','%TBS_BOTH','%TBS_BOTTOM','%TBS_DOWNISLEFT','%TBS_ENABLESELRANGE',
- '%TBS_FIXEDLENGTH','%TBS_HORZ','%TBS_LEFT','%TBS_NOTHUMB','%TBS_NOTICKS','%TBS_REVERSED','%TBS_RIGHT','%TBS_TOOLTIPS',
- '%TBS_TOP','%TBS_VERT','%TBTS_BOTTOM','%TBTS_LEFT','%TBTS_RIGHT','%TBTS_TOP','%TB_%VT_BSTR','%TB_%VT_CY',
- '%TB_%VT_DATE','%TB_%VT_EMPTY','%TB_%VT_I2','%TB_%VT_I4','%TB_%VT_NULL','%TB_%VT_R4','%TB_%VT_R8','%TB_BOTTOM',
- '%TB_CLASS_E_NOAGGREGATION','%TB_CO_E_CLASSSTRING','%TB_DISPATCH_METHOD','%TB_DISPATCH_PROPERTYGET','%TB_DISPATCH_PROPERTYPUT','%TB_DISPATCH_PROPERTYPUTREF','%TB_ENDTRACK','%TB_E_INVALIDARG',
- '%TB_E_NOINTERFACE','%TB_E_OUTOFMEMORY','%TB_IMGCTX_ACTUALSIZE','%TB_IMGCTX_AUTOSIZE','%TB_IMGCTX_FITTOHEIGHT','%TB_IMGCTX_FITTOWIDTH','%TB_IMGCTX_STRETCH','%TB_LINEDOWN',
- '%TB_LINEUP','%TB_MK_E_CONNECTMANUALLY','%TB_MK_E_EXCEEDEDDEADLINE','%TB_MK_E_INTERMEDIATEINTERFACENOTSUPPORTED','%TB_MK_E_NOOBJECT','%TB_MK_E_SYNTAX','%TB_PAGEDOWN','%TB_PAGEUP',
- '%TB_REGDB_E_CLASSNOTREG','%TB_REGDB_E_WRITEREGDB','%TB_SIZEOF_TBVARIANT','%TB_S_FALSE','%TB_S_OK','%TB_THUMBPOSITION','%TB_THUMBTRACK','%TB_TOP',
- '%TCM_FIRST','%TCM_GETCURSEL','%TCN_FOCUSCHANGE','%TCN_GETOBJECT','%TCN_SELCHANGE','%TCN_SELCHANGING','%TCS_BOTTOM','%TCS_BUTTONS',
- '%TCS_EX_FLATSEPARATORS','%TCS_EX_REGISTERDROP','%TCS_FIXEDWIDTH','%TCS_FLATBUTTONS','%TCS_FOCUSNEVER','%TCS_FOCUSONBUTTONDOWN','%TCS_FORCEICONLEFT','%TCS_FORCELABELLEFT',
- '%TCS_HOTTRACK','%TCS_MULTILINE','%TCS_MULTISELECT','%TCS_OWNERDRAWFIXED','%TCS_RAGGEDRIGHT','%TCS_RIGHT','%TCS_RIGHTJUSTIFY','%TCS_SCROLLOPPOSITE',
- '%TCS_SINGLELINE','%TCS_TABS','%TCS_TOOLTIPS','%TCS_VERTICAL','%TM_PLAINTEXT','%TM_RICHTEXT','%TOKENIZER_DEFAULT_ALPHA','%TOKENIZER_DEFAULT_DELIM',
- '%TOKENIZER_DEFAULT_DQUOTE','%TOKENIZER_DEFAULT_NEWLINE','%TOKENIZER_DEFAULT_NUMERIC','%TOKENIZER_DEFAULT_SPACE','%TOKENIZER_DELIMITER','%TOKENIZER_EOL','%TOKENIZER_ERROR','%TOKENIZER_FINISHED',
- '%TOKENIZER_NUMBER','%TOKENIZER_QUOTE','%TOKENIZER_STRING','%TOKENIZER_UNDEFTOK','%TRUE','%TV_FIRST','%UDM_GETACCEL','%UDM_GETBASE',
- '%UDM_GETBUDDY','%UDM_GETPOS','%UDM_GETPOS32','%UDM_GETRANGE','%UDM_GETRANGE32','%UDM_GETUNICODEFORMAT','%UDM_SETACCEL','%UDM_SETBASE',
- '%UDM_SETBUDDY','%UDM_SETPOS','%UDM_SETPOS32','%UDM_SETRANGE','%UDM_SETRANGE32','%UDM_SETUNICODEFORMAT','%UDS_ALIGNLEFT','%UDS_ALIGNRIGHT',
- '%UDS_ARROWKEYS','%UDS_AUTOBUDDY','%UDS_HORZ','%UDS_HOTTRACK','%UDS_NOTHOUSANDS','%UDS_SETBUDDYINT','%UDS_WRAP','%UD_MAXVAL',
- '%UD_MINVAL','%VK_0','%VK_1','%VK_2','%VK_3','%VK_4','%VK_5','%VK_6',
- '%VK_7','%VK_8','%VK_9','%VK_A','%VK_ACCEPT','%VK_ADD','%VK_APPS','%VK_B',
- '%VK_BACK','%VK_C','%VK_CANCEL','%VK_CAPITAL','%VK_CLEAR','%VK_CONTROL','%VK_CONVERT','%VK_D',
- '%VK_DECIMAL','%VK_DELETE','%VK_DIVIDE','%VK_DOWN','%VK_E','%VK_END','%VK_ESCAPE','%VK_EXECUTE',
- '%VK_F','%VK_F1','%VK_F10','%VK_F11','%VK_F12','%VK_F13','%VK_F14','%VK_F15',
- '%VK_F16','%VK_F17','%VK_F18','%VK_F19','%VK_F2','%VK_F20','%VK_F21','%VK_F22',
- '%VK_F23','%VK_F24','%VK_F3','%VK_F4','%VK_F5','%VK_F6','%VK_F7','%VK_F8',
- '%VK_F9','%VK_FINAL','%VK_G','%VK_H','%VK_HANGEUL','%VK_HANGUL','%VK_HANJA','%VK_HELP',
- '%VK_HOME','%VK_I','%VK_INSERT','%VK_J','%VK_JUNJA','%VK_K','%VK_KANA','%VK_KANJI',
- '%VK_L','%VK_LBUTTON','%VK_LEFT','%VK_LINEFEED','%VK_LWIN','%VK_M','%VK_MBUTTON','%VK_MENU',
- '%VK_MODECHANGE','%VK_MULTIPLY','%VK_N','%VK_NEXT','%VK_NONCONVERT','%VK_NUMLOCK','%VK_NUMPAD0','%VK_NUMPAD1',
- '%VK_NUMPAD2','%VK_NUMPAD3','%VK_NUMPAD4','%VK_NUMPAD5','%VK_NUMPAD6','%VK_NUMPAD7','%VK_NUMPAD8','%VK_NUMPAD9',
- '%VK_O','%VK_P','%VK_PAUSE','%VK_PGDN','%VK_PGUP','%VK_PRINT','%VK_PRIOR','%VK_Q',
- '%VK_R','%VK_RBUTTON','%VK_RETURN','%VK_RIGHT','%VK_RWIN','%VK_S','%VK_SCROLL','%VK_SELECT',
- '%VK_SEPARATOR','%VK_SHIFT','%VK_SLEEP','%VK_SNAPSHOT','%VK_SPACE','%VK_SUBTRACT','%VK_T','%VK_TAB',
- '%VK_U','%VK_UP','%VK_V','%VK_W','%VK_X','%VK_XBUTTON1','%VK_XBUTTON2','%VK_Y',
- '%VK_Z','%VT_ARRAY','%VT_BLOB','%VT_BLOB_OBJECT','%VT_BOOL','%VT_BSTR','%VT_BYREF','%VT_CARRAY',
- '%VT_CF','%VT_CLSID','%VT_CY','%VT_DATE','%VT_DISPATCH','%VT_EMPTY','%VT_ERROR','%VT_FILETIME',
- '%VT_HRESULT','%VT_I1','%VT_I2','%VT_I4','%VT_I8','%VT_INT','%VT_LPSTR','%VT_LPWSTR',
- '%VT_NULL','%VT_PTR','%VT_R4','%VT_R8','%VT_RECORD','%VT_RESERVED','%VT_SAFEARRAY','%VT_STORAGE',
- '%VT_STORED_OBJECT','%VT_STREAM','%VT_STREAMED_OBJECT','%VT_UI1','%VT_UI2','%VT_UI4','%VT_UI8','%VT_UINT',
- '%VT_UNKNOWN','%VT_USERDEFINED','%VT_VARIANT','%VT_VECTOR','%VT_VOID','%WAVE_FORMAT_1M08','%WAVE_FORMAT_1M16','%WAVE_FORMAT_1S08',
- '%WAVE_FORMAT_1S16','%WAVE_FORMAT_2M08','%WAVE_FORMAT_2M16','%WAVE_FORMAT_2S08','%WAVE_FORMAT_2S16','%WAVE_FORMAT_4M08','%WAVE_FORMAT_4M16','%WAVE_FORMAT_4S08',
- '%WAVE_FORMAT_4S16','%WBF_CUSTOM','%WBF_LEVEL1','%WBF_LEVEL2','%WBF_OVERFLOW','%WBF_WORDBREAK','%WBF_WORDWRAP','%WHITE',
- '%WIN_FINDTITLECONTAIN','%WIN_FINDTITLEEND','%WIN_FINDTITLEEQUAL','%WIN_FINDTITLESTART','%WM_ACTIVATE','%WM_ACTIVATEAPP','%WM_CAPTURECHANGED','%WM_CHAR',
- '%WM_CLOSE','%WM_COMMAND','%WM_DESTROY','%WM_DROPFILES','%WM_ERASEBKGND','%WM_GETTEXTLENGTH','%WM_HOTKEY','%WM_HSCROLL',
- '%WM_IDLE','%WM_INITDIALOG','%WM_KEYDOWN','%WM_KEYUP','%WM_KILLFOCUS','%WM_LBUTTONDBLCLK','%WM_LBUTTONDOWN','%WM_LBUTTONUP',
- '%WM_MBUTTONDBLCLK','%WM_MBUTTONDOWN','%WM_MBUTTONUP','%WM_MOUSEFIRST','%WM_MOUSEMOVE','%WM_MOUSEWHEEL','%WM_MOVE','%WM_MOVING',
- '%WM_NCLBUTTONDOWN','%WM_NCRBUTTONDOWN','%WM_NEXTDLGCTL','%WM_NOTIFY','%WM_PAINT','%WM_QUIT','%WM_RBUTTONDBLCLK','%WM_RBUTTONDOWN',
- '%WM_RBUTTONUP','%WM_SETFOCUS','%WM_SETFONT','%WM_SETTEXT','%WM_SIZE','%WM_SIZING','%WM_SYSCOMMAND','%WM_TIMER',
- '%WM_USER','%WM_VSCROLL','%WS_BORDER','%WS_CAPTION','%WS_CHILD','%WS_CLIPCHILDREN','%WS_CLIPSIBLINGS','%WS_DISABLED',
- '%WS_DLGFRAME','%WS_EX_ACCEPTFILES','%WS_EX_APPWINDOW','%WS_EX_CLIENTEDGE','%WS_EX_CONTEXTHELP','%WS_EX_CONTROLPARENT','%WS_EX_LAYERED','%WS_EX_LEFT',
- '%WS_EX_LEFTSCROLLBAR','%WS_EX_LTRREADING','%WS_EX_MDICHILD','%WS_EX_NOPARENTNOTIFY','%WS_EX_OVERLAPPEDWINDOW','%WS_EX_PALETTEWINDOW','%WS_EX_RIGHT','%WS_EX_RIGHTSCROLLBAR',
- '%WS_EX_RTLREADING','%WS_EX_STATICEDGE','%WS_EX_TOOLWINDOW','%WS_EX_TOPMOST','%WS_EX_TRANSPARENT','%WS_EX_WINDOWEDGE','%WS_GROUP','%WS_HSCROLL',
- '%WS_ICONIC','%WS_MAXIMIZE','%WS_MAXIMIZEBOX','%WS_MINIMIZE','%WS_MINIMIZEBOX','%WS_OVERLAPPEDWINDOW','%WS_POPUP','%WS_POPUPWINDOW',
- '%WS_SYSMENU','%WS_TABSTOP','%WS_THICKFRAME','%WS_VISIBLE','%WS_VSCROLL','%YELLOW','%ZERO','CRLF',
- 'FALSE','M_E','M_PI','NULL','TAB','TRUE'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%', '^', '&', ':'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF; font-weight: bold;',
- 2 => 'color: #993333; font-style: italic; font-weight: bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #333333;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #800080;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #CC0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #66cc66;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #333333;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- 1 => '_'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/tsql.php b/libvpx/examples/includes/geshi/geshi/tsql.php
deleted file mode 100644
index dd6b0cc..0000000
--- a/libvpx/examples/includes/geshi/geshi/tsql.php
+++ /dev/null
@@ -1,378 +0,0 @@
-<?php
-/*************************************************************************************
- * tsql.php
- * --------
- * Author: Duncan Lock (dunc@dflock.co.uk)
- * Copyright: (c) 2006 Duncan Lock (http://dflock.co.uk/), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2005/11/22
- *
- * T-SQL language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/01/23 (1.0.0)
- * - First Release
- *
- * TODO (updated 2006/01/23)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'T-SQL',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- // Datatypes
- 'bigint', 'int', 'smallint', 'tinyint', 'bit', 'decimal', 'numeric', 'money',
- 'smallmoney', 'float', 'real', 'datetime', 'smalldatetime', 'char', 'varchar',
- 'text', 'nchar', 'nvarchar', 'ntext', 'binary', 'varbinary', 'image', 'cursor',
- 'sql_variant', 'table', 'timestamp', 'uniqueidentifier',
-
- // Keywords
- 'ABSOLUTE', 'ACTION', 'ADD', 'ADMIN', 'AFTER', 'AGGREGATE', 'ALIAS', 'ALLOCATE', 'ALTER', 'ARE', 'ARRAY', 'AS',
- 'ASC', 'ASSERTION', 'AT', 'AUTHORIZATION', 'BACKUP', 'BEFORE', 'BEGIN', 'BINARY', 'BIT', 'BLOB', 'BOOLEAN', 'BOTH', 'BREADTH',
- 'BREAK', 'BROWSE', 'BULK', 'BY', 'CALL', 'CASCADE', 'CASCADED', 'CASE', 'CAST', 'CATALOG', 'CHAR', 'CHARACTER', 'CHECK', 'CHECKPOINT',
- 'CLASS', 'CLOB', 'CLOSE', 'CLUSTERED', 'COALESCE', 'COLLATE', 'COLLATION', 'COLUMN', 'COMMIT', 'COMPLETION', 'COMPUTE', 'CONNECT',
- 'CONNECTION', 'CONSTRAINT', 'CONSTRAINTS', 'CONSTRUCTOR', 'CONTAINS', 'CONTAINSTABLE', 'CONTINUE', 'CONVERT', 'CORRESPONDING', 'CREATE',
- 'CUBE', 'CURRENT', 'CURRENT_DATE', 'CURRENT_PATH', 'CURRENT_ROLE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER',
- 'CURSOR', 'CYCLE', 'DATA', 'DATABASE', 'DATE', 'DAY', 'DBCC', 'DEALLOCATE', 'DEC', 'DECIMAL', 'DECLARE', 'DEFAULT', 'DEFERRABLE',
- 'DEFERRED', 'DELETE', 'DENY', 'DEPTH', 'DEREF', 'DESC', 'DESCRIBE', 'DESCRIPTOR', 'DESTROY', 'DESTRUCTOR', 'DETERMINISTIC',
- 'DIAGNOSTICS', 'DICTIONARY', 'DISCONNECT', 'DISK', 'DISTINCT', 'DISTRIBUTED', 'DOMAIN', 'DOUBLE', 'DROP', 'DUMMY', 'DUMP', 'DYNAMIC',
- 'EACH', 'ELSE', 'END', 'END-EXEC', 'EQUALS', 'ERRLVL', 'ESCAPE', 'EVERY', 'EXCEPT', 'EXCEPTION', 'EXEC', 'EXECUTE', 'EXIT',
- 'EXTERNAL', 'FALSE', 'FETCH', 'FILE', 'FILLFACTOR', 'FIRST', 'FLOAT', 'FOR', 'FOREIGN', 'FOUND', 'FREE', 'FREETEXT', 'FREETEXTTABLE',
- 'FROM', 'FULL', 'FUNCTION', 'GENERAL', 'GET', 'GLOBAL', 'GOTO', 'GRANT', 'GROUP', 'GROUPING', 'HAVING', 'HOLDLOCK', 'HOST', 'HOUR',
- 'IDENTITY', 'IDENTITY_INSERT', 'IDENTITYCOL', 'IF', 'IGNORE', 'IMMEDIATE', 'INDEX', 'INDICATOR', 'INITIALIZE', 'INITIALLY',
- 'INNER', 'INOUT', 'INPUT', 'INSERT', 'INT', 'INTEGER', 'INTERSECT', 'INTERVAL', 'INTO', 'IS', 'ISOLATION', 'ITERATE', 'KEY',
- 'KILL', 'LANGUAGE', 'LARGE', 'LAST', 'LATERAL', 'LEADING', 'LEFT', 'LESS', 'LEVEL', 'LIMIT', 'LINENO', 'LOAD', 'LOCAL',
- 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCATOR', 'MAP', 'MATCH', 'MINUTE', 'MODIFIES', 'MODIFY', 'MODULE', 'MONTH', 'NAMES', 'NATIONAL',
- 'NATURAL', 'NCHAR', 'NCLOB', 'NEW', 'NEXT', 'NO', 'NOCHECK', 'NONCLUSTERED', 'NONE', 'NULLIF', 'NUMERIC', 'OBJECT', 'OF',
- 'OFF', 'OFFSETS', 'OLD', 'ON', 'ONLY', 'OPEN', 'OPENDATASOURCE', 'OPENQUERY', 'OPENROWSET', 'OPENXML', 'OPERATION', 'OPTION',
- 'ORDER', 'ORDINALITY', 'OUT', 'OUTPUT', 'OVER', 'PAD', 'PARAMETER', 'PARAMETERS', 'PARTIAL', 'PATH', 'PERCENT', 'PLAN',
- 'POSTFIX', 'PRECISION', 'PREFIX', 'PREORDER', 'PREPARE', 'PRESERVE', 'PRIMARY', 'PRINT', 'PRIOR', 'PRIVILEGES', 'PROC', 'PROCEDURE',
- 'PUBLIC', 'RAISERROR', 'READ', 'READS', 'READTEXT', 'REAL', 'RECONFIGURE', 'RECURSIVE', 'REF', 'REFERENCES', 'REFERENCING', 'RELATIVE',
- 'REPLICATION', 'RESTORE', 'RESTRICT', 'RESULT', 'RETURN', 'RETURNS', 'REVOKE', 'RIGHT', 'ROLE', 'ROLLBACK', 'ROLLUP', 'ROUTINE', 'ROW',
- 'ROWGUIDCOL', 'ROWS', 'RULE', 'SAVE', 'SAVEPOINT', 'SCHEMA', 'SCOPE', 'SCROLL', 'SEARCH', 'SECOND', 'SECTION', 'SELECT',
- 'SEQUENCE', 'SESSION', 'SESSION_USER', 'SET', 'SETS', 'SETUSER', 'SHUTDOWN', 'SIZE', 'SMALLINT', 'SPACE', 'SPECIFIC',
- 'SPECIFICTYPE', 'SQL', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'START', 'STATE', 'STATEMENT', 'STATIC', 'STATISTICS', 'STRUCTURE',
- 'SYSTEM_USER', 'TABLE', 'TEMPORARY', 'TERMINATE', 'TEXTSIZE', 'THAN', 'THEN', 'TIME', 'TIMESTAMP', 'TIMEZONE_HOUR', 'TIMEZONE_MINUTE',
- 'TO', 'TOP', 'TRAILING', 'TRAN', 'TRANSACTION', 'TRANSLATION', 'TREAT', 'TRIGGER', 'TRUE', 'TRUNCATE', 'TSEQUAL', 'UNDER', 'UNION',
- 'UNIQUE', 'UNKNOWN', 'UNNEST', 'UPDATE', 'UPDATETEXT', 'USAGE', 'USE', 'USER', 'USING', 'VALUE', 'VALUES', 'VARCHAR', 'VARIABLE',
- 'VARYING', 'VIEW', 'WAITFOR', 'WHEN', 'WHENEVER', 'WHERE', 'WHILE', 'WITH', 'WITHOUT', 'WORK', 'WRITE', 'WRITETEXT', 'YEAR', 'ZONE',
- 'UNCOMMITTED', 'NOCOUNT',
- ),
- 2 => array(
- /*
- Built-in functions
- Highlighted in pink.
- */
-
- //Configuration Functions
- '@@DATEFIRST','@@OPTIONS','@@DBTS','@@REMSERVER','@@LANGID','@@SERVERNAME',
- '@@LANGUAGE','@@SERVICENAME','@@LOCK_TIMEOUT','@@SPID','@@MAX_CONNECTIONS','@@TEXTSIZE',
- '@@MAX_PRECISION','@@VERSION','@@NESTLEVEL',
-
- //Cursor Functions
- '@@CURSOR_ROWS','@@FETCH_STATUS',
-
- //Date and Time Functions
- 'DATEADD','DATEDIFF','DATENAME','DATEPART','DAY','GETDATE','GETUTCDATE','MONTH','YEAR',
-
- //Mathematical Functions
- 'ABS','DEGREES','RAND','ACOS','EXP','ROUND','ASIN','FLOOR','SIGN',
- 'ATAN','LOG','SIN','ATN2','LOG10','SQUARE','CEILING','PI','SQRT','COS',
- 'POWER','TAN','COT','RADIANS',
-
- //Meta Data Functions
- 'COL_LENGTH','fn_listextendedproperty','COL_NAME','FULLTEXTCATALOGPROPERTY',
- 'COLUMNPROPERTY','FULLTEXTSERVICEPROPERTY','DATABASEPROPERTY','INDEX_COL',
- 'DATABASEPROPERTYEX','INDEXKEY_PROPERTY','DB_ID','INDEXPROPERTY','DB_NAME',
- 'OBJECT_ID','FILE_ID','OBJECT_NAME','FILE_NAME','OBJECTPROPERTY','FILEGROUP_ID',
- '@@PROCID','FILEGROUP_NAME','SQL_VARIANT_PROPERTY','FILEGROUPPROPERTY',
- 'TYPEPROPERTY','FILEPROPERTY',
-
- //Security Functions
- 'fn_trace_geteventinfo','IS_SRVROLEMEMBER','fn_trace_getfilterinfo','SUSER_SID',
- 'fn_trace_getinfo','SUSER_SNAME','fn_trace_gettable','USER_ID','HAS_DBACCESS',
- 'IS_MEMBER',
-
- //String Functions
- 'ASCII','NCHAR','SOUNDEX','CHAR','PATINDEX','SPACE','CHARINDEX',
- 'REPLACE','STR','DIFFERENCE','QUOTENAME','STUFF','LEFT','REPLICATE',
- 'SUBSTRING','LEN','REVERSE','UNICODE','LOWER','RIGHT','UPPER','LTRIM',
- 'RTRIM',
-
- //System Functions
- 'APP_NAME','COLLATIONPROPERTY','@@ERROR','fn_helpcollations',
- 'fn_servershareddrives','fn_virtualfilestats','FORMATMESSAGE',
- 'GETANSINULL','HOST_ID','HOST_NAME','IDENT_CURRENT','IDENT_INCR',
- 'IDENT_SEED','@@IDENTITY','ISDATE','ISNUMERIC','PARSENAME','PERMISSIONS',
- '@@ROWCOUNT','ROWCOUNT_BIG','SCOPE_IDENTITY','SERVERPROPERTY','SESSIONPROPERTY',
- 'STATS_DATE','@@TRANCOUNT','USER_NAME',
-
- //System Statistical Functions
- '@@CONNECTIONS','@@PACK_RECEIVED','@@CPU_BUSY','@@PACK_SENT',
- '@@TIMETICKS','@@IDLE','@@TOTAL_ERRORS','@@IO_BUSY',
- '@@TOTAL_READ','@@PACKET_ERRORS','@@TOTAL_WRITE',
-
- //Text and Image Functions
- 'TEXTPTR','TEXTVALID',
-
- //Aggregate functions
- 'AVG', 'MAX', 'BINARY_CHECKSUM', 'MIN', 'CHECKSUM', 'SUM', 'CHECKSUM_AGG',
- 'STDEV', 'COUNT', 'STDEVP', 'COUNT_BIG', 'VAR', 'GROUPING', 'VARP'
- ),
- 3 => array(
- /*
- System stored procedures
- Higlighted dark brown
- */
-
- //Active Directory Procedures
- 'sp_ActiveDirectory_Obj', 'sp_ActiveDirectory_SCP',
-
- //Catalog Procedures
- 'sp_column_privileges', 'sp_special_columns', 'sp_columns', 'sp_sproc_columns',
- 'sp_databases', 'sp_statistics', 'sp_fkeys', 'sp_stored_procedures', 'sp_pkeys',
- 'sp_table_privileges', 'sp_server_info', 'sp_tables',
-
- //Cursor Procedures
- 'sp_cursor_list', 'sp_describe_cursor_columns', 'sp_describe_cursor', 'sp_describe_cursor_tables',
-
- //Database Maintenance Plan Procedures
- 'sp_add_maintenance_plan', 'sp_delete_maintenance_plan_db', 'sp_add_maintenance_plan_db',
- 'sp_delete_maintenance_plan_job', 'sp_add_maintenance_plan_job', 'sp_help_maintenance_plan',
- 'sp_delete_maintenance_plan',
-
- //Distributed Queries Procedures
- 'sp_addlinkedserver', 'sp_indexes', 'sp_addlinkedsrvlogin', 'sp_linkedservers', 'sp_catalogs',
- 'sp_primarykeys', 'sp_column_privileges_ex', 'sp_columns_ex',
- 'sp_table_privileges_ex', 'sp_tables_ex', 'sp_foreignkeys',
-
- //Full-Text Search Procedures
- 'sp_fulltext_catalog', 'sp_help_fulltext_catalogs_cursor', 'sp_fulltext_column',
- 'sp_help_fulltext_columns', 'sp_fulltext_database', 'sp_help_fulltext_columns_cursor',
- 'sp_fulltext_service', 'sp_help_fulltext_tables', 'sp_fulltext_table',
- 'sp_help_fulltext_tables_cursor', 'sp_help_fulltext_catalogs',
-
- //Log Shipping Procedures
- 'sp_add_log_shipping_database', 'sp_delete_log_shipping_database', 'sp_add_log_shipping_plan',
- 'sp_delete_log_shipping_plan', 'sp_add_log_shipping_plan_database',
- 'sp_delete_log_shipping_plan_database', 'sp_add_log_shipping_primary',
- 'sp_delete_log_shipping_primary', 'sp_add_log_shipping_secondary',
- 'sp_delete_log_shipping_secondary', 'sp_can_tlog_be_applied', 'sp_get_log_shipping_monitor_info',
- 'sp_change_monitor_role', 'sp_remove_log_shipping_monitor', 'sp_change_primary_role',
- 'sp_resolve_logins', 'sp_change_secondary_role', 'sp_update_log_shipping_monitor_info',
- 'sp_create_log_shipping_monitor_account', 'sp_update_log_shipping_plan',
- 'sp_define_log_shipping_monitor', 'sp_update_log_shipping_plan_database',
-
- //OLE Automation Extended Stored Procedures
- 'sp_OACreate', 'sp_OAMethod', 'sp_OADestroy', 'sp_OASetProperty', 'sp_OAGetErrorInfo',
- 'sp_OAStop', 'sp_OAGetProperty',
-
- //Replication Procedures
- 'sp_add_agent_parameter', 'sp_enableagentoffload', 'sp_add_agent_profile',
- 'sp_enumcustomresolvers', 'sp_addarticle', 'sp_enumdsn', 'sp_adddistpublisher',
- 'sp_enumfullsubscribers', 'sp_adddistributiondb', 'sp_expired_subscription_cleanup',
- 'sp_adddistributor', 'sp_generatefilters', 'sp_addmergealternatepublisher',
- 'sp_getagentoffloadinfo', 'sp_addmergearticle', 'sp_getmergedeletetype', 'sp_addmergefilter',
- 'sp_get_distributor', 'sp_addmergepublication', 'sp_getqueuedrows', 'sp_addmergepullsubscription',
- 'sp_getsubscriptiondtspackagename', 'sp_addmergepullsubscription_agent', 'sp_grant_publication_access',
- 'sp_addmergesubscription', 'sp_help_agent_default', 'sp_addpublication', 'sp_help_agent_parameter',
- 'sp_addpublication_snapshot', 'sp_help_agent_profile', 'sp_addpublisher70', 'sp_helparticle',
- 'sp_addpullsubscription', 'sp_helparticlecolumns', 'sp_addpullsubscription_agent', 'sp_helparticledts',
- 'sp_addscriptexec', 'sp_helpdistpublisher', 'sp_addsubscriber', 'sp_helpdistributiondb',
- 'sp_addsubscriber_schedule', 'sp_helpdistributor', 'sp_addsubscription', 'sp_helpmergealternatepublisher',
- 'sp_addsynctriggers', 'sp_helpmergearticle', 'sp_addtabletocontents', 'sp_helpmergearticlecolumn',
- 'sp_adjustpublisheridentityrange', 'sp_helpmergearticleconflicts', 'sp_article_validation',
- 'sp_helpmergeconflictrows', 'sp_articlecolumn', 'sp_helpmergedeleteconflictrows', 'sp_articlefilter',
- 'sp_helpmergefilter', 'sp_articlesynctranprocs', 'sp_helpmergepublication', 'sp_articleview',
- 'sp_helpmergepullsubscription', 'sp_attachsubscription', 'sp_helpmergesubscription', 'sp_browsesnapshotfolder',
- 'sp_helppublication', 'sp_browsemergesnapshotfolder', 'sp_help_publication_access', 'sp_browsereplcmds',
- 'sp_helppullsubscription', 'sp_change_agent_parameter', 'sp_helpreplfailovermode', 'sp_change_agent_profile',
- 'sp_helpreplicationdboption', 'sp_changearticle', 'sp_helpreplicationoption', 'sp_changedistpublisher',
- 'sp_helpsubscriberinfo', 'sp_changedistributiondb', 'sp_helpsubscription', 'sp_changedistributor_password',
- 'sp_ivindexhasnullcols', 'sp_changedistributor_property', 'sp_helpsubscription_properties', 'sp_changemergearticle',
- 'sp_link_publication', 'sp_changemergefilter', 'sp_marksubscriptionvalidation', 'sp_changemergepublication',
- 'sp_mergearticlecolumn', 'sp_changemergepullsubscription', 'sp_mergecleanupmetadata', 'sp_changemergesubscription',
- 'sp_mergedummyupdate', 'sp_changepublication', 'sp_mergesubscription_cleanup', 'sp_changesubscriber',
- 'sp_publication_validation', 'sp_changesubscriber_schedule', 'sp_refreshsubscriptions', 'sp_changesubscriptiondtsinfo',
- 'sp_reinitmergepullsubscription', 'sp_changesubstatus', 'sp_reinitmergesubscription', 'sp_change_subscription_properties',
- 'sp_reinitpullsubscription', 'sp_check_for_sync_trigger', 'sp_reinitsubscription', 'sp_copymergesnapshot',
- 'sp_removedbreplication', 'sp_copysnapshot', 'sp_repladdcolumn', 'sp_copysubscription', 'sp_replcmds',
- 'sp_deletemergeconflictrow', 'sp_replcounters', 'sp_disableagentoffload', 'sp_repldone', 'sp_drop_agent_parameter',
- 'sp_repldropcolumn', 'sp_drop_agent_profile', 'sp_replflush', 'sp_droparticle', 'sp_replicationdboption',
- 'sp_dropanonymouseagent', 'sp_replication_agent_checkup', 'sp_dropdistpublisher', 'sp_replqueuemonitor',
- 'sp_dropdistributiondb', 'sp_replsetoriginator', 'sp_dropmergealternatepublisher', 'sp_replshowcmds',
- 'sp_dropdistributor', 'sp_repltrans', 'sp_dropmergearticle', 'sp_restoredbreplication', 'sp_dropmergefilter',
- 'sp_revoke_publication_access', 'sp_scriptsubconflicttable', 'sp_dropmergepublication', 'sp_script_synctran_commands',
- 'sp_dropmergepullsubscription', 'sp_setreplfailovermode', 'sp_showrowreplicainfo', 'sp_dropmergesubscription',
- 'sp_subscription_cleanup', 'sp_droppublication', 'sp_table_validation', 'sp_droppullsubscription',
- 'sp_update_agent_profile', 'sp_dropsubscriber', 'sp_validatemergepublication', 'sp_dropsubscription',
- 'sp_validatemergesubscription', 'sp_dsninfo', 'sp_vupgrade_replication', 'sp_dumpparamcmd',
-
- //Security Procedures
- 'sp_addalias', 'sp_droprolemember', 'sp_addapprole', 'sp_dropserver', 'sp_addgroup', 'sp_dropsrvrolemember',
- 'sp_dropuser', 'sp_addlogin', 'sp_grantdbaccess', 'sp_addremotelogin',
- 'sp_grantlogin', 'sp_addrole', 'sp_helpdbfixedrole', 'sp_addrolemember', 'sp_helpgroup',
- 'sp_addserver', 'sp_helplinkedsrvlogin', 'sp_addsrvrolemember', 'sp_helplogins', 'sp_adduser',
- 'sp_helpntgroup', 'sp_approlepassword', 'sp_helpremotelogin', 'sp_changedbowner', 'sp_helprole',
- 'sp_changegroup', 'sp_helprolemember', 'sp_changeobjectowner', 'sp_helprotect', 'sp_change_users_login',
- 'sp_helpsrvrole', 'sp_dbfixedrolepermission', 'sp_helpsrvrolemember', 'sp_defaultdb', 'sp_helpuser',
- 'sp_defaultlanguage', 'sp_MShasdbaccess', 'sp_denylogin', 'sp_password', 'sp_dropalias', 'sp_remoteoption',
- 'sp_dropapprole', 'sp_revokedbaccess', 'sp_dropgroup', 'sp_revokelogin', 'sp_droplinkedsrvlogin',
- 'sp_setapprole', 'sp_droplogin', 'sp_srvrolepermission', 'sp_dropremotelogin', 'sp_validatelogins', 'sp_droprole',
-
- //SQL Mail Procedures
- 'sp_processmail', 'xp_sendmail', 'xp_deletemail', 'xp_startmail', 'xp_findnextmsg', 'xp_stopmail', 'xp_readmail',
-
- //SQL Profiler Procedures
- 'sp_trace_create', 'sp_trace_setfilter', 'sp_trace_generateevent', 'sp_trace_setstatus', 'sp_trace_setevent',
-
- //SQL Server Agent Procedures
- 'sp_add_alert', 'sp_help_jobhistory', 'sp_add_category', 'sp_help_jobschedule', 'sp_add_job',
- 'sp_help_jobserver', 'sp_add_jobschedule', 'sp_help_jobstep', 'sp_add_jobserver', 'sp_help_notification',
- 'sp_add_jobstep', 'sp_help_operator', 'sp_add_notification', 'sp_help_targetserver',
- 'sp_add_operator', 'sp_help_targetservergroup', 'sp_add_targetservergroup', 'sp_helptask',
- 'sp_add_targetsvrgrp_member', 'sp_manage_jobs_by_login', 'sp_addtask', 'sp_msx_defect',
- 'sp_apply_job_to_targets', 'sp_msx_enlist', 'sp_delete_alert', 'sp_post_msx_operation',
- 'sp_delete_category', 'sp_purgehistory', 'sp_delete_job', 'sp_purge_jobhistory', 'sp_delete_jobschedule',
- 'sp_reassigntask', 'sp_delete_jobserver', 'sp_remove_job_from_targets', 'sp_delete_jobstep',
- 'sp_resync_targetserver', 'sp_delete_notification', 'sp_start_job', 'sp_delete_operator',
- 'sp_stop_job', 'sp_delete_targetserver', 'sp_update_alert', 'sp_delete_targetservergroup',
- 'sp_update_category', 'sp_delete_targetsvrgrp_member', 'sp_update_job', 'sp_droptask',
- 'sp_update_jobschedule', 'sp_help_alert', 'sp_update_jobstep', 'sp_help_category',
- 'sp_update_notification', 'sp_help_downloadlist', 'sp_update_operator', 'sp_helphistory',
- 'sp_update_targetservergroup', 'sp_help_job', 'sp_updatetask', 'xp_sqlagent_proxy_account',
-
- //System Procedures
- 'sp_add_data_file_recover_suspect_db', 'sp_helpconstraint', 'sp_addextendedproc',
- 'sp_helpdb', 'sp_addextendedproperty', 'sp_helpdevice', 'sp_add_log_file_recover_suspect_db',
- 'sp_helpextendedproc', 'sp_addmessage', 'sp_helpfile', 'sp_addtype', 'sp_helpfilegroup',
- 'sp_addumpdevice', 'sp_helpindex', 'sp_altermessage', 'sp_helplanguage', 'sp_autostats',
- 'sp_helpserver', 'sp_attach_db', 'sp_helpsort', 'sp_attach_single_file_db', 'sp_helpstats',
- 'sp_bindefault', 'sp_helptext', 'sp_bindrule', 'sp_helptrigger', 'sp_bindsession',
- 'sp_indexoption', 'sp_certify_removable', 'sp_invalidate_textptr', 'sp_configure',
- 'sp_lock', 'sp_create_removable', 'sp_monitor', 'sp_createstats', 'sp_procoption',
- 'sp_cycle_errorlog', 'sp_recompile', 'sp_datatype_info', 'sp_refreshview', 'sp_dbcmptlevel',
- 'sp_releaseapplock', 'sp_dboption', 'sp_rename', 'sp_dbremove', 'sp_renamedb',
- 'sp_delete_backuphistory', 'sp_resetstatus', 'sp_depends', 'sp_serveroption', 'sp_detach_db',
- 'sp_setnetname', 'sp_dropdevice', 'sp_settriggerorder', 'sp_dropextendedproc', 'sp_spaceused',
- 'sp_dropextendedproperty', 'sp_tableoption', 'sp_dropmessage', 'sp_unbindefault', 'sp_droptype',
- 'sp_unbindrule', 'sp_executesql', 'sp_updateextendedproperty', 'sp_getapplock', 'sp_updatestats',
- 'sp_getbindtoken', 'sp_validname', 'sp_help', 'sp_who',
-
- //Web Assistant Procedures
- 'sp_dropwebtask', 'sp_makewebtask', 'sp_enumcodepages', 'sp_runwebtask',
-
- //XML Procedures
- 'sp_xml_preparedocument', 'sp_xml_removedocument',
-
- //General Extended Procedures
- 'xp_cmdshellxp_logininfo', 'xp_enumgroups', 'xp_msver', 'xp_findnextmsgxp_revokelogin',
- 'xp_grantlogin', 'xp_sprintf', 'xp_logevent', 'xp_sqlmaint', 'xp_loginconfig', 'xp_sscanf',
-
- //API System Stored Procedures
- 'sp_cursor', 'sp_cursorclose', 'sp_cursorexecute', 'sp_cursorfetch', 'sp_cursoropen',
- 'sp_cursoroption', 'sp_cursorprepare', 'sp_cursorunprepare', 'sp_execute', 'sp_prepare', 'sp_unprepare',
-
- //Misc
- 'sp_createorphan', 'sp_droporphans', 'sp_reset_connection', 'sp_sdidebug'
- ),
- 4 => array(
- //Function/sp's higlighted brown.
- 'fn_helpcollations', 'fn_listextendedproperty ', 'fn_servershareddrives',
- 'fn_trace_geteventinfo', 'fn_trace_getfilterinfo', 'fn_trace_getinfo',
- 'fn_trace_gettable', 'fn_virtualfilestats',
- ),
- ),
- 'SYMBOLS' => array(
- '!', '!=', '%', '&', '&&', '(', ')', '*', '+', '-', '/', '<', '<<', '<=',
- '<=>', '<>', '=', '>', '>=', '>>', '^', 'ALL', 'AND', 'ANY', 'BETWEEN', 'CROSS',
- 'EXISTS', 'IN', 'JOIN', 'LIKE', 'NOT', 'NULL', 'OR', 'OUTER', 'SOME', '|', '||', '~'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000FF;',
- 2 => 'color: #FF00FF;',
- 3 => 'color: #AF0000;',
- 4 => 'color: #AF0000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008080;',
- 'MULTI' => 'color: #008080;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #808080;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;',
- 2 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #808080;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/typoscript.php b/libvpx/examples/includes/geshi/geshi/typoscript.php
deleted file mode 100644
index b0ae753..0000000
--- a/libvpx/examples/includes/geshi/geshi/typoscript.php
+++ /dev/null
@@ -1,300 +0,0 @@
-<?php
-/*************************************************************************************
- * typoscript.php
- * --------
- * Author: Jan-Philipp Halle (typo3@jphalle.de)
- * Copyright: (c) 2005 Jan-Philipp Halle (http://www.jphalle.de/)
- * Release Version: 1.0.8.3
- * Date Started: 2005/07/29
- *
- * TypoScript language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/07/11 (1.0.8)
- * - Michiel Roos <geshi@typofree.org> Complete rewrite
- * 2005/07/29 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/14)
- * -------------------------
- * <things-to-do>
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'TypoScript',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(2 => '/(?<!(#|\'|"))(?:#(?!(?:[a-fA-F0-9]{6}|[a-fA-F0-9]{3}))[^\n#]+|#{2}[^\n#]+|#{7,999}[^\n]+)/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- // Conditions: http://documentation.typo3.org/documentation/tsref/conditions/
- 1 => array(
- 'browser', 'compatVersion', 'dayofmonth', 'dayofweek', 'device',
- 'globalString', 'globalVars', 'hostname', 'hour',
- 'ip', 'language', 'loginUser', 'loginuser', 'minute',
- 'month', 'PIDinRootline', 'PIDupinRootline',
- 'system', 'treelevel', 'useragent', 'userFunc',
- 'usergroup', 'version'
- ),
-
- // Functions: http://documentation.typo3.org/documentation/tsref/functions/
- 2 => array(
- 'addParams', 'encapsLines', 'filelink', 'HTMLparser',
- 'HTMLparser_tags', 'if', 'imageLinkWrap',
- 'imgResource', 'makelinks', 'numRows', 'parseFunc',
- 'select', 'split', 'stdWrap', 'tableStyle', 'tags',
- 'textStyle', 'typolink'
- ),
-
- // Toplevel objects: http://documentation.typo3.org/documentation/tsref/tlo-objects/
- 3 => array(
- 'CARRAY', 'CONFIG', 'CONSTANTS', 'FE_DATA', 'FE_TABLE', 'FRAME',
- 'FRAMESET', 'META', 'PAGE', 'plugin'
- ),
-
- // Content Objects (cObject) : http://documentation.typo3.org/documentation/tsref/cobjects/
- 4 => array(
- 'CASE', 'CLEARGIF', 'COA', 'COA_INT', 'COBJ_ARRAY', 'COLUMNS',
- 'CONTENT', 'CTABLE', 'EDITPANEL', 'FILE', 'FORM',
- 'HMENU', 'HRULER', 'HTML', 'IMAGE', 'IMGTEXT',
- 'IMG_RESOURCE', 'LOAD_REGISTER', 'MULTIMEDIA',
- 'OTABLE', 'PHP_SCRIPT', 'PHP_SCRIPT_EXT',
- 'PHP_SCRIPT_INT', 'RECORDS', 'RESTORE_REGISTER',
- 'SEARCHRESULT', 'TEMPLATE', 'TEXT', 'USER',
- 'USER_INT'
- ),
-
- // GIFBUILDER toplevel link: http://documentation.typo3.org/documentation/tsref/gifbuilder/
- 5 => array(
- 'GIFBUILDER',
- ),
-
- // GIFBUILDER: http://documentation.typo3.org/documentation/tsref/gifbuilder/
- // skipped fields: IMAGE, TEXT
- // NOTE! the IMAGE and TEXT field already are linked in group 4, they
- // cannot be linked twice . . . . unfortunately
- 6 => array(
- 'ADJUST', 'BOX', 'CROP', 'EFFECT', 'EMBOSS',
- 'IMGMAP', 'OUTLINE', 'SCALE', 'SHADOW',
- 'WORKAREA'
- ),
-
- // MENU Objects: http://documentation.typo3.org/documentation/tsref/menu/
- 7 => array(
- 'GMENU', 'GMENU_FOLDOUT', 'GMENU_LAYERS', 'IMGMENU',
- 'IMGMENUITEM', 'JSMENU', 'JSMENUITEM', 'TMENU',
- 'TMENUITEM', 'TMENU_LAYERS'
- ),
-
- // MENU common properties: http://documentation.typo3.org/documentation/tsref/menu/common-properties/
- 8 => array(
- 'alternativeSortingField', 'begin', 'debugItemConf',
- 'imgNameNotRandom', 'imgNamePrefix',
- 'itemArrayProcFunc', 'JSWindow', 'maxItems',
- 'minItems', 'overrideId', 'sectionIndex',
- 'showAccessRestrictedPages', 'submenuObjSuffixes'
- ),
-
- // MENU item states: http://documentation.typo3.org/documentation/tsref/menu/item-states/
- 9 => array(
- 'ACT', 'ACTIFSUB', 'ACTIFSUBRO', 'ACTRO', 'CUR', 'CURIFSUB',
- 'CURIFSUBRO', 'CURRO', 'IFSUB', 'IFSUBRO', 'NO',
- 'SPC', 'USERDEF1', 'USERDEF1RO', 'USERDEF2',
- 'USERDEF2RO', 'USR', 'USRRO'
- ),
- ),
-
- // Does not include '-' because of stuff like htmlTag_langKey = en-GB and
- // lib.nav-sub
- 'SYMBOLS' => array(
- 0 => array(
- '|',
- '+', '*', '/', '%',
- '!', '&&', '^',
- '<', '>', '=',
- '?', ':',
- '.'
- ),
- 1 => array(
- '(', ')', '{', '}', '[', ']'
- )
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true,
- 4 => true,
- 5 => true,
- 6 => true,
- 7 => true,
- 8 => true,
- 9 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #ed7d14;',
- 2 => 'font-weight: bold;',
- 3 => 'color: #990000; font-weight: bold;',
- 4 => 'color: #990000; font-weight: bold;',
- 5 => 'color: #990000; font-weight: bold;',
- 6 => 'color: #990000; font-weight: bold;',
- 7 => 'color: #990000; font-weight: bold;',
- 8 => 'font-weight: bold;',
- 9 => 'color: #990000; font-weight: bold;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #aaa; font-style: italic;',
- 2 => 'color: #aaa; font-style: italic;',
- 'MULTI' => 'color: #aaa; font-style: italic;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ac14aa;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000e0; font-weight: bold;',
- 2 => 'color: #0000e0; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #009900;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #339933; font-weight: bold;',
- // Set this to the same value as brackets above
- 1 => 'color: #009900; font-weight: bold;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #009900;',
- 1 => 'color: #009900; font-weight: bold;',
- 2 => 'color: #3366CC;',
- 3 => 'color: #000066; font-weight: bold;',
- 4 => 'color: #ed7d14;',
- 5 => 'color: #000066; font-weight: bold;',
- 6 => 'color: #009900;',
- 7 => 'color: #3366CC;'
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => 'http://documentation.typo3.org/documentation/tsref/conditions/{FNAME}/',
- 2 => 'http://documentation.typo3.org/documentation/tsref/functions/{FNAME}/',
- 3 => 'http://documentation.typo3.org/documentation/tsref/tlo-objects/{FNAME}/',
- 4 => 'http://documentation.typo3.org/documentation/tsref/cobjects/{FNAME}/',
- 5 => 'http://documentation.typo3.org/documentation/tsref/gifbuilder/',
- 6 => 'http://documentation.typo3.org/documentation/tsref/gifbuilder/{FNAME}/',
- 7 => 'http://documentation.typo3.org/documentation/tsref/menu/{FNAME}/',
- 8 => 'http://documentation.typo3.org/documentation/tsref/menu/common-properties/',
- 9 => 'http://documentation.typo3.org/documentation/tsref/menu/item-states/'
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- // Constant
- 0 => array(
- GESHI_SEARCH => '(\{)(\$[a-zA-Z_\.]+[a-zA-Z0-9_\.]*)(\})',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => '\\3'
- ),
-
- // Constant dollar sign
- 1 => array(
- GESHI_SEARCH => '(\$)([a-zA-Z_\.]+[a-zA-Z0-9_\.]*)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => '\\2'
- ),
-
- // xhtml tag
- 2 => array(
- GESHI_SEARCH => '(&lt;[a-zA-Z\!\/].*?&gt;)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 's',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
-
- // extension keys / tables: (static|user|ttx|tx|tt|fe)_something[_something]
- 3 => array(
- GESHI_SEARCH => '(plugin\.|[^\.]\b)((?:static|user|ttx|tx|tt|fe)(?:_[0-9A-Za-z_]+?)\b)',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
-
- // conditions and controls
- 4 => array(
- GESHI_SEARCH => '(\[)(globalVar|global|end)\b',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
-
- // lowlevel setup and constant objects
- 5 => array(
- GESHI_SEARCH => '([^\.\$-\{]\b)(cObj|field|config|content|file|frameset|includeLibs|lib|page|plugin|register|resources|sitemap|sitetitle|styles|temp|tt_content|tt_news|types|xmlnews)\b',
- GESHI_REPLACE => '\\2',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '\\1',
- GESHI_AFTER => ''
- ),
-
- // markers
- 6 => array(
- GESHI_SEARCH => '(###[^#]+###)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
-
- // hex color codes
- 7 => array(
- GESHI_SEARCH => '(#[a-fA-F0-9]{6}\b|#[a-fA-F0-9]{3}\b)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => '',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- )
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/vb.php b/libvpx/examples/includes/geshi/geshi/vb.php
deleted file mode 100644
index 0409058..0000000
--- a/libvpx/examples/includes/geshi/geshi/vb.php
+++ /dev/null
@@ -1,133 +0,0 @@
-<?php
-/*************************************************************************************
- * vb.php
- * ------
- * Author: Roberto Rossi (rsoftware@altervista.org)
- * Copyright: (c) 2004 Roberto Rossi (http://rsoftware.altervista.org),
- * Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/08/30
- *
- * Visual Basic language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/08/27 (1.0.8.1)
- * - changed keyword list for better Visual Studio compliance
- * 2008/08/26 (1.0.8.1)
- * - Fixed multiline comments
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/08/30 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Visual Basic',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- // Comments (either single or multiline with _
- 1 => '/\'.*(?<! _)\n/sU',
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'AddressOf', 'Alias', 'And', 'Append', 'As', 'BF', 'Binary',
- 'Boolean', 'ByRef', 'Byte', 'ByVal', 'Call', 'Case', 'CBool',
- 'CByte', 'CCur', 'CDate', 'CDbl', 'CDec', 'CInt', 'CLng',
- 'Close', 'Collection', 'Const', 'Control', 'CSng', 'CStr',
- 'Currency', 'CVar', 'Date', 'Declare', 'Dim', 'Do', 'Double',
- 'Each', 'Else', 'ElseIf', 'End', 'Enum', 'Erase', 'Error',
- 'Event', 'Exit', 'Explicit', 'False', 'For', 'Friend',
- 'Function', 'Get', 'GoSub', 'Goto', 'If', 'Implements', 'In',
- 'Input', 'Integer', 'Is', 'LBound', 'Let', 'Lib', 'Like',
- 'Line', 'Long', 'Loop', 'Mod', 'New', 'Next', 'Not',
- 'Nothing', 'Object', 'On', 'Open', 'Option', 'Optional',
- 'Or', 'Output', 'ParamArray', 'Preserve', 'Print', 'Private',
- 'Property', 'Public', 'RaiseEvent', 'Random', 'ReDim',
- 'Resume', 'Select', 'Set', 'Single', 'Static', 'Step',
- 'Stop', 'String', 'Sub', 'Then', 'To', 'True', 'Type',
- 'TypeOf', 'UBound', 'Until', 'Variant', 'While', 'With',
- 'WithEvents', 'Xor'
- )
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000080;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000;'
- ),
- 'BRACKETS' => array(
- ),
- 'STRINGS' => array(
- 0 => 'color: #800000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #800000; font-weight: bold;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- )
- ),
- 'URLS' => array(
- 1 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'BRACKETS' => GESHI_NEVER,
- 'SYMBOLS' => GESHI_NEVER,
- 'NUMBERS' => GESHI_NEVER
- )
- )
-);
-
-?> \ No newline at end of file
diff --git a/libvpx/examples/includes/geshi/geshi/vbnet.php b/libvpx/examples/includes/geshi/geshi/vbnet.php
deleted file mode 100644
index 4a0f000..0000000
--- a/libvpx/examples/includes/geshi/geshi/vbnet.php
+++ /dev/null
@@ -1,201 +0,0 @@
-<?php
-/*************************************************************************************
- * vbnet.php
- * ---------
- * Author: Alan Juden (alan@judenware.org)
- * Copyright: (c) 2004 Alan Juden, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.8.3
- * Date Started: 2004/06/04
- *
- * VB.NET language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2004/11/27 (1.0.0)
- * - Initial release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'vb.net',
- 'COMMENT_SINGLE' => array(1 => "'"),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- '3DDKSHADOW', '3DHIGHLIGHT', '3DLIGHT', 'ABORT', 'ABORTRETRYIGNORE', 'ACTIVEBORDER',
- 'ACTIVETITLEBAR', 'ALIAS', 'APPLICATIONMODAL', 'APPLICATIONWORKSPACE', 'ARCHIVE',
- 'BACK', 'BINARYCOMPARE', 'BLACK', 'BLUE', 'BUTTONFACE', 'BUTTONSHADOW', 'BUTTONTEXT',
- 'CANCEL', 'CDROM', 'CR', 'CRITICAL', 'CRLF', 'CYAN', 'DEFAULT', 'DEFAULTBUTTON1',
- 'DEFAULTBUTTON2', 'DEFAULTBUTTON3', 'DESKTOP', 'DIRECTORY', 'EXCLAMATION', 'FALSE',
- 'FIXED', 'FORAPPENDING', 'FORMFEED', 'FORREADING', 'FORWRITING', 'FROMUNICODE',
- 'GRAYTEXT', 'GREEN', 'HIDDEN', 'HIDE', 'HIGHLIGHT', 'HIGHLIGHTTEXT', 'HIRAGANA',
- 'IGNORE', 'INACTIVEBORDER', 'INACTIVECAPTIONTEXT', 'INACTIVETITLEBAR', 'INFOBACKGROUND',
- 'INFORMATION', 'INFOTEXT', 'KATAKANALF', 'LOWERCASE', 'MAGENTA', 'MAXIMIZEDFOCUS',
- 'MENUBAR', 'MENUTEXT', 'METHOD', 'MINIMIZEDFOCUS', 'MINIMIZEDNOFOCUS', 'MSGBOXRIGHT',
- 'MSGBOXRTLREADING', 'MSGBOXSETFOREGROUND', 'NARROW', 'NEWLINE', 'NO', 'NORMAL',
- 'NORMALFOCUS', 'NORMALNOFOCUS', 'NULLSTRING', 'OBJECTERROR', 'OK', 'OKCANCEL', 'OKONLY',
- 'PROPERCASE', 'QUESTION', 'RAMDISK', 'READONLY', 'RED', 'REMOTE', 'REMOVABLE', 'RETRY',
- 'RETRYCANCEL', 'SCROLLBARS', 'SYSTEMFOLDER', 'SYSTEMMODAL', 'TEMPORARYFOLDER',
- 'TEXTCOMPARE', 'TITLEBARTEXT', 'TRUE', 'UNICODE', 'UNKNOWN', 'UPPERCASE', 'VERTICALTAB',
- 'VOLUME', 'WHITE', 'WIDE', 'WIN16', 'WIN32', 'WINDOWBACKGROUND', 'WINDOWFRAME',
- 'WINDOWSFOLDER', 'WINDOWTEXT', 'YELLOW', 'YES', 'YESNO', 'YESNOCANCEL'
- ),
- 2 => array(
- 'AndAlso', 'As', 'ADDHANDLER', 'ASSEMBLY', 'AUTO', 'Binary', 'ByRef', 'ByVal', 'BEGINEPILOGUE',
- 'Else', 'ElseIf', 'Empty', 'Error', 'ENDPROLOGUE', 'EXTERNALSOURCE', 'ENVIRON', 'For',
- 'Friend', 'GET', 'HANDLES', 'Input', 'Is', 'IsNot', 'Len', 'Lock', 'Me', 'Mid', 'MUSTINHERIT', 'MustOverride',
- 'MYBASE', 'MYCLASS', 'New', 'Next', 'Nothing', 'Null', 'NOTINHERITABLE',
- 'NOTOVERRIDABLE', 'OFF', 'On', 'Option', 'Optional', 'Overloads', 'OVERRIDABLE', 'Overrides', 'ParamArray',
- 'Print', 'Private', 'Property', 'Public', 'Resume', 'Return', 'Seek', 'Static', 'Step',
- 'String', 'SHELL', 'SENDKEYS', 'SET', 'Shared', 'Then', 'Time', 'To', 'THROW', 'WithEvents'
- ),
- 3 => array(
- 'COLLECTION', 'DEBUG', 'DICTIONARY', 'DRIVE', 'DRIVES', 'ERR', 'FILE', 'FILES',
- 'FILESYSTEMOBJECT', 'FOLDER', 'FOLDERS', 'TEXTSTREAM'
- ),
- 4 => array(
- 'BOOLEAN', 'BYTE', 'DATE', 'DECIMIAL', 'DOUBLE', 'INTEGER', 'LONG', 'OBJECT',
- 'SINGLE STRING'
- ),
- 5 => array(
- 'ADDRESSOF', 'AND', 'BITAND', 'BITNOT', 'BITOR', 'BITXOR',
- 'GETTYPE', 'LIKE', 'MOD', 'NOT', 'ORXOR'
- ),
- 6 => array(
- 'APPACTIVATE', 'BEEP', 'CALL', 'CHDIR', 'CHDRIVE', 'CLASS', 'CASE', 'CATCH', 'CONST',
- 'DECLARE', 'DELEGATE', 'DELETESETTING', 'DIM', 'DO', 'DOEVENTS', 'END', 'ENUM',
- 'EVENT', 'EXIT', 'EACH', 'FUNCTION', 'FINALLY', 'IF', 'IMPORTS', 'INHERITS',
- 'INTERFACE', 'IMPLEMENTS', 'KILL', 'LOOP', 'NAMESPACE', 'OPEN', 'PUT',
- 'RAISEEVENT', 'RANDOMIZE', 'REDIM', 'REM', 'RESET', 'SAVESETTING', 'SELECT',
- 'SETATTR', 'STOP', 'SUB', 'SYNCLOCK', 'STRUCTURE', 'SHADOWS', 'SWITCH',
- 'TRY', 'WIDTH', 'WITH', 'WRITE', 'WHILE'
- ),
- 7 => array(
- 'ABS', 'ARRAY', 'ASC', 'ASCB', 'ASCW', 'CALLBYNAME', 'CBOOL', 'CBYTE', 'CCHAR',
- 'CCHR', 'CDATE', 'CDBL', 'CDEC', 'CHOOSE', 'CHR', 'CHR$', 'CHRB', 'CHRB$', 'CHRW',
- 'CINT', 'CLNG', 'CLNG8', 'CLOSE', 'COBJ', 'COMMAND', 'COMMAND$', 'CONVERSION',
- 'COS', 'CREATEOBJECT', 'CSHORT', 'CSTR', 'CURDIR', 'CTYPE', 'CVDATE', 'DATEADD',
- 'DATEDIFF', 'DATEPART', 'DATESERIAL', 'DATEVALUE', 'DAY', 'DDB', 'DIR', 'DIR$',
- 'EOF', 'ERROR$', 'EXP', 'FILEATTR', 'FILECOPY', 'FILEDATATIME', 'FILELEN', 'FILTER',
- 'FIX', 'FORMAT', 'FORMAT$', 'FORMATCURRENCY', 'FORMATDATETIME', 'FORMATNUMBER',
- 'FORMATPERCENT', 'FREEFILE', 'FV', 'GETALLSETTINGS', 'GETATTRGETOBJECT', 'GETSETTING',
- 'HEX', 'HEX$', 'HOUR', 'IIF', 'IMESTATUS', 'INPUT$', 'INPUTB', 'INPUTB$', 'INPUTBOX',
- 'INSTR', 'INSTRB', 'INSTRREV', 'INT', 'IPMT', 'IRR', 'ISARRAY', 'ISDATE', 'ISEMPTY',
- 'ISERROR', 'ISNULL', 'ISNUMERIC', 'ISOBJECT', 'JOIN', 'LBOUND', 'LCASE', 'LCASE$',
- 'LEFT', 'LEFT$', 'LEFTB', 'LEFTB$', 'LENB', 'LINEINPUT', 'LOC', 'LOF', 'LOG', 'LTRIM',
- 'LTRIM$', 'MID$', 'MIDB', 'MIDB$', 'MINUTE', 'MIRR', 'MKDIR', 'MONTH', 'MONTHNAME',
- 'MSGBOX', 'NOW', 'NPER', 'NPV', 'OCT', 'OCT$', 'PARTITION', 'PMT', 'PPMT', 'PV',
- 'RATE', 'REPLACE', 'RIGHT', 'RIGHT$', 'RIGHTB', 'RIGHTB$', 'RMDIR', 'RND', 'RTRIM',
- 'RTRIM$', 'SECOND', 'SIN', 'SLN', 'SPACE', 'SPACE$', 'SPC', 'SPLIT', 'SQRT', 'STR', 'STR$',
- 'STRCOMP', 'STRCONV', 'STRING$', 'STRREVERSE', 'SYD', 'TAB', 'TAN', 'TIMEOFDAY',
- 'TIMER', 'TIMESERIAL', 'TIMEVALUE', 'TODAY', 'TRIM', 'TRIM$', 'TYPENAME', 'UBOUND',
- 'UCASE', 'UCASE$', 'VAL', 'WEEKDAY', 'WEEKDAYNAME', 'YEAR'
- ),
- 8 => array(
- 'ANY', 'ATN', 'CALENDAR', 'CIRCLE', 'CURRENCY', 'DEFBOOL', 'DEFBYTE', 'DEFCUR',
- 'DEFDATE', 'DEFDBL', 'DEFDEC', 'DEFINT', 'DEFLNG', 'DEFOBJ', 'DEFSNG', 'DEFSTR',
- 'DEFVAR', 'EQV', 'GOSUB', 'IMP', 'INITIALIZE', 'ISMISSING', 'LET', 'LINE', 'LSET',
- 'RSET', 'SGN', 'SQR', 'TERMINATE', 'VARIANT', 'VARTYPE', 'WEND'
- ),
- ),
- 'SYMBOLS' => array(
- '&', '&=', '*', '*=', '+', '+=', '-', '-=', '//', '/', '/=', '=', '\\', '\\=',
- '^', '^='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false,
- 6 => false,
- 7 => false,
- 8 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0600FF;', //Constants
- 2 => 'color: #FF8000;', //Keywords
- 3 => 'color: #008000;', //Data Types
- 4 => 'color: #FF0000;', //Objects
- 5 => 'color: #804040;', //Operators
- 6 => 'color: #0600FF;', //Statements
- 7 => 'color: #0600FF;', //Functions
- 8 => 'color: #0600FF;' //Deprecated
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008080; font-style: italic;',
- 'MULTI' => 'color: #008080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008080; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #808080;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #FF0000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #0000FF;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => 'http://www.google.com/search?q={FNAMEU}+site:msdn.microsoft.com',
- 4 => '',
- 5 => '',
- 6 => '',
- 7 => '',
- 8 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 =>'.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/verilog.php b/libvpx/examples/includes/geshi/geshi/verilog.php
deleted file mode 100644
index 57d268e..0000000
--- a/libvpx/examples/includes/geshi/geshi/verilog.php
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-/**
- * verilog.php
- * -----------
- * Author: G�nter Dannoritzer <dannoritzer@web.de>
- * Copyright: (C) 2008 Guenter Dannoritzer
- * Release Version: 1.0.8.3
- * Date Started: 2008/05/28
- *
- * Verilog language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/29
- * - added regular expression to find numbers of the form 4'b001xz
- * - added regular expression to find values for `timescale command
- * - extended macro keywords
- *
- * TODO (updated 2008/05/29)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Verilog',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'COMMENT_REGEXP' => array(1 => '/\/\/(?:\\\\\\\\|\\\\\\n|.)*$/m'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- // keywords
- 1 => array('always', 'and', 'assign', 'begin', 'buf', 'bufif0', 'bufif1', 'case',
- 'casex', 'casez', 'cmos', 'deassign', 'default', 'defparam',
- 'disable', 'edge', 'else', 'end', 'endcase', 'endfunction',
- 'endmodule', 'endprimitive', 'endspecify', 'endtable', 'endtask',
- 'event', 'for', 'force', 'forever', 'function', 'highz0',
- 'highz1', 'if', 'ifnone', 'initial', 'inout', 'input', 'integer',
- 'join', 'large', 'macromodule', 'medium', 'module', 'nand',
- 'negedge', 'nmos', 'nor', 'not', 'notif0', 'notif1', 'or',
- 'output', 'parameter', 'pmos', 'posedge', 'primitive', 'pull0',
- 'pull1', 'pulldown', 'pullup', 'rcmos', 'real', 'realtime', 'reg',
- 'release', 'repeat', 'rnmos', 'rpmos', 'rtran', 'rtranif0',
- 'rtranif1', 'scalared', 'small', 'specify', 'specparam',
- 'strong0', 'strong1', 'supply0', 'supply1', 'table', 'task',
- 'time', 'tran', 'tranif0', 'tranif1', 'tri', 'tri0', 'tri1',
- 'triand', 'trior', 'trireg', 'vectored', 'wait', 'wand', 'weak0',
- 'weak1', 'while', 'wire', 'wor', 'xnor', 'xor'
- ),
- // system tasks
- 2 => array(
- '$display', '$monitor',
- '$dumpall', '$dumpfile', '$dumpflush', '$dumplimit', '$dumpoff',
- '$dumpon', '$dumpvars',
- '$fclose', '$fdisplay', '$fopen',
- '$finish', '$fmonitor', '$fstrobe', '$fwrite',
- '$fgetc', '$ungetc', '$fgets', '$fscanf', '$fread', '$ftell',
- '$fseek', '$frewind', '$ferror', '$fflush', '$feof',
- '$random',
- '$readmemb', '$readmemh', '$readmemx',
- '$signed', '$stime', '$stop',
- '$strobe', '$time', '$unsigned', '$write'
- ),
- // macros
- 3 => array(
- '`default-net', '`define',
- '`celldefine', '`default_nettype', '`else', '`elsif', '`endcelldefine',
- '`endif', '`ifdef', '`ifndef', '`include', '`line', '`nounconnected_drive',
- '`resetall', '`timescale', '`unconnected_drive', '`undef'
- ),
- ),
- 'SYMBOLS' => array(
- '(', ')', '{', '}', '[', ']', '=', '+', '-', '*', '/', '!', '%',
- '^', '&', '|', '~',
- '?', ':',
- '#', '<<', '<<<',
- '>', '<', '>=', '<=',
- '@', ';', ','
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #A52A2A; font-weight: bold;',
- 2 => 'color: #9932CC;',
- 3 => 'color: #008800;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #00008B; font-style: italic;',
- 'MULTI' => 'color: #00008B; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #9F79EE'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #9F79EE;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #FF00FF;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff0055;'
- ),
- 'METHODS' => array(
- 1 => 'color: #202020;',
- 2 => 'color: #202020;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #5D478B;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #ff0055;',
- 1 => 'color: #ff0055;',
- ),
- 'SCRIPT' => array(
- 0 => '',
- 1 => '',
- 2 => '',
- 3 => ''
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- 1 => ''
- ),
- 'REGEXPS' => array(
- // numbers
- 0 => "\d'[bdh][0-9_a-fA-FxXzZ]+",
- // time -> 1, 10, or 100; s, ms, us, ns, ps, of fs
- 1 => "1[0]{0,2}[munpf]?s"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- 1 => ''
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- 0 => true,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/vhdl.php b/libvpx/examples/includes/geshi/geshi/vhdl.php
deleted file mode 100644
index 6fd537e..0000000
--- a/libvpx/examples/includes/geshi/geshi/vhdl.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/*************************************************************************************
- * vhdl.php
- * --------
- * Author: Alexander 'E-Razor' Krause (admin@erazor-zone.de)
- * Copyright: (c) 2005 Alexander Krause
- * Release Version: 1.0.8.3
- * Date Started: 2005/06/15
- *
- * VHDL (VHSICADL, very high speed integrated circuit HDL) language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * - Optimized regexp group 0 somewhat
- * 2006/06/15 (1.0.0)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'VHDL',
- 'COMMENT_SINGLE' => array(1 => '--'),
- 'COMMENT_MULTI' => array('%' => '%'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /*keywords*/
- 1 => array(
- 'access','after','alias','all','assert','attribute','architecture','begin',
- 'block','body','buffer','bus','case','component','configuration','constant',
- 'disconnect','downto','else','elsif','end','entity','exit','file','for',
- 'function','generate','generic','group','guarded','if','impure','in',
- 'inertial','inout','is','label','library','linkage','literal','loop',
- 'map','new','next','null','of','on','open','others','out','package',
- 'port','postponed','procedure','process','pure','range','record','register',
- 'reject','report','return','select','severity','signal','shared','subtype',
- 'then','to','transport','type','unaffected','units','until','use','variable',
- 'wait','when','while','with','note','warning','error','failure','and',
- 'or','xor','not','nor','used','memory','segments','dff','dffe','help_id',
- 'mod','info','latch','rising_edge','falling_edge'
- ),
- /*types*/
- 2 => array(
- 'bit','bit_vector','character','boolean','integer','real','time','string',
- 'severity_level','positive','natural','signed','unsigned','line','text',
- 'std_logic','std_logic_vector','std_ulogic','std_ulogic_vector','qsim_state',
- 'qsim_state_vector','qsim_12state','qsim_12state_vector','qsim_strength',
- 'mux_bit','mux_vector','reg_bit','reg_vector','wor_bit','wor_vector',
- 'work','ieee','std_logic_signed','std_logic_1164','std_logic_arith',
- 'numeric_std'
-
- ),
- /*operators*/
- ),
- 'SYMBOLS' => array(
- '[', ']', '(', ')',
- ';',':',
- '<','>','=','<=',':=','=>','=='
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #000080; font-weight: bold;',
- 2 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000; font-style: italic;',
- 'MULTI' => 'color: #008000; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000066;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000066;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #ff0000;',
- 1 => 'color: #ff0000;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Hex numbers and scientific notation for numbers
- 0 => '(\b0x[0-9a-fA-F]+|\b\d[0-9a-fA-F]+[hH])|'.
- '(\b\d+?(\.\d+?)?E[+\-]?\d+)|(\bns)|'.
- "('[0-9a-zA-Z]+(?!'))",
- //Number characters?
- 1 => "\b(''\d'')"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/vim.php b/libvpx/examples/includes/geshi/geshi/vim.php
deleted file mode 100644
index 94927ea..0000000
--- a/libvpx/examples/includes/geshi/geshi/vim.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-
-/*************************************************************************************
- * vim.php
- * ----------------
- * Author: Swaroop C H (swaroop@swaroopch.com)
- * Copyright: (c) 2008 Swaroop C H (http://www.swaroopch.com)
- * Release Version: 1.0.8.3
- * Date Started: 2008/10/19
- *
- * Vim scripting language file for GeSHi.
- *
- * Reference: http://qbnz.com/highlighter/geshi-doc.html#language-files
- * All keywords scraped from `:help expression-commands`.
- * All method names scraped from `:help function-list`.
- *
- * CHANGES
- * -------
- * 2008/10/19 (1.0.8.2)
- * - Started.
- *
- * TODO (updated 2008/10/19)
- * -------------------------
- * - Fill out list of zillion commands
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array(
- 'LANG_NAME' => 'Vim Script',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_REGEXP' => array(
- 1 => "/^\".*$/m"
- ),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'brea', 'break', 'call', 'cat', 'catc',
- 'catch', 'con', 'cont', 'conti',
- 'contin', 'continu', 'continue', 'ec', 'echo',
- 'echoe', 'echoer', 'echoerr', 'echoh',
- 'echohl', 'echom', 'echoms', 'echomsg', 'echon',
- 'el', 'els', 'else', 'elsei', 'elseif',
- 'en', 'end', 'endi', 'endif', 'endfo',
- 'endfor', 'endt', 'endtr', 'endtry', 'endw',
- 'endwh', 'endwhi', 'endwhil', 'endwhile', 'exe', 'exec', 'execu',
- 'execut', 'execute', 'fina', 'final', 'finall', 'finally', 'for',
- 'fun', 'func', 'funct', 'functi', 'functio', 'function', 'if', 'in',
- 'let', 'lockv', 'lockva', 'lockvar', 'retu', 'retur', 'return', 'th',
- 'thr', 'thro', 'throw', 'try', 'unl', 'unle', 'unlet', 'unlo', 'unloc',
- 'unlock', 'unlockv', 'unlockva', 'unlockvar', 'wh', 'whi', 'whil',
- 'while'
- ),
- 2 => array(
- 'autocmd', 'com', 'comm', 'comma', 'comman', 'command', 'comc',
- 'comcl', 'comcle', 'comclea', 'comclear', 'delc', 'delco',
- 'delcom', 'delcomm', 'delcomma', 'delcomman', 'delcommand',
- '-nargs' # TODO There are zillions of commands to be added here from http://vimdoc.sourceforge.net/htmldoc/usr_toc.html
- ),
- 3 => array(
- 'abs', 'add', 'append', 'argc', 'argidx', 'argv', 'atan',
- 'browse', 'browsedir', 'bufexists', 'buflisted', 'bufloaded',
- 'bufname', 'bufnr', 'bufwinnr', 'byte2line', 'byteidx',
- 'ceil', 'changenr', 'char2nr', 'cindent', 'clearmatches',
- 'col', 'complete', 'complete_add', 'complete_check', 'confirm',
- 'copy', 'cos', 'count', 'cscope_connection', 'cursor',
- 'deepcopy', 'delete', 'did_filetype', 'diff_filler',
- 'diff_hlID', 'empty', 'escape', 'eval', 'eventhandler',
- 'executable', 'exists', 'extend', 'expand', 'feedkeys',
- 'filereadable', 'filewritable', 'filter', 'finddir',
- 'findfile', 'float2nr', 'floor', 'fnameescape', 'fnamemodify',
- 'foldclosed', 'foldclosedend', 'foldlevel', 'foldtext',
- 'foldtextresult', 'foreground', 'garbagecollect',
- 'get', 'getbufline', 'getbufvar', 'getchar', 'getcharmod',
- 'getcmdline', 'getcmdpos', 'getcmdtype', 'getcwd', 'getfperm',
- 'getfsize', 'getfontname', 'getftime', 'getftype', 'getline',
- 'getloclist', 'getmatches', 'getpid', 'getpos', 'getqflist',
- 'getreg', 'getregtype', 'gettabwinvar', 'getwinposx',
- 'getwinposy', 'getwinvar', 'glob', 'globpath', 'has',
- 'has_key', 'haslocaldir', 'hasmapto', 'histadd', 'histdel',
- 'histget', 'histnr', 'hlexists', 'hlID', 'hostname', 'iconv',
- 'indent', 'index', 'input', 'inputdialog', 'inputlist',
- 'inputrestore', 'inputsave', 'inputsecret', 'insert',
- 'isdirectory', 'islocked', 'items', 'join', 'keys', 'len',
- 'libcall', 'libcallnr', 'line', 'line2byte', 'lispindent',
- 'localtime', 'log10', 'map', 'maparg', 'mapcheck', 'match',
- 'matchadd', 'matcharg', 'matchdelete', 'matchend', 'matchlist',
- 'matchstr', 'max', 'min', 'mkdir', 'mode', 'nextnonblank',
- 'nr2char', 'pathshorten', 'pow', 'prevnonblank', 'printf',
- 'pumvisible', 'range', 'readfile', 'reltime', 'reltimestr',
- 'remote_expr', 'remote_foreground', 'remote_peek',
- 'remote_read', 'remote_send', 'remove', 'rename', 'repeat',
- 'resolve', 'reverse', 'round', 'search', 'searchdecl',
- 'searchpair', 'searchpairpos', 'searchpos', 'server2client',
- 'serverlist', 'setbufvar', 'setcmdpos', 'setline',
- 'setloclist', 'setmatches', 'setpos', 'setqflist', 'setreg',
- 'settabwinvar', 'setwinvar', 'shellescape', 'simplify', 'sin',
- 'sort', 'soundfold', 'spellbadword', 'spellsuggest', 'split',
- 'sqrt', 'str2float', 'str2nr', 'strftime', 'stridx', 'string',
- 'strlen', 'strpart', 'strridx', 'strtrans', 'submatch',
- 'substitute', 'synID', 'synIDattr', 'synIDtrans', 'synstack',
- 'system', 'tabpagebuflist', 'tabpagenr', 'tabpagewinnr',
- 'taglist', 'tagfiles', 'tempname', 'tolower', 'toupper', 'tr',
- 'trunc', 'type', 'values', 'virtcol', 'visualmode', 'winbufnr',
- 'wincol', 'winheight', 'winline', 'winnr', 'winrestcmd',
- 'winrestview', 'winsaveview', 'winwidth', 'writefile'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '%', '&', '*', '|', '/', '<', '>',
- '^', '-', '+', '~', '?', ':', '$', '@', '.'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'STYLES' => array(
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => ''
- ),
- 'KEYWORDS' => array(
- 1 => 'color: #804040;',
- 2 => 'color: #668080;',
- 3 => 'color: #25BB4D;'
- ),
- 'METHODS' => array(
- 0 => 'color: #000000;',
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000; font-weight:bold;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'STRINGS' => array(
- 0 => 'color: #C5A22D;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;'
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false, //Save some time as OO identifiers aren't used
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(),
- 'HIGHLIGHT_STRICT_BLOCK' => array()
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/visualfoxpro.php b/libvpx/examples/includes/geshi/geshi/visualfoxpro.php
deleted file mode 100644
index 4592dd7..0000000
--- a/libvpx/examples/includes/geshi/geshi/visualfoxpro.php
+++ /dev/null
@@ -1,456 +0,0 @@
-<?php
-/*************************************************************************************
- * visualfoxpro.php
- * ----------------
- * Author: Roberto Armellin (r.armellin@tin.it)
- * Copyright: (c) 2004 Roberto Armellin, Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/09/17
- *
- * Visual FoxPro language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Removed tab as a symbol char
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/10/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Visual Fox Pro',
- 'COMMENT_SINGLE' => array(1 => "//", 2 => "\n*"),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'Case', 'Else', '#Else', 'Then',
- 'Endcase', 'Enddefine', 'Enddo', 'Endfor', 'Endfunc', 'Endif', 'Endprintjob',
- 'Endproc', 'Endscan', 'Endtext', 'Endwith', '#Endif',
- '#Elif','#Define','#If','#Include',
- '#Itsexpression','#Readclauses','#Region','#Section','#Undef','#Wname',
- 'Define','Do',
- 'For','Function','Hidden',
- 'If','Local','Lparameter','Lparameters','Next','Otherwise',
- 'Parameters','Printjob','Procedure','Protected','Public','Scan',
- 'Text','While','With','Abs','Accept','Access','Aclass','Acopy',
- 'Acos','Adatabases','Adbobjects','Addbs','Addrelationtoenv','Addtabletoenv',
- 'Adel','Adir','Aelement','Aerror','Afields','Afont',
- 'Agetclass','Agetfileversion','Ains','Ainstance','Alen','Align',
- 'Alines','Alltrim','Alter','Amembers','Amouseobj','Anetresources',
- 'Ansitooem','Append','Aprinters','Ascan','Aselobj','Asin',
- 'Asort','Assert','Asserts','Assist','Asubscript','Asynchronous',
- 'At_c','Atan','Atc','Atcc','Atcline','Atline',
- 'Atn2','Aused','Autoform','Autoreport','Avcxclasses','Average',
- 'BarCount','BarPrompt','BatchMode','BatchUpdateCount','Begin','BellSound',
- 'BinToC','Bintoc','Bitand','Bitclear','Bitlshift','Bitnot',
- 'Bitor','Bitrshift','Bitset','Bittest','Bitxor','Bof',
- 'Browse','BrowseRefresh','Buffering','BuilderLock','COMArray','COMReturnError',
- 'CToBin','Calculate','Call','Capslock','Cd','Cdow',
- 'Ceiling','Central','Change','Char','Chdir','Chr',
- 'Chrsaw','Chrtran','Chrtranc','Close','Cmonth','Cntbar',
- 'Cntpad','Col','Comclassinfo','CommandTargetQuery','Compile','Completed',
- 'Compobj','Compute','Concat','ConnectBusy','ConnectHandle','ConnectName',
- 'ConnectString','ConnectTimeOut','ContainerReleaseType','Continue','Copy','Cos',
- 'Cot','Count','Coverage','Cpconvert','Cpcurrent','Cpdbf',
- 'Cpnotrans','Create','CreateBinary','Createobject','Createobjectex','Createoffline',
- 'CrsBuffering','CrsFetchMemo','CrsFetchSize','CrsMaxRows','CrsMethodUsed','CrsNumBatch',
- 'CrsShareConnection','CrsUseMemoSize','CrsWhereClause','Ctobin','Ctod','Ctot',
- 'Curdate','Curdir','CurrLeft','CurrSymbol','CursorGetProp','CursorSetProp',
- 'Curtime','Curval','DBGetProp','DBSetProp','DB_BufLockRow','DB_BufLockTable',
- 'DB_BufOff','DB_BufOptRow','DB_BufOptTable','DB_Complette','DB_DeleteInsert','DB_KeyAndModified',
- 'DB_KeyAndTimestamp','DB_KeyAndUpdatable','DB_LocalSQL','DB_NoPrompt','DB_Prompt','DB_RemoteSQL',
- 'DB_TransAuto','DB_TransManual','DB_TransNone','DB_Update','Datetime','Day',
- 'Dayname','Dayofmonth','Dayofweek','Dayofyear','Dbalias','Dbused',
- 'Ddeaborttrans','Ddeadvise','Ddeenabled','Ddeexecute','Ddeinitiate','Ddelasterror',
- 'Ddepoke','Dderequest','Ddesetoption','Ddesetservice','Ddesettopic','Ddeterminate',
- 'Debugout','Declare','DefOLELCid','DefaultValue','Defaultext','Degrees',
- 'DeleteTrigger','Desc','Description','Difference','Dimension','Dir',
- 'Directory','Diskspace','DispLogin','DispWarnings','Display','Dll',
- 'Dmy','DoDefault','DoEvents','Doc','Doevents','Dow',
- 'Drivetype','Drop','Dropoffline','Dtoc','Dtor','Dtos',
- 'Dtot','DynamicInputMask','Each','Edit','Eject','Elif',
- 'End','Eof','Erase','Evaluate','Event','Eventtracking',
- 'Exclude','Exclusive','Exit','Exp','Export','External',
- 'FDate','FTime','Fchsize','Fclose','Fcount','Fcreate',
- 'Feof','Ferror','FetchMemo','FetchSize','Fflush','Fgets',
- 'Filer','Filetostr','Find','Fklabel','Fkmax','Fldlist',
- 'Flock','Floor','Flush','Fontmetric','Fopen','Forceext',
- 'Forcepath','FormSetClass','FormSetLib','FormsClass','FormsLib','Found',
- 'FoxPro','Foxcode','Foxdoc','Foxgen','Foxgraph','Foxview',
- 'Fputs','Fread','French','Fseek','Fsize','Fv',
- 'Fwrite','Gather','German','GetPem','Getbar','Getcolor',
- 'Getcp','Getdir','Getenv','Getexpr','Getfile','Getfldstate',
- 'Getfont','Gethost','Getnextmodified','Getobject','Getpad','Getpict',
- 'Getprinter','Go','Gomonth','Goto','Graph','GridHorz',
- 'GridShow','GridShowPos','GridSnap','GridVert','Help','HelpOn',
- 'HelpTo','HighLightRow','Home','Hour','IMEStatus','IdleTimeOut',
- 'Idxcollate','Ifdef','Ifndef','Iif','Import','Include',
- 'Indbc','Index','Indexseek','Inkey','Inlist','Input',
- 'Insert','InsertTrigger','Insmode','IsBlank','IsFLocked','IsLeadByte',
- 'IsMouse','IsNull','IsRLocked','Isalpha','Iscolor','Isdigit',
- 'Isexclusive','Isflocked','Ishosted','Islower','Isreadonly','Isrlocked',
- 'Isupper','Italian','Japan','Join','Justdrive','Justext',
- 'Justfname','Justpath','Juststem','KeyField','KeyFieldList','Keyboard'
- ),
- 2 => array('Keymatch','LastProject','Lastkey','Lcase','Leftc','Len',
- 'Lenc','Length','Likec','Lineno','LoadPicture','Loadpicture',
- 'Locate','Locfile','Log','Log10','Logout','Lookup',
- 'Loop','Lower','Ltrim','Lupdate','Mail','MaxRecords',
- 'Mcol','Md','Mdown','Mdx','Mdy','Memlines',
- 'Menu','Messagebox','Minute','Mkdir','Mline','Modify',
- 'Month','Monthname','Mouse','Mrkbar','Mrkpad','Mrow',
- 'Mtdll','Mton','Mwindow','Native','Ndx','Network',
- 'NoFilter','Nodefault','Normalize','Note','Now','Ntom',
- 'NullString','Numlock','Nvl','ODBChdbc','ODBChstmt','OLEDropTextInsertion',
- 'OLELCid','Objnum','Objref','Objtoclient','Objvar','Occurs',
- 'Oemtoansi','Oldval','OlePublic','Olereturnerror','On','Open',
- 'Oracle','Order','Os','Outer','PCount','Pack',
- 'PacketSize','Padc','Padl','Padr','Payment','Pcol',
- 'PemStatus','Pi','Pivot','Play','Pop','Popup',
- 'Power','PrimaryKey','Printstatus','Private','Prmbar','Prmpad',
- 'ProjectClick','Proper','Prow','Prtinfo','Push','Putfile',
- 'Pv','Qpr','Quater','QueryTimeOut','Quit','Radians',
- 'Rand','Rat','Ratc','Ratline','Rd','Rdlevel',
- 'Read','Readkey','Recall','Reccount','RecentlyUsedFiles','Recno',
- 'Recsize','Regional','Reindex','RelatedChild','RelatedTable','RelatedTag',
- 'Remove','Rename','Repeat','Replace','Replicate','Report',
- 'ResHeight','ResWidth','ResourceOn','ResourceTo','Resources','Restore',
- 'Resume','Retry','Return','Revertoffline','Rgbscheme','Rightc',
- 'Rlock','Rmdir','Rollback','Round','Rtod','Rtrim',
- 'RuleExpression','RuleText','Run','Runscript','Rview','SQLAsynchronous',
- 'SQLBatchMode','SQLCancel','SQLColumns','SQLConnect','SQLConnectTimeOut','SQLDisconnect',
- 'SQLDispLogin','SQLDispWarnings','SQLExec','SQLGetProp','SQLIdleTimeOut','SQLMoreResults',
- 'SQLPrepare','SQLQueryTimeOut','SQLSetProp','SQLTables','SQLTransactions','SQLWaitTime',
- 'Save','SavePicture','Savepicture','ScaleUnits','Scatter','Scols',
- 'Scroll','Sec','Second','Seek','Select','SendUpdates',
- 'Set','SetDefault','Setfldstate','Setup','ShareConnection','ShowOLEControls',
- 'ShowOLEInsertable','ShowVCXs','Sign','Sin','Size','SizeBox',
- 'Skpbar','Skppad','Sort','Soundex','SourceName','Sqlcommit',
- 'Sqll','Sqlrollback','Sqlstringconnect','Sqrt','Srows','StatusBar',
- 'Store','Str','Strconv','Strtofile','Strtran','Stuff',
- 'Stuffc','Substr','Substrc','Substring','Sum','Suspend',
- 'Sys','Sysmetric','TabOrdering','Table','TableRefresh','Tablerevert',
- 'Tableupdate','TagCount','TagNo','Tan','Target','This',
- 'Thisform','Thisformset','Timestamp','Timestampdiff','Total','Transactions',
- 'Transform','Trim','Truncate','Ttoc','Ttod','Txnlevel',
- 'Txtwidth','Type','Ucase','Undefine','Unlock','Unpack',
- 'Updatable','UpdatableFieldList','Update','UpdateName','UpdateNameList','UpdateTrigger',
- 'UpdateType','Updated','Upper','Upsizing','Usa','Use',
- 'UseMemoSize','Used','Val','Validate','Varread','Vartype',
- 'Version','VersionLanguage','Wait','WaitTime','Wborder','Wchild',
- 'Wcols','Week','Wexist','Wfont','WhereType','Windcmd',
- 'Windhelp','Windmemo','Windmenu','Windmodify','Windquery','Windscreen',
- 'Windsnip','Windstproc','WizardPrompt','Wlast','Wlcol','Wlrow',
- 'Wmaximum','Wminimum','Wontop','Woutput','Wparent','Wread',
- 'Wrows','Wtitle','Wvisible','Year','Zap','_Alignment',
- '_Asciicols','_Asciirows','_Assist','_Beautify','_Box','_Browser',
- '_Builder','_Calcmem','_Calcvalue','_Cliptext','_Converter','_Coverage',
- '_Curobj','_Dblclick','_Diarydate','_Dos','_Foxdoc','_Foxgraph',
- '_Gallery','_Gengraph','_Genhtml','_Genmenu','_Genpd','_Genscrn',
- '_Genxtab','_Getexpr','_Include','_Indent','_Lmargin','_Mac',
- '_Mbr_appnd','_Mbr_cpart','_Mbr_delet','_Mbr_font','_Mbr_goto','_Mbr_grid',
- '_Mbr_link','_Mbr_mode','_Mbr_mvfld','_Mbr_mvprt','_Mbr_seek','_Mbr_sp100',
- '_Mbr_sp200','_Mbr_szfld','_Mbrowse','_Mda_appnd','_Mda_avg','_Mda_brow',
- '_Mda_calc','_Mda_copy','_Mda_count','_Mda_label','_Mda_pack','_Mda_reprt',
- '_Mda_rindx','_Mda_setup','_Mda_sort','_Mda_sp100','_Mda_sp200','_Mda_sp300',
- '_Mda_sum','_Mda_total','_Mdata','_Mdiary','_Med_clear','_Med_copy',
- '_Med_cut','_Med_cvtst','_Med_find','_Med_finda','_Med_goto','_Med_insob',
- '_Med_link','_Med_obj','_Med_paste','_Med_pref','_Med_pstlk','_Med_redo',
- '_Med_repl','_Med_repla','_Med_slcta','_Med_sp100','_Med_sp200','_Med_sp300',
- '_Med_sp400','_Med_sp500','_Med_undo','_Medit','_Mfi_clall','_Mfi_close',
- '_Mfi_export','_Mfi_import','_Mfi_new','_Mfi_open','_Mfi_pgset','_Mfi_prevu',
- '_Mfi_print','_Mfi_quit','_Mfi_revrt','_Mfi_savas','_Mfi_save','_Mfi_send',
- '_Mfi_setup','_Mfi_sp100','_Mfi_sp200','_Mfi_sp300','_Mfi_sp400','_Mfile',
- '_Mfiler','_Mfirst','_Mlabel','_Mlast','_Mline','_Mmacro',
- '_Mmbldr','_Mpr_beaut','_Mpr_cancl','_Mpr_compl','_Mpr_do','_Mpr_docum',
- '_Mpr_formwz','_Mpr_gener','_Mpr_graph','_Mpr_resum','_Mpr_sp100','_Mpr_sp200',
- '_Mpr_sp300','_Mpr_suspend','_Mprog','_Mproj','_Mrc_appnd','_Mrc_chnge',
- '_Mrc_cont','_Mrc_delet','_Mrc_goto','_Mrc_locat','_Mrc_recal','_Mrc_repl',
- '_Mrc_seek','_Mrc_sp100','_Mrc_sp200','_Mrecord','_Mreport','_Mrqbe',
- '_Mscreen','_Msm_data','_Msm_edit','_Msm_file','_Msm_format','_Msm_prog',
- '_Msm_recrd','_Msm_systm','_Msm_text','_Msm_tools','_Msm_view','_Msm_windo',
- '_Mst_about','_Mst_ascii','_Mst_calcu','_Mst_captr','_Mst_dbase','_Mst_diary',
- '_Mst_filer','_Mst_help','_Mst_hphow','_Mst_hpsch','_Mst_macro','_Mst_office',
- '_Mst_puzzl','_Mst_sp100','_Mst_sp200','_Mst_sp300','_Mst_specl','_Msysmenu',
- '_Msystem','_Mtable','_Mtb_appnd','_Mtb_cpart','_Mtb_delet','_Mtb_delrc',
- '_Mtb_goto','_Mtb_link','_Mtb_mvfld','_Mtb_mvprt','_Mtb_props','_Mtb_recal',
- '_Mtb_sp100','_Mtb_sp200','_Mtb_sp300','_Mtb_sp400','_Mtb_szfld','_Mwi_arran',
- '_Mwi_clear','_Mwi_cmd','_Mwi_color','_Mwi_debug','_Mwi_hide','_Mwi_hidea',
- '_Mwi_min','_Mwi_move','_Mwi_rotat','_Mwi_showa','_Mwi_size','_Mwi_sp100',
- '_Mwi_sp200','_Mwi_toolb','_Mwi_trace','_Mwi_view','_Mwi_zoom','_Mwindow',
- '_Mwizards','_Mwz_all','_Mwz_form','_Mwz_foxdoc','_Mwz_import','_Mwz_label',
- '_Mwz_mail','_Mwz_pivot','_Mwz_query','_Mwz_reprt','_Mwz_setup','_Mwz_table',
- '_Mwz_upsizing','_Netware','_Oracle','_Padvance','_Pageno','_Pbpage',
- '_Pcolno','_Pcopies','_Pdparms','_Pdriver','_Pdsetup','_Pecode',
- '_Peject','_Pepage','_Pform','_Plength','_Plineno','_Ploffset',
- '_Ppitch','_Pquality','_Pretext','_Pscode','_Pspacing','_Pwait',
- '_Rmargin','_Runactivedoc','_Samples','_Screen','_Shell','_Spellchk',
- '_Sqlserver','_Startup','_Tabs','_Tally','_Text','_Throttle',
- '_Transport','_Triggerlevel','_Unix','_WebDevOnly','_WebMenu','_WebMsftHomePage',
- '_WebVFPHomePage','_WebVfpOnlineSupport','_Windows','_Wizard','_Wrap','_scctext',
- '_vfp','Additive','After','Again','Aindent','Alignright',
- 'All','Alt','Alternate','And','Ansi','Any',
- 'Aplabout','App','Array','As','Asc','Ascending',
- 'Ascii','At','Attributes','Automatic','Autosave','Avg',
- 'Bar','Before','Bell','Between','Bitmap','Blank',
- 'Blink','Blocksize','Border','Bottom','Brstatus','Bucket',
- 'Buffers','By','Candidate','Carry','Cascade','Catalog',
- 'Cdx','Center','Century','Cga','Character','Check',
- 'Classlib','Clock','Cnt','Codepage','Collate','Color',
- 'Com1','Com2','Command','Compact','Compatible','Compress',
- 'Confirm','Connection','Connections','Connstring','Console','Copies',
- 'Cpcompile','Cpdialog','Csv','Currency','Cycle','Databases',
- 'Datasource','Date','Db4','Dbc','Dbf','Dbmemo3',
- 'Debug','Decimals','Defaultsource','Deletetables','Delimited','Delimiters',
- 'Descending','Design','Development','Device','Dif','Disabled',
- 'Distinct','Dlls','Dohistory','Dos','Dosmem','Double',
- 'Driver','Duplex','Echo','Editwork','Ega25','Ega43',
- 'Ems','Ems64','Encrypt','Encryption','Environment','Escape',
- 'Events','Exact','Except','Exe','Exists','Expression',
- 'Extended','F','Fdow','Fetch','Field','Fields',
- 'File','Files','Fill','Fixed','Float','Foldconst',
- 'Font','Footer','Force','Foreign','Fox2x','Foxplus',
- 'Free','Freeze','From','Fullpath','Fw2','Fweek',
- 'Get','Gets','Global','Group','Grow','Halfheight',
- 'Having','Heading','Headings','Helpfilter','History','Hmemory',
- 'Hours','Id','In','Indexes','Information','Instruct',
- 'Int','Integer','Intensity','Intersect','Into','Is',
- 'Isometric','Key','Keycolumns','Keycomp','Keyset','Last',
- 'Ledit','Level','Library','Like','Linked','Lock',
- 'Logerrors','Long','Lpartition','Mac','Macdesktop','Machelp',
- 'Mackey','Macros','Mark','Master','Max','Maxmem',
- 'Mdi','Memlimit','Memory','Memos','Memowidth','Memvar',
- 'Menus','Messages','Middle','Min','Minimize','Minus',
- 'Mod','Modal','Module','Mono43','Movers','Multilocks',
- 'Mvarsiz','Mvcount','N','Near','Negotiate','Noalias',
- 'Noappend','Noclear','Noclose','Noconsole','Nocptrans','Nodata',
- 'Nodebug','Nodelete','Nodup','Noedit','Noeject','Noenvironment',
- 'Nofloat','Nofollow','Nogrow','Noinit','Nolgrid','Nolink',
- 'Nolock','Nomargin','Nomdi','Nomenu','Nominimize','Nomodify'
- ),
- 3 => array('Nomouse','None','Nooptimize','Nooverwrite','Noprojecthook','Noprompt',
- 'Noread','Norefresh','Norequery','Norgrid','Norm','Normal',
- 'Nosave','Noshadow','Noshow','Nospace','Not','Notab',
- 'Notify','Noupdate','Novalidate','Noverify','Nowait','Nowindow',
- 'Nowrap','Nozoom','Npv','Null','Number','Objects',
- 'Odometer','Of','Off','Oleobjects','Only','Optimize',
- 'Or','Orientation','Output','Outshow','Overlay','Overwrite',
- 'Pad','Palette','Paperlength','Papersize','Paperwidth','Password',
- 'Path','Pattern','Pause','Pdox','Pdsetup','Pen',
- 'Pfs','Pixels','Plain','Popups','Precision','Preference',
- 'Preview','Primary','Printer','Printquality','Procedures','Production',
- 'Program','Progwork','Project','Prompt','Query','Random',
- 'Range','Readborder','Readerror','Record','Recover','Redit',
- 'Reference','References','Relative','Remote','Reprocess','Resource',
- 'Rest','Restrict','Rgb','Right','Row','Rowset',
- 'Rpd','Runtime','Safety','Same','Sample','Say',
- 'Scale','Scheme','Scoreboard','Screen','Sdf','Seconds',
- 'Selection','Shadows','Shared','Sheet','Shell','Shift',
- 'Shutdown','Single','Some','Sortwork','Space','Sql',
- 'Standalone','Status','Std','Step','Sticky','String',
- 'Structure','Subclass','Summary','Sylk','Sysformats','Sysmenus',
- 'System','T','Tab','Tables','Talk','Tedit',
- 'Textmerge','Time','Timeout','Titles','Tmpfiles','To',
- 'Topic','Transaction','Trap','Trbetween','Trigger','Ttoption',
- 'Typeahead','Udfparms','Union','Unique','Userid','Users',
- 'Values','Var','Verb','Vga25','Vga50','Views',
- 'Volume','Where','Windows','Wk1','Wk3','Wks',
- 'Workarea','Wp','Wr1','Wrap','Wrk','Xcmdfile',
- 'Xl5','Xl8','Xls','Y','Yresolution','Zoom',
- 'Activate','ActivateCell','Add','AddColumn','AddItem','AddListItem',
- 'AddObject','AddProperty','AddToSCC','AfterBuild','AfterCloseTables','AfterDock',
- 'AfterRowColChange','BeforeBuild','BeforeDock','BeforeOpenTables','BeforeRowColChange','Box',
- 'Build','CheckIn','CheckOut','Circle','Clear','ClearData',
- 'Cleanup','Click','CloneObject','CloseEditor','CloseTables','Cls',
- 'CommandTargetExec','CommandTargetQueryStas','ContainerRelease','DataToClip','DblClick','Deactivate',
- 'Delete','DeleteColumn','Deleted','Destroy','DoCmd','Dock',
- 'DoScroll','DoVerb','DownClick','Drag','DragDrop','DragOver',
- 'DropDown','Draw','EnterFocus','Error','ErrorMessage','Eval',
- 'ExitFocus','FormatChange','GetData','GetFormat','GetLatestVersion','GoBack',
- 'GotFocus','GoForward','GridHitTest','Hide','HideDoc','IndexToItemId',
- 'Init','InteractiveChange','Item','ItemIdToIndex','KeyPress','Line',
- 'Load','LostFocus','Message','MiddleClick','MouseDown','MouseMove',
- 'MouseUp','MouseWheel','Move','Moved','NavigateTo','Newobject',
- 'OLECompleteDrag','OLEDrag','OLEDragDrop','OLEDragOver','OLEGiveFeedback','OLESetData',
- 'OLEStartDrag','OpenEditor','OpenTables','Paint','Point','Print',
- 'ProgrammaticChange','PSet','QueryAddFile','QueryModifyFile','QueryRemoveFile','QueryRunFile',
- 'QueryUnload','RangeHigh','RangeLow','ReadActivate','ReadExpression','ReadDeactivate',
- 'ReadMethod','ReadShow','ReadValid','ReadWhen','Refresh','Release',
- 'RemoveFromSCC','RemoveItem','RemoveListItem','RemoveObject','Requery','RequestData',
- 'Reset','ResetToDefault','Resize','RightClick','SaveAs','SaveAsClass',
- 'Scrolled','SetAll','SetData','SetFocus','SetFormat','SetMain',
- 'SetVar','SetViewPort','ShowDoc','ShowWhatsThis','TextHeight','TextWidth',
- 'Timer','UIEnable','UnDock','UndoCheckOut','Unload','UpClick',
- 'Valid','WhatsThisMode','When','WriteExpression','WriteMethod','ZOrder',
- 'ATGetColors','ATListColors','Accelerate','ActiveColumn','ActiveControl','ActiveForm',
- 'ActiveObjectId','ActivePage','ActiveProject','ActiveRow','AddLineFeeds','Alias',
- 'Alignment','AllowAddNew','AllowHeaderSizing','AllowResize','AllowRowSizing','AllowTabs',
- 'AlwaysOnTop','Application','AutoActivate','AutoCenter','AutoCloseTables','AutoIncrement',
- 'AutoOpenTables','AutoRelease','AutoSize','AutoVerbMenu','AutoYield','AvailNum',
- 'BackColor','BackStyle','BaseClass','BorderColor','BorderStyle','BorderWidth',
- 'Bound','BoundColumn','BoundTo','BrowseAlignment','BrowseCellMarg','BrowseDestWidth',
- 'BufferMode','BufferModeOverride','BuildDateTime','ButtonCount','ButtonIndex','Buttons',
- 'CLSID','CanAccelerate','CanGetFocus','CanLoseFocus','Cancel','Caption',
- 'ChildAlias','ChildOrder','Class','ClassLibrary','ClipControls','ClipRect',
- 'Closable','ColorScheme','ColorSource','ColumnCount','ColumnHeaders','ColumnLines',
- 'ColumnOrder','ColumnWidths','Columns','Comment','ContinuousScroll','ControlBox',
- 'ControlCount','ControlIndex','ControlSource','Controls','CurrentControl','CurrentX',
- 'CurrentY','CursorSource','Curvature','DataSession','DataSessionId','DataSourceObj',
- 'DataType','Database','DateFormat','DateMark','DefButton','DefButtonOrig',
- 'DefHeight','DefLeft','DefTop','DefWidth','Default','DefaultFilePath',
- 'DefineWindows','DeleteMark','Desktop','Dirty','DisabledBackColor','DisabledByEOF',
- 'DisabledForeColor','DisabledItemBackColor','DisabledItemForeColor','DisabledPicture','DispPageHeight','DispPageWidth',
- 'DisplayCount','DisplayValue','DoCreate','DockPosition','Docked','DocumentFile',
- 'DownPicture','DragIcon','DragMode','DragState','DrawMode','DrawStyle',
- 'DrawWidth','DynamicAlignment','DynamicBackColor','DynamicCurrentControl','DynamicFontBold','DynamicFontItalic',
- 'DynamicFontName','DynamicFontOutline','DynamicFontShadow','DynamicFontSize','DynamicFontStrikethru','DynamicFontUnderline',
- 'DynamicForeColor','EditFlags','Enabled','EnabledByReadLock','Encrypted','EnvLevel',
- 'ErasePage','FileClass','FileClassLibrary','FillColor','FillStyle','Filter',
- 'FirstElement','FontBold','FontItalic','FontName','FontOutline','FontShadow',
- 'FontSize','FontStrikethru','FontUnderline','ForceFocus','ForeColor','FormCount',
- 'FormIndex','FormPageCount','FormPageIndex','Format','Forms','FoxFont',
- 'FullName','GoFirst','GoLast','GridLineColor','GridLineWidth','GridLines'
- ),
- 4 => array('HPROJ','HWnd','HalfHeightCaption','HasClip','HeaderGap','HeaderHeight',
- 'Height','HelpContextID','HideSelection','Highlight','HomeDir','HostName',
- 'HotKey','HscrollSmallChange','IMEMode','Icon','IgnoreInsert','InResize',
- 'Increment','IncrementalSearch','InitialSelectedAlias','InputMask','Instancing','IntegralHeight',
- 'Interval','ItemBackColor','ItemData','ItemForeColor','ItemIDData','ItemTips',
- 'JustReadLocked','KeyPreview','KeyboardHighValue','KeyboardLowValue','LastModified','Left',
- 'LeftColumn','LineSlant','LinkMaster','List','ListCount','ListIndex',
- 'ListItem','ListItemId','LockDataSource','LockScreen','MDIForm','MainClass',
- 'MainFile','Margin','MaxButton','MaxHeight','MaxLeft','MaxLength',
- 'MaxTop','MaxWidth','MemoWindow','MinButton','MinHeight','MinWidth',
- 'MouseIcon','MousePointer','Movable','MoverBars','MultiSelect','Name',
- 'NapTime','NewIndex','NewItemId','NoDataOnLoad','NoDefine','NotifyContainer',
- 'NullDisplay','NumberOfElements','OLEDragMode','OLEDragPicture','OLEDropEffects','OLEDropHasData',
- 'OLEDropMode','OLERequestPendingTimeOut','OLEServerBusyRaiseError','OLEServerBusyTimeOut','OLETypeAllowed','OleClass',
- 'OleClassId','OleControlContainer','OleIDispInValue','OleIDispOutValue','OleIDispatchIncoming','OleIDispatchOutgoing',
- 'OnResize','OneToMany','OpenViews','OpenWindow','PageCount','PageHeight',
- 'PageOrder','PageWidth','Pages','Panel','PanelLink','Parent',
- 'ParentAlias','ParentClass','Partition','PasswordChar','Picture','ProcessID',
- 'ProgID','ProjectHookClass','ProjectHookLibrary','Projects','ReadColors','ReadCycle',
- 'ReadFiller','ReadLock','ReadMouse','ReadOnly','ReadSave','ReadSize',
- 'ReadTimeout','RecordMark','RecordSource','RecordSourceType','Rect','RelationalExpr',
- 'RelativeColumn','RelativeRow','ReleaseErase','ReleaseType','ReleaseWindows','Resizable',
- 'RightToLeft','RowHeight','RowSource','RowSourceType','SCCProvider','SCCStatus',
- 'SDIForm','ScaleMode','ScrollBars','SelLength','SelStart','SelText',
- 'SelectOnEntry','Selected','SelectedBackColor','SelectedForeColor','SelectedID','SelectedItemBackColor',
- 'SelectedItemForeColor','SelfEdit','ServerClass','ServerClassLibrary','ServerHelpFile','ServerName',
- 'ServerProject','ShowTips','ShowWindow','Sizable','Size<height>','Size<maxlength>',
- 'Size<width>','Skip','SkipForm','Sorted','SourceType','Sparse',
- 'SpecialEffect','SpinnerHighValue','SpinnerLowValue','SplitBar','StartMode','StatusBarText',
- 'Stretch','StrictDateEntry','Style','SystemRefCount','TabIndex','TabStop',
- 'TabStretch','TabStyle','Tabhit','Tabs','Tag','TerminateRead',
- 'ThreadID','TitleBar','ToolTipText','Top','TopIndex','TopItemId',
- 'TypeLibCLSID','TypeLibDesc','TypeLibName','UnlockDataSource','Value','ValueDirty',
- 'VersionComments','VersionCompany','VersionCopyright','VersionDescription','VersionNumber','VersionProduct',
- 'VersionTrademarks','View','ViewPortHeight','ViewPortLeft','ViewPortTop','ViewPortWidth',
- 'Visible','VscrollSmallChange','WasActive','WasOpen','WhatsThisButton','WhatsThisHelp',
- 'WhatsThisHelpID','Width','WindowList','WindowNTIList','WindowState','WindowType',
- 'WordWrap','ZOrderSet','ActiveDoc','Checkbox','Column','ComboBox',
- 'CommandButton','CommandGroup','Container','Control','Cursor','Custom',
- 'DataEnvironment','EditBox','Empty','FontClass','Form','Formset',
- 'General','Grid','Header','HyperLink','Image','Label',
- 'ListBox','Memo','OleBaseControl','OleBoundControl','OleClassIDispOut','OleControl',
- 'OptionButton','OptionGroup','Page','PageFrame','ProjectHook','RectClass',
- 'Relation','Session','Shape','Spinner','TextBox' ,'Toolbar'
- ),
- ),
- 'SYMBOLS' => array(
- "!", "@", "$", "%",
- "(", ")", "{", "}", "[", "]",
- "-", "+", "*", "/",
- "=", "<", ">",
- ":", ";", ",", ".", "&",
- "?", "??", "???"
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: blue;',
- 2 => 'color: blue;',
- 3 => 'color: blue;',
- 4 => 'color: blue;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: green; font-style: italic;',
- 2 => 'color: green; font-style: italic;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: blue;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 1 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: blue;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/visualprolog.php b/libvpx/examples/includes/geshi/geshi/visualprolog.php
deleted file mode 100644
index 2a5656b..0000000
--- a/libvpx/examples/includes/geshi/geshi/visualprolog.php
+++ /dev/null
@@ -1,129 +0,0 @@
-<?php
-/*************************************************************************************
- * visualprolog.php
- * ----------
- * Author: Thomas Linder Puls (puls@pdc.dk)
- * Copyright: (c) 2008 Thomas Linder Puls (puls@pdc.dk)
- * Release Version: 1.0.8.3
- * Date Started: 2008/11/20
- *
- * Visual Prolog language file for GeSHi.
- *
- * CHANGES
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Visual Prolog',
- 'COMMENT_SINGLE' => array(1 => '%'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'HARDQUOTE' => array('@"', '"'),
- 'HARDESCAPE' => array('""'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array(
- 'clauses','constants','constructors','delegate','domains','facts',
- 'goal','guards','inherits','monitor','namespace','open',
- 'predicates','properties','resolve','supports'
- ),
- 2 => array(
- 'align','and','anyflow','as','bitsize','catch','determ','digits',
- 'div','do','else','elseif','erroneous','externally','failure',
- 'finally','from','language','mod','multi','nondeterm','or',
- 'procedure','quot','rem','single','then','to'
- ),
- 3 => array(
- '#bininclude','#else','#elseif','#endif','#error','#export',
- '#externally','#if','#import','#include','#message','#options',
- '#orrequires','#requires','#then','#warning'
- ),
- ),
- 'SYMBOLS' => array(
- '+', '-', '*', '?', '=', '/', '>', '<', '^', '!', ':', '(', ')', '{', '}', '[', ']'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => true,
- 1 => true,
- 2 => true,
- 3 => true
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #808000;',
- 2 => 'color: #333399;',
- 3 => 'color: #800080;',
- ),
- 'COMMENTS' => array(
- 1 => 'color: #AA77BD',
- 'MULTI' => 'color: #AA77BD'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #008080;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #00B7B7;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #0000FF;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #000000;'
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 0 => 'color: #008000;',
- 1 => 'color: #808000;',
- 2 => 'color: #333399;',
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => ':',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- 0 => "(?<![a-zA-Z0-9_])(?!(?:PIPE|SEMI)>)[A-Z_]\w*(?!\w)",
- 1 => "\\b(end\\s+)?(implement|class|interface)\\b",
- 2 => "\\b(end\\s+)?(foreach|if|try)\\b",
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/whitespace.php b/libvpx/examples/includes/geshi/geshi/whitespace.php
deleted file mode 100644
index dfada78..0000000
--- a/libvpx/examples/includes/geshi/geshi/whitespace.php
+++ /dev/null
@@ -1,121 +0,0 @@
-<?php
-/*************************************************************************************
- * whitespace.php
- * ----------
- * Author: Benny Baumann (BenBE@geshi.org)
- * Copyright: (c) 2008 Benny Baumann (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2009/10/31
- *
- * Whitespace language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/10/31 (1.0.8.1)
- * - First Release
- *
- * TODO
- * ----
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-$language_data = array (
- 'LANG_NAME' => 'Whitespace',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'COMMENT_REGEXP' => array(
- 3 => "/[^\n\x20\x09]+/s"
- ),
- 'CASE_KEYWORDS' => GESHI_CAPS_UPPER,
- 'QUOTEMARKS' => array(),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- ),
- 'COMMENTS' => array(
- 3 => 'color: #666666; font-style: italic;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'SCRIPT' => array(
- ),
- 'REGEXPS' => array(
- 2 => 'background-color: #FF9999;',
- 3 => 'background-color: #9999FF;'
- )
- ),
- 'URLS' => array(
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 2 => array(
- GESHI_SEARCH => "(?<!\\A)\x20",
- GESHI_REPLACE => "&#32;",
- GESHI_MODIFIERS => 's',
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- 3 => array(
- GESHI_SEARCH => "\x09",
- GESHI_REPLACE => "&#9;",
- GESHI_MODIFIERS => 's',
- GESHI_BEFORE => "",
- GESHI_AFTER => ""
- ),
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4,
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'KEYWORDS' => GESHI_NEVER,
- 'SYMBOLS' => GESHI_NEVER,
- 'STRINGS' => GESHI_NEVER,
-// 'REGEXPS' => GESHI_NEVER,
- 'NUMBERS' => GESHI_NEVER
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/winbatch.php b/libvpx/examples/includes/geshi/geshi/winbatch.php
deleted file mode 100644
index caa94a4..0000000
--- a/libvpx/examples/includes/geshi/geshi/winbatch.php
+++ /dev/null
@@ -1,369 +0,0 @@
-<?php
-/*************************************************************************************
- * winbatch.php
- * ------------
- * Author: Craig Storey (storey.craig@gmail.com)
- * Copyright: (c) 2004 Craig Storey (craig.xcottawa.ca)
- * Release Version: 1.0.8.3
- * Date Started: 2006/05/19
- *
- * WinBatch language file for GeSHi.
- *
- * WinBatch is a Windows scripting language - www.winbatch.com.
- * The keywords were pulled from the winbatch/system/WIL.clr file for v2005G.
- * Not all extender functions are added, but a very large set of the most common.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2006/05/05 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/07/14)
- * -------------------------
- * - Right now any ':Subroutine' is treated as a comment. This highlights the
- * Subroutine's name, but it's not a perfect fix. I should use a RegEx in
- * GeSHI_Search&Replace features..
- * - Update the list of extender functions.
- * - Use a regular expression to comment UDFs that start with 'udf_'.
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Winbatch',
- 'COMMENT_SINGLE' => array(1 => ';', 2 => ':'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"', '`'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- 1 => array(
- 'While', 'To', 'Then', 'Switch', 'Select', 'Return', 'Next', 'IntControl', 'Include', 'In', 'If',
- 'Goto', 'GoSub', 'ForEach', 'For', 'Exit', 'Execute', 'ErrorMode', 'EndWhile', 'EndSwitch', '#EndSubRoutine',
- 'EndSelect', 'EndIf', '#EEndFunction', 'EndFor', 'End', 'Else', 'DropWild', 'Drop', '#DefineSubRoutine',
- '#DefineFunction', 'Debug', 'Continue', 'Case', 'CallExt', 'Call', 'By', 'BreakPoint', 'Break'
- ),
- 2 => array(
- 'ZOOMED', 'YES', 'WORD4', 'WORD2', 'WORD1', 'WHOLESECTION', 'WAIT', 'UNSORTED', 'UNCHECK', 'TRUE', 'TILE',
- 'TAB', 'STRING', 'STACK', 'SPC2NET', 'SORTED', 'SOK', 'SNET2PC', 'SINGLE', 'SHIFT', 'SERVER', 'SERRWINSOCK',
- 'SERRVOICE', 'SERRSOCKET', 'SERRSERVICE', 'SERRSELECT', 'SERRPARAM', 'SERROUTOFMEM', 'SERRNOTFOUND', 'SERRNOCONN',
- 'SERRNOANSWER', 'SERRMUSTWAIT', 'SERRIPADDR', 'SERRHOSTNAME', 'SERRFAILURE', 'SERRBUSY', 'SCROLLLOCK', 'SCANCEL',
- 'SAVE', 'SALREADY', 'ROWS', 'REGUSERS', 'REGROOT', 'REGMACHINE', 'REGCURRENT', 'REGCLASSES', 'RDBLCLICK', 'RCLICK',
- 'RBUTTON', 'RAD2DEG', 'QSUCCESSINFO', 'QSUCCESS', 'QSTILLEX', 'QROLLBACK', 'QNULL', 'QNODATA', 'QNEXT', 'QNEEDDATA',
- 'QFIRST', 'QCOMMIT', 'QBADHANDLE', 'PRINTER', 'PLANCKJOULES', 'PLANCKERGS', 'PI', 'PARSEONLY', 'PARSEC', 'P3ERRREPLY',
- 'OPEN', 'ON', 'OFF', 'NUMLOCK', 'NOWAIT', 'NOTIFY', 'NORMAL', 'NORESIZE', 'NONE', 'NO', 'NCSAFORMAT', 'MULTIPLE',
- 'MSFORMAT', 'MPLAYRDBLCK', 'MPLAYRCLK', 'MPLAYRBUTTON', 'MPLAYMDBLCK', 'MPLAYMCLK', 'MPLAYMBUTTON', 'MPLAYLDBLCK',
- 'MPLAYLCLK', 'MPLAYLBUTTON', 'MINOR', 'MDBLCLICK', 'MCLICK', 'MBYESNO', 'MBUTTON', 'MBOKCANCEL', 'MAJOR', 'MAGFIELD',
- 'LOCALGROUP', 'LIGHTMTPS', 'LIGHTMPS', 'LF', 'LDBLCLICK', 'LCLICK', 'LBUTTON', 'LAFFDBERROR', 'ICON', 'HTTPS', 'HTTP',
- 'HNOHEADER', 'HMETHODPOST', 'HMETHODGET', 'HIDDEN', 'HHEADERONLY', 'HHEADER', 'GRAVITATION', 'GOPHER', 'GOLDENRATIO',
- 'GMTSEC', 'GLOBALGROUP', 'GFTSEC', 'GETPROCID', 'GETEXITCODE', 'FWDSCAN', 'FTPPASSIVE', 'FTP', 'FLOAT8', 'FARADAY',
- 'FALSE', 'EXTENDED', 'EULERS', 'ENABLE', 'ELECTRIC', 'DRIVE', 'DISABLE', 'DESCENDING', 'DEG2RAD', 'DEFAULT', 'CTRL',
- 'CRLF', 'CR', 'COMMONFORMAT', 'COLUMNS', 'CHECK', 'CAPSLOCK', 'CANCEL', 'BOLTZMANN', 'BACKSCAN', 'AVOGADRO', 'ATTR_X',
- 'ATTR_T', 'ATTR_SY', 'ATTR_SH', 'ATTR_RO', 'ATTR_RI', 'ATTR_P', 'ATTR_IC', 'ATTR_H', 'ATTR_DM', 'ATTR_DI', 'ATTR_DC',
- 'ATTR_CI', 'ATTR_A', 'ASCENDING', 'ARRANGE', 'AMC', 'ACC_WRITE', 'ACC_READ_NT', 'ACC_READ_95', 'ACC_READ', 'ACC_PRINT_NT',
- 'ACC_PMANG_NT', 'ACC_PFULL_NT', 'ACC_LIST', 'ACC_FULL_NT', 'ACC_FULL_95', 'ACC_DELETE', 'ACC_CREATE', 'ACC_CONTROL',
- 'ACC_CHNG_NT', 'ACC_ATTRIB', 'ABOVEICONS'
- ),
- 3 => array(
- 'Yields', 'Yield', 'WinZoom', 'WinWaitExist', 'WinWaitClose', 'WinWaitChild', 'WinVersion', 'WinTitle', 'WinSysInfo',
- 'WinState', 'WinShow', 'WinResources', 'WinPositionChild', 'WinPosition', 'WinPlaceSet', 'WinPlaceGet', 'WinPlaceChild',
- 'WinPlace', 'WinParmSet', 'WinParmGet', 'WinName', 'WinMetrics', 'WinItemProcId', 'WinItemNameId', 'WinItemizeEx',
- 'WinItemize', 'WinItemChild', 'WinIsDos', 'WinIdGet', 'WinIconize', 'WinHide', 'WinHelp', 'WinGetactive', 'WinExistchild',
- 'WinExist', 'WinExename', 'WinConfig', 'WinClosenot', 'WinClose', 'WinArrange', 'WinActivechild', 'WinActivchild',
- 'WinActivate', 'WebVerifyCard', 'WebSetTimeout', 'WebParamSize', 'WebParamNames', 'WebParamFile', 'WebParamData',
- 'WebParamBuf', 'WebOutFile', 'WebOutBinary', 'WebOut', 'WebDumpError', 'WebDatData', 'WebCounter', 'WebConSize', 'WebConData',
- 'WebConBuf', 'WebCmdData', 'WebBaseConv', 'Wallpaper', 'WaitForKeyEX', 'WaitForKey', 'VersionDLL', 'Version', 'VarType',
- 'TimeYmdHms', 'TimeWait', 'TimeSubtract', 'TimeJulToYmd', 'TimeJulianDay', 'TimeDiffSecs', 'TimeDiffDays', 'TimeDiff', 'TimeDelay',
- 'TimeDate', 'TimeAdd', 'TextSelect', 'TextBoxSort', 'TextBox', 'Terminate', 'Tanh', 'Tan', 'SysParamInfo', 'SvcWaitForCmd',
- 'SvcSetState', 'SvcSetAccept', 'StrUpper', 'StrTrim', 'StrSubWild', 'StrSub', 'StrScan', 'StrReplace', 'StrLower', 'StrLenWild',
- 'StrLen', 'StrIndexWild', 'StrIndexNC', 'StrIndex', 'StriCmp', 'StrFixLeft', 'StrFixCharsL', 'StrFixChars', 'StrFix', 'StrFill',
- 'StrCnt', 'StrCmp', 'StrClean', 'StrCharCount', 'StrCat', 'StrByteCount', 'Sqrt', 'SoundVolume', 'Sounds', 'Snapshot', 'Sinh', 'Sin',
- 'ShortCutMake', 'ShortCutInfo', 'ShortCutExtra', 'ShortCutEdit', 'ShortCutDir', 'ShellExecute', 'SendMenusToEx', 'SendMenusTo',
- 'SendKeysTo', 'SendKeysChild', 'SendKey', 'RunZoomWait', 'RunZoom', 'RunWithLogon', 'RunWait', 'RunShell', 'RunIconWait',
- 'RunIcon', 'RunHideWait', 'RunHide', 'RunExit', 'RunEnviron', 'Run', 'RtStatus', 'Reload', 'RegUnloadHive', 'RegSetValue',
- 'RegSetQword', 'RegSetMulSz', 'RegSetExpSz', 'RegSetEx', 'RegSetDword', 'RegSetBin', 'RegQueryValue', 'RegQueryStr',
- 'RegQueryQword', 'RegQueryMulSz', 'RegQueryKeys', 'RegQueryKeyLastWriteTime', 'RegQueryKey', 'RegQueryItem', 'RegQueryExpSz',
- 'RegQueryEx', 'RegQueryDword', 'RegQueryBin', 'RegOpenKeyEx', 'RegOpenKey', 'RegOpenFlags', 'RegLoadHive', 'RegExistValue',
- 'RegExistKey', 'RegEntryType', 'RegDelValue', 'RegDeleteKey', 'RegCreateKey', 'RegConnect', 'RegCloseKey', 'RegApp', 'Random',
- 'PtrPersistent', 'PtrGlobalDefine', 'PtrGlobal', 'Print', 'PlayWaveform', 'PlayMidi', 'PlayMedia', 'PipeServerWrite', 'PipeServerRead',
- 'PipeServerCreate', 'PipeServerClose', 'PipeInfo', 'PipeClientSendRecvData', 'PipeClientOpen', 'PipeClientClose', 'Pause',
- 'ParseData', 'ObjectTypeGet', 'ObjectType', 'ObjectOpen', 'ObjectGet', 'ObjectEventRemove', 'objecteventremove', 'ObjectEventAdd',
- 'objecteventadd', 'ObjectCreate', 'ObjectConstToArray', 'ObjectConstantsGet', 'ObjectCollectionOpen', 'ObjectCollectionNext',
- 'ObjectCollectionClose', 'ObjectClose', 'ObjectAccess', 'Num2Char', 'NetInfo', 'MsgTextGet', 'MousePlay', 'MouseMove', 'MouseInfo',
- 'MouseDrag', 'MouseCoords', 'MouseClickBtn', 'MouseClick', 'mod', 'Min', 'Message', 'Max', 'Loge', 'LogDisk', 'Log10', 'LastError',
- 'KeyToggleSet', 'KeyToggleGet', 'ItemSortNc', 'ItemSort', 'ItemSelect', 'ItemReplace', 'ItemRemove', 'ItemLocate', 'ItemInsert',
- 'ItemExtractCSV', 'ItemExtract', 'ItemCountCSV', 'ItemCount', 'IsNumber', 'IsLicensed', 'IsKeyDown', 'IsInt', 'IsFloat', 'IsDefined',
- 'Int', 'InstallFile', 'IniWritePvt', 'IniWrite', 'IniReadPvt', 'IniRead', 'IniItemizePvt', 'IniItemize', 'IniDeletePvt', 'IniDelete',
- 'IgnoreInput', 'IconReplace', 'IconInfo', 'IconExtract', 'IconArrange', 'GetTickCount', 'GetObject', 'GetExactTime', 'Floor',
- 'FindWindow', 'FileYmdHms', 'FileWrite', 'FileVerInfo', 'FileTimeTouch', 'FileTimeSetEx', 'FileTimeSet', 'FileTimeGetEx',
- 'FileTimeGet', 'FileTimeCode', 'FileSizeEx', 'FileSize', 'FileRoot', 'FileRename', 'FileRead', 'FilePutW', 'FilePut', 'FilePath',
- 'FileOpen', 'FileNameShort', 'FileNameLong', 'FileNameEval2', 'FileNameEval1', 'FileMoveAttr', 'FileMove', 'FileMapName',
- 'FileLocate', 'FileItemPath', 'FileItemize', 'FileInfoToArray', 'FileGetW', 'FileGet', 'FileFullname', 'FileExtension', 'FileExist',
- 'FileDelete', 'FileCreateTemp', 'FileCopyAttr', 'FileCopy', 'FileCompare', 'FileClose', 'FileBaseName', 'FileAttrSetEx',
- 'FileAttrSet', 'FileAttrGetEx', 'FileAttrGet', 'FileAppend', 'Fabs', 'ExtractAttachedFile', 'Exp', 'ExeTypeInfo', 'Exclusive',
- 'EnvItemize', 'EnvironSet', 'Environment', 'EndSession', 'DosVersion', 'DllLoad', 'DllLastError', 'DllHwnd', 'DllHinst',
- 'DllFree', 'DllCallCDecl', 'DllCall', 'Display', 'DiskVolinfo', 'DiskSize', 'DiskScan', 'DiskInfo', 'DiskFree', 'DiskExist',
- 'DirWindows', 'DirSize', 'DirScript', 'DirRename', 'DirRemove', 'DirMake', 'DirItemize', 'DirInfoToArray', 'DirHome', 'DirGet',
- 'DirExist', 'DirChange', 'DirAttrSetEx', 'DirAttrSet', 'DirAttrGetEx', 'DirAttrGet', 'DialogProcOptions', 'DialogObject',
- 'DialogControlState', 'DialogControlSet', 'DialogControlGet', 'DialogBox', 'Dialog', 'Delay', 'Decimals', 'DebugTrace',
- 'DebugData', 'DDETimeout', 'DDETerminate', 'DDERequest', 'DDEPoke', 'DDEInitiate', 'DDEExecute', 'DateTime', 'CurrFilepath',
- 'CurrentPath', 'CurrentFile', 'CreateObject', 'Cosh', 'Cos', 'ClipPut', 'ClipHasFormat', 'ClipGetEx', 'ClipGet', 'ClipAppend',
- 'ChrUnicodeToString', 'ChrUnicodeToHex', 'ChrStringToUnicode', 'ChrSetCodepage', 'ChrHexToUnicode', 'ChrGetCodepage',
- 'Char2Num', 'Ceiling', 'ButtonNames', 'BoxUpdates', 'BoxTitle', 'BoxTextFont', 'BoxTextColor', 'BoxText', 'BoxShut', 'BoxPen',
- 'BoxOpen', 'BoxNew', 'BoxMapmode', 'BoxesUp', 'BoxDrawText', 'BoxDrawRect', 'BoxDrawLine', 'BoxDrawCircle', 'BoxDestroy',
- 'BoxDataTag', 'BoxDataClear', 'BoxColor', 'BoxCaption', 'BoxButtonWait', 'BoxButtonStat', 'BoxButtonKill', 'BoxButtonDraw',
- 'BoxBitMap', 'BinaryXor', 'BinaryXlate', 'BinaryWriteEx', 'BinaryWrite', 'BinaryTagRepl', 'BinaryTagLen', 'BinaryTagInit',
- 'BinaryTagIndex', 'BinaryTagFind', 'BinaryTagExtr', 'BinaryStrCnt', 'BinarySort', 'BinaryReplace', 'BinaryReadEx',
- 'BinaryRead', 'BinaryPokeStrW', 'BinaryPokeStr', 'BinaryPokeHex', 'BinaryPokeFlt', 'BinaryPoke4', 'BinaryPoke2', 'BinaryPoke',
- 'BinaryPeekStrW', 'BinaryPeekStr', 'BinaryPeekHex', 'BinaryPeekFlt', 'BinaryPeek4', 'BinaryPeek2', 'BinaryPeek', 'BinaryOr',
- 'BinaryOleType', 'BinaryIndexNc', 'BinaryIndexEx', 'BinaryIndexBin', 'BinaryIndex', 'BinaryIncrFlt', 'BinaryIncr4',
- 'BinaryIncr2', 'BinaryIncr', 'BinaryHashRec', 'BinaryFree', 'BinaryEodSet', 'BinaryEodGet', 'BinaryCopy', 'BinaryConvert',
- 'BinaryCompare', 'BinaryClipPut', 'BinaryClipGet', 'BinaryChecksum', 'BinaryBufInfo', 'BinaryAnd', 'BinaryAllocArray',
- 'BinaryAlloc', 'Beep', 'Average', 'Atan', 'AskYesNo', 'AskTextbox', 'AskPassword', 'AskLine', 'AskItemlist', 'AskFont',
- 'AskFiletext', 'AskFilename', 'AskDirectory', 'AskColor', 'Asin', 'ArrInitialize', 'ArrInfo', 'ArrDimension',
- 'Arrayize', 'ArrayFilePutCSV', 'ArrayFilePut', 'ArrayFileGetCSV', 'ArrayFileGet', 'AppWaitClose', 'AppExist', 'AddExtender',
- 'Acos', 'Abs', 'About'
- ),
- 4 => array(
- 'zZipFiles', 'zVersionInfo', 'zVersion', 'zUnZipFiles', 'zSetPortBit', 'zRPortShift', 'zPortOut', 'zPortIn', 'zNotPortBit',
- 'zLPortShift', 'zGetPortBit', 'zClrPortBit', 'xVerifyCCard', 'xSendMessage', 'xMessageBox', 'xMemCompact', 'xHex', 'xGetElapsed',
- 'xGetChildHwnd', 'xExtenderInfo', 'xEnumStreams', 'xEjectMedia', 'xDriveReady', 'xDiskLabelGet', 'xCursorSet', 'xBaseConvert',
- 'wxPing', 'wxParmSet', 'wxParmGet', 'wxMsgSetHdr', 'wxMsgGetHdr', 'wxMsgGetBody', 'wxHost2Addr', 'wxGetLastErr', 'wxGetInfo',
- 'wxGetErrDesc', 'wxAddr2Host', 'wtsWaitSystemEvent', 'wtsVersion', 'wtsTerminateProcess', 'wtsShutdownSystem', 'wtsSendMessage',
- 'wtsQuerySessionInfo', 'wtsProcIdToSessId', 'wtsLogoffSession', 'wtsLastErrMsg', 'wtsIsTSEnabled', 'wtsIsCitrixEnabled',
- 'wtsGetActiveConsoleSessId', 'wtsEnumSessions', 'wtsEnumProcesses', 'wtsDisconnectSession', 'wnWrkGroups', 'wnVersion', 'wntWtsUserSet',
- 'wntWtsUserGet', 'wntVersion', 'wntUserSidChk', 'wntUserSetDat', 'wntUserRename', 'wntUserProps', 'wntUserList', 'wntUserInfo',
- 'wntUserGetDat', 'wntUserFiles', 'wntUserExist', 'wntUserDel', 'wntUserAddDat', 'wntUserAdd', 'wntSvcStatus', 'wntSvcStart',
- 'wntSvcList', 'wntSvcDelete', 'wntSvcCreate', 'wntSvcControl', 'wntSvcCfgSet', 'wntSvcCfgGet', 'wntShutdown', 'wntShareUsers',
- 'wntShareSet', 'wntShareList', 'wntShareInfo', 'wntShareDel', 'wntShareAdd', 'wntServiceInf', 'wntServiceAt', 'wntServerType',
- 'wntServerList', 'wntServerInfo', 'wntSecurityGet', 'wntRunAsUser', 'wntResources2', 'wntResources', 'wntRemoteTime', 'wntRasUserSet',
- 'wntRasUserGet', 'wntProfileInfo', 'wntProfileDel', 'wntPrivUsers', 'wntPrivList', 'wntPrivGet', 'wntPrivDel', 'wntPrivAdd',
- 'wntOwnerSet', 'wntOwnerGet', 'wntMemberSet', 'wntMemberLst2', 'wntMemberList', 'wntMemberGrps', 'wntMemberGet', 'wntMemberDel',
- 'wntLsaPolSet', 'wntLsaPolGet', 'wntListGroups', 'wntLastErrMsg', 'wntGroupRen', 'wntGroupInfo', 'wntGroupEdit', 'wntGroupDel',
- 'wntGroupAdd', 'wntGetUser', 'wntGetDrive', 'wntGetDc', 'wntGetCon', 'wntFileUsers', 'wntFilesOpen', 'wntFileClose', 'wntEventWrite',
- 'wntEventLog', 'wntDomainSync', 'wntDirDialog', 'wntDfsList', 'wntDfsGetInfo', 'wntCurrUsers', 'wntChgPswd', 'wntCancelCon',
- 'wntAuditMod', 'wntAuditList', 'wntAuditGet', 'wntAuditDel', 'wntAuditAdd2', 'wntAuditAdd', 'wntAddPrinter', 'wntAddDrive',
- 'wntAcctPolSet', 'wntAcctPolGet', 'wntAcctList', 'wntAcctInfo', 'wntAccessMod', 'wntAccessList', 'wntAccessGet', 'wntAccessDel',
- 'wntaccessadd2', 'wntAccessAdd', 'wnShares', 'wnSharePath', 'wnShareName', 'wnShareCnt', 'wnServers', 'wnRestore', 'wnNetNames',
- 'wnGetUser', 'wnGetCon', 'wnGetCaps', 'wnDlgShare', 'wnDlgNoShare', 'wnDlgDiscon', 'wnDlgCon4', 'wnDlgCon3', 'wnDlgCon2', 'wnDlgCon',
- 'wnDlgBrowse', 'wnDialog', 'wnCmptrInfo', 'wnCancelCon', 'wnAddCon', 'WaitSRQ', 'w9xVersion', 'w9xUserSetDat', 'w9xUserRename',
- 'w9xUserprops', 'w9xUserList', 'w9xUserinfo', 'w9xUserGetDat', 'w9xUserExist', 'w9xUserDel', 'w9xUserAddDat', 'w9xUserAdd', 'w9xShareSet',
- 'w9xShareInfo', 'w9xShareDel', 'w9xShareAdd', 'w9xServiceAt', 'w9xServerList', 'w9xRemoteTime', 'w9xOwnerGet', 'w9xMemberSet',
- 'w9xMemberList', 'w9xMemberGrps', 'w9xMemberGet', 'w9xMemberDel', 'w9xListGroups', 'w9xGroupInfo', 'w9xGroupDel', 'w9xGroupAdd',
- 'w9xGetDC', 'w9xFileUsers', 'w9xAccessList', 'w9xAccessGet', 'w9xAccessDel', 'w9xAccessAdd', 'w95Version', 'w95ShareUsers',
- 'w95ShareSet', 'w95ShareList', 'w95ShareInfo', 'w95ShareDel', 'w95ShareAdd', 'w95ServiceInf', 'w95ServiceAt', 'w95ServerType',
- 'w95ServerInfo', 'w95Resources', 'w95GetUser', 'w95GetDrive', 'w95GetCon', 'w95FileUsers', 'w95FileClose', 'w95DirDialog',
- 'w95CancelCon', 'w95AddPrinter', 'w95AddDrive', 'w95AccessDel', 'w95AccessAdd', 'w3Version', 'w3PrtBrowse', 'w3NetGetUser',
- 'w3NetDialog', 'w3GetCon', 'w3GetCaps', 'w3DirBrowse', 'w3CancelCon', 'w3AddCon', 'urlGetScheme', 'urlEncode', 'urlDecode',
- 'tVersion', 'tSetPriority', 'TriggerList', 'Trigger', 'tRemoteConn', 'tOpenProc', 'tListProc', 'tListMod', 'tKillProc', 'tGetProcInfo',
- 'tGetPriority', 'tGetModInfo', 'tGetLastError', 'tGetData', 'TestSys', 'TestSRQ', 'tCountProc', 'tCompatible', 'tCloseProc',
- 'tBrowseCntrs', 'sSendString', 'sSendNum', 'sSendLine', 'sSendBinary', 'sRecvNum', 'sRecvLine', 'sRecvBinary', 'SrchVersion',
- 'SrchNext', 'SrchInit', 'SrchFree', 'sOpen', 'sOK2Send', 'sOK2Recv', 'smtpSendText', 'smtpSendFile', 'sListen', 'SetRWLS',
- 'SendSetup', 'SendLLO', 'SendList', 'SendIFC', 'SendDataBytes', 'SendCmds', 'Send', 'sConnect', 'sClose', 'SByteOrder32',
- 'sByteOrder16', 'sAccept', 'rRegVersion', 'rRegSearch', 'ResetSys', 'ReceiveSetup', 'Receive', 'ReadStsByte', 'RcvRespMsg',
- 'RasVersion', 'RasTypeSize', 'RasRename', 'RasNumCons', 'RasNameValid', 'RasListActCon', 'RasItemize', 'RasHangUp', 'RasGetLastErr',
- 'RasGetConStat', 'RasEntrySet', 'RasEntryInfo', 'RasEntryExist', 'RasEntryDel', 'RasEntryAdd', 'RasDialInfo', 'RasDial',
- 'RasCopy', 'RasConStatus', 'qVersionInfo', 'qTransact', 'qTables', 'qSpecial', 'qSetConnOpt', 'qNumRsltCol', 'qNativeSql', 'qLastCode',
- 'qGetData', 'qFreeStmt', 'qFreeEnv', 'qFreeConnect', 'qFetch', 'qExecDirect', 'qError', 'qDriverList', 'qDriverCon', 'qDisconnect',
- 'qDataSources', 'qConnect', 'qConfigError', 'qConfigData', 'qColumns', 'qBindCol', 'qAllocStmt', 'qAllocEnv', 'qAllocConnect',
- 'pWaitFor', 'pVersionInfo', 'pTimeout', 'pSetPublish', 'pSetPrtInfo', 'pSetPrtAttrib', 'pSetDefPrtEx', 'pSetDefPrt', 'pSendFile',
- 'pRecvFile', 'pPutString', 'pPutLine', 'pPutChar', 'pPutByte', 'pPutBinary', 'PPollUnconfig', 'PPollConfig', 'PPoll', 'pPeekChar',
- 'pPeekByte', 'pPaperSizes', 'pPaperBins', 'pModemSReg', 'pModemParams', 'pModemInit', 'pModemHangUp', 'pModemDial', 'pModemControl',
- 'pModemConnect', 'pModemCommand', 'pModemAnsRing', 'pModemAnsCall', 'pMediaTypes', 'pGetString', 'pGetPublish', 'pGetPrtList',
- 'pGetPrtInfo', 'pGetPrtAttrib', 'pGetLine', 'pGetLastError', 'pGetErrorMsg', 'pGetErrorCode', 'pGetDefPrtInf', 'pGetChar',
- 'pGetByte', 'pGetBinary', 'pDelPrtConn', 'pDelPrinter', 'pComOpen', 'pComModify', 'pComInfo', 'pComControl', 'pComClose',
- 'pCheckSum', 'pCheckBinary', 'pCaptureOn', 'pCaptureOff', 'pCaptureLog', 'PassControl', 'pAddPrtConn', 'pAddPrinter', 'p3RecvText',
- 'p3RecvFile', 'p3Peek', 'p3Open', 'p3GetReply', 'p3Delete', 'p3Count', 'p3Close', 'nwWhoAmI', 'nwVfyPassword', 'nwVersion',
- 'nwSrvShutdown', 'nwSrvNLMMgr', 'nwSrvGenGUID', 'nwSrvExecNCF', 'nwSetVolLimit', 'nwSetSrvParam', 'nwSetSrvInfo', 'nwSetPrimServ',
- 'nwSetPassword', 'nwSetOptions', 'nwSetFileInfo', 'nwSetDirLimit', 'nwSetDirInfo', 'nwSetContext', 'nwSetBcastMode', 'nwServerList',
- 'nwSendBcastMsg', 'nwSearchObjects', 'nwSearchFilter', 'nwRenameObject', 'nwRemoveObject', 'nwReceiveBcastMsg', 'nwNameConvert',
- 'nwMutateObject', 'nwMoveObject', 'nwModifyObject', 'nwMapDelete', 'nwMap', 'nwLogout', 'nwLogin', 'nwListUserGroups',
- 'nwListObjects', 'nwListGroupMembers', 'nwLastErrMsg', 'nwIsUserInGroup', 'nwGetVolLimit', 'nwGetSrvStats', 'nwGetSrvParam',
- 'nwGetSrvInfo', 'nwGetSrvCfg', 'nwGetOptions', 'nwGetObjValue', 'nwGetObjInfo', 'nwGetNLMInfo', 'nwGetMapped', 'nwGetFileInfo',
- 'nwGetDirLimit', 'nwGetDirInfo', 'nwGetContext', 'nwGetConnInfo', 'nwGetCapture', 'nwGetBcastMode', 'nwGetAttrInfo',
- 'nwDriveStatus', 'nwDrivePath', 'nwDetachFromServer', 'nwDelUserFromGroup', 'nwDelConnNum', 'nwCompareObject', 'nwClientInfo',
- 'nwChgPassword', 'nwAttachToServer', 'nwAddUserToGroup', 'nwAddObject', 'netVersion', 'netResources', 'netGetUser', 'netGetCon',
- 'netDirDialog', 'netCancelCon', 'netAddPrinter', 'netAddDrive', 'n4Version', 'n4UserGroups', 'n4UserGroupEx', 'n4SetPrimServ',
- 'n4SetOptions', 'n4SetContextG', 'n4SetContext', 'n4ServerList', 'n4ServerInfo', 'n4ObjSearch', 'n4ObjRename', 'n4ObjOptions',
- 'n4ObjMove', 'n4ObjGetVal', 'n4ObjectProps', 'n4ObjectList', 'n4ObjectInfo', 'n4ObjDelete', 'n4NameConvert', 'n4MsgsEndAll',
- 'n4MsgsEnd', 'n4MemberSet', 'n4MemberGet', 'n4MemberDel', 'n4MapRoot', 'n4MapDir', 'n4MapDelete', 'n4Map', 'n4LogoutTree',
- 'n4Logout', 'n4Login', 'n4GetUserName', 'n4GetUserId', 'n4GetUser', 'n4GetNetAddr', 'n4GetMapped', 'n4GetContext',
- 'n4GetConnNum', 'n4FileUsers', 'n4FileTimeGet', 'n4FileAttrSet', 'n4FileAttrGet', 'n4DriveStatus', 'n4DrivePath', 'n4DirTimeGet',
- 'n4DirAttrSet', 'n4DirAttrGet', 'n4Detach', 'n4ChgPassword', 'n4CapturePrt', 'n4CaptureGet', 'n4CaptureEnd', 'n4Attach',
- 'n3Version', 'n3UserGroups', 'n3ServerList', 'n3ServerInfo', 'n3MsgsEndAll', 'n3MsgsEnd', 'n3MemberSet', 'n3MemberGet',
- 'n3MemberDel', 'n3Maproot', 'n3Mapdir', 'n3Mapdelete', 'n3Map', 'n3Logout', 'n3GetUserId', 'n3GetUser', 'n3GetNetAddr',
- 'n3GetMapped', 'n3GetConnNum', 'n3FileTimeGet', 'n3FileAttrSet', 'n3FileAttrGet', 'n3DriveStatus', 'n3DrivePath',
- 'n3DirTimeGet', 'n3DirAttrSet', 'n3DirAttrGet', 'n3Detach', 'n3ChgPassword', 'n3CapturePrt', 'n3CaptureGet',
- 'n3CaptureEnd', 'n3Attach', 'mVersion', 'mSyncMail', 'mSendMailEx', 'mSendMail', 'mrecvmail', 'mReadNextMsg', 'mLogOn',
- 'mLogOff', 'mFindNext', 'mError', 'mCompatible', 'kVerInfo', 'kStatusInfo', 'kSendText', 'kSendFile', 'kManageImap4',
- 'kInit', 'kGetMail', 'kExtra', 'kDest', 'kDeletePop3', 'iWriteDataBuf', 'iWriteData', 'iVersion', 'IUrlOpen', 'iUrlEncode',
- 'iUrlDecode', 'iReadDataBuf', 'iReadData', 'ipVersion', 'ipPing', 'iPing', 'ipHost2Addr', 'ipGetLastErr', 'ipGetAddress',
- 'iParseURL', 'ipAddr2Host', 'iOptionSet', 'iOptionGet', 'ImgWave', 'ImgVersion', 'ImgUnsharpMask', 'ImgThreshold', 'ImgSwirl',
- 'ImgSpread', 'ImgSolarize', 'ImgShear', 'ImgSharpen', 'ImgShade', 'ImgScale', 'ImgSample', 'ImgRotate', 'ImgResize',
- 'ImgReduceNoise', 'ImgRaise', 'ImgOilPaint', 'ImgNormalize', 'ImgNegate', 'ImgMotionBlur', 'ImgModulate', 'ImgMinify',
- 'ImgMedianFilter', 'ImgMagnify', 'ImgLevel', 'ImgIsValid', 'ImgIsPalette', 'ImgIsMono', 'ImgIsGray', 'ImgInfo', 'ImgImplode',
- 'ImgGetImageType', 'ImgGetColorCount', 'ImgGaussianBlur', 'ImgGamma', 'ImgFrame', 'ImgFlop', 'ImgFlip', 'ImgEqualize',
- 'ImgEnhance', 'ImgEmboss', 'ImgCrop', 'ImgConvert', 'ImgContrast', 'ImgCompare', 'ImgColorize', 'ImgChop', 'ImgCharcoal',
- 'ImgBorder', 'ImgBlur', 'ImgAddNoise', 'iLocFindNext', 'iLocFindInit', 'iHttpOpen', 'iHttpInit', 'iHttpHeaders', 'iHttpAccept',
- 'iHostConnect', 'iHost2Addr', 'iGetResponse', 'iGetLastError', 'iGetIEVer', 'iGetConStatEx', 'iGetConState', 'iFtpRename',
- 'iFtpPut', 'iFtpOpen', 'iFtpGet', 'iFtpFindNext', 'iFtpFindInit', 'iFtpDirRemove', 'iFtpDirMake', 'iFtpDirGet', 'iFtpDirChange',
- 'iFtpDialog', 'iFtpDelete', 'iFtpCmd', 'iErrorDialog', 'iDialItemize', 'iDialHangUp', 'iDial', 'iCookieSet', 'iCookieGet',
- 'iContentURL', 'iContentFile', 'iContentData', 'iClose', 'ibWrtf', 'ibWrt', 'ibWait', 'ibVersion', 'ibUnlock', 'ibTrg',
- 'ibTmo', 'ibStop', 'ibStatus', 'ibSta', 'ibSre', 'ibSic', 'ibSad', 'ibRsv', 'ibRsp', 'ibRsc', 'ibRpp', 'ibRdf', 'ibRd',
- 'ibPpc', 'ibPoke', 'ibPct', 'ibPad', 'ibOnl', 'ibMakeAddr', 'ibLock', 'ibLoc', 'ibLn', 'ibLines', 'ibIst', 'ibInit',
- 'ibGts', 'ibGetSad', 'ibGetPad', 'ibFind', 'ibEvent', 'ibErr', 'ibEot', 'ibEos', 'iBegin', 'ibDma', 'ibDev', 'ibConfig',
- 'ibCntl', 'ibCnt', 'ibCmda', 'ibCmd', 'ibClr', 'ibCac', 'ibBna', 'ibAsk', 'iAddr2Host', 'huge_Thousands', 'huge_Subtract',
- 'huge_SetOptions', 'huge_Multiply', 'huge_GetLastError', 'huge_ExtenderInfo', 'huge_Divide', 'huge_Decimal', 'huge_Add',
- 'httpStripHTML', 'httpRecvTextF', 'httpRecvText', 'httpRecvQuery', 'httpRecvQryF', 'httpRecvFile', 'httpGetServer',
- 'httpGetQuery', 'httpGetPath', 'httpGetFile', 'httpGetDir', 'httpGetAnchor', 'httpFullPath', 'httpFirewall', 'httpAuth',
- 'ftpRename', 'ftpQuote', 'ftpPut', 'ftpOpen', 'ftpList', 'ftpGet', 'ftpFirewall', 'ftpDelete', 'ftpClose', 'ftpChDir',
- 'FindRQS', 'FindLstn', 'EnvSetVar', 'EnvPathDel', 'EnvPathChk', 'EnvPathAdd', 'EnvListVars', 'EnvGetVar', 'EnvGetInfo',
- 'EnableRemote', 'EnableLocal', 'ehllapiWait', 'ehllapiVersion', 'ehllapiUninit', 'ehllapiStopKeyIntercept', 'ehllapiStopHostNotify',
- 'ehllapiStopCloseIntercept', 'ehllapiStartKeyIntercept', 'ehllapiStartHostNotify', 'ehllapiStartCloseIntercept',
- 'ehllapiSetWindowStatus', 'ehllapiSetSessionParams', 'ehllapiSetPSWindowName', 'ehllapiSetCursorLoc', 'ehllapiSendKey',
- 'ehllapiSendFile', 'ehllapiSearchPS', 'ehllapiSearchField', 'ehllapiRunProfile', 'ehllapiResetSystem', 'ehllapiReserve',
- 'ehllapiRelease', 'ehllapiReceiveFile', 'ehllapiQuerySystem', 'ehllapiQueryPSStatus', 'ehllapiQueryHostNotify',
- 'ehllapiQueryFieldAttr', 'ehllapiQueryCursorLoc', 'ehllapiQueryCloseIntercept', 'ehllapiPostInterceptStatus',
- 'ehllapiPause', 'ehllapiLastErrMsg', 'ehllapiInit', 'ehllapiGetWindowStatus', 'ehllapiGetPSHWND', 'ehllapiGetKey',
- 'ehllapiFindFieldPos', 'ehllapiFindFieldLen', 'ehllapiDisconnectPS', 'ehllapiCvtRCToPos', 'ehllapiCvtPosToRC',
- 'ehllapiCopyTextToPS', 'ehllapiCopyTextToField', 'ehllapiCopyTextFromPS', 'ehllapiCopyTextFromField', 'ehllapiCopyOIA',
- 'ehllapiConnectPS', 'dunItemize', 'dunDisconnect', 'dunConnectEx', 'dunConnect', 'dsTestParam', 'dsSIDtoHexStr', 'dsSetSecProp',
- 'dsSetProperty', 'dsSetPassword', 'dsSetObj', 'dsSetCredentX', 'dsSetCredent', 'dsRemFromGrp', 'dsRelSecObj', 'dsMoveObj',
- 'dsIsObject', 'dsIsMemberGrp', 'dsIsContainer', 'dsGetUsersGrps', 'dsGetSecProp', 'dsGetPropName', 'dsGetProperty',
- 'dsGetPrntPath', 'dsGetPrimGrp', 'dsGetMemGrp', 'dsGetInfo', 'dsGetClass', 'dsGetChldPath', 'dsFindPath', 'dsDeleteObj',
- 'dsCreatSecObj', 'dsCreateObj', 'dsCopySecObj', 'dsAddToGrp', 'dsAclRemAce', 'dsAclOrderAce', 'dsAclGetAces', 'dsAclAddAce',
- 'DevClearList', 'DevClear', 'dbTest', 'dbSwapColumns', 'dbSort', 'dbSetRecordField', 'dbSetOptions', 'dbSetErrorReporting',
- 'dbSetEntireRecord', 'dbSetDelimiter', 'dbSave', 'dbOpen', 'dbNameColumn', 'dbMakeNewItem', 'dbInsertColumn', 'dbGetVersion',
- 'dbGetSaveStatus', 'dbGetRecordField', 'dbGetRecordCount', 'dbGetNextItem', 'dbGetLastError', 'dbGetEntireRecord',
- 'dbGetColumnType', 'dbGetColumnNumber', 'dbGetColumnName', 'dbGetColumnCount', 'dbFindRecord', 'dbExist', 'dbEasterEgg',
- 'dbDeleteRecord', 'dbDeleteColumn', 'dbDebug', 'dbCookDatabases', 'dbClose', 'dbCloneRecord', 'dbBindCol', 'cWndState',
- 'cWndinfo', 'cWndGetWndSpecName', 'cWndGetWndSpec', 'cWndexist', 'cWndByWndSpecName', 'cWndByWndSpec', 'cWndbyseq',
- 'cWndbyname', 'cWndbyid', 'cWndbyclass', 'cWinIDConvert', 'cVersionInfo', 'cVendorId', 'cSetWndText', 'cSetUpDownPos',
- 'cSetTvItem', 'cSetTrackPos', 'cSetTabItem', 'cSetLvItem', 'cSetLbItemEx', 'cSetLbItem', 'cSetIpAddr', 'cSetFocus',
- 'cSetEditText', 'cSetDtpDate', 'cSetCbItem', 'cSetCalDate', 'cSendMessage', 'cRadioButton', 'cPostMessage', 'cPostButton',
- 'cMemStat', 'cGetWndCursor', 'cGetUpDownPos', 'cGetUpDownMin', 'cGetUpDownMax', 'cGetTVItem', 'cGetTrackPos', 'cGetTrackMin',
- 'cGetTrackMax', 'cGetTbText', 'cGetSbText', 'cGetLvText', 'cGetLvSelText', 'cGetLvFocText', 'cGetLvDdtText', 'cGetLvColText',
- 'cGetLbText', 'cGetLbSelText', 'cGetLbCount', 'cGetIpAddr', 'cGetInfo', 'cGetHrText', 'cGetFocus', 'cGetEditText', 'cGetDtpDate',
- 'cGetControlImageCRC', 'cGetCBText', 'cGetCbCount', 'cGetCalDate', 'cFindByName', 'cFindByClass', 'cEnablestate', 'cDblClickItem',
- 'cCpuSupt', 'cCpuSpeed', 'cCpuIdExt', 'cCpuId', 'cCpuFeat', 'cCpuBenchmark', 'cCloneCheck', 'cClickToolbar', 'cClickButton',
- 'cClearTvItem', 'cClearLvItem', 'cClearLbAll', 'cCheckbox', 'aVersion', 'aStatusbar', 'aShellFolder', 'aMsgTimeout', 'AllSPoll',
- 'aGetLastError', 'aFileRename', 'aFileMove', 'aFileDelete', 'aFileCopy'
- ),
- 5 => array(
- 'wWordRight', 'wWordLeft', 'wWinTile', 'wWinRestore', 'wWinNext', 'wWinMinimize', 'wWinMaximize', 'wWinCloseAll', 'wWinClose',
- 'wWinCascade', 'wWinArricons', 'wViewOutput', 'wViewOptions', 'wViewHtml', 'wUpperCase', 'wUpline', 'wUndo', 'wTopOfFile', 'wToggleIns',
- 'wTab', 'wStatusMsg', 'wStartSel', 'wSpellcheck', 'wSetProject', 'wSetPrefs', 'wSetColblk', 'wSetBookmark', 'wSelWordRight',
- 'wSelWordLeft', 'wSelUp', 'wSelTop', 'wSelRight', 'wSelPgUp', 'wSelPgDn', 'wSelLeft', 'wSelInfo', 'wSelHome', 'wSelEnd', 'wSelectAll',
- 'wSelDown', 'wSelBottom', 'wRunRebuild', 'wRunMake', 'wRunExecute', 'wRunDebug', 'wRunConfig', 'wRunCompile', 'wRunCommand', 'wRight',
- 'wRepeat', 'wRedo', 'wRecord', 'wProperties', 'wPrintDirect', 'wPrinSetup', 'wPrevError', 'wPaste', 'wPageUp', 'wPageDown', 'wNextError',
- 'wNewLine', 'wLowerCase', 'wLineCount', 'wLeft', 'wInvertCase', 'wInsString', 'wInsLine', 'wHome', 'wHelpKeyword', 'wHelpKeybrd',
- 'wHelpIndex', 'wHelpHelp', 'wHelpCmds', 'wHelpAbout', 'wGotoLine', 'wGotoCol', 'wGetWrap', 'wGetWord', 'wGetUndo', 'wGetSelstate',
- 'wGetRedo', 'wGetOutput', 'wGetModified', 'wGetLineNo', 'wGetIns', 'wGetFilename', 'wGetColNo', 'wGetChar', 'wFtpOpen', 'wFindNext',
- 'wFindInFiles', 'wFind', 'wFileSaveAs', 'wFileSave', 'wFileRevert', 'wFilePrint', 'wFilePgSetup', 'wFileOpen', 'wFileNew', 'wFileMerge',
- 'wFileList', 'wFileExit', 'wEndSel', 'wEndOfFile', 'wEnd', 'wEdWrap', 'wEdWordRight', 'wEdWordLeft', 'wEdUpLine', 'wEdUndo', 'wEdTopOfFile',
- 'wEdToggleIns', 'wEdTab', 'wEdStartSel', 'wEdSetColBlk', 'wEdSelectAll', 'wEdRight', 'wEdRedo', 'wEdPaste', 'wEdPageUp', 'wEdPageDown',
- 'wEdNewLine', 'wEdLeft', 'wEdInsString', 'wEdHome', 'wEdGoToLine', 'wEdGoToCol', 'wEdGetWord', 'wEdEndSel', 'wEdEndOfFile', 'wEdEnd',
- 'wEdDownLine', 'wEdDelete', 'wEdCutLine', 'wEdCut', 'wEdCopyLine', 'wEdCopy', 'wEdClearSel', 'wEdBackTab', 'wEdBackspace', 'wDownLine',
- 'wDelete', 'wDelButton', 'wCutMarked', 'wCutLine', 'wCutAppend', 'wCut', 'wCopyMarked', 'wCopyLine', 'wCopyAppend', 'wCopy', 'wCompile',
- 'wClearSel', 'wChange', 'wCallMacro', 'wBackTab', 'wBackspace', 'wAutoIndent', 'wAddButton', 'edWindowTile', 'edWindowRestore',
- 'edWindowNext', 'edWindowMinimize', 'edWindowMaximize', 'edWindowCloseall', 'edWindowClose', 'edWindowCascade', 'edWindowArrangeIcons',
- 'edStatusMsg', 'edSearchViewOutput', 'edSearchRepeat', 'edSearchPrevError', 'edSearchNextError', 'edSearchFind', 'edSearchChange',
- 'edRunRebuild', 'edRunMake', 'edRunExecute', 'edRunDebug', 'edRunConfigure', 'edRunCompile', 'edRunCommand', 'edRecord', 'edHelpProcedures',
- 'edHelpKeyword', 'edHelpKeyboard', 'edHelpIndex', 'edHelpHelp', 'edHelpCommands', 'edHelpAbout', 'edGetWordWrapState', 'edGetWindowName',
- 'edGetUndoState', 'edGetSelectionState', 'edGetRedoState', 'edGetModifiedStatus', 'edGetLineNumber', 'edGetInsertState', 'edGetColumnNumber',
- 'edGetChar', 'edFileSetPreferences', 'edFileSaveAs', 'edFileSave', 'edFilePrinterSetup', 'edFilePrint', 'edFilePageSetup', 'edFileOpen',
- 'edFileNew', 'edFileMerge', 'edFileList', 'edFileExit', 'edEditWrap', 'edEditWordRight', 'edEditWordLeft', 'edEditUpLine', 'edEditUndo',
- 'edEditToggleIns', 'edEditTab', 'edEditStartSelection', 'edEditSetColumnBlock', 'edEditSetBookmark', 'edEditSelectAll', 'edEditRight',
- 'edEditRedo', 'edEditPaste', 'edEditPageUp', 'edEditPageDown', 'edEditLeft', 'edEditInsertString', 'edEditGoToLine', 'edEditGoToColumn',
- 'edEditGoToBookmark', 'edEditGetCurrentWord', 'edEditEndSelection', 'edEditEndOfLine', 'edEditEndOfFile', 'edEditDownline', 'edEditDelete',
- 'edEditCutline', 'edEditCut', 'edEditCopyline', 'edEditCopy', 'edEditClearSelection', 'edEditBeginningOfLine', 'edEditBeginningOfFile',
- 'edEditBackTab', 'edEditBackspace', 'edDeleteButton', 'edAddButton'
- )
- ),
- 'SYMBOLS' => array(
- '(', ')', '[', ']', '{', '}', '!', '+', '-', '~', '$', '^', '?', '@', '%', '#', '&', '*', '|', '/', '<', '>'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false,
- 5 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #800080;',
- 2 => 'color: #0080FF; font-weight: bold;',
- 3 => 'color: #0000FF;',
- 4 => 'color: #FF00FF;',
- 5 => 'color: #008000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #008000; font-style: italic;',
- 2 => 'color: #FF1010; font-weight: bold;',
- 'MULTI' => 'color: #808080; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- 0 => 'color: #006600;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => '',
- 5 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(),
- 'REGEXPS' => array(//Variable names
- 0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
- ),
- 'STRICT_MODE_APPLIES' => GESHI_MAYBE,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/xml.php b/libvpx/examples/includes/geshi/geshi/xml.php
deleted file mode 100644
index 48b748c..0000000
--- a/libvpx/examples/includes/geshi/geshi/xml.php
+++ /dev/null
@@ -1,157 +0,0 @@
-<?php
-/*************************************************************************************
- * xml.php
- * -------
- * Author: Nigel McNie (nigel@geshi.org)
- * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.8.3
- * Date Started: 2004/09/01
- *
- * XML language file for GeSHi. Based on the idea/file by Christian Weiske
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2005/12/28 (1.0.2)
- * - Removed escape character for strings
- * 2004/11/27 (1.0.1)
- * - Added support for multiple object splitters
- * 2004/10/27 (1.0.0)
- * - First Release
- *
- * TODO (updated 2004/11/27)
- * -------------------------
- * * Check regexps work and correctly highlight XML stuff and nothing else
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'XML',
- 'COMMENT_SINGLE' => array(),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- ),
- 'COMMENTS' => array(
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #66cc66;'
- ),
- 'SCRIPT' => array(
- -1 => 'color: #808080; font-style: italic;', // comments
- 0 => 'color: #00bbdd;',
- 1 => 'color: #ddbb00;',
- 2 => 'color: #339933;',
- 3 => 'color: #009900;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #000066;',
- 1 => 'color: #000000; font-weight: bold;',
- 2 => 'color: #000000; font-weight: bold;'
- )
- ),
- 'URLS' => array(
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- 0 => array(//attribute names
- GESHI_SEARCH => '([a-z_:][\w\-\.:]*)(=)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => '\\2'
- ),
- 1 => array(//Initial header line
- GESHI_SEARCH => '(&lt;[\/?|(\?xml)]?[a-z_:][\w\-\.:]*(\??&gt;)?)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- 2 => array(//Tag end markers
- GESHI_SEARCH => '(([\/|\?])?&gt;)',
- GESHI_REPLACE => '\\1',
- GESHI_MODIFIERS => 'i',
- GESHI_BEFORE => '',
- GESHI_AFTER => ''
- ),
- ),
- 'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
- 'SCRIPT_DELIMITERS' => array(
- -1 => array(
- '<!--' => '-->'
- ),
- 0 => array(
- '<!DOCTYPE' => '>'
- ),
- 1 => array(
- '&' => ';'
- ),
- 2 => array(
- '<![CDATA[' => ']]>'
- ),
- 3 => array(
- '<' => '>'
- )
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- -1 => false,
- 0 => false,
- 1 => false,
- 2 => false,
- 3 => true
- ),
- 'TAB_WIDTH' => 2,
- 'PARSER_CONTROL' => array(
- 'ENABLE_FLAGS' => array(
- 'NUMBERS' => GESHI_NEVER
- )
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/xorg_conf.php b/libvpx/examples/includes/geshi/geshi/xorg_conf.php
deleted file mode 100644
index 643d38d..0000000
--- a/libvpx/examples/includes/geshi/geshi/xorg_conf.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-/*************************************************************************************
- * xorg_conf.php
- * ----------
- * Author: Milian Wolff (mail@milianw.de)
- * Copyright: (c) 2008 Milian Wolff (http://milianw.de)
- * Release Version: 1.0.8.3
- * Date Started: 2008/06/18
- *
- * xorg.conf language file for GeSHi.
- *
- * CHANGES
- * -------
- * 2008/06/18 (1.0.8)
- * - Initial import
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'Xorg configuration',
- 'COMMENT_SINGLE' => array(1 => '#'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array('"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- // sections
- 1 => array(
- 'Section', 'EndSection', 'SubSection', 'EndSubSection'
- ),
- 2 => array(
- // see http://www.x.org/archive/X11R6.9.0/doc/html/xorg.conf.5.html
- 'BiosBase', 'Black', 'Boardname', 'BusID', 'ChipID', 'ChipRev',
- 'Chipset', 'ClockChip', 'Clocks', 'DacSpeed',
- 'DefaultDepth', 'DefaultFbBpp', 'Depth', 'Device',
- 'DisplaySize', 'Driver', 'FbBpp', 'Gamma',
- 'HorizSync', 'IOBase', 'Identifier', 'InputDevice',
- 'Load', 'MemBase', 'Mode', 'Modeline', 'Modelname',
- 'Modes', 'Monitor', 'Option', 'Ramdac', 'RgbPath',
- 'Screen', 'TextClockFreq', 'UseModes', 'VendorName',
- 'VertRefresh', 'VideoAdaptor', 'VideoRam',
- 'ViewPort', 'Virtual', 'Visual', 'Weight', 'White'
- ),
- 3 => array(
- // some sub-keywords
- // screen position
- 'Above', 'Absolute', 'Below', 'LeftOf', 'Relative', 'RightOf',
- // modes
- 'DotClock', 'Flags', 'HSkew', 'HTimings', 'VScan', 'VTimings'
- ),
- ),
- 'REGEXPS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #b1b100;',
- 2 => 'color: #990000;',
- 3 => 'color: #550000;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- ),
- 'BRACKETS' => array(
- ),
- 'STRINGS' => array(
- 0 => 'color: #0000ff;',
- ),
- 'NUMBERS' => array(
- 0 => 'color: #cc66cc;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 4
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/xpp.php b/libvpx/examples/includes/geshi/geshi/xpp.php
deleted file mode 100644
index 6e7c980..0000000
--- a/libvpx/examples/includes/geshi/geshi/xpp.php
+++ /dev/null
@@ -1,436 +0,0 @@
-<?php
-/*************************************************************************************
- * xpp.php
- * -------
- * Author: Simon Butcher (simon@butcher.name)
- * Copyright: (c) 2007 Simon Butcher (http://simon.butcher.name/)
- * Release Version: 1.0.8.3
- * Date Started: 2007/02/27
- *
- * Axapta/Dynamics Ax X++ language file for GeSHi.
- * For details, see <http://msdn.microsoft.com/en-us/library/aa867122.aspx>
- *
- * CHANGES
- * -------
- * 2007/02/28 (1.0.0)
- * - First Release
- *
- * TODO (updated 2007/02/27)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'X++',
- 'COMMENT_SINGLE' => array(1 => '//'),
- 'COMMENT_MULTI' => array('/*' => '*/'),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '\\',
- 'KEYWORDS' => array(
- 1 => array( // Primitive types
- 'void',
- 'str',
- 'real',
- 'int64',
- 'int',
- 'date',
- 'container',
- 'boolean',
- 'anytype'
- ),
- 2 => array( // Keywords
- 'window',
- 'while',
- 'try',
- 'true',
- 'throw',
- 'switch',
- 'super',
- 'static',
- 'server',
- 'right',
- 'return',
- 'retry',
- 'public',
- 'protected',
- 'private',
- 'print',
- 'pause',
- 'null',
- 'new',
- 'mod',
- 'left',
- 'interface',
- 'implements',
- 'if',
- 'for',
- 'final',
- 'false',
- 'extends',
- 'else',
- 'edit',
- 'do',
- 'div',
- 'display',
- 'default',
- 'continue',
- 'client',
- 'class',
- 'changeCompany',
- 'case',
- 'breakpoint',
- 'break',
- 'at',
- 'abstract'
- ),
- 3 => array( // Functions within the Axapta kernel
- 'year',
- 'wkofyr',
- 'webwebpartstr',
- 'webstaticfilestr',
- 'websitetempstr',
- 'websitedefstr',
- 'webreportstr',
- 'webpagedefstr',
- 'weboutputcontentitemstr',
- 'webmenustr',
- 'webletitemstr',
- 'webformstr',
- 'webdisplaycontentitemstr',
- 'webactionitemstr',
- 'varstr',
- 'utilmoyr',
- 'uint2str',
- 'typeof',
- 'typeid',
- 'trunc',
- 'today',
- 'timenow',
- 'time2str',
- 'term',
- 'tanh',
- 'tan',
- 'tablestr',
- 'tablestaticmethodstr',
- 'tablepname',
- 'tablenum',
- 'tablename2id',
- 'tablemethodstr',
- 'tableid2pname',
- 'tableid2name',
- 'tablefieldgroupstr',
- 'tablecollectionstr',
- 'systemdateset',
- 'systemdateget',
- 'syd',
- 'substr',
- 'strupr',
- 'strscan',
- 'strrtrim',
- 'strrep',
- 'strrem',
- 'strprompt',
- 'strpoke',
- 'strnfind',
- 'strlwr',
- 'strltrim',
- 'strline',
- 'strlen',
- 'strkeep',
- 'strins',
- 'strfmt',
- 'strfind',
- 'strdel',
- 'strcolseq',
- 'strcmp',
- 'stralpha',
- 'str2time',
- 'str2num',
- 'str2int64',
- 'str2int',
- 'str2guid',
- 'str2enum',
- 'str2date',
- 'staticmethodstr',
- 'sln',
- 'sleep',
- 'sinh',
- 'sin',
- 'setprefix',
- 'sessionid',
- 'securitykeystr',
- 'securitykeynum',
- 'runbuf',
- 'runas',
- 'round',
- 'resourcestr',
- 'reportstr',
- 'refprintall',
- 'rate',
- 'querystr',
- 'pv',
- 'pt',
- 'prmisdefault',
- 'primoyr',
- 'prevyr',
- 'prevqtr',
- 'prevmth',
- 'power',
- 'pmt',
- 'num2str',
- 'num2date',
- 'num2char',
- 'nextyr',
- 'nextqtr',
- 'nextmth',
- 'newguid',
- 'mthofyr',
- 'mthname',
- 'mkdate',
- 'minint',
- 'min',
- 'methodstr',
- 'menustr',
- 'menuitemoutputstr',
- 'menuitemdisplaystr',
- 'menuitemactionstr',
- 'maxint',
- 'maxdate',
- 'max',
- 'match',
- 'logn',
- 'log10',
- 'literalstr',
- 'licensecodestr',
- 'licensecodenum',
- 'intvnorm',
- 'intvno',
- 'intvname',
- 'intvmax',
- 'int64str',
- 'indexstr',
- 'indexnum',
- 'indexname2id',
- 'indexid2name',
- 'idg',
- 'identifierstr',
- 'helpfilestr',
- 'helpdevstr',
- 'helpapplstr',
- 'guid2str',
- 'getprefix',
- 'getCurrentUTCTime',
- 'fv',
- 'funcname',
- 'frac',
- 'formstr',
- 'fieldstr',
- 'fieldpname',
- 'fieldnum',
- 'fieldname2id',
- 'fieldid2pname',
- 'fieldid2name',
- 'extendedTypeStr',
- 'extendedTypeNum',
- 'exp10',
- 'exp',
- 'evalbuf',
- 'enumstr',
- 'enumnum',
- 'enumcnt',
- 'enum2str',
- 'endmth',
- 'dimof',
- 'dg',
- 'decround',
- 'ddb',
- 'dayofyr',
- 'dayofwk',
- 'dayofmth',
- 'dayname',
- 'date2str',
- 'date2num',
- 'curuserid',
- 'curext',
- 'cterm',
- 'cosh',
- 'cos',
- 'corrflagset',
- 'corrflagget',
- 'convertUTCTimeToLocalTime',
- 'convertUTCDateToLocalDate',
- 'conpoke',
- 'conpeek',
- 'connull',
- 'conlen',
- 'conins',
- 'confind',
- 'configurationkeystr',
- 'configurationkeynum',
- 'condel',
- 'classstr',
- 'classnum',
- 'classidget',
- 'char2num',
- 'beep',
- 'atan',
- 'asin',
- 'ascii2ansi',
- 'any2str',
- 'any2real',
- 'any2int64',
- 'any2int',
- 'any2guid',
- 'any2enum',
- 'any2date',
- 'ansi2ascii',
- 'acos',
- 'abs'
- ),
- 4 => array( // X++ SQL stuff
- 'where',
- 'update_recordset',
- 'ttsCommit',
- 'ttsBegin',
- 'ttsAbort',
- 'sum',
- 'setting',
- 'select',
- 'reverse',
- 'pessimisticLock',
- 'outer',
- 'order by',
- 'optimisticLock',
- 'notExists',
- 'noFetch',
- 'next',
- 'minof',
- 'maxof',
- 'like',
- 'join',
- 'insert_recordset',
- 'index hint',
- 'index',
- 'group by',
- 'from',
- 'forUpdate',
- 'forceSelectOrder',
- 'forcePlaceholders',
- 'forceNestedLoop',
- 'forceLiterals',
- 'flush',
- 'firstOnly',
- 'firstFast',
- 'exists',
- 'desc',
- 'delete_from',
- 'count',
- 'avg',
- 'asc'
- )
- ),
- 'SYMBOLS' => array( // X++ symbols
- '!',
- '&',
- '(',
- ')',
- '*',
- '^',
- '|',
- '~',
- '+',
- ',',
- '-',
- '/',
- ':',
- '<',
- '=',
- '>',
- '?',
- '[',
- ']',
- '{',
- '}'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- 4 => false
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #0000ff;',
- 4 => 'color: #0000ff;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #007f00;',
- 'MULTI' => 'color: #007f00; font-style: italic;'
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000000;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #000000;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #ff0000;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #000000;'
- ),
- 'METHODS' => array(
- 1 => 'color: #000000;',
- 2 => 'color: #000000;'
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #00007f;'
- ),
- 'REGEXPS' => array(
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => '',
- 4 => ''
- ),
- 'OOLANG' => true,
- 'OBJECT_SPLITTERS' => array(
- 1 => '.',
- 2 => '::'
- ),
- 'REGEXPS' => array(
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- )
-);
-
-?>
diff --git a/libvpx/examples/includes/geshi/geshi/z80.php b/libvpx/examples/includes/geshi/geshi/z80.php
deleted file mode 100644
index 845712f..0000000
--- a/libvpx/examples/includes/geshi/geshi/z80.php
+++ /dev/null
@@ -1,144 +0,0 @@
-<?php
-/*************************************************************************************
- * z80.php
- * -------
- * Author: Benny Baumann (BenBE@omorphia.de)
- * Copyright: (c) 2007-2008 Benny Baumann (http://www.omorphia.de/)
- * Release Version: 1.0.8.3
- * Date Started: 2007/02/06
- *
- * ZiLOG Z80 Assembler language file for GeSHi.
- * Syntax definition as commonly used with table assembler TASM32
- * This file will contain some undocumented opcodes.
- *
- * CHANGES
- * -------
- * 2008/05/23 (1.0.7.22)
- * - Added description of extra language features (SF#1970248)
- * 2007/06/03 (1.0.1)
- * - Fixed two typos in the language file
- * 2007/02/06 (1.0.0)
- * - First Release
- *
- * TODO (updated 2007/02/06)
- * -------------------------
- *
- *************************************************************************************
- *
- * This file is part of GeSHi.
- *
- * GeSHi is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GeSHi is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GeSHi; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- ************************************************************************************/
-
-$language_data = array (
- 'LANG_NAME' => 'ZiLOG Z80 Assembler',
- 'COMMENT_SINGLE' => array(1 => ';'),
- 'COMMENT_MULTI' => array(),
- 'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
- 'QUOTEMARKS' => array("'", '"'),
- 'ESCAPE_CHAR' => '',
- 'KEYWORDS' => array(
- /*CPU*/
- 1 => array(
- 'adc','add','and','bit','call','ccf','cp','cpd','cpdr','cpir','cpi',
- 'cpl','daa','dec','di','djnz','ei','ex','exx','halt','im','in',
- 'in0','inc','ind','indr','inir','ini','jp','jr','ld','ldd','lddr',
- 'ldir','ldi','mlt','neg','nop','or','otdm','otdmr','otdr','otim',
- 'otimr','otir','out','out0','outd','outi','pop','push','res','ret',
- 'reti','retn','rl','rla','rlc','rlca','rld','rr','rra','rrc','rrca',
- 'rrd','rst','sbc','scf','set','sla','sl1','sll','slp','sra','srl',
- 'sub','tst','tstio','xor'
- ),
- /*registers*/
- 2 => array(
- 'a','b','c','d','e','h','l',
- 'af','bc','de','hl','ix','iy','sp',
- 'af\'','ixh','ixl','iyh','iyl'
- ),
- /*Directive*/
- 3 => array(
- '#define','#endif','#else','#ifdef','#ifndef','#include','#undef',
- '.db','.dd','.df','.dq','.dt','.dw','.end','.org','equ'
- ),
- ),
- 'SYMBOLS' => array(
- '[', ']', '(', ')', '?', '+', '-', '*', '/', '%', '$'
- ),
- 'CASE_SENSITIVE' => array(
- GESHI_COMMENTS => false,
- 1 => false,
- 2 => false,
- 3 => false,
- ),
- 'STYLES' => array(
- 'KEYWORDS' => array(
- 1 => 'color: #0000ff; font-weight:bold;',
- 2 => 'color: #0000ff;',
- 3 => 'color: #46aa03; font-weight:bold;'
- ),
- 'COMMENTS' => array(
- 1 => 'color: #adadad; font-style: italic;',
- ),
- 'ESCAPE_CHAR' => array(
- 0 => 'color: #000099; font-weight: bold;'
- ),
- 'BRACKETS' => array(
- 0 => 'color: #0000ff;'
- ),
- 'STRINGS' => array(
- 0 => 'color: #7f007f;'
- ),
- 'NUMBERS' => array(
- 0 => 'color: #dd22dd;'
- ),
- 'METHODS' => array(
- ),
- 'SYMBOLS' => array(
- 0 => 'color: #008000;'
- ),
- 'REGEXPS' => array(
- 0 => 'color: #22bbff;',
- 1 => 'color: #22bbff;',
- 2 => 'color: #993333;'
- ),
- 'SCRIPT' => array(
- )
- ),
- 'URLS' => array(
- 1 => '',
- 2 => '',
- 3 => ''
- ),
- 'OOLANG' => false,
- 'OBJECT_SPLITTERS' => array(
- ),
- 'REGEXPS' => array(
- //Hex numbers
- 0 => '0[0-9a-fA-F]{1,32}[hH]',
- //Binary numbers
- 1 => '\%[01]{1,64}|[01]{1,64}[bB]?',
- //Labels
- 2 => '^[_a-zA-Z][_a-zA-Z0-9]?\:'
- ),
- 'STRICT_MODE_APPLIES' => GESHI_NEVER,
- 'SCRIPT_DELIMITERS' => array(
- ),
- 'HIGHLIGHT_STRICT_BLOCK' => array(
- ),
- 'TAB_WIDTH' => 8
-);
-
-?>
diff --git a/libvpx/examples/includes/vp8_doc_tools.php b/libvpx/examples/includes/vp8_doc_tools.php
deleted file mode 100644
index aee2a2e..0000000
--- a/libvpx/examples/includes/vp8_doc_tools.php
+++ /dev/null
@@ -1,207 +0,0 @@
-#!/usr/bin/env php
-<?php
-/**
- * vp8_doc_tools.php - Functions used when generating the
- * On2 VP8 user documentation.
- *
- * Requirements
- *
- * PHP Markdown Extra
- * http://michelf.com/projects/php-markdown/extra/
- *
- * PHP SmartyPants
- * http://michelf.com/projects/php-smartypants/
- *
- * GeSHI
- * http://qbnz.com/highlighter/
- *
- * ASCIIMathPHP
- * http://tinyurl.com/asciimathphp
- *
- * HTML::Toc
- * http://search.cpan.org/~fvulto/HTML-Toc-0.91/Toc.pod
- *
- *
- * April 2009 - Lou Quillio <lou.quillio@on2.com>
- *
- **********************************************************/
-
-
-// Includes
-include_once('PHP-Markdown-Extra-1.2.3/markdown.php');
-include_once('PHP-SmartyPants-1.5.1e/smartypants.php');
-include_once('ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.cfg.php');
-require_once('ASCIIMathPHP-2.0/ASCIIMathPHP-2.0.class.php');
-include_once('geshi/geshi.php');
-
-
-// Paths and Scripts
-$geshi_lang = 'geshi/geshi/'; // GeSHi language files
-$toc_script = './do_toc.pl';
-
-
-
-/**
- * ASCIIMathML parser
- * http://tinyurl.com/ASCIIMathPHP
- *
- * @PARAM mtch_arr array - Array of ASCIIMath expressions
- * as returned by preg_replace_callback([pattern]). First
- * dimension is the full matched string (with delimiter);
- * 2nd dimension is the undelimited contents (typically
- * a capture group).
- *
- **********************************************************/
-
-function ASCIIMathPHPCallback($mtch_arr)
-{
- $txt = trim($mtch_arr[1]);
-
- static $asciimath;
-
- if (!isset($asciimath)) $asciimath = new ASCIIMathPHP($symbol_arr);
-
- $math_attr_arr = array('displaystyle' => 'true');
-
- $asciimath->setExpr($txt);
- $asciimath->genMathML($math_attr_arr);
-
- return($asciimath->getMathML());
-}
-
-/**
- * fix_asciiMath()
- *
- * ASCIIMath pretty-prints its output, with linefeeds
- * and tabs. Causes unexpected behavior in some renderers.
- * This flattens <math> blocks.
- *
- * @PARAM page_body str - The <body> element of an
- * XHTML page to transform.
- *
- **********************************************************/
-
-function fix_asciiMath($page_body)
-{
- $out = FALSE;
-
- // Remove linefeeds and whitespace in <math> elements
- $tags_bad = array('/(<math.*?>)\n*\s*/'
- , '/(<mstyle.*?>)\n*\s*/'
- , '/(<\/mstyle>)\n*\s*/'
- , '/(<mrow.*?>)\n*\s*/'
- , '/(<\/mrow>)\n*\s*/'
- , '/(<mo.*?>)\n*\s*/'
- , '/(<\/mo>)\n*\s*/'
- , '/(<mi.*?>)\n*\s*/'
- , '/(<\/mi>)\n*\s*/'
- , '/(<mn.*?>)\n*\s*/'
- , '/(<\/mn>)\n*\s*/'
- , '/(<mtext.*?>)\n*\s*/'
- , '/(<\/mtext>)\n*\s*/'
- , '/(<msqrt.*?>)\n*\s*/'
- , '/(<\/msqrt>)\n*\s*/'
- , '/(<mfrac.*?>)\n*\s*/'
- , '/(<\/mfrac>)\n*\s*/'
- );
- $tags_good = array( '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- , '$1'
- );
- $out = preg_replace($tags_bad, $tags_good, $page_body);
-
- return $out;
-
-}
-
-/**
- * do_geshi() - Performs GeSHi transforms on XHTML blobs
- *
- * @param $blob str - The blob to transform
- * @param $open str - Opening expression to match
- * @param $close str - Closing expression to match
- * @param $lang str - Language file to use
- *
- **********************************************************/
-
-function do_geshi($blob, $open = '<pre>',
- $close = '</pre>', $lang = 'c')
-{
- $out = FALSE;
- $regexp = '|' . $open . '(.*?)' . $close . '|si';
- echo $regexp . "\n\n";
-
- while (preg_match($regexp, $blob, $matches))
- {
- $geshi = new GeSHi($matches[1], $lang);
- $geshi->set_language_path($geshi_lang);
- $blob_new = $geshi->parse_code();
- // Strip annoying final <br />
- $blob_new = preg_replace('/\n&nbsp;<\/pre>/', '</pre>' , $blob_new);
- // Fix annoying GeSHI-injected attributes
- $blob_new = preg_replace('/<pre.*>/i', '<pre>' , $blob_new);
- $blob = preg_replace($regexp, $blob_new, $blob, 1);
- unset($geshi);
- }
-
- return $out;
-
-}
-
-
-
-
-/**
- * prep_dd_codeblocks()
- *
- * I'm _so_ not proud of this, but don't have time to
- * write a proper regex.
- *
- * @TODO - Write that regex.
- *
- **********************************************************/
-/*
-function prep_dd_codeblocks($page_body)
-{
- $out = FALSE;
- $toggle = 0;
- $regexp = '/~{3,}/';
-
- while (preg_match($regexp, $page_body))
- {
- if ($toggle == 0)
- {
- $regexp = '/:\s*~{3,}\s*\n/';
- $page_body = preg_replace($regexp, ': <pre><code>', $page_body, 1);
- $toggle = 1;
- }
- else
- {
- $regexp = '/\n\s*~{3,}/';
- $page_body = preg_replace($regexp, '</code></pre>', $page_body, 1);
- $toggle = 0;
- }
- }
-
- // One more time
- $regexp = '/\n\s*~{3,}/';
- $page_body = preg_replace($regexp, '</code></pre>', $page_body, 1);
- $out = $page_body;
-
- return $out;
-}
-*/
diff --git a/libvpx/examples/postproc.c b/libvpx/examples/postproc.c
new file mode 100644
index 0000000..be08e92
--- /dev/null
+++ b/libvpx/examples/postproc.c
@@ -0,0 +1,140 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// Postprocessing Decoder
+// ======================
+//
+// This example adds postprocessing to the simple decoder loop.
+//
+// Initializing Postprocessing
+// ---------------------------
+// You must inform the codec that you might request postprocessing at
+// initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC
+// flag to `vpx_codec_dec_init`. If the codec does not support
+// postprocessing, this call will return VPX_CODEC_INCAPABLE. For
+// demonstration purposes, we also fall back to default initialization if
+// the codec does not provide support.
+//
+// Using Adaptive Postprocessing
+// -----------------------------
+// VP6 provides "adaptive postprocessing." It will automatically select the
+// best postprocessing filter on a frame by frame basis based on the amount
+// of time remaining before the user's specified deadline expires. The
+// special value 0 indicates that the codec should take as long as
+// necessary to provide the best quality frame. This example gives the
+// codec 15ms (15000us) to return a frame. Remember that this is a soft
+// deadline, and the codec may exceed it doing its regular processing. In
+// these cases, no additional postprocessing will be done.
+//
+// Codec Specific Postprocessing Controls
+// --------------------------------------
+// Some codecs provide fine grained controls over their built-in
+// postprocessors. VP8 is one example. The following sample code toggles
+// postprocessing on and off every 15 frames.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+
+#include "vpx/vp8dx.h"
+#include "vpx/vpx_decoder.h"
+
+#include "./tools_common.h"
+#include "./video_reader.h"
+#include "./vpx_config.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv) {
+ int frame_cnt = 0;
+ FILE *outfile = NULL;
+ vpx_codec_ctx_t codec;
+ vpx_codec_err_t res;
+ VpxVideoReader *reader = NULL;
+ const VpxInterface *decoder = NULL;
+ const VpxVideoInfo *info = NULL;
+
+ exec_name = argv[0];
+
+ if (argc != 3)
+ die("Invalid number of arguments.");
+
+ reader = vpx_video_reader_open(argv[1]);
+ if (!reader)
+ die("Failed to open %s for reading.", argv[1]);
+
+ if (!(outfile = fopen(argv[2], "wb")))
+ die("Failed to open %s for writing", argv[2]);
+
+ info = vpx_video_reader_get_info(reader);
+
+ decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
+ if (!decoder)
+ die("Unknown input codec.");
+
+ printf("Using %s\n", vpx_codec_iface_name(decoder->interface()));
+
+ res = vpx_codec_dec_init(&codec, decoder->interface(), NULL,
+ VPX_CODEC_USE_POSTPROC);
+ if (res == VPX_CODEC_INCAPABLE)
+ die_codec(&codec, "Postproc not supported by this decoder.");
+
+ if (res)
+ die_codec(&codec, "Failed to initialize decoder.");
+
+ while (vpx_video_reader_read_frame(reader)) {
+ vpx_codec_iter_t iter = NULL;
+ vpx_image_t *img = NULL;
+ size_t frame_size = 0;
+ const unsigned char *frame = vpx_video_reader_get_frame(reader,
+ &frame_size);
+
+ ++frame_cnt;
+
+ if (frame_cnt % 30 == 1) {
+ vp8_postproc_cfg_t pp = {0, 0, 0};
+
+ if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
+ die_codec(&codec, "Failed to turn off postproc.");
+ } else if (frame_cnt % 30 == 16) {
+ vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE,
+ 4, 0};
+ if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
+ die_codec(&codec, "Failed to turn on postproc.");
+ };
+
+ // Decode the frame with 15ms deadline
+ if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 15000))
+ die_codec(&codec, "Failed to decode frame");
+
+ while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
+ vpx_img_write(img, outfile);
+ }
+ }
+
+ printf("Processed %d frames.\n", frame_cnt);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec");
+
+ printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
+ info->frame_width, info->frame_height, argv[2]);
+
+ vpx_video_reader_close(reader);
+
+ fclose(outfile);
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/postproc.txt b/libvpx/examples/postproc.txt
deleted file mode 100644
index e00bf59..0000000
--- a/libvpx/examples/postproc.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-@TEMPLATE decoder_tmpl.c
-Postprocessing Decoder
-======================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This example adds postprocessing to the simple decoder loop.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Initializing Postprocessing
----------------------------
-You must inform the codec that you might request postprocessing at
-initialization time. This is done by passing the VPX_CODEC_USE_POSTPROC
-flag to `vpx_codec_dec_init`. If the codec does not support
-postprocessing, this call will return VPX_CODEC_INCAPABLE. For
-demonstration purposes, we also fall back to default initialization if
-the codec does not provide support.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-/* Initialize codec */
-res = vpx_codec_dec_init(&codec, interface, NULL,
- VPX_CODEC_USE_POSTPROC);
-if(res == VPX_CODEC_INCAPABLE) {
- printf("NOTICE: Postproc not supported by %s\n",
- vpx_codec_iface_name(interface));
- res = vpx_codec_dec_init(&codec, interface, NULL, flags);
-}
-if(res)
- die_codec(&codec, "Failed to initialize decoder");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-
-
-Using Adaptive Postprocessing
------------------------------
-VP6 provides "adaptive postprocessing." It will automatically select the
-best postprocessing filter on a frame by frame basis based on the amount
-of time remaining before the user's specified deadline expires. The
-special value 0 indicates that the codec should take as long as
-necessary to provide the best quality frame. This example gives the
-codec 15ms (15000us) to return a frame. Remember that this is a soft
-deadline, and the codec may exceed it doing its regular processing. In
-these cases, no additional postprocessing will be done.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE
-/* Decode the frame with 15ms deadline */
-if(vpx_codec_decode(&codec, frame, frame_sz, NULL, 15000))
- die_codec(&codec, "Failed to decode frame");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE
-
-
-Codec Specific Postprocessing Controls
---------------------------------------
-Some codecs provide fine grained controls over their built-in
-postprocessors. VP8 is one example. The following sample code toggles
-postprocessing on and off every 15 frames.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
-#if CONFIG_VP9_DECODER
-if(frame_cnt%30 == 1) {
- vp8_postproc_cfg_t pp = {0, 0, 0};
-
- if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
- die_codec(&codec, "Failed to turn off postproc");
-} else if(frame_cnt%30 == 16) {
- vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, 4, 0};
-
- if(vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp))
- die_codec(&codec, "Failed to turn on postproc");
-};
-#endif
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRE_DECODE
diff --git a/libvpx/examples/resize_util.c b/libvpx/examples/resize_util.c
new file mode 100644
index 0000000..b068f55
--- /dev/null
+++ b/libvpx/examples/resize_util.c
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <assert.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "./vp9/encoder/vp9_resize.h"
+
+static void usage(char *progname) {
+ printf("Usage:\n");
+ printf("%s <input_yuv> <width>x<height> <target_width>x<target_height> ",
+ progname);
+ printf("<output_yuv> [<frames>]\n");
+}
+
+static int parse_dim(char *v, int *width, int *height) {
+ char *x = strchr(v, 'x');
+ if (x == NULL)
+ x = strchr(v, 'X');
+ if (x == NULL)
+ return 0;
+ *width = atoi(v);
+ *height = atoi(&x[1]);
+ if (*width <= 0 || *height <= 0)
+ return 0;
+ else
+ return 1;
+}
+
+int main(int argc, char *argv[]) {
+ char *fin, *fout;
+ FILE *fpin, *fpout;
+ uint8_t *inbuf, *outbuf;
+ uint8_t *inbuf_u, *outbuf_u;
+ uint8_t *inbuf_v, *outbuf_v;
+ int f, frames;
+ int width, height, target_width, target_height;
+
+ if (argc < 5) {
+ printf("Incorrect parameters:\n");
+ usage(argv[0]);
+ return 1;
+ }
+
+ fin = argv[1];
+ fout = argv[4];
+ if (!parse_dim(argv[2], &width, &height)) {
+ printf("Incorrect parameters: %s\n", argv[2]);
+ usage(argv[0]);
+ return 1;
+ }
+ if (!parse_dim(argv[3], &target_width, &target_height)) {
+ printf("Incorrect parameters: %s\n", argv[3]);
+ usage(argv[0]);
+ return 1;
+ }
+
+ fpin = fopen(fin, "rb");
+ if (fpin == NULL) {
+ printf("Can't open file %s to read\n", fin);
+ usage(argv[0]);
+ return 1;
+ }
+ fpout = fopen(fout, "wb");
+ if (fpout == NULL) {
+ printf("Can't open file %s to write\n", fout);
+ usage(argv[0]);
+ return 1;
+ }
+ if (argc >= 6)
+ frames = atoi(argv[5]);
+ else
+ frames = INT_MAX;
+
+ printf("Input size: %dx%d\n",
+ width, height);
+ printf("Target size: %dx%d, Frames: ",
+ target_width, target_height);
+ if (frames == INT_MAX)
+ printf("All\n");
+ else
+ printf("%d\n", frames);
+
+ inbuf = (uint8_t*)malloc(width * height * 3 / 2);
+ outbuf = (uint8_t*)malloc(target_width * target_height * 3 / 2);
+ inbuf_u = inbuf + width * height;
+ inbuf_v = inbuf_u + width * height / 4;
+ outbuf_u = outbuf + target_width * target_height;
+ outbuf_v = outbuf_u + target_width * target_height / 4;
+ f = 0;
+ while (f < frames) {
+ if (fread(inbuf, width * height * 3 / 2, 1, fpin) != 1)
+ break;
+ vp9_resize_frame420(inbuf, width, inbuf_u, inbuf_v, width / 2,
+ height, width,
+ outbuf, target_width, outbuf_u, outbuf_v,
+ target_width / 2,
+ target_height, target_width);
+ fwrite(outbuf, target_width * target_height * 3 / 2, 1, fpout);
+ f++;
+ }
+ printf("%d frames processed\n", f);
+ fclose(fpin);
+ fclose(fpout);
+
+ free(inbuf);
+ free(outbuf);
+ return 0;
+}
diff --git a/libvpx/examples/set_maps.c b/libvpx/examples/set_maps.c
new file mode 100644
index 0000000..4343832
--- /dev/null
+++ b/libvpx/examples/set_maps.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+
+// VP8 Set Active and ROI Maps
+// ===========================
+//
+// This is an example demonstrating how to control the VP8 encoder's
+// ROI and Active maps.
+//
+// ROI (Reigon of Interest) maps are a way for the application to assign
+// each macroblock in the image to a region, and then set quantizer and
+// filtering parameters on that image.
+//
+// Active maps are a way for the application to specify on a
+// macroblock-by-macroblock basis whether there is any activity in that
+// macroblock.
+//
+//
+// Configuration
+// -------------
+// An ROI map is set on frame 22. If the width of the image in macroblocks
+// is evenly divisble by 4, then the output will appear to have distinct
+// columns, where the quantizer, loopfilter, and static threshold differ
+// from column to column.
+//
+// An active map is set on frame 33. If the width of the image in macroblocks
+// is evenly divisble by 4, then the output will appear to have distinct
+// columns, where one column will have motion and the next will not.
+//
+// The active map is cleared on frame 44.
+//
+// Observing The Effects
+// ---------------------
+// Use the `simple_decoder` example to decode this sample, and observe
+// the change in the image at frames 22, 33, and 44.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+#include "vpx/vp8cx.h"
+#include "vpx/vpx_encoder.h"
+
+#include "./tools_common.h"
+#include "./video_writer.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
+ exec_name);
+ exit(EXIT_FAILURE);
+}
+
+static void set_roi_map(const vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_ctx_t *codec) {
+ unsigned int i;
+ vpx_roi_map_t roi = {0};
+
+ roi.rows = (cfg->g_h + 15) / 16;
+ roi.cols = (cfg->g_w + 15) / 16;
+
+ roi.delta_q[0] = 0;
+ roi.delta_q[1] = -2;
+ roi.delta_q[2] = -4;
+ roi.delta_q[3] = -6;
+
+ roi.delta_lf[0] = 0;
+ roi.delta_lf[1] = 1;
+ roi.delta_lf[2] = 2;
+ roi.delta_lf[3] = 3;
+
+ roi.static_threshold[0] = 1500;
+ roi.static_threshold[1] = 1000;
+ roi.static_threshold[2] = 500;
+ roi.static_threshold[3] = 0;
+
+ roi.roi_map = (uint8_t *)malloc(roi.rows * roi.cols);
+ for (i = 0; i < roi.rows * roi.cols; ++i)
+ roi.roi_map[i] = i % 4;
+
+ if (vpx_codec_control(codec, VP8E_SET_ROI_MAP, &roi))
+ die_codec(codec, "Failed to set ROI map");
+
+ free(roi.roi_map);
+}
+
+static void set_active_map(const vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_ctx_t *codec) {
+ unsigned int i;
+ vpx_active_map_t map = {0};
+
+ map.rows = (cfg->g_h + 15) / 16;
+ map.cols = (cfg->g_w + 15) / 16;
+
+ map.active_map = (uint8_t *)malloc(map.rows * map.cols);
+ for (i = 0; i < map.rows * map.cols; ++i)
+ map.active_map[i] = i % 2;
+
+ if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map))
+ die_codec(codec, "Failed to set active map");
+
+ free(map.active_map);
+}
+
+static void unset_active_map(const vpx_codec_enc_cfg_t *cfg,
+ vpx_codec_ctx_t *codec) {
+ vpx_active_map_t map = {0};
+
+ map.rows = (cfg->g_h + 15) / 16;
+ map.cols = (cfg->g_w + 15) / 16;
+ map.active_map = NULL;
+
+ if (vpx_codec_control(codec, VP8E_SET_ACTIVEMAP, &map))
+ die_codec(codec, "Failed to set active map");
+}
+
+static void encode_frame(vpx_codec_ctx_t *codec,
+ vpx_image_t *img,
+ int frame_index,
+ VpxVideoWriter *writer) {
+ vpx_codec_iter_t iter = NULL;
+ const vpx_codec_cx_pkt_t *pkt = NULL;
+ const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0,
+ VPX_DL_GOOD_QUALITY);
+ if (res != VPX_CODEC_OK)
+ die_codec(codec, "Failed to encode frame");
+
+ while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
+ if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
+ const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
+ if (!vpx_video_writer_write_frame(writer,
+ pkt->data.frame.buf,
+ pkt->data.frame.sz,
+ pkt->data.frame.pts)) {
+ die_codec(codec, "Failed to write compressed frame");
+ }
+
+ printf(keyframe ? "K" : ".");
+ fflush(stdout);
+ }
+ }
+}
+
+int main(int argc, char **argv) {
+ FILE *infile = NULL;
+ vpx_codec_ctx_t codec = {0};
+ vpx_codec_enc_cfg_t cfg = {0};
+ int frame_count = 0;
+ vpx_image_t raw = {0};
+ vpx_codec_err_t res;
+ VpxVideoInfo info = {0};
+ VpxVideoWriter *writer = NULL;
+ const VpxInterface *encoder = NULL;
+ const int fps = 2; // TODO(dkovalev) add command line argument
+ const double bits_per_pixel_per_frame = 0.067;
+
+ exec_name = argv[0];
+
+ if (argc != 6)
+ die("Invalid number of arguments");
+
+ encoder = get_vpx_encoder_by_name(argv[1]);
+ if (!encoder)
+ die("Unsupported codec.");
+
+ info.codec_fourcc = encoder->fourcc;
+ info.frame_width = strtol(argv[2], NULL, 0);
+ info.frame_height = strtol(argv[3], NULL, 0);
+ info.time_base.numerator = 1;
+ info.time_base.denominator = fps;
+
+ if (info.frame_width <= 0 ||
+ info.frame_height <= 0 ||
+ (info.frame_width % 2) != 0 ||
+ (info.frame_height % 2) != 0) {
+ die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
+ }
+
+ if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
+ info.frame_height, 1)) {
+ die("Failed to allocate image.");
+ }
+
+ printf("Using %s\n", vpx_codec_iface_name(encoder->interface()));
+
+ res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0);
+ if (res)
+ die_codec(&codec, "Failed to get default codec config.");
+
+ cfg.g_w = info.frame_width;
+ cfg.g_h = info.frame_height;
+ cfg.g_timebase.num = info.time_base.numerator;
+ cfg.g_timebase.den = info.time_base.denominator;
+ cfg.rc_target_bitrate = (unsigned int)(bits_per_pixel_per_frame * cfg.g_w *
+ cfg.g_h * fps / 1000);
+ cfg.g_lag_in_frames = 0;
+
+ writer = vpx_video_writer_open(argv[5], kContainerIVF, &info);
+ if (!writer)
+ die("Failed to open %s for writing.", argv[5]);
+
+ if (!(infile = fopen(argv[4], "rb")))
+ die("Failed to open %s for reading.", argv[4]);
+
+ if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0))
+ die_codec(&codec, "Failed to initialize encoder");
+
+ while (vpx_img_read(&raw, infile)) {
+ ++frame_count;
+
+ if (frame_count == 22 && encoder->fourcc == VP8_FOURCC) {
+ set_roi_map(&cfg, &codec);
+ } else if (frame_count == 33) {
+ set_active_map(&cfg, &codec);
+ } else if (frame_count == 44) {
+ unset_active_map(&cfg, &codec);
+ }
+
+ encode_frame(&codec, &raw, frame_count, writer);
+ }
+ encode_frame(&codec, NULL, -1, writer);
+ printf("\n");
+ fclose(infile);
+ printf("Processed %d frames.\n", frame_count);
+
+ vpx_img_free(&raw);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec.");
+
+ vpx_video_writer_close(writer);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/simple_decoder.c b/libvpx/examples/simple_decoder.c
new file mode 100644
index 0000000..8c15051
--- /dev/null
+++ b/libvpx/examples/simple_decoder.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+
+// Simple Decoder
+// ==============
+//
+// This is an example of a simple decoder loop. It takes an input file
+// containing the compressed data (in IVF format), passes it through the
+// decoder, and writes the decompressed frames to disk. Other decoder
+// examples build upon this one.
+//
+// The details of the IVF format have been elided from this example for
+// simplicity of presentation, as IVF files will not generally be used by
+// your application. In general, an IVF file consists of a file header,
+// followed by a variable number of frames. Each frame consists of a frame
+// header followed by a variable length payload. The length of the payload
+// is specified in the first four bytes of the frame header. The payload is
+// the raw compressed data.
+//
+// Standard Includes
+// -----------------
+// For decoders, you only have to include `vpx_decoder.h` and then any
+// header files for the specific codecs you use. In this case, we're using
+// vp8. The `VPX_CODEC_DISABLE_COMPAT` macro can be defined to ensure
+// strict compliance with the latest SDK by disabling some backwards
+// compatibility features. Defining this macro is encouraged.
+//
+// Initializing The Codec
+// ----------------------
+// The decoder is initialized by the following code. This is an example for
+// the VP8 decoder, but the code is analogous for all algorithms. Replace
+// `vpx_codec_vp8_dx()` with a pointer to the interface exposed by the
+// algorithm you want to use. The `cfg` argument is left as NULL in this
+// example, because we want the algorithm to determine the stream
+// configuration (width/height) and allocate memory automatically. This
+// parameter is generally only used if you need to preallocate memory,
+// particularly in External Memory Allocation mode.
+//
+// Decoding A Frame
+// ----------------
+// Once the frame has been read into memory, it is decoded using the
+// `vpx_codec_decode` function. The call takes a pointer to the data
+// (`frame`) and the length of the data (`frame_sz`). No application data
+// is associated with the frame in this example, so the `user_priv`
+// parameter is NULL. The `deadline` parameter is left at zero for this
+// example. This parameter is generally only used when doing adaptive
+// postprocessing.
+//
+// Codecs may produce a variable number of output frames for every call to
+// `vpx_codec_decode`. These frames are retrieved by the
+// `vpx_codec_get_frame` iterator function. The iterator variable `iter` is
+// initialized to NULL each time `vpx_codec_decode` is called.
+// `vpx_codec_get_frame` is called in a loop, returning a pointer to a
+// decoded image or NULL to indicate the end of list.
+//
+// Processing The Decoded Data
+// ---------------------------
+// In this example, we simply write the encoded data to disk. It is
+// important to honor the image's `stride` values.
+//
+// Cleanup
+// -------
+// The `vpx_codec_destroy` call frees any memory allocated by the codec.
+//
+// Error Handling
+// --------------
+// This example does not special case any error return codes. If there was
+// an error, a descriptive message is printed and the program exits. With
+// few exeptions, vpx_codec functions return an enumerated error status,
+// with the value `0` indicating success.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+
+#include "vpx/vp8dx.h"
+#include "vpx/vpx_decoder.h"
+
+#include "./tools_common.h"
+#include "./video_reader.h"
+#include "./vpx_config.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
+ exit(EXIT_FAILURE);
+}
+
+int main(int argc, char **argv) {
+ int frame_cnt = 0;
+ FILE *outfile = NULL;
+ vpx_codec_ctx_t codec;
+ VpxVideoReader *reader = NULL;
+ const VpxInterface *decoder = NULL;
+ const VpxVideoInfo *info = NULL;
+
+ exec_name = argv[0];
+
+ if (argc != 3)
+ die("Invalid number of arguments.");
+
+ reader = vpx_video_reader_open(argv[1]);
+ if (!reader)
+ die("Failed to open %s for reading.", argv[1]);
+
+ if (!(outfile = fopen(argv[2], "wb")))
+ die("Failed to open %s for writing.", argv[2]);
+
+ info = vpx_video_reader_get_info(reader);
+
+ decoder = get_vpx_decoder_by_fourcc(info->codec_fourcc);
+ if (!decoder)
+ die("Unknown input codec.");
+
+ printf("Using %s\n", vpx_codec_iface_name(decoder->interface()));
+
+ if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0))
+ die_codec(&codec, "Failed to initialize decoder.");
+
+ while (vpx_video_reader_read_frame(reader)) {
+ vpx_codec_iter_t iter = NULL;
+ vpx_image_t *img = NULL;
+ size_t frame_size = 0;
+ const unsigned char *frame = vpx_video_reader_get_frame(reader,
+ &frame_size);
+ if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0))
+ die_codec(&codec, "Failed to decode frame.");
+
+ while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) {
+ vpx_img_write(img, outfile);
+ ++frame_cnt;
+ }
+ }
+
+ printf("Processed %d frames.\n", frame_cnt);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec");
+
+ printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n",
+ info->frame_width, info->frame_height, argv[2]);
+
+ vpx_video_reader_close(reader);
+
+ fclose(outfile);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/simple_decoder.txt b/libvpx/examples/simple_decoder.txt
deleted file mode 100644
index 90d9a68..0000000
--- a/libvpx/examples/simple_decoder.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-@TEMPLATE decoder_tmpl.c
-Simple Decoder
-==============
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example of a simple decoder loop. It takes an input file
-containing the compressed data (in IVF format), passes it through the
-decoder, and writes the decompressed frames to disk. Other decoder
-examples build upon this one.
-
-The details of the IVF format have been elided from this example for
-simplicity of presentation, as IVF files will not generally be used by
-your application. In general, an IVF file consists of a file header,
-followed by a variable number of frames. Each frame consists of a frame
-header followed by a variable length payload. The length of the payload
-is specified in the first four bytes of the frame header. The payload is
-the raw compressed data.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Standard Includes
------------------
-For decoders, you only have to include `vpx_decoder.h` and then any
-header files for the specific codecs you use. In this case, we're using
-vp8. The `VPX_CODEC_DISABLE_COMPAT` macro can be defined to ensure
-strict compliance with the latest SDK by disabling some backwards
-compatibility features. Defining this macro is encouraged.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INCLUDES
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INCLUDES
-
-
-Initializing The Codec
-----------------------
-The decoder is initialized by the following code. This is an example for
-the VP8 decoder, but the code is analogous for all algorithms. Replace
-`vpx_codec_vp8_dx()` with a pointer to the interface exposed by the
-algorithm you want to use. The `cfg` argument is left as NULL in this
-example, because we want the algorithm to determine the stream
-configuration (width/height) and allocate memory automatically. This
-parameter is generally only used if you need to preallocate memory,
-particularly in External Memory Allocation mode.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DEC_INIT
-
-
-Decoding A Frame
-----------------
-Once the frame has been read into memory, it is decoded using the
-`vpx_codec_decode` function. The call takes a pointer to the data
-(`frame`) and the length of the data (`frame_sz`). No application data
-is associated with the frame in this example, so the `user_priv`
-parameter is NULL. The `deadline` parameter is left at zero for this
-example. This parameter is generally only used when doing adaptive
-postprocessing.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DECODE
-
-Codecs may produce a variable number of output frames for every call to
-`vpx_codec_decode`. These frames are retrieved by the
-`vpx_codec_get_frame` iterator function. The iterator variable `iter` is
-initialized to NULL each time `vpx_codec_decode` is called.
-`vpx_codec_get_frame` is called in a loop, returning a pointer to a
-decoded image or NULL to indicate the end of list.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET_FRAME
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ GET_FRAME
-
-
-Processing The Decoded Data
----------------------------
-In this example, we simply write the encoded data to disk. It is
-important to honor the image's `stride` values.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_DX
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_DX
-
-
-Cleanup
--------
-The `vpx_codec_destroy` call frees any memory allocated by the codec.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-
-
-Error Handling
---------------
-This example does not special case any error return codes. If there was
-an error, a descriptive message is printed and the program exits. With
-few exeptions, vpx_codec functions return an enumerated error status,
-with the value `0` indicating success.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
diff --git a/libvpx/examples/simple_encoder.c b/libvpx/examples/simple_encoder.c
new file mode 100644
index 0000000..af58091
--- /dev/null
+++ b/libvpx/examples/simple_encoder.c
@@ -0,0 +1,252 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// Simple Encoder
+// ==============
+//
+// This is an example of a simple encoder loop. It takes an input file in
+// YV12 format, passes it through the encoder, and writes the compressed
+// frames to disk in IVF format. Other decoder examples build upon this
+// one.
+//
+// The details of the IVF format have been elided from this example for
+// simplicity of presentation, as IVF files will not generally be used by
+// your application. In general, an IVF file consists of a file header,
+// followed by a variable number of frames. Each frame consists of a frame
+// header followed by a variable length payload. The length of the payload
+// is specified in the first four bytes of the frame header. The payload is
+// the raw compressed data.
+//
+// Standard Includes
+// -----------------
+// For encoders, you only have to include `vpx_encoder.h` and then any
+// header files for the specific codecs you use. In this case, we're using
+// vp8. The `VPX_CODEC_DISABLE_COMPAT` macro can be defined to ensure
+// strict compliance with the latest SDK by disabling some backwards
+// compatibility features. Defining this macro is encouraged.
+//
+// Getting The Default Configuration
+// ---------------------------------
+// Encoders have the notion of "usage profiles." For example, an encoder
+// may want to publish default configurations for both a video
+// conferencing application and a best quality offline encoder. These
+// obviously have very different default settings. Consult the
+// documentation for your codec to see if it provides any default
+// configurations. All codecs provide a default configuration, number 0,
+// which is valid for material in the vacinity of QCIF/QVGA.
+//
+// Updating The Configuration
+// ---------------------------------
+// Almost all applications will want to update the default configuration
+// with settings specific to their usage. Here we set the width and height
+// of the video file to that specified on the command line. We also scale
+// the default bitrate based on the ratio between the default resolution
+// and the resolution specified on the command line.
+//
+// Initializing The Codec
+// ----------------------
+// The encoder is initialized by the following code.
+//
+// Encoding A Frame
+// ----------------
+// The frame is read as a continuous block (size width * height * 3 / 2)
+// from the input file. If a frame was read (the input file has not hit
+// EOF) then the frame is passed to the encoder. Otherwise, a NULL
+// is passed, indicating the End-Of-Stream condition to the encoder. The
+// `frame_cnt` is reused as the presentation time stamp (PTS) and each
+// frame is shown for one frame-time in duration. The flags parameter is
+// unused in this example. The deadline is set to VPX_DL_REALTIME to
+// make the example run as quickly as possible.
+
+// Forced Keyframes
+// ----------------
+// Keyframes can be forced by setting the VPX_EFLAG_FORCE_KF bit of the
+// flags passed to `vpx_codec_control()`. In this example, we force a
+// keyframe every <keyframe-interval> frames. Note, the output stream can
+// contain additional keyframes beyond those that have been forced using the
+// VPX_EFLAG_FORCE_KF flag because of automatic keyframe placement by the
+// encoder.
+//
+// Processing The Encoded Data
+// ---------------------------
+// Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data
+// for this frame. We write a IVF frame header, followed by the raw data.
+//
+// Cleanup
+// -------
+// The `vpx_codec_destroy` call frees any memory allocated by the codec.
+//
+// Error Handling
+// --------------
+// This example does not special case any error return codes. If there was
+// an error, a descriptive message is printed and the program exits. With
+// few exeptions, vpx_codec functions return an enumerated error status,
+// with the value `0` indicating success.
+//
+// Error Resiliency Features
+// -------------------------
+// Error resiliency is controlled by the g_error_resilient member of the
+// configuration structure. Use the `decode_with_drops` example to decode with
+// frames 5-10 dropped. Compare the output for a file encoded with this example
+// versus one encoded with the `simple_encoder` example.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+#include "vpx/vpx_encoder.h"
+
+#include "./tools_common.h"
+#include "./video_writer.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr,
+ "Usage: %s <codec> <width> <height> <infile> <outfile> "
+ "<keyframe-interval> [<error-resilient>]\nSee comments in "
+ "simple_encoder.c for more information.\n",
+ exec_name);
+ exit(EXIT_FAILURE);
+}
+
+static void encode_frame(vpx_codec_ctx_t *codec,
+ vpx_image_t *img,
+ int frame_index,
+ int flags,
+ VpxVideoWriter *writer) {
+ vpx_codec_iter_t iter = NULL;
+ const vpx_codec_cx_pkt_t *pkt = NULL;
+ const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1,
+ flags, VPX_DL_GOOD_QUALITY);
+ if (res != VPX_CODEC_OK)
+ die_codec(codec, "Failed to encode frame");
+
+ while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
+ if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
+ const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
+ if (!vpx_video_writer_write_frame(writer,
+ pkt->data.frame.buf,
+ pkt->data.frame.sz,
+ pkt->data.frame.pts)) {
+ die_codec(codec, "Failed to write compressed frame");
+ }
+
+ printf(keyframe ? "K" : ".");
+ fflush(stdout);
+ }
+ }
+}
+
+int main(int argc, char **argv) {
+ FILE *infile = NULL;
+ vpx_codec_ctx_t codec;
+ vpx_codec_enc_cfg_t cfg;
+ int frame_count = 0;
+ vpx_image_t raw;
+ vpx_codec_err_t res;
+ VpxVideoInfo info = {0};
+ VpxVideoWriter *writer = NULL;
+ const VpxInterface *encoder = NULL;
+ const int fps = 30; // TODO(dkovalev) add command line argument
+ const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
+ int keyframe_interval = 0;
+
+ // TODO(dkovalev): Add some simple command line parsing code to make the
+ // command line more flexible.
+ const char *codec_arg = NULL;
+ const char *width_arg = NULL;
+ const char *height_arg = NULL;
+ const char *infile_arg = NULL;
+ const char *outfile_arg = NULL;
+ const char *keyframe_interval_arg = NULL;
+
+ exec_name = argv[0];
+
+ if (argc < 7)
+ die("Invalid number of arguments");
+
+ codec_arg = argv[1];
+ width_arg = argv[2];
+ height_arg = argv[3];
+ infile_arg = argv[4];
+ outfile_arg = argv[5];
+ keyframe_interval_arg = argv[6];
+
+ encoder = get_vpx_encoder_by_name(codec_arg);
+ if (!encoder)
+ die("Unsupported codec.");
+
+ info.codec_fourcc = encoder->fourcc;
+ info.frame_width = strtol(width_arg, NULL, 0);
+ info.frame_height = strtol(height_arg, NULL, 0);
+ info.time_base.numerator = 1;
+ info.time_base.denominator = fps;
+
+ if (info.frame_width <= 0 ||
+ info.frame_height <= 0 ||
+ (info.frame_width % 2) != 0 ||
+ (info.frame_height % 2) != 0) {
+ die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
+ }
+
+ if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
+ info.frame_height, 1)) {
+ die("Failed to allocate image.");
+ }
+
+ keyframe_interval = strtol(keyframe_interval_arg, NULL, 0);
+ if (keyframe_interval < 0)
+ die("Invalid keyframe interval value.");
+
+ printf("Using %s\n", vpx_codec_iface_name(encoder->interface()));
+
+ res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0);
+ if (res)
+ die_codec(&codec, "Failed to get default codec config.");
+
+ cfg.g_w = info.frame_width;
+ cfg.g_h = info.frame_height;
+ cfg.g_timebase.num = info.time_base.numerator;
+ cfg.g_timebase.den = info.time_base.denominator;
+ cfg.rc_target_bitrate = bitrate;
+ cfg.g_error_resilient = argc > 7 ? strtol(argv[7], NULL, 0) : 0;
+
+ writer = vpx_video_writer_open(outfile_arg, kContainerIVF, &info);
+ if (!writer)
+ die("Failed to open %s for writing.", outfile_arg);
+
+ if (!(infile = fopen(infile_arg, "rb")))
+ die("Failed to open %s for reading.", infile_arg);
+
+ if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0))
+ die_codec(&codec, "Failed to initialize encoder");
+
+ while (vpx_img_read(&raw, infile)) {
+ int flags = 0;
+ if (keyframe_interval > 0 && frame_count % keyframe_interval == 0)
+ flags |= VPX_EFLAG_FORCE_KF;
+ encode_frame(&codec, &raw, frame_count++, flags, writer);
+ }
+ encode_frame(&codec, NULL, -1, 0, writer); // flush the encoder
+
+ printf("\n");
+ fclose(infile);
+ printf("Processed %d frames.\n", frame_count);
+
+ vpx_img_free(&raw);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec.");
+
+ vpx_video_writer_close(writer);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/simple_encoder.txt b/libvpx/examples/simple_encoder.txt
deleted file mode 100644
index 44c5b08..0000000
--- a/libvpx/examples/simple_encoder.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-@TEMPLATE encoder_tmpl.c
-Simple Encoder
-==============
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example of a simple encoder loop. It takes an input file in
-YV12 format, passes it through the encoder, and writes the compressed
-frames to disk in IVF format. Other decoder examples build upon this
-one.
-
-The details of the IVF format have been elided from this example for
-simplicity of presentation, as IVF files will not generally be used by
-your application. In general, an IVF file consists of a file header,
-followed by a variable number of frames. Each frame consists of a frame
-header followed by a variable length payload. The length of the payload
-is specified in the first four bytes of the frame header. The payload is
-the raw compressed data.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Standard Includes
------------------
-For encoders, you only have to include `vpx_encoder.h` and then any
-header files for the specific codecs you use. In this case, we're using
-vp8. The `VPX_CODEC_DISABLE_COMPAT` macro can be defined to ensure
-strict compliance with the latest SDK by disabling some backwards
-compatibility features. Defining this macro is encouraged.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INCLUDES
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INCLUDES
-
-
-Getting The Default Configuration
----------------------------------
-Encoders have the notion of "usage profiles." For example, an encoder
-may want to publish default configurations for both a video
-conferencing appliction and a best quality offline encoder. These
-obviously have very different default settings. Consult the
-documentation for your codec to see if it provides any default
-configurations. All codecs provide a default configuration, number 0,
-which is valid for material in the vacinity of QCIF/QVGA.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_DEF_CFG
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_DEF_CFG
-
-
-Updating The Configuration
----------------------------------
-Almost all applications will want to update the default configuration
-with settings specific to their usage. Here we set the width and height
-of the video file to that specified on the command line. We also scale
-the default bitrate based on the ratio between the default resolution
-and the resolution specified on the command line.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_SET_CFG
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_SET_CFG
-
-
-Initializing The Codec
-----------------------
-The encoder is initialized by the following code.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INIT
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENC_INIT
-
-
-Encoding A Frame
-----------------
-The frame is read as a continuous block (size width * height * 3 / 2)
-from the input file. If a frame was read (the input file has not hit
-EOF) then the frame is passed to the encoder. Otherwise, a NULL
-is passed, indicating the End-Of-Stream condition to the encoder. The
-`frame_cnt` is reused as the presentation time stamp (PTS) and each
-frame is shown for one frame-time in duration. The flags parameter is
-unused in this example. The deadline is set to VPX_DL_REALTIME to
-make the example run as quickly as possible.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-
-Processing The Encoded Data
----------------------------
-Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data
-for this frame. We write a IVF frame header, followed by the raw data.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_FRAME
-
-
-Cleanup
--------
-The `vpx_codec_destroy` call frees any memory allocated by the codec.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-
-
-Error Handling
---------------
-This example does not special case any error return codes. If there was
-an error, a descriptive message is printed and the program exits. With
-few exeptions, vpx_codec functions return an enumerated error status,
-with the value `0` indicating success.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
-@DEFAULT
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DIE_CODEC
diff --git a/libvpx/examples/twopass_encoder.c b/libvpx/examples/twopass_encoder.c
new file mode 100644
index 0000000..8bca18c
--- /dev/null
+++ b/libvpx/examples/twopass_encoder.c
@@ -0,0 +1,230 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// Two Pass Encoder
+// ================
+//
+// This is an example of a two pass encoder loop. It takes an input file in
+// YV12 format, passes it through the encoder twice, and writes the compressed
+// frames to disk in IVF format. It builds upon the simple_encoder example.
+//
+// Twopass Variables
+// -----------------
+// Twopass mode needs to track the current pass number and the buffer of
+// statistics packets.
+//
+// Updating The Configuration
+// ---------------------------------
+// In two pass mode, the configuration has to be updated on each pass. The
+// statistics buffer is passed on the last pass.
+//
+// Encoding A Frame
+// ----------------
+// Encoding a frame in two pass mode is identical to the simple encoder
+// example, except the deadline is set to VPX_DL_BEST_QUALITY to get the
+// best quality possible. VPX_DL_GOOD_QUALITY could also be used.
+//
+//
+// Processing Statistics Packets
+// -----------------------------
+// Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data
+// for this frame. We write a IVF frame header, followed by the raw data.
+//
+//
+// Pass Progress Reporting
+// -----------------------------
+// It's sometimes helpful to see when each pass completes.
+//
+//
+// Clean-up
+// -----------------------------
+// Destruction of the encoder instance must be done on each pass. The
+// raw image should be destroyed at the end as usual.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+#include "vpx/vpx_encoder.h"
+
+#include "./tools_common.h"
+#include "./video_writer.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
+ exec_name);
+ exit(EXIT_FAILURE);
+}
+
+static void get_frame_stats(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned int duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned int deadline,
+ vpx_fixed_buf_t *stats) {
+ vpx_codec_iter_t iter = NULL;
+ const vpx_codec_cx_pkt_t *pkt = NULL;
+ const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags,
+ deadline);
+ if (res != VPX_CODEC_OK)
+ die_codec(ctx, "Failed to get frame stats.");
+
+ while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) {
+ if (pkt->kind == VPX_CODEC_STATS_PKT) {
+ const uint8_t *const pkt_buf = pkt->data.twopass_stats.buf;
+ const size_t pkt_size = pkt->data.twopass_stats.sz;
+ stats->buf = realloc(stats->buf, stats->sz + pkt_size);
+ memcpy((uint8_t *)stats->buf + stats->sz, pkt_buf, pkt_size);
+ stats->sz += pkt_size;
+ }
+ }
+}
+
+static void encode_frame(vpx_codec_ctx_t *ctx,
+ const vpx_image_t *img,
+ vpx_codec_pts_t pts,
+ unsigned int duration,
+ vpx_enc_frame_flags_t flags,
+ unsigned int deadline,
+ VpxVideoWriter *writer) {
+ vpx_codec_iter_t iter = NULL;
+ const vpx_codec_cx_pkt_t *pkt = NULL;
+ const vpx_codec_err_t res = vpx_codec_encode(ctx, img, pts, duration, flags,
+ deadline);
+ if (res != VPX_CODEC_OK)
+ die_codec(ctx, "Failed to encode frame.");
+
+ while ((pkt = vpx_codec_get_cx_data(ctx, &iter)) != NULL) {
+ if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
+ const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
+
+ if (!vpx_video_writer_write_frame(writer, pkt->data.frame.buf,
+ pkt->data.frame.sz,
+ pkt->data.frame.pts))
+ die_codec(ctx, "Failed to write compressed frame.");
+ printf(keyframe ? "K" : ".");
+ fflush(stdout);
+ }
+ }
+}
+
+int main(int argc, char **argv) {
+ FILE *infile = NULL;
+ VpxVideoWriter *writer = NULL;
+ vpx_codec_ctx_t codec;
+ vpx_codec_enc_cfg_t cfg;
+ vpx_image_t raw;
+ vpx_codec_err_t res;
+ vpx_fixed_buf_t stats = {0};
+ VpxVideoInfo info = {0};
+ const VpxInterface *encoder = NULL;
+ int pass;
+ const int fps = 30; // TODO(dkovalev) add command line argument
+ const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
+ const char *const codec_arg = argv[1];
+ const char *const width_arg = argv[2];
+ const char *const height_arg = argv[3];
+ const char *const infile_arg = argv[4];
+ const char *const outfile_arg = argv[5];
+ exec_name = argv[0];
+
+ if (argc != 6)
+ die("Invalid number of arguments.");
+
+ encoder = get_vpx_encoder_by_name(codec_arg);
+ if (!encoder)
+ die("Unsupported codec.");
+
+ info.codec_fourcc = encoder->fourcc;
+ info.time_base.numerator = 1;
+ info.time_base.denominator = fps;
+ info.frame_width = strtol(width_arg, NULL, 0);
+ info.frame_height = strtol(height_arg, NULL, 0);
+
+ if (info.frame_width <= 0 ||
+ info.frame_height <= 0 ||
+ (info.frame_width % 2) != 0 ||
+ (info.frame_height % 2) != 0) {
+ die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
+ }
+
+ if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
+ info.frame_height, 1)) {
+ die("Failed to allocate image", info.frame_width, info.frame_height);
+ }
+
+ writer = vpx_video_writer_open(outfile_arg, kContainerIVF, &info);
+ if (!writer)
+ die("Failed to open %s for writing", outfile_arg);
+
+ printf("Using %s\n", vpx_codec_iface_name(encoder->interface()));
+
+ res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0);
+ if (res)
+ die_codec(&codec, "Failed to get default codec config.");
+
+ cfg.g_w = info.frame_width;
+ cfg.g_h = info.frame_height;
+ cfg.g_timebase.num = info.time_base.numerator;
+ cfg.g_timebase.den = info.time_base.denominator;
+ cfg.rc_target_bitrate = bitrate;
+
+ for (pass = 0; pass < 2; ++pass) {
+ int frame_count = 0;
+
+ if (pass == 0) {
+ cfg.g_pass = VPX_RC_FIRST_PASS;
+ } else {
+ cfg.g_pass = VPX_RC_LAST_PASS;
+ cfg.rc_twopass_stats_in = stats;
+ }
+
+ if (!(infile = fopen(infile_arg, "rb")))
+ die("Failed to open %s for reading", infile_arg);
+
+ if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0))
+ die_codec(&codec, "Failed to initialize encoder");
+
+ while (vpx_img_read(&raw, infile)) {
+ ++frame_count;
+
+ if (pass == 0) {
+ get_frame_stats(&codec, &raw, frame_count, 1, 0, VPX_DL_BEST_QUALITY,
+ &stats);
+ } else {
+ encode_frame(&codec, &raw, frame_count, 1, 0, VPX_DL_BEST_QUALITY,
+ writer);
+ }
+ }
+
+ if (pass == 0) {
+ get_frame_stats(&codec, NULL, frame_count, 1, 0, VPX_DL_BEST_QUALITY,
+ &stats);
+ } else {
+ printf("\n");
+ }
+
+ fclose(infile);
+ printf("Pass %d complete. Processed %d frames.\n", pass + 1, frame_count);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec.");
+ }
+
+ vpx_img_free(&raw);
+ free(stats.buf);
+
+ vpx_video_writer_close(writer);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/twopass_encoder.txt b/libvpx/examples/twopass_encoder.txt
deleted file mode 100644
index 2f81a90..0000000
--- a/libvpx/examples/twopass_encoder.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-@TEMPLATE encoder_tmpl.c
-Two Pass Encoder
-================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example of a two pass encoder loop. It takes an input file in
-YV12 format, passes it through the encoder twice, and writes the compressed
-frames to disk in IVF format. It builds upon the simple_encoder example.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Twopass Variables
------------------
-Twopass mode needs to track the current pass number and the buffer of
-statistics packets.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_VARS
-int pass;
-vpx_fixed_buf_t stats = {0};
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_VARS
-
-
-Updating The Configuration
----------------------------------
-In two pass mode, the configuration has to be updated on each pass. The
-statistics buffer is passed on the last pass.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_BEGIN
-for(pass=0; pass<2; pass++) {
- frame_cnt = 0;
-
- if(pass == 0)
- cfg.g_pass = VPX_RC_FIRST_PASS;
- else {
- cfg.g_pass = VPX_RC_LAST_PASS;
- cfg.rc_twopass_stats_in = stats;
- }
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_BEGIN
-
-
-Encoding A Frame
-----------------
-Encoding a frame in two pass mode is identical to the simple encoder
-example, except the deadline is set to VPX_DL_BEST_QUALITY to get the
-best quality possible. VPX_DL_GOOD_QUALITY could also be used.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-frame_avail = read_frame(infile, &raw);
-if(vpx_codec_encode(&codec, frame_avail? &raw : NULL, frame_cnt,
- 1, flags, VPX_DL_BEST_QUALITY))
- die_codec(&codec, "Failed to encode frame");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-
-
-Processing Statistics Packets
------------------------------
-Each packet of type `VPX_CODEC_CX_FRAME_PKT` contains the encoded data
-for this frame. We write a IVF frame header, followed by the raw data.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_STATS
-case VPX_CODEC_STATS_PKT:
- stats.buf = realloc(stats.buf, stats.sz
- + pkt->data.twopass_stats.sz);
- if(!stats.buf)
- die("Memory reallocation failed.\n");
- memcpy((char*)stats.buf + stats.sz,
- pkt->data.twopass_stats.buf,
- pkt->data.twopass_stats.sz);
- stats.sz += pkt->data.twopass_stats.sz;
- break;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROCESS_STATS
-
-
-Pass Progress Reporting
------------------------------
-It's sometimes helpful to see when each pass completes.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END
- printf("Pass %d complete.\n", pass+1);
- if(vpx_codec_destroy(&codec))
- die_codec(&codec, "Failed to destroy codec");
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_LOOP_END
-
-
-Clean-up
------------------------------
-Destruction of the encoder instance must be done on each pass. The
-raw image should be destroyed at the end as usual.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
-vpx_img_free(&raw);
-free(stats.buf);
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DESTROY
diff --git a/libvpx/vp8_multi_resolution_encoder.c b/libvpx/examples/vp8_multi_resolution_encoder.c
index 4c29056..1fef7db 100644
--- a/libvpx/vp8_multi_resolution_encoder.c
+++ b/libvpx/examples/vp8_multi_resolution_encoder.c
@@ -18,11 +18,12 @@
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
-#include "math.h"
+#include <math.h>
#define VPX_CODEC_DISABLE_COMPAT 1
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#include "vpx_ports/mem_ops.h"
+#include "./tools_common.h"
#define interface (vpx_codec_vp8_cx())
#define fourcc 0x30385056
@@ -44,21 +45,6 @@
#include "third_party/libyuv/include/libyuv/scale.h"
#include "third_party/libyuv/include/libyuv/cpu_id.h"
-static double vp8_mse2psnr(double Samples, double Peak, double Mse)
-{
- double psnr;
-
- if ((double)Mse > 0.0)
- psnr = 10.0 * log10(Peak * Peak * Samples / Mse);
- else
- psnr = 60; // Limit to prevent / 0
-
- if (psnr > 60)
- psnr = 60;
-
- return psnr;
-}
-
static void die(const char *fmt, ...) {
va_list ap;
@@ -454,8 +440,8 @@ int main(int argc, char **argv)
if ( (show_psnr) && (psnr_count[i]>0) )
{
int j;
- double ovpsnr = vp8_mse2psnr(psnr_samples_total[i], 255.0,
- psnr_sse_total[i]);
+ double ovpsnr = sse_to_psnr(psnr_samples_total[i], 255.0,
+ psnr_sse_total[i]);
fprintf(stderr, "\n ENC%d PSNR (Overall/Avg/Y/U/V)", i);
diff --git a/libvpx/examples/vp8_set_maps.txt b/libvpx/examples/vp8_set_maps.txt
deleted file mode 100644
index ad9ef61..0000000
--- a/libvpx/examples/vp8_set_maps.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-@TEMPLATE encoder_tmpl.c
-VP8 Set Active and ROI Maps
-===========================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example demonstrating how to control the VP8 encoder's
-ROI and Active maps.
-
-ROI (Reigon of Interest) maps are a way for the application to assign
-each macroblock in the image to a region, and then set quantizer and
-filtering parameters on that image.
-
-Active maps are a way for the application to specify on a
-macroblock-by-macroblock basis whether there is any activity in that
-macroblock.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Configuration
--------------
-An ROI map is set on frame 22. If the width of the image in macroblocks
-is evenly divisble by 4, then the output will appear to have distinct
-columns, where the quantizer, loopfilter, and static threshold differ
-from column to column.
-
-An active map is set on frame 33. If the width of the image in macroblocks
-is evenly divisble by 4, then the output will appear to have distinct
-columns, where one column will have motion and the next will not.
-
-The active map is cleared on frame 44.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PER_FRAME_CFG
-if(frame_cnt + 1 == 22) {
- vpx_roi_map_t roi;
- int i;
-
- roi.rows = cfg.g_h/16;
- roi.cols = cfg.g_w/16;
-
- roi.delta_q[0] = 0;
- roi.delta_q[1] = -2;
- roi.delta_q[2] = -4;
- roi.delta_q[3] = -6;
-
- roi.delta_lf[0] = 0;
- roi.delta_lf[1] = 1;
- roi.delta_lf[2] = 2;
- roi.delta_lf[3] = 3;
-
- roi.static_threshold[0] = 1500;
- roi.static_threshold[1] = 1000;
- roi.static_threshold[2] = 500;
- roi.static_threshold[3] = 0;
-
- /* generate an ROI map for example */
- roi.roi_map = malloc(roi.rows * roi.cols);
- for(i=0;i<roi.rows*roi.cols;i++)
- roi.roi_map[i] = i & 3;
-
- if(vpx_codec_control(&codec, VP8E_SET_ROI_MAP, &roi))
- die_codec(&codec, "Failed to set ROI map");
-
- free(roi.roi_map);
-} else if(frame_cnt + 1 == 33) {
- vpx_active_map_t active;
- int i;
-
- active.rows = cfg.g_h/16;
- active.cols = cfg.g_w/16;
-
- /* generate active map for example */
- active.active_map = malloc(active.rows * active.cols);
- for(i=0;i<active.rows*active.cols;i++)
- active.active_map[i] = i & 1;
-
- if(vpx_codec_control(&codec, VP8E_SET_ACTIVEMAP, &active))
- die_codec(&codec, "Failed to set active map");
-
- free(active.active_map);
-} else if(frame_cnt + 1 == 44) {
- vpx_active_map_t active;
-
- active.rows = cfg.g_h/16;
- active.cols = cfg.g_w/16;
-
- /* pass in null map to disable active_map*/
- active.active_map = NULL;
-
- if(vpx_codec_control(&codec, VP8E_SET_ACTIVEMAP, &active))
- die_codec(&codec, "Failed to set active map");
-}
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PER_FRAME_CFG
-
-
-Observing The Effects
----------------------
-Use the `simple_decoder` example to decode this sample, and observe
-the change in the image at frames 22, 33, and 44.
diff --git a/libvpx/examples/vp8cx_set_ref.c b/libvpx/examples/vp8cx_set_ref.c
new file mode 100644
index 0000000..9b6d11b
--- /dev/null
+++ b/libvpx/examples/vp8cx_set_ref.c
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+
+// VP8 Set Reference Frame
+// =======================
+//
+// This is an example demonstrating how to overwrite the VP8 encoder's
+// internal reference frame. In the sample we set the last frame to the
+// current frame. If this is done at a cut scene it will avoid a keyframe.
+// This technique could be used to bounce between two cameras.
+//
+// Note that the decoder would also have to set the reference frame to the
+// same value on the same frame, or the video will become corrupt.
+//
+// Usage
+// -----
+// This example adds a single argument to the `simple_encoder` example,
+// which specifies the frame number to update the reference frame on.
+// The parameter is parsed as follows:
+//
+//
+// Extra Variables
+// ---------------
+// This example maintains the frame number passed on the command line
+// in the `update_frame_num` variable.
+//
+//
+// Configuration
+// -------------
+//
+// The reference frame is updated on the frame specified on the command
+// line.
+//
+// Observing The Effects
+// ---------------------
+// Use the `simple_encoder` example to encode a sample with a cut scene.
+// Determine the frame number of the cut scene by looking for a generated
+// key-frame (indicated by a 'K'). Supply that frame number as an argument
+// to this example, and observe that no key-frame is generated.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+#include "vpx/vp8cx.h"
+#include "vpx/vpx_encoder.h"
+
+#include "./tools_common.h"
+#include "./video_writer.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile> <frame>\n",
+ exec_name);
+ exit(EXIT_FAILURE);
+}
+
+static void encode_frame(vpx_codec_ctx_t *codec,
+ vpx_image_t *img,
+ int frame_index,
+ VpxVideoWriter *writer) {
+ vpx_codec_iter_t iter = NULL;
+ const vpx_codec_cx_pkt_t *pkt = NULL;
+ const vpx_codec_err_t res = vpx_codec_encode(codec, img, frame_index, 1, 0,
+ VPX_DL_GOOD_QUALITY);
+ if (res != VPX_CODEC_OK)
+ die_codec(codec, "Failed to encode frame");
+
+ while ((pkt = vpx_codec_get_cx_data(codec, &iter)) != NULL) {
+ if (pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
+ const int keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
+ if (!vpx_video_writer_write_frame(writer,
+ pkt->data.frame.buf,
+ pkt->data.frame.sz,
+ pkt->data.frame.pts)) {
+ die_codec(codec, "Failed to write compressed frame");
+ }
+
+ printf(keyframe ? "K" : ".");
+ fflush(stdout);
+ }
+ }
+}
+
+int main(int argc, char **argv) {
+ FILE *infile = NULL;
+ vpx_codec_ctx_t codec = {0};
+ vpx_codec_enc_cfg_t cfg = {0};
+ int frame_count = 0;
+ vpx_image_t raw;
+ vpx_codec_err_t res;
+ VpxVideoInfo info = {0};
+ VpxVideoWriter *writer = NULL;
+ const VpxInterface *encoder = NULL;
+ int update_frame_num = 0;
+ const int fps = 30; // TODO(dkovalev) add command line argument
+ const int bitrate = 200; // kbit/s TODO(dkovalev) add command line argument
+
+ exec_name = argv[0];
+
+ if (argc != 6)
+ die("Invalid number of arguments");
+
+ // TODO(dkovalev): add vp9 support and rename the file accordingly
+ encoder = get_vpx_encoder_by_name("vp8");
+ if (!encoder)
+ die("Unsupported codec.");
+
+ update_frame_num = atoi(argv[5]);
+ if (!update_frame_num)
+ die("Couldn't parse frame number '%s'\n", argv[5]);
+
+ info.codec_fourcc = encoder->fourcc;
+ info.frame_width = strtol(argv[1], NULL, 0);
+ info.frame_height = strtol(argv[2], NULL, 0);
+ info.time_base.numerator = 1;
+ info.time_base.denominator = fps;
+
+ if (info.frame_width <= 0 ||
+ info.frame_height <= 0 ||
+ (info.frame_width % 2) != 0 ||
+ (info.frame_height % 2) != 0) {
+ die("Invalid frame size: %dx%d", info.frame_width, info.frame_height);
+ }
+
+ if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, info.frame_width,
+ info.frame_height, 1)) {
+ die("Failed to allocate image.");
+ }
+
+ printf("Using %s\n", vpx_codec_iface_name(encoder->interface()));
+
+ res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0);
+ if (res)
+ die_codec(&codec, "Failed to get default codec config.");
+
+ cfg.g_w = info.frame_width;
+ cfg.g_h = info.frame_height;
+ cfg.g_timebase.num = info.time_base.numerator;
+ cfg.g_timebase.den = info.time_base.denominator;
+ cfg.rc_target_bitrate = bitrate;
+
+ writer = vpx_video_writer_open(argv[4], kContainerIVF, &info);
+ if (!writer)
+ die("Failed to open %s for writing.", argv[4]);
+
+ if (!(infile = fopen(argv[3], "rb")))
+ die("Failed to open %s for reading.", argv[3]);
+
+ if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0))
+ die_codec(&codec, "Failed to initialize encoder");
+
+ while (vpx_img_read(&raw, infile)) {
+ if (frame_count + 1 == update_frame_num) {
+ vpx_ref_frame_t ref;
+ ref.frame_type = VP8_LAST_FRAME;
+ ref.img = raw;
+ if (vpx_codec_control(&codec, VP8_SET_REFERENCE, &ref))
+ die_codec(&codec, "Failed to set reference frame");
+ }
+
+ encode_frame(&codec, &raw, frame_count++, writer);
+ }
+ encode_frame(&codec, NULL, -1, writer);
+
+ printf("\n");
+ fclose(infile);
+ printf("Processed %d frames.\n", frame_count);
+
+ vpx_img_free(&raw);
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec.");
+
+ vpx_video_writer_close(writer);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/examples/vp8cx_set_ref.txt b/libvpx/examples/vp8cx_set_ref.txt
deleted file mode 100644
index dc8a717..0000000
--- a/libvpx/examples/vp8cx_set_ref.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-@TEMPLATE encoder_tmpl.c
-VP8 Set Reference Frame
-=======================
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-This is an example demonstrating how to overwrite the VP8 encoder's
-internal reference frame. In the sample we set the last frame to the
-current frame. If this is done at a cut scene it will avoid a keyframe.
-This technique could be used to bounce between two cameras.
-
-Note that the decoder would also have to set the reference frame to the
-same value on the same frame, or the video will become corrupt.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ INTRODUCTION
-
-
-Usage
------
-This example adds a single argument to the `simple_encoder` example,
-which specifies the frame number to update the reference frame on.
-The parameter is parsed as follows:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-if(argc!=6)
- die("Usage: %s <width> <height> <infile> <outfile> <frame>\n",
- argv[0]);
-
- update_frame_num = atoi(argv[5]);
- if(!update_frame_num)
- die("Couldn't parse frame number '%s'\n", argv[5]);
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ USAGE
-
-
-Extra Variables
----------------
-This example maintains the frame number passed on the command line
-in the `update_frame_num` variable:
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_VARS
-int update_frame_num = 0;
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TWOPASS_VARS
-
-
-Configuration
--------------
-
-The reference frame is updated on the frame specified on the command
-line.
-
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-frame_avail = read_frame(infile, &raw);
-
-if(frame_cnt + 1 == update_frame_num) {
- vpx_ref_frame_t ref;
-
- ref.frame_type = VP8_LAST_FRAME;
- ref.img = raw;
-
- if(vpx_codec_control(&codec, VP8_SET_REFERENCE, &ref))
- die_codec(&codec, "Failed to set reference frame");
-}
-
-if(vpx_codec_encode(&codec, frame_avail? &raw : NULL, frame_cnt,
- 1, flags, VPX_DL_REALTIME))
- die_codec(&codec, "Failed to encode frame");
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ENCODE_FRAME
-
-
-Observing The Effects
----------------------
-Use the `simple_encoder` example to encode a sample with a cut scene.
-Determine the frame number of the cut scene by looking for a generated
-key-frame (indicated by a 'K'). Supply that frame number as an argument
-to this example, and observe that no key-frame is generated.
diff --git a/libvpx/vp9_spatial_scalable_encoder.c b/libvpx/examples/vp9_spatial_scalable_encoder.c
index 9acfa29..5c80d34 100644
--- a/libvpx/vp9_spatial_scalable_encoder.c
+++ b/libvpx/examples/vp9_spatial_scalable_encoder.c
@@ -18,12 +18,15 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
+
#include "./args.h"
+#include "./tools_common.h"
+#include "./video_writer.h"
+
#include "vpx/svc_context.h"
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
-
-#define VP90_FOURCC 0x30395056
+#include "./vpxstats.h"
static const struct arg_enum_list encoding_mode_enum[] = {
{"i", INTER_LAYER_PREDICTION_I},
@@ -52,15 +55,25 @@ static const arg_def_t kf_dist_arg =
static const arg_def_t scale_factors_arg =
ARG_DEF("r", "scale-factors", 1, "scale factors (lowest to highest layer)");
static const arg_def_t quantizers_arg =
- ARG_DEF("q", "quantizers", 1, "quantizers (lowest to highest layer)");
-static const arg_def_t dummy_frame_arg =
- ARG_DEF("z", "dummy-frame", 1, "make first frame blank and full size");
+ ARG_DEF("q", "quantizers", 1, "quantizers for non key frames, also will "
+ "be applied to key frames if -qn is not specified (lowest to "
+ "highest layer)");
+static const arg_def_t quantizers_keyframe_arg =
+ ARG_DEF("qn", "quantizers-keyframe", 1, "quantizers for key frames (lowest "
+ "to highest layer)");
+static const arg_def_t passes_arg =
+ ARG_DEF("p", "passes", 1, "Number of passes (1/2)");
+static const arg_def_t pass_arg =
+ ARG_DEF(NULL, "pass", 1, "Pass to execute (1/2)");
+static const arg_def_t fpf_name_arg =
+ ARG_DEF(NULL, "fpf", 1, "First pass statistics file name");
static const arg_def_t *svc_args[] = {
&encoding_mode_arg, &frames_arg, &width_arg, &height_arg,
&timebase_arg, &bitrate_arg, &skip_frames_arg, &layers_arg,
- &kf_dist_arg, &scale_factors_arg, &quantizers_arg, &dummy_frame_arg,
- NULL
+ &kf_dist_arg, &scale_factors_arg, &quantizers_arg,
+ &quantizers_keyframe_arg, &passes_arg, &pass_arg,
+ &fpf_name_arg, NULL
};
static const SVC_ENCODING_MODE default_encoding_mode =
@@ -74,28 +87,21 @@ static const uint32_t default_timebase_den = 60;
static const uint32_t default_bitrate = 1000;
static const uint32_t default_spatial_layers = 5;
static const uint32_t default_kf_dist = 100;
-static const int default_use_dummy_frame = 1;
typedef struct {
- char *input_filename;
- char *output_filename;
+ const char *input_filename;
+ const char *output_filename;
uint32_t frames_to_code;
uint32_t frames_to_skip;
+ struct VpxInputContext input_ctx;
+ stats_io_t rc_stats;
+ int passes;
+ int pass;
} AppInput;
-static void mem_put_le16(char *mem, uint32_t val) {
- mem[0] = val;
- mem[1] = val >> 8;
-}
+static const char *exec_name;
-static void mem_put_le32(char *mem, uint32_t val) {
- mem[0] = val;
- mem[1] = val >> 8;
- mem[2] = val >> 16;
- mem[3] = val >> 24;
-}
-
-static void usage(const char *exec_name) {
+void usage_exit() {
fprintf(stderr, "Usage: %s <options> input_filename output_filename\n",
exec_name);
fprintf(stderr, "Options:\n");
@@ -103,113 +109,22 @@ static void usage(const char *exec_name) {
exit(EXIT_FAILURE);
}
-void die(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- vfprintf(stderr, fmt, ap);
- if (fmt[strlen(fmt) - 1] != '\n') printf("\n");
- exit(EXIT_FAILURE);
-}
-
-static void die_codec(vpx_codec_ctx_t *ctx, const char *s) {
- const char *detail = vpx_codec_error_detail(ctx);
-
- printf("%s: %s\n", s, vpx_codec_error(ctx));
- if (detail) printf(" %s\n", detail);
- exit(EXIT_FAILURE);
-}
-
-static int read_frame(FILE *f, vpx_image_t *img) {
- size_t nbytes;
- int res = 1;
- int plane;
-
- for (plane = 0; plane < 3; ++plane) {
- uint8_t *ptr;
- const int w = (plane ? (1 + img->d_w) / 2 : img->d_w);
- const int h = (plane ? (1 + img->d_h) / 2 : img->d_h);
- int r;
-
- switch (plane) {
- case 1:
- ptr = img->planes[VPX_PLANE_U];
- break;
- case 2:
- ptr = img->planes[VPX_PLANE_V];
- break;
- default:
- ptr = img->planes[plane];
- }
- for (r = 0; r < h; ++r) {
- const int to_read = w;
-
- nbytes = fread(ptr, 1, to_read, f);
- if (nbytes != to_read) {
- res = 0;
- if (nbytes > 0)
- printf("Warning: Read partial frame. Check your width & height!\n");
- break;
- }
- ptr += img->stride[plane];
- }
- if (!res) break;
- }
- return res;
-}
-
-static int create_dummy_frame(vpx_image_t *img) {
- const size_t buf_size = img->w * img->h * 3 / 2;
- memset(img->planes[0], 129, buf_size);
- return 1;
-}
-
-static void write_ivf_file_header(FILE *outfile,
- uint32_t width, uint32_t height,
- int timebase_num, int timebase_den,
- int frame_cnt) {
- char header[32];
-
- header[0] = 'D';
- header[1] = 'K';
- header[2] = 'I';
- header[3] = 'F';
- mem_put_le16(header + 4, 0); /* version */
- mem_put_le16(header + 6, 32); /* headersize */
- mem_put_le32(header + 8, VP90_FOURCC); /* fourcc */
- mem_put_le16(header + 12, width); /* width */
- mem_put_le16(header + 14, height); /* height */
- mem_put_le32(header + 16, timebase_den); /* rate */
- mem_put_le32(header + 20, timebase_num); /* scale */
- mem_put_le32(header + 24, frame_cnt); /* length */
- mem_put_le32(header + 28, 0); /* unused */
-
- (void)fwrite(header, 1, 32, outfile);
-}
-
-static void write_ivf_frame_header(FILE *outfile, vpx_codec_pts_t pts,
- size_t sz) {
- char header[12];
- mem_put_le32(header, (uint32_t)sz);
- mem_put_le32(header + 4, pts & 0xFFFFFFFF);
- mem_put_le32(header + 8, pts >> 32);
-
- (void)fwrite(header, 1, 12, outfile);
-}
-
static void parse_command_line(int argc, const char **argv_,
AppInput *app_input, SvcContext *svc_ctx,
vpx_codec_enc_cfg_t *enc_cfg) {
- struct arg arg;
- char **argv, **argi, **argj;
+ struct arg arg = {0};
+ char **argv = NULL;
+ char **argi = NULL;
+ char **argj = NULL;
vpx_codec_err_t res;
+ int passes = 0;
+ int pass = 0;
+ const char *fpf_file_name = NULL;
// initialize SvcContext with parameters that will be passed to vpx_svc_init
svc_ctx->log_level = SVC_LOG_DEBUG;
svc_ctx->spatial_layers = default_spatial_layers;
svc_ctx->encoding_mode = default_encoding_mode;
- // when using a dummy frame, that frame is only encoded to be full size
- svc_ctx->first_frame_full_size = default_use_dummy_frame;
// start with default encoder configuration
res = vpx_codec_enc_config_default(vpx_codec_vp9_cx(), enc_cfg, 0);
@@ -242,8 +157,6 @@ static void parse_command_line(int argc, const char **argv_,
enc_cfg->g_w = arg_parse_uint(&arg);
} else if (arg_match(&arg, &height_arg, argi)) {
enc_cfg->g_h = arg_parse_uint(&arg);
- } else if (arg_match(&arg, &height_arg, argi)) {
- enc_cfg->g_h = arg_parse_uint(&arg);
} else if (arg_match(&arg, &timebase_arg, argi)) {
enc_cfg->g_timebase = arg_parse_rational(&arg);
} else if (arg_match(&arg, &bitrate_arg, argi)) {
@@ -258,21 +171,63 @@ static void parse_command_line(int argc, const char **argv_,
} else if (arg_match(&arg, &scale_factors_arg, argi)) {
vpx_svc_set_scale_factors(svc_ctx, arg.val);
} else if (arg_match(&arg, &quantizers_arg, argi)) {
- vpx_svc_set_quantizers(svc_ctx, arg.val);
- } else if (arg_match(&arg, &dummy_frame_arg, argi)) {
- svc_ctx->first_frame_full_size = arg_parse_int(&arg);
+ vpx_svc_set_quantizers(svc_ctx, arg.val, 0);
+ } else if (arg_match(&arg, &quantizers_keyframe_arg, argi)) {
+ vpx_svc_set_quantizers(svc_ctx, arg.val, 1);
+ } else if (arg_match(&arg, &passes_arg, argi)) {
+ passes = arg_parse_uint(&arg);
+ if (passes < 1 || passes > 2) {
+ die("Error: Invalid number of passes (%d)\n", passes);
+ }
+ } else if (arg_match(&arg, &pass_arg, argi)) {
+ pass = arg_parse_uint(&arg);
+ if (pass < 1 || pass > 2) {
+ die("Error: Invalid pass selected (%d)\n", pass);
+ }
+ } else if (arg_match(&arg, &fpf_name_arg, argi)) {
+ fpf_file_name = arg.val;
} else {
++argj;
}
}
+ if (passes == 0 || passes == 1) {
+ if (pass) {
+ fprintf(stderr, "pass is ignored since there's only one pass\n");
+ }
+ enc_cfg->g_pass = VPX_RC_ONE_PASS;
+ } else {
+ if (pass == 0) {
+ die("pass must be specified when passes is 2\n");
+ }
+
+ if (fpf_file_name == NULL) {
+ die("fpf must be specified when passes is 2\n");
+ }
+
+ if (pass == 1) {
+ enc_cfg->g_pass = VPX_RC_FIRST_PASS;
+ if (!stats_open_file(&app_input->rc_stats, fpf_file_name, 0)) {
+ fatal("Failed to open statistics store");
+ }
+ } else {
+ enc_cfg->g_pass = VPX_RC_LAST_PASS;
+ if (!stats_open_file(&app_input->rc_stats, fpf_file_name, 1)) {
+ fatal("Failed to open statistics store");
+ }
+ enc_cfg->rc_twopass_stats_in = stats_get(&app_input->rc_stats);
+ }
+ app_input->passes = passes;
+ app_input->pass = pass;
+ }
+
// Check for unrecognized options
for (argi = argv; *argi; ++argi)
if (argi[0][0] == '-' && strlen(argi[0]) > 1)
die("Error: Unrecognized option %s\n", *argi);
if (argv[0] == NULL || argv[1] == 0) {
- usage(argv_[0]);
+ usage_exit();
}
app_input->input_filename = argv[0];
app_input->output_filename = argv[1];
@@ -287,18 +242,18 @@ static void parse_command_line(int argc, const char **argv_,
"mode: %d, layers: %d\n"
"width %d, height: %d,\n"
"num: %d, den: %d, bitrate: %d,\n"
- "gop size: %d, use_dummy_frame: %d\n",
+ "gop size: %d\n",
vpx_codec_iface_name(vpx_codec_vp9_cx()), app_input->frames_to_code,
app_input->frames_to_skip, svc_ctx->encoding_mode,
svc_ctx->spatial_layers, enc_cfg->g_w, enc_cfg->g_h,
enc_cfg->g_timebase.num, enc_cfg->g_timebase.den,
- enc_cfg->rc_target_bitrate, enc_cfg->kf_max_dist,
- svc_ctx->first_frame_full_size);
+ enc_cfg->rc_target_bitrate, enc_cfg->kf_max_dist);
}
int main(int argc, const char **argv) {
AppInput app_input = {0};
- FILE *infile, *outfile;
+ VpxVideoWriter *writer = NULL;
+ VpxVideoInfo info = {0};
vpx_codec_ctx_t codec;
vpx_codec_enc_cfg_t enc_cfg;
SvcContext svc_ctx;
@@ -308,9 +263,12 @@ int main(int argc, const char **argv) {
vpx_codec_err_t res;
int pts = 0; /* PTS starts at 0 */
int frame_duration = 1; /* 1 timebase tick per frame */
+ FILE *infile = NULL;
+ int end_of_stream = 0;
memset(&svc_ctx, 0, sizeof(svc_ctx));
svc_ctx.log_print = 1;
+ exec_name = argv[0];
parse_command_line(argc, argv, &app_input, &svc_ctx, &enc_cfg);
// Allocate image buffer
@@ -320,56 +278,78 @@ int main(int argc, const char **argv) {
if (!(infile = fopen(app_input.input_filename, "rb")))
die("Failed to open %s for reading\n", app_input.input_filename);
- if (!(outfile = fopen(app_input.output_filename, "wb")))
- die("Failed to open %s for writing\n", app_input.output_filename);
-
// Initialize codec
if (vpx_svc_init(&svc_ctx, &codec, vpx_codec_vp9_cx(), &enc_cfg) !=
VPX_CODEC_OK)
die("Failed to initialize encoder\n");
- write_ivf_file_header(outfile, enc_cfg.g_w, enc_cfg.g_h,
- enc_cfg.g_timebase.num, enc_cfg.g_timebase.den, 0);
+ info.codec_fourcc = VP9_FOURCC;
+ info.time_base.numerator = enc_cfg.g_timebase.num;
+ info.time_base.denominator = enc_cfg.g_timebase.den;
+ if (vpx_svc_get_layer_resolution(&svc_ctx, svc_ctx.spatial_layers - 1,
+ (unsigned int *)&info.frame_width,
+ (unsigned int *)&info.frame_height) !=
+ VPX_CODEC_OK) {
+ die("Failed to get output resolution");
+ }
- // skip initial frames
- for (i = 0; i < app_input.frames_to_skip; ++i) {
- read_frame(infile, &raw);
+ if (!(app_input.passes == 2 && app_input.pass == 1)) {
+ // We don't save the bitstream for the 1st pass on two pass rate control
+ writer = vpx_video_writer_open(app_input.output_filename, kContainerIVF,
+ &info);
+ if (!writer)
+ die("Failed to open %s for writing\n", app_input.output_filename);
}
+ // skip initial frames
+ for (i = 0; i < app_input.frames_to_skip; ++i)
+ vpx_img_read(&raw, infile);
+
// Encode frames
- while (frame_cnt <= app_input.frames_to_code) {
- if (frame_cnt == 0 && svc_ctx.first_frame_full_size) {
- create_dummy_frame(&raw);
- } else {
- if (!read_frame(infile, &raw)) break;
+ while (!end_of_stream) {
+ if (frame_cnt >= app_input.frames_to_code || !vpx_img_read(&raw, infile)) {
+ // We need one extra vpx_svc_encode call at end of stream to flush
+ // encoder and get remaining data
+ end_of_stream = 1;
}
- res = vpx_svc_encode(&svc_ctx, &codec, &raw, pts, frame_duration,
- VPX_DL_REALTIME);
+
+ res = vpx_svc_encode(&svc_ctx, &codec, (end_of_stream ? NULL : &raw),
+ pts, frame_duration, VPX_DL_REALTIME);
printf("%s", vpx_svc_get_message(&svc_ctx));
if (res != VPX_CODEC_OK) {
die_codec(&codec, "Failed to encode frame");
}
- if (vpx_svc_get_frame_size(&svc_ctx) > 0) {
- write_ivf_frame_header(outfile, pts, vpx_svc_get_frame_size(&svc_ctx));
- (void)fwrite(vpx_svc_get_buffer(&svc_ctx), 1,
- vpx_svc_get_frame_size(&svc_ctx), outfile);
+ if (!(app_input.passes == 2 && app_input.pass == 1)) {
+ if (vpx_svc_get_frame_size(&svc_ctx) > 0) {
+ vpx_video_writer_write_frame(writer,
+ vpx_svc_get_buffer(&svc_ctx),
+ vpx_svc_get_frame_size(&svc_ctx),
+ pts);
+ }
+ }
+ if (vpx_svc_get_rc_stats_buffer_size(&svc_ctx) > 0) {
+ stats_write(&app_input.rc_stats,
+ vpx_svc_get_rc_stats_buffer(&svc_ctx),
+ vpx_svc_get_rc_stats_buffer_size(&svc_ctx));
+ }
+ if (!end_of_stream) {
+ ++frame_cnt;
+ pts += frame_duration;
}
- ++frame_cnt;
- pts += frame_duration;
}
- printf("Processed %d frames\n", frame_cnt - svc_ctx.first_frame_full_size);
+ printf("Processed %d frames\n", frame_cnt);
fclose(infile);
if (vpx_codec_destroy(&codec)) die_codec(&codec, "Failed to destroy codec");
- // rewrite the output file headers with the actual frame count
- if (!fseek(outfile, 0, SEEK_SET)) {
- write_ivf_file_header(outfile, enc_cfg.g_w, enc_cfg.g_h,
- enc_cfg.g_timebase.num, enc_cfg.g_timebase.den,
- frame_cnt);
+ if (app_input.passes == 2)
+ stats_close(&app_input.rc_stats, 1);
+
+ if (writer) {
+ vpx_video_writer_close(writer);
}
- fclose(outfile);
+
vpx_img_free(&raw);
// display average size, psnr
diff --git a/libvpx/examples/vpx_temporal_scalable_patterns.c b/libvpx/examples/vpx_temporal_scalable_patterns.c
new file mode 100644
index 0000000..b25953f
--- /dev/null
+++ b/libvpx/examples/vpx_temporal_scalable_patterns.c
@@ -0,0 +1,659 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+// This is an example demonstrating how to implement a multi-layer VP9
+// encoding scheme based on temporal scalability for video applications
+// that benefit from a scalable bitstream.
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#define VPX_CODEC_DISABLE_COMPAT 1
+#include "./vpx_config.h"
+#include "vpx_ports/vpx_timer.h"
+#include "vpx/vp8cx.h"
+#include "vpx/vpx_encoder.h"
+
+#include "./tools_common.h"
+#include "./video_writer.h"
+
+static const char *exec_name;
+
+void usage_exit() {
+ exit(EXIT_FAILURE);
+}
+
+static int mode_to_num_layers[12] = {1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3};
+
+// For rate control encoding stats.
+struct RateControlMetrics {
+ // Number of input frames per layer.
+ int layer_input_frames[VPX_TS_MAX_LAYERS];
+ // Total (cumulative) number of encoded frames per layer.
+ int layer_tot_enc_frames[VPX_TS_MAX_LAYERS];
+ // Number of encoded non-key frames per layer.
+ int layer_enc_frames[VPX_TS_MAX_LAYERS];
+ // Framerate per layer layer (cumulative).
+ double layer_framerate[VPX_TS_MAX_LAYERS];
+ // Target average frame size per layer (per-frame-bandwidth per layer).
+ double layer_pfb[VPX_TS_MAX_LAYERS];
+ // Actual average frame size per layer.
+ double layer_avg_frame_size[VPX_TS_MAX_LAYERS];
+ // Average rate mismatch per layer (|target - actual| / target).
+ double layer_avg_rate_mismatch[VPX_TS_MAX_LAYERS];
+ // Actual encoding bitrate per layer (cumulative).
+ double layer_encoding_bitrate[VPX_TS_MAX_LAYERS];
+};
+
+// Note: these rate control metrics assume only 1 key frame in the
+// sequence (i.e., first frame only). So for temporal pattern# 7
+// (which has key frame for every frame on base layer), the metrics
+// computation will be off/wrong.
+// TODO(marpan): Update these metrics to account for multiple key frames
+// in the stream.
+static void set_rate_control_metrics(struct RateControlMetrics *rc,
+ vpx_codec_enc_cfg_t *cfg) {
+ unsigned int i = 0;
+ // Set the layer (cumulative) framerate and the target layer (non-cumulative)
+ // per-frame-bandwidth, for the rate control encoding stats below.
+ const double framerate = cfg->g_timebase.den / cfg->g_timebase.num;
+ rc->layer_framerate[0] = framerate / cfg->ts_rate_decimator[0];
+ rc->layer_pfb[0] = 1000.0 * cfg->ts_target_bitrate[0] /
+ rc->layer_framerate[0];
+ for (i = 0; i < cfg->ts_number_layers; ++i) {
+ if (i > 0) {
+ rc->layer_framerate[i] = framerate / cfg->ts_rate_decimator[i];
+ rc->layer_pfb[i] = 1000.0 *
+ (cfg->ts_target_bitrate[i] - cfg->ts_target_bitrate[i - 1]) /
+ (rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
+ }
+ rc->layer_input_frames[i] = 0;
+ rc->layer_enc_frames[i] = 0;
+ rc->layer_tot_enc_frames[i] = 0;
+ rc->layer_encoding_bitrate[i] = 0.0;
+ rc->layer_avg_frame_size[i] = 0.0;
+ rc->layer_avg_rate_mismatch[i] = 0.0;
+ }
+}
+
+static void printout_rate_control_summary(struct RateControlMetrics *rc,
+ vpx_codec_enc_cfg_t *cfg,
+ int frame_cnt) {
+ unsigned int i = 0;
+ int tot_num_frames = 0;
+ printf("Total number of processed frames: %d\n\n", frame_cnt -1);
+ printf("Rate control layer stats for %d layer(s):\n\n",
+ cfg->ts_number_layers);
+ for (i = 0; i < cfg->ts_number_layers; ++i) {
+ const int num_dropped = (i > 0) ?
+ (rc->layer_input_frames[i] - rc->layer_enc_frames[i]) :
+ (rc->layer_input_frames[i] - rc->layer_enc_frames[i] - 1);
+ tot_num_frames += rc->layer_input_frames[i];
+ rc->layer_encoding_bitrate[i] = 0.001 * rc->layer_framerate[i] *
+ rc->layer_encoding_bitrate[i] / tot_num_frames;
+ rc->layer_avg_frame_size[i] = rc->layer_avg_frame_size[i] /
+ rc->layer_enc_frames[i];
+ rc->layer_avg_rate_mismatch[i] = 100.0 * rc->layer_avg_rate_mismatch[i] /
+ rc->layer_enc_frames[i];
+ printf("For layer#: %d \n", i);
+ printf("Bitrate (target vs actual): %d %f \n", cfg->ts_target_bitrate[i],
+ rc->layer_encoding_bitrate[i]);
+ printf("Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i],
+ rc->layer_avg_frame_size[i]);
+ printf("Average rate_mismatch: %f \n", rc->layer_avg_rate_mismatch[i]);
+ printf("Number of input frames, encoded (non-key) frames, "
+ "and perc dropped frames: %d %d %f \n", rc->layer_input_frames[i],
+ rc->layer_enc_frames[i],
+ 100.0 * num_dropped / rc->layer_input_frames[i]);
+ printf("\n");
+ }
+ if ((frame_cnt - 1) != tot_num_frames)
+ die("Error: Number of input frames not equal to output! \n");
+}
+
+// Temporal scaling parameters:
+// NOTE: The 3 prediction frames cannot be used interchangeably due to
+// differences in the way they are handled throughout the code. The
+// frames should be allocated to layers in the order LAST, GF, ARF.
+// Other combinations work, but may produce slightly inferior results.
+static void set_temporal_layer_pattern(int layering_mode,
+ vpx_codec_enc_cfg_t *cfg,
+ int *layer_flags,
+ int *flag_periodicity) {
+ switch (layering_mode) {
+ case 0: {
+ // 1-layer.
+ int ids[1] = {0};
+ cfg->ts_periodicity = 1;
+ *flag_periodicity = 1;
+ cfg->ts_number_layers = 1;
+ cfg->ts_rate_decimator[0] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // Update L only.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF;
+ break;
+ }
+ case 1: {
+ // 2-layers, 2-frame period.
+ int ids[2] = {0, 1};
+ cfg->ts_periodicity = 2;
+ *flag_periodicity = 2;
+ cfg->ts_number_layers = 2;
+ cfg->ts_rate_decimator[0] = 2;
+ cfg->ts_rate_decimator[1] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+#if 1
+ // 0=L, 1=GF, Intra-layer prediction enabled.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
+ layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_REF_ARF;
+#else
+ // 0=L, 1=GF, Intra-layer prediction disabled.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
+ layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_LAST;
+#endif
+ break;
+ }
+ case 2: {
+ // 2-layers, 3-frame period.
+ int ids[3] = {0, 1, 1};
+ cfg->ts_periodicity = 3;
+ *flag_periodicity = 3;
+ cfg->ts_number_layers = 2;
+ cfg->ts_rate_decimator[0] = 3;
+ cfg->ts_rate_decimator[1] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, Intra-layer prediction enabled.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[1] =
+ layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
+ break;
+ }
+ case 3: {
+ // 3-layers, 6-frame period.
+ int ids[6] = {0, 2, 2, 1, 2, 2};
+ cfg->ts_periodicity = 6;
+ *flag_periodicity = 6;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 6;
+ cfg->ts_rate_decimator[1] = 3;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_UPD_LAST;
+ layer_flags[1] =
+ layer_flags[2] =
+ layer_flags[4] =
+ layer_flags[5] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST;
+ break;
+ }
+ case 4: {
+ // 3-layers, 4-frame period.
+ int ids[4] = {0, 2, 1, 2};
+ cfg->ts_periodicity = 4;
+ *flag_periodicity = 4;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 4;
+ cfg->ts_rate_decimator[1] = 2;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF, Intra-layer prediction disabled.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
+ layer_flags[1] =
+ layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ break;
+ }
+ case 5: {
+ // 3-layers, 4-frame period.
+ int ids[4] = {0, 2, 1, 2};
+ cfg->ts_periodicity = 4;
+ *flag_periodicity = 4;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 4;
+ cfg->ts_rate_decimator[1] = 2;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled in layer 1, disabled
+ // in layer 2.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[2] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[1] =
+ layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ break;
+ }
+ case 6: {
+ // 3-layers, 4-frame period.
+ int ids[4] = {0, 2, 1, 2};
+ cfg->ts_periodicity = 4;
+ *flag_periodicity = 4;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 4;
+ cfg->ts_rate_decimator[1] = 2;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[2] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[1] =
+ layer_flags[3] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
+ break;
+ }
+ case 7: {
+ // NOTE: Probably of academic interest only.
+ // 5-layers, 16-frame period.
+ int ids[16] = {0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4};
+ cfg->ts_periodicity = 16;
+ *flag_periodicity = 16;
+ cfg->ts_number_layers = 5;
+ cfg->ts_rate_decimator[0] = 16;
+ cfg->ts_rate_decimator[1] = 8;
+ cfg->ts_rate_decimator[2] = 4;
+ cfg->ts_rate_decimator[3] = 2;
+ cfg->ts_rate_decimator[4] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ layer_flags[0] = VPX_EFLAG_FORCE_KF;
+ layer_flags[1] =
+ layer_flags[3] =
+ layer_flags[5] =
+ layer_flags[7] =
+ layer_flags[9] =
+ layer_flags[11] =
+ layer_flags[13] =
+ layer_flags[15] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[2] =
+ layer_flags[6] =
+ layer_flags[10] =
+ layer_flags[14] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_GF;
+ layer_flags[4] =
+ layer_flags[12] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[8] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF;
+ break;
+ }
+ case 8: {
+ // 2-layers, with sync point at first frame of layer 1.
+ int ids[2] = {0, 1};
+ cfg->ts_periodicity = 2;
+ *flag_periodicity = 8;
+ cfg->ts_number_layers = 2;
+ cfg->ts_rate_decimator[0] = 2;
+ cfg->ts_rate_decimator[1] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF.
+ // ARF is used as predictor for all frames, and is only updated on
+ // key frame. Sync point every 8 frames.
+
+ // Layer 0: predict from L and ARF, update L and G.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_UPD_ARF;
+ // Layer 1: sync point: predict from L and ARF, and update G.
+ layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ARF;
+ // Layer 0, predict from L and ARF, update L.
+ layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF;
+ // Layer 1: predict from L, G and ARF, and update G.
+ layer_flags[3] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ENTROPY;
+ // Layer 0.
+ layer_flags[4] = layer_flags[2];
+ // Layer 1.
+ layer_flags[5] = layer_flags[3];
+ // Layer 0.
+ layer_flags[6] = layer_flags[4];
+ // Layer 1.
+ layer_flags[7] = layer_flags[5];
+ break;
+ }
+ case 9: {
+ // 3-layers: Sync points for layer 1 and 2 every 8 frames.
+ int ids[4] = {0, 2, 1, 2};
+ cfg->ts_periodicity = 4;
+ *flag_periodicity = 8;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 4;
+ cfg->ts_rate_decimator[1] = 2;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_REF_GF |
+ VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
+ VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
+ layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
+ VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[3] =
+ layer_flags[5] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
+ layer_flags[4] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
+ VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[6] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ARF;
+ layer_flags[7] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_ENTROPY;
+ break;
+ }
+ case 10: {
+ // 3-layers structure where ARF is used as predictor for all frames,
+ // and is only updated on key frame.
+ // Sync points for layer 1 and 2 every 8 frames.
+
+ int ids[4] = {0, 2, 1, 2};
+ cfg->ts_periodicity = 4;
+ *flag_periodicity = 8;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 4;
+ cfg->ts_rate_decimator[1] = 2;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF.
+ // Layer 0: predict from L and ARF; update L and G.
+ layer_flags[0] = VPX_EFLAG_FORCE_KF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_REF_GF;
+ // Layer 2: sync point: predict from L and ARF; update none.
+ layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ENTROPY;
+ // Layer 1: sync point: predict from L and ARF; update G.
+ layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_UPD_LAST;
+ // Layer 2: predict from L, G, ARF; update none.
+ layer_flags[3] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY;
+ // Layer 0: predict from L and ARF; update L.
+ layer_flags[4] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_REF_GF;
+ // Layer 2: predict from L, G, ARF; update none.
+ layer_flags[5] = layer_flags[3];
+ // Layer 1: predict from L, G, ARF; update G.
+ layer_flags[6] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
+ // Layer 2: predict from L, G, ARF; update none.
+ layer_flags[7] = layer_flags[3];
+ break;
+ }
+ case 11:
+ default: {
+ // 3-layers structure as in case 10, but no sync/refresh points for
+ // layer 1 and 2.
+ int ids[4] = {0, 2, 1, 2};
+ cfg->ts_periodicity = 4;
+ *flag_periodicity = 8;
+ cfg->ts_number_layers = 3;
+ cfg->ts_rate_decimator[0] = 4;
+ cfg->ts_rate_decimator[1] = 2;
+ cfg->ts_rate_decimator[2] = 1;
+ memcpy(cfg->ts_layer_id, ids, sizeof(ids));
+ // 0=L, 1=GF, 2=ARF.
+ // Layer 0: predict from L and ARF; update L.
+ layer_flags[0] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_REF_GF;
+ layer_flags[4] = layer_flags[0];
+ // Layer 1: predict from L, G, ARF; update G.
+ layer_flags[2] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
+ layer_flags[6] = layer_flags[2];
+ // Layer 2: predict from L, G, ARF; update none.
+ layer_flags[1] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ENTROPY;
+ layer_flags[3] = layer_flags[1];
+ layer_flags[5] = layer_flags[1];
+ layer_flags[7] = layer_flags[1];
+ break;
+ }
+ }
+}
+
+int main(int argc, char **argv) {
+ VpxVideoWriter *outfile[VPX_TS_MAX_LAYERS];
+ vpx_codec_ctx_t codec;
+ vpx_codec_enc_cfg_t cfg;
+ int frame_cnt = 0;
+ vpx_image_t raw;
+ vpx_codec_err_t res;
+ unsigned int width;
+ unsigned int height;
+ int frame_avail;
+ int got_data;
+ int flags = 0;
+ unsigned int i;
+ int pts = 0; // PTS starts at 0.
+ int frame_duration = 1; // 1 timebase tick per frame.
+ int layering_mode = 0;
+ int layer_flags[VPX_TS_MAX_PERIODICITY] = {0};
+ int flag_periodicity = 1;
+ int max_intra_size_pct;
+ vpx_svc_layer_id_t layer_id = {0, 0};
+ const VpxInterface *encoder = NULL;
+ FILE *infile = NULL;
+ struct RateControlMetrics rc;
+ int64_t cx_time = 0;
+
+ exec_name = argv[0];
+ // Check usage and arguments.
+ if (argc < 11) {
+ die("Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
+ "<rate_num> <rate_den> <frame_drop_threshold> <mode> "
+ "<Rate_0> ... <Rate_nlayers-1> \n", argv[0]);
+ }
+
+ encoder = get_vpx_encoder_by_name(argv[3]);
+ if (!encoder)
+ die("Unsupported codec.");
+
+ printf("Using %s\n", vpx_codec_iface_name(encoder->interface()));
+
+ width = strtol(argv[4], NULL, 0);
+ height = strtol(argv[5], NULL, 0);
+ if (width < 16 || width % 2 || height < 16 || height % 2) {
+ die("Invalid resolution: %d x %d", width, height);
+ }
+
+ layering_mode = strtol(argv[9], NULL, 0);
+ if (layering_mode < 0 || layering_mode > 12) {
+ die("Invalid mode (0..12) %s", argv[9]);
+ }
+
+ if (argc != 10 + mode_to_num_layers[layering_mode]) {
+ die("Invalid number of arguments");
+ }
+
+ if (!vpx_img_alloc(&raw, VPX_IMG_FMT_I420, width, height, 32)) {
+ die("Failed to allocate image", width, height);
+ }
+
+ // Populate encoder configuration.
+ res = vpx_codec_enc_config_default(encoder->interface(), &cfg, 0);
+ if (res) {
+ printf("Failed to get config: %s\n", vpx_codec_err_to_string(res));
+ return EXIT_FAILURE;
+ }
+
+ // Update the default configuration with our settings.
+ cfg.g_w = width;
+ cfg.g_h = height;
+
+ // Timebase format e.g. 30fps: numerator=1, demoninator = 30.
+ cfg.g_timebase.num = strtol(argv[6], NULL, 0);
+ cfg.g_timebase.den = strtol(argv[7], NULL, 0);
+
+ for (i = 10; (int)i < 10 + mode_to_num_layers[layering_mode]; ++i) {
+ cfg.ts_target_bitrate[i - 10] = strtol(argv[i], NULL, 0);
+ }
+
+ // Real time parameters.
+ cfg.rc_dropframe_thresh = strtol(argv[8], NULL, 0);
+ cfg.rc_end_usage = VPX_CBR;
+ cfg.rc_resize_allowed = 0;
+ cfg.rc_min_quantizer = 2;
+ cfg.rc_max_quantizer = 56;
+ cfg.rc_undershoot_pct = 50;
+ cfg.rc_overshoot_pct = 50;
+ cfg.rc_buf_initial_sz = 500;
+ cfg.rc_buf_optimal_sz = 600;
+ cfg.rc_buf_sz = 1000;
+
+ // Enable error resilient mode.
+ cfg.g_error_resilient = 1;
+ cfg.g_lag_in_frames = 0;
+ cfg.kf_mode = VPX_KF_DISABLED;
+
+ // Disable automatic keyframe placement.
+ cfg.kf_min_dist = cfg.kf_max_dist = 3000;
+
+ set_temporal_layer_pattern(layering_mode,
+ &cfg,
+ layer_flags,
+ &flag_periodicity);
+
+ set_rate_control_metrics(&rc, &cfg);
+
+ // Target bandwidth for the whole stream.
+ // Set to ts_target_bitrate for highest layer (total bitrate).
+ cfg.rc_target_bitrate = cfg.ts_target_bitrate[cfg.ts_number_layers - 1];
+
+ // Open input file.
+ if (!(infile = fopen(argv[1], "rb"))) {
+ die("Failed to open %s for reading", argv[1]);
+ }
+
+ // Open an output file for each stream.
+ for (i = 0; i < cfg.ts_number_layers; ++i) {
+ char file_name[PATH_MAX];
+ VpxVideoInfo info;
+ info.codec_fourcc = encoder->fourcc;
+ info.frame_width = cfg.g_w;
+ info.frame_height = cfg.g_h;
+ info.time_base.numerator = cfg.g_timebase.num;
+ info.time_base.denominator = cfg.g_timebase.den;
+
+ snprintf(file_name, sizeof(file_name), "%s_%d.ivf", argv[2], i);
+ outfile[i] = vpx_video_writer_open(file_name, kContainerIVF, &info);
+ if (!outfile[i])
+ die("Failed to open %s for writing", file_name);
+ }
+ // No spatial layers in this encoder.
+ cfg.ss_number_layers = 1;
+
+ // Initialize codec.
+ if (vpx_codec_enc_init(&codec, encoder->interface(), &cfg, 0))
+ die_codec(&codec, "Failed to initialize encoder");
+
+ vpx_codec_control(&codec, VP8E_SET_CPUUSED, -6);
+ vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, 1);
+ if (strncmp(encoder->name, "vp9", 3) == 0) {
+ vpx_codec_control(&codec, VP8E_SET_CPUUSED, 5);
+ vpx_codec_control(&codec, VP9E_SET_AQ_MODE, 3);
+ vpx_codec_control(&codec, VP8E_SET_NOISE_SENSITIVITY, 0);
+ if (vpx_codec_control(&codec, VP9E_SET_SVC, 1)) {
+ die_codec(&codec, "Failed to set SVC");
+ }
+ }
+ vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
+ vpx_codec_control(&codec, VP8E_SET_TOKEN_PARTITIONS, 1);
+ // This controls the maximum target size of the key frame.
+ // For generating smaller key frames, use a smaller max_intra_size_pct
+ // value, like 100 or 200.
+ max_intra_size_pct = (int) (((double)cfg.rc_buf_optimal_sz * 0.5)
+ * ((double) cfg.g_timebase.den / cfg.g_timebase.num) / 10.0);
+ // For low-quality key frame.
+ max_intra_size_pct = 200;
+ vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT, max_intra_size_pct);
+
+ frame_avail = 1;
+ while (frame_avail || got_data) {
+ struct vpx_usec_timer timer;
+ vpx_codec_iter_t iter = NULL;
+ const vpx_codec_cx_pkt_t *pkt;
+ // Update the temporal layer_id. No spatial layers in this test.
+ layer_id.spatial_layer_id = 0;
+ layer_id.temporal_layer_id =
+ cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
+ if (strncmp(encoder->name, "vp9", 3) == 0) {
+ vpx_codec_control(&codec, VP9E_SET_SVC_LAYER_ID, &layer_id);
+ }
+ flags = layer_flags[frame_cnt % flag_periodicity];
+ frame_avail = vpx_img_read(&raw, infile);
+ if (frame_avail)
+ ++rc.layer_input_frames[layer_id.temporal_layer_id];
+ vpx_usec_timer_start(&timer);
+ if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts, 1, flags,
+ VPX_DL_REALTIME)) {
+ die_codec(&codec, "Failed to encode frame");
+ }
+ vpx_usec_timer_mark(&timer);
+ cx_time += vpx_usec_timer_elapsed(&timer);
+ // Reset KF flag.
+ if (layering_mode != 7) {
+ layer_flags[0] &= ~VPX_EFLAG_FORCE_KF;
+ }
+ got_data = 0;
+ while ( (pkt = vpx_codec_get_cx_data(&codec, &iter)) ) {
+ got_data = 1;
+ switch (pkt->kind) {
+ case VPX_CODEC_CX_FRAME_PKT:
+ for (i = cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
+ i < cfg.ts_number_layers; ++i) {
+ vpx_video_writer_write_frame(outfile[i], pkt->data.frame.buf,
+ pkt->data.frame.sz, pts);
+ ++rc.layer_tot_enc_frames[i];
+ rc.layer_encoding_bitrate[i] += 8.0 * pkt->data.frame.sz;
+ // Keep count of rate control stats per layer (for non-key frames).
+ if (i == cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity] &&
+ !(pkt->data.frame.flags & VPX_FRAME_IS_KEY)) {
+ rc.layer_avg_frame_size[i] += 8.0 * pkt->data.frame.sz;
+ rc.layer_avg_rate_mismatch[i] +=
+ fabs(8.0 * pkt->data.frame.sz - rc.layer_pfb[i]) /
+ rc.layer_pfb[i];
+ ++rc.layer_enc_frames[i];
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ ++frame_cnt;
+ pts += frame_duration;
+ }
+ fclose(infile);
+ printout_rate_control_summary(&rc, &cfg, frame_cnt);
+ printf("\n");
+ printf("Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
+ frame_cnt,
+ 1000 * (float)cx_time / (double)(frame_cnt * 1000000),
+ 1000000 * (double)frame_cnt / (double)cx_time);
+
+ if (vpx_codec_destroy(&codec))
+ die_codec(&codec, "Failed to destroy codec");
+
+ // Try to rewrite the output file headers with the actual frame count.
+ for (i = 0; i < cfg.ts_number_layers; ++i)
+ vpx_video_writer_close(outfile[i]);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libvpx/ivfdec.c b/libvpx/ivfdec.c
new file mode 100644
index 0000000..6dcd66f
--- /dev/null
+++ b/libvpx/ivfdec.c
@@ -0,0 +1,112 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vpx_ports/mem_ops.h"
+
+#include "./ivfdec.h"
+
+static const char *IVF_SIGNATURE = "DKIF";
+
+static void fix_framerate(int *num, int *den) {
+ // Some versions of vpxenc used 1/(2*fps) for the timebase, so
+ // we can guess the framerate using only the timebase in this
+ // case. Other files would require reading ahead to guess the
+ // timebase, like we do for webm.
+ if (*num < 1000) {
+ // Correct for the factor of 2 applied to the timebase in the encoder.
+ if (*num & 1)
+ *den *= 2;
+ else
+ *num /= 2;
+ } else {
+ // Don't know FPS for sure, and don't have readahead code
+ // (yet?), so just default to 30fps.
+ *num = 30;
+ *den = 1;
+ }
+}
+
+int file_is_ivf(struct VpxInputContext *input_ctx) {
+ char raw_hdr[32];
+ int is_ivf = 0;
+
+ if (fread(raw_hdr, 1, 32, input_ctx->file) == 32) {
+ if (memcmp(IVF_SIGNATURE, raw_hdr, 4) == 0) {
+ is_ivf = 1;
+
+ if (mem_get_le16(raw_hdr + 4) != 0) {
+ fprintf(stderr, "Error: Unrecognized IVF version! This file may not"
+ " decode properly.");
+ }
+
+ input_ctx->fourcc = mem_get_le32(raw_hdr + 8);
+ input_ctx->width = mem_get_le16(raw_hdr + 12);
+ input_ctx->height = mem_get_le16(raw_hdr + 14);
+ input_ctx->framerate.numerator = mem_get_le32(raw_hdr + 16);
+ input_ctx->framerate.denominator = mem_get_le32(raw_hdr + 20);
+ fix_framerate(&input_ctx->framerate.numerator,
+ &input_ctx->framerate.denominator);
+ }
+ }
+
+ if (!is_ivf) {
+ rewind(input_ctx->file);
+ input_ctx->detect.buf_read = 0;
+ } else {
+ input_ctx->detect.position = 4;
+ }
+ return is_ivf;
+}
+
+int ivf_read_frame(FILE *infile, uint8_t **buffer,
+ size_t *bytes_read, size_t *buffer_size) {
+ char raw_header[IVF_FRAME_HDR_SZ] = {0};
+ size_t frame_size = 0;
+
+ if (fread(raw_header, IVF_FRAME_HDR_SZ, 1, infile) != 1) {
+ if (!feof(infile))
+ warn("Failed to read frame size\n");
+ } else {
+ frame_size = mem_get_le32(raw_header);
+
+ if (frame_size > 256 * 1024 * 1024) {
+ warn("Read invalid frame size (%u)\n", (unsigned int)frame_size);
+ frame_size = 0;
+ }
+
+ if (frame_size > *buffer_size) {
+ uint8_t *new_buffer = realloc(*buffer, 2 * frame_size);
+
+ if (new_buffer) {
+ *buffer = new_buffer;
+ *buffer_size = 2 * frame_size;
+ } else {
+ warn("Failed to allocate compressed data buffer\n");
+ frame_size = 0;
+ }
+ }
+ }
+
+ if (!feof(infile)) {
+ if (fread(*buffer, 1, frame_size, infile) != frame_size) {
+ warn("Failed to read full frame\n");
+ return 1;
+ }
+
+ *bytes_read = frame_size;
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/libvpx/vp9/encoder/vp9_dct.h b/libvpx/ivfdec.h
index aaf976d..dd29cc6 100644
--- a/libvpx/vp9/encoder/vp9_dct.h
+++ b/libvpx/ivfdec.h
@@ -7,18 +7,22 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef IVFDEC_H_
+#define IVFDEC_H_
+#include "./tools_common.h"
-#ifndef VP9_ENCODER_VP9_DCT_H_
-#define VP9_ENCODER_VP9_DCT_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
-void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
- int stride);
+int file_is_ivf(struct VpxInputContext *input);
-void vp9_fht8x8(TX_TYPE tx_type, const int16_t *input, int16_t *output,
- int stride);
+int ivf_read_frame(FILE *infile, uint8_t **buffer,
+ size_t *bytes_read, size_t *buffer_size);
-void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
- int stride);
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
-#endif // VP9_ENCODER_VP9_DCT_H_
+#endif // IVFDEC_H_
diff --git a/libvpx/ivfenc.c b/libvpx/ivfenc.c
new file mode 100644
index 0000000..4a97c42
--- /dev/null
+++ b/libvpx/ivfenc.c
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "./ivfenc.h"
+
+#include "vpx/vpx_encoder.h"
+#include "vpx_ports/mem_ops.h"
+
+void ivf_write_file_header(FILE *outfile,
+ const struct vpx_codec_enc_cfg *cfg,
+ unsigned int fourcc,
+ int frame_cnt) {
+ char header[32];
+
+ header[0] = 'D';
+ header[1] = 'K';
+ header[2] = 'I';
+ header[3] = 'F';
+ mem_put_le16(header + 4, 0); // version
+ mem_put_le16(header + 6, 32); // header size
+ mem_put_le32(header + 8, fourcc); // fourcc
+ mem_put_le16(header + 12, cfg->g_w); // width
+ mem_put_le16(header + 14, cfg->g_h); // height
+ mem_put_le32(header + 16, cfg->g_timebase.den); // rate
+ mem_put_le32(header + 20, cfg->g_timebase.num); // scale
+ mem_put_le32(header + 24, frame_cnt); // length
+ mem_put_le32(header + 28, 0); // unused
+
+ fwrite(header, 1, 32, outfile);
+}
+
+void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size) {
+ char header[12];
+
+ mem_put_le32(header, (int)frame_size);
+ mem_put_le32(header + 4, (int)(pts & 0xFFFFFFFF));
+ mem_put_le32(header + 8, (int)(pts >> 32));
+ fwrite(header, 1, 12, outfile);
+}
+
+void ivf_write_frame_size(FILE *outfile, size_t frame_size) {
+ char header[4];
+
+ mem_put_le32(header, (int)frame_size);
+ fwrite(header, 1, 4, outfile);
+}
diff --git a/libvpx/ivfenc.h b/libvpx/ivfenc.h
new file mode 100644
index 0000000..6623687
--- /dev/null
+++ b/libvpx/ivfenc.h
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef IVFENC_H_
+#define IVFENC_H_
+
+#include "./tools_common.h"
+
+struct vpx_codec_enc_cfg;
+struct vpx_codec_cx_pkt;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void ivf_write_file_header(FILE *outfile,
+ const struct vpx_codec_enc_cfg *cfg,
+ uint32_t fourcc,
+ int frame_cnt);
+
+void ivf_write_frame_header(FILE *outfile, int64_t pts, size_t frame_size);
+
+void ivf_write_frame_size(FILE *outfile, size_t frame_size);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif // IVFENC_H_
diff --git a/libvpx/libs.mk b/libvpx/libs.mk
index 4062833..a5c4b76 100644
--- a/libvpx/libs.mk
+++ b/libvpx/libs.mk
@@ -49,7 +49,7 @@ endif # !gcc
define rtcd_h_template
$$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2)
@echo " [CREATE] $$@"
- $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$$(TGT_ISA) \
+ $$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
--sym=$(1) \
--config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \
$$(RTCD_OPTIONS) $$^ > $$@
@@ -57,13 +57,6 @@ CLEAN-OBJS += $$(BUILD_PFX)$(1).h
RTCD += $$(BUILD_PFX)$(1).h
endef
-# x86inc.asm is not compatible with pic 32bit builds. Restrict
-# files which use it to 64bit builds or 32bit without pic
-USE_X86INC = no
-ifeq ($(CONFIG_USE_X86INC),yes)
- USE_X86INC = yes
-endif
-
CODEC_SRCS-yes += CHANGELOG
CODEC_SRCS-yes += libs.mk
@@ -169,8 +162,10 @@ INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
endif
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
-CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
+CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.pl
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
+CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h
+CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/vpx_once.h
CODEC_SRCS-$(BUILD_LIBVPX) += $(BUILD_PFX)vpx_config.c
INSTALL-SRCS-no += $(BUILD_PFX)vpx_config.c
@@ -182,6 +177,7 @@ CODEC_EXPORTS-$(CONFIG_ENCODERS) += vpx/exports_enc
CODEC_EXPORTS-$(CONFIG_DECODERS) += vpx/exports_dec
INSTALL-LIBS-yes += include/vpx/vpx_codec.h
+INSTALL-LIBS-yes += include/vpx/vpx_frame_buffer.h
INSTALL-LIBS-yes += include/vpx/vpx_image.h
INSTALL-LIBS-yes += include/vpx/vpx_integer.h
INSTALL-LIBS-$(CONFIG_DECODERS) += include/vpx/vpx_decoder.h
@@ -214,8 +210,11 @@ CLEAN-OBJS += libvpx_srcs.txt
ifeq ($(CONFIG_EXTERNAL_BUILD),yes)
ifeq ($(CONFIG_MSVS),yes)
+obj_int_extract.bat: $(SRC_PATH_BARE)/build/$(MSVS_ARCH_DIR)/obj_int_extract.bat
+ @cp $^ $@
+
+obj_int_extract.$(VCPROJ_SFX): obj_int_extract.bat
obj_int_extract.$(VCPROJ_SFX): $(SRC_PATH_BARE)/build/make/obj_int_extract.c
- @cp $(SRC_PATH_BARE)/build/$(MSVS_ARCH_DIR)/obj_int_extract.bat .
@echo " [CREATE] $@"
$(qexec)$(GEN_VCPROJ) \
--exe \
@@ -237,6 +236,13 @@ vpx.def: $(call enabled,CODEC_EXPORTS)
--out=$@ $^
CLEAN-OBJS += vpx.def
+# Assembly files that are included, but don't define symbols themselves.
+# Filtered out to avoid Visual Studio build warnings.
+ASM_INCLUDES := \
+ third_party/x86inc/x86inc.asm \
+ vpx_config.asm \
+ vpx_ports/x86_abi_support.asm \
+
vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def obj_int_extract.$(VCPROJ_SFX)
@echo " [CREATE] $@"
$(qexec)$(GEN_VCPROJ) \
@@ -247,7 +253,8 @@ vpx.$(VCPROJ_SFX): $(CODEC_SRCS) vpx.def obj_int_extract.$(VCPROJ_SFX)
--proj-guid=DCE19DAF-69AC-46DB-B14A-39F0FAA5DB74 \
--module-def=vpx.def \
--ver=$(CONFIG_VS_VERSION) \
- --out=$@ $(CFLAGS) $^ \
+ --out=$@ $(CFLAGS) \
+ $(filter-out $(addprefix %, $(ASM_INCLUDES)), $^) \
--src-path-bare="$(SRC_PATH_BARE)" \
PROJECTS-$(BUILD_LIBVPX) += vpx.$(VCPROJ_SFX)
@@ -470,11 +477,6 @@ $(LIBVPX_TEST_OBJS) $(LIBVPX_TEST_OBJS:.o=.d): CXXFLAGS += -I$(SRC_PATH_BARE)/th
OBJS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_OBJS)
BINS-$(BUILD_LIBVPX) += $(LIBVPX_TEST_BINS)
-# Install test sources only if codec source is included
-INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
- $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
-INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
-
CODEC_LIB=$(if $(CONFIG_DEBUG_LIBS),vpx_g,vpx)
CODEC_LIB_SUF=$(if $(CONFIG_SHARED),.so,.a)
$(foreach bin,$(LIBVPX_TEST_BINS),\
@@ -488,6 +490,11 @@ $(foreach bin,$(LIBVPX_TEST_BINS),\
endif
+# Install test sources only if codec source is included
+INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(patsubst $(SRC_PATH_BARE)/%,%,\
+ $(shell find $(SRC_PATH_BARE)/third_party/googletest -type f))
+INSTALL-SRCS-$(CONFIG_CODEC_SRCS) += $(LIBVPX_TEST_SRCS)
+
define test_shard_template
test:: test_shard.$(1)
test_shard.$(1): $(LIBVPX_TEST_BINS) testdata
diff --git a/libvpx/md5_utils.h b/libvpx/md5_utils.h
index 81792c4..bd4991b 100644
--- a/libvpx/md5_utils.h
+++ b/libvpx/md5_utils.h
@@ -20,8 +20,12 @@
* Still in the public domain.
*/
-#ifndef MD5_H
-#define MD5_H
+#ifndef MD5_UTILS_H_
+#define MD5_UTILS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define md5byte unsigned char
#define UWORD32 unsigned int
@@ -38,4 +42,8 @@ void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
-#endif /* !MD5_H */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // MD5_UTILS_H_
diff --git a/libvpx/nestegg/.gitignore b/libvpx/nestegg/.gitignore
deleted file mode 100644
index b2ba99c..0000000
--- a/libvpx/nestegg/.gitignore
+++ /dev/null
@@ -1,40 +0,0 @@
-*.lo
-*.o
-*.swp
-*~
-.deps
-.dirstamp
-.libs
-Makefile
-Makefile.in
-_stdint.h
-aclocal.m4
-autom4te.cache
-compile
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-depcomp
-docs/Doxyfile
-docs/doxygen-build.stamp
-docs/html
-install-sh
-libtool
-ltmain.sh
-m4/libtool.m4
-m4/ltoptions.m4
-m4/ltsugar.m4
-m4/ltversion.m4
-m4/lt~obsolete.m4
-missing
-nestegg-uninstalled.pc
-nestegg.pc
-src/.dirstamp
-src/libnestegg.la
-stamp-h1
-test/test
-include/nestegg/nestegg-stdint.h
diff --git a/libvpx/nestegg/AUTHORS b/libvpx/nestegg/AUTHORS
deleted file mode 100644
index 8204f40..0000000
--- a/libvpx/nestegg/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Matthew Gregan <kinetik@flim.org>
diff --git a/libvpx/nestegg/Makefile.am b/libvpx/nestegg/Makefile.am
deleted file mode 100644
index 5006991..0000000
--- a/libvpx/nestegg/Makefile.am
+++ /dev/null
@@ -1,51 +0,0 @@
-AUTOMAKE_OPTIONS = foreign 1.11 no-dist-gzip dist-bzip2 subdir-objects
-ACLOCAL_AMFLAGS = -I m4
-
-INCLUDES = -I$(top_srcdir)/include -I. -I$(top_srcdir)/halloc
-AM_CFLAGS = -ansi -pedantic -Wall -Wextra -Wno-long-long -O0 -g
-
-SUBDIRS = docs
-
-EXTRA_DIST = \
- AUTHORS README LICENSE \
- nestegg-uninstalled.pc.in \
- m4/as-ac-expand.m4 \
- m4/pkg.m4 \
- m4/ax_create_stdint_h.m4 \
- halloc/src/halloc.c \
- halloc/halloc.h \
- halloc/src/align.h \
- halloc/src/hlist.h \
- halloc/src/macros.h
-
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = nestegg.pc
-
-nesteggincludedir = $(includedir)/nestegg
-nestegginclude_HEADERS = include/nestegg/nestegg.h include/nestegg/nestegg-stdint.h
-
-lib_LTLIBRARIES = src/libnestegg.la
-
-src_libnestegg_la_SOURCES = \
- src/nestegg.c \
- halloc/src/halloc.c \
- halloc/halloc.h \
- halloc/src/align.h \
- halloc/src/hlist.h \
- halloc/src/macros.h
-
-check_PROGRAMS = test/test
-
-test_test_SOURCES = test/test.c
-test_test_LDADD = src/libnestegg.la
-
-DISTCLEANFILES = include/nestegg/nestegg-stdint.h
-
-dist-hook:
- find $(distdir) -type d -name '.git' | xargs rm -rf
-
-debug:
- $(MAKE) all CFLAGS="@DEBUG@"
-
-profile:
- $(MAKE) all CFLAGS="@PROFILE@"
diff --git a/libvpx/nestegg/configure.ac b/libvpx/nestegg/configure.ac
deleted file mode 100644
index 70f6e0d..0000000
--- a/libvpx/nestegg/configure.ac
+++ /dev/null
@@ -1,124 +0,0 @@
-dnl ------------------------------------------------
-dnl Initialization and Versioning
-dnl ------------------------------------------------
-
-AC_INIT(libnestegg,[0.1git])
-
-AC_CANONICAL_HOST
-AC_CANONICAL_TARGET
-
-AC_CONFIG_MACRO_DIR([m4])
-
-AM_CONFIG_HEADER([config.h])
-AC_CONFIG_SRCDIR([src/nestegg.c])
-AM_INIT_AUTOMAKE
-
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
-
-dnl Library versioning
-dnl CURRENT, REVISION, AGE
-dnl - library source changed -> increment REVISION
-dnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
-dnl - interfaces added -> increment AGE
-dnl - interfaces removed -> AGE = 0
-
-NESTEGG_CURRENT=0
-NESTEGG_REVISION=0
-NESTEGG_AGE=1
-AC_SUBST(NESTEGG_CURRENT)
-AC_SUBST(NESTEGG_REVISION)
-AC_SUBST(NESTEGG_AGE)
-
-
-dnl --------------------------------------------------
-dnl Check for programs
-dnl --------------------------------------------------
-
-dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
-dnl if $CFLAGS is blank
-cflags_save="$CFLAGS"
-AC_PROG_CC
-AC_PROG_CPP
-CFLAGS="$cflags_save"
-
-AM_PROG_CC_C_O
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-
-dnl Check for doxygen
-AC_ARG_ENABLE([doc],
- AS_HELP_STRING([--enable-doc], [Build API documentation]),
- [ac_enable_doc=$enableval], [ac_enable_doc=auto])
-
-if test "x$ac_enable_doc" != "xno"; then
- AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, true, false)
-
- if test "x$HAVE_DOXYGEN" = "xfalse" -a "x$ac_enable_doc" = "xyes"; then
- AC_MSG_ERROR([*** API documentation explicitly requested but Doxygen not found])
- fi
-else
- HAVE_DOXYGEN=false
-fi
-AM_CONDITIONAL(HAVE_DOXYGEN,$HAVE_DOXYGEN)
-if test $HAVE_DOXYGEN = "false"; then
- AC_MSG_WARN([*** doxygen not found, API documentation will not be built])
-fi
-
-# Generate portable stdint.h replacement
-AX_CREATE_STDINT_H(include/nestegg/nestegg-stdint.h)
-
-# Test whenever ld supports -version-script
-AC_PROG_LD
-AC_PROG_LD_GNU
-AC_MSG_CHECKING([how to control symbol export])
-
-dnl --------------------------------------------------
-dnl Do substitutions
-dnl --------------------------------------------------
-
-AC_SUBST(DEBUG)
-AC_SUBST(PROFILE)
-
-AC_OUTPUT([
- Makefile
- docs/Makefile
- docs/Doxyfile
- nestegg.pc
- nestegg-uninstalled.pc
-])
-
-AS_AC_EXPAND(LIBDIR, ${libdir})
-AS_AC_EXPAND(INCLUDEDIR, ${includedir})
-AS_AC_EXPAND(BINDIR, ${bindir})
-AS_AC_EXPAND(DOCDIR, ${docdir})
-
-if test $HAVE_DOXYGEN = "false"; then
- doc_build="no"
-else
- doc_build="yes"
-fi
-
-AC_MSG_RESULT([
-------------------------------------------------------------------------
- $PACKAGE $VERSION: Automatic configuration OK.
-
- General configuration:
-
- API Documentation: .......... ${doc_build}
-
- Installation paths:
-
- libnestegg: .................. ${LIBDIR}
- C header files: .............. ${INCLUDEDIR}/nestegg
- Documentation: ............... ${DOCDIR}
-
- Building:
-
- Type 'make' to compile $PACKAGE.
-
- Type 'make install' to install $PACKAGE.
-
- Example programs will be built but not installed.
-------------------------------------------------------------------------
-])
-
diff --git a/libvpx/nestegg/docs/Doxyfile.in b/libvpx/nestegg/docs/Doxyfile.in
deleted file mode 100644
index e0e9249..0000000
--- a/libvpx/nestegg/docs/Doxyfile.in
+++ /dev/null
@@ -1,1551 +0,0 @@
-# Doxyfile 1.6.2
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project
-#
-# All text after a hash (#) is considered a comment and will be ignored
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ")
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
-# by quotes) that should identify the project.
-
-PROJECT_NAME = @PACKAGE@
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = @VERSION@
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = .
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful is your file systems
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = YES
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = YES
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it parses.
-# With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this tag.
-# The format is ext=language, where ext is a file extension, and language is one of
-# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
-# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
-# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
-# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen to replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
-# determine which symbols to keep in memory and which to flush to disk.
-# When the cache is full, less often used symbols will be written to disk.
-# For small to medium size projects (<1000 input files) the default value is
-# probably good enough. For larger projects a too small cache size can cause
-# doxygen to be busy swapping symbols to and from disk most of the time
-# causing a significant performance penality.
-# If the system has enough physical memory increasing the cache will improve the
-# performance by keeping more symbols in memory. Note that the value works on
-# a logarithmic scale so increasing the size by one will rougly double the
-# memory usage. The cache size is given by this formula:
-# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols
-
-SYMBOL_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespace are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = NO
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or define consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and defines in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# If the sources in your project are distributed over multiple directories
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
-# in the documentation. The default is NO.
-
-SHOW_DIRECTORIES = NO
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
-# doxygen. The layout file controls the global structure of the generated output files
-# in an output format independent way. The create the layout file that represents
-# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
-# file name after the option, if omitted DoxygenLayout.xml will be used as the name
-# of the layout file.
-
-LAYOUT_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = YES
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be abled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = YES
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = @top_srcdir@/include/nestegg
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
-# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
-
-FILE_PATTERNS =
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = NO
-
-# The EXCLUDE tag can be used to specify files and/or directories that should
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-
-EXCLUDE =
-
-# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
-# directories that are symbolic links (a Unix filesystem feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
-# is applied to all files.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = NO
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header.
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# stylesheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = NO
-
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
-# files or namespaces will be aligned in HTML using tables. If set to
-# NO a bullet list will be used.
-
-HTML_ALIGN_MEMBERS = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
-# are set, an additional index file will be generated that can be used as input for
-# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
-# HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
-# For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
-# top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it.
-
-DISABLE_INDEX = NO
-
-# This tag can be used to set the number of enum values (range [1..20])
-# that doxygen will group on one line in the generated HTML documentation.
-
-ENUM_VALUES_PER_LINE = 4
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-
-GENERATE_TREEVIEW = NO
-
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
-# and Class Hierarchy pages using a tree view instead of an ordered list.
-
-USE_INLINE_TREES = NO
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, a4wide, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4wide
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# The XML_DTD tag can be used to specify an XML DTD,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_DTD =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# in the INCLUDE_PATH (see below) will be search if a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED =
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all function-like macros that are alone
-# on a line, have an all uppercase name, and do not end with a semicolon. Such
-# function macros are typically used for boiler-plate code, and will confuse
-# the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option is superseded by the HAVE_DOT option below. This is only a
-# fallback. It is recommended to install and use dot, since it yields more
-# powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# By default doxygen will write a font called FreeSans.ttf to the output
-# directory and reference it in all dot files that doxygen generates. This
-# font does not include all possible unicode characters however, so when you need
-# these (or just want a differently looking font) you can specify the font name
-# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
-# which can be done by putting it in a standard location or by setting the
-# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
-# containing the font.
-
-DOT_FONTNAME = FreeSans
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the output directory to look for the
-# FreeSans.ttf font (which doxygen will put there itself). If you specify a
-# different font using DOT_FONTNAME you can set the path where dot
-# can find it using this tag.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# the CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are png, jpg, or gif
-# If left blank png will be used.
-
-DOT_IMAGE_FORMAT = png
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/libvpx/nestegg/docs/Makefile.am b/libvpx/nestegg/docs/Makefile.am
deleted file mode 100644
index 42cf8ee..0000000
--- a/libvpx/nestegg/docs/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-doc_DATA = doxygen-build.stamp
-
-EXTRA_DIST = Doxyfile.in
-
-if HAVE_DOXYGEN
-doxygen-build.stamp: Doxyfile
- doxygen
- touch doxygen-build.stamp
-else
-doxygen-build.stamp:
- echo "*** Warning: Doxygen not found; documentation will not be built."
- touch doxygen-build.stamp
-endif
-
-dist_docdir = $(distdir)/libnestegg
-
-dist-hook:
- if test -d html; then \
- mkdir $(dist_docdir); \
- echo -n "copying built documenation..."; \
- cp -rp html $(dist_docdir)/html; \
- echo "OK"; \
- fi
-
-
-install-data-local: doxygen-build.stamp
- $(mkinstalldirs) $(DESTDIR)$(docdir)
- if test -d html; then \
- cp -rp html $(DESTDIR)$(docdir)/html; \
- fi
-
-uninstall-local:
- rm -rf $(DESTDIR)$(docdir)
-
-clean-local:
- if test -d html; then rm -rf html; fi
- if test -f doxygen-build.stamp; then rm -f doxygen-build.stamp; fi
-
diff --git a/libvpx/nestegg/m4/as-ac-expand.m4 b/libvpx/nestegg/m4/as-ac-expand.m4
deleted file mode 100644
index d6c9e33..0000000
--- a/libvpx/nestegg/m4/as-ac-expand.m4
+++ /dev/null
@@ -1,43 +0,0 @@
-dnl as-ac-expand.m4 0.2.0
-dnl autostars m4 macro for expanding directories using configure's prefix
-dnl thomas@apestaart.org
-
-dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
-dnl example
-dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
-dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
-
-AC_DEFUN([AS_AC_EXPAND],
-[
- EXP_VAR=[$1]
- FROM_VAR=[$2]
-
- dnl first expand prefix and exec_prefix if necessary
- prefix_save=$prefix
- exec_prefix_save=$exec_prefix
-
- dnl if no prefix given, then use /usr/local, the default prefix
- if test "x$prefix" = "xNONE"; then
- prefix="$ac_default_prefix"
- fi
- dnl if no exec_prefix given, then use prefix
- if test "x$exec_prefix" = "xNONE"; then
- exec_prefix=$prefix
- fi
-
- full_var="$FROM_VAR"
- dnl loop until it doesn't change anymore
- while true; do
- new_full_var="`eval echo $full_var`"
- if test "x$new_full_var" = "x$full_var"; then break; fi
- full_var=$new_full_var
- done
-
- dnl clean up
- full_var=$new_full_var
- AC_SUBST([$1], "$full_var")
-
- dnl restore prefix and exec_prefix
- prefix=$prefix_save
- exec_prefix=$exec_prefix_save
-])
diff --git a/libvpx/nestegg/m4/ax_create_stdint_h.m4 b/libvpx/nestegg/m4/ax_create_stdint_h.m4
deleted file mode 100644
index 228105b..0000000
--- a/libvpx/nestegg/m4/ax_create_stdint_h.m4
+++ /dev/null
@@ -1,695 +0,0 @@
-dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
-dnl
-dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
-dnl existence of an include file <stdint.h> that defines a set of
-dnl typedefs, especially uint8_t,int32_t,uintptr_t. Many older
-dnl installations will not provide this file, but some will have the
-dnl very same definitions in <inttypes.h>. In other enviroments we can
-dnl use the inet-types in <sys/types.h> which would define the typedefs
-dnl int8_t and u_int8_t respectivly.
-dnl
-dnl This macros will create a local "_stdint.h" or the headerfile given
-dnl as an argument. In many cases that file will just "#include
-dnl <stdint.h>" or "#include <inttypes.h>", while in other environments
-dnl it will provide the set of basic 'stdint's definitions/typedefs:
-dnl
-dnl int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
-dnl int_least32_t.. int_fast32_t.. intmax_t
-dnl
-dnl which may or may not rely on the definitions of other files, or
-dnl using the AC_CHECK_SIZEOF macro to determine the actual sizeof each
-dnl type.
-dnl
-dnl if your header files require the stdint-types you will want to
-dnl create an installable file mylib-int.h that all your other
-dnl installable header may include. So if you have a library package
-dnl named "mylib", just use
-dnl
-dnl AX_CREATE_STDINT_H(mylib-int.h)
-dnl
-dnl in configure.ac and go to install that very header file in
-dnl Makefile.am along with the other headers (mylib.h) - and the
-dnl mylib-specific headers can simply use "#include <mylib-int.h>" to
-dnl obtain the stdint-types.
-dnl
-dnl Remember, if the system already had a valid <stdint.h>, the
-dnl generated file will include it directly. No need for fuzzy
-dnl HAVE_STDINT_H things... (oops, GCC 4.2.x has deliberatly disabled
-dnl its stdint.h for non-c99 compilation and the c99-mode is not the
-dnl default. Therefore this macro will not use the compiler's stdint.h
-dnl - please complain to the GCC developers).
-dnl
-dnl @category C
-dnl @author Guido U. Draheim <guidod@gmx.de>
-dnl @version 2006-10-13
-dnl @license GPLWithACException
-
-AC_DEFUN([AX_CHECK_DATA_MODEL],[
- AC_CHECK_SIZEOF(char)
- AC_CHECK_SIZEOF(short)
- AC_CHECK_SIZEOF(int)
- AC_CHECK_SIZEOF(long)
- AC_CHECK_SIZEOF(void*)
- ac_cv_char_data_model=""
- ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
- ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
- ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
- ac_cv_long_data_model=""
- ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
- ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
- ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
- AC_MSG_CHECKING([data model])
- case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
- 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;;
- 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;;
- 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;;
- 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
- 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;;
- 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
- 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;;
- 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
- 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;;
- 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
- 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
- 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
- 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
- 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
- 222/*|333/*|444/*|666/*|888/*) :
- ac_cv_data_model="iDSP" ; n="unusual dsptype" ;;
- *) ac_cv_data_model="none" ; n="very unusual model" ;;
- esac
- AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
-])
-
-dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
-AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
-AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
- ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
- AC_MSG_RESULT([(..)])
- for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h])
- do
- unset ac_cv_type_uintptr_t
- unset ac_cv_type_uint64_t
- AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
- AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
- m4_ifvaln([$1],[$1]) break
- done
- AC_MSG_CHECKING([for stdint uintptr_t])
- ])
-])
-
-AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
-AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
- ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
- AC_MSG_RESULT([(..)])
- for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h])
- do
- unset ac_cv_type_uint32_t
- unset ac_cv_type_uint64_t
- AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
- AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
- m4_ifvaln([$1],[$1]) break
- break;
- done
- AC_MSG_CHECKING([for stdint uint32_t])
- ])
-])
-
-AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
-AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
- ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
- AC_MSG_RESULT([(..)])
- for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
- unset ac_cv_type_u_int32_t
- unset ac_cv_type_u_int64_t
- AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
- AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
- m4_ifvaln([$1],[$1]) break
- break;
- done
- AC_MSG_CHECKING([for stdint u_int32_t])
- ])
-])
-
-AC_DEFUN([AX_CREATE_STDINT_H],
-[# ------ AX CREATE STDINT H -------------------------------------
-AC_MSG_CHECKING([for stdint types])
-ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
-# try to shortcircuit - if the default include path of the compiler
-# can find a "stdint.h" header then we assume that all compilers can.
-AC_CACHE_VAL([ac_cv_header_stdint_t],[
-old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
-old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
-old_CFLAGS="$CFLAGS" ; CFLAGS=""
-AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
-[ac_cv_stdint_result="(assuming C99 compatible system)"
- ac_cv_header_stdint_t="stdint.h"; ],
-[ac_cv_header_stdint_t=""])
-if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then
-CFLAGS="-std=c99"
-AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
-[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)])
-fi
-CXXFLAGS="$old_CXXFLAGS"
-CPPFLAGS="$old_CPPFLAGS"
-CFLAGS="$old_CFLAGS" ])
-
-v="... $ac_cv_header_stdint_h"
-if test "$ac_stdint_h" = "stdint.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
-elif test "_$ac_cv_header_stdint_t" = "_" ; then
- AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
-else
- ac_cv_header_stdint="$ac_cv_header_stdint_t"
- AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
-fi
-
-if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
-
-dnl .....intro message done, now do a few system checks.....
-dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type,
-dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW
-dnl instead that is triggered with 3 or more arguments (see types.m4)
-
-inttype_headers=`echo $2 | sed -e 's/,/ /g'`
-
-ac_cv_stdint_result="(no helpful system typedefs seen)"
-AX_CHECK_HEADER_STDINT_X(dnl
- stdint.h inttypes.h sys/inttypes.h $inttype_headers,
- ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
-
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-AX_CHECK_HEADER_STDINT_O(dnl,
- inttypes.h sys/inttypes.h stdint.h $inttype_headers,
- ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
-fi
-
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-if test "_$ac_cv_header_stdint_o" = "_" ; then
-AX_CHECK_HEADER_STDINT_U(dnl,
- sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
- ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
-fi fi
-
-dnl if there was no good C99 header file, do some typedef checks...
-if test "_$ac_cv_header_stdint_x" = "_" ; then
- AC_MSG_CHECKING([for stdint datatype model])
- AC_MSG_RESULT([(..)])
- AX_CHECK_DATA_MODEL
-fi
-
-if test "_$ac_cv_header_stdint_x" != "_" ; then
- ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif test "_$ac_cv_header_stdint_o" != "_" ; then
- ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif test "_$ac_cv_header_stdint_u" != "_" ; then
- ac_cv_header_stdint="$ac_cv_header_stdint_u"
-else
- ac_cv_header_stdint="stddef.h"
-fi
-
-AC_MSG_CHECKING([for extra inttypes in chosen header])
-AC_MSG_RESULT([($ac_cv_header_stdint)])
-dnl see if int_least and int_fast types are present in _this_ header.
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
-AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
-AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
-
-fi # shortcircut to system "stdint.h"
-# ------------------ PREPARE VARIABLES ------------------------------
-if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
-else
-ac_cv_stdint_message="using $CC"
-fi
-
-AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
-$ac_cv_stdint_result])
-
-dnl -----------------------------------------------------------------
-# ----------------- DONE inttypes.h checks START header -------------
-AC_CONFIG_COMMANDS([$ac_stdint_h],[
-AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
-ac_stdint=$tmp/_stdint.h
-
-echo "#ifndef" $_ac_stdint_h >$ac_stdint
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
-echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_t" != "_" ; then
-echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
-echo "#include <stdint.h>" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-else
-
-cat >>$ac_stdint <<STDINT_EOF
-
-/* ................... shortcircuit part ........................... */
-
-#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <stddef.h>
-
-/* .................... configured part ............................ */
-
-STDINT_EOF
-
-echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_x" != "_" ; then
- ac_header="$ac_cv_header_stdint_x"
- echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
-else
- echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
-fi
-
-echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_o" != "_" ; then
- ac_header="$ac_cv_header_stdint_o"
- echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
-else
- echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
-fi
-
-echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_u" != "_" ; then
- ac_header="$ac_cv_header_stdint_u"
- echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
-else
- echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
-fi
-
-echo "" >>$ac_stdint
-
-if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
- echo "#include <$ac_header>" >>$ac_stdint
- echo "" >>$ac_stdint
-fi fi
-
-echo "/* which 64bit typedef has been found */" >>$ac_stdint
-if test "$ac_cv_type_uint64_t" = "yes" ; then
-echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
-fi
-if test "$ac_cv_type_u_int64_t" = "yes" ; then
-echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-echo "/* which type model has been detected */" >>$ac_stdint
-if test "_$ac_cv_char_data_model" != "_" ; then
-echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
-echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
-else
-echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
-echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
-echo "/* whether int_least types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_least32_t" = "yes"; then
-echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
-fi
-echo "/* whether int_fast types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_fast32_t" = "yes"; then
-echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
-fi
-echo "/* whether intmax_t type was detected */" >>$ac_stdint
-if test "$ac_cv_type_intmax_t" = "yes"; then
-echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
-
- cat >>$ac_stdint <<STDINT_EOF
-/* .................... detections part ............................ */
-
-/* whether we need to define bitspecific types from compiler base types */
-#ifndef _STDINT_HEADER_INTPTR
-#ifndef _STDINT_HEADER_UINT32
-#ifndef _STDINT_HEADER_U_INT32
-#define _STDINT_NEED_INT_MODEL_T
-#else
-#define _STDINT_HAVE_U_INT_TYPES
-#endif
-#endif
-#endif
-
-#ifdef _STDINT_HAVE_U_INT_TYPES
-#undef _STDINT_NEED_INT_MODEL_T
-#endif
-
-#ifdef _STDINT_CHAR_MODEL
-#if _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
-#ifndef _STDINT_BYTE_MODEL
-#define _STDINT_BYTE_MODEL 12
-#endif
-#endif
-#endif
-
-#ifndef _STDINT_HAVE_INT_LEAST32_T
-#define _STDINT_NEED_INT_LEAST_T
-#endif
-
-#ifndef _STDINT_HAVE_INT_FAST32_T
-#define _STDINT_NEED_INT_FAST_T
-#endif
-
-#ifndef _STDINT_HEADER_INTPTR
-#define _STDINT_NEED_INTPTR_T
-#ifndef _STDINT_HAVE_INTMAX_T
-#define _STDINT_NEED_INTMAX_T
-#endif
-#endif
-
-
-/* .................... definition part ............................ */
-
-/* some system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#if defined _STDINT_HAVE_UINT64_T || defined HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#elif defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-#endif
-
-#ifndef _HAVE_UINT64_T
-/* .. here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-/* note: all ELF-systems seem to have loff-support which needs 64-bit */
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
-
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-#if !defined _NO_LONGLONG
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
- /* compiler/cpu type to define int64_t */
-#endif
-#endif
-#endif
-
-#if defined _STDINT_HAVE_U_INT_TYPES
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
-
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
-/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
-/* (btw, those nibble-addressable systems are way off, or so we assume) */
-
-dnl /* have a look at "64bit and data size neutrality" at */
-dnl /* http://unix.org/version2/whatsnew/login_64bit.html */
-dnl /* (the shorthand "ILP" types always have a "P" part) */
-
-#if defined _STDINT_BYTE_MODEL
-#if _STDINT_LONG_MODEL+0 == 242
-/* 2:4:2 = IP16 = a normal 16-bit system */
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned long uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef char int8_t;
-typedef short int16_t;
-typedef long int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
-/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */
-/* 4:4:4 = ILP32 = a normal 32-bit system */
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
-/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */
-/* 4:8:8 = LP64 = a normal 64-bit system */
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-#endif
-/* this system has a "long" of 64bit */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef unsigned long uint64_t;
-typedef long int64_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 448
-/* LLP64 a 64-bit system derived from a 32-bit system */
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef char int8_t;
-typedef short int16_t;
-typedef int int32_t;
-#endif
-/* assuming the system has a "long long" */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef unsigned long long uint64_t;
-typedef long long int64_t;
-#endif
-#else
-#define _STDINT_NO_INT32_T
-#endif
-#else
-#define _STDINT_NO_INT8_T
-#define _STDINT_NO_INT32_T
-#endif
-#endif
-
-/*
- * quote from SunOS-5.8 sys/inttypes.h:
- * Use at your own risk. As of February 1996, the committee is squarely
- * behind the fixed sized types; the "least" and "fast" types are still being
- * discussed. The probability that the "fast" types may be removed before
- * the standard is finalized is high enough that they are not currently
- * implemented.
- */
-
-#if defined _STDINT_NEED_INT_LEAST_T
-typedef int8_t int_least8_t;
-typedef int16_t int_least16_t;
-typedef int32_t int_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef int64_t int_least64_t;
-#endif
-
-typedef uint8_t uint_least8_t;
-typedef uint16_t uint_least16_t;
-typedef uint32_t uint_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t uint_least64_t;
-#endif
- /* least types */
-#endif
-
-#if defined _STDINT_NEED_INT_FAST_T
-typedef int8_t int_fast8_t;
-typedef int int_fast16_t;
-typedef int32_t int_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef int64_t int_fast64_t;
-#endif
-
-typedef uint8_t uint_fast8_t;
-typedef unsigned uint_fast16_t;
-typedef uint32_t uint_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t uint_fast64_t;
-#endif
- /* fast types */
-#endif
-
-#ifdef _STDINT_NEED_INTMAX_T
-#ifdef _HAVE_UINT64_T
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
-#else
-typedef long intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-#endif
-
-#ifdef _STDINT_NEED_INTPTR_T
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-/* we encourage using "long" to store pointer values, never use "int" ! */
-#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
-typedef unsigned int uintptr_t;
-typedef int intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
-typedef unsigned long uintptr_t;
-typedef long intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
-typedef uint64_t uintptr_t;
-typedef int64_t intptr_t;
-#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
-typedef unsigned long uintptr_t;
-typedef long intptr_t;
-#endif
-#endif
-#endif
-
-/* The ISO C99 standard specifies that in C++ implementations these
- should only be defined if explicitly requested. */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-#ifndef UINT32_C
-
-/* Signed. */
-# define INT8_C(c) c
-# define INT16_C(c) c
-# define INT32_C(c) c
-# ifdef _HAVE_LONGLONG_UINT64_T
-# define INT64_C(c) c ## L
-# else
-# define INT64_C(c) c ## LL
-# endif
-
-/* Unsigned. */
-# define UINT8_C(c) c ## U
-# define UINT16_C(c) c ## U
-# define UINT32_C(c) c ## U
-# ifdef _HAVE_LONGLONG_UINT64_T
-# define UINT64_C(c) c ## UL
-# else
-# define UINT64_C(c) c ## ULL
-# endif
-
-/* Maximal type. */
-# ifdef _HAVE_LONGLONG_UINT64_T
-# define INTMAX_C(c) c ## L
-# define UINTMAX_C(c) c ## UL
-# else
-# define INTMAX_C(c) c ## LL
-# define UINTMAX_C(c) c ## ULL
-# endif
-
- /* literalnumbers */
-#endif
-#endif
-
-/* These limits are merily those of a two complement byte-oriented system */
-
-/* Minimum of signed integral types. */
-# define INT8_MIN (-128)
-# define INT16_MIN (-32767-1)
-# define INT32_MIN (-2147483647-1)
-# define INT64_MIN (-__INT64_C(9223372036854775807)-1)
-/* Maximum of signed integral types. */
-# define INT8_MAX (127)
-# define INT16_MAX (32767)
-# define INT32_MAX (2147483647)
-# define INT64_MAX (__INT64_C(9223372036854775807))
-
-/* Maximum of unsigned integral types. */
-# define UINT8_MAX (255)
-# define UINT16_MAX (65535)
-# define UINT32_MAX (4294967295U)
-# define UINT64_MAX (__UINT64_C(18446744073709551615))
-
-/* Minimum of signed integral types having a minimum size. */
-# define INT_LEAST8_MIN INT8_MIN
-# define INT_LEAST16_MIN INT16_MIN
-# define INT_LEAST32_MIN INT32_MIN
-# define INT_LEAST64_MIN INT64_MIN
-/* Maximum of signed integral types having a minimum size. */
-# define INT_LEAST8_MAX INT8_MAX
-# define INT_LEAST16_MAX INT16_MAX
-# define INT_LEAST32_MAX INT32_MAX
-# define INT_LEAST64_MAX INT64_MAX
-
-/* Maximum of unsigned integral types having a minimum size. */
-# define UINT_LEAST8_MAX UINT8_MAX
-# define UINT_LEAST16_MAX UINT16_MAX
-# define UINT_LEAST32_MAX UINT32_MAX
-# define UINT_LEAST64_MAX UINT64_MAX
-
- /* shortcircuit*/
-#endif
- /* once */
-#endif
-#endif
-STDINT_EOF
-fi
- if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
- AC_MSG_NOTICE([$ac_stdint_h is unchanged])
- else
- ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
- AS_MKDIR_P(["$ac_dir"])
- rm -f $ac_stdint_h
- mv $ac_stdint $ac_stdint_h
- fi
-],[# variables for create stdint.h replacement
-PACKAGE="$PACKAGE"
-VERSION="$VERSION"
-ac_stdint_h="$ac_stdint_h"
-_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
-ac_cv_stdint_message="$ac_cv_stdint_message"
-ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
-ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
-ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
-ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
-ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
-ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
-ac_cv_char_data_model="$ac_cv_char_data_model"
-ac_cv_long_data_model="$ac_cv_long_data_model"
-ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
-ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
-ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
-])
-])
diff --git a/libvpx/nestegg/m4/pkg.m4 b/libvpx/nestegg/m4/pkg.m4
deleted file mode 100644
index 996e294..0000000
--- a/libvpx/nestegg/m4/pkg.m4
+++ /dev/null
@@ -1,157 +0,0 @@
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-#
-# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
-AC_DEFUN([PKG_PROG_PKG_CONFIG],
-[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
-m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=m4_default([$1], [0.9.0])
- AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- AC_MSG_RESULT([yes])
- else
- AC_MSG_RESULT([no])
- PKG_CONFIG=""
- fi
-
-fi[]dnl
-])# PKG_PROG_PKG_CONFIG
-
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-#
-# Similar to PKG_CHECK_MODULES, make sure that the first instance of
-# this or PKG_CHECK_MODULES is called, or make sure to call
-# PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_EXISTS],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-if test -n "$PKG_CONFIG" && \
- AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
- m4_ifval([$2], [$2], [:])
-m4_ifvaln([$3], [else
- $3])dnl
-fi])
-
-
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
-m4_define([_PKG_CONFIG],
-[if test -n "$PKG_CONFIG"; then
- if test -n "$$1"; then
- pkg_cv_[]$1="$$1"
- else
- PKG_CHECK_EXISTS([$3],
- [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
- [pkg_failed=yes])
- fi
-else
- pkg_failed=untried
-fi[]dnl
-])# _PKG_CONFIG
-
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
-AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
- _pkg_short_errors_supported=yes
-else
- _pkg_short_errors_supported=no
-fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
-
-
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
-AC_DEFUN([PKG_CHECK_MODULES],
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
-AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
-AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
-
-pkg_failed=no
-AC_MSG_CHECKING([for $1])
-
-_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
-_PKG_CONFIG([$1][_LIBS], [libs], [$2])
-
-m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
-and $1[]_LIBS to avoid the need to call pkg-config.
-See the pkg-config man page for more details.])
-
-if test $pkg_failed = yes; then
- _PKG_SHORT_ERRORS_SUPPORTED
- if test $_pkg_short_errors_supported = yes; then
- $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
- else
- $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
- fi
- # Put the nasty error message in config.log where it belongs
- echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
-
- ifelse([$4], , [AC_MSG_ERROR(dnl
-[Package requirements ($2) were not met:
-
-$$1_PKG_ERRORS
-
-Consider adjusting the PKG_CONFIG_PATH environment variable if you
-installed software in a non-standard prefix.
-
-_PKG_TEXT
-])],
- [AC_MSG_RESULT([no])
- $4])
-elif test $pkg_failed = untried; then
- ifelse([$4], , [AC_MSG_FAILURE(dnl
-[The pkg-config script could not be found or is too old. Make sure it
-is in your PATH or set the PKG_CONFIG environment variable to the full
-path to pkg-config.
-
-_PKG_TEXT
-
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
- [$4])
-else
- $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
- $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
- AC_MSG_RESULT([yes])
- ifelse([$3], , :, [$3])
-fi[]dnl
-])# PKG_CHECK_MODULES
diff --git a/libvpx/nestegg/nestegg-uninstalled.pc.in b/libvpx/nestegg/nestegg-uninstalled.pc.in
deleted file mode 100644
index 19bb680..0000000
--- a/libvpx/nestegg/nestegg-uninstalled.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-# nestegg uninstalled pkg-config file
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: nestegg
-Description: WebM/Matroska demuxer
-Version: @VERSION@
-Conflicts:
-Libs: -L${libdir} -lnestegg
-Cflags: -I${includedir}
diff --git a/libvpx/nestegg/nestegg.pc.in b/libvpx/nestegg/nestegg.pc.in
deleted file mode 100644
index 32c09d7..0000000
--- a/libvpx/nestegg/nestegg.pc.in
+++ /dev/null
@@ -1,13 +0,0 @@
-# nestegg installed pkg-config file
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: nestegg
-Description: WebM/Matroska demuxer
-Version: @VERSION@
-Conflicts:
-Libs: -L${libdir} -lnestegg
-Cflags: -I${includedir}
diff --git a/libvpx/rate_hist.c b/libvpx/rate_hist.c
new file mode 100644
index 0000000..1cef19b
--- /dev/null
+++ b/libvpx/rate_hist.c
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <limits.h>
+#include <stdio.h>
+#include <math.h>
+
+#include "./rate_hist.h"
+
+#define RATE_BINS 100
+#define HIST_BAR_MAX 40
+
+struct hist_bucket {
+ int low;
+ int high;
+ int count;
+};
+
+struct rate_hist {
+ int64_t *pts;
+ int *sz;
+ int samples;
+ int frames;
+ struct hist_bucket bucket[RATE_BINS];
+ int total;
+};
+
+struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg,
+ const vpx_rational_t *fps) {
+ int i;
+ struct rate_hist *hist = malloc(sizeof(*hist));
+
+ // Determine the number of samples in the buffer. Use the file's framerate
+ // to determine the number of frames in rc_buf_sz milliseconds, with an
+ // adjustment (5/4) to account for alt-refs
+ hist->samples = cfg->rc_buf_sz * 5 / 4 * fps->num / fps->den / 1000;
+
+ // prevent division by zero
+ if (hist->samples == 0)
+ hist->samples = 1;
+
+ hist->frames = 0;
+ hist->total = 0;
+
+ hist->pts = calloc(hist->samples, sizeof(*hist->pts));
+ hist->sz = calloc(hist->samples, sizeof(*hist->sz));
+ for (i = 0; i < RATE_BINS; i++) {
+ hist->bucket[i].low = INT_MAX;
+ hist->bucket[i].high = 0;
+ hist->bucket[i].count = 0;
+ }
+
+ return hist;
+}
+
+void destroy_rate_histogram(struct rate_hist *hist) {
+ if (hist) {
+ free(hist->pts);
+ free(hist->sz);
+ free(hist);
+ }
+}
+
+void update_rate_histogram(struct rate_hist *hist,
+ const vpx_codec_enc_cfg_t *cfg,
+ const vpx_codec_cx_pkt_t *pkt) {
+ int i;
+ int64_t then = 0;
+ int64_t avg_bitrate = 0;
+ int64_t sum_sz = 0;
+ const int64_t now = pkt->data.frame.pts * 1000 *
+ (uint64_t)cfg->g_timebase.num /
+ (uint64_t)cfg->g_timebase.den;
+
+ int idx = hist->frames++ % hist->samples;
+ hist->pts[idx] = now;
+ hist->sz[idx] = (int)pkt->data.frame.sz;
+
+ if (now < cfg->rc_buf_initial_sz)
+ return;
+
+ then = now;
+
+ /* Sum the size over the past rc_buf_sz ms */
+ for (i = hist->frames; i > 0 && hist->frames - i < hist->samples; i--) {
+ const int i_idx = (i - 1) % hist->samples;
+
+ then = hist->pts[i_idx];
+ if (now - then > cfg->rc_buf_sz)
+ break;
+ sum_sz += hist->sz[i_idx];
+ }
+
+ if (now == then)
+ return;
+
+ avg_bitrate = sum_sz * 8 * 1000 / (now - then);
+ idx = (int)(avg_bitrate * (RATE_BINS / 2) / (cfg->rc_target_bitrate * 1000));
+ if (idx < 0)
+ idx = 0;
+ if (idx > RATE_BINS - 1)
+ idx = RATE_BINS - 1;
+ if (hist->bucket[idx].low > avg_bitrate)
+ hist->bucket[idx].low = (int)avg_bitrate;
+ if (hist->bucket[idx].high < avg_bitrate)
+ hist->bucket[idx].high = (int)avg_bitrate;
+ hist->bucket[idx].count++;
+ hist->total++;
+}
+
+static int merge_hist_buckets(struct hist_bucket *bucket,
+ int max_buckets, int *num_buckets) {
+ int small_bucket = 0, merge_bucket = INT_MAX, big_bucket = 0;
+ int buckets = *num_buckets;
+ int i;
+
+ /* Find the extrema for this list of buckets */
+ big_bucket = small_bucket = 0;
+ for (i = 0; i < buckets; i++) {
+ if (bucket[i].count < bucket[small_bucket].count)
+ small_bucket = i;
+ if (bucket[i].count > bucket[big_bucket].count)
+ big_bucket = i;
+ }
+
+ /* If we have too many buckets, merge the smallest with an adjacent
+ * bucket.
+ */
+ while (buckets > max_buckets) {
+ int last_bucket = buckets - 1;
+
+ /* merge the small bucket with an adjacent one. */
+ if (small_bucket == 0)
+ merge_bucket = 1;
+ else if (small_bucket == last_bucket)
+ merge_bucket = last_bucket - 1;
+ else if (bucket[small_bucket - 1].count < bucket[small_bucket + 1].count)
+ merge_bucket = small_bucket - 1;
+ else
+ merge_bucket = small_bucket + 1;
+
+ assert(abs(merge_bucket - small_bucket) <= 1);
+ assert(small_bucket < buckets);
+ assert(big_bucket < buckets);
+ assert(merge_bucket < buckets);
+
+ if (merge_bucket < small_bucket) {
+ bucket[merge_bucket].high = bucket[small_bucket].high;
+ bucket[merge_bucket].count += bucket[small_bucket].count;
+ } else {
+ bucket[small_bucket].high = bucket[merge_bucket].high;
+ bucket[small_bucket].count += bucket[merge_bucket].count;
+ merge_bucket = small_bucket;
+ }
+
+ assert(bucket[merge_bucket].low != bucket[merge_bucket].high);
+
+ buckets--;
+
+ /* Remove the merge_bucket from the list, and find the new small
+ * and big buckets while we're at it
+ */
+ big_bucket = small_bucket = 0;
+ for (i = 0; i < buckets; i++) {
+ if (i > merge_bucket)
+ bucket[i] = bucket[i + 1];
+
+ if (bucket[i].count < bucket[small_bucket].count)
+ small_bucket = i;
+ if (bucket[i].count > bucket[big_bucket].count)
+ big_bucket = i;
+ }
+ }
+
+ *num_buckets = buckets;
+ return bucket[big_bucket].count;
+}
+
+static void show_histogram(const struct hist_bucket *bucket,
+ int buckets, int total, int scale) {
+ const char *pat1, *pat2;
+ int i;
+
+ switch ((int)(log(bucket[buckets - 1].high) / log(10)) + 1) {
+ case 1:
+ case 2:
+ pat1 = "%4d %2s: ";
+ pat2 = "%4d-%2d: ";
+ break;
+ case 3:
+ pat1 = "%5d %3s: ";
+ pat2 = "%5d-%3d: ";
+ break;
+ case 4:
+ pat1 = "%6d %4s: ";
+ pat2 = "%6d-%4d: ";
+ break;
+ case 5:
+ pat1 = "%7d %5s: ";
+ pat2 = "%7d-%5d: ";
+ break;
+ case 6:
+ pat1 = "%8d %6s: ";
+ pat2 = "%8d-%6d: ";
+ break;
+ case 7:
+ pat1 = "%9d %7s: ";
+ pat2 = "%9d-%7d: ";
+ break;
+ default:
+ pat1 = "%12d %10s: ";
+ pat2 = "%12d-%10d: ";
+ break;
+ }
+
+ for (i = 0; i < buckets; i++) {
+ int len;
+ int j;
+ float pct;
+
+ pct = (float)(100.0 * bucket[i].count / total);
+ len = HIST_BAR_MAX * bucket[i].count / scale;
+ if (len < 1)
+ len = 1;
+ assert(len <= HIST_BAR_MAX);
+
+ if (bucket[i].low == bucket[i].high)
+ fprintf(stderr, pat1, bucket[i].low, "");
+ else
+ fprintf(stderr, pat2, bucket[i].low, bucket[i].high);
+
+ for (j = 0; j < HIST_BAR_MAX; j++)
+ fprintf(stderr, j < len ? "=" : " ");
+ fprintf(stderr, "\t%5d (%6.2f%%)\n", bucket[i].count, pct);
+ }
+}
+
+void show_q_histogram(const int counts[64], int max_buckets) {
+ struct hist_bucket bucket[64];
+ int buckets = 0;
+ int total = 0;
+ int scale;
+ int i;
+
+ for (i = 0; i < 64; i++) {
+ if (counts[i]) {
+ bucket[buckets].low = bucket[buckets].high = i;
+ bucket[buckets].count = counts[i];
+ buckets++;
+ total += counts[i];
+ }
+ }
+
+ fprintf(stderr, "\nQuantizer Selection:\n");
+ scale = merge_hist_buckets(bucket, max_buckets, &buckets);
+ show_histogram(bucket, buckets, total, scale);
+}
+
+void show_rate_histogram(struct rate_hist *hist,
+ const vpx_codec_enc_cfg_t *cfg, int max_buckets) {
+ int i, scale;
+ int buckets = 0;
+
+ for (i = 0; i < RATE_BINS; i++) {
+ if (hist->bucket[i].low == INT_MAX)
+ continue;
+ hist->bucket[buckets++] = hist->bucket[i];
+ }
+
+ fprintf(stderr, "\nRate (over %dms window):\n", cfg->rc_buf_sz);
+ scale = merge_hist_buckets(hist->bucket, max_buckets, &buckets);
+ show_histogram(hist->bucket, buckets, hist->total, scale);
+}
diff --git a/libvpx/rate_hist.h b/libvpx/rate_hist.h
new file mode 100644
index 0000000..00a1676
--- /dev/null
+++ b/libvpx/rate_hist.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef RATE_HIST_H_
+#define RATE_HIST_H_
+
+#include "vpx/vpx_encoder.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct rate_hist;
+
+struct rate_hist *init_rate_histogram(const vpx_codec_enc_cfg_t *cfg,
+ const vpx_rational_t *fps);
+
+void destroy_rate_histogram(struct rate_hist *hist);
+
+void update_rate_histogram(struct rate_hist *hist,
+ const vpx_codec_enc_cfg_t *cfg,
+ const vpx_codec_cx_pkt_t *pkt);
+
+void show_q_histogram(const int counts[64], int max_buckets);
+
+void show_rate_histogram(struct rate_hist *hist, const vpx_codec_enc_cfg_t *cfg,
+ int max_buckets);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // RATE_HIST_H_
diff --git a/libvpx/test/acm_random.h b/libvpx/test/acm_random.h
index de94186..496dae3 100644
--- a/libvpx/test/acm_random.h
+++ b/libvpx/test/acm_random.h
@@ -26,6 +26,11 @@ class ACMRandom {
void Reset(int seed) {
random_.Reseed(seed);
}
+ uint16_t Rand16(void) {
+ const uint32_t value =
+ random_.Generate(testing::internal::Random::kMaxRange);
+ return (value >> 16) & 0xffff;
+ }
uint8_t Rand8(void) {
const uint32_t value =
diff --git a/libvpx/test/active_map_test.cc b/libvpx/test/active_map_test.cc
new file mode 100644
index 0000000..6377e72
--- /dev/null
+++ b/libvpx/test/active_map_test.cc
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#include <climits>
+#include <vector>
+#include "third_party/googletest/src/include/gtest/gtest.h"
+#include "test/codec_factory.h"
+#include "test/encode_test_driver.h"
+#include "test/i420_video_source.h"
+#include "test/util.h"
+
+namespace {
+
+class ActiveMapTest
+ : public ::libvpx_test::EncoderTest,
+ public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
+ protected:
+ static const int kWidth = 208;
+ static const int kHeight = 144;
+
+ ActiveMapTest() : EncoderTest(GET_PARAM(0)) {}
+ virtual ~ActiveMapTest() {}
+
+ virtual void SetUp() {
+ InitializeConfig();
+ SetMode(GET_PARAM(1));
+ cpu_used_ = GET_PARAM(2);
+ }
+
+ virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
+ ::libvpx_test::Encoder *encoder) {
+ if (video->frame() == 1) {
+ encoder->Control(VP8E_SET_CPUUSED, cpu_used_);
+ } else if (video->frame() == 3) {
+ vpx_active_map_t map = {0};
+ uint8_t active_map[9 * 13] = {
+ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
+ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 1,
+ 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1,
+ 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1,
+ 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1,
+ 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 0,
+ };
+ map.cols = (kWidth + 15) / 16;
+ map.rows = (kHeight + 15) / 16;
+ ASSERT_EQ(map.cols, 13u);
+ ASSERT_EQ(map.rows, 9u);
+ map.active_map = active_map;
+ encoder->Control(VP8E_SET_ACTIVEMAP, &map);
+ } else if (video->frame() == 15) {
+ vpx_active_map_t map = {0};
+ map.cols = (kWidth + 15) / 16;
+ map.rows = (kHeight + 15) / 16;
+ map.active_map = NULL;
+ encoder->Control(VP8E_SET_ACTIVEMAP, &map);
+ }
+ }
+
+ int cpu_used_;
+};
+
+TEST_P(ActiveMapTest, Test) {
+ // Validate that this non multiple of 64 wide clip encodes
+ cfg_.g_lag_in_frames = 0;
+ cfg_.rc_target_bitrate = 400;
+ cfg_.rc_resize_allowed = 0;
+ cfg_.g_pass = VPX_RC_ONE_PASS;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.kf_max_dist = 90000;
+
+ ::libvpx_test::I420VideoSource video("hantro_odd.yuv", kWidth, kHeight, 30,
+ 1, 0, 20);
+
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+}
+
+#define VP9_FACTORY \
+ static_cast<const libvpx_test::CodecFactory *>(&libvpx_test::kVP9)
+
+VP9_INSTANTIATE_TEST_CASE(ActiveMapTest,
+ ::testing::Values(::libvpx_test::kRealTime),
+ ::testing::Range(0, 6));
+} // namespace
diff --git a/libvpx/test/aq_segment_test.cc b/libvpx/test/aq_segment_test.cc
new file mode 100644
index 0000000..2f88b53
--- /dev/null
+++ b/libvpx/test/aq_segment_test.cc
@@ -0,0 +1,119 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#include <climits>
+#include <vector>
+#include "third_party/googletest/src/include/gtest/gtest.h"
+#include "test/codec_factory.h"
+#include "test/encode_test_driver.h"
+#include "test/i420_video_source.h"
+#include "test/util.h"
+
+namespace {
+
+class AqSegmentTest : public ::libvpx_test::EncoderTest,
+ public ::libvpx_test::CodecTestWith2Params<
+ libvpx_test::TestMode, int> {
+ protected:
+ AqSegmentTest() : EncoderTest(GET_PARAM(0)) {}
+
+ virtual void SetUp() {
+ InitializeConfig();
+ SetMode(GET_PARAM(1));
+ set_cpu_used_ = GET_PARAM(2);
+ aq_mode_ = 0;
+ }
+
+ virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
+ ::libvpx_test::Encoder *encoder) {
+ if (video->frame() == 1) {
+ encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
+ encoder->Control(VP9E_SET_AQ_MODE, aq_mode_);
+ encoder->Control(VP8E_SET_MAX_INTRA_BITRATE_PCT, 100);
+ }
+ }
+
+ virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
+ if (pkt->data.frame.flags & VPX_FRAME_IS_KEY) {
+ }
+ }
+ int set_cpu_used_;
+ int aq_mode_;
+};
+
+// Validate that this AQ segmentation mode (AQ=1, variance_ap)
+// encodes and decodes without a mismatch.
+TEST_P(AqSegmentTest, TestNoMisMatchAQ1) {
+ cfg_.rc_min_quantizer = 8;
+ cfg_.rc_max_quantizer = 56;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_target_bitrate = 300;
+
+ aq_mode_ = 1;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 100);
+
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+}
+
+// Validate that this AQ segmentation mode (AQ=2, complexity_aq)
+// encodes and decodes without a mismatch.
+TEST_P(AqSegmentTest, TestNoMisMatchAQ2) {
+ cfg_.rc_min_quantizer = 8;
+ cfg_.rc_max_quantizer = 56;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_target_bitrate = 300;
+
+ aq_mode_ = 2;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 100);
+
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+}
+
+// Validate that this AQ segmentation mode (AQ=3, cyclic_refresh_aq)
+// encodes and decodes without a mismatch.
+TEST_P(AqSegmentTest, TestNoMisMatchAQ3) {
+ cfg_.rc_min_quantizer = 8;
+ cfg_.rc_max_quantizer = 56;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_target_bitrate = 300;
+
+ aq_mode_ = 3;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 100);
+
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+}
+
+using std::tr1::make_tuple;
+
+#define VP9_FACTORY \
+ static_cast<const libvpx_test::CodecFactory*> (&libvpx_test::kVP9)
+
+VP9_INSTANTIATE_TEST_CASE(AqSegmentTest,
+ ::testing::Values(::libvpx_test::kRealTime,
+ ::libvpx_test::kOnePassGood),
+ ::testing::Range(3, 9));
+} // namespace
diff --git a/libvpx/test/borders_test.cc b/libvpx/test/borders_test.cc
index dcdedcf..b30be45 100644
--- a/libvpx/test/borders_test.cc
+++ b/libvpx/test/borders_test.cc
@@ -21,6 +21,7 @@ class BordersTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
BordersTest() : EncoderTest(GET_PARAM(0)) {}
+ virtual ~BordersTest() {}
virtual void SetUp() {
InitializeConfig();
@@ -67,7 +68,7 @@ TEST_P(BordersTest, TestLowBitrate) {
cfg_.g_lag_in_frames = 25;
cfg_.rc_2pass_vbr_minsection_pct = 5;
- cfg_.rc_2pass_vbr_minsection_pct = 2000;
+ cfg_.rc_2pass_vbr_maxsection_pct = 2000;
cfg_.rc_target_bitrate = 200;
cfg_.rc_min_quantizer = 40;
diff --git a/libvpx/test/clear_system_state.h b/libvpx/test/clear_system_state.h
index 8f08a4c..5e76797 100644
--- a/libvpx/test/clear_system_state.h
+++ b/libvpx/test/clear_system_state.h
@@ -11,11 +11,9 @@
#define TEST_CLEAR_SYSTEM_STATE_H_
#include "./vpx_config.h"
-extern "C" {
#if ARCH_X86 || ARCH_X86_64
# include "vpx_ports/x86.h"
#endif
-}
namespace libvpx_test {
diff --git a/libvpx/test/codec_factory.h b/libvpx/test/codec_factory.h
index cc7b53f..7f9398c 100644
--- a/libvpx/test/codec_factory.h
+++ b/libvpx/test/codec_factory.h
@@ -10,7 +10,6 @@
#ifndef TEST_CODEC_FACTORY_H_
#define TEST_CODEC_FACTORY_H_
-extern "C" {
#include "./vpx_config.h"
#include "vpx/vpx_decoder.h"
#include "vpx/vpx_encoder.h"
@@ -20,12 +19,13 @@ extern "C" {
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
#include "vpx/vp8dx.h"
#endif
-}
#include "test/decode_test_driver.h"
#include "test/encode_test_driver.h"
namespace libvpx_test {
+const int kCodecFactoryParam = 0;
+
class CodecFactory {
public:
CodecFactory() {}
@@ -73,7 +73,7 @@ class VP8Decoder : public Decoder {
: Decoder(cfg, deadline) {}
protected:
- virtual const vpx_codec_iface_t* CodecInterface() const {
+ virtual vpx_codec_iface_t* CodecInterface() const {
#if CONFIG_VP8_DECODER
return &vpx_codec_vp8_dx_algo;
#else
@@ -89,7 +89,7 @@ class VP8Encoder : public Encoder {
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
- virtual const vpx_codec_iface_t* CodecInterface() const {
+ virtual vpx_codec_iface_t* CodecInterface() const {
#if CONFIG_VP8_ENCODER
return &vpx_codec_vp8_cx_algo;
#else
@@ -155,7 +155,7 @@ class VP9Decoder : public Decoder {
: Decoder(cfg, deadline) {}
protected:
- virtual const vpx_codec_iface_t* CodecInterface() const {
+ virtual vpx_codec_iface_t* CodecInterface() const {
#if CONFIG_VP9_DECODER
return &vpx_codec_vp9_dx_algo;
#else
@@ -171,7 +171,7 @@ class VP9Encoder : public Encoder {
: Encoder(cfg, deadline, init_flags, stats) {}
protected:
- virtual const vpx_codec_iface_t* CodecInterface() const {
+ virtual vpx_codec_iface_t* CodecInterface() const {
#if CONFIG_VP9_ENCODER
return &vpx_codec_vp9_cx_algo;
#else
diff --git a/libvpx/test/config_test.cc b/libvpx/test/config_test.cc
index 36c6330..0493110 100644
--- a/libvpx/test/config_test.cc
+++ b/libvpx/test/config_test.cc
@@ -20,6 +20,7 @@ class ConfigTest : public ::libvpx_test::EncoderTest,
protected:
ConfigTest() : EncoderTest(GET_PARAM(0)),
frame_count_in_(0), frame_count_out_(0), frame_count_max_(0) {}
+ virtual ~ConfigTest() {}
virtual void SetUp() {
InitializeConfig();
diff --git a/libvpx/test/convolve_test.cc b/libvpx/test/convolve_test.cc
index abeb4bd..e920de8 100644
--- a/libvpx/test/convolve_test.cc
+++ b/libvpx/test/convolve_test.cc
@@ -14,13 +14,11 @@
#include "test/util.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
-extern "C" {
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_filter.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/mem.h"
-}
namespace {
typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride,
@@ -44,6 +42,8 @@ struct ConvolveFunctions {
convolve_fn_t hv8_avg_;
};
+typedef std::tr1::tuple<int, int, const ConvolveFunctions*> convolve_param_t;
+
// Reference 8-tap subpixel filter, slightly modified to fit into this test.
#define VP9_FILTER_WEIGHT 128
#define VP9_FILTER_SHIFT 7
@@ -169,7 +169,7 @@ void filter_average_block2d_8_c(const uint8_t *src_ptr,
output_width, output_height);
}
-class ConvolveTest : public PARAMS(int, int, const ConvolveFunctions*) {
+class ConvolveTest : public ::testing::TestWithParam<convolve_param_t> {
public:
static void SetUpTestCase() {
// Force input_ to be unaligned, output to be 16 byte aligned.
diff --git a/libvpx/test/cpu_speed_test.cc b/libvpx/test/cpu_speed_test.cc
index c92e723..be651b4 100644
--- a/libvpx/test/cpu_speed_test.cc
+++ b/libvpx/test/cpu_speed_test.cc
@@ -22,6 +22,7 @@ class CpuSpeedTest : public ::libvpx_test::EncoderTest,
libvpx_test::TestMode, int> {
protected:
CpuSpeedTest() : EncoderTest(GET_PARAM(0)) {}
+ virtual ~CpuSpeedTest() {}
virtual void SetUp() {
InitializeConfig();
@@ -79,7 +80,7 @@ TEST_P(CpuSpeedTest, TestEncodeHighBitrate) {
cfg_.rc_min_quantizer = 0;
::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
- 40);
+ 20);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
@@ -95,7 +96,7 @@ TEST_P(CpuSpeedTest, TestLowBitrate) {
cfg_.rc_min_quantizer = 40;
::libvpx_test::I420VideoSource video("hantro_odd.yuv", 208, 144, 30, 1, 0,
- 40);
+ 20);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
}
@@ -107,6 +108,6 @@ using std::tr1::make_tuple;
VP9_INSTANTIATE_TEST_CASE(
CpuSpeedTest,
- ::testing::Values(::libvpx_test::kTwoPassGood),
- ::testing::Range(0, 5));
+ ::testing::Values(::libvpx_test::kTwoPassGood, ::libvpx_test::kOnePassGood),
+ ::testing::Range(0, 8));
} // namespace
diff --git a/libvpx/test/cq_test.cc b/libvpx/test/cq_test.cc
index a2c8291..7da7b80 100644
--- a/libvpx/test/cq_test.cc
+++ b/libvpx/test/cq_test.cc
@@ -20,7 +20,7 @@ namespace {
const int kCQLevelMin = 4;
const int kCQLevelMax = 63;
const int kCQLevelStep = 8;
-const int kCQTargetBitrate = 2000;
+const unsigned int kCQTargetBitrate = 2000;
class CQTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
@@ -66,17 +66,17 @@ class CQTest : public ::libvpx_test::EncoderTest,
return pow(10.0, avg_psnr / 10.0) / file_size_;
}
- int file_size() const { return file_size_; }
+ size_t file_size() const { return file_size_; }
int n_frames() const { return n_frames_; }
private:
int cq_level_;
- int file_size_;
+ size_t file_size_;
double psnr_;
int n_frames_;
};
-int prev_actual_bitrate = kCQTargetBitrate;
+unsigned int prev_actual_bitrate = kCQTargetBitrate;
TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
@@ -88,7 +88,8 @@ TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
timebase.den, timebase.num, 0, 30);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
const double cq_psnr_lin = GetLinearPSNROverBitrate();
- const int cq_actual_bitrate = file_size() * 8 * 30 / (n_frames() * 1000);
+ const unsigned int cq_actual_bitrate =
+ static_cast<unsigned int>(file_size()) * 8 * 30 / (n_frames() * 1000);
EXPECT_LE(cq_actual_bitrate, kCQTargetBitrate);
EXPECT_LE(cq_actual_bitrate, prev_actual_bitrate);
prev_actual_bitrate = cq_actual_bitrate;
diff --git a/libvpx/test/datarate_test.cc b/libvpx/test/datarate_test.cc
index 5785a0a..f673adc 100644
--- a/libvpx/test/datarate_test.cc
+++ b/libvpx/test/datarate_test.cc
@@ -7,18 +7,22 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "./vpx_config.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
+#include "test/y4m_video_source.h"
namespace {
-class DatarateTest : public ::libvpx_test::EncoderTest,
+class DatarateTestLarge : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
public:
- DatarateTest() : EncoderTest(GET_PARAM(0)) {}
+ DatarateTestLarge() : EncoderTest(GET_PARAM(0)) {}
+
+ virtual ~DatarateTestLarge() {}
protected:
virtual void SetUp() {
@@ -55,21 +59,22 @@ class DatarateTest : public ::libvpx_test::EncoderTest,
duration = 1;
// Add to the buffer the bits we'd expect from a constant bitrate server.
- bits_in_buffer_model_ += duration * timebase_ * cfg_.rc_target_bitrate
- * 1000;
+ bits_in_buffer_model_ += static_cast<int64_t>(
+ duration * timebase_ * cfg_.rc_target_bitrate * 1000);
/* Test the buffer model here before subtracting the frame. Do so because
* the way the leaky bucket model works in libvpx is to allow the buffer to
* empty - and then stop showing frames until we've got enough bits to
* show one. As noted in comment below (issue 495), this does not currently
* apply to key frames. For now exclude key frames in condition below. */
- bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) ? true: false;
+ const bool key_frame = (pkt->data.frame.flags & VPX_FRAME_IS_KEY)
+ ? true: false;
if (!key_frame) {
ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
<< pkt->data.frame.pts;
}
- const int frame_size_in_bits = pkt->data.frame.sz * 8;
+ const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
// Subtract from the buffer the bits associated with a played back frame.
bits_in_buffer_model_ -= frame_size_in_bits;
@@ -93,7 +98,7 @@ class DatarateTest : public ::libvpx_test::EncoderTest,
virtual void EndPassHook(void) {
if (bits_total_) {
- const double file_size_in_kb = bits_total_ / 1000; /* bits per kilobit */
+ const double file_size_in_kb = bits_total_ / 1000.; // bits per kilobit
duration_ = (last_pts_ + 1) * timebase_;
@@ -106,7 +111,7 @@ class DatarateTest : public ::libvpx_test::EncoderTest,
}
vpx_codec_pts_t last_pts_;
- int bits_in_buffer_model_;
+ int64_t bits_in_buffer_model_;
double timebase_;
int frame_number_;
vpx_codec_pts_t first_drop_;
@@ -114,10 +119,10 @@ class DatarateTest : public ::libvpx_test::EncoderTest,
double duration_;
double file_datarate_;
double effective_datarate_;
- int bits_in_last_frame_;
+ size_t bits_in_last_frame_;
};
-TEST_P(DatarateTest, BasicBufferModel) {
+TEST_P(DatarateTestLarge, BasicBufferModel) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_dropframe_thresh = 1;
cfg_.rc_max_quantizer = 56;
@@ -148,7 +153,7 @@ TEST_P(DatarateTest, BasicBufferModel) {
}
}
-TEST_P(DatarateTest, ChangingDropFrameThresh) {
+TEST_P(DatarateTestLarge, ChangingDropFrameThresh) {
cfg_.rc_buf_initial_sz = 500;
cfg_.rc_max_quantizer = 36;
cfg_.rc_end_usage = VPX_CBR;
@@ -176,13 +181,13 @@ TEST_P(DatarateTest, ChangingDropFrameThresh) {
}
}
-class DatarateTestVP9 : public ::libvpx_test::EncoderTest,
+class DatarateTestVP9Large : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWith2Params<libvpx_test::TestMode, int> {
public:
- DatarateTestVP9() : EncoderTest(GET_PARAM(0)) {}
+ DatarateTestVP9Large() : EncoderTest(GET_PARAM(0)) {}
protected:
- virtual ~DatarateTestVP9() {}
+ virtual ~DatarateTestVP9Large() {}
virtual void SetUp() {
InitializeConfig();
@@ -193,54 +198,177 @@ class DatarateTestVP9 : public ::libvpx_test::EncoderTest,
virtual void ResetModel() {
last_pts_ = 0;
+ bits_in_buffer_model_ = cfg_.rc_target_bitrate * cfg_.rc_buf_initial_sz;
frame_number_ = 0;
- bits_total_ = 0;
- duration_ = 0.0;
+ tot_frame_number_ = 0;
+ first_drop_ = 0;
+ num_drops_ = 0;
+ // For testing up to 3 layers.
+ for (int i = 0; i < 3; ++i) {
+ bits_total_[i] = 0;
+ }
+ }
+
+ //
+ // Frame flags and layer id for temporal layers.
+ //
+
+ // For two layers, test pattern is:
+ // 1 3
+ // 0 2 .....
+ // For three layers, test pattern is:
+ // 1 3 5 7
+ // 2 6
+ // 0 4 ....
+ // LAST is always update on base/layer 0, GOLDEN is updated on layer 1.
+ // For this 3 layer example, the 2nd enhancement layer (layer 2) does not
+ // update any reference frames.
+ int SetFrameFlags(int frame_num, int num_temp_layers) {
+ int frame_flags = 0;
+ if (num_temp_layers == 2) {
+ if (frame_num % 2 == 0) {
+ // Layer 0: predict from L and ARF, update L.
+ frame_flags = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_UPD_GF |
+ VP8_EFLAG_NO_UPD_ARF;
+ } else {
+ // Layer 1: predict from L, G and ARF, and update G.
+ frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
+ VP8_EFLAG_NO_UPD_ENTROPY;
+ }
+ } else if (num_temp_layers == 3) {
+ if (frame_num % 4 == 0) {
+ // Layer 0: predict from L and ARF; update L.
+ frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_REF_GF;
+ } else if ((frame_num - 2) % 4 == 0) {
+ // Layer 1: predict from L, G, ARF; update G.
+ frame_flags = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST;
+ } else if ((frame_num - 1) % 2 == 0) {
+ // Layer 2: predict from L, G, ARF; update none.
+ frame_flags = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
+ VP8_EFLAG_NO_UPD_LAST;
+ }
+ }
+ return frame_flags;
+ }
+
+ int SetLayerId(int frame_num, int num_temp_layers) {
+ int layer_id = 0;
+ if (num_temp_layers == 2) {
+ if (frame_num % 2 == 0) {
+ layer_id = 0;
+ } else {
+ layer_id = 1;
+ }
+ } else if (num_temp_layers == 3) {
+ if (frame_num % 4 == 0) {
+ layer_id = 0;
+ } else if ((frame_num - 2) % 4 == 0) {
+ layer_id = 1;
+ } else if ((frame_num - 1) % 2 == 0) {
+ layer_id = 2;
+ }
+ }
+ return layer_id;
}
virtual void PreEncodeFrameHook(::libvpx_test::VideoSource *video,
- ::libvpx_test::Encoder *encoder) {
+ ::libvpx_test::Encoder *encoder) {
if (video->frame() == 1) {
encoder->Control(VP8E_SET_CPUUSED, set_cpu_used_);
}
+ if (cfg_.ts_number_layers > 1) {
+ if (video->frame() == 1) {
+ encoder->Control(VP9E_SET_SVC, 1);
+ }
+ vpx_svc_layer_id_t layer_id = {0, 0};
+ layer_id.spatial_layer_id = 0;
+ frame_flags_ = SetFrameFlags(video->frame(), cfg_.ts_number_layers);
+ layer_id.temporal_layer_id = SetLayerId(video->frame(),
+ cfg_.ts_number_layers);
+ if (video->frame() > 0) {
+ encoder->Control(VP9E_SET_SVC_LAYER_ID, &layer_id);
+ }
+ }
const vpx_rational_t tb = video->timebase();
timebase_ = static_cast<double>(tb.num) / tb.den;
duration_ = 0;
}
+
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
- const int frame_size_in_bits = pkt->data.frame.sz * 8;
- bits_total_ += frame_size_in_bits;
+ // Time since last timestamp = duration.
+ vpx_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
+
+ if (duration > 1) {
+ // If first drop not set and we have a drop set it to this time.
+ if (!first_drop_)
+ first_drop_ = last_pts_ + 1;
+ // Update the number of frame drops.
+ num_drops_ += static_cast<int>(duration - 1);
+ // Update counter for total number of frames (#frames input to encoder).
+ // Needed for setting the proper layer_id below.
+ tot_frame_number_ += static_cast<int>(duration - 1);
+ }
+
+ int layer = SetLayerId(tot_frame_number_, cfg_.ts_number_layers);
+
+ // Add to the buffer the bits we'd expect from a constant bitrate server.
+ bits_in_buffer_model_ += static_cast<int64_t>(
+ duration * timebase_ * cfg_.rc_target_bitrate * 1000);
+
+ // Buffer should not go negative.
+ ASSERT_GE(bits_in_buffer_model_, 0) << "Buffer Underrun at frame "
+ << pkt->data.frame.pts;
+
+ const size_t frame_size_in_bits = pkt->data.frame.sz * 8;
+
+ // Update the total encoded bits. For temporal layers, update the cumulative
+ // encoded bits per layer.
+ for (int i = layer; i < static_cast<int>(cfg_.ts_number_layers); ++i) {
+ bits_total_[i] += frame_size_in_bits;
+ }
+
// Update the most recent pts.
last_pts_ = pkt->data.frame.pts;
++frame_number_;
+ ++tot_frame_number_;
}
virtual void EndPassHook(void) {
- if (bits_total_) {
+ for (int layer = 0; layer < static_cast<int>(cfg_.ts_number_layers);
+ ++layer) {
duration_ = (last_pts_ + 1) * timebase_;
- // Effective file datarate:
- effective_datarate_ = ((bits_total_) / 1000.0) / duration_;
+ if (bits_total_[layer]) {
+ // Effective file datarate:
+ effective_datarate_[layer] = (bits_total_[layer] / 1000.0) / duration_;
+ }
}
}
vpx_codec_pts_t last_pts_;
double timebase_;
- int frame_number_;
- int64_t bits_total_;
+ int frame_number_; // Counter for number of non-dropped/encoded frames.
+ int tot_frame_number_; // Counter for total number of input frames.
+ int64_t bits_total_[3];
double duration_;
- double effective_datarate_;
+ double effective_datarate_[3];
int set_cpu_used_;
+ int64_t bits_in_buffer_model_;
+ vpx_codec_pts_t first_drop_;
+ int num_drops_;
};
-// There is no buffer model/frame dropper in VP9 currently, so for now we
-// have separate test for VP9 rate targeting for 1-pass CBR. We only check
-// that effective datarate is within some range of target bitrate.
-// No frame dropper, so we can't go to low bitrates.
-TEST_P(DatarateTestVP9, BasicRateTargeting) {
+// Check basic rate targeting,
+TEST_P(DatarateTestVP9Large, BasicRateTargeting) {
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_dropframe_thresh = 1;
cfg_.rc_min_quantizer = 0;
cfg_.rc_max_quantizer = 63;
cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
30, 1, 0, 140);
@@ -248,15 +376,213 @@ TEST_P(DatarateTestVP9, BasicRateTargeting) {
cfg_.rc_target_bitrate = i;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
- ASSERT_GE(cfg_.rc_target_bitrate, effective_datarate_ * 0.9)
+ ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85)
+ << " The datarate for the file is lower than target by too much!";
+ ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15)
+ << " The datarate for the file is greater than target by too much!";
+ }
+}
+
+// Check basic rate targeting,
+TEST_P(DatarateTestVP9Large, BasicRateTargeting444) {
+ ::libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 140);
+
+ cfg_.g_profile = 1;
+ cfg_.g_timebase = video.timebase();
+
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_dropframe_thresh = 1;
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_max_quantizer = 63;
+ cfg_.rc_end_usage = VPX_CBR;
+
+ for (int i = 250; i < 900; i += 200) {
+ cfg_.rc_target_bitrate = i;
+ ResetModel();
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate),
+ effective_datarate_[0] * 0.85)
<< " The datarate for the file exceeds the target by too much!";
- ASSERT_LE(cfg_.rc_target_bitrate, effective_datarate_ * 1.1)
- << " The datarate for the file missed the target!";
+ ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
+ effective_datarate_[0] * 1.15)
+ << " The datarate for the file missed the target!"
+ << cfg_.rc_target_bitrate << " "<< effective_datarate_;
+ }
+}
+
+// Check that (1) the first dropped frame gets earlier and earlier
+// as the drop frame threshold is increased, and (2) that the total number of
+// frame drops does not decrease as we increase frame drop threshold.
+// Use a lower qp-max to force some frame drops.
+TEST_P(DatarateTestVP9Large, ChangingDropFrameThresh) {
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_undershoot_pct = 20;
+ cfg_.rc_undershoot_pct = 20;
+ cfg_.rc_dropframe_thresh = 10;
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_max_quantizer = 50;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.rc_target_bitrate = 200;
+ cfg_.g_lag_in_frames = 0;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 140);
+
+ const int kDropFrameThreshTestStep = 30;
+ vpx_codec_pts_t last_drop = 140;
+ int last_num_drops = 0;
+ for (int i = 10; i < 100; i += kDropFrameThreshTestStep) {
+ cfg_.rc_dropframe_thresh = i;
+ ResetModel();
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ ASSERT_GE(effective_datarate_[0], cfg_.rc_target_bitrate * 0.85)
+ << " The datarate for the file is lower than target by too much!";
+ ASSERT_LE(effective_datarate_[0], cfg_.rc_target_bitrate * 1.15)
+ << " The datarate for the file is greater than target by too much!";
+ ASSERT_LE(first_drop_, last_drop)
+ << " The first dropped frame for drop_thresh " << i
+ << " > first dropped frame for drop_thresh "
+ << i - kDropFrameThreshTestStep;
+ ASSERT_GE(num_drops_, last_num_drops)
+ << " The number of dropped frames for drop_thresh " << i
+ << " < number of dropped frames for drop_thresh "
+ << i - kDropFrameThreshTestStep;
+ last_drop = first_drop_;
+ last_num_drops = num_drops_;
+ }
+}
+
+// Check basic rate targeting for 2 temporal layers.
+TEST_P(DatarateTestVP9Large, BasicRateTargeting2TemporalLayers) {
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_dropframe_thresh = 1;
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_max_quantizer = 63;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+
+ // 2 Temporal layers, no spatial layers: Framerate decimation (2, 1).
+ cfg_.ss_number_layers = 1;
+ cfg_.ts_number_layers = 2;
+ cfg_.ts_rate_decimator[0] = 2;
+ cfg_.ts_rate_decimator[1] = 1;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 200);
+ for (int i = 200; i <= 800; i += 200) {
+ cfg_.rc_target_bitrate = i;
+ ResetModel();
+ // 60-40 bitrate allocation for 2 temporal layers.
+ cfg_.ts_target_bitrate[0] = 60 * cfg_.rc_target_bitrate / 100;
+ cfg_.ts_target_bitrate[1] = cfg_.rc_target_bitrate;
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
+ ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
+ << " The datarate for the file is lower than target by too much, "
+ "for layer: " << j;
+ ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
+ << " The datarate for the file is greater than target by too much, "
+ "for layer: " << j;
+ }
+ }
+}
+
+// Check basic rate targeting for 3 temporal layers.
+TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayers) {
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ cfg_.rc_dropframe_thresh = 1;
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_max_quantizer = 63;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+
+ // 3 Temporal layers, no spatial layers: Framerate decimation (4, 2, 1).
+ cfg_.ss_number_layers = 1;
+ cfg_.ts_number_layers = 3;
+ cfg_.ts_rate_decimator[0] = 4;
+ cfg_.ts_rate_decimator[1] = 2;
+ cfg_.ts_rate_decimator[2] = 1;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 200);
+ for (int i = 200; i <= 800; i += 200) {
+ cfg_.rc_target_bitrate = i;
+ ResetModel();
+ // 40-20-40 bitrate allocation for 3 temporal layers.
+ cfg_.ts_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100;
+ cfg_.ts_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100;
+ cfg_.ts_target_bitrate[2] = cfg_.rc_target_bitrate;
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
+ ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
+ << " The datarate for the file is lower than target by too much, "
+ "for layer: " << j;
+ ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
+ << " The datarate for the file is greater than target by too much, "
+ "for layer: " << j;
+ }
+ }
+}
+
+// Check basic rate targeting for 3 temporal layers, with frame dropping.
+// Only for one (low) bitrate with lower max_quantizer, and somewhat higher
+// frame drop threshold, to force frame dropping.
+TEST_P(DatarateTestVP9Large, BasicRateTargeting3TemporalLayersFrameDropping) {
+ cfg_.rc_buf_initial_sz = 500;
+ cfg_.rc_buf_optimal_sz = 500;
+ cfg_.rc_buf_sz = 1000;
+ // Set frame drop threshold and rc_max_quantizer to force some frame drops.
+ cfg_.rc_dropframe_thresh = 20;
+ cfg_.rc_max_quantizer = 45;
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_end_usage = VPX_CBR;
+ cfg_.g_lag_in_frames = 0;
+
+ // 3 Temporal layers, no spatial layers: Framerate decimation (4, 2, 1).
+ cfg_.ss_number_layers = 1;
+ cfg_.ts_number_layers = 3;
+ cfg_.ts_rate_decimator[0] = 4;
+ cfg_.ts_rate_decimator[1] = 2;
+ cfg_.ts_rate_decimator[2] = 1;
+
+ ::libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
+ 30, 1, 0, 200);
+ cfg_.rc_target_bitrate = 200;
+ ResetModel();
+ // 40-20-40 bitrate allocation for 3 temporal layers.
+ cfg_.ts_target_bitrate[0] = 40 * cfg_.rc_target_bitrate / 100;
+ cfg_.ts_target_bitrate[1] = 60 * cfg_.rc_target_bitrate / 100;
+ cfg_.ts_target_bitrate[2] = cfg_.rc_target_bitrate;
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ for (int j = 0; j < static_cast<int>(cfg_.ts_number_layers); ++j) {
+ ASSERT_GE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 0.85)
+ << " The datarate for the file is lower than target by too much, "
+ "for layer: " << j;
+ ASSERT_LE(effective_datarate_[j], cfg_.ts_target_bitrate[j] * 1.15)
+ << " The datarate for the file is greater than target by too much, "
+ "for layer: " << j;
+ // Expect some frame drops in this test: for this 200 frames test,
+ // expect at least 10% and not more than 50% drops.
+ ASSERT_GE(num_drops_, 20);
+ ASSERT_LE(num_drops_, 100);
}
}
-VP8_INSTANTIATE_TEST_CASE(DatarateTest, ALL_TEST_MODES);
-VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9,
- ::testing::Values(::libvpx_test::kOnePassGood),
- ::testing::Range(1, 5));
+VP8_INSTANTIATE_TEST_CASE(DatarateTestLarge, ALL_TEST_MODES);
+VP9_INSTANTIATE_TEST_CASE(DatarateTestVP9Large,
+ ::testing::Values(::libvpx_test::kOnePassGood,
+ ::libvpx_test::kRealTime),
+ ::testing::Range(2, 7));
+// TODO(marpan): Speed 7 fails on one of these tests (likely just a threshold
+// needs to be changed), so for now test up to speed 6, and start at 2 (since
+// speed 0 and 1 are slow). Allow speed 7 (for real-time mode) after
+// looking into/fix failing issue.
} // namespace
diff --git a/libvpx/test/dct16x16_test.cc b/libvpx/test/dct16x16_test.cc
index b61df8d..cb5562e 100644
--- a/libvpx/test/dct16x16_test.cc
+++ b/libvpx/test/dct16x16_test.cc
@@ -18,12 +18,13 @@
#include "test/register_state_check.h"
#include "test/util.h"
-extern "C" {
-#include "vp9/common/vp9_entropy.h"
#include "./vp9_rtcd.h"
+#include "vp9/common/vp9_entropy.h"
+#include "vpx/vpx_integer.h"
+
+extern "C" {
void vp9_idct16x16_256_add_c(const int16_t *input, uint8_t *output, int pitch);
}
-#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
@@ -264,12 +265,15 @@ typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride,
typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride,
int tx_type);
+typedef std::tr1::tuple<fdct_t, idct_t, int> dct_16x16_param_t;
+typedef std::tr1::tuple<fht_t, iht_t, int> ht_16x16_param_t;
+
void fdct16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
vp9_fdct16x16_c(in, out, stride);
}
void fht16x16_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
- vp9_short_fht16x16_c(in, out, stride, tx_type);
+ vp9_fht16x16_c(in, out, stride, tx_type);
}
class Trans16x16TestBase {
@@ -412,8 +416,9 @@ class Trans16x16TestBase {
fht_t fwd_txfm_ref;
};
-class Trans16x16DCT : public Trans16x16TestBase,
- public PARAMS(fdct_t, idct_t, int) {
+class Trans16x16DCT
+ : public Trans16x16TestBase,
+ public ::testing::TestWithParam<dct_16x16_param_t> {
public:
virtual ~Trans16x16DCT() {}
@@ -454,8 +459,9 @@ TEST_P(Trans16x16DCT, InvAccuracyCheck) {
RunInvAccuracyCheck();
}
-class Trans16x16HT : public Trans16x16TestBase,
- public PARAMS(fht_t, iht_t, int) {
+class Trans16x16HT
+ : public Trans16x16TestBase,
+ public ::testing::TestWithParam<ht_16x16_param_t> {
public:
virtual ~Trans16x16HT() {}
@@ -501,10 +507,18 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
C, Trans16x16HT,
::testing::Values(
- make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 0),
- make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 1),
- make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 2),
- make_tuple(&vp9_short_fht16x16_c, &vp9_iht16x16_256_add_c, 3)));
+ make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 0),
+ make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 1),
+ make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 2),
+ make_tuple(&vp9_fht16x16_c, &vp9_iht16x16_256_add_c, 3)));
+
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(
+ NEON, Trans16x16DCT,
+ ::testing::Values(
+ make_tuple(&vp9_fdct16x16_c,
+ &vp9_idct16x16_256_add_neon, 0)));
+#endif
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
@@ -515,9 +529,9 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
SSE2, Trans16x16HT,
::testing::Values(
- make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0),
- make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1),
- make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2),
- make_tuple(&vp9_short_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3)));
+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 0),
+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 1),
+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 2),
+ make_tuple(&vp9_fht16x16_sse2, &vp9_iht16x16_256_add_sse2, 3)));
#endif
} // namespace
diff --git a/libvpx/test/dct32x32_test.cc b/libvpx/test/dct32x32_test.cc
index 1e792da..013f451 100644
--- a/libvpx/test/dct32x32_test.cc
+++ b/libvpx/test/dct32x32_test.cc
@@ -18,12 +18,9 @@
#include "test/register_state_check.h"
#include "test/util.h"
-extern "C" {
#include "./vpx_config.h"
-#include "vp9/common/vp9_entropy.h"
#include "./vp9_rtcd.h"
-}
-
+#include "vp9/common/vp9_entropy.h"
#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
@@ -77,7 +74,9 @@ void reference_32x32_dct_2d(const int16_t input[kNumCoeffs],
typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride);
typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride);
-class Trans32x32Test : public PARAMS(fwd_txfm_t, inv_txfm_t, int) {
+typedef std::tr1::tuple<fwd_txfm_t, inv_txfm_t, int> trans_32x32_param_t;
+
+class Trans32x32Test : public ::testing::TestWithParam<trans_32x32_param_t> {
public:
virtual ~Trans32x32Test() {}
virtual void SetUp() {
@@ -249,6 +248,16 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&vp9_fdct32x32_c, &vp9_idct32x32_1024_add_c, 0),
make_tuple(&vp9_fdct32x32_rd_c, &vp9_idct32x32_1024_add_c, 1)));
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(
+ NEON, Trans32x32Test,
+ ::testing::Values(
+ make_tuple(&vp9_fdct32x32_c,
+ &vp9_idct32x32_1024_add_neon, 0),
+ make_tuple(&vp9_fdct32x32_rd_c,
+ &vp9_idct32x32_1024_add_neon, 1)));
+#endif
+
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
SSE2, Trans32x32Test,
@@ -258,4 +267,14 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(&vp9_fdct32x32_rd_sse2,
&vp9_idct32x32_1024_add_sse2, 1)));
#endif
+
+#if HAVE_AVX2
+INSTANTIATE_TEST_CASE_P(
+ AVX2, Trans32x32Test,
+ ::testing::Values(
+ make_tuple(&vp9_fdct32x32_avx2,
+ &vp9_idct32x32_1024_add_sse2, 0),
+ make_tuple(&vp9_fdct32x32_rd_avx2,
+ &vp9_idct32x32_1024_add_sse2, 1)));
+#endif
} // namespace
diff --git a/libvpx/test/decode_perf_test.cc b/libvpx/test/decode_perf_test.cc
new file mode 100644
index 0000000..a438261
--- /dev/null
+++ b/libvpx/test/decode_perf_test.cc
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "test/codec_factory.h"
+#include "test/decode_test_driver.h"
+#include "test/ivf_video_source.h"
+#include "test/md5_helper.h"
+#include "test/util.h"
+#include "test/webm_video_source.h"
+#include "vpx_ports/vpx_timer.h"
+#include "./vpx_version.h"
+
+using std::tr1::make_tuple;
+
+namespace {
+
+#define VIDEO_NAME 0
+#define THREADS 1
+
+const double kUsecsInSec = 1000000.0;
+
+/*
+ DecodePerfTest takes a tuple of filename + number of threads to decode with
+ */
+typedef std::tr1::tuple<const char *, unsigned> decode_perf_param_t;
+
+const decode_perf_param_t kVP9DecodePerfVectors[] = {
+ make_tuple("vp90-2-bbb_426x240_tile_1x1_180kbps.webm", 1),
+ make_tuple("vp90-2-bbb_640x360_tile_1x2_337kbps.webm", 2),
+ make_tuple("vp90-2-bbb_854x480_tile_1x2_651kbps.webm", 2),
+ make_tuple("vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm", 4),
+ make_tuple("vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm", 1),
+ make_tuple("vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm", 4),
+ make_tuple("vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm", 4),
+ make_tuple("vp90-2-sintel_426x182_tile_1x1_171kbps.webm", 1),
+ make_tuple("vp90-2-sintel_640x272_tile_1x2_318kbps.webm", 2),
+ make_tuple("vp90-2-sintel_854x364_tile_1x2_621kbps.webm", 2),
+ make_tuple("vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm", 4),
+ make_tuple("vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm", 4),
+ make_tuple("vp90-2-tos_426x178_tile_1x1_181kbps.webm", 1),
+ make_tuple("vp90-2-tos_640x266_tile_1x2_336kbps.webm", 2),
+ make_tuple("vp90-2-tos_854x356_tile_1x2_656kbps.webm", 2),
+ make_tuple("vp90-2-tos_1280x534_tile_1x4_1306kbps.webm", 4),
+ make_tuple("vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm", 4),
+};
+
+/*
+ In order to reflect real world performance as much as possible, Perf tests
+ *DO NOT* do any correctness checks. Please run them alongside correctness
+ tests to ensure proper codec integrity. Furthermore, in this test we
+ deliberately limit the amount of system calls we make to avoid OS
+ preemption.
+
+ TODO(joshualitt) create a more detailed perf measurement test to collect
+ power/temp/min max frame decode times/etc
+ */
+
+class DecodePerfTest : public ::testing::TestWithParam<decode_perf_param_t> {
+};
+
+TEST_P(DecodePerfTest, PerfTest) {
+ const char *const video_name = GET_PARAM(VIDEO_NAME);
+ const unsigned threads = GET_PARAM(THREADS);
+
+ libvpx_test::WebMVideoSource video(video_name);
+ video.Init();
+
+ vpx_codec_dec_cfg_t cfg = {0};
+ cfg.threads = threads;
+ libvpx_test::VP9Decoder decoder(cfg, 0);
+
+ vpx_usec_timer t;
+ vpx_usec_timer_start(&t);
+
+ for (video.Begin(); video.cxdata() != NULL; video.Next()) {
+ decoder.DecodeFrame(video.cxdata(), video.frame_size());
+ }
+
+ vpx_usec_timer_mark(&t);
+ const double elapsed_secs = double(vpx_usec_timer_elapsed(&t))
+ / kUsecsInSec;
+ const unsigned frames = video.frame_number();
+ const double fps = double(frames) / elapsed_secs;
+
+ printf("{\n");
+ printf("\t\"version\" : \"%s\",\n", VERSION_STRING_NOSP);
+ printf("\t\"videoName\" : \"%s\",\n", video_name);
+ printf("\t\"threadCount\" : %u,\n", threads);
+ printf("\t\"decodeTimeSecs\" : %f,\n", elapsed_secs);
+ printf("\t\"totalFrames\" : %u,\n", frames);
+ printf("\t\"framesPerSecond\" : %f\n", fps);
+ printf("}\n");
+}
+
+INSTANTIATE_TEST_CASE_P(VP9, DecodePerfTest,
+ ::testing::ValuesIn(kVP9DecodePerfVectors));
+
+} // namespace
diff --git a/libvpx/test/decode_test_driver.cc b/libvpx/test/decode_test_driver.cc
index 1f6d540..e667d1d 100644
--- a/libvpx/test/decode_test_driver.cc
+++ b/libvpx/test/decode_test_driver.cc
@@ -15,11 +15,13 @@
namespace libvpx_test {
-vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, int size) {
+vpx_codec_err_t Decoder::DecodeFrame(const uint8_t *cxdata, size_t size) {
vpx_codec_err_t res_dec;
InitOnce();
- REGISTER_STATE_CHECK(res_dec = vpx_codec_decode(&decoder_,
- cxdata, size, NULL, 0));
+ REGISTER_STATE_CHECK(
+ res_dec = vpx_codec_decode(&decoder_,
+ cxdata, static_cast<unsigned int>(size),
+ NULL, 0));
return res_dec;
}
@@ -30,6 +32,7 @@ void DecoderTest::RunLoop(CompressedVideoSource *video) {
// Decode frames.
for (video->Begin(); video->cxdata(); video->Next()) {
+ PreDecodeFrameHook(*video, decoder);
vpx_codec_err_t res_dec = decoder->DecodeFrame(video->cxdata(),
video->frame_size());
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder->DecodeError();
diff --git a/libvpx/test/decode_test_driver.h b/libvpx/test/decode_test_driver.h
index 055c45e..2734a45 100644
--- a/libvpx/test/decode_test_driver.h
+++ b/libvpx/test/decode_test_driver.h
@@ -49,7 +49,7 @@ class Decoder {
vpx_codec_destroy(&decoder_);
}
- vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, int size);
+ vpx_codec_err_t DecodeFrame(const uint8_t *cxdata, size_t size);
DxDataIterator GetDxData() {
return DxDataIterator(&decoder_);
@@ -76,8 +76,17 @@ class Decoder {
return detail ? detail : vpx_codec_error(&decoder_);
}
+ // Passes the external frame buffer information to libvpx.
+ vpx_codec_err_t SetFrameBufferFunctions(
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *user_priv) {
+ InitOnce();
+ return vpx_codec_set_frame_buffer_functions(
+ &decoder_, cb_get, cb_release, user_priv);
+ }
+
protected:
- virtual const vpx_codec_iface_t* CodecInterface() const = 0;
+ virtual vpx_codec_iface_t* CodecInterface() const = 0;
void InitOnce() {
if (!init_done_) {
@@ -101,6 +110,10 @@ class DecoderTest {
// Main decoding loop
virtual void RunLoop(CompressedVideoSource *video);
+ // Hook to be called before decompressing every frame.
+ virtual void PreDecodeFrameHook(const CompressedVideoSource& video,
+ Decoder *decoder) {}
+
// Hook to be called on every decompressed frame.
virtual void DecompressedFrameHook(const vpx_image_t& img,
const unsigned int frame_number) {}
diff --git a/libvpx/test/encode_test_driver.h b/libvpx/test/encode_test_driver.h
index dbdc33c..9526068 100644
--- a/libvpx/test/encode_test_driver.h
+++ b/libvpx/test/encode_test_driver.h
@@ -16,6 +16,9 @@
#include "./vpx_config.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "vpx/vpx_encoder.h"
+#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
+#include "vpx/vp8cx.h"
+#endif
namespace libvpx_test {
@@ -123,12 +126,24 @@ class Encoder {
ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
}
+ void Control(int ctrl_id, struct vpx_svc_layer_id *arg) {
+ const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
+ ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
+ }
+
+#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
+ void Control(int ctrl_id, vpx_active_map_t *arg) {
+ const vpx_codec_err_t res = vpx_codec_control_(&encoder_, ctrl_id, arg);
+ ASSERT_EQ(VPX_CODEC_OK, res) << EncoderError();
+ }
+#endif
+
void set_deadline(unsigned long deadline) {
deadline_ = deadline;
}
protected:
- virtual const vpx_codec_iface_t* CodecInterface() const = 0;
+ virtual vpx_codec_iface_t* CodecInterface() const = 0;
const char *EncoderError() {
const char *detail = vpx_codec_error_detail(&encoder_);
diff --git a/libvpx/test/error_resilience_test.cc b/libvpx/test/error_resilience_test.cc
index 16d250c..89684f8 100644
--- a/libvpx/test/error_resilience_test.cc
+++ b/libvpx/test/error_resilience_test.cc
@@ -1,12 +1,12 @@
/*
- Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-
- Use of this source code is governed by a BSD-style license
- that can be found in the LICENSE file in the root of the source
- tree. An additional intellectual property rights grant can be found
- in the file PATENTS. All contributing project authors may
- be found in the AUTHORS file in the root of the source tree.
-*/
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
@@ -16,22 +16,23 @@
namespace {
-const int kMaxErrorFrames = 8;
-const int kMaxDroppableFrames = 8;
+const int kMaxErrorFrames = 12;
+const int kMaxDroppableFrames = 12;
-class ErrorResilienceTest : public ::libvpx_test::EncoderTest,
+class ErrorResilienceTestLarge : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
- ErrorResilienceTest() : EncoderTest(GET_PARAM(0)),
- psnr_(0.0),
- nframes_(0),
- mismatch_psnr_(0.0),
- mismatch_nframes_(0),
- encoding_mode_(GET_PARAM(1)) {
+ ErrorResilienceTestLarge()
+ : EncoderTest(GET_PARAM(0)),
+ psnr_(0.0),
+ nframes_(0),
+ mismatch_psnr_(0.0),
+ mismatch_nframes_(0),
+ encoding_mode_(GET_PARAM(1)) {
Reset();
}
- virtual ~ErrorResilienceTest() {}
+ virtual ~ErrorResilienceTestLarge() {}
void Reset() {
error_nframes_ = 0;
@@ -144,7 +145,7 @@ class ErrorResilienceTest : public ::libvpx_test::EncoderTest,
libvpx_test::TestMode encoding_mode_;
};
-TEST_P(ErrorResilienceTest, OnVersusOff) {
+TEST_P(ErrorResilienceTestLarge, OnVersusOff) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 2000;
@@ -175,7 +176,11 @@ TEST_P(ErrorResilienceTest, OnVersusOff) {
}
}
-TEST_P(ErrorResilienceTest, DropFramesWithoutRecovery) {
+// Check for successful decoding and no encoder/decoder mismatch
+// if we lose (i.e., drop before decoding) a set of droppable
+// frames (i.e., frames that don't update any reference buffers).
+// Check both isolated and consecutive loss.
+TEST_P(ErrorResilienceTestLarge, DropFramesWithoutRecovery) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 500;
@@ -186,14 +191,18 @@ TEST_P(ErrorResilienceTest, DropFramesWithoutRecovery) {
init_flags_ = VPX_CODEC_USE_PSNR;
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
- timebase.den, timebase.num, 0, 30);
+ timebase.den, timebase.num, 0, 40);
// Error resilient mode ON.
cfg_.g_error_resilient = 1;
-
- // Set an arbitrary set of error frames same as droppable frames
- unsigned int num_droppable_frames = 2;
- unsigned int droppable_frame_list[] = {5, 16};
+ cfg_.kf_mode = VPX_KF_DISABLED;
+
+ // Set an arbitrary set of error frames same as droppable frames.
+ // In addition to isolated loss/drop, add a long consecutive series
+ // (of size 9) of dropped frames.
+ unsigned int num_droppable_frames = 11;
+ unsigned int droppable_frame_list[] = {5, 16, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30};
SetDroppableFrames(num_droppable_frames, droppable_frame_list);
SetErrorFrames(num_droppable_frames, droppable_frame_list);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
@@ -202,7 +211,7 @@ TEST_P(ErrorResilienceTest, DropFramesWithoutRecovery) {
<< GetMismatchFrames() << "\n";
EXPECT_EQ(GetMismatchFrames(), (unsigned int) 0);
- // reset previously set error/droppable frames
+ // Reset previously set of error/droppable frames.
Reset();
#if 0
@@ -227,7 +236,7 @@ TEST_P(ErrorResilienceTest, DropFramesWithoutRecovery) {
#endif
}
-VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTest, ONE_PASS_TEST_MODES);
-VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTest, ONE_PASS_TEST_MODES);
+VP8_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
+VP9_INSTANTIATE_TEST_CASE(ErrorResilienceTestLarge, ONE_PASS_TEST_MODES);
} // namespace
diff --git a/libvpx/test/external_frame_buffer_test.cc b/libvpx/test/external_frame_buffer_test.cc
new file mode 100644
index 0000000..2e7adc1
--- /dev/null
+++ b/libvpx/test/external_frame_buffer_test.cc
@@ -0,0 +1,466 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <string>
+
+#include "test/codec_factory.h"
+#include "test/decode_test_driver.h"
+#include "test/ivf_video_source.h"
+#include "test/md5_helper.h"
+#include "test/test_vectors.h"
+#include "test/util.h"
+#include "test/webm_video_source.h"
+
+namespace {
+
+const int kVideoNameParam = 1;
+const char kVP9TestFile[] = "vp90-2-02-size-lf-1920x1080.webm";
+
+struct ExternalFrameBuffer {
+ uint8_t *data;
+ size_t size;
+ int in_use;
+};
+
+// Class to manipulate a list of external frame buffers.
+class ExternalFrameBufferList {
+ public:
+ ExternalFrameBufferList()
+ : num_buffers_(0),
+ ext_fb_list_(NULL) {}
+
+ virtual ~ExternalFrameBufferList() {
+ for (int i = 0; i < num_buffers_; ++i) {
+ delete [] ext_fb_list_[i].data;
+ }
+ delete [] ext_fb_list_;
+ }
+
+ // Creates the list to hold the external buffers. Returns true on success.
+ bool CreateBufferList(int num_buffers) {
+ if (num_buffers < 0)
+ return false;
+
+ num_buffers_ = num_buffers;
+ ext_fb_list_ = new ExternalFrameBuffer[num_buffers_];
+ EXPECT_TRUE(ext_fb_list_ != NULL);
+ memset(ext_fb_list_, 0, sizeof(ext_fb_list_[0]) * num_buffers_);
+ return true;
+ }
+
+ // Searches the frame buffer list for a free frame buffer. Makes sure
+ // that the frame buffer is at least |min_size| in bytes. Marks that the
+ // frame buffer is in use by libvpx. Finally sets |fb| to point to the
+ // external frame buffer. Returns < 0 on an error.
+ int GetFreeFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
+ EXPECT_TRUE(fb != NULL);
+ const int idx = FindFreeBufferIndex();
+ if (idx == num_buffers_)
+ return -1;
+
+ if (ext_fb_list_[idx].size < min_size) {
+ delete [] ext_fb_list_[idx].data;
+ ext_fb_list_[idx].data = new uint8_t[min_size];
+ ext_fb_list_[idx].size = min_size;
+ }
+
+ SetFrameBuffer(idx, fb);
+ return 0;
+ }
+
+ // Test function that will not allocate any data for the frame buffer.
+ // Returns < 0 on an error.
+ int GetZeroFrameBuffer(size_t min_size, vpx_codec_frame_buffer_t *fb) {
+ EXPECT_TRUE(fb != NULL);
+ const int idx = FindFreeBufferIndex();
+ if (idx == num_buffers_)
+ return -1;
+
+ if (ext_fb_list_[idx].size < min_size) {
+ delete [] ext_fb_list_[idx].data;
+ ext_fb_list_[idx].data = NULL;
+ ext_fb_list_[idx].size = min_size;
+ }
+
+ SetFrameBuffer(idx, fb);
+ return 0;
+ }
+
+ // Marks the external frame buffer that |fb| is pointing too as free.
+ // Returns < 0 on an error.
+ int ReturnFrameBuffer(vpx_codec_frame_buffer_t *fb) {
+ EXPECT_TRUE(fb != NULL);
+ ExternalFrameBuffer *const ext_fb =
+ reinterpret_cast<ExternalFrameBuffer*>(fb->priv);
+ EXPECT_TRUE(ext_fb != NULL);
+ EXPECT_EQ(1, ext_fb->in_use);
+ ext_fb->in_use = 0;
+ return 0;
+ }
+
+ // Checks that the ximage data is contained within the external frame buffer
+ // private data passed back in the ximage.
+ void CheckXImageFrameBuffer(const vpx_image_t *img) {
+ if (img->fb_priv != NULL) {
+ const struct ExternalFrameBuffer *const ext_fb =
+ reinterpret_cast<ExternalFrameBuffer*>(img->fb_priv);
+
+ ASSERT_TRUE(img->planes[0] >= ext_fb->data &&
+ img->planes[0] < (ext_fb->data + ext_fb->size));
+ }
+ }
+
+ private:
+ // Returns the index of the first free frame buffer. Returns |num_buffers_|
+ // if there are no free frame buffers.
+ int FindFreeBufferIndex() {
+ int i;
+ // Find a free frame buffer.
+ for (i = 0; i < num_buffers_; ++i) {
+ if (!ext_fb_list_[i].in_use)
+ break;
+ }
+ return i;
+ }
+
+ // Sets |fb| to an external frame buffer. idx is the index into the frame
+ // buffer list.
+ void SetFrameBuffer(int idx, vpx_codec_frame_buffer_t *fb) {
+ ASSERT_TRUE(fb != NULL);
+ fb->data = ext_fb_list_[idx].data;
+ fb->size = ext_fb_list_[idx].size;
+ ASSERT_EQ(0, ext_fb_list_[idx].in_use);
+ ext_fb_list_[idx].in_use = 1;
+ fb->priv = &ext_fb_list_[idx];
+ }
+
+ int num_buffers_;
+ ExternalFrameBuffer *ext_fb_list_;
+};
+
+// Callback used by libvpx to request the application to return a frame
+// buffer of at least |min_size| in bytes.
+int get_vp9_frame_buffer(void *user_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb) {
+ ExternalFrameBufferList *const fb_list =
+ reinterpret_cast<ExternalFrameBufferList*>(user_priv);
+ return fb_list->GetFreeFrameBuffer(min_size, fb);
+}
+
+// Callback used by libvpx to tell the application that |fb| is not needed
+// anymore.
+int release_vp9_frame_buffer(void *user_priv,
+ vpx_codec_frame_buffer_t *fb) {
+ ExternalFrameBufferList *const fb_list =
+ reinterpret_cast<ExternalFrameBufferList*>(user_priv);
+ return fb_list->ReturnFrameBuffer(fb);
+}
+
+// Callback will not allocate data for frame buffer.
+int get_vp9_zero_frame_buffer(void *user_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb) {
+ ExternalFrameBufferList *const fb_list =
+ reinterpret_cast<ExternalFrameBufferList*>(user_priv);
+ return fb_list->GetZeroFrameBuffer(min_size, fb);
+}
+
+// Callback will allocate one less byte than |min_size|.
+int get_vp9_one_less_byte_frame_buffer(void *user_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb) {
+ ExternalFrameBufferList *const fb_list =
+ reinterpret_cast<ExternalFrameBufferList*>(user_priv);
+ return fb_list->GetFreeFrameBuffer(min_size - 1, fb);
+}
+
+// Callback will not release the external frame buffer.
+int do_not_release_vp9_frame_buffer(void *user_priv,
+ vpx_codec_frame_buffer_t *fb) {
+ (void)user_priv;
+ (void)fb;
+ return 0;
+}
+
+// Class for testing passing in external frame buffers to libvpx.
+class ExternalFrameBufferMD5Test
+ : public ::libvpx_test::DecoderTest,
+ public ::libvpx_test::CodecTestWithParam<const char*> {
+ protected:
+ ExternalFrameBufferMD5Test()
+ : DecoderTest(GET_PARAM(::libvpx_test::kCodecFactoryParam)),
+ md5_file_(NULL),
+ num_buffers_(0) {}
+
+ virtual ~ExternalFrameBufferMD5Test() {
+ if (md5_file_ != NULL)
+ fclose(md5_file_);
+ }
+
+ virtual void PreDecodeFrameHook(
+ const libvpx_test::CompressedVideoSource &video,
+ libvpx_test::Decoder *decoder) {
+ if (num_buffers_ > 0 && video.frame_number() == 0) {
+ // Have libvpx use frame buffers we create.
+ ASSERT_TRUE(fb_list_.CreateBufferList(num_buffers_));
+ ASSERT_EQ(VPX_CODEC_OK,
+ decoder->SetFrameBufferFunctions(
+ GetVp9FrameBuffer, ReleaseVP9FrameBuffer, this));
+ }
+ }
+
+ void OpenMD5File(const std::string &md5_file_name_) {
+ md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
+ ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: "
+ << md5_file_name_;
+ }
+
+ virtual void DecompressedFrameHook(const vpx_image_t &img,
+ const unsigned int frame_number) {
+ ASSERT_TRUE(md5_file_ != NULL);
+ char expected_md5[33];
+ char junk[128];
+
+ // Read correct md5 checksums.
+ const int res = fscanf(md5_file_, "%s %s", expected_md5, junk);
+ ASSERT_NE(EOF, res) << "Read md5 data failed";
+ expected_md5[32] = '\0';
+
+ ::libvpx_test::MD5 md5_res;
+ md5_res.Add(&img);
+ const char *const actual_md5 = md5_res.Get();
+
+ // Check md5 match.
+ ASSERT_STREQ(expected_md5, actual_md5)
+ << "Md5 checksums don't match: frame number = " << frame_number;
+ }
+
+ // Callback to get a free external frame buffer. Return value < 0 is an
+ // error.
+ static int GetVp9FrameBuffer(void *user_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb) {
+ ExternalFrameBufferMD5Test *const md5Test =
+ reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv);
+ return md5Test->fb_list_.GetFreeFrameBuffer(min_size, fb);
+ }
+
+ // Callback to release an external frame buffer. Return value < 0 is an
+ // error.
+ static int ReleaseVP9FrameBuffer(void *user_priv,
+ vpx_codec_frame_buffer_t *fb) {
+ ExternalFrameBufferMD5Test *const md5Test =
+ reinterpret_cast<ExternalFrameBufferMD5Test*>(user_priv);
+ return md5Test->fb_list_.ReturnFrameBuffer(fb);
+ }
+
+ void set_num_buffers(int num_buffers) { num_buffers_ = num_buffers; }
+ int num_buffers() const { return num_buffers_; }
+
+ private:
+ FILE *md5_file_;
+ int num_buffers_;
+ ExternalFrameBufferList fb_list_;
+};
+
+// Class for testing passing in external frame buffers to libvpx.
+class ExternalFrameBufferTest : public ::testing::Test {
+ protected:
+ ExternalFrameBufferTest()
+ : video_(NULL),
+ decoder_(NULL),
+ num_buffers_(0) {}
+
+ virtual void SetUp() {
+ video_ = new libvpx_test::WebMVideoSource(kVP9TestFile);
+ ASSERT_TRUE(video_ != NULL);
+ video_->Init();
+ video_->Begin();
+
+ vpx_codec_dec_cfg_t cfg = {0};
+ decoder_ = new libvpx_test::VP9Decoder(cfg, 0);
+ ASSERT_TRUE(decoder_ != NULL);
+ }
+
+ virtual void TearDown() {
+ delete decoder_;
+ delete video_;
+ }
+
+ // Passes the external frame buffer information to libvpx.
+ vpx_codec_err_t SetFrameBufferFunctions(
+ int num_buffers,
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release) {
+ if (num_buffers > 0) {
+ num_buffers_ = num_buffers;
+ EXPECT_TRUE(fb_list_.CreateBufferList(num_buffers_));
+ }
+
+ return decoder_->SetFrameBufferFunctions(cb_get, cb_release, &fb_list_);
+ }
+
+ vpx_codec_err_t DecodeOneFrame() {
+ const vpx_codec_err_t res =
+ decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
+ CheckDecodedFrames();
+ if (res == VPX_CODEC_OK)
+ video_->Next();
+ return res;
+ }
+
+ vpx_codec_err_t DecodeRemainingFrames() {
+ for (; video_->cxdata() != NULL; video_->Next()) {
+ const vpx_codec_err_t res =
+ decoder_->DecodeFrame(video_->cxdata(), video_->frame_size());
+ if (res != VPX_CODEC_OK)
+ return res;
+ CheckDecodedFrames();
+ }
+ return VPX_CODEC_OK;
+ }
+
+ private:
+ void CheckDecodedFrames() {
+ libvpx_test::DxDataIterator dec_iter = decoder_->GetDxData();
+ const vpx_image_t *img = NULL;
+
+ // Get decompressed data
+ while ((img = dec_iter.Next()) != NULL) {
+ fb_list_.CheckXImageFrameBuffer(img);
+ }
+ }
+
+ libvpx_test::WebMVideoSource *video_;
+ libvpx_test::VP9Decoder *decoder_;
+ int num_buffers_;
+ ExternalFrameBufferList fb_list_;
+};
+
+// This test runs through the set of test vectors, and decodes them.
+// Libvpx will call into the application to allocate a frame buffer when
+// needed. The md5 checksums are computed for each frame in the video file.
+// If md5 checksums match the correct md5 data, then the test is passed.
+// Otherwise, the test failed.
+TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
+ const std::string filename = GET_PARAM(kVideoNameParam);
+ libvpx_test::CompressedVideoSource *video = NULL;
+
+ // Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
+ // #VPX_MAXIMUM_WORK_BUFFERS + four jitter buffers.
+ const int jitter_buffers = 4;
+ const int num_buffers =
+ VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
+ set_num_buffers(num_buffers);
+
+#if CONFIG_VP8_DECODER
+ // Tell compiler we are not using kVP8TestVectors.
+ (void)libvpx_test::kVP8TestVectors;
+#endif
+
+ // Open compressed video file.
+ if (filename.substr(filename.length() - 3, 3) == "ivf") {
+ video = new libvpx_test::IVFVideoSource(filename);
+ } else {
+ video = new libvpx_test::WebMVideoSource(filename);
+ }
+ ASSERT_TRUE(video != NULL);
+ video->Init();
+
+ // Construct md5 file name.
+ const std::string md5_filename = filename + ".md5";
+ OpenMD5File(md5_filename);
+
+ // Decode frame, and check the md5 matching.
+ ASSERT_NO_FATAL_FAILURE(RunLoop(video));
+ delete video;
+}
+
+TEST_F(ExternalFrameBufferTest, MinFrameBuffers) {
+ // Minimum number of external frame buffers for VP9 is
+ // #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS.
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_OK,
+ SetFrameBufferFunctions(
+ num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
+ ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
+}
+
+TEST_F(ExternalFrameBufferTest, EightJitterBuffers) {
+ // Number of buffers equals #VP9_MAXIMUM_REF_BUFFERS +
+ // #VPX_MAXIMUM_WORK_BUFFERS + eight jitter buffers.
+ const int jitter_buffers = 8;
+ const int num_buffers =
+ VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS + jitter_buffers;
+ ASSERT_EQ(VPX_CODEC_OK,
+ SetFrameBufferFunctions(
+ num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
+ ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames());
+}
+
+TEST_F(ExternalFrameBufferTest, NotEnoughBuffers) {
+ // Minimum number of external frame buffers for VP9 is
+ // #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS. Most files will
+ // only use 5 frame buffers at one time.
+ const int num_buffers = 2;
+ ASSERT_EQ(VPX_CODEC_OK,
+ SetFrameBufferFunctions(
+ num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
+ ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
+ ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeRemainingFrames());
+}
+
+TEST_F(ExternalFrameBufferTest, NoRelease) {
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_OK,
+ SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer,
+ do_not_release_vp9_frame_buffer));
+ ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
+ ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeRemainingFrames());
+}
+
+TEST_F(ExternalFrameBufferTest, NullRealloc) {
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_OK,
+ SetFrameBufferFunctions(num_buffers, get_vp9_zero_frame_buffer,
+ release_vp9_frame_buffer));
+ ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame());
+}
+
+TEST_F(ExternalFrameBufferTest, ReallocOneLessByte) {
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_OK,
+ SetFrameBufferFunctions(
+ num_buffers, get_vp9_one_less_byte_frame_buffer,
+ release_vp9_frame_buffer));
+ ASSERT_EQ(VPX_CODEC_MEM_ERROR, DecodeOneFrame());
+}
+
+TEST_F(ExternalFrameBufferTest, NullGetFunction) {
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
+ SetFrameBufferFunctions(num_buffers, NULL,
+ release_vp9_frame_buffer));
+}
+
+TEST_F(ExternalFrameBufferTest, NullReleaseFunction) {
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_INVALID_PARAM,
+ SetFrameBufferFunctions(num_buffers, get_vp9_frame_buffer, NULL));
+}
+
+TEST_F(ExternalFrameBufferTest, SetAfterDecode) {
+ const int num_buffers = VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ ASSERT_EQ(VPX_CODEC_OK, DecodeOneFrame());
+ ASSERT_EQ(VPX_CODEC_ERROR,
+ SetFrameBufferFunctions(
+ num_buffers, get_vp9_frame_buffer, release_vp9_frame_buffer));
+}
+
+VP9_INSTANTIATE_TEST_CASE(ExternalFrameBufferMD5Test,
+ ::testing::ValuesIn(libvpx_test::kVP9TestVectors));
+} // namespace
diff --git a/libvpx/test/fdct4x4_test.cc b/libvpx/test/fdct4x4_test.cc
index 9d8b0bd..127775c 100644
--- a/libvpx/test/fdct4x4_test.cc
+++ b/libvpx/test/fdct4x4_test.cc
@@ -18,12 +18,13 @@
#include "test/register_state_check.h"
#include "test/util.h"
-extern "C" {
-#include "vp9/common/vp9_entropy.h"
#include "./vp9_rtcd.h"
+#include "vp9/common/vp9_entropy.h"
+#include "vpx/vpx_integer.h"
+
+extern "C" {
void vp9_idct4x4_16_add_c(const int16_t *input, uint8_t *output, int pitch);
}
-#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
@@ -36,12 +37,15 @@ typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride,
typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride,
int tx_type);
+typedef std::tr1::tuple<fdct_t, idct_t, int> dct_4x4_param_t;
+typedef std::tr1::tuple<fht_t, iht_t, int> ht_4x4_param_t;
+
void fdct4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
vp9_fdct4x4_c(in, out, stride);
}
void fht4x4_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
- vp9_short_fht4x4_c(in, out, stride, tx_type);
+ vp9_fht4x4_c(in, out, stride, tx_type);
}
class Trans4x4TestBase {
@@ -183,7 +187,7 @@ class Trans4x4TestBase {
class Trans4x4DCT
: public Trans4x4TestBase,
- public PARAMS(fdct_t, idct_t, int) {
+ public ::testing::TestWithParam<dct_4x4_param_t> {
public:
virtual ~Trans4x4DCT() {}
@@ -226,7 +230,7 @@ TEST_P(Trans4x4DCT, InvAccuracyCheck) {
class Trans4x4HT
: public Trans4x4TestBase,
- public PARAMS(fht_t, iht_t, int) {
+ public ::testing::TestWithParam<ht_4x4_param_t> {
public:
virtual ~Trans4x4HT() {}
@@ -277,10 +281,25 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
C, Trans4x4HT,
::testing::Values(
- make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 0),
- make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 1),
- make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 2),
- make_tuple(&vp9_short_fht4x4_c, &vp9_iht4x4_16_add_c, 3)));
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 0),
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 1),
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 2),
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_c, 3)));
+
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(
+ NEON, Trans4x4DCT,
+ ::testing::Values(
+ make_tuple(&vp9_fdct4x4_c,
+ &vp9_idct4x4_16_add_neon, 0)));
+INSTANTIATE_TEST_CASE_P(
+ DISABLED_NEON, Trans4x4HT,
+ ::testing::Values(
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 0),
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 1),
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 2),
+ make_tuple(&vp9_fht4x4_c, &vp9_iht4x4_16_add_neon, 3)));
+#endif
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
@@ -291,10 +310,10 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
SSE2, Trans4x4HT,
::testing::Values(
- make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 0),
- make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 1),
- make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 2),
- make_tuple(&vp9_short_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 3)));
+ make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 0),
+ make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 1),
+ make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 2),
+ make_tuple(&vp9_fht4x4_sse2, &vp9_iht4x4_16_add_sse2, 3)));
#endif
} // namespace
diff --git a/libvpx/test/fdct8x8_test.cc b/libvpx/test/fdct8x8_test.cc
index 3777b11..6f2d7d1 100644
--- a/libvpx/test/fdct8x8_test.cc
+++ b/libvpx/test/fdct8x8_test.cc
@@ -18,12 +18,13 @@
#include "test/register_state_check.h"
#include "test/util.h"
-extern "C" {
-#include "vp9/common/vp9_entropy.h"
#include "./vp9_rtcd.h"
+#include "vp9/common/vp9_entropy.h"
+#include "vpx/vpx_integer.h"
+
+extern "C" {
void vp9_idct8x8_64_add_c(const int16_t *input, uint8_t *output, int pitch);
}
-#include "vpx/vpx_integer.h"
using libvpx_test::ACMRandom;
@@ -35,12 +36,15 @@ typedef void (*fht_t) (const int16_t *in, int16_t *out, int stride,
typedef void (*iht_t) (const int16_t *in, uint8_t *out, int stride,
int tx_type);
+typedef std::tr1::tuple<fdct_t, idct_t, int> dct_8x8_param_t;
+typedef std::tr1::tuple<fht_t, iht_t, int> ht_8x8_param_t;
+
void fdct8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
vp9_fdct8x8_c(in, out, stride);
}
void fht8x8_ref(const int16_t *in, int16_t *out, int stride, int tx_type) {
- vp9_short_fht8x8_c(in, out, stride, tx_type);
+ vp9_fht8x8_c(in, out, stride, tx_type);
}
class FwdTrans8x8TestBase {
@@ -215,8 +219,9 @@ class FwdTrans8x8TestBase {
fht_t fwd_txfm_ref;
};
-class FwdTrans8x8DCT : public FwdTrans8x8TestBase,
- public PARAMS(fdct_t, idct_t, int) {
+class FwdTrans8x8DCT
+ : public FwdTrans8x8TestBase,
+ public ::testing::TestWithParam<dct_8x8_param_t> {
public:
virtual ~FwdTrans8x8DCT() {}
@@ -254,8 +259,9 @@ TEST_P(FwdTrans8x8DCT, ExtremalCheck) {
RunExtremalCheck();
}
-class FwdTrans8x8HT : public FwdTrans8x8TestBase,
- public PARAMS(fht_t, iht_t, int) {
+class FwdTrans8x8HT
+ : public FwdTrans8x8TestBase,
+ public ::testing::TestWithParam<ht_8x8_param_t> {
public:
virtual ~FwdTrans8x8HT() {}
@@ -302,10 +308,24 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
C, FwdTrans8x8HT,
::testing::Values(
- make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 0),
- make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 1),
- make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 2),
- make_tuple(&vp9_short_fht8x8_c, &vp9_iht8x8_64_add_c, 3)));
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 0),
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 1),
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 2),
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_c, 3)));
+
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(
+ NEON, FwdTrans8x8DCT,
+ ::testing::Values(
+ make_tuple(&vp9_fdct8x8_c, &vp9_idct8x8_64_add_neon, 0)));
+INSTANTIATE_TEST_CASE_P(
+ DISABLED_NEON, FwdTrans8x8HT,
+ ::testing::Values(
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 0),
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 1),
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 2),
+ make_tuple(&vp9_fht8x8_c, &vp9_iht8x8_64_add_neon, 3)));
+#endif
#if HAVE_SSE2
INSTANTIATE_TEST_CASE_P(
@@ -315,9 +335,9 @@ INSTANTIATE_TEST_CASE_P(
INSTANTIATE_TEST_CASE_P(
SSE2, FwdTrans8x8HT,
::testing::Values(
- make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0),
- make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 1),
- make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 2),
- make_tuple(&vp9_short_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 3)));
+ make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 0),
+ make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 1),
+ make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 2),
+ make_tuple(&vp9_fht8x8_sse2, &vp9_iht8x8_64_add_sse2, 3)));
#endif
} // namespace
diff --git a/libvpx/test/i420_video_source.h b/libvpx/test/i420_video_source.h
index 2bf2a03..c3315f9 100644
--- a/libvpx/test/i420_video_source.h
+++ b/libvpx/test/i420_video_source.h
@@ -52,7 +52,7 @@ class I420VideoSource : public VideoSource {
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
<< file_name_;
if (start_) {
- fseek(input_file_, raw_sz_ * start_, SEEK_SET);
+ fseek(input_file_, static_cast<unsigned>(raw_sz_) * start_, SEEK_SET);
}
frame_ = start_;
diff --git a/libvpx/test/idct8x8_test.cc b/libvpx/test/idct8x8_test.cc
index d8c61ff..5f4c33a 100644
--- a/libvpx/test/idct8x8_test.cc
+++ b/libvpx/test/idct8x8_test.cc
@@ -14,9 +14,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
-extern "C" {
#include "./vp9_rtcd.h"
-}
#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
diff --git a/libvpx/test/idct_test.cc b/libvpx/test/idct_test.cc
index 2c7fa0e..1bbf80a 100644
--- a/libvpx/test/idct_test.cc
+++ b/libvpx/test/idct_test.cc
@@ -8,10 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-extern "C" {
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
-}
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
diff --git a/libvpx/test/intrapred_test.cc b/libvpx/test/intrapred_test.cc
index 5fba700..cefe192 100644
--- a/libvpx/test/intrapred_test.cc
+++ b/libvpx/test/intrapred_test.cc
@@ -14,12 +14,11 @@
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
-extern "C" {
+
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
#include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h"
-}
namespace {
@@ -27,11 +26,7 @@ using libvpx_test::ACMRandom;
class IntraPredBase {
public:
- virtual ~IntraPredBase() {}
-
- virtual void TearDown() {
- libvpx_test::ClearSystemState();
- }
+ virtual ~IntraPredBase() { libvpx_test::ClearSystemState(); }
protected:
void SetupMacroblock(MACROBLOCKD *mbptr,
@@ -228,8 +223,9 @@ typedef void (*intra_pred_y_fn_t)(MACROBLOCKD *x,
uint8_t *ypred_ptr,
int y_stride);
-class IntraPredYTest : public ::testing::TestWithParam<intra_pred_y_fn_t>,
- protected IntraPredBase {
+class IntraPredYTest
+ : public IntraPredBase,
+ public ::testing::TestWithParam<intra_pred_y_fn_t> {
public:
static void SetUpTestCase() {
mb_ = reinterpret_cast<MACROBLOCKD*>(
@@ -309,8 +305,9 @@ typedef void (*intra_pred_uv_fn_t)(MACROBLOCKD *x,
uint8_t *vpred_ptr,
int pred_stride);
-class IntraPredUVTest : public ::testing::TestWithParam<intra_pred_uv_fn_t>,
- protected IntraPredBase {
+class IntraPredUVTest
+ : public IntraPredBase,
+ public ::testing::TestWithParam<intra_pred_uv_fn_t> {
public:
static void SetUpTestCase() {
mb_ = reinterpret_cast<MACROBLOCKD*>(
diff --git a/libvpx/test/ivf_video_source.h b/libvpx/test/ivf_video_source.h
index 3fbafbd..824a39d 100644
--- a/libvpx/test/ivf_video_source.h
+++ b/libvpx/test/ivf_video_source.h
@@ -94,14 +94,14 @@ class IVFVideoSource : public CompressedVideoSource {
virtual const uint8_t *cxdata() const {
return end_of_file_ ? NULL : compressed_frame_buf_;
}
- virtual const unsigned int frame_size() const { return frame_sz_; }
- virtual const unsigned int frame_number() const { return frame_; }
+ virtual size_t frame_size() const { return frame_sz_; }
+ virtual unsigned int frame_number() const { return frame_; }
protected:
std::string file_name_;
FILE *input_file_;
uint8_t *compressed_frame_buf_;
- unsigned int frame_sz_;
+ size_t frame_sz_;
unsigned int frame_;
bool end_of_file_;
};
diff --git a/libvpx/test/keyframe_test.cc b/libvpx/test/keyframe_test.cc
index 7ee2898..d8b21a1 100644
--- a/libvpx/test/keyframe_test.cc
+++ b/libvpx/test/keyframe_test.cc
@@ -21,6 +21,7 @@ class KeyframeTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
KeyframeTest() : EncoderTest(GET_PARAM(0)) {}
+ virtual ~KeyframeTest() {}
virtual void SetUp() {
InitializeConfig();
diff --git a/libvpx/test/md5_helper.h b/libvpx/test/md5_helper.h
index 289f608..dd446f4 100644
--- a/libvpx/test/md5_helper.h
+++ b/libvpx/test/md5_helper.h
@@ -11,10 +11,8 @@
#ifndef TEST_MD5_HELPER_H_
#define TEST_MD5_HELPER_H_
-extern "C" {
#include "./md5_utils.h"
#include "vpx/vpx_decoder.h"
-}
namespace libvpx_test {
class MD5 {
diff --git a/libvpx/test/partial_idct_test.cc b/libvpx/test/partial_idct_test.cc
new file mode 100644
index 0000000..8849ce6
--- /dev/null
+++ b/libvpx/test/partial_idct_test.cc
@@ -0,0 +1,193 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <math.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "third_party/googletest/src/include/gtest/gtest.h"
+#include "test/acm_random.h"
+#include "test/clear_system_state.h"
+#include "test/register_state_check.h"
+#include "test/util.h"
+
+#include "./vp9_rtcd.h"
+#include "vp9/common/vp9_blockd.h"
+#include "vp9/common/vp9_scan.h"
+#include "vpx/vpx_integer.h"
+
+using libvpx_test::ACMRandom;
+
+namespace {
+typedef void (*fwd_txfm_t)(const int16_t *in, int16_t *out, int stride);
+typedef void (*inv_txfm_t)(const int16_t *in, uint8_t *out, int stride);
+typedef std::tr1::tuple<inv_txfm_t,
+ inv_txfm_t,
+ TX_SIZE, int> partial_itxfm_param_t;
+const int kMaxNumCoeffs = 1024;
+class PartialIDctTest : public ::testing::TestWithParam<partial_itxfm_param_t> {
+ public:
+ virtual ~PartialIDctTest() {}
+ virtual void SetUp() {
+ full_itxfm_ = GET_PARAM(0);
+ partial_itxfm_ = GET_PARAM(1);
+ tx_size_ = GET_PARAM(2);
+ last_nonzero_ = GET_PARAM(3);
+ }
+
+ virtual void TearDown() { libvpx_test::ClearSystemState(); }
+
+ protected:
+ int last_nonzero_;
+ TX_SIZE tx_size_;
+ inv_txfm_t full_itxfm_;
+ inv_txfm_t partial_itxfm_;
+};
+
+TEST_P(PartialIDctTest, ResultsMatch) {
+ ACMRandom rnd(ACMRandom::DeterministicSeed());
+ int size;
+ switch (tx_size_) {
+ case TX_4X4:
+ size = 4;
+ break;
+ case TX_8X8:
+ size = 8;
+ break;
+ case TX_16X16:
+ size = 16;
+ break;
+ case TX_32X32:
+ size = 32;
+ break;
+ default:
+ FAIL() << "Wrong Size!";
+ break;
+ }
+ DECLARE_ALIGNED_ARRAY(16, int16_t, test_coef_block1, kMaxNumCoeffs);
+ DECLARE_ALIGNED_ARRAY(16, int16_t, test_coef_block2, kMaxNumCoeffs);
+ DECLARE_ALIGNED_ARRAY(16, uint8_t, dst1, kMaxNumCoeffs);
+ DECLARE_ALIGNED_ARRAY(16, uint8_t, dst2, kMaxNumCoeffs);
+ const int count_test_block = 1000;
+ const int max_coeff = 32766 / 4;
+ const int block_size = size * size;
+ int max_error = 0;
+ for (int i = 0; i < count_test_block; ++i) {
+ // clear out destination buffer
+ memset(dst1, 0, sizeof(*dst1) * block_size);
+ memset(dst2, 0, sizeof(*dst2) * block_size);
+ memset(test_coef_block1, 0, sizeof(*test_coef_block1) * block_size);
+ memset(test_coef_block2, 0, sizeof(*test_coef_block2) * block_size);
+ int max_energy_leftover = max_coeff * max_coeff;
+ for (int j = 0; j < last_nonzero_; ++j) {
+ int16_t coef = static_cast<int16_t>(sqrt(1.0 * max_energy_leftover) *
+ (rnd.Rand16() - 32768) / 65536);
+ max_energy_leftover -= coef * coef;
+ if (max_energy_leftover < 0) {
+ max_energy_leftover = 0;
+ coef = 0;
+ }
+ test_coef_block1[vp9_default_scan_orders[tx_size_].scan[j]] = coef;
+ }
+
+ memcpy(test_coef_block2, test_coef_block1,
+ sizeof(*test_coef_block2) * block_size);
+
+ REGISTER_STATE_CHECK(full_itxfm_(test_coef_block1, dst1, size));
+ REGISTER_STATE_CHECK(partial_itxfm_(test_coef_block2, dst2, size));
+
+ for (int j = 0; j < block_size; ++j) {
+ const int diff = dst1[j] - dst2[j];
+ const int error = diff * diff;
+ if (max_error < error)
+ max_error = error;
+ }
+ }
+
+ EXPECT_EQ(0, max_error)
+ << "Error: partial inverse transform produces different results";
+}
+using std::tr1::make_tuple;
+
+INSTANTIATE_TEST_CASE_P(
+ C, PartialIDctTest,
+ ::testing::Values(
+ make_tuple(&vp9_idct32x32_1024_add_c,
+ &vp9_idct32x32_34_add_c,
+ TX_32X32, 34),
+ make_tuple(&vp9_idct32x32_1024_add_c,
+ &vp9_idct32x32_1_add_c,
+ TX_32X32, 1),
+ make_tuple(&vp9_idct16x16_256_add_c,
+ &vp9_idct16x16_10_add_c,
+ TX_16X16, 10),
+ make_tuple(&vp9_idct16x16_256_add_c,
+ &vp9_idct16x16_1_add_c,
+ TX_16X16, 1),
+ make_tuple(&vp9_idct8x8_64_add_c,
+ &vp9_idct8x8_10_add_c,
+ TX_8X8, 10),
+ make_tuple(&vp9_idct8x8_64_add_c,
+ &vp9_idct8x8_1_add_c,
+ TX_8X8, 1),
+ make_tuple(&vp9_idct4x4_16_add_c,
+ &vp9_idct4x4_1_add_c,
+ TX_4X4, 1)));
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(
+ NEON, PartialIDctTest,
+ ::testing::Values(
+ make_tuple(&vp9_idct32x32_1024_add_c,
+ &vp9_idct32x32_1_add_neon,
+ TX_32X32, 1),
+ make_tuple(&vp9_idct16x16_256_add_c,
+ &vp9_idct16x16_10_add_neon,
+ TX_16X16, 10),
+ make_tuple(&vp9_idct16x16_256_add_c,
+ &vp9_idct16x16_1_add_neon,
+ TX_16X16, 1),
+ make_tuple(&vp9_idct8x8_64_add_c,
+ &vp9_idct8x8_10_add_neon,
+ TX_8X8, 10),
+ make_tuple(&vp9_idct8x8_64_add_c,
+ &vp9_idct8x8_1_add_neon,
+ TX_8X8, 1),
+ make_tuple(&vp9_idct4x4_16_add_c,
+ &vp9_idct4x4_1_add_neon,
+ TX_4X4, 1)));
+#endif
+
+#if HAVE_SSE2
+INSTANTIATE_TEST_CASE_P(
+ SSE2, PartialIDctTest,
+ ::testing::Values(
+ make_tuple(&vp9_idct32x32_1024_add_c,
+ &vp9_idct32x32_34_add_sse2,
+ TX_32X32, 34),
+ make_tuple(&vp9_idct32x32_1024_add_c,
+ &vp9_idct32x32_1_add_sse2,
+ TX_32X32, 1),
+ make_tuple(&vp9_idct16x16_256_add_c,
+ &vp9_idct16x16_10_add_sse2,
+ TX_16X16, 10),
+ make_tuple(&vp9_idct16x16_256_add_c,
+ &vp9_idct16x16_1_add_sse2,
+ TX_16X16, 1),
+ make_tuple(&vp9_idct8x8_64_add_c,
+ &vp9_idct8x8_10_add_sse2,
+ TX_8X8, 10),
+ make_tuple(&vp9_idct8x8_64_add_c,
+ &vp9_idct8x8_1_add_sse2,
+ TX_8X8, 1),
+ make_tuple(&vp9_idct4x4_16_add_c,
+ &vp9_idct4x4_1_add_sse2,
+ TX_4X4, 1)));
+#endif
+} // namespace
diff --git a/libvpx/test/pp_filter_test.cc b/libvpx/test/pp_filter_test.cc
index e5ac9db..ff7bb08 100644
--- a/libvpx/test/pp_filter_test.cc
+++ b/libvpx/test/pp_filter_test.cc
@@ -10,12 +10,10 @@
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
-extern "C" {
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
-}
typedef void (*post_proc_func_t)(unsigned char *src_ptr,
unsigned char *dst_ptr,
diff --git a/libvpx/test/register_state_check.h b/libvpx/test/register_state_check.h
index 479a42d..7e3d053 100644
--- a/libvpx/test/register_state_check.h
+++ b/libvpx/test/register_state_check.h
@@ -11,14 +11,15 @@
#ifndef TEST_REGISTER_STATE_CHECK_H_
#define TEST_REGISTER_STATE_CHECK_H_
-#ifdef _WIN64
+#include "third_party/googletest/src/include/gtest/gtest.h"
+#include "./vpx_config.h"
+
+#if defined(_WIN64)
#define _WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winnt.h>
-#include "third_party/googletest/src/include/gtest/gtest.h"
-
namespace testing {
namespace internal {
@@ -81,7 +82,61 @@ class RegisterStateCheck {
} // namespace libvpx_test
-#else // !_WIN64
+#elif defined(CONFIG_SHARED) && defined(HAVE_NEON) \
+ && !CONFIG_SHARED && HAVE_NEON
+
+#include "vpx/vpx_integer.h"
+
+extern "C" {
+// Save the d8-d15 registers into store.
+void vp9_push_neon(int64_t *store);
+}
+
+namespace libvpx_test {
+
+// Compares the state of d8-d15 at construction with their state at
+// destruction. These registers should be preserved by the callee on
+// arm platform.
+// Usage:
+// {
+// RegisterStateCheck reg_check;
+// FunctionToVerify();
+// }
+class RegisterStateCheck {
+ public:
+ RegisterStateCheck() { initialized_ = StoreRegisters(pre_store_); }
+ ~RegisterStateCheck() { EXPECT_TRUE(Check()); }
+
+ private:
+ static bool StoreRegisters(int64_t store[8]) {
+ vp9_push_neon(store);
+ return true;
+ }
+
+ // Compares the register state. Returns true if the states match.
+ bool Check() const {
+ if (!initialized_) return false;
+ int64_t post_store[8];
+ vp9_push_neon(post_store);
+ for (int i = 0; i < 8; ++i) {
+ EXPECT_EQ(pre_store_[i], post_store[i]) << "d"
+ << i + 8 << " has been modified";
+ }
+ return !testing::Test::HasNonfatalFailure();
+ }
+
+ bool initialized_;
+ int64_t pre_store_[8];
+};
+
+#define REGISTER_STATE_CHECK(statement) do { \
+ libvpx_test::RegisterStateCheck reg_check; \
+ statement; \
+} while (false)
+
+} // namespace libvpx_test
+
+#else
namespace libvpx_test {
diff --git a/libvpx/test/resize_test.cc b/libvpx/test/resize_test.cc
index e8c2c82..8d08f1e 100644
--- a/libvpx/test/resize_test.cc
+++ b/libvpx/test/resize_test.cc
@@ -146,16 +146,16 @@ TEST_P(ResizeTest, TestExternalResizeWorks) {
ResizingVideoSource video;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
- for (std::vector<FrameInfo>::iterator info = frame_info_list_.begin();
+ for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
info != frame_info_list_.end(); ++info) {
- const vpx_codec_pts_t pts = info->pts;
- const unsigned int expected_w = ScaleForFrameNumber(pts, kInitialWidth);
- const unsigned int expected_h = ScaleForFrameNumber(pts, kInitialHeight);
+ const unsigned int frame = static_cast<unsigned>(info->pts);
+ const unsigned int expected_w = ScaleForFrameNumber(frame, kInitialWidth);
+ const unsigned int expected_h = ScaleForFrameNumber(frame, kInitialHeight);
EXPECT_EQ(expected_w, info->w)
- << "Frame " << pts << "had unexpected width";
+ << "Frame " << frame << "had unexpected width";
EXPECT_EQ(expected_h, info->h)
- << "Frame " << pts << "had unexpected height";
+ << "Frame " << frame << "had unexpected height";
}
}
@@ -208,7 +208,7 @@ class ResizeInternalTest : public ResizeTest {
virtual void PSNRPktHook(const vpx_codec_cx_pkt_t *pkt) {
if (!frame0_psnr_)
frame0_psnr_ = pkt->data.psnr.psnr[0];
- EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 1.5);
+ EXPECT_NEAR(pkt->data.psnr.psnr[0], frame0_psnr_, 2.0);
}
virtual void FramePktHook(const vpx_codec_cx_pkt_t *pkt) {
@@ -247,7 +247,7 @@ TEST_P(ResizeInternalTest, TestInternalResizeWorks) {
cfg_.g_lag_in_frames = 0;
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
- for (std::vector<FrameInfo>::iterator info = frame_info_list_.begin();
+ for (std::vector<FrameInfo>::const_iterator info = frame_info_list_.begin();
info != frame_info_list_.end(); ++info) {
const vpx_codec_pts_t pts = info->pts;
if (pts >= kStepDownFrame && pts < kStepUpFrame) {
diff --git a/libvpx/test/sad_test.cc b/libvpx/test/sad_test.cc
index 453b3a8..a692891 100644
--- a/libvpx/test/sad_test.cc
+++ b/libvpx/test/sad_test.cc
@@ -13,7 +13,6 @@
#include <limits.h>
#include <stdio.h>
-extern "C" {
#include "./vpx_config.h"
#if CONFIG_VP8_ENCODER
#include "./vp8_rtcd.h"
@@ -22,7 +21,6 @@ extern "C" {
#include "./vp9_rtcd.h"
#endif
#include "vpx_mem/vpx_mem.h"
-}
#include "test/acm_random.h"
#include "test/clear_system_state.h"
@@ -298,6 +296,8 @@ TEST_P(SADTest, MaxSAD) {
using std::tr1::make_tuple;
+//------------------------------------------------------------------------------
+// C functions
#if CONFIG_VP8_ENCODER
const sad_m_by_n_fn_t sad_16x16_c = vp8_sad16x16_c;
const sad_m_by_n_fn_t sad_8x16_c = vp8_sad8x16_c;
@@ -366,16 +366,20 @@ INSTANTIATE_TEST_CASE_P(C, SADx4Test, ::testing::Values(
make_tuple(8, 4, sad_8x4x4d_c),
make_tuple(4, 8, sad_4x8x4d_c),
make_tuple(4, 4, sad_4x4x4d_c)));
-#endif
+#endif // CONFIG_VP9_ENCODER
-// ARM tests
+//------------------------------------------------------------------------------
+// ARM functions
#if HAVE_MEDIA
+#if CONFIG_VP8_ENCODER
const sad_m_by_n_fn_t sad_16x16_armv6 = vp8_sad16x16_armv6;
INSTANTIATE_TEST_CASE_P(MEDIA, SADTest, ::testing::Values(
make_tuple(16, 16, sad_16x16_armv6)));
-
#endif
+#endif
+
#if HAVE_NEON
+#if CONFIG_VP8_ENCODER
const sad_m_by_n_fn_t sad_16x16_neon = vp8_sad16x16_neon;
const sad_m_by_n_fn_t sad_8x16_neon = vp8_sad8x16_neon;
const sad_m_by_n_fn_t sad_16x8_neon = vp8_sad16x8_neon;
@@ -388,8 +392,10 @@ INSTANTIATE_TEST_CASE_P(NEON, SADTest, ::testing::Values(
make_tuple(8, 8, sad_8x8_neon),
make_tuple(4, 4, sad_4x4_neon)));
#endif
+#endif
-// X86 tests
+//------------------------------------------------------------------------------
+// x86 functions
#if HAVE_MMX
#if CONFIG_VP8_ENCODER
const sad_m_by_n_fn_t sad_16x16_mmx = vp8_sad16x16_mmx;
@@ -439,9 +445,9 @@ const sad_n_by_n_by_4_fn_t sad_4x4x4d_sse = vp9_sad4x4x4d_sse;
INSTANTIATE_TEST_CASE_P(SSE, SADx4Test, ::testing::Values(
make_tuple(4, 8, sad_4x8x4d_sse),
make_tuple(4, 4, sad_4x4x4d_sse)));
-#endif
-#endif
-#endif
+#endif // CONFIG_USE_X86INC
+#endif // CONFIG_VP9_ENCODER
+#endif // HAVE_SSE
#if HAVE_SSE2
#if CONFIG_VP8_ENCODER
@@ -539,10 +545,12 @@ INSTANTIATE_TEST_CASE_P(SSE3, SADx4Test, ::testing::Values(
#if HAVE_SSSE3
#if CONFIG_USE_X86INC
+#if CONFIG_VP8_ENCODER
const sad_m_by_n_fn_t sad_16x16_sse3 = vp8_sad16x16_sse3;
INSTANTIATE_TEST_CASE_P(SSE3, SADTest, ::testing::Values(
make_tuple(16, 16, sad_16x16_sse3)));
#endif
#endif
+#endif
} // namespace
diff --git a/libvpx/test/set_roi.cc b/libvpx/test/set_roi.cc
index 9d2e771..e28f511 100644
--- a/libvpx/test/set_roi.cc
+++ b/libvpx/test/set_roi.cc
@@ -18,11 +18,9 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/acm_random.h"
+#include "vp8/encoder/onyx_int.h"
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
-extern "C" {
-#include "vp8/encoder/onyx_int.h"
-}
using libvpx_test::ACMRandom;
diff --git a/libvpx/test/sixtap_predict_test.cc b/libvpx/test/sixtap_predict_test.cc
index ee4faac..0c600f4 100644
--- a/libvpx/test/sixtap_predict_test.cc
+++ b/libvpx/test/sixtap_predict_test.cc
@@ -1,12 +1,12 @@
/*
-* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-*
-* Use of this source code is governed by a BSD-style license
-* that can be found in the LICENSE file in the root of the source
-* tree. An additional intellectual property rights grant can be found
-* in the file PATENTS. All contributing project authors may
-* be found in the AUTHORS file in the root of the source tree.
-*/
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
#include <math.h>
#include <stdlib.h>
@@ -16,12 +16,10 @@
#include "test/register_state_check.h"
#include "test/util.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
-extern "C" {
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
-}
namespace {
@@ -32,7 +30,10 @@ typedef void (*sixtap_predict_fn_t)(uint8_t *src_ptr,
uint8_t *dst_ptr,
int dst_pitch);
-class SixtapPredictTest : public PARAMS(int, int, sixtap_predict_fn_t) {
+typedef std::tr1::tuple<int, int, sixtap_predict_fn_t> sixtap_predict_param_t;
+
+class SixtapPredictTest
+ : public ::testing::TestWithParam<sixtap_predict_param_t> {
public:
static void SetUpTestCase() {
src_ = reinterpret_cast<uint8_t*>(vpx_memalign(kDataAlignment, kSrcSize));
@@ -192,6 +193,16 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(8, 8, sixtap_8x8_c),
make_tuple(8, 4, sixtap_8x4_c),
make_tuple(4, 4, sixtap_4x4_c)));
+#if HAVE_NEON
+const sixtap_predict_fn_t sixtap_16x16_neon = vp8_sixtap_predict16x16_neon;
+const sixtap_predict_fn_t sixtap_8x8_neon = vp8_sixtap_predict8x8_neon;
+const sixtap_predict_fn_t sixtap_8x4_neon = vp8_sixtap_predict8x4_neon;
+INSTANTIATE_TEST_CASE_P(
+ DISABLED_NEON, SixtapPredictTest, ::testing::Values(
+ make_tuple(16, 16, sixtap_16x16_neon),
+ make_tuple(8, 8, sixtap_8x8_neon),
+ make_tuple(8, 4, sixtap_8x4_neon)));
+#endif
#if HAVE_MMX
const sixtap_predict_fn_t sixtap_16x16_mmx = vp8_sixtap_predict16x16_mmx;
const sixtap_predict_fn_t sixtap_8x8_mmx = vp8_sixtap_predict8x8_mmx;
diff --git a/libvpx/test/subtract_test.cc b/libvpx/test/subtract_test.cc
index d1f2729..3efb955 100644
--- a/libvpx/test/subtract_test.cc
+++ b/libvpx/test/subtract_test.cc
@@ -12,13 +12,11 @@
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
-extern "C" {
#include "./vpx_config.h"
#include "./vp8_rtcd.h"
#include "vp8/common/blockd.h"
#include "vp8/encoder/block.h"
#include "vpx_mem/vpx_mem.h"
-}
typedef void (*subtract_b_fn_t)(BLOCK *be, BLOCKD *bd, int pitch);
@@ -61,7 +59,7 @@ TEST_P(SubtractBlockTest, SimpleSubtract) {
int16_t *src_diff = be.src_diff;
for (int r = 0; r < kBlockHeight; ++r) {
for (int c = 0; c < kBlockWidth; ++c) {
- src_diff[c] = static_cast<int16_t>(0xa5a5);
+ src_diff[c] = static_cast<int16_t>(0xa5a5u);
}
src_diff += kDiffPredStride;
}
@@ -107,6 +105,11 @@ TEST_P(SubtractBlockTest, SimpleSubtract) {
INSTANTIATE_TEST_CASE_P(C, SubtractBlockTest,
::testing::Values(vp8_subtract_b_c));
+#if HAVE_NEON
+INSTANTIATE_TEST_CASE_P(NEON, SubtractBlockTest,
+ ::testing::Values(vp8_subtract_b_neon));
+#endif
+
#if HAVE_MMX
INSTANTIATE_TEST_CASE_P(MMX, SubtractBlockTest,
::testing::Values(vp8_subtract_b_mmx));
diff --git a/libvpx/test/superframe_test.cc b/libvpx/test/superframe_test.cc
index d91e7b1..c0f542d 100644
--- a/libvpx/test/superframe_test.cc
+++ b/libvpx/test/superframe_test.cc
@@ -21,6 +21,7 @@ class SuperframeTest : public ::libvpx_test::EncoderTest,
protected:
SuperframeTest() : EncoderTest(GET_PARAM(0)), modified_buf_(NULL),
last_sf_pts_(0) {}
+ virtual ~SuperframeTest() {}
virtual void SetUp() {
InitializeConfig();
diff --git a/libvpx/test/svc_test.cc b/libvpx/test/svc_test.cc
index 98a5d94..dff2ec7 100644
--- a/libvpx/test/svc_test.cc
+++ b/libvpx/test/svc_test.cc
@@ -41,7 +41,6 @@ class SvcTest : public ::testing::Test {
virtual ~SvcTest() {}
virtual void SetUp() {
- svc_.first_frame_full_size = 1;
svc_.encoding_mode = INTER_LAYER_PREDICTION_IP;
svc_.log_level = SVC_LOG_DEBUG;
svc_.log_print = 0;
@@ -178,21 +177,48 @@ TEST_F(SvcTest, SetQuantizersOption) {
codec_initialized_ = true;
}
+TEST_F(SvcTest, SetKeyFrameQuantizersOption) {
+ svc_.spatial_layers = 2;
+ vpx_codec_err_t res = vpx_svc_set_options(&svc_,
+ "quantizers-keyframe=not-quantizers");
+ EXPECT_EQ(VPX_CODEC_OK, res);
+ res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
+ EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
+
+ vpx_svc_set_options(&svc_, "quantizers-keyframe=40,45");
+ res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
+ EXPECT_EQ(VPX_CODEC_OK, res);
+ codec_initialized_ = true;
+}
+
TEST_F(SvcTest, SetQuantizers) {
- vpx_codec_err_t res = vpx_svc_set_quantizers(NULL, "40,30");
+ vpx_codec_err_t res = vpx_svc_set_quantizers(NULL, "40,30", 0);
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
- res = vpx_svc_set_quantizers(&svc_, NULL);
+ res = vpx_svc_set_quantizers(&svc_, NULL, 0);
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
- svc_.first_frame_full_size = 0;
svc_.spatial_layers = 2;
- res = vpx_svc_set_quantizers(&svc_, "40");
+ res = vpx_svc_set_quantizers(&svc_, "40", 0);
+ EXPECT_EQ(VPX_CODEC_OK, res);
+ res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
+ EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
+
+ res = vpx_svc_set_quantizers(&svc_, "40,30", 0);
EXPECT_EQ(VPX_CODEC_OK, res);
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
+ EXPECT_EQ(VPX_CODEC_OK, res);
+ codec_initialized_ = true;
+}
+
+TEST_F(SvcTest, SetKeyFrameQuantizers) {
+ vpx_codec_err_t res = vpx_svc_set_quantizers(NULL, "40,31", 1);
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
- res = vpx_svc_set_quantizers(&svc_, "40,30");
+ res = vpx_svc_set_quantizers(&svc_, NULL, 1);
+ EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
+
+ res = vpx_svc_set_quantizers(&svc_, "40,30", 1);
EXPECT_EQ(VPX_CODEC_OK, res);
res = vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
EXPECT_EQ(VPX_CODEC_OK, res);
@@ -206,7 +232,6 @@ TEST_F(SvcTest, SetScaleFactors) {
res = vpx_svc_set_scale_factors(&svc_, NULL);
EXPECT_EQ(VPX_CODEC_INVALID_PARAM, res);
- svc_.first_frame_full_size = 0;
svc_.spatial_layers = 2;
res = vpx_svc_set_scale_factors(&svc_, "4/16");
EXPECT_EQ(VPX_CODEC_OK, res);
@@ -220,14 +245,11 @@ TEST_F(SvcTest, SetScaleFactors) {
codec_initialized_ = true;
}
-// test that decoder can handle an SVC frame as the first frame in a sequence
-// this test is disabled since it always fails because of a decoder issue
-// https://code.google.com/p/webm/issues/detail?id=654
-TEST_F(SvcTest, DISABLED_FirstFrameHasLayers) {
- svc_.first_frame_full_size = 0;
+// Test that decoder can handle an SVC frame as the first frame in a sequence.
+TEST_F(SvcTest, FirstFrameHasLayers) {
svc_.spatial_layers = 2;
vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
- vpx_svc_set_quantizers(&svc_, "40,30");
+ vpx_svc_set_quantizers(&svc_, "40,30", 0);
vpx_codec_err_t res =
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
@@ -240,7 +262,7 @@ TEST_F(SvcTest, DISABLED_FirstFrameHasLayers) {
video.Begin();
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
- video.duration(), VPX_DL_REALTIME);
+ video.duration(), VPX_DL_GOOD_QUALITY);
EXPECT_EQ(VPX_CODEC_OK, res);
const vpx_codec_err_t res_dec = decoder_->DecodeFrame(
@@ -252,10 +274,9 @@ TEST_F(SvcTest, DISABLED_FirstFrameHasLayers) {
}
TEST_F(SvcTest, EncodeThreeFrames) {
- svc_.first_frame_full_size = 1;
svc_.spatial_layers = 2;
vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
- vpx_svc_set_quantizers(&svc_, "40,30");
+ vpx_svc_set_quantizers(&svc_, "40,30", 0);
vpx_codec_err_t res =
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
@@ -265,11 +286,11 @@ TEST_F(SvcTest, EncodeThreeFrames) {
libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
codec_enc_.g_timebase.den,
codec_enc_.g_timebase.num, 0, 30);
- // FRAME 1
+ // FRAME 0
video.Begin();
- // this frame is full size, with only one layer
+ // This frame is a keyframe.
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
- video.duration(), VPX_DL_REALTIME);
+ video.duration(), VPX_DL_GOOD_QUALITY);
ASSERT_EQ(VPX_CODEC_OK, res);
EXPECT_EQ(1, vpx_svc_is_keyframe(&svc_));
@@ -278,13 +299,13 @@ TEST_F(SvcTest, EncodeThreeFrames) {
vpx_svc_get_frame_size(&svc_));
ASSERT_EQ(VPX_CODEC_OK, res_dec) << decoder_->DecodeError();
- // FRAME 2
+ // FRAME 1
video.Next();
- // this is an I-frame
+ // This is a P-frame.
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
- video.duration(), VPX_DL_REALTIME);
+ video.duration(), VPX_DL_GOOD_QUALITY);
ASSERT_EQ(VPX_CODEC_OK, res);
- EXPECT_EQ(1, vpx_svc_is_keyframe(&svc_));
+ EXPECT_EQ(0, vpx_svc_is_keyframe(&svc_));
res_dec = decoder_->DecodeFrame(
static_cast<const uint8_t *>(vpx_svc_get_buffer(&svc_)),
@@ -293,9 +314,9 @@ TEST_F(SvcTest, EncodeThreeFrames) {
// FRAME 2
video.Next();
- // this is a P-frame
+ // This is a P-frame.
res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
- video.duration(), VPX_DL_REALTIME);
+ video.duration(), VPX_DL_GOOD_QUALITY);
ASSERT_EQ(VPX_CODEC_OK, res);
EXPECT_EQ(0, vpx_svc_is_keyframe(&svc_));
@@ -306,10 +327,9 @@ TEST_F(SvcTest, EncodeThreeFrames) {
}
TEST_F(SvcTest, GetLayerResolution) {
- svc_.first_frame_full_size = 0;
svc_.spatial_layers = 2;
vpx_svc_set_scale_factors(&svc_, "4/16,8/16");
- vpx_svc_set_quantizers(&svc_, "40,30");
+ vpx_svc_set_quantizers(&svc_, "40,30", 0);
vpx_codec_err_t res =
vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
@@ -342,4 +362,39 @@ TEST_F(SvcTest, GetLayerResolution) {
EXPECT_EQ(kHeight * 8 / 16, layer_height);
}
+TEST_F(SvcTest, FirstPassEncode) {
+ svc_.spatial_layers = 2;
+ codec_enc_.g_pass = VPX_RC_FIRST_PASS;
+ vpx_svc_set_scale_factors(&svc_, "4/16,16/16");
+ vpx_svc_set_quantizers(&svc_, "40,30", 0);
+
+ vpx_codec_err_t res =
+ vpx_svc_init(&svc_, &codec_, vpx_codec_vp9_cx(), &codec_enc_);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ codec_initialized_ = true;
+
+ libvpx_test::I420VideoSource video(test_file_name_, kWidth, kHeight,
+ codec_enc_.g_timebase.den,
+ codec_enc_.g_timebase.num, 0, 30);
+ // FRAME 0
+ video.Begin();
+ res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
+ video.duration(), VPX_DL_GOOD_QUALITY);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_GT(vpx_svc_get_rc_stats_buffer_size(&svc_), 0U);
+
+ // FRAME 1
+ video.Next();
+ res = vpx_svc_encode(&svc_, &codec_, video.img(), video.pts(),
+ video.duration(), VPX_DL_GOOD_QUALITY);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_GT(vpx_svc_get_rc_stats_buffer_size(&svc_), 0U);
+
+ // Flush encoder and test EOS packet
+ res = vpx_svc_encode(&svc_, &codec_, NULL, video.pts(),
+ video.duration(), VPX_DL_GOOD_QUALITY);
+ ASSERT_EQ(VPX_CODEC_OK, res);
+ EXPECT_GT(vpx_svc_get_rc_stats_buffer_size(&svc_), 0U);
+}
+
} // namespace
diff --git a/libvpx/test/test-data.sha1 b/libvpx/test/test-data.sha1
index 5229d09..6f718ef 100644
--- a/libvpx/test/test-data.sha1
+++ b/libvpx/test/test-data.sha1
@@ -1,5 +1,6 @@
d5dfb0151c9051f8c85999255645d7a23916d3c0 hantro_collage_w352h288.yuv
b87815bf86020c592ccc7a846ba2e28ec8043902 hantro_odd.yuv
+b1f1c3ec79114b9a0651af24ce634afb44a9a419 rush_hour_444.y4m
5184c46ddca8b1fadd16742e8500115bc8f749da vp80-00-comprehensive-001.ivf
65bf1bbbced81b97bd030f376d1b7f61a224793f vp80-00-comprehensive-002.ivf
906b4c1e99eb734504c504b3f1ad8052137ce672 vp80-00-comprehensive-003.ivf
@@ -61,6 +62,7 @@ c87599cbecd72d4cd4f7ace3313b7a6bc6eb8163 vp80-05-sharpness-1438.ivf
aff51d865c2621b60510459244ea83e958e4baed vp80-05-sharpness-1439.ivf
da386e72b19b5485a6af199c5eb60ef25e510dd1 vp80-05-sharpness-1440.ivf
6759a095203d96ccd267ce09b1b050b8cc4c2f1f vp80-05-sharpness-1443.ivf
+b95d3cc1d0df991e63e150a801710a72f20d9ba0 vp80-06-smallsize.ivf
db55ec7fd02c864ba996ff060b25b1e08611330b vp80-00-comprehensive-001.ivf.md5
29db0ad011cba1e45f856d5623cd38dac3e3bf19 vp80-00-comprehensive-002.ivf.md5
e84f258f69e173e7d68f8f8c037a0a3766902182 vp80-00-comprehensive-003.ivf.md5
@@ -122,6 +124,7 @@ f95eb6214571434f1f73ab7833b9ccdf47588020 vp80-03-segmentation-1437.ivf.md5
086c56378df81b6cee264d7540a7b8f2b405c7a4 vp80-05-sharpness-1439.ivf.md5
d32dc2c4165eb266ea4c23c14a45459b363def32 vp80-05-sharpness-1440.ivf.md5
8c69dc3d8e563f56ffab5ad1e400d9e689dd23df vp80-05-sharpness-1443.ivf.md5
+d6f246df012c241b5fa6c1345019a3703d85c419 vp80-06-smallsize.ivf.md5
ce881e567fe1d0fbcb2d3e9e6281a1a8d74d82e0 vp90-2-00-quantizer-00.webm
ac5eda33407d0521c7afca43a63fd305c0cd9d13 vp90-2-00-quantizer-00.webm.md5
2ca0463f2cfb93d25d7dded174db70b7cb87cb48 vp90-2-00-quantizer-01.webm
@@ -542,3 +545,46 @@ c9b237dfcc01c1b414fbcaa481d014a906ef7998 vp90-2-08-tile_1x4.webm.md5
ae7451810247fd13975cc257aa0301ff17102255 vp90-2-08-tile-4x4.webm.md5
2ec6e15422ac7a61af072dc5f27fcaf1942ce116 vp90-2-08-tile-4x1.webm
0094f5ee5e46345017c30e0aa4835b550212d853 vp90-2-08-tile-4x1.webm.md5
+edea45dac4a3c2e5372339f8851d24c9bef803d6 vp90-2-09-subpixel-00.ivf
+5428efc4bf92191faedf4a727fcd1d94966a7abc vp90-2-09-subpixel-00.ivf.md5
+8cdd435d89029987ee196896e21520e5f879f04d vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm
+091b373aa2ecb59aa5c647affd5bcafcc7547364 vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm
+87ee28032b0963a44b73a850fcc816a6dc83efbb vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm
+c6ce25c4bfd4bdfc2932b70428e3dfe11210ec4f vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm
+2064bdb22aa71c2691e0469fb62e8087a43f08f8 vp90-2-bbb_426x240_tile_1x1_180kbps.webm
+8080eda22694910162f0996e8a962612f381a57f vp90-2-bbb_640x360_tile_1x2_337kbps.webm
+a484b335c27ea189c0f0d77babea4a510ce12d50 vp90-2-bbb_854x480_tile_1x2_651kbps.webm
+3eacf1f006250be4cc5c92a7ef146e385ee62653 vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm
+217f089a16447490823127b36ce0d945522accfd vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm
+eedb3c641e60dacbe082491a16df529a5c9187df vp90-2-sintel_426x182_tile_1x1_171kbps.webm
+cb7e4955af183dff33bcba0c837f0922ab066400 vp90-2-sintel_640x272_tile_1x2_318kbps.webm
+48613f9380e2580002f8a09d6e412ea4e89a52b9 vp90-2-sintel_854x364_tile_1x2_621kbps.webm
+990a91f24dd284562d21d714ae773dff5452cad8 vp90-2-tos_1280x534_tile_1x4_1306kbps.webm
+b6dd558c90bca466b4bcbd03b3371648186465a7 vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm
+1a9c2914ba932a38f0a143efc1ad0e318e78888b vp90-2-tos_426x178_tile_1x1_181kbps.webm
+a3d2b09f24debad4747a1b3066f572be4273bced vp90-2-tos_640x266_tile_1x2_336kbps.webm
+c64b03b5c090e6888cb39685c31f00a6b79fa45c vp90-2-tos_854x356_tile_1x2_656kbps.webm
+0e7cd4135b231c9cea8d76c19f9e84b6fd77acec vp90-2-08-tile_1x8_frame_parallel.webm
+c9b6850af28579b031791066457f4cb40df6e1c7 vp90-2-08-tile_1x8_frame_parallel.webm.md5
+e448b6e83490bca0f8d58b4f4b1126a17baf4b0c vp90-2-08-tile_1x8.webm
+5e524165f0397e6141d914f4f0a66267d7658376 vp90-2-08-tile_1x8.webm.md5
+a34e14923d6d17b1144254d8187d7f85b700a63c vp90-2-02-size-lf-1920x1080.webm
+e3b28ddcfaeb37fb4d132b93f92642a9ad17c22d vp90-2-02-size-lf-1920x1080.webm.md5
+d48c5db1b0f8e60521a7c749696b8067886033a3 vp90-2-09-aq2.webm
+84c1599298aac78f2fc05ae2274575d10569dfa0 vp90-2-09-aq2.webm.md5
+55fc55ed73d578ed60fad05692579873f8bad758 vp90-2-09-lf_deltas.webm
+54638c38009198c38c8f3b25c182b709b6c1fd2e vp90-2-09-lf_deltas.webm.md5
+510d95f3beb3b51c572611fdaeeece12277dac30 vp90-2-10-show-existing-frame.webm
+14d631096f4bfa2d71f7f739aec1448fb3c33bad vp90-2-10-show-existing-frame.webm.md5
+b4318e75f73a6a08992c7326de2fb589c2a794c7 vp90-2-11-size-351x287.webm
+b3c48382cf7d0454e83a02497c229d27720f9e20 vp90-2-11-size-351x287.webm.md5
+8e0096475ea2535bac71d3e2fc09e0c451c444df vp90-2-11-size-351x288.webm
+19e003804ec1dfc5464813b32339a15d5ba7b42f vp90-2-11-size-351x288.webm.md5
+40cd1d6a188d7a88b21ebac1e573d3f270ab261e vp90-2-11-size-352x287.webm
+68f515abe3858fc1eded46c8e6b2f727d43b5331 vp90-2-11-size-352x287.webm.md5
+9a510769ff23db410880ec3029d433e87d17f7fc vp90-2-12-droppable_1.ivf
+952eaac6eefa6f62179ed1db3e922fd42fecc624 vp90-2-12-droppable_1.ivf.md5
+9a510769ff23db410880ec3029d433e87d17f7fc vp90-2-12-droppable_2.ivf
+92a756469fa438220524e7fa6ac1d38c89514d17 vp90-2-12-droppable_2.ivf.md5
+c21e97e4ba486520118d78b01a5cb6e6dc33e190 vp90-2-12-droppable_3.ivf
+601abc9e4176c70f82ac0381365e9b151fdd24cd vp90-2-12-droppable_3.ivf.md5
diff --git a/libvpx/test/test.mk b/libvpx/test/test.mk
index ac072d0..175bc52 100644
--- a/libvpx/test/test.mk
+++ b/libvpx/test/test.mk
@@ -1,10 +1,12 @@
+LIBVPX_TEST_SRCS-yes += acm_random.h
LIBVPX_TEST_SRCS-yes += clear_system_state.h
+LIBVPX_TEST_SRCS-yes += codec_factory.h
+LIBVPX_TEST_SRCS-yes += md5_helper.h
LIBVPX_TEST_SRCS-yes += register_state_check.h
LIBVPX_TEST_SRCS-yes += test.mk
-LIBVPX_TEST_SRCS-yes += acm_random.h
-LIBVPX_TEST_SRCS-yes += md5_helper.h
-LIBVPX_TEST_SRCS-yes += codec_factory.h
LIBVPX_TEST_SRCS-yes += test_libvpx.cc
+LIBVPX_TEST_SRCS-yes += test_vectors.cc
+LIBVPX_TEST_SRCS-yes += test_vectors.h
LIBVPX_TEST_SRCS-yes += util.h
LIBVPX_TEST_SRCS-yes += video_source.h
@@ -13,38 +15,49 @@ LIBVPX_TEST_SRCS-yes += video_source.h
##
## Black box tests only use the public API.
##
+LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../md5_utils.h ../md5_utils.c
+LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += ../y4minput.h ../y4minput.c
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += aq_segment_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += datarate_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += error_resilience_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += i420_video_source.h
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += y4m_video_source.h
+
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += altref_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += config_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += cq_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += datarate_test.cc
-
-LIBVPX_TEST_SRCS-yes += encode_test_driver.cc
-LIBVPX_TEST_SRCS-yes += encode_test_driver.h
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += error_resilience_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += i420_video_source.h
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += keyframe_test.cc
+
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += external_frame_buffer_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += active_map_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += borders_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += resize_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += cpu_speed_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += resize_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_lossless_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ../md5_utils.h ../md5_utils.c
LIBVPX_TEST_SRCS-yes += decode_test_driver.cc
LIBVPX_TEST_SRCS-yes += decode_test_driver.h
-LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += ivf_video_source.h
+LIBVPX_TEST_SRCS-yes += encode_test_driver.cc
+LIBVPX_TEST_SRCS-yes += encode_test_driver.h
## WebM Parsing
-NESTEGG_SRCS += ../nestegg/halloc/halloc.h
-NESTEGG_SRCS += ../nestegg/halloc/src/align.h
-NESTEGG_SRCS += ../nestegg/halloc/src/halloc.c
-NESTEGG_SRCS += ../nestegg/halloc/src/hlist.h
-NESTEGG_SRCS += ../nestegg/include/nestegg/nestegg.h
-NESTEGG_SRCS += ../nestegg/src/nestegg.c
+NESTEGG_SRCS += ../third_party/nestegg/halloc/halloc.h
+NESTEGG_SRCS += ../third_party/nestegg/halloc/src/align.h
+NESTEGG_SRCS += ../third_party/nestegg/halloc/src/halloc.c
+NESTEGG_SRCS += ../third_party/nestegg/halloc/src/hlist.h
+NESTEGG_SRCS += ../third_party/nestegg/include/nestegg/nestegg.h
+NESTEGG_SRCS += ../third_party/nestegg/src/nestegg.c
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += $(NESTEGG_SRCS)
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += webm_video_source.h
LIBVPX_TEST_SRCS-$(CONFIG_DECODERS) += test_vector_test.cc
+# Currently we only support decoder perf tests for vp9
+ifeq ($(CONFIG_DECODE_PERF_TESTS)$(CONFIG_VP9_DECODER), yesyes)
+LIBVPX_TEST_SRCS-yes += decode_perf_test.cc
+endif
+
##
## WHITE BOX TESTS
##
@@ -61,18 +74,17 @@ ifeq ($(CONFIG_VP8_ENCODER)$(CONFIG_VP8_DECODER),yesyes)
LIBVPX_TEST_SRCS-yes += vp8_boolcoder_test.cc
endif
-LIBVPX_TEST_SRCS-yes += idct_test.cc
-LIBVPX_TEST_SRCS-yes += intrapred_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_POSTPROC) += pp_filter_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += vp8_decrypt_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += set_roi.cc
-LIBVPX_TEST_SRCS-yes += sixtap_predict_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += subtract_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_subtract_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += variance_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP8_DECODER) += vp8_decrypt_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP8_ENCODER) += vp8_fdct4x4_test.cc
+LIBVPX_TEST_SRCS-yes += idct_test.cc
+LIBVPX_TEST_SRCS-yes += intrapred_test.cc
+LIBVPX_TEST_SRCS-yes += sixtap_predict_test.cc
+
endif # VP8
## VP9
@@ -80,28 +92,30 @@ ifneq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),)
# These tests require both the encoder and decoder to be built.
ifeq ($(CONFIG_VP9_ENCODER)$(CONFIG_VP9_DECODER),yesyes)
-LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc
-
# IDCT test currently depends on FDCT function
LIBVPX_TEST_SRCS-yes += idct8x8_test.cc
+LIBVPX_TEST_SRCS-yes += partial_idct_test.cc
LIBVPX_TEST_SRCS-yes += superframe_test.cc
LIBVPX_TEST_SRCS-yes += tile_independence_test.cc
+LIBVPX_TEST_SRCS-yes += vp9_boolcoder_test.cc
+
endif
LIBVPX_TEST_SRCS-$(CONFIG_VP9) += convolve_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_DECODER) += vp9_thread_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct4x4_test.cc
-
-LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct16x16_test.cc
-LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += dct32x32_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct4x4_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += fdct8x8_test.cc
LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += svc_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += variance_test.cc
+LIBVPX_TEST_SRCS-$(CONFIG_VP9_ENCODER) += vp9_subtract_test.cc
endif # VP9
+LIBVPX_TEST_SRCS-$(CONFIG_ENCODERS) += sad_test.cc
-endif
+endif # CONFIG_SHARED
##
@@ -109,129 +123,132 @@ endif
##
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_collage_w352h288.yuv
LIBVPX_TEST_DATA-$(CONFIG_ENCODERS) += hantro_odd.yuv
+LIBVPX_TEST_DATA-$(CONFIG_VP9_ENCODER) += rush_hour_444.y4m
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1401.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-001.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-002.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-003.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-004.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-005.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-006.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-007.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-008.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-009.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-010.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-011.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-012.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-013.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-014.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-015.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-016.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-017.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-00-comprehensive-018.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1400.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1411.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1416.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-01-intra-1417.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1402.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1412.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1418.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-02-inter-1424.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1401.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1403.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1407.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1408.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1409.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1410.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1413.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1414.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1415.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1425.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1426.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1427.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1432.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1435.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1436.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1437.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1441.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-1442.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-01.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-02.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-03.ivf.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-03-segmentation-04.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1404.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1405.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-04-partitions-1406.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1428.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1429.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1430.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1431.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1433.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1434.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1438.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1439.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1440.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-05-sharpness-1443.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-06-smallsize.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP8_DECODER) += vp80-06-smallsize.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-00.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-00-quantizer-01.webm
@@ -502,6 +519,10 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x64.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-66x66.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-02-size-lf-1920x1080.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x196.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-196x198.webm
@@ -630,25 +651,87 @@ LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x224.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-size-226x226.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-03-deltaq.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-05-resize.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-06-bilinear.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-07-frame_parallel.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x2_frame_parallel.webm.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x4.webm.md5
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm
-LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile-4x1.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x4_frame_parallel.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8_frame_parallel.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-08-tile_1x8_frame_parallel.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-aq2.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-aq2.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-lf_deltas.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-subpixel-00.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-09-subpixel-00.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-10-show-existing-frame.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x287.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x287.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x288.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-351x288.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-352x287.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-11-size-352x287.webm.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_1.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_1.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_2.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_2.ivf.md5
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_3.ivf
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp90-2-12-droppable_3.ivf.md5
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm
LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += vp91-2-04-yv444.webm.md5
+
+ifeq ($(CONFIG_DECODE_PERF_TESTS),yes)
+# BBB VP9 streams
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_426x240_tile_1x1_180kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_640x360_tile_1x2_337kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_854x480_tile_1x2_651kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_1280x720_tile_1x4_1310kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_1920x1080_tile_1x1_2581kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_1920x1080_tile_1x4_2586kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-bbb_1920x1080_tile_1x4_fpm_2304kbps.webm
+#Sintel VP9 streams
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-sintel_426x182_tile_1x1_171kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-sintel_640x272_tile_1x2_318kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-sintel_854x364_tile_1x2_621kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-sintel_1280x546_tile_1x4_1257kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-sintel_1920x818_tile_1x4_fpm_2279kbps.webm
+# TOS VP9 streams
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-tos_426x178_tile_1x1_181kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-tos_640x266_tile_1x2_336kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-tos_854x356_tile_1x2_656kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-tos_1280x534_tile_1x4_1306kbps.webm
+LIBVPX_TEST_DATA-$(CONFIG_VP9_DECODER) += \
+ vp90-2-tos_1920x800_tile_1x4_fpm_2335kbps.webm
+endif # CONFIG_DECODE_PERF_TESTS
diff --git a/libvpx/test/test_libvpx.cc b/libvpx/test/test_libvpx.cc
index 80aca98..fc035af 100644
--- a/libvpx/test/test_libvpx.cc
+++ b/libvpx/test/test_libvpx.cc
@@ -9,10 +9,10 @@
*/
#include <string>
#include "./vpx_config.h"
-extern "C" {
#if ARCH_X86 || ARCH_X86_64
#include "vpx_ports/x86.h"
#endif
+extern "C" {
#if CONFIG_VP8
extern void vp8_rtcd();
#endif
@@ -22,8 +22,10 @@ extern void vp9_rtcd();
}
#include "third_party/googletest/src/include/gtest/gtest.h"
-static void append_gtest_filter(const char *str) {
+static void append_negative_gtest_filter(const char *str) {
std::string filter = ::testing::FLAGS_gtest_filter;
+ // Negative patterns begin with one '-' followed by a ':' separated list.
+ if (filter.find('-') == std::string::npos) filter += '-';
filter += str;
::testing::FLAGS_gtest_filter = filter;
}
@@ -34,21 +36,21 @@ int main(int argc, char **argv) {
#if ARCH_X86 || ARCH_X86_64
const int simd_caps = x86_simd_caps();
if (!(simd_caps & HAS_MMX))
- append_gtest_filter(":-MMX/*");
+ append_negative_gtest_filter(":MMX/*");
if (!(simd_caps & HAS_SSE))
- append_gtest_filter(":-SSE/*");
+ append_negative_gtest_filter(":SSE/*");
if (!(simd_caps & HAS_SSE2))
- append_gtest_filter(":-SSE2/*");
+ append_negative_gtest_filter(":SSE2/*");
if (!(simd_caps & HAS_SSE3))
- append_gtest_filter(":-SSE3/*");
+ append_negative_gtest_filter(":SSE3/*");
if (!(simd_caps & HAS_SSSE3))
- append_gtest_filter(":-SSSE3/*");
+ append_negative_gtest_filter(":SSSE3/*");
if (!(simd_caps & HAS_SSE4_1))
- append_gtest_filter(":-SSE4_1/*");
+ append_negative_gtest_filter(":SSE4_1/*");
if (!(simd_caps & HAS_AVX))
- append_gtest_filter(":-AVX/*");
+ append_negative_gtest_filter(":AVX/*");
if (!(simd_caps & HAS_AVX2))
- append_gtest_filter(":-AVX2/*");
+ append_negative_gtest_filter(":AVX2/*");
#endif
#if !CONFIG_SHARED
diff --git a/libvpx/test/test_vector_test.cc b/libvpx/test/test_vector_test.cc
index 08449a5..53b7636 100644
--- a/libvpx/test/test_vector_test.cc
+++ b/libvpx/test/test_vector_test.cc
@@ -1,11 +1,11 @@
/*
- Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-
- Use of this source code is governed by a BSD-style license
- that can be found in the LICENSE file in the root of the source
- tree. An additional intellectual property rights grant can be found
- in the file PATENTS. All contributing project authors may
- be found in the AUTHORS file in the root of the source tree.
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
*/
#include <cstdio>
@@ -15,161 +15,13 @@
#include "test/codec_factory.h"
#include "test/decode_test_driver.h"
#include "test/ivf_video_source.h"
-#include "test/webm_video_source.h"
-#include "test/util.h"
#include "test/md5_helper.h"
-extern "C" {
+#include "test/test_vectors.h"
+#include "test/util.h"
+#include "test/webm_video_source.h"
#include "vpx_mem/vpx_mem.h"
-}
namespace {
-#if CONFIG_VP8_DECODER
-const char *kVP8TestVectors[] = {
- "vp80-00-comprehensive-001.ivf",
- "vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf",
- "vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf",
- "vp80-00-comprehensive-006.ivf", "vp80-00-comprehensive-007.ivf",
- "vp80-00-comprehensive-008.ivf", "vp80-00-comprehensive-009.ivf",
- "vp80-00-comprehensive-010.ivf", "vp80-00-comprehensive-011.ivf",
- "vp80-00-comprehensive-012.ivf", "vp80-00-comprehensive-013.ivf",
- "vp80-00-comprehensive-014.ivf", "vp80-00-comprehensive-015.ivf",
- "vp80-00-comprehensive-016.ivf", "vp80-00-comprehensive-017.ivf",
- "vp80-00-comprehensive-018.ivf", "vp80-01-intra-1400.ivf",
- "vp80-01-intra-1411.ivf", "vp80-01-intra-1416.ivf",
- "vp80-01-intra-1417.ivf", "vp80-02-inter-1402.ivf",
- "vp80-02-inter-1412.ivf", "vp80-02-inter-1418.ivf",
- "vp80-02-inter-1424.ivf", "vp80-03-segmentation-01.ivf",
- "vp80-03-segmentation-02.ivf", "vp80-03-segmentation-03.ivf",
- "vp80-03-segmentation-04.ivf", "vp80-03-segmentation-1401.ivf",
- "vp80-03-segmentation-1403.ivf", "vp80-03-segmentation-1407.ivf",
- "vp80-03-segmentation-1408.ivf", "vp80-03-segmentation-1409.ivf",
- "vp80-03-segmentation-1410.ivf", "vp80-03-segmentation-1413.ivf",
- "vp80-03-segmentation-1414.ivf", "vp80-03-segmentation-1415.ivf",
- "vp80-03-segmentation-1425.ivf", "vp80-03-segmentation-1426.ivf",
- "vp80-03-segmentation-1427.ivf", "vp80-03-segmentation-1432.ivf",
- "vp80-03-segmentation-1435.ivf", "vp80-03-segmentation-1436.ivf",
- "vp80-03-segmentation-1437.ivf", "vp80-03-segmentation-1441.ivf",
- "vp80-03-segmentation-1442.ivf", "vp80-04-partitions-1404.ivf",
- "vp80-04-partitions-1405.ivf", "vp80-04-partitions-1406.ivf",
- "vp80-05-sharpness-1428.ivf", "vp80-05-sharpness-1429.ivf",
- "vp80-05-sharpness-1430.ivf", "vp80-05-sharpness-1431.ivf",
- "vp80-05-sharpness-1433.ivf", "vp80-05-sharpness-1434.ivf",
- "vp80-05-sharpness-1438.ivf", "vp80-05-sharpness-1439.ivf",
- "vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf"
-};
-#endif
-#if CONFIG_VP9_DECODER
-const char *kVP9TestVectors[] = {
- "vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
- "vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
- "vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm",
- "vp90-2-00-quantizer-06.webm", "vp90-2-00-quantizer-07.webm",
- "vp90-2-00-quantizer-08.webm", "vp90-2-00-quantizer-09.webm",
- "vp90-2-00-quantizer-10.webm", "vp90-2-00-quantizer-11.webm",
- "vp90-2-00-quantizer-12.webm", "vp90-2-00-quantizer-13.webm",
- "vp90-2-00-quantizer-14.webm", "vp90-2-00-quantizer-15.webm",
- "vp90-2-00-quantizer-16.webm", "vp90-2-00-quantizer-17.webm",
- "vp90-2-00-quantizer-18.webm", "vp90-2-00-quantizer-19.webm",
- "vp90-2-00-quantizer-20.webm", "vp90-2-00-quantizer-21.webm",
- "vp90-2-00-quantizer-22.webm", "vp90-2-00-quantizer-23.webm",
- "vp90-2-00-quantizer-24.webm", "vp90-2-00-quantizer-25.webm",
- "vp90-2-00-quantizer-26.webm", "vp90-2-00-quantizer-27.webm",
- "vp90-2-00-quantizer-28.webm", "vp90-2-00-quantizer-29.webm",
- "vp90-2-00-quantizer-30.webm", "vp90-2-00-quantizer-31.webm",
- "vp90-2-00-quantizer-32.webm", "vp90-2-00-quantizer-33.webm",
- "vp90-2-00-quantizer-34.webm", "vp90-2-00-quantizer-35.webm",
- "vp90-2-00-quantizer-36.webm", "vp90-2-00-quantizer-37.webm",
- "vp90-2-00-quantizer-38.webm", "vp90-2-00-quantizer-39.webm",
- "vp90-2-00-quantizer-40.webm", "vp90-2-00-quantizer-41.webm",
- "vp90-2-00-quantizer-42.webm", "vp90-2-00-quantizer-43.webm",
- "vp90-2-00-quantizer-44.webm", "vp90-2-00-quantizer-45.webm",
- "vp90-2-00-quantizer-46.webm", "vp90-2-00-quantizer-47.webm",
- "vp90-2-00-quantizer-48.webm", "vp90-2-00-quantizer-49.webm",
- "vp90-2-00-quantizer-50.webm", "vp90-2-00-quantizer-51.webm",
- "vp90-2-00-quantizer-52.webm", "vp90-2-00-quantizer-53.webm",
- "vp90-2-00-quantizer-54.webm", "vp90-2-00-quantizer-55.webm",
- "vp90-2-00-quantizer-56.webm", "vp90-2-00-quantizer-57.webm",
- "vp90-2-00-quantizer-58.webm", "vp90-2-00-quantizer-59.webm",
- "vp90-2-00-quantizer-60.webm", "vp90-2-00-quantizer-61.webm",
- "vp90-2-00-quantizer-62.webm", "vp90-2-00-quantizer-63.webm",
- "vp90-2-01-sharpness-1.webm", "vp90-2-01-sharpness-2.webm",
- "vp90-2-01-sharpness-3.webm", "vp90-2-01-sharpness-4.webm",
- "vp90-2-01-sharpness-5.webm", "vp90-2-01-sharpness-6.webm",
- "vp90-2-01-sharpness-7.webm", "vp90-2-02-size-08x08.webm",
- "vp90-2-02-size-08x10.webm", "vp90-2-02-size-08x16.webm",
- "vp90-2-02-size-08x18.webm", "vp90-2-02-size-08x32.webm",
- "vp90-2-02-size-08x34.webm", "vp90-2-02-size-08x64.webm",
- "vp90-2-02-size-08x66.webm", "vp90-2-02-size-10x08.webm",
- "vp90-2-02-size-10x10.webm", "vp90-2-02-size-10x16.webm",
- "vp90-2-02-size-10x18.webm", "vp90-2-02-size-10x32.webm",
- "vp90-2-02-size-10x34.webm", "vp90-2-02-size-10x64.webm",
- "vp90-2-02-size-10x66.webm", "vp90-2-02-size-16x08.webm",
- "vp90-2-02-size-16x10.webm", "vp90-2-02-size-16x16.webm",
- "vp90-2-02-size-16x18.webm", "vp90-2-02-size-16x32.webm",
- "vp90-2-02-size-16x34.webm", "vp90-2-02-size-16x64.webm",
- "vp90-2-02-size-16x66.webm", "vp90-2-02-size-18x08.webm",
- "vp90-2-02-size-18x10.webm", "vp90-2-02-size-18x16.webm",
- "vp90-2-02-size-18x18.webm", "vp90-2-02-size-18x32.webm",
- "vp90-2-02-size-18x34.webm", "vp90-2-02-size-18x64.webm",
- "vp90-2-02-size-18x66.webm", "vp90-2-02-size-32x08.webm",
- "vp90-2-02-size-32x10.webm", "vp90-2-02-size-32x16.webm",
- "vp90-2-02-size-32x18.webm", "vp90-2-02-size-32x32.webm",
- "vp90-2-02-size-32x34.webm", "vp90-2-02-size-32x64.webm",
- "vp90-2-02-size-32x66.webm", "vp90-2-02-size-34x08.webm",
- "vp90-2-02-size-34x10.webm", "vp90-2-02-size-34x16.webm",
- "vp90-2-02-size-34x18.webm", "vp90-2-02-size-34x32.webm",
- "vp90-2-02-size-34x34.webm", "vp90-2-02-size-34x64.webm",
- "vp90-2-02-size-34x66.webm", "vp90-2-02-size-64x08.webm",
- "vp90-2-02-size-64x10.webm", "vp90-2-02-size-64x16.webm",
- "vp90-2-02-size-64x18.webm", "vp90-2-02-size-64x32.webm",
- "vp90-2-02-size-64x34.webm", "vp90-2-02-size-64x64.webm",
- "vp90-2-02-size-64x66.webm", "vp90-2-02-size-66x08.webm",
- "vp90-2-02-size-66x10.webm", "vp90-2-02-size-66x16.webm",
- "vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.webm",
- "vp90-2-02-size-66x34.webm", "vp90-2-02-size-66x64.webm",
- "vp90-2-02-size-66x66.webm", "vp90-2-03-size-196x196.webm",
- "vp90-2-03-size-196x198.webm", "vp90-2-03-size-196x200.webm",
- "vp90-2-03-size-196x202.webm", "vp90-2-03-size-196x208.webm",
- "vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
- "vp90-2-03-size-196x226.webm", "vp90-2-03-size-198x196.webm",
- "vp90-2-03-size-198x198.webm", "vp90-2-03-size-198x200.webm",
- "vp90-2-03-size-198x202.webm", "vp90-2-03-size-198x208.webm",
- "vp90-2-03-size-198x210.webm", "vp90-2-03-size-198x224.webm",
- "vp90-2-03-size-198x226.webm", "vp90-2-03-size-200x196.webm",
- "vp90-2-03-size-200x198.webm", "vp90-2-03-size-200x200.webm",
- "vp90-2-03-size-200x202.webm", "vp90-2-03-size-200x208.webm",
- "vp90-2-03-size-200x210.webm", "vp90-2-03-size-200x224.webm",
- "vp90-2-03-size-200x226.webm", "vp90-2-03-size-202x196.webm",
- "vp90-2-03-size-202x198.webm", "vp90-2-03-size-202x200.webm",
- "vp90-2-03-size-202x202.webm", "vp90-2-03-size-202x208.webm",
- "vp90-2-03-size-202x210.webm", "vp90-2-03-size-202x224.webm",
- "vp90-2-03-size-202x226.webm", "vp90-2-03-size-208x196.webm",
- "vp90-2-03-size-208x198.webm", "vp90-2-03-size-208x200.webm",
- "vp90-2-03-size-208x202.webm", "vp90-2-03-size-208x208.webm",
- "vp90-2-03-size-208x210.webm", "vp90-2-03-size-208x224.webm",
- "vp90-2-03-size-208x226.webm", "vp90-2-03-size-210x196.webm",
- "vp90-2-03-size-210x198.webm", "vp90-2-03-size-210x200.webm",
- "vp90-2-03-size-210x202.webm", "vp90-2-03-size-210x208.webm",
- "vp90-2-03-size-210x210.webm", "vp90-2-03-size-210x224.webm",
- "vp90-2-03-size-210x226.webm", "vp90-2-03-size-224x196.webm",
- "vp90-2-03-size-224x198.webm", "vp90-2-03-size-224x200.webm",
- "vp90-2-03-size-224x202.webm", "vp90-2-03-size-224x208.webm",
- "vp90-2-03-size-224x210.webm", "vp90-2-03-size-224x224.webm",
- "vp90-2-03-size-224x226.webm", "vp90-2-03-size-226x196.webm",
- "vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm",
- "vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm",
- "vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm",
- "vp90-2-03-size-226x226.webm", "vp90-2-03-deltaq.webm",
- "vp90-2-05-resize.ivf", "vp90-2-06-bilinear.webm",
- "vp90-2-07-frame_parallel.webm",
- "vp90-2-08-tile_1x2_frame_parallel.webm", "vp90-2-08-tile_1x2.webm",
- "vp90-2-08-tile_1x4_frame_parallel.webm", "vp90-2-08-tile_1x4.webm",
- "vp90-2-08-tile-4x4.webm", "vp90-2-08-tile-4x1.webm",
-#if CONFIG_NON420
- "vp91-2-04-yv444.webm"
-#endif
-};
-#endif
class TestVectorTest : public ::libvpx_test::DecoderTest,
public ::libvpx_test::CodecTestWithParam<const char*> {
@@ -183,7 +35,7 @@ class TestVectorTest : public ::libvpx_test::DecoderTest,
void OpenMD5File(const std::string& md5_file_name_) {
md5_file_ = libvpx_test::OpenTestDataFile(md5_file_name_);
- ASSERT_TRUE(md5_file_) << "Md5 file open failed. Filename: "
+ ASSERT_TRUE(md5_file_ != NULL) << "Md5 file open failed. Filename: "
<< md5_file_name_;
}
@@ -237,8 +89,8 @@ TEST_P(TestVectorTest, MD5Match) {
}
VP8_INSTANTIATE_TEST_CASE(TestVectorTest,
- ::testing::ValuesIn(kVP8TestVectors));
+ ::testing::ValuesIn(libvpx_test::kVP8TestVectors));
VP9_INSTANTIATE_TEST_CASE(TestVectorTest,
- ::testing::ValuesIn(kVP9TestVectors));
+ ::testing::ValuesIn(libvpx_test::kVP9TestVectors));
} // namespace
diff --git a/libvpx/test/test_vectors.cc b/libvpx/test/test_vectors.cc
new file mode 100644
index 0000000..aba8a3c
--- /dev/null
+++ b/libvpx/test/test_vectors.cc
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "test/test_vectors.h"
+
+namespace libvpx_test {
+
+#if CONFIG_VP8_DECODER
+const char *kVP8TestVectors[kNumVp8TestVectors] = {
+ "vp80-00-comprehensive-001.ivf",
+ "vp80-00-comprehensive-002.ivf", "vp80-00-comprehensive-003.ivf",
+ "vp80-00-comprehensive-004.ivf", "vp80-00-comprehensive-005.ivf",
+ "vp80-00-comprehensive-006.ivf", "vp80-00-comprehensive-007.ivf",
+ "vp80-00-comprehensive-008.ivf", "vp80-00-comprehensive-009.ivf",
+ "vp80-00-comprehensive-010.ivf", "vp80-00-comprehensive-011.ivf",
+ "vp80-00-comprehensive-012.ivf", "vp80-00-comprehensive-013.ivf",
+ "vp80-00-comprehensive-014.ivf", "vp80-00-comprehensive-015.ivf",
+ "vp80-00-comprehensive-016.ivf", "vp80-00-comprehensive-017.ivf",
+ "vp80-00-comprehensive-018.ivf", "vp80-01-intra-1400.ivf",
+ "vp80-01-intra-1411.ivf", "vp80-01-intra-1416.ivf",
+ "vp80-01-intra-1417.ivf", "vp80-02-inter-1402.ivf",
+ "vp80-02-inter-1412.ivf", "vp80-02-inter-1418.ivf",
+ "vp80-02-inter-1424.ivf", "vp80-03-segmentation-01.ivf",
+ "vp80-03-segmentation-02.ivf", "vp80-03-segmentation-03.ivf",
+ "vp80-03-segmentation-04.ivf", "vp80-03-segmentation-1401.ivf",
+ "vp80-03-segmentation-1403.ivf", "vp80-03-segmentation-1407.ivf",
+ "vp80-03-segmentation-1408.ivf", "vp80-03-segmentation-1409.ivf",
+ "vp80-03-segmentation-1410.ivf", "vp80-03-segmentation-1413.ivf",
+ "vp80-03-segmentation-1414.ivf", "vp80-03-segmentation-1415.ivf",
+ "vp80-03-segmentation-1425.ivf", "vp80-03-segmentation-1426.ivf",
+ "vp80-03-segmentation-1427.ivf", "vp80-03-segmentation-1432.ivf",
+ "vp80-03-segmentation-1435.ivf", "vp80-03-segmentation-1436.ivf",
+ "vp80-03-segmentation-1437.ivf", "vp80-03-segmentation-1441.ivf",
+ "vp80-03-segmentation-1442.ivf", "vp80-04-partitions-1404.ivf",
+ "vp80-04-partitions-1405.ivf", "vp80-04-partitions-1406.ivf",
+ "vp80-05-sharpness-1428.ivf", "vp80-05-sharpness-1429.ivf",
+ "vp80-05-sharpness-1430.ivf", "vp80-05-sharpness-1431.ivf",
+ "vp80-05-sharpness-1433.ivf", "vp80-05-sharpness-1434.ivf",
+ "vp80-05-sharpness-1438.ivf", "vp80-05-sharpness-1439.ivf",
+ "vp80-05-sharpness-1440.ivf", "vp80-05-sharpness-1443.ivf",
+ "vp80-06-smallsize.ivf"
+};
+#endif // CONFIG_VP8_DECODER
+#if CONFIG_VP9_DECODER
+const char *kVP9TestVectors[kNumVp9TestVectors] = {
+ "vp90-2-00-quantizer-00.webm", "vp90-2-00-quantizer-01.webm",
+ "vp90-2-00-quantizer-02.webm", "vp90-2-00-quantizer-03.webm",
+ "vp90-2-00-quantizer-04.webm", "vp90-2-00-quantizer-05.webm",
+ "vp90-2-00-quantizer-06.webm", "vp90-2-00-quantizer-07.webm",
+ "vp90-2-00-quantizer-08.webm", "vp90-2-00-quantizer-09.webm",
+ "vp90-2-00-quantizer-10.webm", "vp90-2-00-quantizer-11.webm",
+ "vp90-2-00-quantizer-12.webm", "vp90-2-00-quantizer-13.webm",
+ "vp90-2-00-quantizer-14.webm", "vp90-2-00-quantizer-15.webm",
+ "vp90-2-00-quantizer-16.webm", "vp90-2-00-quantizer-17.webm",
+ "vp90-2-00-quantizer-18.webm", "vp90-2-00-quantizer-19.webm",
+ "vp90-2-00-quantizer-20.webm", "vp90-2-00-quantizer-21.webm",
+ "vp90-2-00-quantizer-22.webm", "vp90-2-00-quantizer-23.webm",
+ "vp90-2-00-quantizer-24.webm", "vp90-2-00-quantizer-25.webm",
+ "vp90-2-00-quantizer-26.webm", "vp90-2-00-quantizer-27.webm",
+ "vp90-2-00-quantizer-28.webm", "vp90-2-00-quantizer-29.webm",
+ "vp90-2-00-quantizer-30.webm", "vp90-2-00-quantizer-31.webm",
+ "vp90-2-00-quantizer-32.webm", "vp90-2-00-quantizer-33.webm",
+ "vp90-2-00-quantizer-34.webm", "vp90-2-00-quantizer-35.webm",
+ "vp90-2-00-quantizer-36.webm", "vp90-2-00-quantizer-37.webm",
+ "vp90-2-00-quantizer-38.webm", "vp90-2-00-quantizer-39.webm",
+ "vp90-2-00-quantizer-40.webm", "vp90-2-00-quantizer-41.webm",
+ "vp90-2-00-quantizer-42.webm", "vp90-2-00-quantizer-43.webm",
+ "vp90-2-00-quantizer-44.webm", "vp90-2-00-quantizer-45.webm",
+ "vp90-2-00-quantizer-46.webm", "vp90-2-00-quantizer-47.webm",
+ "vp90-2-00-quantizer-48.webm", "vp90-2-00-quantizer-49.webm",
+ "vp90-2-00-quantizer-50.webm", "vp90-2-00-quantizer-51.webm",
+ "vp90-2-00-quantizer-52.webm", "vp90-2-00-quantizer-53.webm",
+ "vp90-2-00-quantizer-54.webm", "vp90-2-00-quantizer-55.webm",
+ "vp90-2-00-quantizer-56.webm", "vp90-2-00-quantizer-57.webm",
+ "vp90-2-00-quantizer-58.webm", "vp90-2-00-quantizer-59.webm",
+ "vp90-2-00-quantizer-60.webm", "vp90-2-00-quantizer-61.webm",
+ "vp90-2-00-quantizer-62.webm", "vp90-2-00-quantizer-63.webm",
+ "vp90-2-01-sharpness-1.webm", "vp90-2-01-sharpness-2.webm",
+ "vp90-2-01-sharpness-3.webm", "vp90-2-01-sharpness-4.webm",
+ "vp90-2-01-sharpness-5.webm", "vp90-2-01-sharpness-6.webm",
+ "vp90-2-01-sharpness-7.webm", "vp90-2-02-size-08x08.webm",
+ "vp90-2-02-size-08x10.webm", "vp90-2-02-size-08x16.webm",
+ "vp90-2-02-size-08x18.webm", "vp90-2-02-size-08x32.webm",
+ "vp90-2-02-size-08x34.webm", "vp90-2-02-size-08x64.webm",
+ "vp90-2-02-size-08x66.webm", "vp90-2-02-size-10x08.webm",
+ "vp90-2-02-size-10x10.webm", "vp90-2-02-size-10x16.webm",
+ "vp90-2-02-size-10x18.webm", "vp90-2-02-size-10x32.webm",
+ "vp90-2-02-size-10x34.webm", "vp90-2-02-size-10x64.webm",
+ "vp90-2-02-size-10x66.webm", "vp90-2-02-size-16x08.webm",
+ "vp90-2-02-size-16x10.webm", "vp90-2-02-size-16x16.webm",
+ "vp90-2-02-size-16x18.webm", "vp90-2-02-size-16x32.webm",
+ "vp90-2-02-size-16x34.webm", "vp90-2-02-size-16x64.webm",
+ "vp90-2-02-size-16x66.webm", "vp90-2-02-size-18x08.webm",
+ "vp90-2-02-size-18x10.webm", "vp90-2-02-size-18x16.webm",
+ "vp90-2-02-size-18x18.webm", "vp90-2-02-size-18x32.webm",
+ "vp90-2-02-size-18x34.webm", "vp90-2-02-size-18x64.webm",
+ "vp90-2-02-size-18x66.webm", "vp90-2-02-size-32x08.webm",
+ "vp90-2-02-size-32x10.webm", "vp90-2-02-size-32x16.webm",
+ "vp90-2-02-size-32x18.webm", "vp90-2-02-size-32x32.webm",
+ "vp90-2-02-size-32x34.webm", "vp90-2-02-size-32x64.webm",
+ "vp90-2-02-size-32x66.webm", "vp90-2-02-size-34x08.webm",
+ "vp90-2-02-size-34x10.webm", "vp90-2-02-size-34x16.webm",
+ "vp90-2-02-size-34x18.webm", "vp90-2-02-size-34x32.webm",
+ "vp90-2-02-size-34x34.webm", "vp90-2-02-size-34x64.webm",
+ "vp90-2-02-size-34x66.webm", "vp90-2-02-size-64x08.webm",
+ "vp90-2-02-size-64x10.webm", "vp90-2-02-size-64x16.webm",
+ "vp90-2-02-size-64x18.webm", "vp90-2-02-size-64x32.webm",
+ "vp90-2-02-size-64x34.webm", "vp90-2-02-size-64x64.webm",
+ "vp90-2-02-size-64x66.webm", "vp90-2-02-size-66x08.webm",
+ "vp90-2-02-size-66x10.webm", "vp90-2-02-size-66x16.webm",
+ "vp90-2-02-size-66x18.webm", "vp90-2-02-size-66x32.webm",
+ "vp90-2-02-size-66x34.webm", "vp90-2-02-size-66x64.webm",
+ "vp90-2-02-size-66x66.webm", "vp90-2-03-size-196x196.webm",
+ "vp90-2-03-size-196x198.webm", "vp90-2-03-size-196x200.webm",
+ "vp90-2-03-size-196x202.webm", "vp90-2-03-size-196x208.webm",
+ "vp90-2-03-size-196x210.webm", "vp90-2-03-size-196x224.webm",
+ "vp90-2-03-size-196x226.webm", "vp90-2-03-size-198x196.webm",
+ "vp90-2-03-size-198x198.webm", "vp90-2-03-size-198x200.webm",
+ "vp90-2-03-size-198x202.webm", "vp90-2-03-size-198x208.webm",
+ "vp90-2-03-size-198x210.webm", "vp90-2-03-size-198x224.webm",
+ "vp90-2-03-size-198x226.webm", "vp90-2-03-size-200x196.webm",
+ "vp90-2-03-size-200x198.webm", "vp90-2-03-size-200x200.webm",
+ "vp90-2-03-size-200x202.webm", "vp90-2-03-size-200x208.webm",
+ "vp90-2-03-size-200x210.webm", "vp90-2-03-size-200x224.webm",
+ "vp90-2-03-size-200x226.webm", "vp90-2-03-size-202x196.webm",
+ "vp90-2-03-size-202x198.webm", "vp90-2-03-size-202x200.webm",
+ "vp90-2-03-size-202x202.webm", "vp90-2-03-size-202x208.webm",
+ "vp90-2-03-size-202x210.webm", "vp90-2-03-size-202x224.webm",
+ "vp90-2-03-size-202x226.webm", "vp90-2-03-size-208x196.webm",
+ "vp90-2-03-size-208x198.webm", "vp90-2-03-size-208x200.webm",
+ "vp90-2-03-size-208x202.webm", "vp90-2-03-size-208x208.webm",
+ "vp90-2-03-size-208x210.webm", "vp90-2-03-size-208x224.webm",
+ "vp90-2-03-size-208x226.webm", "vp90-2-03-size-210x196.webm",
+ "vp90-2-03-size-210x198.webm", "vp90-2-03-size-210x200.webm",
+ "vp90-2-03-size-210x202.webm", "vp90-2-03-size-210x208.webm",
+ "vp90-2-03-size-210x210.webm", "vp90-2-03-size-210x224.webm",
+ "vp90-2-03-size-210x226.webm", "vp90-2-03-size-224x196.webm",
+ "vp90-2-03-size-224x198.webm", "vp90-2-03-size-224x200.webm",
+ "vp90-2-03-size-224x202.webm", "vp90-2-03-size-224x208.webm",
+ "vp90-2-03-size-224x210.webm", "vp90-2-03-size-224x224.webm",
+ "vp90-2-03-size-224x226.webm", "vp90-2-03-size-226x196.webm",
+ "vp90-2-03-size-226x198.webm", "vp90-2-03-size-226x200.webm",
+ "vp90-2-03-size-226x202.webm", "vp90-2-03-size-226x208.webm",
+ "vp90-2-03-size-226x210.webm", "vp90-2-03-size-226x224.webm",
+ "vp90-2-03-size-226x226.webm", "vp90-2-03-deltaq.webm",
+ "vp90-2-05-resize.ivf", "vp90-2-06-bilinear.webm",
+ "vp90-2-07-frame_parallel.webm", "vp90-2-08-tile_1x2_frame_parallel.webm",
+ "vp90-2-08-tile_1x2.webm", "vp90-2-08-tile_1x4_frame_parallel.webm",
+ "vp90-2-08-tile_1x4.webm", "vp90-2-08-tile_1x8_frame_parallel.webm",
+ "vp90-2-08-tile_1x8.webm", "vp90-2-08-tile-4x4.webm",
+ "vp90-2-08-tile-4x1.webm", "vp90-2-09-subpixel-00.ivf",
+ "vp90-2-02-size-lf-1920x1080.webm", "vp90-2-09-aq2.webm",
+ "vp90-2-09-lf_deltas.webm", "vp90-2-10-show-existing-frame.webm",
+ "vp90-2-11-size-351x287.webm", "vp90-2-11-size-351x288.webm",
+ "vp90-2-11-size-352x287.webm", "vp90-2-12-droppable_1.ivf",
+ "vp90-2-12-droppable_2.ivf", "vp90-2-12-droppable_3.ivf",
+ "vp91-2-04-yv444.webm"
+};
+#endif // CONFIG_VP9_DECODER
+
+} // namespace libvpx_test
diff --git a/libvpx/test/test_vectors.h b/libvpx/test/test_vectors.h
new file mode 100644
index 0000000..d5ecc96
--- /dev/null
+++ b/libvpx/test/test_vectors.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef TEST_TEST_VECTORS_H_
+#define TEST_TEST_VECTORS_H_
+
+#include "./vpx_config.h"
+
+namespace libvpx_test {
+
+#if CONFIG_VP8_DECODER
+const int kNumVp8TestVectors = 62;
+extern const char *kVP8TestVectors[kNumVp8TestVectors];
+#endif
+
+#if CONFIG_VP9_DECODER
+const int kNumVp9TestVectors = 223;
+
+extern const char *kVP9TestVectors[kNumVp9TestVectors];
+#endif // CONFIG_VP9_DECODER
+
+} // namespace libvpx_test
+
+#endif // TEST_TEST_VECTORS_H_
diff --git a/libvpx/test/tile_independence_test.cc b/libvpx/test/tile_independence_test.cc
index 403dbb6..d714452 100644
--- a/libvpx/test/tile_independence_test.cc
+++ b/libvpx/test/tile_independence_test.cc
@@ -1,11 +1,11 @@
/*
- Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-
- Use of this source code is governed by a BSD-style license
- that can be found in the LICENSE file in the root of the source
- tree. An additional intellectual property rights grant can be found
- in the file PATENTS. All contributing project authors may
- be found in the AUTHORS file in the root of the source tree.
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
*/
#include <cstdio>
@@ -17,9 +17,7 @@
#include "test/i420_video_source.h"
#include "test/util.h"
#include "test/md5_helper.h"
-extern "C" {
#include "vpx_mem/vpx_mem.h"
-}
namespace {
class TileIndependenceTest : public ::libvpx_test::EncoderTest,
diff --git a/libvpx/test/util.h b/libvpx/test/util.h
index 4d7f3d4..3c45721 100644
--- a/libvpx/test/util.h
+++ b/libvpx/test/util.h
@@ -17,7 +17,6 @@
#include "vpx/vpx_image.h"
// Macros
-#define PARAMS(...) ::testing::TestWithParam< std::tr1::tuple< __VA_ARGS__ > >
#define GET_PARAM(k) std::tr1::get< k >(GetParam())
static double compute_psnr(const vpx_image_t *img1,
diff --git a/libvpx/test/variance_test.cc b/libvpx/test/variance_test.cc
index 3f55601..c9bf13a 100644
--- a/libvpx/test/variance_test.cc
+++ b/libvpx/test/variance_test.cc
@@ -17,17 +17,15 @@
#include "vpx/vpx_integer.h"
#include "./vpx_config.h"
-extern "C" {
#include "vpx_mem/vpx_mem.h"
#if CONFIG_VP8_ENCODER
-# include "vp8/common/variance.h"
# include "./vp8_rtcd.h"
+# include "vp8/common/variance.h"
#endif
#if CONFIG_VP9_ENCODER
-# include "vp9/encoder/vp9_variance.h"
# include "./vp9_rtcd.h"
+# include "vp9/encoder/vp9_variance.h"
#endif
-}
#include "test/acm_random.h"
namespace {
@@ -309,6 +307,19 @@ INSTANTIATE_TEST_CASE_P(
make_tuple(4, 3, variance16x8_c),
make_tuple(4, 4, variance16x16_c)));
+#if HAVE_NEON
+const vp8_variance_fn_t variance8x8_neon = vp8_variance8x8_neon;
+const vp8_variance_fn_t variance8x16_neon = vp8_variance8x16_neon;
+const vp8_variance_fn_t variance16x8_neon = vp8_variance16x8_neon;
+const vp8_variance_fn_t variance16x16_neon = vp8_variance16x16_neon;
+INSTANTIATE_TEST_CASE_P(
+ NEON, VP8VarianceTest,
+ ::testing::Values(make_tuple(3, 3, variance8x8_neon),
+ make_tuple(3, 4, variance8x16_neon),
+ make_tuple(4, 3, variance16x8_neon),
+ make_tuple(4, 4, variance16x16_neon)));
+#endif
+
#if HAVE_MMX
const vp8_variance_fn_t variance4x4_mmx = vp8_variance4x4_mmx;
const vp8_variance_fn_t variance8x8_mmx = vp8_variance8x8_mmx;
diff --git a/libvpx/test/video_source.h b/libvpx/test/video_source.h
index 3d01d39..6d1855a 100644
--- a/libvpx/test/video_source.h
+++ b/libvpx/test/video_source.h
@@ -184,9 +184,9 @@ class CompressedVideoSource {
virtual const uint8_t *cxdata() const = 0;
- virtual const unsigned int frame_size() const = 0;
+ virtual size_t frame_size() const = 0;
- virtual const unsigned int frame_number() const = 0;
+ virtual unsigned int frame_number() const = 0;
};
} // namespace libvpx_test
diff --git a/libvpx/test/vp8_boolcoder_test.cc b/libvpx/test/vp8_boolcoder_test.cc
index 0383af2..9cd1987 100644
--- a/libvpx/test/vp8_boolcoder_test.cc
+++ b/libvpx/test/vp8_boolcoder_test.cc
@@ -20,10 +20,8 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "vpx/vpx_integer.h"
-extern "C" {
#include "vp8/encoder/boolhuff.h"
#include "vp8/decoder/dboolhuff.h"
-}
namespace {
const int num_tests = 10;
@@ -37,15 +35,15 @@ const uint8_t secret_key[16] = {
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
};
-void encrypt_buffer(uint8_t *buffer, int size) {
- for (int i = 0; i < size; ++i) {
+void encrypt_buffer(uint8_t *buffer, size_t size) {
+ for (size_t i = 0; i < size; ++i) {
buffer[i] ^= secret_key[i & 15];
}
}
void test_decrypt_cb(void *decrypt_state, const uint8_t *input,
- uint8_t *output, int count) {
- int offset = input - reinterpret_cast<uint8_t *>(decrypt_state);
+ uint8_t *output, int count) {
+ const size_t offset = input - reinterpret_cast<uint8_t*>(decrypt_state);
for (int i = 0; i < count; i++) {
output[i] = input[i] ^ secret_key[(offset + i) & 15];
}
diff --git a/libvpx/test/vp8_decrypt_test.cc b/libvpx/test/vp8_decrypt_test.cc
index b092509..1b5b083 100644
--- a/libvpx/test/vp8_decrypt_test.cc
+++ b/libvpx/test/vp8_decrypt_test.cc
@@ -26,9 +26,9 @@ const uint8_t test_key[16] = {
0x89, 0x9a, 0xab, 0xbc, 0xcd, 0xde, 0xef, 0xf0
};
-void encrypt_buffer(const uint8_t *src, uint8_t *dst,
- int size, int offset = 0) {
- for (int i = 0; i < size; ++i) {
+void encrypt_buffer(const uint8_t *src, uint8_t *dst, size_t size,
+ ptrdiff_t offset) {
+ for (size_t i = 0; i < size; ++i) {
dst[i] = src[i] ^ test_key[(offset + i) & 15];
}
}
@@ -61,7 +61,7 @@ TEST(TestDecrypt, DecryptWorks) {
#if CONFIG_DECRYPT
std::vector<uint8_t> encrypted(video.frame_size());
- encrypt_buffer(video.cxdata(), &encrypted[0], video.frame_size());
+ encrypt_buffer(video.cxdata(), &encrypted[0], video.frame_size(), 0);
vp8_decrypt_init di = { test_decrypt_cb, &encrypted[0] };
decoder.Control(VP8D_SET_DECRYPTOR, &di);
#endif // CONFIG_DECRYPT
diff --git a/libvpx/test/vp8_fdct4x4_test.cc b/libvpx/test/vp8_fdct4x4_test.cc
index c823436..e3c292e 100644
--- a/libvpx/test/vp8_fdct4x4_test.cc
+++ b/libvpx/test/vp8_fdct4x4_test.cc
@@ -1,13 +1,12 @@
/*
-* Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-*
-* Use of this source code is governed by a BSD-style license
-* that can be found in the LICENSE file in the root of the source
-* tree. An additional intellectual property rights grant can be found
-* in the file PATENTS. All contributing project authors may
-* be found in the AUTHORS file in the root of the source tree.
-*/
-
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
#include <math.h>
#include <stddef.h>
@@ -16,16 +15,12 @@
#include <string.h>
#include <sys/types.h>
-
-extern "C" {
#include "./vp8_rtcd.h"
-}
#include "test/acm_random.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "vpx/vpx_integer.h"
-
namespace {
const int cospi8sqrt2minus1 = 20091;
diff --git a/libvpx/test/vp9_boolcoder_test.cc b/libvpx/test/vp9_boolcoder_test.cc
index 5edde90..c579ade 100644
--- a/libvpx/test/vp9_boolcoder_test.cc
+++ b/libvpx/test/vp9_boolcoder_test.cc
@@ -14,10 +14,8 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
-extern "C" {
-#include "vp9/encoder/vp9_boolhuff.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
-}
+#include "vp9/decoder/vp9_reader.h"
+#include "vp9/encoder/vp9_writer.h"
#include "test/acm_random.h"
#include "vpx/vpx_integer.h"
diff --git a/libvpx/test/vp9_lossless_test.cc b/libvpx/test/vp9_lossless_test.cc
index 30a3118..7c3ba9f 100644
--- a/libvpx/test/vp9_lossless_test.cc
+++ b/libvpx/test/vp9_lossless_test.cc
@@ -1,33 +1,35 @@
/*
- Copyright (c) 2012 The WebM project authors. All Rights Reserved.
-
- Use of this source code is governed by a BSD-style license
- that can be found in the LICENSE file in the root of the source
- tree. An additional intellectual property rights grant can be found
- in the file PATENTS. All contributing project authors may
- be found in the AUTHORS file in the root of the source tree.
-*/
-
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#include "./vpx_config.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
#include "test/encode_test_driver.h"
#include "test/i420_video_source.h"
#include "test/util.h"
+#include "test/y4m_video_source.h"
namespace {
const int kMaxPsnr = 100;
-class LossLessTest : public ::libvpx_test::EncoderTest,
+class LosslessTestLarge : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<libvpx_test::TestMode> {
protected:
- LossLessTest() : EncoderTest(GET_PARAM(0)),
- psnr_(kMaxPsnr),
- nframes_(0),
- encoding_mode_(GET_PARAM(1)) {
+ LosslessTestLarge()
+ : EncoderTest(GET_PARAM(0)),
+ psnr_(kMaxPsnr),
+ nframes_(0),
+ encoding_mode_(GET_PARAM(1)) {
}
- virtual ~LossLessTest() {}
+ virtual ~LosslessTestLarge() {}
virtual void SetUp() {
InitializeConfig();
@@ -54,7 +56,7 @@ class LossLessTest : public ::libvpx_test::EncoderTest,
libvpx_test::TestMode encoding_mode_;
};
-TEST_P(LossLessTest, TestLossLessEncoding) {
+TEST_P(LosslessTestLarge, TestLossLessEncoding) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
cfg_.rc_target_bitrate = 2000;
@@ -66,10 +68,28 @@ TEST_P(LossLessTest, TestLossLessEncoding) {
// intentionally changed the dimension for better testing coverage
libvpx_test::I420VideoSource video("hantro_collage_w352h288.yuv", 352, 288,
- timebase.den, timebase.num, 0, 30);
+ timebase.den, timebase.num, 0, 10);
+ ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
+ const double psnr_lossless = GetMinPsnr();
+ EXPECT_GE(psnr_lossless, kMaxPsnr);
+}
+
+TEST_P(LosslessTestLarge, TestLossLessEncoding444) {
+ libvpx_test::Y4mVideoSource video("rush_hour_444.y4m", 0, 10);
+
+ cfg_.g_profile = 1;
+ cfg_.g_timebase = video.timebase();
+ cfg_.rc_target_bitrate = 2000;
+ cfg_.g_lag_in_frames = 25;
+ cfg_.rc_min_quantizer = 0;
+ cfg_.rc_max_quantizer = 0;
+
+ init_flags_ = VPX_CODEC_USE_PSNR;
+
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
const double psnr_lossless = GetMinPsnr();
EXPECT_GE(psnr_lossless, kMaxPsnr);
}
-VP9_INSTANTIATE_TEST_CASE(LossLessTest, ALL_TEST_MODES);
+
+VP9_INSTANTIATE_TEST_CASE(LosslessTestLarge, ALL_TEST_MODES);
} // namespace
diff --git a/libvpx/test/vp9_subtract_test.cc b/libvpx/test/vp9_subtract_test.cc
index 332a839..d7df286 100644
--- a/libvpx/test/vp9_subtract_test.cc
+++ b/libvpx/test/vp9_subtract_test.cc
@@ -12,12 +12,10 @@
#include "test/acm_random.h"
#include "test/clear_system_state.h"
#include "test/register_state_check.h"
-extern "C" {
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_blockd.h"
#include "vpx_mem/vpx_mem.h"
-}
typedef void (*subtract_fn_t)(int rows, int cols,
int16_t *diff_ptr, ptrdiff_t diff_stride,
@@ -41,8 +39,8 @@ TEST_P(VP9SubtractBlockTest, SimpleSubtract) {
// FIXME(rbultje) split in its own file
for (BLOCK_SIZE bsize = BLOCK_4X4; bsize < BLOCK_SIZES;
bsize = static_cast<BLOCK_SIZE>(static_cast<int>(bsize) + 1)) {
- const int block_width = 4 << b_width_log2(bsize);
- const int block_height = 4 << b_height_log2(bsize);
+ const int block_width = 4 * num_4x4_blocks_wide_lookup[bsize];
+ const int block_height = 4 * num_4x4_blocks_high_lookup[bsize];
int16_t *diff = reinterpret_cast<int16_t *>(
vpx_memalign(16, sizeof(*diff) * block_width * block_height * 2));
uint8_t *pred = reinterpret_cast<uint8_t *>(
diff --git a/libvpx/test/vp9_thread_test.cc b/libvpx/test/vp9_thread_test.cc
index a8ce6e4..a78cdea 100644
--- a/libvpx/test/vp9_thread_test.cc
+++ b/libvpx/test/vp9_thread_test.cc
@@ -141,10 +141,12 @@ TEST(VP9DecodeMTTest, MTDecode2) {
"68ede6abd66bae0a2edf2eb9232241b6" },
{ "vp90-2-08-tile_1x4_frame_parallel.webm",
"368ebc6ebf3a5e478d85b2c3149b2848" },
+ { "vp90-2-08-tile_1x8_frame_parallel.webm",
+ "17e439da2388aff3a0f69cb22579c6c1" },
};
for (int i = 0; i < static_cast<int>(sizeof(files) / sizeof(files[0])); ++i) {
- for (int t = 2; t <= 4; ++t) {
+ for (int t = 2; t <= 8; ++t) {
EXPECT_STREQ(files[i].expected_md5, DecodeFile(files[i].name, t).c_str())
<< "threads = " << t;
}
diff --git a/libvpx/test/webm_video_source.h b/libvpx/test/webm_video_source.h
index 9fc8545..9d88ae3 100644
--- a/libvpx/test/webm_video_source.h
+++ b/libvpx/test/webm_video_source.h
@@ -14,7 +14,7 @@
#include <cstdlib>
#include <new>
#include <string>
-#include "nestegg/include/nestegg/nestegg.h"
+#include "third_party/nestegg/include/nestegg/nestegg.h"
#include "test/video_source.h"
namespace libvpx_test {
@@ -90,8 +90,12 @@ class WebMVideoSource : public CompressedVideoSource {
virtual ~WebMVideoSource() {
if (input_file_)
fclose(input_file_);
- if (nestegg_ctx_)
+ if (nestegg_ctx_ != NULL) {
+ if (pkt_ != NULL) {
+ nestegg_free_packet(pkt_);
+ }
nestegg_destroy(nestegg_ctx_);
+ }
}
virtual void Init() {
@@ -104,7 +108,7 @@ class WebMVideoSource : public CompressedVideoSource {
nestegg_io io = {nestegg_read_cb, nestegg_seek_cb, nestegg_tell_cb,
input_file_};
- ASSERT_FALSE(nestegg_init(&nestegg_ctx_, io, NULL))
+ ASSERT_FALSE(nestegg_init(&nestegg_ctx_, io, NULL, -1))
<< "nestegg_init failed";
unsigned int n;
@@ -136,8 +140,10 @@ class WebMVideoSource : public CompressedVideoSource {
do {
/* End of this packet, get another. */
- if (pkt_)
+ if (pkt_ != NULL) {
nestegg_free_packet(pkt_);
+ pkt_ = NULL;
+ }
int again = nestegg_read_packet(nestegg_ctx_, &pkt_);
ASSERT_GE(again, 0) << "nestegg_read_packet failed";
@@ -163,8 +169,8 @@ class WebMVideoSource : public CompressedVideoSource {
virtual const uint8_t *cxdata() const {
return end_of_file_ ? NULL : buf_;
}
- virtual const unsigned int frame_size() const { return buf_sz_; }
- virtual const unsigned int frame_number() const { return frame_; }
+ virtual size_t frame_size() const { return buf_sz_; }
+ virtual unsigned int frame_number() const { return frame_; }
protected:
std::string file_name_;
diff --git a/libvpx/test/y4m_video_source.h b/libvpx/test/y4m_video_source.h
new file mode 100644
index 0000000..7419043
--- /dev/null
+++ b/libvpx/test/y4m_video_source.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef TEST_Y4M_VIDEO_SOURCE_H_
+#define TEST_Y4M_VIDEO_SOURCE_H_
+#include <string>
+
+#include "test/video_source.h"
+#include "./y4minput.h"
+
+namespace libvpx_test {
+
+// This class extends VideoSource to allow parsing of raw yv12
+// so that we can do actual file encodes.
+class Y4mVideoSource : public VideoSource {
+ public:
+ Y4mVideoSource(const std::string &file_name,
+ unsigned int start, int limit)
+ : file_name_(file_name),
+ input_file_(NULL),
+ img_(new vpx_image_t()),
+ start_(start),
+ limit_(limit),
+ frame_(0),
+ framerate_numerator_(0),
+ framerate_denominator_(0),
+ y4m_() {
+ }
+
+ virtual ~Y4mVideoSource() {
+ vpx_img_free(img_.get());
+ CloseSource();
+ }
+
+ virtual void Begin() {
+ CloseSource();
+ input_file_ = OpenTestDataFile(file_name_);
+ ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
+ << file_name_;
+
+ y4m_input_open(&y4m_, input_file_, NULL, 0, 0);
+ framerate_numerator_ = y4m_.fps_n;
+ framerate_denominator_ = y4m_.fps_d;
+
+ frame_ = 0;
+ for (unsigned int i = 0; i < start_; i++) {
+ Next();
+ }
+
+ FillFrame();
+ }
+
+ virtual void Next() {
+ ++frame_;
+ FillFrame();
+ }
+
+ virtual vpx_image_t *img() const {
+ return (frame_ < limit_) ? img_.get() : NULL;
+ }
+
+ // Models a stream where Timebase = 1/FPS, so pts == frame.
+ virtual vpx_codec_pts_t pts() const { return frame_; }
+
+ virtual unsigned long duration() const { return 1; }
+
+ virtual vpx_rational_t timebase() const {
+ const vpx_rational_t t = { framerate_denominator_, framerate_numerator_ };
+ return t;
+ }
+
+ virtual unsigned int frame() const { return frame_; }
+
+ virtual unsigned int limit() const { return limit_; }
+
+ virtual void FillFrame() {
+ ASSERT_TRUE(input_file_ != NULL);
+ // Read a frame from input_file.
+ y4m_input_fetch_frame(&y4m_, input_file_, img_.get());
+ }
+
+ protected:
+ void CloseSource() {
+ y4m_input_close(&y4m_);
+ y4m_ = y4m_input();
+ if (input_file_ != NULL) {
+ fclose(input_file_);
+ input_file_ = NULL;
+ }
+ }
+
+ std::string file_name_;
+ FILE *input_file_;
+ testing::internal::scoped_ptr<vpx_image_t> img_;
+ unsigned int start_;
+ unsigned int limit_;
+ unsigned int frame_;
+ int framerate_numerator_;
+ int framerate_denominator_;
+ y4m_input y4m_;
+};
+
+} // namespace libvpx_test
+
+#endif // TEST_Y4M_VIDEO_SOURCE_H_
diff --git a/libvpx/third_party/libmkv/EbmlBufferWriter.c b/libvpx/third_party/libmkv/EbmlBufferWriter.c
index 574e478..116cbc4 100644
--- a/libvpx/third_party/libmkv/EbmlBufferWriter.c
+++ b/libvpx/third_party/libmkv/EbmlBufferWriter.c
@@ -18,8 +18,6 @@ void Ebml_Write(EbmlGlobal *glob, const void *buffer_in, unsigned long len) {
static void _Serialize(EbmlGlobal *glob, const unsigned char *p, const unsigned char *q) {
while (q != p) {
--q;
-
- unsigned long cbWritten;
memcpy(&(glob->buf[glob->offset]), q, 1);
glob->offset++;
}
diff --git a/libvpx/third_party/libmkv/Makefile b/libvpx/third_party/libmkv/Makefile
index b53377b..71aee23 100644
--- a/libvpx/third_party/libmkv/Makefile
+++ b/libvpx/third_party/libmkv/Makefile
@@ -1,8 +1,9 @@
#Variables
CC=gcc
LINKER=gcc
-FLAGS=
+FLAGS=-g -Wall
+all: testlibmkv
#Build Targets
EbmlWriter.o: EbmlWriter.c EbmlWriter.h
@@ -10,16 +11,15 @@ EbmlWriter.o: EbmlWriter.c EbmlWriter.h
EbmlBufferWriter.o: EbmlBufferWriter.c EbmlBufferWriter.h
$(CC) $(FLAGS) -c EbmlBufferWriter.c
-
-MkvElement.o: MkvElement.c WebMElement.h
- $(CC) $(FLAGS) -c MkvElement.c
-
+
+WebMElement.o: WebMElement.c WebMElement.h
+ $(CC) $(FLAGS) -c WebMElement.c
+
testlibmkv.o: testlibmkv.c
$(CC) $(FLAGS) -c testlibmkv.c
-
-testlibmkv: testlibmkv.o MkvElement.o EbmlBufferWriter.o EbmlWriter.o
- $(LINKER) $(FLAGS) testlibmkv.o MkvElement.o EbmlBufferWriter.o EbmlWriter.o -o testlibmkv
+
+testlibmkv: testlibmkv.o WebMElement.o EbmlBufferWriter.o EbmlWriter.o
+ $(LINKER) $(FLAGS) -o testlibmkv testlibmkv.o WebMElement.o EbmlBufferWriter.o EbmlWriter.o
clean:
rm -rf *.o testlibmkv
- \ No newline at end of file
diff --git a/libvpx/third_party/libmkv/WebMElement.c b/libvpx/third_party/libmkv/WebMElement.c
index 2f79a3c..6c3670a 100644
--- a/libvpx/third_party/libmkv/WebMElement.c
+++ b/libvpx/third_party/libmkv/WebMElement.c
@@ -11,6 +11,7 @@
#include "EbmlIDs.h"
#include "WebMElement.h"
#include <stdio.h>
+#include "vpx/vpx_integer.h"
#define kVorbisPrivateMaxSize 4000
@@ -43,22 +44,23 @@ void writeSimpleBlock(EbmlGlobal *glob, unsigned char trackNumber, short timeCod
Ebml_Write(glob, data, dataLength);
}
-static UInt64 generateTrackID(unsigned int trackNumber) {
- UInt64 t = time(NULL) * trackNumber;
- UInt64 r = rand();
+static uint64_t generateTrackID(unsigned int trackNumber) {
+ uint64_t t = time(NULL) * trackNumber;
+ uint64_t r = rand();
r = r << 32;
r += rand();
- UInt64 rval = t ^ r;
+ uint64_t rval = t ^ r;
return rval;
}
-void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing,
- char *codecId, unsigned int pixelWidth, unsigned int pixelHeight,
+void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber,
+ int flagLacing, const char *codecId,
+ unsigned int pixelWidth, unsigned int pixelHeight,
double frameRate) {
EbmlLoc start;
Ebml_StartSubElement(glob, &start, TrackEntry);
Ebml_SerializeUnsigned(glob, TrackNumber, trackNumber);
- UInt64 trackID = generateTrackID(trackNumber);
+ uint64_t trackID = generateTrackID(trackNumber);
Ebml_SerializeUnsigned(glob, TrackUID, trackID);
Ebml_SerializeString(glob, CodecName, "VP8"); // TODO shouldn't be fixed
@@ -74,13 +76,14 @@ void writeVideoTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing,
}
Ebml_EndSubElement(glob, &start); // Track Entry
}
-void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing,
- char *codecId, double samplingFrequency, unsigned int channels,
+void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber,
+ int flagLacing, const char *codecId,
+ double samplingFrequency, unsigned int channels,
unsigned char *private, unsigned long privateSize) {
EbmlLoc start;
Ebml_StartSubElement(glob, &start, TrackEntry);
Ebml_SerializeUnsigned(glob, TrackNumber, trackNumber);
- UInt64 trackID = generateTrackID(trackNumber);
+ uint64_t trackID = generateTrackID(trackNumber);
Ebml_SerializeUnsigned(glob, TrackUID, trackID);
Ebml_SerializeUnsigned(glob, TrackType, 2); // audio is always 2
// I am using defaults for thesed required fields
diff --git a/libvpx/third_party/libmkv/WebMElement.h b/libvpx/third_party/libmkv/WebMElement.h
index d9ad0a0..0e5ec20 100644
--- a/libvpx/third_party/libmkv/WebMElement.h
+++ b/libvpx/third_party/libmkv/WebMElement.h
@@ -10,26 +10,23 @@
#ifndef MKV_CONTEXT_HPP
#define MKV_CONTEXT_HPP 1
-void writeSimpleBock(EbmlGlobal *ebml, unsigned char trackNumber, unsigned short timeCode,
- int isKeyframe, unsigned char lacingFlag, int discardable,
- unsigned char *data, unsigned long dataLength);
-
-
// these are helper functions
void writeHeader(EbmlGlobal *ebml);
-void writeSegmentInformation(EbmlGlobal *ebml, EbmlLoc *startInfo, unsigned long timeCodeScale, double duration);
+void writeSegmentInformation(EbmlGlobal *ebml, EbmlLoc *startInfo,
+ unsigned long timeCodeScale, double duration);
// this function is a helper only, it assumes a lot of defaults
-void writeVideoTrack(EbmlGlobal *ebml, unsigned int trackNumber, int flagLacing,
- char *codecId, unsigned int pixelWidth, unsigned int pixelHeight,
+void writeVideoTrack(EbmlGlobal *ebml, unsigned int trackNumber,
+ int flagLacing, const char *codecId,
+ unsigned int pixelWidth, unsigned int pixelHeight,
double frameRate);
-void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber, int flagLacing,
- char *codecId, double samplingFrequency, unsigned int channels,
+void writeAudioTrack(EbmlGlobal *glob, unsigned int trackNumber,
+ int flagLacing, const char *codecId,
+ double samplingFrequency, unsigned int channels,
unsigned char *private, unsigned long privateSize);
-void writeSimpleBlock(EbmlGlobal *ebml, unsigned char trackNumber, short timeCode,
- int isKeyframe, unsigned char lacingFlag, int discardable,
+void writeSimpleBlock(EbmlGlobal *ebml, unsigned char trackNumber,
+ short timeCode, int isKeyframe,
+ unsigned char lacingFlag, int discardable,
unsigned char *data, unsigned long dataLength);
-
-
-#endif \ No newline at end of file
+#endif
diff --git a/libvpx/third_party/libwebm/AUTHORS.TXT b/libvpx/third_party/libwebm/AUTHORS.TXT
new file mode 100644
index 0000000..8ab6f79
--- /dev/null
+++ b/libvpx/third_party/libwebm/AUTHORS.TXT
@@ -0,0 +1,4 @@
+# Names should be added to this file like so:
+# Name or Organization <email address>
+
+Google Inc.
diff --git a/libvpx/third_party/libwebm/LICENSE.TXT b/libvpx/third_party/libwebm/LICENSE.TXT
new file mode 100644
index 0000000..7a6f995
--- /dev/null
+++ b/libvpx/third_party/libwebm/LICENSE.TXT
@@ -0,0 +1,30 @@
+Copyright (c) 2010, Google Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ * Neither the name of Google nor the names of its contributors may
+ be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/libvpx/third_party/libwebm/PATENTS.TXT b/libvpx/third_party/libwebm/PATENTS.TXT
new file mode 100644
index 0000000..4414d83
--- /dev/null
+++ b/libvpx/third_party/libwebm/PATENTS.TXT
@@ -0,0 +1,22 @@
+Additional IP Rights Grant (Patents)
+
+"This implementation" means the copyrightable works distributed by
+Google as part of the WebM Project.
+
+Google hereby grants to you a perpetual, worldwide, non-exclusive,
+no-charge, royalty-free, irrevocable (except as stated in this section)
+patent license to make, have made, use, offer to sell, sell, import,
+transfer, and otherwise run, modify and propagate the contents of this
+implementation of VP8, where such license applies only to those patent
+claims, both currently owned by Google and acquired in the future,
+licensable by Google that are necessarily infringed by this
+implementation of VP8. This grant does not include claims that would be
+infringed only as a consequence of further modification of this
+implementation. If you or your agent or exclusive licensee institute or
+order or agree to the institution of patent litigation against any
+entity (including a cross-claim or counterclaim in a lawsuit) alleging
+that this implementation of VP8 or any code incorporated within this
+implementation of VP8 constitutes direct or contributory patent
+infringement, or inducement of patent infringement, then any patent
+rights granted to you under this License for this implementation of VP8
+shall terminate as of the date such litigation is filed.
diff --git a/libvpx/third_party/libwebm/README.webm b/libvpx/third_party/libwebm/README.webm
new file mode 100644
index 0000000..b13c8cb
--- /dev/null
+++ b/libvpx/third_party/libwebm/README.webm
@@ -0,0 +1,7 @@
+URL: https://chromium.googlesource.com/webm/libwebm
+Version: 630a0e3c338e1b32bddf513a2dad807908d2976a
+License: BSD
+License File: LICENSE.txt
+
+Description:
+libwebm is used to handle WebM container I/O.
diff --git a/libvpx/third_party/libwebm/RELEASE.TXT b/libvpx/third_party/libwebm/RELEASE.TXT
new file mode 100644
index 0000000..a7e9f03
--- /dev/null
+++ b/libvpx/third_party/libwebm/RELEASE.TXT
@@ -0,0 +1,34 @@
+1.0.0.5
+ * Handled case when no duration
+ * Handled empty clusters
+ * Handled empty clusters when seeking
+ * Implemented check lacing bits
+
+1.0.0.4
+ * Made Cues member variables mutables
+ * Defined against badly-formatted cue points
+ * Segment::GetCluster returns CuePoint too
+ * Separated cue-based searches
+
+1.0.0.3
+ * Added Block::GetOffset() to get a frame's offset in a block
+ * Changed cluster count type from size_t to long
+ * Parsed SeekHead to find cues
+ * Allowed seeking beyond end of cluster cache
+ * Added not to attempt to reparse cues element
+ * Restructured Segment::LoadCluster
+ * Marked position of cues without parsing cues element
+ * Allowed cue points to be loaded incrementally
+ * Implemented to load lazily cue points as they're searched
+ * Merged Cues::LoadCuePoint into Cues::Find
+ * Lazy init cues
+ * Loaded cue point during find
+
+1.0.0.2
+ * added support for Cues element
+ * seeking was improved
+
+1.0.0.1
+ * fixed item 141
+ * added item 142
+ * added this file, RELEASE.TXT, to repository
diff --git a/libvpx/third_party/libwebm/mkvmuxer.cpp b/libvpx/third_party/libwebm/mkvmuxer.cpp
new file mode 100644
index 0000000..8ae0dda
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvmuxer.cpp
@@ -0,0 +1,3245 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#include "mkvmuxer.hpp"
+
+#include <climits>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+#include <new>
+
+#include "mkvmuxerutil.hpp"
+#include "mkvparser.hpp"
+#include "mkvwriter.hpp"
+#include "webmids.hpp"
+
+#ifdef _MSC_VER
+// Disable MSVC warnings that suggest making code non-portable.
+#pragma warning(disable:4996)
+#endif
+
+namespace mkvmuxer {
+
+namespace {
+// Deallocate the string designated by |dst|, and then copy the |src|
+// string to |dst|. The caller owns both the |src| string and the
+// |dst| copy (hence the caller is responsible for eventually
+// deallocating the strings, either directly, or indirectly via
+// StrCpy). Returns true if the source string was successfully copied
+// to the destination.
+bool StrCpy(const char* src, char** dst_ptr) {
+ if (dst_ptr == NULL)
+ return false;
+
+ char*& dst = *dst_ptr;
+
+ delete [] dst;
+ dst = NULL;
+
+ if (src == NULL)
+ return true;
+
+ const size_t size = strlen(src) + 1;
+
+ dst = new (std::nothrow) char[size]; // NOLINT
+ if (dst == NULL)
+ return false;
+
+ strcpy(dst, src); // NOLINT
+ return true;
+}
+} // namespace
+
+///////////////////////////////////////////////////////////////
+//
+// IMkvWriter Class
+
+IMkvWriter::IMkvWriter() {
+}
+
+IMkvWriter::~IMkvWriter() {
+}
+
+bool WriteEbmlHeader(IMkvWriter* writer) {
+ // Level 0
+ uint64 size = EbmlElementSize(kMkvEBMLVersion, 1ULL);
+ size += EbmlElementSize(kMkvEBMLReadVersion, 1ULL);
+ size += EbmlElementSize(kMkvEBMLMaxIDLength, 4ULL);
+ size += EbmlElementSize(kMkvEBMLMaxSizeLength, 8ULL);
+ size += EbmlElementSize(kMkvDocType, "webm");
+ size += EbmlElementSize(kMkvDocTypeVersion, 2ULL);
+ size += EbmlElementSize(kMkvDocTypeReadVersion, 2ULL);
+
+ if (!WriteEbmlMasterElement(writer, kMkvEBML, size))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvEBMLVersion, 1ULL))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvEBMLReadVersion, 1ULL))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvEBMLMaxIDLength, 4ULL))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvEBMLMaxSizeLength, 8ULL))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvDocType, "webm"))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvDocTypeVersion, 2ULL))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvDocTypeReadVersion, 2ULL))
+ return false;
+
+ return true;
+}
+
+bool ChunkedCopy(mkvparser::IMkvReader* source,
+ mkvmuxer::IMkvWriter* dst,
+ mkvmuxer::int64 start, int64 size) {
+ // TODO(vigneshv): Check if this is a reasonable value.
+ const uint32 kBufSize = 2048;
+ uint8* buf = new uint8[kBufSize];
+ int64 offset = start;
+ while (size > 0) {
+ const int64 read_len = (size > kBufSize) ? kBufSize : size;
+ if (source->Read(offset, static_cast<long>(read_len), buf))
+ return false;
+ dst->Write(buf, static_cast<uint32>(read_len));
+ offset += read_len;
+ size -= read_len;
+ }
+ delete[] buf;
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Frame Class
+
+Frame::Frame()
+ : add_id_(0),
+ additional_(NULL),
+ additional_length_(0),
+ duration_(0),
+ frame_(NULL),
+ is_key_(false),
+ length_(0),
+ track_number_(0),
+ timestamp_(0),
+ discard_padding_(0) {
+}
+
+Frame::~Frame() {
+ delete [] frame_;
+ delete [] additional_;
+}
+
+bool Frame::Init(const uint8* frame, uint64 length) {
+ uint8* const data =
+ new (std::nothrow) uint8[static_cast<size_t>(length)]; // NOLINT
+ if (!data)
+ return false;
+
+ delete [] frame_;
+ frame_ = data;
+ length_ = length;
+
+ memcpy(frame_, frame, static_cast<size_t>(length_));
+ return true;
+}
+
+bool Frame::AddAdditionalData(const uint8* additional, uint64 length,
+ uint64 add_id) {
+ uint8* const data =
+ new (std::nothrow) uint8[static_cast<size_t>(length)]; // NOLINT
+ if (!data)
+ return false;
+
+ delete [] additional_;
+ additional_ = data;
+ additional_length_ = length;
+ add_id_ = add_id;
+
+ memcpy(additional_, additional, static_cast<size_t>(additional_length_));
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// CuePoint Class
+
+CuePoint::CuePoint()
+ : time_(0),
+ track_(0),
+ cluster_pos_(0),
+ block_number_(1),
+ output_block_number_(true) {
+}
+
+CuePoint::~CuePoint() {
+}
+
+bool CuePoint::Write(IMkvWriter* writer) const {
+ if (!writer || track_ < 1 || cluster_pos_ < 1)
+ return false;
+
+ uint64 size = EbmlElementSize(kMkvCueClusterPosition, cluster_pos_);
+ size += EbmlElementSize(kMkvCueTrack, track_);
+ if (output_block_number_ && block_number_ > 1)
+ size += EbmlElementSize(kMkvCueBlockNumber, block_number_);
+ const uint64 track_pos_size = EbmlMasterElementSize(kMkvCueTrackPositions,
+ size) + size;
+ const uint64 payload_size = EbmlElementSize(kMkvCueTime, time_) +
+ track_pos_size;
+
+ if (!WriteEbmlMasterElement(writer, kMkvCuePoint, payload_size))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlElement(writer, kMkvCueTime, time_))
+ return false;
+
+ if (!WriteEbmlMasterElement(writer, kMkvCueTrackPositions, size))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvCueTrack, track_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvCueClusterPosition, cluster_pos_))
+ return false;
+ if (output_block_number_ && block_number_ > 1)
+ if (!WriteEbmlElement(writer, kMkvCueBlockNumber, block_number_))
+ return false;
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0)
+ return false;
+
+ if (stop_position - payload_position != static_cast<int64>(payload_size))
+ return false;
+
+ return true;
+}
+
+uint64 CuePoint::PayloadSize() const {
+ uint64 size = EbmlElementSize(kMkvCueClusterPosition, cluster_pos_);
+ size += EbmlElementSize(kMkvCueTrack, track_);
+ if (output_block_number_ && block_number_ > 1)
+ size += EbmlElementSize(kMkvCueBlockNumber, block_number_);
+ const uint64 track_pos_size = EbmlMasterElementSize(kMkvCueTrackPositions,
+ size) + size;
+ const uint64 payload_size = EbmlElementSize(kMkvCueTime, time_) +
+ track_pos_size;
+
+ return payload_size;
+}
+
+uint64 CuePoint::Size() const {
+ const uint64 payload_size = PayloadSize();
+ return EbmlMasterElementSize(kMkvCuePoint, payload_size) + payload_size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Cues Class
+
+Cues::Cues()
+ : cue_entries_capacity_(0),
+ cue_entries_size_(0),
+ cue_entries_(NULL),
+ output_block_number_(true) {
+}
+
+Cues::~Cues() {
+ if (cue_entries_) {
+ for (int32 i = 0; i < cue_entries_size_; ++i) {
+ CuePoint* const cue = cue_entries_[i];
+ delete cue;
+ }
+ delete [] cue_entries_;
+ }
+}
+
+bool Cues::AddCue(CuePoint* cue) {
+ if (!cue)
+ return false;
+
+ if ((cue_entries_size_ + 1) > cue_entries_capacity_) {
+ // Add more CuePoints.
+ const int32 new_capacity =
+ (!cue_entries_capacity_) ? 2 : cue_entries_capacity_ * 2;
+
+ if (new_capacity < 1)
+ return false;
+
+ CuePoint** const cues =
+ new (std::nothrow) CuePoint*[new_capacity]; // NOLINT
+ if (!cues)
+ return false;
+
+ for (int32 i = 0; i < cue_entries_size_; ++i) {
+ cues[i] = cue_entries_[i];
+ }
+
+ delete [] cue_entries_;
+
+ cue_entries_ = cues;
+ cue_entries_capacity_ = new_capacity;
+ }
+
+ cue->set_output_block_number(output_block_number_);
+ cue_entries_[cue_entries_size_++] = cue;
+ return true;
+}
+
+CuePoint* Cues::GetCueByIndex(int32 index) const {
+ if (cue_entries_ == NULL)
+ return NULL;
+
+ if (index >= cue_entries_size_)
+ return NULL;
+
+ return cue_entries_[index];
+}
+
+uint64 Cues::Size() {
+ uint64 size = 0;
+ for (int32 i = 0; i < cue_entries_size_; ++i)
+ size += GetCueByIndex(i)->Size();
+ size += EbmlMasterElementSize(kMkvCues, size);
+ return size;
+}
+
+bool Cues::Write(IMkvWriter* writer) const {
+ if (!writer)
+ return false;
+
+ uint64 size = 0;
+ for (int32 i = 0; i < cue_entries_size_; ++i) {
+ const CuePoint* const cue = GetCueByIndex(i);
+
+ if (!cue)
+ return false;
+
+ size += cue->Size();
+ }
+
+ if (!WriteEbmlMasterElement(writer, kMkvCues, size))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ for (int32 i = 0; i < cue_entries_size_; ++i) {
+ const CuePoint* const cue = GetCueByIndex(i);
+
+ if (!cue->Write(writer))
+ return false;
+ }
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0)
+ return false;
+
+ if (stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// ContentEncAESSettings Class
+
+ContentEncAESSettings::ContentEncAESSettings() : cipher_mode_(kCTR) {}
+
+uint64 ContentEncAESSettings::Size() const {
+ const uint64 payload = PayloadSize();
+ const uint64 size =
+ EbmlMasterElementSize(kMkvContentEncAESSettings, payload) + payload;
+ return size;
+}
+
+bool ContentEncAESSettings::Write(IMkvWriter* writer) const {
+ const uint64 payload = PayloadSize();
+
+ if (!WriteEbmlMasterElement(writer, kMkvContentEncAESSettings, payload))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlElement(writer, kMkvAESSettingsCipherMode, cipher_mode_))
+ return false;
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(payload))
+ return false;
+
+ return true;
+}
+
+uint64 ContentEncAESSettings::PayloadSize() const {
+ uint64 size = EbmlElementSize(kMkvAESSettingsCipherMode, cipher_mode_);
+ return size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// ContentEncoding Class
+
+ContentEncoding::ContentEncoding()
+ : enc_algo_(5),
+ enc_key_id_(NULL),
+ encoding_order_(0),
+ encoding_scope_(1),
+ encoding_type_(1),
+ enc_key_id_length_(0) {
+}
+
+ContentEncoding::~ContentEncoding() {
+ delete [] enc_key_id_;
+}
+
+bool ContentEncoding::SetEncryptionID(const uint8* id, uint64 length) {
+ if (!id || length < 1)
+ return false;
+
+ delete [] enc_key_id_;
+
+ enc_key_id_ =
+ new (std::nothrow) uint8[static_cast<size_t>(length)]; // NOLINT
+ if (!enc_key_id_)
+ return false;
+
+ memcpy(enc_key_id_, id, static_cast<size_t>(length));
+ enc_key_id_length_ = length;
+
+ return true;
+}
+
+uint64 ContentEncoding::Size() const {
+ const uint64 encryption_size = EncryptionSize();
+ const uint64 encoding_size = EncodingSize(0, encryption_size);
+ const uint64 encodings_size = EbmlMasterElementSize(kMkvContentEncoding,
+ encoding_size) +
+ encoding_size;
+
+ return encodings_size;
+}
+
+bool ContentEncoding::Write(IMkvWriter* writer) const {
+ const uint64 encryption_size = EncryptionSize();
+ const uint64 encoding_size = EncodingSize(0, encryption_size);
+ const uint64 size = EbmlMasterElementSize(kMkvContentEncoding,
+ encoding_size) +
+ encoding_size;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlMasterElement(writer, kMkvContentEncoding, encoding_size))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvContentEncodingOrder, encoding_order_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvContentEncodingScope, encoding_scope_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvContentEncodingType, encoding_type_))
+ return false;
+
+ if (!WriteEbmlMasterElement(writer, kMkvContentEncryption, encryption_size))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvContentEncAlgo, enc_algo_))
+ return false;
+ if (!WriteEbmlElement(writer,
+ kMkvContentEncKeyID,
+ enc_key_id_,
+ enc_key_id_length_))
+ return false;
+
+ if (!enc_aes_settings_.Write(writer))
+ return false;
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ return true;
+}
+
+uint64 ContentEncoding::EncodingSize(uint64 compresion_size,
+ uint64 encryption_size) const {
+ // TODO(fgalligan): Add support for compression settings.
+ if (compresion_size != 0)
+ return 0;
+
+ uint64 encoding_size = 0;
+
+ if (encryption_size > 0) {
+ encoding_size += EbmlMasterElementSize(kMkvContentEncryption,
+ encryption_size) +
+ encryption_size;
+ }
+ encoding_size += EbmlElementSize(kMkvContentEncodingType, encoding_type_);
+ encoding_size += EbmlElementSize(kMkvContentEncodingScope, encoding_scope_);
+ encoding_size += EbmlElementSize(kMkvContentEncodingOrder, encoding_order_);
+
+ return encoding_size;
+}
+
+uint64 ContentEncoding::EncryptionSize() const {
+ const uint64 aes_size = enc_aes_settings_.Size();
+
+ uint64 encryption_size = EbmlElementSize(kMkvContentEncKeyID,
+ enc_key_id_,
+ enc_key_id_length_);
+ encryption_size += EbmlElementSize(kMkvContentEncAlgo, enc_algo_);
+
+ return encryption_size + aes_size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Track Class
+
+Track::Track(unsigned int* seed)
+ : codec_id_(NULL),
+ codec_private_(NULL),
+ language_(NULL),
+ max_block_additional_id_(0),
+ name_(NULL),
+ number_(0),
+ type_(0),
+ uid_(MakeUID(seed)),
+ codec_delay_(0),
+ seek_pre_roll_(0),
+ codec_private_length_(0),
+ content_encoding_entries_(NULL),
+ content_encoding_entries_size_(0) {
+}
+
+Track::~Track() {
+ delete [] codec_id_;
+ delete [] codec_private_;
+ delete [] language_;
+ delete [] name_;
+
+ if (content_encoding_entries_) {
+ for (uint32 i = 0; i < content_encoding_entries_size_; ++i) {
+ ContentEncoding* const encoding = content_encoding_entries_[i];
+ delete encoding;
+ }
+ delete [] content_encoding_entries_;
+ }
+}
+
+bool Track::AddContentEncoding() {
+ const uint32 count = content_encoding_entries_size_ + 1;
+
+ ContentEncoding** const content_encoding_entries =
+ new (std::nothrow) ContentEncoding*[count]; // NOLINT
+ if (!content_encoding_entries)
+ return false;
+
+ ContentEncoding* const content_encoding =
+ new (std::nothrow) ContentEncoding(); // NOLINT
+ if (!content_encoding) {
+ delete [] content_encoding_entries;
+ return false;
+ }
+
+ for (uint32 i = 0; i < content_encoding_entries_size_; ++i) {
+ content_encoding_entries[i] = content_encoding_entries_[i];
+ }
+
+ delete [] content_encoding_entries_;
+
+ content_encoding_entries_ = content_encoding_entries;
+ content_encoding_entries_[content_encoding_entries_size_] = content_encoding;
+ content_encoding_entries_size_ = count;
+ return true;
+}
+
+ContentEncoding* Track::GetContentEncodingByIndex(uint32 index) const {
+ if (content_encoding_entries_ == NULL)
+ return NULL;
+
+ if (index >= content_encoding_entries_size_)
+ return NULL;
+
+ return content_encoding_entries_[index];
+}
+
+uint64 Track::PayloadSize() const {
+ uint64 size = EbmlElementSize(kMkvTrackNumber, number_);
+ size += EbmlElementSize(kMkvTrackUID, uid_);
+ size += EbmlElementSize(kMkvTrackType, type_);
+ if (codec_id_)
+ size += EbmlElementSize(kMkvCodecID, codec_id_);
+ if (codec_private_)
+ size += EbmlElementSize(kMkvCodecPrivate,
+ codec_private_,
+ codec_private_length_);
+ if (language_)
+ size += EbmlElementSize(kMkvLanguage, language_);
+ if (name_)
+ size += EbmlElementSize(kMkvName, name_);
+ if (max_block_additional_id_)
+ size += EbmlElementSize(kMkvMaxBlockAdditionID, max_block_additional_id_);
+ if (codec_delay_)
+ size += EbmlElementSize(kMkvCodecDelay, codec_delay_);
+ if (seek_pre_roll_)
+ size += EbmlElementSize(kMkvSeekPreRoll, seek_pre_roll_);
+
+ if (content_encoding_entries_size_ > 0) {
+ uint64 content_encodings_size = 0;
+ for (uint32 i = 0; i < content_encoding_entries_size_; ++i) {
+ ContentEncoding* const encoding = content_encoding_entries_[i];
+ content_encodings_size += encoding->Size();
+ }
+
+ size += EbmlMasterElementSize(kMkvContentEncodings,
+ content_encodings_size) +
+ content_encodings_size;
+ }
+
+ return size;
+}
+
+uint64 Track::Size() const {
+ uint64 size = PayloadSize();
+ size += EbmlMasterElementSize(kMkvTrackEntry, size);
+ return size;
+}
+
+bool Track::Write(IMkvWriter* writer) const {
+ if (!writer)
+ return false;
+
+ // |size| may be bigger than what is written out in this function because
+ // derived classes may write out more data in the Track element.
+ const uint64 payload_size = PayloadSize();
+
+ if (!WriteEbmlMasterElement(writer, kMkvTrackEntry, payload_size))
+ return false;
+
+ uint64 size = EbmlElementSize(kMkvTrackNumber, number_);
+ size += EbmlElementSize(kMkvTrackUID, uid_);
+ size += EbmlElementSize(kMkvTrackType, type_);
+ if (codec_id_)
+ size += EbmlElementSize(kMkvCodecID, codec_id_);
+ if (codec_private_)
+ size += EbmlElementSize(kMkvCodecPrivate,
+ codec_private_,
+ codec_private_length_);
+ if (language_)
+ size += EbmlElementSize(kMkvLanguage, language_);
+ if (name_)
+ size += EbmlElementSize(kMkvName, name_);
+ if (max_block_additional_id_)
+ size += EbmlElementSize(kMkvMaxBlockAdditionID, max_block_additional_id_);
+ if (codec_delay_)
+ size += EbmlElementSize(kMkvCodecDelay, codec_delay_);
+ if (seek_pre_roll_)
+ size += EbmlElementSize(kMkvSeekPreRoll, seek_pre_roll_);
+
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlElement(writer, kMkvTrackNumber, number_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvTrackUID, uid_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvTrackType, type_))
+ return false;
+ if (max_block_additional_id_) {
+ if (!WriteEbmlElement(writer,
+ kMkvMaxBlockAdditionID,
+ max_block_additional_id_)) {
+ return false;
+ }
+ }
+ if (codec_delay_) {
+ if (!WriteEbmlElement(writer, kMkvCodecDelay, codec_delay_))
+ return false;
+ }
+ if (seek_pre_roll_) {
+ if (!WriteEbmlElement(writer, kMkvSeekPreRoll, seek_pre_roll_))
+ return false;
+ }
+ if (codec_id_) {
+ if (!WriteEbmlElement(writer, kMkvCodecID, codec_id_))
+ return false;
+ }
+ if (codec_private_) {
+ if (!WriteEbmlElement(writer,
+ kMkvCodecPrivate,
+ codec_private_,
+ codec_private_length_))
+ return false;
+ }
+ if (language_) {
+ if (!WriteEbmlElement(writer, kMkvLanguage, language_))
+ return false;
+ }
+ if (name_) {
+ if (!WriteEbmlElement(writer, kMkvName, name_))
+ return false;
+ }
+
+ int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ if (content_encoding_entries_size_ > 0) {
+ uint64 content_encodings_size = 0;
+ for (uint32 i = 0; i < content_encoding_entries_size_; ++i) {
+ ContentEncoding* const encoding = content_encoding_entries_[i];
+ content_encodings_size += encoding->Size();
+ }
+
+ if (!WriteEbmlMasterElement(writer,
+ kMkvContentEncodings,
+ content_encodings_size))
+ return false;
+
+ for (uint32 i = 0; i < content_encoding_entries_size_; ++i) {
+ ContentEncoding* const encoding = content_encoding_entries_[i];
+ if (!encoding->Write(writer))
+ return false;
+ }
+ }
+
+ stop_position = writer->Position();
+ if (stop_position < 0)
+ return false;
+ return true;
+}
+
+bool Track::SetCodecPrivate(const uint8* codec_private, uint64 length) {
+ if (!codec_private || length < 1)
+ return false;
+
+ delete [] codec_private_;
+
+ codec_private_ =
+ new (std::nothrow) uint8[static_cast<size_t>(length)]; // NOLINT
+ if (!codec_private_)
+ return false;
+
+ memcpy(codec_private_, codec_private, static_cast<size_t>(length));
+ codec_private_length_ = length;
+
+ return true;
+}
+
+void Track::set_codec_id(const char* codec_id) {
+ if (codec_id) {
+ delete [] codec_id_;
+
+ const size_t length = strlen(codec_id) + 1;
+ codec_id_ = new (std::nothrow) char[length]; // NOLINT
+ if (codec_id_) {
+#ifdef _MSC_VER
+ strcpy_s(codec_id_, length, codec_id);
+#else
+ strcpy(codec_id_, codec_id);
+#endif
+ }
+ }
+}
+
+// TODO(fgalligan): Vet the language parameter.
+void Track::set_language(const char* language) {
+ if (language) {
+ delete [] language_;
+
+ const size_t length = strlen(language) + 1;
+ language_ = new (std::nothrow) char[length]; // NOLINT
+ if (language_) {
+#ifdef _MSC_VER
+ strcpy_s(language_, length, language);
+#else
+ strcpy(language_, language);
+#endif
+ }
+ }
+}
+
+void Track::set_name(const char* name) {
+ if (name) {
+ delete [] name_;
+
+ const size_t length = strlen(name) + 1;
+ name_ = new (std::nothrow) char[length]; // NOLINT
+ if (name_) {
+#ifdef _MSC_VER
+ strcpy_s(name_, length, name);
+#else
+ strcpy(name_, name);
+#endif
+ }
+ }
+}
+
+///////////////////////////////////////////////////////////////
+//
+// VideoTrack Class
+
+VideoTrack::VideoTrack(unsigned int* seed)
+ : Track(seed),
+ display_height_(0),
+ display_width_(0),
+ frame_rate_(0.0),
+ height_(0),
+ stereo_mode_(0),
+ alpha_mode_(0),
+ width_(0) {
+}
+
+VideoTrack::~VideoTrack() {
+}
+
+bool VideoTrack::SetStereoMode(uint64 stereo_mode) {
+ if (stereo_mode != kMono &&
+ stereo_mode != kSideBySideLeftIsFirst &&
+ stereo_mode != kTopBottomRightIsFirst &&
+ stereo_mode != kTopBottomLeftIsFirst &&
+ stereo_mode != kSideBySideRightIsFirst)
+ return false;
+
+ stereo_mode_ = stereo_mode;
+ return true;
+}
+
+bool VideoTrack::SetAlphaMode(uint64 alpha_mode) {
+ if (alpha_mode != kNoAlpha &&
+ alpha_mode != kAlpha)
+ return false;
+
+ alpha_mode_ = alpha_mode;
+ return true;
+}
+
+uint64 VideoTrack::PayloadSize() const {
+ const uint64 parent_size = Track::PayloadSize();
+
+ uint64 size = VideoPayloadSize();
+ size += EbmlMasterElementSize(kMkvVideo, size);
+
+ return parent_size + size;
+}
+
+bool VideoTrack::Write(IMkvWriter* writer) const {
+ if (!Track::Write(writer))
+ return false;
+
+ const uint64 size = VideoPayloadSize();
+
+ if (!WriteEbmlMasterElement(writer, kMkvVideo, size))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlElement(writer, kMkvPixelWidth, width_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvPixelHeight, height_))
+ return false;
+ if (display_width_ > 0)
+ if (!WriteEbmlElement(writer, kMkvDisplayWidth, display_width_))
+ return false;
+ if (display_height_ > 0)
+ if (!WriteEbmlElement(writer, kMkvDisplayHeight, display_height_))
+ return false;
+ if (stereo_mode_ > kMono)
+ if (!WriteEbmlElement(writer, kMkvStereoMode, stereo_mode_))
+ return false;
+ if (alpha_mode_ > kNoAlpha)
+ if (!WriteEbmlElement(writer, kMkvAlphaMode, alpha_mode_))
+ return false;
+ if (frame_rate_ > 0.0)
+ if (!WriteEbmlElement(writer,
+ kMkvFrameRate,
+ static_cast<float>(frame_rate_)))
+ return false;
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ return true;
+}
+
+uint64 VideoTrack::VideoPayloadSize() const {
+ uint64 size = EbmlElementSize(kMkvPixelWidth, width_);
+ size += EbmlElementSize(kMkvPixelHeight, height_);
+ if (display_width_ > 0)
+ size += EbmlElementSize(kMkvDisplayWidth, display_width_);
+ if (display_height_ > 0)
+ size += EbmlElementSize(kMkvDisplayHeight, display_height_);
+ if (stereo_mode_ > kMono)
+ size += EbmlElementSize(kMkvStereoMode, stereo_mode_);
+ if (alpha_mode_ > kNoAlpha)
+ size += EbmlElementSize(kMkvAlphaMode, alpha_mode_);
+ if (frame_rate_ > 0.0)
+ size += EbmlElementSize(kMkvFrameRate, static_cast<float>(frame_rate_));
+
+ return size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// AudioTrack Class
+
+AudioTrack::AudioTrack(unsigned int* seed)
+ : Track(seed),
+ bit_depth_(0),
+ channels_(1),
+ sample_rate_(0.0) {
+}
+
+AudioTrack::~AudioTrack() {
+}
+
+uint64 AudioTrack::PayloadSize() const {
+ const uint64 parent_size = Track::PayloadSize();
+
+ uint64 size = EbmlElementSize(kMkvSamplingFrequency,
+ static_cast<float>(sample_rate_));
+ size += EbmlElementSize(kMkvChannels, channels_);
+ if (bit_depth_ > 0)
+ size += EbmlElementSize(kMkvBitDepth, bit_depth_);
+ size += EbmlMasterElementSize(kMkvAudio, size);
+
+ return parent_size + size;
+}
+
+bool AudioTrack::Write(IMkvWriter* writer) const {
+ if (!Track::Write(writer))
+ return false;
+
+ // Calculate AudioSettings size.
+ uint64 size = EbmlElementSize(kMkvSamplingFrequency,
+ static_cast<float>(sample_rate_));
+ size += EbmlElementSize(kMkvChannels, channels_);
+ if (bit_depth_ > 0)
+ size += EbmlElementSize(kMkvBitDepth, bit_depth_);
+
+ if (!WriteEbmlMasterElement(writer, kMkvAudio, size))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlElement(writer,
+ kMkvSamplingFrequency,
+ static_cast<float>(sample_rate_)))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvChannels, channels_))
+ return false;
+ if (bit_depth_ > 0)
+ if (!WriteEbmlElement(writer, kMkvBitDepth, bit_depth_))
+ return false;
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Tracks Class
+
+const char Tracks::kOpusCodecId[] = "A_OPUS";
+const char Tracks::kVorbisCodecId[] = "A_VORBIS";
+const char Tracks::kVp8CodecId[] = "V_VP8";
+const char Tracks::kVp9CodecId[] = "V_VP9";
+
+
+Tracks::Tracks()
+ : track_entries_(NULL),
+ track_entries_size_(0) {
+}
+
+Tracks::~Tracks() {
+ if (track_entries_) {
+ for (uint32 i = 0; i < track_entries_size_; ++i) {
+ Track* const track = track_entries_[i];
+ delete track;
+ }
+ delete [] track_entries_;
+ }
+}
+
+bool Tracks::AddTrack(Track* track, int32 number) {
+ if (number < 0)
+ return false;
+
+ // This muxer only supports track numbers in the range [1, 126], in
+ // order to be able (to use Matroska integer representation) to
+ // serialize the block header (of which the track number is a part)
+ // for a frame using exactly 4 bytes.
+
+ if (number > 0x7E)
+ return false;
+
+ uint32 track_num = number;
+
+ if (track_num > 0) {
+ // Check to make sure a track does not already have |track_num|.
+ for (uint32 i = 0; i < track_entries_size_; ++i) {
+ if (track_entries_[i]->number() == track_num)
+ return false;
+ }
+ }
+
+ const uint32 count = track_entries_size_ + 1;
+
+ Track** const track_entries = new (std::nothrow) Track*[count]; // NOLINT
+ if (!track_entries)
+ return false;
+
+ for (uint32 i = 0; i < track_entries_size_; ++i) {
+ track_entries[i] = track_entries_[i];
+ }
+
+ delete [] track_entries_;
+
+ // Find the lowest availible track number > 0.
+ if (track_num == 0) {
+ track_num = count;
+
+ // Check to make sure a track does not already have |track_num|.
+ bool exit = false;
+ do {
+ exit = true;
+ for (uint32 i = 0; i < track_entries_size_; ++i) {
+ if (track_entries[i]->number() == track_num) {
+ track_num++;
+ exit = false;
+ break;
+ }
+ }
+ } while (!exit);
+ }
+ track->set_number(track_num);
+
+ track_entries_ = track_entries;
+ track_entries_[track_entries_size_] = track;
+ track_entries_size_ = count;
+ return true;
+}
+
+const Track* Tracks::GetTrackByIndex(uint32 index) const {
+ if (track_entries_ == NULL)
+ return NULL;
+
+ if (index >= track_entries_size_)
+ return NULL;
+
+ return track_entries_[index];
+}
+
+Track* Tracks::GetTrackByNumber(uint64 track_number) const {
+ const int32 count = track_entries_size();
+ for (int32 i = 0; i < count; ++i) {
+ if (track_entries_[i]->number() == track_number)
+ return track_entries_[i];
+ }
+
+ return NULL;
+}
+
+bool Tracks::TrackIsAudio(uint64 track_number) const {
+ const Track* const track = GetTrackByNumber(track_number);
+
+ if (track->type() == kAudio)
+ return true;
+
+ return false;
+}
+
+bool Tracks::TrackIsVideo(uint64 track_number) const {
+ const Track* const track = GetTrackByNumber(track_number);
+
+ if (track->type() == kVideo)
+ return true;
+
+ return false;
+}
+
+bool Tracks::Write(IMkvWriter* writer) const {
+ uint64 size = 0;
+ const int32 count = track_entries_size();
+ for (int32 i = 0; i < count; ++i) {
+ const Track* const track = GetTrackByIndex(i);
+
+ if (!track)
+ return false;
+
+ size += track->Size();
+ }
+
+ if (!WriteEbmlMasterElement(writer, kMkvTracks, size))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ for (int32 i = 0; i < count; ++i) {
+ const Track* const track = GetTrackByIndex(i);
+ if (!track->Write(writer))
+ return false;
+ }
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Chapter Class
+
+bool Chapter::set_id(const char* id) {
+ return StrCpy(id, &id_);
+}
+
+void Chapter::set_time(const Segment& segment,
+ uint64 start_ns,
+ uint64 end_ns) {
+ const SegmentInfo* const info = segment.GetSegmentInfo();
+ const uint64 timecode_scale = info->timecode_scale();
+ start_timecode_ = start_ns / timecode_scale;
+ end_timecode_ = end_ns / timecode_scale;
+}
+
+bool Chapter::add_string(const char* title,
+ const char* language,
+ const char* country) {
+ if (!ExpandDisplaysArray())
+ return false;
+
+ Display& d = displays_[displays_count_++];
+ d.Init();
+
+ if (!d.set_title(title))
+ return false;
+
+ if (!d.set_language(language))
+ return false;
+
+ if (!d.set_country(country))
+ return false;
+
+ return true;
+}
+
+Chapter::Chapter() {
+ // This ctor only constructs the object. Proper initialization is
+ // done in Init() (called in Chapters::AddChapter()). The only
+ // reason we bother implementing this ctor is because we had to
+ // declare it as private (along with the dtor), in order to prevent
+ // clients from creating Chapter instances (a privelege we grant
+ // only to the Chapters class). Doing no initialization here also
+ // means that creating arrays of chapter objects is more efficient,
+ // because we only initialize each new chapter object as it becomes
+ // active on the array.
+}
+
+Chapter::~Chapter() {
+}
+
+void Chapter::Init(unsigned int* seed) {
+ id_ = NULL;
+ displays_ = NULL;
+ displays_size_ = 0;
+ displays_count_ = 0;
+ uid_ = MakeUID(seed);
+}
+
+void Chapter::ShallowCopy(Chapter* dst) const {
+ dst->id_ = id_;
+ dst->start_timecode_ = start_timecode_;
+ dst->end_timecode_ = end_timecode_;
+ dst->uid_ = uid_;
+ dst->displays_ = displays_;
+ dst->displays_size_ = displays_size_;
+ dst->displays_count_ = displays_count_;
+}
+
+void Chapter::Clear() {
+ StrCpy(NULL, &id_);
+
+ while (displays_count_ > 0) {
+ Display& d = displays_[--displays_count_];
+ d.Clear();
+ }
+
+ delete [] displays_;
+ displays_ = NULL;
+
+ displays_size_ = 0;
+}
+
+bool Chapter::ExpandDisplaysArray() {
+ if (displays_size_ > displays_count_)
+ return true; // nothing to do yet
+
+ const int size = (displays_size_ == 0) ? 1 : 2 * displays_size_;
+
+ Display* const displays = new (std::nothrow) Display[size]; // NOLINT
+ if (displays == NULL)
+ return false;
+
+ for (int idx = 0; idx < displays_count_; ++idx) {
+ displays[idx] = displays_[idx]; // shallow copy
+ }
+
+ delete [] displays_;
+
+ displays_ = displays;
+ displays_size_ = size;
+
+ return true;
+}
+
+uint64 Chapter::WriteAtom(IMkvWriter* writer) const {
+ uint64 payload_size =
+ EbmlElementSize(kMkvChapterStringUID, id_) +
+ EbmlElementSize(kMkvChapterUID, uid_) +
+ EbmlElementSize(kMkvChapterTimeStart, start_timecode_) +
+ EbmlElementSize(kMkvChapterTimeEnd, end_timecode_);
+
+ for (int idx = 0; idx < displays_count_; ++idx) {
+ const Display& d = displays_[idx];
+ payload_size += d.WriteDisplay(NULL);
+ }
+
+ const uint64 atom_size =
+ EbmlMasterElementSize(kMkvChapterAtom, payload_size) +
+ payload_size;
+
+ if (writer == NULL)
+ return atom_size;
+
+ const int64 start = writer->Position();
+
+ if (!WriteEbmlMasterElement(writer, kMkvChapterAtom, payload_size))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvChapterStringUID, id_))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvChapterUID, uid_))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvChapterTimeStart, start_timecode_))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvChapterTimeEnd, end_timecode_))
+ return 0;
+
+ for (int idx = 0; idx < displays_count_; ++idx) {
+ const Display& d = displays_[idx];
+
+ if (!d.WriteDisplay(writer))
+ return 0;
+ }
+
+ const int64 stop = writer->Position();
+
+ if (stop >= start && uint64(stop - start) != atom_size)
+ return 0;
+
+ return atom_size;
+}
+
+void Chapter::Display::Init() {
+ title_ = NULL;
+ language_ = NULL;
+ country_ = NULL;
+}
+
+void Chapter::Display::Clear() {
+ StrCpy(NULL, &title_);
+ StrCpy(NULL, &language_);
+ StrCpy(NULL, &country_);
+}
+
+bool Chapter::Display::set_title(const char* title) {
+ return StrCpy(title, &title_);
+}
+
+bool Chapter::Display::set_language(const char* language) {
+ return StrCpy(language, &language_);
+}
+
+bool Chapter::Display::set_country(const char* country) {
+ return StrCpy(country, &country_);
+}
+
+uint64 Chapter::Display::WriteDisplay(IMkvWriter* writer) const {
+ uint64 payload_size = EbmlElementSize(kMkvChapString, title_);
+
+ if (language_)
+ payload_size += EbmlElementSize(kMkvChapLanguage, language_);
+
+ if (country_)
+ payload_size += EbmlElementSize(kMkvChapCountry, country_);
+
+ const uint64 display_size =
+ EbmlMasterElementSize(kMkvChapterDisplay, payload_size) +
+ payload_size;
+
+ if (writer == NULL)
+ return display_size;
+
+ const int64 start = writer->Position();
+
+ if (!WriteEbmlMasterElement(writer, kMkvChapterDisplay, payload_size))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvChapString, title_))
+ return 0;
+
+ if (language_) {
+ if (!WriteEbmlElement(writer, kMkvChapLanguage, language_))
+ return 0;
+ }
+
+ if (country_) {
+ if (!WriteEbmlElement(writer, kMkvChapCountry, country_))
+ return 0;
+ }
+
+ const int64 stop = writer->Position();
+
+ if (stop >= start && uint64(stop - start) != display_size)
+ return 0;
+
+ return display_size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Chapters Class
+
+Chapters::Chapters()
+ : chapters_size_(0),
+ chapters_count_(0),
+ chapters_(NULL) {
+}
+
+Chapters::~Chapters() {
+ while (chapters_count_ > 0) {
+ Chapter& chapter = chapters_[--chapters_count_];
+ chapter.Clear();
+ }
+
+ delete [] chapters_;
+ chapters_ = NULL;
+}
+
+int Chapters::Count() const {
+ return chapters_count_;
+}
+
+Chapter* Chapters::AddChapter(unsigned int* seed) {
+ if (!ExpandChaptersArray())
+ return NULL;
+
+ Chapter& chapter = chapters_[chapters_count_++];
+ chapter.Init(seed);
+
+ return &chapter;
+}
+
+bool Chapters::Write(IMkvWriter* writer) const {
+ if (writer == NULL)
+ return false;
+
+ const uint64 payload_size = WriteEdition(NULL); // return size only
+
+ if (!WriteEbmlMasterElement(writer, kMkvChapters, payload_size))
+ return false;
+
+ const int64 start = writer->Position();
+
+ if (WriteEdition(writer) == 0) // error
+ return false;
+
+ const int64 stop = writer->Position();
+
+ if (stop >= start && uint64(stop - start) != payload_size)
+ return false;
+
+ return true;
+}
+
+bool Chapters::ExpandChaptersArray() {
+ if (chapters_size_ > chapters_count_)
+ return true; // nothing to do yet
+
+ const int size = (chapters_size_ == 0) ? 1 : 2 * chapters_size_;
+
+ Chapter* const chapters = new (std::nothrow) Chapter[size]; // NOLINT
+ if (chapters == NULL)
+ return false;
+
+ for (int idx = 0; idx < chapters_count_; ++idx) {
+ const Chapter& src = chapters_[idx];
+ Chapter* const dst = chapters + idx;
+ src.ShallowCopy(dst);
+ }
+
+ delete [] chapters_;
+
+ chapters_ = chapters;
+ chapters_size_ = size;
+
+ return true;
+}
+
+uint64 Chapters::WriteEdition(IMkvWriter* writer) const {
+ uint64 payload_size = 0;
+
+ for (int idx = 0; idx < chapters_count_; ++idx) {
+ const Chapter& chapter = chapters_[idx];
+ payload_size += chapter.WriteAtom(NULL);
+ }
+
+ const uint64 edition_size =
+ EbmlMasterElementSize(kMkvEditionEntry, payload_size) +
+ payload_size;
+
+ if (writer == NULL) // return size only
+ return edition_size;
+
+ const int64 start = writer->Position();
+
+ if (!WriteEbmlMasterElement(writer, kMkvEditionEntry, payload_size))
+ return 0; // error
+
+ for (int idx = 0; idx < chapters_count_; ++idx) {
+ const Chapter& chapter = chapters_[idx];
+
+ const uint64 chapter_size = chapter.WriteAtom(writer);
+ if (chapter_size == 0) // error
+ return 0;
+ }
+
+ const int64 stop = writer->Position();
+
+ if (stop >= start && uint64(stop - start) != edition_size)
+ return 0;
+
+ return edition_size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Cluster class
+
+Cluster::Cluster(uint64 timecode, int64 cues_pos)
+ : blocks_added_(0),
+ finalized_(false),
+ header_written_(false),
+ payload_size_(0),
+ position_for_cues_(cues_pos),
+ size_position_(-1),
+ timecode_(timecode),
+ writer_(NULL) {
+}
+
+Cluster::~Cluster() {
+}
+
+bool Cluster::Init(IMkvWriter* ptr_writer) {
+ if (!ptr_writer) {
+ return false;
+ }
+ writer_ = ptr_writer;
+ return true;
+}
+
+bool Cluster::AddFrame(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 abs_timecode,
+ bool is_key) {
+ return DoWriteBlock(frame,
+ length,
+ track_number,
+ abs_timecode,
+ is_key ? 1 : 0,
+ &WriteSimpleBlock);
+}
+
+bool Cluster::AddFrameWithAdditional(const uint8* frame,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ uint64 abs_timecode,
+ bool is_key) {
+ return DoWriteBlockWithAdditional(frame,
+ length,
+ additional,
+ additional_length,
+ add_id,
+ track_number,
+ abs_timecode,
+ is_key ? 1 : 0,
+ &WriteBlockWithAdditional);
+}
+
+bool Cluster::AddFrameWithDiscardPadding(const uint8* frame,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ uint64 abs_timecode,
+ bool is_key) {
+ return DoWriteBlockWithDiscardPadding(frame,
+ length,
+ discard_padding,
+ track_number,
+ abs_timecode,
+ is_key ? 1 : 0,
+ &WriteBlockWithDiscardPadding);
+}
+
+bool Cluster::AddMetadata(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 abs_timecode,
+ uint64 duration_timecode) {
+ return DoWriteBlock(frame,
+ length,
+ track_number,
+ abs_timecode,
+ duration_timecode,
+ &WriteMetadataBlock);
+}
+
+void Cluster::AddPayloadSize(uint64 size) {
+ payload_size_ += size;
+}
+
+bool Cluster::Finalize() {
+ if (!writer_ || finalized_ || size_position_ == -1)
+ return false;
+
+ if (writer_->Seekable()) {
+ const int64 pos = writer_->Position();
+
+ if (writer_->Position(size_position_))
+ return false;
+
+ if (WriteUIntSize(writer_, payload_size(), 8))
+ return false;
+
+ if (writer_->Position(pos))
+ return false;
+ }
+
+ finalized_ = true;
+
+ return true;
+}
+
+uint64 Cluster::Size() const {
+ const uint64 element_size =
+ EbmlMasterElementSize(kMkvCluster,
+ 0xFFFFFFFFFFFFFFFFULL) + payload_size_;
+ return element_size;
+}
+
+template <typename Type>
+bool Cluster::PreWriteBlock(Type* write_function) {
+ if (write_function == NULL)
+ return false;
+
+ if (finalized_)
+ return false;
+
+ if (!header_written_) {
+ if (!WriteClusterHeader())
+ return false;
+ }
+
+ return true;
+}
+
+void Cluster::PostWriteBlock(uint64 element_size) {
+ AddPayloadSize(element_size);
+ ++blocks_added_;
+}
+
+bool Cluster::IsValidTrackNumber(uint64 track_number) const {
+ return (track_number > 0 && track_number <= 0x7E);
+}
+
+int64 Cluster::GetRelativeTimecode(int64 abs_timecode) const {
+ const int64 cluster_timecode = this->Cluster::timecode();
+ const int64 rel_timecode =
+ static_cast<int64>(abs_timecode) - cluster_timecode;
+
+ if (rel_timecode < 0 || rel_timecode > kMaxBlockTimecode)
+ return -1;
+
+ return rel_timecode;
+}
+
+bool Cluster::DoWriteBlock(
+ const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 abs_timecode,
+ uint64 generic_arg,
+ WriteBlock write_block) {
+ if (frame == NULL || length == 0)
+ return false;
+
+ if (!IsValidTrackNumber(track_number))
+ return false;
+
+ const int64 rel_timecode = GetRelativeTimecode(abs_timecode);
+ if (rel_timecode < 0)
+ return false;
+
+ if (!PreWriteBlock(write_block))
+ return false;
+
+ const uint64 element_size = (*write_block)(writer_,
+ frame,
+ length,
+ track_number,
+ rel_timecode,
+ generic_arg);
+ if (element_size == 0)
+ return false;
+
+ PostWriteBlock(element_size);
+ return true;
+}
+
+bool Cluster::DoWriteBlockWithAdditional(
+ const uint8* frame,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ uint64 abs_timecode,
+ uint64 generic_arg,
+ WriteBlockAdditional write_block) {
+ if (frame == NULL || length == 0 ||
+ additional == NULL || additional_length == 0)
+ return false;
+
+ if (!IsValidTrackNumber(track_number))
+ return false;
+
+ const int64 rel_timecode = GetRelativeTimecode(abs_timecode);
+ if (rel_timecode < 0)
+ return false;
+
+ if (!PreWriteBlock(write_block))
+ return false;
+
+ const uint64 element_size = (*write_block)(writer_,
+ frame,
+ length,
+ additional,
+ additional_length,
+ add_id,
+ track_number,
+ rel_timecode,
+ generic_arg);
+ if (element_size == 0)
+ return false;
+
+ PostWriteBlock(element_size);
+ return true;
+}
+
+bool Cluster::DoWriteBlockWithDiscardPadding(
+ const uint8* frame,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ uint64 abs_timecode,
+ uint64 generic_arg,
+ WriteBlockDiscardPadding write_block) {
+ if (frame == NULL || length == 0 || discard_padding <= 0)
+ return false;
+
+ if (!IsValidTrackNumber(track_number))
+ return false;
+
+ const int64 rel_timecode = GetRelativeTimecode(abs_timecode);
+ if (rel_timecode < 0)
+ return false;
+
+ if (!PreWriteBlock(write_block))
+ return false;
+
+ const uint64 element_size = (*write_block)(writer_,
+ frame,
+ length,
+ discard_padding,
+ track_number,
+ rel_timecode,
+ generic_arg);
+ if (element_size == 0)
+ return false;
+
+ PostWriteBlock(element_size);
+ return true;
+}
+
+bool Cluster::WriteClusterHeader() {
+ if (finalized_)
+ return false;
+
+ if (WriteID(writer_, kMkvCluster))
+ return false;
+
+ // Save for later.
+ size_position_ = writer_->Position();
+
+ // Write "unknown" (EBML coded -1) as cluster size value. We need to write 8
+ // bytes because we do not know how big our cluster will be.
+ if (SerializeInt(writer_, kEbmlUnknownValue, 8))
+ return false;
+
+ if (!WriteEbmlElement(writer_, kMkvTimecode, timecode()))
+ return false;
+ AddPayloadSize(EbmlElementSize(kMkvTimecode, timecode()));
+ header_written_ = true;
+
+ return true;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// SeekHead Class
+
+SeekHead::SeekHead() : start_pos_(0ULL) {
+ for (int32 i = 0; i < kSeekEntryCount; ++i) {
+ seek_entry_id_[i] = 0;
+ seek_entry_pos_[i] = 0;
+ }
+}
+
+SeekHead::~SeekHead() {
+}
+
+bool SeekHead::Finalize(IMkvWriter* writer) const {
+ if (writer->Seekable()) {
+ if (start_pos_ == -1)
+ return false;
+
+ uint64 payload_size = 0;
+ uint64 entry_size[kSeekEntryCount];
+
+ for (int32 i = 0; i < kSeekEntryCount; ++i) {
+ if (seek_entry_id_[i] != 0) {
+ entry_size[i] = EbmlElementSize(
+ kMkvSeekID,
+ static_cast<uint64>(seek_entry_id_[i]));
+ entry_size[i] += EbmlElementSize(kMkvSeekPosition, seek_entry_pos_[i]);
+
+ payload_size += EbmlMasterElementSize(kMkvSeek, entry_size[i]) +
+ entry_size[i];
+ }
+ }
+
+ // No SeekHead elements
+ if (payload_size == 0)
+ return true;
+
+ const int64 pos = writer->Position();
+ if (writer->Position(start_pos_))
+ return false;
+
+ if (!WriteEbmlMasterElement(writer, kMkvSeekHead, payload_size))
+ return false;
+
+ for (int32 i = 0; i < kSeekEntryCount; ++i) {
+ if (seek_entry_id_[i] != 0) {
+ if (!WriteEbmlMasterElement(writer, kMkvSeek, entry_size[i]))
+ return false;
+
+ if (!WriteEbmlElement(writer,
+ kMkvSeekID,
+ static_cast<uint64>(seek_entry_id_[i])))
+ return false;
+
+ if (!WriteEbmlElement(writer, kMkvSeekPosition, seek_entry_pos_[i]))
+ return false;
+ }
+ }
+
+ const uint64 total_entry_size = kSeekEntryCount * MaxEntrySize();
+ const uint64 total_size =
+ EbmlMasterElementSize(kMkvSeekHead,
+ total_entry_size) + total_entry_size;
+ const int64 size_left = total_size - (writer->Position() - start_pos_);
+
+ const uint64 bytes_written = WriteVoidElement(writer, size_left);
+ if (!bytes_written)
+ return false;
+
+ if (writer->Position(pos))
+ return false;
+ }
+
+ return true;
+}
+
+bool SeekHead::Write(IMkvWriter* writer) {
+ const uint64 entry_size = kSeekEntryCount * MaxEntrySize();
+ const uint64 size = EbmlMasterElementSize(kMkvSeekHead, entry_size);
+
+ start_pos_ = writer->Position();
+
+ const uint64 bytes_written = WriteVoidElement(writer, size + entry_size);
+ if (!bytes_written)
+ return false;
+
+ return true;
+}
+
+bool SeekHead::AddSeekEntry(uint32 id, uint64 pos) {
+ for (int32 i = 0; i < kSeekEntryCount; ++i) {
+ if (seek_entry_id_[i] == 0) {
+ seek_entry_id_[i] = id;
+ seek_entry_pos_[i] = pos;
+ return true;
+ }
+ }
+ return false;
+}
+
+uint32 SeekHead::GetId(int index) const {
+ if (index < 0 || index >= kSeekEntryCount)
+ return UINT_MAX;
+ return seek_entry_id_[index];
+}
+
+uint64 SeekHead::GetPosition(int index) const {
+ if (index < 0 || index >= kSeekEntryCount)
+ return ULLONG_MAX;
+ return seek_entry_pos_[index];
+}
+
+bool SeekHead::SetSeekEntry(int index, uint32 id, uint64 position) {
+ if (index < 0 || index >= kSeekEntryCount)
+ return false;
+ seek_entry_id_[index] = id;
+ seek_entry_pos_[index] = position;
+ return true;
+}
+
+uint64 SeekHead::MaxEntrySize() const {
+ const uint64 max_entry_payload_size =
+ EbmlElementSize(kMkvSeekID, 0xffffffffULL) +
+ EbmlElementSize(kMkvSeekPosition, 0xffffffffffffffffULL);
+ const uint64 max_entry_size =
+ EbmlMasterElementSize(kMkvSeek, max_entry_payload_size) +
+ max_entry_payload_size;
+
+ return max_entry_size;
+}
+
+///////////////////////////////////////////////////////////////
+//
+// SegmentInfo Class
+
+SegmentInfo::SegmentInfo()
+ : duration_(-1.0),
+ muxing_app_(NULL),
+ timecode_scale_(1000000ULL),
+ writing_app_(NULL),
+ duration_pos_(-1) {
+}
+
+SegmentInfo::~SegmentInfo() {
+ delete [] muxing_app_;
+ delete [] writing_app_;
+}
+
+bool SegmentInfo::Init() {
+ int32 major;
+ int32 minor;
+ int32 build;
+ int32 revision;
+ GetVersion(&major, &minor, &build, &revision);
+ char temp[256];
+#ifdef _MSC_VER
+ sprintf_s(temp,
+ sizeof(temp)/sizeof(temp[0]),
+ "libwebm-%d.%d.%d.%d",
+ major,
+ minor,
+ build,
+ revision);
+#else
+ snprintf(temp,
+ sizeof(temp)/sizeof(temp[0]),
+ "libwebm-%d.%d.%d.%d",
+ major,
+ minor,
+ build,
+ revision);
+#endif
+
+ const size_t app_len = strlen(temp) + 1;
+
+ delete [] muxing_app_;
+
+ muxing_app_ = new (std::nothrow) char[app_len]; // NOLINT
+ if (!muxing_app_)
+ return false;
+
+#ifdef _MSC_VER
+ strcpy_s(muxing_app_, app_len, temp);
+#else
+ strcpy(muxing_app_, temp);
+#endif
+
+ set_writing_app(temp);
+ if (!writing_app_)
+ return false;
+ return true;
+}
+
+bool SegmentInfo::Finalize(IMkvWriter* writer) const {
+ if (!writer)
+ return false;
+
+ if (duration_ > 0.0) {
+ if (writer->Seekable()) {
+ if (duration_pos_ == -1)
+ return false;
+
+ const int64 pos = writer->Position();
+
+ if (writer->Position(duration_pos_))
+ return false;
+
+ if (!WriteEbmlElement(writer,
+ kMkvDuration,
+ static_cast<float>(duration_)))
+ return false;
+
+ if (writer->Position(pos))
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool SegmentInfo::Write(IMkvWriter* writer) {
+ if (!writer || !muxing_app_ || !writing_app_)
+ return false;
+
+ uint64 size = EbmlElementSize(kMkvTimecodeScale, timecode_scale_);
+ if (duration_ > 0.0)
+ size += EbmlElementSize(kMkvDuration, static_cast<float>(duration_));
+ size += EbmlElementSize(kMkvMuxingApp, muxing_app_);
+ size += EbmlElementSize(kMkvWritingApp, writing_app_);
+
+ if (!WriteEbmlMasterElement(writer, kMkvInfo, size))
+ return false;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return false;
+
+ if (!WriteEbmlElement(writer, kMkvTimecodeScale, timecode_scale_))
+ return false;
+
+ if (duration_ > 0.0) {
+ // Save for later
+ duration_pos_ = writer->Position();
+
+ if (!WriteEbmlElement(writer, kMkvDuration, static_cast<float>(duration_)))
+ return false;
+ }
+
+ if (!WriteEbmlElement(writer, kMkvMuxingApp, muxing_app_))
+ return false;
+ if (!WriteEbmlElement(writer, kMkvWritingApp, writing_app_))
+ return false;
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(size))
+ return false;
+
+ return true;
+}
+
+void SegmentInfo::set_muxing_app(const char* app) {
+ if (app) {
+ const size_t length = strlen(app) + 1;
+ char* temp_str = new (std::nothrow) char[length]; // NOLINT
+ if (!temp_str)
+ return;
+
+#ifdef _MSC_VER
+ strcpy_s(temp_str, length, app);
+#else
+ strcpy(temp_str, app);
+#endif
+
+ delete [] muxing_app_;
+ muxing_app_ = temp_str;
+ }
+}
+
+void SegmentInfo::set_writing_app(const char* app) {
+ if (app) {
+ const size_t length = strlen(app) + 1;
+ char* temp_str = new (std::nothrow) char[length]; // NOLINT
+ if (!temp_str)
+ return;
+
+#ifdef _MSC_VER
+ strcpy_s(temp_str, length, app);
+#else
+ strcpy(temp_str, app);
+#endif
+
+ delete [] writing_app_;
+ writing_app_ = temp_str;
+ }
+}
+
+///////////////////////////////////////////////////////////////
+//
+// Segment Class
+
+Segment::Segment()
+ : chunk_count_(0),
+ chunk_name_(NULL),
+ chunk_writer_cluster_(NULL),
+ chunk_writer_cues_(NULL),
+ chunk_writer_header_(NULL),
+ chunking_(false),
+ chunking_base_name_(NULL),
+ cluster_list_(NULL),
+ cluster_list_capacity_(0),
+ cluster_list_size_(0),
+ cues_position_(kAfterClusters),
+ cues_track_(0),
+ force_new_cluster_(false),
+ frames_(NULL),
+ frames_capacity_(0),
+ frames_size_(0),
+ has_video_(false),
+ header_written_(false),
+ last_block_duration_(0),
+ last_timestamp_(0),
+ max_cluster_duration_(kDefaultMaxClusterDuration),
+ max_cluster_size_(0),
+ mode_(kFile),
+ new_cuepoint_(false),
+ output_cues_(true),
+ payload_pos_(0),
+ size_position_(0),
+ writer_cluster_(NULL),
+ writer_cues_(NULL),
+ writer_header_(NULL) {
+ const time_t curr_time = time(NULL);
+ seed_ = static_cast<unsigned int>(curr_time);
+#ifdef _WIN32
+ srand(seed_);
+#endif
+}
+
+Segment::~Segment() {
+ if (cluster_list_) {
+ for (int32 i = 0; i < cluster_list_size_; ++i) {
+ Cluster* const cluster = cluster_list_[i];
+ delete cluster;
+ }
+ delete [] cluster_list_;
+ }
+
+ if (frames_) {
+ for (int32 i = 0; i < frames_size_; ++i) {
+ Frame* const frame = frames_[i];
+ delete frame;
+ }
+ delete [] frames_;
+ }
+
+ delete [] chunk_name_;
+ delete [] chunking_base_name_;
+
+ if (chunk_writer_cluster_) {
+ chunk_writer_cluster_->Close();
+ delete chunk_writer_cluster_;
+ }
+ if (chunk_writer_cues_) {
+ chunk_writer_cues_->Close();
+ delete chunk_writer_cues_;
+ }
+ if (chunk_writer_header_) {
+ chunk_writer_header_->Close();
+ delete chunk_writer_header_;
+ }
+}
+
+void Segment::MoveCuesBeforeClustersHelper(uint64 diff,
+ int32 index,
+ uint64* cues_size) {
+ const uint64 old_cues_size = *cues_size;
+ CuePoint* const cue_point = cues_.GetCueByIndex(index);
+ if (cue_point == NULL)
+ return;
+ const uint64 old_cue_point_size = cue_point->Size();
+ const uint64 cluster_pos = cue_point->cluster_pos() + diff;
+ cue_point->set_cluster_pos(cluster_pos); // update the new cluster position
+ // New size of the cue is computed as follows
+ // Let a = current size of Cues Element
+ // Let b = Difference in Cue Point's size after this pass
+ // Let c = Difference in length of Cues Element's size
+ // (This is computed as CodedSize(a + b) - CodedSize(a)
+ // Let d = a + b + c. Now d is the new size of the Cues element which is
+ // passed on to the next recursive call.
+ const uint64 cue_point_size_diff = cue_point->Size() - old_cue_point_size;
+ const uint64 cue_size_diff = GetCodedUIntSize(*cues_size +
+ cue_point_size_diff) -
+ GetCodedUIntSize(*cues_size);
+ *cues_size += cue_point_size_diff + cue_size_diff;
+ diff = *cues_size - old_cues_size;
+ if (diff > 0) {
+ for (int32 i = 0; i < cues_.cue_entries_size(); ++i) {
+ MoveCuesBeforeClustersHelper(diff, i, cues_size);
+ }
+ }
+}
+
+void Segment::MoveCuesBeforeClusters() {
+ const uint64 current_cue_size = cues_.Size();
+ uint64 cue_size = current_cue_size;
+ for (int32 i = 0; i < cues_.cue_entries_size(); i++)
+ MoveCuesBeforeClustersHelper(current_cue_size, i, &cue_size);
+
+ // Adjust the Seek Entry to reflect the change in position
+ // of Cluster and Cues
+ int32 cluster_index = 0;
+ int32 cues_index = 0;
+ for (int32 i = 0; i < SeekHead::kSeekEntryCount; ++i) {
+ if (seek_head_.GetId(i) == kMkvCluster)
+ cluster_index = i;
+ if (seek_head_.GetId(i) == kMkvCues)
+ cues_index = i;
+ }
+ seek_head_.SetSeekEntry(cues_index, kMkvCues,
+ seek_head_.GetPosition(cluster_index));
+ seek_head_.SetSeekEntry(cluster_index, kMkvCluster,
+ cues_.Size() + seek_head_.GetPosition(cues_index));
+}
+
+bool Segment::Init(IMkvWriter* ptr_writer) {
+ if (!ptr_writer) {
+ return false;
+ }
+ writer_cluster_ = ptr_writer;
+ writer_cues_ = ptr_writer;
+ writer_header_ = ptr_writer;
+ return segment_info_.Init();
+}
+
+bool Segment::CopyAndMoveCuesBeforeClusters(mkvparser::IMkvReader* reader,
+ IMkvWriter* writer) {
+ if (!writer->Seekable() || chunking_)
+ return false;
+ const int64 cluster_offset = cluster_list_[0]->size_position() -
+ GetUIntSize(kMkvCluster);
+
+ // Copy the headers.
+ if (!ChunkedCopy(reader, writer, 0, cluster_offset))
+ return false;
+
+ // Recompute cue positions and seek entries.
+ MoveCuesBeforeClusters();
+
+ // Write cues and seek entries.
+ // TODO(vigneshv): As of now, it's safe to call seek_head_.Finalize() for the
+ // second time with a different writer object. But the name Finalize() doesn't
+ // indicate something we want to call more than once. So consider renaming it
+ // to write() or some such.
+ if (!cues_.Write(writer) || !seek_head_.Finalize(writer))
+ return false;
+
+ // Copy the Clusters.
+ if (!ChunkedCopy(reader, writer, cluster_offset,
+ cluster_end_offset_ - cluster_offset))
+ return false;
+
+ // Update the Segment size in case the Cues size has changed.
+ const int64 pos = writer->Position();
+ const int64 segment_size = writer->Position() - payload_pos_;
+ if (writer->Position(size_position_) ||
+ WriteUIntSize(writer, segment_size, 8) ||
+ writer->Position(pos))
+ return false;
+ return true;
+}
+
+bool Segment::Finalize() {
+ if (WriteFramesAll() < 0)
+ return false;
+
+ if (mode_ == kFile) {
+ if (cluster_list_size_ > 0) {
+ // Update last cluster's size
+ Cluster* const old_cluster = cluster_list_[cluster_list_size_-1];
+
+ if (!old_cluster || !old_cluster->Finalize())
+ return false;
+ }
+
+ if (chunking_ && chunk_writer_cluster_) {
+ chunk_writer_cluster_->Close();
+ chunk_count_++;
+ }
+
+ const double duration =
+ (static_cast<double>(last_timestamp_) + last_block_duration_) /
+ segment_info_.timecode_scale();
+ segment_info_.set_duration(duration);
+ if (!segment_info_.Finalize(writer_header_))
+ return false;
+
+ if (output_cues_)
+ if (!seek_head_.AddSeekEntry(kMkvCues, MaxOffset()))
+ return false;
+
+ if (chunking_) {
+ if (!chunk_writer_cues_)
+ return false;
+
+ char* name = NULL;
+ if (!UpdateChunkName("cues", &name))
+ return false;
+
+ const bool cues_open = chunk_writer_cues_->Open(name);
+ delete [] name;
+ if (!cues_open)
+ return false;
+ }
+
+ cluster_end_offset_ = writer_cluster_->Position();
+
+ // Write the seek headers and cues
+ if (output_cues_)
+ if (!cues_.Write(writer_cues_))
+ return false;
+
+ if (!seek_head_.Finalize(writer_header_))
+ return false;
+
+ if (writer_header_->Seekable()) {
+ if (size_position_ == -1)
+ return false;
+
+ const int64 pos = writer_header_->Position();
+ const int64 segment_size = MaxOffset();
+
+ if (segment_size < 1)
+ return false;
+
+ if (writer_header_->Position(size_position_))
+ return false;
+
+ if (WriteUIntSize(writer_header_, segment_size, 8))
+ return false;
+
+ if (writer_header_->Position(pos))
+ return false;
+ }
+
+ if (chunking_) {
+ // Do not close any writers until the segment size has been written,
+ // otherwise the size may be off.
+ if (!chunk_writer_cues_ || !chunk_writer_header_)
+ return false;
+
+ chunk_writer_cues_->Close();
+ chunk_writer_header_->Close();
+ }
+ }
+
+ return true;
+}
+
+Track* Segment::AddTrack(int32 number) {
+ Track* const track = new (std::nothrow) Track(&seed_); // NOLINT
+
+ if (!track)
+ return NULL;
+
+ if (!tracks_.AddTrack(track, number)) {
+ delete track;
+ return NULL;
+ }
+
+ return track;
+}
+
+Chapter* Segment::AddChapter() {
+ return chapters_.AddChapter(&seed_);
+}
+
+uint64 Segment::AddVideoTrack(int32 width, int32 height, int32 number) {
+ VideoTrack* const track = new (std::nothrow) VideoTrack(&seed_); // NOLINT
+ if (!track)
+ return 0;
+
+ track->set_type(Tracks::kVideo);
+ track->set_codec_id(Tracks::kVp8CodecId);
+ track->set_width(width);
+ track->set_height(height);
+
+ tracks_.AddTrack(track, number);
+ has_video_ = true;
+
+ return track->number();
+}
+
+bool Segment::AddCuePoint(uint64 timestamp, uint64 track) {
+ if (cluster_list_size_ < 1)
+ return false;
+
+ const Cluster* const cluster = cluster_list_[cluster_list_size_-1];
+ if (!cluster)
+ return false;
+
+ CuePoint* const cue = new (std::nothrow) CuePoint(); // NOLINT
+ if (!cue)
+ return false;
+
+ cue->set_time(timestamp / segment_info_.timecode_scale());
+ cue->set_block_number(cluster->blocks_added());
+ cue->set_cluster_pos(cluster->position_for_cues());
+ cue->set_track(track);
+ if (!cues_.AddCue(cue))
+ return false;
+
+ new_cuepoint_ = false;
+ return true;
+}
+
+uint64 Segment::AddAudioTrack(int32 sample_rate,
+ int32 channels,
+ int32 number) {
+ AudioTrack* const track = new (std::nothrow) AudioTrack(&seed_); // NOLINT
+ if (!track)
+ return 0;
+
+ track->set_type(Tracks::kAudio);
+ track->set_codec_id(Tracks::kVorbisCodecId);
+ track->set_sample_rate(sample_rate);
+ track->set_channels(channels);
+
+ tracks_.AddTrack(track, number);
+
+ return track->number();
+}
+
+bool Segment::AddFrame(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 timestamp,
+ bool is_key) {
+ if (!frame)
+ return false;
+
+ if (!CheckHeaderInfo())
+ return false;
+
+ // Check for non-monotonically increasing timestamps.
+ if (timestamp < last_timestamp_)
+ return false;
+
+ // If the segment has a video track hold onto audio frames to make sure the
+ // audio that is associated with the start time of a video key-frame is
+ // muxed into the same cluster.
+ if (has_video_ && tracks_.TrackIsAudio(track_number) && !force_new_cluster_) {
+ Frame* const new_frame = new (std::nothrow) Frame();
+ if (new_frame == NULL || !new_frame->Init(frame, length))
+ return false;
+ new_frame->set_track_number(track_number);
+ new_frame->set_timestamp(timestamp);
+ new_frame->set_is_key(is_key);
+
+ if (!QueueFrame(new_frame))
+ return false;
+
+ return true;
+ }
+
+ if (!DoNewClusterProcessing(track_number, timestamp, is_key))
+ return false;
+
+ if (cluster_list_size_ < 1)
+ return false;
+
+ Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
+ if (!cluster)
+ return false;
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ const uint64 abs_timecode = timestamp / timecode_scale;
+
+ if (!cluster->AddFrame(frame,
+ length,
+ track_number,
+ abs_timecode,
+ is_key))
+ return false;
+
+ if (new_cuepoint_ && cues_track_ == track_number) {
+ if (!AddCuePoint(timestamp, cues_track_))
+ return false;
+ }
+
+ if (timestamp > last_timestamp_)
+ last_timestamp_ = timestamp;
+
+ return true;
+}
+
+bool Segment::AddFrameWithAdditional(const uint8* frame,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ uint64 timestamp,
+ bool is_key) {
+ if (frame == NULL || additional == NULL)
+ return false;
+
+ if (!CheckHeaderInfo())
+ return false;
+
+ // Check for non-monotonically increasing timestamps.
+ if (timestamp < last_timestamp_)
+ return false;
+
+ // If the segment has a video track hold onto audio frames to make sure the
+ // audio that is associated with the start time of a video key-frame is
+ // muxed into the same cluster.
+ if (has_video_ && tracks_.TrackIsAudio(track_number) && !force_new_cluster_) {
+ Frame* const new_frame = new (std::nothrow) Frame();
+ if (new_frame == NULL || !new_frame->Init(frame, length))
+ return false;
+ new_frame->set_track_number(track_number);
+ new_frame->set_timestamp(timestamp);
+ new_frame->set_is_key(is_key);
+
+ if (!QueueFrame(new_frame))
+ return false;
+
+ return true;
+ }
+
+ if (!DoNewClusterProcessing(track_number, timestamp, is_key))
+ return false;
+
+ if (cluster_list_size_ < 1)
+ return false;
+
+ Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
+ if (cluster == NULL)
+ return false;
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ const uint64 abs_timecode = timestamp / timecode_scale;
+
+ if (!cluster->AddFrameWithAdditional(frame,
+ length,
+ additional,
+ additional_length,
+ add_id,
+ track_number,
+ abs_timecode,
+ is_key))
+ return false;
+
+ if (new_cuepoint_ && cues_track_ == track_number) {
+ if (!AddCuePoint(timestamp, cues_track_))
+ return false;
+ }
+
+ if (timestamp > last_timestamp_)
+ last_timestamp_ = timestamp;
+
+ return true;
+}
+
+bool Segment::AddFrameWithDiscardPadding(const uint8* frame,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ uint64 timestamp,
+ bool is_key) {
+ if (frame == NULL || discard_padding <= 0)
+ return false;
+
+ if (!CheckHeaderInfo())
+ return false;
+
+ // Check for non-monotonically increasing timestamps.
+ if (timestamp < last_timestamp_)
+ return false;
+
+ // If the segment has a video track hold onto audio frames to make sure the
+ // audio that is associated with the start time of a video key-frame is
+ // muxed into the same cluster.
+ if (has_video_ && tracks_.TrackIsAudio(track_number) && !force_new_cluster_) {
+ Frame* const new_frame = new (std::nothrow) Frame();
+ if (new_frame == NULL || !new_frame->Init(frame, length))
+ return false;
+ new_frame->set_track_number(track_number);
+ new_frame->set_timestamp(timestamp);
+ new_frame->set_is_key(is_key);
+ new_frame->set_discard_padding(discard_padding);
+
+ if (!QueueFrame(new_frame))
+ return false;
+
+ return true;
+ }
+
+ if (!DoNewClusterProcessing(track_number, timestamp, is_key))
+ return false;
+
+ if (cluster_list_size_ < 1)
+ return false;
+
+ Cluster* const cluster = cluster_list_[cluster_list_size_ - 1];
+ if (!cluster)
+ return false;
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ const uint64 abs_timecode = timestamp / timecode_scale;
+
+ if (!cluster->AddFrameWithDiscardPadding(frame, length,
+ discard_padding,
+ track_number,
+ abs_timecode,
+ is_key)) {
+ return false;
+ }
+
+ if (new_cuepoint_ && cues_track_ == track_number) {
+ if (!AddCuePoint(timestamp, cues_track_))
+ return false;
+ }
+
+ if (timestamp > last_timestamp_)
+ last_timestamp_ = timestamp;
+
+ return true;
+}
+
+bool Segment::AddMetadata(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 timestamp_ns,
+ uint64 duration_ns) {
+ if (!frame)
+ return false;
+
+ if (!CheckHeaderInfo())
+ return false;
+
+ // Check for non-monotonically increasing timestamps.
+ if (timestamp_ns < last_timestamp_)
+ return false;
+
+ if (!DoNewClusterProcessing(track_number, timestamp_ns, true))
+ return false;
+
+ if (cluster_list_size_ < 1)
+ return false;
+
+ Cluster* const cluster = cluster_list_[cluster_list_size_-1];
+
+ if (!cluster)
+ return false;
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ const uint64 abs_timecode = timestamp_ns / timecode_scale;
+ const uint64 duration_timecode = duration_ns / timecode_scale;
+
+ if (!cluster->AddMetadata(frame,
+ length,
+ track_number,
+ abs_timecode,
+ duration_timecode))
+ return false;
+
+ if (timestamp_ns > last_timestamp_)
+ last_timestamp_ = timestamp_ns;
+
+ return true;
+}
+
+bool Segment::AddGenericFrame(const Frame* frame) {
+ last_block_duration_ = frame->duration();
+ if (!tracks_.TrackIsAudio(frame->track_number()) &&
+ !tracks_.TrackIsVideo(frame->track_number()) &&
+ frame->duration() > 0) {
+ return AddMetadata(frame->frame(),
+ frame->length(),
+ frame->track_number(),
+ frame->timestamp(),
+ frame->duration());
+ } else if (frame->additional() && frame->additional_length() > 0) {
+ return AddFrameWithAdditional(frame->frame(),
+ frame->length(),
+ frame->additional(),
+ frame->additional_length(),
+ frame->add_id(),
+ frame->track_number(),
+ frame->timestamp(),
+ frame->is_key());
+ } else if (frame->discard_padding() > 0) {
+ return AddFrameWithDiscardPadding(frame->frame(), frame->length(),
+ frame->discard_padding(),
+ frame->track_number(),
+ frame->timestamp(),
+ frame->is_key());
+ } else {
+ return AddFrame(frame->frame(),
+ frame->length(),
+ frame->track_number(),
+ frame->timestamp(),
+ frame->is_key());
+ }
+}
+
+void Segment::OutputCues(bool output_cues) {
+ output_cues_ = output_cues;
+}
+
+bool Segment::SetChunking(bool chunking, const char* filename) {
+ if (chunk_count_ > 0)
+ return false;
+
+ if (chunking) {
+ if (!filename)
+ return false;
+
+ // Check if we are being set to what is already set.
+ if (chunking_ && !strcmp(filename, chunking_base_name_))
+ return true;
+
+ const size_t name_length = strlen(filename) + 1;
+ char* const temp = new (std::nothrow) char[name_length]; // NOLINT
+ if (!temp)
+ return false;
+
+#ifdef _MSC_VER
+ strcpy_s(temp, name_length, filename);
+#else
+ strcpy(temp, filename);
+#endif
+
+ delete [] chunking_base_name_;
+ chunking_base_name_ = temp;
+
+ if (!UpdateChunkName("chk", &chunk_name_))
+ return false;
+
+ if (!chunk_writer_cluster_) {
+ chunk_writer_cluster_ = new (std::nothrow) MkvWriter(); // NOLINT
+ if (!chunk_writer_cluster_)
+ return false;
+ }
+
+ if (!chunk_writer_cues_) {
+ chunk_writer_cues_ = new (std::nothrow) MkvWriter(); // NOLINT
+ if (!chunk_writer_cues_)
+ return false;
+ }
+
+ if (!chunk_writer_header_) {
+ chunk_writer_header_ = new (std::nothrow) MkvWriter(); // NOLINT
+ if (!chunk_writer_header_)
+ return false;
+ }
+
+ if (!chunk_writer_cluster_->Open(chunk_name_))
+ return false;
+
+ const size_t header_length = strlen(filename) + strlen(".hdr") + 1;
+ char* const header = new (std::nothrow) char[header_length]; // NOLINT
+ if (!header)
+ return false;
+
+#ifdef _MSC_VER
+ strcpy_s(header, header_length - strlen(".hdr"), chunking_base_name_);
+ strcat_s(header, header_length, ".hdr");
+#else
+ strcpy(header, chunking_base_name_);
+ strcat(header, ".hdr");
+#endif
+ if (!chunk_writer_header_->Open(header)) {
+ delete [] header;
+ return false;
+ }
+
+ writer_cluster_ = chunk_writer_cluster_;
+ writer_cues_ = chunk_writer_cues_;
+ writer_header_ = chunk_writer_header_;
+
+ delete [] header;
+ }
+
+ chunking_ = chunking;
+
+ return true;
+}
+
+bool Segment::CuesTrack(uint64 track_number) {
+ const Track* const track = GetTrackByNumber(track_number);
+ if (!track)
+ return false;
+
+ cues_track_ = track_number;
+ return true;
+}
+
+void Segment::ForceNewClusterOnNextFrame() {
+ force_new_cluster_ = true;
+}
+
+Track* Segment::GetTrackByNumber(uint64 track_number) const {
+ return tracks_.GetTrackByNumber(track_number);
+}
+
+bool Segment::WriteSegmentHeader() {
+ // TODO(fgalligan): Support more than one segment.
+ if (!WriteEbmlHeader(writer_header_))
+ return false;
+
+ // Write "unknown" (-1) as segment size value. If mode is kFile, Segment
+ // will write over duration when the file is finalized.
+ if (WriteID(writer_header_, kMkvSegment))
+ return false;
+
+ // Save for later.
+ size_position_ = writer_header_->Position();
+
+ // Write "unknown" (EBML coded -1) as segment size value. We need to write 8
+ // bytes because if we are going to overwrite the segment size later we do
+ // not know how big our segment will be.
+ if (SerializeInt(writer_header_, kEbmlUnknownValue, 8))
+ return false;
+
+ payload_pos_ = writer_header_->Position();
+
+ if (mode_ == kFile && writer_header_->Seekable()) {
+ // Set the duration > 0.0 so SegmentInfo will write out the duration. When
+ // the muxer is done writing we will set the correct duration and have
+ // SegmentInfo upadte it.
+ segment_info_.set_duration(1.0);
+
+ if (!seek_head_.Write(writer_header_))
+ return false;
+ }
+
+ if (!seek_head_.AddSeekEntry(kMkvInfo, MaxOffset()))
+ return false;
+ if (!segment_info_.Write(writer_header_))
+ return false;
+
+ if (!seek_head_.AddSeekEntry(kMkvTracks, MaxOffset()))
+ return false;
+ if (!tracks_.Write(writer_header_))
+ return false;
+
+ if (chapters_.Count() > 0) {
+ if (!seek_head_.AddSeekEntry(kMkvChapters, MaxOffset()))
+ return false;
+ if (!chapters_.Write(writer_header_))
+ return false;
+ }
+
+ if (chunking_ && (mode_ == kLive || !writer_header_->Seekable())) {
+ if (!chunk_writer_header_)
+ return false;
+
+ chunk_writer_header_->Close();
+ }
+
+ header_written_ = true;
+
+ return true;
+}
+
+// Here we are testing whether to create a new cluster, given a frame
+// having time frame_timestamp_ns.
+//
+int Segment::TestFrame(uint64 track_number,
+ uint64 frame_timestamp_ns,
+ bool is_key) const {
+ if (force_new_cluster_)
+ return 1;
+
+ // If no clusters have been created yet, then create a new cluster
+ // and write this frame immediately, in the new cluster. This path
+ // should only be followed once, the first time we attempt to write
+ // a frame.
+
+ if (cluster_list_size_ <= 0)
+ return 1;
+
+ // There exists at least one cluster. We must compare the frame to
+ // the last cluster, in order to determine whether the frame is
+ // written to the existing cluster, or that a new cluster should be
+ // created.
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ const uint64 frame_timecode = frame_timestamp_ns / timecode_scale;
+
+ const Cluster* const last_cluster = cluster_list_[cluster_list_size_ - 1];
+ const uint64 last_cluster_timecode = last_cluster->timecode();
+
+ // For completeness we test for the case when the frame's timecode
+ // is less than the cluster's timecode. Although in principle that
+ // is allowed, this muxer doesn't actually write clusters like that,
+ // so this indicates a bug somewhere in our algorithm.
+
+ if (frame_timecode < last_cluster_timecode) // should never happen
+ return -1; // error
+
+ // If the frame has a timestamp significantly larger than the last
+ // cluster (in Matroska, cluster-relative timestamps are serialized
+ // using a 16-bit signed integer), then we cannot write this frame
+ // to that cluster, and so we must create a new cluster.
+
+ const int64 delta_timecode = frame_timecode - last_cluster_timecode;
+
+ if (delta_timecode > kMaxBlockTimecode)
+ return 2;
+
+ // We decide to create a new cluster when we have a video keyframe.
+ // This will flush queued (audio) frames, and write the keyframe
+ // immediately, in the newly-created cluster.
+
+ if (is_key && tracks_.TrackIsVideo(track_number))
+ return 1;
+
+ // Create a new cluster if we have accumulated too many frames
+ // already, where "too many" is defined as "the total time of frames
+ // in the cluster exceeds a threshold".
+
+ const uint64 delta_ns = delta_timecode * timecode_scale;
+
+ if (max_cluster_duration_ > 0 && delta_ns >= max_cluster_duration_)
+ return 1;
+
+ // This is similar to the case above, with the difference that a new
+ // cluster is created when the size of the current cluster exceeds a
+ // threshold.
+
+ const uint64 cluster_size = last_cluster->payload_size();
+
+ if (max_cluster_size_ > 0 && cluster_size >= max_cluster_size_)
+ return 1;
+
+ // There's no need to create a new cluster, so emit this frame now.
+
+ return 0;
+}
+
+bool Segment::MakeNewCluster(uint64 frame_timestamp_ns) {
+ const int32 new_size = cluster_list_size_ + 1;
+
+ if (new_size > cluster_list_capacity_) {
+ // Add more clusters.
+ const int32 new_capacity =
+ (cluster_list_capacity_ <= 0) ? 1 : cluster_list_capacity_ * 2;
+ Cluster** const clusters =
+ new (std::nothrow) Cluster*[new_capacity]; // NOLINT
+ if (!clusters)
+ return false;
+
+ for (int32 i = 0; i < cluster_list_size_; ++i) {
+ clusters[i] = cluster_list_[i];
+ }
+
+ delete [] cluster_list_;
+
+ cluster_list_ = clusters;
+ cluster_list_capacity_ = new_capacity;
+ }
+
+ if (!WriteFramesLessThan(frame_timestamp_ns))
+ return false;
+
+ if (mode_ == kFile) {
+ if (cluster_list_size_ > 0) {
+ // Update old cluster's size
+ Cluster* const old_cluster = cluster_list_[cluster_list_size_ - 1];
+
+ if (!old_cluster || !old_cluster->Finalize())
+ return false;
+ }
+
+ if (output_cues_)
+ new_cuepoint_ = true;
+ }
+
+ if (chunking_ && cluster_list_size_ > 0) {
+ chunk_writer_cluster_->Close();
+ chunk_count_++;
+
+ if (!UpdateChunkName("chk", &chunk_name_))
+ return false;
+ if (!chunk_writer_cluster_->Open(chunk_name_))
+ return false;
+ }
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ const uint64 frame_timecode = frame_timestamp_ns / timecode_scale;
+
+ uint64 cluster_timecode = frame_timecode;
+
+ if (frames_size_ > 0) {
+ const Frame* const f = frames_[0]; // earliest queued frame
+ const uint64 ns = f->timestamp();
+ const uint64 tc = ns / timecode_scale;
+
+ if (tc < cluster_timecode)
+ cluster_timecode = tc;
+ }
+
+ Cluster*& cluster = cluster_list_[cluster_list_size_];
+ const int64 offset = MaxOffset();
+ cluster = new (std::nothrow) Cluster(cluster_timecode, offset); // NOLINT
+ if (!cluster)
+ return false;
+
+ if (!cluster->Init(writer_cluster_))
+ return false;
+
+ cluster_list_size_ = new_size;
+ return true;
+}
+
+bool Segment::DoNewClusterProcessing(uint64 track_number,
+ uint64 frame_timestamp_ns,
+ bool is_key) {
+ for (;;) {
+ // Based on the characteristics of the current frame and current
+ // cluster, decide whether to create a new cluster.
+ const int result = TestFrame(track_number, frame_timestamp_ns, is_key);
+ if (result < 0) // error
+ return false;
+
+ // Always set force_new_cluster_ to false after TestFrame.
+ force_new_cluster_ = false;
+
+ // A non-zero result means create a new cluster.
+ if (result > 0 && !MakeNewCluster(frame_timestamp_ns))
+ return false;
+
+ // Write queued (audio) frames.
+ const int frame_count = WriteFramesAll();
+ if (frame_count < 0) // error
+ return false;
+
+ // Write the current frame to the current cluster (if TestFrame
+ // returns 0) or to a newly created cluster (TestFrame returns 1).
+ if (result <= 1)
+ return true;
+
+ // TestFrame returned 2, which means there was a large time
+ // difference between the cluster and the frame itself. Do the
+ // test again, comparing the frame to the new cluster.
+ }
+}
+
+bool Segment::CheckHeaderInfo() {
+ if (!header_written_) {
+ if (!WriteSegmentHeader())
+ return false;
+
+ if (!seek_head_.AddSeekEntry(kMkvCluster, MaxOffset()))
+ return false;
+
+ if (output_cues_ && cues_track_ == 0) {
+ // Check for a video track
+ for (uint32 i = 0; i < tracks_.track_entries_size(); ++i) {
+ const Track* const track = tracks_.GetTrackByIndex(i);
+ if (!track)
+ return false;
+
+ if (tracks_.TrackIsVideo(track->number())) {
+ cues_track_ = track->number();
+ break;
+ }
+ }
+
+ // Set first track found
+ if (cues_track_ == 0) {
+ const Track* const track = tracks_.GetTrackByIndex(0);
+ if (!track)
+ return false;
+
+ cues_track_ = track->number();
+ }
+ }
+ }
+ return true;
+}
+
+bool Segment::UpdateChunkName(const char* ext, char** name) const {
+ if (!name || !ext)
+ return false;
+
+ char ext_chk[64];
+#ifdef _MSC_VER
+ sprintf_s(ext_chk, sizeof(ext_chk), "_%06d.%s", chunk_count_, ext);
+#else
+ snprintf(ext_chk, sizeof(ext_chk), "_%06d.%s", chunk_count_, ext);
+#endif
+
+ const size_t length = strlen(chunking_base_name_) + strlen(ext_chk) + 1;
+ char* const str = new (std::nothrow) char[length]; // NOLINT
+ if (!str)
+ return false;
+
+#ifdef _MSC_VER
+ strcpy_s(str, length-strlen(ext_chk), chunking_base_name_);
+ strcat_s(str, length, ext_chk);
+#else
+ strcpy(str, chunking_base_name_);
+ strcat(str, ext_chk);
+#endif
+
+ delete [] *name;
+ *name = str;
+
+ return true;
+}
+
+int64 Segment::MaxOffset() {
+ if (!writer_header_)
+ return -1;
+
+ int64 offset = writer_header_->Position() - payload_pos_;
+
+ if (chunking_) {
+ for (int32 i = 0; i < cluster_list_size_; ++i) {
+ Cluster* const cluster = cluster_list_[i];
+ offset += cluster->Size();
+ }
+
+ if (writer_cues_)
+ offset += writer_cues_->Position();
+ }
+
+ return offset;
+}
+
+bool Segment::QueueFrame(Frame* frame) {
+ const int32 new_size = frames_size_ + 1;
+
+ if (new_size > frames_capacity_) {
+ // Add more frames.
+ const int32 new_capacity = (!frames_capacity_) ? 2 : frames_capacity_ * 2;
+
+ if (new_capacity < 1)
+ return false;
+
+ Frame** const frames = new (std::nothrow) Frame*[new_capacity]; // NOLINT
+ if (!frames)
+ return false;
+
+ for (int32 i = 0; i < frames_size_; ++i) {
+ frames[i] = frames_[i];
+ }
+
+ delete [] frames_;
+ frames_ = frames;
+ frames_capacity_ = new_capacity;
+ }
+
+ frames_[frames_size_++] = frame;
+
+ return true;
+}
+
+int Segment::WriteFramesAll() {
+ if (frames_ == NULL)
+ return 0;
+
+ if (cluster_list_size_ < 1)
+ return -1;
+
+ Cluster* const cluster = cluster_list_[cluster_list_size_-1];
+
+ if (!cluster)
+ return -1;
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+
+ for (int32 i = 0; i < frames_size_; ++i) {
+ Frame*& frame = frames_[i];
+ const uint64 frame_timestamp = frame->timestamp(); // ns
+ const uint64 frame_timecode = frame_timestamp / timecode_scale;
+
+ if (frame->discard_padding() > 0) {
+ if (!cluster->AddFrameWithDiscardPadding(frame->frame(),
+ frame->length(),
+ frame->discard_padding(),
+ frame->track_number(),
+ frame_timecode,
+ frame->is_key())) {
+ return -1;
+ }
+ } else {
+ if (!cluster->AddFrame(frame->frame(),
+ frame->length(),
+ frame->track_number(),
+ frame_timecode,
+ frame->is_key())) {
+ return -1;
+ }
+ }
+
+ if (new_cuepoint_ && cues_track_ == frame->track_number()) {
+ if (!AddCuePoint(frame_timestamp, cues_track_))
+ return -1;
+ }
+
+ if (frame_timestamp > last_timestamp_)
+ last_timestamp_ = frame_timestamp;
+
+ delete frame;
+ frame = NULL;
+ }
+
+ const int result = frames_size_;
+ frames_size_ = 0;
+
+ return result;
+}
+
+bool Segment::WriteFramesLessThan(uint64 timestamp) {
+ // Check |cluster_list_size_| to see if this is the first cluster. If it is
+ // the first cluster the audio frames that are less than the first video
+ // timesatmp will be written in a later step.
+ if (frames_size_ > 0 && cluster_list_size_ > 0) {
+ if (!frames_)
+ return false;
+
+ Cluster* const cluster = cluster_list_[cluster_list_size_-1];
+ if (!cluster)
+ return false;
+
+ const uint64 timecode_scale = segment_info_.timecode_scale();
+ int32 shift_left = 0;
+
+ // TODO(fgalligan): Change this to use the durations of frames instead of
+ // the next frame's start time if the duration is accurate.
+ for (int32 i = 1; i < frames_size_; ++i) {
+ const Frame* const frame_curr = frames_[i];
+
+ if (frame_curr->timestamp() > timestamp)
+ break;
+
+ const Frame* const frame_prev = frames_[i-1];
+ const uint64 frame_timestamp = frame_prev->timestamp();
+ const uint64 frame_timecode = frame_timestamp / timecode_scale;
+ const int64 discard_padding = frame_prev->discard_padding();
+
+ if (discard_padding > 0) {
+ if (!cluster->AddFrameWithDiscardPadding(frame_prev->frame(),
+ frame_prev->length(),
+ discard_padding,
+ frame_prev->track_number(),
+ frame_timecode,
+ frame_prev->is_key())) {
+ return false;
+ }
+ } else {
+ if (!cluster->AddFrame(frame_prev->frame(),
+ frame_prev->length(),
+ frame_prev->track_number(),
+ frame_timecode,
+ frame_prev->is_key())) {
+ return false;
+ }
+ }
+
+ if (new_cuepoint_ && cues_track_ == frame_prev->track_number()) {
+ if (!AddCuePoint(frame_timestamp, cues_track_))
+ return false;
+ }
+
+ ++shift_left;
+ if (frame_timestamp > last_timestamp_)
+ last_timestamp_ = frame_timestamp;
+
+ delete frame_prev;
+ }
+
+ if (shift_left > 0) {
+ if (shift_left >= frames_size_)
+ return false;
+
+ const int32 new_frames_size = frames_size_ - shift_left;
+ for (int32 i = 0; i < new_frames_size; ++i) {
+ frames_[i] = frames_[i+shift_left];
+ }
+
+ frames_size_ = new_frames_size;
+ }
+ }
+
+ return true;
+}
+
+} // namespace mkvmuxer
diff --git a/libvpx/third_party/libwebm/mkvmuxer.hpp b/libvpx/third_party/libwebm/mkvmuxer.hpp
new file mode 100644
index 0000000..63a315e
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvmuxer.hpp
@@ -0,0 +1,1403 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef MKVMUXER_HPP
+#define MKVMUXER_HPP
+
+#include "mkvmuxertypes.hpp"
+
+// For a description of the WebM elements see
+// http://www.webmproject.org/code/specs/container/.
+
+namespace mkvparser {
+ class IMkvReader;
+} // end namespace
+
+namespace mkvmuxer {
+
+class MkvWriter;
+class Segment;
+
+///////////////////////////////////////////////////////////////
+// Interface used by the mkvmuxer to write out the Mkv data.
+class IMkvWriter {
+ public:
+ // Writes out |len| bytes of |buf|. Returns 0 on success.
+ virtual int32 Write(const void* buf, uint32 len) = 0;
+
+ // Returns the offset of the output position from the beginning of the
+ // output.
+ virtual int64 Position() const = 0;
+
+ // Set the current File position. Returns 0 on success.
+ virtual int32 Position(int64 position) = 0;
+
+ // Returns true if the writer is seekable.
+ virtual bool Seekable() const = 0;
+
+ // Element start notification. Called whenever an element identifier is about
+ // to be written to the stream. |element_id| is the element identifier, and
+ // |position| is the location in the WebM stream where the first octet of the
+ // element identifier will be written.
+ // Note: the |MkvId| enumeration in webmids.hpp defines element values.
+ virtual void ElementStartNotify(uint64 element_id, int64 position) = 0;
+
+ protected:
+ IMkvWriter();
+ virtual ~IMkvWriter();
+
+ private:
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(IMkvWriter);
+};
+
+// Writes out the EBML header for a WebM file. This function must be called
+// before any other libwebm writing functions are called.
+bool WriteEbmlHeader(IMkvWriter* writer);
+
+// Copies in Chunk from source to destination between the given byte positions
+bool ChunkedCopy(mkvparser::IMkvReader* source, IMkvWriter* dst,
+ int64 start, int64 size);
+
+///////////////////////////////////////////////////////////////
+// Class to hold data the will be written to a block.
+class Frame {
+ public:
+ Frame();
+ ~Frame();
+
+ // Copies |frame| data into |frame_|. Returns true on success.
+ bool Init(const uint8* frame, uint64 length);
+
+ // Copies |additional| data into |additional_|. Returns true on success.
+ bool AddAdditionalData(const uint8* additional, uint64 length,
+ uint64 add_id);
+
+ uint64 add_id() const { return add_id_; }
+ const uint8* additional() const { return additional_; }
+ uint64 additional_length() const { return additional_length_; }
+ void set_duration(uint64 duration) { duration_ = duration; }
+ uint64 duration() const { return duration_; }
+ const uint8* frame() const { return frame_; }
+ void set_is_key(bool key) { is_key_ = key; }
+ bool is_key() const { return is_key_; }
+ uint64 length() const { return length_; }
+ void set_track_number(uint64 track_number) { track_number_ = track_number; }
+ uint64 track_number() const { return track_number_; }
+ void set_timestamp(uint64 timestamp) { timestamp_ = timestamp; }
+ uint64 timestamp() const { return timestamp_; }
+ void set_discard_padding(uint64 discard_padding) {
+ discard_padding_ = discard_padding;
+ }
+ uint64 discard_padding() const { return discard_padding_; }
+
+ private:
+ // Id of the Additional data.
+ uint64 add_id_;
+
+ // Pointer to additional data. Owned by this class.
+ uint8* additional_;
+
+ // Length of the additional data.
+ uint64 additional_length_;
+
+ // Duration of the frame in nanoseconds.
+ uint64 duration_;
+
+ // Pointer to the data. Owned by this class.
+ uint8* frame_;
+
+ // Flag telling if the data should set the key flag of a block.
+ bool is_key_;
+
+ // Length of the data.
+ uint64 length_;
+
+ // Mkv track number the data is associated with.
+ uint64 track_number_;
+
+ // Timestamp of the data in nanoseconds.
+ uint64 timestamp_;
+
+ // Discard padding for the frame.
+ int64 discard_padding_;
+};
+
+///////////////////////////////////////////////////////////////
+// Class to hold one cue point in a Cues element.
+class CuePoint {
+ public:
+ CuePoint();
+ ~CuePoint();
+
+ // Returns the size in bytes for the entire CuePoint element.
+ uint64 Size() const;
+
+ // Output the CuePoint element to the writer. Returns true on success.
+ bool Write(IMkvWriter* writer) const;
+
+ void set_time(uint64 time) { time_ = time; }
+ uint64 time() const { return time_; }
+ void set_track(uint64 track) { track_ = track; }
+ uint64 track() const { return track_; }
+ void set_cluster_pos(uint64 cluster_pos) { cluster_pos_ = cluster_pos; }
+ uint64 cluster_pos() const { return cluster_pos_; }
+ void set_block_number(uint64 block_number) { block_number_ = block_number; }
+ uint64 block_number() const { return block_number_; }
+ void set_output_block_number(bool output_block_number) {
+ output_block_number_ = output_block_number;
+ }
+ bool output_block_number() const { return output_block_number_; }
+
+ private:
+ // Returns the size in bytes for the payload of the CuePoint element.
+ uint64 PayloadSize() const;
+
+ // Absolute timecode according to the segment time base.
+ uint64 time_;
+
+ // The Track element associated with the CuePoint.
+ uint64 track_;
+
+ // The position of the Cluster containing the Block.
+ uint64 cluster_pos_;
+
+ // Number of the Block within the Cluster, starting from 1.
+ uint64 block_number_;
+
+ // If true the muxer will write out the block number for the cue if the
+ // block number is different than the default of 1. Default is set to true.
+ bool output_block_number_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(CuePoint);
+};
+
+///////////////////////////////////////////////////////////////
+// Cues element.
+class Cues {
+ public:
+ Cues();
+ ~Cues();
+
+ // Adds a cue point to the Cues element. Returns true on success.
+ bool AddCue(CuePoint* cue);
+
+ // Returns the cue point by index. Returns NULL if there is no cue point
+ // match.
+ CuePoint* GetCueByIndex(int32 index) const;
+
+ // Returns the total size of the Cues element
+ uint64 Size();
+
+ // Output the Cues element to the writer. Returns true on success.
+ bool Write(IMkvWriter* writer) const;
+
+ int32 cue_entries_size() const { return cue_entries_size_; }
+ void set_output_block_number(bool output_block_number) {
+ output_block_number_ = output_block_number;
+ }
+ bool output_block_number() const { return output_block_number_; }
+
+ private:
+ // Number of allocated elements in |cue_entries_|.
+ int32 cue_entries_capacity_;
+
+ // Number of CuePoints in |cue_entries_|.
+ int32 cue_entries_size_;
+
+ // CuePoint list.
+ CuePoint** cue_entries_;
+
+ // If true the muxer will write out the block number for the cue if the
+ // block number is different than the default of 1. Default is set to true.
+ bool output_block_number_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Cues);
+};
+
+///////////////////////////////////////////////////////////////
+// ContentEncAESSettings element
+class ContentEncAESSettings {
+ public:
+ enum {
+ kCTR = 1
+ };
+
+ ContentEncAESSettings();
+ ~ContentEncAESSettings() {}
+
+ // Returns the size in bytes for the ContentEncAESSettings element.
+ uint64 Size() const;
+
+ // Writes out the ContentEncAESSettings element to |writer|. Returns true on
+ // success.
+ bool Write(IMkvWriter* writer) const;
+
+ uint64 cipher_mode() const { return cipher_mode_; }
+
+ private:
+ // Returns the size in bytes for the payload of the ContentEncAESSettings
+ // element.
+ uint64 PayloadSize() const;
+
+ // Sub elements
+ uint64 cipher_mode_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(ContentEncAESSettings);
+};
+
+///////////////////////////////////////////////////////////////
+// ContentEncoding element
+// Elements used to describe if the track data has been encrypted or
+// compressed with zlib or header stripping.
+// Currently only whole frames can be encrypted with AES. This dictates that
+// ContentEncodingOrder will be 0, ContentEncodingScope will be 1,
+// ContentEncodingType will be 1, and ContentEncAlgo will be 5.
+class ContentEncoding {
+ public:
+ ContentEncoding();
+ ~ContentEncoding();
+
+ // Sets the content encryption id. Copies |length| bytes from |id| to
+ // |enc_key_id_|. Returns true on success.
+ bool SetEncryptionID(const uint8* id, uint64 length);
+
+ // Returns the size in bytes for the ContentEncoding element.
+ uint64 Size() const;
+
+ // Writes out the ContentEncoding element to |writer|. Returns true on
+ // success.
+ bool Write(IMkvWriter* writer) const;
+
+ uint64 enc_algo() const { return enc_algo_; }
+ uint64 encoding_order() const { return encoding_order_; }
+ uint64 encoding_scope() const { return encoding_scope_; }
+ uint64 encoding_type() const { return encoding_type_; }
+ ContentEncAESSettings* enc_aes_settings() { return &enc_aes_settings_; }
+
+ private:
+ // Returns the size in bytes for the encoding elements.
+ uint64 EncodingSize(uint64 compresion_size, uint64 encryption_size) const;
+
+ // Returns the size in bytes for the encryption elements.
+ uint64 EncryptionSize() const;
+
+ // Track element names
+ uint64 enc_algo_;
+ uint8* enc_key_id_;
+ uint64 encoding_order_;
+ uint64 encoding_scope_;
+ uint64 encoding_type_;
+
+ // ContentEncAESSettings element.
+ ContentEncAESSettings enc_aes_settings_;
+
+ // Size of the ContentEncKeyID data in bytes.
+ uint64 enc_key_id_length_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(ContentEncoding);
+};
+
+///////////////////////////////////////////////////////////////
+// Track element.
+class Track {
+ public:
+ // The |seed| parameter is used to synthesize a UID for the track.
+ explicit Track(unsigned int* seed);
+ virtual ~Track();
+
+ // Adds a ContentEncoding element to the Track. Returns true on success.
+ virtual bool AddContentEncoding();
+
+ // Returns the ContentEncoding by index. Returns NULL if there is no
+ // ContentEncoding match.
+ ContentEncoding* GetContentEncodingByIndex(uint32 index) const;
+
+ // Returns the size in bytes for the payload of the Track element.
+ virtual uint64 PayloadSize() const;
+
+ // Returns the size in bytes of the Track element.
+ virtual uint64 Size() const;
+
+ // Output the Track element to the writer. Returns true on success.
+ virtual bool Write(IMkvWriter* writer) const;
+
+ // Sets the CodecPrivate element of the Track element. Copies |length|
+ // bytes from |codec_private| to |codec_private_|. Returns true on success.
+ bool SetCodecPrivate(const uint8* codec_private, uint64 length);
+
+ void set_codec_id(const char* codec_id);
+ const char* codec_id() const { return codec_id_; }
+ const uint8* codec_private() const { return codec_private_; }
+ void set_language(const char* language);
+ const char* language() const { return language_; }
+ void set_max_block_additional_id(uint64 max_block_additional_id) {
+ max_block_additional_id_ = max_block_additional_id;
+ }
+ uint64 max_block_additional_id() const { return max_block_additional_id_; }
+ void set_name(const char* name);
+ const char* name() const { return name_; }
+ void set_number(uint64 number) { number_ = number; }
+ uint64 number() const { return number_; }
+ void set_type(uint64 type) { type_ = type; }
+ uint64 type() const { return type_; }
+ void set_uid(uint64 uid) { uid_ = uid; }
+ uint64 uid() const { return uid_; }
+ void set_codec_delay(uint64 codec_delay) { codec_delay_ = codec_delay; }
+ uint64 codec_delay() const { return codec_delay_; }
+ void set_seek_pre_roll(uint64 seek_pre_roll) {
+ seek_pre_roll_ = seek_pre_roll;
+ }
+ uint64 seek_pre_roll() const { return seek_pre_roll_; }
+
+ uint64 codec_private_length() const { return codec_private_length_; }
+ uint32 content_encoding_entries_size() const {
+ return content_encoding_entries_size_;
+ }
+
+ private:
+ // Track element names
+ char* codec_id_;
+ uint8* codec_private_;
+ char* language_;
+ uint64 max_block_additional_id_;
+ char* name_;
+ uint64 number_;
+ uint64 type_;
+ uint64 uid_;
+ uint64 codec_delay_;
+ uint64 seek_pre_roll_;
+
+ // Size of the CodecPrivate data in bytes.
+ uint64 codec_private_length_;
+
+ // ContentEncoding element list.
+ ContentEncoding** content_encoding_entries_;
+
+ // Number of ContentEncoding elements added.
+ uint32 content_encoding_entries_size_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Track);
+};
+
+///////////////////////////////////////////////////////////////
+// Track that has video specific elements.
+class VideoTrack : public Track {
+ public:
+ // Supported modes for stereo 3D.
+ enum StereoMode {
+ kMono = 0,
+ kSideBySideLeftIsFirst = 1,
+ kTopBottomRightIsFirst = 2,
+ kTopBottomLeftIsFirst = 3,
+ kSideBySideRightIsFirst = 11
+ };
+
+ enum AlphaMode {
+ kNoAlpha = 0,
+ kAlpha = 1
+ };
+
+ // The |seed| parameter is used to synthesize a UID for the track.
+ explicit VideoTrack(unsigned int* seed);
+ virtual ~VideoTrack();
+
+ // Returns the size in bytes for the payload of the Track element plus the
+ // video specific elements.
+ virtual uint64 PayloadSize() const;
+
+ // Output the VideoTrack element to the writer. Returns true on success.
+ virtual bool Write(IMkvWriter* writer) const;
+
+ // Sets the video's stereo mode. Returns true on success.
+ bool SetStereoMode(uint64 stereo_mode);
+
+ // Sets the video's alpha mode. Returns true on success.
+ bool SetAlphaMode(uint64 alpha_mode);
+
+ void set_display_height(uint64 height) { display_height_ = height; }
+ uint64 display_height() const { return display_height_; }
+ void set_display_width(uint64 width) { display_width_ = width; }
+ uint64 display_width() const { return display_width_; }
+ void set_frame_rate(double frame_rate) { frame_rate_ = frame_rate; }
+ double frame_rate() const { return frame_rate_; }
+ void set_height(uint64 height) { height_ = height; }
+ uint64 height() const { return height_; }
+ uint64 stereo_mode() { return stereo_mode_; }
+ uint64 alpha_mode() { return alpha_mode_; }
+ void set_width(uint64 width) { width_ = width; }
+ uint64 width() const { return width_; }
+
+ private:
+ // Returns the size in bytes of the Video element.
+ uint64 VideoPayloadSize() const;
+
+ // Video track element names.
+ uint64 display_height_;
+ uint64 display_width_;
+ double frame_rate_;
+ uint64 height_;
+ uint64 stereo_mode_;
+ uint64 alpha_mode_;
+ uint64 width_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(VideoTrack);
+};
+
+///////////////////////////////////////////////////////////////
+// Track that has audio specific elements.
+class AudioTrack : public Track {
+ public:
+ // The |seed| parameter is used to synthesize a UID for the track.
+ explicit AudioTrack(unsigned int* seed);
+ virtual ~AudioTrack();
+
+ // Returns the size in bytes for the payload of the Track element plus the
+ // audio specific elements.
+ virtual uint64 PayloadSize() const;
+
+ // Output the AudioTrack element to the writer. Returns true on success.
+ virtual bool Write(IMkvWriter* writer) const;
+
+ void set_bit_depth(uint64 bit_depth) { bit_depth_ = bit_depth; }
+ uint64 bit_depth() const { return bit_depth_; }
+ void set_channels(uint64 channels) { channels_ = channels; }
+ uint64 channels() const { return channels_; }
+ void set_sample_rate(double sample_rate) { sample_rate_ = sample_rate; }
+ double sample_rate() const { return sample_rate_; }
+
+ private:
+ // Audio track element names.
+ uint64 bit_depth_;
+ uint64 channels_;
+ double sample_rate_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(AudioTrack);
+};
+
+///////////////////////////////////////////////////////////////
+// Tracks element
+class Tracks {
+ public:
+ // Audio and video type defined by the Matroska specs.
+ enum {
+ kVideo = 0x1,
+ kAudio = 0x2
+ };
+ // Opus, Vorbis, VP8, and VP9 codec ids defined by the Matroska specs.
+ static const char kOpusCodecId[];
+ static const char kVorbisCodecId[];
+ static const char kVp8CodecId[];
+ static const char kVp9CodecId[];
+
+ Tracks();
+ ~Tracks();
+
+ // Adds a Track element to the Tracks object. |track| will be owned and
+ // deleted by the Tracks object. Returns true on success. |number| is the
+ // number to use for the track. |number| must be >= 0. If |number| == 0
+ // then the muxer will decide on the track number.
+ bool AddTrack(Track* track, int32 number);
+
+ // Returns the track by index. Returns NULL if there is no track match.
+ const Track* GetTrackByIndex(uint32 idx) const;
+
+ // Search the Tracks and return the track that matches |tn|. Returns NULL
+ // if there is no track match.
+ Track* GetTrackByNumber(uint64 track_number) const;
+
+ // Returns true if the track number is an audio track.
+ bool TrackIsAudio(uint64 track_number) const;
+
+ // Returns true if the track number is a video track.
+ bool TrackIsVideo(uint64 track_number) const;
+
+ // Output the Tracks element to the writer. Returns true on success.
+ bool Write(IMkvWriter* writer) const;
+
+ uint32 track_entries_size() const { return track_entries_size_; }
+
+ private:
+ // Track element list.
+ Track** track_entries_;
+
+ // Number of Track elements added.
+ uint32 track_entries_size_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Tracks);
+};
+
+///////////////////////////////////////////////////////////////
+// Chapter element
+//
+class Chapter {
+ public:
+ // Set the identifier for this chapter. (This corresponds to the
+ // Cue Identifier line in WebVTT.)
+ // TODO(matthewjheaney): the actual serialization of this item in
+ // MKV is pending.
+ bool set_id(const char* id);
+
+ // Converts the nanosecond start and stop times of this chapter to
+ // their corresponding timecode values, and stores them that way.
+ void set_time(const Segment& segment,
+ uint64 start_time_ns,
+ uint64 end_time_ns);
+
+ // Sets the uid for this chapter. Primarily used to enable
+ // deterministic output from the muxer.
+ void set_uid(const uint64 uid) { uid_ = uid; }
+
+ // Add a title string to this chapter, per the semantics described
+ // here:
+ // http://www.matroska.org/technical/specs/index.html
+ //
+ // The title ("chapter string") is a UTF-8 string.
+ //
+ // The language has ISO 639-2 representation, described here:
+ // http://www.loc.gov/standards/iso639-2/englangn.html
+ // http://www.loc.gov/standards/iso639-2/php/English_list.php
+ // If you specify NULL as the language value, this implies
+ // English ("eng").
+ //
+ // The country value corresponds to the codes listed here:
+ // http://www.iana.org/domains/root/db/
+ //
+ // The function returns false if the string could not be allocated.
+ bool add_string(const char* title,
+ const char* language,
+ const char* country);
+
+ private:
+ friend class Chapters;
+
+ // For storage of chapter titles that differ by language.
+ class Display {
+ public:
+ // Establish representation invariant for new Display object.
+ void Init();
+
+ // Reclaim resources, in anticipation of destruction.
+ void Clear();
+
+ // Copies the title to the |title_| member. Returns false on
+ // error.
+ bool set_title(const char* title);
+
+ // Copies the language to the |language_| member. Returns false
+ // on error.
+ bool set_language(const char* language);
+
+ // Copies the country to the |country_| member. Returns false on
+ // error.
+ bool set_country(const char* country);
+
+ // If |writer| is non-NULL, serialize the Display sub-element of
+ // the Atom into the stream. Returns the Display element size on
+ // success, 0 if error.
+ uint64 WriteDisplay(IMkvWriter* writer) const;
+
+ private:
+ char* title_;
+ char* language_;
+ char* country_;
+ };
+
+ Chapter();
+ ~Chapter();
+
+ // Establish the representation invariant for a newly-created
+ // Chapter object. The |seed| parameter is used to create the UID
+ // for this chapter atom.
+ void Init(unsigned int* seed);
+
+ // Copies this Chapter object to a different one. This is used when
+ // expanding a plain array of Chapter objects (see Chapters).
+ void ShallowCopy(Chapter* dst) const;
+
+ // Reclaim resources used by this Chapter object, pending its
+ // destruction.
+ void Clear();
+
+ // If there is no storage remaining on the |displays_| array for a
+ // new display object, creates a new, longer array and copies the
+ // existing Display objects to the new array. Returns false if the
+ // array cannot be expanded.
+ bool ExpandDisplaysArray();
+
+ // If |writer| is non-NULL, serialize the Atom sub-element into the
+ // stream. Returns the total size of the element on success, 0 if
+ // error.
+ uint64 WriteAtom(IMkvWriter* writer) const;
+
+ // The string identifier for this chapter (corresponds to WebVTT cue
+ // identifier).
+ char* id_;
+
+ // Start timecode of the chapter.
+ uint64 start_timecode_;
+
+ // Stop timecode of the chapter.
+ uint64 end_timecode_;
+
+ // The binary identifier for this chapter.
+ uint64 uid_;
+
+ // The Atom element can contain multiple Display sub-elements, as
+ // the same logical title can be rendered in different languages.
+ Display* displays_;
+
+ // The physical length (total size) of the |displays_| array.
+ int displays_size_;
+
+ // The logical length (number of active elements) on the |displays_|
+ // array.
+ int displays_count_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Chapter);
+};
+
+///////////////////////////////////////////////////////////////
+// Chapters element
+//
+class Chapters {
+ public:
+ Chapters();
+ ~Chapters();
+
+ Chapter* AddChapter(unsigned int* seed);
+
+ // Returns the number of chapters that have been added.
+ int Count() const;
+
+ // Output the Chapters element to the writer. Returns true on success.
+ bool Write(IMkvWriter* writer) const;
+
+ private:
+ // Expands the chapters_ array if there is not enough space to contain
+ // another chapter object. Returns true on success.
+ bool ExpandChaptersArray();
+
+ // If |writer| is non-NULL, serialize the Edition sub-element of the
+ // Chapters element into the stream. Returns the Edition element
+ // size on success, 0 if error.
+ uint64 WriteEdition(IMkvWriter* writer) const;
+
+ // Total length of the chapters_ array.
+ int chapters_size_;
+
+ // Number of active chapters on the chapters_ array.
+ int chapters_count_;
+
+ // Array for storage of chapter objects.
+ Chapter* chapters_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Chapters);
+};
+
+///////////////////////////////////////////////////////////////
+// Cluster element
+//
+// Notes:
+// |Init| must be called before any other method in this class.
+class Cluster {
+ public:
+ Cluster(uint64 timecode, int64 cues_pos);
+ ~Cluster();
+
+ // |timecode| is the absolute timecode of the cluster. |cues_pos| is the
+ // position for the cluster within the segment that should be written in
+ // the cues element.
+ bool Init(IMkvWriter* ptr_writer);
+
+ // Adds a frame to be output in the file. The frame is written out through
+ // |writer_| if successful. Returns true on success.
+ // Inputs:
+ // frame: Pointer to the data
+ // length: Length of the data
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions. The range of allowed values is [1, 126].
+ // timecode: Absolute (not relative to cluster) timestamp of the
+ // frame, expressed in timecode units.
+ // is_key: Flag telling whether or not this frame is a key frame.
+ bool AddFrame(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 timecode, // timecode units (absolute)
+ bool is_key);
+
+ // Adds a frame to be output in the file. The frame is written out through
+ // |writer_| if successful. Returns true on success.
+ // Inputs:
+ // frame: Pointer to the data
+ // length: Length of the data
+ // additional: Pointer to the additional data
+ // additional_length: Length of the additional data
+ // add_id: Value of BlockAddID element
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions. The range of allowed values is [1, 126].
+ // abs_timecode: Absolute (not relative to cluster) timestamp of the
+ // frame, expressed in timecode units.
+ // is_key: Flag telling whether or not this frame is a key frame.
+ bool AddFrameWithAdditional(const uint8* frame,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ uint64 abs_timecode,
+ bool is_key);
+
+ // Adds a frame to be output in the file. The frame is written out through
+ // |writer_| if successful. Returns true on success.
+ // Inputs:
+ // frame: Pointer to the data.
+ // length: Length of the data.
+ // discard_padding: DiscardPadding element value.
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions. The range of allowed values is [1, 126].
+ // abs_timecode: Absolute (not relative to cluster) timestamp of the
+ // frame, expressed in timecode units.
+ // is_key: Flag telling whether or not this frame is a key frame.
+ bool AddFrameWithDiscardPadding(const uint8* frame,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ uint64 abs_timecode,
+ bool is_key);
+
+ // Writes a frame of metadata to the output medium; returns true on
+ // success.
+ // Inputs:
+ // frame: Pointer to the data
+ // length: Length of the data
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions. The range of allowed values is [1, 126].
+ // timecode: Absolute (not relative to cluster) timestamp of the
+ // metadata frame, expressed in timecode units.
+ // duration: Duration of metadata frame, in timecode units.
+ //
+ // The metadata frame is written as a block group, with a duration
+ // sub-element but no reference time sub-elements (indicating that
+ // it is considered a keyframe, per Matroska semantics).
+ bool AddMetadata(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 timecode, // timecode units (absolute)
+ uint64 duration); // timecode units
+
+ // Increments the size of the cluster's data in bytes.
+ void AddPayloadSize(uint64 size);
+
+ // Closes the cluster so no more data can be written to it. Will update the
+ // cluster's size if |writer_| is seekable. Returns true on success.
+ bool Finalize();
+
+ // Returns the size in bytes for the entire Cluster element.
+ uint64 Size() const;
+
+ int64 size_position() const { return size_position_; }
+ int32 blocks_added() const { return blocks_added_; }
+ uint64 payload_size() const { return payload_size_; }
+ int64 position_for_cues() const { return position_for_cues_; }
+ uint64 timecode() const { return timecode_; }
+
+ private:
+ // Signature that matches either of WriteSimpleBlock or WriteMetadataBlock
+ // in the muxer utilities package.
+ typedef uint64 (*WriteBlock)(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ uint64 track_number,
+ int64 timecode,
+ uint64 generic_arg);
+
+ // Signature that matches WriteBlockWithAdditional
+ // in the muxer utilities package.
+ typedef uint64 (*WriteBlockAdditional)(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ const uint8* additional,
+ uint64 add_id,
+ uint64 additional_length,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key);
+
+ // Signature that matches WriteBlockWithDiscardPadding
+ // in the muxer utilities package.
+ typedef uint64 (*WriteBlockDiscardPadding)(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key);
+
+ // Utility method that confirms that blocks can still be added, and that the
+ // cluster header has been written. Used by |DoWriteBlock*|. Returns true
+ // when successful.
+ template <typename Type>
+ bool PreWriteBlock(Type* write_function);
+
+ // Utility method used by the |DoWriteBlock*| methods that handles the book
+ // keeping required after each block is written.
+ void PostWriteBlock(uint64 element_size);
+
+ // To simplify things, we require that there be fewer than 127
+ // tracks -- this allows us to serialize the track number value for
+ // a stream using a single byte, per the Matroska encoding.
+ bool IsValidTrackNumber(uint64 track_number) const;
+
+ // Given |abs_timecode|, calculates timecode relative to most recent timecode.
+ // Returns -1 on failure, or a relative timecode.
+ int64 GetRelativeTimecode(int64 abs_timecode) const;
+
+ // Used to implement AddFrame and AddMetadata.
+ bool DoWriteBlock(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 absolute_timecode,
+ uint64 generic_arg,
+ WriteBlock write_block);
+
+ // Used to implement AddFrameWithAdditional
+ bool DoWriteBlockWithAdditional(const uint8* frame,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ uint64 absolute_timecode,
+ uint64 generic_arg,
+ WriteBlockAdditional write_block);
+
+ // Used to implement AddFrameWithDiscardPadding
+ bool DoWriteBlockWithDiscardPadding(const uint8* frame,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ uint64 absolute_timecode,
+ uint64 generic_arg,
+ WriteBlockDiscardPadding write_block);
+
+ // Outputs the Cluster header to |writer_|. Returns true on success.
+ bool WriteClusterHeader();
+
+ // Number of blocks added to the cluster.
+ int32 blocks_added_;
+
+ // Flag telling if the cluster has been closed.
+ bool finalized_;
+
+ // Flag telling if the cluster's header has been written.
+ bool header_written_;
+
+ // The size of the cluster elements in bytes.
+ uint64 payload_size_;
+
+ // The file position used for cue points.
+ const int64 position_for_cues_;
+
+ // The file position of the cluster's size element.
+ int64 size_position_;
+
+ // The absolute timecode of the cluster.
+ const uint64 timecode_;
+
+ // Pointer to the writer object. Not owned by this class.
+ IMkvWriter* writer_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Cluster);
+};
+
+///////////////////////////////////////////////////////////////
+// SeekHead element
+class SeekHead {
+ public:
+ SeekHead();
+ ~SeekHead();
+
+ // TODO(fgalligan): Change this to reserve a certain size. Then check how
+ // big the seek entry to be added is as not every seek entry will be the
+ // maximum size it could be.
+ // Adds a seek entry to be written out when the element is finalized. |id|
+ // must be the coded mkv element id. |pos| is the file position of the
+ // element. Returns true on success.
+ bool AddSeekEntry(uint32 id, uint64 pos);
+
+ // Writes out SeekHead and SeekEntry elements. Returns true on success.
+ bool Finalize(IMkvWriter* writer) const;
+
+ // Returns the id of the Seek Entry at the given index. Returns -1 if index is
+ // out of range.
+ uint32 GetId(int index) const;
+
+ // Returns the position of the Seek Entry at the given index. Returns -1 if
+ // index is out of range.
+ uint64 GetPosition(int index) const;
+
+ // Sets the Seek Entry id and position at given index.
+ // Returns true on success.
+ bool SetSeekEntry(int index, uint32 id, uint64 position);
+
+ // Reserves space by writing out a Void element which will be updated with
+ // a SeekHead element later. Returns true on success.
+ bool Write(IMkvWriter* writer);
+
+ // We are going to put a cap on the number of Seek Entries.
+ const static int32 kSeekEntryCount = 5;
+
+ private:
+ // Returns the maximum size in bytes of one seek entry.
+ uint64 MaxEntrySize() const;
+
+ // Seek entry id element list.
+ uint32 seek_entry_id_[kSeekEntryCount];
+
+ // Seek entry pos element list.
+ uint64 seek_entry_pos_[kSeekEntryCount];
+
+ // The file position of SeekHead element.
+ int64 start_pos_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(SeekHead);
+};
+
+///////////////////////////////////////////////////////////////
+// Segment Information element
+class SegmentInfo {
+ public:
+ SegmentInfo();
+ ~SegmentInfo();
+
+ // Will update the duration if |duration_| is > 0.0. Returns true on success.
+ bool Finalize(IMkvWriter* writer) const;
+
+ // Sets |muxing_app_| and |writing_app_|.
+ bool Init();
+
+ // Output the Segment Information element to the writer. Returns true on
+ // success.
+ bool Write(IMkvWriter* writer);
+
+ void set_duration(double duration) { duration_ = duration; }
+ double duration() const { return duration_; }
+ void set_muxing_app(const char* app);
+ const char* muxing_app() const { return muxing_app_; }
+ void set_timecode_scale(uint64 scale) { timecode_scale_ = scale; }
+ uint64 timecode_scale() const { return timecode_scale_; }
+ void set_writing_app(const char* app);
+ const char* writing_app() const { return writing_app_; }
+
+ private:
+ // Segment Information element names.
+ // Initially set to -1 to signify that a duration has not been set and should
+ // not be written out.
+ double duration_;
+ // Set to libwebm-%d.%d.%d.%d, major, minor, build, revision.
+ char* muxing_app_;
+ uint64 timecode_scale_;
+ // Initially set to libwebm-%d.%d.%d.%d, major, minor, build, revision.
+ char* writing_app_;
+
+ // The file position of the duration element.
+ int64 duration_pos_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(SegmentInfo);
+};
+
+///////////////////////////////////////////////////////////////
+// This class represents the main segment in a WebM file. Currently only
+// supports one Segment element.
+//
+// Notes:
+// |Init| must be called before any other method in this class.
+class Segment {
+ public:
+ enum Mode {
+ kLive = 0x1,
+ kFile = 0x2
+ };
+
+ enum CuesPosition {
+ kAfterClusters = 0x0, // Position Cues after Clusters - Default
+ kBeforeClusters = 0x1 // Position Cues before Clusters
+ };
+
+ const static uint64 kDefaultMaxClusterDuration = 30000000000ULL;
+
+ Segment();
+ ~Segment();
+
+ // Initializes |SegmentInfo| and returns result. Always returns false when
+ // |ptr_writer| is NULL.
+ bool Init(IMkvWriter* ptr_writer);
+
+ // Adds a generic track to the segment. Returns the newly-allocated
+ // track object (which is owned by the segment) on success, NULL on
+ // error. |number| is the number to use for the track. |number|
+ // must be >= 0. If |number| == 0 then the muxer will decide on the
+ // track number.
+ Track* AddTrack(int32 number);
+
+ // Adds a Vorbis audio track to the segment. Returns the number of the track
+ // on success, 0 on error. |number| is the number to use for the audio track.
+ // |number| must be >= 0. If |number| == 0 then the muxer will decide on
+ // the track number.
+ uint64 AddAudioTrack(int32 sample_rate, int32 channels, int32 number);
+
+ // Adds an empty chapter to the chapters of this segment. Returns
+ // non-NULL on success. After adding the chapter, the caller should
+ // populate its fields via the Chapter member functions.
+ Chapter* AddChapter();
+
+ // Adds a cue point to the Cues element. |timestamp| is the time in
+ // nanoseconds of the cue's time. |track| is the Track of the Cue. This
+ // function must be called after AddFrame to calculate the correct
+ // BlockNumber for the CuePoint. Returns true on success.
+ bool AddCuePoint(uint64 timestamp, uint64 track);
+
+ // Adds a frame to be output in the file. Returns true on success.
+ // Inputs:
+ // frame: Pointer to the data
+ // length: Length of the data
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions.
+ // timestamp: Timestamp of the frame in nanoseconds from 0.
+ // is_key: Flag telling whether or not this frame is a key frame.
+ bool AddFrame(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 timestamp_ns,
+ bool is_key);
+
+ // Writes a frame of metadata to the output medium; returns true on
+ // success.
+ // Inputs:
+ // frame: Pointer to the data
+ // length: Length of the data
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions.
+ // timecode: Absolute timestamp of the metadata frame, expressed
+ // in nanosecond units.
+ // duration: Duration of metadata frame, in nanosecond units.
+ //
+ // The metadata frame is written as a block group, with a duration
+ // sub-element but no reference time sub-elements (indicating that
+ // it is considered a keyframe, per Matroska semantics).
+ bool AddMetadata(const uint8* frame,
+ uint64 length,
+ uint64 track_number,
+ uint64 timestamp_ns,
+ uint64 duration_ns);
+
+ // Writes a frame with additional data to the output medium; returns true on
+ // success.
+ // Inputs:
+ // frame: Pointer to the data.
+ // length: Length of the data.
+ // additional: Pointer to additional data.
+ // additional_length: Length of additional data.
+ // add_id: Additional ID which identifies the type of additional data.
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions.
+ // timestamp: Absolute timestamp of the frame, expressed in nanosecond
+ // units.
+ // is_key: Flag telling whether or not this frame is a key frame.
+ bool AddFrameWithAdditional(const uint8* frame,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ uint64 timestamp,
+ bool is_key);
+
+ // Writes a frame with DiscardPadding to the output medium; returns true on
+ // success.
+ // Inputs:
+ // frame: Pointer to the data.
+ // length: Length of the data.
+ // discard_padding: DiscardPadding element value.
+ // track_number: Track to add the data to. Value returned by Add track
+ // functions.
+ // timestamp: Absolute timestamp of the frame, expressed in nanosecond
+ // units.
+ // is_key: Flag telling whether or not this frame is a key frame.
+ bool AddFrameWithDiscardPadding(const uint8* frame,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ uint64 timestamp,
+ bool is_key);
+
+ // Writes a Frame to the output medium. Chooses the correct way of writing
+ // the frame (Block vs SimpleBlock) based on the parameters passed.
+ // Inputs:
+ // frame: frame object
+ bool AddGenericFrame(const Frame* frame);
+
+ // Adds a VP8 video track to the segment. Returns the number of the track on
+ // success, 0 on error. |number| is the number to use for the video track.
+ // |number| must be >= 0. If |number| == 0 then the muxer will decide on
+ // the track number.
+ uint64 AddVideoTrack(int32 width, int32 height, int32 number);
+
+ // This function must be called after Finalize() if you need a copy of the
+ // output with Cues written before the Clusters. It will return false if the
+ // writer is not seekable of if chunking is set to true.
+ // Input parameters:
+ // reader - an IMkvReader object created with the same underlying file of the
+ // current writer object. Make sure to close the existing writer
+ // object before creating this so that all the data is properly
+ // flushed and available for reading.
+ // writer - an IMkvWriter object pointing to a *different* file than the one
+ // pointed by the current writer object. This file will contain the
+ // Cues element before the Clusters.
+ bool CopyAndMoveCuesBeforeClusters(mkvparser::IMkvReader* reader,
+ IMkvWriter* writer);
+
+ // Sets which track to use for the Cues element. Must have added the track
+ // before calling this function. Returns true on success. |track_number| is
+ // returned by the Add track functions.
+ bool CuesTrack(uint64 track_number);
+
+ // This will force the muxer to create a new Cluster when the next frame is
+ // added.
+ void ForceNewClusterOnNextFrame();
+
+ // Writes out any frames that have not been written out. Finalizes the last
+ // cluster. May update the size and duration of the segment. May output the
+ // Cues element. May finalize the SeekHead element. Returns true on success.
+ bool Finalize();
+
+ // Returns the Cues object.
+ Cues* GetCues() { return &cues_; }
+
+ // Returns the Segment Information object.
+ const SegmentInfo* GetSegmentInfo() const { return &segment_info_; }
+ SegmentInfo* GetSegmentInfo() { return &segment_info_; }
+
+ // Search the Tracks and return the track that matches |track_number|.
+ // Returns NULL if there is no track match.
+ Track* GetTrackByNumber(uint64 track_number) const;
+
+ // Toggles whether to output a cues element.
+ void OutputCues(bool output_cues);
+
+ // Sets if the muxer will output files in chunks or not. |chunking| is a
+ // flag telling whether or not to turn on chunking. |filename| is the base
+ // filename for the chunk files. The header chunk file will be named
+ // |filename|.hdr and the data chunks will be named
+ // |filename|_XXXXXX.chk. Chunking implies that the muxer will be writing
+ // to files so the muxer will use the default MkvWriter class to control
+ // what data is written to what files. Returns true on success.
+ // TODO: Should we change the IMkvWriter Interface to add Open and Close?
+ // That will force the interface to be dependent on files.
+ bool SetChunking(bool chunking, const char* filename);
+
+ bool chunking() const { return chunking_; }
+ uint64 cues_track() const { return cues_track_; }
+ void set_max_cluster_duration(uint64 max_cluster_duration) {
+ max_cluster_duration_ = max_cluster_duration;
+ }
+ uint64 max_cluster_duration() const { return max_cluster_duration_; }
+ void set_max_cluster_size(uint64 max_cluster_size) {
+ max_cluster_size_ = max_cluster_size;
+ }
+ uint64 max_cluster_size() const { return max_cluster_size_; }
+ void set_mode(Mode mode) { mode_ = mode; }
+ Mode mode() const { return mode_; }
+ CuesPosition cues_position() const { return cues_position_; }
+ bool output_cues() const { return output_cues_; }
+ const SegmentInfo* segment_info() const { return &segment_info_; }
+
+ private:
+ // Checks if header information has been output and initialized. If not it
+ // will output the Segment element and initialize the SeekHead elment and
+ // Cues elements.
+ bool CheckHeaderInfo();
+
+ // Sets |name| according to how many chunks have been written. |ext| is the
+ // file extension. |name| must be deleted by the calling app. Returns true
+ // on success.
+ bool UpdateChunkName(const char* ext, char** name) const;
+
+ // Returns the maximum offset within the segment's payload. When chunking
+ // this function is needed to determine offsets of elements within the
+ // chunked files. Returns -1 on error.
+ int64 MaxOffset();
+
+ // Adds the frame to our frame array.
+ bool QueueFrame(Frame* frame);
+
+ // Output all frames that are queued. Returns -1 on error, otherwise
+ // it returns the number of frames written.
+ int WriteFramesAll();
+
+ // Output all frames that are queued that have an end time that is less
+ // then |timestamp|. Returns true on success and if there are no frames
+ // queued.
+ bool WriteFramesLessThan(uint64 timestamp);
+
+ // Outputs the segment header, Segment Information element, SeekHead element,
+ // and Tracks element to |writer_|.
+ bool WriteSegmentHeader();
+
+ // Given a frame with the specified timestamp (nanosecond units) and
+ // keyframe status, determine whether a new cluster should be
+ // created, before writing enqueued frames and the frame itself. The
+ // function returns one of the following values:
+ // -1 = error: an out-of-order frame was detected
+ // 0 = do not create a new cluster, and write frame to the existing cluster
+ // 1 = create a new cluster, and write frame to that new cluster
+ // 2 = create a new cluster, and re-run test
+ int TestFrame(uint64 track_num, uint64 timestamp_ns, bool key) const;
+
+ // Create a new cluster, using the earlier of the first enqueued
+ // frame, or the indicated time. Returns true on success.
+ bool MakeNewCluster(uint64 timestamp_ns);
+
+ // Checks whether a new cluster needs to be created, and if so
+ // creates a new cluster. Returns false if creation of a new cluster
+ // was necessary but creation was not successful.
+ bool DoNewClusterProcessing(uint64 track_num, uint64 timestamp_ns, bool key);
+
+
+ // Adjusts Cue Point values (to place Cues before Clusters) so that they
+ // reflect the correct offsets.
+ void MoveCuesBeforeClusters();
+
+ // This function recursively computes the correct cluster offsets (this is
+ // done to move the Cues before Clusters). It recursively updates the change
+ // in size (which indicates a change in cluster offset) until no sizes change.
+ // Parameters:
+ // diff - indicates the difference in size of the Cues element that needs to
+ // accounted for.
+ // index - index in the list of Cues which is currently being adjusted.
+ // cue_size - size of the Cues element.
+ void MoveCuesBeforeClustersHelper(uint64 diff, int index, uint64* cue_size);
+
+ // Seeds the random number generator used to make UIDs.
+ unsigned int seed_;
+
+ // WebM elements
+ Cues cues_;
+ SeekHead seek_head_;
+ SegmentInfo segment_info_;
+ Tracks tracks_;
+ Chapters chapters_;
+
+ // Number of chunks written.
+ int chunk_count_;
+
+ // Current chunk filename.
+ char* chunk_name_;
+
+ // Default MkvWriter object created by this class used for writing clusters
+ // out in separate files.
+ MkvWriter* chunk_writer_cluster_;
+
+ // Default MkvWriter object created by this class used for writing Cues
+ // element out to a file.
+ MkvWriter* chunk_writer_cues_;
+
+ // Default MkvWriter object created by this class used for writing the
+ // Matroska header out to a file.
+ MkvWriter* chunk_writer_header_;
+
+ // Flag telling whether or not the muxer is chunking output to multiple
+ // files.
+ bool chunking_;
+
+ // Base filename for the chunked files.
+ char* chunking_base_name_;
+
+ // File position offset where the Clusters end.
+ int64 cluster_end_offset_;
+
+ // List of clusters.
+ Cluster** cluster_list_;
+
+ // Number of cluster pointers allocated in the cluster list.
+ int32 cluster_list_capacity_;
+
+ // Number of clusters in the cluster list.
+ int32 cluster_list_size_;
+
+ // Indicates whether Cues should be written before or after Clusters
+ CuesPosition cues_position_;
+
+ // Track number that is associated with the cues element for this segment.
+ uint64 cues_track_;
+
+ // Tells the muxer to force a new cluster on the next Block.
+ bool force_new_cluster_;
+
+ // List of stored audio frames. These variables are used to store frames so
+ // the muxer can follow the guideline "Audio blocks that contain the video
+ // key frame's timecode should be in the same cluster as the video key frame
+ // block."
+ Frame** frames_;
+
+ // Number of frame pointers allocated in the frame list.
+ int32 frames_capacity_;
+
+ // Number of frames in the frame list.
+ int32 frames_size_;
+
+ // Flag telling if a video track has been added to the segment.
+ bool has_video_;
+
+ // Flag telling if the segment's header has been written.
+ bool header_written_;
+
+ // Duration of the last block in nanoseconds.
+ uint64 last_block_duration_;
+
+ // Last timestamp in nanoseconds added to a cluster.
+ uint64 last_timestamp_;
+
+ // Maximum time in nanoseconds for a cluster duration. This variable is a
+ // guideline and some clusters may have a longer duration. Default is 30
+ // seconds.
+ uint64 max_cluster_duration_;
+
+ // Maximum size in bytes for a cluster. This variable is a guideline and
+ // some clusters may have a larger size. Default is 0 which signifies that
+ // the muxer will decide the size.
+ uint64 max_cluster_size_;
+
+ // The mode that segment is in. If set to |kLive| the writer must not
+ // seek backwards.
+ Mode mode_;
+
+ // Flag telling the muxer that a new cue point should be added.
+ bool new_cuepoint_;
+
+ // TODO(fgalligan): Should we add support for more than one Cues element?
+ // Flag whether or not the muxer should output a Cues element.
+ bool output_cues_;
+
+ // The file position of the segment's payload.
+ int64 payload_pos_;
+
+ // The file position of the element's size.
+ int64 size_position_;
+
+ // Pointer to the writer objects. Not owned by this class.
+ IMkvWriter* writer_cluster_;
+ IMkvWriter* writer_cues_;
+ IMkvWriter* writer_header_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(Segment);
+};
+
+} //end namespace mkvmuxer
+
+#endif //MKVMUXER_HPP
diff --git a/libvpx/third_party/libwebm/mkvmuxertypes.hpp b/libvpx/third_party/libwebm/mkvmuxertypes.hpp
new file mode 100644
index 0000000..2c66fd2
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvmuxertypes.hpp
@@ -0,0 +1,30 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef MKVMUXERTYPES_HPP
+#define MKVMUXERTYPES_HPP
+
+// Copied from Chromium basictypes.h
+// A macro to disallow the copy constructor and operator= functions
+// This should be used in the private: declarations for a class
+#define LIBWEBM_DISALLOW_COPY_AND_ASSIGN(TypeName) \
+ TypeName(const TypeName&); \
+ void operator=(const TypeName&)
+
+namespace mkvmuxer {
+
+typedef unsigned char uint8;
+typedef short int16;
+typedef int int32;
+typedef unsigned int uint32;
+typedef long long int64;
+typedef unsigned long long uint64;
+
+} //end namespace mkvmuxer
+
+#endif // MKVMUXERTYPES_HPP
diff --git a/libvpx/third_party/libwebm/mkvmuxerutil.cpp b/libvpx/third_party/libwebm/mkvmuxerutil.cpp
new file mode 100644
index 0000000..96350e9
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvmuxerutil.cpp
@@ -0,0 +1,713 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#include "mkvmuxerutil.hpp"
+
+#ifdef __ANDROID__
+#include <fcntl.h>
+#endif
+
+#include <cassert>
+#include <cmath>
+#include <cstdio>
+#ifdef _MSC_VER
+#define _CRT_RAND_S
+#endif
+#include <cstdlib>
+#include <cstring>
+#include <ctime>
+
+#include <new>
+
+#include "mkvwriter.hpp"
+#include "webmids.hpp"
+
+namespace mkvmuxer {
+
+int32 GetCodedUIntSize(uint64 value) {
+ if (value < 0x000000000000007FULL)
+ return 1;
+ else if (value < 0x0000000000003FFFULL)
+ return 2;
+ else if (value < 0x00000000001FFFFFULL)
+ return 3;
+ else if (value < 0x000000000FFFFFFFULL)
+ return 4;
+ else if (value < 0x00000007FFFFFFFFULL)
+ return 5;
+ else if (value < 0x000003FFFFFFFFFFULL)
+ return 6;
+ else if (value < 0x0001FFFFFFFFFFFFULL)
+ return 7;
+ return 8;
+}
+
+int32 GetUIntSize(uint64 value) {
+ if (value < 0x0000000000000100ULL)
+ return 1;
+ else if (value < 0x0000000000010000ULL)
+ return 2;
+ else if (value < 0x0000000001000000ULL)
+ return 3;
+ else if (value < 0x0000000100000000ULL)
+ return 4;
+ else if (value < 0x0000010000000000ULL)
+ return 5;
+ else if (value < 0x0001000000000000ULL)
+ return 6;
+ else if (value < 0x0100000000000000ULL)
+ return 7;
+ return 8;
+}
+
+uint64 EbmlMasterElementSize(uint64 type, uint64 value) {
+ // Size of EBML ID
+ int32 ebml_size = GetUIntSize(type);
+
+ // Datasize
+ ebml_size += GetCodedUIntSize(value);
+
+ return ebml_size;
+}
+
+uint64 EbmlElementSize(uint64 type, int64 value) {
+ return EbmlElementSize(type, static_cast<uint64>(value));
+}
+
+uint64 EbmlElementSize(uint64 type, uint64 value) {
+ // Size of EBML ID
+ int32 ebml_size = GetUIntSize(type);
+
+ // Datasize
+ ebml_size += GetUIntSize(value);
+
+ // Size of Datasize
+ ebml_size++;
+
+ return ebml_size;
+}
+
+uint64 EbmlElementSize(uint64 type, float /* value */ ) {
+ // Size of EBML ID
+ uint64 ebml_size = GetUIntSize(type);
+
+ // Datasize
+ ebml_size += sizeof(float);
+
+ // Size of Datasize
+ ebml_size++;
+
+ return ebml_size;
+}
+
+uint64 EbmlElementSize(uint64 type, const char* value) {
+ if (!value)
+ return 0;
+
+ // Size of EBML ID
+ uint64 ebml_size = GetUIntSize(type);
+
+ // Datasize
+ ebml_size += strlen(value);
+
+ // Size of Datasize
+ ebml_size++;
+
+ return ebml_size;
+}
+
+uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size) {
+ if (!value)
+ return 0;
+
+ // Size of EBML ID
+ uint64 ebml_size = GetUIntSize(type);
+
+ // Datasize
+ ebml_size += size;
+
+ // Size of Datasize
+ ebml_size += GetCodedUIntSize(size);
+
+ return ebml_size;
+}
+
+int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size) {
+ if (!writer || size < 1 || size > 8)
+ return -1;
+
+ for (int32 i = 1; i <= size; ++i) {
+ const int32 byte_count = size - i;
+ const int32 bit_count = byte_count * 8;
+
+ const int64 bb = value >> bit_count;
+ const uint8 b = static_cast<uint8>(bb);
+
+ const int32 status = writer->Write(&b, 1);
+
+ if (status < 0)
+ return status;
+ }
+
+ return 0;
+}
+
+int32 SerializeFloat(IMkvWriter* writer, float f) {
+ if (!writer)
+ return -1;
+
+ assert(sizeof(uint32) == sizeof(float));
+ // This union is merely used to avoid a reinterpret_cast from float& to
+ // uint32& which will result in violation of strict aliasing.
+ union U32 {
+ uint32 u32;
+ float f;
+ } value;
+ value.f = f;
+
+ for (int32 i = 1; i <= 4; ++i) {
+ const int32 byte_count = 4 - i;
+ const int32 bit_count = byte_count * 8;
+
+ const uint8 byte = static_cast<uint8>(value.u32 >> bit_count);
+
+ const int32 status = writer->Write(&byte, 1);
+
+ if (status < 0)
+ return status;
+ }
+
+ return 0;
+}
+
+int32 WriteUInt(IMkvWriter* writer, uint64 value) {
+ if (!writer)
+ return -1;
+
+ int32 size = GetCodedUIntSize(value);
+
+ return WriteUIntSize(writer, value, size);
+}
+
+int32 WriteUIntSize(IMkvWriter* writer, uint64 value, int32 size) {
+ if (!writer || size < 0 || size > 8)
+ return -1;
+
+ if (size > 0) {
+ const uint64 bit = 1LL << (size * 7);
+
+ if (value > (bit - 2))
+ return -1;
+
+ value |= bit;
+ } else {
+ size = 1;
+ int64 bit;
+
+ for (;;) {
+ bit = 1LL << (size * 7);
+ const uint64 max = bit - 2;
+
+ if (value <= max)
+ break;
+
+ ++size;
+ }
+
+ if (size > 8)
+ return false;
+
+ value |= bit;
+ }
+
+ return SerializeInt(writer, value, size);
+}
+
+int32 WriteID(IMkvWriter* writer, uint64 type) {
+ if (!writer)
+ return -1;
+
+ writer->ElementStartNotify(type, writer->Position());
+
+ const int32 size = GetUIntSize(type);
+
+ return SerializeInt(writer, type, size);
+}
+
+bool WriteEbmlMasterElement(IMkvWriter* writer, uint64 type, uint64 size) {
+ if (!writer)
+ return false;
+
+ if (WriteID(writer, type))
+ return false;
+
+ if (WriteUInt(writer, size))
+ return false;
+
+ return true;
+}
+
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value) {
+ if (!writer)
+ return false;
+
+ if (WriteID(writer, type))
+ return false;
+
+ const uint64 size = GetUIntSize(value);
+ if (WriteUInt(writer, size))
+ return false;
+
+ if (SerializeInt(writer, value, static_cast<int32>(size)))
+ return false;
+
+ return true;
+}
+
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value) {
+ if (!writer)
+ return false;
+
+ if (WriteID(writer, type))
+ return false;
+
+ if (WriteUInt(writer, 4))
+ return false;
+
+ if (SerializeFloat(writer, value))
+ return false;
+
+ return true;
+}
+
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value) {
+ if (!writer || !value)
+ return false;
+
+ if (WriteID(writer, type))
+ return false;
+
+ const int32 length = strlen(value);
+ if (WriteUInt(writer, length))
+ return false;
+
+ if (writer->Write(value, length))
+ return false;
+
+ return true;
+}
+
+bool WriteEbmlElement(IMkvWriter* writer,
+ uint64 type,
+ const uint8* value,
+ uint64 size) {
+ if (!writer || !value || size < 1)
+ return false;
+
+ if (WriteID(writer, type))
+ return false;
+
+ if (WriteUInt(writer, size))
+ return false;
+
+ if (writer->Write(value, static_cast<uint32>(size)))
+ return false;
+
+ return true;
+}
+
+uint64 WriteSimpleBlock(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key) {
+ if (!writer)
+ return false;
+
+ if (!data || length < 1)
+ return false;
+
+ // Here we only permit track number values to be no greater than
+ // 126, which the largest value we can store having a Matroska
+ // integer representation of only 1 byte.
+
+ if (track_number < 1 || track_number > 126)
+ return false;
+
+ // Technically the timestamp for a block can be less than the
+ // timestamp for the cluster itself (remember that block timestamp
+ // is a signed, 16-bit integer). However, as a simplification we
+ // only permit non-negative cluster-relative timestamps for blocks.
+
+ if (timecode < 0 || timecode > kMaxBlockTimecode)
+ return false;
+
+ if (WriteID(writer, kMkvSimpleBlock))
+ return 0;
+
+ const int32 size = static_cast<int32>(length) + 4;
+ if (WriteUInt(writer, size))
+ return 0;
+
+ if (WriteUInt(writer, static_cast<uint64>(track_number)))
+ return 0;
+
+ if (SerializeInt(writer, timecode, 2))
+ return 0;
+
+ uint64 flags = 0;
+ if (is_key)
+ flags |= 0x80;
+
+ if (SerializeInt(writer, flags, 1))
+ return 0;
+
+ if (writer->Write(data, static_cast<uint32>(length)))
+ return 0;
+
+ const uint64 element_size =
+ GetUIntSize(kMkvSimpleBlock) + GetCodedUIntSize(size) + 4 + length;
+
+ return element_size;
+}
+
+// We must write the metadata (key)frame as a BlockGroup element,
+// because we need to specify a duration for the frame. The
+// BlockGroup element comprises the frame itself and its duration,
+// and is laid out as follows:
+//
+// BlockGroup tag
+// BlockGroup size
+// Block tag
+// Block size
+// (the frame is the block payload)
+// Duration tag
+// Duration size
+// (duration payload)
+//
+uint64 WriteMetadataBlock(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ uint64 track_number,
+ int64 timecode,
+ uint64 duration) {
+ // We don't backtrack when writing to the stream, so we must
+ // pre-compute the BlockGroup size, by summing the sizes of each
+ // sub-element (the block and the duration).
+
+ // We use a single byte for the track number of the block, which
+ // means the block header is exactly 4 bytes.
+
+ // TODO(matthewjheaney): use EbmlMasterElementSize and WriteEbmlMasterElement
+
+ const uint64 block_payload_size = 4 + length;
+ const int32 block_size = GetCodedUIntSize(block_payload_size);
+ const uint64 block_elem_size = 1 + block_size + block_payload_size;
+
+ const int32 duration_payload_size = GetUIntSize(duration);
+ const int32 duration_size = GetCodedUIntSize(duration_payload_size);
+ const uint64 duration_elem_size = 1 + duration_size + duration_payload_size;
+
+ const uint64 blockg_payload_size = block_elem_size + duration_elem_size;
+ const int32 blockg_size = GetCodedUIntSize(blockg_payload_size);
+ const uint64 blockg_elem_size = 1 + blockg_size + blockg_payload_size;
+
+ if (WriteID(writer, kMkvBlockGroup)) // 1-byte ID size
+ return 0;
+
+ if (WriteUInt(writer, blockg_payload_size))
+ return 0;
+
+ // Write Block element
+
+ if (WriteID(writer, kMkvBlock)) // 1-byte ID size
+ return 0;
+
+ if (WriteUInt(writer, block_payload_size))
+ return 0;
+
+ // Byte 1 of 4
+
+ if (WriteUInt(writer, track_number))
+ return 0;
+
+ // Bytes 2 & 3 of 4
+
+ if (SerializeInt(writer, timecode, 2))
+ return 0;
+
+ // Byte 4 of 4
+
+ const uint64 flags = 0;
+
+ if (SerializeInt(writer, flags, 1))
+ return 0;
+
+ // Now write the actual frame (of metadata)
+
+ if (writer->Write(data, static_cast<uint32>(length)))
+ return 0;
+
+ // Write Duration element
+
+ if (WriteID(writer, kMkvBlockDuration)) // 1-byte ID size
+ return 0;
+
+ if (WriteUInt(writer, duration_payload_size))
+ return 0;
+
+ if (SerializeInt(writer, duration, duration_payload_size))
+ return 0;
+
+ // Note that we don't write a reference time as part of the block
+ // group; no reference time(s) indicates that this block is a
+ // keyframe. (Unlike the case for a SimpleBlock element, the header
+ // bits of the Block sub-element of a BlockGroup element do not
+ // indicate keyframe status. The keyframe status is inferred from
+ // the absence of reference time sub-elements.)
+
+ return blockg_elem_size;
+}
+
+// Writes a WebM BlockGroup with BlockAdditional data. The structure is as
+// follows:
+// Indentation shows sub-levels
+// BlockGroup
+// Block
+// Data
+// BlockAdditions
+// BlockMore
+// BlockAddID
+// 1 (Denotes Alpha)
+// BlockAdditional
+// Data
+uint64 WriteBlockWithAdditional(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key) {
+ if (!data || !additional || length < 1 || additional_length < 1)
+ return 0;
+
+ const uint64 block_payload_size = 4 + length;
+ const uint64 block_elem_size = EbmlMasterElementSize(kMkvBlock,
+ block_payload_size) +
+ block_payload_size;
+ const uint64 block_additional_elem_size = EbmlElementSize(kMkvBlockAdditional,
+ additional,
+ additional_length);
+ const uint64 block_addid_elem_size = EbmlElementSize(kMkvBlockAddID, add_id);
+
+ const uint64 block_more_payload_size = block_addid_elem_size +
+ block_additional_elem_size;
+ const uint64 block_more_elem_size = EbmlMasterElementSize(
+ kMkvBlockMore,
+ block_more_payload_size) +
+ block_more_payload_size;
+ const uint64 block_additions_payload_size = block_more_elem_size;
+ const uint64 block_additions_elem_size = EbmlMasterElementSize(
+ kMkvBlockAdditions,
+ block_additions_payload_size) +
+ block_additions_payload_size;
+ const uint64 block_group_payload_size = block_elem_size +
+ block_additions_elem_size;
+ const uint64 block_group_elem_size = EbmlMasterElementSize(
+ kMkvBlockGroup,
+ block_group_payload_size) +
+ block_group_payload_size;
+
+ if (!WriteEbmlMasterElement(writer, kMkvBlockGroup,
+ block_group_payload_size))
+ return 0;
+
+ if (!WriteEbmlMasterElement(writer, kMkvBlock, block_payload_size))
+ return 0;
+
+ if (WriteUInt(writer, track_number))
+ return 0;
+
+ if (SerializeInt(writer, timecode, 2))
+ return 0;
+
+ uint64 flags = 0;
+ if (is_key)
+ flags |= 0x80;
+ if (SerializeInt(writer, flags, 1))
+ return 0;
+
+ if (writer->Write(data, static_cast<uint32>(length)))
+ return 0;
+
+ if (!WriteEbmlMasterElement(writer, kMkvBlockAdditions,
+ block_additions_payload_size))
+ return 0;
+
+ if (!WriteEbmlMasterElement(writer, kMkvBlockMore, block_more_payload_size))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvBlockAddID, add_id))
+ return 0;
+
+ if (!WriteEbmlElement(writer, kMkvBlockAdditional,
+ additional, additional_length))
+ return 0;
+
+ return block_group_elem_size;
+}
+
+// Writes a WebM BlockGroup with DiscardPadding. The structure is as follows:
+// Indentation shows sub-levels
+// BlockGroup
+// Block
+// Data
+// DiscardPadding
+uint64 WriteBlockWithDiscardPadding(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key) {
+ if (!data || length < 1 || discard_padding <= 0)
+ return 0;
+
+ const uint64 block_payload_size = 4 + length;
+ const uint64 block_elem_size = EbmlMasterElementSize(kMkvBlock,
+ block_payload_size) +
+ block_payload_size;
+ const uint64 discard_padding_elem_size = EbmlElementSize(kMkvDiscardPadding,
+ discard_padding);
+ const uint64 block_group_payload_size = block_elem_size +
+ discard_padding_elem_size;
+ const uint64 block_group_elem_size = EbmlMasterElementSize(
+ kMkvBlockGroup,
+ block_group_payload_size) +
+ block_group_payload_size;
+
+ if (!WriteEbmlMasterElement(writer, kMkvBlockGroup,
+ block_group_payload_size))
+ return 0;
+
+ if (!WriteEbmlMasterElement(writer, kMkvBlock, block_payload_size))
+ return 0;
+
+ if (WriteUInt(writer, track_number))
+ return 0;
+
+ if (SerializeInt(writer, timecode, 2))
+ return 0;
+
+ uint64 flags = 0;
+ if (is_key)
+ flags |= 0x80;
+ if (SerializeInt(writer, flags, 1))
+ return 0;
+
+ if (writer->Write(data, static_cast<uint32>(length)))
+ return 0;
+
+ if (WriteID(writer, kMkvDiscardPadding))
+ return 0;
+
+ const uint64 size = GetUIntSize(discard_padding);
+ if (WriteUInt(writer, size))
+ return false;
+
+ if (SerializeInt(writer, discard_padding, static_cast<int32>(size)))
+ return false;
+
+ return block_group_elem_size;
+}
+
+uint64 WriteVoidElement(IMkvWriter* writer, uint64 size) {
+ if (!writer)
+ return false;
+
+ // Subtract one for the void ID and the coded size.
+ uint64 void_entry_size = size - 1 - GetCodedUIntSize(size-1);
+ uint64 void_size = EbmlMasterElementSize(kMkvVoid, void_entry_size) +
+ void_entry_size;
+
+ if (void_size != size)
+ return 0;
+
+ const int64 payload_position = writer->Position();
+ if (payload_position < 0)
+ return 0;
+
+ if (WriteID(writer, kMkvVoid))
+ return 0;
+
+ if (WriteUInt(writer, void_entry_size))
+ return 0;
+
+ const uint8 value = 0;
+ for (int32 i = 0; i < static_cast<int32>(void_entry_size); ++i) {
+ if (writer->Write(&value, 1))
+ return 0;
+ }
+
+ const int64 stop_position = writer->Position();
+ if (stop_position < 0 ||
+ stop_position - payload_position != static_cast<int64>(void_size))
+ return 0;
+
+ return void_size;
+}
+
+void GetVersion(int32* major, int32* minor, int32* build, int32* revision) {
+ *major = 0;
+ *minor = 2;
+ *build = 1;
+ *revision = 0;
+}
+
+} // namespace mkvmuxer
+
+mkvmuxer::uint64 mkvmuxer::MakeUID(unsigned int* seed) {
+ uint64 uid = 0;
+
+#ifdef __MINGW32__
+ srand(*seed);
+#endif
+
+ for (int i = 0; i < 7; ++i) { // avoid problems with 8-byte values
+ uid <<= 8;
+
+ // TODO(fgalligan): Move random number generation to platform specific code.
+#ifdef _MSC_VER
+ (void)seed;
+ unsigned int random_value;
+ const errno_t e = rand_s(&random_value);
+ (void)e;
+ const int32 nn = random_value;
+#elif __ANDROID__
+ int32 temp_num = 1;
+ int fd = open("/dev/urandom", O_RDONLY);
+ if (fd != -1) {
+ read(fd, &temp_num, sizeof(int32));
+ close(fd);
+ }
+ const int32 nn = temp_num;
+#elif defined __MINGW32__
+ const int32 nn = rand();
+#else
+ const int32 nn = rand_r(seed);
+#endif
+ const int32 n = 0xFF & (nn >> 4); // throw away low-order bits
+
+ uid |= n;
+ }
+
+ return uid;
+}
diff --git a/libvpx/third_party/libwebm/mkvmuxerutil.hpp b/libvpx/third_party/libwebm/mkvmuxerutil.hpp
new file mode 100644
index 0000000..d196ad3
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvmuxerutil.hpp
@@ -0,0 +1,151 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef MKVMUXERUTIL_HPP
+#define MKVMUXERUTIL_HPP
+
+#include "mkvmuxertypes.hpp"
+
+namespace mkvmuxer {
+
+class IMkvWriter;
+
+const uint64 kEbmlUnknownValue = 0x01FFFFFFFFFFFFFFULL;
+const int64 kMaxBlockTimecode = 0x07FFFLL;
+
+// Writes out |value| in Big Endian order. Returns 0 on success.
+int32 SerializeInt(IMkvWriter* writer, int64 value, int32 size);
+
+// Returns the size in bytes of the element.
+int32 GetUIntSize(uint64 value);
+int32 GetCodedUIntSize(uint64 value);
+uint64 EbmlMasterElementSize(uint64 type, uint64 value);
+uint64 EbmlElementSize(uint64 type, int64 value);
+uint64 EbmlElementSize(uint64 type, uint64 value);
+uint64 EbmlElementSize(uint64 type, float value);
+uint64 EbmlElementSize(uint64 type, const char* value);
+uint64 EbmlElementSize(uint64 type, const uint8* value, uint64 size);
+
+// Creates an EBML coded number from |value| and writes it out. The size of
+// the coded number is determined by the value of |value|. |value| must not
+// be in a coded form. Returns 0 on success.
+int32 WriteUInt(IMkvWriter* writer, uint64 value);
+
+// Creates an EBML coded number from |value| and writes it out. The size of
+// the coded number is determined by the value of |size|. |value| must not
+// be in a coded form. Returns 0 on success.
+int32 WriteUIntSize(IMkvWriter* writer, uint64 value, int32 size);
+
+// Output an Mkv master element. Returns true if the element was written.
+bool WriteEbmlMasterElement(IMkvWriter* writer, uint64 value, uint64 size);
+
+// Outputs an Mkv ID, calls |IMkvWriter::ElementStartNotify|, and passes the
+// ID to |SerializeInt|. Returns 0 on success.
+int32 WriteID(IMkvWriter* writer, uint64 type);
+
+// Output an Mkv non-master element. Returns true if the element was written.
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, uint64 value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, float value);
+bool WriteEbmlElement(IMkvWriter* writer, uint64 type, const char* value);
+bool WriteEbmlElement(IMkvWriter* writer,
+ uint64 type,
+ const uint8* value,
+ uint64 size);
+
+// Output an Mkv Simple Block.
+// Inputs:
+// data: Pointer to the data.
+// length: Length of the data.
+// track_number: Track to add the data to. Value returned by Add track
+// functions. Only values in the range [1, 126] are
+// permitted.
+// timecode: Relative timecode of the Block. Only values in the
+// range [0, 2^15) are permitted.
+// is_key: Non-zero value specifies that frame is a key frame.
+uint64 WriteSimpleBlock(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key);
+
+// Output a metadata keyframe, using a Block Group element.
+// Inputs:
+// data: Pointer to the (meta)data.
+// length: Length of the (meta)data.
+// track_number: Track to add the data to. Value returned by Add track
+// functions. Only values in the range [1, 126] are
+// permitted.
+// timecode Timecode of frame, relative to cluster timecode. Only
+// values in the range [0, 2^15) are permitted.
+// duration_timecode Duration of frame, using timecode units.
+uint64 WriteMetadataBlock(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ uint64 track_number,
+ int64 timecode,
+ uint64 duration_timecode);
+
+// Output an Mkv Block with BlockAdditional data.
+// Inputs:
+// data: Pointer to the data.
+// length: Length of the data.
+// additional: Pointer to the additional data
+// additional_length: Length of the additional data.
+// add_id: Value of BlockAddID element.
+// track_number: Track to add the data to. Value returned by Add track
+// functions. Only values in the range [1, 126] are
+// permitted.
+// timecode: Relative timecode of the Block. Only values in the
+// range [0, 2^15) are permitted.
+// is_key: Non-zero value specifies that frame is a key frame.
+uint64 WriteBlockWithAdditional(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ const uint8* additional,
+ uint64 additional_length,
+ uint64 add_id,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key);
+
+// Output an Mkv Block with a DiscardPadding element.
+// Inputs:
+// data: Pointer to the data.
+// length: Length of the data.
+// discard_padding: DiscardPadding value.
+// track_number: Track to add the data to. Value returned by Add track
+// functions. Only values in the range [1, 126] are
+// permitted.
+// timecode: Relative timecode of the Block. Only values in the
+// range [0, 2^15) are permitted.
+// is_key: Non-zero value specifies that frame is a key frame.
+uint64 WriteBlockWithDiscardPadding(IMkvWriter* writer,
+ const uint8* data,
+ uint64 length,
+ int64 discard_padding,
+ uint64 track_number,
+ int64 timecode,
+ uint64 is_key);
+
+// Output a void element. |size| must be the entire size in bytes that will be
+// void. The function will calculate the size of the void header and subtract
+// it from |size|.
+uint64 WriteVoidElement(IMkvWriter* writer, uint64 size);
+
+// Returns the version number of the muxer in |major|, |minor|, |build|,
+// and |revision|.
+void GetVersion(int32* major, int32* minor, int32* build, int32* revision);
+
+// Returns a random number to be used for UID, using |seed| to seed
+// the random-number generator (see POSIX rand_r() for semantics).
+uint64 MakeUID(unsigned int* seed);
+
+} //end namespace mkvmuxer
+
+#endif // MKVMUXERUTIL_HPP
diff --git a/libvpx/third_party/libwebm/mkvparser.cpp b/libvpx/third_party/libwebm/mkvparser.cpp
new file mode 100644
index 0000000..b41456a
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvparser.cpp
@@ -0,0 +1,9617 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#include "mkvparser.hpp"
+#include <cassert>
+#include <cstring>
+#include <new>
+#include <climits>
+
+#ifdef _MSC_VER
+// Disable MSVC warnings that suggest making code non-portable.
+#pragma warning(disable:4996)
+#endif
+
+mkvparser::IMkvReader::~IMkvReader()
+{
+}
+
+void mkvparser::GetVersion(int& major, int& minor, int& build, int& revision)
+{
+ major = 1;
+ minor = 0;
+ build = 0;
+ revision = 27;
+}
+
+long long mkvparser::ReadUInt(IMkvReader* pReader, long long pos, long& len)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ int status;
+
+//#ifdef _DEBUG
+// long long total, available;
+// status = pReader->Length(&total, &available);
+// assert(status >= 0);
+// assert((total < 0) || (available <= total));
+// assert(pos < available);
+// assert((available - pos) >= 1); //assume here max u-int len is 8
+//#endif
+
+ len = 1;
+
+ unsigned char b;
+
+ status = pReader->Read(pos, 1, &b);
+
+ if (status < 0) //error or underflow
+ return status;
+
+ if (status > 0) //interpreted as "underflow"
+ return E_BUFFER_NOT_FULL;
+
+ if (b == 0) //we can't handle u-int values larger than 8 bytes
+ return E_FILE_FORMAT_INVALID;
+
+ unsigned char m = 0x80;
+
+ while (!(b & m))
+ {
+ m >>= 1;
+ ++len;
+ }
+
+//#ifdef _DEBUG
+// assert((available - pos) >= len);
+//#endif
+
+ long long result = b & (~m);
+ ++pos;
+
+ for (int i = 1; i < len; ++i)
+ {
+ status = pReader->Read(pos, 1, &b);
+
+ if (status < 0)
+ {
+ len = 1;
+ return status;
+ }
+
+ if (status > 0)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result <<= 8;
+ result |= b;
+
+ ++pos;
+ }
+
+ return result;
+}
+
+long long mkvparser::GetUIntLength(
+ IMkvReader* pReader,
+ long long pos,
+ long& len)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ long long total, available;
+
+ int status = pReader->Length(&total, &available);
+ assert(status >= 0);
+ assert((total < 0) || (available <= total));
+
+ len = 1;
+
+ if (pos >= available)
+ return pos; //too few bytes available
+
+ unsigned char b;
+
+ status = pReader->Read(pos, 1, &b);
+
+ if (status < 0)
+ return status;
+
+ assert(status == 0);
+
+ if (b == 0) //we can't handle u-int values larger than 8 bytes
+ return E_FILE_FORMAT_INVALID;
+
+ unsigned char m = 0x80;
+
+ while (!(b & m))
+ {
+ m >>= 1;
+ ++len;
+ }
+
+ return 0; //success
+}
+
+
+long long mkvparser::UnserializeUInt(
+ IMkvReader* pReader,
+ long long pos,
+ long long size)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ if ((size <= 0) || (size > 8))
+ return E_FILE_FORMAT_INVALID;
+
+ long long result = 0;
+
+ for (long long i = 0; i < size; ++i)
+ {
+ unsigned char b;
+
+ const long status = pReader->Read(pos, 1, &b);
+
+ if (status < 0)
+ return status;
+
+ result <<= 8;
+ result |= b;
+
+ ++pos;
+ }
+
+ return result;
+}
+
+
+long mkvparser::UnserializeFloat(
+ IMkvReader* pReader,
+ long long pos,
+ long long size_,
+ double& result)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ if ((size_ != 4) && (size_ != 8))
+ return E_FILE_FORMAT_INVALID;
+
+ const long size = static_cast<long>(size_);
+
+ unsigned char buf[8];
+
+ const int status = pReader->Read(pos, size, buf);
+
+ if (status < 0) //error
+ return status;
+
+ if (size == 4)
+ {
+ union
+ {
+ float f;
+ unsigned long ff;
+ };
+
+ ff = 0;
+
+ for (int i = 0;;)
+ {
+ ff |= buf[i];
+
+ if (++i >= 4)
+ break;
+
+ ff <<= 8;
+ }
+
+ result = f;
+ }
+ else
+ {
+ assert(size == 8);
+
+ union
+ {
+ double d;
+ unsigned long long dd;
+ };
+
+ dd = 0;
+
+ for (int i = 0;;)
+ {
+ dd |= buf[i];
+
+ if (++i >= 8)
+ break;
+
+ dd <<= 8;
+ }
+
+ result = d;
+ }
+
+ return 0;
+}
+
+
+long mkvparser::UnserializeInt(
+ IMkvReader* pReader,
+ long long pos,
+ long size,
+ long long& result)
+{
+ assert(pReader);
+ assert(pos >= 0);
+ assert(size > 0);
+ assert(size <= 8);
+
+ {
+ signed char b;
+
+ const long status = pReader->Read(pos, 1, (unsigned char*)&b);
+
+ if (status < 0)
+ return status;
+
+ result = b;
+
+ ++pos;
+ }
+
+ for (long i = 1; i < size; ++i)
+ {
+ unsigned char b;
+
+ const long status = pReader->Read(pos, 1, &b);
+
+ if (status < 0)
+ return status;
+
+ result <<= 8;
+ result |= b;
+
+ ++pos;
+ }
+
+ return 0; //success
+}
+
+
+long mkvparser::UnserializeString(
+ IMkvReader* pReader,
+ long long pos,
+ long long size_,
+ char*& str)
+{
+ delete[] str;
+ str = NULL;
+
+ if (size_ >= LONG_MAX) //we need (size+1) chars
+ return E_FILE_FORMAT_INVALID;
+
+ const long size = static_cast<long>(size_);
+
+ str = new (std::nothrow) char[size+1];
+
+ if (str == NULL)
+ return -1;
+
+ unsigned char* const buf = reinterpret_cast<unsigned char*>(str);
+
+ const long status = pReader->Read(pos, size, buf);
+
+ if (status)
+ {
+ delete[] str;
+ str = NULL;
+
+ return status;
+ }
+
+ str[size] = '\0';
+
+ return 0; //success
+}
+
+
+long mkvparser::ParseElementHeader(
+ IMkvReader* pReader,
+ long long& pos,
+ long long stop,
+ long long& id,
+ long long& size)
+{
+ if ((stop >= 0) && (pos >= stop))
+ return E_FILE_FORMAT_INVALID;
+
+ long len;
+
+ id = ReadUInt(pReader, pos, len);
+
+ if (id < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume id
+
+ if ((stop >= 0) && (pos >= stop))
+ return E_FILE_FORMAT_INVALID;
+
+ size = ReadUInt(pReader, pos, len);
+
+ if (size < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume length of size
+
+ //pos now designates payload
+
+ if ((stop >= 0) && ((pos + size) > stop))
+ return E_FILE_FORMAT_INVALID;
+
+ return 0; //success
+}
+
+
+bool mkvparser::Match(
+ IMkvReader* pReader,
+ long long& pos,
+ unsigned long id_,
+ long long& val)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ long long total, available;
+
+ const long status = pReader->Length(&total, &available);
+ assert(status >= 0);
+ assert((total < 0) || (available <= total));
+ if (status < 0)
+ return false;
+
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0);
+ assert(len > 0);
+ assert(len <= 8);
+ assert((pos + len) <= available);
+
+ if ((unsigned long)id != id_)
+ return false;
+
+ pos += len; //consume id
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0);
+ assert(size <= 8);
+ assert(len > 0);
+ assert(len <= 8);
+ assert((pos + len) <= available);
+
+ pos += len; //consume length of size of payload
+
+ val = UnserializeUInt(pReader, pos, size);
+ assert(val >= 0);
+
+ pos += size; //consume size of payload
+
+ return true;
+}
+
+bool mkvparser::Match(
+ IMkvReader* pReader,
+ long long& pos,
+ unsigned long id_,
+ unsigned char*& buf,
+ size_t& buflen)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ long long total, available;
+
+ long status = pReader->Length(&total, &available);
+ assert(status >= 0);
+ assert((total < 0) || (available <= total));
+ if (status < 0)
+ return false;
+
+ long len;
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0);
+ assert(len > 0);
+ assert(len <= 8);
+ assert((pos + len) <= available);
+
+ if ((unsigned long)id != id_)
+ return false;
+
+ pos += len; //consume id
+
+ const long long size_ = ReadUInt(pReader, pos, len);
+ assert(size_ >= 0);
+ assert(len > 0);
+ assert(len <= 8);
+ assert((pos + len) <= available);
+
+ pos += len; //consume length of size of payload
+ assert((pos + size_) <= available);
+
+ const long buflen_ = static_cast<long>(size_);
+
+ buf = new (std::nothrow) unsigned char[buflen_];
+ assert(buf); //TODO
+
+ status = pReader->Read(pos, buflen_, buf);
+ assert(status == 0); //TODO
+
+ buflen = buflen_;
+
+ pos += size_; //consume size of payload
+ return true;
+}
+
+
+namespace mkvparser
+{
+
+EBMLHeader::EBMLHeader() :
+ m_docType(NULL)
+{
+ Init();
+}
+
+EBMLHeader::~EBMLHeader()
+{
+ delete[] m_docType;
+}
+
+void EBMLHeader::Init()
+{
+ m_version = 1;
+ m_readVersion = 1;
+ m_maxIdLength = 4;
+ m_maxSizeLength = 8;
+
+ if (m_docType)
+ {
+ delete[] m_docType;
+ m_docType = NULL;
+ }
+
+ m_docTypeVersion = 1;
+ m_docTypeReadVersion = 1;
+}
+
+long long EBMLHeader::Parse(
+ IMkvReader* pReader,
+ long long& pos)
+{
+ assert(pReader);
+
+ long long total, available;
+
+ long status = pReader->Length(&total, &available);
+
+ if (status < 0) //error
+ return status;
+
+ pos = 0;
+ long long end = (available >= 1024) ? 1024 : available;
+
+ for (;;)
+ {
+ unsigned char b = 0;
+
+ while (pos < end)
+ {
+ status = pReader->Read(pos, 1, &b);
+
+ if (status < 0) //error
+ return status;
+
+ if (b == 0x1A)
+ break;
+
+ ++pos;
+ }
+
+ if (b != 0x1A)
+ {
+ if (pos >= 1024)
+ return E_FILE_FORMAT_INVALID; //don't bother looking anymore
+
+ if ((total >= 0) && ((total - available) < 5))
+ return E_FILE_FORMAT_INVALID;
+
+ return available + 5; //5 = 4-byte ID + 1st byte of size
+ }
+
+ if ((total >= 0) && ((total - pos) < 5))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((available - pos) < 5)
+ return pos + 5; //try again later
+
+ long len;
+
+ const long long result = ReadUInt(pReader, pos, len);
+
+ if (result < 0) //error
+ return result;
+
+ if (result == 0x0A45DFA3) //EBML Header ID
+ {
+ pos += len; //consume ID
+ break;
+ }
+
+ ++pos; //throw away just the 0x1A byte, and try again
+ }
+
+ //pos designates start of size field
+
+ //get length of size field
+
+ long len;
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return result;
+
+ if (result > 0) //need more data
+ return result;
+
+ assert(len > 0);
+ assert(len <= 8);
+
+ if ((total >= 0) && ((total - pos) < len))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((available - pos) < len)
+ return pos + len; //try again later
+
+ //get the EBML header size
+
+ result = ReadUInt(pReader, pos, len);
+
+ if (result < 0) //error
+ return result;
+
+ pos += len; //consume size field
+
+ //pos now designates start of payload
+
+ if ((total >= 0) && ((total - pos) < result))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((available - pos) < result)
+ return pos + result;
+
+ end = pos + result;
+
+ Init();
+
+ while (pos < end)
+ {
+ long long id, size;
+
+ status = ParseElementHeader(
+ pReader,
+ pos,
+ end,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (size == 0) //weird
+ return E_FILE_FORMAT_INVALID;
+
+ if (id == 0x0286) //version
+ {
+ m_version = UnserializeUInt(pReader, pos, size);
+
+ if (m_version <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x02F7) //read version
+ {
+ m_readVersion = UnserializeUInt(pReader, pos, size);
+
+ if (m_readVersion <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x02F2) //max id length
+ {
+ m_maxIdLength = UnserializeUInt(pReader, pos, size);
+
+ if (m_maxIdLength <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x02F3) //max size length
+ {
+ m_maxSizeLength = UnserializeUInt(pReader, pos, size);
+
+ if (m_maxSizeLength <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x0282) //doctype
+ {
+ if (m_docType)
+ return E_FILE_FORMAT_INVALID;
+
+ status = UnserializeString(pReader, pos, size, m_docType);
+
+ if (status) //error
+ return status;
+ }
+ else if (id == 0x0287) //doctype version
+ {
+ m_docTypeVersion = UnserializeUInt(pReader, pos, size);
+
+ if (m_docTypeVersion <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x0285) //doctype read version
+ {
+ m_docTypeReadVersion = UnserializeUInt(pReader, pos, size);
+
+ if (m_docTypeReadVersion <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+
+ pos += size;
+ }
+
+ assert(pos == end);
+ return 0;
+}
+
+
+Segment::Segment(
+ IMkvReader* pReader,
+ long long elem_start,
+ //long long elem_size,
+ long long start,
+ long long size) :
+ m_pReader(pReader),
+ m_element_start(elem_start),
+ //m_element_size(elem_size),
+ m_start(start),
+ m_size(size),
+ m_pos(start),
+ m_pUnknownSize(0),
+ m_pSeekHead(NULL),
+ m_pInfo(NULL),
+ m_pTracks(NULL),
+ m_pCues(NULL),
+ m_pChapters(NULL),
+ m_clusters(NULL),
+ m_clusterCount(0),
+ m_clusterPreloadCount(0),
+ m_clusterSize(0)
+{
+}
+
+
+Segment::~Segment()
+{
+ const long count = m_clusterCount + m_clusterPreloadCount;
+
+ Cluster** i = m_clusters;
+ Cluster** j = m_clusters + count;
+
+ while (i != j)
+ {
+ Cluster* const p = *i++;
+ assert(p);
+
+ delete p;
+ }
+
+ delete[] m_clusters;
+
+ delete m_pTracks;
+ delete m_pInfo;
+ delete m_pCues;
+ delete m_pChapters;
+ delete m_pSeekHead;
+}
+
+
+long long Segment::CreateInstance(
+ IMkvReader* pReader,
+ long long pos,
+ Segment*& pSegment)
+{
+ assert(pReader);
+ assert(pos >= 0);
+
+ pSegment = NULL;
+
+ long long total, available;
+
+ const long status = pReader->Length(&total, &available);
+
+ if (status < 0) //error
+ return status;
+
+ if (available < 0)
+ return -1;
+
+ if ((total >= 0) && (available > total))
+ return -1;
+
+ //I would assume that in practice this loop would execute
+ //exactly once, but we allow for other elements (e.g. Void)
+ //to immediately follow the EBML header. This is fine for
+ //the source filter case (since the entire file is available),
+ //but in the splitter case over a network we should probably
+ //just give up early. We could for example decide only to
+ //execute this loop a maximum of, say, 10 times.
+ //TODO:
+ //There is an implied "give up early" by only parsing up
+ //to the available limit. We do do that, but only if the
+ //total file size is unknown. We could decide to always
+ //use what's available as our limit (irrespective of whether
+ //we happen to know the total file length). This would have
+ //as its sense "parse this much of the file before giving up",
+ //which a slightly different sense from "try to parse up to
+ //10 EMBL elements before giving up".
+
+ for (;;)
+ {
+ if ((total >= 0) && (pos >= total))
+ return E_FILE_FORMAT_INVALID;
+
+ //Read ID
+ long len;
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result) //error, or too few available bytes
+ return result;
+
+ if ((total >= 0) && ((pos + len) > total))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > available)
+ return pos + len;
+
+ const long long idpos = pos;
+ const long long id = ReadUInt(pReader, pos, len);
+
+ if (id < 0) //error
+ return id;
+
+ pos += len; //consume ID
+
+ //Read Size
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result) //error, or too few available bytes
+ return result;
+
+ if ((total >= 0) && ((pos + len) > total))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > available)
+ return pos + len;
+
+ long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return size;
+
+ pos += len; //consume length of size of element
+
+ //Pos now points to start of payload
+
+ //Handle "unknown size" for live streaming of webm files.
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (id == 0x08538067) //Segment ID
+ {
+ if (size == unknown_size)
+ size = -1;
+
+ else if (total < 0)
+ size = -1;
+
+ else if ((pos + size) > total)
+ size = -1;
+
+ pSegment = new (std::nothrow) Segment(
+ pReader,
+ idpos,
+ //elem_size
+ pos,
+ size);
+
+ if (pSegment == 0)
+ return -1; //generic error
+
+ return 0; //success
+ }
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((total >= 0) && ((pos + size) > total))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + size) > available)
+ return pos + size;
+
+ pos += size; //consume payload
+ }
+}
+
+
+long long Segment::ParseHeaders()
+{
+ //Outermost (level 0) segment object has been constructed,
+ //and pos designates start of payload. We need to find the
+ //inner (level 1) elements.
+ long long total, available;
+
+ const int status = m_pReader->Length(&total, &available);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (available <= total));
+
+ const long long segment_stop = (m_size < 0) ? -1 : m_start + m_size;
+ assert((segment_stop < 0) || (total < 0) || (segment_stop <= total));
+ assert((segment_stop < 0) || (m_pos <= segment_stop));
+
+ for (;;)
+ {
+ if ((total >= 0) && (m_pos >= total))
+ break;
+
+ if ((segment_stop >= 0) && (m_pos >= segment_stop))
+ break;
+
+ long long pos = m_pos;
+ const long long element_start = pos;
+
+ if ((pos + 1) > available)
+ return (pos + 1);
+
+ long len;
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return result;
+
+ if (result > 0) //underflow (weird)
+ return (pos + 1);
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > available)
+ return pos + len;
+
+ const long long idpos = pos;
+ const long long id = ReadUInt(m_pReader, idpos, len);
+
+ if (id < 0) //error
+ return id;
+
+ if (id == 0x0F43B675) //Cluster ID
+ break;
+
+ pos += len; //consume ID
+
+ if ((pos + 1) > available)
+ return (pos + 1);
+
+ //Read Size
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return result;
+
+ if (result > 0) //underflow (weird)
+ return (pos + 1);
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > available)
+ return pos + len;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return size;
+
+ pos += len; //consume length of size of element
+
+ const long long element_size = size + pos - element_start;
+
+ //Pos now points to start of payload
+
+ if ((segment_stop >= 0) && ((pos + size) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ //We read EBML elements either in total or nothing at all.
+
+ if ((pos + size) > available)
+ return pos + size;
+
+ if (id == 0x0549A966) //Segment Info ID
+ {
+ if (m_pInfo)
+ return E_FILE_FORMAT_INVALID;
+
+ m_pInfo = new (std::nothrow) SegmentInfo(
+ this,
+ pos,
+ size,
+ element_start,
+ element_size);
+
+ if (m_pInfo == NULL)
+ return -1;
+
+ const long status = m_pInfo->Parse();
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x0654AE6B) //Tracks ID
+ {
+ if (m_pTracks)
+ return E_FILE_FORMAT_INVALID;
+
+ m_pTracks = new (std::nothrow) Tracks(this,
+ pos,
+ size,
+ element_start,
+ element_size);
+
+ if (m_pTracks == NULL)
+ return -1;
+
+ const long status = m_pTracks->Parse();
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x0C53BB6B) //Cues ID
+ {
+ if (m_pCues == NULL)
+ {
+ m_pCues = new (std::nothrow) Cues(
+ this,
+ pos,
+ size,
+ element_start,
+ element_size);
+
+ if (m_pCues == NULL)
+ return -1;
+ }
+ }
+ else if (id == 0x014D9B74) //SeekHead ID
+ {
+ if (m_pSeekHead == NULL)
+ {
+ m_pSeekHead = new (std::nothrow) SeekHead(
+ this,
+ pos,
+ size,
+ element_start,
+ element_size);
+
+ if (m_pSeekHead == NULL)
+ return -1;
+
+ const long status = m_pSeekHead->Parse();
+
+ if (status)
+ return status;
+ }
+ }
+ else if (id == 0x0043A770) //Chapters ID
+ {
+ if (m_pChapters == NULL)
+ {
+ m_pChapters = new (std::nothrow) Chapters(
+ this,
+ pos,
+ size,
+ element_start,
+ element_size);
+
+ if (m_pChapters == NULL)
+ return -1;
+
+ const long status = m_pChapters->Parse();
+
+ if (status)
+ return status;
+ }
+ }
+
+ m_pos = pos + size; //consume payload
+ }
+
+ assert((segment_stop < 0) || (m_pos <= segment_stop));
+
+ if (m_pInfo == NULL) //TODO: liberalize this behavior
+ return E_FILE_FORMAT_INVALID;
+
+ if (m_pTracks == NULL)
+ return E_FILE_FORMAT_INVALID;
+
+ return 0; //success
+}
+
+
+long Segment::LoadCluster(
+ long long& pos,
+ long& len)
+{
+ for (;;)
+ {
+ const long result = DoLoadCluster(pos, len);
+
+ if (result <= 1)
+ return result;
+ }
+}
+
+
+long Segment::DoLoadCluster(
+ long long& pos,
+ long& len)
+{
+ if (m_pos < 0)
+ return DoLoadClusterUnknownSize(pos, len);
+
+ long long total, avail;
+
+ long status = m_pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ const long long segment_stop = (m_size < 0) ? -1 : m_start + m_size;
+
+ long long cluster_off = -1; //offset relative to start of segment
+ long long cluster_size = -1; //size of cluster payload
+
+ for (;;)
+ {
+ if ((total >= 0) && (m_pos >= total))
+ return 1; //no more clusters
+
+ if ((segment_stop >= 0) && (m_pos >= segment_stop))
+ return 1; //no more clusters
+
+ pos = m_pos;
+
+ //Read ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long idpos = pos;
+ const long long id = ReadUInt(m_pReader, idpos, len);
+
+ if (id < 0) //error (or underflow)
+ return static_cast<long>(id);
+
+ pos += len; //consume ID
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume length of size of element
+
+ //pos now points to start of payload
+
+ if (size == 0) //weird
+ {
+ m_pos = pos;
+ continue;
+ }
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+#if 0 //we must handle this to support live webm
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //TODO: allow this
+#endif
+
+ if ((segment_stop >= 0) &&
+ (size != unknown_size) &&
+ ((pos + size) > segment_stop))
+ {
+ return E_FILE_FORMAT_INVALID;
+ }
+
+#if 0 //commented-out, to support incremental cluster parsing
+ len = static_cast<long>(size);
+
+ if ((pos + size) > avail)
+ return E_BUFFER_NOT_FULL;
+#endif
+
+ if (id == 0x0C53BB6B) //Cues ID
+ {
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //TODO: liberalize
+
+ if (m_pCues == NULL)
+ {
+ const long long element_size = (pos - idpos) + size;
+
+ m_pCues = new Cues(this,
+ pos,
+ size,
+ idpos,
+ element_size);
+ assert(m_pCues); //TODO
+ }
+
+ m_pos = pos + size; //consume payload
+ continue;
+ }
+
+ if (id != 0x0F43B675) //Cluster ID
+ {
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //TODO: liberalize
+
+ m_pos = pos + size; //consume payload
+ continue;
+ }
+
+ //We have a cluster.
+
+ cluster_off = idpos - m_start; //relative pos
+
+ if (size != unknown_size)
+ cluster_size = size;
+
+ break;
+ }
+
+ assert(cluster_off >= 0); //have cluster
+
+ long long pos_;
+ long len_;
+
+ status = Cluster::HasBlockEntries(this, cluster_off, pos_, len_);
+
+ if (status < 0) //error, or underflow
+ {
+ pos = pos_;
+ len = len_;
+
+ return status;
+ }
+
+ //status == 0 means "no block entries found"
+ //status > 0 means "found at least one block entry"
+
+ //TODO:
+ //The issue here is that the segment increments its own
+ //pos ptr past the most recent cluster parsed, and then
+ //starts from there to parse the next cluster. If we
+ //don't know the size of the current cluster, then we
+ //must either parse its payload (as we do below), looking
+ //for the cluster (or cues) ID to terminate the parse.
+ //This isn't really what we want: rather, we really need
+ //a way to create the curr cluster object immediately.
+ //The pity is that cluster::parse can determine its own
+ //boundary, and we largely duplicate that same logic here.
+ //
+ //Maybe we need to get rid of our look-ahead preloading
+ //in source::parse???
+ //
+ //As we're parsing the blocks in the curr cluster
+ //(in cluster::parse), we should have some way to signal
+ //to the segment that we have determined the boundary,
+ //so it can adjust its own segment::m_pos member.
+ //
+ //The problem is that we're asserting in asyncreadinit,
+ //because we adjust the pos down to the curr seek pos,
+ //and the resulting adjusted len is > 2GB. I'm suspicious
+ //that this is even correct, but even if it is, we can't
+ //be loading that much data in the cache anyway.
+
+ const long idx = m_clusterCount;
+
+ if (m_clusterPreloadCount > 0)
+ {
+ assert(idx < m_clusterSize);
+
+ Cluster* const pCluster = m_clusters[idx];
+ assert(pCluster);
+ assert(pCluster->m_index < 0);
+
+ const long long off = pCluster->GetPosition();
+ assert(off >= 0);
+
+ if (off == cluster_off) //preloaded already
+ {
+ if (status == 0) //no entries found
+ return E_FILE_FORMAT_INVALID;
+
+ if (cluster_size >= 0)
+ pos += cluster_size;
+ else
+ {
+ const long long element_size = pCluster->GetElementSize();
+
+ if (element_size <= 0)
+ return E_FILE_FORMAT_INVALID; //TODO: handle this case
+
+ pos = pCluster->m_element_start + element_size;
+ }
+
+ pCluster->m_index = idx; //move from preloaded to loaded
+ ++m_clusterCount;
+ --m_clusterPreloadCount;
+
+ m_pos = pos; //consume payload
+ assert((segment_stop < 0) || (m_pos <= segment_stop));
+
+ return 0; //success
+ }
+ }
+
+ if (status == 0) //no entries found
+ {
+ if (cluster_size < 0)
+ return E_FILE_FORMAT_INVALID; //TODO: handle this
+
+ pos += cluster_size;
+
+ if ((total >= 0) && (pos >= total))
+ {
+ m_pos = total;
+ return 1; //no more clusters
+ }
+
+ if ((segment_stop >= 0) && (pos >= segment_stop))
+ {
+ m_pos = segment_stop;
+ return 1; //no more clusters
+ }
+
+ m_pos = pos;
+ return 2; //try again
+ }
+
+ //status > 0 means we have an entry
+
+ Cluster* const pCluster = Cluster::Create(this,
+ idx,
+ cluster_off);
+ //element_size);
+ assert(pCluster);
+
+ AppendCluster(pCluster);
+ assert(m_clusters);
+ assert(idx < m_clusterSize);
+ assert(m_clusters[idx] == pCluster);
+
+ if (cluster_size >= 0)
+ {
+ pos += cluster_size;
+
+ m_pos = pos;
+ assert((segment_stop < 0) || (m_pos <= segment_stop));
+
+ return 0;
+ }
+
+ m_pUnknownSize = pCluster;
+ m_pos = -pos;
+
+ return 0; //partial success, since we have a new cluster
+
+ //status == 0 means "no block entries found"
+
+ //pos designates start of payload
+ //m_pos has NOT been adjusted yet (in case we need to come back here)
+
+#if 0
+
+ if (cluster_size < 0) //unknown size
+ {
+ const long long payload_pos = pos; //absolute pos of cluster payload
+
+ for (;;) //determine cluster size
+ {
+ if ((total >= 0) && (pos >= total))
+ break;
+
+ if ((segment_stop >= 0) && (pos >= segment_stop))
+ break; //no more clusters
+
+ //Read ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long idpos = pos;
+ const long long id = ReadUInt(m_pReader, idpos, len);
+
+ if (id < 0) //error (or underflow)
+ return static_cast<long>(id);
+
+ //This is the distinguished set of ID's we use to determine
+ //that we have exhausted the sub-element's inside the cluster
+ //whose ID we parsed earlier.
+
+ if (id == 0x0F43B675) //Cluster ID
+ break;
+
+ if (id == 0x0C53BB6B) //Cues ID
+ break;
+
+ switch (id)
+ {
+ case 0x20: //BlockGroup
+ case 0x23: //Simple Block
+ case 0x67: //TimeCode
+ case 0x2B: //PrevSize
+ break;
+
+ default:
+ assert(false);
+ break;
+ }
+
+ pos += len; //consume ID (of sub-element)
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume size field of element
+
+ //pos now points to start of sub-element's payload
+
+ if (size == 0) //weird
+ continue;
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //not allowed for sub-elements
+
+ if ((segment_stop >= 0) && ((pos + size) > segment_stop)) //weird
+ return E_FILE_FORMAT_INVALID;
+
+ pos += size; //consume payload of sub-element
+ assert((segment_stop < 0) || (pos <= segment_stop));
+ } //determine cluster size
+
+ cluster_size = pos - payload_pos;
+ assert(cluster_size >= 0);
+
+ pos = payload_pos; //reset and re-parse original cluster
+ }
+
+ if (m_clusterPreloadCount > 0)
+ {
+ assert(idx < m_clusterSize);
+
+ Cluster* const pCluster = m_clusters[idx];
+ assert(pCluster);
+ assert(pCluster->m_index < 0);
+
+ const long long off = pCluster->GetPosition();
+ assert(off >= 0);
+
+ if (off == cluster_off) //preloaded already
+ return E_FILE_FORMAT_INVALID; //subtle
+ }
+
+ m_pos = pos + cluster_size; //consume payload
+ assert((segment_stop < 0) || (m_pos <= segment_stop));
+
+ return 2; //try to find another cluster
+
+#endif
+
+}
+
+
+long Segment::DoLoadClusterUnknownSize(
+ long long& pos,
+ long& len)
+{
+ assert(m_pos < 0);
+ assert(m_pUnknownSize);
+
+#if 0
+ assert(m_pUnknownSize->GetElementSize() < 0); //TODO: verify this
+
+ const long long element_start = m_pUnknownSize->m_element_start;
+
+ pos = -m_pos;
+ assert(pos > element_start);
+
+ //We have already consumed the (cluster) ID and size fields.
+ //We just need to consume the blocks and other sub-elements
+ //of this cluster, until we discover the boundary.
+
+ long long total, avail;
+
+ long status = m_pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ const long long segment_stop = (m_size < 0) ? -1 : m_start + m_size;
+
+ long long element_size = -1;
+
+ for (;;) //determine cluster size
+ {
+ if ((total >= 0) && (pos >= total))
+ {
+ element_size = total - element_start;
+ assert(element_size > 0);
+
+ break;
+ }
+
+ if ((segment_stop >= 0) && (pos >= segment_stop))
+ {
+ element_size = segment_stop - element_start;
+ assert(element_size > 0);
+
+ break;
+ }
+
+ //Read ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long idpos = pos;
+ const long long id = ReadUInt(m_pReader, idpos, len);
+
+ if (id < 0) //error (or underflow)
+ return static_cast<long>(id);
+
+ //This is the distinguished set of ID's we use to determine
+ //that we have exhausted the sub-element's inside the cluster
+ //whose ID we parsed earlier.
+
+ if ((id == 0x0F43B675) || (id == 0x0C53BB6B)) //Cluster ID or Cues ID
+ {
+ element_size = pos - element_start;
+ assert(element_size > 0);
+
+ break;
+ }
+
+#ifdef _DEBUG
+ switch (id)
+ {
+ case 0x20: //BlockGroup
+ case 0x23: //Simple Block
+ case 0x67: //TimeCode
+ case 0x2B: //PrevSize
+ break;
+
+ default:
+ assert(false);
+ break;
+ }
+#endif
+
+ pos += len; //consume ID (of sub-element)
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume size field of element
+
+ //pos now points to start of sub-element's payload
+
+ if (size == 0) //weird
+ continue;
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //not allowed for sub-elements
+
+ if ((segment_stop >= 0) && ((pos + size) > segment_stop)) //weird
+ return E_FILE_FORMAT_INVALID;
+
+ pos += size; //consume payload of sub-element
+ assert((segment_stop < 0) || (pos <= segment_stop));
+ } //determine cluster size
+
+ assert(element_size >= 0);
+
+ m_pos = element_start + element_size;
+ m_pUnknownSize = 0;
+
+ return 2; //continue parsing
+#else
+ const long status = m_pUnknownSize->Parse(pos, len);
+
+ if (status < 0) //error or underflow
+ return status;
+
+ if (status == 0) //parsed a block
+ return 2; //continue parsing
+
+ assert(status > 0); //nothing left to parse of this cluster
+
+ const long long start = m_pUnknownSize->m_element_start;
+
+ const long long size = m_pUnknownSize->GetElementSize();
+ assert(size >= 0);
+
+ pos = start + size;
+ m_pos = pos;
+
+ m_pUnknownSize = 0;
+
+ return 2; //continue parsing
+#endif
+}
+
+
+void Segment::AppendCluster(Cluster* pCluster)
+{
+ assert(pCluster);
+ assert(pCluster->m_index >= 0);
+
+ const long count = m_clusterCount + m_clusterPreloadCount;
+
+ long& size = m_clusterSize;
+ assert(size >= count);
+
+ const long idx = pCluster->m_index;
+ assert(idx == m_clusterCount);
+
+ if (count >= size)
+ {
+ const long n = (size <= 0) ? 2048 : 2*size;
+
+ Cluster** const qq = new Cluster*[n];
+ Cluster** q = qq;
+
+ Cluster** p = m_clusters;
+ Cluster** const pp = p + count;
+
+ while (p != pp)
+ *q++ = *p++;
+
+ delete[] m_clusters;
+
+ m_clusters = qq;
+ size = n;
+ }
+
+ if (m_clusterPreloadCount > 0)
+ {
+ assert(m_clusters);
+
+ Cluster** const p = m_clusters + m_clusterCount;
+ assert(*p);
+ assert((*p)->m_index < 0);
+
+ Cluster** q = p + m_clusterPreloadCount;
+ assert(q < (m_clusters + size));
+
+ for (;;)
+ {
+ Cluster** const qq = q - 1;
+ assert((*qq)->m_index < 0);
+
+ *q = *qq;
+ q = qq;
+
+ if (q == p)
+ break;
+ }
+ }
+
+ m_clusters[idx] = pCluster;
+ ++m_clusterCount;
+}
+
+
+void Segment::PreloadCluster(Cluster* pCluster, ptrdiff_t idx)
+{
+ assert(pCluster);
+ assert(pCluster->m_index < 0);
+ assert(idx >= m_clusterCount);
+
+ const long count = m_clusterCount + m_clusterPreloadCount;
+
+ long& size = m_clusterSize;
+ assert(size >= count);
+
+ if (count >= size)
+ {
+ const long n = (size <= 0) ? 2048 : 2*size;
+
+ Cluster** const qq = new Cluster*[n];
+ Cluster** q = qq;
+
+ Cluster** p = m_clusters;
+ Cluster** const pp = p + count;
+
+ while (p != pp)
+ *q++ = *p++;
+
+ delete[] m_clusters;
+
+ m_clusters = qq;
+ size = n;
+ }
+
+ assert(m_clusters);
+
+ Cluster** const p = m_clusters + idx;
+
+ Cluster** q = m_clusters + count;
+ assert(q >= p);
+ assert(q < (m_clusters + size));
+
+ while (q > p)
+ {
+ Cluster** const qq = q - 1;
+ assert((*qq)->m_index < 0);
+
+ *q = *qq;
+ q = qq;
+ }
+
+ m_clusters[idx] = pCluster;
+ ++m_clusterPreloadCount;
+}
+
+
+long Segment::Load()
+{
+ assert(m_clusters == NULL);
+ assert(m_clusterSize == 0);
+ assert(m_clusterCount == 0);
+ //assert(m_size >= 0);
+
+ //Outermost (level 0) segment object has been constructed,
+ //and pos designates start of payload. We need to find the
+ //inner (level 1) elements.
+
+ const long long header_status = ParseHeaders();
+
+ if (header_status < 0) //error
+ return static_cast<long>(header_status);
+
+ if (header_status > 0) //underflow
+ return E_BUFFER_NOT_FULL;
+
+ assert(m_pInfo);
+ assert(m_pTracks);
+
+ for (;;)
+ {
+ const int status = LoadCluster();
+
+ if (status < 0) //error
+ return status;
+
+ if (status >= 1) //no more clusters
+ return 0;
+ }
+}
+
+
+SeekHead::SeekHead(
+ Segment* pSegment,
+ long long start,
+ long long size_,
+ long long element_start,
+ long long element_size) :
+ m_pSegment(pSegment),
+ m_start(start),
+ m_size(size_),
+ m_element_start(element_start),
+ m_element_size(element_size),
+ m_entries(0),
+ m_entry_count(0),
+ m_void_elements(0),
+ m_void_element_count(0)
+{
+}
+
+
+SeekHead::~SeekHead()
+{
+ delete[] m_entries;
+ delete[] m_void_elements;
+}
+
+
+long SeekHead::Parse()
+{
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long pos = m_start;
+ const long long stop = m_start + m_size;
+
+ //first count the seek head entries
+
+ int entry_count = 0;
+ int void_element_count = 0;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x0DBB) //SeekEntry ID
+ ++entry_count;
+ else if (id == 0x6C) //Void ID
+ ++void_element_count;
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ m_entries = new (std::nothrow) Entry[entry_count];
+
+ if (m_entries == NULL)
+ return -1;
+
+ m_void_elements = new (std::nothrow) VoidElement[void_element_count];
+
+ if (m_void_elements == NULL)
+ return -1;
+
+ //now parse the entries and void elements
+
+ Entry* pEntry = m_entries;
+ VoidElement* pVoidElement = m_void_elements;
+
+ pos = m_start;
+
+ while (pos < stop)
+ {
+ const long long idpos = pos;
+
+ long long id, size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x0DBB) //SeekEntry ID
+ {
+ if (ParseEntry(pReader, pos, size, pEntry))
+ {
+ Entry& e = *pEntry++;
+
+ e.element_start = idpos;
+ e.element_size = (pos + size) - idpos;
+ }
+ }
+ else if (id == 0x6C) //Void ID
+ {
+ VoidElement& e = *pVoidElement++;
+
+ e.element_start = idpos;
+ e.element_size = (pos + size) - idpos;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ ptrdiff_t count_ = ptrdiff_t(pEntry - m_entries);
+ assert(count_ >= 0);
+ assert(count_ <= entry_count);
+
+ m_entry_count = static_cast<int>(count_);
+
+ count_ = ptrdiff_t(pVoidElement - m_void_elements);
+ assert(count_ >= 0);
+ assert(count_ <= void_element_count);
+
+ m_void_element_count = static_cast<int>(count_);
+
+ return 0;
+}
+
+
+int SeekHead::GetCount() const
+{
+ return m_entry_count;
+}
+
+const SeekHead::Entry* SeekHead::GetEntry(int idx) const
+{
+ if (idx < 0)
+ return 0;
+
+ if (idx >= m_entry_count)
+ return 0;
+
+ return m_entries + idx;
+}
+
+int SeekHead::GetVoidElementCount() const
+{
+ return m_void_element_count;
+}
+
+const SeekHead::VoidElement* SeekHead::GetVoidElement(int idx) const
+{
+ if (idx < 0)
+ return 0;
+
+ if (idx >= m_void_element_count)
+ return 0;
+
+ return m_void_elements + idx;
+}
+
+
+#if 0
+void Segment::ParseCues(long long off)
+{
+ if (m_pCues)
+ return;
+
+ //odbgstream os;
+ //os << "Segment::ParseCues (begin)" << endl;
+
+ long long pos = m_start + off;
+ const long long element_start = pos;
+ const long long stop = m_start + m_size;
+
+ long len;
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+ assert(result == 0);
+ assert((pos + len) <= stop);
+
+ const long long idpos = pos;
+
+ const long long id = ReadUInt(m_pReader, idpos, len);
+ assert(id == 0x0C53BB6B); //Cues ID
+
+ pos += len; //consume ID
+ assert(pos < stop);
+
+ //Read Size
+
+ result = GetUIntLength(m_pReader, pos, len);
+ assert(result == 0);
+ assert((pos + len) <= stop);
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+ assert(size >= 0);
+
+ pos += len; //consume length of size of element
+ assert((pos + size) <= stop);
+
+ const long long element_size = size + pos - element_start;
+
+ //Pos now points to start of payload
+
+ m_pCues = new Cues(this, pos, size, element_start, element_size);
+ assert(m_pCues); //TODO
+
+ //os << "Segment::ParseCues (end)" << endl;
+}
+#else
+long Segment::ParseCues(
+ long long off,
+ long long& pos,
+ long& len)
+{
+ if (m_pCues)
+ return 0; //success
+
+ if (off < 0)
+ return -1;
+
+ long long total, avail;
+
+ const int status = m_pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ pos = m_start + off;
+
+ if ((total < 0) || (pos >= total))
+ return 1; //don't bother parsing cues
+
+ const long long element_start = pos;
+ const long long segment_stop = (m_size < 0) ? -1 : m_start + m_size;
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //underflow (weird)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long idpos = pos;
+
+ const long long id = ReadUInt(m_pReader, idpos, len);
+
+ if (id != 0x0C53BB6B) //Cues ID
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume ID
+ assert((segment_stop < 0) || (pos <= segment_stop));
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //underflow (weird)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ if (size == 0) //weird, although technically not illegal
+ return 1; //done
+
+ pos += len; //consume length of size of element
+ assert((segment_stop < 0) || (pos <= segment_stop));
+
+ //Pos now points to start of payload
+
+ const long long element_stop = pos + size;
+
+ if ((segment_stop >= 0) && (element_stop > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((total >= 0) && (element_stop > total))
+ return 1; //don't bother parsing anymore
+
+ len = static_cast<long>(size);
+
+ if (element_stop > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long element_size = element_stop - element_start;
+
+ m_pCues = new (std::nothrow) Cues(
+ this,
+ pos,
+ size,
+ element_start,
+ element_size);
+ assert(m_pCues); //TODO
+
+ return 0; //success
+}
+#endif
+
+
+#if 0
+void Segment::ParseSeekEntry(
+ long long start,
+ long long size_)
+{
+ long long pos = start;
+
+ const long long stop = start + size_;
+
+ long len;
+
+ const long long seekIdId = ReadUInt(m_pReader, pos, len);
+ //seekIdId;
+ assert(seekIdId == 0x13AB); //SeekID ID
+ assert((pos + len) <= stop);
+
+ pos += len; //consume id
+
+ const long long seekIdSize = ReadUInt(m_pReader, pos, len);
+ assert(seekIdSize >= 0);
+ assert((pos + len) <= stop);
+
+ pos += len; //consume size
+
+ const long long seekId = ReadUInt(m_pReader, pos, len); //payload
+ assert(seekId >= 0);
+ assert(len == seekIdSize);
+ assert((pos + len) <= stop);
+
+ pos += seekIdSize; //consume payload
+
+ const long long seekPosId = ReadUInt(m_pReader, pos, len);
+ //seekPosId;
+ assert(seekPosId == 0x13AC); //SeekPos ID
+ assert((pos + len) <= stop);
+
+ pos += len; //consume id
+
+ const long long seekPosSize = ReadUInt(m_pReader, pos, len);
+ assert(seekPosSize >= 0);
+ assert((pos + len) <= stop);
+
+ pos += len; //consume size
+ assert((pos + seekPosSize) <= stop);
+
+ const long long seekOff = UnserializeUInt(m_pReader, pos, seekPosSize);
+ assert(seekOff >= 0);
+ assert(seekOff < m_size);
+
+ pos += seekPosSize; //consume payload
+ assert(pos == stop);
+
+ const long long seekPos = m_start + seekOff;
+ assert(seekPos < (m_start + m_size));
+
+ if (seekId == 0x0C53BB6B) //Cues ID
+ ParseCues(seekOff);
+}
+#else
+bool SeekHead::ParseEntry(
+ IMkvReader* pReader,
+ long long start,
+ long long size_,
+ Entry* pEntry)
+{
+ if (size_ <= 0)
+ return false;
+
+ long long pos = start;
+ const long long stop = start + size_;
+
+ long len;
+
+ //parse the container for the level-1 element ID
+
+ const long long seekIdId = ReadUInt(pReader, pos, len);
+ //seekIdId;
+
+ if (seekIdId != 0x13AB) //SeekID ID
+ return false;
+
+ if ((pos + len) > stop)
+ return false;
+
+ pos += len; //consume SeekID id
+
+ const long long seekIdSize = ReadUInt(pReader, pos, len);
+
+ if (seekIdSize <= 0)
+ return false;
+
+ if ((pos + len) > stop)
+ return false;
+
+ pos += len; //consume size of field
+
+ if ((pos + seekIdSize) > stop)
+ return false;
+
+ //Note that the SeekId payload really is serialized
+ //as a "Matroska integer", not as a plain binary value.
+ //In fact, Matroska requires that ID values in the
+ //stream exactly match the binary representation as listed
+ //in the Matroska specification.
+ //
+ //This parser is more liberal, and permits IDs to have
+ //any width. (This could make the representation in the stream
+ //different from what's in the spec, but it doesn't matter here,
+ //since we always normalize "Matroska integer" values.)
+
+ pEntry->id = ReadUInt(pReader, pos, len); //payload
+
+ if (pEntry->id <= 0)
+ return false;
+
+ if (len != seekIdSize)
+ return false;
+
+ pos += seekIdSize; //consume SeekID payload
+
+ const long long seekPosId = ReadUInt(pReader, pos, len);
+
+ if (seekPosId != 0x13AC) //SeekPos ID
+ return false;
+
+ if ((pos + len) > stop)
+ return false;
+
+ pos += len; //consume id
+
+ const long long seekPosSize = ReadUInt(pReader, pos, len);
+
+ if (seekPosSize <= 0)
+ return false;
+
+ if ((pos + len) > stop)
+ return false;
+
+ pos += len; //consume size
+
+ if ((pos + seekPosSize) > stop)
+ return false;
+
+ pEntry->pos = UnserializeUInt(pReader, pos, seekPosSize);
+
+ if (pEntry->pos < 0)
+ return false;
+
+ pos += seekPosSize; //consume payload
+
+ if (pos != stop)
+ return false;
+
+ return true;
+}
+#endif
+
+
+Cues::Cues(
+ Segment* pSegment,
+ long long start_,
+ long long size_,
+ long long element_start,
+ long long element_size) :
+ m_pSegment(pSegment),
+ m_start(start_),
+ m_size(size_),
+ m_element_start(element_start),
+ m_element_size(element_size),
+ m_cue_points(NULL),
+ m_count(0),
+ m_preload_count(0),
+ m_pos(start_)
+{
+}
+
+
+Cues::~Cues()
+{
+ const long n = m_count + m_preload_count;
+
+ CuePoint** p = m_cue_points;
+ CuePoint** const q = p + n;
+
+ while (p != q)
+ {
+ CuePoint* const pCP = *p++;
+ assert(pCP);
+
+ delete pCP;
+ }
+
+ delete[] m_cue_points;
+}
+
+
+long Cues::GetCount() const
+{
+ if (m_cue_points == NULL)
+ return -1;
+
+ return m_count; //TODO: really ignore preload count?
+}
+
+
+bool Cues::DoneParsing() const
+{
+ const long long stop = m_start + m_size;
+ return (m_pos >= stop);
+}
+
+
+void Cues::Init() const
+{
+ if (m_cue_points)
+ return;
+
+ assert(m_count == 0);
+ assert(m_preload_count == 0);
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ const long long stop = m_start + m_size;
+ long long pos = m_start;
+
+ long cue_points_size = 0;
+
+ while (pos < stop)
+ {
+ const long long idpos = pos;
+
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume ID
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0);
+ assert((pos + len) <= stop);
+
+ pos += len; //consume Size field
+ assert((pos + size) <= stop);
+
+ if (id == 0x3B) //CuePoint ID
+ PreloadCuePoint(cue_points_size, idpos);
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+}
+
+
+void Cues::PreloadCuePoint(
+ long& cue_points_size,
+ long long pos) const
+{
+ assert(m_count == 0);
+
+ if (m_preload_count >= cue_points_size)
+ {
+ const long n = (cue_points_size <= 0) ? 2048 : 2*cue_points_size;
+
+ CuePoint** const qq = new CuePoint*[n];
+ CuePoint** q = qq; //beginning of target
+
+ CuePoint** p = m_cue_points; //beginning of source
+ CuePoint** const pp = p + m_preload_count; //end of source
+
+ while (p != pp)
+ *q++ = *p++;
+
+ delete[] m_cue_points;
+
+ m_cue_points = qq;
+ cue_points_size = n;
+ }
+
+ CuePoint* const pCP = new CuePoint(m_preload_count, pos);
+ m_cue_points[m_preload_count++] = pCP;
+}
+
+
+bool Cues::LoadCuePoint() const
+{
+ //odbgstream os;
+ //os << "Cues::LoadCuePoint" << endl;
+
+ const long long stop = m_start + m_size;
+
+ if (m_pos >= stop)
+ return false; //nothing else to do
+
+ Init();
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ while (m_pos < stop)
+ {
+ const long long idpos = m_pos;
+
+ long len;
+
+ const long long id = ReadUInt(pReader, m_pos, len);
+ assert(id >= 0); //TODO
+ assert((m_pos + len) <= stop);
+
+ m_pos += len; //consume ID
+
+ const long long size = ReadUInt(pReader, m_pos, len);
+ assert(size >= 0);
+ assert((m_pos + len) <= stop);
+
+ m_pos += len; //consume Size field
+ assert((m_pos + size) <= stop);
+
+ if (id != 0x3B) //CuePoint ID
+ {
+ m_pos += size; //consume payload
+ assert(m_pos <= stop);
+
+ continue;
+ }
+
+ assert(m_preload_count > 0);
+
+ CuePoint* const pCP = m_cue_points[m_count];
+ assert(pCP);
+ assert((pCP->GetTimeCode() >= 0) || (-pCP->GetTimeCode() == idpos));
+ if (pCP->GetTimeCode() < 0 && (-pCP->GetTimeCode() != idpos))
+ return false;
+
+ pCP->Load(pReader);
+ ++m_count;
+ --m_preload_count;
+
+ m_pos += size; //consume payload
+ assert(m_pos <= stop);
+
+ return true; //yes, we loaded a cue point
+ }
+
+ //return (m_pos < stop);
+ return false; //no, we did not load a cue point
+}
+
+
+bool Cues::Find(
+ long long time_ns,
+ const Track* pTrack,
+ const CuePoint*& pCP,
+ const CuePoint::TrackPosition*& pTP) const
+{
+ assert(time_ns >= 0);
+ assert(pTrack);
+
+#if 0
+ LoadCuePoint(); //establish invariant
+
+ assert(m_cue_points);
+ assert(m_count > 0);
+
+ CuePoint** const ii = m_cue_points;
+ CuePoint** i = ii;
+
+ CuePoint** const jj = ii + m_count + m_preload_count;
+ CuePoint** j = jj;
+
+ pCP = *i;
+ assert(pCP);
+
+ if (time_ns <= pCP->GetTime(m_pSegment))
+ {
+ pTP = pCP->Find(pTrack);
+ return (pTP != NULL);
+ }
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[ii, i) <= time_ns
+ //[i, j) ?
+ //[j, jj) > time_ns
+
+ CuePoint** const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ CuePoint* const pCP = *k;
+ assert(pCP);
+
+ pCP->Load(pReader);
+
+ const long long t = pCP->GetTime(m_pSegment);
+
+ if (t <= time_ns)
+ i = k + 1;
+ else
+ j = k;
+
+ assert(i <= j);
+ }
+
+ assert(i == j);
+ assert(i <= jj);
+ assert(i > ii);
+
+ pCP = *--i;
+ assert(pCP);
+ assert(pCP->GetTime(m_pSegment) <= time_ns);
+#else
+ if (m_cue_points == NULL)
+ return false;
+
+ if (m_count == 0)
+ return false;
+
+ CuePoint** const ii = m_cue_points;
+ CuePoint** i = ii;
+
+ CuePoint** const jj = ii + m_count;
+ CuePoint** j = jj;
+
+ pCP = *i;
+ assert(pCP);
+
+ if (time_ns <= pCP->GetTime(m_pSegment))
+ {
+ pTP = pCP->Find(pTrack);
+ return (pTP != NULL);
+ }
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[ii, i) <= time_ns
+ //[i, j) ?
+ //[j, jj) > time_ns
+
+ CuePoint** const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ CuePoint* const pCP = *k;
+ assert(pCP);
+
+ const long long t = pCP->GetTime(m_pSegment);
+
+ if (t <= time_ns)
+ i = k + 1;
+ else
+ j = k;
+
+ assert(i <= j);
+ }
+
+ assert(i == j);
+ assert(i <= jj);
+ assert(i > ii);
+
+ pCP = *--i;
+ assert(pCP);
+ assert(pCP->GetTime(m_pSegment) <= time_ns);
+#endif
+
+ //TODO: here and elsewhere, it's probably not correct to search
+ //for the cue point with this time, and then search for a matching
+ //track. In principle, the matching track could be on some earlier
+ //cue point, and with our current algorithm, we'd miss it. To make
+ //this bullet-proof, we'd need to create a secondary structure,
+ //with a list of cue points that apply to a track, and then search
+ //that track-based structure for a matching cue point.
+
+ pTP = pCP->Find(pTrack);
+ return (pTP != NULL);
+}
+
+
+#if 0
+bool Cues::FindNext(
+ long long time_ns,
+ const Track* pTrack,
+ const CuePoint*& pCP,
+ const CuePoint::TrackPosition*& pTP) const
+{
+ pCP = 0;
+ pTP = 0;
+
+ if (m_count == 0)
+ return false;
+
+ assert(m_cue_points);
+
+ const CuePoint* const* const ii = m_cue_points;
+ const CuePoint* const* i = ii;
+
+ const CuePoint* const* const jj = ii + m_count;
+ const CuePoint* const* j = jj;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[ii, i) <= time_ns
+ //[i, j) ?
+ //[j, jj) > time_ns
+
+ const CuePoint* const* const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ pCP = *k;
+ assert(pCP);
+
+ const long long t = pCP->GetTime(m_pSegment);
+
+ if (t <= time_ns)
+ i = k + 1;
+ else
+ j = k;
+
+ assert(i <= j);
+ }
+
+ assert(i == j);
+ assert(i <= jj);
+
+ if (i >= jj) //time_ns is greater than max cue point
+ return false;
+
+ pCP = *i;
+ assert(pCP);
+ assert(pCP->GetTime(m_pSegment) > time_ns);
+
+ pTP = pCP->Find(pTrack);
+ return (pTP != NULL);
+}
+#endif
+
+
+const CuePoint* Cues::GetFirst() const
+{
+ if (m_cue_points == NULL)
+ return NULL;
+
+ if (m_count == 0)
+ return NULL;
+
+#if 0
+ LoadCuePoint(); //init cues
+
+ const size_t count = m_count + m_preload_count;
+
+ if (count == 0) //weird
+ return NULL;
+#endif
+
+ CuePoint* const* const pp = m_cue_points;
+ assert(pp);
+
+ CuePoint* const pCP = pp[0];
+ assert(pCP);
+ assert(pCP->GetTimeCode() >= 0);
+
+ return pCP;
+}
+
+
+const CuePoint* Cues::GetLast() const
+{
+ if (m_cue_points == NULL)
+ return NULL;
+
+ if (m_count <= 0)
+ return NULL;
+
+#if 0
+ LoadCuePoint(); //init cues
+
+ const size_t count = m_count + m_preload_count;
+
+ if (count == 0) //weird
+ return NULL;
+
+ const size_t index = count - 1;
+
+ CuePoint* const* const pp = m_cue_points;
+ assert(pp);
+
+ CuePoint* const pCP = pp[index];
+ assert(pCP);
+
+ pCP->Load(m_pSegment->m_pReader);
+ assert(pCP->GetTimeCode() >= 0);
+#else
+ const long index = m_count - 1;
+
+ CuePoint* const* const pp = m_cue_points;
+ assert(pp);
+
+ CuePoint* const pCP = pp[index];
+ assert(pCP);
+ assert(pCP->GetTimeCode() >= 0);
+#endif
+
+ return pCP;
+}
+
+
+const CuePoint* Cues::GetNext(const CuePoint* pCurr) const
+{
+ if (pCurr == NULL)
+ return NULL;
+
+ assert(pCurr->GetTimeCode() >= 0);
+ assert(m_cue_points);
+ assert(m_count >= 1);
+
+#if 0
+ const size_t count = m_count + m_preload_count;
+
+ size_t index = pCurr->m_index;
+ assert(index < count);
+
+ CuePoint* const* const pp = m_cue_points;
+ assert(pp);
+ assert(pp[index] == pCurr);
+
+ ++index;
+
+ if (index >= count)
+ return NULL;
+
+ CuePoint* const pNext = pp[index];
+ assert(pNext);
+
+ pNext->Load(m_pSegment->m_pReader);
+#else
+ long index = pCurr->m_index;
+ assert(index < m_count);
+
+ CuePoint* const* const pp = m_cue_points;
+ assert(pp);
+ assert(pp[index] == pCurr);
+
+ ++index;
+
+ if (index >= m_count)
+ return NULL;
+
+ CuePoint* const pNext = pp[index];
+ assert(pNext);
+ assert(pNext->GetTimeCode() >= 0);
+#endif
+
+ return pNext;
+}
+
+
+const BlockEntry* Cues::GetBlock(
+ const CuePoint* pCP,
+ const CuePoint::TrackPosition* pTP) const
+{
+ if (pCP == NULL)
+ return NULL;
+
+ if (pTP == NULL)
+ return NULL;
+
+ return m_pSegment->GetBlock(*pCP, *pTP);
+}
+
+
+const BlockEntry* Segment::GetBlock(
+ const CuePoint& cp,
+ const CuePoint::TrackPosition& tp)
+{
+ Cluster** const ii = m_clusters;
+ Cluster** i = ii;
+
+ const long count = m_clusterCount + m_clusterPreloadCount;
+
+ Cluster** const jj = ii + count;
+ Cluster** j = jj;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[ii, i) < pTP->m_pos
+ //[i, j) ?
+ //[j, jj) > pTP->m_pos
+
+ Cluster** const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ Cluster* const pCluster = *k;
+ assert(pCluster);
+
+ //const long long pos_ = pCluster->m_pos;
+ //assert(pos_);
+ //const long long pos = pos_ * ((pos_ < 0) ? -1 : 1);
+
+ const long long pos = pCluster->GetPosition();
+ assert(pos >= 0);
+
+ if (pos < tp.m_pos)
+ i = k + 1;
+ else if (pos > tp.m_pos)
+ j = k;
+ else
+ return pCluster->GetEntry(cp, tp);
+ }
+
+ assert(i == j);
+ //assert(Cluster::HasBlockEntries(this, tp.m_pos));
+
+ Cluster* const pCluster = Cluster::Create(this, -1, tp.m_pos); //, -1);
+ assert(pCluster);
+
+ const ptrdiff_t idx = i - m_clusters;
+
+ PreloadCluster(pCluster, idx);
+ assert(m_clusters);
+ assert(m_clusterPreloadCount > 0);
+ assert(m_clusters[idx] == pCluster);
+
+ return pCluster->GetEntry(cp, tp);
+}
+
+
+const Cluster* Segment::FindOrPreloadCluster(long long requested_pos)
+{
+ if (requested_pos < 0)
+ return 0;
+
+ Cluster** const ii = m_clusters;
+ Cluster** i = ii;
+
+ const long count = m_clusterCount + m_clusterPreloadCount;
+
+ Cluster** const jj = ii + count;
+ Cluster** j = jj;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[ii, i) < pTP->m_pos
+ //[i, j) ?
+ //[j, jj) > pTP->m_pos
+
+ Cluster** const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ Cluster* const pCluster = *k;
+ assert(pCluster);
+
+ //const long long pos_ = pCluster->m_pos;
+ //assert(pos_);
+ //const long long pos = pos_ * ((pos_ < 0) ? -1 : 1);
+
+ const long long pos = pCluster->GetPosition();
+ assert(pos >= 0);
+
+ if (pos < requested_pos)
+ i = k + 1;
+ else if (pos > requested_pos)
+ j = k;
+ else
+ return pCluster;
+ }
+
+ assert(i == j);
+ //assert(Cluster::HasBlockEntries(this, tp.m_pos));
+
+ Cluster* const pCluster = Cluster::Create(
+ this,
+ -1,
+ requested_pos);
+ //-1);
+ assert(pCluster);
+
+ const ptrdiff_t idx = i - m_clusters;
+
+ PreloadCluster(pCluster, idx);
+ assert(m_clusters);
+ assert(m_clusterPreloadCount > 0);
+ assert(m_clusters[idx] == pCluster);
+
+ return pCluster;
+}
+
+
+CuePoint::CuePoint(long idx, long long pos) :
+ m_element_start(0),
+ m_element_size(0),
+ m_index(idx),
+ m_timecode(-1 * pos),
+ m_track_positions(NULL),
+ m_track_positions_count(0)
+{
+ assert(pos > 0);
+}
+
+
+CuePoint::~CuePoint()
+{
+ delete[] m_track_positions;
+}
+
+
+void CuePoint::Load(IMkvReader* pReader)
+{
+ //odbgstream os;
+ //os << "CuePoint::Load(begin): timecode=" << m_timecode << endl;
+
+ if (m_timecode >= 0) //already loaded
+ return;
+
+ assert(m_track_positions == NULL);
+ assert(m_track_positions_count == 0);
+
+ long long pos_ = -m_timecode;
+ const long long element_start = pos_;
+
+ long long stop;
+
+ {
+ long len;
+
+ const long long id = ReadUInt(pReader, pos_, len);
+ assert(id == 0x3B); //CuePoint ID
+ if (id != 0x3B)
+ return;
+
+ pos_ += len; //consume ID
+
+ const long long size = ReadUInt(pReader, pos_, len);
+ assert(size >= 0);
+
+ pos_ += len; //consume Size field
+ //pos_ now points to start of payload
+
+ stop = pos_ + size;
+ }
+
+ const long long element_size = stop - element_start;
+
+ long long pos = pos_;
+
+ //First count number of track positions
+
+ while (pos < stop)
+ {
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume ID
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0);
+ assert((pos + len) <= stop);
+
+ pos += len; //consume Size field
+ assert((pos + size) <= stop);
+
+ if (id == 0x33) //CueTime ID
+ m_timecode = UnserializeUInt(pReader, pos, size);
+
+ else if (id == 0x37) //CueTrackPosition(s) ID
+ ++m_track_positions_count;
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(m_timecode >= 0);
+ assert(m_track_positions_count > 0);
+
+ //os << "CuePoint::Load(cont'd): idpos=" << idpos
+ // << " timecode=" << m_timecode
+ // << endl;
+
+ m_track_positions = new TrackPosition[m_track_positions_count];
+
+ //Now parse track positions
+
+ TrackPosition* p = m_track_positions;
+ pos = pos_;
+
+ while (pos < stop)
+ {
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume ID
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0);
+ assert((pos + len) <= stop);
+
+ pos += len; //consume Size field
+ assert((pos + size) <= stop);
+
+ if (id == 0x37) //CueTrackPosition(s) ID
+ {
+ TrackPosition& tp = *p++;
+ tp.Parse(pReader, pos, size);
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(size_t(p - m_track_positions) == m_track_positions_count);
+
+ m_element_start = element_start;
+ m_element_size = element_size;
+}
+
+
+
+void CuePoint::TrackPosition::Parse(
+ IMkvReader* pReader,
+ long long start_,
+ long long size_)
+{
+ const long long stop = start_ + size_;
+ long long pos = start_;
+
+ m_track = -1;
+ m_pos = -1;
+ m_block = 1; //default
+
+ while (pos < stop)
+ {
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume ID
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0);
+ assert((pos + len) <= stop);
+
+ pos += len; //consume Size field
+ assert((pos + size) <= stop);
+
+ if (id == 0x77) //CueTrack ID
+ m_track = UnserializeUInt(pReader, pos, size);
+
+ else if (id == 0x71) //CueClusterPos ID
+ m_pos = UnserializeUInt(pReader, pos, size);
+
+ else if (id == 0x1378) //CueBlockNumber
+ m_block = UnserializeUInt(pReader, pos, size);
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(m_pos >= 0);
+ assert(m_track > 0);
+ //assert(m_block > 0);
+}
+
+
+const CuePoint::TrackPosition* CuePoint::Find(const Track* pTrack) const
+{
+ assert(pTrack);
+
+ const long long n = pTrack->GetNumber();
+
+ const TrackPosition* i = m_track_positions;
+ const TrackPosition* const j = i + m_track_positions_count;
+
+ while (i != j)
+ {
+ const TrackPosition& p = *i++;
+
+ if (p.m_track == n)
+ return &p;
+ }
+
+ return NULL; //no matching track number found
+}
+
+
+long long CuePoint::GetTimeCode() const
+{
+ return m_timecode;
+}
+
+long long CuePoint::GetTime(const Segment* pSegment) const
+{
+ assert(pSegment);
+ assert(m_timecode >= 0);
+
+ const SegmentInfo* const pInfo = pSegment->GetInfo();
+ assert(pInfo);
+
+ const long long scale = pInfo->GetTimeCodeScale();
+ assert(scale >= 1);
+
+ const long long time = scale * m_timecode;
+
+ return time;
+}
+
+
+#if 0
+long long Segment::Unparsed() const
+{
+ if (m_size < 0)
+ return LLONG_MAX;
+
+ const long long stop = m_start + m_size;
+
+ const long long result = stop - m_pos;
+ assert(result >= 0);
+
+ return result;
+}
+#else
+bool Segment::DoneParsing() const
+{
+ if (m_size < 0)
+ {
+ long long total, avail;
+
+ const int status = m_pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return true; //must assume done
+
+ if (total < 0)
+ return false; //assume live stream
+
+ return (m_pos >= total);
+ }
+
+ const long long stop = m_start + m_size;
+
+ return (m_pos >= stop);
+}
+#endif
+
+
+const Cluster* Segment::GetFirst() const
+{
+ if ((m_clusters == NULL) || (m_clusterCount <= 0))
+ return &m_eos;
+
+ Cluster* const pCluster = m_clusters[0];
+ assert(pCluster);
+
+ return pCluster;
+}
+
+
+const Cluster* Segment::GetLast() const
+{
+ if ((m_clusters == NULL) || (m_clusterCount <= 0))
+ return &m_eos;
+
+ const long idx = m_clusterCount - 1;
+
+ Cluster* const pCluster = m_clusters[idx];
+ assert(pCluster);
+
+ return pCluster;
+}
+
+
+unsigned long Segment::GetCount() const
+{
+ return m_clusterCount;
+}
+
+
+const Cluster* Segment::GetNext(const Cluster* pCurr)
+{
+ assert(pCurr);
+ assert(pCurr != &m_eos);
+ assert(m_clusters);
+
+ long idx = pCurr->m_index;
+
+ if (idx >= 0)
+ {
+ assert(m_clusterCount > 0);
+ assert(idx < m_clusterCount);
+ assert(pCurr == m_clusters[idx]);
+
+ ++idx;
+
+ if (idx >= m_clusterCount)
+ return &m_eos; //caller will LoadCluster as desired
+
+ Cluster* const pNext = m_clusters[idx];
+ assert(pNext);
+ assert(pNext->m_index >= 0);
+ assert(pNext->m_index == idx);
+
+ return pNext;
+ }
+
+ assert(m_clusterPreloadCount > 0);
+
+ long long pos = pCurr->m_element_start;
+
+ assert(m_size >= 0); //TODO
+ const long long stop = m_start + m_size; //end of segment
+
+ {
+ long len;
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+ assert(result == 0);
+ assert((pos + len) <= stop); //TODO
+ if (result != 0)
+ return NULL;
+
+ const long long id = ReadUInt(m_pReader, pos, len);
+ assert(id == 0x0F43B675); //Cluster ID
+ if (id != 0x0F43B675)
+ return NULL;
+
+ pos += len; //consume ID
+
+ //Read Size
+ result = GetUIntLength(m_pReader, pos, len);
+ assert(result == 0); //TODO
+ assert((pos + len) <= stop); //TODO
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+ assert(size > 0); //TODO
+ //assert((pCurr->m_size <= 0) || (pCurr->m_size == size));
+
+ pos += len; //consume length of size of element
+ assert((pos + size) <= stop); //TODO
+
+ //Pos now points to start of payload
+
+ pos += size; //consume payload
+ }
+
+ long long off_next = 0;
+
+ while (pos < stop)
+ {
+ long len;
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+ assert(result == 0);
+ assert((pos + len) <= stop); //TODO
+ if (result != 0)
+ return NULL;
+
+ const long long idpos = pos; //pos of next (potential) cluster
+
+ const long long id = ReadUInt(m_pReader, idpos, len);
+ assert(id > 0); //TODO
+
+ pos += len; //consume ID
+
+ //Read Size
+ result = GetUIntLength(m_pReader, pos, len);
+ assert(result == 0); //TODO
+ assert((pos + len) <= stop); //TODO
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+ assert(size >= 0); //TODO
+
+ pos += len; //consume length of size of element
+ assert((pos + size) <= stop); //TODO
+
+ //Pos now points to start of payload
+
+ if (size == 0) //weird
+ continue;
+
+ if (id == 0x0F43B675) //Cluster ID
+ {
+ const long long off_next_ = idpos - m_start;
+
+ long long pos_;
+ long len_;
+
+ const long status = Cluster::HasBlockEntries(
+ this,
+ off_next_,
+ pos_,
+ len_);
+
+ assert(status >= 0);
+
+ if (status > 0)
+ {
+ off_next = off_next_;
+ break;
+ }
+ }
+
+ pos += size; //consume payload
+ }
+
+ if (off_next <= 0)
+ return 0;
+
+ Cluster** const ii = m_clusters + m_clusterCount;
+ Cluster** i = ii;
+
+ Cluster** const jj = ii + m_clusterPreloadCount;
+ Cluster** j = jj;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[0, i) < pos_next
+ //[i, j) ?
+ //[j, jj) > pos_next
+
+ Cluster** const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ Cluster* const pNext = *k;
+ assert(pNext);
+ assert(pNext->m_index < 0);
+
+ //const long long pos_ = pNext->m_pos;
+ //assert(pos_);
+ //pos = pos_ * ((pos_ < 0) ? -1 : 1);
+
+ pos = pNext->GetPosition();
+
+ if (pos < off_next)
+ i = k + 1;
+ else if (pos > off_next)
+ j = k;
+ else
+ return pNext;
+ }
+
+ assert(i == j);
+
+ Cluster* const pNext = Cluster::Create(this,
+ -1,
+ off_next);
+ assert(pNext);
+
+ const ptrdiff_t idx_next = i - m_clusters; //insertion position
+
+ PreloadCluster(pNext, idx_next);
+ assert(m_clusters);
+ assert(idx_next < m_clusterSize);
+ assert(m_clusters[idx_next] == pNext);
+
+ return pNext;
+}
+
+
+long Segment::ParseNext(
+ const Cluster* pCurr,
+ const Cluster*& pResult,
+ long long& pos,
+ long& len)
+{
+ assert(pCurr);
+ assert(!pCurr->EOS());
+ assert(m_clusters);
+
+ pResult = 0;
+
+ if (pCurr->m_index >= 0) //loaded (not merely preloaded)
+ {
+ assert(m_clusters[pCurr->m_index] == pCurr);
+
+ const long next_idx = pCurr->m_index + 1;
+
+ if (next_idx < m_clusterCount)
+ {
+ pResult = m_clusters[next_idx];
+ return 0; //success
+ }
+
+ //curr cluster is last among loaded
+
+ const long result = LoadCluster(pos, len);
+
+ if (result < 0) //error or underflow
+ return result;
+
+ if (result > 0) //no more clusters
+ {
+ //pResult = &m_eos;
+ return 1;
+ }
+
+ pResult = GetLast();
+ return 0; //success
+ }
+
+ assert(m_pos > 0);
+
+ long long total, avail;
+
+ long status = m_pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ const long long segment_stop = (m_size < 0) ? -1 : m_start + m_size;
+
+ //interrogate curr cluster
+
+ pos = pCurr->m_element_start;
+
+ if (pCurr->m_element_size >= 0)
+ pos += pCurr->m_element_size;
+ else
+ {
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id = ReadUInt(m_pReader, pos, len);
+
+ if (id != 0x0F43B675) //weird: not Cluster ID
+ return -1;
+
+ pos += len; //consume ID
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume size field
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size) //TODO: should never happen
+ return E_FILE_FORMAT_INVALID; //TODO: resolve this
+
+ //assert((pCurr->m_size <= 0) || (pCurr->m_size == size));
+
+ if ((segment_stop >= 0) && ((pos + size) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ //Pos now points to start of payload
+
+ pos += size; //consume payload (that is, the current cluster)
+ assert((segment_stop < 0) || (pos <= segment_stop));
+
+ //By consuming the payload, we are assuming that the curr
+ //cluster isn't interesting. That is, we don't bother checking
+ //whether the payload of the curr cluster is less than what
+ //happens to be available (obtained via IMkvReader::Length).
+ //Presumably the caller has already dispensed with the current
+ //cluster, and really does want the next cluster.
+ }
+
+ //pos now points to just beyond the last fully-loaded cluster
+
+ for (;;)
+ {
+ const long status = DoParseNext(pResult, pos, len);
+
+ if (status <= 1)
+ return status;
+ }
+}
+
+
+long Segment::DoParseNext(
+ const Cluster*& pResult,
+ long long& pos,
+ long& len)
+{
+ long long total, avail;
+
+ long status = m_pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ const long long segment_stop = (m_size < 0) ? -1 : m_start + m_size;
+
+ //Parse next cluster. This is strictly a parsing activity.
+ //Creation of a new cluster object happens later, after the
+ //parsing is done.
+
+ long long off_next = 0;
+ long long cluster_size = -1;
+
+ for (;;)
+ {
+ if ((total >= 0) && (pos >= total))
+ return 1; //EOF
+
+ if ((segment_stop >= 0) && (pos >= segment_stop))
+ return 1; //EOF
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long idpos = pos; //absolute
+ const long long idoff = pos - m_start; //relative
+
+ const long long id = ReadUInt(m_pReader, idpos, len); //absolute
+
+ if (id < 0) //error
+ return static_cast<long>(id);
+
+ if (id == 0) //weird
+ return -1; //generic error
+
+ pos += len; //consume ID
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume length of size of element
+
+ //Pos now points to start of payload
+
+ if (size == 0) //weird
+ continue;
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if ((segment_stop >= 0) &&
+ (size != unknown_size) &&
+ ((pos + size) > segment_stop))
+ {
+ return E_FILE_FORMAT_INVALID;
+ }
+
+ if (id == 0x0C53BB6B) //Cues ID
+ {
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID;
+
+ const long long element_stop = pos + size;
+
+ if ((segment_stop >= 0) && (element_stop > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ const long long element_start = idpos;
+ const long long element_size = element_stop - element_start;
+
+ if (m_pCues == NULL)
+ {
+ m_pCues = new Cues(this,
+ pos,
+ size,
+ element_start,
+ element_size);
+ assert(m_pCues); //TODO
+ }
+
+ pos += size; //consume payload
+ assert((segment_stop < 0) || (pos <= segment_stop));
+
+ continue;
+ }
+
+ if (id != 0x0F43B675) //not a Cluster ID
+ {
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += size; //consume payload
+ assert((segment_stop < 0) || (pos <= segment_stop));
+
+ continue;
+ }
+
+#if 0 //this is commented-out to support incremental cluster parsing
+ len = static_cast<long>(size);
+
+ if (element_stop > avail)
+ return E_BUFFER_NOT_FULL;
+#endif
+
+ //We have a cluster.
+
+ off_next = idoff;
+
+ if (size != unknown_size)
+ cluster_size = size;
+
+ break;
+ }
+
+ assert(off_next > 0); //have cluster
+
+ //We have parsed the next cluster.
+ //We have not created a cluster object yet. What we need
+ //to do now is determine whether it has already be preloaded
+ //(in which case, an object for this cluster has already been
+ //created), and if not, create a new cluster object.
+
+ Cluster** const ii = m_clusters + m_clusterCount;
+ Cluster** i = ii;
+
+ Cluster** const jj = ii + m_clusterPreloadCount;
+ Cluster** j = jj;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[0, i) < pos_next
+ //[i, j) ?
+ //[j, jj) > pos_next
+
+ Cluster** const k = i + (j - i) / 2;
+ assert(k < jj);
+
+ const Cluster* const pNext = *k;
+ assert(pNext);
+ assert(pNext->m_index < 0);
+
+ pos = pNext->GetPosition();
+ assert(pos >= 0);
+
+ if (pos < off_next)
+ i = k + 1;
+ else if (pos > off_next)
+ j = k;
+ else
+ {
+ pResult = pNext;
+ return 0; //success
+ }
+ }
+
+ assert(i == j);
+
+ long long pos_;
+ long len_;
+
+ status = Cluster::HasBlockEntries(this, off_next, pos_, len_);
+
+ if (status < 0) //error or underflow
+ {
+ pos = pos_;
+ len = len_;
+
+ return status;
+ }
+
+ if (status > 0) //means "found at least one block entry"
+ {
+ Cluster* const pNext = Cluster::Create(this,
+ -1, //preloaded
+ off_next);
+ //element_size);
+ assert(pNext);
+
+ const ptrdiff_t idx_next = i - m_clusters; //insertion position
+
+ PreloadCluster(pNext, idx_next);
+ assert(m_clusters);
+ assert(idx_next < m_clusterSize);
+ assert(m_clusters[idx_next] == pNext);
+
+ pResult = pNext;
+ return 0; //success
+ }
+
+ //status == 0 means "no block entries found"
+
+ if (cluster_size < 0) //unknown size
+ {
+ const long long payload_pos = pos; //absolute pos of cluster payload
+
+ for (;;) //determine cluster size
+ {
+ if ((total >= 0) && (pos >= total))
+ break;
+
+ if ((segment_stop >= 0) && (pos >= segment_stop))
+ break; //no more clusters
+
+ //Read ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long idpos = pos;
+ const long long id = ReadUInt(m_pReader, idpos, len);
+
+ if (id < 0) //error (or underflow)
+ return static_cast<long>(id);
+
+ //This is the distinguished set of ID's we use to determine
+ //that we have exhausted the sub-element's inside the cluster
+ //whose ID we parsed earlier.
+
+ if (id == 0x0F43B675) //Cluster ID
+ break;
+
+ if (id == 0x0C53BB6B) //Cues ID
+ break;
+
+ pos += len; //consume ID (of sub-element)
+
+ //Read Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(m_pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(m_pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume size field of element
+
+ //pos now points to start of sub-element's payload
+
+ if (size == 0) //weird
+ continue;
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //not allowed for sub-elements
+
+ if ((segment_stop >= 0) && ((pos + size) > segment_stop)) //weird
+ return E_FILE_FORMAT_INVALID;
+
+ pos += size; //consume payload of sub-element
+ assert((segment_stop < 0) || (pos <= segment_stop));
+ } //determine cluster size
+
+ cluster_size = pos - payload_pos;
+ assert(cluster_size >= 0); //TODO: handle cluster_size = 0
+
+ pos = payload_pos; //reset and re-parse original cluster
+ }
+
+ pos += cluster_size; //consume payload
+ assert((segment_stop < 0) || (pos <= segment_stop));
+
+ return 2; //try to find a cluster that follows next
+}
+
+
+const Cluster* Segment::FindCluster(long long time_ns) const
+{
+ if ((m_clusters == NULL) || (m_clusterCount <= 0))
+ return &m_eos;
+
+ {
+ Cluster* const pCluster = m_clusters[0];
+ assert(pCluster);
+ assert(pCluster->m_index == 0);
+
+ if (time_ns <= pCluster->GetTime())
+ return pCluster;
+ }
+
+ //Binary search of cluster array
+
+ long i = 0;
+ long j = m_clusterCount;
+
+ while (i < j)
+ {
+ //INVARIANT:
+ //[0, i) <= time_ns
+ //[i, j) ?
+ //[j, m_clusterCount) > time_ns
+
+ const long k = i + (j - i) / 2;
+ assert(k < m_clusterCount);
+
+ Cluster* const pCluster = m_clusters[k];
+ assert(pCluster);
+ assert(pCluster->m_index == k);
+
+ const long long t = pCluster->GetTime();
+
+ if (t <= time_ns)
+ i = k + 1;
+ else
+ j = k;
+
+ assert(i <= j);
+ }
+
+ assert(i == j);
+ assert(i > 0);
+ assert(i <= m_clusterCount);
+
+ const long k = i - 1;
+
+ Cluster* const pCluster = m_clusters[k];
+ assert(pCluster);
+ assert(pCluster->m_index == k);
+ assert(pCluster->GetTime() <= time_ns);
+
+ return pCluster;
+}
+
+
+#if 0
+const BlockEntry* Segment::Seek(
+ long long time_ns,
+ const Track* pTrack) const
+{
+ assert(pTrack);
+
+ if ((m_clusters == NULL) || (m_clusterCount <= 0))
+ return pTrack->GetEOS();
+
+ Cluster** const i = m_clusters;
+ assert(i);
+
+ {
+ Cluster* const pCluster = *i;
+ assert(pCluster);
+ assert(pCluster->m_index == 0); //m_clusterCount > 0
+ assert(pCluster->m_pSegment == this);
+
+ if (time_ns <= pCluster->GetTime())
+ return pCluster->GetEntry(pTrack);
+ }
+
+ Cluster** const j = i + m_clusterCount;
+
+ if (pTrack->GetType() == 2) //audio
+ {
+ //TODO: we could decide to use cues for this, as we do for video.
+ //But we only use it for video because looking around for a keyframe
+ //can get expensive. Audio doesn't require anything special so a
+ //straight cluster search is good enough (we assume).
+
+ Cluster** lo = i;
+ Cluster** hi = j;
+
+ while (lo < hi)
+ {
+ //INVARIANT:
+ //[i, lo) <= time_ns
+ //[lo, hi) ?
+ //[hi, j) > time_ns
+
+ Cluster** const mid = lo + (hi - lo) / 2;
+ assert(mid < hi);
+
+ Cluster* const pCluster = *mid;
+ assert(pCluster);
+ assert(pCluster->m_index == long(mid - m_clusters));
+ assert(pCluster->m_pSegment == this);
+
+ const long long t = pCluster->GetTime();
+
+ if (t <= time_ns)
+ lo = mid + 1;
+ else
+ hi = mid;
+
+ assert(lo <= hi);
+ }
+
+ assert(lo == hi);
+ assert(lo > i);
+ assert(lo <= j);
+
+ while (lo > i)
+ {
+ Cluster* const pCluster = *--lo;
+ assert(pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ const BlockEntry* const pBE = pCluster->GetEntry(pTrack);
+
+ if ((pBE != 0) && !pBE->EOS())
+ return pBE;
+
+ //landed on empty cluster (no entries)
+ }
+
+ return pTrack->GetEOS(); //weird
+ }
+
+ assert(pTrack->GetType() == 1); //video
+
+ Cluster** lo = i;
+ Cluster** hi = j;
+
+ while (lo < hi)
+ {
+ //INVARIANT:
+ //[i, lo) <= time_ns
+ //[lo, hi) ?
+ //[hi, j) > time_ns
+
+ Cluster** const mid = lo + (hi - lo) / 2;
+ assert(mid < hi);
+
+ Cluster* const pCluster = *mid;
+ assert(pCluster);
+
+ const long long t = pCluster->GetTime();
+
+ if (t <= time_ns)
+ lo = mid + 1;
+ else
+ hi = mid;
+
+ assert(lo <= hi);
+ }
+
+ assert(lo == hi);
+ assert(lo > i);
+ assert(lo <= j);
+
+ Cluster* pCluster = *--lo;
+ assert(pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ {
+ const BlockEntry* const pBE = pCluster->GetEntry(pTrack, time_ns);
+
+ if ((pBE != 0) && !pBE->EOS()) //found a keyframe
+ return pBE;
+ }
+
+ const VideoTrack* const pVideo = static_cast<const VideoTrack*>(pTrack);
+
+ while (lo != i)
+ {
+ pCluster = *--lo;
+ assert(pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ const BlockEntry* const pBlockEntry = pCluster->GetMaxKey(pVideo);
+
+ if ((pBlockEntry != 0) && !pBlockEntry->EOS())
+ return pBlockEntry;
+ }
+
+ //weird: we're on the first cluster, but no keyframe found
+ //should never happen but we must return something anyway
+
+ return pTrack->GetEOS();
+}
+#endif
+
+
+#if 0
+bool Segment::SearchCues(
+ long long time_ns,
+ Track* pTrack,
+ Cluster*& pCluster,
+ const BlockEntry*& pBlockEntry,
+ const CuePoint*& pCP,
+ const CuePoint::TrackPosition*& pTP)
+{
+ if (pTrack->GetType() != 1) //not video
+ return false; //TODO: for now, just handle video stream
+
+ if (m_pCues == NULL)
+ return false;
+
+ if (!m_pCues->Find(time_ns, pTrack, pCP, pTP))
+ return false; //weird
+
+ assert(pCP);
+ assert(pTP);
+ assert(pTP->m_track == pTrack->GetNumber());
+
+ //We have the cue point and track position we want,
+ //so we now need to search for the cluster having
+ //the indicated position.
+
+ return GetCluster(pCP, pTP, pCluster, pBlockEntry);
+}
+#endif
+
+
+const Tracks* Segment::GetTracks() const
+{
+ return m_pTracks;
+}
+
+
+const SegmentInfo* Segment::GetInfo() const
+{
+ return m_pInfo;
+}
+
+
+const Cues* Segment::GetCues() const
+{
+ return m_pCues;
+}
+
+
+const Chapters* Segment::GetChapters() const
+{
+ return m_pChapters;
+}
+
+
+const SeekHead* Segment::GetSeekHead() const
+{
+ return m_pSeekHead;
+}
+
+
+long long Segment::GetDuration() const
+{
+ assert(m_pInfo);
+ return m_pInfo->GetDuration();
+}
+
+
+Chapters::Chapters(
+ Segment* pSegment,
+ long long payload_start,
+ long long payload_size,
+ long long element_start,
+ long long element_size) :
+ m_pSegment(pSegment),
+ m_start(payload_start),
+ m_size(payload_size),
+ m_element_start(element_start),
+ m_element_size(element_size),
+ m_editions(NULL),
+ m_editions_size(0),
+ m_editions_count(0)
+{
+}
+
+
+Chapters::~Chapters()
+{
+ while (m_editions_count > 0)
+ {
+ Edition& e = m_editions[--m_editions_count];
+ e.Clear();
+ }
+}
+
+
+long Chapters::Parse()
+{
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long pos = m_start; // payload start
+ const long long stop = pos + m_size; // payload stop
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) // error
+ return status;
+
+ if (size == 0) // weird
+ continue;
+
+ if (id == 0x05B9) // EditionEntry ID
+ {
+ status = ParseEdition(pos, size);
+
+ if (status < 0) // error
+ return status;
+ }
+
+ pos += size;
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+ return 0;
+}
+
+
+int Chapters::GetEditionCount() const
+{
+ return m_editions_count;
+}
+
+
+const Chapters::Edition* Chapters::GetEdition(int idx) const
+{
+ if (idx < 0)
+ return NULL;
+
+ if (idx >= m_editions_count)
+ return NULL;
+
+ return m_editions + idx;
+}
+
+
+bool Chapters::ExpandEditionsArray()
+{
+ if (m_editions_size > m_editions_count)
+ return true; // nothing else to do
+
+ const int size = (m_editions_size == 0) ? 1 : 2 * m_editions_size;
+
+ Edition* const editions = new (std::nothrow) Edition[size];
+
+ if (editions == NULL)
+ return false;
+
+ for (int idx = 0; idx < m_editions_count; ++idx)
+ {
+ m_editions[idx].ShallowCopy(editions[idx]);
+ }
+
+ delete[] m_editions;
+ m_editions = editions;
+
+ m_editions_size = size;
+ return true;
+}
+
+
+long Chapters::ParseEdition(
+ long long pos,
+ long long size)
+{
+ if (!ExpandEditionsArray())
+ return -1;
+
+ Edition& e = m_editions[m_editions_count++];
+ e.Init();
+
+ return e.Parse(m_pSegment->m_pReader, pos, size);
+}
+
+
+Chapters::Edition::Edition()
+{
+}
+
+
+Chapters::Edition::~Edition()
+{
+}
+
+
+int Chapters::Edition::GetAtomCount() const
+{
+ return m_atoms_count;
+}
+
+
+const Chapters::Atom* Chapters::Edition::GetAtom(int index) const
+{
+ if (index < 0)
+ return NULL;
+
+ if (index >= m_atoms_count)
+ return NULL;
+
+ return m_atoms + index;
+}
+
+
+void Chapters::Edition::Init()
+{
+ m_atoms = NULL;
+ m_atoms_size = 0;
+ m_atoms_count = 0;
+}
+
+
+void Chapters::Edition::ShallowCopy(Edition& rhs) const
+{
+ rhs.m_atoms = m_atoms;
+ rhs.m_atoms_size = m_atoms_size;
+ rhs.m_atoms_count = m_atoms_count;
+}
+
+
+void Chapters::Edition::Clear()
+{
+ while (m_atoms_count > 0)
+ {
+ Atom& a = m_atoms[--m_atoms_count];
+ a.Clear();
+ }
+
+ delete[] m_atoms;
+ m_atoms = NULL;
+
+ m_atoms_size = 0;
+}
+
+
+long Chapters::Edition::Parse(
+ IMkvReader* pReader,
+ long long pos,
+ long long size)
+{
+ const long long stop = pos + size;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) // error
+ return status;
+
+ if (size == 0) // weird
+ continue;
+
+ if (id == 0x36) // Atom ID
+ {
+ status = ParseAtom(pReader, pos, size);
+
+ if (status < 0) // error
+ return status;
+ }
+
+ pos += size;
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+ return 0;
+}
+
+
+long Chapters::Edition::ParseAtom(
+ IMkvReader* pReader,
+ long long pos,
+ long long size)
+{
+ if (!ExpandAtomsArray())
+ return -1;
+
+ Atom& a = m_atoms[m_atoms_count++];
+ a.Init();
+
+ return a.Parse(pReader, pos, size);
+}
+
+
+bool Chapters::Edition::ExpandAtomsArray()
+{
+ if (m_atoms_size > m_atoms_count)
+ return true; // nothing else to do
+
+ const int size = (m_atoms_size == 0) ? 1 : 2 * m_atoms_size;
+
+ Atom* const atoms = new (std::nothrow) Atom[size];
+
+ if (atoms == NULL)
+ return false;
+
+ for (int idx = 0; idx < m_atoms_count; ++idx)
+ {
+ m_atoms[idx].ShallowCopy(atoms[idx]);
+ }
+
+ delete[] m_atoms;
+ m_atoms = atoms;
+
+ m_atoms_size = size;
+ return true;
+}
+
+
+Chapters::Atom::Atom()
+{
+}
+
+
+Chapters::Atom::~Atom()
+{
+}
+
+
+unsigned long long Chapters::Atom::GetUID() const
+{
+ return m_uid;
+}
+
+
+const char* Chapters::Atom::GetStringUID() const
+{
+ return m_string_uid;
+}
+
+
+long long Chapters::Atom::GetStartTimecode() const
+{
+ return m_start_timecode;
+}
+
+
+long long Chapters::Atom::GetStopTimecode() const
+{
+ return m_stop_timecode;
+}
+
+
+long long Chapters::Atom::GetStartTime(const Chapters* pChapters) const
+{
+ return GetTime(pChapters, m_start_timecode);
+}
+
+
+long long Chapters::Atom::GetStopTime(const Chapters* pChapters) const
+{
+ return GetTime(pChapters, m_stop_timecode);
+}
+
+
+int Chapters::Atom::GetDisplayCount() const
+{
+ return m_displays_count;
+}
+
+
+const Chapters::Display* Chapters::Atom::GetDisplay(int index) const
+{
+ if (index < 0)
+ return NULL;
+
+ if (index >= m_displays_count)
+ return NULL;
+
+ return m_displays + index;
+}
+
+
+void Chapters::Atom::Init()
+{
+ m_string_uid = NULL;
+ m_uid = 0;
+ m_start_timecode = -1;
+ m_stop_timecode = -1;
+
+ m_displays = NULL;
+ m_displays_size = 0;
+ m_displays_count = 0;
+}
+
+
+void Chapters::Atom::ShallowCopy(Atom& rhs) const
+{
+ rhs.m_string_uid = m_string_uid;
+ rhs.m_uid = m_uid;
+ rhs.m_start_timecode = m_start_timecode;
+ rhs.m_stop_timecode = m_stop_timecode;
+
+ rhs.m_displays = m_displays;
+ rhs.m_displays_size = m_displays_size;
+ rhs.m_displays_count = m_displays_count;
+}
+
+
+void Chapters::Atom::Clear()
+{
+ delete[] m_string_uid;
+ m_string_uid = NULL;
+
+ while (m_displays_count > 0)
+ {
+ Display& d = m_displays[--m_displays_count];
+ d.Clear();
+ }
+
+ delete[] m_displays;
+ m_displays = NULL;
+
+ m_displays_size = 0;
+}
+
+
+long Chapters::Atom::Parse(
+ IMkvReader* pReader,
+ long long pos,
+ long long size)
+{
+ const long long stop = pos + size;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) // error
+ return status;
+
+ if (size == 0) // weird
+ continue;
+
+ if (id == 0x00) // Display ID
+ {
+ status = ParseDisplay(pReader, pos, size);
+
+ if (status < 0) // error
+ return status;
+ }
+ else if (id == 0x1654) // StringUID ID
+ {
+ status = UnserializeString(pReader, pos, size, m_string_uid);
+
+ if (status < 0) // error
+ return status;
+ }
+ else if (id == 0x33C4) // UID ID
+ {
+ const long long val = UnserializeUInt(pReader, pos, size);
+
+ if (val < 0) // error
+ return static_cast<long>(val);
+
+ m_uid = val;
+ }
+ else if (id == 0x11) // TimeStart ID
+ {
+ const long long val = UnserializeUInt(pReader, pos, size);
+
+ if (val < 0) // error
+ return static_cast<long>(val);
+
+ m_start_timecode = val;
+ }
+ else if (id == 0x12) // TimeEnd ID
+ {
+ const long long val = UnserializeUInt(pReader, pos, size);
+
+ if (val < 0) // error
+ return static_cast<long>(val);
+
+ m_stop_timecode = val;
+ }
+
+ pos += size;
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+ return 0;
+}
+
+
+long long Chapters::Atom::GetTime(
+ const Chapters* pChapters,
+ long long timecode)
+{
+ if (pChapters == NULL)
+ return -1;
+
+ Segment* const pSegment = pChapters->m_pSegment;
+
+ if (pSegment == NULL) // weird
+ return -1;
+
+ const SegmentInfo* const pInfo = pSegment->GetInfo();
+
+ if (pInfo == NULL)
+ return -1;
+
+ const long long timecode_scale = pInfo->GetTimeCodeScale();
+
+ if (timecode_scale < 1) // weird
+ return -1;
+
+ if (timecode < 0)
+ return -1;
+
+ const long long result = timecode_scale * timecode;
+
+ return result;
+}
+
+
+long Chapters::Atom::ParseDisplay(
+ IMkvReader* pReader,
+ long long pos,
+ long long size)
+{
+ if (!ExpandDisplaysArray())
+ return -1;
+
+ Display& d = m_displays[m_displays_count++];
+ d.Init();
+
+ return d.Parse(pReader, pos, size);
+}
+
+
+bool Chapters::Atom::ExpandDisplaysArray()
+{
+ if (m_displays_size > m_displays_count)
+ return true; // nothing else to do
+
+ const int size = (m_displays_size == 0) ? 1 : 2 * m_displays_size;
+
+ Display* const displays = new (std::nothrow) Display[size];
+
+ if (displays == NULL)
+ return false;
+
+ for (int idx = 0; idx < m_displays_count; ++idx)
+ {
+ m_displays[idx].ShallowCopy(displays[idx]);
+ }
+
+ delete[] m_displays;
+ m_displays = displays;
+
+ m_displays_size = size;
+ return true;
+}
+
+
+Chapters::Display::Display()
+{
+}
+
+
+Chapters::Display::~Display()
+{
+}
+
+
+const char* Chapters::Display::GetString() const
+{
+ return m_string;
+}
+
+
+const char* Chapters::Display::GetLanguage() const
+{
+ return m_language;
+}
+
+
+const char* Chapters::Display::GetCountry() const
+{
+ return m_country;
+}
+
+
+void Chapters::Display::Init()
+{
+ m_string = NULL;
+ m_language = NULL;
+ m_country = NULL;
+}
+
+
+void Chapters::Display::ShallowCopy(Display& rhs) const
+{
+ rhs.m_string = m_string;
+ rhs.m_language = m_language;
+ rhs.m_country = m_country;
+}
+
+
+void Chapters::Display::Clear()
+{
+ delete[] m_string;
+ m_string = NULL;
+
+ delete[] m_language;
+ m_language = NULL;
+
+ delete[] m_country;
+ m_country = NULL;
+}
+
+
+long Chapters::Display::Parse(
+ IMkvReader* pReader,
+ long long pos,
+ long long size)
+{
+ const long long stop = pos + size;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) // error
+ return status;
+
+ if (size == 0) // weird
+ continue;
+
+ if (id == 0x05) // ChapterString ID
+ {
+ status = UnserializeString(pReader, pos, size, m_string);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x037C) // ChapterLanguage ID
+ {
+ status = UnserializeString(pReader, pos, size, m_language);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x037E) // ChapterCountry ID
+ {
+ status = UnserializeString(pReader, pos, size, m_country);
+
+ if (status)
+ return status;
+ }
+
+ pos += size;
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+ return 0;
+}
+
+
+SegmentInfo::SegmentInfo(
+ Segment* pSegment,
+ long long start,
+ long long size_,
+ long long element_start,
+ long long element_size) :
+ m_pSegment(pSegment),
+ m_start(start),
+ m_size(size_),
+ m_element_start(element_start),
+ m_element_size(element_size),
+ m_pMuxingAppAsUTF8(NULL),
+ m_pWritingAppAsUTF8(NULL),
+ m_pTitleAsUTF8(NULL)
+{
+}
+
+SegmentInfo::~SegmentInfo()
+{
+ delete[] m_pMuxingAppAsUTF8;
+ m_pMuxingAppAsUTF8 = NULL;
+
+ delete[] m_pWritingAppAsUTF8;
+ m_pWritingAppAsUTF8 = NULL;
+
+ delete[] m_pTitleAsUTF8;
+ m_pTitleAsUTF8 = NULL;
+}
+
+
+long SegmentInfo::Parse()
+{
+ assert(m_pMuxingAppAsUTF8 == NULL);
+ assert(m_pWritingAppAsUTF8 == NULL);
+ assert(m_pTitleAsUTF8 == NULL);
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long pos = m_start;
+ const long long stop = m_start + m_size;
+
+ m_timecodeScale = 1000000;
+ m_duration = -1;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x0AD7B1) //Timecode Scale
+ {
+ m_timecodeScale = UnserializeUInt(pReader, pos, size);
+
+ if (m_timecodeScale <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x0489) //Segment duration
+ {
+ const long status = UnserializeFloat(
+ pReader,
+ pos,
+ size,
+ m_duration);
+
+ if (status < 0)
+ return status;
+
+ if (m_duration < 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x0D80) //MuxingApp
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ m_pMuxingAppAsUTF8);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x1741) //WritingApp
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ m_pWritingAppAsUTF8);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x3BA9) //Title
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ m_pTitleAsUTF8);
+
+ if (status)
+ return status;
+ }
+
+ pos += size;
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ return 0;
+}
+
+
+long long SegmentInfo::GetTimeCodeScale() const
+{
+ return m_timecodeScale;
+}
+
+
+long long SegmentInfo::GetDuration() const
+{
+ if (m_duration < 0)
+ return -1;
+
+ assert(m_timecodeScale >= 1);
+
+ const double dd = double(m_duration) * double(m_timecodeScale);
+ const long long d = static_cast<long long>(dd);
+
+ return d;
+}
+
+const char* SegmentInfo::GetMuxingAppAsUTF8() const
+{
+ return m_pMuxingAppAsUTF8;
+}
+
+
+const char* SegmentInfo::GetWritingAppAsUTF8() const
+{
+ return m_pWritingAppAsUTF8;
+}
+
+const char* SegmentInfo::GetTitleAsUTF8() const
+{
+ return m_pTitleAsUTF8;
+}
+
+///////////////////////////////////////////////////////////////
+// ContentEncoding element
+ContentEncoding::ContentCompression::ContentCompression()
+ : algo(0),
+ settings(NULL),
+ settings_len(0) {
+}
+
+ContentEncoding::ContentCompression::~ContentCompression() {
+ delete [] settings;
+}
+
+ContentEncoding::ContentEncryption::ContentEncryption()
+ : algo(0),
+ key_id(NULL),
+ key_id_len(0),
+ signature(NULL),
+ signature_len(0),
+ sig_key_id(NULL),
+ sig_key_id_len(0),
+ sig_algo(0),
+ sig_hash_algo(0) {
+}
+
+ContentEncoding::ContentEncryption::~ContentEncryption() {
+ delete [] key_id;
+ delete [] signature;
+ delete [] sig_key_id;
+}
+
+ContentEncoding::ContentEncoding()
+ : compression_entries_(NULL),
+ compression_entries_end_(NULL),
+ encryption_entries_(NULL),
+ encryption_entries_end_(NULL),
+ encoding_order_(0),
+ encoding_scope_(1),
+ encoding_type_(0) {
+}
+
+ContentEncoding::~ContentEncoding() {
+ ContentCompression** comp_i = compression_entries_;
+ ContentCompression** const comp_j = compression_entries_end_;
+
+ while (comp_i != comp_j) {
+ ContentCompression* const comp = *comp_i++;
+ delete comp;
+ }
+
+ delete [] compression_entries_;
+
+ ContentEncryption** enc_i = encryption_entries_;
+ ContentEncryption** const enc_j = encryption_entries_end_;
+
+ while (enc_i != enc_j) {
+ ContentEncryption* const enc = *enc_i++;
+ delete enc;
+ }
+
+ delete [] encryption_entries_;
+}
+
+
+const ContentEncoding::ContentCompression*
+ContentEncoding::GetCompressionByIndex(unsigned long idx) const {
+ const ptrdiff_t count = compression_entries_end_ - compression_entries_;
+ assert(count >= 0);
+
+ if (idx >= static_cast<unsigned long>(count))
+ return NULL;
+
+ return compression_entries_[idx];
+}
+
+unsigned long ContentEncoding::GetCompressionCount() const {
+ const ptrdiff_t count = compression_entries_end_ - compression_entries_;
+ assert(count >= 0);
+
+ return static_cast<unsigned long>(count);
+}
+
+const ContentEncoding::ContentEncryption*
+ContentEncoding::GetEncryptionByIndex(unsigned long idx) const {
+ const ptrdiff_t count = encryption_entries_end_ - encryption_entries_;
+ assert(count >= 0);
+
+ if (idx >= static_cast<unsigned long>(count))
+ return NULL;
+
+ return encryption_entries_[idx];
+}
+
+unsigned long ContentEncoding::GetEncryptionCount() const {
+ const ptrdiff_t count = encryption_entries_end_ - encryption_entries_;
+ assert(count >= 0);
+
+ return static_cast<unsigned long>(count);
+}
+
+long ContentEncoding::ParseContentEncAESSettingsEntry(
+ long long start,
+ long long size,
+ IMkvReader* pReader,
+ ContentEncAESSettings* aes) {
+ assert(pReader);
+ assert(aes);
+
+ long long pos = start;
+ const long long stop = start + size;
+
+ while (pos < stop) {
+ long long id, size;
+ const long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x7E8) {
+ // AESSettingsCipherMode
+ aes->cipher_mode = UnserializeUInt(pReader, pos, size);
+ if (aes->cipher_mode != 1)
+ return E_FILE_FORMAT_INVALID;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ return 0;
+}
+
+long ContentEncoding::ParseContentEncodingEntry(long long start,
+ long long size,
+ IMkvReader* pReader) {
+ assert(pReader);
+
+ long long pos = start;
+ const long long stop = start + size;
+
+ // Count ContentCompression and ContentEncryption elements.
+ int compression_count = 0;
+ int encryption_count = 0;
+
+ while (pos < stop) {
+ long long id, size;
+ const long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x1034) // ContentCompression ID
+ ++compression_count;
+
+ if (id == 0x1035) // ContentEncryption ID
+ ++encryption_count;
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ if (compression_count <= 0 && encryption_count <= 0)
+ return -1;
+
+ if (compression_count > 0) {
+ compression_entries_ =
+ new (std::nothrow) ContentCompression*[compression_count];
+ if (!compression_entries_)
+ return -1;
+ compression_entries_end_ = compression_entries_;
+ }
+
+ if (encryption_count > 0) {
+ encryption_entries_ =
+ new (std::nothrow) ContentEncryption*[encryption_count];
+ if (!encryption_entries_) {
+ delete [] compression_entries_;
+ return -1;
+ }
+ encryption_entries_end_ = encryption_entries_;
+ }
+
+ pos = start;
+ while (pos < stop) {
+ long long id, size;
+ long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x1031) {
+ // ContentEncodingOrder
+ encoding_order_ = UnserializeUInt(pReader, pos, size);
+ } else if (id == 0x1032) {
+ // ContentEncodingScope
+ encoding_scope_ = UnserializeUInt(pReader, pos, size);
+ if (encoding_scope_ < 1)
+ return -1;
+ } else if (id == 0x1033) {
+ // ContentEncodingType
+ encoding_type_ = UnserializeUInt(pReader, pos, size);
+ } else if (id == 0x1034) {
+ // ContentCompression ID
+ ContentCompression* const compression =
+ new (std::nothrow) ContentCompression();
+ if (!compression)
+ return -1;
+
+ status = ParseCompressionEntry(pos, size, pReader, compression);
+ if (status) {
+ delete compression;
+ return status;
+ }
+ *compression_entries_end_++ = compression;
+ } else if (id == 0x1035) {
+ // ContentEncryption ID
+ ContentEncryption* const encryption =
+ new (std::nothrow) ContentEncryption();
+ if (!encryption)
+ return -1;
+
+ status = ParseEncryptionEntry(pos, size, pReader, encryption);
+ if (status) {
+ delete encryption;
+ return status;
+ }
+ *encryption_entries_end_++ = encryption;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+ return 0;
+}
+
+long ContentEncoding::ParseCompressionEntry(
+ long long start,
+ long long size,
+ IMkvReader* pReader,
+ ContentCompression* compression) {
+ assert(pReader);
+ assert(compression);
+
+ long long pos = start;
+ const long long stop = start + size;
+
+ bool valid = false;
+
+ while (pos < stop) {
+ long long id, size;
+ const long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x254) {
+ // ContentCompAlgo
+ long long algo = UnserializeUInt(pReader, pos, size);
+ if (algo < 0)
+ return E_FILE_FORMAT_INVALID;
+ compression->algo = algo;
+ valid = true;
+ } else if (id == 0x255) {
+ // ContentCompSettings
+ if (size <= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ const size_t buflen = static_cast<size_t>(size);
+ typedef unsigned char* buf_t;
+ const buf_t buf = new (std::nothrow) unsigned char[buflen];
+ if (buf == NULL)
+ return -1;
+
+ const int read_status = pReader->Read(pos, buflen, buf);
+ if (read_status) {
+ delete [] buf;
+ return status;
+ }
+
+ compression->settings = buf;
+ compression->settings_len = buflen;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ // ContentCompAlgo is mandatory
+ if (!valid)
+ return E_FILE_FORMAT_INVALID;
+
+ return 0;
+}
+
+long ContentEncoding::ParseEncryptionEntry(
+ long long start,
+ long long size,
+ IMkvReader* pReader,
+ ContentEncryption* encryption) {
+ assert(pReader);
+ assert(encryption);
+
+ long long pos = start;
+ const long long stop = start + size;
+
+ while (pos < stop) {
+ long long id, size;
+ const long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x7E1) {
+ // ContentEncAlgo
+ encryption->algo = UnserializeUInt(pReader, pos, size);
+ if (encryption->algo != 5)
+ return E_FILE_FORMAT_INVALID;
+ } else if (id == 0x7E2) {
+ // ContentEncKeyID
+ delete[] encryption->key_id;
+ encryption->key_id = NULL;
+ encryption->key_id_len = 0;
+
+ if (size <= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ const size_t buflen = static_cast<size_t>(size);
+ typedef unsigned char* buf_t;
+ const buf_t buf = new (std::nothrow) unsigned char[buflen];
+ if (buf == NULL)
+ return -1;
+
+ const int read_status = pReader->Read(pos, buflen, buf);
+ if (read_status) {
+ delete [] buf;
+ return status;
+ }
+
+ encryption->key_id = buf;
+ encryption->key_id_len = buflen;
+ } else if (id == 0x7E3) {
+ // ContentSignature
+ delete[] encryption->signature;
+ encryption->signature = NULL;
+ encryption->signature_len = 0;
+
+ if (size <= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ const size_t buflen = static_cast<size_t>(size);
+ typedef unsigned char* buf_t;
+ const buf_t buf = new (std::nothrow) unsigned char[buflen];
+ if (buf == NULL)
+ return -1;
+
+ const int read_status = pReader->Read(pos, buflen, buf);
+ if (read_status) {
+ delete [] buf;
+ return status;
+ }
+
+ encryption->signature = buf;
+ encryption->signature_len = buflen;
+ } else if (id == 0x7E4) {
+ // ContentSigKeyID
+ delete[] encryption->sig_key_id;
+ encryption->sig_key_id = NULL;
+ encryption->sig_key_id_len = 0;
+
+ if (size <= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ const size_t buflen = static_cast<size_t>(size);
+ typedef unsigned char* buf_t;
+ const buf_t buf = new (std::nothrow) unsigned char[buflen];
+ if (buf == NULL)
+ return -1;
+
+ const int read_status = pReader->Read(pos, buflen, buf);
+ if (read_status) {
+ delete [] buf;
+ return status;
+ }
+
+ encryption->sig_key_id = buf;
+ encryption->sig_key_id_len = buflen;
+ } else if (id == 0x7E5) {
+ // ContentSigAlgo
+ encryption->sig_algo = UnserializeUInt(pReader, pos, size);
+ } else if (id == 0x7E6) {
+ // ContentSigHashAlgo
+ encryption->sig_hash_algo = UnserializeUInt(pReader, pos, size);
+ } else if (id == 0x7E7) {
+ // ContentEncAESSettings
+ const long status = ParseContentEncAESSettingsEntry(
+ pos,
+ size,
+ pReader,
+ &encryption->aes_settings);
+ if (status)
+ return status;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ return 0;
+}
+
+Track::Track(
+ Segment* pSegment,
+ long long element_start,
+ long long element_size) :
+ m_pSegment(pSegment),
+ m_element_start(element_start),
+ m_element_size(element_size),
+ content_encoding_entries_(NULL),
+ content_encoding_entries_end_(NULL)
+{
+}
+
+Track::~Track()
+{
+ Info& info = const_cast<Info&>(m_info);
+ info.Clear();
+
+ ContentEncoding** i = content_encoding_entries_;
+ ContentEncoding** const j = content_encoding_entries_end_;
+
+ while (i != j) {
+ ContentEncoding* const encoding = *i++;
+ delete encoding;
+ }
+
+ delete [] content_encoding_entries_;
+}
+
+long Track::Create(
+ Segment* pSegment,
+ const Info& info,
+ long long element_start,
+ long long element_size,
+ Track*& pResult)
+{
+ if (pResult)
+ return -1;
+
+ Track* const pTrack = new (std::nothrow) Track(pSegment,
+ element_start,
+ element_size);
+
+ if (pTrack == NULL)
+ return -1; //generic error
+
+ const int status = info.Copy(pTrack->m_info);
+
+ if (status) // error
+ {
+ delete pTrack;
+ return status;
+ }
+
+ pResult = pTrack;
+ return 0; //success
+}
+
+Track::Info::Info():
+ uid(0),
+ defaultDuration(0),
+ codecDelay(0),
+ seekPreRoll(0),
+ nameAsUTF8(NULL),
+ language(NULL),
+ codecId(NULL),
+ codecNameAsUTF8(NULL),
+ codecPrivate(NULL),
+ codecPrivateSize(0),
+ lacing(false)
+{
+}
+
+Track::Info::~Info()
+{
+ Clear();
+}
+
+void Track::Info::Clear()
+{
+ delete[] nameAsUTF8;
+ nameAsUTF8 = NULL;
+
+ delete[] language;
+ language = NULL;
+
+ delete[] codecId;
+ codecId = NULL;
+
+ delete[] codecPrivate;
+ codecPrivate = NULL;
+ codecPrivateSize = 0;
+
+ delete[] codecNameAsUTF8;
+ codecNameAsUTF8 = NULL;
+}
+
+int Track::Info::CopyStr(char* Info::*str, Info& dst_) const
+{
+ if (str == static_cast<char* Info::*>(NULL))
+ return -1;
+
+ char*& dst = dst_.*str;
+
+ if (dst) //should be NULL already
+ return -1;
+
+ const char* const src = this->*str;
+
+ if (src == NULL)
+ return 0;
+
+ const size_t len = strlen(src);
+
+ dst = new (std::nothrow) char[len+1];
+
+ if (dst == NULL)
+ return -1;
+
+ strcpy(dst, src);
+
+ return 0;
+}
+
+
+int Track::Info::Copy(Info& dst) const
+{
+ if (&dst == this)
+ return 0;
+
+ dst.type = type;
+ dst.number = number;
+ dst.defaultDuration = defaultDuration;
+ dst.codecDelay = codecDelay;
+ dst.seekPreRoll = seekPreRoll;
+ dst.uid = uid;
+ dst.lacing = lacing;
+ dst.settings = settings;
+
+ //We now copy the string member variables from src to dst.
+ //This involves memory allocation so in principle the operation
+ //can fail (indeed, that's why we have Info::Copy), so we must
+ //report this to the caller. An error return from this function
+ //therefore implies that the copy was only partially successful.
+
+ if (int status = CopyStr(&Info::nameAsUTF8, dst))
+ return status;
+
+ if (int status = CopyStr(&Info::language, dst))
+ return status;
+
+ if (int status = CopyStr(&Info::codecId, dst))
+ return status;
+
+ if (int status = CopyStr(&Info::codecNameAsUTF8, dst))
+ return status;
+
+ if (codecPrivateSize > 0)
+ {
+ if (codecPrivate == NULL)
+ return -1;
+
+ if (dst.codecPrivate)
+ return -1;
+
+ if (dst.codecPrivateSize != 0)
+ return -1;
+
+ dst.codecPrivate = new (std::nothrow) unsigned char[codecPrivateSize];
+
+ if (dst.codecPrivate == NULL)
+ return -1;
+
+ memcpy(dst.codecPrivate, codecPrivate, codecPrivateSize);
+ dst.codecPrivateSize = codecPrivateSize;
+ }
+
+ return 0;
+}
+
+const BlockEntry* Track::GetEOS() const
+{
+ return &m_eos;
+}
+
+long Track::GetType() const
+{
+ return m_info.type;
+}
+
+long Track::GetNumber() const
+{
+ return m_info.number;
+}
+
+unsigned long long Track::GetUid() const
+{
+ return m_info.uid;
+}
+
+const char* Track::GetNameAsUTF8() const
+{
+ return m_info.nameAsUTF8;
+}
+
+const char* Track::GetLanguage() const
+{
+ return m_info.language;
+}
+
+const char* Track::GetCodecNameAsUTF8() const
+{
+ return m_info.codecNameAsUTF8;
+}
+
+
+const char* Track::GetCodecId() const
+{
+ return m_info.codecId;
+}
+
+const unsigned char* Track::GetCodecPrivate(size_t& size) const
+{
+ size = m_info.codecPrivateSize;
+ return m_info.codecPrivate;
+}
+
+
+bool Track::GetLacing() const
+{
+ return m_info.lacing;
+}
+
+unsigned long long Track::GetDefaultDuration() const
+{
+ return m_info.defaultDuration;
+}
+
+unsigned long long Track::GetCodecDelay() const
+{
+ return m_info.codecDelay;
+}
+
+unsigned long long Track::GetSeekPreRoll() const
+{
+ return m_info.seekPreRoll;
+}
+
+long Track::GetFirst(const BlockEntry*& pBlockEntry) const
+{
+ const Cluster* pCluster = m_pSegment->GetFirst();
+
+ for (int i = 0; ; )
+ {
+ if (pCluster == NULL)
+ {
+ pBlockEntry = GetEOS();
+ return 1;
+ }
+
+ if (pCluster->EOS())
+ {
+#if 0
+ if (m_pSegment->Unparsed() <= 0) //all clusters have been loaded
+ {
+ pBlockEntry = GetEOS();
+ return 1;
+ }
+#else
+ if (m_pSegment->DoneParsing())
+ {
+ pBlockEntry = GetEOS();
+ return 1;
+ }
+#endif
+
+ pBlockEntry = 0;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long status = pCluster->GetFirst(pBlockEntry);
+
+ if (status < 0) //error
+ return status;
+
+ if (pBlockEntry == 0) //empty cluster
+ {
+ pCluster = m_pSegment->GetNext(pCluster);
+ continue;
+ }
+
+ for (;;)
+ {
+ const Block* const pBlock = pBlockEntry->GetBlock();
+ assert(pBlock);
+
+ const long long tn = pBlock->GetTrackNumber();
+
+ if ((tn == m_info.number) && VetEntry(pBlockEntry))
+ return 0;
+
+ const BlockEntry* pNextEntry;
+
+ status = pCluster->GetNext(pBlockEntry, pNextEntry);
+
+ if (status < 0) //error
+ return status;
+
+ if (pNextEntry == 0)
+ break;
+
+ pBlockEntry = pNextEntry;
+ }
+
+ ++i;
+
+ if (i >= 100)
+ break;
+
+ pCluster = m_pSegment->GetNext(pCluster);
+ }
+
+ //NOTE: if we get here, it means that we didn't find a block with
+ //a matching track number. We interpret that as an error (which
+ //might be too conservative).
+
+ pBlockEntry = GetEOS(); //so we can return a non-NULL value
+ return 1;
+}
+
+
+long Track::GetNext(
+ const BlockEntry* pCurrEntry,
+ const BlockEntry*& pNextEntry) const
+{
+ assert(pCurrEntry);
+ assert(!pCurrEntry->EOS()); //?
+
+ const Block* const pCurrBlock = pCurrEntry->GetBlock();
+ assert(pCurrBlock && pCurrBlock->GetTrackNumber() == m_info.number);
+ if (!pCurrBlock || pCurrBlock->GetTrackNumber() != m_info.number)
+ return -1;
+
+ const Cluster* pCluster = pCurrEntry->GetCluster();
+ assert(pCluster);
+ assert(!pCluster->EOS());
+
+ long status = pCluster->GetNext(pCurrEntry, pNextEntry);
+
+ if (status < 0) //error
+ return status;
+
+ for (int i = 0; ; )
+ {
+ while (pNextEntry)
+ {
+ const Block* const pNextBlock = pNextEntry->GetBlock();
+ assert(pNextBlock);
+
+ if (pNextBlock->GetTrackNumber() == m_info.number)
+ return 0;
+
+ pCurrEntry = pNextEntry;
+
+ status = pCluster->GetNext(pCurrEntry, pNextEntry);
+
+ if (status < 0) //error
+ return status;
+ }
+
+ pCluster = m_pSegment->GetNext(pCluster);
+
+ if (pCluster == NULL)
+ {
+ pNextEntry = GetEOS();
+ return 1;
+ }
+
+ if (pCluster->EOS())
+ {
+#if 0
+ if (m_pSegment->Unparsed() <= 0) //all clusters have been loaded
+ {
+ pNextEntry = GetEOS();
+ return 1;
+ }
+#else
+ if (m_pSegment->DoneParsing())
+ {
+ pNextEntry = GetEOS();
+ return 1;
+ }
+#endif
+
+ //TODO: there is a potential O(n^2) problem here: we tell the
+ //caller to (pre)load another cluster, which he does, but then he
+ //calls GetNext again, which repeats the same search. This is
+ //a pathological case, since the only way it can happen is if
+ //there exists a long sequence of clusters none of which contain a
+ // block from this track. One way around this problem is for the
+ //caller to be smarter when he loads another cluster: don't call
+ //us back until you have a cluster that contains a block from this
+ //track. (Of course, that's not cheap either, since our caller
+ //would have to scan the each cluster as it's loaded, so that
+ //would just push back the problem.)
+
+ pNextEntry = NULL;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ status = pCluster->GetFirst(pNextEntry);
+
+ if (status < 0) //error
+ return status;
+
+ if (pNextEntry == NULL) //empty cluster
+ continue;
+
+ ++i;
+
+ if (i >= 100)
+ break;
+ }
+
+ //NOTE: if we get here, it means that we didn't find a block with
+ //a matching track number after lots of searching, so we give
+ //up trying.
+
+ pNextEntry = GetEOS(); //so we can return a non-NULL value
+ return 1;
+}
+
+bool Track::VetEntry(const BlockEntry* pBlockEntry) const
+{
+ assert(pBlockEntry);
+ const Block* const pBlock = pBlockEntry->GetBlock();
+ assert(pBlock);
+ assert(pBlock->GetTrackNumber() == m_info.number);
+ if (!pBlock || pBlock->GetTrackNumber() != m_info.number)
+ return false;
+
+ // This function is used during a seek to determine whether the
+ // frame is a valid seek target. This default function simply
+ // returns true, which means all frames are valid seek targets.
+ // It gets overridden by the VideoTrack class, because only video
+ // keyframes can be used as seek target.
+
+ return true;
+}
+
+long Track::Seek(
+ long long time_ns,
+ const BlockEntry*& pResult) const
+{
+ const long status = GetFirst(pResult);
+
+ if (status < 0) //buffer underflow, etc
+ return status;
+
+ assert(pResult);
+
+ if (pResult->EOS())
+ return 0;
+
+ const Cluster* pCluster = pResult->GetCluster();
+ assert(pCluster);
+ assert(pCluster->GetIndex() >= 0);
+
+ if (time_ns <= pResult->GetBlock()->GetTime(pCluster))
+ return 0;
+
+ Cluster** const clusters = m_pSegment->m_clusters;
+ assert(clusters);
+
+ const long count = m_pSegment->GetCount(); //loaded only, not preloaded
+ assert(count > 0);
+
+ Cluster** const i = clusters + pCluster->GetIndex();
+ assert(i);
+ assert(*i == pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ Cluster** const j = clusters + count;
+
+ Cluster** lo = i;
+ Cluster** hi = j;
+
+ while (lo < hi)
+ {
+ //INVARIANT:
+ //[i, lo) <= time_ns
+ //[lo, hi) ?
+ //[hi, j) > time_ns
+
+ Cluster** const mid = lo + (hi - lo) / 2;
+ assert(mid < hi);
+
+ pCluster = *mid;
+ assert(pCluster);
+ assert(pCluster->GetIndex() >= 0);
+ assert(pCluster->GetIndex() == long(mid - m_pSegment->m_clusters));
+
+ const long long t = pCluster->GetTime();
+
+ if (t <= time_ns)
+ lo = mid + 1;
+ else
+ hi = mid;
+
+ assert(lo <= hi);
+ }
+
+ assert(lo == hi);
+ assert(lo > i);
+ assert(lo <= j);
+
+ while (lo > i)
+ {
+ pCluster = *--lo;
+ assert(pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ pResult = pCluster->GetEntry(this);
+
+ if ((pResult != 0) && !pResult->EOS())
+ return 0;
+
+ //landed on empty cluster (no entries)
+ }
+
+ pResult = GetEOS(); //weird
+ return 0;
+}
+
+const ContentEncoding*
+Track::GetContentEncodingByIndex(unsigned long idx) const {
+ const ptrdiff_t count =
+ content_encoding_entries_end_ - content_encoding_entries_;
+ assert(count >= 0);
+
+ if (idx >= static_cast<unsigned long>(count))
+ return NULL;
+
+ return content_encoding_entries_[idx];
+}
+
+unsigned long Track::GetContentEncodingCount() const {
+ const ptrdiff_t count =
+ content_encoding_entries_end_ - content_encoding_entries_;
+ assert(count >= 0);
+
+ return static_cast<unsigned long>(count);
+}
+
+long Track::ParseContentEncodingsEntry(long long start, long long size) {
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+ assert(pReader);
+
+ long long pos = start;
+ const long long stop = start + size;
+
+ // Count ContentEncoding elements.
+ int count = 0;
+ while (pos < stop) {
+ long long id, size;
+ const long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+
+ //pos now designates start of element
+ if (id == 0x2240) // ContentEncoding ID
+ ++count;
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ if (count <= 0)
+ return -1;
+
+ content_encoding_entries_ = new (std::nothrow) ContentEncoding*[count];
+ if (!content_encoding_entries_)
+ return -1;
+
+ content_encoding_entries_end_ = content_encoding_entries_;
+
+ pos = start;
+ while (pos < stop) {
+ long long id, size;
+ long status = ParseElementHeader(pReader,
+ pos,
+ stop,
+ id,
+ size);
+ if (status < 0) //error
+ return status;
+
+ //pos now designates start of element
+ if (id == 0x2240) { // ContentEncoding ID
+ ContentEncoding* const content_encoding =
+ new (std::nothrow) ContentEncoding();
+ if (!content_encoding)
+ return -1;
+
+ status = content_encoding->ParseContentEncodingEntry(pos,
+ size,
+ pReader);
+ if (status) {
+ delete content_encoding;
+ return status;
+ }
+
+ *content_encoding_entries_end_++ = content_encoding;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ return 0;
+}
+
+Track::EOSBlock::EOSBlock() :
+ BlockEntry(NULL, LONG_MIN)
+{
+}
+
+BlockEntry::Kind Track::EOSBlock::GetKind() const
+{
+ return kBlockEOS;
+}
+
+
+const Block* Track::EOSBlock::GetBlock() const
+{
+ return NULL;
+}
+
+
+VideoTrack::VideoTrack(
+ Segment* pSegment,
+ long long element_start,
+ long long element_size) :
+ Track(pSegment, element_start, element_size)
+{
+}
+
+
+long VideoTrack::Parse(
+ Segment* pSegment,
+ const Info& info,
+ long long element_start,
+ long long element_size,
+ VideoTrack*& pResult)
+{
+ if (pResult)
+ return -1;
+
+ if (info.type != Track::kVideo)
+ return -1;
+
+ long long width = 0;
+ long long height = 0;
+ double rate = 0.0;
+
+ IMkvReader* const pReader = pSegment->m_pReader;
+
+ const Settings& s = info.settings;
+ assert(s.start >= 0);
+ assert(s.size >= 0);
+
+ long long pos = s.start;
+ assert(pos >= 0);
+
+ const long long stop = pos + s.size;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x30) //pixel width
+ {
+ width = UnserializeUInt(pReader, pos, size);
+
+ if (width <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x3A) //pixel height
+ {
+ height = UnserializeUInt(pReader, pos, size);
+
+ if (height <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x0383E3) //frame rate
+ {
+ const long status = UnserializeFloat(
+ pReader,
+ pos,
+ size,
+ rate);
+
+ if (status < 0)
+ return status;
+
+ if (rate <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ VideoTrack* const pTrack = new (std::nothrow) VideoTrack(pSegment,
+ element_start,
+ element_size);
+
+ if (pTrack == NULL)
+ return -1; //generic error
+
+ const int status = info.Copy(pTrack->m_info);
+
+ if (status) // error
+ {
+ delete pTrack;
+ return status;
+ }
+
+ pTrack->m_width = width;
+ pTrack->m_height = height;
+ pTrack->m_rate = rate;
+
+ pResult = pTrack;
+ return 0; //success
+}
+
+
+bool VideoTrack::VetEntry(const BlockEntry* pBlockEntry) const
+{
+ return Track::VetEntry(pBlockEntry) && pBlockEntry->GetBlock()->IsKey();
+}
+
+long VideoTrack::Seek(
+ long long time_ns,
+ const BlockEntry*& pResult) const
+{
+ const long status = GetFirst(pResult);
+
+ if (status < 0) //buffer underflow, etc
+ return status;
+
+ assert(pResult);
+
+ if (pResult->EOS())
+ return 0;
+
+ const Cluster* pCluster = pResult->GetCluster();
+ assert(pCluster);
+ assert(pCluster->GetIndex() >= 0);
+
+ if (time_ns <= pResult->GetBlock()->GetTime(pCluster))
+ return 0;
+
+ Cluster** const clusters = m_pSegment->m_clusters;
+ assert(clusters);
+
+ const long count = m_pSegment->GetCount(); //loaded only, not pre-loaded
+ assert(count > 0);
+
+ Cluster** const i = clusters + pCluster->GetIndex();
+ assert(i);
+ assert(*i == pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ Cluster** const j = clusters + count;
+
+ Cluster** lo = i;
+ Cluster** hi = j;
+
+ while (lo < hi)
+ {
+ //INVARIANT:
+ //[i, lo) <= time_ns
+ //[lo, hi) ?
+ //[hi, j) > time_ns
+
+ Cluster** const mid = lo + (hi - lo) / 2;
+ assert(mid < hi);
+
+ pCluster = *mid;
+ assert(pCluster);
+ assert(pCluster->GetIndex() >= 0);
+ assert(pCluster->GetIndex() == long(mid - m_pSegment->m_clusters));
+
+ const long long t = pCluster->GetTime();
+
+ if (t <= time_ns)
+ lo = mid + 1;
+ else
+ hi = mid;
+
+ assert(lo <= hi);
+ }
+
+ assert(lo == hi);
+ assert(lo > i);
+ assert(lo <= j);
+
+ pCluster = *--lo;
+ assert(pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+ pResult = pCluster->GetEntry(this, time_ns);
+
+ if ((pResult != 0) && !pResult->EOS()) //found a keyframe
+ return 0;
+
+ while (lo != i)
+ {
+ pCluster = *--lo;
+ assert(pCluster);
+ assert(pCluster->GetTime() <= time_ns);
+
+#if 0
+ //TODO:
+ //We need to handle the case when a cluster
+ //contains multiple keyframes. Simply returning
+ //the largest keyframe on the cluster isn't
+ //good enough.
+ pResult = pCluster->GetMaxKey(this);
+#else
+ pResult = pCluster->GetEntry(this, time_ns);
+#endif
+
+ if ((pResult != 0) && !pResult->EOS())
+ return 0;
+ }
+
+ //weird: we're on the first cluster, but no keyframe found
+ //should never happen but we must return something anyway
+
+ pResult = GetEOS();
+ return 0;
+}
+
+
+long long VideoTrack::GetWidth() const
+{
+ return m_width;
+}
+
+
+long long VideoTrack::GetHeight() const
+{
+ return m_height;
+}
+
+
+double VideoTrack::GetFrameRate() const
+{
+ return m_rate;
+}
+
+
+AudioTrack::AudioTrack(
+ Segment* pSegment,
+ long long element_start,
+ long long element_size) :
+ Track(pSegment, element_start, element_size)
+{
+}
+
+
+long AudioTrack::Parse(
+ Segment* pSegment,
+ const Info& info,
+ long long element_start,
+ long long element_size,
+ AudioTrack*& pResult)
+{
+ if (pResult)
+ return -1;
+
+ if (info.type != Track::kAudio)
+ return -1;
+
+ IMkvReader* const pReader = pSegment->m_pReader;
+
+ const Settings& s = info.settings;
+ assert(s.start >= 0);
+ assert(s.size >= 0);
+
+ long long pos = s.start;
+ assert(pos >= 0);
+
+ const long long stop = pos + s.size;
+
+ double rate = 8000.0; // MKV default
+ long long channels = 1;
+ long long bit_depth = 0;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (id == 0x35) //Sample Rate
+ {
+ status = UnserializeFloat(pReader, pos, size, rate);
+
+ if (status < 0)
+ return status;
+
+ if (rate <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x1F) //Channel Count
+ {
+ channels = UnserializeUInt(pReader, pos, size);
+
+ if (channels <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x2264) //Bit Depth
+ {
+ bit_depth = UnserializeUInt(pReader, pos, size);
+
+ if (bit_depth <= 0)
+ return E_FILE_FORMAT_INVALID;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ AudioTrack* const pTrack = new (std::nothrow) AudioTrack(pSegment,
+ element_start,
+ element_size);
+
+ if (pTrack == NULL)
+ return -1; //generic error
+
+ const int status = info.Copy(pTrack->m_info);
+
+ if (status)
+ {
+ delete pTrack;
+ return status;
+ }
+
+ pTrack->m_rate = rate;
+ pTrack->m_channels = channels;
+ pTrack->m_bitDepth = bit_depth;
+
+ pResult = pTrack;
+ return 0; //success
+}
+
+
+double AudioTrack::GetSamplingRate() const
+{
+ return m_rate;
+}
+
+
+long long AudioTrack::GetChannels() const
+{
+ return m_channels;
+}
+
+long long AudioTrack::GetBitDepth() const
+{
+ return m_bitDepth;
+}
+
+Tracks::Tracks(
+ Segment* pSegment,
+ long long start,
+ long long size_,
+ long long element_start,
+ long long element_size) :
+ m_pSegment(pSegment),
+ m_start(start),
+ m_size(size_),
+ m_element_start(element_start),
+ m_element_size(element_size),
+ m_trackEntries(NULL),
+ m_trackEntriesEnd(NULL)
+{
+}
+
+
+long Tracks::Parse()
+{
+ assert(m_trackEntries == NULL);
+ assert(m_trackEntriesEnd == NULL);
+
+ const long long stop = m_start + m_size;
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ int count = 0;
+ long long pos = m_start;
+
+ while (pos < stop)
+ {
+ long long id, size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (size == 0) //weird
+ continue;
+
+ if (id == 0x2E) //TrackEntry ID
+ ++count;
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ if (count <= 0)
+ return 0; //success
+
+ m_trackEntries = new (std::nothrow) Track*[count];
+
+ if (m_trackEntries == NULL)
+ return -1;
+
+ m_trackEntriesEnd = m_trackEntries;
+
+ pos = m_start;
+
+ while (pos < stop)
+ {
+ const long long element_start = pos;
+
+ long long id, payload_size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ stop,
+ id,
+ payload_size);
+
+ if (status < 0) //error
+ return status;
+
+ if (payload_size == 0) //weird
+ continue;
+
+ const long long payload_stop = pos + payload_size;
+ assert(payload_stop <= stop); //checked in ParseElement
+
+ const long long element_size = payload_stop - element_start;
+
+ if (id == 0x2E) //TrackEntry ID
+ {
+ Track*& pTrack = *m_trackEntriesEnd;
+ pTrack = NULL;
+
+ const long status = ParseTrackEntry(
+ pos,
+ payload_size,
+ element_start,
+ element_size,
+ pTrack);
+
+ if (status)
+ return status;
+
+ if (pTrack)
+ ++m_trackEntriesEnd;
+ }
+
+ pos = payload_stop;
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+
+ return 0; //success
+}
+
+
+unsigned long Tracks::GetTracksCount() const
+{
+ const ptrdiff_t result = m_trackEntriesEnd - m_trackEntries;
+ assert(result >= 0);
+
+ return static_cast<unsigned long>(result);
+}
+
+long Tracks::ParseTrackEntry(
+ long long track_start,
+ long long track_size,
+ long long element_start,
+ long long element_size,
+ Track*& pResult) const
+{
+ if (pResult)
+ return -1;
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long pos = track_start;
+ const long long track_stop = track_start + track_size;
+
+ Track::Info info;
+
+ info.type = 0;
+ info.number = 0;
+ info.uid = 0;
+ info.defaultDuration = 0;
+
+ Track::Settings v;
+ v.start = -1;
+ v.size = -1;
+
+ Track::Settings a;
+ a.start = -1;
+ a.size = -1;
+
+ Track::Settings e; //content_encodings_settings;
+ e.start = -1;
+ e.size = -1;
+
+ long long lacing = 1; //default is true
+
+ while (pos < track_stop)
+ {
+ long long id, size;
+
+ const long status = ParseElementHeader(
+ pReader,
+ pos,
+ track_stop,
+ id,
+ size);
+
+ if (status < 0) //error
+ return status;
+
+ if (size < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ const long long start = pos;
+
+ if (id == 0x60) // VideoSettings ID
+ {
+ v.start = start;
+ v.size = size;
+ }
+ else if (id == 0x61) // AudioSettings ID
+ {
+ a.start = start;
+ a.size = size;
+ }
+ else if (id == 0x2D80) // ContentEncodings ID
+ {
+ e.start = start;
+ e.size = size;
+ }
+ else if (id == 0x33C5) //Track UID
+ {
+ if (size > 8)
+ return E_FILE_FORMAT_INVALID;
+
+ info.uid = 0;
+
+ long long pos_ = start;
+ const long long pos_end = start + size;
+
+ while (pos_ != pos_end)
+ {
+ unsigned char b;
+
+ const int status = pReader->Read(pos_, 1, &b);
+
+ if (status)
+ return status;
+
+ info.uid <<= 8;
+ info.uid |= b;
+
+ ++pos_;
+ }
+ }
+ else if (id == 0x57) //Track Number
+ {
+ const long long num = UnserializeUInt(pReader, pos, size);
+
+ if ((num <= 0) || (num > 127))
+ return E_FILE_FORMAT_INVALID;
+
+ info.number = static_cast<long>(num);
+ }
+ else if (id == 0x03) //Track Type
+ {
+ const long long type = UnserializeUInt(pReader, pos, size);
+
+ if ((type <= 0) || (type > 254))
+ return E_FILE_FORMAT_INVALID;
+
+ info.type = static_cast<long>(type);
+ }
+ else if (id == 0x136E) //Track Name
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ info.nameAsUTF8);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x02B59C) //Track Language
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ info.language);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x03E383) //Default Duration
+ {
+ const long long duration = UnserializeUInt(pReader, pos, size);
+
+ if (duration < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ info.defaultDuration = static_cast<unsigned long long>(duration);
+ }
+ else if (id == 0x06) //CodecID
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ info.codecId);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x1C) //lacing
+ {
+ lacing = UnserializeUInt(pReader, pos, size);
+
+ if ((lacing < 0) || (lacing > 1))
+ return E_FILE_FORMAT_INVALID;
+ }
+ else if (id == 0x23A2) //Codec Private
+ {
+ delete[] info.codecPrivate;
+ info.codecPrivate = NULL;
+ info.codecPrivateSize = 0;
+
+ const size_t buflen = static_cast<size_t>(size);
+
+ if (buflen)
+ {
+ typedef unsigned char* buf_t;
+
+ const buf_t buf = new (std::nothrow) unsigned char[buflen];
+
+ if (buf == NULL)
+ return -1;
+
+ const int status = pReader->Read(pos, buflen, buf);
+
+ if (status)
+ {
+ delete[] buf;
+ return status;
+ }
+
+ info.codecPrivate = buf;
+ info.codecPrivateSize = buflen;
+ }
+ }
+ else if (id == 0x058688) //Codec Name
+ {
+ const long status = UnserializeString(
+ pReader,
+ pos,
+ size,
+ info.codecNameAsUTF8);
+
+ if (status)
+ return status;
+ }
+ else if (id == 0x16AA) //Codec Delay
+ {
+ info.codecDelay = UnserializeUInt(pReader, pos, size);
+
+ }
+ else if (id == 0x16BB) //Seek Pre Roll
+ {
+ info.seekPreRoll = UnserializeUInt(pReader, pos, size);
+ }
+
+ pos += size; //consume payload
+ assert(pos <= track_stop);
+ }
+
+ assert(pos == track_stop);
+
+ if (info.number <= 0) //not specified
+ return E_FILE_FORMAT_INVALID;
+
+ if (GetTrackByNumber(info.number))
+ return E_FILE_FORMAT_INVALID;
+
+ if (info.type <= 0) //not specified
+ return E_FILE_FORMAT_INVALID;
+
+ info.lacing = (lacing > 0) ? true : false;
+
+ if (info.type == Track::kVideo)
+ {
+ if (v.start < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if (a.start >= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ info.settings = v;
+
+ VideoTrack* pTrack = NULL;
+
+ const long status = VideoTrack::Parse(m_pSegment,
+ info,
+ element_start,
+ element_size,
+ pTrack);
+
+ if (status)
+ return status;
+
+ pResult = pTrack;
+ assert(pResult);
+
+ if (e.start >= 0)
+ pResult->ParseContentEncodingsEntry(e.start, e.size);
+ }
+ else if (info.type == Track::kAudio)
+ {
+ if (a.start < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if (v.start >= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ info.settings = a;
+
+ AudioTrack* pTrack = NULL;
+
+ const long status = AudioTrack::Parse(m_pSegment,
+ info,
+ element_start,
+ element_size,
+ pTrack);
+
+ if (status)
+ return status;
+
+ pResult = pTrack;
+ assert(pResult);
+
+ if (e.start >= 0)
+ pResult->ParseContentEncodingsEntry(e.start, e.size);
+ }
+ else
+ {
+ // neither video nor audio - probably metadata or subtitles
+
+ if (a.start >= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if (v.start >= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if (e.start >= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ info.settings.start = -1;
+ info.settings.size = 0;
+
+ Track* pTrack = NULL;
+
+ const long status = Track::Create(m_pSegment,
+ info,
+ element_start,
+ element_size,
+ pTrack);
+
+ if (status)
+ return status;
+
+ pResult = pTrack;
+ assert(pResult);
+ }
+
+ return 0; //success
+}
+
+
+Tracks::~Tracks()
+{
+ Track** i = m_trackEntries;
+ Track** const j = m_trackEntriesEnd;
+
+ while (i != j)
+ {
+ Track* const pTrack = *i++;
+ delete pTrack;
+ }
+
+ delete[] m_trackEntries;
+}
+
+const Track* Tracks::GetTrackByNumber(long tn) const
+{
+ if (tn < 0)
+ return NULL;
+
+ Track** i = m_trackEntries;
+ Track** const j = m_trackEntriesEnd;
+
+ while (i != j)
+ {
+ Track* const pTrack = *i++;
+
+ if (pTrack == NULL)
+ continue;
+
+ if (tn == pTrack->GetNumber())
+ return pTrack;
+ }
+
+ return NULL; //not found
+}
+
+
+const Track* Tracks::GetTrackByIndex(unsigned long idx) const
+{
+ const ptrdiff_t count = m_trackEntriesEnd - m_trackEntries;
+
+ if (idx >= static_cast<unsigned long>(count))
+ return NULL;
+
+ return m_trackEntries[idx];
+}
+
+#if 0
+long long Cluster::Unparsed() const
+{
+ if (m_timecode < 0) //not even partially loaded
+ return LLONG_MAX;
+
+ assert(m_pos >= m_element_start);
+ //assert(m_element_size > m_size);
+
+ const long long element_stop = m_element_start + m_element_size;
+ assert(m_pos <= element_stop);
+
+ const long long result = element_stop - m_pos;
+ assert(result >= 0);
+
+ return result;
+}
+#endif
+
+
+long Cluster::Load(long long& pos, long& len) const
+{
+ assert(m_pSegment);
+ assert(m_pos >= m_element_start);
+
+ if (m_timecode >= 0) //at least partially loaded
+ return 0;
+
+ assert(m_pos == m_element_start);
+ assert(m_element_size < 0);
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long total, avail;
+
+ const int status = pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+ assert((total < 0) || (m_pos <= total)); //TODO: verify this
+
+ pos = m_pos;
+
+ long long cluster_size = -1;
+
+ {
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error or underflow
+ return static_cast<long>(result);
+
+ if (result > 0) //underflow (weird)
+ return E_BUFFER_NOT_FULL;
+
+ //if ((pos + len) > segment_stop)
+ // return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id_ = ReadUInt(pReader, pos, len);
+
+ if (id_ < 0) //error
+ return static_cast<long>(id_);
+
+ if (id_ != 0x0F43B675) //Cluster ID
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume id
+
+ //read cluster size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ //if ((pos + len) > segment_stop)
+ // return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(cluster_size);
+
+ if (size == 0)
+ return E_FILE_FORMAT_INVALID; //TODO: verify this
+
+ pos += len; //consume length of size of element
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size != unknown_size)
+ cluster_size = size;
+ }
+
+ //pos points to start of payload
+
+#if 0
+ len = static_cast<long>(size_);
+
+ if (cluster_stop > avail)
+ return E_BUFFER_NOT_FULL;
+#endif
+
+ long long timecode = -1;
+ long long new_pos = -1;
+ bool bBlock = false;
+
+ long long cluster_stop = (cluster_size < 0) ? -1 : pos + cluster_size;
+
+ for (;;)
+ {
+ if ((cluster_stop >= 0) && (pos >= cluster_stop))
+ break;
+
+ //Parse ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((cluster_stop >= 0) && ((pos + len) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id = ReadUInt(pReader, pos, len);
+
+ if (id < 0) //error
+ return static_cast<long>(id);
+
+ if (id == 0)
+ return E_FILE_FORMAT_INVALID;
+
+ //This is the distinguished set of ID's we use to determine
+ //that we have exhausted the sub-element's inside the cluster
+ //whose ID we parsed earlier.
+
+ if (id == 0x0F43B675) //Cluster ID
+ break;
+
+ if (id == 0x0C53BB6B) //Cues ID
+ break;
+
+ pos += len; //consume ID field
+
+ //Parse Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((cluster_stop >= 0) && ((pos + len) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume size field
+
+ if ((cluster_stop >= 0) && (pos > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ //pos now points to start of payload
+
+ if (size == 0) //weird
+ continue;
+
+ if ((cluster_stop >= 0) && ((pos + size) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if (id == 0x67) //TimeCode ID
+ {
+ len = static_cast<long>(size);
+
+ if ((pos + size) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ timecode = UnserializeUInt(pReader, pos, size);
+
+ if (timecode < 0) //error (or underflow)
+ return static_cast<long>(timecode);
+
+ new_pos = pos + size;
+
+ if (bBlock)
+ break;
+ }
+ else if (id == 0x20) //BlockGroup ID
+ {
+ bBlock = true;
+ break;
+ }
+ else if (id == 0x23) //SimpleBlock ID
+ {
+ bBlock = true;
+ break;
+ }
+
+ pos += size; //consume payload
+ assert((cluster_stop < 0) || (pos <= cluster_stop));
+ }
+
+ assert((cluster_stop < 0) || (pos <= cluster_stop));
+
+ if (timecode < 0) //no timecode found
+ return E_FILE_FORMAT_INVALID;
+
+ if (!bBlock)
+ return E_FILE_FORMAT_INVALID;
+
+ m_pos = new_pos; //designates position just beyond timecode payload
+ m_timecode = timecode; // m_timecode >= 0 means we're partially loaded
+
+ if (cluster_size >= 0)
+ m_element_size = cluster_stop - m_element_start;
+
+ return 0;
+}
+
+
+long Cluster::Parse(long long& pos, long& len) const
+{
+ long status = Load(pos, len);
+
+ if (status < 0)
+ return status;
+
+ assert(m_pos >= m_element_start);
+ assert(m_timecode >= 0);
+ //assert(m_size > 0);
+ //assert(m_element_size > m_size);
+
+ const long long cluster_stop =
+ (m_element_size < 0) ? -1 : m_element_start + m_element_size;
+
+ if ((cluster_stop >= 0) && (m_pos >= cluster_stop))
+ return 1; //nothing else to do
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long total, avail;
+
+ status = pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ pos = m_pos;
+
+ for (;;)
+ {
+ if ((cluster_stop >= 0) && (pos >= cluster_stop))
+ break;
+
+ if ((total >= 0) && (pos >= total))
+ {
+ if (m_element_size < 0)
+ m_element_size = pos - m_element_start;
+
+ break;
+ }
+
+ //Parse ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((cluster_stop >= 0) && ((pos + len) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id = ReadUInt(pReader, pos, len);
+
+ if (id < 0) //error
+ return static_cast<long>(id);
+
+ if (id == 0) //weird
+ return E_FILE_FORMAT_INVALID;
+
+ //This is the distinguished set of ID's we use to determine
+ //that we have exhausted the sub-element's inside the cluster
+ //whose ID we parsed earlier.
+
+ if ((id == 0x0F43B675) || (id == 0x0C53BB6B)) //Cluster or Cues ID
+ {
+ if (m_element_size < 0)
+ m_element_size = pos - m_element_start;
+
+ break;
+ }
+
+ pos += len; //consume ID field
+
+ //Parse Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((cluster_stop >= 0) && ((pos + len) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume size field
+
+ if ((cluster_stop >= 0) && (pos > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ //pos now points to start of payload
+
+ if (size == 0) //weird
+ continue;
+
+ //const long long block_start = pos;
+ const long long block_stop = pos + size;
+
+ if (cluster_stop >= 0)
+ {
+ if (block_stop > cluster_stop)
+ {
+ if ((id == 0x20) || (id == 0x23))
+ return E_FILE_FORMAT_INVALID;
+
+ pos = cluster_stop;
+ break;
+ }
+ }
+ else if ((total >= 0) && (block_stop > total))
+ {
+ m_element_size = total - m_element_start;
+ pos = total;
+ break;
+ }
+ else if (block_stop > avail)
+ {
+ len = static_cast<long>(size);
+ return E_BUFFER_NOT_FULL;
+ }
+
+ Cluster* const this_ = const_cast<Cluster*>(this);
+
+ if (id == 0x20) //BlockGroup
+ return this_->ParseBlockGroup(size, pos, len);
+
+ if (id == 0x23) //SimpleBlock
+ return this_->ParseSimpleBlock(size, pos, len);
+
+ pos += size; //consume payload
+ assert((cluster_stop < 0) || (pos <= cluster_stop));
+ }
+
+ assert(m_element_size > 0);
+
+ m_pos = pos;
+ assert((cluster_stop < 0) || (m_pos <= cluster_stop));
+
+ if (m_entries_count > 0)
+ {
+ const long idx = m_entries_count - 1;
+
+ const BlockEntry* const pLast = m_entries[idx];
+ assert(pLast);
+
+ const Block* const pBlock = pLast->GetBlock();
+ assert(pBlock);
+
+ const long long start = pBlock->m_start;
+
+ if ((total >= 0) && (start > total))
+ return -1; //defend against trucated stream
+
+ const long long size = pBlock->m_size;
+
+ const long long stop = start + size;
+ assert((cluster_stop < 0) || (stop <= cluster_stop));
+
+ if ((total >= 0) && (stop > total))
+ return -1; //defend against trucated stream
+ }
+
+ return 1; //no more entries
+}
+
+
+long Cluster::ParseSimpleBlock(
+ long long block_size,
+ long long& pos,
+ long& len)
+{
+ const long long block_start = pos;
+ const long long block_stop = pos + block_size;
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long total, avail;
+
+ long status = pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ //parse track number
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((pos + len) > block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long track = ReadUInt(pReader, pos, len);
+
+ if (track < 0) //error
+ return static_cast<long>(track);
+
+ if (track == 0)
+ return E_FILE_FORMAT_INVALID;
+
+#if 0
+ //TODO(matthewjheaney)
+ //This turned out to be too conservative. The problem is that
+ //if we see a track header in the tracks element with an unsupported
+ //track type, we throw that track header away, so it is not present
+ //in the track map. But even though we don't understand the track
+ //header, there are still blocks in the cluster with that track
+ //number. It was our decision to ignore that track header, so it's
+ //up to us to deal with blocks associated with that track -- we
+ //cannot simply report an error since technically there's nothing
+ //wrong with the file.
+ //
+ //For now we go ahead and finish the parse, creating a block entry
+ //for this block. This is somewhat wasteful, because without a
+ //track header there's nothing you can do with the block. What
+ //we really need here is a special return value that indicates to
+ //the caller that he should ignore this particular block, and
+ //continue parsing.
+
+ const Tracks* const pTracks = m_pSegment->GetTracks();
+ assert(pTracks);
+
+ const long tn = static_cast<long>(track);
+
+ const Track* const pTrack = pTracks->GetTrackByNumber(tn);
+
+ if (pTrack == NULL)
+ return E_FILE_FORMAT_INVALID;
+#endif
+
+ pos += len; //consume track number
+
+ if ((pos + 2) > block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + 2) > avail)
+ {
+ len = 2;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ pos += 2; //consume timecode
+
+ if ((pos + 1) > block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ unsigned char flags;
+
+ status = pReader->Read(pos, 1, &flags);
+
+ if (status < 0) //error or underflow
+ {
+ len = 1;
+ return status;
+ }
+
+ ++pos; //consume flags byte
+ assert(pos <= avail);
+
+ if (pos >= block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ const int lacing = int(flags & 0x06) >> 1;
+
+ if ((lacing != 0) && (block_stop > avail))
+ {
+ len = static_cast<long>(block_stop - pos);
+ return E_BUFFER_NOT_FULL;
+ }
+
+ status = CreateBlock(0x23, //simple block id
+ block_start, block_size,
+ 0); //DiscardPadding
+
+ if (status != 0)
+ return status;
+
+ m_pos = block_stop;
+
+ return 0; //success
+}
+
+
+long Cluster::ParseBlockGroup(
+ long long payload_size,
+ long long& pos,
+ long& len)
+{
+ const long long payload_start = pos;
+ const long long payload_stop = pos + payload_size;
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long total, avail;
+
+ long status = pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ if ((total >= 0) && (payload_stop > total))
+ return E_FILE_FORMAT_INVALID;
+
+ if (payload_stop > avail)
+ {
+ len = static_cast<long>(payload_size);
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long discard_padding = 0;
+
+ while (pos < payload_stop)
+ {
+ //parse sub-block element ID
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((pos + len) > payload_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id = ReadUInt(pReader, pos, len);
+
+ if (id < 0) //error
+ return static_cast<long>(id);
+
+ if (id == 0) //not a value ID
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume ID field
+
+ //Parse Size
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((pos + len) > payload_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume size field
+
+ //pos now points to start of sub-block group payload
+
+ if (pos > payload_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if (size == 0) //weird
+ continue;
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID;
+
+ if (id == 0x35A2) //DiscardPadding
+ {
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ status = UnserializeInt(pReader, pos, len, discard_padding);
+
+ if (status < 0) //error
+ return status;
+ }
+
+ if (id != 0x21) //sub-part of BlockGroup is not a Block
+ {
+ pos += size; //consume sub-part of block group
+
+ if (pos > payload_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ continue;
+ }
+
+ const long long block_stop = pos + size;
+
+ if (block_stop > payload_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ //parse track number
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((pos + len) > block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long track = ReadUInt(pReader, pos, len);
+
+ if (track < 0) //error
+ return static_cast<long>(track);
+
+ if (track == 0)
+ return E_FILE_FORMAT_INVALID;
+
+#if 0
+ //TODO(matthewjheaney)
+ //This turned out to be too conservative. The problem is that
+ //if we see a track header in the tracks element with an unsupported
+ //track type, we throw that track header away, so it is not present
+ //in the track map. But even though we don't understand the track
+ //header, there are still blocks in the cluster with that track
+ //number. It was our decision to ignore that track header, so it's
+ //up to us to deal with blocks associated with that track -- we
+ //cannot simply report an error since technically there's nothing
+ //wrong with the file.
+ //
+ //For now we go ahead and finish the parse, creating a block entry
+ //for this block. This is somewhat wasteful, because without a
+ //track header there's nothing you can do with the block. What
+ //we really need here is a special return value that indicates to
+ //the caller that he should ignore this particular block, and
+ //continue parsing.
+
+ const Tracks* const pTracks = m_pSegment->GetTracks();
+ assert(pTracks);
+
+ const long tn = static_cast<long>(track);
+
+ const Track* const pTrack = pTracks->GetTrackByNumber(tn);
+
+ if (pTrack == NULL)
+ return E_FILE_FORMAT_INVALID;
+#endif
+
+ pos += len; //consume track number
+
+ if ((pos + 2) > block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + 2) > avail)
+ {
+ len = 2;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ pos += 2; //consume timecode
+
+ if ((pos + 1) > block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ unsigned char flags;
+
+ status = pReader->Read(pos, 1, &flags);
+
+ if (status < 0) //error or underflow
+ {
+ len = 1;
+ return status;
+ }
+
+ ++pos; //consume flags byte
+ assert(pos <= avail);
+
+ if (pos >= block_stop)
+ return E_FILE_FORMAT_INVALID;
+
+ const int lacing = int(flags & 0x06) >> 1;
+
+ if ((lacing != 0) && (block_stop > avail))
+ {
+ len = static_cast<long>(block_stop - pos);
+ return E_BUFFER_NOT_FULL;
+ }
+
+ pos = block_stop; //consume block-part of block group
+ assert(pos <= payload_stop);
+ }
+
+ assert(pos == payload_stop);
+
+ status = CreateBlock(0x20, //BlockGroup ID
+ payload_start, payload_size,
+ discard_padding);
+ if (status != 0)
+ return status;
+
+ m_pos = payload_stop;
+
+ return 0; //success
+}
+
+
+long Cluster::GetEntry(long index, const mkvparser::BlockEntry*& pEntry) const
+{
+ assert(m_pos >= m_element_start);
+
+ pEntry = NULL;
+
+ if (index < 0)
+ return -1; //generic error
+
+ if (m_entries_count < 0)
+ return E_BUFFER_NOT_FULL;
+
+ assert(m_entries);
+ assert(m_entries_size > 0);
+ assert(m_entries_count <= m_entries_size);
+
+ if (index < m_entries_count)
+ {
+ pEntry = m_entries[index];
+ assert(pEntry);
+
+ return 1; //found entry
+ }
+
+ if (m_element_size < 0) //we don't know cluster end yet
+ return E_BUFFER_NOT_FULL; //underflow
+
+ const long long element_stop = m_element_start + m_element_size;
+
+ if (m_pos >= element_stop)
+ return 0; //nothing left to parse
+
+ return E_BUFFER_NOT_FULL; //underflow, since more remains to be parsed
+}
+
+
+Cluster* Cluster::Create(
+ Segment* pSegment,
+ long idx,
+ long long off)
+ //long long element_size)
+{
+ assert(pSegment);
+ assert(off >= 0);
+
+ const long long element_start = pSegment->m_start + off;
+
+ Cluster* const pCluster = new Cluster(pSegment,
+ idx,
+ element_start);
+ //element_size);
+ assert(pCluster);
+
+ return pCluster;
+}
+
+
+Cluster::Cluster() :
+ m_pSegment(NULL),
+ m_element_start(0),
+ m_index(0),
+ m_pos(0),
+ m_element_size(0),
+ m_timecode(0),
+ m_entries(NULL),
+ m_entries_size(0),
+ m_entries_count(0) //means "no entries"
+{
+}
+
+
+Cluster::Cluster(
+ Segment* pSegment,
+ long idx,
+ long long element_start
+ /* long long element_size */ ) :
+ m_pSegment(pSegment),
+ m_element_start(element_start),
+ m_index(idx),
+ m_pos(element_start),
+ m_element_size(-1 /* element_size */ ),
+ m_timecode(-1),
+ m_entries(NULL),
+ m_entries_size(0),
+ m_entries_count(-1) //means "has not been parsed yet"
+{
+}
+
+
+Cluster::~Cluster()
+{
+ if (m_entries_count <= 0)
+ return;
+
+ BlockEntry** i = m_entries;
+ BlockEntry** const j = m_entries + m_entries_count;
+
+ while (i != j)
+ {
+ BlockEntry* p = *i++;
+ assert(p);
+
+ delete p;
+ }
+
+ delete[] m_entries;
+}
+
+
+bool Cluster::EOS() const
+{
+ return (m_pSegment == NULL);
+}
+
+
+long Cluster::GetIndex() const
+{
+ return m_index;
+}
+
+
+long long Cluster::GetPosition() const
+{
+ const long long pos = m_element_start - m_pSegment->m_start;
+ assert(pos >= 0);
+
+ return pos;
+}
+
+
+long long Cluster::GetElementSize() const
+{
+ return m_element_size;
+}
+
+
+#if 0
+bool Cluster::HasBlockEntries(
+ const Segment* pSegment,
+ long long off) //relative to start of segment payload
+{
+ assert(pSegment);
+ assert(off >= 0); //relative to segment
+
+ IMkvReader* const pReader = pSegment->m_pReader;
+
+ long long pos = pSegment->m_start + off; //absolute
+ long long size;
+
+ {
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ (void)id;
+ assert(id >= 0);
+ assert(id == 0x0F43B675); //Cluster ID
+
+ pos += len; //consume id
+
+ size = ReadUInt(pReader, pos, len);
+ assert(size > 0);
+
+ pos += len; //consume size
+
+ //pos now points to start of payload
+ }
+
+ const long long stop = pos + size;
+
+ while (pos < stop)
+ {
+ long len;
+
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume id
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume size
+
+ if (id == 0x20) //BlockGroup ID
+ return true;
+
+ if (id == 0x23) //SimpleBlock ID
+ return true;
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ return false;
+}
+#endif
+
+
+long Cluster::HasBlockEntries(
+ const Segment* pSegment,
+ long long off, //relative to start of segment payload
+ long long& pos,
+ long& len)
+{
+ assert(pSegment);
+ assert(off >= 0); //relative to segment
+
+ IMkvReader* const pReader = pSegment->m_pReader;
+
+ long long total, avail;
+
+ long status = pReader->Length(&total, &avail);
+
+ if (status < 0) //error
+ return status;
+
+ assert((total < 0) || (avail <= total));
+
+ pos = pSegment->m_start + off; //absolute
+
+ if ((total >= 0) && (pos >= total))
+ return 0; //we don't even have a complete cluster
+
+ const long long segment_stop =
+ (pSegment->m_size < 0) ? -1 : pSegment->m_start + pSegment->m_size;
+
+ long long cluster_stop = -1; //interpreted later to mean "unknown size"
+
+ {
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //need more data
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((total >= 0) && ((pos + len) > total))
+ return 0;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id = ReadUInt(pReader, pos, len);
+
+ if (id < 0) //error
+ return static_cast<long>(id);
+
+ if (id != 0x0F43B675) //weird: not cluster ID
+ return -1; //generic error
+
+ pos += len; //consume Cluster ID field
+
+ //read size field
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //weird
+ return E_BUFFER_NOT_FULL;
+
+ if ((segment_stop >= 0) && ((pos + len) > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((total >= 0) && ((pos + len) > total))
+ return 0;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ if (size == 0)
+ return 0; //cluster does not have entries
+
+ pos += len; //consume size field
+
+ //pos now points to start of payload
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size != unknown_size)
+ {
+ cluster_stop = pos + size;
+ assert(cluster_stop >= 0);
+
+ if ((segment_stop >= 0) && (cluster_stop > segment_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((total >= 0) && (cluster_stop > total))
+ //return E_FILE_FORMAT_INVALID; //too conservative
+ return 0; //cluster does not have any entries
+ }
+ }
+
+ for (;;)
+ {
+ if ((cluster_stop >= 0) && (pos >= cluster_stop))
+ return 0; //no entries detected
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ long long result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //need more data
+ return E_BUFFER_NOT_FULL;
+
+ if ((cluster_stop >= 0) && ((pos + len) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long id = ReadUInt(pReader, pos, len);
+
+ if (id < 0) //error
+ return static_cast<long>(id);
+
+ //This is the distinguished set of ID's we use to determine
+ //that we have exhausted the sub-element's inside the cluster
+ //whose ID we parsed earlier.
+
+ if (id == 0x0F43B675) //Cluster ID
+ return 0; //no entries found
+
+ if (id == 0x0C53BB6B) //Cues ID
+ return 0; //no entries found
+
+ pos += len; //consume id field
+
+ if ((cluster_stop >= 0) && (pos >= cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ //read size field
+
+ if ((pos + 1) > avail)
+ {
+ len = 1;
+ return E_BUFFER_NOT_FULL;
+ }
+
+ result = GetUIntLength(pReader, pos, len);
+
+ if (result < 0) //error
+ return static_cast<long>(result);
+
+ if (result > 0) //underflow
+ return E_BUFFER_NOT_FULL;
+
+ if ((cluster_stop >= 0) && ((pos + len) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > avail)
+ return E_BUFFER_NOT_FULL;
+
+ const long long size = ReadUInt(pReader, pos, len);
+
+ if (size < 0) //error
+ return static_cast<long>(size);
+
+ pos += len; //consume size field
+
+ //pos now points to start of payload
+
+ if ((cluster_stop >= 0) && (pos > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if (size == 0) //weird
+ continue;
+
+ const long long unknown_size = (1LL << (7 * len)) - 1;
+
+ if (size == unknown_size)
+ return E_FILE_FORMAT_INVALID; //not supported inside cluster
+
+ if ((cluster_stop >= 0) && ((pos + size) > cluster_stop))
+ return E_FILE_FORMAT_INVALID;
+
+ if (id == 0x20) //BlockGroup ID
+ return 1; //have at least one entry
+
+ if (id == 0x23) //SimpleBlock ID
+ return 1; //have at least one entry
+
+ pos += size; //consume payload
+ assert((cluster_stop < 0) || (pos <= cluster_stop));
+ }
+}
+
+
+long long Cluster::GetTimeCode() const
+{
+ long long pos;
+ long len;
+
+ const long status = Load(pos, len);
+
+ if (status < 0) //error
+ return status;
+
+ return m_timecode;
+}
+
+
+long long Cluster::GetTime() const
+{
+ const long long tc = GetTimeCode();
+
+ if (tc < 0)
+ return tc;
+
+ const SegmentInfo* const pInfo = m_pSegment->GetInfo();
+ assert(pInfo);
+
+ const long long scale = pInfo->GetTimeCodeScale();
+ assert(scale >= 1);
+
+ const long long t = m_timecode * scale;
+
+ return t;
+}
+
+
+long long Cluster::GetFirstTime() const
+{
+ const BlockEntry* pEntry;
+
+ const long status = GetFirst(pEntry);
+
+ if (status < 0) //error
+ return status;
+
+ if (pEntry == NULL) //empty cluster
+ return GetTime();
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ return pBlock->GetTime(this);
+}
+
+
+long long Cluster::GetLastTime() const
+{
+ const BlockEntry* pEntry;
+
+ const long status = GetLast(pEntry);
+
+ if (status < 0) //error
+ return status;
+
+ if (pEntry == NULL) //empty cluster
+ return GetTime();
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ return pBlock->GetTime(this);
+}
+
+
+long Cluster::CreateBlock(
+ long long id,
+ long long pos, //absolute pos of payload
+ long long size,
+ long long discard_padding)
+{
+ assert((id == 0x20) || (id == 0x23)); //BlockGroup or SimpleBlock
+
+ if (m_entries_count < 0) //haven't parsed anything yet
+ {
+ assert(m_entries == NULL);
+ assert(m_entries_size == 0);
+
+ m_entries_size = 1024;
+ m_entries = new BlockEntry*[m_entries_size];
+
+ m_entries_count = 0;
+ }
+ else
+ {
+ assert(m_entries);
+ assert(m_entries_size > 0);
+ assert(m_entries_count <= m_entries_size);
+
+ if (m_entries_count >= m_entries_size)
+ {
+ const long entries_size = 2 * m_entries_size;
+
+ BlockEntry** const entries = new BlockEntry*[entries_size];
+ assert(entries);
+
+ BlockEntry** src = m_entries;
+ BlockEntry** const src_end = src + m_entries_count;
+
+ BlockEntry** dst = entries;
+
+ while (src != src_end)
+ *dst++ = *src++;
+
+ delete[] m_entries;
+
+ m_entries = entries;
+ m_entries_size = entries_size;
+ }
+ }
+
+ if (id == 0x20) //BlockGroup ID
+ return CreateBlockGroup(pos, size, discard_padding);
+ else //SimpleBlock ID
+ return CreateSimpleBlock(pos, size);
+}
+
+
+long Cluster::CreateBlockGroup(
+ long long start_offset,
+ long long size,
+ long long discard_padding)
+{
+ assert(m_entries);
+ assert(m_entries_size > 0);
+ assert(m_entries_count >= 0);
+ assert(m_entries_count < m_entries_size);
+
+ IMkvReader* const pReader = m_pSegment->m_pReader;
+
+ long long pos = start_offset;
+ const long long stop = start_offset + size;
+
+ //For WebM files, there is a bias towards previous reference times
+ //(in order to support alt-ref frames, which refer back to the previous
+ //keyframe). Normally a 0 value is not possible, but here we tenatively
+ //allow 0 as the value of a reference frame, with the interpretation
+ //that this is a "previous" reference time.
+
+ long long prev = 1; //nonce
+ long long next = 0; //nonce
+ long long duration = -1; //really, this is unsigned
+
+ long long bpos = -1;
+ long long bsize = -1;
+
+ while (pos < stop)
+ {
+ long len;
+ const long long id = ReadUInt(pReader, pos, len);
+ assert(id >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume ID
+
+ const long long size = ReadUInt(pReader, pos, len);
+ assert(size >= 0); //TODO
+ assert((pos + len) <= stop);
+
+ pos += len; //consume size
+
+ if (id == 0x21) //Block ID
+ {
+ if (bpos < 0) //Block ID
+ {
+ bpos = pos;
+ bsize = size;
+ }
+ }
+ else if (id == 0x1B) //Duration ID
+ {
+ assert(size <= 8);
+
+ duration = UnserializeUInt(pReader, pos, size);
+ assert(duration >= 0); //TODO
+ }
+ else if (id == 0x7B) //ReferenceBlock
+ {
+ assert(size <= 8);
+ const long size_ = static_cast<long>(size);
+
+ long long time;
+
+ long status = UnserializeInt(pReader, pos, size_, time);
+ assert(status == 0);
+ if (status != 0)
+ return -1;
+
+ if (time <= 0) //see note above
+ prev = time;
+ else //weird
+ next = time;
+ }
+
+ pos += size; //consume payload
+ assert(pos <= stop);
+ }
+
+ assert(pos == stop);
+ assert(bpos >= 0);
+ assert(bsize >= 0);
+
+ const long idx = m_entries_count;
+
+ BlockEntry** const ppEntry = m_entries + idx;
+ BlockEntry*& pEntry = *ppEntry;
+
+ pEntry = new (std::nothrow) BlockGroup(
+ this,
+ idx,
+ bpos,
+ bsize,
+ prev,
+ next,
+ duration,
+ discard_padding);
+
+ if (pEntry == NULL)
+ return -1; //generic error
+
+ BlockGroup* const p = static_cast<BlockGroup*>(pEntry);
+
+ const long status = p->Parse();
+
+ if (status == 0) //success
+ {
+ ++m_entries_count;
+ return 0;
+ }
+
+ delete pEntry;
+ pEntry = 0;
+
+ return status;
+}
+
+
+
+long Cluster::CreateSimpleBlock(
+ long long st,
+ long long sz)
+{
+ assert(m_entries);
+ assert(m_entries_size > 0);
+ assert(m_entries_count >= 0);
+ assert(m_entries_count < m_entries_size);
+
+ const long idx = m_entries_count;
+
+ BlockEntry** const ppEntry = m_entries + idx;
+ BlockEntry*& pEntry = *ppEntry;
+
+ pEntry = new (std::nothrow) SimpleBlock(this, idx, st, sz);
+
+ if (pEntry == NULL)
+ return -1; //generic error
+
+ SimpleBlock* const p = static_cast<SimpleBlock*>(pEntry);
+
+ const long status = p->Parse();
+
+ if (status == 0)
+ {
+ ++m_entries_count;
+ return 0;
+ }
+
+ delete pEntry;
+ pEntry = 0;
+
+ return status;
+}
+
+
+long Cluster::GetFirst(const BlockEntry*& pFirst) const
+{
+ if (m_entries_count <= 0)
+ {
+ long long pos;
+ long len;
+
+ const long status = Parse(pos, len);
+
+ if (status < 0) //error
+ {
+ pFirst = NULL;
+ return status;
+ }
+
+ if (m_entries_count <= 0) //empty cluster
+ {
+ pFirst = NULL;
+ return 0;
+ }
+ }
+
+ assert(m_entries);
+
+ pFirst = m_entries[0];
+ assert(pFirst);
+
+ return 0; //success
+}
+
+long Cluster::GetLast(const BlockEntry*& pLast) const
+{
+ for (;;)
+ {
+ long long pos;
+ long len;
+
+ const long status = Parse(pos, len);
+
+ if (status < 0) //error
+ {
+ pLast = NULL;
+ return status;
+ }
+
+ if (status > 0) //no new block
+ break;
+ }
+
+ if (m_entries_count <= 0)
+ {
+ pLast = NULL;
+ return 0;
+ }
+
+ assert(m_entries);
+
+ const long idx = m_entries_count - 1;
+
+ pLast = m_entries[idx];
+ assert(pLast);
+
+ return 0;
+}
+
+
+long Cluster::GetNext(
+ const BlockEntry* pCurr,
+ const BlockEntry*& pNext) const
+{
+ assert(pCurr);
+ assert(m_entries);
+ assert(m_entries_count > 0);
+
+ size_t idx = pCurr->GetIndex();
+ assert(idx < size_t(m_entries_count));
+ assert(m_entries[idx] == pCurr);
+
+ ++idx;
+
+ if (idx >= size_t(m_entries_count))
+ {
+ long long pos;
+ long len;
+
+ const long status = Parse(pos, len);
+
+ if (status < 0) //error
+ {
+ pNext = NULL;
+ return status;
+ }
+
+ if (status > 0)
+ {
+ pNext = NULL;
+ return 0;
+ }
+
+ assert(m_entries);
+ assert(m_entries_count > 0);
+ assert(idx < size_t(m_entries_count));
+ }
+
+ pNext = m_entries[idx];
+ assert(pNext);
+
+ return 0;
+}
+
+
+long Cluster::GetEntryCount() const
+{
+ return m_entries_count;
+}
+
+
+const BlockEntry* Cluster::GetEntry(
+ const Track* pTrack,
+ long long time_ns) const
+{
+ assert(pTrack);
+
+ if (m_pSegment == NULL) //this is the special EOS cluster
+ return pTrack->GetEOS();
+
+#if 0
+
+ LoadBlockEntries();
+
+ if ((m_entries == NULL) || (m_entries_count <= 0))
+ return NULL; //return EOS here?
+
+ const BlockEntry* pResult = pTrack->GetEOS();
+
+ BlockEntry** i = m_entries;
+ assert(i);
+
+ BlockEntry** const j = i + m_entries_count;
+
+ while (i != j)
+ {
+ const BlockEntry* const pEntry = *i++;
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if (pBlock->GetTrackNumber() != pTrack->GetNumber())
+ continue;
+
+ if (pTrack->VetEntry(pEntry))
+ {
+ if (time_ns < 0) //just want first candidate block
+ return pEntry;
+
+ const long long ns = pBlock->GetTime(this);
+
+ if (ns > time_ns)
+ break;
+
+ pResult = pEntry;
+ }
+ else if (time_ns >= 0)
+ {
+ const long long ns = pBlock->GetTime(this);
+
+ if (ns > time_ns)
+ break;
+ }
+ }
+
+ return pResult;
+
+#else
+
+ const BlockEntry* pResult = pTrack->GetEOS();
+
+ long index = 0;
+
+ for (;;)
+ {
+ if (index >= m_entries_count)
+ {
+ long long pos;
+ long len;
+
+ const long status = Parse(pos, len);
+ assert(status >= 0);
+
+ if (status > 0) //completely parsed, and no more entries
+ return pResult;
+
+ if (status < 0) //should never happen
+ return 0;
+
+ assert(m_entries);
+ assert(index < m_entries_count);
+ }
+
+ const BlockEntry* const pEntry = m_entries[index];
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if (pBlock->GetTrackNumber() != pTrack->GetNumber())
+ {
+ ++index;
+ continue;
+ }
+
+ if (pTrack->VetEntry(pEntry))
+ {
+ if (time_ns < 0) //just want first candidate block
+ return pEntry;
+
+ const long long ns = pBlock->GetTime(this);
+
+ if (ns > time_ns)
+ return pResult;
+
+ pResult = pEntry; //have a candidate
+ }
+ else if (time_ns >= 0)
+ {
+ const long long ns = pBlock->GetTime(this);
+
+ if (ns > time_ns)
+ return pResult;
+ }
+
+ ++index;
+ }
+
+#endif
+}
+
+
+const BlockEntry*
+Cluster::GetEntry(
+ const CuePoint& cp,
+ const CuePoint::TrackPosition& tp) const
+{
+ assert(m_pSegment);
+
+#if 0
+
+ LoadBlockEntries();
+
+ if (m_entries == NULL)
+ return NULL;
+
+ const long long count = m_entries_count;
+
+ if (count <= 0)
+ return NULL;
+
+ const long long tc = cp.GetTimeCode();
+
+ if ((tp.m_block > 0) && (tp.m_block <= count))
+ {
+ const size_t block = static_cast<size_t>(tp.m_block);
+ const size_t index = block - 1;
+
+ const BlockEntry* const pEntry = m_entries[index];
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if ((pBlock->GetTrackNumber() == tp.m_track) &&
+ (pBlock->GetTimeCode(this) == tc))
+ {
+ return pEntry;
+ }
+ }
+
+ const BlockEntry* const* i = m_entries;
+ const BlockEntry* const* const j = i + count;
+
+ while (i != j)
+ {
+#ifdef _DEBUG
+ const ptrdiff_t idx = i - m_entries;
+ idx;
+#endif
+
+ const BlockEntry* const pEntry = *i++;
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if (pBlock->GetTrackNumber() != tp.m_track)
+ continue;
+
+ const long long tc_ = pBlock->GetTimeCode(this);
+ assert(tc_ >= 0);
+
+ if (tc_ < tc)
+ continue;
+
+ if (tc_ > tc)
+ return NULL;
+
+ const Tracks* const pTracks = m_pSegment->GetTracks();
+ assert(pTracks);
+
+ const long tn = static_cast<long>(tp.m_track);
+ const Track* const pTrack = pTracks->GetTrackByNumber(tn);
+
+ if (pTrack == NULL)
+ return NULL;
+
+ const long long type = pTrack->GetType();
+
+ if (type == 2) //audio
+ return pEntry;
+
+ if (type != 1) //not video
+ return NULL;
+
+ if (!pBlock->IsKey())
+ return NULL;
+
+ return pEntry;
+ }
+
+ return NULL;
+
+#else
+
+ const long long tc = cp.GetTimeCode();
+
+ if (tp.m_block > 0)
+ {
+ const long block = static_cast<long>(tp.m_block);
+ const long index = block - 1;
+
+ while (index >= m_entries_count)
+ {
+ long long pos;
+ long len;
+
+ const long status = Parse(pos, len);
+
+ if (status < 0) //TODO: can this happen?
+ return NULL;
+
+ if (status > 0) //nothing remains to be parsed
+ return NULL;
+ }
+
+ const BlockEntry* const pEntry = m_entries[index];
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if ((pBlock->GetTrackNumber() == tp.m_track) &&
+ (pBlock->GetTimeCode(this) == tc))
+ {
+ return pEntry;
+ }
+ }
+
+ long index = 0;
+
+ for (;;)
+ {
+ if (index >= m_entries_count)
+ {
+ long long pos;
+ long len;
+
+ const long status = Parse(pos, len);
+
+ if (status < 0) //TODO: can this happen?
+ return NULL;
+
+ if (status > 0) //nothing remains to be parsed
+ return NULL;
+
+ assert(m_entries);
+ assert(index < m_entries_count);
+ }
+
+ const BlockEntry* const pEntry = m_entries[index];
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if (pBlock->GetTrackNumber() != tp.m_track)
+ {
+ ++index;
+ continue;
+ }
+
+ const long long tc_ = pBlock->GetTimeCode(this);
+
+ if (tc_ < tc)
+ {
+ ++index;
+ continue;
+ }
+
+ if (tc_ > tc)
+ return NULL;
+
+ const Tracks* const pTracks = m_pSegment->GetTracks();
+ assert(pTracks);
+
+ const long tn = static_cast<long>(tp.m_track);
+ const Track* const pTrack = pTracks->GetTrackByNumber(tn);
+
+ if (pTrack == NULL)
+ return NULL;
+
+ const long long type = pTrack->GetType();
+
+ if (type == 2) //audio
+ return pEntry;
+
+ if (type != 1) //not video
+ return NULL;
+
+ if (!pBlock->IsKey())
+ return NULL;
+
+ return pEntry;
+ }
+
+#endif
+
+}
+
+
+#if 0
+const BlockEntry* Cluster::GetMaxKey(const VideoTrack* pTrack) const
+{
+ assert(pTrack);
+
+ if (m_pSegment == NULL) //EOS
+ return pTrack->GetEOS();
+
+ LoadBlockEntries();
+
+ if ((m_entries == NULL) || (m_entries_count <= 0))
+ return pTrack->GetEOS();
+
+ BlockEntry** i = m_entries + m_entries_count;
+ BlockEntry** const j = m_entries;
+
+ while (i != j)
+ {
+ const BlockEntry* const pEntry = *--i;
+ assert(pEntry);
+ assert(!pEntry->EOS());
+
+ const Block* const pBlock = pEntry->GetBlock();
+ assert(pBlock);
+
+ if (pBlock->GetTrackNumber() != pTrack->GetNumber())
+ continue;
+
+ if (pBlock->IsKey())
+ return pEntry;
+ }
+
+ return pTrack->GetEOS(); //no satisfactory block found
+}
+#endif
+
+
+BlockEntry::BlockEntry(Cluster* p, long idx) :
+ m_pCluster(p),
+ m_index(idx)
+{
+}
+
+
+BlockEntry::~BlockEntry()
+{
+}
+
+
+bool BlockEntry::EOS() const
+{
+ return (GetKind() == kBlockEOS);
+}
+
+
+const Cluster* BlockEntry::GetCluster() const
+{
+ return m_pCluster;
+}
+
+
+long BlockEntry::GetIndex() const
+{
+ return m_index;
+}
+
+
+SimpleBlock::SimpleBlock(
+ Cluster* pCluster,
+ long idx,
+ long long start,
+ long long size) :
+ BlockEntry(pCluster, idx),
+ m_block(start, size, 0)
+{
+}
+
+
+long SimpleBlock::Parse()
+{
+ return m_block.Parse(m_pCluster);
+}
+
+
+BlockEntry::Kind SimpleBlock::GetKind() const
+{
+ return kBlockSimple;
+}
+
+
+const Block* SimpleBlock::GetBlock() const
+{
+ return &m_block;
+}
+
+
+BlockGroup::BlockGroup(
+ Cluster* pCluster,
+ long idx,
+ long long block_start,
+ long long block_size,
+ long long prev,
+ long long next,
+ long long duration,
+ long long discard_padding) :
+ BlockEntry(pCluster, idx),
+ m_block(block_start, block_size, discard_padding),
+ m_prev(prev),
+ m_next(next),
+ m_duration(duration)
+{
+}
+
+
+long BlockGroup::Parse()
+{
+ const long status = m_block.Parse(m_pCluster);
+
+ if (status)
+ return status;
+
+ m_block.SetKey((m_prev > 0) && (m_next <= 0));
+
+ return 0;
+}
+
+
+#if 0
+void BlockGroup::ParseBlock(long long start, long long size)
+{
+ IMkvReader* const pReader = m_pCluster->m_pSegment->m_pReader;
+
+ Block* const pBlock = new Block(start, size, pReader);
+ assert(pBlock); //TODO
+
+ //TODO: the Matroska spec says you have multiple blocks within the
+ //same block group, with blocks ranked by priority (the flag bits).
+
+ assert(m_pBlock == NULL);
+ m_pBlock = pBlock;
+}
+#endif
+
+
+BlockEntry::Kind BlockGroup::GetKind() const
+{
+ return kBlockGroup;
+}
+
+
+const Block* BlockGroup::GetBlock() const
+{
+ return &m_block;
+}
+
+
+long long BlockGroup::GetPrevTimeCode() const
+{
+ return m_prev;
+}
+
+
+long long BlockGroup::GetNextTimeCode() const
+{
+ return m_next;
+}
+
+long long BlockGroup::GetDurationTimeCode() const
+{
+ return m_duration;
+}
+
+Block::Block(long long start, long long size_, long long discard_padding) :
+ m_start(start),
+ m_size(size_),
+ m_track(0),
+ m_timecode(-1),
+ m_flags(0),
+ m_frames(NULL),
+ m_frame_count(-1),
+ m_discard_padding(discard_padding)
+{
+}
+
+
+Block::~Block()
+{
+ delete[] m_frames;
+}
+
+
+long Block::Parse(const Cluster* pCluster)
+{
+ if (pCluster == NULL)
+ return -1;
+
+ if (pCluster->m_pSegment == NULL)
+ return -1;
+
+ assert(m_start >= 0);
+ assert(m_size >= 0);
+ assert(m_track <= 0);
+ assert(m_frames == NULL);
+ assert(m_frame_count <= 0);
+
+ long long pos = m_start;
+ const long long stop = m_start + m_size;
+
+ long len;
+
+ IMkvReader* const pReader = pCluster->m_pSegment->m_pReader;
+
+ m_track = ReadUInt(pReader, pos, len);
+
+ if (m_track <= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > stop)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume track number
+
+ if ((stop - pos) < 2)
+ return E_FILE_FORMAT_INVALID;
+
+ long status;
+ long long value;
+
+ status = UnserializeInt(pReader, pos, 2, value);
+
+ if (status)
+ return E_FILE_FORMAT_INVALID;
+
+ if (value < SHRT_MIN)
+ return E_FILE_FORMAT_INVALID;
+
+ if (value > SHRT_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ m_timecode = static_cast<short>(value);
+
+ pos += 2;
+
+ if ((stop - pos) <= 0)
+ return E_FILE_FORMAT_INVALID;
+
+ status = pReader->Read(pos, 1, &m_flags);
+
+ if (status)
+ return E_FILE_FORMAT_INVALID;
+
+ const int lacing = int(m_flags & 0x06) >> 1;
+
+ ++pos; //consume flags byte
+
+ if (lacing == 0) //no lacing
+ {
+ if (pos > stop)
+ return E_FILE_FORMAT_INVALID;
+
+ m_frame_count = 1;
+ m_frames = new Frame[m_frame_count];
+
+ Frame& f = m_frames[0];
+ f.pos = pos;
+
+ const long long frame_size = stop - pos;
+
+ if (frame_size > LONG_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ f.len = static_cast<long>(frame_size);
+
+ return 0; //success
+ }
+
+ if (pos >= stop)
+ return E_FILE_FORMAT_INVALID;
+
+ unsigned char biased_count;
+
+ status = pReader->Read(pos, 1, &biased_count);
+
+ if (status)
+ return E_FILE_FORMAT_INVALID;
+
+ ++pos; //consume frame count
+ assert(pos <= stop);
+
+ m_frame_count = int(biased_count) + 1;
+
+ m_frames = new Frame[m_frame_count];
+ assert(m_frames);
+
+ if (lacing == 1) //Xiph
+ {
+ Frame* pf = m_frames;
+ Frame* const pf_end = pf + m_frame_count;
+
+ long size = 0;
+ int frame_count = m_frame_count;
+
+ while (frame_count > 1)
+ {
+ long frame_size = 0;
+
+ for (;;)
+ {
+ unsigned char val;
+
+ if (pos >= stop)
+ return E_FILE_FORMAT_INVALID;
+
+ status = pReader->Read(pos, 1, &val);
+
+ if (status)
+ return E_FILE_FORMAT_INVALID;
+
+ ++pos; //consume xiph size byte
+
+ frame_size += val;
+
+ if (val < 255)
+ break;
+ }
+
+ Frame& f = *pf++;
+ assert(pf < pf_end);
+
+ f.pos = 0; //patch later
+
+ f.len = frame_size;
+ size += frame_size; //contribution of this frame
+
+ --frame_count;
+ }
+
+ assert(pf < pf_end);
+ assert(pos <= stop);
+
+ {
+ Frame& f = *pf++;
+
+ if (pf != pf_end)
+ return E_FILE_FORMAT_INVALID;
+
+ f.pos = 0; //patch later
+
+ const long long total_size = stop - pos;
+
+ if (total_size < size)
+ return E_FILE_FORMAT_INVALID;
+
+ const long long frame_size = total_size - size;
+
+ if (frame_size > LONG_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ f.len = static_cast<long>(frame_size);
+ }
+
+ pf = m_frames;
+ while (pf != pf_end)
+ {
+ Frame& f = *pf++;
+ assert((pos + f.len) <= stop);
+
+ f.pos = pos;
+ pos += f.len;
+ }
+
+ assert(pos == stop);
+ }
+ else if (lacing == 2) //fixed-size lacing
+ {
+ const long long total_size = stop - pos;
+
+ if ((total_size % m_frame_count) != 0)
+ return E_FILE_FORMAT_INVALID;
+
+ const long long frame_size = total_size / m_frame_count;
+
+ if (frame_size > LONG_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ Frame* pf = m_frames;
+ Frame* const pf_end = pf + m_frame_count;
+
+ while (pf != pf_end)
+ {
+ assert((pos + frame_size) <= stop);
+
+ Frame& f = *pf++;
+
+ f.pos = pos;
+ f.len = static_cast<long>(frame_size);
+
+ pos += frame_size;
+ }
+
+ assert(pos == stop);
+ }
+ else
+ {
+ assert(lacing == 3); //EBML lacing
+
+ if (pos >= stop)
+ return E_FILE_FORMAT_INVALID;
+
+ long size = 0;
+ int frame_count = m_frame_count;
+
+ long long frame_size = ReadUInt(pReader, pos, len);
+
+ if (frame_size < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if (frame_size > LONG_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > stop)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume length of size of first frame
+
+ if ((pos + frame_size) > stop)
+ return E_FILE_FORMAT_INVALID;
+
+ Frame* pf = m_frames;
+ Frame* const pf_end = pf + m_frame_count;
+
+ {
+ Frame& curr = *pf;
+
+ curr.pos = 0; //patch later
+
+ curr.len = static_cast<long>(frame_size);
+ size += curr.len; //contribution of this frame
+ }
+
+ --frame_count;
+
+ while (frame_count > 1)
+ {
+ if (pos >= stop)
+ return E_FILE_FORMAT_INVALID;
+
+ assert(pf < pf_end);
+
+ const Frame& prev = *pf++;
+ assert(prev.len == frame_size);
+ if (prev.len != frame_size)
+ return E_FILE_FORMAT_INVALID;
+
+ assert(pf < pf_end);
+
+ Frame& curr = *pf;
+
+ curr.pos = 0; //patch later
+
+ const long long delta_size_ = ReadUInt(pReader, pos, len);
+
+ if (delta_size_ < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if ((pos + len) > stop)
+ return E_FILE_FORMAT_INVALID;
+
+ pos += len; //consume length of (delta) size
+ assert(pos <= stop);
+
+ const int exp = 7*len - 1;
+ const long long bias = (1LL << exp) - 1LL;
+ const long long delta_size = delta_size_ - bias;
+
+ frame_size += delta_size;
+
+ if (frame_size < 0)
+ return E_FILE_FORMAT_INVALID;
+
+ if (frame_size > LONG_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ curr.len = static_cast<long>(frame_size);
+ size += curr.len; //contribution of this frame
+
+ --frame_count;
+ }
+
+ {
+ assert(pos <= stop);
+ assert(pf < pf_end);
+
+ const Frame& prev = *pf++;
+ assert(prev.len == frame_size);
+ if (prev.len != frame_size)
+ return E_FILE_FORMAT_INVALID;
+
+ assert(pf < pf_end);
+
+ Frame& curr = *pf++;
+ assert(pf == pf_end);
+
+ curr.pos = 0; //patch later
+
+ const long long total_size = stop - pos;
+
+ if (total_size < size)
+ return E_FILE_FORMAT_INVALID;
+
+ frame_size = total_size - size;
+
+ if (frame_size > LONG_MAX)
+ return E_FILE_FORMAT_INVALID;
+
+ curr.len = static_cast<long>(frame_size);
+ }
+
+ pf = m_frames;
+ while (pf != pf_end)
+ {
+ Frame& f = *pf++;
+ assert((pos + f.len) <= stop);
+
+ f.pos = pos;
+ pos += f.len;
+ }
+
+ assert(pos == stop);
+ }
+
+ return 0; //success
+}
+
+
+long long Block::GetTimeCode(const Cluster* pCluster) const
+{
+ if (pCluster == 0)
+ return m_timecode;
+
+ const long long tc0 = pCluster->GetTimeCode();
+ assert(tc0 >= 0);
+
+ const long long tc = tc0 + m_timecode;
+
+ return tc; //unscaled timecode units
+}
+
+
+long long Block::GetTime(const Cluster* pCluster) const
+{
+ assert(pCluster);
+
+ const long long tc = GetTimeCode(pCluster);
+
+ const Segment* const pSegment = pCluster->m_pSegment;
+ const SegmentInfo* const pInfo = pSegment->GetInfo();
+ assert(pInfo);
+
+ const long long scale = pInfo->GetTimeCodeScale();
+ assert(scale >= 1);
+
+ const long long ns = tc * scale;
+
+ return ns;
+}
+
+
+long long Block::GetTrackNumber() const
+{
+ return m_track;
+}
+
+
+bool Block::IsKey() const
+{
+ return ((m_flags & static_cast<unsigned char>(1 << 7)) != 0);
+}
+
+
+void Block::SetKey(bool bKey)
+{
+ if (bKey)
+ m_flags |= static_cast<unsigned char>(1 << 7);
+ else
+ m_flags &= 0x7F;
+}
+
+
+bool Block::IsInvisible() const
+{
+ return bool(int(m_flags & 0x08) != 0);
+}
+
+
+Block::Lacing Block::GetLacing() const
+{
+ const int value = int(m_flags & 0x06) >> 1;
+ return static_cast<Lacing>(value);
+}
+
+
+int Block::GetFrameCount() const
+{
+ return m_frame_count;
+}
+
+
+const Block::Frame& Block::GetFrame(int idx) const
+{
+ assert(idx >= 0);
+ assert(idx < m_frame_count);
+
+ const Frame& f = m_frames[idx];
+ assert(f.pos > 0);
+ assert(f.len > 0);
+
+ return f;
+}
+
+
+long Block::Frame::Read(IMkvReader* pReader, unsigned char* buf) const
+{
+ assert(pReader);
+ assert(buf);
+
+ const long status = pReader->Read(pos, len, buf);
+ return status;
+}
+
+long long Block::GetDiscardPadding() const
+{
+ return m_discard_padding;
+}
+
+} //end namespace mkvparser
diff --git a/libvpx/third_party/libwebm/mkvparser.hpp b/libvpx/third_party/libwebm/mkvparser.hpp
new file mode 100644
index 0000000..7184d26
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvparser.hpp
@@ -0,0 +1,1079 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef MKVPARSER_HPP
+#define MKVPARSER_HPP
+
+#include <cstdlib>
+#include <cstdio>
+#include <cstddef>
+
+namespace mkvparser
+{
+
+const int E_FILE_FORMAT_INVALID = -2;
+const int E_BUFFER_NOT_FULL = -3;
+
+class IMkvReader
+{
+public:
+ virtual int Read(long long pos, long len, unsigned char* buf) = 0;
+ virtual int Length(long long* total, long long* available) = 0;
+protected:
+ virtual ~IMkvReader();
+};
+
+long long GetUIntLength(IMkvReader*, long long, long&);
+long long ReadUInt(IMkvReader*, long long, long&);
+long long UnserializeUInt(IMkvReader*, long long pos, long long size);
+
+long UnserializeFloat(IMkvReader*, long long pos, long long size, double&);
+long UnserializeInt(IMkvReader*, long long pos, long len, long long& result);
+
+long UnserializeString(
+ IMkvReader*,
+ long long pos,
+ long long size,
+ char*& str);
+
+long ParseElementHeader(
+ IMkvReader* pReader,
+ long long& pos, //consume id and size fields
+ long long stop, //if you know size of element's parent
+ long long& id,
+ long long& size);
+
+bool Match(IMkvReader*, long long&, unsigned long, long long&);
+bool Match(IMkvReader*, long long&, unsigned long, unsigned char*&, size_t&);
+
+void GetVersion(int& major, int& minor, int& build, int& revision);
+
+struct EBMLHeader
+{
+ EBMLHeader();
+ ~EBMLHeader();
+ long long m_version;
+ long long m_readVersion;
+ long long m_maxIdLength;
+ long long m_maxSizeLength;
+ char* m_docType;
+ long long m_docTypeVersion;
+ long long m_docTypeReadVersion;
+
+ long long Parse(IMkvReader*, long long&);
+ void Init();
+};
+
+
+class Segment;
+class Track;
+class Cluster;
+
+class Block
+{
+ Block(const Block&);
+ Block& operator=(const Block&);
+
+public:
+ const long long m_start;
+ const long long m_size;
+
+ Block(long long start, long long size, long long discard_padding);
+ ~Block();
+
+ long Parse(const Cluster*);
+
+ long long GetTrackNumber() const;
+ long long GetTimeCode(const Cluster*) const; //absolute, but not scaled
+ long long GetTime(const Cluster*) const; //absolute, and scaled (ns)
+ bool IsKey() const;
+ void SetKey(bool);
+ bool IsInvisible() const;
+
+ enum Lacing { kLacingNone, kLacingXiph, kLacingFixed, kLacingEbml };
+ Lacing GetLacing() const;
+
+ int GetFrameCount() const; //to index frames: [0, count)
+
+ struct Frame
+ {
+ long long pos; //absolute offset
+ long len;
+
+ long Read(IMkvReader*, unsigned char*) const;
+ };
+
+ const Frame& GetFrame(int frame_index) const;
+
+ long long GetDiscardPadding() const;
+
+private:
+ long long m_track; //Track::Number()
+ short m_timecode; //relative to cluster
+ unsigned char m_flags;
+
+ Frame* m_frames;
+ int m_frame_count;
+
+protected:
+ const long long m_discard_padding;
+};
+
+
+class BlockEntry
+{
+ BlockEntry(const BlockEntry&);
+ BlockEntry& operator=(const BlockEntry&);
+
+protected:
+ BlockEntry(Cluster*, long index);
+
+public:
+ virtual ~BlockEntry();
+
+ bool EOS() const;
+ const Cluster* GetCluster() const;
+ long GetIndex() const;
+ virtual const Block* GetBlock() const = 0;
+
+ enum Kind { kBlockEOS, kBlockSimple, kBlockGroup };
+ virtual Kind GetKind() const = 0;
+
+protected:
+ Cluster* const m_pCluster;
+ const long m_index;
+
+};
+
+
+class SimpleBlock : public BlockEntry
+{
+ SimpleBlock(const SimpleBlock&);
+ SimpleBlock& operator=(const SimpleBlock&);
+
+public:
+ SimpleBlock(Cluster*, long index, long long start, long long size);
+ long Parse();
+
+ Kind GetKind() const;
+ const Block* GetBlock() const;
+
+protected:
+ Block m_block;
+
+};
+
+
+class BlockGroup : public BlockEntry
+{
+ BlockGroup(const BlockGroup&);
+ BlockGroup& operator=(const BlockGroup&);
+
+public:
+ BlockGroup(
+ Cluster*,
+ long index,
+ long long block_start, //absolute pos of block's payload
+ long long block_size, //size of block's payload
+ long long prev,
+ long long next,
+ long long duration,
+ long long discard_padding);
+
+ long Parse();
+
+ Kind GetKind() const;
+ const Block* GetBlock() const;
+
+ long long GetPrevTimeCode() const; //relative to block's time
+ long long GetNextTimeCode() const; //as above
+ long long GetDurationTimeCode() const;
+
+private:
+ Block m_block;
+ const long long m_prev;
+ const long long m_next;
+ const long long m_duration;
+};
+
+///////////////////////////////////////////////////////////////
+// ContentEncoding element
+// Elements used to describe if the track data has been encrypted or
+// compressed with zlib or header stripping.
+class ContentEncoding {
+public:
+ enum {
+ kCTR = 1
+ };
+
+ ContentEncoding();
+ ~ContentEncoding();
+
+ // ContentCompression element names
+ struct ContentCompression {
+ ContentCompression();
+ ~ContentCompression();
+
+ unsigned long long algo;
+ unsigned char* settings;
+ long long settings_len;
+ };
+
+ // ContentEncAESSettings element names
+ struct ContentEncAESSettings {
+ ContentEncAESSettings() : cipher_mode(kCTR) {}
+ ~ContentEncAESSettings() {}
+
+ unsigned long long cipher_mode;
+ };
+
+ // ContentEncryption element names
+ struct ContentEncryption {
+ ContentEncryption();
+ ~ContentEncryption();
+
+ unsigned long long algo;
+ unsigned char* key_id;
+ long long key_id_len;
+ unsigned char* signature;
+ long long signature_len;
+ unsigned char* sig_key_id;
+ long long sig_key_id_len;
+ unsigned long long sig_algo;
+ unsigned long long sig_hash_algo;
+
+ ContentEncAESSettings aes_settings;
+ };
+
+ // Returns ContentCompression represented by |idx|. Returns NULL if |idx|
+ // is out of bounds.
+ const ContentCompression* GetCompressionByIndex(unsigned long idx) const;
+
+ // Returns number of ContentCompression elements in this ContentEncoding
+ // element.
+ unsigned long GetCompressionCount() const;
+
+ // Parses the ContentCompression element from |pReader|. |start| is the
+ // starting offset of the ContentCompression payload. |size| is the size in
+ // bytes of the ContentCompression payload. |compression| is where the parsed
+ // values will be stored.
+ long ParseCompressionEntry(long long start,
+ long long size,
+ IMkvReader* pReader,
+ ContentCompression* compression);
+
+ // Returns ContentEncryption represented by |idx|. Returns NULL if |idx|
+ // is out of bounds.
+ const ContentEncryption* GetEncryptionByIndex(unsigned long idx) const;
+
+ // Returns number of ContentEncryption elements in this ContentEncoding
+ // element.
+ unsigned long GetEncryptionCount() const;
+
+ // Parses the ContentEncAESSettings element from |pReader|. |start| is the
+ // starting offset of the ContentEncAESSettings payload. |size| is the
+ // size in bytes of the ContentEncAESSettings payload. |encryption| is
+ // where the parsed values will be stored.
+ long ParseContentEncAESSettingsEntry(long long start,
+ long long size,
+ IMkvReader* pReader,
+ ContentEncAESSettings* aes);
+
+ // Parses the ContentEncoding element from |pReader|. |start| is the
+ // starting offset of the ContentEncoding payload. |size| is the size in
+ // bytes of the ContentEncoding payload. Returns true on success.
+ long ParseContentEncodingEntry(long long start,
+ long long size,
+ IMkvReader* pReader);
+
+ // Parses the ContentEncryption element from |pReader|. |start| is the
+ // starting offset of the ContentEncryption payload. |size| is the size in
+ // bytes of the ContentEncryption payload. |encryption| is where the parsed
+ // values will be stored.
+ long ParseEncryptionEntry(long long start,
+ long long size,
+ IMkvReader* pReader,
+ ContentEncryption* encryption);
+
+ unsigned long long encoding_order() const { return encoding_order_; }
+ unsigned long long encoding_scope() const { return encoding_scope_; }
+ unsigned long long encoding_type() const { return encoding_type_; }
+
+private:
+ // Member variables for list of ContentCompression elements.
+ ContentCompression** compression_entries_;
+ ContentCompression** compression_entries_end_;
+
+ // Member variables for list of ContentEncryption elements.
+ ContentEncryption** encryption_entries_;
+ ContentEncryption** encryption_entries_end_;
+
+ // ContentEncoding element names
+ unsigned long long encoding_order_;
+ unsigned long long encoding_scope_;
+ unsigned long long encoding_type_;
+
+ // LIBWEBM_DISALLOW_COPY_AND_ASSIGN(ContentEncoding);
+ ContentEncoding(const ContentEncoding&);
+ ContentEncoding& operator=(const ContentEncoding&);
+};
+
+class Track
+{
+ Track(const Track&);
+ Track& operator=(const Track&);
+
+public:
+ class Info;
+ static long Create(
+ Segment*,
+ const Info&,
+ long long element_start,
+ long long element_size,
+ Track*&);
+
+ enum Type {
+ kVideo = 1,
+ kAudio = 2,
+ kSubtitle = 0x11,
+ kMetadata = 0x21
+ };
+
+ Segment* const m_pSegment;
+ const long long m_element_start;
+ const long long m_element_size;
+ virtual ~Track();
+
+ long GetType() const;
+ long GetNumber() const;
+ unsigned long long GetUid() const;
+ const char* GetNameAsUTF8() const;
+ const char* GetLanguage() const;
+ const char* GetCodecNameAsUTF8() const;
+ const char* GetCodecId() const;
+ const unsigned char* GetCodecPrivate(size_t&) const;
+ bool GetLacing() const;
+ unsigned long long GetDefaultDuration() const;
+ unsigned long long GetCodecDelay() const;
+ unsigned long long GetSeekPreRoll() const;
+
+ const BlockEntry* GetEOS() const;
+
+ struct Settings
+ {
+ long long start;
+ long long size;
+ };
+
+ class Info
+ {
+ public:
+ Info();
+ ~Info();
+ int Copy(Info&) const;
+ void Clear();
+ long type;
+ long number;
+ unsigned long long uid;
+ unsigned long long defaultDuration;
+ unsigned long long codecDelay;
+ unsigned long long seekPreRoll;
+ char* nameAsUTF8;
+ char* language;
+ char* codecId;
+ char* codecNameAsUTF8;
+ unsigned char* codecPrivate;
+ size_t codecPrivateSize;
+ bool lacing;
+ Settings settings;
+
+ private:
+ Info(const Info&);
+ Info& operator=(const Info&);
+ int CopyStr(char* Info::*str, Info&) const;
+ };
+
+ long GetFirst(const BlockEntry*&) const;
+ long GetNext(const BlockEntry* pCurr, const BlockEntry*& pNext) const;
+ virtual bool VetEntry(const BlockEntry*) const;
+ virtual long Seek(long long time_ns, const BlockEntry*&) const;
+
+ const ContentEncoding* GetContentEncodingByIndex(unsigned long idx) const;
+ unsigned long GetContentEncodingCount() const;
+
+ long ParseContentEncodingsEntry(long long start, long long size);
+
+protected:
+ Track(
+ Segment*,
+ long long element_start,
+ long long element_size);
+
+ Info m_info;
+
+ class EOSBlock : public BlockEntry
+ {
+ public:
+ EOSBlock();
+
+ Kind GetKind() const;
+ const Block* GetBlock() const;
+ };
+
+ EOSBlock m_eos;
+
+private:
+ ContentEncoding** content_encoding_entries_;
+ ContentEncoding** content_encoding_entries_end_;
+};
+
+
+class VideoTrack : public Track
+{
+ VideoTrack(const VideoTrack&);
+ VideoTrack& operator=(const VideoTrack&);
+
+ VideoTrack(
+ Segment*,
+ long long element_start,
+ long long element_size);
+
+public:
+ static long Parse(
+ Segment*,
+ const Info&,
+ long long element_start,
+ long long element_size,
+ VideoTrack*&);
+
+ long long GetWidth() const;
+ long long GetHeight() const;
+ double GetFrameRate() const;
+
+ bool VetEntry(const BlockEntry*) const;
+ long Seek(long long time_ns, const BlockEntry*&) const;
+
+private:
+ long long m_width;
+ long long m_height;
+ double m_rate;
+
+};
+
+
+class AudioTrack : public Track
+{
+ AudioTrack(const AudioTrack&);
+ AudioTrack& operator=(const AudioTrack&);
+
+ AudioTrack(
+ Segment*,
+ long long element_start,
+ long long element_size);
+public:
+ static long Parse(
+ Segment*,
+ const Info&,
+ long long element_start,
+ long long element_size,
+ AudioTrack*&);
+
+ double GetSamplingRate() const;
+ long long GetChannels() const;
+ long long GetBitDepth() const;
+
+private:
+ double m_rate;
+ long long m_channels;
+ long long m_bitDepth;
+};
+
+
+class Tracks
+{
+ Tracks(const Tracks&);
+ Tracks& operator=(const Tracks&);
+
+public:
+ Segment* const m_pSegment;
+ const long long m_start;
+ const long long m_size;
+ const long long m_element_start;
+ const long long m_element_size;
+
+ Tracks(
+ Segment*,
+ long long start,
+ long long size,
+ long long element_start,
+ long long element_size);
+
+ ~Tracks();
+
+ long Parse();
+
+ unsigned long GetTracksCount() const;
+
+ const Track* GetTrackByNumber(long tn) const;
+ const Track* GetTrackByIndex(unsigned long idx) const;
+
+private:
+ Track** m_trackEntries;
+ Track** m_trackEntriesEnd;
+
+ long ParseTrackEntry(
+ long long payload_start,
+ long long payload_size,
+ long long element_start,
+ long long element_size,
+ Track*&) const;
+
+};
+
+
+class Chapters
+{
+ Chapters(const Chapters&);
+ Chapters& operator=(const Chapters&);
+
+public:
+ Segment* const m_pSegment;
+ const long long m_start;
+ const long long m_size;
+ const long long m_element_start;
+ const long long m_element_size;
+
+ Chapters(
+ Segment*,
+ long long payload_start,
+ long long payload_size,
+ long long element_start,
+ long long element_size);
+
+ ~Chapters();
+
+ long Parse();
+
+ class Atom;
+ class Edition;
+
+ class Display
+ {
+ friend class Atom;
+ Display();
+ Display(const Display&);
+ ~Display();
+ Display& operator=(const Display&);
+ public:
+ const char* GetString() const;
+ const char* GetLanguage() const;
+ const char* GetCountry() const;
+ private:
+ void Init();
+ void ShallowCopy(Display&) const;
+ void Clear();
+ long Parse(IMkvReader*, long long pos, long long size);
+
+ char* m_string;
+ char* m_language;
+ char* m_country;
+ };
+
+ class Atom
+ {
+ friend class Edition;
+ Atom();
+ Atom(const Atom&);
+ ~Atom();
+ Atom& operator=(const Atom&);
+ public:
+ unsigned long long GetUID() const;
+ const char* GetStringUID() const;
+
+ long long GetStartTimecode() const;
+ long long GetStopTimecode() const;
+
+ long long GetStartTime(const Chapters*) const;
+ long long GetStopTime(const Chapters*) const;
+
+ int GetDisplayCount() const;
+ const Display* GetDisplay(int index) const;
+ private:
+ void Init();
+ void ShallowCopy(Atom&) const;
+ void Clear();
+ long Parse(IMkvReader*, long long pos, long long size);
+ static long long GetTime(const Chapters*, long long timecode);
+
+ long ParseDisplay(IMkvReader*, long long pos, long long size);
+ bool ExpandDisplaysArray();
+
+ char* m_string_uid;
+ unsigned long long m_uid;
+ long long m_start_timecode;
+ long long m_stop_timecode;
+
+ Display* m_displays;
+ int m_displays_size;
+ int m_displays_count;
+ };
+
+ class Edition
+ {
+ friend class Chapters;
+ Edition();
+ Edition(const Edition&);
+ ~Edition();
+ Edition& operator=(const Edition&);
+ public:
+ int GetAtomCount() const;
+ const Atom* GetAtom(int index) const;
+ private:
+ void Init();
+ void ShallowCopy(Edition&) const;
+ void Clear();
+ long Parse(IMkvReader*, long long pos, long long size);
+
+ long ParseAtom(IMkvReader*, long long pos, long long size);
+ bool ExpandAtomsArray();
+
+ Atom* m_atoms;
+ int m_atoms_size;
+ int m_atoms_count;
+ };
+
+ int GetEditionCount() const;
+ const Edition* GetEdition(int index) const;
+
+private:
+ long ParseEdition(long long pos, long long size);
+ bool ExpandEditionsArray();
+
+ Edition* m_editions;
+ int m_editions_size;
+ int m_editions_count;
+
+};
+
+
+class SegmentInfo
+{
+ SegmentInfo(const SegmentInfo&);
+ SegmentInfo& operator=(const SegmentInfo&);
+
+public:
+ Segment* const m_pSegment;
+ const long long m_start;
+ const long long m_size;
+ const long long m_element_start;
+ const long long m_element_size;
+
+ SegmentInfo(
+ Segment*,
+ long long start,
+ long long size,
+ long long element_start,
+ long long element_size);
+
+ ~SegmentInfo();
+
+ long Parse();
+
+ long long GetTimeCodeScale() const;
+ long long GetDuration() const; //scaled
+ const char* GetMuxingAppAsUTF8() const;
+ const char* GetWritingAppAsUTF8() const;
+ const char* GetTitleAsUTF8() const;
+
+private:
+ long long m_timecodeScale;
+ double m_duration;
+ char* m_pMuxingAppAsUTF8;
+ char* m_pWritingAppAsUTF8;
+ char* m_pTitleAsUTF8;
+};
+
+
+class SeekHead
+{
+ SeekHead(const SeekHead&);
+ SeekHead& operator=(const SeekHead&);
+
+public:
+ Segment* const m_pSegment;
+ const long long m_start;
+ const long long m_size;
+ const long long m_element_start;
+ const long long m_element_size;
+
+ SeekHead(
+ Segment*,
+ long long start,
+ long long size,
+ long long element_start,
+ long long element_size);
+
+ ~SeekHead();
+
+ long Parse();
+
+ struct Entry
+ {
+ //the SeekHead entry payload
+ long long id;
+ long long pos;
+
+ //absolute pos of SeekEntry ID
+ long long element_start;
+
+ //SeekEntry ID size + size size + payload
+ long long element_size;
+ };
+
+ int GetCount() const;
+ const Entry* GetEntry(int idx) const;
+
+ struct VoidElement
+ {
+ //absolute pos of Void ID
+ long long element_start;
+
+ //ID size + size size + payload size
+ long long element_size;
+ };
+
+ int GetVoidElementCount() const;
+ const VoidElement* GetVoidElement(int idx) const;
+
+private:
+ Entry* m_entries;
+ int m_entry_count;
+
+ VoidElement* m_void_elements;
+ int m_void_element_count;
+
+ static bool ParseEntry(
+ IMkvReader*,
+ long long pos, //payload
+ long long size,
+ Entry*);
+
+};
+
+class Cues;
+class CuePoint
+{
+ friend class Cues;
+
+ CuePoint(long, long long);
+ ~CuePoint();
+
+ CuePoint(const CuePoint&);
+ CuePoint& operator=(const CuePoint&);
+
+public:
+ long long m_element_start;
+ long long m_element_size;
+
+ void Load(IMkvReader*);
+
+ long long GetTimeCode() const; //absolute but unscaled
+ long long GetTime(const Segment*) const; //absolute and scaled (ns units)
+
+ struct TrackPosition
+ {
+ long long m_track;
+ long long m_pos; //of cluster
+ long long m_block;
+ //codec_state //defaults to 0
+ //reference = clusters containing req'd referenced blocks
+ // reftime = timecode of the referenced block
+
+ void Parse(IMkvReader*, long long, long long);
+ };
+
+ const TrackPosition* Find(const Track*) const;
+
+private:
+ const long m_index;
+ long long m_timecode;
+ TrackPosition* m_track_positions;
+ size_t m_track_positions_count;
+
+};
+
+
+class Cues
+{
+ friend class Segment;
+
+ Cues(
+ Segment*,
+ long long start,
+ long long size,
+ long long element_start,
+ long long element_size);
+ ~Cues();
+
+ Cues(const Cues&);
+ Cues& operator=(const Cues&);
+
+public:
+ Segment* const m_pSegment;
+ const long long m_start;
+ const long long m_size;
+ const long long m_element_start;
+ const long long m_element_size;
+
+ bool Find( //lower bound of time_ns
+ long long time_ns,
+ const Track*,
+ const CuePoint*&,
+ const CuePoint::TrackPosition*&) const;
+
+#if 0
+ bool FindNext( //upper_bound of time_ns
+ long long time_ns,
+ const Track*,
+ const CuePoint*&,
+ const CuePoint::TrackPosition*&) const;
+#endif
+
+ const CuePoint* GetFirst() const;
+ const CuePoint* GetLast() const;
+ const CuePoint* GetNext(const CuePoint*) const;
+
+ const BlockEntry* GetBlock(
+ const CuePoint*,
+ const CuePoint::TrackPosition*) const;
+
+ bool LoadCuePoint() const;
+ long GetCount() const; //loaded only
+ //long GetTotal() const; //loaded + preloaded
+ bool DoneParsing() const;
+
+private:
+ void Init() const;
+ void PreloadCuePoint(long&, long long) const;
+
+ mutable CuePoint** m_cue_points;
+ mutable long m_count;
+ mutable long m_preload_count;
+ mutable long long m_pos;
+
+};
+
+
+class Cluster
+{
+ friend class Segment;
+
+ Cluster(const Cluster&);
+ Cluster& operator=(const Cluster&);
+
+public:
+ Segment* const m_pSegment;
+
+public:
+ static Cluster* Create(
+ Segment*,
+ long index, //index in segment
+ long long off); //offset relative to segment
+ //long long element_size);
+
+ Cluster(); //EndOfStream
+ ~Cluster();
+
+ bool EOS() const;
+
+ long long GetTimeCode() const; //absolute, but not scaled
+ long long GetTime() const; //absolute, and scaled (nanosecond units)
+ long long GetFirstTime() const; //time (ns) of first (earliest) block
+ long long GetLastTime() const; //time (ns) of last (latest) block
+
+ long GetFirst(const BlockEntry*&) const;
+ long GetLast(const BlockEntry*&) const;
+ long GetNext(const BlockEntry* curr, const BlockEntry*& next) const;
+
+ const BlockEntry* GetEntry(const Track*, long long ns = -1) const;
+ const BlockEntry* GetEntry(
+ const CuePoint&,
+ const CuePoint::TrackPosition&) const;
+ //const BlockEntry* GetMaxKey(const VideoTrack*) const;
+
+// static bool HasBlockEntries(const Segment*, long long);
+
+ static long HasBlockEntries(
+ const Segment*,
+ long long idoff,
+ long long& pos,
+ long& size);
+
+ long GetEntryCount() const;
+
+ long Load(long long& pos, long& size) const;
+
+ long Parse(long long& pos, long& size) const;
+ long GetEntry(long index, const mkvparser::BlockEntry*&) const;
+
+protected:
+ Cluster(
+ Segment*,
+ long index,
+ long long element_start);
+ //long long element_size);
+
+public:
+ const long long m_element_start;
+ long long GetPosition() const; //offset relative to segment
+
+ long GetIndex() const;
+ long long GetElementSize() const;
+ //long long GetPayloadSize() const;
+
+ //long long Unparsed() const;
+
+private:
+ long m_index;
+ mutable long long m_pos;
+ //mutable long long m_size;
+ mutable long long m_element_size;
+ mutable long long m_timecode;
+ mutable BlockEntry** m_entries;
+ mutable long m_entries_size;
+ mutable long m_entries_count;
+
+ long ParseSimpleBlock(long long, long long&, long&);
+ long ParseBlockGroup(long long, long long&, long&);
+
+ long CreateBlock(long long id, long long pos, long long size,
+ long long discard_padding);
+ long CreateBlockGroup(long long start_offset, long long size,
+ long long discard_padding);
+ long CreateSimpleBlock(long long, long long);
+
+};
+
+
+class Segment
+{
+ friend class Cues;
+ friend class Track;
+ friend class VideoTrack;
+
+ Segment(const Segment&);
+ Segment& operator=(const Segment&);
+
+private:
+ Segment(
+ IMkvReader*,
+ long long elem_start,
+ //long long elem_size,
+ long long pos,
+ long long size);
+
+public:
+ IMkvReader* const m_pReader;
+ const long long m_element_start;
+ //const long long m_element_size;
+ const long long m_start; //posn of segment payload
+ const long long m_size; //size of segment payload
+ Cluster m_eos; //TODO: make private?
+
+ static long long CreateInstance(IMkvReader*, long long, Segment*&);
+ ~Segment();
+
+ long Load(); //loads headers and all clusters
+
+ //for incremental loading
+ //long long Unparsed() const;
+ bool DoneParsing() const;
+ long long ParseHeaders(); //stops when first cluster is found
+ //long FindNextCluster(long long& pos, long& size) const;
+ long LoadCluster(long long& pos, long& size); //load one cluster
+ long LoadCluster();
+
+ long ParseNext(
+ const Cluster* pCurr,
+ const Cluster*& pNext,
+ long long& pos,
+ long& size);
+
+#if 0
+ //This pair parses one cluster, but only changes the state of the
+ //segment object when the cluster is actually added to the index.
+ long ParseCluster(long long& cluster_pos, long long& new_pos) const;
+ bool AddCluster(long long cluster_pos, long long new_pos);
+#endif
+
+ const SeekHead* GetSeekHead() const;
+ const Tracks* GetTracks() const;
+ const SegmentInfo* GetInfo() const;
+ const Cues* GetCues() const;
+ const Chapters* GetChapters() const;
+
+ long long GetDuration() const;
+
+ unsigned long GetCount() const;
+ const Cluster* GetFirst() const;
+ const Cluster* GetLast() const;
+ const Cluster* GetNext(const Cluster*);
+
+ const Cluster* FindCluster(long long time_nanoseconds) const;
+ //const BlockEntry* Seek(long long time_nanoseconds, const Track*) const;
+
+ const Cluster* FindOrPreloadCluster(long long pos);
+
+ long ParseCues(
+ long long cues_off, //offset relative to start of segment
+ long long& parse_pos,
+ long& parse_len);
+
+private:
+
+ long long m_pos; //absolute file posn; what has been consumed so far
+ Cluster* m_pUnknownSize;
+
+ SeekHead* m_pSeekHead;
+ SegmentInfo* m_pInfo;
+ Tracks* m_pTracks;
+ Cues* m_pCues;
+ Chapters* m_pChapters;
+ Cluster** m_clusters;
+ long m_clusterCount; //number of entries for which m_index >= 0
+ long m_clusterPreloadCount; //number of entries for which m_index < 0
+ long m_clusterSize; //array size
+
+ long DoLoadCluster(long long&, long&);
+ long DoLoadClusterUnknownSize(long long&, long&);
+ long DoParseNext(const Cluster*&, long long&, long&);
+
+ void AppendCluster(Cluster*);
+ void PreloadCluster(Cluster*, ptrdiff_t);
+
+ //void ParseSeekHead(long long pos, long long size);
+ //void ParseSeekEntry(long long pos, long long size);
+ //void ParseCues(long long);
+
+ const BlockEntry* GetBlock(
+ const CuePoint&,
+ const CuePoint::TrackPosition&);
+
+};
+
+} //end namespace mkvparser
+
+inline long mkvparser::Segment::LoadCluster()
+{
+ long long pos;
+ long size;
+
+ return LoadCluster(pos, size);
+}
+
+#endif //MKVPARSER_HPP
diff --git a/libvpx/third_party/libwebm/mkvreader.cpp b/libvpx/third_party/libwebm/mkvreader.cpp
new file mode 100644
index 0000000..cb3567f
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvreader.cpp
@@ -0,0 +1,128 @@
+// Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#include "mkvreader.hpp"
+
+#include <cassert>
+
+namespace mkvparser
+{
+
+MkvReader::MkvReader() :
+ m_file(NULL)
+{
+}
+
+MkvReader::~MkvReader()
+{
+ Close();
+}
+
+int MkvReader::Open(const char* fileName)
+{
+ if (fileName == NULL)
+ return -1;
+
+ if (m_file)
+ return -1;
+
+#ifdef _MSC_VER
+ const errno_t e = fopen_s(&m_file, fileName, "rb");
+
+ if (e)
+ return -1; //error
+#else
+ m_file = fopen(fileName, "rb");
+
+ if (m_file == NULL)
+ return -1;
+#endif
+
+#ifdef _MSC_VER
+ int status = _fseeki64(m_file, 0L, SEEK_END);
+
+ if (status)
+ return -1; //error
+
+ m_length = _ftelli64(m_file);
+#else
+ fseek(m_file, 0L, SEEK_END);
+ m_length = ftell(m_file);
+#endif
+ assert(m_length >= 0);
+
+#ifdef _MSC_VER
+ status = _fseeki64(m_file, 0L, SEEK_SET);
+
+ if (status)
+ return -1; //error
+#else
+ fseek(m_file, 0L, SEEK_SET);
+#endif
+
+ return 0;
+}
+
+void MkvReader::Close()
+{
+ if (m_file != NULL)
+ {
+ fclose(m_file);
+ m_file = NULL;
+ }
+}
+
+int MkvReader::Length(long long* total, long long* available)
+{
+ if (m_file == NULL)
+ return -1;
+
+ if (total)
+ *total = m_length;
+
+ if (available)
+ *available = m_length;
+
+ return 0;
+}
+
+int MkvReader::Read(long long offset, long len, unsigned char* buffer)
+{
+ if (m_file == NULL)
+ return -1;
+
+ if (offset < 0)
+ return -1;
+
+ if (len < 0)
+ return -1;
+
+ if (len == 0)
+ return 0;
+
+ if (offset >= m_length)
+ return -1;
+
+#ifdef _MSC_VER
+ const int status = _fseeki64(m_file, offset, SEEK_SET);
+
+ if (status)
+ return -1; //error
+#else
+ fseek(m_file, offset, SEEK_SET);
+#endif
+
+ const size_t size = fread(buffer, 1, len, m_file);
+
+ if (size < size_t(len))
+ return -1; //error
+
+ return 0; //success
+}
+
+} //end namespace mkvparser
diff --git a/libvpx/third_party/libwebm/mkvreader.hpp b/libvpx/third_party/libwebm/mkvreader.hpp
new file mode 100644
index 0000000..adcc29f
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvreader.hpp
@@ -0,0 +1,38 @@
+// Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef MKVREADER_HPP
+#define MKVREADER_HPP
+
+#include "mkvparser.hpp"
+#include <cstdio>
+
+namespace mkvparser
+{
+
+class MkvReader : public IMkvReader
+{
+ MkvReader(const MkvReader&);
+ MkvReader& operator=(const MkvReader&);
+public:
+ MkvReader();
+ virtual ~MkvReader();
+
+ int Open(const char*);
+ void Close();
+
+ virtual int Read(long long position, long length, unsigned char* buffer);
+ virtual int Length(long long* total, long long* available);
+private:
+ long long m_length;
+ FILE* m_file;
+};
+
+} //end namespace mkvparser
+
+#endif //MKVREADER_HPP
diff --git a/libvpx/third_party/libwebm/mkvwriter.cpp b/libvpx/third_party/libwebm/mkvwriter.cpp
new file mode 100644
index 0000000..8de89a4
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvwriter.cpp
@@ -0,0 +1,97 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#include "mkvwriter.hpp"
+
+#ifdef _MSC_VER
+#include <share.h> // for _SH_DENYWR
+#endif
+
+#include <new>
+
+namespace mkvmuxer {
+
+MkvWriter::MkvWriter() : file_(NULL), writer_owns_file_(true) {
+}
+
+MkvWriter::MkvWriter(FILE* fp): file_(fp), writer_owns_file_(false) {
+}
+
+MkvWriter::~MkvWriter() {
+ Close();
+}
+
+int32 MkvWriter::Write(const void* buffer, uint32 length) {
+ if (!file_)
+ return -1;
+
+ if (length == 0)
+ return 0;
+
+ if (buffer == NULL)
+ return -1;
+
+ const size_t bytes_written = fwrite(buffer, 1, length, file_);
+
+ return (bytes_written == length) ? 0 : -1;
+}
+
+bool MkvWriter::Open(const char* filename) {
+ if (filename == NULL)
+ return false;
+
+ if (file_)
+ return false;
+
+#ifdef _MSC_VER
+ file_ = _fsopen(filename, "wb", _SH_DENYWR);
+#else
+ file_ = fopen(filename, "wb");
+#endif
+ if (file_ == NULL)
+ return false;
+ return true;
+}
+
+void MkvWriter::Close() {
+ if (file_ && writer_owns_file_) {
+ fclose(file_);
+ }
+ file_ = NULL;
+}
+
+int64 MkvWriter::Position() const {
+ if (!file_)
+ return 0;
+
+#ifdef _MSC_VER
+ return _ftelli64(file_);
+#else
+ return ftell(file_);
+#endif
+}
+
+int32 MkvWriter::Position(int64 position) {
+ if (!file_)
+ return -1;
+
+#ifdef _MSC_VER
+ return _fseeki64(file_, position, SEEK_SET);
+#else
+ return fseek(file_, position, SEEK_SET);
+#endif
+}
+
+bool MkvWriter::Seekable() const {
+ return true;
+}
+
+void MkvWriter::ElementStartNotify(uint64, int64) {
+}
+
+} // namespace mkvmuxer
diff --git a/libvpx/third_party/libwebm/mkvwriter.hpp b/libvpx/third_party/libwebm/mkvwriter.hpp
new file mode 100644
index 0000000..524e0f7
--- /dev/null
+++ b/libvpx/third_party/libwebm/mkvwriter.hpp
@@ -0,0 +1,51 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef MKVWRITER_HPP
+#define MKVWRITER_HPP
+
+#include <stdio.h>
+
+#include "mkvmuxer.hpp"
+#include "mkvmuxertypes.hpp"
+
+namespace mkvmuxer {
+
+// Default implementation of the IMkvWriter interface on Windows.
+class MkvWriter : public IMkvWriter {
+ public:
+ MkvWriter();
+ MkvWriter(FILE* fp);
+ virtual ~MkvWriter();
+
+ // IMkvWriter interface
+ virtual int64 Position() const;
+ virtual int32 Position(int64 position);
+ virtual bool Seekable() const;
+ virtual int32 Write(const void* buffer, uint32 length);
+ virtual void ElementStartNotify(uint64 element_id, int64 position);
+
+ // Creates and opens a file for writing. |filename| is the name of the file
+ // to open. This function will overwrite the contents of |filename|. Returns
+ // true on success.
+ bool Open(const char* filename);
+
+ // Closes an opened file.
+ void Close();
+
+ private:
+ // File handle to output file.
+ FILE* file_;
+ bool writer_owns_file_;
+
+ LIBWEBM_DISALLOW_COPY_AND_ASSIGN(MkvWriter);
+};
+
+} //end namespace mkvmuxer
+
+#endif // MKVWRITER_HPP
diff --git a/libvpx/third_party/libwebm/webmids.hpp b/libvpx/third_party/libwebm/webmids.hpp
new file mode 100644
index 0000000..65fab96
--- /dev/null
+++ b/libvpx/third_party/libwebm/webmids.hpp
@@ -0,0 +1,141 @@
+// Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+//
+// Use of this source code is governed by a BSD-style license
+// that can be found in the LICENSE file in the root of the source
+// tree. An additional intellectual property rights grant can be found
+// in the file PATENTS. All contributing project authors may
+// be found in the AUTHORS file in the root of the source tree.
+
+#ifndef WEBMIDS_HPP
+#define WEBMIDS_HPP
+
+namespace mkvmuxer {
+
+enum MkvId {
+ kMkvEBML = 0x1A45DFA3,
+ kMkvEBMLVersion = 0x4286,
+ kMkvEBMLReadVersion = 0x42F7,
+ kMkvEBMLMaxIDLength = 0x42F2,
+ kMkvEBMLMaxSizeLength = 0x42F3,
+ kMkvDocType = 0x4282,
+ kMkvDocTypeVersion = 0x4287,
+ kMkvDocTypeReadVersion = 0x4285,
+ kMkvVoid = 0xEC,
+ kMkvSignatureSlot = 0x1B538667,
+ kMkvSignatureAlgo = 0x7E8A,
+ kMkvSignatureHash = 0x7E9A,
+ kMkvSignaturePublicKey = 0x7EA5,
+ kMkvSignature = 0x7EB5,
+ kMkvSignatureElements = 0x7E5B,
+ kMkvSignatureElementList = 0x7E7B,
+ kMkvSignedElement = 0x6532,
+ //segment
+ kMkvSegment = 0x18538067,
+ //Meta Seek Information
+ kMkvSeekHead = 0x114D9B74,
+ kMkvSeek = 0x4DBB,
+ kMkvSeekID = 0x53AB,
+ kMkvSeekPosition = 0x53AC,
+ //Segment Information
+ kMkvInfo = 0x1549A966,
+ kMkvTimecodeScale = 0x2AD7B1,
+ kMkvDuration = 0x4489,
+ kMkvDateUTC = 0x4461,
+ kMkvMuxingApp = 0x4D80,
+ kMkvWritingApp = 0x5741,
+ //Cluster
+ kMkvCluster = 0x1F43B675,
+ kMkvTimecode = 0xE7,
+ kMkvPrevSize = 0xAB,
+ kMkvBlockGroup = 0xA0,
+ kMkvBlock = 0xA1,
+ kMkvBlockDuration = 0x9B,
+ kMkvReferenceBlock = 0xFB,
+ kMkvLaceNumber = 0xCC,
+ kMkvSimpleBlock = 0xA3,
+ kMkvBlockAdditions = 0x75A1,
+ kMkvBlockMore = 0xA6,
+ kMkvBlockAddID = 0xEE,
+ kMkvBlockAdditional = 0xA5,
+ kMkvDiscardPadding = 0x75A2,
+ //Track
+ kMkvTracks = 0x1654AE6B,
+ kMkvTrackEntry = 0xAE,
+ kMkvTrackNumber = 0xD7,
+ kMkvTrackUID = 0x73C5,
+ kMkvTrackType = 0x83,
+ kMkvFlagEnabled = 0xB9,
+ kMkvFlagDefault = 0x88,
+ kMkvFlagForced = 0x55AA,
+ kMkvFlagLacing = 0x9C,
+ kMkvDefaultDuration = 0x23E383,
+ kMkvMaxBlockAdditionID = 0x55EE,
+ kMkvName = 0x536E,
+ kMkvLanguage = 0x22B59C,
+ kMkvCodecID = 0x86,
+ kMkvCodecPrivate = 0x63A2,
+ kMkvCodecName = 0x258688,
+ kMkvCodecDelay = 0x56AA,
+ kMkvSeekPreRoll = 0x56BB,
+ //video
+ kMkvVideo = 0xE0,
+ kMkvFlagInterlaced = 0x9A,
+ kMkvStereoMode = 0x53B8,
+ kMkvAlphaMode = 0x53C0,
+ kMkvPixelWidth = 0xB0,
+ kMkvPixelHeight = 0xBA,
+ kMkvPixelCropBottom = 0x54AA,
+ kMkvPixelCropTop = 0x54BB,
+ kMkvPixelCropLeft = 0x54CC,
+ kMkvPixelCropRight = 0x54DD,
+ kMkvDisplayWidth = 0x54B0,
+ kMkvDisplayHeight = 0x54BA,
+ kMkvDisplayUnit = 0x54B2,
+ kMkvAspectRatioType = 0x54B3,
+ kMkvFrameRate = 0x2383E3,
+ //end video
+ //audio
+ kMkvAudio = 0xE1,
+ kMkvSamplingFrequency = 0xB5,
+ kMkvOutputSamplingFrequency = 0x78B5,
+ kMkvChannels = 0x9F,
+ kMkvBitDepth = 0x6264,
+ //end audio
+ //ContentEncodings
+ kMkvContentEncodings = 0x6D80,
+ kMkvContentEncoding = 0x6240,
+ kMkvContentEncodingOrder = 0x5031,
+ kMkvContentEncodingScope = 0x5032,
+ kMkvContentEncodingType = 0x5033,
+ kMkvContentEncryption = 0x5035,
+ kMkvContentEncAlgo = 0x47E1,
+ kMkvContentEncKeyID = 0x47E2,
+ kMkvContentEncAESSettings = 0x47E7,
+ kMkvAESSettingsCipherMode = 0x47E8,
+ kMkvAESSettingsCipherInitData = 0x47E9,
+ //end ContentEncodings
+ //Cueing Data
+ kMkvCues = 0x1C53BB6B,
+ kMkvCuePoint = 0xBB,
+ kMkvCueTime = 0xB3,
+ kMkvCueTrackPositions = 0xB7,
+ kMkvCueTrack = 0xF7,
+ kMkvCueClusterPosition = 0xF1,
+ kMkvCueBlockNumber = 0x5378,
+ //Chapters
+ kMkvChapters = 0x1043A770,
+ kMkvEditionEntry = 0x45B9,
+ kMkvChapterAtom = 0xB6,
+ kMkvChapterUID = 0x73C4,
+ kMkvChapterStringUID = 0x5654,
+ kMkvChapterTimeStart = 0x91,
+ kMkvChapterTimeEnd = 0x92,
+ kMkvChapterDisplay = 0x80,
+ kMkvChapString = 0x85,
+ kMkvChapLanguage = 0x437C,
+ kMkvChapCountry = 0x437E
+};
+
+} // end namespace mkvmuxer
+
+#endif // WEBMIDS_HPP
diff --git a/libvpx/third_party/nestegg/0001-include-paths.diff b/libvpx/third_party/nestegg/0001-include-paths.diff
new file mode 100644
index 0000000..a704ebd
--- /dev/null
+++ b/libvpx/third_party/nestegg/0001-include-paths.diff
@@ -0,0 +1,41 @@
+diff --git a/nestegg/halloc/src/halloc.c b/nestegg/halloc/src/halloc.c
+index 5758fc0..837b3ff 100644
+--- a/nestegg/halloc/src/halloc.c
++++ b/nestegg/halloc/src/halloc.c
+@@ -15,7 +15,7 @@
+ #include <stdlib.h> /* realloc */
+ #include <string.h> /* memset & co */
+
+-#include "halloc.h"
++#include "third_party/nestegg/halloc/halloc.h"
+ #include "align.h"
+ #include "hlist.h"
+
+diff --git a/nestegg/include/nestegg/nestegg.h b/nestegg/include/nestegg/nestegg.h
+index ff13728..c18d1d3 100644
+--- a/nestegg/include/nestegg/nestegg.h
++++ b/nestegg/include/nestegg/nestegg.h
+@@ -7,7 +7,7 @@
+ #if !defined(NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79)
+ #define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
+
+-#include <nestegg/nestegg-stdint.h>
++#include "vpx/vpx_integer.h"
+
+ #if defined(__cplusplus)
+ extern "C" {
+diff --git a/nestegg/src/nestegg.c b/nestegg/src/nestegg.c
+index daf1eed..4fb10e7 100644
+--- a/nestegg/src/nestegg.c
++++ b/nestegg/src/nestegg.c
+@@ -8,8 +8,8 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include "halloc.h"
+-#include "nestegg/nestegg.h"
++#include "third_party/nestegg/halloc/halloc.h"
++#include "third_party/nestegg/include/nestegg/nestegg.h"
+
+ /* EBML Elements */
+ #define ID_EBML 0x1a45dfa3
diff --git a/libvpx/third_party/nestegg/0002-ne_read_simple-uninitialized_variable.diff b/libvpx/third_party/nestegg/0002-ne_read_simple-uninitialized_variable.diff
new file mode 100644
index 0000000..c3bc9e5
--- /dev/null
+++ b/libvpx/third_party/nestegg/0002-ne_read_simple-uninitialized_variable.diff
@@ -0,0 +1,21 @@
+diff --git a/nestegg/src/nestegg.c b/nestegg/src/nestegg.c
+index 4fb10e7..b6bc460 100644
+--- a/nestegg/src/nestegg.c
++++ b/nestegg/src/nestegg.c
+@@ -934,7 +934,7 @@ static int
+ ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
+ {
+ struct ebml_type * storage;
+- int r;
++ int r = 0;
+
+ storage = (struct ebml_type *) (ctx->ancestor->data + desc->offset);
+
+@@ -968,7 +968,6 @@ ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
+ case TYPE_MASTER:
+ case TYPE_UNKNOWN:
+ assert(0);
+- r = 0;
+ break;
+ }
+
diff --git a/libvpx/third_party/nestegg/AUTHORS b/libvpx/third_party/nestegg/AUTHORS
new file mode 100644
index 0000000..7d2c612
--- /dev/null
+++ b/libvpx/third_party/nestegg/AUTHORS
@@ -0,0 +1,3 @@
+Matthew Gregan <kinetik@flim.org>
+Steve Workman <sjhworkman@gmail.com>
+Paul Adenot <paul@paul.cx>
diff --git a/libvpx/nestegg/INSTALL b/libvpx/third_party/nestegg/INSTALL
index 401df41..401df41 100644
--- a/libvpx/nestegg/INSTALL
+++ b/libvpx/third_party/nestegg/INSTALL
diff --git a/libvpx/nestegg/LICENSE b/libvpx/third_party/nestegg/LICENSE
index a67984a..a67984a 100644
--- a/libvpx/nestegg/LICENSE
+++ b/libvpx/third_party/nestegg/LICENSE
diff --git a/libvpx/nestegg/README b/libvpx/third_party/nestegg/README
index 47c8237..47c8237 100644
--- a/libvpx/nestegg/README
+++ b/libvpx/third_party/nestegg/README
diff --git a/libvpx/third_party/nestegg/README.webm b/libvpx/third_party/nestegg/README.webm
new file mode 100644
index 0000000..8e3760b
--- /dev/null
+++ b/libvpx/third_party/nestegg/README.webm
@@ -0,0 +1,24 @@
+URL: https://github.com/kinetiknz/nestegg.git
+Version: f46223191d8116a36bf299b5b9793fcb798417b1
+License: ISC-style
+License File: LICENSE
+
+Description:
+The source under the halloc/ directory is licensed under a BSD license. See
+halloc/halloc.h for details.
+
+Local Modifications:
+- delete unnecessary docs and build files
+- nestegg/0001-include-paths.diff
+ include path modifications for the libvpx build system
+- 0002-ne_read_simple-uninitialized_variable.diff
+ fixes:
+nestegg.c|975 col 6| warning: ‘r’ may be used uninitialized in this function [-Wuninitialized]
+- add ne_get_uint32 convenience function
+- fix track_number uint64->uint32 warnings
+- fix track_scale double->uint64 warning
+- nestegg_packet_track: fix uint64->uint32 warning
+- ne_read_(string|binary|block): normalize size_t usage
+- ne_parse: normalize size_t usage
+- quiet read related uint64->size_t warnings
+- ne_buffer_read: quiet uint64->size_t warning
diff --git a/libvpx/nestegg/TODO b/libvpx/third_party/nestegg/TODO
index bf0cb04..bf0cb04 100644
--- a/libvpx/nestegg/TODO
+++ b/libvpx/third_party/nestegg/TODO
diff --git a/libvpx/nestegg/halloc/README b/libvpx/third_party/nestegg/halloc/README
index 380fba2..380fba2 100644
--- a/libvpx/nestegg/halloc/README
+++ b/libvpx/third_party/nestegg/halloc/README
diff --git a/libvpx/nestegg/halloc/halloc.h b/libvpx/third_party/nestegg/halloc/halloc.h
index 10af4e8..10af4e8 100644
--- a/libvpx/nestegg/halloc/halloc.h
+++ b/libvpx/third_party/nestegg/halloc/halloc.h
diff --git a/libvpx/nestegg/halloc/src/align.h b/libvpx/third_party/nestegg/halloc/src/align.h
index 4c6e183..4c6e183 100644
--- a/libvpx/nestegg/halloc/src/align.h
+++ b/libvpx/third_party/nestegg/halloc/src/align.h
diff --git a/libvpx/nestegg/halloc/src/halloc.c b/libvpx/third_party/nestegg/halloc/src/halloc.c
index 38fd6c1..8860d73 100644
--- a/libvpx/nestegg/halloc/src/halloc.c
+++ b/libvpx/third_party/nestegg/halloc/src/halloc.c
@@ -15,7 +15,7 @@
#include <stdlib.h> /* realloc */
#include <string.h> /* memset & co */
-#include "../halloc.h"
+#include "third_party/nestegg/halloc/halloc.h"
#include "align.h"
#include "hlist.h"
diff --git a/libvpx/nestegg/halloc/src/hlist.h b/libvpx/third_party/nestegg/halloc/src/hlist.h
index 2791f78..2791f78 100644
--- a/libvpx/nestegg/halloc/src/hlist.h
+++ b/libvpx/third_party/nestegg/halloc/src/hlist.h
diff --git a/libvpx/nestegg/halloc/src/macros.h b/libvpx/third_party/nestegg/halloc/src/macros.h
index 1f84bc2..1f84bc2 100644
--- a/libvpx/nestegg/halloc/src/macros.h
+++ b/libvpx/third_party/nestegg/halloc/src/macros.h
diff --git a/libvpx/nestegg/include/nestegg/nestegg.h b/libvpx/third_party/nestegg/include/nestegg/nestegg.h
index 6510694..c18d1d3 100644
--- a/libvpx/nestegg/include/nestegg/nestegg.h
+++ b/libvpx/third_party/nestegg/include/nestegg/nestegg.h
@@ -4,12 +4,12 @@
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
*/
-#ifndef NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
-#define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
+#if !defined(NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79)
+#define NESTEGG_671cac2a_365d_ed69_d7a3_4491d3538d79
#include "vpx/vpx_integer.h"
-#ifdef __cplusplus
+#if defined(__cplusplus)
extern "C" {
#endif
@@ -17,10 +17,10 @@ extern "C" {
@section intro Introduction
- This is the documentation fot the <tt>libnestegg</tt> C API.
+ This is the documentation for the <tt>libnestegg</tt> C API.
<tt>libnestegg</tt> is a demultiplexing library for <a
- href="http://www.matroska.org/">Matroska</a> and <a
- href="http://www.webmproject.org/">WebMedia</a> media files.
+ href="http://www.webmproject.org/code/specs/container/">WebM</a>
+ media files.
@section example Example code
@@ -68,6 +68,13 @@ extern "C" {
#define NESTEGG_CODEC_VP8 0 /**< Track uses Google On2 VP8 codec. */
#define NESTEGG_CODEC_VORBIS 1 /**< Track uses Xiph Vorbis codec. */
#define NESTEGG_CODEC_VP9 2 /**< Track uses Google On2 VP9 codec. */
+#define NESTEGG_CODEC_OPUS 3 /**< Track uses Xiph Opus codec. */
+
+#define NESTEGG_VIDEO_MONO 0 /**< Track is mono video. */
+#define NESTEGG_VIDEO_STEREO_LEFT_RIGHT 1 /**< Track is side-by-side stereo video. Left first. */
+#define NESTEGG_VIDEO_STEREO_BOTTOM_TOP 2 /**< Track is top-bottom stereo video. Right first. */
+#define NESTEGG_VIDEO_STEREO_TOP_BOTTOM 3 /**< Track is top-bottom stereo video. Left first. */
+#define NESTEGG_VIDEO_STEREO_RIGHT_LEFT 11 /**< Track is side-by-side stereo video. Right first. */
#define NESTEGG_SEEK_SET 0 /**< Seek offset relative to beginning of stream. */
#define NESTEGG_SEEK_CUR 1 /**< Seek offset relative to current position in stream. */
@@ -114,6 +121,10 @@ typedef struct {
/** Parameters specific to a video track. */
typedef struct {
+ unsigned int stereo_mode; /**< Video mode. One of #NESTEGG_VIDEO_MONO,
+ #NESTEGG_VIDEO_STEREO_LEFT_RIGHT,
+ #NESTEGG_VIDEO_STEREO_BOTTOM_TOP, or
+ #NESTEGG_VIDEO_STEREO_TOP_BOTTOM. */
unsigned int width; /**< Width of the video frame in pixels. */
unsigned int height; /**< Height of the video frame in pixels. */
unsigned int display_width; /**< Display width of the video frame in pixels. */
@@ -129,6 +140,8 @@ typedef struct {
double rate; /**< Sampling rate in Hz. */
unsigned int channels; /**< Number of audio channels. */
unsigned int depth; /**< Bits per sample. */
+ uint64_t codec_delay; /**< Nanoseconds that must be discarded from the start. */
+ uint64_t seek_preroll;/**< Nanoseconds that must be discarded after a seek. */
} nestegg_audio_params;
/** Logging callback function pointer. */
@@ -140,9 +153,10 @@ typedef void (* nestegg_log)(nestegg * context, unsigned int severity, char cons
@param context Storage for the new nestegg context. @see nestegg_destroy
@param io User supplied IO context.
@param callback Optional logging callback function pointer. May be NULL.
+ @param max_offset Optional maximum offset to be read. Set -1 to ignore.
@retval 0 Success.
@retval -1 Error. */
-int nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback);
+int nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback, int64_t max_offset);
/** Destroy a nestegg context and free associated memory.
@param context #nestegg context to be freed. @see nestegg_init */
@@ -171,6 +185,29 @@ int nestegg_tstamp_scale(nestegg * context, uint64_t * scale);
@retval -1 Error. */
int nestegg_track_count(nestegg * context, unsigned int * tracks);
+/** Query the start and end offset for a particular cluster.
+ @param context Stream context initialized by #nestegg_init.
+ @param cluster_num Zero-based cluster number; order they appear in cues.
+ @param max_offset Optional maximum offset to be read. Set -1 to ignore.
+ @param start_pos Starting offset of the cluster. -1 means non-existant.
+ @param end_pos Starting offset of the cluster. -1 means non-existant or
+ final cluster.
+ @param tstamp Starting timestamp of the cluster.
+ @retval 0 Success.
+ @retval -1 Error. */
+int nestegg_get_cue_point(nestegg * context, unsigned int cluster_num,
+ int64_t max_offset, int64_t * start_pos,
+ int64_t * end_pos, uint64_t * tstamp);
+
+/** Seek to @a offset. Stream will seek directly to offset.
+ Should be used to seek to the start of a resync point, i.e. cluster; the
+ parser will not be able to understand other offsets.
+ @param context Stream context initialized by #nestegg_init.
+ @param offset Absolute offset in bytes.
+ @retval 0 Success.
+ @retval -1 Error. */
+int nestegg_offset_seek(nestegg * context, uint64_t offset);
+
/** Seek @a track to @a tstamp. Stream seek will terminate at the earliest
key point in the stream at or before @a tstamp. Other tracks in the
stream will output packets with unspecified but nearby timestamps.
@@ -286,7 +323,30 @@ int nestegg_packet_count(nestegg_packet * packet, unsigned int * count);
int nestegg_packet_data(nestegg_packet * packet, unsigned int item,
unsigned char ** data, size_t * length);
-#ifdef __cplusplus
+/** Returns discard_padding for given packet
+ @param packet Packet initialized by #nestegg_read_packet.
+ @param discard_padding pointer to store discard padding in.
+ @retval 0 Success.
+ @retval -1 Error. */
+int nestegg_packet_discard_padding(nestegg_packet * packet,
+ int64_t * discard_padding);
+
+/** Query the presence of cues.
+ @param context Stream context initialized by #nestegg_init.
+ @retval 0 The media has no cues.
+ @retval 1 The media has cues. */
+int nestegg_has_cues(nestegg * context);
+
+/**
+ * Try to determine if the buffer looks like the beginning of a WebM file.
+ *
+ * @param buffer A buffer containing the beginning of a media file.
+ * @param length The size of the buffer.
+ * @retval 0 The file is not a WebM file.
+ * @retval 1 The file is a WebM file. */
+int nestegg_sniff(unsigned char const * buffer, size_t length);
+
+#if defined(__cplusplus)
}
#endif
diff --git a/libvpx/nestegg/src/nestegg.c b/libvpx/third_party/nestegg/src/nestegg.c
index ae87e8f8..c7e2b02 100644
--- a/libvpx/nestegg/src/nestegg.c
+++ b/libvpx/third_party/nestegg/src/nestegg.c
@@ -8,8 +8,8 @@
#include <stdlib.h>
#include <string.h>
-#include "nestegg/halloc/halloc.h"
-#include "nestegg/include/nestegg/nestegg.h"
+#include "third_party/nestegg/halloc/halloc.h"
+#include "third_party/nestegg/include/nestegg/nestegg.h"
/* EBML Elements */
#define ID_EBML 0x1a45dfa3
@@ -25,7 +25,7 @@
#define ID_VOID 0xec
#define ID_CRC32 0xbf
-/* WebMedia Elements */
+/* WebM Elements */
#define ID_SEGMENT 0x18538067
/* Seek Head Elements */
@@ -49,6 +49,7 @@
#define ID_BLOCK 0xa1
#define ID_BLOCK_DURATION 0x9b
#define ID_REFERENCE_BLOCK 0xfb
+#define ID_DISCARD_PADDING 0x75a2
/* Tracks Elements */
#define ID_TRACKS 0x1654ae6b
@@ -63,9 +64,12 @@
#define ID_LANGUAGE 0x22b59c
#define ID_CODEC_ID 0x86
#define ID_CODEC_PRIVATE 0x63a2
+#define ID_CODEC_DELAY 0x56aa
+#define ID_SEEK_PREROLL 0x56bb
/* Video Elements */
#define ID_VIDEO 0xe0
+#define ID_STEREO_MODE 0x53b8
#define ID_PIXEL_WIDTH 0xb0
#define ID_PIXEL_HEIGHT 0xba
#define ID_PIXEL_CROP_BOTTOM 0x54aa
@@ -129,6 +133,7 @@ enum ebml_type_enum {
#define TRACK_ID_VP8 "V_VP8"
#define TRACK_ID_VP9 "V_VP9"
#define TRACK_ID_VORBIS "A_VORBIS"
+#define TRACK_ID_OPUS "A_OPUS"
enum vint_mask {
MASK_NONE,
@@ -192,6 +197,7 @@ struct info {
struct block_group {
struct ebml_type duration;
struct ebml_type reference_block;
+ struct ebml_type discard_padding;
};
struct cluster {
@@ -200,6 +206,7 @@ struct cluster {
};
struct video {
+ struct ebml_type stereo_mode;
struct ebml_type pixel_width;
struct ebml_type pixel_height;
struct ebml_type pixel_crop_bottom;
@@ -227,6 +234,8 @@ struct track_entry {
struct ebml_type language;
struct ebml_type codec_id;
struct ebml_type codec_private;
+ struct ebml_type codec_delay;
+ struct ebml_type seek_preroll;
struct video video;
struct audio audio;
};
@@ -274,6 +283,7 @@ struct saved_state {
struct list_node * ancestor;
uint64_t last_id;
uint64_t last_size;
+ int last_valid;
};
struct frame {
@@ -289,6 +299,7 @@ struct nestegg {
struct pool_ctx * alloc_pool;
uint64_t last_id;
uint64_t last_size;
+ int last_valid;
struct list_node * ancestor;
struct ebml ebml;
struct segment segment;
@@ -300,6 +311,7 @@ struct nestegg_packet {
uint64_t track;
uint64_t timecode;
struct frame * frame;
+ int64_t discard_padding;
};
/* Element Descriptor */
@@ -341,7 +353,7 @@ static struct ebml_element_desc ne_ebml_elements[] = {
E_LAST
};
-/* WebMedia Element Lists */
+/* WebM Element Lists */
static struct ebml_element_desc ne_seek_elements[] = {
E_FIELD(ID_SEEK_ID, TYPE_BINARY, struct seek, id),
E_FIELD(ID_SEEK_POSITION, TYPE_UINT, struct seek, position),
@@ -363,6 +375,7 @@ static struct ebml_element_desc ne_block_group_elements[] = {
E_SUSPEND(ID_BLOCK, TYPE_BINARY),
E_FIELD(ID_BLOCK_DURATION, TYPE_UINT, struct block_group, duration),
E_FIELD(ID_REFERENCE_BLOCK, TYPE_INT, struct block_group, reference_block),
+ E_FIELD(ID_DISCARD_PADDING, TYPE_INT, struct block_group, discard_padding),
E_LAST
};
@@ -374,6 +387,7 @@ static struct ebml_element_desc ne_cluster_elements[] = {
};
static struct ebml_element_desc ne_video_elements[] = {
+ E_FIELD(ID_STEREO_MODE, TYPE_UINT, struct video, stereo_mode),
E_FIELD(ID_PIXEL_WIDTH, TYPE_UINT, struct video, pixel_width),
E_FIELD(ID_PIXEL_HEIGHT, TYPE_UINT, struct video, pixel_height),
E_FIELD(ID_PIXEL_CROP_BOTTOM, TYPE_UINT, struct video, pixel_crop_bottom),
@@ -403,6 +417,8 @@ static struct ebml_element_desc ne_track_entry_elements[] = {
E_FIELD(ID_LANGUAGE, TYPE_STRING, struct track_entry, language),
E_FIELD(ID_CODEC_ID, TYPE_STRING, struct track_entry, codec_id),
E_FIELD(ID_CODEC_PRIVATE, TYPE_BINARY, struct track_entry, codec_private),
+ E_FIELD(ID_CODEC_DELAY, TYPE_UINT, struct track_entry, codec_delay),
+ E_FIELD(ID_SEEK_PREROLL, TYPE_UINT, struct track_entry, seek_preroll),
E_SINGLE_MASTER(ID_VIDEO, TYPE_MASTER, struct track_entry, video),
E_SINGLE_MASTER(ID_AUDIO, TYPE_MASTER, struct track_entry, audio),
E_LAST
@@ -660,7 +676,7 @@ ne_read_float(nestegg_io * io, double * val, uint64_t length)
} value;
int r;
- /* length == 10 not implemented */
+ /* Length == 10 not implemented. */
if (length != 4 && length != 8)
return -1;
r = ne_read_uint(io, &value.u, length);
@@ -678,14 +694,15 @@ ne_read_string(nestegg * ctx, char ** val, uint64_t length)
{
char * str;
int r;
+ const size_t alloc_size = (size_t)length + 1;
if (length == 0 || length > LIMIT_STRING)
return -1;
- str = ne_pool_alloc(length + 1, ctx->alloc_pool);
- r = ne_io_read(ctx->io, (unsigned char *) str, length);
+ str = ne_pool_alloc(alloc_size, ctx->alloc_pool);
+ r = ne_io_read(ctx->io, (unsigned char *) str, alloc_size - 1);
if (r != 1)
return r;
- str[length] = '\0';
+ str[alloc_size - 1] = '\0';
*val = str;
return 1;
}
@@ -695,9 +712,9 @@ ne_read_binary(nestegg * ctx, struct ebml_binary * val, uint64_t length)
{
if (length == 0 || length > LIMIT_BINARY)
return -1;
- val->data = ne_pool_alloc(length, ctx->alloc_pool);
- val->length = length;
- return ne_io_read(ctx->io, val->data, length);
+ val->length = (size_t)length;
+ val->data = ne_pool_alloc(val->length, ctx->alloc_pool);
+ return ne_io_read(ctx->io, val->data, val->length);
}
static int
@@ -714,6 +731,20 @@ ne_get_uint(struct ebml_type type, uint64_t * value)
}
static int
+ne_get_uint32(struct ebml_type type, unsigned int * value)
+{
+ uint64_t v;
+ if (ne_get_uint(type, &v))
+ return -1;
+
+ assert((unsigned int)v == v);
+
+ *value = (unsigned int)v;
+
+ return 0;
+}
+
+static int
ne_get_float(struct ebml_type type, double * value)
{
if (!type.read)
@@ -808,6 +839,7 @@ ne_ctx_save(nestegg * ctx, struct saved_state * s)
s->ancestor = ctx->ancestor;
s->last_id = ctx->last_id;
s->last_size = ctx->last_size;
+ s->last_valid = ctx->last_valid;
return 0;
}
@@ -822,6 +854,7 @@ ne_ctx_restore(nestegg * ctx, struct saved_state * s)
ctx->ancestor = s->ancestor;
ctx->last_id = s->last_id;
ctx->last_size = s->last_size;
+ ctx->last_valid = s->last_valid;
return 0;
}
@@ -830,7 +863,7 @@ ne_peek_element(nestegg * ctx, uint64_t * id, uint64_t * size)
{
int r;
- if (ctx->last_id && ctx->last_size) {
+ if (ctx->last_valid) {
if (id)
*id = ctx->last_id;
if (size)
@@ -851,6 +884,8 @@ ne_peek_element(nestegg * ctx, uint64_t * id, uint64_t * size)
if (size)
*size = ctx->last_size;
+ ctx->last_valid = 1;
+
return 1;
}
@@ -863,8 +898,7 @@ ne_read_element(nestegg * ctx, uint64_t * id, uint64_t * size)
if (r != 1)
return r;
- ctx->last_id = 0;
- ctx->last_size = 0;
+ ctx->last_valid = 0;
return 1;
}
@@ -915,7 +949,7 @@ static int
ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
{
struct ebml_type * storage;
- int r;
+ int r = 0;
storage = (struct ebml_type *) (ctx->ancestor->data + desc->offset);
@@ -930,8 +964,6 @@ ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
ctx->log(ctx, NESTEGG_LOG_DEBUG, "element %llx (%s) -> %p (%u)",
desc->id, desc->name, storage, desc->offset);
- r = -1;
-
switch (desc->type) {
case TYPE_UINT:
r = ne_read_uint(ctx->io, &storage->v.u, length);
@@ -961,29 +993,26 @@ ne_read_simple(nestegg * ctx, struct ebml_element_desc * desc, size_t length)
}
static int
-ne_parse(nestegg * ctx, struct ebml_element_desc * top_level)
+ne_parse(nestegg * ctx, struct ebml_element_desc * top_level, int64_t max_offset)
{
int r;
int64_t * data_offset;
- uint64_t id, size;
+ uint64_t id, size, peeked_id;
struct ebml_element_desc * element;
- /* loop until we need to return:
- - hit suspend point
- - parse complete
- - error occurred */
-
- /* loop over elements at current level reading them if sublevel found,
- push ctx onto stack and continue if sublevel ended, pop ctx off stack
- and continue */
-
if (!ctx->ancestor)
return -1;
for (;;) {
+ if (max_offset > 0 && ne_io_tell(ctx->io) >= max_offset) {
+ /* Reached end of offset allowed for parsing - return gracefully */
+ r = 1;
+ break;
+ }
r = ne_peek_element(ctx, &id, &size);
if (r != 1)
break;
+ peeked_id = id;
element = ne_find_element(id, ctx->ancestor->node);
if (element) {
@@ -997,6 +1026,7 @@ ne_parse(nestegg * ctx, struct ebml_element_desc * top_level)
r = ne_read_element(ctx, &id, &size);
if (r != 1)
break;
+ assert(id == peeked_id);
if (element->flags & DESC_FLAG_OFFSET) {
data_offset = (int64_t *) (ctx->ancestor->data + element->data_offset);
@@ -1014,7 +1044,7 @@ ne_parse(nestegg * ctx, struct ebml_element_desc * top_level)
ne_read_single_master(ctx, element);
continue;
} else {
- r = ne_read_simple(ctx, element, size);
+ r = ne_read_simple(ctx, element, (size_t)size);
if (r < 0)
break;
}
@@ -1033,7 +1063,7 @@ ne_parse(nestegg * ctx, struct ebml_element_desc * top_level)
if (id != ID_VOID && id != ID_CRC32)
ctx->log(ctx, NESTEGG_LOG_DEBUG, "unknown element %llx", id);
- r = ne_io_read_skip(ctx->io, size);
+ r = ne_io_read_skip(ctx->io, (size_t)size);
if (r != 1)
break;
}
@@ -1106,7 +1136,7 @@ ne_read_xiph_lacing(nestegg_io * io, size_t block, size_t * read, uint64_t n, ui
if (*read + sum > block)
return -1;
- /* last frame is the remainder of the block */
+ /* Last frame is the remainder of the block. */
sizes[i] = block - *read - sum;
return 1;
}
@@ -1122,7 +1152,8 @@ ne_read_ebml_lacing(nestegg_io * io, size_t block, size_t * read, uint64_t n, ui
r = ne_read_vint(io, &lace, &length);
if (r != 1)
return r;
- *read += length;
+ assert(length <= 8);
+ *read += (size_t)length;
sizes[i] = lace;
sum = sizes[i];
@@ -1134,7 +1165,8 @@ ne_read_ebml_lacing(nestegg_io * io, size_t block, size_t * read, uint64_t n, ui
r = ne_read_svint(io, &slace, &length);
if (r != 1)
return r;
- *read += length;
+ assert(length <= 8);
+ *read += (size_t)length;
sizes[i] = sizes[i - 1] + slace;
sum += sizes[i];
i += 1;
@@ -1143,7 +1175,7 @@ ne_read_ebml_lacing(nestegg_io * io, size_t block, size_t * read, uint64_t n, ui
if (*read + sum > block)
return -1;
- /* last frame is the remainder of the block */
+ /* Last frame is the remainder of the block. */
sizes[i] = block - *read - sum;
return 1;
}
@@ -1159,6 +1191,37 @@ ne_get_timecode_scale(nestegg * ctx)
return scale;
}
+static int
+ne_map_track_number_to_index(nestegg * ctx,
+ unsigned int track_number,
+ unsigned int * track_index)
+{
+ struct ebml_list_node * node;
+ struct track_entry * t_entry;
+ uint64_t t_number = 0;
+
+ if (!track_index)
+ return -1;
+ *track_index = 0;
+
+ if (track_number == 0)
+ return -1;
+
+ node = ctx->segment.tracks.track_entry.head;
+ while (node) {
+ assert(node->id == ID_TRACK_ENTRY);
+ t_entry = node->data;
+ if (ne_get_uint(t_entry->number, &t_number) != 0)
+ return -1;
+ if (t_number == track_number)
+ return 0;
+ *track_index += 1;
+ node = node->next;
+ }
+
+ return -1;
+}
+
static struct track_entry *
ne_find_track_entry(nestegg * ctx, unsigned int track)
{
@@ -1186,9 +1249,9 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
struct cluster * cluster;
struct frame * f, * last;
struct track_entry * entry;
- double track_scale;
- uint64_t track, length, frame_sizes[256], cluster_tc, flags, frames, tc_scale, total;
- unsigned int i, lacing;
+ const int track_scale = 1;
+ uint64_t track_number, length, frame_sizes[256], cluster_tc, flags, frames, tc_scale, total;
+ unsigned int i, lacing, track;
size_t consumed = 0;
*data = NULL;
@@ -1196,14 +1259,15 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
if (block_size > LIMIT_BLOCK)
return -1;
- r = ne_read_vint(ctx->io, &track, &length);
+ r = ne_read_vint(ctx->io, &track_number, &length);
if (r != 1)
return r;
- if (track == 0 || track > ctx->track_count)
+ if (track_number == 0 || (unsigned int)track_number != track_number)
return -1;
- consumed += length;
+ assert(length <= 8);
+ consumed += (size_t)length;
r = ne_read_int(ctx->io, &timecode, 2);
if (r != 1)
@@ -1219,8 +1283,8 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
frames = 0;
- /* flags are different between block and simpleblock, but lacing is
- encoded the same way */
+ /* Flags are different between Block and SimpleBlock, but lacing is
+ encoded the same way. */
lacing = (flags & BLOCK_FLAGS_LACING) >> 1;
switch (lacing) {
@@ -1247,7 +1311,7 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
case LACING_XIPH:
if (frames == 1)
return -1;
- r = ne_read_xiph_lacing(ctx->io, block_size, &consumed, frames, frame_sizes);
+ r = ne_read_xiph_lacing(ctx->io, (size_t)block_size, &consumed, frames, frame_sizes);
if (r != 1)
return r;
break;
@@ -1260,24 +1324,25 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
case LACING_EBML:
if (frames == 1)
return -1;
- r = ne_read_ebml_lacing(ctx->io, block_size, &consumed, frames, frame_sizes);
+ r = ne_read_ebml_lacing(ctx->io, (size_t)block_size, &consumed, frames, frame_sizes);
if (r != 1)
return r;
break;
}
- /* sanity check unlaced frame sizes against total block size. */
+ /* Sanity check unlaced frame sizes against total block size. */
total = consumed;
for (i = 0; i < frames; ++i)
total += frame_sizes[i];
if (total > block_size)
return -1;
- entry = ne_find_track_entry(ctx, (unsigned int)(track - 1));
- if (!entry)
+ if (ne_map_track_number_to_index(ctx, (unsigned int)track_number, &track) != 0)
return -1;
- track_scale = 1.0;
+ entry = ne_find_track_entry(ctx, track);
+ if (!entry)
+ return -1;
tc_scale = ne_get_timecode_scale(ctx);
@@ -1291,8 +1356,8 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
return -1;
pkt = ne_alloc(sizeof(*pkt));
- pkt->track = track - 1;
- pkt->timecode = (uint64_t)(abs_timecode * tc_scale * track_scale);
+ pkt->track = track;
+ pkt->timecode = abs_timecode * tc_scale * track_scale;
ctx->log(ctx, NESTEGG_LOG_DEBUG, "%sblock t %lld pts %f f %llx frames: %llu",
block_id == ID_BLOCK ? "" : "simple", pkt->track, pkt->timecode / 1e9, flags, frames);
@@ -1304,9 +1369,9 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
return -1;
}
f = ne_alloc(sizeof(*f));
- f->data = ne_alloc(frame_sizes[i]);
- f->length = frame_sizes[i];
- r = ne_io_read(ctx->io, f->data, frame_sizes[i]);
+ f->length = (size_t)frame_sizes[i];
+ f->data = ne_alloc(f->length);
+ r = ne_io_read(ctx->io, f->data, f->length);
if (r != 1) {
free(f->data);
free(f);
@@ -1326,6 +1391,36 @@ ne_read_block(nestegg * ctx, uint64_t block_id, uint64_t block_size, nestegg_pac
return 1;
}
+static int
+ne_read_discard_padding(nestegg * ctx, nestegg_packet * pkt)
+{
+ int r;
+ uint64_t id, size;
+ struct ebml_element_desc * element;
+ struct ebml_type * storage;
+
+ r = ne_peek_element(ctx, &id, &size);
+ if (r != 1)
+ return r;
+
+ if (id != ID_DISCARD_PADDING)
+ return 1;
+
+ element = ne_find_element(id, ctx->ancestor->node);
+ if (!element)
+ return 1;
+
+ assert((size_t)size == size);
+ r = ne_read_simple(ctx, element, (size_t)size);
+ if (r != 1)
+ return r;
+ storage = (struct ebml_type *) (ctx->ancestor->data + element->offset);
+ pkt->discard_padding = storage->v.i;
+
+ return 1;
+}
+
+
static uint64_t
ne_buf_read_id(unsigned char const * p, size_t length)
{
@@ -1369,8 +1464,33 @@ ne_find_seek_for_id(struct ebml_list_node * seek_head, uint64_t id)
return NULL;
}
+static struct cue_track_positions *
+ne_find_cue_position_for_track(nestegg * ctx, struct ebml_list_node * node, unsigned int track)
+{
+ struct cue_track_positions * pos = NULL;
+ unsigned int track_number;
+ unsigned int t;
+
+ while (node) {
+ assert(node->id == ID_CUE_TRACK_POSITIONS);
+ pos = node->data;
+ if (ne_get_uint32(pos->track, &track_number) != 0)
+ return NULL;
+
+ if (ne_map_track_number_to_index(ctx, track_number, &t) != 0)
+ return NULL;
+
+ if (t == track)
+ return pos;
+
+ node = node->next;
+ }
+
+ return NULL;
+}
+
static struct cue_point *
-ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale, uint64_t tstamp)
+ne_find_cue_point_for_tstamp(nestegg * ctx, struct ebml_list_node * cue_point, unsigned int track, uint64_t scale, uint64_t tstamp)
{
uint64_t time;
struct cue_point * c, * prev = NULL;
@@ -1385,7 +1505,9 @@ ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale,
if (ne_get_uint(c->time, &time) == 0 && time * scale > tstamp)
break;
- prev = cue_point->data;
+ if (ne_find_cue_position_for_track(ctx, c->cue_track_positions.head, track) != NULL)
+ prev = c;
+
cue_point = cue_point->next;
}
@@ -1395,7 +1517,6 @@ ne_find_cue_point_for_tstamp(struct ebml_list_node * cue_point, uint64_t scale,
static int
ne_is_suspend_element(uint64_t id)
{
- /* this could search the tree of elements for DESC_FLAG_SUSPEND */
if (id == ID_SIMPLE_BLOCK || id == ID_BLOCK)
return 1;
return 0;
@@ -1408,14 +1529,180 @@ ne_null_log_callback(nestegg * ctx, unsigned int severity, char const * fmt, ...
return;
}
+static int
+ne_init_cue_points(nestegg * ctx, int64_t max_offset)
+{
+ int r;
+ struct ebml_list_node * node = ctx->segment.cues.cue_point.head;
+ struct seek * found;
+ uint64_t seek_pos, id;
+ struct saved_state state;
+
+ /* If there are no cues loaded, check for cues element in the seek head
+ and load it. */
+ if (!node) {
+ found = ne_find_seek_for_id(ctx->segment.seek_head.head, ID_CUES);
+ if (!found)
+ return -1;
+
+ if (ne_get_uint(found->position, &seek_pos) != 0)
+ return -1;
+
+ /* Save old parser state. */
+ r = ne_ctx_save(ctx, &state);
+ if (r != 0)
+ return -1;
+
+ /* Seek and set up parser state for segment-level element (Cues). */
+ r = ne_io_seek(ctx->io, ctx->segment_offset + seek_pos, NESTEGG_SEEK_SET);
+ if (r != 0)
+ return -1;
+ ctx->last_valid = 0;
+
+ r = ne_read_element(ctx, &id, NULL);
+ if (r != 1)
+ return -1;
+
+ if (id != ID_CUES)
+ return -1;
+
+ ctx->ancestor = NULL;
+ ne_ctx_push(ctx, ne_top_level_elements, ctx);
+ ne_ctx_push(ctx, ne_segment_elements, &ctx->segment);
+ ne_ctx_push(ctx, ne_cues_elements, &ctx->segment.cues);
+ /* parser will run until end of cues element. */
+ ctx->log(ctx, NESTEGG_LOG_DEBUG, "seek: parsing cue elements");
+ r = ne_parse(ctx, ne_cues_elements, max_offset);
+ while (ctx->ancestor)
+ ne_ctx_pop(ctx);
+
+ /* Reset parser state to original state and seek back to old position. */
+ if (ne_ctx_restore(ctx, &state) != 0)
+ return -1;
+
+ if (r < 0)
+ return -1;
+
+ node = ctx->segment.cues.cue_point.head;
+ if (!node)
+ return -1;
+ }
+
+ return 0;
+}
+
+/* Three functions that implement the nestegg_io interface, operating on a
+ * sniff_buffer. */
+struct sniff_buffer {
+ unsigned char const * buffer;
+ size_t length;
+ int64_t offset;
+};
+
+static int
+ne_buffer_read(void * buffer, size_t length, void * user_data)
+{
+ struct sniff_buffer * sb = user_data;
+
+ int rv = 1;
+ size_t available = sb->length - (size_t)sb->offset;
+
+ if (available < length)
+ return 0;
+
+ memcpy(buffer, sb->buffer + sb->offset, length);
+ sb->offset += length;
+
+ return rv;
+}
+
+static int
+ne_buffer_seek(int64_t offset, int whence, void * user_data)
+{
+ struct sniff_buffer * sb = user_data;
+ int64_t o = sb->offset;
+
+ switch(whence) {
+ case NESTEGG_SEEK_SET:
+ o = offset;
+ break;
+ case NESTEGG_SEEK_CUR:
+ o += offset;
+ break;
+ case NESTEGG_SEEK_END:
+ o = sb->length + offset;
+ break;
+ }
+
+ if (o < 0 || o > (int64_t) sb->length)
+ return -1;
+
+ sb->offset = o;
+ return 0;
+}
+
+static int64_t
+ne_buffer_tell(void * user_data)
+{
+ struct sniff_buffer * sb = user_data;
+ return sb->offset;
+}
+
+static int
+ne_match_webm(nestegg_io io, int64_t max_offset)
+{
+ int r;
+ uint64_t id;
+ char * doctype;
+ nestegg * ctx;
+
+ if (!(io.read && io.seek && io.tell))
+ return -1;
+
+ ctx = ne_alloc(sizeof(*ctx));
+
+ ctx->io = ne_alloc(sizeof(*ctx->io));
+ *ctx->io = io;
+ ctx->alloc_pool = ne_pool_init();
+ ctx->log = ne_null_log_callback;
+
+ r = ne_peek_element(ctx, &id, NULL);
+ if (r != 1) {
+ nestegg_destroy(ctx);
+ return 0;
+ }
+
+ if (id != ID_EBML) {
+ nestegg_destroy(ctx);
+ return 0;
+ }
+
+ ne_ctx_push(ctx, ne_top_level_elements, ctx);
+
+ /* we don't check the return value of ne_parse, that might fail because
+ * max_offset is not on a valid element end point. We only want to check
+ * the EBML ID and that the doctype is "webm". */
+ ne_parse(ctx, NULL, max_offset);
+
+ if (ne_get_string(ctx->ebml.doctype, &doctype) != 0 ||
+ strcmp(doctype, "webm") != 0) {
+ nestegg_destroy(ctx);
+ return 0;
+ }
+
+ nestegg_destroy(ctx);
+
+ return 1;
+}
+
int
-nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback)
+nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback, int64_t max_offset)
{
int r;
uint64_t id, version, docversion;
struct ebml_list_node * track;
char * doctype;
- nestegg * ctx = NULL;
+ nestegg * ctx;
if (!(io.read && io.seek && io.tell))
return -1;
@@ -1445,7 +1732,7 @@ nestegg_init(nestegg ** context, nestegg_io io, nestegg_log callback)
ne_ctx_push(ctx, ne_top_level_elements, ctx);
- r = ne_parse(ctx, NULL);
+ r = ne_parse(ctx, NULL, max_offset);
if (r != 1) {
nestegg_destroy(ctx);
@@ -1531,98 +1818,130 @@ nestegg_track_count(nestegg * ctx, unsigned int * tracks)
}
int
-nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp)
+nestegg_get_cue_point(nestegg * ctx, unsigned int cluster_num, int64_t max_offset,
+ int64_t * start_pos, int64_t * end_pos, uint64_t * tstamp)
{
- int r;
+ int range_obtained = 0;
+ unsigned int cluster_count = 0;
struct cue_point * cue_point;
struct cue_track_positions * pos;
- struct saved_state state;
- struct seek * found;
- uint64_t seek_pos, tc_scale, t, id;
- struct ebml_list_node * node = ctx->segment.cues.cue_point.head;
+ uint64_t seek_pos, track_number, tc_scale, time;
+ struct ebml_list_node * cues_node = ctx->segment.cues.cue_point.head;
+ struct ebml_list_node * cue_pos_node = NULL;
+ unsigned int track = 0, track_count = 0, track_index;
- /* If there are no cues loaded, check for cues element in the seek head
- and load it. */
- if (!node) {
- found = ne_find_seek_for_id(ctx->segment.seek_head.head, ID_CUES);
- if (!found)
- return -1;
+ if (!start_pos || !end_pos || !tstamp)
+ return -1;
- if (ne_get_uint(found->position, &seek_pos) != 0)
- return -1;
+ /* Initialise return values */
+ *start_pos = -1;
+ *end_pos = -1;
+ *tstamp = 0;
- /* Save old parser state. */
- r = ne_ctx_save(ctx, &state);
- if (r != 0)
+ if (!cues_node) {
+ ne_init_cue_points(ctx, max_offset);
+ cues_node = ctx->segment.cues.cue_point.head;
+ /* Verify cues have been added to context. */
+ if (!cues_node)
return -1;
+ }
- /* Seek and set up parser state for segment-level element (Cues). */
- r = ne_io_seek(ctx->io, ctx->segment_offset + seek_pos, NESTEGG_SEEK_SET);
- if (r != 0)
- return -1;
- ctx->last_id = 0;
- ctx->last_size = 0;
+ nestegg_track_count(ctx, &track_count);
- r = ne_read_element(ctx, &id, NULL);
- if (r != 1)
- return -1;
+ tc_scale = ne_get_timecode_scale(ctx);
- if (id != ID_CUES)
- return -1;
+ while (cues_node && !range_obtained) {
+ assert(cues_node->id == ID_CUE_POINT);
+ cue_point = cues_node->data;
+ cue_pos_node = cue_point->cue_track_positions.head;
+ while (cue_pos_node) {
+ assert(cue_pos_node->id == ID_CUE_TRACK_POSITIONS);
+ pos = cue_pos_node->data;
+ for (track = 0; track < track_count; track++) {
+ if (ne_get_uint(pos->track, &track_number) != 0)
+ return -1;
+
+ if (ne_map_track_number_to_index(ctx, (unsigned int)track_number, &track_index) != 0)
+ return -1;
+
+ if (track_index == track) {
+ if (ne_get_uint(pos->cluster_position, &seek_pos) != 0)
+ return -1;
+ if (cluster_count == cluster_num) {
+ *start_pos = ctx->segment_offset+seek_pos;
+ if (ne_get_uint(cue_point->time, &time) != 0)
+ return -1;
+ *tstamp = time * tc_scale;
+ } else if (cluster_count == cluster_num+1) {
+ *end_pos = (ctx->segment_offset+seek_pos)-1;
+ range_obtained = 1;
+ break;
+ }
+ cluster_count++;
+ }
+ }
+ cue_pos_node = cue_pos_node->next;
+ }
+ cues_node = cues_node->next;
+ }
- ctx->ancestor = NULL;
- ne_ctx_push(ctx, ne_top_level_elements, ctx);
- ne_ctx_push(ctx, ne_segment_elements, &ctx->segment);
- ne_ctx_push(ctx, ne_cues_elements, &ctx->segment.cues);
- /* parser will run until end of cues element. */
- ctx->log(ctx, NESTEGG_LOG_DEBUG, "seek: parsing cue elements");
- r = ne_parse(ctx, ne_cues_elements);
- while (ctx->ancestor)
- ne_ctx_pop(ctx);
+ return 0;
+}
- /* Reset parser state to original state and seek back to old position. */
- if (ne_ctx_restore(ctx, &state) != 0)
- return -1;
+int
+nestegg_offset_seek(nestegg * ctx, uint64_t offset)
+{
+ int r;
- if (r < 0)
+ /* Seek and set up parser state for segment-level element (Cluster). */
+ r = ne_io_seek(ctx->io, offset, NESTEGG_SEEK_SET);
+ if (r != 0)
+ return -1;
+ ctx->last_valid = 0;
+
+ while (ctx->ancestor)
+ ne_ctx_pop(ctx);
+
+ ne_ctx_push(ctx, ne_top_level_elements, ctx);
+ ne_ctx_push(ctx, ne_segment_elements, &ctx->segment);
+
+ return 0;
+}
+
+int
+nestegg_track_seek(nestegg * ctx, unsigned int track, uint64_t tstamp)
+{
+ int r;
+ struct cue_point * cue_point;
+ struct cue_track_positions * pos;
+ uint64_t seek_pos, tc_scale;
+
+ /* If there are no cues loaded, check for cues element in the seek head
+ and load it. */
+ if (!ctx->segment.cues.cue_point.head) {
+ r = ne_init_cue_points(ctx, -1);
+ if (r != 0)
return -1;
}
tc_scale = ne_get_timecode_scale(ctx);
- cue_point = ne_find_cue_point_for_tstamp(ctx->segment.cues.cue_point.head, tc_scale, tstamp);
+ cue_point = ne_find_cue_point_for_tstamp(ctx, ctx->segment.cues.cue_point.head,
+ track, tc_scale, tstamp);
if (!cue_point)
return -1;
- node = cue_point->cue_track_positions.head;
-
- seek_pos = 0;
-
- while (node) {
- assert(node->id == ID_CUE_TRACK_POSITIONS);
- pos = node->data;
- if (ne_get_uint(pos->track, &t) == 0 && t - 1 == track) {
- if (ne_get_uint(pos->cluster_position, &seek_pos) != 0)
- return -1;
- break;
- }
- node = node->next;
- }
-
- /* Seek and set up parser state for segment-level element (Cluster). */
- r = ne_io_seek(ctx->io, ctx->segment_offset + seek_pos, NESTEGG_SEEK_SET);
- if (r != 0)
+ pos = ne_find_cue_position_for_track(ctx, cue_point->cue_track_positions.head, track);
+ if (pos == NULL)
return -1;
- ctx->last_id = 0;
- ctx->last_size = 0;
- while (ctx->ancestor)
- ne_ctx_pop(ctx);
+ if (ne_get_uint(pos->cluster_position, &seek_pos) != 0)
+ return -1;
- ne_ctx_push(ctx, ne_top_level_elements, ctx);
- ne_ctx_push(ctx, ne_segment_elements, &ctx->segment);
+ /* Seek and set up parser state for segment-level element (Cluster). */
+ r = nestegg_offset_seek(ctx, ctx->segment_offset + seek_pos);
ctx->log(ctx, NESTEGG_LOG_DEBUG, "seek: parsing cluster elements");
- r = ne_parse(ctx, NULL);
+ r = ne_parse(ctx, NULL, -1);
if (r != 1)
return -1;
@@ -1676,6 +1995,9 @@ nestegg_track_codec_id(nestegg * ctx, unsigned int track)
if (strcmp(codec_id, TRACK_ID_VORBIS) == 0)
return NESTEGG_CODEC_VORBIS;
+ if (strcmp(codec_id, TRACK_ID_OPUS) == 0)
+ return NESTEGG_CODEC_OPUS;
+
return -1;
}
@@ -1728,34 +2050,40 @@ nestegg_track_codec_data(nestegg * ctx, unsigned int track, unsigned int item,
if (!entry)
return -1;
- if (nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_VORBIS)
+ if (nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_VORBIS
+ && nestegg_track_codec_id(ctx, track) != NESTEGG_CODEC_OPUS)
return -1;
if (ne_get_binary(entry->codec_private, &codec_private) != 0)
return -1;
- p = codec_private.data;
- count = *p++ + 1;
+ if (nestegg_track_codec_id(ctx, track) == NESTEGG_CODEC_VORBIS) {
+ p = codec_private.data;
+ count = *p++ + 1;
- if (count > 3)
- return -1;
+ if (count > 3)
+ return -1;
- i = 0;
- total = 0;
- while (--count) {
- sizes[i] = ne_xiph_lace_value(&p);
- total += sizes[i];
- i += 1;
- }
- sizes[i] = codec_private.length - total - (p - codec_private.data);
+ i = 0;
+ total = 0;
+ while (--count) {
+ sizes[i] = ne_xiph_lace_value(&p);
+ total += sizes[i];
+ i += 1;
+ }
+ sizes[i] = codec_private.length - total - (p - codec_private.data);
- for (i = 0; i < item; ++i) {
- if (sizes[i] > LIMIT_FRAME)
- return -1;
- p += sizes[i];
+ for (i = 0; i < item; ++i) {
+ if (sizes[i] > LIMIT_FRAME)
+ return -1;
+ p += sizes[i];
+ }
+ *data = p;
+ *length = (size_t)sizes[item];
+ } else {
+ *data = codec_private.data;
+ *length = codec_private.length;
}
- *data = p;
- *length = sizes[item];
return 0;
}
@@ -1765,7 +2093,7 @@ nestegg_track_video_params(nestegg * ctx, unsigned int track,
nestegg_video_params * params)
{
struct track_entry * entry;
- uint64_t value;
+ unsigned int value;
memset(params, 0, sizeof(*params));
@@ -1776,37 +2104,43 @@ nestegg_track_video_params(nestegg * ctx, unsigned int track,
if (nestegg_track_type(ctx, track) != NESTEGG_TRACK_VIDEO)
return -1;
- if (ne_get_uint(entry->video.pixel_width, &value) != 0)
+ value = 0;
+ ne_get_uint32(entry->video.stereo_mode, &value);
+ if (value <= NESTEGG_VIDEO_STEREO_TOP_BOTTOM ||
+ value == NESTEGG_VIDEO_STEREO_RIGHT_LEFT)
+ params->stereo_mode = value;
+
+ if (ne_get_uint32(entry->video.pixel_width, &value) != 0)
return -1;
- params->width = (unsigned int)value;
+ params->width = value;
- if (ne_get_uint(entry->video.pixel_height, &value) != 0)
+ if (ne_get_uint32(entry->video.pixel_height, &value) != 0)
return -1;
- params->height = (unsigned int)value;
+ params->height = value;
value = 0;
- ne_get_uint(entry->video.pixel_crop_bottom, &value);
- params->crop_bottom = (unsigned int)value;
+ ne_get_uint32(entry->video.pixel_crop_bottom, &value);
+ params->crop_bottom = value;
value = 0;
- ne_get_uint(entry->video.pixel_crop_top, &value);
- params->crop_top = (unsigned int)value;
+ ne_get_uint32(entry->video.pixel_crop_top, &value);
+ params->crop_top = value;
value = 0;
- ne_get_uint(entry->video.pixel_crop_left, &value);
- params->crop_left = (unsigned int)value;
+ ne_get_uint32(entry->video.pixel_crop_left, &value);
+ params->crop_left = value;
value = 0;
- ne_get_uint(entry->video.pixel_crop_right, &value);
- params->crop_right = (unsigned int)value;
+ ne_get_uint32(entry->video.pixel_crop_right, &value);
+ params->crop_right = value;
value = params->width;
- ne_get_uint(entry->video.display_width, &value);
- params->display_width = (unsigned int)value;
+ ne_get_uint32(entry->video.display_width, &value);
+ params->display_width = value;
value = params->height;
- ne_get_uint(entry->video.display_height, &value);
- params->display_height = (unsigned int)value;
+ ne_get_uint32(entry->video.display_height, &value);
+ params->display_height = value;
return 0;
}
@@ -1816,7 +2150,7 @@ nestegg_track_audio_params(nestegg * ctx, unsigned int track,
nestegg_audio_params * params)
{
struct track_entry * entry;
- uint64_t value;
+ unsigned int value;
memset(params, 0, sizeof(*params));
@@ -1831,12 +2165,20 @@ nestegg_track_audio_params(nestegg * ctx, unsigned int track,
ne_get_float(entry->audio.sampling_frequency, &params->rate);
value = 1;
- ne_get_uint(entry->audio.channels, &value);
- params->channels = (unsigned int)value;
+ ne_get_uint32(entry->audio.channels, &value);
+ params->channels = value;
value = 16;
- ne_get_uint(entry->audio.bit_depth, &value);
- params->depth = (unsigned int)value;
+ ne_get_uint32(entry->audio.bit_depth, &value);
+ params->depth = value;
+
+ value = 0;
+ ne_get_uint32(entry->codec_delay, &value);
+ params->codec_delay = value;
+
+ value = 0;
+ ne_get_uint32(entry->seek_preroll, &value);
+ params->seek_preroll = value;
return 0;
}
@@ -1854,19 +2196,26 @@ nestegg_read_packet(nestegg * ctx, nestegg_packet ** pkt)
if (r != 1)
return r;
- /* any suspend fields must be handled here */
+ /* Any DESC_FLAG_SUSPEND fields must be handled here. */
if (ne_is_suspend_element(id)) {
r = ne_read_element(ctx, &id, &size);
if (r != 1)
return r;
- /* the only suspend fields are blocks and simple blocks, which we
+ /* The only DESC_FLAG_SUSPEND fields are Blocks and SimpleBlocks, which we
handle directly. */
r = ne_read_block(ctx, id, size, pkt);
+ if (r != 1)
+ return r;
+
+ r = ne_read_discard_padding(ctx, *pkt);
+ if (r != 1)
+ return r;
+
return r;
}
- r = ne_parse(ctx, NULL);
+ r = ne_parse(ctx, NULL, -1);
if (r != 1)
return r;
}
@@ -1904,6 +2253,13 @@ nestegg_packet_tstamp(nestegg_packet * pkt, uint64_t * tstamp)
}
int
+nestegg_packet_discard_padding(nestegg_packet * pkt, int64_t * discard_padding)
+{
+ *discard_padding = pkt->discard_padding;
+ return 0;
+}
+
+int
nestegg_packet_count(nestegg_packet * pkt, unsigned int * count)
{
struct frame * f = pkt->frame;
@@ -1940,3 +2296,28 @@ nestegg_packet_data(nestegg_packet * pkt, unsigned int item,
return -1;
}
+
+int
+nestegg_has_cues(nestegg * ctx)
+{
+ return ctx->segment.cues.cue_point.head ||
+ ne_find_seek_for_id(ctx->segment.seek_head.head, ID_CUES);
+}
+
+int
+nestegg_sniff(unsigned char const * buffer, size_t length)
+{
+ nestegg_io io;
+ struct sniff_buffer user_data;
+
+ user_data.buffer = buffer;
+ user_data.length = length;
+ user_data.offset = 0;
+
+ io.read = ne_buffer_read;
+ io.seek = ne_buffer_seek;
+ io.tell = ne_buffer_tell;
+ io.userdata = &user_data;
+ return ne_match_webm(io, length);
+}
+
diff --git a/libvpx/nestegg/test/test.c b/libvpx/third_party/nestegg/test/test.c
index 210b640..cc0753d 100644
--- a/libvpx/nestegg/test/test.c
+++ b/libvpx/third_party/nestegg/test/test.c
@@ -15,9 +15,10 @@
#define SEEK_TEST
static int
-stdio_read(void * p, size_t length, void * fp)
+stdio_read(void * p, size_t length, void * file)
{
size_t r;
+ FILE * fp = file;
r = fread(p, length, 1, fp);
if (r == 0 && feof(fp))
@@ -26,8 +27,9 @@ stdio_read(void * p, size_t length, void * fp)
}
static int
-stdio_seek(int64_t offset, int whence, void * fp)
+stdio_seek(int64_t offset, int whence, void * file)
{
+ FILE * fp = file;
return fseek(fp, offset, whence);
}
@@ -43,7 +45,7 @@ log_callback(nestegg * ctx, unsigned int severity, char const * fmt, ...)
va_list ap;
char const * sev = NULL;
-#ifndef DEBUG
+#if !defined(DEBUG)
if (severity < NESTEGG_LOG_WARNING)
return;
#endif
@@ -102,32 +104,32 @@ main(int argc, char * argv[])
io.userdata = fp;
ctx = NULL;
- r = nestegg_init(&ctx, io, log_callback);
+ r = nestegg_init(&ctx, io, log_callback, -1);
if (r != 0)
return EXIT_FAILURE;
nestegg_track_count(ctx, &tracks);
nestegg_duration(ctx, &duration);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "media has %u tracks and duration %fs\n", tracks, duration / 1e9);
#endif
for (i = 0; i < tracks; ++i) {
type = nestegg_track_type(ctx, i);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "track %u: type: %d codec: %d", i,
type, nestegg_track_codec_id(ctx, i));
#endif
nestegg_track_codec_data_count(ctx, i, &data_items);
for (j = 0; j < data_items; ++j) {
nestegg_track_codec_data(ctx, i, j, &codec_data, &length);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, " (%p, %u)", codec_data, (unsigned int) length);
#endif
}
if (type == NESTEGG_TRACK_VIDEO) {
nestegg_track_video_params(ctx, i, &vparams);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, " video: %ux%u (d: %ux%u %ux%ux%ux%u)",
vparams.width, vparams.height,
vparams.display_width, vparams.display_height,
@@ -135,23 +137,23 @@ main(int argc, char * argv[])
#endif
} else if (type == NESTEGG_TRACK_AUDIO) {
nestegg_track_audio_params(ctx, i, &aparams);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, " audio: %.2fhz %u bit %u channels",
aparams.rate, aparams.depth, aparams.channels);
#endif
}
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "\n");
#endif
}
-#ifdef SEEK_TEST
-#ifdef DEBUG
+#if defined(SEEK_TEST)
+#if defined(DEBUG)
fprintf(stderr, "seek to middle\n");
#endif
r = nestegg_track_seek(ctx, 0, duration / 2);
if (r == 0) {
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "middle ");
#endif
r = nestegg_read_packet(ctx, &pkt);
@@ -159,23 +161,23 @@ main(int argc, char * argv[])
nestegg_packet_track(pkt, &track);
nestegg_packet_count(pkt, &cnt);
nestegg_packet_tstamp(pkt, &tstamp);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "* t %u pts %f frames %u\n", track, tstamp / 1e9, cnt);
#endif
nestegg_free_packet(pkt);
} else {
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "middle seek failed\n");
#endif
}
}
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "seek to ~end\n");
#endif
r = nestegg_track_seek(ctx, 0, duration - (duration / 10));
if (r == 0) {
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "end ");
#endif
r = nestegg_read_packet(ctx, &pkt);
@@ -183,23 +185,23 @@ main(int argc, char * argv[])
nestegg_packet_track(pkt, &track);
nestegg_packet_count(pkt, &cnt);
nestegg_packet_tstamp(pkt, &tstamp);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "* t %u pts %f frames %u\n", track, tstamp / 1e9, cnt);
#endif
nestegg_free_packet(pkt);
} else {
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "end seek failed\n");
#endif
}
}
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "seek to ~start\n");
#endif
r = nestegg_track_seek(ctx, 0, duration / 10);
if (r == 0) {
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "start ");
#endif
r = nestegg_read_packet(ctx, &pkt);
@@ -207,12 +209,12 @@ main(int argc, char * argv[])
nestegg_packet_track(pkt, &track);
nestegg_packet_count(pkt, &cnt);
nestegg_packet_tstamp(pkt, &tstamp);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "* t %u pts %f frames %u\n", track, tstamp / 1e9, cnt);
#endif
nestegg_free_packet(pkt);
} else {
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "start seek failed\n");
#endif
}
@@ -224,17 +226,17 @@ main(int argc, char * argv[])
nestegg_packet_count(pkt, &pkt_cnt);
nestegg_packet_tstamp(pkt, &pkt_tstamp);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "t %u pts %f frames %u: ", pkt_track, pkt_tstamp / 1e9, pkt_cnt);
#endif
for (i = 0; i < pkt_cnt; ++i) {
nestegg_packet_data(pkt, i, &ptr, &size);
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "%u ", (unsigned int) size);
#endif
}
-#ifdef DEBUG
+#if defined(DEBUG)
fprintf(stderr, "\n");
#endif
diff --git a/libvpx/tools/cpplint.py b/libvpx/tools/cpplint.py
index 159dbbb..25fbef7 100755
--- a/libvpx/tools/cpplint.py
+++ b/libvpx/tools/cpplint.py
@@ -28,40 +28,6 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# Here are some issues that I've had people identify in my code during reviews,
-# that I think are possible to flag automatically in a lint tool. If these were
-# caught by lint, it would save time both for myself and that of my reviewers.
-# Most likely, some of these are beyond the scope of the current lint framework,
-# but I think it is valuable to retain these wish-list items even if they cannot
-# be immediately implemented.
-#
-# Suggestions
-# -----------
-# - Check for no 'explicit' for multi-arg ctor
-# - Check for boolean assign RHS in parens
-# - Check for ctor initializer-list colon position and spacing
-# - Check that if there's a ctor, there should be a dtor
-# - Check accessors that return non-pointer member variables are
-# declared const
-# - Check accessors that return non-const pointer member vars are
-# *not* declared const
-# - Check for using public includes for testing
-# - Check for spaces between brackets in one-line inline method
-# - Check for no assert()
-# - Check for spaces surrounding operators
-# - Check for 0 in pointer context (should be NULL)
-# - Check for 0 in char context (should be '\0')
-# - Check for camel-case method name conventions for methods
-# that are not simple inline getters and setters
-# - Do not indent namespace contents
-# - Avoid inlining non-trivial constructors in header files
-# - Check for old-school (void) cast for call-sites of functions
-# ignored return value
-# - Check gUnit usage of anonymous namespace
-# - Check for class declaration order (typedefs, consts, enums,
-# ctor(s?), dtor, friend declarations, methods, member vars)
-#
-
"""Does google-lint on c++ files.
The goal of this script is to identify places in the code that *may*
@@ -89,7 +55,8 @@ import unicodedata
_USAGE = """
Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
- [--counting=total|toplevel|detailed]
+ [--counting=total|toplevel|detailed] [--root=subdir]
+ [--linelength=digits]
<file> [file] ...
The style guidelines this tries to follow are those in
@@ -104,7 +71,8 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
suppresses errors of all categories on that line.
The files passed in will be linted; at least one file must be provided.
- Linted extensions are .cc, .cpp, and .h. Other file types will be ignored.
+ Default linted extensions are .cc, .cpp, .cu, .cuh and .h. Change the
+ extensions with the --extensions flag.
Flags:
@@ -152,13 +120,25 @@ Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
No flag => CHROME_BROWSER_UI_BROWSER_H_
--root=chrome => BROWSER_UI_BROWSER_H_
--root=chrome/browser => UI_BROWSER_H_
+
+ linelength=digits
+ This is the allowed line length for the project. The default value is
+ 80 characters.
+
+ Examples:
+ --linelength=120
+
+ extensions=extension,extension,...
+ The allowed file extensions that cpplint will check
+
+ Examples:
+ --extensions=hpp,cpp
"""
# We categorize each error message we print. Here are the categories.
# We want an explicit list so we can list them all in cpplint --filter=.
# If you add a new error message with a new category, add it to the list
# here! cpplint_unittest.py should tell you if you forget to do this.
-# \ used for clearer layout -- pylint: disable-msg=C6013
_ERROR_CATEGORIES = [
'build/class',
'build/deprecated',
@@ -185,6 +165,7 @@ _ERROR_CATEGORIES = [
'readability/multiline_string',
'readability/namespace',
'readability/nolint',
+ 'readability/nul',
'readability/streams',
'readability/todo',
'readability/utf8',
@@ -200,20 +181,20 @@ _ERROR_CATEGORIES = [
'runtime/printf',
'runtime/printf_format',
'runtime/references',
- 'runtime/rtti',
'runtime/sizeof',
'runtime/string',
'runtime/threadsafe_fn',
+ 'runtime/vlog',
'whitespace/blank_line',
'whitespace/braces',
'whitespace/comma',
'whitespace/comments',
+ 'whitespace/empty_conditional_body',
'whitespace/empty_loop_body',
'whitespace/end_of_line',
'whitespace/ending_newline',
'whitespace/forcolon',
'whitespace/indent',
- 'whitespace/labels',
'whitespace/line_length',
'whitespace/newline',
'whitespace/operators',
@@ -233,35 +214,143 @@ _DEFAULT_FILTERS = ['-build/include_alpha']
# decided those were OK, as long as they were in UTF-8 and didn't represent
# hard-coded international strings, which belong in a separate i18n file.
-# Headers that we consider STL headers.
-_STL_HEADERS = frozenset([
- 'algobase.h', 'algorithm', 'alloc.h', 'bitset', 'deque', 'exception',
- 'function.h', 'functional', 'hash_map', 'hash_map.h', 'hash_set',
- 'hash_set.h', 'iterator', 'list', 'list.h', 'map', 'memory', 'new',
- 'pair.h', 'pthread_alloc', 'queue', 'set', 'set.h', 'sstream', 'stack',
- 'stl_alloc.h', 'stl_relops.h', 'type_traits.h',
- 'utility', 'vector', 'vector.h',
- ])
-
-# Non-STL C++ system headers.
+# C++ headers
_CPP_HEADERS = frozenset([
- 'algo.h', 'builtinbuf.h', 'bvector.h', 'cassert', 'cctype',
- 'cerrno', 'cfloat', 'ciso646', 'climits', 'clocale', 'cmath',
- 'complex', 'complex.h', 'csetjmp', 'csignal', 'cstdarg', 'cstddef',
- 'cstdio', 'cstdlib', 'cstring', 'ctime', 'cwchar', 'cwctype',
- 'defalloc.h', 'deque.h', 'editbuf.h', 'exception', 'fstream',
- 'fstream.h', 'hashtable.h', 'heap.h', 'indstream.h', 'iomanip',
- 'iomanip.h', 'ios', 'iosfwd', 'iostream', 'iostream.h', 'istream',
- 'istream.h', 'iterator.h', 'limits', 'map.h', 'multimap.h', 'multiset.h',
- 'numeric', 'ostream', 'ostream.h', 'parsestream.h', 'pfstream.h',
- 'PlotFile.h', 'procbuf.h', 'pthread_alloc.h', 'rope', 'rope.h',
- 'ropeimpl.h', 'SFile.h', 'slist', 'slist.h', 'stack.h', 'stdexcept',
- 'stdiostream.h', 'streambuf.h', 'stream.h', 'strfile.h', 'string',
- 'strstream', 'strstream.h', 'tempbuf.h', 'tree.h', 'typeinfo', 'valarray',
+ # Legacy
+ 'algobase.h',
+ 'algo.h',
+ 'alloc.h',
+ 'builtinbuf.h',
+ 'bvector.h',
+ 'complex.h',
+ 'defalloc.h',
+ 'deque.h',
+ 'editbuf.h',
+ 'fstream.h',
+ 'function.h',
+ 'hash_map',
+ 'hash_map.h',
+ 'hash_set',
+ 'hash_set.h',
+ 'hashtable.h',
+ 'heap.h',
+ 'indstream.h',
+ 'iomanip.h',
+ 'iostream.h',
+ 'istream.h',
+ 'iterator.h',
+ 'list.h',
+ 'map.h',
+ 'multimap.h',
+ 'multiset.h',
+ 'ostream.h',
+ 'pair.h',
+ 'parsestream.h',
+ 'pfstream.h',
+ 'procbuf.h',
+ 'pthread_alloc',
+ 'pthread_alloc.h',
+ 'rope',
+ 'rope.h',
+ 'ropeimpl.h',
+ 'set.h',
+ 'slist',
+ 'slist.h',
+ 'stack.h',
+ 'stdiostream.h',
+ 'stl_alloc.h',
+ 'stl_relops.h',
+ 'streambuf.h',
+ 'stream.h',
+ 'strfile.h',
+ 'strstream.h',
+ 'tempbuf.h',
+ 'tree.h',
+ 'type_traits.h',
+ 'vector.h',
+ # 17.6.1.2 C++ library headers
+ 'algorithm',
+ 'array',
+ 'atomic',
+ 'bitset',
+ 'chrono',
+ 'codecvt',
+ 'complex',
+ 'condition_variable',
+ 'deque',
+ 'exception',
+ 'forward_list',
+ 'fstream',
+ 'functional',
+ 'future',
+ 'initializer_list',
+ 'iomanip',
+ 'ios',
+ 'iosfwd',
+ 'iostream',
+ 'istream',
+ 'iterator',
+ 'limits',
+ 'list',
+ 'locale',
+ 'map',
+ 'memory',
+ 'mutex',
+ 'new',
+ 'numeric',
+ 'ostream',
+ 'queue',
+ 'random',
+ 'ratio',
+ 'regex',
+ 'set',
+ 'sstream',
+ 'stack',
+ 'stdexcept',
+ 'streambuf',
+ 'string',
+ 'strstream',
+ 'system_error',
+ 'thread',
+ 'tuple',
+ 'typeindex',
+ 'typeinfo',
+ 'type_traits',
+ 'unordered_map',
+ 'unordered_set',
+ 'utility',
+ 'valarray',
+ 'vector',
+ # 17.6.1.2 C++ headers for C library facilities
+ 'cassert',
+ 'ccomplex',
+ 'cctype',
+ 'cerrno',
+ 'cfenv',
+ 'cfloat',
+ 'cinttypes',
+ 'ciso646',
+ 'climits',
+ 'clocale',
+ 'cmath',
+ 'csetjmp',
+ 'csignal',
+ 'cstdalign',
+ 'cstdarg',
+ 'cstdbool',
+ 'cstddef',
+ 'cstdint',
+ 'cstdio',
+ 'cstdlib',
+ 'cstring',
+ 'ctgmath',
+ 'ctime',
+ 'cuchar',
+ 'cwchar',
+ 'cwctype',
])
-
# Assertion macros. These are defined in base/logging.h and
# testing/base/gunit.h. Note that the _M versions need to come first
# for substring matching to work.
@@ -316,9 +405,8 @@ _ALT_TOKEN_REPLACEMENT = {
# Compile regular expression that matches all the above keywords. The "[ =()]"
# bit is meant to avoid matching these keywords outside of boolean expressions.
#
-# False positives include C-style multi-line comments (http://go/nsiut )
-# and multi-line strings (http://go/beujw ), but those have always been
-# troublesome for cpplint.
+# False positives include C-style multi-line comments and multi-line strings
+# but those have always been troublesome for cpplint.
_ALT_TOKEN_REPLACEMENT_PATTERN = re.compile(
r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)')
@@ -356,6 +444,14 @@ _error_suppressions = {}
# This is set by --root flag.
_root = None
+# The allowed line length of files.
+# This is set by --linelength flag.
+_line_length = 80
+
+# The allowed extensions for file names
+# This is set by --extensions flag.
+_valid_extensions = set(['cc', 'h', 'cpp', 'cu', 'cuh'])
+
def ParseNolintSuppressions(filename, raw_line, linenum, error):
"""Updates the global list of error-suppressions.
@@ -410,14 +506,32 @@ def Match(pattern, s):
# The regexp compilation caching is inlined in both Match and Search for
# performance reasons; factoring it out into a separate function turns out
# to be noticeably expensive.
- if not pattern in _regexp_compile_cache:
+ if pattern not in _regexp_compile_cache:
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
return _regexp_compile_cache[pattern].match(s)
+def ReplaceAll(pattern, rep, s):
+ """Replaces instances of pattern in a string with a replacement.
+
+ The compiled regex is kept in a cache shared by Match and Search.
+
+ Args:
+ pattern: regex pattern
+ rep: replacement text
+ s: search string
+
+ Returns:
+ string with replacements made (or original string if no replacements)
+ """
+ if pattern not in _regexp_compile_cache:
+ _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
+ return _regexp_compile_cache[pattern].sub(rep, s)
+
+
def Search(pattern, s):
"""Searches the string for the pattern, caching the compiled regexp."""
- if not pattern in _regexp_compile_cache:
+ if pattern not in _regexp_compile_cache:
_regexp_compile_cache[pattern] = sre_compile.compile(pattern)
return _regexp_compile_cache[pattern].search(s)
@@ -458,11 +572,17 @@ class _IncludeState(dict):
def __init__(self):
dict.__init__(self)
+ self.ResetSection()
+
+ def ResetSection(self):
# The name of the current section.
self._section = self._INITIAL_SECTION
# The path of last found header.
self._last_header = ''
+ def SetLastHeader(self, header_path):
+ self._last_header = header_path
+
def CanonicalizeAlphabeticalOrder(self, header_path):
"""Returns a path canonicalized for alphabetical comparison.
@@ -478,19 +598,25 @@ class _IncludeState(dict):
"""
return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
- def IsInAlphabeticalOrder(self, header_path):
+ def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
"""Check if a header is in alphabetical order with the previous header.
Args:
- header_path: Header to be checked.
+ clean_lines: A CleansedLines instance containing the file.
+ linenum: The number of the line to check.
+ header_path: Canonicalized header to be checked.
Returns:
Returns true if the header is in alphabetical order.
"""
- canonical_header = self.CanonicalizeAlphabeticalOrder(header_path)
- if self._last_header > canonical_header:
+ # If previous section is different from current section, _last_header will
+ # be reset to empty string, so it's always less than current header.
+ #
+ # If previous line was a blank line, assume that the headers are
+ # intentionally sorted the way they are.
+ if (self._last_header > header_path and
+ not Match(r'^\s*$', clean_lines.elided[linenum - 1])):
return False
- self._last_header = canonical_header
return True
def CheckNextIncludeOrder(self, header_type):
@@ -875,12 +1001,15 @@ def Error(filename, linenum, category, confidence, message):
if _cpplint_state.output_format == 'vs7':
sys.stderr.write('%s(%s): %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
+ elif _cpplint_state.output_format == 'eclipse':
+ sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % (
+ filename, linenum, message, category, confidence))
else:
sys.stderr.write('%s:%s: %s [%s] [%d]\n' % (
filename, linenum, message, category, confidence))
-# Matches standard C++ escape esequences per 2.13.2.3 of the C++ standard.
+# Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard.
_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile(
r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
# Matches strings. Escape codes should already be removed by ESCAPES.
@@ -919,6 +1048,67 @@ def IsCppString(line):
return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
+def CleanseRawStrings(raw_lines):
+ """Removes C++11 raw strings from lines.
+
+ Before:
+ static const char kData[] = R"(
+ multi-line string
+ )";
+
+ After:
+ static const char kData[] = ""
+ (replaced by blank line)
+ "";
+
+ Args:
+ raw_lines: list of raw lines.
+
+ Returns:
+ list of lines with C++11 raw strings replaced by empty strings.
+ """
+
+ delimiter = None
+ lines_without_raw_strings = []
+ for line in raw_lines:
+ if delimiter:
+ # Inside a raw string, look for the end
+ end = line.find(delimiter)
+ if end >= 0:
+ # Found the end of the string, match leading space for this
+ # line and resume copying the original lines, and also insert
+ # a "" on the last line.
+ leading_space = Match(r'^(\s*)\S', line)
+ line = leading_space.group(1) + '""' + line[end + len(delimiter):]
+ delimiter = None
+ else:
+ # Haven't found the end yet, append a blank line.
+ line = ''
+
+ else:
+ # Look for beginning of a raw string.
+ # See 2.14.15 [lex.string] for syntax.
+ matched = Match(r'^(.*)\b(?:R|u8R|uR|UR|LR)"([^\s\\()]*)\((.*)$', line)
+ if matched:
+ delimiter = ')' + matched.group(2) + '"'
+
+ end = matched.group(3).find(delimiter)
+ if end >= 0:
+ # Raw string ended on same line
+ line = (matched.group(1) + '""' +
+ matched.group(3)[end + len(delimiter):])
+ delimiter = None
+ else:
+ # Start of a multi-line raw string
+ line = matched.group(1) + '""'
+
+ lines_without_raw_strings.append(line)
+
+ # TODO(unknown): if delimiter is not None here, we might want to
+ # emit a warning for unterminated string.
+ return lines_without_raw_strings
+
+
def FindNextMultiLineCommentStart(lines, lineix):
"""Find the beginning marker for a multiline comment."""
while lineix < len(lines):
@@ -993,9 +1183,11 @@ class CleansedLines(object):
self.lines = []
self.raw_lines = lines
self.num_lines = len(lines)
- for linenum in range(len(lines)):
- self.lines.append(CleanseComments(lines[linenum]))
- elided = self._CollapseStrings(lines[linenum])
+ self.lines_without_raw_strings = CleanseRawStrings(lines)
+ for linenum in range(len(self.lines_without_raw_strings)):
+ self.lines.append(CleanseComments(
+ self.lines_without_raw_strings[linenum]))
+ elided = self._CollapseStrings(self.lines_without_raw_strings[linenum])
self.elided.append(CleanseComments(elided))
def NumLines(self):
@@ -1035,7 +1227,8 @@ def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
endchar: expression closing character.
Returns:
- Index just after endchar.
+ On finding matching endchar: (index just after matching endchar, 0)
+ Otherwise: (-1, new depth at end of this line)
"""
for i in xrange(startpos, len(line)):
if line[i] == startchar:
@@ -1043,14 +1236,14 @@ def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
elif line[i] == endchar:
depth -= 1
if depth == 0:
- return i + 1
- return -1
+ return (i + 1, 0)
+ return (-1, depth)
def CloseExpression(clean_lines, linenum, pos):
- """If input points to ( or { or [, finds the position that closes it.
+ """If input points to ( or { or [ or <, finds the position that closes it.
- If lines[linenum][pos] points to a '(' or '{' or '[', finds the
+ If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
linenum/pos that correspond to the closing of the expression.
Args:
@@ -1067,30 +1260,104 @@ def CloseExpression(clean_lines, linenum, pos):
line = clean_lines.elided[linenum]
startchar = line[pos]
- if startchar not in '({[':
+ if startchar not in '({[<':
return (line, clean_lines.NumLines(), -1)
if startchar == '(': endchar = ')'
if startchar == '[': endchar = ']'
if startchar == '{': endchar = '}'
+ if startchar == '<': endchar = '>'
# Check first line
- end_pos = FindEndOfExpressionInLine(line, pos, 0, startchar, endchar)
+ (end_pos, num_open) = FindEndOfExpressionInLine(
+ line, pos, 0, startchar, endchar)
if end_pos > -1:
return (line, linenum, end_pos)
- tail = line[pos:]
- num_open = tail.count(startchar) - tail.count(endchar)
+
+ # Continue scanning forward
while linenum < clean_lines.NumLines() - 1:
linenum += 1
line = clean_lines.elided[linenum]
- delta = line.count(startchar) - line.count(endchar)
- if num_open + delta <= 0:
- return (line, linenum,
- FindEndOfExpressionInLine(line, 0, num_open, startchar, endchar))
- num_open += delta
+ (end_pos, num_open) = FindEndOfExpressionInLine(
+ line, 0, num_open, startchar, endchar)
+ if end_pos > -1:
+ return (line, linenum, end_pos)
# Did not find endchar before end of file, give up
return (line, clean_lines.NumLines(), -1)
+
+def FindStartOfExpressionInLine(line, endpos, depth, startchar, endchar):
+ """Find position at the matching startchar.
+
+ This is almost the reverse of FindEndOfExpressionInLine, but note
+ that the input position and returned position differs by 1.
+
+ Args:
+ line: a CleansedLines line.
+ endpos: start searching at this position.
+ depth: nesting level at endpos.
+ startchar: expression opening character.
+ endchar: expression closing character.
+
+ Returns:
+ On finding matching startchar: (index at matching startchar, 0)
+ Otherwise: (-1, new depth at beginning of this line)
+ """
+ for i in xrange(endpos, -1, -1):
+ if line[i] == endchar:
+ depth += 1
+ elif line[i] == startchar:
+ depth -= 1
+ if depth == 0:
+ return (i, 0)
+ return (-1, depth)
+
+
+def ReverseCloseExpression(clean_lines, linenum, pos):
+ """If input points to ) or } or ] or >, finds the position that opens it.
+
+ If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
+ linenum/pos that correspond to the opening of the expression.
+
+ Args:
+ clean_lines: A CleansedLines instance containing the file.
+ linenum: The number of the line to check.
+ pos: A position on the line.
+
+ Returns:
+ A tuple (line, linenum, pos) pointer *at* the opening brace, or
+ (line, 0, -1) if we never find the matching opening brace. Note
+ we ignore strings and comments when matching; and the line we
+ return is the 'cleansed' line at linenum.
+ """
+ line = clean_lines.elided[linenum]
+ endchar = line[pos]
+ if endchar not in ')}]>':
+ return (line, 0, -1)
+ if endchar == ')': startchar = '('
+ if endchar == ']': startchar = '['
+ if endchar == '}': startchar = '{'
+ if endchar == '>': startchar = '<'
+
+ # Check last line
+ (start_pos, num_open) = FindStartOfExpressionInLine(
+ line, pos, 0, startchar, endchar)
+ if start_pos > -1:
+ return (line, linenum, start_pos)
+
+ # Continue scanning backward
+ while linenum > 0:
+ linenum -= 1
+ line = clean_lines.elided[linenum]
+ (start_pos, num_open) = FindStartOfExpressionInLine(
+ line, len(line) - 1, num_open, startchar, endchar)
+ if start_pos > -1:
+ return (line, linenum, start_pos)
+
+ # Did not find startchar before beginning of file, give up
+ return (line, 0, -1)
+
+
def CheckForCopyright(filename, lines, error):
"""Logs an error if no Copyright message appears at the top of the file."""
@@ -1203,13 +1470,17 @@ def CheckForHeaderGuard(filename, lines, error):
'#endif line should be "#endif // %s"' % cppvar)
-def CheckForUnicodeReplacementCharacters(filename, lines, error):
- """Logs an error for each line containing Unicode replacement characters.
+def CheckForBadCharacters(filename, lines, error):
+ """Logs an error for each line containing bad characters.
+
+ Two kinds of bad characters:
- These indicate that either the file contained invalid UTF-8 (likely)
- or Unicode replacement characters (which it shouldn't). Note that
- it's possible for this to throw off line numbering if the invalid
- UTF-8 occurred adjacent to a newline.
+ 1. Unicode replacement characters: These indicate that either the file
+ contained invalid UTF-8 (likely) or Unicode replacement characters (which
+ it shouldn't). Note that it's possible for this to throw off line
+ numbering if the invalid UTF-8 occurred adjacent to a newline.
+
+ 2. NUL bytes. These are problematic for some tools.
Args:
filename: The name of the current file.
@@ -1220,6 +1491,8 @@ def CheckForUnicodeReplacementCharacters(filename, lines, error):
if u'\ufffd' in line:
error(filename, linenum, 'readability/utf8', 5,
'Line contains invalid UTF-8 (or Unicode replacement character).')
+ if '\0' in line:
+ error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.')
def CheckForNewlineAtEOF(filename, lines, error):
@@ -1274,8 +1547,8 @@ def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
if (line.count('"') - line.count('\\"')) % 2:
error(filename, linenum, 'readability/multiline_string', 5,
'Multi-line string ("...") found. This lint script doesn\'t '
- 'do well with such strings, and may give bogus warnings. They\'re '
- 'ugly and unnecessary, and you should use concatenation instead".')
+ 'do well with such strings, and may give bogus warnings. '
+ 'Use C++11 raw strings or concatenation instead.')
threading_list = (
@@ -1289,7 +1562,6 @@ threading_list = (
('gmtime(', 'gmtime_r('),
('localtime(', 'localtime_r('),
('rand(', 'rand_r('),
- ('readdir(', 'readdir_r('),
('strtok(', 'strtok_r('),
('ttyname(', 'ttyname_r('),
)
@@ -1313,7 +1585,7 @@ def CheckPosixThreading(filename, clean_lines, linenum, error):
line = clean_lines.elided[linenum]
for single_thread_function, multithread_safe_function in threading_list:
ix = line.find(single_thread_function)
- # Comparisons made explicit for clarity -- pylint: disable-msg=C6403
+ # Comparisons made explicit for clarity -- pylint: disable=g-explicit-bool-comparison
if ix >= 0 and (ix == 0 or (not line[ix - 1].isalnum() and
line[ix - 1] not in ('_', '.', '>'))):
error(filename, linenum, 'runtime/threadsafe_fn', 2,
@@ -1322,6 +1594,25 @@ def CheckPosixThreading(filename, clean_lines, linenum, error):
'...) for improved thread safety.')
+def CheckVlogArguments(filename, clean_lines, linenum, error):
+ """Checks that VLOG() is only used for defining a logging level.
+
+ For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
+ VLOG(FATAL) are not.
+
+ Args:
+ filename: The name of the current file.
+ clean_lines: A CleansedLines instance containing the file.
+ linenum: The number of the line to check.
+ error: The function to call with any errors found.
+ """
+ line = clean_lines.elided[linenum]
+ if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
+ error(filename, linenum, 'runtime/vlog', 5,
+ 'VLOG() should be used with numeric verbosity level. '
+ 'Use LOG() if you want symbolic severity levels.')
+
+
# Matches invalid increment: *count++, which moves pointer instead of
# incrementing a value.
_RE_PATTERN_INVALID_INCREMENT = re.compile(
@@ -1397,8 +1688,18 @@ class _ClassInfo(_BlockInfo):
self.is_derived = False
if class_or_struct == 'struct':
self.access = 'public'
+ self.is_struct = True
else:
self.access = 'private'
+ self.is_struct = False
+
+ # Remember initial indentation level for this class. Using raw_lines here
+ # instead of elided to account for leading comments.
+ initial_indent = Match(r'^( *)\S', clean_lines.raw_lines[linenum])
+ if initial_indent:
+ self.class_indent = len(initial_indent.group(1))
+ else:
+ self.class_indent = 0
# Try to find the end of the class. This will be confused by things like:
# class A {
@@ -1419,6 +1720,19 @@ class _ClassInfo(_BlockInfo):
if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
self.is_derived = True
+ def CheckEnd(self, filename, clean_lines, linenum, error):
+ # Check that closing brace is aligned with beginning of the class.
+ # Only do this if the closing brace is indented by only whitespaces.
+ # This means we will not check single-line class definitions.
+ indent = Match(r'^( *)\}', clean_lines.elided[linenum])
+ if indent and len(indent.group(1)) != self.class_indent:
+ if self.is_struct:
+ parent = 'struct ' + self.name
+ else:
+ parent = 'class ' + self.name
+ error(filename, linenum, 'whitespace/indent', 3,
+ 'Closing brace should be aligned with beginning of %s' % parent)
+
class _NamespaceInfo(_BlockInfo):
"""Stores information about a namespace."""
@@ -1451,14 +1765,14 @@ class _NamespaceInfo(_BlockInfo):
#
# Note that we accept C style "/* */" comments for terminating
# namespaces, so that code that terminate namespaces inside
- # preprocessor macros can be cpplint clean. Example: http://go/nxpiz
+ # preprocessor macros can be cpplint clean.
#
# We also accept stuff like "// end of namespace <name>." with the
# period at the end.
#
# Besides these, we don't accept anything else, otherwise we might
# get false negatives when existing comment is a substring of the
- # expected namespace. Example: http://go/ldkdc, http://cl/23548205
+ # expected namespace.
if self.name:
# Named namespace
if not Match((r'};*\s*(//|/\*).*\bnamespace\s+' + re.escape(self.name) +
@@ -1529,7 +1843,6 @@ class _NestingState(object):
#else
struct ResultDetailsPageElementExtensionPoint : public Extension {
#endif
- (see http://go/qwddn for original example)
We make the following assumptions (good enough for most files):
- Preprocessor condition evaluates to true from #if up to first
@@ -1657,8 +1970,8 @@ class _NestingState(object):
# To avoid these cases, we ignore classes that are followed by '=' or '>'
class_decl_match = Match(
r'\s*(template\s*<[\w\s<>,:]*>\s*)?'
- '(class|struct)\s+([A-Z_]+\s+)*(\w+(?:::\w+)*)'
- '(([^=>]|<[^<>]*>)*)$', line)
+ r'(class|struct)\s+([A-Z_]+\s+)*(\w+(?:::\w+)*)'
+ r'(([^=>]|<[^<>]*>|<[^<>]*<[^<>]*>\s*>)*)$', line)
if (class_decl_match and
(not self.stack or self.stack[-1].open_parentheses == 0)):
self.stack.append(_ClassInfo(
@@ -1673,9 +1986,29 @@ class _NestingState(object):
# Update access control if we are inside a class/struct
if self.stack and isinstance(self.stack[-1], _ClassInfo):
- access_match = Match(r'\s*(public|private|protected)\s*:', line)
+ classinfo = self.stack[-1]
+ access_match = Match(
+ r'^(.*)\b(public|private|protected|signals)(\s+(?:slots\s*)?)?'
+ r':(?:[^:]|$)',
+ line)
if access_match:
- self.stack[-1].access = access_match.group(1)
+ classinfo.access = access_match.group(2)
+
+ # Check that access keywords are indented +1 space. Skip this
+ # check if the keywords are not preceded by whitespaces.
+ indent = access_match.group(1)
+ if (len(indent) != classinfo.class_indent + 1 and
+ Match(r'^\s*$', indent)):
+ if classinfo.is_struct:
+ parent = 'struct ' + classinfo.name
+ else:
+ parent = 'class ' + classinfo.name
+ slots = ''
+ if access_match.group(3):
+ slots = access_match.group(3)
+ error(filename, linenum, 'whitespace/indent', 3,
+ '%s%s: should be indented +1 space inside %s' % (
+ access_match.group(2), slots, parent))
# Consume braces or semicolons from what's left of the line
while True:
@@ -1725,8 +2058,8 @@ class _NestingState(object):
return classinfo
return None
- def CheckClassFinished(self, filename, error):
- """Checks that all classes have been completely parsed.
+ def CheckCompletedBlocks(self, filename, error):
+ """Checks that all classes and namespaces have been completely parsed.
Call this when all lines in a file have been processed.
Args:
@@ -1741,11 +2074,15 @@ class _NestingState(object):
error(filename, obj.starting_linenum, 'build/class', 5,
'Failed to find complete declaration of class %s' %
obj.name)
+ elif isinstance(obj, _NamespaceInfo):
+ error(filename, obj.starting_linenum, 'build/namespaces', 5,
+ 'Failed to find complete declaration of namespace %s' %
+ obj.name)
def CheckForNonStandardConstructs(filename, clean_lines, linenum,
nesting_state, error):
- """Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
+ r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
Complain about several constructs which gcc-2 accepts, but which are
not standard C++. Warning about these in lint is one way to ease the
@@ -1844,8 +2181,8 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum,
line)
if (args and
args.group(1) != 'void' and
- not Match(r'(const\s+)?%s\s*(?:<\w+>\s*)?&' % re.escape(base_classname),
- args.group(1).strip())):
+ not Match(r'(const\s+)?%s(\s+const)?\s*(?:<\w+>\s*)?&'
+ % re.escape(base_classname), args.group(1).strip())):
error(filename, linenum, 'runtime/explicit', 5,
'Single-argument constructors should be marked explicit.')
@@ -1888,7 +2225,8 @@ def CheckSpacingForFunctionCall(filename, line, linenum, error):
# Note that we assume the contents of [] to be short enough that
# they'll never need to wrap.
if ( # Ignore control structures.
- not Search(r'\b(if|for|while|switch|return|delete)\b', fncall) and
+ not Search(r'\b(if|for|while|switch|return|new|delete|catch|sizeof)\b',
+ fncall) and
# Ignore pointers/references to functions.
not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and
# Ignore pointers/references to arrays.
@@ -1901,7 +2239,7 @@ def CheckSpacingForFunctionCall(filename, line, linenum, error):
'Extra space after (')
if (Search(r'\w\s+\(', fncall) and
not Search(r'#\s*define|typedef', fncall) and
- not Search(r'\w\s+\((\w+::)?\*\w+\)\(', fncall)):
+ not Search(r'\w\s+\((\w+::)*\*\w+\)\(', fncall)):
error(filename, linenum, 'whitespace/parens', 4,
'Extra space before ( in function call')
# If the ) is followed only by a newline or a { + newline, assume it's
@@ -2029,7 +2367,7 @@ def CheckComment(comment, filename, linenum, error):
'"// TODO(my_username): Stuff."')
middle_whitespace = match.group(3)
- # Comparisons made explicit for correctness -- pylint: disable-msg=C6403
+ # Comparisons made explicit for correctness -- pylint: disable=g-explicit-bool-comparison
if middle_whitespace != ' ' and middle_whitespace != '':
error(filename, linenum, 'whitespace/todo', 2,
'TODO(my_username) should be followed by a space')
@@ -2086,8 +2424,7 @@ def FindNextMatchingAngleBracket(clean_lines, linenum, init_suffix):
# We could also check all other operators and terminate the search
# early, e.g. if we got something like this "a<b+c", the "<" is
# most likely a less-than operator, but then we will get false
- # positives for default arguments (e.g. http://go/prccd) and
- # other template expressions (e.g. http://go/oxcjq).
+ # positives for default arguments and other template expressions.
match = Search(r'^[^<>(),;\[\]]*([<>(),;\[\]])(.*)$', line)
if match:
# Found an operator, update nesting stack
@@ -2210,7 +2547,10 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
error: The function to call with any errors found.
"""
- raw = clean_lines.raw_lines
+ # Don't use "elided" lines here, otherwise we can't check commented lines.
+ # Don't want to use "raw" either, because we don't want to check inside C++11
+ # raw strings,
+ raw = clean_lines.lines_without_raw_strings
line = raw[linenum]
# Before nixing comments, check if the line is blank for no good
@@ -2264,7 +2604,8 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
if not exception:
error(filename, linenum, 'whitespace/blank_line', 2,
- 'Blank line at the start of a code block. Is this needed?')
+ 'Redundant blank line at the start of a code block '
+ 'should be deleted.')
# Ignore blank lines at the end of a block in a long if-else
# chain, like this:
# if (condition1) {
@@ -2279,7 +2620,8 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
and Match(r'\s*}', next_line)
and next_line.find('} else ') == -1):
error(filename, linenum, 'whitespace/blank_line', 3,
- 'Blank line at the end of a code block. Is this needed?')
+ 'Redundant blank line at the end of a code block '
+ 'should be deleted.')
matched = Match(r'\s*(public|protected|private):', prev_line)
if matched:
@@ -2290,7 +2632,7 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
commentpos = line.find('//')
if commentpos != -1:
# Check if the // may be in quotes. If so, ignore it
- # Comparisons made explicit for clarity -- pylint: disable-msg=C6403
+ # Comparisons made explicit for clarity -- pylint: disable=g-explicit-bool-comparison
if (line.count('"', 0, commentpos) -
line.count('\\"', 0, commentpos)) % 2 == 0: # not in quotes
# Allow one space for new scopes, two spaces otherwise:
@@ -2309,10 +2651,15 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
# //----------------------------------------------------------
# or are an empty C++ style Doxygen comment, like:
# ///
+ # or C++ style Doxygen comments placed after the variable:
+ # ///< Header comment
+ # //!< Header comment
# or they begin with multiple slashes followed by a space:
# //////// Header comment
match = (Search(r'[=/-]{4,}\s*$', line[commentend:]) or
Search(r'^/$', line[commentend:]) or
+ Search(r'^!< ', line[commentend:]) or
+ Search(r'^/< ', line[commentend:]) or
Search(r'^/+ ', line[commentend:]))
if not match:
error(filename, linenum, 'whitespace/comments', 4,
@@ -2346,8 +2693,11 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
'Missing spaces around %s' % match.group(1))
# We allow no-spaces around << when used like this: 10<<20, but
# not otherwise (particularly, not when used as streams)
- match = Search(r'(\S)(?:L|UL|ULL|l|ul|ull)?<<(\S)', line)
- if match and not (match.group(1).isdigit() and match.group(2).isdigit()):
+ # Also ignore using ns::operator<<;
+ match = Search(r'(operator|\S)(?:L|UL|ULL|l|ul|ull)?<<(\S)', line)
+ if (match and
+ not (match.group(1).isdigit() and match.group(2).isdigit()) and
+ not (match.group(1) == 'operator' and match.group(2) == ';')):
error(filename, linenum, 'whitespace/operators', 3,
'Missing spaces around <<')
elif not Match(r'#.*include', line):
@@ -2418,13 +2768,22 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)):
error(filename, linenum, 'whitespace/parens', 5,
'Mismatching spaces inside () in %s' % match.group(1))
- if not len(match.group(2)) in [0, 1]:
+ if len(match.group(2)) not in [0, 1]:
error(filename, linenum, 'whitespace/parens', 5,
'Should have zero or one spaces inside ( and ) in %s' %
match.group(1))
# You should always have a space after a comma (either as fn arg or operator)
- if Search(r',[^\s]', line):
+ #
+ # This does not apply when the non-space character following the
+ # comma is another comma, since the only time when that happens is
+ # for empty macro arguments.
+ #
+ # We run this check in two passes: first pass on elided lines to
+ # verify that lines contain missing whitespaces, second pass on raw
+ # lines to confirm that those missing whitespaces are not due to
+ # elided comments.
+ if Search(r',[^,\s]', line) and Search(r',[^,\s]', raw[linenum]):
error(filename, linenum, 'whitespace/comma', 3,
'Missing space after ,')
@@ -2443,9 +2802,45 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
# an initializer list, for instance), you should have spaces before your
# braces. And since you should never have braces at the beginning of a line,
# this is an easy test.
- if Search(r'[^ ({]{', line):
- error(filename, linenum, 'whitespace/braces', 5,
- 'Missing space before {')
+ match = Match(r'^(.*[^ ({]){', line)
+ if match:
+ # Try a bit harder to check for brace initialization. This
+ # happens in one of the following forms:
+ # Constructor() : initializer_list_{} { ... }
+ # Constructor{}.MemberFunction()
+ # Type variable{};
+ # FunctionCall(type{}, ...);
+ # LastArgument(..., type{});
+ # LOG(INFO) << type{} << " ...";
+ # map_of_type[{...}] = ...;
+ #
+ # We check for the character following the closing brace, and
+ # silence the warning if it's one of those listed above, i.e.
+ # "{.;,)<]".
+ #
+ # To account for nested initializer list, we allow any number of
+ # closing braces up to "{;,)<". We can't simply silence the
+ # warning on first sight of closing brace, because that would
+ # cause false negatives for things that are not initializer lists.
+ # Silence this: But not this:
+ # Outer{ if (...) {
+ # Inner{...} if (...){ // Missing space before {
+ # }; }
+ #
+ # There is a false negative with this approach if people inserted
+ # spurious semicolons, e.g. "if (cond){};", but we will catch the
+ # spurious semicolon with a separate check.
+ (endline, endlinenum, endpos) = CloseExpression(
+ clean_lines, linenum, len(match.group(1)))
+ trailing_text = ''
+ if endpos > -1:
+ trailing_text = endline[endpos:]
+ for offset in xrange(endlinenum + 1,
+ min(endlinenum + 3, clean_lines.NumLines() - 1)):
+ trailing_text += clean_lines.elided[offset]
+ if not Match(r'^[\s}]*[{.;,)<\]]', trailing_text):
+ error(filename, linenum, 'whitespace/braces', 5,
+ 'Missing space before {')
# Make sure '} else {' has spaces.
if Search(r'}else', line):
@@ -2573,15 +2968,15 @@ def CheckBraces(filename, clean_lines, linenum, error):
line = clean_lines.elided[linenum] # get rid of comments and strings
if Match(r'\s*{\s*$', line):
- # We allow an open brace to start a line in the case where someone
- # is using braces in a block to explicitly create a new scope,
- # which is commonly used to control the lifetime of
- # stack-allocated variables. We don't detect this perfectly: we
- # just don't complain if the last non-whitespace character on the
- # previous non-blank line is ';', ':', '{', or '}', or if the previous
- # line starts a preprocessor block.
+ # We allow an open brace to start a line in the case where someone is using
+ # braces in a block to explicitly create a new scope, which is commonly used
+ # to control the lifetime of stack-allocated variables. Braces are also
+ # used for brace initializers inside function calls. We don't detect this
+ # perfectly: we just don't complain if the last non-whitespace character on
+ # the previous non-blank line is ',', ';', ':', '(', '{', or '}', or if the
+ # previous line starts a preprocessor block.
prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
- if (not Search(r'[;:}{]\s*$', prevline) and
+ if (not Search(r'[,;:}{(]\s*$', prevline) and
not Match(r'\s*#', prevline)):
error(filename, linenum, 'whitespace/braces', 4,
'{ should almost always be at the end of the previous line')
@@ -2619,25 +3014,123 @@ def CheckBraces(filename, clean_lines, linenum, error):
error(filename, linenum, 'whitespace/newline', 4,
'do/while clauses should not be on a single line')
- # Braces shouldn't be followed by a ; unless they're defining a struct
- # or initializing an array.
- # We can't tell in general, but we can for some common cases.
- prevlinenum = linenum
- while True:
- (prevline, prevlinenum) = GetPreviousNonBlankLine(clean_lines, prevlinenum)
- if Match(r'\s+{.*}\s*;', line) and not prevline.count(';'):
- line = prevline + line
- else:
- break
- if (Search(r'{.*}\s*;', line) and
- line.count('{') == line.count('}') and
- not Search(r'struct|class|enum|\s*=\s*{', line)):
- error(filename, linenum, 'readability/braces', 4,
- "You don't need a ; after a }")
+ # Block bodies should not be followed by a semicolon. Due to C++11
+ # brace initialization, there are more places where semicolons are
+ # required than not, so we use a whitelist approach to check these
+ # rather than a blacklist. These are the places where "};" should
+ # be replaced by just "}":
+ # 1. Some flavor of block following closing parenthesis:
+ # for (;;) {};
+ # while (...) {};
+ # switch (...) {};
+ # Function(...) {};
+ # if (...) {};
+ # if (...) else if (...) {};
+ #
+ # 2. else block:
+ # if (...) else {};
+ #
+ # 3. const member function:
+ # Function(...) const {};
+ #
+ # 4. Block following some statement:
+ # x = 42;
+ # {};
+ #
+ # 5. Block at the beginning of a function:
+ # Function(...) {
+ # {};
+ # }
+ #
+ # Note that naively checking for the preceding "{" will also match
+ # braces inside multi-dimensional arrays, but this is fine since
+ # that expression will not contain semicolons.
+ #
+ # 6. Block following another block:
+ # while (true) {}
+ # {};
+ #
+ # 7. End of namespaces:
+ # namespace {};
+ #
+ # These semicolons seems far more common than other kinds of
+ # redundant semicolons, possibly due to people converting classes
+ # to namespaces. For now we do not warn for this case.
+ #
+ # Try matching case 1 first.
+ match = Match(r'^(.*\)\s*)\{', line)
+ if match:
+ # Matched closing parenthesis (case 1). Check the token before the
+ # matching opening parenthesis, and don't warn if it looks like a
+ # macro. This avoids these false positives:
+ # - macro that defines a base class
+ # - multi-line macro that defines a base class
+ # - macro that defines the whole class-head
+ #
+ # But we still issue warnings for macros that we know are safe to
+ # warn, specifically:
+ # - TEST, TEST_F, TEST_P, MATCHER, MATCHER_P
+ # - TYPED_TEST
+ # - INTERFACE_DEF
+ # - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
+ #
+ # We implement a whitelist of safe macros instead of a blacklist of
+ # unsafe macros, even though the latter appears less frequently in
+ # google code and would have been easier to implement. This is because
+ # the downside for getting the whitelist wrong means some extra
+ # semicolons, while the downside for getting the blacklist wrong
+ # would result in compile errors.
+ #
+ # In addition to macros, we also don't want to warn on compound
+ # literals.
+ closing_brace_pos = match.group(1).rfind(')')
+ opening_parenthesis = ReverseCloseExpression(
+ clean_lines, linenum, closing_brace_pos)
+ if opening_parenthesis[2] > -1:
+ line_prefix = opening_parenthesis[0][0:opening_parenthesis[2]]
+ macro = Search(r'\b([A-Z_]+)\s*$', line_prefix)
+ if ((macro and
+ macro.group(1) not in (
+ 'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST',
+ 'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED',
+ 'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or
+ Search(r'\s+=\s*$', line_prefix)):
+ match = None
+
+ else:
+ # Try matching cases 2-3.
+ match = Match(r'^(.*(?:else|\)\s*const)\s*)\{', line)
+ if not match:
+ # Try matching cases 4-6. These are always matched on separate lines.
+ #
+ # Note that we can't simply concatenate the previous line to the
+ # current line and do a single match, otherwise we may output
+ # duplicate warnings for the blank line case:
+ # if (cond) {
+ # // blank line
+ # }
+ prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
+ if prevline and Search(r'[;{}]\s*$', prevline):
+ match = Match(r'^(\s*)\{', line)
+
+ # Check matching closing brace
+ if match:
+ (endline, endlinenum, endpos) = CloseExpression(
+ clean_lines, linenum, len(match.group(1)))
+ if endpos > -1 and Match(r'^\s*;', endline[endpos:]):
+ # Current {} pair is eligible for semicolon check, and we have found
+ # the redundant semicolon, output warning here.
+ #
+ # Note: because we are scanning forward for opening braces, and
+ # outputting warnings for the matching closing brace, if there are
+ # nested blocks with trailing semicolons, we will get the error
+ # messages in reversed order.
+ error(filename, endlinenum, 'readability/braces', 4,
+ "You don't need a ; after a }")
-def CheckEmptyLoopBody(filename, clean_lines, linenum, error):
- """Loop for empty loop body with only a single semicolon.
+def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
+ """Look for empty loop/conditional body with only a single semicolon.
Args:
filename: The name of the current file.
@@ -2649,8 +3142,12 @@ def CheckEmptyLoopBody(filename, clean_lines, linenum, error):
# Search for loop keywords at the beginning of the line. Because only
# whitespaces are allowed before the keywords, this will also ignore most
# do-while-loops, since those lines should start with closing brace.
+ #
+ # We also check "if" blocks here, since an empty conditional block
+ # is likely an error.
line = clean_lines.elided[linenum]
- if Match(r'\s*(for|while)\s*\(', line):
+ matched = Match(r'\s*(for|while|if)\s*\(', line)
+ if matched:
# Find the end of the conditional expression
(end_line, end_linenum, end_pos) = CloseExpression(
clean_lines, linenum, line.find('('))
@@ -2659,43 +3156,12 @@ def CheckEmptyLoopBody(filename, clean_lines, linenum, error):
# No warning for all other cases, including whitespace or newline, since we
# have a separate check for semicolons preceded by whitespace.
if end_pos >= 0 and Match(r';', end_line[end_pos:]):
- error(filename, end_linenum, 'whitespace/empty_loop_body', 5,
- 'Empty loop bodies should use {} or continue')
-
-
-def ReplaceableCheck(operator, macro, line):
- """Determine whether a basic CHECK can be replaced with a more specific one.
-
- For example suggest using CHECK_EQ instead of CHECK(a == b) and
- similarly for CHECK_GE, CHECK_GT, CHECK_LE, CHECK_LT, CHECK_NE.
-
- Args:
- operator: The C++ operator used in the CHECK.
- macro: The CHECK or EXPECT macro being called.
- line: The current source line.
-
- Returns:
- True if the CHECK can be replaced with a more specific one.
- """
-
- # This matches decimal and hex integers, strings, and chars (in that order).
- match_constant = r'([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')'
-
- # Expression to match two sides of the operator with something that
- # looks like a literal, since CHECK(x == iterator) won't compile.
- # This means we can't catch all the cases where a more specific
- # CHECK is possible, but it's less annoying than dealing with
- # extraneous warnings.
- match_this = (r'\s*' + macro + r'\((\s*' +
- match_constant + r'\s*' + operator + r'[^<>].*|'
- r'.*[^<>]' + operator + r'\s*' + match_constant +
- r'\s*\))')
-
- # Don't complain about CHECK(x == NULL) or similar because
- # CHECK_EQ(x, NULL) won't compile (requires a cast).
- # Also, don't complain about more complex boolean expressions
- # involving && or || such as CHECK(a == b || c == d).
- return Match(match_this, line) and not Search(r'NULL|&&|\|\|', line)
+ if matched.group(1) == 'if':
+ error(filename, end_linenum, 'whitespace/empty_conditional_body', 5,
+ 'Empty conditional bodies should use {}')
+ else:
+ error(filename, end_linenum, 'whitespace/empty_loop_body', 5,
+ 'Empty loop bodies should use {} or continue')
def CheckCheck(filename, clean_lines, linenum, error):
@@ -2709,26 +3175,120 @@ def CheckCheck(filename, clean_lines, linenum, error):
"""
# Decide the set of replacement macros that should be suggested
- raw_lines = clean_lines.raw_lines
- current_macro = ''
+ lines = clean_lines.elided
+ check_macro = None
+ start_pos = -1
for macro in _CHECK_MACROS:
- if raw_lines[linenum].find(macro) >= 0:
- current_macro = macro
+ i = lines[linenum].find(macro)
+ if i >= 0:
+ check_macro = macro
+
+ # Find opening parenthesis. Do a regular expression match here
+ # to make sure that we are matching the expected CHECK macro, as
+ # opposed to some other macro that happens to contain the CHECK
+ # substring.
+ matched = Match(r'^(.*\b' + check_macro + r'\s*)\(', lines[linenum])
+ if not matched:
+ continue
+ start_pos = len(matched.group(1))
break
- if not current_macro:
+ if not check_macro or start_pos < 0:
# Don't waste time here if line doesn't contain 'CHECK' or 'EXPECT'
return
- line = clean_lines.elided[linenum] # get rid of comments and strings
+ # Find end of the boolean expression by matching parentheses
+ (last_line, end_line, end_pos) = CloseExpression(
+ clean_lines, linenum, start_pos)
+ if end_pos < 0:
+ return
+ if linenum == end_line:
+ expression = lines[linenum][start_pos + 1:end_pos - 1]
+ else:
+ expression = lines[linenum][start_pos + 1:]
+ for i in xrange(linenum + 1, end_line):
+ expression += lines[i]
+ expression += last_line[0:end_pos - 1]
+
+ # Parse expression so that we can take parentheses into account.
+ # This avoids false positives for inputs like "CHECK((a < 4) == b)",
+ # which is not replaceable by CHECK_LE.
+ lhs = ''
+ rhs = ''
+ operator = None
+ while expression:
+ matched = Match(r'^\s*(<<|<<=|>>|>>=|->\*|->|&&|\|\||'
+ r'==|!=|>=|>|<=|<|\()(.*)$', expression)
+ if matched:
+ token = matched.group(1)
+ if token == '(':
+ # Parenthesized operand
+ expression = matched.group(2)
+ (end, _) = FindEndOfExpressionInLine(expression, 0, 1, '(', ')')
+ if end < 0:
+ return # Unmatched parenthesis
+ lhs += '(' + expression[0:end]
+ expression = expression[end:]
+ elif token in ('&&', '||'):
+ # Logical and/or operators. This means the expression
+ # contains more than one term, for example:
+ # CHECK(42 < a && a < b);
+ #
+ # These are not replaceable with CHECK_LE, so bail out early.
+ return
+ elif token in ('<<', '<<=', '>>', '>>=', '->*', '->'):
+ # Non-relational operator
+ lhs += token
+ expression = matched.group(2)
+ else:
+ # Relational operator
+ operator = token
+ rhs = matched.group(2)
+ break
+ else:
+ # Unparenthesized operand. Instead of appending to lhs one character
+ # at a time, we do another regular expression match to consume several
+ # characters at once if possible. Trivial benchmark shows that this
+ # is more efficient when the operands are longer than a single
+ # character, which is generally the case.
+ matched = Match(r'^([^-=!<>()&|]+)(.*)$', expression)
+ if not matched:
+ matched = Match(r'^(\s*\S)(.*)$', expression)
+ if not matched:
+ break
+ lhs += matched.group(1)
+ expression = matched.group(2)
- # Encourage replacing plain CHECKs with CHECK_EQ/CHECK_NE/etc.
- for operator in ['==', '!=', '>=', '>', '<=', '<']:
- if ReplaceableCheck(operator, current_macro, line):
- error(filename, linenum, 'readability/check', 2,
- 'Consider using %s instead of %s(a %s b)' % (
- _CHECK_REPLACEMENT[current_macro][operator],
- current_macro, operator))
- break
+ # Only apply checks if we got all parts of the boolean expression
+ if not (lhs and operator and rhs):
+ return
+
+ # Check that rhs do not contain logical operators. We already know
+ # that lhs is fine since the loop above parses out && and ||.
+ if rhs.find('&&') > -1 or rhs.find('||') > -1:
+ return
+
+ # At least one of the operands must be a constant literal. This is
+ # to avoid suggesting replacements for unprintable things like
+ # CHECK(variable != iterator)
+ #
+ # The following pattern matches decimal, hex integers, strings, and
+ # characters (in that order).
+ lhs = lhs.strip()
+ rhs = rhs.strip()
+ match_constant = r'^([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')$'
+ if Match(match_constant, lhs) or Match(match_constant, rhs):
+ # Note: since we know both lhs and rhs, we can provide a more
+ # descriptive error message like:
+ # Consider using CHECK_EQ(x, 42) instead of CHECK(x == 42)
+ # Instead of:
+ # Consider using CHECK_EQ instead of CHECK(a == b)
+ #
+ # We are still keeping the less descriptive message because if lhs
+ # or rhs gets long, the error message might become unreadable.
+ error(filename, linenum, 'readability/check', 2,
+ 'Consider using %s instead of %s(a %s b)' % (
+ _CHECK_REPLACEMENT[check_macro][operator],
+ check_macro, operator))
def CheckAltTokens(filename, clean_lines, linenum, error):
@@ -2803,7 +3363,10 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
error: The function to call with any errors found.
"""
- raw_lines = clean_lines.raw_lines
+ # Don't use "elided" lines here, otherwise we can't check commented lines.
+ # Don't want to use "raw" either, because we don't want to check inside C++11
+ # raw strings,
+ raw_lines = clean_lines.lines_without_raw_strings
line = raw_lines[linenum]
if line.find('\t') != -1:
@@ -2829,21 +3392,12 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
if line and line[-1].isspace():
error(filename, linenum, 'whitespace/end_of_line', 4,
'Line ends in whitespace. Consider deleting these extra spaces.')
- # There are certain situations we allow one space, notably for labels
+ # There are certain situations we allow one space, notably for section labels
elif ((initial_spaces == 1 or initial_spaces == 3) and
not Match(r'\s*\w+\s*:\s*$', cleansed_line)):
error(filename, linenum, 'whitespace/indent', 3,
'Weird number of spaces at line-start. '
'Are you using a 2-space indent?')
- # Labels should always be indented at least one space.
- elif not initial_spaces and line[:2] != '//' and Search(r'[^:]:\s*$',
- line):
- error(filename, linenum, 'whitespace/labels', 4,
- 'Labels should always be indented at least one space. '
- 'If this is a member-initializer list in a constructor or '
- 'the base class list in a class definition, the colon should '
- 'be on the following line.')
-
# Check if the line is a header guard.
is_header_guard = False
@@ -2865,12 +3419,14 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
not Match(r'^\s*//.*http(s?)://\S*$', line) and
not Match(r'^// \$Id:.*#[0-9]+ \$$', line)):
line_width = GetLineWidth(line)
- if line_width > 100:
+ extended_length = int((_line_length * 1.25))
+ if line_width > extended_length:
error(filename, linenum, 'whitespace/line_length', 4,
- 'Lines should very rarely be longer than 100 characters')
- elif line_width > 80:
+ 'Lines should very rarely be longer than %i characters' %
+ extended_length)
+ elif line_width > _line_length:
error(filename, linenum, 'whitespace/line_length', 2,
- 'Lines should be <= 80 characters long')
+ 'Lines should be <= %i characters long' % _line_length)
if (cleansed_line.count(';') > 1 and
# for loops are allowed two ;'s (and may run over two lines).
@@ -2886,7 +3442,7 @@ def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
# Some more style checks
CheckBraces(filename, clean_lines, linenum, error)
- CheckEmptyLoopBody(filename, clean_lines, linenum, error)
+ CheckEmptyBlockBody(filename, clean_lines, linenum, error)
CheckAccess(filename, clean_lines, linenum, nesting_state, error)
CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
CheckCheck(filename, clean_lines, linenum, error)
@@ -2976,8 +3532,7 @@ def _ClassifyInclude(fileinfo, include, is_system):
"""
# This is a list of all standard c++ header files, except
# those already checked for above.
- is_stl_h = include in _STL_HEADERS
- is_cpp_h = is_stl_h or include in _CPP_HEADERS
+ is_cpp_h = include in _CPP_HEADERS
if is_system:
if is_cpp_h:
@@ -3065,9 +3620,12 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
error(filename, linenum, 'build/include_order', 4,
'%s. Should be: %s.h, c system, c++ system, other.' %
(error_message, fileinfo.BaseName()))
- if not include_state.IsInAlphabeticalOrder(include):
+ canonical_include = include_state.CanonicalizeAlphabeticalOrder(include)
+ if not include_state.IsInAlphabeticalOrder(
+ clean_lines, linenum, canonical_include):
error(filename, linenum, 'build/include_alpha', 4,
'Include "%s" not in alphabetical order' % include)
+ include_state.SetLastHeader(canonical_include)
# Look for any of the stream classes that are part of standard C++.
match = _RE_PATTERN_INCLUDE.match(line)
@@ -3081,7 +3639,7 @@ def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
def _GetTextInside(text, start_pattern):
- """Retrieves all the text between matching open and close parentheses.
+ r"""Retrieves all the text between matching open and close parentheses.
Given a string of lines and a regular expression string, retrieve all the text
following the expression and between opening punctuation symbols like
@@ -3136,8 +3694,34 @@ def _GetTextInside(text, start_pattern):
return text[start_position:position - 1]
-def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
- error):
+# Patterns for matching call-by-reference parameters.
+#
+# Supports nested templates up to 2 levels deep using this messy pattern:
+# < (?: < (?: < [^<>]*
+# >
+# | [^<>] )*
+# >
+# | [^<>] )*
+# >
+_RE_PATTERN_IDENT = r'[_a-zA-Z]\w*' # =~ [[:alpha:]][[:alnum:]]*
+_RE_PATTERN_TYPE = (
+ r'(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+)?'
+ r'(?:\w|'
+ r'\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|'
+ r'::)+')
+# A call-by-reference parameter ends with '& identifier'.
+_RE_PATTERN_REF_PARAM = re.compile(
+ r'(' + _RE_PATTERN_TYPE + r'(?:\s*(?:\bconst\b|[*]))*\s*'
+ r'&\s*' + _RE_PATTERN_IDENT + r')\s*(?:=[^,()]+)?[,)]')
+# A call-by-const-reference parameter either ends with 'const& identifier'
+# or looks like 'const type& identifier' when 'type' is atomic.
+_RE_PATTERN_CONST_REF_PARAM = (
+ r'(?:.*\s*\bconst\s*&\s*' + _RE_PATTERN_IDENT +
+ r'|const\s+' + _RE_PATTERN_TYPE + r'\s*&\s*' + _RE_PATTERN_IDENT + r')')
+
+
+def CheckLanguage(filename, clean_lines, linenum, file_extension,
+ include_state, nesting_state, error):
"""Checks rules from the 'C++ language rules' section of cppguide.html.
Some of these rules are hard to test (function overloading, using
@@ -3149,6 +3733,8 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
linenum: The number of the line to check.
file_extension: The extension (without the dot) of the filename.
include_state: An _IncludeState instance in which the headers are inserted.
+ nesting_state: A _NestingState instance which maintains information about
+ the current stack of nested blocks being parsed.
error: The function to call with any errors found.
"""
# If the line is empty or consists of entirely a comment, no need to
@@ -3162,73 +3748,64 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
return
- # Create an extended_line, which is the concatenation of the current and
- # next lines, for more effective checking of code that may span more than one
- # line.
- if linenum + 1 < clean_lines.NumLines():
- extended_line = line + clean_lines.elided[linenum + 1]
- else:
- extended_line = line
+ # Reset include state across preprocessor directives. This is meant
+ # to silence warnings for conditional includes.
+ if Match(r'^\s*#\s*(?:ifdef|elif|else|endif)\b', line):
+ include_state.ResetSection()
# Make Windows paths like Unix.
fullname = os.path.abspath(filename).replace('\\', '/')
# TODO(unknown): figure out if they're using default arguments in fn proto.
- # Check for non-const references in functions. This is tricky because &
- # is also used to take the address of something. We allow <> for templates,
- # (ignoring whatever is between the braces) and : for classes.
- # These are complicated re's. They try to capture the following:
- # paren (for fn-prototype start), typename, &, varname. For the const
- # version, we're willing for const to be before typename or after
- # Don't check the implementation on same line.
- fnline = line.split('{', 1)[0]
- if (len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) >
- len(re.findall(r'\([^()]*\bconst\s+(?:typename\s+)?(?:struct\s+)?'
- r'(?:[\w:]|<[^()]*>)+(\s?&|&\s?)\w+', fnline)) +
- len(re.findall(r'\([^()]*\b(?:[\w:]|<[^()]*>)+\s+const(\s?&|&\s?)[\w]+',
- fnline))):
-
- # We allow non-const references in a few standard places, like functions
- # called "swap()" or iostream operators like "<<" or ">>". We also filter
- # out for loops, which lint otherwise mistakenly thinks are functions.
- if not Search(
- r'(for|swap|Swap|operator[<>][<>])\s*\(\s*'
- r'(?:(?:typename\s*)?[\w:]|<.*>)+\s*&',
- fnline):
- error(filename, linenum, 'runtime/references', 2,
- 'Is this a non-const reference? '
- 'If so, make const or use a pointer.')
-
# Check to see if they're using an conversion function cast.
# I just try to capture the most common basic types, though there are more.
# Parameterless conversion functions, such as bool(), are allowed as they are
# probably a member operator declaration or default constructor.
match = Search(
r'(\bnew\s+)?\b' # Grab 'new' operator, if it's there
- r'(int|float|double|bool|char|int32|uint32|int64|uint64)\([^)]', line)
+ r'(int|float|double|bool|char|int32|uint32|int64|uint64)'
+ r'(\([^)].*)', line)
if match:
+ matched_new = match.group(1)
+ matched_type = match.group(2)
+ matched_funcptr = match.group(3)
+
# gMock methods are defined using some variant of MOCK_METHODx(name, type)
# where type may be float(), int(string), etc. Without context they are
# virtually indistinguishable from int(x) casts. Likewise, gMock's
# MockCallback takes a template parameter of the form return_type(arg_type),
# which looks much like the cast we're trying to detect.
- if (match.group(1) is None and # If new operator, then this isn't a cast
+ #
+ # std::function<> wrapper has a similar problem.
+ #
+ # Return types for function pointers also look like casts if they
+ # don't have an extra space.
+ if (matched_new is None and # If new operator, then this isn't a cast
not (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
- Match(r'^\s*MockCallback<.*>', line))):
+ Search(r'\bMockCallback<.*>', line) or
+ Search(r'\bstd::function<.*>', line)) and
+ not (matched_funcptr and
+ Match(r'\((?:[^() ]+::\s*\*\s*)?[^() ]+\)\s*\(',
+ matched_funcptr))):
# Try a bit harder to catch gmock lines: the only place where
# something looks like an old-style cast is where we declare the
# return type of the mocked method, and the only time when we
# are missing context is if MOCK_METHOD was split across
- # multiple lines (for example http://go/hrfhr ), so we only need
- # to check the previous line for MOCK_METHOD.
- if (linenum == 0 or
- not Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(\S+,\s*$',
- clean_lines.elided[linenum - 1])):
+ # multiple lines. The missing MOCK_METHOD is usually one or two
+ # lines back, so scan back one or two lines.
+ #
+ # It's not possible for gmock macros to appear in the first 2
+ # lines, since the class head + section name takes up 2 lines.
+ if (linenum < 2 or
+ not (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
+ clean_lines.elided[linenum - 1]) or
+ Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
+ clean_lines.elided[linenum - 2]))):
error(filename, linenum, 'readability/casting', 4,
'Using deprecated casting style. '
'Use static_cast<%s>(...) instead' %
- match.group(2))
+ matched_type)
CheckCStyleCast(filename, linenum, line, clean_lines.raw_lines[linenum],
'static_cast',
@@ -3249,13 +3826,23 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
# In addition, we look for people taking the address of a cast. This
# is dangerous -- casts can assign to temporaries, so the pointer doesn't
# point where you think.
- if Search(
- r'(&\([^)]+\)[\w(])|(&(static|dynamic|reinterpret)_cast\b)', line):
+ match = Search(
+ r'(?:&\(([^)]+)\)[\w(])|'
+ r'(?:&(static|dynamic|down|reinterpret)_cast\b)', line)
+ if match and match.group(1) != '*':
error(filename, linenum, 'runtime/casting', 4,
('Are you taking an address of a cast? '
'This is dangerous: could be a temp var. '
'Take the address before doing the cast, rather than after'))
+ # Create an extended_line, which is the concatenation of the current and
+ # next lines, for more effective checking of code that may span more than one
+ # line.
+ if linenum + 1 < clean_lines.NumLines():
+ extended_line = line + clean_lines.elided[linenum + 1]
+ else:
+ extended_line = line
+
# Check for people declaring static/global STL strings at the top level.
# This is dangerous because the C++ language does not guarantee that
# globals with constructors are initialized before the first access.
@@ -3265,20 +3852,18 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
# Make sure it's not a function.
# Function template specialization looks like: "string foo<Type>(...".
# Class template definitions look like: "string Foo<Type>::Method(...".
- if match and not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)?\s*\(([^"]|$)',
- match.group(3)):
+ #
+ # Also ignore things that look like operators. These are matched separately
+ # because operator names cross non-word boundaries. If we change the pattern
+ # above, we would decrease the accuracy of matching identifiers.
+ if (match and
+ not Search(r'\boperator\W', line) and
+ not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)?\s*\(([^"]|$)', match.group(3))):
error(filename, linenum, 'runtime/string', 4,
'For a static/global string constant, use a C style string instead: '
'"%schar %s[]".' %
(match.group(1), match.group(2)))
- # Check that we're not using RTTI outside of testing code.
- if Search(r'\bdynamic_cast<', line) and not _IsTestFilename(filename):
- error(filename, linenum, 'runtime/rtti', 5,
- 'Do not use dynamic_cast<>. If you need to cast within a class '
- "hierarchy, use static_cast<> to upcast. Google doesn't support "
- 'RTTI.')
-
if Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line):
error(filename, linenum, 'runtime/init', 4,
'You seem to be initializing a member variable with itself.')
@@ -3320,10 +3905,6 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
error(filename, linenum, 'runtime/printf', 4,
'Almost always, snprintf is better than %s' % match.group(1))
- if Search(r'\bsscanf\b', line):
- error(filename, linenum, 'runtime/printf', 1,
- 'sscanf can be ok, but is slow and can overflow buffers.')
-
# Check if some verboten operator overloading is going on
# TODO(unknown): catch out-of-line unary operator&:
# class X {};
@@ -3439,13 +4020,123 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension, include_state,
'http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces'
' for more information.')
+def CheckForNonConstReference(filename, clean_lines, linenum,
+ nesting_state, error):
+ """Check for non-const references.
+
+ Separate from CheckLanguage since it scans backwards from current
+ line, instead of scanning forward.
+
+ Args:
+ filename: The name of the current file.
+ clean_lines: A CleansedLines instance containing the file.
+ linenum: The number of the line to check.
+ nesting_state: A _NestingState instance which maintains information about
+ the current stack of nested blocks being parsed.
+ error: The function to call with any errors found.
+ """
+ # Do nothing if there is no '&' on current line.
+ line = clean_lines.elided[linenum]
+ if '&' not in line:
+ return
+
+ # Long type names may be broken across multiple lines, usually in one
+ # of these forms:
+ # LongType
+ # ::LongTypeContinued &identifier
+ # LongType::
+ # LongTypeContinued &identifier
+ # LongType<
+ # ...>::LongTypeContinued &identifier
+ #
+ # If we detected a type split across two lines, join the previous
+ # line to current line so that we can match const references
+ # accordingly.
+ #
+ # Note that this only scans back one line, since scanning back
+ # arbitrary number of lines would be expensive. If you have a type
+ # that spans more than 2 lines, please use a typedef.
+ if linenum > 1:
+ previous = None
+ if Match(r'\s*::(?:[\w<>]|::)+\s*&\s*\S', line):
+ # previous_line\n + ::current_line
+ previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+[\w<>])\s*$',
+ clean_lines.elided[linenum - 1])
+ elif Match(r'\s*[a-zA-Z_]([\w<>]|::)+\s*&\s*\S', line):
+ # previous_line::\n + current_line
+ previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+::)\s*$',
+ clean_lines.elided[linenum - 1])
+ if previous:
+ line = previous.group(1) + line.lstrip()
+ else:
+ # Check for templated parameter that is split across multiple lines
+ endpos = line.rfind('>')
+ if endpos > -1:
+ (_, startline, startpos) = ReverseCloseExpression(
+ clean_lines, linenum, endpos)
+ if startpos > -1 and startline < linenum:
+ # Found the matching < on an earlier line, collect all
+ # pieces up to current line.
+ line = ''
+ for i in xrange(startline, linenum + 1):
+ line += clean_lines.elided[i].strip()
+
+ # Check for non-const references in function parameters. A single '&' may
+ # found in the following places:
+ # inside expression: binary & for bitwise AND
+ # inside expression: unary & for taking the address of something
+ # inside declarators: reference parameter
+ # We will exclude the first two cases by checking that we are not inside a
+ # function body, including one that was just introduced by a trailing '{'.
+ # TODO(unknwon): Doesn't account for preprocessor directives.
+ # TODO(unknown): Doesn't account for 'catch(Exception& e)' [rare].
+ check_params = False
+ if not nesting_state.stack:
+ check_params = True # top level
+ elif (isinstance(nesting_state.stack[-1], _ClassInfo) or
+ isinstance(nesting_state.stack[-1], _NamespaceInfo)):
+ check_params = True # within class or namespace
+ elif Match(r'.*{\s*$', line):
+ if (len(nesting_state.stack) == 1 or
+ isinstance(nesting_state.stack[-2], _ClassInfo) or
+ isinstance(nesting_state.stack[-2], _NamespaceInfo)):
+ check_params = True # just opened global/class/namespace block
+ # We allow non-const references in a few standard places, like functions
+ # called "swap()" or iostream operators like "<<" or ">>". Do not check
+ # those function parameters.
+ #
+ # We also accept & in static_assert, which looks like a function but
+ # it's actually a declaration expression.
+ whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
+ r'operator\s*[<>][<>]|'
+ r'static_assert|COMPILE_ASSERT'
+ r')\s*\(')
+ if Search(whitelisted_functions, line):
+ check_params = False
+ elif not Search(r'\S+\([^)]*$', line):
+ # Don't see a whitelisted function on this line. Actually we
+ # didn't see any function name on this line, so this is likely a
+ # multi-line parameter list. Try a bit harder to catch this case.
+ for i in xrange(2):
+ if (linenum > i and
+ Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
+ check_params = False
+ break
+
+ if check_params:
+ decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body
+ for parameter in re.findall(_RE_PATTERN_REF_PARAM, decls):
+ if not Match(_RE_PATTERN_CONST_REF_PARAM, parameter):
+ error(filename, linenum, 'runtime/references', 2,
+ 'Is this a non-const reference? '
+ 'If so, make const or use a pointer: ' +
+ ReplaceAll(' *<', '<', parameter))
+
def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
error):
"""Checks for a C-style cast by looking for the pattern.
- This also handles sizeof(type) warnings, due to similarity of content.
-
Args:
filename: The name of the current file.
linenum: The number of the line to check.
@@ -3476,28 +4167,58 @@ def CheckCStyleCast(filename, linenum, line, raw_line, cast_type, pattern,
line[0:match.start(1) - 1].endswith(' operator--')):
return False
+ # A single unnamed argument for a function tends to look like old
+ # style cast. If we see those, don't issue warnings for deprecated
+ # casts, instead issue warnings for unnamed arguments where
+ # appropriate.
+ #
+ # These are things that we want warnings for, since the style guide
+ # explicitly require all parameters to be named:
+ # Function(int);
+ # Function(int) {
+ # ConstMember(int) const;
+ # ConstMember(int) const {
+ # ExceptionMember(int) throw (...);
+ # ExceptionMember(int) throw (...) {
+ # PureVirtual(int) = 0;
+ #
+ # These are functions of some sort, where the compiler would be fine
+ # if they had named parameters, but people often omit those
+ # identifiers to reduce clutter:
+ # (FunctionPointer)(int);
+ # (FunctionPointer)(int) = value;
+ # Function((function_pointer_arg)(int))
+ # <TemplateArgument(int)>;
+ # <(FunctionPointerTemplateArgument)(int)>;
remainder = line[match.end(0):]
+ if Match(r'^\s*(?:;|const\b|throw\b|=|>|\{|\))', remainder):
+ # Looks like an unnamed parameter.
- # The close paren is for function pointers as arguments to a function.
- # eg, void foo(void (*bar)(int));
- # The semicolon check is a more basic function check; also possibly a
- # function pointer typedef.
- # eg, void foo(int); or void foo(int) const;
- # The equals check is for function pointer assignment.
- # eg, void *(*foo)(int) = ...
- # The > is for MockCallback<...> ...
- #
- # Right now, this will only catch cases where there's a single argument, and
- # it's unnamed. It should probably be expanded to check for multiple
- # arguments with some unnamed.
- function_match = Match(r'\s*(\)|=|(const)?\s*(;|\{|throw\(\)|>))', remainder)
- if function_match:
- if (not function_match.group(3) or
- function_match.group(3) == ';' or
- ('MockCallback<' not in raw_line and
- '/*' not in raw_line)):
- error(filename, linenum, 'readability/function', 3,
- 'All parameters should be named in a function')
+ # Don't warn on any kind of template arguments.
+ if Match(r'^\s*>', remainder):
+ return False
+
+ # Don't warn on assignments to function pointers, but keep warnings for
+ # unnamed parameters to pure virtual functions. Note that this pattern
+ # will also pass on assignments of "0" to function pointers, but the
+ # preferred values for those would be "nullptr" or "NULL".
+ matched_zero = Match(r'^\s=\s*(\S+)\s*;', remainder)
+ if matched_zero and matched_zero.group(1) != '0':
+ return False
+
+ # Don't warn on function pointer declarations. For this we need
+ # to check what came before the "(type)" string.
+ if Match(r'.*\)\s*$', line[0:match.start(0)]):
+ return False
+
+ # Don't warn if the parameter is named with block comments, e.g.:
+ # Function(int /*unused_param*/);
+ if '/*' in raw_line:
+ return False
+
+ # Passed all filters, issue warning here.
+ error(filename, linenum, 'readability/function', 3,
+ 'All parameters should be named in a function')
return True
# At this point, all that should be left is actual casts.
@@ -3758,8 +4479,7 @@ def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
linenum: The number of the line to check.
error: The function to call with any errors found.
"""
- raw = clean_lines.raw_lines
- line = raw[linenum]
+ line = clean_lines.elided[linenum]
match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line)
if match:
error(filename, linenum, 'build/explicit_make_pair',
@@ -3798,9 +4518,11 @@ def ProcessLine(filename, file_extension, clean_lines, line,
CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
CheckLanguage(filename, clean_lines, line, file_extension, include_state,
- error)
+ nesting_state, error)
+ CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
CheckForNonStandardConstructs(filename, clean_lines, line,
nesting_state, error)
+ CheckVlogArguments(filename, clean_lines, line, error)
CheckPosixThreading(filename, clean_lines, line, error)
CheckInvalidIncrement(filename, clean_lines, line, error)
CheckMakePairUsesDeduction(filename, clean_lines, line, error)
@@ -3842,13 +4564,13 @@ def ProcessFileData(filename, file_extension, lines, error,
ProcessLine(filename, file_extension, clean_lines, line,
include_state, function_state, nesting_state, error,
extra_check_functions)
- nesting_state.CheckClassFinished(filename, error)
+ nesting_state.CheckCompletedBlocks(filename, error)
CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error)
# We check here rather than inside ProcessLine so that we see raw
# lines rather than "cleaned" lines.
- CheckForUnicodeReplacementCharacters(filename, lines, error)
+ CheckForBadCharacters(filename, lines, error)
CheckForNewlineAtEOF(filename, lines, error)
@@ -3904,9 +4626,9 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
# When reading from stdin, the extension is unknown, so no cpplint tests
# should rely on the extension.
- if (filename != '-' and file_extension != 'cc' and file_extension != 'h'
- and file_extension != 'cpp'):
- sys.stderr.write('Ignoring %s; not a .cc or .h file\n' % filename)
+ if filename != '-' and file_extension not in _valid_extensions:
+ sys.stderr.write('Ignoring %s; not a valid file name '
+ '(%s)\n' % (filename, ', '.join(_valid_extensions)))
else:
ProcessFileData(filename, file_extension, lines, Error,
extra_check_functions)
@@ -3957,7 +4679,9 @@ def ParseArguments(args):
(opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=',
'counting=',
'filter=',
- 'root='])
+ 'root=',
+ 'linelength=',
+ 'extensions='])
except getopt.GetoptError:
PrintUsage('Invalid arguments.')
@@ -3970,8 +4694,8 @@ def ParseArguments(args):
if opt == '--help':
PrintUsage(None)
elif opt == '--output':
- if not val in ('emacs', 'vs7'):
- PrintUsage('The only allowed output formats are emacs and vs7.')
+ if val not in ('emacs', 'vs7', 'eclipse'):
+ PrintUsage('The only allowed output formats are emacs, vs7 and eclipse.')
output_format = val
elif opt == '--verbose':
verbosity = int(val)
@@ -3986,6 +4710,18 @@ def ParseArguments(args):
elif opt == '--root':
global _root
_root = val
+ elif opt == '--linelength':
+ global _line_length
+ try:
+ _line_length = int(val)
+ except ValueError:
+ PrintUsage('Line length must be digits.')
+ elif opt == '--extensions':
+ global _valid_extensions
+ try:
+ _valid_extensions = set(val.split(','))
+ except ValueError:
+ PrintUsage('Extensions must be comma seperated list.')
if not filenames:
PrintUsage('No files were specified.')
diff --git a/libvpx/tools/diff.py b/libvpx/tools/diff.py
index a42a4dc..a96c7db 100644
--- a/libvpx/tools/diff.py
+++ b/libvpx/tools/diff.py
@@ -56,6 +56,9 @@ class DiffHunk(object):
elif line[0] == " ":
self.left.Append(line)
self.right.Append(line)
+ elif line[0] == "\\":
+ # Ignore newline messages from git diff.
+ pass
else:
assert False, ("Unrecognized character at start of diff line "
"%r" % line[0])
diff --git a/libvpx/tools_common.c b/libvpx/tools_common.c
index 44b2a3f..4f2ac74 100644
--- a/libvpx/tools_common.c
+++ b/libvpx/tools_common.c
@@ -7,10 +7,22 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "tools_common.h"
+#include <math.h>
#include <stdarg.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+
+#include "./tools_common.h"
+
+#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
+#include "vpx/vp8cx.h"
+#endif
+
+#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
+#include "vpx/vp8dx.h"
+#endif
#if defined(_WIN32) || defined(__OS2__)
#include <io.h>
@@ -56,3 +68,200 @@ void fatal(const char *fmt, ...) {
void warn(const char *fmt, ...) {
LOG_ERROR("Warning");
}
+
+void die_codec(vpx_codec_ctx_t *ctx, const char *s) {
+ const char *detail = vpx_codec_error_detail(ctx);
+
+ printf("%s: %s\n", s, vpx_codec_error(ctx));
+ if (detail)
+ printf(" %s\n", detail);
+ exit(EXIT_FAILURE);
+}
+
+int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame) {
+ FILE *f = input_ctx->file;
+ struct FileTypeDetectionBuffer *detect = &input_ctx->detect;
+ int plane = 0;
+ int shortread = 0;
+
+ for (plane = 0; plane < 3; ++plane) {
+ uint8_t *ptr;
+ const int w = (plane ? (1 + yuv_frame->d_w) / 2 : yuv_frame->d_w);
+ const int h = (plane ? (1 + yuv_frame->d_h) / 2 : yuv_frame->d_h);
+ int r;
+
+ /* Determine the correct plane based on the image format. The for-loop
+ * always counts in Y,U,V order, but this may not match the order of
+ * the data on disk.
+ */
+ switch (plane) {
+ case 1:
+ ptr = yuv_frame->planes[
+ yuv_frame->fmt == VPX_IMG_FMT_YV12 ? VPX_PLANE_V : VPX_PLANE_U];
+ break;
+ case 2:
+ ptr = yuv_frame->planes[
+ yuv_frame->fmt == VPX_IMG_FMT_YV12 ? VPX_PLANE_U : VPX_PLANE_V];
+ break;
+ default:
+ ptr = yuv_frame->planes[plane];
+ }
+
+ for (r = 0; r < h; ++r) {
+ size_t needed = w;
+ size_t buf_position = 0;
+ const size_t left = detect->buf_read - detect->position;
+ if (left > 0) {
+ const size_t more = (left < needed) ? left : needed;
+ memcpy(ptr, detect->buf + detect->position, more);
+ buf_position = more;
+ needed -= more;
+ detect->position += more;
+ }
+ if (needed > 0) {
+ shortread |= (fread(ptr + buf_position, 1, needed, f) < needed);
+ }
+
+ ptr += yuv_frame->stride[plane];
+ }
+ }
+
+ return shortread;
+}
+
+static const VpxInterface vpx_encoders[] = {
+#if CONFIG_VP8_ENCODER
+ {"vp8", VP8_FOURCC, &vpx_codec_vp8_cx},
+#endif
+
+#if CONFIG_VP9_ENCODER
+ {"vp9", VP9_FOURCC, &vpx_codec_vp9_cx},
+#endif
+};
+
+int get_vpx_encoder_count() {
+ return sizeof(vpx_encoders) / sizeof(vpx_encoders[0]);
+}
+
+const VpxInterface *get_vpx_encoder_by_index(int i) {
+ return &vpx_encoders[i];
+}
+
+const VpxInterface *get_vpx_encoder_by_name(const char *name) {
+ int i;
+
+ for (i = 0; i < get_vpx_encoder_count(); ++i) {
+ const VpxInterface *encoder = get_vpx_encoder_by_index(i);
+ if (strcmp(encoder->name, name) == 0)
+ return encoder;
+ }
+
+ return NULL;
+}
+
+static const VpxInterface vpx_decoders[] = {
+#if CONFIG_VP8_DECODER
+ {"vp8", VP8_FOURCC, &vpx_codec_vp8_dx},
+#endif
+
+#if CONFIG_VP9_DECODER
+ {"vp9", VP9_FOURCC, &vpx_codec_vp9_dx},
+#endif
+};
+
+int get_vpx_decoder_count() {
+ return sizeof(vpx_decoders) / sizeof(vpx_decoders[0]);
+}
+
+const VpxInterface *get_vpx_decoder_by_index(int i) {
+ return &vpx_decoders[i];
+}
+
+const VpxInterface *get_vpx_decoder_by_name(const char *name) {
+ int i;
+
+ for (i = 0; i < get_vpx_decoder_count(); ++i) {
+ const VpxInterface *const decoder = get_vpx_decoder_by_index(i);
+ if (strcmp(decoder->name, name) == 0)
+ return decoder;
+ }
+
+ return NULL;
+}
+
+const VpxInterface *get_vpx_decoder_by_fourcc(uint32_t fourcc) {
+ int i;
+
+ for (i = 0; i < get_vpx_decoder_count(); ++i) {
+ const VpxInterface *const decoder = get_vpx_decoder_by_index(i);
+ if (decoder->fourcc == fourcc)
+ return decoder;
+ }
+
+ return NULL;
+}
+
+// TODO(dkovalev): move this function to vpx_image.{c, h}, so it will be part
+// of vpx_image_t support
+int vpx_img_plane_width(const vpx_image_t *img, int plane) {
+ if (plane > 0 && img->x_chroma_shift > 0)
+ return (img->d_w + 1) >> img->x_chroma_shift;
+ else
+ return img->d_w;
+}
+
+int vpx_img_plane_height(const vpx_image_t *img, int plane) {
+ if (plane > 0 && img->y_chroma_shift > 0)
+ return (img->d_h + 1) >> img->y_chroma_shift;
+ else
+ return img->d_h;
+}
+
+void vpx_img_write(const vpx_image_t *img, FILE *file) {
+ int plane;
+
+ for (plane = 0; plane < 3; ++plane) {
+ const unsigned char *buf = img->planes[plane];
+ const int stride = img->stride[plane];
+ const int w = vpx_img_plane_width(img, plane);
+ const int h = vpx_img_plane_height(img, plane);
+ int y;
+
+ for (y = 0; y < h; ++y) {
+ fwrite(buf, 1, w, file);
+ buf += stride;
+ }
+ }
+}
+
+int vpx_img_read(vpx_image_t *img, FILE *file) {
+ int plane;
+
+ for (plane = 0; plane < 3; ++plane) {
+ unsigned char *buf = img->planes[plane];
+ const int stride = img->stride[plane];
+ const int w = vpx_img_plane_width(img, plane);
+ const int h = vpx_img_plane_height(img, plane);
+ int y;
+
+ for (y = 0; y < h; ++y) {
+ if (fread(buf, 1, w, file) != w)
+ return 0;
+ buf += stride;
+ }
+ }
+
+ return 1;
+}
+
+// TODO(dkovalev) change sse_to_psnr signature: double -> int64_t
+double sse_to_psnr(double samples, double peak, double sse) {
+ static const double kMaxPSNR = 100.0;
+
+ if (sse > 0.0) {
+ const double psnr = 10.0 * log10(samples * peak * peak / sse);
+ return psnr > kMaxPSNR ? kMaxPSNR : psnr;
+ } else {
+ return kMaxPSNR;
+ }
+}
diff --git a/libvpx/tools_common.h b/libvpx/tools_common.h
index 068e7b5..58894de 100644
--- a/libvpx/tools_common.h
+++ b/libvpx/tools_common.h
@@ -13,6 +13,13 @@
#include <stdio.h>
#include "./vpx_config.h"
+#include "vpx/vpx_codec.h"
+#include "vpx/vpx_image.h"
+#include "vpx/vpx_integer.h"
+
+#if CONFIG_ENCODERS
+#include "./y4minput.h"
+#endif
#if defined(_MSC_VER)
/* MSVS doesn't define off_t, and uses _f{seek,tell}i64. */
@@ -52,10 +59,52 @@ typedef long off_t; /* NOLINT */
#define PATH_MAX 512
#endif
-#define VP8_FOURCC (0x30385056)
-#define VP9_FOURCC (0x30395056)
-#define VP8_FOURCC_MASK (0x00385056)
-#define VP9_FOURCC_MASK (0x00395056)
+#define IVF_FRAME_HDR_SZ (4 + 8) /* 4 byte size + 8 byte timestamp */
+#define IVF_FILE_HDR_SZ 32
+
+#define RAW_FRAME_HDR_SZ sizeof(uint32_t)
+
+#define VP8_FOURCC 0x30385056
+#define VP9_FOURCC 0x30395056
+
+enum VideoFileType {
+ FILE_TYPE_RAW,
+ FILE_TYPE_IVF,
+ FILE_TYPE_Y4M,
+ FILE_TYPE_WEBM
+};
+
+struct FileTypeDetectionBuffer {
+ char buf[4];
+ size_t buf_read;
+ size_t position;
+};
+
+struct VpxRational {
+ int numerator;
+ int denominator;
+};
+
+struct VpxInputContext {
+ const char *filename;
+ FILE *file;
+ off_t length;
+ struct FileTypeDetectionBuffer detect;
+ enum VideoFileType file_type;
+ uint32_t width;
+ uint32_t height;
+ int use_i420;
+ int only_i420;
+ uint32_t fourcc;
+ struct VpxRational framerate;
+#if CONFIG_ENCODERS
+ y4m_input y4m;
+#endif
+};
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Sets a stdio stream into binary mode */
FILE *set_binary_mode(FILE *stream);
@@ -64,7 +113,39 @@ void die(const char *fmt, ...);
void fatal(const char *fmt, ...);
void warn(const char *fmt, ...);
+void die_codec(vpx_codec_ctx_t *ctx, const char *s);
+
/* The tool including this file must define usage_exit() */
void usage_exit();
+int read_yuv_frame(struct VpxInputContext *input_ctx, vpx_image_t *yuv_frame);
+
+typedef struct VpxInterface {
+ const char *const name;
+ const uint32_t fourcc;
+ vpx_codec_iface_t *(*const interface)();
+} VpxInterface;
+
+int get_vpx_encoder_count();
+const VpxInterface *get_vpx_encoder_by_index(int i);
+const VpxInterface *get_vpx_encoder_by_name(const char *name);
+
+int get_vpx_decoder_count();
+const VpxInterface *get_vpx_decoder_by_index(int i);
+const VpxInterface *get_vpx_decoder_by_name(const char *name);
+const VpxInterface *get_vpx_decoder_by_fourcc(uint32_t fourcc);
+
+// TODO(dkovalev): move this function to vpx_image.{c, h}, so it will be part
+// of vpx_image_t support
+int vpx_img_plane_width(const vpx_image_t *img, int plane);
+int vpx_img_plane_height(const vpx_image_t *img, int plane);
+void vpx_img_write(const vpx_image_t *img, FILE *file);
+int vpx_img_read(vpx_image_t *img, FILE *file);
+
+double sse_to_psnr(double samples, double peak, double mse);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
#endif // TOOLS_COMMON_H_
diff --git a/libvpx/vp9/encoder/vp9_psnr.h b/libvpx/video_common.h
index 15dd836..44b27a8 100644
--- a/libvpx/vp9/encoder/vp9_psnr.h
+++ b/libvpx/video_common.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -8,10 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VIDEO_COMMON_H_
+#define VIDEO_COMMON_H_
-#ifndef VP9_ENCODER_VP9_PSNR_H_
-#define VP9_ENCODER_VP9_PSNR_H_
+#include "./tools_common.h"
-double vp9_mse2psnr(double samples, double peak, double mse);
+typedef struct {
+ uint32_t codec_fourcc;
+ int frame_width;
+ int frame_height;
+ struct VpxRational time_base;
+} VpxVideoInfo;
-#endif // VP9_ENCODER_VP9_PSNR_H_
+#endif // VIDEO_COMMON_H_
diff --git a/libvpx/video_reader.c b/libvpx/video_reader.c
new file mode 100644
index 0000000..39c7edb
--- /dev/null
+++ b/libvpx/video_reader.c
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "./ivfdec.h"
+#include "./video_reader.h"
+
+#include "vpx_ports/mem_ops.h"
+
+static const char *const kIVFSignature = "DKIF";
+
+struct VpxVideoReaderStruct {
+ VpxVideoInfo info;
+ FILE *file;
+ uint8_t *buffer;
+ size_t buffer_size;
+ size_t frame_size;
+};
+
+VpxVideoReader *vpx_video_reader_open(const char *filename) {
+ char header[32];
+ VpxVideoReader *reader = NULL;
+ FILE *const file = fopen(filename, "rb");
+ if (!file)
+ return NULL; // Can't open file
+
+ if (fread(header, 1, 32, file) != 32)
+ return NULL; // Can't read file header
+
+ if (memcmp(kIVFSignature, header, 4) != 0)
+ return NULL; // Wrong IVF signature
+
+ if (mem_get_le16(header + 4) != 0)
+ return NULL; // Wrong IVF version
+
+ reader = calloc(1, sizeof(*reader));
+ if (!reader)
+ return NULL; // Can't allocate VpxVideoReader
+
+ reader->file = file;
+ reader->info.codec_fourcc = mem_get_le32(header + 8);
+ reader->info.frame_width = mem_get_le16(header + 12);
+ reader->info.frame_height = mem_get_le16(header + 14);
+ reader->info.time_base.numerator = mem_get_le32(header + 16);
+ reader->info.time_base.denominator = mem_get_le32(header + 20);
+
+ return reader;
+}
+
+void vpx_video_reader_close(VpxVideoReader *reader) {
+ if (reader) {
+ fclose(reader->file);
+ free(reader->buffer);
+ free(reader);
+ }
+}
+
+int vpx_video_reader_read_frame(VpxVideoReader *reader) {
+ return !ivf_read_frame(reader->file, &reader->buffer, &reader->frame_size,
+ &reader->buffer_size);
+}
+
+const uint8_t *vpx_video_reader_get_frame(VpxVideoReader *reader,
+ size_t *size) {
+ if (size)
+ *size = reader->frame_size;
+
+ return reader->buffer;
+}
+
+const VpxVideoInfo *vpx_video_reader_get_info(VpxVideoReader *reader) {
+ return &reader->info;
+}
+
diff --git a/libvpx/video_reader.h b/libvpx/video_reader.h
new file mode 100644
index 0000000..a62c6d7
--- /dev/null
+++ b/libvpx/video_reader.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VIDEO_READER_H_
+#define VIDEO_READER_H_
+
+#include "./video_common.h"
+
+// The following code is work in progress. It is going to support transparent
+// reading of input files. Right now only IVF format is supported for
+// simplicity. The main goal the API is to be simple and easy to use in example
+// code and in vpxenc/vpxdec later. All low-level details like memory
+// buffer management are hidden from API users.
+struct VpxVideoReaderStruct;
+typedef struct VpxVideoReaderStruct VpxVideoReader;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Opens the input file for reading and inspects it to determine file type.
+// Returns an opaque VpxVideoReader* upon success, or NULL upon failure.
+// Right now only IVF format is supported.
+VpxVideoReader *vpx_video_reader_open(const char *filename);
+
+// Frees all resources associated with VpxVideoReader* returned from
+// vpx_video_reader_open() call.
+void vpx_video_reader_close(VpxVideoReader *reader);
+
+// Reads frame from the file and stores it in internal buffer.
+int vpx_video_reader_read_frame(VpxVideoReader *reader);
+
+// Returns the pointer to memory buffer with frame data read by last call to
+// vpx_video_reader_read_frame().
+const uint8_t *vpx_video_reader_get_frame(VpxVideoReader *reader,
+ size_t *size);
+
+// Fills VpxVideoInfo with information from opened video file.
+const VpxVideoInfo *vpx_video_reader_get_info(VpxVideoReader *reader);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VIDEO_READER_H_
diff --git a/libvpx/video_writer.c b/libvpx/video_writer.c
new file mode 100644
index 0000000..3695236
--- /dev/null
+++ b/libvpx/video_writer.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <stdlib.h>
+
+#include "./ivfenc.h"
+#include "./video_writer.h"
+#include "vpx/vpx_encoder.h"
+
+struct VpxVideoWriterStruct {
+ VpxVideoInfo info;
+ FILE *file;
+ int frame_count;
+};
+
+static void write_header(FILE *file, const VpxVideoInfo *info,
+ int frame_count) {
+ struct vpx_codec_enc_cfg cfg;
+ cfg.g_w = info->frame_width;
+ cfg.g_h = info->frame_height;
+ cfg.g_timebase.num = info->time_base.numerator;
+ cfg.g_timebase.den = info->time_base.denominator;
+
+ ivf_write_file_header(file, &cfg, info->codec_fourcc, frame_count);
+}
+
+VpxVideoWriter *vpx_video_writer_open(const char *filename,
+ VpxContainer container,
+ const VpxVideoInfo *info) {
+ if (container == kContainerIVF) {
+ VpxVideoWriter *writer = NULL;
+ FILE *const file = fopen(filename, "wb");
+ if (!file)
+ return NULL;
+
+ writer = malloc(sizeof(*writer));
+ if (!writer)
+ return NULL;
+
+ writer->frame_count = 0;
+ writer->info = *info;
+ writer->file = file;
+
+ write_header(writer->file, info, 0);
+
+ return writer;
+ }
+
+ return NULL;
+}
+
+void vpx_video_writer_close(VpxVideoWriter *writer) {
+ if (writer) {
+ // Rewriting frame header with real frame count
+ rewind(writer->file);
+ write_header(writer->file, &writer->info, writer->frame_count);
+
+ fclose(writer->file);
+ free(writer);
+ }
+}
+
+int vpx_video_writer_write_frame(VpxVideoWriter *writer,
+ const uint8_t *buffer, size_t size,
+ int64_t pts) {
+ ivf_write_frame_header(writer->file, pts, size);
+ if (fwrite(buffer, 1, size, writer->file) != size)
+ return 0;
+
+ ++writer->frame_count;
+
+ return 1;
+}
diff --git a/libvpx/video_writer.h b/libvpx/video_writer.h
new file mode 100644
index 0000000..5dbfe52
--- /dev/null
+++ b/libvpx/video_writer.h
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VIDEO_WRITER_H_
+#define VIDEO_WRITER_H_
+
+#include "./video_common.h"
+
+typedef enum {
+ kContainerIVF
+} VpxContainer;
+
+struct VpxVideoWriterStruct;
+typedef struct VpxVideoWriterStruct VpxVideoWriter;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Finds and opens writer for specified container format.
+// Returns an opaque VpxVideoWriter* upon success, or NULL upon failure.
+// Right now only IVF format is supported.
+VpxVideoWriter *vpx_video_writer_open(const char *filename,
+ VpxContainer container,
+ const VpxVideoInfo *info);
+
+// Frees all resources associated with VpxVideoWriter* returned from
+// vpx_video_writer_open() call.
+void vpx_video_writer_close(VpxVideoWriter *writer);
+
+// Writes frame bytes to the file.
+int vpx_video_writer_write_frame(VpxVideoWriter *writer,
+ const uint8_t *buffer, size_t size,
+ int64_t pts);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VIDEO_WRITER_H_
diff --git a/libvpx/vp8/common/alloccommon.h b/libvpx/vp8/common/alloccommon.h
index ea93c25..93e99d7 100644
--- a/libvpx/vp8/common/alloccommon.h
+++ b/libvpx/vp8/common/alloccommon.h
@@ -9,15 +9,23 @@
*/
-#ifndef __INC_ALLOCCOMMON_H
-#define __INC_ALLOCCOMMON_H
+#ifndef VP8_COMMON_ALLOCCOMMON_H_
+#define VP8_COMMON_ALLOCCOMMON_H_
#include "onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_create_common(VP8_COMMON *oci);
void vp8_remove_common(VP8_COMMON *oci);
void vp8_de_alloc_frame_buffers(VP8_COMMON *oci);
int vp8_alloc_frame_buffers(VP8_COMMON *oci, int width, int height);
void vp8_setup_version(VP8_COMMON *oci);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_ALLOCCOMMON_H_
diff --git a/libvpx/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm b/libvpx/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm
index dc84c30..3991957 100644
--- a/libvpx/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm
+++ b/libvpx/vp8/common/arm/armv6/vp8_variance16x16_armv6.asm
@@ -53,7 +53,7 @@ loop
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
adds r8, r8, r4 ; add positive differences to sum
- subs r8, r8, r5 ; substract negative differences from sum
+ subs r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -77,7 +77,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -101,7 +101,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -127,7 +127,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
diff --git a/libvpx/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm b/libvpx/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm
index adc353d..915ee49 100644
--- a/libvpx/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm
+++ b/libvpx/vp8/common/arm/armv6/vp8_variance8x8_armv6.asm
@@ -51,7 +51,7 @@ loop
orr r8, r8, r10 ; differences of all 4 pixels
; calculate total sum
add r4, r4, r6 ; add positive differences to sum
- sub r4, r4, r7 ; substract negative differences from sum
+ sub r4, r4, r7 ; subtract negative differences from sum
; calculate sse
uxtb16 r7, r8 ; byte (two pixels) to halfwords
@@ -77,7 +77,7 @@ loop
; calculate total sum
add r4, r4, r6 ; add positive differences to sum
- sub r4, r4, r7 ; substract negative differences from sum
+ sub r4, r4, r7 ; subtract negative differences from sum
; calculate sse
uxtb16 r7, r8 ; byte (two pixels) to halfwords
diff --git a/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm b/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
index dd2ce68..3668dc5 100644
--- a/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
+++ b/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
@@ -58,7 +58,7 @@ loop
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
adds r8, r8, r4 ; add positive differences to sum
- subs r8, r8, r5 ; substract negative differences from sum
+ subs r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -89,7 +89,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -120,7 +120,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -153,7 +153,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
diff --git a/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm b/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
index f972d9b..b4e0959 100644
--- a/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
+++ b/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
@@ -69,7 +69,7 @@ loop
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
adds r8, r8, r4 ; add positive differences to sum
- subs r8, r8, r5 ; substract negative differences from sum
+ subs r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -111,7 +111,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -153,7 +153,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -195,7 +195,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
diff --git a/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm b/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
index f5da9c0..10863e2 100644
--- a/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
+++ b/libvpx/vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
@@ -59,7 +59,7 @@ loop
orr r6, r6, r7 ; differences of all 4 pixels
; calculate total sum
adds r8, r8, r4 ; add positive differences to sum
- subs r8, r8, r5 ; substract negative differences from sum
+ subs r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -90,7 +90,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -121,7 +121,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
@@ -154,7 +154,7 @@ loop
; calculate total sum
add r8, r8, r4 ; add positive differences to sum
- sub r8, r8, r5 ; substract negative differences from sum
+ sub r8, r8, r5 ; subtract negative differences from sum
; calculate sse
uxtb16 r5, r6 ; byte (two pixels) to halfwords
diff --git a/libvpx/vp8/common/arm/bilinearfilter_arm.h b/libvpx/vp8/common/arm/bilinearfilter_arm.h
index b7155d3..6b84e6f 100644
--- a/libvpx/vp8/common/arm/bilinearfilter_arm.h
+++ b/libvpx/vp8/common/arm/bilinearfilter_arm.h
@@ -9,8 +9,12 @@
*/
-#ifndef BILINEARFILTER_ARM_H
-#define BILINEARFILTER_ARM_H
+#ifndef VP8_COMMON_ARM_BILINEARFILTER_ARM_H_
+#define VP8_COMMON_ARM_BILINEARFILTER_ARM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void vp8_filter_block2d_bil_first_pass_armv6
(
@@ -32,4 +36,8 @@ extern void vp8_filter_block2d_bil_second_pass_armv6
const short *vp8_filter
);
-#endif /* BILINEARFILTER_ARM_H */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_ARM_BILINEARFILTER_ARM_H_
diff --git a/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm b/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm
deleted file mode 100644
index e392786..0000000
--- a/libvpx/vp8/common/arm/neon/bilinearpredict16x16_neon.asm
+++ /dev/null
@@ -1,357 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_bilinear_predict16x16_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-; r0 unsigned char *src_ptr,
-; r1 int src_pixels_per_line,
-; r2 int xoffset,
-; r3 int yoffset,
-; r4 unsigned char *dst_ptr,
-; stack(r5) int dst_pitch
-
-|vp8_bilinear_predict16x16_neon| PROC
- push {r4-r5, lr}
-
- adr r12, bifilter16_coeff
- ldr r4, [sp, #12] ;load parameters from stack
- ldr r5, [sp, #16] ;load parameters from stack
-
- cmp r2, #0 ;skip first_pass filter if xoffset=0
- beq secondpass_bfilter16x16_only
-
- add r2, r12, r2, lsl #3 ;calculate filter location
-
- cmp r3, #0 ;skip second_pass filter if yoffset=0
-
- vld1.s32 {d31}, [r2] ;load first_pass filter
-
- beq firstpass_bfilter16x16_only
-
- sub sp, sp, #272 ;reserve space on stack for temporary storage
- vld1.u8 {d2, d3, d4}, [r0], r1 ;load src data
- mov lr, sp
- vld1.u8 {d5, d6, d7}, [r0], r1
-
- mov r2, #3 ;loop counter
- vld1.u8 {d8, d9, d10}, [r0], r1
-
- vdup.8 d0, d31[0] ;first_pass filter (d0 d1)
- vld1.u8 {d11, d12, d13}, [r0], r1
-
- vdup.8 d1, d31[4]
-
-;First Pass: output_height lines x output_width columns (17x16)
-filt_blk2d_fp16x16_loop_neon
- pld [r0]
- pld [r0, r1]
- pld [r0, r1, lsl #1]
-
- vmull.u8 q7, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q8, d3, d0
- vmull.u8 q9, d5, d0
- vmull.u8 q10, d6, d0
- vmull.u8 q11, d8, d0
- vmull.u8 q12, d9, d0
- vmull.u8 q13, d11, d0
- vmull.u8 q14, d12, d0
-
- vext.8 d2, d2, d3, #1 ;construct src_ptr[1]
- vext.8 d5, d5, d6, #1
- vext.8 d8, d8, d9, #1
- vext.8 d11, d11, d12, #1
-
- vmlal.u8 q7, d2, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q9, d5, d1
- vmlal.u8 q11, d8, d1
- vmlal.u8 q13, d11, d1
-
- vext.8 d3, d3, d4, #1
- vext.8 d6, d6, d7, #1
- vext.8 d9, d9, d10, #1
- vext.8 d12, d12, d13, #1
-
- vmlal.u8 q8, d3, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q10, d6, d1
- vmlal.u8 q12, d9, d1
- vmlal.u8 q14, d12, d1
-
- subs r2, r2, #1
-
- vqrshrn.u16 d14, q7, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d15, q8, #7
- vqrshrn.u16 d16, q9, #7
- vqrshrn.u16 d17, q10, #7
- vqrshrn.u16 d18, q11, #7
- vqrshrn.u16 d19, q12, #7
- vqrshrn.u16 d20, q13, #7
-
- vld1.u8 {d2, d3, d4}, [r0], r1 ;load src data
- vqrshrn.u16 d21, q14, #7
- vld1.u8 {d5, d6, d7}, [r0], r1
-
- vst1.u8 {d14, d15, d16, d17}, [lr]! ;store result
- vld1.u8 {d8, d9, d10}, [r0], r1
- vst1.u8 {d18, d19, d20, d21}, [lr]!
- vld1.u8 {d11, d12, d13}, [r0], r1
-
- bne filt_blk2d_fp16x16_loop_neon
-
-;First-pass filtering for rest 5 lines
- vld1.u8 {d14, d15, d16}, [r0], r1
-
- vmull.u8 q9, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q10, d3, d0
- vmull.u8 q11, d5, d0
- vmull.u8 q12, d6, d0
- vmull.u8 q13, d8, d0
- vmull.u8 q14, d9, d0
-
- vext.8 d2, d2, d3, #1 ;construct src_ptr[1]
- vext.8 d5, d5, d6, #1
- vext.8 d8, d8, d9, #1
-
- vmlal.u8 q9, d2, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q11, d5, d1
- vmlal.u8 q13, d8, d1
-
- vext.8 d3, d3, d4, #1
- vext.8 d6, d6, d7, #1
- vext.8 d9, d9, d10, #1
-
- vmlal.u8 q10, d3, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q12, d6, d1
- vmlal.u8 q14, d9, d1
-
- vmull.u8 q1, d11, d0
- vmull.u8 q2, d12, d0
- vmull.u8 q3, d14, d0
- vmull.u8 q4, d15, d0
-
- vext.8 d11, d11, d12, #1 ;construct src_ptr[1]
- vext.8 d14, d14, d15, #1
-
- vmlal.u8 q1, d11, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q3, d14, d1
-
- vext.8 d12, d12, d13, #1
- vext.8 d15, d15, d16, #1
-
- vmlal.u8 q2, d12, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q4, d15, d1
-
- vqrshrn.u16 d10, q9, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d11, q10, #7
- vqrshrn.u16 d12, q11, #7
- vqrshrn.u16 d13, q12, #7
- vqrshrn.u16 d14, q13, #7
- vqrshrn.u16 d15, q14, #7
- vqrshrn.u16 d16, q1, #7
- vqrshrn.u16 d17, q2, #7
- vqrshrn.u16 d18, q3, #7
- vqrshrn.u16 d19, q4, #7
-
- vst1.u8 {d10, d11, d12, d13}, [lr]! ;store result
- vst1.u8 {d14, d15, d16, d17}, [lr]!
- vst1.u8 {d18, d19}, [lr]!
-
-;Second pass: 16x16
-;secondpass_filter
- add r3, r12, r3, lsl #3
- sub lr, lr, #272
-
- vld1.u32 {d31}, [r3] ;load second_pass filter
-
- vld1.u8 {d22, d23}, [lr]! ;load src data
-
- vdup.8 d0, d31[0] ;second_pass filter parameters (d0 d1)
- vdup.8 d1, d31[4]
- mov r12, #4 ;loop counter
-
-filt_blk2d_sp16x16_loop_neon
- vld1.u8 {d24, d25}, [lr]!
- vmull.u8 q1, d22, d0 ;(src_ptr[0] * vp8_filter[0])
- vld1.u8 {d26, d27}, [lr]!
- vmull.u8 q2, d23, d0
- vld1.u8 {d28, d29}, [lr]!
- vmull.u8 q3, d24, d0
- vld1.u8 {d30, d31}, [lr]!
-
- vmull.u8 q4, d25, d0
- vmull.u8 q5, d26, d0
- vmull.u8 q6, d27, d0
- vmull.u8 q7, d28, d0
- vmull.u8 q8, d29, d0
-
- vmlal.u8 q1, d24, d1 ;(src_ptr[pixel_step] * vp8_filter[1])
- vmlal.u8 q2, d25, d1
- vmlal.u8 q3, d26, d1
- vmlal.u8 q4, d27, d1
- vmlal.u8 q5, d28, d1
- vmlal.u8 q6, d29, d1
- vmlal.u8 q7, d30, d1
- vmlal.u8 q8, d31, d1
-
- subs r12, r12, #1
-
- vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d3, q2, #7
- vqrshrn.u16 d4, q3, #7
- vqrshrn.u16 d5, q4, #7
- vqrshrn.u16 d6, q5, #7
- vqrshrn.u16 d7, q6, #7
- vqrshrn.u16 d8, q7, #7
- vqrshrn.u16 d9, q8, #7
-
- vst1.u8 {d2, d3}, [r4], r5 ;store result
- vst1.u8 {d4, d5}, [r4], r5
- vst1.u8 {d6, d7}, [r4], r5
- vmov q11, q15
- vst1.u8 {d8, d9}, [r4], r5
-
- bne filt_blk2d_sp16x16_loop_neon
-
- add sp, sp, #272
-
- pop {r4-r5,pc}
-
-;--------------------
-firstpass_bfilter16x16_only
- mov r2, #4 ;loop counter
- vdup.8 d0, d31[0] ;first_pass filter (d0 d1)
- vdup.8 d1, d31[4]
-
-;First Pass: output_height lines x output_width columns (16x16)
-filt_blk2d_fpo16x16_loop_neon
- vld1.u8 {d2, d3, d4}, [r0], r1 ;load src data
- vld1.u8 {d5, d6, d7}, [r0], r1
- vld1.u8 {d8, d9, d10}, [r0], r1
- vld1.u8 {d11, d12, d13}, [r0], r1
-
- pld [r0]
- pld [r0, r1]
- pld [r0, r1, lsl #1]
-
- vmull.u8 q7, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q8, d3, d0
- vmull.u8 q9, d5, d0
- vmull.u8 q10, d6, d0
- vmull.u8 q11, d8, d0
- vmull.u8 q12, d9, d0
- vmull.u8 q13, d11, d0
- vmull.u8 q14, d12, d0
-
- vext.8 d2, d2, d3, #1 ;construct src_ptr[1]
- vext.8 d5, d5, d6, #1
- vext.8 d8, d8, d9, #1
- vext.8 d11, d11, d12, #1
-
- vmlal.u8 q7, d2, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q9, d5, d1
- vmlal.u8 q11, d8, d1
- vmlal.u8 q13, d11, d1
-
- vext.8 d3, d3, d4, #1
- vext.8 d6, d6, d7, #1
- vext.8 d9, d9, d10, #1
- vext.8 d12, d12, d13, #1
-
- vmlal.u8 q8, d3, d1 ;(src_ptr[0] * vp8_filter[1])
- vmlal.u8 q10, d6, d1
- vmlal.u8 q12, d9, d1
- vmlal.u8 q14, d12, d1
-
- subs r2, r2, #1
-
- vqrshrn.u16 d14, q7, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d15, q8, #7
- vqrshrn.u16 d16, q9, #7
- vqrshrn.u16 d17, q10, #7
- vqrshrn.u16 d18, q11, #7
- vqrshrn.u16 d19, q12, #7
- vqrshrn.u16 d20, q13, #7
- vst1.u8 {d14, d15}, [r4], r5 ;store result
- vqrshrn.u16 d21, q14, #7
-
- vst1.u8 {d16, d17}, [r4], r5
- vst1.u8 {d18, d19}, [r4], r5
- vst1.u8 {d20, d21}, [r4], r5
-
- bne filt_blk2d_fpo16x16_loop_neon
- pop {r4-r5,pc}
-
-;---------------------
-secondpass_bfilter16x16_only
-;Second pass: 16x16
-;secondpass_filter
- add r3, r12, r3, lsl #3
- mov r12, #4 ;loop counter
- vld1.u32 {d31}, [r3] ;load second_pass filter
- vld1.u8 {d22, d23}, [r0], r1 ;load src data
-
- vdup.8 d0, d31[0] ;second_pass filter parameters (d0 d1)
- vdup.8 d1, d31[4]
-
-filt_blk2d_spo16x16_loop_neon
- vld1.u8 {d24, d25}, [r0], r1
- vmull.u8 q1, d22, d0 ;(src_ptr[0] * vp8_filter[0])
- vld1.u8 {d26, d27}, [r0], r1
- vmull.u8 q2, d23, d0
- vld1.u8 {d28, d29}, [r0], r1
- vmull.u8 q3, d24, d0
- vld1.u8 {d30, d31}, [r0], r1
-
- vmull.u8 q4, d25, d0
- vmull.u8 q5, d26, d0
- vmull.u8 q6, d27, d0
- vmull.u8 q7, d28, d0
- vmull.u8 q8, d29, d0
-
- vmlal.u8 q1, d24, d1 ;(src_ptr[pixel_step] * vp8_filter[1])
- vmlal.u8 q2, d25, d1
- vmlal.u8 q3, d26, d1
- vmlal.u8 q4, d27, d1
- vmlal.u8 q5, d28, d1
- vmlal.u8 q6, d29, d1
- vmlal.u8 q7, d30, d1
- vmlal.u8 q8, d31, d1
-
- vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d3, q2, #7
- vqrshrn.u16 d4, q3, #7
- vqrshrn.u16 d5, q4, #7
- vqrshrn.u16 d6, q5, #7
- vqrshrn.u16 d7, q6, #7
- vqrshrn.u16 d8, q7, #7
- vqrshrn.u16 d9, q8, #7
-
- vst1.u8 {d2, d3}, [r4], r5 ;store result
- subs r12, r12, #1
- vst1.u8 {d4, d5}, [r4], r5
- vmov q11, q15
- vst1.u8 {d6, d7}, [r4], r5
- vst1.u8 {d8, d9}, [r4], r5
-
- bne filt_blk2d_spo16x16_loop_neon
- pop {r4-r5,pc}
-
- ENDP
-
-;-----------------
-
-bifilter16_coeff
- DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
-
- END
diff --git a/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm b/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm
deleted file mode 100644
index 0ac6243..0000000
--- a/libvpx/vp8/common/arm/neon/bilinearpredict4x4_neon.asm
+++ /dev/null
@@ -1,130 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_bilinear_predict4x4_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-; r0 unsigned char *src_ptr,
-; r1 int src_pixels_per_line,
-; r2 int xoffset,
-; r3 int yoffset,
-; r4 unsigned char *dst_ptr,
-; stack(lr) int dst_pitch
-
-|vp8_bilinear_predict4x4_neon| PROC
- push {r4, lr}
-
- adr r12, bifilter4_coeff
- ldr r4, [sp, #8] ;load parameters from stack
- ldr lr, [sp, #12] ;load parameters from stack
-
- cmp r2, #0 ;skip first_pass filter if xoffset=0
- beq skip_firstpass_filter
-
-;First pass: output_height lines x output_width columns (5x4)
- vld1.u8 {d2}, [r0], r1 ;load src data
- add r2, r12, r2, lsl #3 ;calculate Hfilter location (2coeffsx4bytes=8bytes)
-
- vld1.u8 {d3}, [r0], r1
- vld1.u32 {d31}, [r2] ;first_pass filter
-
- vld1.u8 {d4}, [r0], r1
- vdup.8 d0, d31[0] ;first_pass filter (d0-d1)
- vld1.u8 {d5}, [r0], r1
- vdup.8 d1, d31[4]
- vld1.u8 {d6}, [r0], r1
-
- vshr.u64 q4, q1, #8 ;construct src_ptr[1]
- vshr.u64 q5, q2, #8
- vshr.u64 d12, d6, #8
-
- vzip.32 d2, d3 ;put 2-line data in 1 register (src_ptr[0])
- vzip.32 d4, d5
- vzip.32 d8, d9 ;put 2-line data in 1 register (src_ptr[1])
- vzip.32 d10, d11
-
- vmull.u8 q7, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q8, d4, d0
- vmull.u8 q9, d6, d0
-
- vmlal.u8 q7, d8, d1 ;(src_ptr[1] * vp8_filter[1])
- vmlal.u8 q8, d10, d1
- vmlal.u8 q9, d12, d1
-
- vqrshrn.u16 d28, q7, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d29, q8, #7
- vqrshrn.u16 d30, q9, #7
-
-;Second pass: 4x4
-secondpass_filter
- cmp r3, #0 ;skip second_pass filter if yoffset=0
- beq skip_secondpass_filter
-
- add r3, r12, r3, lsl #3 ;calculate Vfilter location
- vld1.u32 {d31}, [r3] ;load second_pass filter
-
- vdup.8 d0, d31[0] ;second_pass filter parameters (d0-d5)
- vdup.8 d1, d31[4]
-
- vmull.u8 q1, d28, d0
- vmull.u8 q2, d29, d0
-
- vext.8 d26, d28, d29, #4 ;construct src_ptr[pixel_step]
- vext.8 d27, d29, d30, #4
-
- vmlal.u8 q1, d26, d1
- vmlal.u8 q2, d27, d1
-
- add r0, r4, lr
- add r1, r0, lr
- add r2, r1, lr
-
- vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d3, q2, #7
-
- vst1.32 {d2[0]}, [r4] ;store result
- vst1.32 {d2[1]}, [r0]
- vst1.32 {d3[0]}, [r1]
- vst1.32 {d3[1]}, [r2]
-
- pop {r4, pc}
-
-;--------------------
-skip_firstpass_filter
-
- vld1.32 {d28[0]}, [r0], r1 ;load src data
- vld1.32 {d28[1]}, [r0], r1
- vld1.32 {d29[0]}, [r0], r1
- vld1.32 {d29[1]}, [r0], r1
- vld1.32 {d30[0]}, [r0], r1
-
- b secondpass_filter
-
-;---------------------
-skip_secondpass_filter
- vst1.32 {d28[0]}, [r4], lr ;store result
- vst1.32 {d28[1]}, [r4], lr
- vst1.32 {d29[0]}, [r4], lr
- vst1.32 {d29[1]}, [r4], lr
-
- pop {r4, pc}
-
- ENDP
-
-;-----------------
-
-bifilter4_coeff
- DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
-
- END
diff --git a/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm b/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm
deleted file mode 100644
index 41f5c45..0000000
--- a/libvpx/vp8/common/arm/neon/bilinearpredict8x4_neon.asm
+++ /dev/null
@@ -1,135 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_bilinear_predict8x4_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-; r0 unsigned char *src_ptr,
-; r1 int src_pixels_per_line,
-; r2 int xoffset,
-; r3 int yoffset,
-; r4 unsigned char *dst_ptr,
-; stack(lr) int dst_pitch
-
-|vp8_bilinear_predict8x4_neon| PROC
- push {r4, lr}
-
- adr r12, bifilter8x4_coeff
- ldr r4, [sp, #8] ;load parameters from stack
- ldr lr, [sp, #12] ;load parameters from stack
-
- cmp r2, #0 ;skip first_pass filter if xoffset=0
- beq skip_firstpass_filter
-
-;First pass: output_height lines x output_width columns (5x8)
- add r2, r12, r2, lsl #3 ;calculate filter location
-
- vld1.u8 {q1}, [r0], r1 ;load src data
- vld1.u32 {d31}, [r2] ;load first_pass filter
- vld1.u8 {q2}, [r0], r1
- vdup.8 d0, d31[0] ;first_pass filter (d0 d1)
- vld1.u8 {q3}, [r0], r1
- vdup.8 d1, d31[4]
- vld1.u8 {q4}, [r0], r1
-
- vmull.u8 q6, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vld1.u8 {q5}, [r0], r1
- vmull.u8 q7, d4, d0
- vmull.u8 q8, d6, d0
- vmull.u8 q9, d8, d0
- vmull.u8 q10, d10, d0
-
- vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
- vext.8 d5, d4, d5, #1
- vext.8 d7, d6, d7, #1
- vext.8 d9, d8, d9, #1
- vext.8 d11, d10, d11, #1
-
- vmlal.u8 q6, d3, d1 ;(src_ptr[1] * vp8_filter[1])
- vmlal.u8 q7, d5, d1
- vmlal.u8 q8, d7, d1
- vmlal.u8 q9, d9, d1
- vmlal.u8 q10, d11, d1
-
- vqrshrn.u16 d22, q6, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d23, q7, #7
- vqrshrn.u16 d24, q8, #7
- vqrshrn.u16 d25, q9, #7
- vqrshrn.u16 d26, q10, #7
-
-;Second pass: 4x8
-secondpass_filter
- cmp r3, #0 ;skip second_pass filter if yoffset=0
- beq skip_secondpass_filter
-
- add r3, r12, r3, lsl #3
- add r0, r4, lr
-
- vld1.u32 {d31}, [r3] ;load second_pass filter
- add r1, r0, lr
-
- vdup.8 d0, d31[0] ;second_pass filter parameters (d0 d1)
- vdup.8 d1, d31[4]
-
- vmull.u8 q1, d22, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q2, d23, d0
- vmull.u8 q3, d24, d0
- vmull.u8 q4, d25, d0
-
- vmlal.u8 q1, d23, d1 ;(src_ptr[pixel_step] * vp8_filter[1])
- vmlal.u8 q2, d24, d1
- vmlal.u8 q3, d25, d1
- vmlal.u8 q4, d26, d1
-
- add r2, r1, lr
-
- vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d3, q2, #7
- vqrshrn.u16 d4, q3, #7
- vqrshrn.u16 d5, q4, #7
-
- vst1.u8 {d2}, [r4] ;store result
- vst1.u8 {d3}, [r0]
- vst1.u8 {d4}, [r1]
- vst1.u8 {d5}, [r2]
-
- pop {r4, pc}
-
-;--------------------
-skip_firstpass_filter
- vld1.u8 {d22}, [r0], r1 ;load src data
- vld1.u8 {d23}, [r0], r1
- vld1.u8 {d24}, [r0], r1
- vld1.u8 {d25}, [r0], r1
- vld1.u8 {d26}, [r0], r1
-
- b secondpass_filter
-
-;---------------------
-skip_secondpass_filter
- vst1.u8 {d22}, [r4], lr ;store result
- vst1.u8 {d23}, [r4], lr
- vst1.u8 {d24}, [r4], lr
- vst1.u8 {d25}, [r4], lr
-
- pop {r4, pc}
-
- ENDP
-
-;-----------------
-
-bifilter8x4_coeff
- DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
-
- END
diff --git a/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm b/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm
deleted file mode 100644
index c4711bc..0000000
--- a/libvpx/vp8/common/arm/neon/bilinearpredict8x8_neon.asm
+++ /dev/null
@@ -1,183 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_bilinear_predict8x8_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-; r0 unsigned char *src_ptr,
-; r1 int src_pixels_per_line,
-; r2 int xoffset,
-; r3 int yoffset,
-; r4 unsigned char *dst_ptr,
-; stack(lr) int dst_pitch
-
-|vp8_bilinear_predict8x8_neon| PROC
- push {r4, lr}
-
- adr r12, bifilter8_coeff
- ldr r4, [sp, #8] ;load parameters from stack
- ldr lr, [sp, #12] ;load parameters from stack
-
- cmp r2, #0 ;skip first_pass filter if xoffset=0
- beq skip_firstpass_filter
-
-;First pass: output_height lines x output_width columns (9x8)
- add r2, r12, r2, lsl #3 ;calculate filter location
-
- vld1.u8 {q1}, [r0], r1 ;load src data
- vld1.u32 {d31}, [r2] ;load first_pass filter
- vld1.u8 {q2}, [r0], r1
- vdup.8 d0, d31[0] ;first_pass filter (d0 d1)
- vld1.u8 {q3}, [r0], r1
- vdup.8 d1, d31[4]
- vld1.u8 {q4}, [r0], r1
-
- vmull.u8 q6, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q7, d4, d0
- vmull.u8 q8, d6, d0
- vmull.u8 q9, d8, d0
-
- vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
- vext.8 d5, d4, d5, #1
- vext.8 d7, d6, d7, #1
- vext.8 d9, d8, d9, #1
-
- vmlal.u8 q6, d3, d1 ;(src_ptr[1] * vp8_filter[1])
- vmlal.u8 q7, d5, d1
- vmlal.u8 q8, d7, d1
- vmlal.u8 q9, d9, d1
-
- vld1.u8 {q1}, [r0], r1 ;load src data
- vqrshrn.u16 d22, q6, #7 ;shift/round/saturate to u8
- vld1.u8 {q2}, [r0], r1
- vqrshrn.u16 d23, q7, #7
- vld1.u8 {q3}, [r0], r1
- vqrshrn.u16 d24, q8, #7
- vld1.u8 {q4}, [r0], r1
- vqrshrn.u16 d25, q9, #7
-
- ;first_pass filtering on the rest 5-line data
- vld1.u8 {q5}, [r0], r1
-
- vmull.u8 q6, d2, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q7, d4, d0
- vmull.u8 q8, d6, d0
- vmull.u8 q9, d8, d0
- vmull.u8 q10, d10, d0
-
- vext.8 d3, d2, d3, #1 ;construct src_ptr[-1]
- vext.8 d5, d4, d5, #1
- vext.8 d7, d6, d7, #1
- vext.8 d9, d8, d9, #1
- vext.8 d11, d10, d11, #1
-
- vmlal.u8 q6, d3, d1 ;(src_ptr[1] * vp8_filter[1])
- vmlal.u8 q7, d5, d1
- vmlal.u8 q8, d7, d1
- vmlal.u8 q9, d9, d1
- vmlal.u8 q10, d11, d1
-
- vqrshrn.u16 d26, q6, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d27, q7, #7
- vqrshrn.u16 d28, q8, #7
- vqrshrn.u16 d29, q9, #7
- vqrshrn.u16 d30, q10, #7
-
-;Second pass: 8x8
-secondpass_filter
- cmp r3, #0 ;skip second_pass filter if yoffset=0
- beq skip_secondpass_filter
-
- add r3, r12, r3, lsl #3
- add r0, r4, lr
-
- vld1.u32 {d31}, [r3] ;load second_pass filter
- add r1, r0, lr
-
- vdup.8 d0, d31[0] ;second_pass filter parameters (d0 d1)
- vdup.8 d1, d31[4]
-
- vmull.u8 q1, d22, d0 ;(src_ptr[0] * vp8_filter[0])
- vmull.u8 q2, d23, d0
- vmull.u8 q3, d24, d0
- vmull.u8 q4, d25, d0
- vmull.u8 q5, d26, d0
- vmull.u8 q6, d27, d0
- vmull.u8 q7, d28, d0
- vmull.u8 q8, d29, d0
-
- vmlal.u8 q1, d23, d1 ;(src_ptr[pixel_step] * vp8_filter[1])
- vmlal.u8 q2, d24, d1
- vmlal.u8 q3, d25, d1
- vmlal.u8 q4, d26, d1
- vmlal.u8 q5, d27, d1
- vmlal.u8 q6, d28, d1
- vmlal.u8 q7, d29, d1
- vmlal.u8 q8, d30, d1
-
- vqrshrn.u16 d2, q1, #7 ;shift/round/saturate to u8
- vqrshrn.u16 d3, q2, #7
- vqrshrn.u16 d4, q3, #7
- vqrshrn.u16 d5, q4, #7
- vqrshrn.u16 d6, q5, #7
- vqrshrn.u16 d7, q6, #7
- vqrshrn.u16 d8, q7, #7
- vqrshrn.u16 d9, q8, #7
-
- vst1.u8 {d2}, [r4] ;store result
- vst1.u8 {d3}, [r0]
- vst1.u8 {d4}, [r1], lr
- vst1.u8 {d5}, [r1], lr
- vst1.u8 {d6}, [r1], lr
- vst1.u8 {d7}, [r1], lr
- vst1.u8 {d8}, [r1], lr
- vst1.u8 {d9}, [r1], lr
-
- pop {r4, pc}
-
-;--------------------
-skip_firstpass_filter
- vld1.u8 {d22}, [r0], r1 ;load src data
- vld1.u8 {d23}, [r0], r1
- vld1.u8 {d24}, [r0], r1
- vld1.u8 {d25}, [r0], r1
- vld1.u8 {d26}, [r0], r1
- vld1.u8 {d27}, [r0], r1
- vld1.u8 {d28}, [r0], r1
- vld1.u8 {d29}, [r0], r1
- vld1.u8 {d30}, [r0], r1
-
- b secondpass_filter
-
-;---------------------
-skip_secondpass_filter
- vst1.u8 {d22}, [r4], lr ;store result
- vst1.u8 {d23}, [r4], lr
- vst1.u8 {d24}, [r4], lr
- vst1.u8 {d25}, [r4], lr
- vst1.u8 {d26}, [r4], lr
- vst1.u8 {d27}, [r4], lr
- vst1.u8 {d28}, [r4], lr
- vst1.u8 {d29}, [r4], lr
-
- pop {r4, pc}
-
- ENDP
-
-;-----------------
-
-bifilter8_coeff
- DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
-
- END
diff --git a/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c b/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c
new file mode 100644
index 0000000..e1c3c2b
--- /dev/null
+++ b/libvpx/vp8/common/arm/neon/bilinearpredict_neon.c
@@ -0,0 +1,696 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <arm_neon.h>
+
+static const uint16_t bifilter4_coeff[8][2] = {
+ {128, 0},
+ {112, 16},
+ { 96, 32},
+ { 80, 48},
+ { 64, 64},
+ { 48, 80},
+ { 32, 96},
+ { 16, 112}
+};
+
+void vp8_bilinear_predict4x4_neon(
+ unsigned char *src_ptr,
+ int src_pixels_per_line,
+ int xoffset,
+ int yoffset,
+ unsigned char *dst_ptr,
+ int dst_pitch) {
+ uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8;
+ uint8x8_t d26u8, d27u8, d28u8, d29u8, d30u8;
+ uint32x2_t d28u32, d29u32, d30u32;
+ uint8x16_t q1u8, q2u8;
+ uint16x8_t q1u16, q2u16;
+ uint16x8_t q7u16, q8u16, q9u16;
+ uint64x2_t q4u64, q5u64;
+ uint64x1_t d12u64;
+ uint32x2x2_t d0u32x2, d1u32x2, d2u32x2, d3u32x2;
+
+ if (xoffset == 0) { // skip_1stpass_filter
+ d28u32 = vld1_lane_u32((const uint32_t *)src_ptr, d28u32, 0);
+ src_ptr += src_pixels_per_line;
+ d28u32 = vld1_lane_u32((const uint32_t *)src_ptr, d28u32, 1);
+ src_ptr += src_pixels_per_line;
+ d29u32 = vld1_lane_u32((const uint32_t *)src_ptr, d29u32, 0);
+ src_ptr += src_pixels_per_line;
+ d29u32 = vld1_lane_u32((const uint32_t *)src_ptr, d29u32, 1);
+ src_ptr += src_pixels_per_line;
+ d30u32 = vld1_lane_u32((const uint32_t *)src_ptr, d30u32, 0);
+ d28u8 = vreinterpret_u8_u32(d28u32);
+ d29u8 = vreinterpret_u8_u32(d29u32);
+ d30u8 = vreinterpret_u8_u32(d30u32);
+ } else {
+ d2u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d3u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d4u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d5u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d6u8 = vld1_u8(src_ptr);
+
+ q1u8 = vcombine_u8(d2u8, d3u8);
+ q2u8 = vcombine_u8(d4u8, d5u8);
+
+ d0u8 = vdup_n_u8((uint8_t)bifilter4_coeff[xoffset][0]);
+ d1u8 = vdup_n_u8((uint8_t)bifilter4_coeff[xoffset][1]);
+
+ q4u64 = vshrq_n_u64(vreinterpretq_u64_u8(q1u8), 8);
+ q5u64 = vshrq_n_u64(vreinterpretq_u64_u8(q2u8), 8);
+ d12u64 = vshr_n_u64(vreinterpret_u64_u8(d6u8), 8);
+
+ d0u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q1u8)),
+ vreinterpret_u32_u8(vget_high_u8(q1u8)));
+ d1u32x2 = vzip_u32(vreinterpret_u32_u8(vget_low_u8(q2u8)),
+ vreinterpret_u32_u8(vget_high_u8(q2u8)));
+ d2u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q4u64)),
+ vreinterpret_u32_u64(vget_high_u64(q4u64)));
+ d3u32x2 = vzip_u32(vreinterpret_u32_u64(vget_low_u64(q5u64)),
+ vreinterpret_u32_u64(vget_high_u64(q5u64)));
+
+ q7u16 = vmull_u8(vreinterpret_u8_u32(d0u32x2.val[0]), d0u8);
+ q8u16 = vmull_u8(vreinterpret_u8_u32(d1u32x2.val[0]), d0u8);
+ q9u16 = vmull_u8(d6u8, d0u8);
+
+ q7u16 = vmlal_u8(q7u16, vreinterpret_u8_u32(d2u32x2.val[0]), d1u8);
+ q8u16 = vmlal_u8(q8u16, vreinterpret_u8_u32(d3u32x2.val[0]), d1u8);
+ q9u16 = vmlal_u8(q9u16, vreinterpret_u8_u64(d12u64), d1u8);
+
+ d28u8 = vqrshrn_n_u16(q7u16, 7);
+ d29u8 = vqrshrn_n_u16(q8u16, 7);
+ d30u8 = vqrshrn_n_u16(q9u16, 7);
+ }
+
+ // secondpass_filter
+ if (yoffset == 0) { // skip_2ndpass_filter
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d28u8), 0);
+ dst_ptr += dst_pitch;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d28u8), 1);
+ dst_ptr += dst_pitch;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d29u8), 0);
+ dst_ptr += dst_pitch;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d29u8), 1);
+ } else {
+ d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]);
+
+ q1u16 = vmull_u8(d28u8, d0u8);
+ q2u16 = vmull_u8(d29u8, d0u8);
+
+ d26u8 = vext_u8(d28u8, d29u8, 4);
+ d27u8 = vext_u8(d29u8, d30u8, 4);
+
+ q1u16 = vmlal_u8(q1u16, d26u8, d1u8);
+ q2u16 = vmlal_u8(q2u16, d27u8, d1u8);
+
+ d2u8 = vqrshrn_n_u16(q1u16, 7);
+ d3u8 = vqrshrn_n_u16(q2u16, 7);
+
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 0);
+ dst_ptr += dst_pitch;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 1);
+ dst_ptr += dst_pitch;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 0);
+ dst_ptr += dst_pitch;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d3u8), 1);
+ }
+ return;
+}
+
+void vp8_bilinear_predict8x4_neon(
+ unsigned char *src_ptr,
+ int src_pixels_per_line,
+ int xoffset,
+ int yoffset,
+ unsigned char *dst_ptr,
+ int dst_pitch) {
+ uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8;
+ uint8x8_t d7u8, d9u8, d11u8, d22u8, d23u8, d24u8, d25u8, d26u8;
+ uint8x16_t q1u8, q2u8, q3u8, q4u8, q5u8;
+ uint16x8_t q1u16, q2u16, q3u16, q4u16;
+ uint16x8_t q6u16, q7u16, q8u16, q9u16, q10u16;
+
+ if (xoffset == 0) { // skip_1stpass_filter
+ d22u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d23u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d24u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d25u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d26u8 = vld1_u8(src_ptr);
+ } else {
+ q1u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q2u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q3u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q4u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q5u8 = vld1q_u8(src_ptr);
+
+ d0u8 = vdup_n_u8((uint8_t)bifilter4_coeff[xoffset][0]);
+ d1u8 = vdup_n_u8((uint8_t)bifilter4_coeff[xoffset][1]);
+
+ q6u16 = vmull_u8(vget_low_u8(q1u8), d0u8);
+ q7u16 = vmull_u8(vget_low_u8(q2u8), d0u8);
+ q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8);
+ q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8);
+ q10u16 = vmull_u8(vget_low_u8(q5u8), d0u8);
+
+ d3u8 = vext_u8(vget_low_u8(q1u8), vget_high_u8(q1u8), 1);
+ d5u8 = vext_u8(vget_low_u8(q2u8), vget_high_u8(q2u8), 1);
+ d7u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1);
+ d9u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1);
+ d11u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1);
+
+ q6u16 = vmlal_u8(q6u16, d3u8, d1u8);
+ q7u16 = vmlal_u8(q7u16, d5u8, d1u8);
+ q8u16 = vmlal_u8(q8u16, d7u8, d1u8);
+ q9u16 = vmlal_u8(q9u16, d9u8, d1u8);
+ q10u16 = vmlal_u8(q10u16, d11u8, d1u8);
+
+ d22u8 = vqrshrn_n_u16(q6u16, 7);
+ d23u8 = vqrshrn_n_u16(q7u16, 7);
+ d24u8 = vqrshrn_n_u16(q8u16, 7);
+ d25u8 = vqrshrn_n_u16(q9u16, 7);
+ d26u8 = vqrshrn_n_u16(q10u16, 7);
+ }
+
+ // secondpass_filter
+ if (yoffset == 0) { // skip_2ndpass_filter
+ vst1_u8((uint8_t *)dst_ptr, d22u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d23u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d24u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d25u8);
+ } else {
+ d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]);
+
+ q1u16 = vmull_u8(d22u8, d0u8);
+ q2u16 = vmull_u8(d23u8, d0u8);
+ q3u16 = vmull_u8(d24u8, d0u8);
+ q4u16 = vmull_u8(d25u8, d0u8);
+
+ q1u16 = vmlal_u8(q1u16, d23u8, d1u8);
+ q2u16 = vmlal_u8(q2u16, d24u8, d1u8);
+ q3u16 = vmlal_u8(q3u16, d25u8, d1u8);
+ q4u16 = vmlal_u8(q4u16, d26u8, d1u8);
+
+ d2u8 = vqrshrn_n_u16(q1u16, 7);
+ d3u8 = vqrshrn_n_u16(q2u16, 7);
+ d4u8 = vqrshrn_n_u16(q3u16, 7);
+ d5u8 = vqrshrn_n_u16(q4u16, 7);
+
+ vst1_u8((uint8_t *)dst_ptr, d2u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d3u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d4u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d5u8);
+ }
+ return;
+}
+
+void vp8_bilinear_predict8x8_neon(
+ unsigned char *src_ptr,
+ int src_pixels_per_line,
+ int xoffset,
+ int yoffset,
+ unsigned char *dst_ptr,
+ int dst_pitch) {
+ uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8, d11u8;
+ uint8x8_t d22u8, d23u8, d24u8, d25u8, d26u8, d27u8, d28u8, d29u8, d30u8;
+ uint8x16_t q1u8, q2u8, q3u8, q4u8, q5u8;
+ uint16x8_t q1u16, q2u16, q3u16, q4u16, q5u16;
+ uint16x8_t q6u16, q7u16, q8u16, q9u16, q10u16;
+
+ if (xoffset == 0) { // skip_1stpass_filter
+ d22u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d23u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d24u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d25u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d26u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d27u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d28u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d29u8 = vld1_u8(src_ptr); src_ptr += src_pixels_per_line;
+ d30u8 = vld1_u8(src_ptr);
+ } else {
+ q1u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q2u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q3u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q4u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+
+ d0u8 = vdup_n_u8((uint8_t)bifilter4_coeff[xoffset][0]);
+ d1u8 = vdup_n_u8((uint8_t)bifilter4_coeff[xoffset][1]);
+
+ q6u16 = vmull_u8(vget_low_u8(q1u8), d0u8);
+ q7u16 = vmull_u8(vget_low_u8(q2u8), d0u8);
+ q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8);
+ q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8);
+
+ d3u8 = vext_u8(vget_low_u8(q1u8), vget_high_u8(q1u8), 1);
+ d5u8 = vext_u8(vget_low_u8(q2u8), vget_high_u8(q2u8), 1);
+ d7u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1);
+ d9u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1);
+
+ q6u16 = vmlal_u8(q6u16, d3u8, d1u8);
+ q7u16 = vmlal_u8(q7u16, d5u8, d1u8);
+ q8u16 = vmlal_u8(q8u16, d7u8, d1u8);
+ q9u16 = vmlal_u8(q9u16, d9u8, d1u8);
+
+ d22u8 = vqrshrn_n_u16(q6u16, 7);
+ d23u8 = vqrshrn_n_u16(q7u16, 7);
+ d24u8 = vqrshrn_n_u16(q8u16, 7);
+ d25u8 = vqrshrn_n_u16(q9u16, 7);
+
+ // first_pass filtering on the rest 5-line data
+ q1u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q2u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q3u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q4u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q5u8 = vld1q_u8(src_ptr);
+
+ q6u16 = vmull_u8(vget_low_u8(q1u8), d0u8);
+ q7u16 = vmull_u8(vget_low_u8(q2u8), d0u8);
+ q8u16 = vmull_u8(vget_low_u8(q3u8), d0u8);
+ q9u16 = vmull_u8(vget_low_u8(q4u8), d0u8);
+ q10u16 = vmull_u8(vget_low_u8(q5u8), d0u8);
+
+ d3u8 = vext_u8(vget_low_u8(q1u8), vget_high_u8(q1u8), 1);
+ d5u8 = vext_u8(vget_low_u8(q2u8), vget_high_u8(q2u8), 1);
+ d7u8 = vext_u8(vget_low_u8(q3u8), vget_high_u8(q3u8), 1);
+ d9u8 = vext_u8(vget_low_u8(q4u8), vget_high_u8(q4u8), 1);
+ d11u8 = vext_u8(vget_low_u8(q5u8), vget_high_u8(q5u8), 1);
+
+ q6u16 = vmlal_u8(q6u16, d3u8, d1u8);
+ q7u16 = vmlal_u8(q7u16, d5u8, d1u8);
+ q8u16 = vmlal_u8(q8u16, d7u8, d1u8);
+ q9u16 = vmlal_u8(q9u16, d9u8, d1u8);
+ q10u16 = vmlal_u8(q10u16, d11u8, d1u8);
+
+ d26u8 = vqrshrn_n_u16(q6u16, 7);
+ d27u8 = vqrshrn_n_u16(q7u16, 7);
+ d28u8 = vqrshrn_n_u16(q8u16, 7);
+ d29u8 = vqrshrn_n_u16(q9u16, 7);
+ d30u8 = vqrshrn_n_u16(q10u16, 7);
+ }
+
+ // secondpass_filter
+ if (yoffset == 0) { // skip_2ndpass_filter
+ vst1_u8((uint8_t *)dst_ptr, d22u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d23u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d24u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d25u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d26u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d27u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d28u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d29u8);
+ } else {
+ d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]);
+
+ q1u16 = vmull_u8(d22u8, d0u8);
+ q2u16 = vmull_u8(d23u8, d0u8);
+ q3u16 = vmull_u8(d24u8, d0u8);
+ q4u16 = vmull_u8(d25u8, d0u8);
+ q5u16 = vmull_u8(d26u8, d0u8);
+ q6u16 = vmull_u8(d27u8, d0u8);
+ q7u16 = vmull_u8(d28u8, d0u8);
+ q8u16 = vmull_u8(d29u8, d0u8);
+
+ q1u16 = vmlal_u8(q1u16, d23u8, d1u8);
+ q2u16 = vmlal_u8(q2u16, d24u8, d1u8);
+ q3u16 = vmlal_u8(q3u16, d25u8, d1u8);
+ q4u16 = vmlal_u8(q4u16, d26u8, d1u8);
+ q5u16 = vmlal_u8(q5u16, d27u8, d1u8);
+ q6u16 = vmlal_u8(q6u16, d28u8, d1u8);
+ q7u16 = vmlal_u8(q7u16, d29u8, d1u8);
+ q8u16 = vmlal_u8(q8u16, d30u8, d1u8);
+
+ d2u8 = vqrshrn_n_u16(q1u16, 7);
+ d3u8 = vqrshrn_n_u16(q2u16, 7);
+ d4u8 = vqrshrn_n_u16(q3u16, 7);
+ d5u8 = vqrshrn_n_u16(q4u16, 7);
+ d6u8 = vqrshrn_n_u16(q5u16, 7);
+ d7u8 = vqrshrn_n_u16(q6u16, 7);
+ d8u8 = vqrshrn_n_u16(q7u16, 7);
+ d9u8 = vqrshrn_n_u16(q8u16, 7);
+
+ vst1_u8((uint8_t *)dst_ptr, d2u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d3u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d4u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d5u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d6u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d7u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d8u8); dst_ptr += dst_pitch;
+ vst1_u8((uint8_t *)dst_ptr, d9u8);
+ }
+ return;
+}
+
+void vp8_bilinear_predict16x16_neon(
+ unsigned char *src_ptr,
+ int src_pixels_per_line,
+ int xoffset,
+ int yoffset,
+ unsigned char *dst_ptr,
+ int dst_pitch) {
+ int i;
+ unsigned char tmp[272];
+ unsigned char *tmpp;
+ uint8x8_t d0u8, d1u8, d2u8, d3u8, d4u8, d5u8, d6u8, d7u8, d8u8, d9u8;
+ uint8x8_t d10u8, d11u8, d12u8, d13u8, d14u8, d15u8, d16u8, d17u8, d18u8;
+ uint8x8_t d19u8, d20u8, d21u8;
+ uint8x16_t q1u8, q2u8, q3u8, q4u8, q5u8, q6u8, q7u8, q8u8, q9u8, q10u8;
+ uint8x16_t q11u8, q12u8, q13u8, q14u8, q15u8;
+ uint16x8_t q1u16, q2u16, q3u16, q4u16, q5u16, q6u16, q7u16, q8u16;
+ uint16x8_t q9u16, q10u16, q11u16, q12u16, q13u16, q14u16;
+
+ if (xoffset == 0) { // secondpass_bfilter16x16_only
+ d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]);
+
+ q11u8 = vld1q_u8(src_ptr);
+ src_ptr += src_pixels_per_line;
+ for (i = 4; i > 0; i--) {
+ q12u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q13u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q14u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+ q15u8 = vld1q_u8(src_ptr); src_ptr += src_pixels_per_line;
+
+ q1u16 = vmull_u8(vget_low_u8(q11u8), d0u8);
+ q2u16 = vmull_u8(vget_high_u8(q11u8), d0u8);
+ q3u16 = vmull_u8(vget_low_u8(q12u8), d0u8);
+ q4u16 = vmull_u8(vget_high_u8(q12u8), d0u8);
+ q5u16 = vmull_u8(vget_low_u8(q13u8), d0u8);
+ q6u16 = vmull_u8(vget_high_u8(q13u8), d0u8);
+ q7u16 = vmull_u8(vget_low_u8(q14u8), d0u8);
+ q8u16 = vmull_u8(vget_high_u8(q14u8), d0u8);
+
+ q1u16 = vmlal_u8(q1u16, vget_low_u8(q12u8), d1u8);
+ q2u16 = vmlal_u8(q2u16, vget_high_u8(q12u8), d1u8);
+ q3u16 = vmlal_u8(q3u16, vget_low_u8(q13u8), d1u8);
+ q4u16 = vmlal_u8(q4u16, vget_high_u8(q13u8), d1u8);
+ q5u16 = vmlal_u8(q5u16, vget_low_u8(q14u8), d1u8);
+ q6u16 = vmlal_u8(q6u16, vget_high_u8(q14u8), d1u8);
+ q7u16 = vmlal_u8(q7u16, vget_low_u8(q15u8), d1u8);
+ q8u16 = vmlal_u8(q8u16, vget_high_u8(q15u8), d1u8);
+
+ d2u8 = vqrshrn_n_u16(q1u16, 7);
+ d3u8 = vqrshrn_n_u16(q2u16, 7);
+ d4u8 = vqrshrn_n_u16(q3u16, 7);
+ d5u8 = vqrshrn_n_u16(q4u16, 7);
+ d6u8 = vqrshrn_n_u16(q5u16, 7);
+ d7u8 = vqrshrn_n_u16(q6u16, 7);
+ d8u8 = vqrshrn_n_u16(q7u16, 7);
+ d9u8 = vqrshrn_n_u16(q8u16, 7);
+
+ q1u8 = vcombine_u8(d2u8, d3u8);
+ q2u8 = vcombine_u8(d4u8, d5u8);
+ q3u8 = vcombine_u8(d6u8, d7u8);
+ q4u8 = vcombine_u8(d8u8, d9u8);
+
+ q11u8 = q15u8;
+
+ vst1q_u8((uint8_t *)dst_ptr, q1u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q2u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q3u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q4u8); dst_ptr += dst_pitch;
+ }
+ return;
+ }
+
+ if (yoffset == 0) { // firstpass_bfilter16x16_only
+ d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]);
+
+ for (i = 4; i > 0 ; i--) {
+ d2u8 = vld1_u8(src_ptr);
+ d3u8 = vld1_u8(src_ptr + 8);
+ d4u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d5u8 = vld1_u8(src_ptr);
+ d6u8 = vld1_u8(src_ptr + 8);
+ d7u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d8u8 = vld1_u8(src_ptr);
+ d9u8 = vld1_u8(src_ptr + 8);
+ d10u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d11u8 = vld1_u8(src_ptr);
+ d12u8 = vld1_u8(src_ptr + 8);
+ d13u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+
+ q7u16 = vmull_u8(d2u8, d0u8);
+ q8u16 = vmull_u8(d3u8, d0u8);
+ q9u16 = vmull_u8(d5u8, d0u8);
+ q10u16 = vmull_u8(d6u8, d0u8);
+ q11u16 = vmull_u8(d8u8, d0u8);
+ q12u16 = vmull_u8(d9u8, d0u8);
+ q13u16 = vmull_u8(d11u8, d0u8);
+ q14u16 = vmull_u8(d12u8, d0u8);
+
+ d2u8 = vext_u8(d2u8, d3u8, 1);
+ d5u8 = vext_u8(d5u8, d6u8, 1);
+ d8u8 = vext_u8(d8u8, d9u8, 1);
+ d11u8 = vext_u8(d11u8, d12u8, 1);
+
+ q7u16 = vmlal_u8(q7u16, d2u8, d1u8);
+ q9u16 = vmlal_u8(q9u16, d5u8, d1u8);
+ q11u16 = vmlal_u8(q11u16, d8u8, d1u8);
+ q13u16 = vmlal_u8(q13u16, d11u8, d1u8);
+
+ d3u8 = vext_u8(d3u8, d4u8, 1);
+ d6u8 = vext_u8(d6u8, d7u8, 1);
+ d9u8 = vext_u8(d9u8, d10u8, 1);
+ d12u8 = vext_u8(d12u8, d13u8, 1);
+
+ q8u16 = vmlal_u8(q8u16, d3u8, d1u8);
+ q10u16 = vmlal_u8(q10u16, d6u8, d1u8);
+ q12u16 = vmlal_u8(q12u16, d9u8, d1u8);
+ q14u16 = vmlal_u8(q14u16, d12u8, d1u8);
+
+ d14u8 = vqrshrn_n_u16(q7u16, 7);
+ d15u8 = vqrshrn_n_u16(q8u16, 7);
+ d16u8 = vqrshrn_n_u16(q9u16, 7);
+ d17u8 = vqrshrn_n_u16(q10u16, 7);
+ d18u8 = vqrshrn_n_u16(q11u16, 7);
+ d19u8 = vqrshrn_n_u16(q12u16, 7);
+ d20u8 = vqrshrn_n_u16(q13u16, 7);
+ d21u8 = vqrshrn_n_u16(q14u16, 7);
+
+ q7u8 = vcombine_u8(d14u8, d15u8);
+ q8u8 = vcombine_u8(d16u8, d17u8);
+ q9u8 = vcombine_u8(d18u8, d19u8);
+ q10u8 =vcombine_u8(d20u8, d21u8);
+
+ vst1q_u8((uint8_t *)dst_ptr, q7u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q8u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q9u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q10u8); dst_ptr += dst_pitch;
+ }
+ return;
+ }
+
+ d0u8 = vdup_n_u8(bifilter4_coeff[xoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[xoffset][1]);
+
+ d2u8 = vld1_u8(src_ptr);
+ d3u8 = vld1_u8(src_ptr + 8);
+ d4u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d5u8 = vld1_u8(src_ptr);
+ d6u8 = vld1_u8(src_ptr + 8);
+ d7u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d8u8 = vld1_u8(src_ptr);
+ d9u8 = vld1_u8(src_ptr + 8);
+ d10u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d11u8 = vld1_u8(src_ptr);
+ d12u8 = vld1_u8(src_ptr + 8);
+ d13u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+
+ // First Pass: output_height lines x output_width columns (17x16)
+ tmpp = tmp;
+ for (i = 3; i > 0; i--) {
+ q7u16 = vmull_u8(d2u8, d0u8);
+ q8u16 = vmull_u8(d3u8, d0u8);
+ q9u16 = vmull_u8(d5u8, d0u8);
+ q10u16 = vmull_u8(d6u8, d0u8);
+ q11u16 = vmull_u8(d8u8, d0u8);
+ q12u16 = vmull_u8(d9u8, d0u8);
+ q13u16 = vmull_u8(d11u8, d0u8);
+ q14u16 = vmull_u8(d12u8, d0u8);
+
+ d2u8 = vext_u8(d2u8, d3u8, 1);
+ d5u8 = vext_u8(d5u8, d6u8, 1);
+ d8u8 = vext_u8(d8u8, d9u8, 1);
+ d11u8 = vext_u8(d11u8, d12u8, 1);
+
+ q7u16 = vmlal_u8(q7u16, d2u8, d1u8);
+ q9u16 = vmlal_u8(q9u16, d5u8, d1u8);
+ q11u16 = vmlal_u8(q11u16, d8u8, d1u8);
+ q13u16 = vmlal_u8(q13u16, d11u8, d1u8);
+
+ d3u8 = vext_u8(d3u8, d4u8, 1);
+ d6u8 = vext_u8(d6u8, d7u8, 1);
+ d9u8 = vext_u8(d9u8, d10u8, 1);
+ d12u8 = vext_u8(d12u8, d13u8, 1);
+
+ q8u16 = vmlal_u8(q8u16, d3u8, d1u8);
+ q10u16 = vmlal_u8(q10u16, d6u8, d1u8);
+ q12u16 = vmlal_u8(q12u16, d9u8, d1u8);
+ q14u16 = vmlal_u8(q14u16, d12u8, d1u8);
+
+ d14u8 = vqrshrn_n_u16(q7u16, 7);
+ d15u8 = vqrshrn_n_u16(q8u16, 7);
+ d16u8 = vqrshrn_n_u16(q9u16, 7);
+ d17u8 = vqrshrn_n_u16(q10u16, 7);
+ d18u8 = vqrshrn_n_u16(q11u16, 7);
+ d19u8 = vqrshrn_n_u16(q12u16, 7);
+ d20u8 = vqrshrn_n_u16(q13u16, 7);
+ d21u8 = vqrshrn_n_u16(q14u16, 7);
+
+ d2u8 = vld1_u8(src_ptr);
+ d3u8 = vld1_u8(src_ptr + 8);
+ d4u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d5u8 = vld1_u8(src_ptr);
+ d6u8 = vld1_u8(src_ptr + 8);
+ d7u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d8u8 = vld1_u8(src_ptr);
+ d9u8 = vld1_u8(src_ptr + 8);
+ d10u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+ d11u8 = vld1_u8(src_ptr);
+ d12u8 = vld1_u8(src_ptr + 8);
+ d13u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+
+ q7u8 = vcombine_u8(d14u8, d15u8);
+ q8u8 = vcombine_u8(d16u8, d17u8);
+ q9u8 = vcombine_u8(d18u8, d19u8);
+ q10u8 = vcombine_u8(d20u8, d21u8);
+
+ vst1q_u8((uint8_t *)tmpp, q7u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q8u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q9u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q10u8); tmpp += 16;
+ }
+
+ // First-pass filtering for rest 5 lines
+ d14u8 = vld1_u8(src_ptr);
+ d15u8 = vld1_u8(src_ptr + 8);
+ d16u8 = vld1_u8(src_ptr + 16); src_ptr += src_pixels_per_line;
+
+ q9u16 = vmull_u8(d2u8, d0u8);
+ q10u16 = vmull_u8(d3u8, d0u8);
+ q11u16 = vmull_u8(d5u8, d0u8);
+ q12u16 = vmull_u8(d6u8, d0u8);
+ q13u16 = vmull_u8(d8u8, d0u8);
+ q14u16 = vmull_u8(d9u8, d0u8);
+
+ d2u8 = vext_u8(d2u8, d3u8, 1);
+ d5u8 = vext_u8(d5u8, d6u8, 1);
+ d8u8 = vext_u8(d8u8, d9u8, 1);
+
+ q9u16 = vmlal_u8(q9u16, d2u8, d1u8);
+ q11u16 = vmlal_u8(q11u16, d5u8, d1u8);
+ q13u16 = vmlal_u8(q13u16, d8u8, d1u8);
+
+ d3u8 = vext_u8(d3u8, d4u8, 1);
+ d6u8 = vext_u8(d6u8, d7u8, 1);
+ d9u8 = vext_u8(d9u8, d10u8, 1);
+
+ q10u16 = vmlal_u8(q10u16, d3u8, d1u8);
+ q12u16 = vmlal_u8(q12u16, d6u8, d1u8);
+ q14u16 = vmlal_u8(q14u16, d9u8, d1u8);
+
+ q1u16 = vmull_u8(d11u8, d0u8);
+ q2u16 = vmull_u8(d12u8, d0u8);
+ q3u16 = vmull_u8(d14u8, d0u8);
+ q4u16 = vmull_u8(d15u8, d0u8);
+
+ d11u8 = vext_u8(d11u8, d12u8, 1);
+ d14u8 = vext_u8(d14u8, d15u8, 1);
+
+ q1u16 = vmlal_u8(q1u16, d11u8, d1u8);
+ q3u16 = vmlal_u8(q3u16, d14u8, d1u8);
+
+ d12u8 = vext_u8(d12u8, d13u8, 1);
+ d15u8 = vext_u8(d15u8, d16u8, 1);
+
+ q2u16 = vmlal_u8(q2u16, d12u8, d1u8);
+ q4u16 = vmlal_u8(q4u16, d15u8, d1u8);
+
+ d10u8 = vqrshrn_n_u16(q9u16, 7);
+ d11u8 = vqrshrn_n_u16(q10u16, 7);
+ d12u8 = vqrshrn_n_u16(q11u16, 7);
+ d13u8 = vqrshrn_n_u16(q12u16, 7);
+ d14u8 = vqrshrn_n_u16(q13u16, 7);
+ d15u8 = vqrshrn_n_u16(q14u16, 7);
+ d16u8 = vqrshrn_n_u16(q1u16, 7);
+ d17u8 = vqrshrn_n_u16(q2u16, 7);
+ d18u8 = vqrshrn_n_u16(q3u16, 7);
+ d19u8 = vqrshrn_n_u16(q4u16, 7);
+
+ q5u8 = vcombine_u8(d10u8, d11u8);
+ q6u8 = vcombine_u8(d12u8, d13u8);
+ q7u8 = vcombine_u8(d14u8, d15u8);
+ q8u8 = vcombine_u8(d16u8, d17u8);
+ q9u8 = vcombine_u8(d18u8, d19u8);
+
+ vst1q_u8((uint8_t *)tmpp, q5u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q6u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q7u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q8u8); tmpp += 16;
+ vst1q_u8((uint8_t *)tmpp, q9u8);
+
+ // secondpass_filter
+ d0u8 = vdup_n_u8(bifilter4_coeff[yoffset][0]);
+ d1u8 = vdup_n_u8(bifilter4_coeff[yoffset][1]);
+
+ tmpp = tmp;
+ q11u8 = vld1q_u8(tmpp);
+ tmpp += 16;
+ for (i = 4; i > 0; i--) {
+ q12u8 = vld1q_u8(tmpp); tmpp += 16;
+ q13u8 = vld1q_u8(tmpp); tmpp += 16;
+ q14u8 = vld1q_u8(tmpp); tmpp += 16;
+ q15u8 = vld1q_u8(tmpp); tmpp += 16;
+
+ q1u16 = vmull_u8(vget_low_u8(q11u8), d0u8);
+ q2u16 = vmull_u8(vget_high_u8(q11u8), d0u8);
+ q3u16 = vmull_u8(vget_low_u8(q12u8), d0u8);
+ q4u16 = vmull_u8(vget_high_u8(q12u8), d0u8);
+ q5u16 = vmull_u8(vget_low_u8(q13u8), d0u8);
+ q6u16 = vmull_u8(vget_high_u8(q13u8), d0u8);
+ q7u16 = vmull_u8(vget_low_u8(q14u8), d0u8);
+ q8u16 = vmull_u8(vget_high_u8(q14u8), d0u8);
+
+ q1u16 = vmlal_u8(q1u16, vget_low_u8(q12u8), d1u8);
+ q2u16 = vmlal_u8(q2u16, vget_high_u8(q12u8), d1u8);
+ q3u16 = vmlal_u8(q3u16, vget_low_u8(q13u8), d1u8);
+ q4u16 = vmlal_u8(q4u16, vget_high_u8(q13u8), d1u8);
+ q5u16 = vmlal_u8(q5u16, vget_low_u8(q14u8), d1u8);
+ q6u16 = vmlal_u8(q6u16, vget_high_u8(q14u8), d1u8);
+ q7u16 = vmlal_u8(q7u16, vget_low_u8(q15u8), d1u8);
+ q8u16 = vmlal_u8(q8u16, vget_high_u8(q15u8), d1u8);
+
+ d2u8 = vqrshrn_n_u16(q1u16, 7);
+ d3u8 = vqrshrn_n_u16(q2u16, 7);
+ d4u8 = vqrshrn_n_u16(q3u16, 7);
+ d5u8 = vqrshrn_n_u16(q4u16, 7);
+ d6u8 = vqrshrn_n_u16(q5u16, 7);
+ d7u8 = vqrshrn_n_u16(q6u16, 7);
+ d8u8 = vqrshrn_n_u16(q7u16, 7);
+ d9u8 = vqrshrn_n_u16(q8u16, 7);
+
+ q1u8 = vcombine_u8(d2u8, d3u8);
+ q2u8 = vcombine_u8(d4u8, d5u8);
+ q3u8 = vcombine_u8(d6u8, d7u8);
+ q4u8 = vcombine_u8(d8u8, d9u8);
+
+ q11u8 = q15u8;
+
+ vst1q_u8((uint8_t *)dst_ptr, q1u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q2u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q3u8); dst_ptr += dst_pitch;
+ vst1q_u8((uint8_t *)dst_ptr, q4u8); dst_ptr += dst_pitch;
+ }
+ return;
+}
diff --git a/libvpx/vp8/common/arm/neon/copymem16x16_neon.asm b/libvpx/vp8/common/arm/neon/copymem16x16_neon.asm
deleted file mode 100644
index bda4b96..0000000
--- a/libvpx/vp8/common/arm/neon/copymem16x16_neon.asm
+++ /dev/null
@@ -1,59 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_copy_mem16x16_neon|
- ; ARM
- ; REQUIRE8
- ; PRESERVE8
-
- AREA Block, CODE, READONLY ; name this block of code
-;void copy_mem16x16_neon( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride)
-;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-|vp8_copy_mem16x16_neon| PROC
-
- vld1.u8 {q0}, [r0], r1
- vld1.u8 {q1}, [r0], r1
- vld1.u8 {q2}, [r0], r1
- vst1.u8 {q0}, [r2], r3
- vld1.u8 {q3}, [r0], r1
- vst1.u8 {q1}, [r2], r3
- vld1.u8 {q4}, [r0], r1
- vst1.u8 {q2}, [r2], r3
- vld1.u8 {q5}, [r0], r1
- vst1.u8 {q3}, [r2], r3
- vld1.u8 {q6}, [r0], r1
- vst1.u8 {q4}, [r2], r3
- vld1.u8 {q7}, [r0], r1
- vst1.u8 {q5}, [r2], r3
- vld1.u8 {q8}, [r0], r1
- vst1.u8 {q6}, [r2], r3
- vld1.u8 {q9}, [r0], r1
- vst1.u8 {q7}, [r2], r3
- vld1.u8 {q10}, [r0], r1
- vst1.u8 {q8}, [r2], r3
- vld1.u8 {q11}, [r0], r1
- vst1.u8 {q9}, [r2], r3
- vld1.u8 {q12}, [r0], r1
- vst1.u8 {q10}, [r2], r3
- vld1.u8 {q13}, [r0], r1
- vst1.u8 {q11}, [r2], r3
- vld1.u8 {q14}, [r0], r1
- vst1.u8 {q12}, [r2], r3
- vld1.u8 {q15}, [r0], r1
- vst1.u8 {q13}, [r2], r3
- vst1.u8 {q14}, [r2], r3
- vst1.u8 {q15}, [r2], r3
-
- mov pc, lr
-
- ENDP ; |vp8_copy_mem16x16_neon|
-
- END
diff --git a/libvpx/vp8/common/arm/neon/copymem8x4_neon.asm b/libvpx/vp8/common/arm/neon/copymem8x4_neon.asm
deleted file mode 100644
index 35c0f67..0000000
--- a/libvpx/vp8/common/arm/neon/copymem8x4_neon.asm
+++ /dev/null
@@ -1,34 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_copy_mem8x4_neon|
- ; ARM
- ; REQUIRE8
- ; PRESERVE8
-
- AREA Block, CODE, READONLY ; name this block of code
-;void copy_mem8x4_neon( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride)
-;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-|vp8_copy_mem8x4_neon| PROC
- vld1.u8 {d0}, [r0], r1
- vld1.u8 {d1}, [r0], r1
- vst1.u8 {d0}, [r2], r3
- vld1.u8 {d2}, [r0], r1
- vst1.u8 {d1}, [r2], r3
- vld1.u8 {d3}, [r0], r1
- vst1.u8 {d2}, [r2], r3
- vst1.u8 {d3}, [r2], r3
-
- mov pc, lr
-
- ENDP ; |vp8_copy_mem8x4_neon|
-
- END
diff --git a/libvpx/vp8/common/arm/neon/copymem8x8_neon.asm b/libvpx/vp8/common/arm/neon/copymem8x8_neon.asm
deleted file mode 100644
index 1f5b941..0000000
--- a/libvpx/vp8/common/arm/neon/copymem8x8_neon.asm
+++ /dev/null
@@ -1,43 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_copy_mem8x8_neon|
- ; ARM
- ; REQUIRE8
- ; PRESERVE8
-
- AREA Block, CODE, READONLY ; name this block of code
-;void copy_mem8x8_neon( unsigned char *src, int src_stride, unsigned char *dst, int dst_stride)
-;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-|vp8_copy_mem8x8_neon| PROC
-
- vld1.u8 {d0}, [r0], r1
- vld1.u8 {d1}, [r0], r1
- vst1.u8 {d0}, [r2], r3
- vld1.u8 {d2}, [r0], r1
- vst1.u8 {d1}, [r2], r3
- vld1.u8 {d3}, [r0], r1
- vst1.u8 {d2}, [r2], r3
- vld1.u8 {d4}, [r0], r1
- vst1.u8 {d3}, [r2], r3
- vld1.u8 {d5}, [r0], r1
- vst1.u8 {d4}, [r2], r3
- vld1.u8 {d6}, [r0], r1
- vst1.u8 {d5}, [r2], r3
- vld1.u8 {d7}, [r0], r1
- vst1.u8 {d6}, [r2], r3
- vst1.u8 {d7}, [r2], r3
-
- mov pc, lr
-
- ENDP ; |vp8_copy_mem8x8_neon|
-
- END
diff --git a/libvpx/vp8/common/arm/neon/copymem_neon.c b/libvpx/vp8/common/arm/neon/copymem_neon.c
new file mode 100644
index 0000000..deced11
--- /dev/null
+++ b/libvpx/vp8/common/arm/neon/copymem_neon.c
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <arm_neon.h>
+
+void vp8_copy_mem8x4_neon(
+ unsigned char *src,
+ int src_stride,
+ unsigned char *dst,
+ int dst_stride) {
+ uint8x8_t vtmp;
+ int r;
+
+ for (r = 0; r < 4; r++) {
+ vtmp = vld1_u8(src);
+ vst1_u8(dst, vtmp);
+ src += src_stride;
+ dst += dst_stride;
+ }
+}
+
+void vp8_copy_mem8x8_neon(
+ unsigned char *src,
+ int src_stride,
+ unsigned char *dst,
+ int dst_stride) {
+ uint8x8_t vtmp;
+ int r;
+
+ for (r = 0; r < 8; r++) {
+ vtmp = vld1_u8(src);
+ vst1_u8(dst, vtmp);
+ src += src_stride;
+ dst += dst_stride;
+ }
+}
+
+void vp8_copy_mem16x16_neon(
+ unsigned char *src,
+ int src_stride,
+ unsigned char *dst,
+ int dst_stride) {
+ int r;
+ uint8x16_t qtmp;
+
+ for (r = 0; r < 16; r++) {
+ qtmp = vld1q_u8(src);
+ vst1q_u8(dst, qtmp);
+ src += src_stride;
+ dst += dst_stride;
+ }
+}
diff --git a/libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.asm b/libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.asm
deleted file mode 100644
index 79ff02c..0000000
--- a/libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.asm
+++ /dev/null
@@ -1,54 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license and patent
-; grant that can be found in the LICENSE file in the root of the source
-; tree. All contributing project authors may be found in the AUTHORS
-; file in the root of the source tree.
-;
-
-
- EXPORT |vp8_dc_only_idct_add_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-
-;void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr,
-; int pred_stride, unsigned char *dst_ptr,
-; int dst_stride)
-
-; r0 input_dc
-; r1 pred_ptr
-; r2 pred_stride
-; r3 dst_ptr
-; sp dst_stride
-
-|vp8_dc_only_idct_add_neon| PROC
- add r0, r0, #4
- asr r0, r0, #3
- ldr r12, [sp]
- vdup.16 q0, r0
-
- vld1.32 {d2[0]}, [r1], r2
- vld1.32 {d2[1]}, [r1], r2
- vld1.32 {d4[0]}, [r1], r2
- vld1.32 {d4[1]}, [r1]
-
- vaddw.u8 q1, q0, d2
- vaddw.u8 q2, q0, d4
-
- vqmovun.s16 d2, q1
- vqmovun.s16 d4, q2
-
- vst1.32 {d2[0]}, [r3], r12
- vst1.32 {d2[1]}, [r3], r12
- vst1.32 {d4[0]}, [r3], r12
- vst1.32 {d4[1]}, [r3]
-
- bx lr
-
- ENDP
-
- END
diff --git a/libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.c b/libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.c
new file mode 100644
index 0000000..ad5f41d
--- /dev/null
+++ b/libvpx/vp8/common/arm/neon/dc_only_idct_add_neon.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <arm_neon.h>
+
+void vp8_dc_only_idct_add_neon(
+ int16_t input_dc,
+ unsigned char *pred_ptr,
+ int pred_stride,
+ unsigned char *dst_ptr,
+ int dst_stride) {
+ int i;
+ uint16_t a1 = ((input_dc + 4) >> 3);
+ uint32x2_t d2u32 = vdup_n_u32(0);
+ uint8x8_t d2u8;
+ uint16x8_t q1u16;
+ uint16x8_t qAdd;
+
+ qAdd = vdupq_n_u16(a1);
+
+ for (i = 0; i < 2; i++) {
+ d2u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d2u32, 0);
+ pred_ptr += pred_stride;
+ d2u32 = vld1_lane_u32((const uint32_t *)pred_ptr, d2u32, 1);
+ pred_ptr += pred_stride;
+
+ q1u16 = vaddw_u8(qAdd, vreinterpret_u8_u32(d2u32));
+ d2u8 = vqmovun_s16(vreinterpretq_s16_u16(q1u16));
+
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 0);
+ dst_ptr += dst_stride;
+ vst1_lane_u32((uint32_t *)dst_ptr, vreinterpret_u32_u8(d2u8), 1);
+ dst_ptr += dst_stride;
+ }
+}
diff --git a/libvpx/vp8/common/arm/neon/dequant_idct_neon.asm b/libvpx/vp8/common/arm/neon/dequant_idct_neon.asm
deleted file mode 100644
index 602cce6..0000000
--- a/libvpx/vp8/common/arm/neon/dequant_idct_neon.asm
+++ /dev/null
@@ -1,131 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_dequant_idct_add_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-;void vp8_dequant_idct_add_neon(short *input, short *dq,
-; unsigned char *dest, int stride)
-; r0 short *input,
-; r1 short *dq,
-; r2 unsigned char *dest
-; r3 int stride
-
-|vp8_dequant_idct_add_neon| PROC
- vld1.16 {q3, q4}, [r0]
- vld1.16 {q5, q6}, [r1]
-
- add r1, r2, r3 ; r1 = dest + stride
- lsl r3, #1 ; 2x stride
-
- vld1.32 {d14[0]}, [r2], r3
- vld1.32 {d14[1]}, [r1], r3
- vld1.32 {d15[0]}, [r2]
- vld1.32 {d15[1]}, [r1]
-
- adr r12, cospi8sqrt2minus1 ; pointer to the first constant
-
- vmul.i16 q1, q3, q5 ;input for short_idct4x4llm_neon
- vmul.i16 q2, q4, q6
-
-;|short_idct4x4llm_neon| PROC
- vld1.16 {d0}, [r12]
- vswp d3, d4 ;q2(vp[4] vp[12])
-
- vqdmulh.s16 q3, q2, d0[2]
- vqdmulh.s16 q4, q2, d0[0]
-
- vqadd.s16 d12, d2, d3 ;a1
- vqsub.s16 d13, d2, d3 ;b1
-
- vshr.s16 q3, q3, #1
- vshr.s16 q4, q4, #1
-
- vqadd.s16 q3, q3, q2
- vqadd.s16 q4, q4, q2
-
- vqsub.s16 d10, d6, d9 ;c1
- vqadd.s16 d11, d7, d8 ;d1
-
- vqadd.s16 d2, d12, d11
- vqadd.s16 d3, d13, d10
- vqsub.s16 d4, d13, d10
- vqsub.s16 d5, d12, d11
-
- vtrn.32 d2, d4
- vtrn.32 d3, d5
- vtrn.16 d2, d3
- vtrn.16 d4, d5
-
-; memset(input, 0, 32) -- 32bytes
- vmov.i16 q14, #0
-
- vswp d3, d4
- vqdmulh.s16 q3, q2, d0[2]
- vqdmulh.s16 q4, q2, d0[0]
-
- vqadd.s16 d12, d2, d3 ;a1
- vqsub.s16 d13, d2, d3 ;b1
-
- vmov q15, q14
-
- vshr.s16 q3, q3, #1
- vshr.s16 q4, q4, #1
-
- vqadd.s16 q3, q3, q2
- vqadd.s16 q4, q4, q2
-
- vqsub.s16 d10, d6, d9 ;c1
- vqadd.s16 d11, d7, d8 ;d1
-
- vqadd.s16 d2, d12, d11
- vqadd.s16 d3, d13, d10
- vqsub.s16 d4, d13, d10
- vqsub.s16 d5, d12, d11
-
- vst1.16 {q14, q15}, [r0]
-
- vrshr.s16 d2, d2, #3
- vrshr.s16 d3, d3, #3
- vrshr.s16 d4, d4, #3
- vrshr.s16 d5, d5, #3
-
- vtrn.32 d2, d4
- vtrn.32 d3, d5
- vtrn.16 d2, d3
- vtrn.16 d4, d5
-
- vaddw.u8 q1, q1, d14
- vaddw.u8 q2, q2, d15
-
- sub r2, r2, r3
- sub r1, r1, r3
-
- vqmovun.s16 d0, q1
- vqmovun.s16 d1, q2
-
- vst1.32 {d0[0]}, [r2], r3
- vst1.32 {d0[1]}, [r1], r3
- vst1.32 {d1[0]}, [r2]
- vst1.32 {d1[1]}, [r1]
-
- bx lr
-
- ENDP ; |vp8_dequant_idct_add_neon|
-
-; Constant Pool
-cospi8sqrt2minus1 DCD 0x4e7b4e7b
-sinpi8sqrt2 DCD 0x8a8c8a8c
-
- END
diff --git a/libvpx/vp8/common/arm/neon/dequant_idct_neon.c b/libvpx/vp8/common/arm/neon/dequant_idct_neon.c
new file mode 100644
index 0000000..58e1192
--- /dev/null
+++ b/libvpx/vp8/common/arm/neon/dequant_idct_neon.c
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <arm_neon.h>
+
+static const int16_t cospi8sqrt2minus1 = 20091;
+static const int16_t sinpi8sqrt2 = 35468;
+
+void vp8_dequant_idct_add_neon(
+ int16_t *input,
+ int16_t *dq,
+ unsigned char *dst,
+ int stride) {
+ unsigned char *dst0;
+ int32x2_t d14, d15;
+ int16x4_t d2, d3, d4, d5, d10, d11, d12, d13;
+ int16x8_t q1, q2, q3, q4, q5, q6;
+ int16x8_t qEmpty = vdupq_n_s16(0);
+ int32x2x2_t d2tmp0, d2tmp1;
+ int16x4x2_t d2tmp2, d2tmp3;
+
+ d14 = d15 = vdup_n_s32(0);
+
+ // load input
+ q3 = vld1q_s16(input);
+ vst1q_s16(input, qEmpty);
+ input += 8;
+ q4 = vld1q_s16(input);
+ vst1q_s16(input, qEmpty);
+
+ // load dq
+ q5 = vld1q_s16(dq);
+ dq += 8;
+ q6 = vld1q_s16(dq);
+
+ // load src from dst
+ dst0 = dst;
+ d14 = vld1_lane_s32((const int32_t *)dst0, d14, 0);
+ dst0 += stride;
+ d14 = vld1_lane_s32((const int32_t *)dst0, d14, 1);
+ dst0 += stride;
+ d15 = vld1_lane_s32((const int32_t *)dst0, d15, 0);
+ dst0 += stride;
+ d15 = vld1_lane_s32((const int32_t *)dst0, d15, 1);
+
+ q1 = vreinterpretq_s16_u16(vmulq_u16(vreinterpretq_u16_s16(q3),
+ vreinterpretq_u16_s16(q5)));
+ q2 = vreinterpretq_s16_u16(vmulq_u16(vreinterpretq_u16_s16(q4),
+ vreinterpretq_u16_s16(q6)));
+
+ d12 = vqadd_s16(vget_low_s16(q1), vget_low_s16(q2));
+ d13 = vqsub_s16(vget_low_s16(q1), vget_low_s16(q2));
+
+ q2 = vcombine_s16(vget_high_s16(q1), vget_high_s16(q2));
+
+ q3 = vqdmulhq_n_s16(q2, sinpi8sqrt2);
+ q4 = vqdmulhq_n_s16(q2, cospi8sqrt2minus1);
+
+ q3 = vshrq_n_s16(q3, 1);
+ q4 = vshrq_n_s16(q4, 1);
+
+ q3 = vqaddq_s16(q3, q2);
+ q4 = vqaddq_s16(q4, q2);
+
+ d10 = vqsub_s16(vget_low_s16(q3), vget_high_s16(q4));
+ d11 = vqadd_s16(vget_high_s16(q3), vget_low_s16(q4));
+
+ d2 = vqadd_s16(d12, d11);
+ d3 = vqadd_s16(d13, d10);
+ d4 = vqsub_s16(d13, d10);
+ d5 = vqsub_s16(d12, d11);
+
+ d2tmp0 = vtrn_s32(vreinterpret_s32_s16(d2), vreinterpret_s32_s16(d4));
+ d2tmp1 = vtrn_s32(vreinterpret_s32_s16(d3), vreinterpret_s32_s16(d5));
+ d2tmp2 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[0]),
+ vreinterpret_s16_s32(d2tmp1.val[0]));
+ d2tmp3 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[1]),
+ vreinterpret_s16_s32(d2tmp1.val[1]));
+
+ // loop 2
+ q2 = vcombine_s16(d2tmp2.val[1], d2tmp3.val[1]);
+
+ q3 = vqdmulhq_n_s16(q2, sinpi8sqrt2);
+ q4 = vqdmulhq_n_s16(q2, cospi8sqrt2minus1);
+
+ d12 = vqadd_s16(d2tmp2.val[0], d2tmp3.val[0]);
+ d13 = vqsub_s16(d2tmp2.val[0], d2tmp3.val[0]);
+
+ q3 = vshrq_n_s16(q3, 1);
+ q4 = vshrq_n_s16(q4, 1);
+
+ q3 = vqaddq_s16(q3, q2);
+ q4 = vqaddq_s16(q4, q2);
+
+ d10 = vqsub_s16(vget_low_s16(q3), vget_high_s16(q4));
+ d11 = vqadd_s16(vget_high_s16(q3), vget_low_s16(q4));
+
+ d2 = vqadd_s16(d12, d11);
+ d3 = vqadd_s16(d13, d10);
+ d4 = vqsub_s16(d13, d10);
+ d5 = vqsub_s16(d12, d11);
+
+ d2 = vrshr_n_s16(d2, 3);
+ d3 = vrshr_n_s16(d3, 3);
+ d4 = vrshr_n_s16(d4, 3);
+ d5 = vrshr_n_s16(d5, 3);
+
+ d2tmp0 = vtrn_s32(vreinterpret_s32_s16(d2), vreinterpret_s32_s16(d4));
+ d2tmp1 = vtrn_s32(vreinterpret_s32_s16(d3), vreinterpret_s32_s16(d5));
+ d2tmp2 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[0]),
+ vreinterpret_s16_s32(d2tmp1.val[0]));
+ d2tmp3 = vtrn_s16(vreinterpret_s16_s32(d2tmp0.val[1]),
+ vreinterpret_s16_s32(d2tmp1.val[1]));
+
+ q1 = vcombine_s16(d2tmp2.val[0], d2tmp2.val[1]);
+ q2 = vcombine_s16(d2tmp3.val[0], d2tmp3.val[1]);
+
+ q1 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q1),
+ vreinterpret_u8_s32(d14)));
+ q2 = vreinterpretq_s16_u16(vaddw_u8(vreinterpretq_u16_s16(q2),
+ vreinterpret_u8_s32(d15)));
+
+ d14 = vreinterpret_s32_u8(vqmovun_s16(q1));
+ d15 = vreinterpret_s32_u8(vqmovun_s16(q2));
+
+ dst0 = dst;
+ vst1_lane_s32((int32_t *)dst0, d14, 0);
+ dst0 += stride;
+ vst1_lane_s32((int32_t *)dst0, d14, 1);
+ dst0 += stride;
+ vst1_lane_s32((int32_t *)dst0, d15, 0);
+ dst0 += stride;
+ vst1_lane_s32((int32_t *)dst0, d15, 1);
+ return;
+}
diff --git a/libvpx/vp8/common/arm/neon/dequantizeb_neon.asm b/libvpx/vp8/common/arm/neon/dequantizeb_neon.asm
deleted file mode 100644
index c8e0c31..0000000
--- a/libvpx/vp8/common/arm/neon/dequantizeb_neon.asm
+++ /dev/null
@@ -1,34 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vp8_dequantize_b_loop_neon|
- ARM
- REQUIRE8
- PRESERVE8
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-; r0 short *Q,
-; r1 short *DQC
-; r2 short *DQ
-|vp8_dequantize_b_loop_neon| PROC
- vld1.16 {q0, q1}, [r0]
- vld1.16 {q2, q3}, [r1]
-
- vmul.i16 q4, q0, q2
- vmul.i16 q5, q1, q3
-
- vst1.16 {q4, q5}, [r2]
-
- bx lr
-
- ENDP
-
- END
diff --git a/libvpx/vp8/common/arm/neon/dequantizeb_neon.c b/libvpx/vp8/common/arm/neon/dequantizeb_neon.c
new file mode 100644
index 0000000..60f69c8
--- /dev/null
+++ b/libvpx/vp8/common/arm/neon/dequantizeb_neon.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <arm_neon.h>
+
+void vp8_dequantize_b_loop_neon(
+ int16_t *Q,
+ int16_t *DQC,
+ int16_t *DQ) {
+ int16x8x2_t qQ, qDQC, qDQ;
+
+ qQ = vld2q_s16(Q);
+ qDQC = vld2q_s16(DQC);
+
+ qDQ.val[0] = vmulq_s16(qQ.val[0], qDQC.val[0]);
+ qDQ.val[1] = vmulq_s16(qQ.val[1], qDQC.val[1]);
+
+ vst2q_s16(DQ, qDQ);
+ return;
+}
diff --git a/libvpx/vp8/common/blockd.h b/libvpx/vp8/common/blockd.h
index f7ff577..ea1a6a4 100644
--- a/libvpx/vp8/common/blockd.h
+++ b/libvpx/vp8/common/blockd.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_BLOCKD_H
-#define __INC_BLOCKD_H
+#ifndef VP8_COMMON_BLOCKD_H_
+#define VP8_COMMON_BLOCKD_H_
void vpx_log(const char *format, ...);
@@ -20,6 +20,10 @@ void vpx_log(const char *format, ...);
#include "treecoder.h"
#include "vpx_ports/mem.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*#define DCPRED 1*/
#define DCPREDSIMTHRESH 0
#define DCPREDCNTTHRESH 3
@@ -297,4 +301,8 @@ typedef struct macroblockd
extern void vp8_build_block_doffsets(MACROBLOCKD *x);
extern void vp8_setup_block_dptrs(MACROBLOCKD *x);
-#endif /* __INC_BLOCKD_H */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_BLOCKD_H_
diff --git a/libvpx/vp8/common/coefupdateprobs.h b/libvpx/vp8/common/coefupdateprobs.h
index 9e194dc..d96a19e 100644
--- a/libvpx/vp8/common/coefupdateprobs.h
+++ b/libvpx/vp8/common/coefupdateprobs.h
@@ -8,6 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_COEFUPDATEPROBS_H_
+#define VP8_COMMON_COEFUPDATEPROBS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/* Update probabilities for the nodes in the token entropy tree.
Generated file included by entropy.c */
@@ -183,3 +189,9 @@ const vp8_prob vp8_coef_update_probs [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTE
},
},
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_COEFUPDATEPROBS_H_
diff --git a/libvpx/vp8/common/common.h b/libvpx/vp8/common/common.h
index 2cc1c54..ee5b58c 100644
--- a/libvpx/vp8/common/common.h
+++ b/libvpx/vp8/common/common.h
@@ -9,8 +9,8 @@
*/
-#ifndef common_h
-#define common_h 1
+#ifndef VP8_COMMON_COMMON_H_
+#define VP8_COMMON_COMMON_H_
#include <assert.h>
@@ -18,6 +18,10 @@
#include "vpx_mem/vpx_mem.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Only need this for fixed-size arrays, for structs just assign. */
#define vp8_copy( Dest, Src) { \
@@ -37,4 +41,8 @@
#define vp8_zero_array( Dest, N) vpx_memset( Dest, 0, N * sizeof( *Dest));
-#endif /* common_h */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_COMMON_H_
diff --git a/libvpx/vp8/common/default_coef_probs.h b/libvpx/vp8/common/default_coef_probs.h
index 0d19563..4d69e4b 100644
--- a/libvpx/vp8/common/default_coef_probs.h
+++ b/libvpx/vp8/common/default_coef_probs.h
@@ -8,6 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_DEFAULT_COEF_PROBS_H_
+#define VP8_COMMON_DEFAULT_COEF_PROBS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*Generated file, included by entropy.c*/
@@ -186,3 +192,9 @@ static const vp8_prob default_coef_probs [BLOCK_TYPES]
}
}
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_DEFAULT_COEF_PROBS_H_
diff --git a/libvpx/vp8/common/entropy.h b/libvpx/vp8/common/entropy.h
index 5389bc1..a90bab4 100644
--- a/libvpx/vp8/common/entropy.h
+++ b/libvpx/vp8/common/entropy.h
@@ -9,12 +9,16 @@
*/
-#ifndef __INC_ENTROPY_H
-#define __INC_ENTROPY_H
+#ifndef VP8_COMMON_ENTROPY_H_
+#define VP8_COMMON_ENTROPY_H_
#include "treecoder.h"
#include "blockd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Coefficient token alphabet */
#define ZERO_TOKEN 0 /* 0 Extra Bits 0+0 */
@@ -98,4 +102,8 @@ extern DECLARE_ALIGNED(16, const short, vp8_default_zig_zag_mask[16]);
extern const int vp8_mb_feature_data_bits[MB_LVL_MAX];
void vp8_coef_tree_initialize(void);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_ENTROPY_H_
diff --git a/libvpx/vp8/common/entropymode.h b/libvpx/vp8/common/entropymode.h
index 1df0f64..81bdfc4 100644
--- a/libvpx/vp8/common/entropymode.h
+++ b/libvpx/vp8/common/entropymode.h
@@ -9,12 +9,16 @@
*/
-#ifndef __INC_ENTROPYMODE_H
-#define __INC_ENTROPYMODE_H
+#ifndef VP8_COMMON_ENTROPYMODE_H_
+#define VP8_COMMON_ENTROPYMODE_H_
#include "onyxc_int.h"
#include "treecoder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum
{
SUBMVREF_NORMAL,
@@ -77,4 +81,8 @@ void vp8_init_mbmode_probs(VP8_COMMON *x);
void vp8_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES-1]);
void vp8_kf_default_bmode_probs(vp8_prob dest [VP8_BINTRAMODES] [VP8_BINTRAMODES] [VP8_BINTRAMODES-1]);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_ENTROPYMODE_H_
diff --git a/libvpx/vp8/common/entropymv.h b/libvpx/vp8/common/entropymv.h
index 2db1e38..42840d5 100644
--- a/libvpx/vp8/common/entropymv.h
+++ b/libvpx/vp8/common/entropymv.h
@@ -9,11 +9,15 @@
*/
-#ifndef __INC_ENTROPYMV_H
-#define __INC_ENTROPYMV_H
+#ifndef VP8_COMMON_ENTROPYMV_H_
+#define VP8_COMMON_ENTROPYMV_H_
#include "treecoder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum
{
mv_max = 1023, /* max absolute value of a MV component */
@@ -41,4 +45,8 @@ typedef struct mv_context
extern const MV_CONTEXT vp8_mv_update_probs[2], vp8_default_mv_context[2];
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_ENTROPYMV_H_
diff --git a/libvpx/vp8/common/extend.h b/libvpx/vp8/common/extend.h
index 74a0b17..068f4ac 100644
--- a/libvpx/vp8/common/extend.h
+++ b/libvpx/vp8/common/extend.h
@@ -9,11 +9,15 @@
*/
-#ifndef __INC_EXTEND_H
-#define __INC_EXTEND_H
+#ifndef VP8_COMMON_EXTEND_H_
+#define VP8_COMMON_EXTEND_H_
#include "vpx_scale/yv12config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_extend_mb_row(YV12_BUFFER_CONFIG *ybf, unsigned char *YPtr, unsigned char *UPtr, unsigned char *VPtr);
void vp8_copy_and_extend_frame(YV12_BUFFER_CONFIG *src,
YV12_BUFFER_CONFIG *dst);
@@ -22,4 +26,8 @@ void vp8_copy_and_extend_frame_with_rect(YV12_BUFFER_CONFIG *src,
int srcy, int srcx,
int srch, int srcw);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_EXTEND_H_
diff --git a/libvpx/vp8/common/filter.h b/libvpx/vp8/common/filter.h
index ccda7c8..cfba775 100644
--- a/libvpx/vp8/common/filter.h
+++ b/libvpx/vp8/common/filter.h
@@ -9,11 +9,15 @@
*/
-#ifndef FILTER_H
-#define FILTER_H
+#ifndef VP8_COMMON_FILTER_H_
+#define VP8_COMMON_FILTER_H_
#include "vpx_ports/mem.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define BLOCK_HEIGHT_WIDTH 4
#define VP8_FILTER_WEIGHT 128
#define VP8_FILTER_SHIFT 7
@@ -21,4 +25,8 @@
extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]);
extern DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_FILTER_H_
diff --git a/libvpx/vp8/common/findnearmv.h b/libvpx/vp8/common/findnearmv.h
index c60e463..3c8c050 100644
--- a/libvpx/vp8/common/findnearmv.h
+++ b/libvpx/vp8/common/findnearmv.h
@@ -9,14 +9,18 @@
*/
-#ifndef __INC_FINDNEARMV_H
-#define __INC_FINDNEARMV_H
+#ifndef VP8_COMMON_FINDNEARMV_H_
+#define VP8_COMMON_FINDNEARMV_H_
#include "mv.h"
#include "blockd.h"
#include "modecont.h"
#include "treecoder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static void mv_bias(int refmb_ref_frame_sign_bias, int refframe, int_mv *mvp,
const int *ref_frame_sign_bias)
@@ -179,4 +183,8 @@ static B_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mb, int b, int mi
return (cur_mb->bmi + b - 4)->as_mode;
}
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_FINDNEARMV_H_
diff --git a/libvpx/vp8/common/header.h b/libvpx/vp8/common/header.h
index 3e98eeb..e27bca1 100644
--- a/libvpx/vp8/common/header.h
+++ b/libvpx/vp8/common/header.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_HEADER_H
-#define __INC_HEADER_H
+#ifndef VP8_COMMON_HEADER_H_
+#define VP8_COMMON_HEADER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/* 24 bits total */
typedef struct
@@ -40,4 +44,8 @@ typedef struct
#endif
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_HEADER_H_
diff --git a/libvpx/vp8/common/invtrans.h b/libvpx/vp8/common/invtrans.h
index 9262640..affe57e 100644
--- a/libvpx/vp8/common/invtrans.h
+++ b/libvpx/vp8/common/invtrans.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_INVTRANS_H
-#define __INC_INVTRANS_H
+#ifndef VP8_COMMON_INVTRANS_H_
+#define VP8_COMMON_INVTRANS_H_
#include "vpx_config.h"
#include "vp8_rtcd.h"
@@ -21,6 +21,10 @@
#include "vpx_mem/vpx_mem.h"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static void eob_adjust(char *eobs, short *diff)
{
/* eob adjust.... the idct can only skip if both the dc and eob are zero */
@@ -59,4 +63,8 @@ static void vp8_inverse_transform_mby(MACROBLOCKD *xd)
xd->dst.y_buffer,
xd->dst.y_stride, xd->eobs);
}
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_INVTRANS_H_
diff --git a/libvpx/vp8/common/loopfilter.h b/libvpx/vp8/common/loopfilter.h
index 1e47f34..20a6bd3 100644
--- a/libvpx/vp8/common/loopfilter.h
+++ b/libvpx/vp8/common/loopfilter.h
@@ -9,13 +9,17 @@
*/
-#ifndef loopfilter_h
-#define loopfilter_h
+#ifndef VP8_COMMON_LOOPFILTER_H_
+#define VP8_COMMON_LOOPFILTER_H_
#include "vpx_ports/mem.h"
#include "vpx_config.h"
#include "vp8_rtcd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_LOOP_FILTER 63
/* fraction of total macroblock rows to be used in fast filter level picking */
/* has to be > 2 */
@@ -102,4 +106,8 @@ void vp8_loop_filter_row_simple(struct VP8Common *cm,
int mb_row, int post_ystride, int post_uvstride,
unsigned char *y_ptr, unsigned char *u_ptr,
unsigned char *v_ptr);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_LOOPFILTER_H_
diff --git a/libvpx/vp8/common/modecont.h b/libvpx/vp8/common/modecont.h
index 24db882..ff34c33 100644
--- a/libvpx/vp8/common/modecont.h
+++ b/libvpx/vp8/common/modecont.h
@@ -9,9 +9,17 @@
*/
-#ifndef __INC_MODECONT_H
-#define __INC_MODECONT_H
+#ifndef VP8_COMMON_MODECONT_H_
+#define VP8_COMMON_MODECONT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern const int vp8_mode_contexts[6][4];
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_MODECONT_H_
diff --git a/libvpx/vp8/common/mv.h b/libvpx/vp8/common/mv.h
index b3f919d..111ccd6 100644
--- a/libvpx/vp8/common/mv.h
+++ b/libvpx/vp8/common/mv.h
@@ -9,10 +9,14 @@
*/
-#ifndef __INC_MV_H
-#define __INC_MV_H
+#ifndef VP8_COMMON_MV_H_
+#define VP8_COMMON_MV_H_
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct
{
short row;
@@ -25,4 +29,8 @@ typedef union int_mv
MV as_mv;
} int_mv; /* facilitates faster equality tests and copies */
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_MV_H_
diff --git a/libvpx/vp8/common/onyx.h b/libvpx/vp8/common/onyx.h
index 30c4cbb..119e40c 100644
--- a/libvpx/vp8/common/onyx.h
+++ b/libvpx/vp8/common/onyx.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_VP8_H
-#define __INC_VP8_H
+#ifndef VP8_COMMON_ONYX_H_
+#define VP8_COMMON_ONYX_H_
#ifdef __cplusplus
extern "C"
@@ -39,8 +39,8 @@ extern "C"
typedef enum
{
- USAGE_STREAM_FROM_SERVER = 0x0,
- USAGE_LOCAL_FILE_PLAYBACK = 0x1,
+ USAGE_LOCAL_FILE_PLAYBACK = 0x0,
+ USAGE_STREAM_FROM_SERVER = 0x1,
USAGE_CONSTRAINED_QUALITY = 0x2,
USAGE_CONSTANT_QUALITY = 0x3
} END_USAGE;
@@ -267,4 +267,4 @@ extern "C"
}
#endif
-#endif
+#endif // VP8_COMMON_ONYX_H_
diff --git a/libvpx/vp8/common/onyxc_int.h b/libvpx/vp8/common/onyxc_int.h
index e9bb7af..6d89865 100644
--- a/libvpx/vp8/common/onyxc_int.h
+++ b/libvpx/vp8/common/onyxc_int.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_VP8C_INT_H
-#define __INC_VP8C_INT_H
+#ifndef VP8_COMMON_ONYXC_INT_H_
+#define VP8_COMMON_ONYXC_INT_H_
#include "vpx_config.h"
#include "vp8_rtcd.h"
@@ -26,6 +26,10 @@
#include "header.h"
/*#endif*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MINQ 0
#define MAXQ 127
#define QINDEX_RANGE (MAXQ + 1)
@@ -174,4 +178,8 @@ typedef struct VP8Common
int cpu_caps;
} VP8_COMMON;
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_ONYXC_INT_H_
diff --git a/libvpx/vp8/common/onyxd.h b/libvpx/vp8/common/onyxd.h
index 97c81c1..e37b29f 100644
--- a/libvpx/vp8/common/onyxd.h
+++ b/libvpx/vp8/common/onyxd.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_VP8D_H
-#define __INC_VP8D_H
+#ifndef VP8_COMMON_ONYXD_H_
+#define VP8_COMMON_ONYXD_H_
/* Create/destroy static data structures. */
@@ -60,4 +60,4 @@ extern "C"
#endif
-#endif
+#endif // VP8_COMMON_ONYXD_H_
diff --git a/libvpx/vp8/common/postproc.c b/libvpx/vp8/common/postproc.c
index dd998f1..e3bee32 100644
--- a/libvpx/vp8/common/postproc.c
+++ b/libvpx/vp8/common/postproc.c
@@ -71,11 +71,6 @@ static const unsigned char MV_REFERENCE_FRAME_colors[MAX_REF_FRAMES][3] =
};
#endif
-static const short kernel5[] =
-{
- 1, 1, 4, 1, 1
-};
-
const short vp8_rv[] =
{
8, 5, 2, 2, 8, 12, 4, 9, 8, 3,
diff --git a/libvpx/vp8/common/postproc.h b/libvpx/vp8/common/postproc.h
index 495a2c9..33d0a7f 100644
--- a/libvpx/vp8/common/postproc.h
+++ b/libvpx/vp8/common/postproc.h
@@ -9,8 +9,8 @@
*/
-#ifndef POSTPROC_H
-#define POSTPROC_H
+#ifndef VP8_COMMON_POSTPROC_H_
+#define VP8_COMMON_POSTPROC_H_
#include "vpx_ports/mem.h"
struct postproc_state
@@ -26,6 +26,10 @@ struct postproc_state
};
#include "onyxc_int.h"
#include "ppflags.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
int vp8_post_proc_frame(struct VP8Common *oci, YV12_BUFFER_CONFIG *dest,
vp8_ppflags_t *flags);
@@ -47,4 +51,8 @@ void vp8_deblock(struct VP8Common *oci,
#define MFQE_PRECISION 4
void vp8_multiframe_quality_enhance(struct VP8Common *cm);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_POSTPROC_H_
diff --git a/libvpx/vp8/common/ppflags.h b/libvpx/vp8/common/ppflags.h
index 665e21f..768224a 100644
--- a/libvpx/vp8/common/ppflags.h
+++ b/libvpx/vp8/common/ppflags.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_PPFLAGS_H
-#define __INC_PPFLAGS_H
+#ifndef VP8_COMMON_PPFLAGS_H_
+#define VP8_COMMON_PPFLAGS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
enum
{
VP8D_NOFILTERING = 0,
@@ -38,4 +42,8 @@ typedef struct
int display_mv_flag;
} vp8_ppflags_t;
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_PPFLAGS_H_
diff --git a/libvpx/vp8/common/pragmas.h b/libvpx/vp8/common/pragmas.h
index 99fee5a..329cc82 100644
--- a/libvpx/vp8/common/pragmas.h
+++ b/libvpx/vp8/common/pragmas.h
@@ -8,8 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_PRAGMAS_H_
+#define VP8_COMMON_PRAGMAS_H_
-
+#ifdef __cplusplus
+extern "C" {
+#endif
#ifdef __INTEL_COMPILER
#pragma warning(disable:997 1011 170)
@@ -17,3 +21,9 @@
#ifdef _MSC_VER
#pragma warning(disable:4799)
#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_PRAGMAS_H_
diff --git a/libvpx/vp8/common/quant_common.h b/libvpx/vp8/common/quant_common.h
index cb64d8e..700b5e6 100644
--- a/libvpx/vp8/common/quant_common.h
+++ b/libvpx/vp8/common/quant_common.h
@@ -8,14 +8,27 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_QUANT_COMMON_H_
+#define VP8_COMMON_QUANT_COMMON_H_
+
#include "string.h"
#include "blockd.h"
#include "onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern int vp8_ac_yquant(int QIndex);
extern int vp8_dc_quant(int QIndex, int Delta);
extern int vp8_dc2quant(int QIndex, int Delta);
extern int vp8_ac2quant(int QIndex, int Delta);
extern int vp8_dc_uv_quant(int QIndex, int Delta);
extern int vp8_ac_uv_quant(int QIndex, int Delta);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_QUANT_COMMON_H_
diff --git a/libvpx/vp8/common/reconinter.h b/libvpx/vp8/common/reconinter.h
index 233c02e..ba979b9 100644
--- a/libvpx/vp8/common/reconinter.h
+++ b/libvpx/vp8/common/reconinter.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_RECONINTER_H
-#define __INC_RECONINTER_H
+#ifndef VP8_COMMON_RECONINTER_H_
+#define VP8_COMMON_RECONINTER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void vp8_build_inter_predictors_mb(MACROBLOCKD *x);
extern void vp8_build_inter16x16_predictors_mb(MACROBLOCKD *x,
@@ -32,4 +36,8 @@ extern void vp8_build_inter_predictors_b(BLOCKD *d, int pitch,
extern void vp8_build_inter16x16_predictors_mbuv(MACROBLOCKD *x);
extern void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_RECONINTER_H_
diff --git a/libvpx/vp8/common/reconintra4x4.h b/libvpx/vp8/common/reconintra4x4.h
index d2b0d43..ed59c9e 100644
--- a/libvpx/vp8/common/reconintra4x4.h
+++ b/libvpx/vp8/common/reconintra4x4.h
@@ -9,10 +9,14 @@
*/
-#ifndef __INC_RECONINTRA4x4_H
-#define __INC_RECONINTRA4x4_H
+#ifndef VP8_COMMON_RECONINTRA4X4_H_
+#define VP8_COMMON_RECONINTRA4X4_H_
#include "vp8/common/blockd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static void intra_prediction_down_copy(MACROBLOCKD *xd,
unsigned char *above_right_src)
{
@@ -29,4 +33,8 @@ static void intra_prediction_down_copy(MACROBLOCKD *xd,
*dst_ptr2 = *src_ptr;
}
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_RECONINTRA4X4_H_
diff --git a/libvpx/vp8/common/rtcd_defs.pl b/libvpx/vp8/common/rtcd_defs.pl
new file mode 100644
index 0000000..130d965
--- /dev/null
+++ b/libvpx/vp8/common/rtcd_defs.pl
@@ -0,0 +1,541 @@
+sub vp8_common_forward_decls() {
+print <<EOF
+/*
+ * VP8
+ */
+
+struct blockd;
+struct macroblockd;
+struct loop_filter_info;
+
+/* Encoder forward decls */
+struct block;
+struct macroblock;
+struct variance_vtable;
+union int_mv;
+struct yv12_buffer_config;
+EOF
+}
+forward_decls qw/vp8_common_forward_decls/;
+
+#
+# system state
+#
+add_proto qw/void vp8_clear_system_state/, "";
+specialize qw/vp8_clear_system_state mmx/;
+$vp8_clear_system_state_mmx=vpx_reset_mmx_state;
+
+#
+# Dequant
+#
+add_proto qw/void vp8_dequantize_b/, "struct blockd*, short *dqc";
+specialize qw/vp8_dequantize_b mmx media neon/;
+$vp8_dequantize_b_media=vp8_dequantize_b_v6;
+
+add_proto qw/void vp8_dequant_idct_add/, "short *input, short *dq, unsigned char *output, int stride";
+specialize qw/vp8_dequant_idct_add mmx media neon dspr2/;
+$vp8_dequant_idct_add_media=vp8_dequant_idct_add_v6;
+$vp8_dequant_idct_add_dspr2=vp8_dequant_idct_add_dspr2;
+
+add_proto qw/void vp8_dequant_idct_add_y_block/, "short *q, short *dq, unsigned char *dst, int stride, char *eobs";
+specialize qw/vp8_dequant_idct_add_y_block mmx sse2 media neon dspr2/;
+$vp8_dequant_idct_add_y_block_media=vp8_dequant_idct_add_y_block_v6;
+$vp8_dequant_idct_add_y_block_dspr2=vp8_dequant_idct_add_y_block_dspr2;
+
+add_proto qw/void vp8_dequant_idct_add_uv_block/, "short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs";
+specialize qw/vp8_dequant_idct_add_uv_block mmx sse2 media neon dspr2/;
+$vp8_dequant_idct_add_uv_block_media=vp8_dequant_idct_add_uv_block_v6;
+$vp8_dequant_idct_add_y_block_dspr2=vp8_dequant_idct_add_y_block_dspr2;
+
+#
+# Loopfilter
+#
+add_proto qw/void vp8_loop_filter_mbv/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
+specialize qw/vp8_loop_filter_mbv mmx sse2 media neon dspr2/;
+$vp8_loop_filter_mbv_media=vp8_loop_filter_mbv_armv6;
+$vp8_loop_filter_mbv_dspr2=vp8_loop_filter_mbv_dspr2;
+
+add_proto qw/void vp8_loop_filter_bv/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
+specialize qw/vp8_loop_filter_bv mmx sse2 media neon dspr2/;
+$vp8_loop_filter_bv_media=vp8_loop_filter_bv_armv6;
+$vp8_loop_filter_bv_dspr2=vp8_loop_filter_bv_dspr2;
+
+add_proto qw/void vp8_loop_filter_mbh/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
+specialize qw/vp8_loop_filter_mbh mmx sse2 media neon dspr2/;
+$vp8_loop_filter_mbh_media=vp8_loop_filter_mbh_armv6;
+$vp8_loop_filter_mbh_dspr2=vp8_loop_filter_mbh_dspr2;
+
+add_proto qw/void vp8_loop_filter_bh/, "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi";
+specialize qw/vp8_loop_filter_bh mmx sse2 media neon dspr2/;
+$vp8_loop_filter_bh_media=vp8_loop_filter_bh_armv6;
+$vp8_loop_filter_bh_dspr2=vp8_loop_filter_bh_dspr2;
+
+
+add_proto qw/void vp8_loop_filter_simple_mbv/, "unsigned char *y, int ystride, const unsigned char *blimit";
+specialize qw/vp8_loop_filter_simple_mbv mmx sse2 media neon/;
+$vp8_loop_filter_simple_mbv_c=vp8_loop_filter_simple_vertical_edge_c;
+$vp8_loop_filter_simple_mbv_mmx=vp8_loop_filter_simple_vertical_edge_mmx;
+$vp8_loop_filter_simple_mbv_sse2=vp8_loop_filter_simple_vertical_edge_sse2;
+$vp8_loop_filter_simple_mbv_media=vp8_loop_filter_simple_vertical_edge_armv6;
+$vp8_loop_filter_simple_mbv_neon=vp8_loop_filter_mbvs_neon;
+
+add_proto qw/void vp8_loop_filter_simple_mbh/, "unsigned char *y, int ystride, const unsigned char *blimit";
+specialize qw/vp8_loop_filter_simple_mbh mmx sse2 media neon/;
+$vp8_loop_filter_simple_mbh_c=vp8_loop_filter_simple_horizontal_edge_c;
+$vp8_loop_filter_simple_mbh_mmx=vp8_loop_filter_simple_horizontal_edge_mmx;
+$vp8_loop_filter_simple_mbh_sse2=vp8_loop_filter_simple_horizontal_edge_sse2;
+$vp8_loop_filter_simple_mbh_media=vp8_loop_filter_simple_horizontal_edge_armv6;
+$vp8_loop_filter_simple_mbh_neon=vp8_loop_filter_mbhs_neon;
+
+add_proto qw/void vp8_loop_filter_simple_bv/, "unsigned char *y, int ystride, const unsigned char *blimit";
+specialize qw/vp8_loop_filter_simple_bv mmx sse2 media neon/;
+$vp8_loop_filter_simple_bv_c=vp8_loop_filter_bvs_c;
+$vp8_loop_filter_simple_bv_mmx=vp8_loop_filter_bvs_mmx;
+$vp8_loop_filter_simple_bv_sse2=vp8_loop_filter_bvs_sse2;
+$vp8_loop_filter_simple_bv_media=vp8_loop_filter_bvs_armv6;
+$vp8_loop_filter_simple_bv_neon=vp8_loop_filter_bvs_neon;
+
+add_proto qw/void vp8_loop_filter_simple_bh/, "unsigned char *y, int ystride, const unsigned char *blimit";
+specialize qw/vp8_loop_filter_simple_bh mmx sse2 media neon/;
+$vp8_loop_filter_simple_bh_c=vp8_loop_filter_bhs_c;
+$vp8_loop_filter_simple_bh_mmx=vp8_loop_filter_bhs_mmx;
+$vp8_loop_filter_simple_bh_sse2=vp8_loop_filter_bhs_sse2;
+$vp8_loop_filter_simple_bh_media=vp8_loop_filter_bhs_armv6;
+$vp8_loop_filter_simple_bh_neon=vp8_loop_filter_bhs_neon;
+
+#
+# IDCT
+#
+#idct16
+add_proto qw/void vp8_short_idct4x4llm/, "short *input, unsigned char *pred, int pitch, unsigned char *dst, int dst_stride";
+specialize qw/vp8_short_idct4x4llm mmx media neon dspr2/;
+$vp8_short_idct4x4llm_media=vp8_short_idct4x4llm_v6_dual;
+$vp8_short_idct4x4llm_dspr2=vp8_short_idct4x4llm_dspr2;
+
+#iwalsh1
+add_proto qw/void vp8_short_inv_walsh4x4_1/, "short *input, short *output";
+specialize qw/vp8_short_inv_walsh4x4_1 dspr2/;
+$vp8_short_inv_walsh4x4_1_dspr2=vp8_short_inv_walsh4x4_1_dspr2;
+# no asm yet
+
+#iwalsh16
+add_proto qw/void vp8_short_inv_walsh4x4/, "short *input, short *output";
+specialize qw/vp8_short_inv_walsh4x4 mmx sse2 media neon dspr2/;
+$vp8_short_inv_walsh4x4_media=vp8_short_inv_walsh4x4_v6;
+$vp8_short_inv_walsh4x4_dspr2=vp8_short_inv_walsh4x4_dspr2;
+
+#idct1_scalar_add
+add_proto qw/void vp8_dc_only_idct_add/, "short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride";
+specialize qw/vp8_dc_only_idct_add mmx media neon dspr2/;
+$vp8_dc_only_idct_add_media=vp8_dc_only_idct_add_v6;
+$vp8_dc_only_idct_add_dspr2=vp8_dc_only_idct_add_dspr2;
+
+#
+# RECON
+#
+add_proto qw/void vp8_copy_mem16x16/, "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_copy_mem16x16 mmx sse2 media neon dspr2/;
+$vp8_copy_mem16x16_media=vp8_copy_mem16x16_v6;
+$vp8_copy_mem16x16_dspr2=vp8_copy_mem16x16_dspr2;
+
+add_proto qw/void vp8_copy_mem8x8/, "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_copy_mem8x8 mmx media neon dspr2/;
+$vp8_copy_mem8x8_media=vp8_copy_mem8x8_v6;
+$vp8_copy_mem8x8_dspr2=vp8_copy_mem8x8_dspr2;
+
+add_proto qw/void vp8_copy_mem8x4/, "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_copy_mem8x4 mmx media neon dspr2/;
+$vp8_copy_mem8x4_media=vp8_copy_mem8x4_v6;
+$vp8_copy_mem8x4_dspr2=vp8_copy_mem8x4_dspr2;
+
+add_proto qw/void vp8_build_intra_predictors_mby_s/, "struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride";
+specialize qw/vp8_build_intra_predictors_mby_s sse2 ssse3/;
+#TODO: fix assembly for neon
+
+add_proto qw/void vp8_build_intra_predictors_mbuv_s/, "struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride";
+specialize qw/vp8_build_intra_predictors_mbuv_s sse2 ssse3/;
+
+add_proto qw/void vp8_intra4x4_predict/, "unsigned char *Above, unsigned char *yleft, int left_stride, int b_mode, unsigned char *dst, int dst_stride, unsigned char top_left";
+specialize qw/vp8_intra4x4_predict media/;
+$vp8_intra4x4_predict_media=vp8_intra4x4_predict_armv6;
+
+#
+# Postproc
+#
+if (vpx_config("CONFIG_POSTPROC") eq "yes") {
+ add_proto qw/void vp8_mbpost_proc_down/, "unsigned char *dst, int pitch, int rows, int cols,int flimit";
+ specialize qw/vp8_mbpost_proc_down mmx sse2/;
+ $vp8_mbpost_proc_down_sse2=vp8_mbpost_proc_down_xmm;
+
+ add_proto qw/void vp8_mbpost_proc_across_ip/, "unsigned char *dst, int pitch, int rows, int cols,int flimit";
+ specialize qw/vp8_mbpost_proc_across_ip sse2/;
+ $vp8_mbpost_proc_across_ip_sse2=vp8_mbpost_proc_across_ip_xmm;
+
+ add_proto qw/void vp8_post_proc_down_and_across_mb_row/, "unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int cols, unsigned char *flimits, int size";
+ specialize qw/vp8_post_proc_down_and_across_mb_row sse2/;
+
+ add_proto qw/void vp8_plane_add_noise/, "unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch";
+ specialize qw/vp8_plane_add_noise mmx sse2/;
+ $vp8_plane_add_noise_sse2=vp8_plane_add_noise_wmt;
+
+ add_proto qw/void vp8_blend_mb_inner/, "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride";
+ # no asm yet
+
+ add_proto qw/void vp8_blend_mb_outer/, "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride";
+ # no asm yet
+
+ add_proto qw/void vp8_blend_b/, "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride";
+ # no asm yet
+
+ add_proto qw/void vp8_filter_by_weight16x16/, "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight";
+ specialize qw/vp8_filter_by_weight16x16 sse2/;
+
+ add_proto qw/void vp8_filter_by_weight8x8/, "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight";
+ specialize qw/vp8_filter_by_weight8x8 sse2/;
+
+ add_proto qw/void vp8_filter_by_weight4x4/, "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight";
+ # no asm yet
+}
+
+#
+# Subpixel
+#
+add_proto qw/void vp8_sixtap_predict16x16/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_sixtap_predict16x16 mmx sse2 ssse3 media neon dspr2/;
+$vp8_sixtap_predict16x16_media=vp8_sixtap_predict16x16_armv6;
+$vp8_sixtap_predict16x16_dspr2=vp8_sixtap_predict16x16_dspr2;
+
+add_proto qw/void vp8_sixtap_predict8x8/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_sixtap_predict8x8 mmx sse2 ssse3 media neon dspr2/;
+$vp8_sixtap_predict8x8_media=vp8_sixtap_predict8x8_armv6;
+$vp8_sixtap_predict8x8_dspr2=vp8_sixtap_predict8x8_dspr2;
+
+add_proto qw/void vp8_sixtap_predict8x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_sixtap_predict8x4 mmx sse2 ssse3 media neon dspr2/;
+$vp8_sixtap_predict8x4_media=vp8_sixtap_predict8x4_armv6;
+$vp8_sixtap_predict8x4_dspr2=vp8_sixtap_predict8x4_dspr2;
+
+add_proto qw/void vp8_sixtap_predict4x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_sixtap_predict4x4 mmx ssse3 media neon dspr2/;
+$vp8_sixtap_predict4x4_media=vp8_sixtap_predict4x4_armv6;
+$vp8_sixtap_predict4x4_dspr2=vp8_sixtap_predict4x4_dspr2;
+
+add_proto qw/void vp8_bilinear_predict16x16/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_bilinear_predict16x16 mmx sse2 ssse3 media neon/;
+$vp8_bilinear_predict16x16_media=vp8_bilinear_predict16x16_armv6;
+
+add_proto qw/void vp8_bilinear_predict8x8/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_bilinear_predict8x8 mmx sse2 ssse3 media neon/;
+$vp8_bilinear_predict8x8_media=vp8_bilinear_predict8x8_armv6;
+
+add_proto qw/void vp8_bilinear_predict8x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_bilinear_predict8x4 mmx media neon/;
+$vp8_bilinear_predict8x4_media=vp8_bilinear_predict8x4_armv6;
+
+add_proto qw/void vp8_bilinear_predict4x4/, "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch";
+specialize qw/vp8_bilinear_predict4x4 mmx media neon/;
+$vp8_bilinear_predict4x4_media=vp8_bilinear_predict4x4_armv6;
+
+#
+# Whole-pixel Variance
+#
+add_proto qw/unsigned int vp8_variance4x4/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance4x4 mmx sse2/;
+$vp8_variance4x4_sse2=vp8_variance4x4_wmt;
+
+add_proto qw/unsigned int vp8_variance8x8/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance8x8 mmx sse2 media neon/;
+$vp8_variance8x8_sse2=vp8_variance8x8_wmt;
+$vp8_variance8x8_media=vp8_variance8x8_armv6;
+
+add_proto qw/unsigned int vp8_variance8x16/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance8x16 mmx sse2 neon/;
+$vp8_variance8x16_sse2=vp8_variance8x16_wmt;
+
+add_proto qw/unsigned int vp8_variance16x8/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance16x8 mmx sse2 neon/;
+$vp8_variance16x8_sse2=vp8_variance16x8_wmt;
+
+add_proto qw/unsigned int vp8_variance16x16/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance16x16 mmx sse2 media neon/;
+$vp8_variance16x16_sse2=vp8_variance16x16_wmt;
+$vp8_variance16x16_media=vp8_variance16x16_armv6;
+
+#
+# Sub-pixel Variance
+#
+add_proto qw/unsigned int vp8_sub_pixel_variance4x4/, "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse";
+specialize qw/vp8_sub_pixel_variance4x4 mmx sse2/;
+$vp8_sub_pixel_variance4x4_sse2=vp8_sub_pixel_variance4x4_wmt;
+
+add_proto qw/unsigned int vp8_sub_pixel_variance8x8/, "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse";
+specialize qw/vp8_sub_pixel_variance8x8 mmx sse2 media neon/;
+$vp8_sub_pixel_variance8x8_sse2=vp8_sub_pixel_variance8x8_wmt;
+$vp8_sub_pixel_variance8x8_media=vp8_sub_pixel_variance8x8_armv6;
+
+add_proto qw/unsigned int vp8_sub_pixel_variance8x16/, "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse";
+specialize qw/vp8_sub_pixel_variance8x16 mmx sse2/;
+$vp8_sub_pixel_variance8x16_sse2=vp8_sub_pixel_variance8x16_wmt;
+
+add_proto qw/unsigned int vp8_sub_pixel_variance16x8/, "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse";
+specialize qw/vp8_sub_pixel_variance16x8 mmx sse2 ssse3/;
+$vp8_sub_pixel_variance16x8_sse2=vp8_sub_pixel_variance16x8_wmt;
+
+add_proto qw/unsigned int vp8_sub_pixel_variance16x16/, "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse";
+specialize qw/vp8_sub_pixel_variance16x16 mmx sse2 ssse3 media neon/;
+$vp8_sub_pixel_variance16x16_sse2=vp8_sub_pixel_variance16x16_wmt;
+$vp8_sub_pixel_variance16x16_media=vp8_sub_pixel_variance16x16_armv6;
+
+add_proto qw/unsigned int vp8_variance_halfpixvar16x16_h/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance_halfpixvar16x16_h mmx sse2 media neon/;
+$vp8_variance_halfpixvar16x16_h_sse2=vp8_variance_halfpixvar16x16_h_wmt;
+$vp8_variance_halfpixvar16x16_h_media=vp8_variance_halfpixvar16x16_h_armv6;
+
+add_proto qw/unsigned int vp8_variance_halfpixvar16x16_v/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance_halfpixvar16x16_v mmx sse2 media neon/;
+$vp8_variance_halfpixvar16x16_v_sse2=vp8_variance_halfpixvar16x16_v_wmt;
+$vp8_variance_halfpixvar16x16_v_media=vp8_variance_halfpixvar16x16_v_armv6;
+
+add_proto qw/unsigned int vp8_variance_halfpixvar16x16_hv/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_variance_halfpixvar16x16_hv mmx sse2 media neon/;
+$vp8_variance_halfpixvar16x16_hv_sse2=vp8_variance_halfpixvar16x16_hv_wmt;
+$vp8_variance_halfpixvar16x16_hv_media=vp8_variance_halfpixvar16x16_hv_armv6;
+
+#
+# Single block SAD
+#
+add_proto qw/unsigned int vp8_sad4x4/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp8_sad4x4 mmx sse2 neon/;
+$vp8_sad4x4_sse2=vp8_sad4x4_wmt;
+
+add_proto qw/unsigned int vp8_sad8x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp8_sad8x8 mmx sse2 neon/;
+$vp8_sad8x8_sse2=vp8_sad8x8_wmt;
+
+add_proto qw/unsigned int vp8_sad8x16/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp8_sad8x16 mmx sse2 neon/;
+$vp8_sad8x16_sse2=vp8_sad8x16_wmt;
+
+add_proto qw/unsigned int vp8_sad16x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp8_sad16x8 mmx sse2 neon/;
+$vp8_sad16x8_sse2=vp8_sad16x8_wmt;
+
+add_proto qw/unsigned int vp8_sad16x16/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp8_sad16x16 mmx sse2 sse3 media neon/;
+$vp8_sad16x16_sse2=vp8_sad16x16_wmt;
+$vp8_sad16x16_media=vp8_sad16x16_armv6;
+
+#
+# Multi-block SAD, comparing a reference to N blocks 1 pixel apart horizontally
+#
+add_proto qw/void vp8_sad4x4x3/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad4x4x3 sse3/;
+
+add_proto qw/void vp8_sad8x8x3/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad8x8x3 sse3/;
+
+add_proto qw/void vp8_sad8x16x3/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad8x16x3 sse3/;
+
+add_proto qw/void vp8_sad16x8x3/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad16x8x3 sse3 ssse3/;
+
+add_proto qw/void vp8_sad16x16x3/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad16x16x3 sse3 ssse3/;
+
+# Note the only difference in the following prototypes is that they return into
+# an array of short
+add_proto qw/void vp8_sad4x4x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array";
+specialize qw/vp8_sad4x4x8 sse4_1/;
+$vp8_sad4x4x8_sse4_1=vp8_sad4x4x8_sse4;
+
+add_proto qw/void vp8_sad8x8x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array";
+specialize qw/vp8_sad8x8x8 sse4_1/;
+$vp8_sad8x8x8_sse4_1=vp8_sad8x8x8_sse4;
+
+add_proto qw/void vp8_sad8x16x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array";
+specialize qw/vp8_sad8x16x8 sse4_1/;
+$vp8_sad8x16x8_sse4_1=vp8_sad8x16x8_sse4;
+
+add_proto qw/void vp8_sad16x8x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array";
+specialize qw/vp8_sad16x8x8 sse4_1/;
+$vp8_sad16x8x8_sse4_1=vp8_sad16x8x8_sse4;
+
+add_proto qw/void vp8_sad16x16x8/, "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array";
+specialize qw/vp8_sad16x16x8 sse4_1/;
+$vp8_sad16x16x8_sse4_1=vp8_sad16x16x8_sse4;
+
+#
+# Multi-block SAD, comparing a reference to N independent blocks
+#
+add_proto qw/void vp8_sad4x4x4d/, "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad4x4x4d sse3/;
+
+add_proto qw/void vp8_sad8x8x4d/, "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad8x8x4d sse3/;
+
+add_proto qw/void vp8_sad8x16x4d/, "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad8x16x4d sse3/;
+
+add_proto qw/void vp8_sad16x8x4d/, "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad16x8x4d sse3/;
+
+add_proto qw/void vp8_sad16x16x4d/, "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp8_sad16x16x4d sse3/;
+
+#
+# Encoder functions below this point.
+#
+if (vpx_config("CONFIG_VP8_ENCODER") eq "yes") {
+
+#
+# Sum of squares (vector)
+#
+add_proto qw/unsigned int vp8_get_mb_ss/, "const short *";
+specialize qw/vp8_get_mb_ss mmx sse2/;
+
+#
+# SSE (Sum Squared Error)
+#
+add_proto qw/unsigned int vp8_sub_pixel_mse16x16/, "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse";
+specialize qw/vp8_sub_pixel_mse16x16 mmx sse2/;
+$vp8_sub_pixel_mse16x16_sse2=vp8_sub_pixel_mse16x16_wmt;
+
+add_proto qw/unsigned int vp8_mse16x16/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp8_mse16x16 mmx sse2 media neon/;
+$vp8_mse16x16_sse2=vp8_mse16x16_wmt;
+$vp8_mse16x16_media=vp8_mse16x16_armv6;
+
+add_proto qw/unsigned int vp8_get4x4sse_cs/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride";
+specialize qw/vp8_get4x4sse_cs mmx neon/;
+
+#
+# Block copy
+#
+if ($opts{arch} =~ /x86/) {
+ add_proto qw/void vp8_copy32xn/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, int n";
+ specialize qw/vp8_copy32xn sse2 sse3/;
+}
+
+#
+# Structured Similarity (SSIM)
+#
+if (vpx_config("CONFIG_INTERNAL_STATS") eq "yes") {
+ $opts{arch} eq "x86_64" and $sse2_on_x86_64 = "sse2";
+
+ add_proto qw/void vp8_ssim_parms_8x8/, "unsigned char *s, int sp, unsigned char *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr";
+ specialize qw/vp8_ssim_parms_8x8/, "$sse2_on_x86_64";
+
+ add_proto qw/void vp8_ssim_parms_16x16/, "unsigned char *s, int sp, unsigned char *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr";
+ specialize qw/vp8_ssim_parms_16x16/, "$sse2_on_x86_64";
+}
+
+#
+# Forward DCT
+#
+add_proto qw/void vp8_short_fdct4x4/, "short *input, short *output, int pitch";
+specialize qw/vp8_short_fdct4x4 mmx sse2 media neon/;
+$vp8_short_fdct4x4_media=vp8_short_fdct4x4_armv6;
+
+add_proto qw/void vp8_short_fdct8x4/, "short *input, short *output, int pitch";
+specialize qw/vp8_short_fdct8x4 mmx sse2 media neon/;
+$vp8_short_fdct8x4_media=vp8_short_fdct8x4_armv6;
+
+add_proto qw/void vp8_short_walsh4x4/, "short *input, short *output, int pitch";
+specialize qw/vp8_short_walsh4x4 sse2 media neon/;
+$vp8_short_walsh4x4_media=vp8_short_walsh4x4_armv6;
+
+#
+# Quantizer
+#
+add_proto qw/void vp8_regular_quantize_b/, "struct block *, struct blockd *";
+specialize qw/vp8_regular_quantize_b sse2/;
+# TODO(johann) Update sse4 implementation and re-enable
+#$vp8_regular_quantize_b_sse4_1=vp8_regular_quantize_b_sse4;
+
+add_proto qw/void vp8_fast_quantize_b/, "struct block *, struct blockd *";
+specialize qw/vp8_fast_quantize_b sse2 ssse3 media neon/;
+$vp8_fast_quantize_b_media=vp8_fast_quantize_b_armv6;
+
+add_proto qw/void vp8_regular_quantize_b_pair/, "struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2";
+# no asm yet
+
+add_proto qw/void vp8_fast_quantize_b_pair/, "struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2";
+specialize qw/vp8_fast_quantize_b_pair neon/;
+
+add_proto qw/void vp8_quantize_mb/, "struct macroblock *";
+specialize qw/vp8_quantize_mb neon/;
+
+add_proto qw/void vp8_quantize_mby/, "struct macroblock *";
+specialize qw/vp8_quantize_mby neon/;
+
+add_proto qw/void vp8_quantize_mbuv/, "struct macroblock *";
+specialize qw/vp8_quantize_mbuv neon/;
+
+#
+# Block subtraction
+#
+add_proto qw/int vp8_block_error/, "short *coeff, short *dqcoeff";
+specialize qw/vp8_block_error mmx sse2/;
+$vp8_block_error_sse2=vp8_block_error_xmm;
+
+add_proto qw/int vp8_mbblock_error/, "struct macroblock *mb, int dc";
+specialize qw/vp8_mbblock_error mmx sse2/;
+$vp8_mbblock_error_sse2=vp8_mbblock_error_xmm;
+
+add_proto qw/int vp8_mbuverror/, "struct macroblock *mb";
+specialize qw/vp8_mbuverror mmx sse2/;
+$vp8_mbuverror_sse2=vp8_mbuverror_xmm;
+
+add_proto qw/void vp8_subtract_b/, "struct block *be, struct blockd *bd, int pitch";
+specialize qw/vp8_subtract_b mmx sse2 media neon/;
+$vp8_subtract_b_media=vp8_subtract_b_armv6;
+
+add_proto qw/void vp8_subtract_mby/, "short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride";
+specialize qw/vp8_subtract_mby mmx sse2 media neon/;
+$vp8_subtract_mby_media=vp8_subtract_mby_armv6;
+
+add_proto qw/void vp8_subtract_mbuv/, "short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride";
+specialize qw/vp8_subtract_mbuv mmx sse2 media neon/;
+$vp8_subtract_mbuv_media=vp8_subtract_mbuv_armv6;
+
+#
+# Motion search
+#
+add_proto qw/int vp8_full_search_sad/, "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv";
+specialize qw/vp8_full_search_sad sse3 sse4_1/;
+$vp8_full_search_sad_sse3=vp8_full_search_sadx3;
+$vp8_full_search_sad_sse4_1=vp8_full_search_sadx8;
+
+add_proto qw/int vp8_refining_search_sad/, "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv";
+specialize qw/vp8_refining_search_sad sse3/;
+$vp8_refining_search_sad_sse3=vp8_refining_search_sadx4;
+
+add_proto qw/int vp8_diamond_search_sad/, "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv";
+$vp8_diamond_search_sad_sse3=vp8_diamond_search_sadx4;
+
+#
+# Alt-ref Noise Reduction (ARNR)
+#
+if (vpx_config("CONFIG_REALTIME_ONLY") ne "yes") {
+ add_proto qw/void vp8_temporal_filter_apply/, "unsigned char *frame1, unsigned int stride, unsigned char *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, unsigned short *count";
+ specialize qw/vp8_temporal_filter_apply sse2/;
+}
+
+#
+# Pick Loopfilter
+#
+add_proto qw/void vp8_yv12_copy_partial_frame/, "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc";
+specialize qw/vp8_yv12_copy_partial_frame neon/;
+
+#
+# Denoiser filter
+#
+if (vpx_config("CONFIG_TEMPORAL_DENOISING") eq "yes") {
+ add_proto qw/int vp8_denoiser_filter/, "struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset";
+ specialize qw/vp8_denoiser_filter sse2 neon/;
+}
+
+# End of encoder only functions
+}
+1;
diff --git a/libvpx/vp8/common/rtcd_defs.sh b/libvpx/vp8/common/rtcd_defs.sh
deleted file mode 100644
index 9ebf389..0000000
--- a/libvpx/vp8/common/rtcd_defs.sh
+++ /dev/null
@@ -1,542 +0,0 @@
-vp8_common_forward_decls() {
-cat <<EOF
-/*
- * VP8
- */
-
-struct blockd;
-struct macroblockd;
-struct loop_filter_info;
-
-/* Encoder forward decls */
-struct block;
-struct macroblock;
-struct variance_vtable;
-union int_mv;
-struct yv12_buffer_config;
-EOF
-}
-forward_decls vp8_common_forward_decls
-
-#
-# system state
-#
-prototype void vp8_clear_system_state ""
-specialize vp8_clear_system_state mmx
-vp8_clear_system_state_mmx=vpx_reset_mmx_state
-
-#
-# Dequant
-#
-prototype void vp8_dequantize_b "struct blockd*, short *dqc"
-specialize vp8_dequantize_b mmx media neon
-vp8_dequantize_b_media=vp8_dequantize_b_v6
-
-prototype void vp8_dequant_idct_add "short *input, short *dq, unsigned char *output, int stride"
-specialize vp8_dequant_idct_add mmx media neon dspr2
-vp8_dequant_idct_add_media=vp8_dequant_idct_add_v6
-vp8_dequant_idct_add_dspr2=vp8_dequant_idct_add_dspr2
-
-prototype void vp8_dequant_idct_add_y_block "short *q, short *dq, unsigned char *dst, int stride, char *eobs"
-specialize vp8_dequant_idct_add_y_block mmx sse2 media neon dspr2
-vp8_dequant_idct_add_y_block_media=vp8_dequant_idct_add_y_block_v6
-vp8_dequant_idct_add_y_block_dspr2=vp8_dequant_idct_add_y_block_dspr2
-
-prototype void vp8_dequant_idct_add_uv_block "short *q, short *dq, unsigned char *dst_u, unsigned char *dst_v, int stride, char *eobs"
-specialize vp8_dequant_idct_add_uv_block mmx sse2 media neon dspr2
-vp8_dequant_idct_add_uv_block_media=vp8_dequant_idct_add_uv_block_v6
-vp8_dequant_idct_add_y_block_dspr2=vp8_dequant_idct_add_y_block_dspr2
-
-#
-# Loopfilter
-#
-prototype void vp8_loop_filter_mbv "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi"
-specialize vp8_loop_filter_mbv mmx sse2 media neon dspr2
-vp8_loop_filter_mbv_media=vp8_loop_filter_mbv_armv6
-vp8_loop_filter_mbv_dspr2=vp8_loop_filter_mbv_dspr2
-
-prototype void vp8_loop_filter_bv "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi"
-specialize vp8_loop_filter_bv mmx sse2 media neon dspr2
-vp8_loop_filter_bv_media=vp8_loop_filter_bv_armv6
-vp8_loop_filter_bv_dspr2=vp8_loop_filter_bv_dspr2
-
-prototype void vp8_loop_filter_mbh "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi"
-specialize vp8_loop_filter_mbh mmx sse2 media neon dspr2
-vp8_loop_filter_mbh_media=vp8_loop_filter_mbh_armv6
-vp8_loop_filter_mbh_dspr2=vp8_loop_filter_mbh_dspr2
-
-prototype void vp8_loop_filter_bh "unsigned char *y, unsigned char *u, unsigned char *v, int ystride, int uv_stride, struct loop_filter_info *lfi"
-specialize vp8_loop_filter_bh mmx sse2 media neon dspr2
-vp8_loop_filter_bh_media=vp8_loop_filter_bh_armv6
-vp8_loop_filter_bh_dspr2=vp8_loop_filter_bh_dspr2
-
-
-prototype void vp8_loop_filter_simple_mbv "unsigned char *y, int ystride, const unsigned char *blimit"
-specialize vp8_loop_filter_simple_mbv mmx sse2 media neon
-vp8_loop_filter_simple_mbv_c=vp8_loop_filter_simple_vertical_edge_c
-vp8_loop_filter_simple_mbv_mmx=vp8_loop_filter_simple_vertical_edge_mmx
-vp8_loop_filter_simple_mbv_sse2=vp8_loop_filter_simple_vertical_edge_sse2
-vp8_loop_filter_simple_mbv_media=vp8_loop_filter_simple_vertical_edge_armv6
-vp8_loop_filter_simple_mbv_neon=vp8_loop_filter_mbvs_neon
-
-prototype void vp8_loop_filter_simple_mbh "unsigned char *y, int ystride, const unsigned char *blimit"
-specialize vp8_loop_filter_simple_mbh mmx sse2 media neon
-vp8_loop_filter_simple_mbh_c=vp8_loop_filter_simple_horizontal_edge_c
-vp8_loop_filter_simple_mbh_mmx=vp8_loop_filter_simple_horizontal_edge_mmx
-vp8_loop_filter_simple_mbh_sse2=vp8_loop_filter_simple_horizontal_edge_sse2
-vp8_loop_filter_simple_mbh_media=vp8_loop_filter_simple_horizontal_edge_armv6
-vp8_loop_filter_simple_mbh_neon=vp8_loop_filter_mbhs_neon
-
-prototype void vp8_loop_filter_simple_bv "unsigned char *y, int ystride, const unsigned char *blimit"
-specialize vp8_loop_filter_simple_bv mmx sse2 media neon
-vp8_loop_filter_simple_bv_c=vp8_loop_filter_bvs_c
-vp8_loop_filter_simple_bv_mmx=vp8_loop_filter_bvs_mmx
-vp8_loop_filter_simple_bv_sse2=vp8_loop_filter_bvs_sse2
-vp8_loop_filter_simple_bv_media=vp8_loop_filter_bvs_armv6
-vp8_loop_filter_simple_bv_neon=vp8_loop_filter_bvs_neon
-
-prototype void vp8_loop_filter_simple_bh "unsigned char *y, int ystride, const unsigned char *blimit"
-specialize vp8_loop_filter_simple_bh mmx sse2 media neon
-vp8_loop_filter_simple_bh_c=vp8_loop_filter_bhs_c
-vp8_loop_filter_simple_bh_mmx=vp8_loop_filter_bhs_mmx
-vp8_loop_filter_simple_bh_sse2=vp8_loop_filter_bhs_sse2
-vp8_loop_filter_simple_bh_media=vp8_loop_filter_bhs_armv6
-vp8_loop_filter_simple_bh_neon=vp8_loop_filter_bhs_neon
-
-#
-# IDCT
-#
-#idct16
-prototype void vp8_short_idct4x4llm "short *input, unsigned char *pred, int pitch, unsigned char *dst, int dst_stride"
-specialize vp8_short_idct4x4llm mmx media neon dspr2
-vp8_short_idct4x4llm_media=vp8_short_idct4x4llm_v6_dual
-vp8_short_idct4x4llm_dspr2=vp8_short_idct4x4llm_dspr2
-
-#iwalsh1
-prototype void vp8_short_inv_walsh4x4_1 "short *input, short *output"
-specialize vp8_short_inv_walsh4x4_1 dspr2
-vp8_short_inv_walsh4x4_1_dspr2=vp8_short_inv_walsh4x4_1_dspr2
-# no asm yet
-
-#iwalsh16
-prototype void vp8_short_inv_walsh4x4 "short *input, short *output"
-specialize vp8_short_inv_walsh4x4 mmx sse2 media neon dspr2
-vp8_short_inv_walsh4x4_media=vp8_short_inv_walsh4x4_v6
-vp8_short_inv_walsh4x4_dspr2=vp8_short_inv_walsh4x4_dspr2
-
-#idct1_scalar_add
-prototype void vp8_dc_only_idct_add "short input, unsigned char *pred, int pred_stride, unsigned char *dst, int dst_stride"
-specialize vp8_dc_only_idct_add mmx media neon dspr2
-vp8_dc_only_idct_add_media=vp8_dc_only_idct_add_v6
-vp8_dc_only_idct_add_dspr2=vp8_dc_only_idct_add_dspr2
-
-#
-# RECON
-#
-prototype void vp8_copy_mem16x16 "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch"
-specialize vp8_copy_mem16x16 mmx sse2 media neon dspr2
-vp8_copy_mem16x16_media=vp8_copy_mem16x16_v6
-vp8_copy_mem16x16_dspr2=vp8_copy_mem16x16_dspr2
-
-prototype void vp8_copy_mem8x8 "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch"
-specialize vp8_copy_mem8x8 mmx media neon dspr2
-vp8_copy_mem8x8_media=vp8_copy_mem8x8_v6
-vp8_copy_mem8x8_dspr2=vp8_copy_mem8x8_dspr2
-
-prototype void vp8_copy_mem8x4 "unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch"
-specialize vp8_copy_mem8x4 mmx media neon dspr2
-vp8_copy_mem8x4_media=vp8_copy_mem8x4_v6
-vp8_copy_mem8x4_dspr2=vp8_copy_mem8x4_dspr2
-
-prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x, unsigned char * yabove_row, unsigned char * yleft, int left_stride, unsigned char * ypred_ptr, int y_stride"
-specialize vp8_build_intra_predictors_mby_s sse2 ssse3
-#TODO: fix assembly for neon
-
-prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x, unsigned char * uabove_row, unsigned char * vabove_row, unsigned char *uleft, unsigned char *vleft, int left_stride, unsigned char * upred_ptr, unsigned char * vpred_ptr, int pred_stride"
-specialize vp8_build_intra_predictors_mbuv_s sse2 ssse3
-
-prototype void vp8_intra4x4_predict "unsigned char *Above, unsigned char *yleft, int left_stride, int b_mode, unsigned char *dst, int dst_stride, unsigned char top_left"
-specialize vp8_intra4x4_predict media
-vp8_intra4x4_predict_media=vp8_intra4x4_predict_armv6
-
-#
-# Postproc
-#
-if [ "$CONFIG_POSTPROC" = "yes" ]; then
- prototype void vp8_mbpost_proc_down "unsigned char *dst, int pitch, int rows, int cols,int flimit"
- specialize vp8_mbpost_proc_down mmx sse2
- vp8_mbpost_proc_down_sse2=vp8_mbpost_proc_down_xmm
-
- prototype void vp8_mbpost_proc_across_ip "unsigned char *dst, int pitch, int rows, int cols,int flimit"
- specialize vp8_mbpost_proc_across_ip sse2
- vp8_mbpost_proc_across_ip_sse2=vp8_mbpost_proc_across_ip_xmm
-
- prototype void vp8_post_proc_down_and_across_mb_row "unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int cols, unsigned char *flimits, int size"
- specialize vp8_post_proc_down_and_across_mb_row sse2
-
- prototype void vp8_plane_add_noise "unsigned char *s, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int w, unsigned int h, int pitch"
- specialize vp8_plane_add_noise mmx sse2
- vp8_plane_add_noise_sse2=vp8_plane_add_noise_wmt
-
- prototype void vp8_blend_mb_inner "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride"
- # no asm yet
-
- prototype void vp8_blend_mb_outer "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride"
- # no asm yet
-
- prototype void vp8_blend_b "unsigned char *y, unsigned char *u, unsigned char *v, int y1, int u1, int v1, int alpha, int stride"
- # no asm yet
-
- prototype void vp8_filter_by_weight16x16 "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight"
- specialize vp8_filter_by_weight16x16 sse2
-
- prototype void vp8_filter_by_weight8x8 "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight"
- specialize vp8_filter_by_weight8x8 sse2
-
- prototype void vp8_filter_by_weight4x4 "unsigned char *src, int src_stride, unsigned char *dst, int dst_stride, int src_weight"
- # no asm yet
-fi
-
-#
-# Subpixel
-#
-prototype void vp8_sixtap_predict16x16 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_sixtap_predict16x16 mmx sse2 ssse3 media neon dspr2
-vp8_sixtap_predict16x16_media=vp8_sixtap_predict16x16_armv6
-vp8_sixtap_predict16x16_dspr2=vp8_sixtap_predict16x16_dspr2
-
-prototype void vp8_sixtap_predict8x8 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_sixtap_predict8x8 mmx sse2 ssse3 media neon dspr2
-vp8_sixtap_predict8x8_media=vp8_sixtap_predict8x8_armv6
-vp8_sixtap_predict8x8_dspr2=vp8_sixtap_predict8x8_dspr2
-
-prototype void vp8_sixtap_predict8x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_sixtap_predict8x4 mmx sse2 ssse3 media neon dspr2
-vp8_sixtap_predict8x4_media=vp8_sixtap_predict8x4_armv6
-vp8_sixtap_predict8x4_dspr2=vp8_sixtap_predict8x4_dspr2
-
-prototype void vp8_sixtap_predict4x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_sixtap_predict4x4 mmx ssse3 media neon dspr2
-vp8_sixtap_predict4x4_media=vp8_sixtap_predict4x4_armv6
-vp8_sixtap_predict4x4_dspr2=vp8_sixtap_predict4x4_dspr2
-
-prototype void vp8_bilinear_predict16x16 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_bilinear_predict16x16 mmx sse2 ssse3 media neon
-vp8_bilinear_predict16x16_media=vp8_bilinear_predict16x16_armv6
-
-prototype void vp8_bilinear_predict8x8 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_bilinear_predict8x8 mmx sse2 ssse3 media neon
-vp8_bilinear_predict8x8_media=vp8_bilinear_predict8x8_armv6
-
-prototype void vp8_bilinear_predict8x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_bilinear_predict8x4 mmx media neon
-vp8_bilinear_predict8x4_media=vp8_bilinear_predict8x4_armv6
-
-prototype void vp8_bilinear_predict4x4 "unsigned char *src, int src_pitch, int xofst, int yofst, unsigned char *dst, int dst_pitch"
-specialize vp8_bilinear_predict4x4 mmx media neon
-vp8_bilinear_predict4x4_media=vp8_bilinear_predict4x4_armv6
-
-#
-# Whole-pixel Variance
-#
-prototype unsigned int vp8_variance4x4 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance4x4 mmx sse2
-vp8_variance4x4_sse2=vp8_variance4x4_wmt
-
-prototype unsigned int vp8_variance8x8 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance8x8 mmx sse2 media neon
-vp8_variance8x8_sse2=vp8_variance8x8_wmt
-vp8_variance8x8_media=vp8_variance8x8_armv6
-
-prototype unsigned int vp8_variance8x16 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance8x16 mmx sse2 neon
-vp8_variance8x16_sse2=vp8_variance8x16_wmt
-
-prototype unsigned int vp8_variance16x8 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance16x8 mmx sse2 neon
-vp8_variance16x8_sse2=vp8_variance16x8_wmt
-
-prototype unsigned int vp8_variance16x16 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance16x16 mmx sse2 media neon
-vp8_variance16x16_sse2=vp8_variance16x16_wmt
-vp8_variance16x16_media=vp8_variance16x16_armv6
-
-#
-# Sub-pixel Variance
-#
-prototype unsigned int vp8_sub_pixel_variance4x4 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
-specialize vp8_sub_pixel_variance4x4 mmx sse2
-vp8_sub_pixel_variance4x4_sse2=vp8_sub_pixel_variance4x4_wmt
-
-prototype unsigned int vp8_sub_pixel_variance8x8 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
-specialize vp8_sub_pixel_variance8x8 mmx sse2 media neon
-vp8_sub_pixel_variance8x8_sse2=vp8_sub_pixel_variance8x8_wmt
-vp8_sub_pixel_variance8x8_media=vp8_sub_pixel_variance8x8_armv6
-
-prototype unsigned int vp8_sub_pixel_variance8x16 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
-specialize vp8_sub_pixel_variance8x16 mmx sse2
-vp8_sub_pixel_variance8x16_sse2=vp8_sub_pixel_variance8x16_wmt
-
-prototype unsigned int vp8_sub_pixel_variance16x8 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
-specialize vp8_sub_pixel_variance16x8 mmx sse2 ssse3
-vp8_sub_pixel_variance16x8_sse2=vp8_sub_pixel_variance16x8_wmt
-
-prototype unsigned int vp8_sub_pixel_variance16x16 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
-specialize vp8_sub_pixel_variance16x16 mmx sse2 ssse3 media neon
-vp8_sub_pixel_variance16x16_sse2=vp8_sub_pixel_variance16x16_wmt
-vp8_sub_pixel_variance16x16_media=vp8_sub_pixel_variance16x16_armv6
-
-prototype unsigned int vp8_variance_halfpixvar16x16_h "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance_halfpixvar16x16_h mmx sse2 media neon
-vp8_variance_halfpixvar16x16_h_sse2=vp8_variance_halfpixvar16x16_h_wmt
-vp8_variance_halfpixvar16x16_h_media=vp8_variance_halfpixvar16x16_h_armv6
-
-prototype unsigned int vp8_variance_halfpixvar16x16_v "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance_halfpixvar16x16_v mmx sse2 media neon
-vp8_variance_halfpixvar16x16_v_sse2=vp8_variance_halfpixvar16x16_v_wmt
-vp8_variance_halfpixvar16x16_v_media=vp8_variance_halfpixvar16x16_v_armv6
-
-prototype unsigned int vp8_variance_halfpixvar16x16_hv "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_variance_halfpixvar16x16_hv mmx sse2 media neon
-vp8_variance_halfpixvar16x16_hv_sse2=vp8_variance_halfpixvar16x16_hv_wmt
-vp8_variance_halfpixvar16x16_hv_media=vp8_variance_halfpixvar16x16_hv_armv6
-
-#
-# Single block SAD
-#
-prototype unsigned int vp8_sad4x4 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp8_sad4x4 mmx sse2 neon
-vp8_sad4x4_sse2=vp8_sad4x4_wmt
-
-prototype unsigned int vp8_sad8x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp8_sad8x8 mmx sse2 neon
-vp8_sad8x8_sse2=vp8_sad8x8_wmt
-
-prototype unsigned int vp8_sad8x16 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp8_sad8x16 mmx sse2 neon
-vp8_sad8x16_sse2=vp8_sad8x16_wmt
-
-prototype unsigned int vp8_sad16x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp8_sad16x8 mmx sse2 neon
-vp8_sad16x8_sse2=vp8_sad16x8_wmt
-
-prototype unsigned int vp8_sad16x16 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp8_sad16x16 mmx sse2 sse3 media neon
-vp8_sad16x16_sse2=vp8_sad16x16_wmt
-vp8_sad16x16_media=vp8_sad16x16_armv6
-
-#
-# Multi-block SAD, comparing a reference to N blocks 1 pixel apart horizontally
-#
-prototype void vp8_sad4x4x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp8_sad4x4x3 sse3
-
-prototype void vp8_sad8x8x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp8_sad8x8x3 sse3
-
-prototype void vp8_sad8x16x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp8_sad8x16x3 sse3
-
-prototype void vp8_sad16x8x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp8_sad16x8x3 sse3 ssse3
-
-prototype void vp8_sad16x16x3 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp8_sad16x16x3 sse3 ssse3
-
-# Note the only difference in the following prototypes is that they return into
-# an array of short
-prototype void vp8_sad4x4x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array"
-specialize vp8_sad4x4x8 sse4_1
-vp8_sad4x4x8_sse4_1=vp8_sad4x4x8_sse4
-
-prototype void vp8_sad8x8x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array"
-specialize vp8_sad8x8x8 sse4_1
-vp8_sad8x8x8_sse4_1=vp8_sad8x8x8_sse4
-
-prototype void vp8_sad8x16x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array"
-specialize vp8_sad8x16x8 sse4_1
-vp8_sad8x16x8_sse4_1=vp8_sad8x16x8_sse4
-
-prototype void vp8_sad16x8x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array"
-specialize vp8_sad16x8x8 sse4_1
-vp8_sad16x8x8_sse4_1=vp8_sad16x8x8_sse4
-
-prototype void vp8_sad16x16x8 "const unsigned char *src_ptr, int src_stride, const unsigned char *ref_ptr, int ref_stride, unsigned short *sad_array"
-specialize vp8_sad16x16x8 sse4_1
-vp8_sad16x16x8_sse4_1=vp8_sad16x16x8_sse4
-
-#
-# Multi-block SAD, comparing a reference to N independent blocks
-#
-prototype void vp8_sad4x4x4d "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp8_sad4x4x4d sse3
-
-prototype void vp8_sad8x8x4d "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp8_sad8x8x4d sse3
-
-prototype void vp8_sad8x16x4d "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp8_sad8x16x4d sse3
-
-prototype void vp8_sad16x8x4d "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp8_sad16x8x4d sse3
-
-prototype void vp8_sad16x16x4d "const unsigned char *src_ptr, int src_stride, const unsigned char * const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp8_sad16x16x4d sse3
-
-#
-# Encoder functions below this point.
-#
-if [ "$CONFIG_VP8_ENCODER" = "yes" ]; then
-
-#
-# Sum of squares (vector)
-#
-prototype unsigned int vp8_get_mb_ss "const short *"
-specialize vp8_get_mb_ss mmx sse2
-
-#
-# SSE (Sum Squared Error)
-#
-prototype unsigned int vp8_sub_pixel_mse16x16 "const unsigned char *src_ptr, int source_stride, int xoffset, int yoffset, const unsigned char *ref_ptr, int Refstride, unsigned int *sse"
-specialize vp8_sub_pixel_mse16x16 mmx sse2
-vp8_sub_pixel_mse16x16_sse2=vp8_sub_pixel_mse16x16_wmt
-
-prototype unsigned int vp8_mse16x16 "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp8_mse16x16 mmx sse2 media neon
-vp8_mse16x16_sse2=vp8_mse16x16_wmt
-vp8_mse16x16_media=vp8_mse16x16_armv6
-
-prototype unsigned int vp8_get4x4sse_cs "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride"
-specialize vp8_get4x4sse_cs mmx neon
-
-#
-# Block copy
-#
-case $arch in
- x86*)
- prototype void vp8_copy32xn "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride, int n"
- specialize vp8_copy32xn sse2 sse3
- ;;
-esac
-
-#
-# Structured Similarity (SSIM)
-#
-if [ "$CONFIG_INTERNAL_STATS" = "yes" ]; then
- [ $arch = "x86_64" ] && sse2_on_x86_64=sse2
-
- prototype void vp8_ssim_parms_8x8 "unsigned char *s, int sp, unsigned char *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr"
- specialize vp8_ssim_parms_8x8 $sse2_on_x86_64
-
- prototype void vp8_ssim_parms_16x16 "unsigned char *s, int sp, unsigned char *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr"
- specialize vp8_ssim_parms_16x16 $sse2_on_x86_64
-fi
-
-#
-# Forward DCT
-#
-prototype void vp8_short_fdct4x4 "short *input, short *output, int pitch"
-specialize vp8_short_fdct4x4 mmx sse2 media neon
-vp8_short_fdct4x4_media=vp8_short_fdct4x4_armv6
-
-prototype void vp8_short_fdct8x4 "short *input, short *output, int pitch"
-specialize vp8_short_fdct8x4 mmx sse2 media neon
-vp8_short_fdct8x4_media=vp8_short_fdct8x4_armv6
-
-prototype void vp8_short_walsh4x4 "short *input, short *output, int pitch"
-specialize vp8_short_walsh4x4 sse2 media neon
-vp8_short_walsh4x4_media=vp8_short_walsh4x4_armv6
-
-#
-# Quantizer
-#
-prototype void vp8_regular_quantize_b "struct block *, struct blockd *"
-specialize vp8_regular_quantize_b sse2 #sse4_1
-# TODO(johann) Update sse4 implementation and re-enable
-#vp8_regular_quantize_b_sse4_1=vp8_regular_quantize_b_sse4
-
-prototype void vp8_fast_quantize_b "struct block *, struct blockd *"
-specialize vp8_fast_quantize_b sse2 ssse3 media neon
-vp8_fast_quantize_b_media=vp8_fast_quantize_b_armv6
-
-prototype void vp8_regular_quantize_b_pair "struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2"
-# no asm yet
-
-prototype void vp8_fast_quantize_b_pair "struct block *b1, struct block *b2, struct blockd *d1, struct blockd *d2"
-specialize vp8_fast_quantize_b_pair neon
-
-prototype void vp8_quantize_mb "struct macroblock *"
-specialize vp8_quantize_mb neon
-
-prototype void vp8_quantize_mby "struct macroblock *"
-specialize vp8_quantize_mby neon
-
-prototype void vp8_quantize_mbuv "struct macroblock *"
-specialize vp8_quantize_mbuv neon
-
-#
-# Block subtraction
-#
-prototype int vp8_block_error "short *coeff, short *dqcoeff"
-specialize vp8_block_error mmx sse2
-vp8_block_error_sse2=vp8_block_error_xmm
-
-prototype int vp8_mbblock_error "struct macroblock *mb, int dc"
-specialize vp8_mbblock_error mmx sse2
-vp8_mbblock_error_sse2=vp8_mbblock_error_xmm
-
-prototype int vp8_mbuverror "struct macroblock *mb"
-specialize vp8_mbuverror mmx sse2
-vp8_mbuverror_sse2=vp8_mbuverror_xmm
-
-prototype void vp8_subtract_b "struct block *be, struct blockd *bd, int pitch"
-specialize vp8_subtract_b mmx sse2 media neon
-vp8_subtract_b_media=vp8_subtract_b_armv6
-
-prototype void vp8_subtract_mby "short *diff, unsigned char *src, int src_stride, unsigned char *pred, int pred_stride"
-specialize vp8_subtract_mby mmx sse2 media neon
-vp8_subtract_mby_media=vp8_subtract_mby_armv6
-
-prototype void vp8_subtract_mbuv "short *diff, unsigned char *usrc, unsigned char *vsrc, int src_stride, unsigned char *upred, unsigned char *vpred, int pred_stride"
-specialize vp8_subtract_mbuv mmx sse2 media neon
-vp8_subtract_mbuv_media=vp8_subtract_mbuv_armv6
-
-#
-# Motion search
-#
-prototype int vp8_full_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv"
-specialize vp8_full_search_sad sse3 sse4_1
-vp8_full_search_sad_sse3=vp8_full_search_sadx3
-vp8_full_search_sad_sse4_1=vp8_full_search_sadx8
-
-prototype int vp8_refining_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv"
-specialize vp8_refining_search_sad sse3
-vp8_refining_search_sad_sse3=vp8_refining_search_sadx4
-
-prototype int vp8_diamond_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, int *mvcost[2], union int_mv *center_mv"
-vp8_diamond_search_sad_sse3=vp8_diamond_search_sadx4
-
-#
-# Alt-ref Noise Reduction (ARNR)
-#
-if [ "$CONFIG_REALTIME_ONLY" != "yes" ]; then
- prototype void vp8_temporal_filter_apply "unsigned char *frame1, unsigned int stride, unsigned char *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, unsigned short *count"
- specialize vp8_temporal_filter_apply sse2
-fi
-
-#
-# Pick Loopfilter
-#
-prototype void vp8_yv12_copy_partial_frame "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
-specialize vp8_yv12_copy_partial_frame neon
-
-#
-# Denoiser filter
-#
-if [ "$CONFIG_TEMPORAL_DENOISING" = "yes" ]; then
- prototype int vp8_denoiser_filter "struct yv12_buffer_config* mc_running_avg, struct yv12_buffer_config* running_avg, struct macroblock* signal, unsigned int motion_magnitude2, int y_offset, int uv_offset"
- specialize vp8_denoiser_filter sse2
-fi
-
-# End of encoder only functions
-fi
diff --git a/libvpx/vp8/common/setupintrarecon.h b/libvpx/vp8/common/setupintrarecon.h
index e515c3a..608f4a9 100644
--- a/libvpx/vp8/common/setupintrarecon.h
+++ b/libvpx/vp8/common/setupintrarecon.h
@@ -8,8 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_SETUPINTRARECON_H_
+#define VP8_COMMON_SETUPINTRARECON_H_
#include "vpx_scale/yv12config.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf);
extern void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf);
@@ -31,3 +37,9 @@ void setup_intra_recon_left(unsigned char *y_buffer,
for (i = 0; i < 8; i++)
v_buffer[uv_stride *i] = (unsigned char) 129;
}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_SETUPINTRARECON_H_
diff --git a/libvpx/vp8/common/swapyv12buffer.h b/libvpx/vp8/common/swapyv12buffer.h
index a6473ed..1d66cd3 100644
--- a/libvpx/vp8/common/swapyv12buffer.h
+++ b/libvpx/vp8/common/swapyv12buffer.h
@@ -9,11 +9,19 @@
*/
-#ifndef SWAPYV12_BUFFER_H
-#define SWAPYV12_BUFFER_H
+#ifndef VP8_COMMON_SWAPYV12BUFFER_H_
+#define VP8_COMMON_SWAPYV12BUFFER_H_
#include "vpx_scale/yv12config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_swap_yv12_buffer(YV12_BUFFER_CONFIG *new_frame, YV12_BUFFER_CONFIG *last_frame);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_SWAPYV12BUFFER_H_
diff --git a/libvpx/vp8/common/systemdependent.h b/libvpx/vp8/common/systemdependent.h
index e6b0456..3d44e37 100644
--- a/libvpx/vp8/common/systemdependent.h
+++ b/libvpx/vp8/common/systemdependent.h
@@ -8,8 +8,20 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_SYSTEMDEPENDENT_H_
+#define VP8_COMMON_SYSTEMDEPENDENT_H_
#include "vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct VP8Common;
void vp8_machine_specific_config(struct VP8Common *);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_SYSTEMDEPENDENT_H_
diff --git a/libvpx/vp8/common/threading.h b/libvpx/vp8/common/threading.h
index ed9e3e6..01c82db 100644
--- a/libvpx/vp8/common/threading.h
+++ b/libvpx/vp8/common/threading.h
@@ -9,8 +9,12 @@
*/
-#ifndef _PTHREAD_EMULATION
-#define _PTHREAD_EMULATION
+#ifndef VP8_COMMON_THREADING_H_
+#define VP8_COMMON_THREADING_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#if CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD
@@ -183,4 +187,8 @@ static inline int sem_destroy(sem_t * sem)
#endif /* CONFIG_OS_SUPPORT && CONFIG_MULTITHREAD */
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_THREADING_H_
diff --git a/libvpx/vp8/common/treecoder.h b/libvpx/vp8/common/treecoder.h
index ebf51c5..d22b7c5 100644
--- a/libvpx/vp8/common/treecoder.h
+++ b/libvpx/vp8/common/treecoder.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_TREECODER_H
-#define __INC_TREECODER_H
+#ifndef VP8_COMMON_TREECODER_H_
+#define VP8_COMMON_TREECODER_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
typedef unsigned char vp8bc_index_t; /* probability index */
@@ -87,4 +91,8 @@ void vp8bc_tree_probs_from_distribution(
);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_TREECODER_H_
diff --git a/libvpx/vp8/common/variance.h b/libvpx/vp8/common/variance.h
index 01193b8..89a32a7 100644
--- a/libvpx/vp8/common/variance.h
+++ b/libvpx/vp8/common/variance.h
@@ -9,11 +9,15 @@
*/
-#ifndef VARIANCE_H
-#define VARIANCE_H
+#ifndef VP8_COMMON_VARIANCE_H_
+#define VP8_COMMON_VARIANCE_H_
#include "vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef unsigned int(*vp8_sad_fn_t)(
const unsigned char *src_ptr,
int source_stride,
@@ -112,4 +116,8 @@ typedef struct variance_vtable
#endif
} vp8_variance_fn_ptr_t;
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_COMMON_VARIANCE_H_
diff --git a/libvpx/vp8/common/vp8_entropymodedata.h b/libvpx/vp8/common/vp8_entropymodedata.h
index 13e9a92..c4aed49 100644
--- a/libvpx/vp8/common/vp8_entropymodedata.h
+++ b/libvpx/vp8/common/vp8_entropymodedata.h
@@ -8,6 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_COMMON_VP8_ENTROPYMODEDATA_H_
+#define VP8_COMMON_VP8_ENTROPYMODEDATA_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
/*Generated file, included by entropymode.c*/
@@ -240,3 +246,9 @@ const vp8_prob vp8_kf_bmode_prob
{ 112, 19, 12, 61, 195, 128, 48, 4, 24 }
}
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_VP8_ENTROPYMODEDATA_H_
diff --git a/libvpx/vp8/common/x86/filter_x86.h b/libvpx/vp8/common/x86/filter_x86.h
index cfadaee..d282841 100644
--- a/libvpx/vp8/common/x86/filter_x86.h
+++ b/libvpx/vp8/common/x86/filter_x86.h
@@ -8,11 +8,15 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef FILTER_X86_H
-#define FILTER_X86_H
+#ifndef VP8_COMMON_X86_FILTER_X86_H_
+#define VP8_COMMON_X86_FILTER_X86_H_
#include "vpx_ports/mem.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* x86 assembly specific copy of vp8/common/filter.c:vp8_bilinear_filters with
* duplicated values */
@@ -22,4 +26,8 @@ extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_4[8][8]);
/* duplicated 8x */
extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_8[8][16]);
-#endif /* FILTER_X86_H */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_COMMON_X86_FILTER_X86_H_
diff --git a/libvpx/vp8/common/x86/loopfilter_mmx.asm b/libvpx/vp8/common/x86/loopfilter_mmx.asm
index f388d24..88a07b9 100644
--- a/libvpx/vp8/common/x86/loopfilter_mmx.asm
+++ b/libvpx/vp8/common/x86/loopfilter_mmx.asm
@@ -527,7 +527,7 @@ sym(vp8_loop_filter_vertical_edge_mmx):
pxor mm7, [GLOBAL(t80)] ; unoffset
; mm7 = q1
- ; tranpose and write back
+ ; transpose and write back
; mm1 = 72 62 52 42 32 22 12 02
; mm6 = 73 63 53 43 33 23 13 03
; mm3 = 74 64 54 44 34 24 14 04
@@ -1289,7 +1289,7 @@ sym(vp8_mbloop_filter_vertical_edge_mmx):
pxor mm6, [GLOBAL(t80)] ; mm6 = 71 61 51 41 31 21 11 01
pxor mm3, [GLOBAL(t80)] ; mm3 = 76 66 56 46 36 26 15 06
- ; tranpose and write back
+ ; transpose and write back
movq mm0, [rdx] ; mm0 = 70 60 50 40 30 20 10 00
movq mm1, mm0 ; mm0 = 70 60 50 40 30 20 10 00
diff --git a/libvpx/vp8/common/x86/loopfilter_sse2.asm b/libvpx/vp8/common/x86/loopfilter_sse2.asm
index a66753b..1913abc 100644
--- a/libvpx/vp8/common/x86/loopfilter_sse2.asm
+++ b/libvpx/vp8/common/x86/loopfilter_sse2.asm
@@ -958,7 +958,7 @@ sym(vp8_loop_filter_vertical_edge_sse2):
; start work on filters
B_FILTER 2
- ; tranpose and write back - only work on q1, q0, p0, p1
+ ; transpose and write back - only work on q1, q0, p0, p1
BV_TRANSPOSE
; store 16-line result
@@ -1023,7 +1023,7 @@ sym(vp8_loop_filter_vertical_edge_uv_sse2):
; start work on filters
B_FILTER 2
- ; tranpose and write back - only work on q1, q0, p0, p1
+ ; transpose and write back - only work on q1, q0, p0, p1
BV_TRANSPOSE
lea rdi, [rsi + rax] ; rdi points to row +1 for indirect addressing
diff --git a/libvpx/vp8/decoder/dboolhuff.h b/libvpx/vp8/decoder/dboolhuff.h
index 4c0ca1c..36af7ee 100644
--- a/libvpx/vp8/decoder/dboolhuff.h
+++ b/libvpx/vp8/decoder/dboolhuff.h
@@ -9,8 +9,8 @@
*/
-#ifndef DBOOLHUFF_H_
-#define DBOOLHUFF_H_
+#ifndef VP8_DECODER_DBOOLHUFF_H_
+#define VP8_DECODER_DBOOLHUFF_H_
#include <stddef.h>
#include <limits.h>
@@ -19,6 +19,10 @@
#include "vpx_ports/mem.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef size_t VP8_BD_VALUE;
#define VP8_BD_VALUE_SIZE ((int)sizeof(VP8_BD_VALUE)*CHAR_BIT)
@@ -135,4 +139,8 @@ static int vp8dx_bool_error(BOOL_DECODER *br)
return 0;
}
-#endif // DBOOLHUFF_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_DBOOLHUFF_H_
diff --git a/libvpx/vp8/decoder/decodframe.c b/libvpx/vp8/decoder/decodeframe.c
index 16da78a..bfde599 100644
--- a/libvpx/vp8/decoder/decodframe.c
+++ b/libvpx/vp8/decoder/decodeframe.c
@@ -680,7 +680,6 @@ static void decode_mb_rows(VP8D_COMP *pbi)
vp8_loop_filter_row_simple(pc, lf_mic, mb_row-1,
recon_y_stride, recon_uv_stride,
lf_dst[0], lf_dst[1], lf_dst[2]);
-
if(mb_row > 1)
{
yv12_extend_frame_left_right_c(yv12_fb_new,
@@ -691,10 +690,6 @@ static void decode_mb_rows(VP8D_COMP *pbi)
eb_dst[0] += recon_y_stride * 16;
eb_dst[1] += recon_uv_stride * 8;
eb_dst[2] += recon_uv_stride * 8;
-
- if(mb_row == 2)
- yv12_extend_frame_top_c(yv12_fb_new);
-
}
lf_dst[0] += recon_y_stride * 16;
@@ -713,13 +708,9 @@ static void decode_mb_rows(VP8D_COMP *pbi)
eb_dst[0],
eb_dst[1],
eb_dst[2]);
-
eb_dst[0] += recon_y_stride * 16;
eb_dst[1] += recon_uv_stride * 8;
eb_dst[2] += recon_uv_stride * 8;
-
- if(mb_row == 1)
- yv12_extend_frame_top_c(yv12_fb_new);
}
}
}
@@ -747,7 +738,7 @@ static void decode_mb_rows(VP8D_COMP *pbi)
eb_dst[0],
eb_dst[1],
eb_dst[2]);
-
+ yv12_extend_frame_top_c(yv12_fb_new);
yv12_extend_frame_bottom_c(yv12_fb_new);
}
diff --git a/libvpx/vp8/decoder/decodemv.h b/libvpx/vp8/decoder/decodemv.h
index 05a33d2..f33b073 100644
--- a/libvpx/vp8/decoder/decodemv.h
+++ b/libvpx/vp8/decoder/decodemv.h
@@ -8,11 +8,19 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef DECODEMV_H_
-#define DECODEMV_H_
+#ifndef VP8_DECODER_DECODEMV_H_
+#define VP8_DECODER_DECODEMV_H_
#include "onyxd_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_decode_mode_mvs(VP8D_COMP *);
-#endif // DECODEMV_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_DECODEMV_H_
diff --git a/libvpx/vp8/decoder/decoderthreading.h b/libvpx/vp8/decoder/decoderthreading.h
index bc716e4..c563cf6 100644
--- a/libvpx/vp8/decoder/decoderthreading.h
+++ b/libvpx/vp8/decoder/decoderthreading.h
@@ -8,8 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef DECODERTHREADING_H_
-#define DECODERTHREADING_H_
+#ifndef VP8_DECODER_DECODERTHREADING_H_
+#define VP8_DECODER_DECODERTHREADING_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#if CONFIG_MULTITHREAD
void vp8mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd);
@@ -19,4 +23,8 @@ void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows);
void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows);
#endif
-#endif // DECODERTHREADING_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_DECODERTHREADING_H_
diff --git a/libvpx/vp8/decoder/detokenize.h b/libvpx/vp8/decoder/detokenize.h
index f2130b3..f0b1254 100644
--- a/libvpx/vp8/decoder/detokenize.h
+++ b/libvpx/vp8/decoder/detokenize.h
@@ -8,12 +8,20 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef DETOKENIZE_H_
-#define DETOKENIZE_H_
+#ifndef VP8_DECODER_DETOKENIZE_H_
+#define VP8_DECODER_DETOKENIZE_H_
#include "onyxd_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_reset_mb_tokens_context(MACROBLOCKD *x);
int vp8_decode_mb_tokens(VP8D_COMP *, MACROBLOCKD *);
-#endif // DETOKENIZE_H
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_DETOKENIZE_H_
diff --git a/libvpx/vp8/decoder/ec_types.h b/libvpx/vp8/decoder/ec_types.h
index b24bfd9..3af5ca8 100644
--- a/libvpx/vp8/decoder/ec_types.h
+++ b/libvpx/vp8/decoder/ec_types.h
@@ -8,8 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VP8_DEC_EC_TYPES_H
-#define VP8_DEC_EC_TYPES_H
+#ifndef VP8_DECODER_EC_TYPES_H_
+#define VP8_DECODER_EC_TYPES_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define MAX_OVERLAPS 16
@@ -47,4 +51,8 @@ typedef struct
MV_REFERENCE_FRAME ref_frame;
} EC_BLOCK;
-#endif // VP8_DEC_EC_TYPES_H
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_EC_TYPES_H_
diff --git a/libvpx/vp8/decoder/error_concealment.h b/libvpx/vp8/decoder/error_concealment.h
index fb96b36..9a1e024 100644
--- a/libvpx/vp8/decoder/error_concealment.h
+++ b/libvpx/vp8/decoder/error_concealment.h
@@ -9,12 +9,16 @@
*/
-#ifndef ERROR_CONCEALMENT_H_
-#define ERROR_CONCEALMENT_H_
+#ifndef VP8_DECODER_ERROR_CONCEALMENT_H_
+#define VP8_DECODER_ERROR_CONCEALMENT_H_
#include "onyxd_int.h"
#include "ec_types.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Allocate memory for the overlap lists */
int vp8_alloc_overlap_lists(VP8D_COMP *pbi);
@@ -38,4 +42,8 @@ void vp8_interpolate_motion(MACROBLOCKD *mb,
*/
void vp8_conceal_corrupt_mb(MACROBLOCKD *xd);
-#endif // ERROR_CONCEALMENT_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_ERROR_CONCEALMENT_H_
diff --git a/libvpx/vp8/decoder/onyxd_int.h b/libvpx/vp8/decoder/onyxd_int.h
index 54a98f7..8ef4894 100644
--- a/libvpx/vp8/decoder/onyxd_int.h
+++ b/libvpx/vp8/decoder/onyxd_int.h
@@ -9,8 +9,8 @@
*/
-#ifndef ONYXD_INT_H_
-#define ONYXD_INT_H_
+#ifndef VP8_DECODER_ONYXD_INT_H_
+#define VP8_DECODER_ONYXD_INT_H_
#include "vpx_config.h"
#include "vp8/common/onyxd.h"
@@ -22,6 +22,10 @@
#include "ec_types.h"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct
{
int ithread;
@@ -148,4 +152,8 @@ int vp8_remove_decoder_instances(struct frame_buffers *fb);
} while(0)
#endif
-#endif // ONYXD_INT_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_ONYXD_INT_H_
diff --git a/libvpx/vp8/decoder/treereader.h b/libvpx/vp8/decoder/treereader.h
index 9393bb4..35ee696 100644
--- a/libvpx/vp8/decoder/treereader.h
+++ b/libvpx/vp8/decoder/treereader.h
@@ -9,12 +9,16 @@
*/
-#ifndef TREEREADER_H_
-#define TREEREADER_H_
+#ifndef VP8_DECODER_TREEREADER_H_
+#define VP8_DECODER_TREEREADER_H_
#include "vp8/common/treecoder.h"
#include "dboolhuff.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef BOOL_DECODER vp8_reader;
#define vp8_read vp8dx_decode_bool
@@ -37,4 +41,8 @@ static int vp8_treed_read(
return -i;
}
-#endif // TREEREADER_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_DECODER_TREEREADER_H_
diff --git a/libvpx/vp8/encoder/arm/neon/denoising_neon.c b/libvpx/vp8/encoder/arm/neon/denoising_neon.c
new file mode 100644
index 0000000..3f85397
--- /dev/null
+++ b/libvpx/vp8/encoder/arm/neon/denoising_neon.c
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <arm_neon.h>
+
+#include "vp8/encoder/denoising.h"
+#include "vpx_mem/vpx_mem.h"
+#include "./vp8_rtcd.h"
+
+/*
+ * The filter function was modified to reduce the computational complexity.
+ *
+ * Step 1:
+ * Instead of applying tap coefficients for each pixel, we calculated the
+ * pixel adjustments vs. pixel diff value ahead of time.
+ * adjustment = filtered_value - current_raw
+ * = (filter_coefficient * diff + 128) >> 8
+ * where
+ * filter_coefficient = (255 << 8) / (256 + ((abs_diff * 330) >> 3));
+ * filter_coefficient += filter_coefficient /
+ * (3 + motion_magnitude_adjustment);
+ * filter_coefficient is clamped to 0 ~ 255.
+ *
+ * Step 2:
+ * The adjustment vs. diff curve becomes flat very quick when diff increases.
+ * This allowed us to use only several levels to approximate the curve without
+ * changing the filtering algorithm too much.
+ * The adjustments were further corrected by checking the motion magnitude.
+ * The levels used are:
+ * diff level adjustment w/o adjustment w/
+ * motion correction motion correction
+ * [-255, -16] 3 -6 -7
+ * [-15, -8] 2 -4 -5
+ * [-7, -4] 1 -3 -4
+ * [-3, 3] 0 diff diff
+ * [4, 7] 1 3 4
+ * [8, 15] 2 4 5
+ * [16, 255] 3 6 7
+ */
+
+int vp8_denoiser_filter_neon(YV12_BUFFER_CONFIG *mc_running_avg,
+ YV12_BUFFER_CONFIG *running_avg,
+ MACROBLOCK *signal, unsigned int motion_magnitude,
+ int y_offset, int uv_offset) {
+ /* If motion_magnitude is small, making the denoiser more aggressive by
+ * increasing the adjustment for each level, level1 adjustment is
+ * increased, the deltas stay the same.
+ */
+ const uint8x16_t v_level1_adjustment = vdupq_n_u8(
+ (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 4 : 3);
+ const uint8x16_t v_delta_level_1_and_2 = vdupq_n_u8(1);
+ const uint8x16_t v_delta_level_2_and_3 = vdupq_n_u8(2);
+ const uint8x16_t v_level1_threshold = vdupq_n_u8(4);
+ const uint8x16_t v_level2_threshold = vdupq_n_u8(8);
+ const uint8x16_t v_level3_threshold = vdupq_n_u8(16);
+
+ /* Local variables for array pointers and strides. */
+ unsigned char *sig = signal->thismb;
+ int sig_stride = 16;
+ unsigned char *mc_running_avg_y = mc_running_avg->y_buffer + y_offset;
+ int mc_running_avg_y_stride = mc_running_avg->y_stride;
+ unsigned char *running_avg_y = running_avg->y_buffer + y_offset;
+ int running_avg_y_stride = running_avg->y_stride;
+
+ /* Go over lines. */
+ int i;
+ int sum_diff = 0;
+ for (i = 0; i < 16; ++i) {
+ int8x16_t v_sum_diff = vdupq_n_s8(0);
+ uint8x16_t v_running_avg_y;
+
+ /* Load inputs. */
+ const uint8x16_t v_sig = vld1q_u8(sig);
+ const uint8x16_t v_mc_running_avg_y = vld1q_u8(mc_running_avg_y);
+
+ /* Calculate absolute difference and sign masks. */
+ const uint8x16_t v_abs_diff = vabdq_u8(v_sig, v_mc_running_avg_y);
+ const uint8x16_t v_diff_pos_mask = vcltq_u8(v_sig, v_mc_running_avg_y);
+ const uint8x16_t v_diff_neg_mask = vcgtq_u8(v_sig, v_mc_running_avg_y);
+
+ /* Figure out which level that put us in. */
+ const uint8x16_t v_level1_mask = vcleq_u8(v_level1_threshold,
+ v_abs_diff);
+ const uint8x16_t v_level2_mask = vcleq_u8(v_level2_threshold,
+ v_abs_diff);
+ const uint8x16_t v_level3_mask = vcleq_u8(v_level3_threshold,
+ v_abs_diff);
+
+ /* Calculate absolute adjustments for level 1, 2 and 3. */
+ const uint8x16_t v_level2_adjustment = vandq_u8(v_level2_mask,
+ v_delta_level_1_and_2);
+ const uint8x16_t v_level3_adjustment = vandq_u8(v_level3_mask,
+ v_delta_level_2_and_3);
+ const uint8x16_t v_level1and2_adjustment = vaddq_u8(v_level1_adjustment,
+ v_level2_adjustment);
+ const uint8x16_t v_level1and2and3_adjustment = vaddq_u8(
+ v_level1and2_adjustment, v_level3_adjustment);
+
+ /* Figure adjustment absolute value by selecting between the absolute
+ * difference if in level0 or the value for level 1, 2 and 3.
+ */
+ const uint8x16_t v_abs_adjustment = vbslq_u8(v_level1_mask,
+ v_level1and2and3_adjustment, v_abs_diff);
+
+ /* Calculate positive and negative adjustments. Apply them to the signal
+ * and accumulate them. Adjustments are less than eight and the maximum
+ * sum of them (7 * 16) can fit in a signed char.
+ */
+ const uint8x16_t v_pos_adjustment = vandq_u8(v_diff_pos_mask,
+ v_abs_adjustment);
+ const uint8x16_t v_neg_adjustment = vandq_u8(v_diff_neg_mask,
+ v_abs_adjustment);
+ v_running_avg_y = vqaddq_u8(v_sig, v_pos_adjustment);
+ v_running_avg_y = vqsubq_u8(v_running_avg_y, v_neg_adjustment);
+ v_sum_diff = vqaddq_s8(v_sum_diff,
+ vreinterpretq_s8_u8(v_pos_adjustment));
+ v_sum_diff = vqsubq_s8(v_sum_diff,
+ vreinterpretq_s8_u8(v_neg_adjustment));
+
+ /* Store results. */
+ vst1q_u8(running_avg_y, v_running_avg_y);
+
+ /* Sum all the accumulators to have the sum of all pixel differences
+ * for this macroblock.
+ */
+ {
+ int s0 = vgetq_lane_s8(v_sum_diff, 0) +
+ vgetq_lane_s8(v_sum_diff, 1) +
+ vgetq_lane_s8(v_sum_diff, 2) +
+ vgetq_lane_s8(v_sum_diff, 3);
+ int s1 = vgetq_lane_s8(v_sum_diff, 4) +
+ vgetq_lane_s8(v_sum_diff, 5) +
+ vgetq_lane_s8(v_sum_diff, 6) +
+ vgetq_lane_s8(v_sum_diff, 7);
+ int s2 = vgetq_lane_s8(v_sum_diff, 8) +
+ vgetq_lane_s8(v_sum_diff, 9) +
+ vgetq_lane_s8(v_sum_diff, 10) +
+ vgetq_lane_s8(v_sum_diff, 11);
+ int s3 = vgetq_lane_s8(v_sum_diff, 12) +
+ vgetq_lane_s8(v_sum_diff, 13) +
+ vgetq_lane_s8(v_sum_diff, 14) +
+ vgetq_lane_s8(v_sum_diff, 15);
+ sum_diff += s0 + s1+ s2 + s3;
+ }
+
+ /* Update pointers for next iteration. */
+ sig += sig_stride;
+ mc_running_avg_y += mc_running_avg_y_stride;
+ running_avg_y += running_avg_y_stride;
+ }
+
+ /* Too much adjustments => copy block. */
+ if (abs(sum_diff) > SUM_DIFF_THRESHOLD)
+ return COPY_BLOCK;
+
+ /* Tell above level that block was filtered. */
+ vp8_copy_mem16x16(running_avg->y_buffer + y_offset, running_avg_y_stride,
+ signal->thismb, sig_stride);
+ return FILTER_BLOCK;
+}
diff --git a/libvpx/vp8/encoder/bitstream.h b/libvpx/vp8/encoder/bitstream.h
index 455a94f..eef2d79 100644
--- a/libvpx/vp8/encoder/bitstream.h
+++ b/libvpx/vp8/encoder/bitstream.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_BITSTREAM_H
-#define __INC_BITSTREAM_H
+#ifndef VP8_ENCODER_BITSTREAM_H_
+#define VP8_ENCODER_BITSTREAM_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#if HAVE_EDSP
void vp8cx_pack_tokens_armv5(vp8_writer *w, const TOKENEXTRA *p, int xcount,
@@ -43,4 +47,8 @@ void vp8_pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount);
# define pack_mb_row_tokens(a,b) pack_mb_row_tokens_c(a,b)
#endif
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_BITSTREAM_H_
diff --git a/libvpx/vp8/encoder/block.h b/libvpx/vp8/encoder/block.h
index cf74c7a..dd733e5 100644
--- a/libvpx/vp8/encoder/block.h
+++ b/libvpx/vp8/encoder/block.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_BLOCK_H
-#define __INC_BLOCK_H
+#ifndef VP8_ENCODER_BLOCK_H_
+#define VP8_ENCODER_BLOCK_H_
#include "vp8/common/onyx.h"
#include "vp8/common/blockd.h"
@@ -18,6 +18,10 @@
#include "vp8/common/entropy.h"
#include "vpx_ports/mem.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_MODES 20
#define MAX_ERROR_BINS 1024
@@ -160,4 +164,8 @@ typedef struct macroblock
} MACROBLOCK;
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_BLOCK_H_
diff --git a/libvpx/vp8/encoder/boolhuff.h b/libvpx/vp8/encoder/boolhuff.h
index 39ab586..6114215 100644
--- a/libvpx/vp8/encoder/boolhuff.h
+++ b/libvpx/vp8/encoder/boolhuff.h
@@ -16,12 +16,16 @@
* Description : Bool Coder header file.
*
****************************************************************************/
-#ifndef __INC_BOOLHUFF_H
-#define __INC_BOOLHUFF_H
+#ifndef VP8_ENCODER_BOOLHUFF_H_
+#define VP8_ENCODER_BOOLHUFF_H_
#include "vpx_ports/mem.h"
#include "vpx/internal/vpx_codec_internal.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct
{
unsigned int lowvalue;
@@ -125,4 +129,8 @@ static void vp8_encode_bool(BOOL_CODER *br, int bit, int probability)
br->range = range;
}
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_BOOLHUFF_H_
diff --git a/libvpx/vp8/encoder/dct_value_cost.h b/libvpx/vp8/encoder/dct_value_cost.h
index e892765..1cd3eec 100644
--- a/libvpx/vp8/encoder/dct_value_cost.h
+++ b/libvpx/vp8/encoder/dct_value_cost.h
@@ -8,6 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_ENCODER_DCT_VALUE_COST_H_
+#define VP8_ENCODER_DCT_VALUE_COST_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Generated file, included by tokenize.c */
/* Values generated by fill_value_tokens() */
@@ -356,3 +363,9 @@ static const short dct_value_cost[2048*2] =
8134, 8140, 8148, 8170, 8178, 8184, 8192, 8202, 8210, 8216, 8224, 8243,
8251, 8257, 8265, 8275
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_ENCODER_DCT_VALUE_COST_H_
diff --git a/libvpx/vp8/encoder/dct_value_tokens.h b/libvpx/vp8/encoder/dct_value_tokens.h
index ef08eed..c2aadef 100644
--- a/libvpx/vp8/encoder/dct_value_tokens.h
+++ b/libvpx/vp8/encoder/dct_value_tokens.h
@@ -8,6 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_ENCODER_DCT_VALUE_TOKENS_H_
+#define VP8_ENCODER_DCT_VALUE_TOKENS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Generated file, included by tokenize.c */
/* Values generated by fill_value_tokens() */
@@ -697,3 +704,9 @@ static const TOKENVALUE dct_value_tokens[2048*2] =
{10, 3942}, {10, 3944}, {10, 3946}, {10, 3948}, {10, 3950}, {10, 3952},
{10, 3954}, {10, 3956}, {10, 3958}, {10, 3960}
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_ENCODER_DCT_VALUE_TOKENS_H_
diff --git a/libvpx/vp8/encoder/defaultcoefcounts.h b/libvpx/vp8/encoder/defaultcoefcounts.h
index 2c0f3dd..1e8e804 100644
--- a/libvpx/vp8/encoder/defaultcoefcounts.h
+++ b/libvpx/vp8/encoder/defaultcoefcounts.h
@@ -8,6 +8,13 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_ENCODER_DEFAULTCOEFCOUNTS_H_
+#define VP8_ENCODER_DEFAULTCOEFCOUNTS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Generated file, included by entropy.c */
static const unsigned int default_coef_counts[BLOCK_TYPES]
@@ -221,3 +228,9 @@ static const unsigned int default_coef_counts[BLOCK_TYPES]
},
},
};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_ENCODER_DEFAULTCOEFCOUNTS_H_
diff --git a/libvpx/vp8/encoder/denoising.h b/libvpx/vp8/encoder/denoising.h
index b025f5c..cc9913a 100644
--- a/libvpx/vp8/encoder/denoising.h
+++ b/libvpx/vp8/encoder/denoising.h
@@ -13,6 +13,10 @@
#include "block.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define SUM_DIFF_THRESHOLD (16 * 16 * 2)
#define MOTION_MAGNITUDE_THRESHOLD (8*3)
@@ -39,4 +43,8 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
int recon_yoffset,
int recon_uvoffset);
-#endif /* VP8_ENCODER_DENOISING_H_ */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_ENCODER_DENOISING_H_
diff --git a/libvpx/vp8/encoder/encodeframe.h b/libvpx/vp8/encoder/encodeframe.h
index 4dd6ba0..e185c10 100644
--- a/libvpx/vp8/encoder/encodeframe.h
+++ b/libvpx/vp8/encoder/encodeframe.h
@@ -7,8 +7,12 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef ENCODEFRAME_H
-#define ENCODEFRAME_H
+#ifndef VP8_ENCODER_ENCODEFRAME_H_
+#define VP8_ENCODER_ENCODEFRAME_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void vp8_activity_masking(VP8_COMP *cpi, MACROBLOCK *x);
extern void vp8_build_block_offsets(MACROBLOCK *x);
@@ -24,4 +28,8 @@ extern int vp8cx_encode_inter_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
extern int vp8cx_encode_intra_macroblock(VP8_COMP *cpi, MACROBLOCK *x,
TOKENEXTRA **t);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_ENCODEFRAME_H_
diff --git a/libvpx/vp8/encoder/encodeintra.h b/libvpx/vp8/encoder/encodeintra.h
index be2141f..a8d0284 100644
--- a/libvpx/vp8/encoder/encodeintra.h
+++ b/libvpx/vp8/encoder/encodeintra.h
@@ -9,13 +9,21 @@
*/
-#ifndef _ENCODEINTRA_H_
-#define _ENCODEINTRA_H_
+#ifndef VP8_ENCODER_ENCODEINTRA_H_
+#define VP8_ENCODER_ENCODEINTRA_H_
#include "onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int vp8_encode_intra(VP8_COMP *cpi, MACROBLOCK *x, int use_dc_pred);
void vp8_encode_intra16x16mby(MACROBLOCK *x);
void vp8_encode_intra16x16mbuv(MACROBLOCK *x);
void vp8_encode_intra4x4mby(MACROBLOCK *mb);
void vp8_encode_intra4x4block(MACROBLOCK *x, int ib);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_ENCODEINTRA_H_
diff --git a/libvpx/vp8/encoder/encodemb.h b/libvpx/vp8/encoder/encodemb.h
index 6badf7d..0b3ec87 100644
--- a/libvpx/vp8/encoder/encodemb.h
+++ b/libvpx/vp8/encoder/encodemb.h
@@ -9,10 +9,14 @@
*/
-#ifndef __INC_ENCODEMB_H
-#define __INC_ENCODEMB_H
+#ifndef VP8_ENCODER_ENCODEMB_H_
+#define VP8_ENCODER_ENCODEMB_H_
#include "onyx_int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
void vp8_encode_inter16x16(MACROBLOCK *x);
void vp8_build_dcblock(MACROBLOCK *b);
@@ -23,4 +27,8 @@ void vp8_transform_intra_mby(MACROBLOCK *x);
void vp8_optimize_mby(MACROBLOCK *x);
void vp8_optimize_mbuv(MACROBLOCK *x);
void vp8_encode_inter16x16y(MACROBLOCK *x);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_ENCODEMB_H_
diff --git a/libvpx/vp8/encoder/encodemv.h b/libvpx/vp8/encoder/encodemv.h
index a6116c1..722162b 100644
--- a/libvpx/vp8/encoder/encodemv.h
+++ b/libvpx/vp8/encoder/encodemv.h
@@ -9,13 +9,21 @@
*/
-#ifndef __INC_ENCODEMV_H
-#define __INC_ENCODEMV_H
+#ifndef VP8_ENCODER_ENCODEMV_H_
+#define VP8_ENCODER_ENCODEMV_H_
#include "onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_write_mvprobs(VP8_COMP *);
void vp8_encode_motion_vector(vp8_writer *, const MV *, const MV_CONTEXT *);
void vp8_build_component_cost_table(int *mvcost[2], const MV_CONTEXT *mvc, int mvc_flag[2]);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_ENCODEMV_H_
diff --git a/libvpx/vp8/encoder/firstpass.c b/libvpx/vp8/encoder/firstpass.c
index 968c7f3..98e5a71 100644
--- a/libvpx/vp8/encoder/firstpass.c
+++ b/libvpx/vp8/encoder/firstpass.c
@@ -940,9 +940,9 @@ static int64_t estimate_modemvcost(VP8_COMP *cpi,
/* Crude estimate of overhead cost from modes
* << 9 is the normalization to (bits * 512) used in vp8_bits_per_mb
*/
- mode_cost =((((av_pct_inter - av_pct_motion) * zz_cost) +
- (av_pct_motion * motion_cost) +
- (av_intra * intra_cost)) * cpi->common.MBs) * 512;
+ mode_cost = (int64_t)((((av_pct_inter - av_pct_motion) * zz_cost) +
+ (av_pct_motion * motion_cost) +
+ (av_intra * intra_cost)) * cpi->common.MBs) * 512;
return mv_cost + mode_cost;
}
@@ -2310,7 +2310,7 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
pct_extra = (pct_extra > 20) ? 20 : pct_extra;
cpi->twopass.alt_extra_bits =
- (cpi->twopass.gf_group_bits * pct_extra) / 100;
+ (int)(cpi->twopass.gf_group_bits * pct_extra) / 100;
cpi->twopass.gf_group_bits -= cpi->twopass.alt_extra_bits;
cpi->twopass.alt_extra_bits /=
((cpi->baseline_gf_interval-1)>>1);
@@ -2386,7 +2386,7 @@ static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
target_frame_size = max_bits;
if (target_frame_size > cpi->twopass.gf_group_bits)
- target_frame_size = cpi->twopass.gf_group_bits;
+ target_frame_size = (int)cpi->twopass.gf_group_bits;
}
/* Adjust error and bits remaining */
@@ -2444,10 +2444,10 @@ void vp8_second_pass(VP8_COMP *cpi)
find_next_key_frame(cpi, &this_frame_copy);
/* Special case: Error error_resilient_mode mode does not make much
- * sense for two pass but with its current meaning but this code is
+ * sense for two pass but with its current meaning this code is
* designed to stop outlandish behaviour if someone does set it when
* using two pass. It effectively disables GF groups. This is
- * temporary code till we decide what should really happen in this
+ * temporary code until we decide what should really happen in this
* case.
*/
if (cpi->oxcf.error_resilient_mode)
@@ -2773,7 +2773,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
kf_group_intra_err += this_frame->intra_error;
kf_group_coded_err += this_frame->coded_error;
- /* load a the next frame's stats */
+ /* Load the next frame's stats. */
vpx_memcpy(&last_frame, this_frame, sizeof(*this_frame));
input_stats(cpi, this_frame);
diff --git a/libvpx/vp8/encoder/firstpass.h b/libvpx/vp8/encoder/firstpass.h
index 95e1e54..c409ebc 100644
--- a/libvpx/vp8/encoder/firstpass.h
+++ b/libvpx/vp8/encoder/firstpass.h
@@ -9,8 +9,12 @@
*/
-#if !defined __INC_FIRSTPASS_H
-#define __INC_FIRSTPASS_H
+#ifndef VP8_ENCODER_FIRSTPASS_H_
+#define VP8_ENCODER_FIRSTPASS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
extern void vp8_init_first_pass(VP8_COMP *cpi);
extern void vp8_first_pass(VP8_COMP *cpi);
@@ -21,4 +25,8 @@ extern void vp8_second_pass(VP8_COMP *cpi);
extern void vp8_end_second_pass(VP8_COMP *cpi);
extern size_t vp8_firstpass_stats_sz(unsigned int mb_count);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_FIRSTPASS_H_
diff --git a/libvpx/vp8/encoder/lookahead.h b/libvpx/vp8/encoder/lookahead.h
index cf56b75..cad68e6 100644
--- a/libvpx/vp8/encoder/lookahead.h
+++ b/libvpx/vp8/encoder/lookahead.h
@@ -7,11 +7,15 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef LOOKAHEAD_H
-#define LOOKAHEAD_H
+#ifndef VP8_ENCODER_LOOKAHEAD_H_
+#define VP8_ENCODER_LOOKAHEAD_H_
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct lookahead_entry
{
YV12_BUFFER_CONFIG img;
@@ -106,4 +110,8 @@ unsigned int
vp8_lookahead_depth(struct lookahead_ctx *ctx);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_LOOKAHEAD_H_
diff --git a/libvpx/vp8/encoder/mcomp.h b/libvpx/vp8/encoder/mcomp.h
index e36c515..f284f7c 100644
--- a/libvpx/vp8/encoder/mcomp.h
+++ b/libvpx/vp8/encoder/mcomp.h
@@ -9,12 +9,16 @@
*/
-#ifndef __INC_MCOMP_H
-#define __INC_MCOMP_H
+#ifndef VP8_ENCODER_MCOMP_H_
+#define VP8_ENCODER_MCOMP_H_
#include "block.h"
#include "vp8/common/variance.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef VP8_ENTROPY_STATS
extern void init_mv_ref_counts();
extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]);
@@ -104,4 +108,8 @@ typedef int (*vp8_diamond_search_fn_t)
int_mv *center_mv
);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_MCOMP_H_
diff --git a/libvpx/vp8/encoder/modecosts.h b/libvpx/vp8/encoder/modecosts.h
index 99ef119..9281551 100644
--- a/libvpx/vp8/encoder/modecosts.h
+++ b/libvpx/vp8/encoder/modecosts.h
@@ -9,9 +9,17 @@
*/
-#ifndef __INC_MODECOSTS_H
-#define __INC_MODECOSTS_H
+#ifndef VP8_ENCODER_MODECOSTS_H_
+#define VP8_ENCODER_MODECOSTS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
void vp8_init_mode_costs(VP8_COMP *x);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_MODECOSTS_H_
diff --git a/libvpx/vp8/encoder/mr_dissim.h b/libvpx/vp8/encoder/mr_dissim.h
index f8cb135..5a59ce6 100644
--- a/libvpx/vp8/encoder/mr_dissim.h
+++ b/libvpx/vp8/encoder/mr_dissim.h
@@ -9,12 +9,20 @@
*/
-#ifndef __INC_MR_DISSIM_H
-#define __INC_MR_DISSIM_H
+#ifndef VP8_ENCODER_MR_DISSIM_H_
+#define VP8_ENCODER_MR_DISSIM_H_
#include "vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern void vp8_cal_low_res_mb_cols(VP8_COMP *cpi);
extern void vp8_cal_dissimilarity(VP8_COMP *cpi);
extern void vp8_store_drop_frame_info(VP8_COMP *cpi);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_MR_DISSIM_H_
diff --git a/libvpx/vp8/encoder/onyx_if.c b/libvpx/vp8/encoder/onyx_if.c
index 4b60cfd..ef37c0e 100644
--- a/libvpx/vp8/encoder/onyx_if.c
+++ b/libvpx/vp8/encoder/onyx_if.c
@@ -19,7 +19,7 @@
#include "vp8/common/alloccommon.h"
#include "mcomp.h"
#include "firstpass.h"
-#include "psnr.h"
+#include "vpx/internal/vpx_psnr.h"
#include "vpx_scale/vpx_scale.h"
#include "vp8/common/extend.h"
#include "ratectrl.h"
@@ -1401,6 +1401,7 @@ static void update_layer_contexts (VP8_COMP *cpi)
unsigned int i;
double prev_layer_framerate=0;
+ assert(oxcf->number_of_layers <= VPX_TS_MAX_LAYERS);
for (i=0; i<oxcf->number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
@@ -1623,6 +1624,12 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cpi->oxcf.maximum_buffer_size =
rescale((int)cpi->oxcf.maximum_buffer_size,
cpi->oxcf.target_bandwidth, 1000);
+ // Under a configuration change, where maximum_buffer_size may change,
+ // keep buffer level clipped to the maximum allowed buffer size.
+ if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) {
+ cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
+ cpi->buffer_level = cpi->bits_off_target;
+ }
/* Set up frame rate and related parameters rate control values. */
vp8_new_framerate(cpi, cpi->framerate);
@@ -2164,10 +2171,12 @@ void vp8_remove_compressor(VP8_COMP **ptr)
8.0 / 1000.0 / time_encoded;
double samples = 3.0 / 2 * cpi->frames_in_layer[i] *
lst_yv12->y_width * lst_yv12->y_height;
- double total_psnr = vp8_mse2psnr(samples, 255.0,
- cpi->total_error2[i]);
- double total_psnr2 = vp8_mse2psnr(samples, 255.0,
- cpi->total_error2_p[i]);
+ double total_psnr =
+ vpx_sse_to_psnr(samples, 255.0,
+ cpi->total_error2[i]);
+ double total_psnr2 =
+ vpx_sse_to_psnr(samples, 255.0,
+ cpi->total_error2_p[i]);
double total_ssim = 100 * pow(cpi->sum_ssim[i] /
cpi->sum_weights[i], 8.0);
@@ -2184,9 +2193,9 @@ void vp8_remove_compressor(VP8_COMP **ptr)
{
double samples = 3.0 / 2 * cpi->count *
lst_yv12->y_width * lst_yv12->y_height;
- double total_psnr = vp8_mse2psnr(samples, 255.0,
- cpi->total_sq_error);
- double total_psnr2 = vp8_mse2psnr(samples, 255.0,
+ double total_psnr = vpx_sse_to_psnr(samples, 255.0,
+ cpi->total_sq_error);
+ double total_psnr2 = vpx_sse_to_psnr(samples, 255.0,
cpi->total_sq_error2);
double total_ssim = 100 * pow(cpi->summed_quality /
cpi->summed_weights, 8.0);
@@ -2516,8 +2525,8 @@ static void generate_psnr_packet(VP8_COMP *cpi)
pkt.data.psnr.samples[3] = width * height;
for (i = 0; i < 4; i++)
- pkt.data.psnr.psnr[i] = vp8_mse2psnr(pkt.data.psnr.samples[i], 255.0,
- (double)(pkt.data.psnr.sse[i]));
+ pkt.data.psnr.psnr[i] = vpx_sse_to_psnr(pkt.data.psnr.samples[i], 255.0,
+ (double)(pkt.data.psnr.sse[i]));
vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt);
}
@@ -2675,8 +2684,8 @@ static int resize_key_frame(VP8_COMP *cpi)
VP8_COMMON *cm = &cpi->common;
/* Do we need to apply resampling for one pass cbr.
- * In one pass this is more limited than in two pass cbr
- * The test and any change is only made one per key frame sequence
+ * In one pass this is more limited than in two pass cbr.
+ * The test and any change is only made once per key frame sequence.
*/
if (cpi->oxcf.allow_spatial_resampling && (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER))
{
@@ -2699,7 +2708,7 @@ static int resize_key_frame(VP8_COMP *cpi)
cm->vert_scale = (cm->vert_scale > NORMAL) ? cm->vert_scale - 1 : NORMAL;
}
- /* Get the new hieght and width */
+ /* Get the new height and width */
Scale2Ratio(cm->horiz_scale, &hr, &hs);
Scale2Ratio(cm->vert_scale, &vr, &vs);
new_width = ((hs - 1) + (cpi->oxcf.Width * hr)) / hs;
@@ -3808,7 +3817,7 @@ static void encode_frame_to_data_rate
/* Setup background Q adjustment for error resilient mode.
* For multi-layer encodes only enable this for the base layer.
- */
+ */
if (cpi->cyclic_refresh_mode_enabled)
{
if (cpi->current_layer==0)
@@ -4621,45 +4630,43 @@ static void encode_frame_to_data_rate
vp8_clear_system_state();
if (cpi->twopass.total_left_stats.coded_error != 0.0)
- fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %10d %6d %6d"
- "%6d %6d %6d %5d %5d %5d %8d %8.2f %10d %10.3f"
- "%10.3f %8d\n",
+ fprintf(f, "%10d %10d %10d %10d %10d %10"PRId64" %10"PRId64
+ "%10"PRId64" %10d %6d %6d %6d %6d %5d %5d %5d %8d "
+ "%8.2lf %"PRId64" %10.3lf %10"PRId64" %8d\n",
cpi->common.current_video_frame, cpi->this_frame_target,
cpi->projected_frame_size,
(cpi->projected_frame_size - cpi->this_frame_target),
- (int)cpi->total_target_vs_actual,
+ cpi->total_target_vs_actual,
cpi->buffer_level,
(cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
- (int)cpi->total_actual_bits, cm->base_qindex,
+ cpi->total_actual_bits, cm->base_qindex,
cpi->active_best_quality, cpi->active_worst_quality,
cpi->ni_av_qi, cpi->cq_target_quality,
- cpi->zbin_over_quant,
cm->refresh_golden_frame, cm->refresh_alt_ref_frame,
cm->frame_type, cpi->gfu_boost,
cpi->twopass.est_max_qcorrection_factor,
- (int)cpi->twopass.bits_left,
+ cpi->twopass.bits_left,
cpi->twopass.total_left_stats.coded_error,
(double)cpi->twopass.bits_left /
cpi->twopass.total_left_stats.coded_error,
cpi->tot_recode_hits);
else
- fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %10d %6d %6d"
- "%6d %6d %6d %5d %5d %5d %8d %8.2f %10d %10.3f"
- "%8d\n",
- cpi->common.current_video_frame,
- cpi->this_frame_target, cpi->projected_frame_size,
+ fprintf(f, "%10d %10d %10d %10d %10d %10"PRId64" %10"PRId64
+ "%10"PRId64" %10d %6d %6d %6d %6d %5d %5d %5d %8d "
+ "%8.2lf %"PRId64" %10.3lf %8d\n",
+ cpi->common.current_video_frame, cpi->this_frame_target,
+ cpi->projected_frame_size,
(cpi->projected_frame_size - cpi->this_frame_target),
- (int)cpi->total_target_vs_actual,
+ cpi->total_target_vs_actual,
cpi->buffer_level,
(cpi->oxcf.starting_buffer_level-cpi->bits_off_target),
- (int)cpi->total_actual_bits, cm->base_qindex,
+ cpi->total_actual_bits, cm->base_qindex,
cpi->active_best_quality, cpi->active_worst_quality,
cpi->ni_av_qi, cpi->cq_target_quality,
- cpi->zbin_over_quant,
cm->refresh_golden_frame, cm->refresh_alt_ref_frame,
cm->frame_type, cpi->gfu_boost,
cpi->twopass.est_max_qcorrection_factor,
- (int)cpi->twopass.bits_left,
+ cpi->twopass.bits_left,
cpi->twopass.total_left_stats.coded_error,
cpi->tot_recode_hits);
@@ -4667,7 +4674,6 @@ static void encode_frame_to_data_rate
{
FILE *fmodes = fopen("Modes.stt", "a");
- int i;
fprintf(fmodes, "%6d:%1d:%1d:%1d ",
cpi->common.current_video_frame,
@@ -5066,6 +5072,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
unsigned int i;
/* Update frame rates for each layer */
+ assert(cpi->oxcf.number_of_layers <= VPX_TS_MAX_LAYERS);
for (i=0; i<cpi->oxcf.number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
@@ -5281,11 +5288,11 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
sq_error = (double)(ye + ue + ve);
- frame_psnr = vp8_mse2psnr(t_samples, 255.0, sq_error);
+ frame_psnr = vpx_sse_to_psnr(t_samples, 255.0, sq_error);
- cpi->total_y += vp8_mse2psnr(y_samples, 255.0, (double)ye);
- cpi->total_u += vp8_mse2psnr(uv_samples, 255.0, (double)ue);
- cpi->total_v += vp8_mse2psnr(uv_samples, 255.0, (double)ve);
+ cpi->total_y += vpx_sse_to_psnr(y_samples, 255.0, (double)ye);
+ cpi->total_u += vpx_sse_to_psnr(uv_samples, 255.0, (double)ue);
+ cpi->total_v += vpx_sse_to_psnr(uv_samples, 255.0, (double)ve);
cpi->total_sq_error += sq_error;
cpi->total += frame_psnr;
#if CONFIG_POSTPROC
@@ -5308,14 +5315,14 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
sq_error2 = (double)(ye + ue + ve);
- frame_psnr2 = vp8_mse2psnr(t_samples, 255.0, sq_error2);
+ frame_psnr2 = vpx_sse_to_psnr(t_samples, 255.0, sq_error2);
- cpi->totalp_y += vp8_mse2psnr(y_samples,
- 255.0, (double)ye);
- cpi->totalp_u += vp8_mse2psnr(uv_samples,
- 255.0, (double)ue);
- cpi->totalp_v += vp8_mse2psnr(uv_samples,
- 255.0, (double)ve);
+ cpi->totalp_y += vpx_sse_to_psnr(y_samples,
+ 255.0, (double)ye);
+ cpi->totalp_u += vpx_sse_to_psnr(uv_samples,
+ 255.0, (double)ue);
+ cpi->totalp_v += vpx_sse_to_psnr(uv_samples,
+ 255.0, (double)ve);
cpi->total_sq_error2 += sq_error2;
cpi->totalp += frame_psnr2;
diff --git a/libvpx/vp8/encoder/onyx_int.h b/libvpx/vp8/encoder/onyx_int.h
index 3ab0fe8..6b37167 100644
--- a/libvpx/vp8/encoder/onyx_int.h
+++ b/libvpx/vp8/encoder/onyx_int.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_VP8_INT_H
-#define __INC_VP8_INT_H
+#ifndef VP8_ENCODER_ONYX_INT_H_
+#define VP8_ENCODER_ONYX_INT_H_
#include <stdio.h>
#include "vpx_config.h"
@@ -33,6 +33,10 @@
#include "vp8/encoder/denoising.h"
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MIN_GF_INTERVAL 4
#define DEFAULT_GF_INTERVAL 7
@@ -721,4 +725,8 @@ void vp8_set_speed_features(VP8_COMP *cpi);
"Failed to allocate "#lval);\
} while(0)
#endif
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_ONYX_INT_H_
diff --git a/libvpx/vp8/encoder/pickinter.h b/libvpx/vp8/encoder/pickinter.h
index 35011ca..cf3b1f8 100644
--- a/libvpx/vp8/encoder/pickinter.h
+++ b/libvpx/vp8/encoder/pickinter.h
@@ -9,11 +9,15 @@
*/
-#ifndef __INC_PICKINTER_H
-#define __INC_PICKINTER_H
+#ifndef VP8_ENCODER_PICKINTER_H_
+#define VP8_ENCODER_PICKINTER_H_
#include "vpx_config.h"
#include "vp8/common/onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
int recon_uvoffset, int *returnrate,
int *returndistortion, int *returnintra,
@@ -24,4 +28,8 @@ extern int vp8_get_inter_mbpred_error(MACROBLOCK *mb,
const vp8_variance_fn_ptr_t *vfp,
unsigned int *sse,
int_mv this_mv);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_PICKINTER_H_
diff --git a/libvpx/vp8/encoder/psnr.c b/libvpx/vp8/encoder/psnr.c
deleted file mode 100644
index b3a3d95..0000000
--- a/libvpx/vp8/encoder/psnr.c
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include "vpx_scale/yv12config.h"
-#include "math.h"
-#include "vp8/common/systemdependent.h" /* for vp8_clear_system_state() */
-
-#define MAX_PSNR 100
-
-double vp8_mse2psnr(double Samples, double Peak, double Mse)
-{
- double psnr;
-
- if ((double)Mse > 0.0)
- psnr = 10.0 * log10(Peak * Peak * Samples / Mse);
- else
- psnr = MAX_PSNR; /* Limit to prevent / 0 */
-
- if (psnr > MAX_PSNR)
- psnr = MAX_PSNR;
-
- return psnr;
-}
diff --git a/libvpx/vp8/encoder/psnr.h b/libvpx/vp8/encoder/psnr.h
deleted file mode 100644
index 7f6269a..0000000
--- a/libvpx/vp8/encoder/psnr.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef __INC_PSNR_H
-#define __INC_PSNR_H
-
-extern double vp8_mse2psnr(double Samples, double Peak, double Mse);
-
-#endif
diff --git a/libvpx/vp8/encoder/quantize.h b/libvpx/vp8/encoder/quantize.h
index d55496c..c739b26 100644
--- a/libvpx/vp8/encoder/quantize.h
+++ b/libvpx/vp8/encoder/quantize.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_QUANTIZE_H
-#define __INC_QUANTIZE_H
+#ifndef VP8_ENCODER_QUANTIZE_H_
+#define VP8_ENCODER_QUANTIZE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
struct VP8_COMP;
struct macroblock;
@@ -20,4 +24,8 @@ extern void vp8_update_zbin_extra(struct VP8_COMP *cpi, struct macroblock *x);
extern void vp8cx_mb_init_quantizer(struct VP8_COMP *cpi, struct macroblock *x, int ok_to_skip);
extern void vp8cx_init_quantizer(struct VP8_COMP *cpi);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_QUANTIZE_H_
diff --git a/libvpx/vp8/encoder/ratectrl.c b/libvpx/vp8/encoder/ratectrl.c
index fe4db13..c51650c 100644
--- a/libvpx/vp8/encoder/ratectrl.c
+++ b/libvpx/vp8/encoder/ratectrl.c
@@ -174,14 +174,6 @@ static const int kf_gf_boost_qlimits[QINDEX_RANGE] =
600, 600, 600, 600, 600, 600, 600, 600,
};
-/* % adjustment to target kf size based on seperation from previous frame */
-static const int kf_boost_seperation_adjustment[16] =
-{
- 30, 40, 50, 55, 60, 65, 70, 75,
- 80, 85, 90, 95, 100, 100, 100, 100,
-};
-
-
static const int gf_adjust_table[101] =
{
100,
@@ -1238,7 +1230,6 @@ int vp8_regulate_q(VP8_COMP *cpi, int target_bits_per_frame)
{
Q = cpi->oxcf.gold_q;
}
-
}
else
{
diff --git a/libvpx/vp8/encoder/ratectrl.h b/libvpx/vp8/encoder/ratectrl.h
index c43f08d..829697f 100644
--- a/libvpx/vp8/encoder/ratectrl.h
+++ b/libvpx/vp8/encoder/ratectrl.h
@@ -9,10 +9,15 @@
*/
-#if !defined __INC_RATECTRL_H
+#ifndef VP8_ENCODER_RATECTRL_H_
+#define VP8_ENCODER_RATECTRL_H_
#include "onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern void vp8_save_coding_context(VP8_COMP *cpi);
extern void vp8_restore_coding_context(VP8_COMP *cpi);
@@ -25,4 +30,8 @@ extern void vp8_compute_frame_size_bounds(VP8_COMP *cpi, int *frame_under_shoot_
/* return of 0 means drop frame */
extern int vp8_pick_frame_size(VP8_COMP *cpi);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_RATECTRL_H_
diff --git a/libvpx/vp8/encoder/rdopt.c b/libvpx/vp8/encoder/rdopt.c
index 5016cc4..387701c 100644
--- a/libvpx/vp8/encoder/rdopt.c
+++ b/libvpx/vp8/encoder/rdopt.c
@@ -528,19 +528,16 @@ static int cost_coeffs(MACROBLOCK *mb, BLOCKD *b, int type, ENTROPY_CONTEXT *a,
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
-# define QC( I) ( qcoeff_ptr [vp8_default_zig_zag1d[I]] )
-
+ assert(eob <= 16);
for (; c < eob; c++)
{
- int v = QC(c);
- int t = vp8_dct_value_tokens_ptr[v].Token;
+ const int v = qcoeff_ptr[vp8_default_zig_zag1d[c]];
+ const int t = vp8_dct_value_tokens_ptr[v].Token;
cost += mb->token_costs [type] [vp8_coef_bands[c]] [pt] [t];
cost += vp8_dct_value_cost_ptr[v];
pt = vp8_prev_token_class[t];
}
-# undef QC
-
if (c < 16)
cost += mb->token_costs [type] [vp8_coef_bands[c]] [pt] [DCT_EOB_TOKEN];
diff --git a/libvpx/vp8/encoder/rdopt.h b/libvpx/vp8/encoder/rdopt.h
index 1e11fa7..fe21b8e 100644
--- a/libvpx/vp8/encoder/rdopt.h
+++ b/libvpx/vp8/encoder/rdopt.h
@@ -9,8 +9,12 @@
*/
-#ifndef __INC_RDOPT_H
-#define __INC_RDOPT_H
+#ifndef VP8_ENCODER_RDOPT_H_
+#define VP8_ENCODER_RDOPT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define RDCOST(RM,DM,R,D) ( ((128+(R)*(RM)) >> 8) + (DM)*(D) )
@@ -130,4 +134,8 @@ extern void vp8_mv_pred
);
void vp8_cal_sad(VP8_COMP *cpi, MACROBLOCKD *xd, MACROBLOCK *x, int recon_yoffset, int near_sadidx[]);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_RDOPT_H_
diff --git a/libvpx/vp8/encoder/segmentation.h b/libvpx/vp8/encoder/segmentation.h
index 12815b0..6b55005 100644
--- a/libvpx/vp8/encoder/segmentation.h
+++ b/libvpx/vp8/encoder/segmentation.h
@@ -8,9 +8,21 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP8_ENCODER_SEGMENTATION_H_
+#define VP8_ENCODER_SEGMENTATION_H_
#include "string.h"
#include "vp8/common/blockd.h"
#include "onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern void vp8_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, MACROBLOCK *x);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_ENCODER_SEGMENTATION_H_
diff --git a/libvpx/vp8/encoder/temporal_filter.c b/libvpx/vp8/encoder/temporal_filter.c
index 7e3af71..513b2bf 100644
--- a/libvpx/vp8/encoder/temporal_filter.c
+++ b/libvpx/vp8/encoder/temporal_filter.c
@@ -16,7 +16,6 @@
#include "vp8/common/alloccommon.h"
#include "mcomp.h"
#include "firstpass.h"
-#include "psnr.h"
#include "vpx_scale/vpx_scale.h"
#include "vp8/common/extend.h"
#include "ratectrl.h"
diff --git a/libvpx/vp8/encoder/tokenize.c b/libvpx/vp8/encoder/tokenize.c
index 11559a7..2dc8205 100644
--- a/libvpx/vp8/encoder/tokenize.c
+++ b/libvpx/vp8/encoder/tokenize.c
@@ -213,6 +213,7 @@ static void tokenize1st_order_b
/* Luma */
for (block = 0; block < 16; block++, b++)
{
+ const int eob = *b->eob;
tmp1 = vp8_block2above[block];
tmp2 = vp8_block2left[block];
qcoeff_ptr = b->qcoeff;
@@ -223,7 +224,7 @@ static void tokenize1st_order_b
c = type ? 0 : 1;
- if(c >= *b->eob)
+ if(c >= eob)
{
/* c = band for this case */
t->Token = DCT_EOB_TOKEN;
@@ -250,7 +251,8 @@ static void tokenize1st_order_b
t++;
c++;
- for (; c < *b->eob; c++)
+ assert(eob <= 16);
+ for (; c < eob; c++)
{
rc = vp8_default_zig_zag1d[c];
band = vp8_coef_bands[c];
@@ -286,6 +288,7 @@ static void tokenize1st_order_b
/* Chroma */
for (block = 16; block < 24; block++, b++)
{
+ const int eob = *b->eob;
tmp1 = vp8_block2above[block];
tmp2 = vp8_block2left[block];
qcoeff_ptr = b->qcoeff;
@@ -294,7 +297,7 @@ static void tokenize1st_order_b
VP8_COMBINEENTROPYCONTEXTS(pt, *a, *l);
- if(!(*b->eob))
+ if(!eob)
{
/* c = band for this case */
t->Token = DCT_EOB_TOKEN;
@@ -321,7 +324,8 @@ static void tokenize1st_order_b
t++;
c = 1;
- for (; c < *b->eob; c++)
+ assert(eob <= 16);
+ for (; c < eob; c++)
{
rc = vp8_default_zig_zag1d[c];
band = vp8_coef_bands[c];
diff --git a/libvpx/vp8/encoder/tokenize.h b/libvpx/vp8/encoder/tokenize.h
index 1e6cea1..b73a9ee 100644
--- a/libvpx/vp8/encoder/tokenize.h
+++ b/libvpx/vp8/encoder/tokenize.h
@@ -9,12 +9,16 @@
*/
-#ifndef tokenize_h
-#define tokenize_h
+#ifndef VP8_ENCODER_TOKENIZE_H_
+#define VP8_ENCODER_TOKENIZE_H_
#include "vp8/common/entropy.h"
#include "block.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp8_tokenize_initialize();
typedef struct
@@ -47,4 +51,8 @@ extern const short *const vp8_dct_value_cost_ptr;
*/
extern const TOKENVALUE *const vp8_dct_value_tokens_ptr;
-#endif /* tokenize_h */
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP8_ENCODER_TOKENIZE_H_
diff --git a/libvpx/vp8/encoder/treewriter.h b/libvpx/vp8/encoder/treewriter.h
index 48574f3..cfb2730 100644
--- a/libvpx/vp8/encoder/treewriter.h
+++ b/libvpx/vp8/encoder/treewriter.h
@@ -9,8 +9,8 @@
*/
-#ifndef __INC_TREEWRITER_H
-#define __INC_TREEWRITER_H
+#ifndef VP8_ENCODER_TREEWRITER_H_
+#define VP8_ENCODER_TREEWRITER_H_
/* Trees map alphabets into huffman-like codes suitable for an arithmetic
bit coder. Timothy S Murphy 11 October 2004 */
@@ -19,6 +19,10 @@
#include "boolhuff.h" /* for now */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef BOOL_CODER vp8_writer;
#define vp8_write vp8_encode_bool
@@ -123,4 +127,8 @@ void vp8_cost_tokens2(
int *Costs, const vp8_prob *, vp8_tree, int
);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VP8_ENCODER_TREEWRITER_H_
diff --git a/libvpx/vp8/vp8_common.mk b/libvpx/vp8/vp8_common.mk
index f98eb31..dfb54a5 100644
--- a/libvpx/vp8/vp8_common.mk
+++ b/libvpx/vp8/vp8_common.mk
@@ -47,7 +47,7 @@ VP8_COMMON_SRCS-yes += common/quant_common.h
VP8_COMMON_SRCS-yes += common/reconinter.h
VP8_COMMON_SRCS-yes += common/reconintra4x4.h
VP8_COMMON_SRCS-yes += common/rtcd.c
-VP8_COMMON_SRCS-yes += common/rtcd_defs.sh
+VP8_COMMON_SRCS-yes += common/rtcd_defs.pl
VP8_COMMON_SRCS-yes += common/setupintrarecon.h
VP8_COMMON_SRCS-yes += common/swapyv12buffer.h
VP8_COMMON_SRCS-yes += common/systemdependent.h
@@ -159,14 +159,6 @@ VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance_halfpixvar16x16_
VP8_COMMON_SRCS-$(HAVE_MEDIA) += common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6$(ASM)
# common (neon)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/bilinearpredict4x4_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/bilinearpredict8x4_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/bilinearpredict8x8_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/bilinearpredict16x16_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/copymem8x4_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/copymem8x8_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/copymem16x16_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dc_only_idct_add_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/iwalsh_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/loopfilter_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/loopfiltersimplehorizontaledge_neon$(ASM)
@@ -181,14 +173,20 @@ VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/sixtappredict8x8_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/sixtappredict16x16_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/buildintrapredictorsmby_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/save_reg_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequant_idct_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/idct_dequant_full_2x_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/idct_dequant_0_2x_neon$(ASM)
-VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequantizeb_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/idct_blk_neon.c
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/variance_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp8_subpixelvariance8x8_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp8_subpixelvariance16x16_neon$(ASM)
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp8_subpixelvariance16x16s_neon$(ASM)
-$(eval $(call rtcd_h_template,vp8_rtcd,vp8/common/rtcd_defs.sh))
+# common (neon intrinsics)
+VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/bilinearpredict_neon.c
+VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/copymem_neon.c
+VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dc_only_idct_add_neon.c
+VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequant_idct_neon.c
+VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequantizeb_neon.c
+
+
+$(eval $(call rtcd_h_template,vp8_rtcd,vp8/common/rtcd_defs.pl))
diff --git a/libvpx/vp8/vp8_cx_iface.c b/libvpx/vp8/vp8_cx_iface.c
index 19e9d27..4c896b1 100644
--- a/libvpx/vp8/vp8_cx_iface.c
+++ b/libvpx/vp8/vp8_cx_iface.c
@@ -414,7 +414,6 @@ static vpx_codec_err_t set_vp8e_config(VP8_CONFIG *oxcf,
printf("Sharpness: %d\n", oxcf->Sharpness);
printf("cpu_used: %d\n", oxcf->cpu_used);
printf("Mode: %d\n", oxcf->Mode);
- printf("delete_first_pass_file: %d\n", oxcf->delete_first_pass_file);
printf("auto_key: %d\n", oxcf->auto_key);
printf("key_freq: %d\n", oxcf->key_freq);
printf("end_usage: %d\n", oxcf->end_usage);
@@ -751,9 +750,6 @@ static vpx_codec_err_t vp8e_encode(vpx_codec_alg_priv_t *ctx,
if (!ctx->cfg.rc_target_bitrate)
return res;
- if (!ctx->cfg.rc_target_bitrate)
- return res;
-
if (img)
res = validate_img(ctx, img);
@@ -1266,10 +1262,10 @@ static vpx_codec_enc_cfg_map_t vp8e_usage_cfg_map[] =
128, /* kf_max_dist */
#if VPX_ENCODER_ABI_VERSION == (1 + VPX_CODEC_ABI_VERSION)
- 1, /* g_delete_first_pass_file */
"vp8.fpf" /* first pass filename */
#endif
VPX_SS_DEFAULT_LAYERS, /* ss_number_layers */
+ {0}, /* ss_target_bitrate */
1, /* ts_number_layers */
{0}, /* ts_target_bitrate */
{0}, /* ts_rate_decimator */
diff --git a/libvpx/vp8/vp8_dx_iface.c b/libvpx/vp8/vp8_dx_iface.c
index 871b8d3..0b4c4cb 100644
--- a/libvpx/vp8/vp8_dx_iface.c
+++ b/libvpx/vp8/vp8_dx_iface.c
@@ -929,6 +929,7 @@ CODEC_INTERFACE(vpx_codec_vp8_dx) =
vp8_get_si, /* vpx_codec_get_si_fn_t get_si; */
vp8_decode, /* vpx_codec_decode_fn_t decode; */
vp8_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */
+ NOT_IMPLEMENTED,
},
{ /* encoder functions */
NOT_IMPLEMENTED,
diff --git a/libvpx/vp8/vp8cx.mk b/libvpx/vp8/vp8cx.mk
index cd091f3..d7c6dd1 100644
--- a/libvpx/vp8/vp8cx.mk
+++ b/libvpx/vp8/vp8cx.mk
@@ -50,7 +50,6 @@ VP8_CX_SRCS-yes += encoder/mcomp.h
VP8_CX_SRCS-yes += encoder/modecosts.h
VP8_CX_SRCS-yes += encoder/onyx_int.h
VP8_CX_SRCS-yes += encoder/pickinter.h
-VP8_CX_SRCS-yes += encoder/psnr.h
VP8_CX_SRCS-yes += encoder/quantize.h
VP8_CX_SRCS-yes += encoder/ratectrl.h
VP8_CX_SRCS-yes += encoder/rdopt.h
@@ -61,7 +60,6 @@ VP8_CX_SRCS-yes += encoder/modecosts.c
VP8_CX_SRCS-yes += encoder/onyx_if.c
VP8_CX_SRCS-yes += encoder/pickinter.c
VP8_CX_SRCS-yes += encoder/picklpf.c
-VP8_CX_SRCS-yes += encoder/psnr.c
VP8_CX_SRCS-yes += encoder/quantize.c
VP8_CX_SRCS-yes += encoder/ratectrl.c
VP8_CX_SRCS-yes += encoder/rdopt.c
diff --git a/libvpx/vp8/vp8cx_arm.mk b/libvpx/vp8/vp8cx_arm.mk
index b030ee5..398172a 100644
--- a/libvpx/vp8/vp8cx_arm.mk
+++ b/libvpx/vp8/vp8cx_arm.mk
@@ -37,6 +37,7 @@ VP8_CX_SRCS-$(HAVE_MEDIA) += encoder/arm/armv6/walsh_v6$(ASM)
# encoder
VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/fastquantizeb_neon$(ASM)
VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/picklpf_arm.c
+VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/denoising_neon.c
VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/shortfdct_neon$(ASM)
VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/subtract_neon$(ASM)
VP8_CX_SRCS-$(HAVE_NEON) += encoder/arm/neon/vp8_mse16x16_neon$(ASM)
diff --git a/libvpx/vp8/vp8dx.mk b/libvpx/vp8/vp8dx.mk
index 4a8f467..892ed70 100644
--- a/libvpx/vp8/vp8dx.mk
+++ b/libvpx/vp8/vp8dx.mk
@@ -22,7 +22,7 @@ VP8_DX_SRCS-yes += vp8_dx_iface.c
VP8_DX_SRCS-yes += decoder/dboolhuff.c
VP8_DX_SRCS-yes += decoder/decodemv.c
-VP8_DX_SRCS-yes += decoder/decodframe.c
+VP8_DX_SRCS-yes += decoder/decodeframe.c
VP8_DX_SRCS-yes += decoder/detokenize.c
VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/ec_types.h
VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT) += decoder/error_concealment.h
diff --git a/libvpx/vp8_scalable_patterns.c b/libvpx/vp8_scalable_patterns.c
deleted file mode 100644
index 06270fe..0000000
--- a/libvpx/vp8_scalable_patterns.c
+++ /dev/null
@@ -1,694 +0,0 @@
-/*
- * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-/*
- * This is an example demonstrating how to implement a multi-layer VP8
- * encoding scheme based on temporal scalability for video applications
- * that benefit from a scalable bitstream.
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#define VPX_CODEC_DISABLE_COMPAT 1
-#include "vpx/vpx_encoder.h"
-#include "vpx/vp8cx.h"
-#define interface (vpx_codec_vp8_cx())
-#define fourcc 0x30385056
-
-#define IVF_FILE_HDR_SZ (32)
-#define IVF_FRAME_HDR_SZ (12)
-
-static void mem_put_le16(char *mem, unsigned int val) {
- mem[0] = val;
- mem[1] = val>>8;
-}
-
-static void mem_put_le32(char *mem, unsigned int val) {
- mem[0] = val;
- mem[1] = val>>8;
- mem[2] = val>>16;
- mem[3] = val>>24;
-}
-
-static void die(const char *fmt, ...) {
- va_list ap;
-
- va_start(ap, fmt);
- vprintf(fmt, ap);
- if(fmt[strlen(fmt)-1] != '\n')
- printf("\n");
- exit(EXIT_FAILURE);
-}
-
-static void die_codec(vpx_codec_ctx_t *ctx, const char *s) {
- const char *detail = vpx_codec_error_detail(ctx);
-
- printf("%s: %s\n", s, vpx_codec_error(ctx));
- if(detail)
- printf(" %s\n",detail);
- exit(EXIT_FAILURE);
-}
-
-static int read_frame(FILE *f, vpx_image_t *img) {
- size_t nbytes, to_read;
- int res = 1;
-
- to_read = img->w*img->h*3/2;
- nbytes = fread(img->planes[0], 1, to_read, f);
- if(nbytes != to_read) {
- res = 0;
- if(nbytes > 0)
- printf("Warning: Read partial frame. Check your width & height!\n");
- }
- return res;
-}
-
-static void write_ivf_file_header(FILE *outfile,
- const vpx_codec_enc_cfg_t *cfg,
- int frame_cnt) {
- char header[32];
-
- if(cfg->g_pass != VPX_RC_ONE_PASS && cfg->g_pass != VPX_RC_LAST_PASS)
- return;
- header[0] = 'D';
- header[1] = 'K';
- header[2] = 'I';
- header[3] = 'F';
- mem_put_le16(header+4, 0); /* version */
- mem_put_le16(header+6, 32); /* headersize */
- mem_put_le32(header+8, fourcc); /* headersize */
- mem_put_le16(header+12, cfg->g_w); /* width */
- mem_put_le16(header+14, cfg->g_h); /* height */
- mem_put_le32(header+16, cfg->g_timebase.den); /* rate */
- mem_put_le32(header+20, cfg->g_timebase.num); /* scale */
- mem_put_le32(header+24, frame_cnt); /* length */
- mem_put_le32(header+28, 0); /* unused */
-
- (void) fwrite(header, 1, 32, outfile);
-}
-
-
-static void write_ivf_frame_header(FILE *outfile,
- const vpx_codec_cx_pkt_t *pkt)
-{
- char header[12];
- vpx_codec_pts_t pts;
-
- if(pkt->kind != VPX_CODEC_CX_FRAME_PKT)
- return;
-
- pts = pkt->data.frame.pts;
- mem_put_le32(header, pkt->data.frame.sz);
- mem_put_le32(header+4, pts&0xFFFFFFFF);
- mem_put_le32(header+8, pts >> 32);
-
- (void) fwrite(header, 1, 12, outfile);
-}
-
-static int mode_to_num_layers[12] = {1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3};
-
-int main(int argc, char **argv) {
- FILE *infile, *outfile[VPX_TS_MAX_LAYERS];
- vpx_codec_ctx_t codec;
- vpx_codec_enc_cfg_t cfg;
- int frame_cnt = 0;
- vpx_image_t raw;
- vpx_codec_err_t res;
- unsigned int width;
- unsigned int height;
- int frame_avail;
- int got_data;
- int flags = 0;
- int i;
- int pts = 0; /* PTS starts at 0 */
- int frame_duration = 1; /* 1 timebase tick per frame */
-
- int layering_mode = 0;
- int frames_in_layer[VPX_TS_MAX_LAYERS] = {0};
- int layer_flags[VPX_TS_MAX_PERIODICITY] = {0};
- int flag_periodicity;
- int max_intra_size_pct;
-
- /* Check usage and arguments */
- if (argc < 9)
- die("Usage: %s <infile> <outfile> <width> <height> <rate_num> "
- " <rate_den> <mode> <Rate_0> ... <Rate_nlayers-1>\n", argv[0]);
-
- width = strtol (argv[3], NULL, 0);
- height = strtol (argv[4], NULL, 0);
- if (width < 16 || width%2 || height <16 || height%2)
- die ("Invalid resolution: %d x %d", width, height);
-
- if (!sscanf(argv[7], "%d", &layering_mode))
- die ("Invalid mode %s", argv[7]);
- if (layering_mode<0 || layering_mode>11)
- die ("Invalid mode (0..11) %s", argv[7]);
-
- if (argc != 8+mode_to_num_layers[layering_mode])
- die ("Invalid number of arguments");
-
- if (!vpx_img_alloc (&raw, VPX_IMG_FMT_I420, width, height, 32))
- die ("Failed to allocate image", width, height);
-
- printf("Using %s\n",vpx_codec_iface_name(interface));
-
- /* Populate encoder configuration */
- res = vpx_codec_enc_config_default(interface, &cfg, 0);
- if(res) {
- printf("Failed to get config: %s\n", vpx_codec_err_to_string(res));
- return EXIT_FAILURE;
- }
-
- /* Update the default configuration with our settings */
- cfg.g_w = width;
- cfg.g_h = height;
-
- /* Timebase format e.g. 30fps: numerator=1, demoninator=30 */
- if (!sscanf (argv[5], "%d", &cfg.g_timebase.num ))
- die ("Invalid timebase numerator %s", argv[5]);
- if (!sscanf (argv[6], "%d", &cfg.g_timebase.den ))
- die ("Invalid timebase denominator %s", argv[6]);
-
- for (i=8; i<8+mode_to_num_layers[layering_mode]; i++)
- if (!sscanf(argv[i], "%ud", &cfg.ts_target_bitrate[i-8]))
- die ("Invalid data rate %s", argv[i]);
-
- /* Real time parameters */
- cfg.rc_dropframe_thresh = 0;
- cfg.rc_end_usage = VPX_CBR;
- cfg.rc_resize_allowed = 0;
- cfg.rc_min_quantizer = 2;
- cfg.rc_max_quantizer = 56;
- cfg.rc_undershoot_pct = 100;
- cfg.rc_overshoot_pct = 15;
- cfg.rc_buf_initial_sz = 500;
- cfg.rc_buf_optimal_sz = 600;
- cfg.rc_buf_sz = 1000;
-
- /* Enable error resilient mode */
- cfg.g_error_resilient = 1;
- cfg.g_lag_in_frames = 0;
- cfg.kf_mode = VPX_KF_DISABLED;
-
- /* Disable automatic keyframe placement */
- cfg.kf_min_dist = cfg.kf_max_dist = 3000;
-
- /* Default setting for bitrate: used in special case of 1 layer (case 0). */
- cfg.rc_target_bitrate = cfg.ts_target_bitrate[0];
-
- /* Temporal scaling parameters: */
- /* NOTE: The 3 prediction frames cannot be used interchangeably due to
- * differences in the way they are handled throughout the code. The
- * frames should be allocated to layers in the order LAST, GF, ARF.
- * Other combinations work, but may produce slightly inferior results.
- */
- switch (layering_mode)
- {
- case 0:
- {
- /* 1-layer */
- int ids[1] = {0};
- cfg.ts_number_layers = 1;
- cfg.ts_periodicity = 1;
- cfg.ts_rate_decimator[0] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- // Update L only.
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- break;
- }
- case 1:
- {
- /* 2-layers, 2-frame period */
- int ids[2] = {0,1};
- cfg.ts_number_layers = 2;
- cfg.ts_periodicity = 2;
- cfg.ts_rate_decimator[0] = 2;
- cfg.ts_rate_decimator[1] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-#if 1
- /* 0=L, 1=GF, Intra-layer prediction enabled */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
- layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_REF_ARF;
-#else
- /* 0=L, 1=GF, Intra-layer prediction disabled */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF;
- layer_flags[1] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_REF_LAST;
-#endif
- break;
- }
-
- case 2:
- {
- /* 2-layers, 3-frame period */
- int ids[3] = {0,1,1};
- cfg.ts_number_layers = 2;
- cfg.ts_periodicity = 3;
- cfg.ts_rate_decimator[0] = 3;
- cfg.ts_rate_decimator[1] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- /* 0=L, 1=GF, Intra-layer prediction enabled */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[1] =
- layer_flags[2] = VP8_EFLAG_NO_REF_GF |
- VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST;
- break;
- }
-
- case 3:
- {
- /* 3-layers, 6-frame period */
- int ids[6] = {0,2,2,1,2,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 6;
- cfg.ts_rate_decimator[0] = 6;
- cfg.ts_rate_decimator[1] = 3;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- /* 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[3] = VP8_EFLAG_NO_REF_ARF | VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST;
- layer_flags[1] =
- layer_flags[2] =
- layer_flags[4] =
- layer_flags[5] = VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_LAST;
- break;
- }
-
- case 4:
- {
- /* 3-layers, 4-frame period */
- int ids[4] = {0,2,1,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 4;
- cfg.ts_rate_decimator[0] = 4;
- cfg.ts_rate_decimator[1] = 2;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- /* 0=L, 1=GF, 2=ARF, Intra-layer prediction disabled */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST;
- layer_flags[1] =
- layer_flags[3] = VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF;
- break;
- }
-
- case 5:
- {
- /* 3-layers, 4-frame period */
- int ids[4] = {0,2,1,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 4;
- cfg.ts_rate_decimator[0] = 4;
- cfg.ts_rate_decimator[1] = 2;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- /* 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled in layer 1,
- * disabled in layer 2
- */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[2] = VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[1] =
- layer_flags[3] = VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF;
- break;
- }
-
- case 6:
- {
- /* 3-layers, 4-frame period */
- int ids[4] = {0,2,1,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 4;
- cfg.ts_rate_decimator[0] = 4;
- cfg.ts_rate_decimator[1] = 2;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- /* 0=L, 1=GF, 2=ARF, Intra-layer prediction enabled */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[2] = VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[1] =
- layer_flags[3] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
- break;
- }
-
- case 7:
- {
- /* NOTE: Probably of academic interest only */
-
- /* 5-layers, 16-frame period */
- int ids[16] = {0,4,3,4,2,4,3,4,1,4,3,4,2,4,3,4};
- cfg.ts_number_layers = 5;
- cfg.ts_periodicity = 16;
- cfg.ts_rate_decimator[0] = 16;
- cfg.ts_rate_decimator[1] = 8;
- cfg.ts_rate_decimator[2] = 4;
- cfg.ts_rate_decimator[3] = 2;
- cfg.ts_rate_decimator[4] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = cfg.ts_periodicity;
-
- layer_flags[0] = VPX_EFLAG_FORCE_KF;
- layer_flags[1] =
- layer_flags[3] =
- layer_flags[5] =
- layer_flags[7] =
- layer_flags[9] =
- layer_flags[11] =
- layer_flags[13] =
- layer_flags[15] = VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF;
- layer_flags[2] =
- layer_flags[6] =
- layer_flags[10] =
- layer_flags[14] = VP8_EFLAG_NO_UPD_ARF | VP8_EFLAG_NO_UPD_GF;
- layer_flags[4] =
- layer_flags[12] = VP8_EFLAG_NO_REF_LAST |
- VP8_EFLAG_NO_UPD_ARF;
- layer_flags[8] = VP8_EFLAG_NO_REF_LAST | VP8_EFLAG_NO_REF_GF;
- break;
- }
-
- case 8:
- {
- /* 2-layers, with sync point at first frame of layer 1. */
- int ids[2] = {0,1};
- cfg.ts_number_layers = 2;
- cfg.ts_periodicity = 2;
- cfg.ts_rate_decimator[0] = 2;
- cfg.ts_rate_decimator[1] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = 8;
-
- /* 0=L, 1=GF */
- // ARF is used as predictor for all frames, and is only updated on
- // key frame. Sync point every 8 frames.
-
- // Layer 0: predict from L and ARF, update L and G.
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF |
- VP8_EFLAG_NO_UPD_ARF;
-
- // Layer 1: sync point: predict from L and ARF, and update G.
- layer_flags[1] = VP8_EFLAG_NO_REF_GF |
- VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_UPD_ARF;
-
- // Layer 0, predict from L and ARF, update L.
- layer_flags[2] = VP8_EFLAG_NO_REF_GF |
- VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF;
-
- // Layer 1: predict from L, G and ARF, and update G.
- layer_flags[3] = VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_UPD_ENTROPY;
-
- // Layer 0
- layer_flags[4] = layer_flags[2];
-
- // Layer 1
- layer_flags[5] = layer_flags[3];
-
- // Layer 0
- layer_flags[6] = layer_flags[4];
-
- // Layer 1
- layer_flags[7] = layer_flags[5];
- break;
- }
-
- case 9:
- {
- /* 3-layers */
- // Sync points for layer 1 and 2 every 8 frames.
-
- int ids[4] = {0,2,1,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 4;
- cfg.ts_rate_decimator[0] = 4;
- cfg.ts_rate_decimator[1] = 2;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = 8;
-
- /* 0=L, 1=GF, 2=ARF */
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[1] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
- layer_flags[2] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[3] =
- layer_flags[5] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF;
- layer_flags[4] = VP8_EFLAG_NO_REF_GF | VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_GF | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[6] = VP8_EFLAG_NO_REF_ARF |
- VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_ARF;
- layer_flags[7] = VP8_EFLAG_NO_UPD_LAST | VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_ENTROPY;
- break;
- }
- case 10:
- {
- // 3-layers structure where ARF is used as predictor for all frames,
- // and is only updated on key frame.
- // Sync points for layer 1 and 2 every 8 frames.
-
- int ids[4] = {0,2,1,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 4;
- cfg.ts_rate_decimator[0] = 4;
- cfg.ts_rate_decimator[1] = 2;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = 8;
-
- /* 0=L, 1=GF, 2=ARF */
-
- // Layer 0: predict from L and ARF; update L and G.
- layer_flags[0] = VPX_EFLAG_FORCE_KF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_REF_GF;
-
- // Layer 2: sync point: predict from L and ARF; update none.
- layer_flags[1] = VP8_EFLAG_NO_REF_GF |
- VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_UPD_ENTROPY;
-
- // Layer 1: sync point: predict from L and ARF; update G.
- layer_flags[2] = VP8_EFLAG_NO_REF_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST;
-
- // Layer 2: predict from L, G, ARF; update none.
- layer_flags[3] = VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_UPD_ENTROPY;
-
- // Layer 0: predict from L and ARF; update L.
- layer_flags[4] = VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_REF_GF;
-
- // Layer 2: predict from L, G, ARF; update none.
- layer_flags[5] = layer_flags[3];
-
- // Layer 1: predict from L, G, ARF; update G.
- layer_flags[6] = VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST;
-
- // Layer 2: predict from L, G, ARF; update none.
- layer_flags[7] = layer_flags[3];
- break;
- }
- case 11:
- default:
- {
- // 3-layers structure as in case 10, but no sync/refresh points for
- // layer 1 and 2.
-
- int ids[4] = {0,2,1,2};
- cfg.ts_number_layers = 3;
- cfg.ts_periodicity = 4;
- cfg.ts_rate_decimator[0] = 4;
- cfg.ts_rate_decimator[1] = 2;
- cfg.ts_rate_decimator[2] = 1;
- memcpy(cfg.ts_layer_id, ids, sizeof(ids));
-
- flag_periodicity = 8;
-
- /* 0=L, 1=GF, 2=ARF */
-
- // Layer 0: predict from L and ARF; update L.
- layer_flags[0] = VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_REF_GF;
- layer_flags[4] = layer_flags[0];
-
- // Layer 1: predict from L, G, ARF; update G.
- layer_flags[2] = VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST;
- layer_flags[6] = layer_flags[2];
-
- // Layer 2: predict from L, G, ARF; update none.
- layer_flags[1] = VP8_EFLAG_NO_UPD_GF |
- VP8_EFLAG_NO_UPD_ARF |
- VP8_EFLAG_NO_UPD_LAST |
- VP8_EFLAG_NO_UPD_ENTROPY;
- layer_flags[3] = layer_flags[1];
- layer_flags[5] = layer_flags[1];
- layer_flags[7] = layer_flags[1];
- break;
- }
- }
-
- /* Open input file */
- if(!(infile = fopen(argv[1], "rb")))
- die("Failed to open %s for reading", argv[1]);
-
- /* Open an output file for each stream */
- for (i=0; i<cfg.ts_number_layers; i++)
- {
- char file_name[512];
- sprintf (file_name, "%s_%d.ivf", argv[2], i);
- if (!(outfile[i] = fopen(file_name, "wb")))
- die("Failed to open %s for writing", file_name);
- write_ivf_file_header(outfile[i], &cfg, 0);
- }
-
- /* Initialize codec */
- if (vpx_codec_enc_init (&codec, interface, &cfg, 0))
- die_codec (&codec, "Failed to initialize encoder");
-
- /* Cap CPU & first I-frame size */
- vpx_codec_control (&codec, VP8E_SET_CPUUSED, -6);
- vpx_codec_control (&codec, VP8E_SET_STATIC_THRESHOLD, 1);
- vpx_codec_control (&codec, VP8E_SET_NOISE_SENSITIVITY, 1);
- vpx_codec_control(&codec, VP8E_SET_TOKEN_PARTITIONS, 1);
-
- max_intra_size_pct = (int) (((double)cfg.rc_buf_optimal_sz * 0.5)
- * ((double) cfg.g_timebase.den / cfg.g_timebase.num)
- / 10.0);
- /* printf ("max_intra_size_pct=%d\n", max_intra_size_pct); */
-
- vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT,
- max_intra_size_pct);
-
- frame_avail = 1;
- while (frame_avail || got_data) {
- vpx_codec_iter_t iter = NULL;
- const vpx_codec_cx_pkt_t *pkt;
-
- flags = layer_flags[frame_cnt % flag_periodicity];
-
- frame_avail = read_frame(infile, &raw);
- if (vpx_codec_encode(&codec, frame_avail? &raw : NULL, pts,
- 1, flags, VPX_DL_REALTIME))
- die_codec(&codec, "Failed to encode frame");
-
- /* Reset KF flag */
- if (layering_mode != 7)
- layer_flags[0] &= ~VPX_EFLAG_FORCE_KF;
-
- got_data = 0;
- while ( (pkt = vpx_codec_get_cx_data(&codec, &iter)) ) {
- got_data = 1;
- switch (pkt->kind) {
- case VPX_CODEC_CX_FRAME_PKT:
- for (i=cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
- i<cfg.ts_number_layers; i++)
- {
- write_ivf_frame_header(outfile[i], pkt);
- (void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
- outfile[i]);
- frames_in_layer[i]++;
- }
- break;
- default:
- break;
- }
- }
- frame_cnt++;
- pts += frame_duration;
- }
- fclose (infile);
-
- printf ("Processed %d frames.\n",frame_cnt-1);
- if (vpx_codec_destroy(&codec))
- die_codec (&codec, "Failed to destroy codec");
-
- /* Try to rewrite the output file headers with the actual frame count */
- for (i=0; i<cfg.ts_number_layers; i++)
- {
- if (!fseek(outfile[i], 0, SEEK_SET))
- write_ivf_file_header (outfile[i], &cfg, frames_in_layer[i]);
- fclose (outfile[i]);
- }
-
- return EXIT_SUCCESS;
-}
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct16x16_1_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.asm
index b1fd21b..b1fd21b 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct16x16_1_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct16x16_1_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct16x16_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct16x16_add_neon.asm
index a13c0d0..a13c0d0 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct16x16_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct16x16_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct32x32_1_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.asm
index d290d07..d290d07 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct32x32_1_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct32x32_1_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct32x32_add_neon.asm
index 388a7d7..72e933e 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct32x32_add_neon.asm
@@ -72,7 +72,7 @@ cospi_31_64 EQU 804
; reg1 = output[first_offset]
; reg2 = output[second_offset]
; for proper address calculation, the last offset used when manipulating
- ; output, wethere reading or storing) must be passed in. use 0 for first
+ ; output, whether reading or storing) must be passed in. use 0 for first
; use.
MACRO
LOAD_FROM_OUTPUT $prev_offset, $first_offset, $second_offset, $reg1, $reg2
@@ -88,7 +88,7 @@ cospi_31_64 EQU 804
; output[first_offset] = reg1
; output[second_offset] = reg2
; for proper address calculation, the last offset used when manipulating
- ; output, wethere reading or storing) must be passed in. use 0 for first
+ ; output, whether reading or storing) must be passed in. use 0 for first
; use.
MACRO
STORE_IN_OUTPUT $prev_offset, $first_offset, $second_offset, $reg1, $reg2
@@ -242,7 +242,7 @@ cospi_31_64 EQU 804
; TODO(cd): have special case to re-use constants when they are similar for
; consecutive butterflies
; TODO(cd): have special case when both constants are the same, do the
- ; additions/substractions before the multiplies.
+ ; additions/subtractions before the multiplies.
; generate the constants
; generate scalar constants
mov r8, #$first_constant & 0xFF00
@@ -260,7 +260,7 @@ cospi_31_64 EQU 804
vmull.s16 q11, $regB, d31
vmull.s16 q12, $regC, d31
; (used) five for intermediate (q8-q12), one for constants (q15)
- ; do some addition/substractions (to get back two register)
+ ; do some addition/subtractions (to get back two register)
vsub.s32 q8, q8, q10
vsub.s32 q9, q9, q11
; do more multiplications (ordered for maximum latency hiding)
@@ -268,7 +268,7 @@ cospi_31_64 EQU 804
vmull.s16 q11, $regA, d30
vmull.s16 q15, $regB, d30
; (used) six for intermediate (q8-q12, q15)
- ; do more addition/substractions
+ ; do more addition/subtractions
vadd.s32 q11, q12, q11
vadd.s32 q10, q10, q15
; (used) four for intermediate (q8-q11)
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct4x4_1_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.asm
index 0d4a721..0d4a721 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct4x4_1_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct4x4_1_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct4x4_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct4x4_add_neon.asm
index 00283fc..00283fc 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct4x4_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct4x4_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct8x8_1_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.asm
index 421d202..421d202 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct8x8_1_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct8x8_1_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_idct8x8_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_idct8x8_add_neon.asm
index 5476400..5476400 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_idct8x8_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_idct8x8_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_iht4x4_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_iht4x4_add_neon.asm
index 2f326e2..2f326e2 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_iht4x4_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_iht4x4_add_neon.asm
diff --git a/libvpx/vp9/common/arm/neon/vp9_short_iht8x8_add_neon.asm b/libvpx/vp9/common/arm/neon/vp9_iht8x8_add_neon.asm
index 93d3af3..b41f566 100644
--- a/libvpx/vp9/common/arm/neon/vp9_short_iht8x8_add_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_iht8x8_add_neon.asm
@@ -576,6 +576,7 @@
vld1.s16 {q14,q15}, [r0]!
push {r0-r10}
+ vpush {d8-d15}
; transpose the input data
TRANSPOSE8X8
@@ -636,6 +637,7 @@ iadst_iadst
IADST8X8_1D
end_vp9_iht8x8_64_add_neon
+ vpop {d8-d15}
pop {r0-r10}
; ROUND_POWER_OF_TWO(temp_out[j], 5)
diff --git a/libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.asm b/libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.asm
new file mode 100644
index 0000000..5b8ec20
--- /dev/null
+++ b/libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.asm
@@ -0,0 +1,199 @@
+;
+; Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+;
+; Use of this source code is governed by a BSD-style license
+; that can be found in the LICENSE file in the root of the source
+; tree. An additional intellectual property rights grant can be found
+; in the file PATENTS. All contributing project authors may
+; be found in the AUTHORS file in the root of the source tree.
+;
+
+ EXPORT |vp9_lpf_horizontal_4_dual_neon|
+ ARM
+
+ AREA ||.text||, CODE, READONLY, ALIGN=2
+
+;void vp9_lpf_horizontal_4_dual_neon(uint8_t *s, int p,
+; const uint8_t *blimit0,
+; const uint8_t *limit0,
+; const uint8_t *thresh0,
+; const uint8_t *blimit1,
+; const uint8_t *limit1,
+; const uint8_t *thresh1)
+; r0 uint8_t *s,
+; r1 int p,
+; r2 const uint8_t *blimit0,
+; r3 const uint8_t *limit0,
+; sp const uint8_t *thresh0,
+; sp+4 const uint8_t *blimit1,
+; sp+8 const uint8_t *limit1,
+; sp+12 const uint8_t *thresh1,
+
+|vp9_lpf_horizontal_4_dual_neon| PROC
+ push {lr}
+
+ ldr r12, [sp, #4] ; load thresh0
+ vld1.8 {d0}, [r2] ; load blimit0 to first half q
+ vld1.8 {d2}, [r3] ; load limit0 to first half q
+
+ add r1, r1, r1 ; double pitch
+ ldr r2, [sp, #8] ; load blimit1
+
+ vld1.8 {d4}, [r12] ; load thresh0 to first half q
+
+ ldr r3, [sp, #12] ; load limit1
+ ldr r12, [sp, #16] ; load thresh1
+ vld1.8 {d1}, [r2] ; load blimit1 to 2nd half q
+
+ sub r2, r0, r1, lsl #1 ; s[-4 * p]
+
+ vld1.8 {d3}, [r3] ; load limit1 to 2nd half q
+ vld1.8 {d5}, [r12] ; load thresh1 to 2nd half q
+
+ vpush {d8-d15} ; save neon registers
+
+ add r3, r2, r1, lsr #1 ; s[-3 * p]
+
+ vld1.u8 {q3}, [r2@64], r1 ; p3
+ vld1.u8 {q4}, [r3@64], r1 ; p2
+ vld1.u8 {q5}, [r2@64], r1 ; p1
+ vld1.u8 {q6}, [r3@64], r1 ; p0
+ vld1.u8 {q7}, [r2@64], r1 ; q0
+ vld1.u8 {q8}, [r3@64], r1 ; q1
+ vld1.u8 {q9}, [r2@64] ; q2
+ vld1.u8 {q10}, [r3@64] ; q3
+
+ sub r2, r2, r1, lsl #1
+ sub r3, r3, r1, lsl #1
+
+ bl vp9_loop_filter_neon_16
+
+ vst1.u8 {q5}, [r2@64], r1 ; store op1
+ vst1.u8 {q6}, [r3@64], r1 ; store op0
+ vst1.u8 {q7}, [r2@64], r1 ; store oq0
+ vst1.u8 {q8}, [r3@64], r1 ; store oq1
+
+ vpop {d8-d15} ; restore neon registers
+
+ pop {pc}
+ ENDP ; |vp9_lpf_horizontal_4_dual_neon|
+
+; void vp9_loop_filter_neon_16();
+; This is a helper function for the loopfilters. The invidual functions do the
+; necessary load, transpose (if necessary) and store. This function uses
+; registers d8-d15, so the calling function must save those registers.
+;
+; r0-r3, r12 PRESERVE
+; q0 blimit
+; q1 limit
+; q2 thresh
+; q3 p3
+; q4 p2
+; q5 p1
+; q6 p0
+; q7 q0
+; q8 q1
+; q9 q2
+; q10 q3
+;
+; Outputs:
+; q5 op1
+; q6 op0
+; q7 oq0
+; q8 oq1
+|vp9_loop_filter_neon_16| PROC
+
+ ; filter_mask
+ vabd.u8 q11, q3, q4 ; m1 = abs(p3 - p2)
+ vabd.u8 q12, q4, q5 ; m2 = abs(p2 - p1)
+ vabd.u8 q13, q5, q6 ; m3 = abs(p1 - p0)
+ vabd.u8 q14, q8, q7 ; m4 = abs(q1 - q0)
+ vabd.u8 q3, q9, q8 ; m5 = abs(q2 - q1)
+ vabd.u8 q4, q10, q9 ; m6 = abs(q3 - q2)
+
+ ; only compare the largest value to limit
+ vmax.u8 q11, q11, q12 ; m7 = max(m1, m2)
+ vmax.u8 q12, q13, q14 ; m8 = max(m3, m4)
+
+ vabd.u8 q9, q6, q7 ; abs(p0 - q0)
+
+ vmax.u8 q3, q3, q4 ; m9 = max(m5, m6)
+
+ vmov.u8 q10, #0x80
+
+ vmax.u8 q15, q11, q12 ; m10 = max(m7, m8)
+
+ vcgt.u8 q13, q13, q2 ; (abs(p1 - p0) > thresh)*-1
+ vcgt.u8 q14, q14, q2 ; (abs(q1 - q0) > thresh)*-1
+ vmax.u8 q15, q15, q3 ; m11 = max(m10, m9)
+
+ vabd.u8 q2, q5, q8 ; a = abs(p1 - q1)
+ vqadd.u8 q9, q9, q9 ; b = abs(p0 - q0) * 2
+
+ veor q7, q7, q10 ; qs0
+
+ vcge.u8 q15, q1, q15 ; abs(m11) > limit
+
+ vshr.u8 q2, q2, #1 ; a = a / 2
+ veor q6, q6, q10 ; ps0
+
+ veor q5, q5, q10 ; ps1
+ vqadd.u8 q9, q9, q2 ; a = b + a
+
+ veor q8, q8, q10 ; qs1
+
+ vmov.u16 q4, #3
+
+ vsubl.s8 q2, d14, d12 ; ( qs0 - ps0)
+ vsubl.s8 q11, d15, d13
+
+ vcge.u8 q9, q0, q9 ; a > blimit
+
+ vqsub.s8 q1, q5, q8 ; filter = clamp(ps1-qs1)
+ vorr q14, q13, q14 ; hev
+
+ vmul.i16 q2, q2, q4 ; 3 * ( qs0 - ps0)
+ vmul.i16 q11, q11, q4
+
+ vand q1, q1, q14 ; filter &= hev
+ vand q15, q15, q9 ; mask
+
+ vmov.u8 q4, #3
+
+ vaddw.s8 q2, q2, d2 ; filter + 3 * (qs0 - ps0)
+ vaddw.s8 q11, q11, d3
+
+ vmov.u8 q9, #4
+
+ ; filter = clamp(filter + 3 * ( qs0 - ps0))
+ vqmovn.s16 d2, q2
+ vqmovn.s16 d3, q11
+ vand q1, q1, q15 ; filter &= mask
+
+ vqadd.s8 q2, q1, q4 ; filter2 = clamp(filter+3)
+ vqadd.s8 q1, q1, q9 ; filter1 = clamp(filter+4)
+ vshr.s8 q2, q2, #3 ; filter2 >>= 3
+ vshr.s8 q1, q1, #3 ; filter1 >>= 3
+
+
+ vqadd.s8 q11, q6, q2 ; u = clamp(ps0 + filter2)
+ vqsub.s8 q0, q7, q1 ; u = clamp(qs0 - filter1)
+
+ ; outer tap adjustments
+ vrshr.s8 q1, q1, #1 ; filter = ++filter1 >> 1
+
+ veor q7, q0, q10 ; *oq0 = u^0x80
+
+ vbic q1, q1, q14 ; filter &= ~hev
+
+ vqadd.s8 q13, q5, q1 ; u = clamp(ps1 + filter)
+ vqsub.s8 q12, q8, q1 ; u = clamp(qs1 - filter)
+
+ veor q6, q11, q10 ; *op0 = u^0x80
+ veor q5, q13, q10 ; *op1 = u^0x80
+ veor q8, q12, q10 ; *oq1 = u^0x80
+
+ bx lr
+ ENDP ; |vp9_loop_filter_neon_16|
+
+ END
diff --git a/libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.c b/libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.c
new file mode 100644
index 0000000..0820db2
--- /dev/null
+++ b/libvpx/vp9/common/arm/neon/vp9_loopfilter_16_neon.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "./vp9_rtcd.h"
+
+void vp9_lpf_horizontal_8_dual_neon(uint8_t *s, int p /* pitch */,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_horizontal_8(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_horizontal_8(s + 8, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_4_dual_neon(uint8_t *s, int p,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_vertical_4_neon(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_vertical_4_neon(s + 8 * p, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_8_dual_neon(uint8_t *s, int p,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_vertical_8_neon(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_vertical_8_neon(s + 8 * p, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_16_dual_neon(uint8_t *s, int p,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh) {
+ vp9_lpf_vertical_16_neon(s, p, blimit, limit, thresh);
+ vp9_lpf_vertical_16_neon(s + 8 * p, p, blimit, limit, thresh);
+}
diff --git a/libvpx/vp9/common/arm/neon/vp9_loopfilter_neon.asm b/libvpx/vp9/common/arm/neon/vp9_loopfilter_neon.asm
index 8b4fe5d..4430322 100644
--- a/libvpx/vp9/common/arm/neon/vp9_loopfilter_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_loopfilter_neon.asm
@@ -8,10 +8,10 @@
; be found in the AUTHORS file in the root of the source tree.
;
- EXPORT |vp9_loop_filter_horizontal_edge_neon|
- EXPORT |vp9_loop_filter_vertical_edge_neon|
- EXPORT |vp9_mbloop_filter_horizontal_edge_neon|
- EXPORT |vp9_mbloop_filter_vertical_edge_neon|
+ EXPORT |vp9_lpf_horizontal_4_neon|
+ EXPORT |vp9_lpf_vertical_4_neon|
+ EXPORT |vp9_lpf_horizontal_8_neon|
+ EXPORT |vp9_lpf_vertical_8_neon|
ARM
AREA ||.text||, CODE, READONLY, ALIGN=2
@@ -21,12 +21,12 @@
; TODO(fgalligan): See about removing the count code as this function is only
; called with a count of 1.
;
-; void vp9_loop_filter_horizontal_edge_neon(uint8_t *s,
-; int p /* pitch */,
-; const uint8_t *blimit,
-; const uint8_t *limit,
-; const uint8_t *thresh,
-; int count)
+; void vp9_lpf_horizontal_4_neon(uint8_t *s,
+; int p /* pitch */,
+; const uint8_t *blimit,
+; const uint8_t *limit,
+; const uint8_t *thresh,
+; int count)
;
; r0 uint8_t *s,
; r1 int p, /* pitch */
@@ -34,7 +34,7 @@
; r3 const uint8_t *limit,
; sp const uint8_t *thresh,
; sp+4 int count
-|vp9_loop_filter_horizontal_edge_neon| PROC
+|vp9_lpf_horizontal_4_neon| PROC
push {lr}
vld1.8 {d0[]}, [r2] ; duplicate *blimit
@@ -77,19 +77,19 @@ count_lf_h_loop
end_vp9_lf_h_edge
pop {pc}
- ENDP ; |vp9_loop_filter_horizontal_edge_neon|
+ ENDP ; |vp9_lpf_horizontal_4_neon|
; Currently vp9 only works on iterations 8 at a time. The vp8 loop filter
; works on 16 iterations at a time.
; TODO(fgalligan): See about removing the count code as this function is only
; called with a count of 1.
;
-; void vp9_loop_filter_vertical_edge_neon(uint8_t *s,
-; int p /* pitch */,
-; const uint8_t *blimit,
-; const uint8_t *limit,
-; const uint8_t *thresh,
-; int count)
+; void vp9_lpf_vertical_4_neon(uint8_t *s,
+; int p /* pitch */,
+; const uint8_t *blimit,
+; const uint8_t *limit,
+; const uint8_t *thresh,
+; int count)
;
; r0 uint8_t *s,
; r1 int p, /* pitch */
@@ -97,7 +97,7 @@ end_vp9_lf_h_edge
; r3 const uint8_t *limit,
; sp const uint8_t *thresh,
; sp+4 int count
-|vp9_loop_filter_vertical_edge_neon| PROC
+|vp9_lpf_vertical_4_neon| PROC
push {lr}
vld1.8 {d0[]}, [r2] ; duplicate *blimit
@@ -158,7 +158,7 @@ count_lf_v_loop
end_vp9_lf_v_edge
pop {pc}
- ENDP ; |vp9_loop_filter_vertical_edge_neon|
+ ENDP ; |vp9_lpf_vertical_4_neon|
; void vp9_loop_filter_neon();
; This is a helper function for the loopfilters. The invidual functions do the
@@ -276,18 +276,18 @@ end_vp9_lf_v_edge
bx lr
ENDP ; |vp9_loop_filter_neon|
-; void vp9_mbloop_filter_horizontal_edge_neon(uint8_t *s, int p,
-; const uint8_t *blimit,
-; const uint8_t *limit,
-; const uint8_t *thresh,
-; int count)
+; void vp9_lpf_horizontal_8_neon(uint8_t *s, int p,
+; const uint8_t *blimit,
+; const uint8_t *limit,
+; const uint8_t *thresh,
+; int count)
; r0 uint8_t *s,
; r1 int p, /* pitch */
; r2 const uint8_t *blimit,
; r3 const uint8_t *limit,
; sp const uint8_t *thresh,
; sp+4 int count
-|vp9_mbloop_filter_horizontal_edge_neon| PROC
+|vp9_lpf_horizontal_8_neon| PROC
push {r4-r5, lr}
vld1.8 {d0[]}, [r2] ; duplicate *blimit
@@ -333,14 +333,14 @@ count_mblf_h_loop
end_vp9_mblf_h_edge
pop {r4-r5, pc}
- ENDP ; |vp9_mbloop_filter_horizontal_edge_neon|
+ ENDP ; |vp9_lpf_horizontal_8_neon|
-; void vp9_mbloop_filter_vertical_edge_neon(uint8_t *s,
-; int pitch,
-; const uint8_t *blimit,
-; const uint8_t *limit,
-; const uint8_t *thresh,
-; int count)
+; void vp9_lpf_vertical_8_neon(uint8_t *s,
+; int pitch,
+; const uint8_t *blimit,
+; const uint8_t *limit,
+; const uint8_t *thresh,
+; int count)
;
; r0 uint8_t *s,
; r1 int pitch,
@@ -348,7 +348,7 @@ end_vp9_mblf_h_edge
; r3 const uint8_t *limit,
; sp const uint8_t *thresh,
; sp+4 int count
-|vp9_mbloop_filter_vertical_edge_neon| PROC
+|vp9_lpf_vertical_8_neon| PROC
push {r4-r5, lr}
vld1.8 {d0[]}, [r2] ; duplicate *blimit
@@ -420,7 +420,7 @@ count_mblf_v_loop
end_vp9_mblf_v_edge
pop {r4-r5, pc}
- ENDP ; |vp9_mbloop_filter_vertical_edge_neon|
+ ENDP ; |vp9_lpf_vertical_8_neon|
; void vp9_mbloop_filter_neon();
; This is a helper function for the loopfilters. The invidual functions do the
diff --git a/libvpx/vp9/common/arm/neon/vp9_mb_lpf_neon.asm b/libvpx/vp9/common/arm/neon/vp9_mb_lpf_neon.asm
index 2e8001b..5fe2bba 100644
--- a/libvpx/vp9/common/arm/neon/vp9_mb_lpf_neon.asm
+++ b/libvpx/vp9/common/arm/neon/vp9_mb_lpf_neon.asm
@@ -8,23 +8,23 @@
; be found in the AUTHORS file in the root of the source tree.
;
- EXPORT |vp9_mb_lpf_horizontal_edge_w_neon|
- EXPORT |vp9_mb_lpf_vertical_edge_w_neon|
+ EXPORT |vp9_lpf_horizontal_16_neon|
+ EXPORT |vp9_lpf_vertical_16_neon|
ARM
AREA ||.text||, CODE, READONLY, ALIGN=2
-; void vp9_mb_lpf_horizontal_edge_w_neon(uint8_t *s, int p,
-; const uint8_t *blimit,
-; const uint8_t *limit,
-; const uint8_t *thresh
-; int count)
+; void vp9_lpf_horizontal_16_neon(uint8_t *s, int p,
+; const uint8_t *blimit,
+; const uint8_t *limit,
+; const uint8_t *thresh
+; int count)
; r0 uint8_t *s,
; r1 int p, /* pitch */
; r2 const uint8_t *blimit,
; r3 const uint8_t *limit,
; sp const uint8_t *thresh,
-|vp9_mb_lpf_horizontal_edge_w_neon| PROC
+|vp9_lpf_horizontal_16_neon| PROC
push {r4-r8, lr}
vpush {d8-d15}
ldr r4, [sp, #88] ; load thresh
@@ -115,18 +115,18 @@ h_next
vpop {d8-d15}
pop {r4-r8, pc}
- ENDP ; |vp9_mb_lpf_horizontal_edge_w_neon|
+ ENDP ; |vp9_lpf_horizontal_16_neon|
-; void vp9_mb_lpf_vertical_edge_w_neon(uint8_t *s, int p,
-; const uint8_t *blimit,
-; const uint8_t *limit,
-; const uint8_t *thresh)
+; void vp9_lpf_vertical_16_neon(uint8_t *s, int p,
+; const uint8_t *blimit,
+; const uint8_t *limit,
+; const uint8_t *thresh)
; r0 uint8_t *s,
; r1 int p, /* pitch */
; r2 const uint8_t *blimit,
; r3 const uint8_t *limit,
; sp const uint8_t *thresh,
-|vp9_mb_lpf_vertical_edge_w_neon| PROC
+|vp9_lpf_vertical_16_neon| PROC
push {r4-r8, lr}
vpush {d8-d15}
ldr r4, [sp, #88] ; load thresh
@@ -279,7 +279,7 @@ v_end
vpop {d8-d15}
pop {r4-r8, pc}
- ENDP ; |vp9_mb_lpf_vertical_edge_w_neon|
+ ENDP ; |vp9_lpf_vertical_16_neon|
; void vp9_wide_mbfilter_neon();
; This is a helper function for the loopfilters. The invidual functions do the
@@ -439,6 +439,9 @@ v_end
tst r7, #1
bxne lr
+ orrs r5, r5, r6 ; Check for 0
+ orreq r7, r7, #2 ; Only do mbfilter branch
+
; mbfilter flat && mask branch
; TODO(fgalligan): Can I decrease the cycles shifting to consective d's
; and using vibt on the q's?
diff --git a/libvpx/vp9/common/arm/neon/vp9_reconintra_neon.asm b/libvpx/vp9/common/arm/neon/vp9_reconintra_neon.asm
new file mode 100644
index 0000000..dc9856f
--- /dev/null
+++ b/libvpx/vp9/common/arm/neon/vp9_reconintra_neon.asm
@@ -0,0 +1,634 @@
+;
+; Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+;
+; Use of this source code is governed by a BSD-style license
+; that can be found in the LICENSE file in the root of the source
+; tree. An additional intellectual property rights grant can be found
+; in the file PATENTS. All contributing project authors may
+; be found in the AUTHORS file in the root of the source tree.
+;
+
+ EXPORT |vp9_v_predictor_4x4_neon|
+ EXPORT |vp9_v_predictor_8x8_neon|
+ EXPORT |vp9_v_predictor_16x16_neon|
+ EXPORT |vp9_v_predictor_32x32_neon|
+ EXPORT |vp9_h_predictor_4x4_neon|
+ EXPORT |vp9_h_predictor_8x8_neon|
+ EXPORT |vp9_h_predictor_16x16_neon|
+ EXPORT |vp9_h_predictor_32x32_neon|
+ EXPORT |vp9_tm_predictor_4x4_neon|
+ EXPORT |vp9_tm_predictor_8x8_neon|
+ EXPORT |vp9_tm_predictor_16x16_neon|
+ EXPORT |vp9_tm_predictor_32x32_neon|
+ ARM
+ REQUIRE8
+ PRESERVE8
+
+ AREA ||.text||, CODE, READONLY, ALIGN=2
+
+;void vp9_v_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_v_predictor_4x4_neon| PROC
+ vld1.32 {d0[0]}, [r2]
+ vst1.32 {d0[0]}, [r0], r1
+ vst1.32 {d0[0]}, [r0], r1
+ vst1.32 {d0[0]}, [r0], r1
+ vst1.32 {d0[0]}, [r0], r1
+ bx lr
+ ENDP ; |vp9_v_predictor_4x4_neon|
+
+;void vp9_v_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_v_predictor_8x8_neon| PROC
+ vld1.8 {d0}, [r2]
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ vst1.8 {d0}, [r0], r1
+ bx lr
+ ENDP ; |vp9_v_predictor_8x8_neon|
+
+;void vp9_v_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_v_predictor_16x16_neon| PROC
+ vld1.8 {q0}, [r2]
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ vst1.8 {q0}, [r0], r1
+ bx lr
+ ENDP ; |vp9_v_predictor_16x16_neon|
+
+;void vp9_v_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_v_predictor_32x32_neon| PROC
+ vld1.8 {q0, q1}, [r2]
+ mov r2, #2
+loop_v
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ vst1.8 {q0, q1}, [r0], r1
+ subs r2, r2, #1
+ bgt loop_v
+ bx lr
+ ENDP ; |vp9_v_predictor_32x32_neon|
+
+;void vp9_h_predictor_4x4_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_h_predictor_4x4_neon| PROC
+ vld1.32 {d1[0]}, [r3]
+ vdup.8 d0, d1[0]
+ vst1.32 {d0[0]}, [r0], r1
+ vdup.8 d0, d1[1]
+ vst1.32 {d0[0]}, [r0], r1
+ vdup.8 d0, d1[2]
+ vst1.32 {d0[0]}, [r0], r1
+ vdup.8 d0, d1[3]
+ vst1.32 {d0[0]}, [r0], r1
+ bx lr
+ ENDP ; |vp9_h_predictor_4x4_neon|
+
+;void vp9_h_predictor_8x8_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_h_predictor_8x8_neon| PROC
+ vld1.64 {d1}, [r3]
+ vdup.8 d0, d1[0]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[1]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[2]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[3]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[4]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[5]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[6]
+ vst1.64 {d0}, [r0], r1
+ vdup.8 d0, d1[7]
+ vst1.64 {d0}, [r0], r1
+ bx lr
+ ENDP ; |vp9_h_predictor_8x8_neon|
+
+;void vp9_h_predictor_16x16_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_h_predictor_16x16_neon| PROC
+ vld1.8 {q1}, [r3]
+ vdup.8 q0, d2[0]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[1]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[2]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[3]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[4]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[5]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[6]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[7]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[0]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[1]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[2]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[3]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[4]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[5]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[6]
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[7]
+ vst1.8 {q0}, [r0], r1
+ bx lr
+ ENDP ; |vp9_h_predictor_16x16_neon|
+
+;void vp9_h_predictor_32x32_neon(uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_h_predictor_32x32_neon| PROC
+ sub r1, r1, #16
+ mov r2, #2
+loop_h
+ vld1.8 {q1}, [r3]!
+ vdup.8 q0, d2[0]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[1]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[2]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[3]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[4]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[5]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[6]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d2[7]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[0]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[1]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[2]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[3]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[4]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[5]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[6]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ vdup.8 q0, d3[7]
+ vst1.8 {q0}, [r0]!
+ vst1.8 {q0}, [r0], r1
+ subs r2, r2, #1
+ bgt loop_h
+ bx lr
+ ENDP ; |vp9_h_predictor_32x32_neon|
+
+;void vp9_tm_predictor_4x4_neon (uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_tm_predictor_4x4_neon| PROC
+ ; Load ytop_left = above[-1];
+ sub r12, r2, #1
+ ldrb r12, [r12]
+ vdup.u8 d0, r12
+
+ ; Load above 4 pixels
+ vld1.32 {d2[0]}, [r2]
+
+ ; Compute above - ytop_left
+ vsubl.u8 q3, d2, d0
+
+ ; Load left row by row and compute left + (above - ytop_left)
+ ; 1st row and 2nd row
+ ldrb r12, [r3], #1
+ ldrb r2, [r3], #1
+ vdup.u16 q1, r12
+ vdup.u16 q2, r2
+ vadd.s16 q1, q1, q3
+ vadd.s16 q2, q2, q3
+ vqmovun.s16 d0, q1
+ vqmovun.s16 d1, q2
+ vst1.32 {d0[0]}, [r0], r1
+ vst1.32 {d1[0]}, [r0], r1
+
+ ; 3rd row and 4th row
+ ldrb r12, [r3], #1
+ ldrb r2, [r3], #1
+ vdup.u16 q1, r12
+ vdup.u16 q2, r2
+ vadd.s16 q1, q1, q3
+ vadd.s16 q2, q2, q3
+ vqmovun.s16 d0, q1
+ vqmovun.s16 d1, q2
+ vst1.32 {d0[0]}, [r0], r1
+ vst1.32 {d1[0]}, [r0], r1
+ bx lr
+ ENDP ; |vp9_tm_predictor_4x4_neon|
+
+;void vp9_tm_predictor_8x8_neon (uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_tm_predictor_8x8_neon| PROC
+ ; Load ytop_left = above[-1];
+ sub r12, r2, #1
+ ldrb r12, [r12]
+ vdup.u8 d0, r12
+
+ ; preload 8 left
+ vld1.8 {d30}, [r3]
+
+ ; Load above 8 pixels
+ vld1.64 {d2}, [r2]
+
+ vmovl.u8 q10, d30
+
+ ; Compute above - ytop_left
+ vsubl.u8 q3, d2, d0
+
+ ; Load left row by row and compute left + (above - ytop_left)
+ ; 1st row and 2nd row
+ vdup.16 q0, d20[0]
+ vdup.16 q1, d20[1]
+ vadd.s16 q0, q3, q0
+ vadd.s16 q1, q3, q1
+
+ ; 3rd row and 4th row
+ vdup.16 q8, d20[2]
+ vdup.16 q9, d20[3]
+ vadd.s16 q8, q3, q8
+ vadd.s16 q9, q3, q9
+
+ vqmovun.s16 d0, q0
+ vqmovun.s16 d1, q1
+ vqmovun.s16 d2, q8
+ vqmovun.s16 d3, q9
+
+ vst1.64 {d0}, [r0], r1
+ vst1.64 {d1}, [r0], r1
+ vst1.64 {d2}, [r0], r1
+ vst1.64 {d3}, [r0], r1
+
+ ; 5th row and 6th row
+ vdup.16 q0, d21[0]
+ vdup.16 q1, d21[1]
+ vadd.s16 q0, q3, q0
+ vadd.s16 q1, q3, q1
+
+ ; 7th row and 8th row
+ vdup.16 q8, d21[2]
+ vdup.16 q9, d21[3]
+ vadd.s16 q8, q3, q8
+ vadd.s16 q9, q3, q9
+
+ vqmovun.s16 d0, q0
+ vqmovun.s16 d1, q1
+ vqmovun.s16 d2, q8
+ vqmovun.s16 d3, q9
+
+ vst1.64 {d0}, [r0], r1
+ vst1.64 {d1}, [r0], r1
+ vst1.64 {d2}, [r0], r1
+ vst1.64 {d3}, [r0], r1
+
+ bx lr
+ ENDP ; |vp9_tm_predictor_8x8_neon|
+
+;void vp9_tm_predictor_16x16_neon (uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_tm_predictor_16x16_neon| PROC
+ ; Load ytop_left = above[-1];
+ sub r12, r2, #1
+ ldrb r12, [r12]
+ vdup.u8 q0, r12
+
+ ; Load above 8 pixels
+ vld1.8 {q1}, [r2]
+
+ ; preload 8 left into r12
+ vld1.8 {d18}, [r3]!
+
+ ; Compute above - ytop_left
+ vsubl.u8 q2, d2, d0
+ vsubl.u8 q3, d3, d1
+
+ vmovl.u8 q10, d18
+
+ ; Load left row by row and compute left + (above - ytop_left)
+ ; Process 8 rows in each single loop and loop 2 times to process 16 rows.
+ mov r2, #2
+
+loop_16x16_neon
+ ; Process two rows.
+ vdup.16 q0, d20[0]
+ vdup.16 q8, d20[1]
+ vadd.s16 q1, q0, q2
+ vadd.s16 q0, q0, q3
+ vadd.s16 q11, q8, q2
+ vadd.s16 q8, q8, q3
+ vqmovun.s16 d2, q1
+ vqmovun.s16 d3, q0
+ vqmovun.s16 d22, q11
+ vqmovun.s16 d23, q8
+ vdup.16 q0, d20[2] ; proload next 2 rows data
+ vdup.16 q8, d20[3]
+ vst1.64 {d2,d3}, [r0], r1
+ vst1.64 {d22,d23}, [r0], r1
+
+ ; Process two rows.
+ vadd.s16 q1, q0, q2
+ vadd.s16 q0, q0, q3
+ vadd.s16 q11, q8, q2
+ vadd.s16 q8, q8, q3
+ vqmovun.s16 d2, q1
+ vqmovun.s16 d3, q0
+ vqmovun.s16 d22, q11
+ vqmovun.s16 d23, q8
+ vdup.16 q0, d21[0] ; proload next 2 rows data
+ vdup.16 q8, d21[1]
+ vst1.64 {d2,d3}, [r0], r1
+ vst1.64 {d22,d23}, [r0], r1
+
+ vadd.s16 q1, q0, q2
+ vadd.s16 q0, q0, q3
+ vadd.s16 q11, q8, q2
+ vadd.s16 q8, q8, q3
+ vqmovun.s16 d2, q1
+ vqmovun.s16 d3, q0
+ vqmovun.s16 d22, q11
+ vqmovun.s16 d23, q8
+ vdup.16 q0, d21[2] ; proload next 2 rows data
+ vdup.16 q8, d21[3]
+ vst1.64 {d2,d3}, [r0], r1
+ vst1.64 {d22,d23}, [r0], r1
+
+
+ vadd.s16 q1, q0, q2
+ vadd.s16 q0, q0, q3
+ vadd.s16 q11, q8, q2
+ vadd.s16 q8, q8, q3
+ vqmovun.s16 d2, q1
+ vqmovun.s16 d3, q0
+ vqmovun.s16 d22, q11
+ vqmovun.s16 d23, q8
+ vld1.8 {d18}, [r3]! ; preload 8 left into r12
+ vmovl.u8 q10, d18
+ vst1.64 {d2,d3}, [r0], r1
+ vst1.64 {d22,d23}, [r0], r1
+
+ subs r2, r2, #1
+ bgt loop_16x16_neon
+
+ bx lr
+ ENDP ; |vp9_tm_predictor_16x16_neon|
+
+;void vp9_tm_predictor_32x32_neon (uint8_t *dst, ptrdiff_t y_stride,
+; const uint8_t *above,
+; const uint8_t *left)
+; r0 uint8_t *dst
+; r1 ptrdiff_t y_stride
+; r2 const uint8_t *above
+; r3 const uint8_t *left
+
+|vp9_tm_predictor_32x32_neon| PROC
+ ; Load ytop_left = above[-1];
+ sub r12, r2, #1
+ ldrb r12, [r12]
+ vdup.u8 q0, r12
+
+ ; Load above 32 pixels
+ vld1.8 {q1}, [r2]!
+ vld1.8 {q2}, [r2]
+
+ ; preload 8 left pixels
+ vld1.8 {d26}, [r3]!
+
+ ; Compute above - ytop_left
+ vsubl.u8 q8, d2, d0
+ vsubl.u8 q9, d3, d1
+ vsubl.u8 q10, d4, d0
+ vsubl.u8 q11, d5, d1
+
+ vmovl.u8 q3, d26
+
+ ; Load left row by row and compute left + (above - ytop_left)
+ ; Process 8 rows in each single loop and loop 4 times to process 32 rows.
+ mov r2, #4
+
+loop_32x32_neon
+ ; Process two rows.
+ vdup.16 q0, d6[0]
+ vdup.16 q2, d6[1]
+ vadd.s16 q12, q0, q8
+ vadd.s16 q13, q0, q9
+ vadd.s16 q14, q0, q10
+ vadd.s16 q15, q0, q11
+ vqmovun.s16 d0, q12
+ vqmovun.s16 d1, q13
+ vadd.s16 q12, q2, q8
+ vadd.s16 q13, q2, q9
+ vqmovun.s16 d2, q14
+ vqmovun.s16 d3, q15
+ vadd.s16 q14, q2, q10
+ vadd.s16 q15, q2, q11
+ vst1.64 {d0-d3}, [r0], r1
+ vqmovun.s16 d24, q12
+ vqmovun.s16 d25, q13
+ vqmovun.s16 d26, q14
+ vqmovun.s16 d27, q15
+ vdup.16 q1, d6[2]
+ vdup.16 q2, d6[3]
+ vst1.64 {d24-d27}, [r0], r1
+
+ ; Process two rows.
+ vadd.s16 q12, q1, q8
+ vadd.s16 q13, q1, q9
+ vadd.s16 q14, q1, q10
+ vadd.s16 q15, q1, q11
+ vqmovun.s16 d0, q12
+ vqmovun.s16 d1, q13
+ vadd.s16 q12, q2, q8
+ vadd.s16 q13, q2, q9
+ vqmovun.s16 d2, q14
+ vqmovun.s16 d3, q15
+ vadd.s16 q14, q2, q10
+ vadd.s16 q15, q2, q11
+ vst1.64 {d0-d3}, [r0], r1
+ vqmovun.s16 d24, q12
+ vqmovun.s16 d25, q13
+ vqmovun.s16 d26, q14
+ vqmovun.s16 d27, q15
+ vdup.16 q0, d7[0]
+ vdup.16 q2, d7[1]
+ vst1.64 {d24-d27}, [r0], r1
+
+ ; Process two rows.
+ vadd.s16 q12, q0, q8
+ vadd.s16 q13, q0, q9
+ vadd.s16 q14, q0, q10
+ vadd.s16 q15, q0, q11
+ vqmovun.s16 d0, q12
+ vqmovun.s16 d1, q13
+ vadd.s16 q12, q2, q8
+ vadd.s16 q13, q2, q9
+ vqmovun.s16 d2, q14
+ vqmovun.s16 d3, q15
+ vadd.s16 q14, q2, q10
+ vadd.s16 q15, q2, q11
+ vst1.64 {d0-d3}, [r0], r1
+ vqmovun.s16 d24, q12
+ vqmovun.s16 d25, q13
+ vqmovun.s16 d26, q14
+ vqmovun.s16 d27, q15
+ vdup.16 q0, d7[2]
+ vdup.16 q2, d7[3]
+ vst1.64 {d24-d27}, [r0], r1
+
+ ; Process two rows.
+ vadd.s16 q12, q0, q8
+ vadd.s16 q13, q0, q9
+ vadd.s16 q14, q0, q10
+ vadd.s16 q15, q0, q11
+ vqmovun.s16 d0, q12
+ vqmovun.s16 d1, q13
+ vadd.s16 q12, q2, q8
+ vadd.s16 q13, q2, q9
+ vqmovun.s16 d2, q14
+ vqmovun.s16 d3, q15
+ vadd.s16 q14, q2, q10
+ vadd.s16 q15, q2, q11
+ vst1.64 {d0-d3}, [r0], r1
+ vqmovun.s16 d24, q12
+ vqmovun.s16 d25, q13
+ vld1.8 {d0}, [r3]! ; preload 8 left pixels
+ vqmovun.s16 d26, q14
+ vqmovun.s16 d27, q15
+ vmovl.u8 q3, d0
+ vst1.64 {d24-d27}, [r0], r1
+
+ subs r2, r2, #1
+ bgt loop_32x32_neon
+
+ bx lr
+ ENDP ; |vp9_tm_predictor_32x32_neon|
+
+ END
diff --git a/libvpx/vp9/common/generic/vp9_systemdependent.c b/libvpx/vp9/common/generic/vp9_systemdependent.c
deleted file mode 100644
index 536febb..0000000
--- a/libvpx/vp9/common/generic/vp9_systemdependent.c
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include "./vpx_config.h"
-#include "./vp9_rtcd.h"
-#include "vp9/common/vp9_onyxc_int.h"
-
-void vp9_machine_specific_config(VP9_COMMON *cm) {
- (void)cm;
- vp9_rtcd();
-}
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_common_dspr2.h b/libvpx/vp9/common/mips/dspr2/vp9_common_dspr2.h
index 644264f..6ebea9f 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_common_dspr2.h
+++ b/libvpx/vp9/common/mips/dspr2/vp9_common_dspr2.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VP9_COMMON_VP9_COMMON_DSPR2_H_
-#define VP9_COMMON_VP9_COMMON_DSPR2_H_
+#ifndef VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_
+#define VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_
#include <assert.h>
@@ -17,6 +17,10 @@
#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_DSPR2
#define CROP_WIDTH 512
extern uint8_t *vp9_ff_cropTbl;
@@ -81,8 +85,8 @@ static INLINE void vp9_prefetch_store_streamed(unsigned char *dst) {
);
}
-void vp9_idct32_1d_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
- int dest_stride);
+void vp9_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
+ int dest_stride);
void vp9_convolve2_horiz_dspr2(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride,
@@ -114,4 +118,8 @@ void vp9_convolve2_vert_dspr2(const uint8_t *src, ptrdiff_t src_stride,
int w, int h);
#endif // #if HAVE_DSPR2
-#endif // VP9_COMMON_VP9_COMMON_DSPR2_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_COMMON_MIPS_DSPR2_VP9_COMMON_DSPR2_H_
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c
index 1b2f550..19c582f 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_itrans16_dspr2.c
@@ -19,8 +19,8 @@
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#if HAVE_DSPR2
-static void idct16_1d_rows_dspr2(const int16_t *input, int16_t *output,
- uint32_t no_rows) {
+static void idct16_rows_dspr2(const int16_t *input, int16_t *output,
+ uint32_t no_rows) {
int i;
int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7;
int step1_10, step1_11, step1_12, step1_13;
@@ -404,8 +404,8 @@ static void idct16_1d_rows_dspr2(const int16_t *input, int16_t *output,
}
}
-static void idct16_1d_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
- int dest_stride) {
+static void idct16_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
+ int dest_stride) {
int i;
int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7;
int step1_8, step1_9, step1_10, step1_11;
@@ -905,13 +905,13 @@ void vp9_idct16x16_256_add_dspr2(const int16_t *input, uint8_t *dest,
);
// First transform rows
- idct16_1d_rows_dspr2(input, out, 16);
+ idct16_rows_dspr2(input, out, 16);
// Then transform columns and add to dest
- idct16_1d_cols_add_blk_dspr2(out, dest, dest_stride);
+ idct16_cols_add_blk_dspr2(out, dest, dest_stride);
}
-static void iadst16_1d(const int16_t *input, int16_t *output) {
+static void iadst16(const int16_t *input, int16_t *output) {
int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;
int x0 = input[15];
@@ -1099,16 +1099,16 @@ void vp9_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest,
switch (tx_type) {
case DCT_DCT: // DCT in both horizontal and vertical
- idct16_1d_rows_dspr2(input, outptr, 16);
- idct16_1d_cols_add_blk_dspr2(out, dest, pitch);
+ idct16_rows_dspr2(input, outptr, 16);
+ idct16_cols_add_blk_dspr2(out, dest, pitch);
break;
case ADST_DCT: // ADST in vertical, DCT in horizontal
- idct16_1d_rows_dspr2(input, outptr, 16);
+ idct16_rows_dspr2(input, outptr, 16);
outptr = out;
for (i = 0; i < 16; ++i) {
- iadst16_1d(outptr, temp_out);
+ iadst16(outptr, temp_out);
for (j = 0; j < 16; ++j)
dest[j * pitch + i] =
@@ -1125,7 +1125,7 @@ void vp9_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest,
/* prefetch row */
vp9_prefetch_load((const uint8_t *)(input + 16));
- iadst16_1d(input, outptr);
+ iadst16(input, outptr);
input += 16;
outptr += 16;
}
@@ -1134,7 +1134,7 @@ void vp9_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest,
for (j = 0; j < 16; ++j)
temp_in[j * 16 + i] = out[i * 16 + j];
- idct16_1d_cols_add_blk_dspr2(temp_in, dest, pitch);
+ idct16_cols_add_blk_dspr2(temp_in, dest, pitch);
}
break;
case ADST_ADST: // ADST in both directions
@@ -1145,7 +1145,7 @@ void vp9_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest,
/* prefetch row */
vp9_prefetch_load((const uint8_t *)(input + 16));
- iadst16_1d(input, outptr);
+ iadst16(input, outptr);
input += 16;
outptr += 16;
}
@@ -1153,7 +1153,7 @@ void vp9_iht16x16_256_add_dspr2(const int16_t *input, uint8_t *dest,
for (i = 0; i < 16; ++i) {
for (j = 0; j < 16; ++j)
temp_in[j] = out[j * 16 + i];
- iadst16_1d(temp_in, temp_out);
+ iadst16(temp_in, temp_out);
for (j = 0; j < 16; ++j)
dest[j * pitch + i] =
clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
@@ -1183,7 +1183,7 @@ void vp9_idct16x16_10_add_dspr2(const int16_t *input, uint8_t *dest,
// First transform rows. Since all non-zero dct coefficients are in
// upper-left 4x4 area, we only need to calculate first 4 rows here.
- idct16_1d_rows_dspr2(input, outptr, 4);
+ idct16_rows_dspr2(input, outptr, 4);
outptr += 4;
for (i = 0; i < 6; ++i) {
@@ -1213,7 +1213,7 @@ void vp9_idct16x16_10_add_dspr2(const int16_t *input, uint8_t *dest,
}
// Then transform columns
- idct16_1d_cols_add_blk_dspr2(out, dest, dest_stride);
+ idct16_cols_add_blk_dspr2(out, dest, dest_stride);
}
void vp9_idct16x16_1_add_dspr2(const int16_t *input, uint8_t *dest,
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c
index 5e92db3..132d88c 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_itrans32_cols_dspr2.c
@@ -18,8 +18,8 @@
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#if HAVE_DSPR2
-void vp9_idct32_1d_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
- int dest_stride) {
+void vp9_idct32_cols_add_blk_dspr2(int16_t *input, uint8_t *dest,
+ int dest_stride) {
int16_t step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6;
int16_t step1_7, step1_8, step1_9, step1_10, step1_11, step1_12, step1_13;
int16_t step1_14, step1_15, step1_16, step1_17, step1_18, step1_19;
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c
index bc67594..74a90b0 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_itrans32_dspr2.c
@@ -19,8 +19,8 @@
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#if HAVE_DSPR2
-static void idct32_1d_rows_dspr2(const int16_t *input, int16_t *output,
- uint32_t no_rows) {
+static void idct32_rows_dspr2(const int16_t *input, int16_t *output,
+ uint32_t no_rows) {
int16_t step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6;
int16_t step1_7, step1_8, step1_9, step1_10, step1_11, step1_12, step1_13;
int16_t step1_14, step1_15, step1_16, step1_17, step1_18, step1_19, step1_20;
@@ -882,10 +882,10 @@ void vp9_idct32x32_1024_add_dspr2(const int16_t *input, uint8_t *dest,
);
// Rows
- idct32_1d_rows_dspr2(input, outptr, 32);
+ idct32_rows_dspr2(input, outptr, 32);
// Columns
- vp9_idct32_1d_cols_add_blk_dspr2(out, dest, dest_stride);
+ vp9_idct32_cols_add_blk_dspr2(out, dest, dest_stride);
}
void vp9_idct32x32_34_add_dspr2(const int16_t *input, uint8_t *dest,
@@ -903,7 +903,7 @@ void vp9_idct32x32_34_add_dspr2(const int16_t *input, uint8_t *dest,
);
// Rows
- idct32_1d_rows_dspr2(input, outptr, 8);
+ idct32_rows_dspr2(input, outptr, 8);
outptr += 8;
__asm__ __volatile__ (
@@ -947,7 +947,7 @@ void vp9_idct32x32_34_add_dspr2(const int16_t *input, uint8_t *dest,
}
// Columns
- vp9_idct32_1d_cols_add_blk_dspr2(out, dest, stride);
+ vp9_idct32_cols_add_blk_dspr2(out, dest, stride);
}
void vp9_idct32x32_1_add_dspr2(const int16_t *input, uint8_t *dest,
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c
index 5b7aa5e..1990348 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_itrans4_dspr2.c
@@ -19,7 +19,7 @@
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#if HAVE_DSPR2
-static void vp9_idct4_1d_rows_dspr2(const int16_t *input, int16_t *output) {
+static void vp9_idct4_rows_dspr2(const int16_t *input, int16_t *output) {
int16_t step_0, step_1, step_2, step_3;
int Temp0, Temp1, Temp2, Temp3;
const int const_2_power_13 = 8192;
@@ -104,7 +104,7 @@ static void vp9_idct4_1d_rows_dspr2(const int16_t *input, int16_t *output) {
}
}
-static void vp9_idct4_1d_columns_add_blk_dspr2(int16_t *input, uint8_t *dest,
+static void vp9_idct4_columns_add_blk_dspr2(int16_t *input, uint8_t *dest,
int dest_stride) {
int16_t step_0, step_1, step_2, step_3;
int Temp0, Temp1, Temp2, Temp3;
@@ -240,10 +240,10 @@ void vp9_idct4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
);
// Rows
- vp9_idct4_1d_rows_dspr2(input, outptr);
+ vp9_idct4_rows_dspr2(input, outptr);
// Columns
- vp9_idct4_1d_columns_add_blk_dspr2(&out[0], dest, dest_stride);
+ vp9_idct4_columns_add_blk_dspr2(&out[0], dest, dest_stride);
}
void vp9_idct4x4_1_add_dspr2(const int16_t *input, uint8_t *dest,
@@ -319,7 +319,7 @@ void vp9_idct4x4_1_add_dspr2(const int16_t *input, uint8_t *dest,
}
}
-static void iadst4_1d_dspr2(const int16_t *input, int16_t *output) {
+static void iadst4_dspr2(const int16_t *input, int16_t *output) {
int s0, s1, s2, s3, s4, s5, s6, s7;
int x0, x1, x2, x3;
@@ -379,16 +379,16 @@ void vp9_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
switch (tx_type) {
case DCT_DCT: // DCT in both horizontal and vertical
- vp9_idct4_1d_rows_dspr2(input, outptr);
- vp9_idct4_1d_columns_add_blk_dspr2(&out[0], dest, dest_stride);
+ vp9_idct4_rows_dspr2(input, outptr);
+ vp9_idct4_columns_add_blk_dspr2(&out[0], dest, dest_stride);
break;
case ADST_DCT: // ADST in vertical, DCT in horizontal
- vp9_idct4_1d_rows_dspr2(input, outptr);
+ vp9_idct4_rows_dspr2(input, outptr);
outptr = out;
for (i = 0; i < 4; ++i) {
- iadst4_1d_dspr2(outptr, temp_out);
+ iadst4_dspr2(outptr, temp_out);
for (j = 0; j < 4; ++j)
dest[j * dest_stride + i] =
@@ -400,7 +400,7 @@ void vp9_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
break;
case DCT_ADST: // DCT in vertical, ADST in horizontal
for (i = 0; i < 4; ++i) {
- iadst4_1d_dspr2(input, outptr);
+ iadst4_dspr2(input, outptr);
input += 4;
outptr += 4;
}
@@ -410,11 +410,11 @@ void vp9_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
temp_in[i * 4 + j] = out[j * 4 + i];
}
}
- vp9_idct4_1d_columns_add_blk_dspr2(&temp_in[0], dest, dest_stride);
+ vp9_idct4_columns_add_blk_dspr2(&temp_in[0], dest, dest_stride);
break;
case ADST_ADST: // ADST in both directions
for (i = 0; i < 4; ++i) {
- iadst4_1d_dspr2(input, outptr);
+ iadst4_dspr2(input, outptr);
input += 4;
outptr += 4;
}
@@ -422,7 +422,7 @@ void vp9_iht4x4_16_add_dspr2(const int16_t *input, uint8_t *dest,
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j)
temp_in[j] = out[j * 4 + i];
- iadst4_1d_dspr2(temp_in, temp_out);
+ iadst4_dspr2(temp_in, temp_out);
for (j = 0; j < 4; ++j)
dest[j * dest_stride + i] =
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c
index 93a0840..acccaea 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_itrans8_dspr2.c
@@ -19,8 +19,8 @@
#include "vp9/common/mips/dspr2/vp9_common_dspr2.h"
#if HAVE_DSPR2
-static void idct8_1d_rows_dspr2(const int16_t *input, int16_t *output,
- uint32_t no_rows) {
+static void idct8_rows_dspr2(const int16_t *input, int16_t *output,
+ uint32_t no_rows) {
int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7;
const int const_2_power_13 = 8192;
int Temp0, Temp1, Temp2, Temp3, Temp4;
@@ -200,8 +200,8 @@ static void idct8_1d_rows_dspr2(const int16_t *input, int16_t *output,
}
}
-static void idct8_1d_columns_add_blk_dspr2(int16_t *input, uint8_t *dest,
- int dest_stride) {
+static void idct8_columns_add_blk_dspr2(int16_t *input, uint8_t *dest,
+ int dest_stride) {
int step1_0, step1_1, step1_2, step1_3, step1_4, step1_5, step1_6, step1_7;
int Temp0, Temp1, Temp2, Temp3;
int i;
@@ -462,13 +462,13 @@ void vp9_idct8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
);
// First transform rows
- idct8_1d_rows_dspr2(input, outptr, 8);
+ idct8_rows_dspr2(input, outptr, 8);
// Then transform columns and add to dest
- idct8_1d_columns_add_blk_dspr2(&out[0], dest, dest_stride);
+ idct8_columns_add_blk_dspr2(&out[0], dest, dest_stride);
}
-static void iadst8_1d_dspr2(const int16_t *input, int16_t *output) {
+static void iadst8_dspr2(const int16_t *input, int16_t *output) {
int s0, s1, s2, s3, s4, s5, s6, s7;
int x0, x1, x2, x3, x4, x5, x6, x7;
@@ -563,14 +563,14 @@ void vp9_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
switch (tx_type) {
case DCT_DCT: // DCT in both horizontal and vertical
- idct8_1d_rows_dspr2(input, outptr, 8);
- idct8_1d_columns_add_blk_dspr2(&out[0], dest, dest_stride);
+ idct8_rows_dspr2(input, outptr, 8);
+ idct8_columns_add_blk_dspr2(&out[0], dest, dest_stride);
break;
case ADST_DCT: // ADST in vertical, DCT in horizontal
- idct8_1d_rows_dspr2(input, outptr, 8);
+ idct8_rows_dspr2(input, outptr, 8);
for (i = 0; i < 8; ++i) {
- iadst8_1d_dspr2(&out[i * 8], temp_out);
+ iadst8_dspr2(&out[i * 8], temp_out);
for (j = 0; j < 8; ++j)
dest[j * dest_stride + i] =
@@ -580,7 +580,7 @@ void vp9_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
break;
case DCT_ADST: // DCT in vertical, ADST in horizontal
for (i = 0; i < 8; ++i) {
- iadst8_1d_dspr2(input, outptr);
+ iadst8_dspr2(input, outptr);
input += 8;
outptr += 8;
}
@@ -590,11 +590,11 @@ void vp9_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
temp_in[i * 8 + j] = out[j * 8 + i];
}
}
- idct8_1d_columns_add_blk_dspr2(&temp_in[0], dest, dest_stride);
+ idct8_columns_add_blk_dspr2(&temp_in[0], dest, dest_stride);
break;
case ADST_ADST: // ADST in both directions
for (i = 0; i < 8; ++i) {
- iadst8_1d_dspr2(input, outptr);
+ iadst8_dspr2(input, outptr);
input += 8;
outptr += 8;
}
@@ -603,7 +603,7 @@ void vp9_iht8x8_64_add_dspr2(const int16_t *input, uint8_t *dest,
for (j = 0; j < 8; ++j)
temp_in[j] = out[j * 8 + i];
- iadst8_1d_dspr2(temp_in, temp_out);
+ iadst8_dspr2(temp_in, temp_out);
for (j = 0; j < 8; ++j)
dest[j * dest_stride + i] =
@@ -631,7 +631,7 @@ void vp9_idct8x8_10_add_dspr2(const int16_t *input, uint8_t *dest,
);
// First transform rows
- idct8_1d_rows_dspr2(input, outptr, 4);
+ idct8_rows_dspr2(input, outptr, 4);
outptr += 4;
@@ -659,7 +659,7 @@ void vp9_idct8x8_10_add_dspr2(const int16_t *input, uint8_t *dest,
// Then transform columns and add to dest
- idct8_1d_columns_add_blk_dspr2(&out[0], dest, dest_stride);
+ idct8_columns_add_blk_dspr2(&out[0], dest, dest_stride);
}
void vp9_idct8x8_1_add_dspr2(const int16_t *input, uint8_t *dest,
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c
index 36cfc83..3df7f4c 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.c
@@ -20,12 +20,12 @@
#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h"
#if HAVE_DSPR2
-void vp9_loop_filter_horizontal_edge_dspr2(unsigned char *s,
- int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_4_dspr2(unsigned char *s,
+ int pitch,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh,
+ int count) {
uint8_t i;
uint32_t mask;
uint32_t hev;
@@ -114,12 +114,12 @@ void vp9_loop_filter_horizontal_edge_dspr2(unsigned char *s,
}
}
-void vp9_loop_filter_vertical_edge_dspr2(unsigned char *s,
- int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_vertical_4_dspr2(unsigned char *s,
+ int pitch,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh,
+ int count) {
uint8_t i;
uint32_t mask, hev;
uint32_t pm1, p0, p1, p2, p3, p4, p5, p6;
@@ -306,4 +306,57 @@ void vp9_loop_filter_vertical_edge_dspr2(unsigned char *s,
}
}
}
+
+void vp9_lpf_horizontal_4_dual_dspr2(uint8_t *s, int p /* pitch */,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_horizontal_4_dspr2(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_horizontal_4_dspr2(s + 8, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_horizontal_8_dual_dspr2(uint8_t *s, int p /* pitch */,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_horizontal_8_dspr2(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_horizontal_8_dspr2(s + 8, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_4_dual_dspr2(uint8_t *s, int p,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_vertical_4_dspr2(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_vertical_4_dspr2(s + 8 * p, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_8_dual_dspr2(uint8_t *s, int p,
+ const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_vertical_8_dspr2(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_vertical_8_dspr2(s + 8 * p, p, blimit1, limit1, thresh1,
+ 1);
+}
+
+void vp9_lpf_vertical_16_dual_dspr2(uint8_t *s, int p,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh) {
+ vp9_lpf_vertical_16_dspr2(s, p, blimit, limit, thresh);
+ vp9_lpf_vertical_16_dspr2(s + 8 * p, p, blimit, limit, thresh);
+}
#endif // #if HAVE_DSPR2
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h
index 98bfcfa..008cf8c 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h
+++ b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h
@@ -17,6 +17,10 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_DSPR2
/* inputs & outputs are quad-byte vectors */
static INLINE void vp9_filter_dspr2(uint32_t mask, uint32_t hev,
@@ -752,4 +756,8 @@ static INLINE void vp9_wide_mbfilter_dspr2(uint32_t *op7, uint32_t *op6,
*oq6 = res_oq6;
}
#endif // #if HAVE_DSPR2
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_FILTERS_DSPR2_H_
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h
index 4cb2ebb..ca01a6a 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h
+++ b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_macros_dspr2.h
@@ -17,6 +17,10 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_DSPR2
#define STORE_F0() { \
__asm__ __volatile__ ( \
@@ -467,4 +471,8 @@
}
#endif // #if HAVE_DSPR2
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MACROS_DSPR2_H_
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h
index b9e0aca..5b0d9cc 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h
+++ b/libvpx/vp9/common/mips/dspr2/vp9_loopfilter_masks_dspr2.h
@@ -17,6 +17,10 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_DSPR2
/* processing 4 pixels at the same time
* compute hev and mask in the same function */
@@ -362,4 +366,8 @@ static INLINE void vp9_flatmask5(uint32_t p4, uint32_t p3,
*flat2 = flat1;
}
#endif // #if HAVE_DSPR2
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_MIPS_DSPR2_VP9_LOOPFILTER_MASKS_DSPR2_H_
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c
index adfd755..7cd0b63 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_mbloop_loopfilter_dspr2.c
@@ -20,12 +20,12 @@
#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h"
#if HAVE_DSPR2
-void vp9_mbloop_filter_horizontal_edge_dspr2(unsigned char *s,
- int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_8_dspr2(unsigned char *s,
+ int pitch,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh,
+ int count) {
uint32_t mask;
uint32_t hev, flat;
uint8_t i;
@@ -319,12 +319,12 @@ void vp9_mbloop_filter_horizontal_edge_dspr2(unsigned char *s,
}
}
-void vp9_mbloop_filter_vertical_edge_dspr2(unsigned char *s,
- int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_vertical_8_dspr2(unsigned char *s,
+ int pitch,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh,
+ int count) {
uint8_t i;
uint32_t mask, hev, flat;
uint8_t *s1, *s2, *s3, *s4;
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c
index 0759755..6c94674 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_mblpf_horiz_loopfilter_dspr2.c
@@ -20,12 +20,12 @@
#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h"
#if HAVE_DSPR2
-void vp9_mb_lpf_horizontal_edge_w_dspr2(unsigned char *s,
- int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_16_dspr2(unsigned char *s,
+ int pitch,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh,
+ int count) {
uint32_t mask;
uint32_t hev, flat, flat2;
uint8_t i;
diff --git a/libvpx/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c b/libvpx/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c
index 9e9171c..851fc6c 100644
--- a/libvpx/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c
+++ b/libvpx/vp9/common/mips/dspr2/vp9_mblpf_vert_loopfilter_dspr2.c
@@ -20,11 +20,11 @@
#include "vp9/common/mips/dspr2/vp9_loopfilter_filters_dspr2.h"
#if HAVE_DSPR2
-void vp9_mb_lpf_vertical_edge_w_dspr2(uint8_t *s,
- int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh) {
+void vp9_lpf_vertical_16_dspr2(uint8_t *s,
+ int pitch,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh) {
uint8_t i;
uint32_t mask, hev, flat, flat2;
uint8_t *s1, *s2, *s3, *s4;
diff --git a/libvpx/vp9/common/vp9_alloccommon.c b/libvpx/vp9/common/vp9_alloccommon.c
index d298160..08ab27a 100644
--- a/libvpx/vp9/common/vp9_alloccommon.c
+++ b/libvpx/vp9/common/vp9_alloccommon.c
@@ -8,14 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#include "./vpx_config.h"
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_entropymv.h"
-#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_systemdependent.h"
@@ -31,27 +29,6 @@ void vp9_update_mode_info_border(VP9_COMMON *cm, MODE_INFO *mi) {
vpx_memset(&mi[i * stride], 0, sizeof(MODE_INFO));
}
-void vp9_free_frame_buffers(VP9_COMMON *cm) {
- int i;
-
- for (i = 0; i < NUM_YV12_BUFFERS; i++)
- vp9_free_frame_buffer(&cm->yv12_fb[i]);
-
- vp9_free_frame_buffer(&cm->post_proc_buffer);
-
- vpx_free(cm->mip);
- vpx_free(cm->prev_mip);
- vpx_free(cm->last_frame_seg_map);
- vpx_free(cm->mi_grid_base);
- vpx_free(cm->prev_mi_grid_base);
-
- cm->mip = NULL;
- cm->prev_mip = NULL;
- cm->last_frame_seg_map = NULL;
- cm->mi_grid_base = NULL;
- cm->prev_mi_grid_base = NULL;
-}
-
static void set_mb_mi(VP9_COMMON *cm, int aligned_width, int aligned_height) {
cm->mi_cols = aligned_width >> MI_SIZE_LOG2;
cm->mi_rows = aligned_height >> MI_SIZE_LOG2;
@@ -69,57 +46,91 @@ static void setup_mi(VP9_COMMON *cm) {
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
vpx_memset(cm->mip, 0,
- cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
+ cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(*cm->mip));
vpx_memset(cm->mi_grid_base, 0,
cm->mode_info_stride * (cm->mi_rows + 1) *
sizeof(*cm->mi_grid_base));
- vp9_update_mode_info_border(cm, cm->mip);
vp9_update_mode_info_border(cm, cm->prev_mip);
}
+static int alloc_mi(VP9_COMMON *cm, int mi_size) {
+ cm->mip = (MODE_INFO *)vpx_calloc(mi_size, sizeof(*cm->mip));
+ if (cm->mip == NULL)
+ return 1;
+
+ cm->prev_mip = (MODE_INFO *)vpx_calloc(mi_size, sizeof(*cm->prev_mip));
+ if (cm->prev_mip == NULL)
+ return 1;
+
+ cm->mi_grid_base =
+ (MODE_INFO **)vpx_calloc(mi_size, sizeof(*cm->mi_grid_base));
+ if (cm->mi_grid_base == NULL)
+ return 1;
+
+ cm->prev_mi_grid_base =
+ (MODE_INFO **)vpx_calloc(mi_size, sizeof(*cm->prev_mi_grid_base));
+ if (cm->prev_mi_grid_base == NULL)
+ return 1;
+
+ return 0;
+}
+
+static void free_mi(VP9_COMMON *cm) {
+ vpx_free(cm->mip);
+ vpx_free(cm->prev_mip);
+ vpx_free(cm->mi_grid_base);
+ vpx_free(cm->prev_mi_grid_base);
+
+ cm->mip = NULL;
+ cm->prev_mip = NULL;
+ cm->mi_grid_base = NULL;
+ cm->prev_mi_grid_base = NULL;
+}
+
+void vp9_free_frame_buffers(VP9_COMMON *cm) {
+ int i;
+
+ for (i = 0; i < FRAME_BUFFERS; ++i) {
+ vp9_free_frame_buffer(&cm->frame_bufs[i].buf);
+
+ if (cm->frame_bufs[i].ref_count > 0 &&
+ cm->frame_bufs[i].raw_frame_buffer.data != NULL) {
+ cm->release_fb_cb(cm->cb_priv, &cm->frame_bufs[i].raw_frame_buffer);
+ cm->frame_bufs[i].ref_count = 0;
+ }
+ }
+
+ vp9_free_frame_buffer(&cm->post_proc_buffer);
+
+ free_mi(cm);
+
+ vpx_free(cm->last_frame_seg_map);
+ cm->last_frame_seg_map = NULL;
+}
+
int vp9_resize_frame_buffers(VP9_COMMON *cm, int width, int height) {
const int aligned_width = ALIGN_POWER_OF_TWO(width, MI_SIZE_LOG2);
const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2);
const int ss_x = cm->subsampling_x;
const int ss_y = cm->subsampling_y;
- int mi_size;
if (vp9_realloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
- VP9BORDERINPIXELS) < 0)
+ VP9_DEC_BORDER_IN_PIXELS, NULL, NULL, NULL) < 0)
goto fail;
set_mb_mi(cm, aligned_width, aligned_height);
- // Allocation
- mi_size = cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE);
-
- vpx_free(cm->mip);
- cm->mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
- if (!cm->mip)
- goto fail;
-
- vpx_free(cm->prev_mip);
- cm->prev_mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
- if (!cm->prev_mip)
- goto fail;
-
- vpx_free(cm->mi_grid_base);
- cm->mi_grid_base = vpx_calloc(mi_size, sizeof(*cm->mi_grid_base));
- if (!cm->mi_grid_base)
- goto fail;
-
- vpx_free(cm->prev_mi_grid_base);
- cm->prev_mi_grid_base = vpx_calloc(mi_size, sizeof(*cm->prev_mi_grid_base));
- if (!cm->prev_mi_grid_base)
+ free_mi(cm);
+ if (alloc_mi(cm, cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE)))
goto fail;
setup_mi(cm);
// Create the segmentation map structure and set to 0.
vpx_free(cm->last_frame_seg_map);
- cm->last_frame_seg_map = vpx_calloc(cm->mi_rows * cm->mi_cols, 1);
+ cm->last_frame_seg_map = (uint8_t *)vpx_calloc(cm->mi_rows * cm->mi_cols, 1);
if (!cm->last_frame_seg_map)
goto fail;
@@ -137,57 +148,37 @@ int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) {
const int aligned_height = ALIGN_POWER_OF_TWO(height, MI_SIZE_LOG2);
const int ss_x = cm->subsampling_x;
const int ss_y = cm->subsampling_y;
- int mi_size;
vp9_free_frame_buffers(cm);
- for (i = 0; i < NUM_YV12_BUFFERS; i++) {
- cm->fb_idx_ref_cnt[i] = 0;
- if (vp9_alloc_frame_buffer(&cm->yv12_fb[i], width, height, ss_x, ss_y,
- VP9BORDERINPIXELS) < 0)
+ for (i = 0; i < FRAME_BUFFERS; i++) {
+ cm->frame_bufs[i].ref_count = 0;
+ if (vp9_alloc_frame_buffer(&cm->frame_bufs[i].buf, width, height,
+ ss_x, ss_y, VP9_ENC_BORDER_IN_PIXELS) < 0)
goto fail;
}
- cm->new_fb_idx = NUM_YV12_BUFFERS - 1;
- cm->fb_idx_ref_cnt[cm->new_fb_idx] = 1;
-
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; i++)
- cm->active_ref_idx[i] = i;
+ cm->new_fb_idx = FRAME_BUFFERS - 1;
+ cm->frame_bufs[cm->new_fb_idx].ref_count = 1;
- for (i = 0; i < NUM_REF_FRAMES; i++) {
+ for (i = 0; i < REF_FRAMES; i++) {
cm->ref_frame_map[i] = i;
- cm->fb_idx_ref_cnt[i] = 1;
+ cm->frame_bufs[i].ref_count = 1;
}
if (vp9_alloc_frame_buffer(&cm->post_proc_buffer, width, height, ss_x, ss_y,
- VP9BORDERINPIXELS) < 0)
+ VP9_ENC_BORDER_IN_PIXELS) < 0)
goto fail;
set_mb_mi(cm, aligned_width, aligned_height);
- // Allocation
- mi_size = cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE);
-
- cm->mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
- if (!cm->mip)
- goto fail;
-
- cm->prev_mip = vpx_calloc(mi_size, sizeof(MODE_INFO));
- if (!cm->prev_mip)
- goto fail;
-
- cm->mi_grid_base = vpx_calloc(mi_size, sizeof(*cm->mi_grid_base));
- if (!cm->mi_grid_base)
- goto fail;
-
- cm->prev_mi_grid_base = vpx_calloc(mi_size, sizeof(*cm->prev_mi_grid_base));
- if (!cm->prev_mi_grid_base)
+ if (alloc_mi(cm, cm->mode_info_stride * (cm->mi_rows + MI_BLOCK_SIZE)))
goto fail;
setup_mi(cm);
// Create the segmentation map structure and set to 0.
- cm->last_frame_seg_map = vpx_calloc(cm->mi_rows * cm->mi_cols, 1);
+ cm->last_frame_seg_map = (uint8_t *)vpx_calloc(cm->mi_rows * cm->mi_cols, 1);
if (!cm->last_frame_seg_map)
goto fail;
@@ -198,22 +189,13 @@ int vp9_alloc_frame_buffers(VP9_COMMON *cm, int width, int height) {
return 1;
}
-void vp9_create_common(VP9_COMMON *cm) {
- vp9_machine_specific_config(cm);
-
- cm->tx_mode = ONLY_4X4;
- cm->comp_pred_mode = HYBRID_PREDICTION;
-}
-
void vp9_remove_common(VP9_COMMON *cm) {
vp9_free_frame_buffers(cm);
+ vp9_free_internal_frame_buffers(&cm->int_frame_buffers);
}
void vp9_initialize_common() {
vp9_init_neighbors();
- vp9_coef_tree_initialize();
- vp9_entropy_mode_init();
- vp9_entropy_mv_init();
}
void vp9_update_frame_size(VP9_COMMON *cm) {
@@ -227,3 +209,19 @@ void vp9_update_frame_size(VP9_COMMON *cm) {
if (cm->last_frame_seg_map)
vpx_memset(cm->last_frame_seg_map, 0, cm->mi_rows * cm->mi_cols);
}
+
+void vp9_swap_mi_and_prev_mi(VP9_COMMON *cm) {
+ // Current mip will be the prev_mip for the next frame.
+ MODE_INFO *temp = cm->prev_mip;
+ MODE_INFO **temp2 = cm->prev_mi_grid_base;
+ cm->prev_mip = cm->mip;
+ cm->mip = temp;
+ cm->prev_mi_grid_base = cm->mi_grid_base;
+ cm->mi_grid_base = temp2;
+
+ // Update the upper left visible macroblock ptrs.
+ cm->mi = cm->mip + cm->mode_info_stride + 1;
+ cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
+ cm->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
+ cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
+}
diff --git a/libvpx/vp9/common/vp9_alloccommon.h b/libvpx/vp9/common/vp9_alloccommon.h
index cf8dca5..fca6935 100644
--- a/libvpx/vp9/common/vp9_alloccommon.h
+++ b/libvpx/vp9/common/vp9_alloccommon.h
@@ -14,11 +14,14 @@
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_initialize_common();
void vp9_update_mode_info_border(VP9_COMMON *cm, MODE_INFO *mi);
-void vp9_create_common(VP9_COMMON *cm);
void vp9_remove_common(VP9_COMMON *cm);
int vp9_resize_frame_buffers(VP9_COMMON *cm, int width, int height);
@@ -28,4 +31,10 @@ void vp9_free_frame_buffers(VP9_COMMON *cm);
void vp9_update_frame_size(VP9_COMMON *cm);
+void vp9_swap_mi_and_prev_mi(VP9_COMMON *cm);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_ALLOCCOMMON_H_
diff --git a/libvpx/vp9/common/vp9_blockd.c b/libvpx/vp9/common/vp9_blockd.c
new file mode 100644
index 0000000..e1d1318
--- /dev/null
+++ b/libvpx/vp9/common/vp9_blockd.c
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "vp9/common/vp9_blockd.h"
+
+MB_PREDICTION_MODE vp9_left_block_mode(const MODE_INFO *cur_mi,
+ const MODE_INFO *left_mi, int b) {
+ if (b == 0 || b == 2) {
+ if (!left_mi || is_inter_block(&left_mi->mbmi))
+ return DC_PRED;
+
+ return get_y_mode(left_mi, b + 1);
+ } else {
+ assert(b == 1 || b == 3);
+ return cur_mi->bmi[b - 1].as_mode;
+ }
+}
+
+MB_PREDICTION_MODE vp9_above_block_mode(const MODE_INFO *cur_mi,
+ const MODE_INFO *above_mi, int b) {
+ if (b == 0 || b == 1) {
+ if (!above_mi || is_inter_block(&above_mi->mbmi))
+ return DC_PRED;
+
+ return get_y_mode(above_mi, b + 2);
+ } else {
+ assert(b == 2 || b == 3);
+ return cur_mi->bmi[b - 2].as_mode;
+ }
+}
+
+void vp9_foreach_transformed_block_in_plane(
+ const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
+ foreach_transformed_block_visitor visit, void *arg) {
+ const struct macroblockd_plane *const pd = &xd->plane[plane];
+ const MB_MODE_INFO* mbmi = &xd->mi_8x8[0]->mbmi;
+ // block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
+ // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
+ // transform size varies per plane, look it up in a common way.
+ const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi)
+ : mbmi->tx_size;
+ const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
+ const int step = 1 << (tx_size << 1);
+ int i;
+
+ // If mb_to_right_edge is < 0 we are in a situation in which
+ // the current block size extends into the UMV and we won't
+ // visit the sub blocks that are wholly within the UMV.
+ if (xd->mb_to_right_edge < 0 || xd->mb_to_bottom_edge < 0) {
+ int r, c;
+
+ int max_blocks_wide = num_4x4_w;
+ int max_blocks_high = num_4x4_h;
+
+ // xd->mb_to_right_edge is in units of pixels * 8. This converts
+ // it to 4x4 block sizes.
+ if (xd->mb_to_right_edge < 0)
+ max_blocks_wide += (xd->mb_to_right_edge >> (5 + pd->subsampling_x));
+
+ if (xd->mb_to_bottom_edge < 0)
+ max_blocks_high += (xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
+
+ i = 0;
+ // Unlike the normal case - in here we have to keep track of the
+ // row and column of the blocks we use so that we know if we are in
+ // the unrestricted motion border.
+ for (r = 0; r < num_4x4_h; r += (1 << tx_size)) {
+ for (c = 0; c < num_4x4_w; c += (1 << tx_size)) {
+ if (r < max_blocks_high && c < max_blocks_wide)
+ visit(plane, i, plane_bsize, tx_size, arg);
+ i += step;
+ }
+ }
+ } else {
+ for (i = 0; i < num_4x4_w * num_4x4_h; i += step)
+ visit(plane, i, plane_bsize, tx_size, arg);
+ }
+}
+
+void vp9_foreach_transformed_block(const MACROBLOCKD* const xd,
+ BLOCK_SIZE bsize,
+ foreach_transformed_block_visitor visit,
+ void *arg) {
+ int plane;
+
+ for (plane = 0; plane < MAX_MB_PLANE; plane++)
+ vp9_foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg);
+}
+
+void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob,
+ int aoff, int loff) {
+ ENTROPY_CONTEXT *const a = pd->above_context + aoff;
+ ENTROPY_CONTEXT *const l = pd->left_context + loff;
+ const int tx_size_in_blocks = 1 << tx_size;
+
+ // above
+ if (has_eob && xd->mb_to_right_edge < 0) {
+ int i;
+ const int blocks_wide = num_4x4_blocks_wide_lookup[plane_bsize] +
+ (xd->mb_to_right_edge >> (5 + pd->subsampling_x));
+ int above_contexts = tx_size_in_blocks;
+ if (above_contexts + aoff > blocks_wide)
+ above_contexts = blocks_wide - aoff;
+
+ for (i = 0; i < above_contexts; ++i)
+ a[i] = has_eob;
+ for (i = above_contexts; i < tx_size_in_blocks; ++i)
+ a[i] = 0;
+ } else {
+ vpx_memset(a, has_eob, sizeof(ENTROPY_CONTEXT) * tx_size_in_blocks);
+ }
+
+ // left
+ if (has_eob && xd->mb_to_bottom_edge < 0) {
+ int i;
+ const int blocks_high = num_4x4_blocks_high_lookup[plane_bsize] +
+ (xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
+ int left_contexts = tx_size_in_blocks;
+ if (left_contexts + loff > blocks_high)
+ left_contexts = blocks_high - loff;
+
+ for (i = 0; i < left_contexts; ++i)
+ l[i] = has_eob;
+ for (i = left_contexts; i < tx_size_in_blocks; ++i)
+ l[i] = 0;
+ } else {
+ vpx_memset(l, has_eob, sizeof(ENTROPY_CONTEXT) * tx_size_in_blocks);
+ }
+}
+
+void vp9_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y) {
+ int i;
+
+ for (i = 0; i < MAX_MB_PLANE; i++) {
+ xd->plane[i].plane_type = i ? PLANE_TYPE_UV : PLANE_TYPE_Y;
+ xd->plane[i].subsampling_x = i ? ss_x : 0;
+ xd->plane[i].subsampling_y = i ? ss_y : 0;
+ }
+#if CONFIG_ALPHA
+ // TODO(jkoleszar): Using the Y w/h for now
+ xd->plane[3].plane_type = PLANE_TYPE_Y;
+ xd->plane[3].subsampling_x = 0;
+ xd->plane[3].subsampling_y = 0;
+#endif
+}
diff --git a/libvpx/vp9/common/vp9_blockd.h b/libvpx/vp9/common/vp9_blockd.h
index c5da375..ca5a0c2 100644
--- a/libvpx/vp9/common/vp9_blockd.h
+++ b/libvpx/vp9/common/vp9_blockd.h
@@ -24,10 +24,14 @@
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_scale.h"
#include "vp9/common/vp9_seg_common.h"
-#include "vp9/common/vp9_treecoder.h"
-#define BLOCK_SIZE_GROUPS 4
-#define MBSKIP_CONTEXTS 3
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define BLOCK_SIZE_GROUPS 4
+#define SKIP_CONTEXTS 3
+#define INTER_MODE_CONTEXTS 7
/* Segment Feature Masks */
#define MAX_MV_REF_CANDIDATES 2
@@ -37,8 +41,9 @@
#define REF_CONTEXTS 5
typedef enum {
- PLANE_TYPE_Y_WITH_DC,
- PLANE_TYPE_UV,
+ PLANE_TYPE_Y = 0,
+ PLANE_TYPE_UV = 1,
+ PLANE_TYPES
} PLANE_TYPE;
typedef char ENTROPY_CONTEXT;
@@ -84,7 +89,6 @@ static INLINE int is_inter_mode(MB_PREDICTION_MODE mode) {
#define INTER_OFFSET(mode) ((mode) - NEARESTMV)
-
/* For keyframes, intra block modes are predicted by the (already decoded)
modes for the Y blocks to the left and above us; for interframes, there
is a single probability table. */
@@ -114,10 +118,6 @@ static INLINE int mi_width_log2(BLOCK_SIZE sb_type) {
return mi_width_log2_lookup[sb_type];
}
-static INLINE int mi_height_log2(BLOCK_SIZE sb_type) {
- return mi_height_log2_lookup[sb_type];
-}
-
// This structure now relates to 8x8 block regions.
typedef struct {
MB_PREDICTION_MODE mode, uv_mode;
@@ -125,17 +125,16 @@ typedef struct {
TX_SIZE tx_size;
int_mv mv[2]; // for each reference frame used
int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES];
- int_mv best_mv[2];
uint8_t mode_context[MAX_REF_FRAMES];
- unsigned char skip_coeff; // 0=need to decode coeffs, 1=no coefficients
+ unsigned char skip; // 0=need to decode coeffs, 1=no coefficients
unsigned char segment_id; // Segment id for this block.
// Flags used for prediction status of various bit-stream signals
unsigned char seg_id_predicted;
- INTERPOLATION_TYPE interp_filter;
+ INTERP_FILTER interp_filter;
BLOCK_SIZE sb_type;
} MB_MODE_INFO;
@@ -145,6 +144,11 @@ typedef struct {
b_mode_info bmi[4];
} MODE_INFO;
+static INLINE MB_PREDICTION_MODE get_y_mode(const MODE_INFO *mi, int block) {
+ return mi->mbmi.sb_type < BLOCK_8X8 ? mi->bmi[block].as_mode
+ : mi->mbmi.mode;
+}
+
static INLINE int is_inter_block(const MB_MODE_INFO *mbmi) {
return mbmi->ref_frame[0] > INTRA_FRAME;
}
@@ -153,6 +157,12 @@ static INLINE int has_second_ref(const MB_MODE_INFO *mbmi) {
return mbmi->ref_frame[1] > INTRA_FRAME;
}
+MB_PREDICTION_MODE vp9_left_block_mode(const MODE_INFO *cur_mi,
+ const MODE_INFO *left_mi, int b);
+
+MB_PREDICTION_MODE vp9_above_block_mode(const MODE_INFO *cur_mi,
+ const MODE_INFO *above_mi, int b);
+
enum mv_precision {
MV_PRECISION_Q3,
MV_PRECISION_Q4
@@ -170,33 +180,35 @@ struct buf_2d {
};
struct macroblockd_plane {
- int16_t *qcoeff;
int16_t *dqcoeff;
- uint16_t *eobs;
PLANE_TYPE plane_type;
int subsampling_x;
int subsampling_y;
struct buf_2d dst;
struct buf_2d pre[2];
- int16_t *dequant;
+ const int16_t *dequant;
ENTROPY_CONTEXT *above_context;
ENTROPY_CONTEXT *left_context;
};
#define BLOCK_OFFSET(x, i) ((x) + (i) * 16)
+typedef struct RefBuffer {
+ // TODO(dkovalev): idx is not really required and should be removed, now it
+ // is used in vp9_onyxd_if.c
+ int idx;
+ YV12_BUFFER_CONFIG *buf;
+ struct scale_factors sf;
+} RefBuffer;
+
typedef struct macroblockd {
struct macroblockd_plane plane[MAX_MB_PLANE];
- struct scale_factors scale_factor[2];
-
- MODE_INFO *last_mi;
int mode_info_stride;
// A NULL indicates that the 8x8 is not part of the image
MODE_INFO **mi_8x8;
MODE_INFO **prev_mi_8x8;
- MODE_INFO *mi_stream;
int up_available;
int left_available;
@@ -207,11 +219,20 @@ typedef struct macroblockd {
int mb_to_top_edge;
int mb_to_bottom_edge;
+ /* pointers to reference frames */
+ RefBuffer *block_refs[2];
+
+ /* pointer to current frame */
+ const YV12_BUFFER_CONFIG *cur_buf;
+
+ /* mc buffer */
+ DECLARE_ALIGNED(16, uint8_t, mc_buf[80 * 2 * 80 * 2]);
+
int lossless;
/* Inverse transform function pointers. */
void (*itxm_add)(const int16_t *input, uint8_t *dest, int stride, int eob);
- struct subpix_fn_table subpix;
+ const InterpKernel *interp_kernel;
int corrupted;
@@ -225,182 +246,74 @@ typedef struct macroblockd {
-static BLOCK_SIZE get_subsize(BLOCK_SIZE bsize, PARTITION_TYPE partition) {
+static INLINE BLOCK_SIZE get_subsize(BLOCK_SIZE bsize,
+ PARTITION_TYPE partition) {
const BLOCK_SIZE subsize = subsize_lookup[partition][bsize];
assert(subsize < BLOCK_SIZES);
return subsize;
}
-extern const TX_TYPE mode2txfm_map[MB_MODE_COUNT];
+extern const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES];
+
+static INLINE TX_TYPE get_tx_type(PLANE_TYPE plane_type,
+ const MACROBLOCKD *xd) {
+ const MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
+
+ if (plane_type != PLANE_TYPE_Y || is_inter_block(mbmi))
+ return DCT_DCT;
+ return intra_mode_to_tx_type_lookup[mbmi->mode];
+}
static INLINE TX_TYPE get_tx_type_4x4(PLANE_TYPE plane_type,
const MACROBLOCKD *xd, int ib) {
const MODE_INFO *const mi = xd->mi_8x8[0];
- const MB_MODE_INFO *const mbmi = &mi->mbmi;
- if (plane_type != PLANE_TYPE_Y_WITH_DC ||
- xd->lossless ||
- is_inter_block(mbmi))
+ if (plane_type != PLANE_TYPE_Y || xd->lossless || is_inter_block(&mi->mbmi))
return DCT_DCT;
- return mode2txfm_map[mbmi->sb_type < BLOCK_8X8 ?
- mi->bmi[ib].as_mode : mbmi->mode];
-}
-
-static INLINE TX_TYPE get_tx_type_8x8(PLANE_TYPE plane_type,
- const MACROBLOCKD *xd) {
- return plane_type == PLANE_TYPE_Y_WITH_DC ?
- mode2txfm_map[xd->mi_8x8[0]->mbmi.mode] : DCT_DCT;
+ return intra_mode_to_tx_type_lookup[get_y_mode(mi, ib)];
}
-static INLINE TX_TYPE get_tx_type_16x16(PLANE_TYPE plane_type,
- const MACROBLOCKD *xd) {
- return plane_type == PLANE_TYPE_Y_WITH_DC ?
- mode2txfm_map[xd->mi_8x8[0]->mbmi.mode] : DCT_DCT;
-}
-
-static void setup_block_dptrs(MACROBLOCKD *xd, int ss_x, int ss_y) {
- int i;
+void vp9_setup_block_planes(MACROBLOCKD *xd, int ss_x, int ss_y);
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].plane_type = i ? PLANE_TYPE_UV : PLANE_TYPE_Y_WITH_DC;
- xd->plane[i].subsampling_x = i ? ss_x : 0;
- xd->plane[i].subsampling_y = i ? ss_y : 0;
+static INLINE TX_SIZE get_uv_tx_size_impl(TX_SIZE y_tx_size, BLOCK_SIZE bsize) {
+ if (bsize < BLOCK_8X8) {
+ return TX_4X4;
+ } else {
+ // TODO(dkovalev): Assuming YUV420 (ss_x == 1, ss_y == 1)
+ const BLOCK_SIZE plane_bsize = ss_size_lookup[bsize][1][1];
+ return MIN(y_tx_size, max_txsize_lookup[plane_bsize]);
}
-#if CONFIG_ALPHA
- // TODO(jkoleszar): Using the Y w/h for now
- xd->plane[3].subsampling_x = 0;
- xd->plane[3].subsampling_y = 0;
-#endif
}
-
static INLINE TX_SIZE get_uv_tx_size(const MB_MODE_INFO *mbmi) {
- return MIN(mbmi->tx_size, max_uv_txsize_lookup[mbmi->sb_type]);
+ return get_uv_tx_size_impl(mbmi->tx_size, mbmi->sb_type);
}
-static BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize,
- const struct macroblockd_plane *pd) {
+static INLINE BLOCK_SIZE get_plane_block_size(BLOCK_SIZE bsize,
+ const struct macroblockd_plane *pd) {
BLOCK_SIZE bs = ss_size_lookup[bsize][pd->subsampling_x][pd->subsampling_y];
assert(bs < BLOCK_SIZES);
return bs;
}
-static INLINE int plane_block_width(BLOCK_SIZE bsize,
- const struct macroblockd_plane* plane) {
- return 4 << (b_width_log2(bsize) - plane->subsampling_x);
-}
-
-static INLINE int plane_block_height(BLOCK_SIZE bsize,
- const struct macroblockd_plane* plane) {
- return 4 << (b_height_log2(bsize) - plane->subsampling_y);
-}
-
typedef void (*foreach_transformed_block_visitor)(int plane, int block,
BLOCK_SIZE plane_bsize,
TX_SIZE tx_size,
void *arg);
-static INLINE void foreach_transformed_block_in_plane(
+void vp9_foreach_transformed_block_in_plane(
const MACROBLOCKD *const xd, BLOCK_SIZE bsize, int plane,
- foreach_transformed_block_visitor visit, void *arg) {
- const struct macroblockd_plane *const pd = &xd->plane[plane];
- const MB_MODE_INFO* mbmi = &xd->mi_8x8[0]->mbmi;
- // block and transform sizes, in number of 4x4 blocks log 2 ("*_b")
- // 4x4=0, 8x8=2, 16x16=4, 32x32=6, 64x64=8
- // transform size varies per plane, look it up in a common way.
- const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi)
- : mbmi->tx_size;
- const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
- const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
- const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
- const int step = 1 << (tx_size << 1);
- int i;
-
- // If mb_to_right_edge is < 0 we are in a situation in which
- // the current block size extends into the UMV and we won't
- // visit the sub blocks that are wholly within the UMV.
- if (xd->mb_to_right_edge < 0 || xd->mb_to_bottom_edge < 0) {
- int r, c;
-
- int max_blocks_wide = num_4x4_w;
- int max_blocks_high = num_4x4_h;
-
- // xd->mb_to_right_edge is in units of pixels * 8. This converts
- // it to 4x4 block sizes.
- if (xd->mb_to_right_edge < 0)
- max_blocks_wide += (xd->mb_to_right_edge >> (5 + pd->subsampling_x));
-
- if (xd->mb_to_bottom_edge < 0)
- max_blocks_high += (xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
-
- i = 0;
- // Unlike the normal case - in here we have to keep track of the
- // row and column of the blocks we use so that we know if we are in
- // the unrestricted motion border.
- for (r = 0; r < num_4x4_h; r += (1 << tx_size)) {
- for (c = 0; c < num_4x4_w; c += (1 << tx_size)) {
- if (r < max_blocks_high && c < max_blocks_wide)
- visit(plane, i, plane_bsize, tx_size, arg);
- i += step;
- }
- }
- } else {
- for (i = 0; i < num_4x4_w * num_4x4_h; i += step)
- visit(plane, i, plane_bsize, tx_size, arg);
- }
-}
-
-static INLINE void foreach_transformed_block(
- const MACROBLOCKD* const xd, BLOCK_SIZE bsize,
- foreach_transformed_block_visitor visit, void *arg) {
- int plane;
+ foreach_transformed_block_visitor visit, void *arg);
- for (plane = 0; plane < MAX_MB_PLANE; plane++)
- foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg);
-}
-static INLINE void foreach_transformed_block_uv(
+void vp9_foreach_transformed_block(
const MACROBLOCKD* const xd, BLOCK_SIZE bsize,
- foreach_transformed_block_visitor visit, void *arg) {
- int plane;
-
- for (plane = 1; plane < MAX_MB_PLANE; plane++)
- foreach_transformed_block_in_plane(xd, bsize, plane, visit, arg);
-}
-
-static int raster_block_offset(BLOCK_SIZE plane_bsize,
- int raster_block, int stride) {
- const int bw = b_width_log2(plane_bsize);
- const int y = 4 * (raster_block >> bw);
- const int x = 4 * (raster_block & ((1 << bw) - 1));
- return y * stride + x;
-}
-static int16_t* raster_block_offset_int16(BLOCK_SIZE plane_bsize,
- int raster_block, int16_t *base) {
- const int stride = 4 << b_width_log2(plane_bsize);
- return base + raster_block_offset(plane_bsize, raster_block, stride);
-}
-static uint8_t* raster_block_offset_uint8(BLOCK_SIZE plane_bsize,
- int raster_block, uint8_t *base,
- int stride) {
- return base + raster_block_offset(plane_bsize, raster_block, stride);
-}
-
-static int txfrm_block_to_raster_block(BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, int block) {
- const int bwl = b_width_log2(plane_bsize);
- const int tx_cols_log2 = bwl - tx_size;
- const int tx_cols = 1 << tx_cols_log2;
- const int raster_mb = block >> (tx_size << 1);
- const int x = (raster_mb & (tx_cols - 1)) << tx_size;
- const int y = (raster_mb >> tx_cols_log2) << tx_size;
- return x + (y << bwl);
-}
+ foreach_transformed_block_visitor visit, void *arg);
-static void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, int block,
- int *x, int *y) {
+static INLINE void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize,
+ TX_SIZE tx_size, int block,
+ int *x, int *y) {
const int bwl = b_width_log2(plane_bsize);
const int tx_cols_log2 = bwl - tx_size;
const int tx_cols = 1 << tx_cols_log2;
@@ -409,93 +322,12 @@ static void txfrm_block_to_raster_xy(BLOCK_SIZE plane_bsize,
*y = (raster_mb >> tx_cols_log2) << tx_size;
}
-static void extend_for_intra(MACROBLOCKD *xd, BLOCK_SIZE plane_bsize,
- int plane, int block, TX_SIZE tx_size) {
- struct macroblockd_plane *const pd = &xd->plane[plane];
- uint8_t *const buf = pd->dst.buf;
- const int stride = pd->dst.stride;
-
- int x, y;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
- x = x * 4 - 1;
- y = y * 4 - 1;
- // Copy a pixel into the umv if we are in a situation where the block size
- // extends into the UMV.
- // TODO(JBB): Should be able to do the full extend in place so we don't have
- // to do this multiple times.
- if (xd->mb_to_right_edge < 0) {
- const int bw = 4 << b_width_log2(plane_bsize);
- const int umv_border_start = bw + (xd->mb_to_right_edge >>
- (3 + pd->subsampling_x));
-
- if (x + bw > umv_border_start)
- vpx_memset(&buf[y * stride + umv_border_start],
- buf[y * stride + umv_border_start - 1], bw);
- }
-
- if (xd->mb_to_bottom_edge < 0) {
- if (xd->left_available || x >= 0) {
- const int bh = 4 << b_height_log2(plane_bsize);
- const int umv_border_start =
- bh + (xd->mb_to_bottom_edge >> (3 + pd->subsampling_y));
-
- if (y + bh > umv_border_start) {
- const uint8_t c = buf[(umv_border_start - 1) * stride + x];
- uint8_t *d = &buf[umv_border_start * stride + x];
- int i;
- for (i = 0; i < bh; ++i, d += stride)
- *d = c;
- }
- }
- }
-}
+void vp9_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size, int has_eob,
+ int aoff, int loff);
-static void set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
- BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
- int has_eob, int aoff, int loff) {
- ENTROPY_CONTEXT *const a = pd->above_context + aoff;
- ENTROPY_CONTEXT *const l = pd->left_context + loff;
- const int tx_size_in_blocks = 1 << tx_size;
-
- // above
- if (has_eob && xd->mb_to_right_edge < 0) {
- int i;
- const int blocks_wide = num_4x4_blocks_wide_lookup[plane_bsize] +
- (xd->mb_to_right_edge >> (5 + pd->subsampling_x));
- int above_contexts = tx_size_in_blocks;
- if (above_contexts + aoff > blocks_wide)
- above_contexts = blocks_wide - aoff;
-
- for (i = 0; i < above_contexts; ++i)
- a[i] = has_eob;
- for (i = above_contexts; i < tx_size_in_blocks; ++i)
- a[i] = 0;
- } else {
- vpx_memset(a, has_eob, sizeof(ENTROPY_CONTEXT) * tx_size_in_blocks);
- }
-
- // left
- if (has_eob && xd->mb_to_bottom_edge < 0) {
- int i;
- const int blocks_high = num_4x4_blocks_high_lookup[plane_bsize] +
- (xd->mb_to_bottom_edge >> (5 + pd->subsampling_y));
- int left_contexts = tx_size_in_blocks;
- if (left_contexts + loff > blocks_high)
- left_contexts = blocks_high - loff;
-
- for (i = 0; i < left_contexts; ++i)
- l[i] = has_eob;
- for (i = left_contexts; i < tx_size_in_blocks; ++i)
- l[i] = 0;
- } else {
- vpx_memset(l, has_eob, sizeof(ENTROPY_CONTEXT) * tx_size_in_blocks);
- }
-}
-
-static int get_tx_eob(const struct segmentation *seg, int segment_id,
- TX_SIZE tx_size) {
- const int eob_max = 16 << (tx_size << 1);
- return vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max;
-}
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_COMMON_VP9_BLOCKD_H_
diff --git a/libvpx/vp9/common/vp9_common.h b/libvpx/vp9/common/vp9_common.h
index 36d1cdf..2dccb70 100644
--- a/libvpx/vp9/common/vp9_common.h
+++ b/libvpx/vp9/common/vp9_common.h
@@ -18,6 +18,11 @@
#include "./vpx_config.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx/vpx_integer.h"
+#include "vp9/common/vp9_systemdependent.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
@@ -55,16 +60,8 @@ static INLINE double fclamp(double value, double low, double high) {
return value < low ? low : (value > high ? high : value);
}
-static int get_unsigned_bits(unsigned int num_values) {
- int cat = 0;
- if (num_values <= 1)
- return 0;
- num_values--;
- while (num_values > 0) {
- cat++;
- num_values >>= 1;
- }
- return cat;
+static INLINE int get_unsigned_bits(unsigned int num_values) {
+ return num_values > 0 ? get_msb(num_values) + 1 : 0;
}
#if CONFIG_DEBUG
@@ -91,4 +88,8 @@ static int get_unsigned_bits(unsigned int num_values) {
#define VP9_FRAME_MARKER 0x2
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_COMMON_H_
diff --git a/libvpx/vp9/common/vp9_common_data.c b/libvpx/vp9/common/vp9_common_data.c
index f858900..a927823 100644
--- a/libvpx/vp9/common/vp9_common_data.c
+++ b/libvpx/vp9/common/vp9_common_data.c
@@ -26,8 +26,6 @@ const int mi_width_log2_lookup[BLOCK_SIZES] =
{0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3};
const int num_8x8_blocks_wide_lookup[BLOCK_SIZES] =
{1, 1, 1, 1, 1, 2, 2, 2, 4, 4, 4, 8, 8};
-const int mi_height_log2_lookup[BLOCK_SIZES] =
- {0, 0, 0, 0, 1, 0, 1, 2, 1, 2, 3, 2, 3};
const int num_8x8_blocks_high_lookup[BLOCK_SIZES] =
{1, 1, 1, 1, 2, 1, 2, 4, 2, 4, 8, 4, 8};
@@ -108,12 +106,6 @@ const TX_SIZE max_txsize_lookup[BLOCK_SIZES] = {
TX_16X16, TX_16X16, TX_16X16,
TX_32X32, TX_32X32, TX_32X32, TX_32X32
};
-const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES] = {
- TX_4X4, TX_4X4, TX_4X4,
- TX_4X4, TX_4X4, TX_4X4,
- TX_8X8, TX_8X8, TX_8X8,
- TX_16X16, TX_16X16, TX_16X16, TX_32X32
-};
const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = {
TX_4X4, // ONLY_4X4
@@ -123,8 +115,6 @@ const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES] = {
TX_32X32, // TX_MODE_SELECT
};
-
-
const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = {
// ss_x == 0 ss_x == 0 ss_x == 1 ss_x == 1
// ss_y == 0 ss_y == 1 ss_y == 0 ss_y == 1
@@ -143,4 +133,24 @@ const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2] = {
{{BLOCK_64X64, BLOCK_64X32}, {BLOCK_32X64, BLOCK_32X32}},
};
-
+// Generates 4 bit field in which each bit set to 1 represents
+// a blocksize partition 1111 means we split 64x64, 32x32, 16x16
+// and 8x8. 1000 means we just split the 64x64 to 32x32
+const struct {
+ PARTITION_CONTEXT above;
+ PARTITION_CONTEXT left;
+} partition_context_lookup[BLOCK_SIZES]= {
+ {15, 15}, // 4X4 - {0b1111, 0b1111}
+ {15, 14}, // 4X8 - {0b1111, 0b1110}
+ {14, 15}, // 8X4 - {0b1110, 0b1111}
+ {14, 14}, // 8X8 - {0b1110, 0b1110}
+ {14, 12}, // 8X16 - {0b1110, 0b1100}
+ {12, 14}, // 16X8 - {0b1100, 0b1110}
+ {12, 12}, // 16X16 - {0b1100, 0b1100}
+ {12, 8 }, // 16X32 - {0b1100, 0b1000}
+ {8, 12}, // 32X16 - {0b1000, 0b1100}
+ {8, 8 }, // 32X32 - {0b1000, 0b1000}
+ {8, 0 }, // 32X64 - {0b1000, 0b0000}
+ {0, 8 }, // 64X32 - {0b0000, 0b1000}
+ {0, 0 }, // 64X64 - {0b0000, 0b0000}
+};
diff --git a/libvpx/vp9/common/vp9_common_data.h b/libvpx/vp9/common/vp9_common_data.h
index c1f6405..f419627 100644
--- a/libvpx/vp9/common/vp9_common_data.h
+++ b/libvpx/vp9/common/vp9_common_data.h
@@ -13,10 +13,13 @@
#include "vp9/common/vp9_enums.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
extern const int b_width_log2_lookup[BLOCK_SIZES];
extern const int b_height_log2_lookup[BLOCK_SIZES];
extern const int mi_width_log2_lookup[BLOCK_SIZES];
-extern const int mi_height_log2_lookup[BLOCK_SIZES];
extern const int num_8x8_blocks_wide_lookup[BLOCK_SIZES];
extern const int num_8x8_blocks_high_lookup[BLOCK_SIZES];
extern const int num_4x4_blocks_high_lookup[BLOCK_SIZES];
@@ -26,8 +29,11 @@ extern const int num_pels_log2_lookup[BLOCK_SIZES];
extern const PARTITION_TYPE partition_lookup[][BLOCK_SIZES];
extern const BLOCK_SIZE subsize_lookup[PARTITION_TYPES][BLOCK_SIZES];
extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES];
-extern const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES];
extern const TX_SIZE tx_mode_to_biggest_tx_size[TX_MODES];
extern const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2];
-#endif // VP9_COMMON_VP9_COMMON_DATA_H
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_COMMON_VP9_COMMON_DATA_H_
diff --git a/libvpx/vp9/common/vp9_convolve.c b/libvpx/vp9/common/vp9_convolve.c
index a2d864c..d30e0b4 100644
--- a/libvpx/vp9/common/vp9_convolve.c
+++ b/libvpx/vp9/common/vp9_convolve.c
@@ -18,40 +18,21 @@
#include "vpx/vpx_integer.h"
#include "vpx_ports/mem.h"
-static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x0, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h, int taps) {
- int x, y, k;
-
- /* NOTE: This assumes that the filter table is 256-byte aligned. */
- /* TODO(agrange) Modify to make independent of table alignment. */
- const int16_t *const filter_x_base =
- (const int16_t *)(((intptr_t)filter_x0) & ~(intptr_t)0xff);
-
- /* Adjust base pointer address for this source line */
- src -= taps / 2 - 1;
-
+static void convolve_horiz(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const InterpKernel *x_filters,
+ int x0_q4, int x_step_q4, int w, int h) {
+ int x, y;
+ src -= SUBPEL_TAPS / 2 - 1;
for (y = 0; y < h; ++y) {
- /* Initial phase offset */
- int x_q4 = (int)(filter_x0 - filter_x_base) / taps;
-
+ int x_q4 = x0_q4;
for (x = 0; x < w; ++x) {
- /* Per-pixel src offset */
- const int src_x = x_q4 >> SUBPEL_BITS;
- int sum = 0;
-
- /* Pointer to filter to use */
- const int16_t *const filter_x = filter_x_base +
- (x_q4 & SUBPEL_MASK) * taps;
-
- for (k = 0; k < taps; ++k)
- sum += src[src_x + k] * filter_x[k];
-
+ const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS];
+ const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK];
+ int k, sum = 0;
+ for (k = 0; k < SUBPEL_TAPS; ++k)
+ sum += src_x[k] * x_filter[k];
dst[x] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
-
- /* Move to the next source pixel */
x_q4 += x_step_q4;
}
src += src_stride;
@@ -59,41 +40,22 @@ static void convolve_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
}
}
-static void convolve_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x0, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h, int taps) {
- int x, y, k;
-
- /* NOTE: This assumes that the filter table is 256-byte aligned. */
- /* TODO(agrange) Modify to make independent of table alignment. */
- const int16_t *const filter_x_base =
- (const int16_t *)(((intptr_t)filter_x0) & ~(intptr_t)0xff);
-
- /* Adjust base pointer address for this source line */
- src -= taps / 2 - 1;
-
+static void convolve_avg_horiz(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const InterpKernel *x_filters,
+ int x0_q4, int x_step_q4, int w, int h) {
+ int x, y;
+ src -= SUBPEL_TAPS / 2 - 1;
for (y = 0; y < h; ++y) {
- /* Initial phase offset */
- int x_q4 = (int)(filter_x0 - filter_x_base) / taps;
-
+ int x_q4 = x0_q4;
for (x = 0; x < w; ++x) {
- /* Per-pixel src offset */
- const int src_x = x_q4 >> SUBPEL_BITS;
- int sum = 0;
-
- /* Pointer to filter to use */
- const int16_t *const filter_x = filter_x_base +
- (x_q4 & SUBPEL_MASK) * taps;
-
- for (k = 0; k < taps; ++k)
- sum += src[src_x + k] * filter_x[k];
-
+ const uint8_t *const src_x = &src[x_q4 >> SUBPEL_BITS];
+ const int16_t *const x_filter = x_filters[x_q4 & SUBPEL_MASK];
+ int k, sum = 0;
+ for (k = 0; k < SUBPEL_TAPS; ++k)
+ sum += src_x[k] * x_filter[k];
dst[x] = ROUND_POWER_OF_TWO(dst[x] +
- clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1);
-
- /* Move to the next source pixel */
+ clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1);
x_q4 += x_step_q4;
}
src += src_stride;
@@ -101,41 +63,22 @@ static void convolve_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
}
}
-static void convolve_vert_c(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y0, int y_step_q4,
- int w, int h, int taps) {
- int x, y, k;
-
- /* NOTE: This assumes that the filter table is 256-byte aligned. */
- /* TODO(agrange) Modify to make independent of table alignment. */
- const int16_t *const filter_y_base =
- (const int16_t *)(((intptr_t)filter_y0) & ~(intptr_t)0xff);
-
- /* Adjust base pointer address for this source column */
- src -= src_stride * (taps / 2 - 1);
+static void convolve_vert(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const InterpKernel *y_filters,
+ int y0_q4, int y_step_q4, int w, int h) {
+ int x, y;
+ src -= src_stride * (SUBPEL_TAPS / 2 - 1);
for (x = 0; x < w; ++x) {
- /* Initial phase offset */
- int y_q4 = (int)(filter_y0 - filter_y_base) / taps;
-
+ int y_q4 = y0_q4;
for (y = 0; y < h; ++y) {
- /* Per-pixel src offset */
- const int src_y = y_q4 >> SUBPEL_BITS;
- int sum = 0;
-
- /* Pointer to filter to use */
- const int16_t *const filter_y = filter_y_base +
- (y_q4 & SUBPEL_MASK) * taps;
-
- for (k = 0; k < taps; ++k)
- sum += src[(src_y + k) * src_stride] * filter_y[k];
-
- dst[y * dst_stride] =
- clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
-
- /* Move to the next source pixel */
+ const unsigned char *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
+ const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK];
+ int k, sum = 0;
+ for (k = 0; k < SUBPEL_TAPS; ++k)
+ sum += src_y[k * src_stride] * y_filter[k];
+ dst[y * dst_stride] = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
y_q4 += y_step_q4;
}
++src;
@@ -143,41 +86,23 @@ static void convolve_vert_c(const uint8_t *src, ptrdiff_t src_stride,
}
}
-static void convolve_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y0, int y_step_q4,
- int w, int h, int taps) {
- int x, y, k;
-
- /* NOTE: This assumes that the filter table is 256-byte aligned. */
- /* TODO(agrange) Modify to make independent of table alignment. */
- const int16_t *const filter_y_base =
- (const int16_t *)(((intptr_t)filter_y0) & ~(intptr_t)0xff);
-
- /* Adjust base pointer address for this source column */
- src -= src_stride * (taps / 2 - 1);
+static void convolve_avg_vert(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const InterpKernel *y_filters,
+ int y0_q4, int y_step_q4, int w, int h) {
+ int x, y;
+ src -= src_stride * (SUBPEL_TAPS / 2 - 1);
for (x = 0; x < w; ++x) {
- /* Initial phase offset */
- int y_q4 = (int)(filter_y0 - filter_y_base) / taps;
-
+ int y_q4 = y0_q4;
for (y = 0; y < h; ++y) {
- /* Per-pixel src offset */
- const int src_y = y_q4 >> SUBPEL_BITS;
- int sum = 0;
-
- /* Pointer to filter to use */
- const int16_t *const filter_y = filter_y_base +
- (y_q4 & SUBPEL_MASK) * taps;
-
- for (k = 0; k < taps; ++k)
- sum += src[(src_y + k) * src_stride] * filter_y[k];
-
+ const unsigned char *src_y = &src[(y_q4 >> SUBPEL_BITS) * src_stride];
+ const int16_t *const y_filter = y_filters[y_q4 & SUBPEL_MASK];
+ int k, sum = 0;
+ for (k = 0; k < SUBPEL_TAPS; ++k)
+ sum += src_y[k * src_stride] * y_filter[k];
dst[y * dst_stride] = ROUND_POWER_OF_TWO(dst[y * dst_stride] +
- clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1);
-
- /* Move to the next source pixel */
+ clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS)), 1);
y_q4 += y_step_q4;
}
++src;
@@ -185,33 +110,42 @@ static void convolve_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
}
}
-static void convolve_c(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h, int taps) {
- /* Fixed size intermediate buffer places limits on parameters.
- * Maximum intermediate_height is 324, for y_step_q4 == 80,
- * h == 64, taps == 8.
- * y_step_q4 of 80 allows for 1/10 scale for 5 layer svc
- */
+static void convolve(const uint8_t *src, ptrdiff_t src_stride,
+ uint8_t *dst, ptrdiff_t dst_stride,
+ const InterpKernel *const x_filters,
+ int x0_q4, int x_step_q4,
+ const InterpKernel *const y_filters,
+ int y0_q4, int y_step_q4,
+ int w, int h) {
+ // Fixed size intermediate buffer places limits on parameters.
+ // Maximum intermediate_height is 324, for y_step_q4 == 80,
+ // h == 64, taps == 8.
+ // y_step_q4 of 80 allows for 1/10 scale for 5 layer svc
uint8_t temp[64 * 324];
- int intermediate_height = (((h - 1) * y_step_q4 + 15) >> 4) + taps;
+ int intermediate_height = (((h - 1) * y_step_q4 + 15) >> 4) + SUBPEL_TAPS;
assert(w <= 64);
assert(h <= 64);
- assert(taps <= 8);
assert(y_step_q4 <= 80);
assert(x_step_q4 <= 80);
if (intermediate_height < h)
intermediate_height = h;
- convolve_horiz_c(src - src_stride * (taps / 2 - 1), src_stride, temp, 64,
- filter_x, x_step_q4, filter_y, y_step_q4, w,
- intermediate_height, taps);
- convolve_vert_c(temp + 64 * (taps / 2 - 1), 64, dst, dst_stride, filter_x,
- x_step_q4, filter_y, y_step_q4, w, h, taps);
+ convolve_horiz(src - src_stride * (SUBPEL_TAPS / 2 - 1), src_stride, temp, 64,
+ x_filters, x0_q4, x_step_q4, w, intermediate_height);
+ convolve_vert(temp + 64 * (SUBPEL_TAPS / 2 - 1), 64, dst, dst_stride,
+ y_filters, y0_q4, y_step_q4, w, h);
+}
+
+static const InterpKernel *get_filter_base(const int16_t *filter) {
+ // NOTE: This assumes that the filter table is 256-byte aligned.
+ // TODO(agrange) Modify to make independent of table alignment.
+ return (const InterpKernel *)(((intptr_t)filter) & ~((intptr_t)0xFF));
+}
+
+static int get_filter_offset(const int16_t *f, const InterpKernel *base) {
+ return (int)((const InterpKernel *)(intptr_t)f - base);
}
void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -219,8 +153,11 @@ void vp9_convolve8_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- convolve_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
+ const InterpKernel *const filters_x = get_filter_base(filter_x);
+ const int x0_q4 = get_filter_offset(filter_x, filters_x);
+
+ convolve_horiz(src, src_stride, dst, dst_stride, filters_x,
+ x0_q4, x_step_q4, w, h);
}
void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -228,8 +165,11 @@ void vp9_convolve8_avg_horiz_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- convolve_avg_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
+ const InterpKernel *const filters_x = get_filter_base(filter_x);
+ const int x0_q4 = get_filter_offset(filter_x, filters_x);
+
+ convolve_avg_horiz(src, src_stride, dst, dst_stride, filters_x,
+ x0_q4, x_step_q4, w, h);
}
void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -237,8 +177,10 @@ void vp9_convolve8_vert_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- convolve_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
+ const InterpKernel *const filters_y = get_filter_base(filter_y);
+ const int y0_q4 = get_filter_offset(filter_y, filters_y);
+ convolve_vert(src, src_stride, dst, dst_stride, filters_y,
+ y0_q4, y_step_q4, w, h);
}
void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -246,8 +188,10 @@ void vp9_convolve8_avg_vert_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- convolve_avg_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
+ const InterpKernel *const filters_y = get_filter_base(filter_y);
+ const int y0_q4 = get_filter_offset(filter_y, filters_y);
+ convolve_avg_vert(src, src_stride, dst, dst_stride, filters_y,
+ y0_q4, y_step_q4, w, h);
}
void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -255,8 +199,15 @@ void vp9_convolve8_c(const uint8_t *src, ptrdiff_t src_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h) {
- convolve_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h, 8);
+ const InterpKernel *const filters_x = get_filter_base(filter_x);
+ const int x0_q4 = get_filter_offset(filter_x, filters_x);
+
+ const InterpKernel *const filters_y = get_filter_base(filter_y);
+ const int y0_q4 = get_filter_offset(filter_y, filters_y);
+
+ convolve(src, src_stride, dst, dst_stride,
+ filters_x, x0_q4, x_step_q4,
+ filters_y, y0_q4, y_step_q4, w, h);
}
void vp9_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride,
@@ -269,9 +220,9 @@ void vp9_convolve8_avg_c(const uint8_t *src, ptrdiff_t src_stride,
assert(w <= 64);
assert(h <= 64);
- vp9_convolve8(src, src_stride, temp, 64,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- vp9_convolve_avg(temp, 64, dst, dst_stride, NULL, 0, NULL, 0, w, h);
+ vp9_convolve8_c(src, src_stride, temp, 64,
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h);
+ vp9_convolve_avg_c(temp, 64, dst, dst_stride, NULL, 0, NULL, 0, w, h);
}
void vp9_convolve_copy_c(const uint8_t *src, ptrdiff_t src_stride,
diff --git a/libvpx/vp9/common/vp9_convolve.h b/libvpx/vp9/common/vp9_convolve.h
index 29d4990..6bf71fc 100644
--- a/libvpx/vp9/common/vp9_convolve.h
+++ b/libvpx/vp9/common/vp9_convolve.h
@@ -13,10 +13,18 @@
#include "./vpx_config.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef void (*convolve_fn_t)(const uint8_t *src, ptrdiff_t src_stride,
uint8_t *dst, ptrdiff_t dst_stride,
const int16_t *filter_x, int x_step_q4,
const int16_t *filter_y, int y_step_q4,
int w, int h);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_CONVOLVE_H_
diff --git a/libvpx/vp9/common/vp9_debugmodes.c b/libvpx/vp9/common/vp9_debugmodes.c
index 355ac1a..8f150a4 100644
--- a/libvpx/vp9/common/vp9_debugmodes.c
+++ b/libvpx/vp9/common/vp9_debugmodes.c
@@ -22,7 +22,7 @@ static void log_frame_info(VP9_COMMON *cm, const char *str, FILE *f) {
* and uses the passed in member offset to print out the value of an integer
* for each mbmi member value in the mi structure.
*/
-static void print_mi_data(VP9_COMMON *cm, FILE *file, char *descriptor,
+static void print_mi_data(VP9_COMMON *cm, FILE *file, const char *descriptor,
size_t member_offset) {
int mi_row;
int mi_col;
@@ -47,7 +47,7 @@ static void print_mi_data(VP9_COMMON *cm, FILE *file, char *descriptor,
}
fprintf(file, "\n");
}
-void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, char *file) {
+void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, const char *file) {
int mi_row;
int mi_col;
int mi_index = 0;
@@ -58,7 +58,7 @@ void vp9_print_modes_and_motion_vectors(VP9_COMMON *cm, char *file) {
print_mi_data(cm, mvs, "Partitions:", offsetof(MB_MODE_INFO, sb_type));
print_mi_data(cm, mvs, "Modes:", offsetof(MB_MODE_INFO, mode));
- print_mi_data(cm, mvs, "Skips:", offsetof(MB_MODE_INFO, skip_coeff));
+ print_mi_data(cm, mvs, "Skips:", offsetof(MB_MODE_INFO, skip));
print_mi_data(cm, mvs, "Ref frame:", offsetof(MB_MODE_INFO, ref_frame[0]));
print_mi_data(cm, mvs, "Transform:", offsetof(MB_MODE_INFO, tx_size));
print_mi_data(cm, mvs, "UV Modes:", offsetof(MB_MODE_INFO, uv_mode));
diff --git a/libvpx/vp9/common/vp9_default_coef_probs.h b/libvpx/vp9/common/vp9_default_coef_probs.h
deleted file mode 100644
index 3b512be..0000000
--- a/libvpx/vp9/common/vp9_default_coef_probs.h
+++ /dev/null
@@ -1,699 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
-*/
-#ifndef VP9_COMMON_DEFAULT_COEF_PROBS_H_
-#define VP9_COMMON_DEFAULT_COEF_PROBS_H_
-
-/*Generated file, included by vp9_entropy.c*/
-static const vp9_coeff_probs_model default_coef_probs_4x4[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 195, 29, 183 },
- { 84, 49, 136 },
- { 8, 42, 71 }
- }, { /* Coeff Band 1 */
- { 31, 107, 169 },
- { 35, 99, 159 },
- { 17, 82, 140 },
- { 8, 66, 114 },
- { 2, 44, 76 },
- { 1, 19, 32 }
- }, { /* Coeff Band 2 */
- { 40, 132, 201 },
- { 29, 114, 187 },
- { 13, 91, 157 },
- { 7, 75, 127 },
- { 3, 58, 95 },
- { 1, 28, 47 }
- }, { /* Coeff Band 3 */
- { 69, 142, 221 },
- { 42, 122, 201 },
- { 15, 91, 159 },
- { 6, 67, 121 },
- { 1, 42, 77 },
- { 1, 17, 31 }
- }, { /* Coeff Band 4 */
- { 102, 148, 228 },
- { 67, 117, 204 },
- { 17, 82, 154 },
- { 6, 59, 114 },
- { 2, 39, 75 },
- { 1, 15, 29 }
- }, { /* Coeff Band 5 */
- { 156, 57, 233 },
- { 119, 57, 212 },
- { 58, 48, 163 },
- { 29, 40, 124 },
- { 12, 30, 81 },
- { 3, 12, 31 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 191, 107, 226 },
- { 124, 117, 204 },
- { 25, 99, 155 }
- }, { /* Coeff Band 1 */
- { 29, 148, 210 },
- { 37, 126, 194 },
- { 8, 93, 157 },
- { 2, 68, 118 },
- { 1, 39, 69 },
- { 1, 17, 33 }
- }, { /* Coeff Band 2 */
- { 41, 151, 213 },
- { 27, 123, 193 },
- { 3, 82, 144 },
- { 1, 58, 105 },
- { 1, 32, 60 },
- { 1, 13, 26 }
- }, { /* Coeff Band 3 */
- { 59, 159, 220 },
- { 23, 126, 198 },
- { 4, 88, 151 },
- { 1, 66, 114 },
- { 1, 38, 71 },
- { 1, 18, 34 }
- }, { /* Coeff Band 4 */
- { 114, 136, 232 },
- { 51, 114, 207 },
- { 11, 83, 155 },
- { 3, 56, 105 },
- { 1, 33, 65 },
- { 1, 17, 34 }
- }, { /* Coeff Band 5 */
- { 149, 65, 234 },
- { 121, 57, 215 },
- { 61, 49, 166 },
- { 28, 36, 114 },
- { 12, 25, 76 },
- { 3, 16, 42 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 214, 49, 220 },
- { 132, 63, 188 },
- { 42, 65, 137 }
- }, { /* Coeff Band 1 */
- { 85, 137, 221 },
- { 104, 131, 216 },
- { 49, 111, 192 },
- { 21, 87, 155 },
- { 2, 49, 87 },
- { 1, 16, 28 }
- }, { /* Coeff Band 2 */
- { 89, 163, 230 },
- { 90, 137, 220 },
- { 29, 100, 183 },
- { 10, 70, 135 },
- { 2, 42, 81 },
- { 1, 17, 33 }
- }, { /* Coeff Band 3 */
- { 108, 167, 237 },
- { 55, 133, 222 },
- { 15, 97, 179 },
- { 4, 72, 135 },
- { 1, 45, 85 },
- { 1, 19, 38 }
- }, { /* Coeff Band 4 */
- { 124, 146, 240 },
- { 66, 124, 224 },
- { 17, 88, 175 },
- { 4, 58, 122 },
- { 1, 36, 75 },
- { 1, 18, 37 }
- }, { /* Coeff Band 5 */
- { 141, 79, 241 },
- { 126, 70, 227 },
- { 66, 58, 182 },
- { 30, 44, 136 },
- { 12, 34, 96 },
- { 2, 20, 47 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 229, 99, 249 },
- { 143, 111, 235 },
- { 46, 109, 192 }
- }, { /* Coeff Band 1 */
- { 82, 158, 236 },
- { 94, 146, 224 },
- { 25, 117, 191 },
- { 9, 87, 149 },
- { 3, 56, 99 },
- { 1, 33, 57 }
- }, { /* Coeff Band 2 */
- { 83, 167, 237 },
- { 68, 145, 222 },
- { 10, 103, 177 },
- { 2, 72, 131 },
- { 1, 41, 79 },
- { 1, 20, 39 }
- }, { /* Coeff Band 3 */
- { 99, 167, 239 },
- { 47, 141, 224 },
- { 10, 104, 178 },
- { 2, 73, 133 },
- { 1, 44, 85 },
- { 1, 22, 47 }
- }, { /* Coeff Band 4 */
- { 127, 145, 243 },
- { 71, 129, 228 },
- { 17, 93, 177 },
- { 3, 61, 124 },
- { 1, 41, 84 },
- { 1, 21, 52 }
- }, { /* Coeff Band 5 */
- { 157, 78, 244 },
- { 140, 72, 231 },
- { 69, 58, 184 },
- { 31, 44, 137 },
- { 14, 38, 105 },
- { 8, 23, 61 }
- }
- }
- }
-};
-static const vp9_coeff_probs_model default_coef_probs_8x8[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 125, 34, 187 },
- { 52, 41, 133 },
- { 6, 31, 56 }
- }, { /* Coeff Band 1 */
- { 37, 109, 153 },
- { 51, 102, 147 },
- { 23, 87, 128 },
- { 8, 67, 101 },
- { 1, 41, 63 },
- { 1, 19, 29 }
- }, { /* Coeff Band 2 */
- { 31, 154, 185 },
- { 17, 127, 175 },
- { 6, 96, 145 },
- { 2, 73, 114 },
- { 1, 51, 82 },
- { 1, 28, 45 }
- }, { /* Coeff Band 3 */
- { 23, 163, 200 },
- { 10, 131, 185 },
- { 2, 93, 148 },
- { 1, 67, 111 },
- { 1, 41, 69 },
- { 1, 14, 24 }
- }, { /* Coeff Band 4 */
- { 29, 176, 217 },
- { 12, 145, 201 },
- { 3, 101, 156 },
- { 1, 69, 111 },
- { 1, 39, 63 },
- { 1, 14, 23 }
- }, { /* Coeff Band 5 */
- { 57, 192, 233 },
- { 25, 154, 215 },
- { 6, 109, 167 },
- { 3, 78, 118 },
- { 1, 48, 69 },
- { 1, 21, 29 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 202, 105, 245 },
- { 108, 106, 216 },
- { 18, 90, 144 }
- }, { /* Coeff Band 1 */
- { 33, 172, 219 },
- { 64, 149, 206 },
- { 14, 117, 177 },
- { 5, 90, 141 },
- { 2, 61, 95 },
- { 1, 37, 57 }
- }, { /* Coeff Band 2 */
- { 33, 179, 220 },
- { 11, 140, 198 },
- { 1, 89, 148 },
- { 1, 60, 104 },
- { 1, 33, 57 },
- { 1, 12, 21 }
- }, { /* Coeff Band 3 */
- { 30, 181, 221 },
- { 8, 141, 198 },
- { 1, 87, 145 },
- { 1, 58, 100 },
- { 1, 31, 55 },
- { 1, 12, 20 }
- }, { /* Coeff Band 4 */
- { 32, 186, 224 },
- { 7, 142, 198 },
- { 1, 86, 143 },
- { 1, 58, 100 },
- { 1, 31, 55 },
- { 1, 12, 22 }
- }, { /* Coeff Band 5 */
- { 57, 192, 227 },
- { 20, 143, 204 },
- { 3, 96, 154 },
- { 1, 68, 112 },
- { 1, 42, 69 },
- { 1, 19, 32 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 212, 35, 215 },
- { 113, 47, 169 },
- { 29, 48, 105 }
- }, { /* Coeff Band 1 */
- { 74, 129, 203 },
- { 106, 120, 203 },
- { 49, 107, 178 },
- { 19, 84, 144 },
- { 4, 50, 84 },
- { 1, 15, 25 }
- }, { /* Coeff Band 2 */
- { 71, 172, 217 },
- { 44, 141, 209 },
- { 15, 102, 173 },
- { 6, 76, 133 },
- { 2, 51, 89 },
- { 1, 24, 42 }
- }, { /* Coeff Band 3 */
- { 64, 185, 231 },
- { 31, 148, 216 },
- { 8, 103, 175 },
- { 3, 74, 131 },
- { 1, 46, 81 },
- { 1, 18, 30 }
- }, { /* Coeff Band 4 */
- { 65, 196, 235 },
- { 25, 157, 221 },
- { 5, 105, 174 },
- { 1, 67, 120 },
- { 1, 38, 69 },
- { 1, 15, 30 }
- }, { /* Coeff Band 5 */
- { 65, 204, 238 },
- { 30, 156, 224 },
- { 7, 107, 177 },
- { 2, 70, 124 },
- { 1, 42, 73 },
- { 1, 18, 34 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 225, 86, 251 },
- { 144, 104, 235 },
- { 42, 99, 181 }
- }, { /* Coeff Band 1 */
- { 85, 175, 239 },
- { 112, 165, 229 },
- { 29, 136, 200 },
- { 12, 103, 162 },
- { 6, 77, 123 },
- { 2, 53, 84 }
- }, { /* Coeff Band 2 */
- { 75, 183, 239 },
- { 30, 155, 221 },
- { 3, 106, 171 },
- { 1, 74, 128 },
- { 1, 44, 76 },
- { 1, 17, 28 }
- }, { /* Coeff Band 3 */
- { 73, 185, 240 },
- { 27, 159, 222 },
- { 2, 107, 172 },
- { 1, 75, 127 },
- { 1, 42, 73 },
- { 1, 17, 29 }
- }, { /* Coeff Band 4 */
- { 62, 190, 238 },
- { 21, 159, 222 },
- { 2, 107, 172 },
- { 1, 72, 122 },
- { 1, 40, 71 },
- { 1, 18, 32 }
- }, { /* Coeff Band 5 */
- { 61, 199, 240 },
- { 27, 161, 226 },
- { 4, 113, 180 },
- { 1, 76, 129 },
- { 1, 46, 80 },
- { 1, 23, 41 }
- }
- }
- }
-};
-static const vp9_coeff_probs_model default_coef_probs_16x16[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 7, 27, 153 },
- { 5, 30, 95 },
- { 1, 16, 30 }
- }, { /* Coeff Band 1 */
- { 50, 75, 127 },
- { 57, 75, 124 },
- { 27, 67, 108 },
- { 10, 54, 86 },
- { 1, 33, 52 },
- { 1, 12, 18 }
- }, { /* Coeff Band 2 */
- { 43, 125, 151 },
- { 26, 108, 148 },
- { 7, 83, 122 },
- { 2, 59, 89 },
- { 1, 38, 60 },
- { 1, 17, 27 }
- }, { /* Coeff Band 3 */
- { 23, 144, 163 },
- { 13, 112, 154 },
- { 2, 75, 117 },
- { 1, 50, 81 },
- { 1, 31, 51 },
- { 1, 14, 23 }
- }, { /* Coeff Band 4 */
- { 18, 162, 185 },
- { 6, 123, 171 },
- { 1, 78, 125 },
- { 1, 51, 86 },
- { 1, 31, 54 },
- { 1, 14, 23 }
- }, { /* Coeff Band 5 */
- { 15, 199, 227 },
- { 3, 150, 204 },
- { 1, 91, 146 },
- { 1, 55, 95 },
- { 1, 30, 53 },
- { 1, 11, 20 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 19, 55, 240 },
- { 19, 59, 196 },
- { 3, 52, 105 }
- }, { /* Coeff Band 1 */
- { 41, 166, 207 },
- { 104, 153, 199 },
- { 31, 123, 181 },
- { 14, 101, 152 },
- { 5, 72, 106 },
- { 1, 36, 52 }
- }, { /* Coeff Band 2 */
- { 35, 176, 211 },
- { 12, 131, 190 },
- { 2, 88, 144 },
- { 1, 60, 101 },
- { 1, 36, 60 },
- { 1, 16, 28 }
- }, { /* Coeff Band 3 */
- { 28, 183, 213 },
- { 8, 134, 191 },
- { 1, 86, 142 },
- { 1, 56, 96 },
- { 1, 30, 53 },
- { 1, 12, 20 }
- }, { /* Coeff Band 4 */
- { 20, 190, 215 },
- { 4, 135, 192 },
- { 1, 84, 139 },
- { 1, 53, 91 },
- { 1, 28, 49 },
- { 1, 11, 20 }
- }, { /* Coeff Band 5 */
- { 13, 196, 216 },
- { 2, 137, 192 },
- { 1, 86, 143 },
- { 1, 57, 99 },
- { 1, 32, 56 },
- { 1, 13, 24 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 211, 29, 217 },
- { 96, 47, 156 },
- { 22, 43, 87 }
- }, { /* Coeff Band 1 */
- { 78, 120, 193 },
- { 111, 116, 186 },
- { 46, 102, 164 },
- { 15, 80, 128 },
- { 2, 49, 76 },
- { 1, 18, 28 }
- }, { /* Coeff Band 2 */
- { 71, 161, 203 },
- { 42, 132, 192 },
- { 10, 98, 150 },
- { 3, 69, 109 },
- { 1, 44, 70 },
- { 1, 18, 29 }
- }, { /* Coeff Band 3 */
- { 57, 186, 211 },
- { 30, 140, 196 },
- { 4, 93, 146 },
- { 1, 62, 102 },
- { 1, 38, 65 },
- { 1, 16, 27 }
- }, { /* Coeff Band 4 */
- { 47, 199, 217 },
- { 14, 145, 196 },
- { 1, 88, 142 },
- { 1, 57, 98 },
- { 1, 36, 62 },
- { 1, 15, 26 }
- }, { /* Coeff Band 5 */
- { 26, 219, 229 },
- { 5, 155, 207 },
- { 1, 94, 151 },
- { 1, 60, 104 },
- { 1, 36, 62 },
- { 1, 16, 28 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 233, 29, 248 },
- { 146, 47, 220 },
- { 43, 52, 140 }
- }, { /* Coeff Band 1 */
- { 100, 163, 232 },
- { 179, 161, 222 },
- { 63, 142, 204 },
- { 37, 113, 174 },
- { 26, 89, 137 },
- { 18, 68, 97 }
- }, { /* Coeff Band 2 */
- { 85, 181, 230 },
- { 32, 146, 209 },
- { 7, 100, 164 },
- { 3, 71, 121 },
- { 1, 45, 77 },
- { 1, 18, 30 }
- }, { /* Coeff Band 3 */
- { 65, 187, 230 },
- { 20, 148, 207 },
- { 2, 97, 159 },
- { 1, 68, 116 },
- { 1, 40, 70 },
- { 1, 14, 29 }
- }, { /* Coeff Band 4 */
- { 40, 194, 227 },
- { 8, 147, 204 },
- { 1, 94, 155 },
- { 1, 65, 112 },
- { 1, 39, 66 },
- { 1, 14, 26 }
- }, { /* Coeff Band 5 */
- { 16, 208, 228 },
- { 3, 151, 207 },
- { 1, 98, 160 },
- { 1, 67, 117 },
- { 1, 41, 74 },
- { 1, 17, 31 }
- }
- }
- }
-};
-static const vp9_coeff_probs_model default_coef_probs_32x32[BLOCK_TYPES] = {
- { /* block Type 0 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 17, 38, 140 },
- { 7, 34, 80 },
- { 1, 17, 29 }
- }, { /* Coeff Band 1 */
- { 37, 75, 128 },
- { 41, 76, 128 },
- { 26, 66, 116 },
- { 12, 52, 94 },
- { 2, 32, 55 },
- { 1, 10, 16 }
- }, { /* Coeff Band 2 */
- { 50, 127, 154 },
- { 37, 109, 152 },
- { 16, 82, 121 },
- { 5, 59, 85 },
- { 1, 35, 54 },
- { 1, 13, 20 }
- }, { /* Coeff Band 3 */
- { 40, 142, 167 },
- { 17, 110, 157 },
- { 2, 71, 112 },
- { 1, 44, 72 },
- { 1, 27, 45 },
- { 1, 11, 17 }
- }, { /* Coeff Band 4 */
- { 30, 175, 188 },
- { 9, 124, 169 },
- { 1, 74, 116 },
- { 1, 48, 78 },
- { 1, 30, 49 },
- { 1, 11, 18 }
- }, { /* Coeff Band 5 */
- { 10, 222, 223 },
- { 2, 150, 194 },
- { 1, 83, 128 },
- { 1, 48, 79 },
- { 1, 27, 45 },
- { 1, 11, 17 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 36, 41, 235 },
- { 29, 36, 193 },
- { 10, 27, 111 }
- }, { /* Coeff Band 1 */
- { 85, 165, 222 },
- { 177, 162, 215 },
- { 110, 135, 195 },
- { 57, 113, 168 },
- { 23, 83, 120 },
- { 10, 49, 61 }
- }, { /* Coeff Band 2 */
- { 85, 190, 223 },
- { 36, 139, 200 },
- { 5, 90, 146 },
- { 1, 60, 103 },
- { 1, 38, 65 },
- { 1, 18, 30 }
- }, { /* Coeff Band 3 */
- { 72, 202, 223 },
- { 23, 141, 199 },
- { 2, 86, 140 },
- { 1, 56, 97 },
- { 1, 36, 61 },
- { 1, 16, 27 }
- }, { /* Coeff Band 4 */
- { 55, 218, 225 },
- { 13, 145, 200 },
- { 1, 86, 141 },
- { 1, 57, 99 },
- { 1, 35, 61 },
- { 1, 13, 22 }
- }, { /* Coeff Band 5 */
- { 15, 235, 212 },
- { 1, 132, 184 },
- { 1, 84, 139 },
- { 1, 57, 97 },
- { 1, 34, 56 },
- { 1, 14, 23 }
- }
- }
- }, { /* block Type 1 */
- { /* Intra */
- { /* Coeff Band 0 */
- { 181, 21, 201 },
- { 61, 37, 123 },
- { 10, 38, 71 }
- }, { /* Coeff Band 1 */
- { 47, 106, 172 },
- { 95, 104, 173 },
- { 42, 93, 159 },
- { 18, 77, 131 },
- { 4, 50, 81 },
- { 1, 17, 23 }
- }, { /* Coeff Band 2 */
- { 62, 147, 199 },
- { 44, 130, 189 },
- { 28, 102, 154 },
- { 18, 75, 115 },
- { 2, 44, 65 },
- { 1, 12, 19 }
- }, { /* Coeff Band 3 */
- { 55, 153, 210 },
- { 24, 130, 194 },
- { 3, 93, 146 },
- { 1, 61, 97 },
- { 1, 31, 50 },
- { 1, 10, 16 }
- }, { /* Coeff Band 4 */
- { 49, 186, 223 },
- { 17, 148, 204 },
- { 1, 96, 142 },
- { 1, 53, 83 },
- { 1, 26, 44 },
- { 1, 11, 17 }
- }, { /* Coeff Band 5 */
- { 13, 217, 212 },
- { 2, 136, 180 },
- { 1, 78, 124 },
- { 1, 50, 83 },
- { 1, 29, 49 },
- { 1, 14, 23 }
- }
- }, { /* Inter */
- { /* Coeff Band 0 */
- { 197, 13, 247 },
- { 82, 17, 222 },
- { 25, 17, 162 }
- }, { /* Coeff Band 1 */
- { 126, 186, 247 },
- { 234, 191, 243 },
- { 176, 177, 234 },
- { 104, 158, 220 },
- { 66, 128, 186 },
- { 55, 90, 137 }
- }, { /* Coeff Band 2 */
- { 111, 197, 242 },
- { 46, 158, 219 },
- { 9, 104, 171 },
- { 2, 65, 125 },
- { 1, 44, 80 },
- { 1, 17, 91 }
- }, { /* Coeff Band 3 */
- { 104, 208, 245 },
- { 39, 168, 224 },
- { 3, 109, 162 },
- { 1, 79, 124 },
- { 1, 50, 102 },
- { 1, 43, 102 }
- }, { /* Coeff Band 4 */
- { 84, 220, 246 },
- { 31, 177, 231 },
- { 2, 115, 180 },
- { 1, 79, 134 },
- { 1, 55, 77 },
- { 1, 60, 79 }
- }, { /* Coeff Band 5 */
- { 43, 243, 240 },
- { 8, 180, 217 },
- { 1, 115, 166 },
- { 1, 84, 121 },
- { 1, 51, 67 },
- { 1, 16, 6 }
- }
- }
- }
-};
-
-#endif // VP9_COMMON_DEFAULT_COEF_PROBS_H_
diff --git a/libvpx/vp9/common/vp9_entropy.c b/libvpx/vp9/common/vp9_entropy.c
index feceb66..bc12f9a 100644
--- a/libvpx/vp9/common/vp9_entropy.c
+++ b/libvpx/vp9/common/vp9_entropy.c
@@ -15,29 +15,8 @@
#include "vpx_mem/vpx_mem.h"
#include "vpx/vpx_integer.h"
-#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES)
-DECLARE_ALIGNED(16, const uint8_t, vp9_norm[256]) = {
- 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-DECLARE_ALIGNED(16, const uint8_t,
- vp9_coefband_trans_8x8plus[1024]) = {
+const uint8_t vp9_coefband_trans_8x8plus[1024] = {
0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 5,
// beyond MAXBAND_INDEX+1 all values are filled as 5
@@ -106,50 +85,17 @@ DECLARE_ALIGNED(16, const uint8_t,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
};
-DECLARE_ALIGNED(16, const uint8_t,
- vp9_coefband_trans_4x4[16]) = {
+const uint8_t vp9_coefband_trans_4x4[16] = {
0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5,
};
-DECLARE_ALIGNED(16, const uint8_t, vp9_pt_energy_class[MAX_ENTROPY_TOKENS]) = {
+const uint8_t vp9_pt_energy_class[ENTROPY_TOKENS] = {
0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 5, 5
};
-
-
-/* Array indices are identical to previously-existing CONTEXT_NODE indices */
-
-const vp9_tree_index vp9_coef_tree[TREE_SIZE(MAX_ENTROPY_TOKENS)] = {
- -DCT_EOB_TOKEN, 2, /* 0 = EOB */
- -ZERO_TOKEN, 4, /* 1 = ZERO */
- -ONE_TOKEN, 6, /* 2 = ONE */
- 8, 12, /* 3 = LOW_VAL */
- -TWO_TOKEN, 10, /* 4 = TWO */
- -THREE_TOKEN, -FOUR_TOKEN, /* 5 = THREE */
- 14, 16, /* 6 = HIGH_LOW */
- -DCT_VAL_CATEGORY1, -DCT_VAL_CATEGORY2, /* 7 = CAT_ONE */
- 18, 20, /* 8 = CAT_THREEFOUR */
- -DCT_VAL_CATEGORY3, -DCT_VAL_CATEGORY4, /* 9 = CAT_THREE */
- -DCT_VAL_CATEGORY5, -DCT_VAL_CATEGORY6 /* 10 = CAT_FIVE */
-};
-
-struct vp9_token vp9_coef_encodings[MAX_ENTROPY_TOKENS];
-
-/* Trees for extra bits. Probabilities are constant and
- do not depend on previously encoded bits */
-
-static const vp9_prob Pcat1[] = { 159};
-static const vp9_prob Pcat2[] = { 165, 145};
-static const vp9_prob Pcat3[] = { 173, 148, 140};
-static const vp9_prob Pcat4[] = { 176, 155, 140, 135};
-static const vp9_prob Pcat5[] = { 180, 157, 141, 134, 130};
-static const vp9_prob Pcat6[] = {
- 254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129
-};
-
-const vp9_tree_index vp9_coefmodel_tree[6] = {
- -DCT_EOB_MODEL_TOKEN, 2, /* 0 = EOB */
- -ZERO_TOKEN, 4, /* 1 = ZERO */
+const vp9_tree_index vp9_coefmodel_tree[TREE_SIZE(UNCONSTRAINED_NODES + 1)] = {
+ -EOB_MODEL_TOKEN, 2,
+ -ZERO_TOKEN, 4,
-ONE_TOKEN, -TWO_TOKEN,
};
@@ -162,198 +108,617 @@ const vp9_tree_index vp9_coefmodel_tree[6] = {
// the probabilities for the rest of the nodes.
// beta = 8
-static const vp9_prob modelcoefprobs_pareto8[COEFPROB_MODELS][MODEL_NODES] = {
+
+// Every odd line in this table can be generated from the even lines
+// by averaging :
+// vp9_pareto8_full[l][node] = (vp9_pareto8_full[l-1][node] +
+// vp9_pareto8_full[l+1][node] ) >> 1;
+const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
{ 3, 86, 128, 6, 86, 23, 88, 29},
+ { 6, 86, 128, 11, 87, 42, 91, 52},
{ 9, 86, 129, 17, 88, 61, 94, 76},
+ { 12, 86, 129, 22, 88, 77, 97, 93},
{ 15, 87, 129, 28, 89, 93, 100, 110},
+ { 17, 87, 129, 33, 90, 105, 103, 123},
{ 20, 88, 130, 38, 91, 118, 106, 136},
+ { 23, 88, 130, 43, 91, 128, 108, 146},
{ 26, 89, 131, 48, 92, 139, 111, 156},
+ { 28, 89, 131, 53, 93, 147, 114, 163},
{ 31, 90, 131, 58, 94, 156, 117, 171},
+ { 34, 90, 131, 62, 94, 163, 119, 177},
{ 37, 90, 132, 66, 95, 171, 122, 184},
+ { 39, 90, 132, 70, 96, 177, 124, 189},
{ 42, 91, 132, 75, 97, 183, 127, 194},
+ { 44, 91, 132, 79, 97, 188, 129, 198},
{ 47, 92, 133, 83, 98, 193, 132, 202},
+ { 49, 92, 133, 86, 99, 197, 134, 205},
{ 52, 93, 133, 90, 100, 201, 137, 208},
+ { 54, 93, 133, 94, 100, 204, 139, 211},
{ 57, 94, 134, 98, 101, 208, 142, 214},
+ { 59, 94, 134, 101, 102, 211, 144, 216},
{ 62, 94, 135, 105, 103, 214, 146, 218},
+ { 64, 94, 135, 108, 103, 216, 148, 220},
{ 66, 95, 135, 111, 104, 219, 151, 222},
+ { 68, 95, 135, 114, 105, 221, 153, 223},
{ 71, 96, 136, 117, 106, 224, 155, 225},
+ { 73, 96, 136, 120, 106, 225, 157, 226},
{ 76, 97, 136, 123, 107, 227, 159, 228},
+ { 78, 97, 136, 126, 108, 229, 160, 229},
{ 80, 98, 137, 129, 109, 231, 162, 231},
+ { 82, 98, 137, 131, 109, 232, 164, 232},
{ 84, 98, 138, 134, 110, 234, 166, 233},
+ { 86, 98, 138, 137, 111, 235, 168, 234},
{ 89, 99, 138, 140, 112, 236, 170, 235},
+ { 91, 99, 138, 142, 112, 237, 171, 235},
{ 93, 100, 139, 145, 113, 238, 173, 236},
+ { 95, 100, 139, 147, 114, 239, 174, 237},
{ 97, 101, 140, 149, 115, 240, 176, 238},
+ { 99, 101, 140, 151, 115, 241, 177, 238},
{101, 102, 140, 154, 116, 242, 179, 239},
+ {103, 102, 140, 156, 117, 242, 180, 239},
{105, 103, 141, 158, 118, 243, 182, 240},
+ {107, 103, 141, 160, 118, 243, 183, 240},
{109, 104, 141, 162, 119, 244, 185, 241},
+ {111, 104, 141, 164, 119, 244, 186, 241},
{113, 104, 142, 166, 120, 245, 187, 242},
+ {114, 104, 142, 168, 121, 245, 188, 242},
{116, 105, 143, 170, 122, 246, 190, 243},
+ {118, 105, 143, 171, 122, 246, 191, 243},
{120, 106, 143, 173, 123, 247, 192, 244},
+ {121, 106, 143, 175, 124, 247, 193, 244},
{123, 107, 144, 177, 125, 248, 195, 244},
+ {125, 107, 144, 178, 125, 248, 196, 244},
{127, 108, 145, 180, 126, 249, 197, 245},
+ {128, 108, 145, 181, 127, 249, 198, 245},
{130, 109, 145, 183, 128, 249, 199, 245},
+ {132, 109, 145, 184, 128, 249, 200, 245},
{134, 110, 146, 186, 129, 250, 201, 246},
+ {135, 110, 146, 187, 130, 250, 202, 246},
{137, 111, 147, 189, 131, 251, 203, 246},
+ {138, 111, 147, 190, 131, 251, 204, 246},
{140, 112, 147, 192, 132, 251, 205, 247},
+ {141, 112, 147, 193, 132, 251, 206, 247},
{143, 113, 148, 194, 133, 251, 207, 247},
+ {144, 113, 148, 195, 134, 251, 207, 247},
{146, 114, 149, 197, 135, 252, 208, 248},
+ {147, 114, 149, 198, 135, 252, 209, 248},
{149, 115, 149, 199, 136, 252, 210, 248},
+ {150, 115, 149, 200, 137, 252, 210, 248},
{152, 115, 150, 201, 138, 252, 211, 248},
+ {153, 115, 150, 202, 138, 252, 212, 248},
{155, 116, 151, 204, 139, 253, 213, 249},
+ {156, 116, 151, 205, 139, 253, 213, 249},
{158, 117, 151, 206, 140, 253, 214, 249},
+ {159, 117, 151, 207, 141, 253, 215, 249},
{161, 118, 152, 208, 142, 253, 216, 249},
+ {162, 118, 152, 209, 142, 253, 216, 249},
{163, 119, 153, 210, 143, 253, 217, 249},
+ {164, 119, 153, 211, 143, 253, 217, 249},
{166, 120, 153, 212, 144, 254, 218, 250},
+ {167, 120, 153, 212, 145, 254, 219, 250},
{168, 121, 154, 213, 146, 254, 220, 250},
+ {169, 121, 154, 214, 146, 254, 220, 250},
{171, 122, 155, 215, 147, 254, 221, 250},
+ {172, 122, 155, 216, 147, 254, 221, 250},
{173, 123, 155, 217, 148, 254, 222, 250},
+ {174, 123, 155, 217, 149, 254, 222, 250},
{176, 124, 156, 218, 150, 254, 223, 250},
+ {177, 124, 156, 219, 150, 254, 223, 250},
{178, 125, 157, 220, 151, 254, 224, 251},
+ {179, 125, 157, 220, 151, 254, 224, 251},
{180, 126, 157, 221, 152, 254, 225, 251},
+ {181, 126, 157, 221, 152, 254, 225, 251},
{183, 127, 158, 222, 153, 254, 226, 251},
+ {184, 127, 158, 223, 154, 254, 226, 251},
{185, 128, 159, 224, 155, 255, 227, 251},
+ {186, 128, 159, 224, 155, 255, 227, 251},
{187, 129, 160, 225, 156, 255, 228, 251},
+ {188, 130, 160, 225, 156, 255, 228, 251},
{189, 131, 160, 226, 157, 255, 228, 251},
+ {190, 131, 160, 226, 158, 255, 228, 251},
{191, 132, 161, 227, 159, 255, 229, 251},
+ {192, 132, 161, 227, 159, 255, 229, 251},
{193, 133, 162, 228, 160, 255, 230, 252},
+ {194, 133, 162, 229, 160, 255, 230, 252},
{195, 134, 163, 230, 161, 255, 231, 252},
+ {196, 134, 163, 230, 161, 255, 231, 252},
{197, 135, 163, 231, 162, 255, 231, 252},
+ {198, 135, 163, 231, 162, 255, 231, 252},
{199, 136, 164, 232, 163, 255, 232, 252},
+ {200, 136, 164, 232, 164, 255, 232, 252},
+ {201, 137, 165, 233, 165, 255, 233, 252},
{201, 137, 165, 233, 165, 255, 233, 252},
{202, 138, 166, 233, 166, 255, 233, 252},
+ {203, 138, 166, 233, 166, 255, 233, 252},
{204, 139, 166, 234, 167, 255, 234, 252},
+ {205, 139, 166, 234, 167, 255, 234, 252},
+ {206, 140, 167, 235, 168, 255, 235, 252},
{206, 140, 167, 235, 168, 255, 235, 252},
{207, 141, 168, 236, 169, 255, 235, 252},
+ {208, 141, 168, 236, 170, 255, 235, 252},
{209, 142, 169, 237, 171, 255, 236, 252},
+ {209, 143, 169, 237, 171, 255, 236, 252},
{210, 144, 169, 237, 172, 255, 236, 252},
+ {211, 144, 169, 237, 172, 255, 236, 252},
{212, 145, 170, 238, 173, 255, 237, 252},
+ {213, 145, 170, 238, 173, 255, 237, 252},
{214, 146, 171, 239, 174, 255, 237, 253},
+ {214, 146, 171, 239, 174, 255, 237, 253},
+ {215, 147, 172, 240, 175, 255, 238, 253},
{215, 147, 172, 240, 175, 255, 238, 253},
{216, 148, 173, 240, 176, 255, 238, 253},
+ {217, 148, 173, 240, 176, 255, 238, 253},
{218, 149, 173, 241, 177, 255, 239, 253},
+ {218, 149, 173, 241, 178, 255, 239, 253},
{219, 150, 174, 241, 179, 255, 239, 253},
+ {219, 151, 174, 241, 179, 255, 239, 253},
{220, 152, 175, 242, 180, 255, 240, 253},
+ {221, 152, 175, 242, 180, 255, 240, 253},
{222, 153, 176, 242, 181, 255, 240, 253},
+ {222, 153, 176, 242, 181, 255, 240, 253},
+ {223, 154, 177, 243, 182, 255, 240, 253},
{223, 154, 177, 243, 182, 255, 240, 253},
{224, 155, 178, 244, 183, 255, 241, 253},
+ {224, 155, 178, 244, 183, 255, 241, 253},
{225, 156, 178, 244, 184, 255, 241, 253},
+ {225, 157, 178, 244, 184, 255, 241, 253},
{226, 158, 179, 244, 185, 255, 242, 253},
+ {227, 158, 179, 244, 185, 255, 242, 253},
+ {228, 159, 180, 245, 186, 255, 242, 253},
{228, 159, 180, 245, 186, 255, 242, 253},
{229, 160, 181, 245, 187, 255, 242, 253},
+ {229, 160, 181, 245, 187, 255, 242, 253},
{230, 161, 182, 246, 188, 255, 243, 253},
+ {230, 162, 182, 246, 188, 255, 243, 253},
+ {231, 163, 183, 246, 189, 255, 243, 253},
{231, 163, 183, 246, 189, 255, 243, 253},
{232, 164, 184, 247, 190, 255, 243, 253},
+ {232, 164, 184, 247, 190, 255, 243, 253},
+ {233, 165, 185, 247, 191, 255, 244, 253},
{233, 165, 185, 247, 191, 255, 244, 253},
{234, 166, 185, 247, 192, 255, 244, 253},
+ {234, 167, 185, 247, 192, 255, 244, 253},
{235, 168, 186, 248, 193, 255, 244, 253},
+ {235, 168, 186, 248, 193, 255, 244, 253},
+ {236, 169, 187, 248, 194, 255, 244, 253},
{236, 169, 187, 248, 194, 255, 244, 253},
{236, 170, 188, 248, 195, 255, 245, 253},
+ {236, 170, 188, 248, 195, 255, 245, 253},
{237, 171, 189, 249, 196, 255, 245, 254},
+ {237, 172, 189, 249, 196, 255, 245, 254},
+ {238, 173, 190, 249, 197, 255, 245, 254},
{238, 173, 190, 249, 197, 255, 245, 254},
{239, 174, 191, 249, 198, 255, 245, 254},
+ {239, 174, 191, 249, 198, 255, 245, 254},
{240, 175, 192, 249, 199, 255, 246, 254},
+ {240, 176, 192, 249, 199, 255, 246, 254},
+ {240, 177, 193, 250, 200, 255, 246, 254},
{240, 177, 193, 250, 200, 255, 246, 254},
{241, 178, 194, 250, 201, 255, 246, 254},
+ {241, 178, 194, 250, 201, 255, 246, 254},
{242, 179, 195, 250, 202, 255, 246, 254},
+ {242, 180, 195, 250, 202, 255, 246, 254},
+ {242, 181, 196, 250, 203, 255, 247, 254},
{242, 181, 196, 250, 203, 255, 247, 254},
{243, 182, 197, 251, 204, 255, 247, 254},
+ {243, 183, 197, 251, 204, 255, 247, 254},
{244, 184, 198, 251, 205, 255, 247, 254},
+ {244, 184, 198, 251, 205, 255, 247, 254},
+ {244, 185, 199, 251, 206, 255, 247, 254},
{244, 185, 199, 251, 206, 255, 247, 254},
{245, 186, 200, 251, 207, 255, 247, 254},
+ {245, 187, 200, 251, 207, 255, 247, 254},
+ {246, 188, 201, 252, 207, 255, 248, 254},
{246, 188, 201, 252, 207, 255, 248, 254},
{246, 189, 202, 252, 208, 255, 248, 254},
+ {246, 190, 202, 252, 208, 255, 248, 254},
+ {247, 191, 203, 252, 209, 255, 248, 254},
{247, 191, 203, 252, 209, 255, 248, 254},
{247, 192, 204, 252, 210, 255, 248, 254},
+ {247, 193, 204, 252, 210, 255, 248, 254},
+ {248, 194, 205, 252, 211, 255, 248, 254},
{248, 194, 205, 252, 211, 255, 248, 254},
{248, 195, 206, 252, 212, 255, 249, 254},
+ {248, 196, 206, 252, 212, 255, 249, 254},
+ {249, 197, 207, 253, 213, 255, 249, 254},
{249, 197, 207, 253, 213, 255, 249, 254},
{249, 198, 208, 253, 214, 255, 249, 254},
+ {249, 199, 209, 253, 214, 255, 249, 254},
+ {250, 200, 210, 253, 215, 255, 249, 254},
{250, 200, 210, 253, 215, 255, 249, 254},
{250, 201, 211, 253, 215, 255, 249, 254},
+ {250, 202, 211, 253, 215, 255, 249, 254},
+ {250, 203, 212, 253, 216, 255, 249, 254},
{250, 203, 212, 253, 216, 255, 249, 254},
{251, 204, 213, 253, 217, 255, 250, 254},
+ {251, 205, 213, 253, 217, 255, 250, 254},
{251, 206, 214, 254, 218, 255, 250, 254},
+ {251, 206, 215, 254, 218, 255, 250, 254},
{252, 207, 216, 254, 219, 255, 250, 254},
+ {252, 208, 216, 254, 219, 255, 250, 254},
{252, 209, 217, 254, 220, 255, 250, 254},
+ {252, 210, 217, 254, 220, 255, 250, 254},
{252, 211, 218, 254, 221, 255, 250, 254},
+ {252, 212, 218, 254, 221, 255, 250, 254},
{253, 213, 219, 254, 222, 255, 250, 254},
+ {253, 213, 220, 254, 222, 255, 250, 254},
{253, 214, 221, 254, 223, 255, 250, 254},
+ {253, 215, 221, 254, 223, 255, 250, 254},
{253, 216, 222, 254, 224, 255, 251, 254},
+ {253, 217, 223, 254, 224, 255, 251, 254},
{253, 218, 224, 254, 225, 255, 251, 254},
+ {253, 219, 224, 254, 225, 255, 251, 254},
{254, 220, 225, 254, 225, 255, 251, 254},
+ {254, 221, 226, 254, 225, 255, 251, 254},
{254, 222, 227, 255, 226, 255, 251, 254},
+ {254, 223, 227, 255, 226, 255, 251, 254},
{254, 224, 228, 255, 227, 255, 251, 254},
+ {254, 225, 229, 255, 227, 255, 251, 254},
{254, 226, 230, 255, 228, 255, 251, 254},
+ {254, 227, 230, 255, 229, 255, 251, 254},
{255, 228, 231, 255, 230, 255, 251, 254},
+ {255, 229, 232, 255, 230, 255, 251, 254},
{255, 230, 233, 255, 231, 255, 252, 254},
+ {255, 231, 234, 255, 231, 255, 252, 254},
{255, 232, 235, 255, 232, 255, 252, 254},
+ {255, 233, 236, 255, 232, 255, 252, 254},
{255, 235, 237, 255, 233, 255, 252, 254},
+ {255, 236, 238, 255, 234, 255, 252, 254},
{255, 238, 240, 255, 235, 255, 252, 255},
+ {255, 239, 241, 255, 235, 255, 252, 254},
{255, 241, 243, 255, 236, 255, 252, 254},
- {255, 246, 247, 255, 239, 255, 253, 255}
+ {255, 243, 245, 255, 237, 255, 252, 254},
+ {255, 246, 247, 255, 239, 255, 253, 255},
+ {255, 246, 247, 255, 239, 255, 253, 255},
};
-static void extend_model_to_full_distribution(vp9_prob p,
- vp9_prob *tree_probs) {
- const int l = (p - 1) / 2;
- const vp9_prob (*model)[MODEL_NODES] = modelcoefprobs_pareto8;
- if (p & 1) {
- vpx_memcpy(tree_probs + UNCONSTRAINED_NODES,
- model[l], MODEL_NODES * sizeof(vp9_prob));
- } else {
- // interpolate
- int i;
- for (i = UNCONSTRAINED_NODES; i < ENTROPY_NODES; ++i)
- tree_probs[i] = (model[l][i - UNCONSTRAINED_NODES] +
- model[l + 1][i - UNCONSTRAINED_NODES]) >> 1;
+static const vp9_coeff_probs_model default_coef_probs_4x4[PLANE_TYPES] = {
+ { // Y plane
+ { // Intra
+ { // Band 0
+ { 195, 29, 183 }, { 84, 49, 136 }, { 8, 42, 71 }
+ }, { // Band 1
+ { 31, 107, 169 }, { 35, 99, 159 }, { 17, 82, 140 },
+ { 8, 66, 114 }, { 2, 44, 76 }, { 1, 19, 32 }
+ }, { // Band 2
+ { 40, 132, 201 }, { 29, 114, 187 }, { 13, 91, 157 },
+ { 7, 75, 127 }, { 3, 58, 95 }, { 1, 28, 47 }
+ }, { // Band 3
+ { 69, 142, 221 }, { 42, 122, 201 }, { 15, 91, 159 },
+ { 6, 67, 121 }, { 1, 42, 77 }, { 1, 17, 31 }
+ }, { // Band 4
+ { 102, 148, 228 }, { 67, 117, 204 }, { 17, 82, 154 },
+ { 6, 59, 114 }, { 2, 39, 75 }, { 1, 15, 29 }
+ }, { // Band 5
+ { 156, 57, 233 }, { 119, 57, 212 }, { 58, 48, 163 },
+ { 29, 40, 124 }, { 12, 30, 81 }, { 3, 12, 31 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 191, 107, 226 }, { 124, 117, 204 }, { 25, 99, 155 }
+ }, { // Band 1
+ { 29, 148, 210 }, { 37, 126, 194 }, { 8, 93, 157 },
+ { 2, 68, 118 }, { 1, 39, 69 }, { 1, 17, 33 }
+ }, { // Band 2
+ { 41, 151, 213 }, { 27, 123, 193 }, { 3, 82, 144 },
+ { 1, 58, 105 }, { 1, 32, 60 }, { 1, 13, 26 }
+ }, { // Band 3
+ { 59, 159, 220 }, { 23, 126, 198 }, { 4, 88, 151 },
+ { 1, 66, 114 }, { 1, 38, 71 }, { 1, 18, 34 }
+ }, { // Band 4
+ { 114, 136, 232 }, { 51, 114, 207 }, { 11, 83, 155 },
+ { 3, 56, 105 }, { 1, 33, 65 }, { 1, 17, 34 }
+ }, { // Band 5
+ { 149, 65, 234 }, { 121, 57, 215 }, { 61, 49, 166 },
+ { 28, 36, 114 }, { 12, 25, 76 }, { 3, 16, 42 }
+ }
+ }
+ }, { // UV plane
+ { // Intra
+ { // Band 0
+ { 214, 49, 220 }, { 132, 63, 188 }, { 42, 65, 137 }
+ }, { // Band 1
+ { 85, 137, 221 }, { 104, 131, 216 }, { 49, 111, 192 },
+ { 21, 87, 155 }, { 2, 49, 87 }, { 1, 16, 28 }
+ }, { // Band 2
+ { 89, 163, 230 }, { 90, 137, 220 }, { 29, 100, 183 },
+ { 10, 70, 135 }, { 2, 42, 81 }, { 1, 17, 33 }
+ }, { // Band 3
+ { 108, 167, 237 }, { 55, 133, 222 }, { 15, 97, 179 },
+ { 4, 72, 135 }, { 1, 45, 85 }, { 1, 19, 38 }
+ }, { // Band 4
+ { 124, 146, 240 }, { 66, 124, 224 }, { 17, 88, 175 },
+ { 4, 58, 122 }, { 1, 36, 75 }, { 1, 18, 37 }
+ }, { // Band 5
+ { 141, 79, 241 }, { 126, 70, 227 }, { 66, 58, 182 },
+ { 30, 44, 136 }, { 12, 34, 96 }, { 2, 20, 47 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 229, 99, 249 }, { 143, 111, 235 }, { 46, 109, 192 }
+ }, { // Band 1
+ { 82, 158, 236 }, { 94, 146, 224 }, { 25, 117, 191 },
+ { 9, 87, 149 }, { 3, 56, 99 }, { 1, 33, 57 }
+ }, { // Band 2
+ { 83, 167, 237 }, { 68, 145, 222 }, { 10, 103, 177 },
+ { 2, 72, 131 }, { 1, 41, 79 }, { 1, 20, 39 }
+ }, { // Band 3
+ { 99, 167, 239 }, { 47, 141, 224 }, { 10, 104, 178 },
+ { 2, 73, 133 }, { 1, 44, 85 }, { 1, 22, 47 }
+ }, { // Band 4
+ { 127, 145, 243 }, { 71, 129, 228 }, { 17, 93, 177 },
+ { 3, 61, 124 }, { 1, 41, 84 }, { 1, 21, 52 }
+ }, { // Band 5
+ { 157, 78, 244 }, { 140, 72, 231 }, { 69, 58, 184 },
+ { 31, 44, 137 }, { 14, 38, 105 }, { 8, 23, 61 }
+ }
+ }
}
-}
-
-void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full) {
- if (full != model)
- vpx_memcpy(full, model, sizeof(vp9_prob) * UNCONSTRAINED_NODES);
- extend_model_to_full_distribution(model[PIVOT_NODE], full);
-}
+};
-static vp9_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[28];
+static const vp9_coeff_probs_model default_coef_probs_8x8[PLANE_TYPES] = {
+ { // Y plane
+ { // Intra
+ { // Band 0
+ { 125, 34, 187 }, { 52, 41, 133 }, { 6, 31, 56 }
+ }, { // Band 1
+ { 37, 109, 153 }, { 51, 102, 147 }, { 23, 87, 128 },
+ { 8, 67, 101 }, { 1, 41, 63 }, { 1, 19, 29 }
+ }, { // Band 2
+ { 31, 154, 185 }, { 17, 127, 175 }, { 6, 96, 145 },
+ { 2, 73, 114 }, { 1, 51, 82 }, { 1, 28, 45 }
+ }, { // Band 3
+ { 23, 163, 200 }, { 10, 131, 185 }, { 2, 93, 148 },
+ { 1, 67, 111 }, { 1, 41, 69 }, { 1, 14, 24 }
+ }, { // Band 4
+ { 29, 176, 217 }, { 12, 145, 201 }, { 3, 101, 156 },
+ { 1, 69, 111 }, { 1, 39, 63 }, { 1, 14, 23 }
+ }, { // Band 5
+ { 57, 192, 233 }, { 25, 154, 215 }, { 6, 109, 167 },
+ { 3, 78, 118 }, { 1, 48, 69 }, { 1, 21, 29 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 202, 105, 245 }, { 108, 106, 216 }, { 18, 90, 144 }
+ }, { // Band 1
+ { 33, 172, 219 }, { 64, 149, 206 }, { 14, 117, 177 },
+ { 5, 90, 141 }, { 2, 61, 95 }, { 1, 37, 57 }
+ }, { // Band 2
+ { 33, 179, 220 }, { 11, 140, 198 }, { 1, 89, 148 },
+ { 1, 60, 104 }, { 1, 33, 57 }, { 1, 12, 21 }
+ }, { // Band 3
+ { 30, 181, 221 }, { 8, 141, 198 }, { 1, 87, 145 },
+ { 1, 58, 100 }, { 1, 31, 55 }, { 1, 12, 20 }
+ }, { // Band 4
+ { 32, 186, 224 }, { 7, 142, 198 }, { 1, 86, 143 },
+ { 1, 58, 100 }, { 1, 31, 55 }, { 1, 12, 22 }
+ }, { // Band 5
+ { 57, 192, 227 }, { 20, 143, 204 }, { 3, 96, 154 },
+ { 1, 68, 112 }, { 1, 42, 69 }, { 1, 19, 32 }
+ }
+ }
+ }, { // UV plane
+ { // Intra
+ { // Band 0
+ { 212, 35, 215 }, { 113, 47, 169 }, { 29, 48, 105 }
+ }, { // Band 1
+ { 74, 129, 203 }, { 106, 120, 203 }, { 49, 107, 178 },
+ { 19, 84, 144 }, { 4, 50, 84 }, { 1, 15, 25 }
+ }, { // Band 2
+ { 71, 172, 217 }, { 44, 141, 209 }, { 15, 102, 173 },
+ { 6, 76, 133 }, { 2, 51, 89 }, { 1, 24, 42 }
+ }, { // Band 3
+ { 64, 185, 231 }, { 31, 148, 216 }, { 8, 103, 175 },
+ { 3, 74, 131 }, { 1, 46, 81 }, { 1, 18, 30 }
+ }, { // Band 4
+ { 65, 196, 235 }, { 25, 157, 221 }, { 5, 105, 174 },
+ { 1, 67, 120 }, { 1, 38, 69 }, { 1, 15, 30 }
+ }, { // Band 5
+ { 65, 204, 238 }, { 30, 156, 224 }, { 7, 107, 177 },
+ { 2, 70, 124 }, { 1, 42, 73 }, { 1, 18, 34 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 225, 86, 251 }, { 144, 104, 235 }, { 42, 99, 181 }
+ }, { // Band 1
+ { 85, 175, 239 }, { 112, 165, 229 }, { 29, 136, 200 },
+ { 12, 103, 162 }, { 6, 77, 123 }, { 2, 53, 84 }
+ }, { // Band 2
+ { 75, 183, 239 }, { 30, 155, 221 }, { 3, 106, 171 },
+ { 1, 74, 128 }, { 1, 44, 76 }, { 1, 17, 28 }
+ }, { // Band 3
+ { 73, 185, 240 }, { 27, 159, 222 }, { 2, 107, 172 },
+ { 1, 75, 127 }, { 1, 42, 73 }, { 1, 17, 29 }
+ }, { // Band 4
+ { 62, 190, 238 }, { 21, 159, 222 }, { 2, 107, 172 },
+ { 1, 72, 122 }, { 1, 40, 71 }, { 1, 18, 32 }
+ }, { // Band 5
+ { 61, 199, 240 }, { 27, 161, 226 }, { 4, 113, 180 },
+ { 1, 76, 129 }, { 1, 46, 80 }, { 1, 23, 41 }
+ }
+ }
+ }
+};
-static void init_bit_tree(vp9_tree_index *p, int n) {
- int i = 0;
+static const vp9_coeff_probs_model default_coef_probs_16x16[PLANE_TYPES] = {
+ { // Y plane
+ { // Intra
+ { // Band 0
+ { 7, 27, 153 }, { 5, 30, 95 }, { 1, 16, 30 }
+ }, { // Band 1
+ { 50, 75, 127 }, { 57, 75, 124 }, { 27, 67, 108 },
+ { 10, 54, 86 }, { 1, 33, 52 }, { 1, 12, 18 }
+ }, { // Band 2
+ { 43, 125, 151 }, { 26, 108, 148 }, { 7, 83, 122 },
+ { 2, 59, 89 }, { 1, 38, 60 }, { 1, 17, 27 }
+ }, { // Band 3
+ { 23, 144, 163 }, { 13, 112, 154 }, { 2, 75, 117 },
+ { 1, 50, 81 }, { 1, 31, 51 }, { 1, 14, 23 }
+ }, { // Band 4
+ { 18, 162, 185 }, { 6, 123, 171 }, { 1, 78, 125 },
+ { 1, 51, 86 }, { 1, 31, 54 }, { 1, 14, 23 }
+ }, { // Band 5
+ { 15, 199, 227 }, { 3, 150, 204 }, { 1, 91, 146 },
+ { 1, 55, 95 }, { 1, 30, 53 }, { 1, 11, 20 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 19, 55, 240 }, { 19, 59, 196 }, { 3, 52, 105 }
+ }, { // Band 1
+ { 41, 166, 207 }, { 104, 153, 199 }, { 31, 123, 181 },
+ { 14, 101, 152 }, { 5, 72, 106 }, { 1, 36, 52 }
+ }, { // Band 2
+ { 35, 176, 211 }, { 12, 131, 190 }, { 2, 88, 144 },
+ { 1, 60, 101 }, { 1, 36, 60 }, { 1, 16, 28 }
+ }, { // Band 3
+ { 28, 183, 213 }, { 8, 134, 191 }, { 1, 86, 142 },
+ { 1, 56, 96 }, { 1, 30, 53 }, { 1, 12, 20 }
+ }, { // Band 4
+ { 20, 190, 215 }, { 4, 135, 192 }, { 1, 84, 139 },
+ { 1, 53, 91 }, { 1, 28, 49 }, { 1, 11, 20 }
+ }, { // Band 5
+ { 13, 196, 216 }, { 2, 137, 192 }, { 1, 86, 143 },
+ { 1, 57, 99 }, { 1, 32, 56 }, { 1, 13, 24 }
+ }
+ }
+ }, { // UV plane
+ { // Intra
+ { // Band 0
+ { 211, 29, 217 }, { 96, 47, 156 }, { 22, 43, 87 }
+ }, { // Band 1
+ { 78, 120, 193 }, { 111, 116, 186 }, { 46, 102, 164 },
+ { 15, 80, 128 }, { 2, 49, 76 }, { 1, 18, 28 }
+ }, { // Band 2
+ { 71, 161, 203 }, { 42, 132, 192 }, { 10, 98, 150 },
+ { 3, 69, 109 }, { 1, 44, 70 }, { 1, 18, 29 }
+ }, { // Band 3
+ { 57, 186, 211 }, { 30, 140, 196 }, { 4, 93, 146 },
+ { 1, 62, 102 }, { 1, 38, 65 }, { 1, 16, 27 }
+ }, { // Band 4
+ { 47, 199, 217 }, { 14, 145, 196 }, { 1, 88, 142 },
+ { 1, 57, 98 }, { 1, 36, 62 }, { 1, 15, 26 }
+ }, { // Band 5
+ { 26, 219, 229 }, { 5, 155, 207 }, { 1, 94, 151 },
+ { 1, 60, 104 }, { 1, 36, 62 }, { 1, 16, 28 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 233, 29, 248 }, { 146, 47, 220 }, { 43, 52, 140 }
+ }, { // Band 1
+ { 100, 163, 232 }, { 179, 161, 222 }, { 63, 142, 204 },
+ { 37, 113, 174 }, { 26, 89, 137 }, { 18, 68, 97 }
+ }, { // Band 2
+ { 85, 181, 230 }, { 32, 146, 209 }, { 7, 100, 164 },
+ { 3, 71, 121 }, { 1, 45, 77 }, { 1, 18, 30 }
+ }, { // Band 3
+ { 65, 187, 230 }, { 20, 148, 207 }, { 2, 97, 159 },
+ { 1, 68, 116 }, { 1, 40, 70 }, { 1, 14, 29 }
+ }, { // Band 4
+ { 40, 194, 227 }, { 8, 147, 204 }, { 1, 94, 155 },
+ { 1, 65, 112 }, { 1, 39, 66 }, { 1, 14, 26 }
+ }, { // Band 5
+ { 16, 208, 228 }, { 3, 151, 207 }, { 1, 98, 160 },
+ { 1, 67, 117 }, { 1, 41, 74 }, { 1, 17, 31 }
+ }
+ }
+ }
+};
- while (++i < n) {
- p[0] = p[1] = i << 1;
- p += 2;
+static const vp9_coeff_probs_model default_coef_probs_32x32[PLANE_TYPES] = {
+ { // Y plane
+ { // Intra
+ { // Band 0
+ { 17, 38, 140 }, { 7, 34, 80 }, { 1, 17, 29 }
+ }, { // Band 1
+ { 37, 75, 128 }, { 41, 76, 128 }, { 26, 66, 116 },
+ { 12, 52, 94 }, { 2, 32, 55 }, { 1, 10, 16 }
+ }, { // Band 2
+ { 50, 127, 154 }, { 37, 109, 152 }, { 16, 82, 121 },
+ { 5, 59, 85 }, { 1, 35, 54 }, { 1, 13, 20 }
+ }, { // Band 3
+ { 40, 142, 167 }, { 17, 110, 157 }, { 2, 71, 112 },
+ { 1, 44, 72 }, { 1, 27, 45 }, { 1, 11, 17 }
+ }, { // Band 4
+ { 30, 175, 188 }, { 9, 124, 169 }, { 1, 74, 116 },
+ { 1, 48, 78 }, { 1, 30, 49 }, { 1, 11, 18 }
+ }, { // Band 5
+ { 10, 222, 223 }, { 2, 150, 194 }, { 1, 83, 128 },
+ { 1, 48, 79 }, { 1, 27, 45 }, { 1, 11, 17 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 36, 41, 235 }, { 29, 36, 193 }, { 10, 27, 111 }
+ }, { // Band 1
+ { 85, 165, 222 }, { 177, 162, 215 }, { 110, 135, 195 },
+ { 57, 113, 168 }, { 23, 83, 120 }, { 10, 49, 61 }
+ }, { // Band 2
+ { 85, 190, 223 }, { 36, 139, 200 }, { 5, 90, 146 },
+ { 1, 60, 103 }, { 1, 38, 65 }, { 1, 18, 30 }
+ }, { // Band 3
+ { 72, 202, 223 }, { 23, 141, 199 }, { 2, 86, 140 },
+ { 1, 56, 97 }, { 1, 36, 61 }, { 1, 16, 27 }
+ }, { // Band 4
+ { 55, 218, 225 }, { 13, 145, 200 }, { 1, 86, 141 },
+ { 1, 57, 99 }, { 1, 35, 61 }, { 1, 13, 22 }
+ }, { // Band 5
+ { 15, 235, 212 }, { 1, 132, 184 }, { 1, 84, 139 },
+ { 1, 57, 97 }, { 1, 34, 56 }, { 1, 14, 23 }
+ }
+ }
+ }, { // UV plane
+ { // Intra
+ { // Band 0
+ { 181, 21, 201 }, { 61, 37, 123 }, { 10, 38, 71 }
+ }, { // Band 1
+ { 47, 106, 172 }, { 95, 104, 173 }, { 42, 93, 159 },
+ { 18, 77, 131 }, { 4, 50, 81 }, { 1, 17, 23 }
+ }, { // Band 2
+ { 62, 147, 199 }, { 44, 130, 189 }, { 28, 102, 154 },
+ { 18, 75, 115 }, { 2, 44, 65 }, { 1, 12, 19 }
+ }, { // Band 3
+ { 55, 153, 210 }, { 24, 130, 194 }, { 3, 93, 146 },
+ { 1, 61, 97 }, { 1, 31, 50 }, { 1, 10, 16 }
+ }, { // Band 4
+ { 49, 186, 223 }, { 17, 148, 204 }, { 1, 96, 142 },
+ { 1, 53, 83 }, { 1, 26, 44 }, { 1, 11, 17 }
+ }, { // Band 5
+ { 13, 217, 212 }, { 2, 136, 180 }, { 1, 78, 124 },
+ { 1, 50, 83 }, { 1, 29, 49 }, { 1, 14, 23 }
+ }
+ }, { // Inter
+ { // Band 0
+ { 197, 13, 247 }, { 82, 17, 222 }, { 25, 17, 162 }
+ }, { // Band 1
+ { 126, 186, 247 }, { 234, 191, 243 }, { 176, 177, 234 },
+ { 104, 158, 220 }, { 66, 128, 186 }, { 55, 90, 137 }
+ }, { // Band 2
+ { 111, 197, 242 }, { 46, 158, 219 }, { 9, 104, 171 },
+ { 2, 65, 125 }, { 1, 44, 80 }, { 1, 17, 91 }
+ }, { // Band 3
+ { 104, 208, 245 }, { 39, 168, 224 }, { 3, 109, 162 },
+ { 1, 79, 124 }, { 1, 50, 102 }, { 1, 43, 102 }
+ }, { // Band 4
+ { 84, 220, 246 }, { 31, 177, 231 }, { 2, 115, 180 },
+ { 1, 79, 134 }, { 1, 55, 77 }, { 1, 60, 79 }
+ }, { // Band 5
+ { 43, 243, 240 }, { 8, 180, 217 }, { 1, 115, 166 },
+ { 1, 84, 121 }, { 1, 51, 67 }, { 1, 16, 6 }
+ }
+ }
}
+};
- p[0] = p[1] = 0;
+static void extend_to_full_distribution(vp9_prob *probs, vp9_prob p) {
+ vpx_memcpy(probs, vp9_pareto8_full[p = 0 ? 0 : p - 1],
+ MODEL_NODES * sizeof(vp9_prob));
}
-static void init_bit_trees() {
- init_bit_tree(cat1, 1);
- init_bit_tree(cat2, 2);
- init_bit_tree(cat3, 3);
- init_bit_tree(cat4, 4);
- init_bit_tree(cat5, 5);
- init_bit_tree(cat6, 14);
+void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full) {
+ if (full != model)
+ vpx_memcpy(full, model, sizeof(vp9_prob) * UNCONSTRAINED_NODES);
+ extend_to_full_distribution(&full[UNCONSTRAINED_NODES], model[PIVOT_NODE]);
}
-const vp9_extra_bit vp9_extra_bits[MAX_ENTROPY_TOKENS] = {
- { 0, 0, 0, 0},
- { 0, 0, 0, 1},
- { 0, 0, 0, 2},
- { 0, 0, 0, 3},
- { 0, 0, 0, 4},
- { cat1, Pcat1, 1, 5},
- { cat2, Pcat2, 2, 7},
- { cat3, Pcat3, 3, 11},
- { cat4, Pcat4, 4, 19},
- { cat5, Pcat5, 5, 35},
- { cat6, Pcat6, 14, 67},
- { 0, 0, 0, 0}
-};
-
-#include "vp9/common/vp9_default_coef_probs.h"
-
void vp9_default_coef_probs(VP9_COMMON *cm) {
vp9_copy(cm->fc.coef_probs[TX_4X4], default_coef_probs_4x4);
vp9_copy(cm->fc.coef_probs[TX_8X8], default_coef_probs_8x8);
@@ -361,13 +726,6 @@ void vp9_default_coef_probs(VP9_COMMON *cm) {
vp9_copy(cm->fc.coef_probs[TX_32X32], default_coef_probs_32x32);
}
-void vp9_coef_tree_initialize() {
- init_bit_trees();
- vp9_tokens_from_tree(vp9_coef_encodings, vp9_coef_tree);
-}
-
-// #define COEF_COUNT_TESTING
-
#define COEF_COUNT_SAT 24
#define COEF_MAX_UPDATE_FACTOR 112
#define COEF_COUNT_SAT_KEY 24
@@ -379,29 +737,30 @@ static void adapt_coef_probs(VP9_COMMON *cm, TX_SIZE tx_size,
unsigned int count_sat,
unsigned int update_factor) {
const FRAME_CONTEXT *pre_fc = &cm->frame_contexts[cm->frame_context_idx];
-
- vp9_coeff_probs_model *dst_coef_probs = cm->fc.coef_probs[tx_size];
- const vp9_coeff_probs_model *pre_coef_probs = pre_fc->coef_probs[tx_size];
- vp9_coeff_count_model *coef_counts = cm->counts.coef[tx_size];
- unsigned int (*eob_branch_count)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] =
+ vp9_coeff_probs_model *const probs = cm->fc.coef_probs[tx_size];
+ const vp9_coeff_probs_model *const pre_probs = pre_fc->coef_probs[tx_size];
+ vp9_coeff_count_model *counts = cm->counts.coef[tx_size];
+ unsigned int (*eob_counts)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] =
cm->counts.eob_branch[tx_size];
int i, j, k, l, m;
- unsigned int branch_ct[UNCONSTRAINED_NODES][2];
- for (i = 0; i < BLOCK_TYPES; ++i)
+ for (i = 0; i < PLANE_TYPES; ++i)
for (j = 0; j < REF_TYPES; ++j)
for (k = 0; k < COEF_BANDS; ++k)
- for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
- if (l >= 3 && k == 0)
- continue;
- vp9_tree_probs_from_distribution(vp9_coefmodel_tree, branch_ct,
- coef_counts[i][j][k][l]);
- branch_ct[0][1] = eob_branch_count[i][j][k][l] - branch_ct[0][0];
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
+ const int n0 = counts[i][j][k][l][ZERO_TOKEN];
+ const int n1 = counts[i][j][k][l][ONE_TOKEN];
+ const int n2 = counts[i][j][k][l][TWO_TOKEN];
+ const int neob = counts[i][j][k][l][EOB_MODEL_TOKEN];
+ const unsigned int branch_ct[UNCONSTRAINED_NODES][2] = {
+ { neob, eob_counts[i][j][k][l] - neob },
+ { n0, n1 + n2 },
+ { n1, n2 }
+ };
for (m = 0; m < UNCONSTRAINED_NODES; ++m)
- dst_coef_probs[i][j][k][l][m] = merge_probs(
- pre_coef_probs[i][j][k][l][m],
- branch_ct[m],
- count_sat, update_factor);
+ probs[i][j][k][l][m] = merge_probs(pre_probs[i][j][k][l][m],
+ branch_ct[m],
+ count_sat, update_factor);
}
}
diff --git a/libvpx/vp9/common/vp9_entropy.h b/libvpx/vp9/common/vp9_entropy.h
index e133d65..15bf8eb 100644
--- a/libvpx/vp9/common/vp9_entropy.h
+++ b/libvpx/vp9/common/vp9_entropy.h
@@ -16,40 +16,36 @@
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_scan.h"
-#include "vp9/common/vp9_treecoder.h"
-#define DIFF_UPDATE_PROB 252
+#ifdef __cplusplus
+extern "C" {
+#endif
-/* Coefficient token alphabet */
+#define DIFF_UPDATE_PROB 252
-#define ZERO_TOKEN 0 /* 0 Extra Bits 0+0 */
-#define ONE_TOKEN 1 /* 1 Extra Bits 0+1 */
-#define TWO_TOKEN 2 /* 2 Extra Bits 0+1 */
-#define THREE_TOKEN 3 /* 3 Extra Bits 0+1 */
-#define FOUR_TOKEN 4 /* 4 Extra Bits 0+1 */
-#define DCT_VAL_CATEGORY1 5 /* 5-6 Extra Bits 1+1 */
-#define DCT_VAL_CATEGORY2 6 /* 7-10 Extra Bits 2+1 */
-#define DCT_VAL_CATEGORY3 7 /* 11-18 Extra Bits 3+1 */
-#define DCT_VAL_CATEGORY4 8 /* 19-34 Extra Bits 4+1 */
-#define DCT_VAL_CATEGORY5 9 /* 35-66 Extra Bits 5+1 */
-#define DCT_VAL_CATEGORY6 10 /* 67+ Extra Bits 14+1 */
-#define DCT_EOB_TOKEN 11 /* EOB Extra Bits 0+0 */
-#define MAX_ENTROPY_TOKENS 12
-#define ENTROPY_NODES 11
-#define EOSB_TOKEN 127 /* Not signalled, encoder only */
+// Coefficient token alphabet
+#define ZERO_TOKEN 0 // 0 Extra Bits 0+0
+#define ONE_TOKEN 1 // 1 Extra Bits 0+1
+#define TWO_TOKEN 2 // 2 Extra Bits 0+1
+#define THREE_TOKEN 3 // 3 Extra Bits 0+1
+#define FOUR_TOKEN 4 // 4 Extra Bits 0+1
+#define CATEGORY1_TOKEN 5 // 5-6 Extra Bits 1+1
+#define CATEGORY2_TOKEN 6 // 7-10 Extra Bits 2+1
+#define CATEGORY3_TOKEN 7 // 11-18 Extra Bits 3+1
+#define CATEGORY4_TOKEN 8 // 19-34 Extra Bits 4+1
+#define CATEGORY5_TOKEN 9 // 35-66 Extra Bits 5+1
+#define CATEGORY6_TOKEN 10 // 67+ Extra Bits 14+1
+#define EOB_TOKEN 11 // EOB Extra Bits 0+0
-#define INTER_MODE_CONTEXTS 7
+#define ENTROPY_TOKENS 12
-extern DECLARE_ALIGNED(16, const uint8_t,
- vp9_pt_energy_class[MAX_ENTROPY_TOKENS]);
+#define ENTROPY_NODES 11
-extern const vp9_tree_index vp9_coef_tree[TREE_SIZE(MAX_ENTROPY_TOKENS)];
+DECLARE_ALIGNED(16, extern const uint8_t, vp9_pt_energy_class[ENTROPY_TOKENS]);
-#define DCT_EOB_MODEL_TOKEN 3 /* EOB Extra Bits 0+0 */
+#define EOB_MODEL_TOKEN 3
extern const vp9_tree_index vp9_coefmodel_tree[];
-extern struct vp9_token vp9_coef_encodings[MAX_ENTROPY_TOKENS];
-
typedef struct {
const vp9_tree_index *tree;
const vp9_prob *prob;
@@ -58,15 +54,12 @@ typedef struct {
} vp9_extra_bit;
// indexed by token value
-extern const vp9_extra_bit vp9_extra_bits[MAX_ENTROPY_TOKENS];
+extern const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS];
-#define MAX_PROB 255
#define DCT_MAX_VALUE 16384
/* Coefficients are predicted via a 3-dimensional probability table. */
-/* Outside dimension. 0 = Y with DC, 1 = UV */
-#define BLOCK_TYPES 2
#define REF_TYPES 2 // intra=0, inter=1
/* Middle dimension reflects the coefficient position within the transform. */
@@ -88,13 +81,14 @@ extern const vp9_extra_bit vp9_extra_bits[MAX_ENTROPY_TOKENS];
coefficient band (and since zigzag positions 0, 1, and 2 are in
distinct bands). */
-#define PREV_COEF_CONTEXTS 6
+#define COEFF_CONTEXTS 6
+#define BAND_COEFF_CONTEXTS(band) ((band) == 0 ? 3 : COEFF_CONTEXTS)
// #define ENTROPY_STATS
-typedef unsigned int vp9_coeff_count[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
- [MAX_ENTROPY_TOKENS];
-typedef unsigned int vp9_coeff_stats[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
+typedef unsigned int vp9_coeff_count[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
+ [ENTROPY_TOKENS];
+typedef unsigned int vp9_coeff_stats[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[ENTROPY_NODES][2];
#define SUBEXP_PARAM 4 /* Subexponential code parameter */
@@ -102,8 +96,6 @@ typedef unsigned int vp9_coeff_stats[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS]
struct VP9Common;
void vp9_default_coef_probs(struct VP9Common *cm);
-
-void vp9_coef_tree_initialize();
void vp9_adapt_coef_probs(struct VP9Common *cm);
static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
@@ -123,10 +115,10 @@ static INLINE void reset_skip_context(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
// This macro is currently unused but may be used by certain implementations
#define MAXBAND_INDEX 21
-extern const uint8_t vp9_coefband_trans_8x8plus[1024];
-extern const uint8_t vp9_coefband_trans_4x4[16];
+DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_8x8plus[1024]);
+DECLARE_ALIGNED(16, extern const uint8_t, vp9_coefband_trans_4x4[16]);
-static const uint8_t *get_band_translate(TX_SIZE tx_size) {
+static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
return tx_size == TX_4X4 ? vp9_coefband_trans_4x4
: vp9_coefband_trans_8x8plus;
}
@@ -135,24 +127,26 @@ static const uint8_t *get_band_translate(TX_SIZE tx_size) {
// 1, 3, 5, 7, ..., 253, 255
// In between probabilities are interpolated linearly
-#define COEFPROB_MODELS 128
+#define COEFF_PROB_MODELS 256
#define UNCONSTRAINED_NODES 3
#define PIVOT_NODE 2 // which node is pivot
+#define MODEL_NODES (ENTROPY_NODES - UNCONSTRAINED_NODES)
+extern const vp9_prob vp9_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
+
typedef vp9_prob vp9_coeff_probs_model[REF_TYPES][COEF_BANDS]
- [PREV_COEF_CONTEXTS]
- [UNCONSTRAINED_NODES];
+ [COEFF_CONTEXTS][UNCONSTRAINED_NODES];
typedef unsigned int vp9_coeff_count_model[REF_TYPES][COEF_BANDS]
- [PREV_COEF_CONTEXTS]
+ [COEFF_CONTEXTS]
[UNCONSTRAINED_NODES + 1];
void vp9_model_to_full_probs(const vp9_prob *model, vp9_prob *full);
-static int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
- const ENTROPY_CONTEXT *l) {
+static INLINE int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
+ const ENTROPY_CONTEXT *l) {
ENTROPY_CONTEXT above_ec = 0, left_ec = 0;
switch (tx_size) {
@@ -173,32 +167,26 @@ static int get_entropy_context(TX_SIZE tx_size, const ENTROPY_CONTEXT *a,
left_ec = !!*(const uint64_t *)l;
break;
default:
- assert(!"Invalid transform size.");
+ assert(0 && "Invalid transform size.");
}
return combine_entropy_contexts(above_ec, left_ec);
}
-static void get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
- PLANE_TYPE type, int block_idx,
- const int16_t **scan, const int16_t **scan_nb) {
- switch (tx_size) {
- case TX_4X4:
- get_scan_nb_4x4(get_tx_type_4x4(type, xd, block_idx), scan, scan_nb);
- break;
- case TX_8X8:
- get_scan_nb_8x8(get_tx_type_8x8(type, xd), scan, scan_nb);
- break;
- case TX_16X16:
- get_scan_nb_16x16(get_tx_type_16x16(type, xd), scan, scan_nb);
- break;
- case TX_32X32:
- *scan = vp9_default_scan_32x32;
- *scan_nb = vp9_default_scan_32x32_neighbors;
- break;
- default:
- assert(!"Invalid transform size.");
+static const INLINE scan_order *get_scan(const MACROBLOCKD *xd, TX_SIZE tx_size,
+ PLANE_TYPE type, int block_idx) {
+ const MODE_INFO *const mi = xd->mi_8x8[0];
+
+ if (is_inter_block(&mi->mbmi) || type != PLANE_TYPE_Y || xd->lossless) {
+ return &vp9_default_scan_orders[tx_size];
+ } else {
+ const MB_PREDICTION_MODE mode = get_y_mode(mi, block_idx);
+ return &vp9_scan_orders[tx_size][intra_mode_to_tx_type_lookup[mode]];
}
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_ENTROPY_H_
diff --git a/libvpx/vp9/common/vp9_entropymode.c b/libvpx/vp9/common/vp9_entropymode.c
index 3b2510d..f2c81bc 100644
--- a/libvpx/vp9/common/vp9_entropymode.c
+++ b/libvpx/vp9/common/vp9_entropymode.c
@@ -10,7 +10,6 @@
#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_seg_common.h"
@@ -232,21 +231,18 @@ const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)] = {
-D63_PRED, 16, /* 7 = D63_NODE */
-D153_PRED, -D207_PRED /* 8 = D153_NODE */
};
-struct vp9_token vp9_intra_mode_encodings[INTRA_MODES];
const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)] = {
-INTER_OFFSET(ZEROMV), 2,
-INTER_OFFSET(NEARESTMV), 4,
-INTER_OFFSET(NEARMV), -INTER_OFFSET(NEWMV)
};
-struct vp9_token vp9_inter_mode_encodings[INTER_MODES];
const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)] = {
-PARTITION_NONE, 2,
-PARTITION_HORZ, 4,
-PARTITION_VERT, -PARTITION_SPLIT
};
-struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
static const vp9_prob default_intra_inter_p[INTRA_INTER_CONTEXTS] = {
9, 102, 187, 225
@@ -306,7 +302,7 @@ void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p,
ct_8x8p[0][1] = tx_count_8x8p[TX_8X8];
}
-static const vp9_prob default_mbskip_probs[MBSKIP_CONTEXTS] = {
+static const vp9_prob default_skip_probs[SKIP_CONTEXTS] = {
192, 128, 64
};
@@ -318,17 +314,18 @@ static const vp9_prob default_switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
{ 149, 144, },
};
-void vp9_init_mbmode_probs(VP9_COMMON *cm) {
- vp9_copy(cm->fc.uv_mode_prob, default_if_uv_probs);
- vp9_copy(cm->fc.y_mode_prob, default_if_y_probs);
- vp9_copy(cm->fc.switchable_interp_prob, default_switchable_interp_prob);
- vp9_copy(cm->fc.partition_prob, default_partition_probs);
- vp9_copy(cm->fc.intra_inter_prob, default_intra_inter_p);
- vp9_copy(cm->fc.comp_inter_prob, default_comp_inter_p);
- vp9_copy(cm->fc.comp_ref_prob, default_comp_ref_p);
- vp9_copy(cm->fc.single_ref_prob, default_single_ref_p);
- cm->fc.tx_probs = default_tx_probs;
- vp9_copy(cm->fc.mbskip_probs, default_mbskip_probs);
+void vp9_init_mode_probs(FRAME_CONTEXT *fc) {
+ vp9_copy(fc->uv_mode_prob, default_if_uv_probs);
+ vp9_copy(fc->y_mode_prob, default_if_y_probs);
+ vp9_copy(fc->switchable_interp_prob, default_switchable_interp_prob);
+ vp9_copy(fc->partition_prob, default_partition_probs);
+ vp9_copy(fc->intra_inter_prob, default_intra_inter_p);
+ vp9_copy(fc->comp_inter_prob, default_comp_inter_p);
+ vp9_copy(fc->comp_ref_prob, default_comp_ref_p);
+ vp9_copy(fc->single_ref_prob, default_single_ref_p);
+ fc->tx_probs = default_tx_probs;
+ vp9_copy(fc->skip_probs, default_skip_probs);
+ vp9_copy(fc->inter_mode_probs, default_inter_mode_probs);
}
const vp9_tree_index vp9_switchable_interp_tree
@@ -336,15 +333,6 @@ const vp9_tree_index vp9_switchable_interp_tree
-EIGHTTAP, 2,
-EIGHTTAP_SMOOTH, -EIGHTTAP_SHARP
};
-struct vp9_token vp9_switchable_interp_encodings[SWITCHABLE_FILTERS];
-
-void vp9_entropy_mode_init() {
- vp9_tokens_from_tree(vp9_intra_mode_encodings, vp9_intra_mode_tree);
- vp9_tokens_from_tree(vp9_switchable_interp_encodings,
- vp9_switchable_interp_tree);
- vp9_tokens_from_tree(vp9_partition_encodings, vp9_partition_tree);
- vp9_tokens_from_tree(vp9_inter_mode_encodings, vp9_inter_mode_tree);
-}
#define COUNT_SAT 20
#define MAX_UPDATE_FACTOR 128
@@ -356,7 +344,7 @@ static int adapt_prob(vp9_prob pre_prob, const unsigned int ct[2]) {
static void adapt_probs(const vp9_tree_index *tree,
const vp9_prob *pre_probs, const unsigned int *counts,
vp9_prob *probs) {
- tree_merge_probs(tree, pre_probs, counts, COUNT_SAT, MAX_UPDATE_FACTOR,
+ vp9_tree_merge_probs(tree, pre_probs, counts, COUNT_SAT, MAX_UPDATE_FACTOR,
probs);
}
@@ -396,7 +384,7 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
adapt_probs(vp9_partition_tree, pre_fc->partition_prob[i],
counts->partition[i], fc->partition_prob[i]);
- if (cm->mcomp_filter_type == SWITCHABLE) {
+ if (cm->interp_filter == SWITCHABLE) {
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
adapt_probs(vp9_switchable_interp_tree, pre_fc->switchable_interp_prob[i],
counts->switchable_interp[i], fc->switchable_interp_prob[i]);
@@ -426,9 +414,8 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
}
}
- for (i = 0; i < MBSKIP_CONTEXTS; ++i)
- fc->mbskip_probs[i] = adapt_prob(pre_fc->mbskip_probs[i],
- counts->mbskip[i]);
+ for (i = 0; i < SKIP_CONTEXTS; ++i)
+ fc->skip_probs[i] = adapt_prob(pre_fc->skip_probs[i], counts->skip[i]);
}
static void set_default_lf_deltas(struct loopfilter *lf) {
@@ -464,28 +451,26 @@ void vp9_setup_past_independence(VP9_COMMON *cm) {
lf->last_sharpness_level = -1;
vp9_default_coef_probs(cm);
- vp9_init_mbmode_probs(cm);
+ vp9_init_mode_probs(&cm->fc);
vp9_init_mv_probs(cm);
- vp9_copy(cm->fc.inter_mode_probs, default_inter_mode_probs);
if (cm->frame_type == KEY_FRAME ||
cm->error_resilient_mode || cm->reset_frame_context == 3) {
// Reset all frame contexts.
- for (i = 0; i < NUM_FRAME_CONTEXTS; ++i)
+ for (i = 0; i < FRAME_CONTEXTS; ++i)
cm->frame_contexts[i] = cm->fc;
} else if (cm->reset_frame_context == 2) {
// Reset only the frame context specified in the frame header.
cm->frame_contexts[cm->frame_context_idx] = cm->fc;
}
- vpx_memset(cm->prev_mip, 0,
- cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
+ if (frame_is_intra_only(cm))
+ vpx_memset(cm->prev_mip, 0,
+ cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
+
vpx_memset(cm->mip, 0,
cm->mode_info_stride * (cm->mi_rows + 1) * sizeof(MODE_INFO));
- vp9_update_mode_info_border(cm, cm->mip);
- vp9_update_mode_info_border(cm, cm->prev_mip);
-
vp9_zero(cm->ref_frame_sign_bias);
cm->frame_context_idx = 0;
diff --git a/libvpx/vp9/common/vp9_entropymode.h b/libvpx/vp9/common/vp9_entropymode.h
index 38b4199..c7b1911 100644
--- a/libvpx/vp9/common/vp9_entropymode.h
+++ b/libvpx/vp9/common/vp9_entropymode.h
@@ -12,14 +12,17 @@
#define VP9_COMMON_VP9_ENTROPYMODE_H_
#include "vp9/common/vp9_blockd.h"
-#include "vp9/common/vp9_treecoder.h"
+#include "vp9/common/vp9_entropy.h"
+#include "vp9/common/vp9_entropymv.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define TX_SIZE_CONTEXTS 2
#define SWITCHABLE_FILTERS 3 // number of switchable filters
#define SWITCHABLE_FILTER_CONTEXTS (SWITCHABLE_FILTERS + 1)
-// #define MODE_STATS
-
struct VP9Common;
struct tx_probs {
@@ -34,31 +37,56 @@ struct tx_counts {
unsigned int p8x8[TX_SIZE_CONTEXTS][TX_SIZES - 2];
};
+typedef struct frame_contexts {
+ vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
+ vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
+ vp9_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
+ vp9_coeff_probs_model coef_probs[TX_SIZES][PLANE_TYPES];
+ vp9_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
+ [SWITCHABLE_FILTERS - 1];
+ vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
+ vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
+ vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS];
+ vp9_prob single_ref_prob[REF_CONTEXTS][2];
+ vp9_prob comp_ref_prob[REF_CONTEXTS];
+ struct tx_probs tx_probs;
+ vp9_prob skip_probs[SKIP_CONTEXTS];
+ nmv_context nmvc;
+} FRAME_CONTEXT;
+
+typedef struct {
+ unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
+ unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
+ unsigned int partition[PARTITION_CONTEXTS][PARTITION_TYPES];
+ vp9_coeff_count_model coef[TX_SIZES][PLANE_TYPES];
+ unsigned int eob_branch[TX_SIZES][PLANE_TYPES][REF_TYPES]
+ [COEF_BANDS][COEFF_CONTEXTS];
+ unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS]
+ [SWITCHABLE_FILTERS];
+ unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
+ unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
+ unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
+ unsigned int single_ref[REF_CONTEXTS][2][2];
+ unsigned int comp_ref[REF_CONTEXTS][2];
+ struct tx_counts tx;
+ unsigned int skip[SKIP_CONTEXTS][2];
+ nmv_context_counts mv;
+} FRAME_COUNTS;
+
extern const vp9_prob vp9_kf_uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
extern const vp9_prob vp9_kf_y_mode_prob[INTRA_MODES][INTRA_MODES]
[INTRA_MODES - 1];
-
extern const vp9_prob vp9_kf_partition_probs[PARTITION_CONTEXTS]
[PARTITION_TYPES - 1];
-
extern const vp9_tree_index vp9_intra_mode_tree[TREE_SIZE(INTRA_MODES)];
-extern struct vp9_token vp9_intra_mode_encodings[INTRA_MODES];
-
extern const vp9_tree_index vp9_inter_mode_tree[TREE_SIZE(INTER_MODES)];
-extern struct vp9_token vp9_inter_mode_encodings[INTER_MODES];
-
extern const vp9_tree_index vp9_partition_tree[TREE_SIZE(PARTITION_TYPES)];
-extern struct vp9_token vp9_partition_encodings[PARTITION_TYPES];
-
extern const vp9_tree_index vp9_switchable_interp_tree
[TREE_SIZE(SWITCHABLE_FILTERS)];
-extern struct vp9_token vp9_switchable_interp_encodings[SWITCHABLE_FILTERS];
-
-void vp9_entropy_mode_init();
void vp9_setup_past_independence(struct VP9Common *cm);
-void vp9_init_mbmode_probs(struct VP9Common *cm);
+void vp9_init_mode_probs(FRAME_CONTEXT *fc);
void vp9_adapt_mode_probs(struct VP9Common *cm);
@@ -69,4 +97,17 @@ void tx_counts_to_branch_counts_16x16(const unsigned int *tx_count_16x16p,
void tx_counts_to_branch_counts_8x8(const unsigned int *tx_count_8x8p,
unsigned int (*ct_8x8p)[2]);
+static INLINE const vp9_prob *get_y_mode_probs(const MODE_INFO *mi,
+ const MODE_INFO *above_mi,
+ const MODE_INFO *left_mi,
+ int block) {
+ const MB_PREDICTION_MODE above = vp9_above_block_mode(mi, above_mi, block);
+ const MB_PREDICTION_MODE left = vp9_left_block_mode(mi, left_mi, block);
+ return vp9_kf_y_mode_prob[above][left];
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_ENTROPYMODE_H_
diff --git a/libvpx/vp9/common/vp9_entropymv.c b/libvpx/vp9/common/vp9_entropymv.c
index 290dcdd..197b7c0 100644
--- a/libvpx/vp9/common/vp9_entropymv.c
+++ b/libvpx/vp9/common/vp9_entropymv.c
@@ -23,7 +23,6 @@ const vp9_tree_index vp9_mv_joint_tree[TREE_SIZE(MV_JOINTS)] = {
-MV_JOINT_HNZVZ, 4,
-MV_JOINT_HZVNZ, -MV_JOINT_HNZVNZ
};
-struct vp9_token vp9_mv_joint_encodings[MV_JOINTS];
const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = {
-MV_CLASS_0, 2,
@@ -37,19 +36,16 @@ const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)] = {
-MV_CLASS_7, -MV_CLASS_8,
-MV_CLASS_9, -MV_CLASS_10,
};
-struct vp9_token vp9_mv_class_encodings[MV_CLASSES];
const vp9_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)] = {
-0, -1,
};
-struct vp9_token vp9_mv_class0_encodings[CLASS0_SIZE];
-const vp9_tree_index vp9_mv_fp_tree[TREE_SIZE(4)] = {
+const vp9_tree_index vp9_mv_fp_tree[TREE_SIZE(MV_FP_SIZE)] = {
-0, 2,
-1, 4,
-2, -3
};
-struct vp9_token vp9_mv_fp_encodings[4];
static const nmv_context default_nmv_context = {
{32, 64, 96},
@@ -126,12 +122,8 @@ static const uint8_t log_in_base_2[] = {
};
MV_CLASS_TYPE vp9_get_mv_class(int z, int *offset) {
- MV_CLASS_TYPE c = MV_CLASS_0;
- if (z >= CLASS0_SIZE * 4096)
- c = MV_CLASS_10;
- else
- c = log_in_base_2[z >> 3];
-
+ const MV_CLASS_TYPE c = (z >= CLASS0_SIZE * 4096) ? MV_CLASS_10 :
+ (MV_CLASS_TYPE)log_in_base_2[z >> 3];
if (offset)
*offset = z - mv_class_base(c);
return c;
@@ -196,8 +188,8 @@ static vp9_prob adapt_prob(vp9_prob prep, const unsigned int ct[2]) {
static void adapt_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs,
const unsigned int *counts, vp9_prob *probs) {
- tree_merge_probs(tree, pre_probs, counts, MV_COUNT_SAT, MV_MAX_UPDATE_FACTOR,
- probs);
+ vp9_tree_merge_probs(tree, pre_probs, counts, MV_COUNT_SAT,
+ MV_MAX_UPDATE_FACTOR, probs);
}
void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
@@ -235,13 +227,6 @@ void vp9_adapt_mv_probs(VP9_COMMON *cm, int allow_hp) {
}
}
-void vp9_entropy_mv_init() {
- vp9_tokens_from_tree(vp9_mv_joint_encodings, vp9_mv_joint_tree);
- vp9_tokens_from_tree(vp9_mv_class_encodings, vp9_mv_class_tree);
- vp9_tokens_from_tree(vp9_mv_class0_encodings, vp9_mv_class0_tree);
- vp9_tokens_from_tree(vp9_mv_fp_encodings, vp9_mv_fp_tree);
-}
-
void vp9_init_mv_probs(VP9_COMMON *cm) {
cm->fc.nmvc = default_nmv_context;
}
diff --git a/libvpx/vp9/common/vp9_entropymv.h b/libvpx/vp9/common/vp9_entropymv.h
index d843f5b..e7033e4 100644
--- a/libvpx/vp9/common/vp9_entropymv.h
+++ b/libvpx/vp9/common/vp9_entropymv.h
@@ -12,19 +12,21 @@
#ifndef VP9_COMMON_VP9_ENTROPYMV_H_
#define VP9_COMMON_VP9_ENTROPYMV_H_
-#include "vp9/common/vp9_treecoder.h"
#include "./vpx_config.h"
#include "vp9/common/vp9_blockd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct VP9Common;
-void vp9_entropy_mv_init();
void vp9_init_mv_probs(struct VP9Common *cm);
void vp9_adapt_mv_probs(struct VP9Common *cm, int usehp);
int vp9_use_mv_hp(const MV *ref);
-#define NMV_UPDATE_PROB 252
+#define MV_UPDATE_PROB 252
/* Symbols for coding which components are zero jointly */
#define MV_JOINTS 4
@@ -62,6 +64,7 @@ typedef enum {
#define CLASS0_BITS 1 /* bits at integer precision for class 0 */
#define CLASS0_SIZE (1 << CLASS0_BITS)
#define MV_OFFSET_BITS (MV_CLASSES + CLASS0_BITS - 2)
+#define MV_FP_SIZE 4
#define MV_MAX_BITS (MV_CLASSES + CLASS0_BITS + 2)
#define MV_MAX ((1 << MV_MAX_BITS) - 1)
@@ -71,25 +74,18 @@ typedef enum {
#define MV_UPP ((1 << MV_IN_USE_BITS) - 1)
#define MV_LOW (-(1 << MV_IN_USE_BITS))
-extern const vp9_tree_index vp9_mv_joint_tree[TREE_SIZE(MV_JOINTS)];
-extern struct vp9_token vp9_mv_joint_encodings[MV_JOINTS];
-
-extern const vp9_tree_index vp9_mv_class_tree[TREE_SIZE(MV_CLASSES)];
-extern struct vp9_token vp9_mv_class_encodings[MV_CLASSES];
-
-extern const vp9_tree_index vp9_mv_class0_tree[TREE_SIZE(CLASS0_SIZE)];
-extern struct vp9_token vp9_mv_class0_encodings[CLASS0_SIZE];
-
-extern const vp9_tree_index vp9_mv_fp_tree[TREE_SIZE(4)];
-extern struct vp9_token vp9_mv_fp_encodings[4];
+extern const vp9_tree_index vp9_mv_joint_tree[];
+extern const vp9_tree_index vp9_mv_class_tree[];
+extern const vp9_tree_index vp9_mv_class0_tree[];
+extern const vp9_tree_index vp9_mv_fp_tree[];
typedef struct {
vp9_prob sign;
vp9_prob classes[MV_CLASSES - 1];
vp9_prob class0[CLASS0_SIZE - 1];
vp9_prob bits[MV_OFFSET_BITS];
- vp9_prob class0_fp[CLASS0_SIZE][4 - 1];
- vp9_prob fp[4 - 1];
+ vp9_prob class0_fp[CLASS0_SIZE][MV_FP_SIZE - 1];
+ vp9_prob fp[MV_FP_SIZE - 1];
vp9_prob class0_hp;
vp9_prob hp;
} nmv_component;
@@ -116,8 +112,8 @@ typedef struct {
unsigned int classes[MV_CLASSES];
unsigned int class0[CLASS0_SIZE];
unsigned int bits[MV_OFFSET_BITS][2];
- unsigned int class0_fp[CLASS0_SIZE][4];
- unsigned int fp[4];
+ unsigned int class0_fp[CLASS0_SIZE][MV_FP_SIZE];
+ unsigned int fp[MV_FP_SIZE];
unsigned int class0_hp[2];
unsigned int hp[2];
} nmv_component_counts;
@@ -129,4 +125,8 @@ typedef struct {
void vp9_inc_mv(const MV *mv, nmv_context_counts *mvctx);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_ENTROPYMV_H_
diff --git a/libvpx/vp9/common/vp9_enums.h b/libvpx/vp9/common/vp9_enums.h
index 1651b90..e96e769 100644
--- a/libvpx/vp9/common/vp9_enums.h
+++ b/libvpx/vp9/common/vp9_enums.h
@@ -13,6 +13,10 @@
#include "./vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MI_SIZE_LOG2 3
#define MI_BLOCK_SIZE_LOG2 (6 - MI_SIZE_LOG2) // 64 = 2^6
@@ -52,20 +56,22 @@ typedef enum PARTITION_TYPE {
#define PARTITION_PLOFFSET 4 // number of probability models per block size
#define PARTITION_CONTEXTS (4 * PARTITION_PLOFFSET)
+// block transform size
typedef enum {
- TX_4X4 = 0, // 4x4 dct transform
- TX_8X8 = 1, // 8x8 dct transform
- TX_16X16 = 2, // 16x16 dct transform
- TX_32X32 = 3, // 32x32 dct transform
+ TX_4X4 = 0, // 4x4 transform
+ TX_8X8 = 1, // 8x8 transform
+ TX_16X16 = 2, // 16x16 transform
+ TX_32X32 = 3, // 32x32 transform
TX_SIZES
} TX_SIZE;
+// frame transform mode
typedef enum {
- ONLY_4X4 = 0,
- ALLOW_8X8 = 1,
- ALLOW_16X16 = 2,
- ALLOW_32X32 = 3,
- TX_MODE_SELECT = 4,
+ ONLY_4X4 = 0, // only 4x4 transform used
+ ALLOW_8X8 = 1, // allow block transform size up to 8x8
+ ALLOW_16X16 = 2, // allow block transform size up to 16x16
+ ALLOW_32X32 = 3, // allow block transform size up to 32x32
+ TX_MODE_SELECT = 4, // transform specified for each block
TX_MODES = 5,
} TX_MODE;
@@ -73,7 +79,8 @@ typedef enum {
DCT_DCT = 0, // DCT in both horizontal and vertical
ADST_DCT = 1, // ADST in vertical, DCT in horizontal
DCT_ADST = 2, // DCT in vertical, ADST in horizontal
- ADST_ADST = 3 // ADST in both directions
+ ADST_ADST = 3, // ADST in both directions
+ TX_TYPES = 4
} TX_TYPE;
typedef enum {
@@ -87,4 +94,8 @@ typedef enum {
SRGB = 7 // RGB
} COLOR_SPACE;
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_ENUMS_H_
diff --git a/libvpx/vp9/common/vp9_filter.c b/libvpx/vp9/common/vp9_filter.c
index 79ace14..7474a88 100644
--- a/libvpx/vp9/common/vp9_filter.c
+++ b/libvpx/vp9/common/vp9_filter.c
@@ -10,12 +10,9 @@
#include <assert.h>
-#include "vpx_ports/mem.h"
-
#include "vp9/common/vp9_filter.h"
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_bilinear_filters[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_bilinear_filters[SUBPEL_SHIFTS] = {
{ 0, 0, 0, 128, 0, 0, 0, 0 },
{ 0, 0, 0, 120, 8, 0, 0, 0 },
{ 0, 0, 0, 112, 16, 0, 0, 0 },
@@ -35,8 +32,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
// Lagrangian interpolation filter
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_sub_pel_filters_8[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS] = {
{ 0, 0, 0, 128, 0, 0, 0, 0},
{ 0, 1, -5, 126, 8, -3, 1, 0},
{ -1, 3, -10, 122, 18, -6, 2, 0},
@@ -56,8 +52,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
// DCT based filter
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS] = {
{0, 0, 0, 128, 0, 0, 0, 0},
{-1, 3, -7, 127, 8, -3, 1, 0},
{-2, 5, -13, 125, 17, -6, 3, -1},
@@ -77,8 +72,7 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
// freqmultiplier = 0.5
-DECLARE_ALIGNED(256, const subpel_kernel,
- vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]) = {
+const InterpKernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS] = {
{ 0, 0, 0, 128, 0, 0, 0, 0},
{-3, -1, 32, 64, 38, 1, -3, 0},
{-2, -2, 29, 63, 41, 2, -3, 0},
@@ -98,14 +92,15 @@ DECLARE_ALIGNED(256, const subpel_kernel,
};
-static const subpel_kernel* vp9_filter_kernels[4] = {
+static const InterpKernel* vp9_filter_kernels[4] = {
vp9_sub_pel_filters_8,
vp9_sub_pel_filters_8lp,
vp9_sub_pel_filters_8s,
vp9_bilinear_filters
};
-const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type) {
- return vp9_filter_kernels[type];
+const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter) {
+ assert(filter != SWITCHABLE);
+ return vp9_filter_kernels[filter];
}
diff --git a/libvpx/vp9/common/vp9_filter.h b/libvpx/vp9/common/vp9_filter.h
index b1e7e64..29d3867 100644
--- a/libvpx/vp9/common/vp9_filter.h
+++ b/libvpx/vp9/common/vp9_filter.h
@@ -13,6 +13,12 @@
#include "./vpx_config.h"
#include "vpx/vpx_integer.h"
+#include "vpx_ports/mem.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define FILTER_BITS 7
@@ -27,25 +33,28 @@ typedef enum {
EIGHTTAP_SHARP = 2,
BILINEAR = 3,
SWITCHABLE = 4 /* should be the last one */
-} INTERPOLATION_TYPE;
+} INTERP_FILTER;
-typedef int16_t subpel_kernel[SUBPEL_TAPS];
+typedef int16_t InterpKernel[SUBPEL_TAPS];
-struct subpix_fn_table {
- const subpel_kernel *filter_x;
- const subpel_kernel *filter_y;
-};
+const InterpKernel *vp9_get_interp_kernel(INTERP_FILTER filter);
-const subpel_kernel *vp9_get_filter_kernel(INTERPOLATION_TYPE type);
-
-extern const subpel_kernel vp9_bilinear_filters[SUBPEL_SHIFTS];
-extern const subpel_kernel vp9_sub_pel_filters_8[SUBPEL_SHIFTS];
-extern const subpel_kernel vp9_sub_pel_filters_8s[SUBPEL_SHIFTS];
-extern const subpel_kernel vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS];
+DECLARE_ALIGNED(256, extern const InterpKernel,
+ vp9_bilinear_filters[SUBPEL_SHIFTS]);
+DECLARE_ALIGNED(256, extern const InterpKernel,
+ vp9_sub_pel_filters_8[SUBPEL_SHIFTS]);
+DECLARE_ALIGNED(256, extern const InterpKernel,
+ vp9_sub_pel_filters_8s[SUBPEL_SHIFTS]);
+DECLARE_ALIGNED(256, extern const InterpKernel,
+ vp9_sub_pel_filters_8lp[SUBPEL_SHIFTS]);
// The VP9_BILINEAR_FILTERS_2TAP macro returns a pointer to the bilinear
// filter kernel as a 2 tap filter.
#define BILINEAR_FILTERS_2TAP(x) \
(vp9_bilinear_filters[(x)] + SUBPEL_TAPS/2 - 1)
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_FILTER_H_
diff --git a/libvpx/vp9/common/vp9_findnearmv.c b/libvpx/vp9/common/vp9_findnearmv.c
deleted file mode 100644
index b91c501..0000000
--- a/libvpx/vp9/common/vp9_findnearmv.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "vp9/common/vp9_findnearmv.h"
-#include "vp9/common/vp9_mvref_common.h"
-
-static void lower_mv_precision(MV *mv, int allow_hp) {
- const int use_hp = allow_hp && vp9_use_mv_hp(mv);
- if (!use_hp) {
- if (mv->row & 1)
- mv->row += (mv->row > 0 ? -1 : 1);
- if (mv->col & 1)
- mv->col += (mv->col > 0 ? -1 : 1);
- }
-}
-
-
-void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
- int_mv *mvlist, int_mv *nearest, int_mv *near) {
- int i;
- // Make sure all the candidates are properly clamped etc
- for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
- lower_mv_precision(&mvlist[i].as_mv, allow_hp);
- clamp_mv2(&mvlist[i].as_mv, xd);
- }
- *nearest = mvlist[0];
- *near = mvlist[1];
-}
-
-void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
- const TileInfo *const tile,
- int_mv *dst_nearest,
- int_mv *dst_near,
- int block_idx, int ref_idx,
- int mi_row, int mi_col) {
- int_mv dst_list[MAX_MV_REF_CANDIDATES];
- int_mv mv_list[MAX_MV_REF_CANDIDATES];
- MODE_INFO *const mi = xd->mi_8x8[0];
-
- assert(ref_idx == 0 || ref_idx == 1);
- assert(MAX_MV_REF_CANDIDATES == 2); // makes code here slightly easier
-
- vp9_find_mv_refs_idx(cm, xd, tile, mi, xd->last_mi,
- mi->mbmi.ref_frame[ref_idx],
- mv_list, block_idx, mi_row, mi_col);
-
- dst_list[1].as_int = 0;
- if (block_idx == 0) {
- vpx_memcpy(dst_list, mv_list, MAX_MV_REF_CANDIDATES * sizeof(int_mv));
- } else if (block_idx == 1 || block_idx == 2) {
- int dst = 0, n;
- b_mode_info *bmi = mi->bmi;
-
- dst_list[dst++].as_int = bmi[0].as_mv[ref_idx].as_int;
- for (n = 0; dst < MAX_MV_REF_CANDIDATES &&
- n < MAX_MV_REF_CANDIDATES; n++)
- if (mv_list[n].as_int != dst_list[0].as_int)
- dst_list[dst++].as_int = mv_list[n].as_int;
- } else {
- int dst = 0, n;
- b_mode_info *bmi = mi->bmi;
-
- assert(block_idx == 3);
- dst_list[dst++].as_int = bmi[2].as_mv[ref_idx].as_int;
- if (dst_list[0].as_int != bmi[1].as_mv[ref_idx].as_int)
- dst_list[dst++].as_int = bmi[1].as_mv[ref_idx].as_int;
- if (dst < MAX_MV_REF_CANDIDATES &&
- dst_list[0].as_int != bmi[0].as_mv[ref_idx].as_int)
- dst_list[dst++].as_int = bmi[0].as_mv[ref_idx].as_int;
- for (n = 0; dst < MAX_MV_REF_CANDIDATES &&
- n < MAX_MV_REF_CANDIDATES; n++)
- if (mv_list[n].as_int != dst_list[0].as_int)
- dst_list[dst++].as_int = mv_list[n].as_int;
- }
-
- dst_nearest->as_int = dst_list[0].as_int;
- dst_near->as_int = dst_list[1].as_int;
-}
diff --git a/libvpx/vp9/common/vp9_findnearmv.h b/libvpx/vp9/common/vp9_findnearmv.h
deleted file mode 100644
index 2362caa..0000000
--- a/libvpx/vp9/common/vp9_findnearmv.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef VP9_COMMON_VP9_FINDNEARMV_H_
-#define VP9_COMMON_VP9_FINDNEARMV_H_
-
-#include "vp9/common/vp9_mv.h"
-#include "vp9/common/vp9_blockd.h"
-#include "vp9/common/vp9_treecoder.h"
-#include "vp9/common/vp9_onyxc_int.h"
-
-#define LEFT_TOP_MARGIN ((VP9BORDERINPIXELS - VP9_INTERP_EXTEND) << 3)
-#define RIGHT_BOTTOM_MARGIN ((VP9BORDERINPIXELS - VP9_INTERP_EXTEND) << 3)
-
-// check a list of motion vectors by sad score using a number rows of pixels
-// above and a number cols of pixels in the left to select the one with best
-// score to use as ref motion vector
-void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
- int_mv *mvlist, int_mv *nearest, int_mv *near);
-
-// TODO(jingning): this mv clamping function should be block size dependent.
-static void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
- clamp_mv(mv, xd->mb_to_left_edge - LEFT_TOP_MARGIN,
- xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN,
- xd->mb_to_top_edge - LEFT_TOP_MARGIN,
- xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN);
-}
-
-void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
- const TileInfo *const tile,
- int_mv *dst_nearest,
- int_mv *dst_near,
- int block_idx, int ref_idx,
- int mi_row, int mi_col);
-
-static MB_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mi,
- const MODE_INFO *left_mi, int b) {
- if (b == 0 || b == 2) {
- if (!left_mi || is_inter_block(&left_mi->mbmi))
- return DC_PRED;
-
- return left_mi->mbmi.sb_type < BLOCK_8X8 ? left_mi->bmi[b + 1].as_mode
- : left_mi->mbmi.mode;
- } else {
- assert(b == 1 || b == 3);
- return cur_mi->bmi[b - 1].as_mode;
- }
-}
-
-static MB_PREDICTION_MODE above_block_mode(const MODE_INFO *cur_mi,
- const MODE_INFO *above_mi, int b) {
- if (b == 0 || b == 1) {
- if (!above_mi || is_inter_block(&above_mi->mbmi))
- return DC_PRED;
-
- return above_mi->mbmi.sb_type < BLOCK_8X8 ? above_mi->bmi[b + 2].as_mode
- : above_mi->mbmi.mode;
- } else {
- assert(b == 2 || b == 3);
- return cur_mi->bmi[b - 2].as_mode;
- }
-}
-
-#endif // VP9_COMMON_VP9_FINDNEARMV_H_
diff --git a/libvpx/vp9/common/vp9_frame_buffers.c b/libvpx/vp9/common/vp9_frame_buffers.c
new file mode 100644
index 0000000..a0b1e03
--- /dev/null
+++ b/libvpx/vp9/common/vp9_frame_buffers.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <assert.h>
+
+#include "vp9/common/vp9_frame_buffers.h"
+#include "vpx_mem/vpx_mem.h"
+
+int vp9_alloc_internal_frame_buffers(InternalFrameBufferList *list) {
+ assert(list != NULL);
+ vp9_free_internal_frame_buffers(list);
+
+ list->num_internal_frame_buffers =
+ VP9_MAXIMUM_REF_BUFFERS + VPX_MAXIMUM_WORK_BUFFERS;
+ list->int_fb =
+ (InternalFrameBuffer *)vpx_calloc(list->num_internal_frame_buffers,
+ sizeof(*list->int_fb));
+ return (list->int_fb == NULL);
+}
+
+void vp9_free_internal_frame_buffers(InternalFrameBufferList *list) {
+ int i;
+
+ assert(list != NULL);
+
+ for (i = 0; i < list->num_internal_frame_buffers; ++i) {
+ vpx_free(list->int_fb[i].data);
+ list->int_fb[i].data = NULL;
+ }
+ vpx_free(list->int_fb);
+ list->int_fb = NULL;
+}
+
+int vp9_get_frame_buffer(void *cb_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb) {
+ int i;
+ InternalFrameBufferList *const int_fb_list =
+ (InternalFrameBufferList *)cb_priv;
+ if (int_fb_list == NULL)
+ return -1;
+
+ // Find a free frame buffer.
+ for (i = 0; i < int_fb_list->num_internal_frame_buffers; ++i) {
+ if (!int_fb_list->int_fb[i].in_use)
+ break;
+ }
+
+ if (i == int_fb_list->num_internal_frame_buffers)
+ return -1;
+
+ if (int_fb_list->int_fb[i].size < min_size) {
+ int_fb_list->int_fb[i].data =
+ (uint8_t *)vpx_realloc(int_fb_list->int_fb[i].data, min_size);
+ if (!int_fb_list->int_fb[i].data)
+ return -1;
+
+ int_fb_list->int_fb[i].size = min_size;
+ }
+
+ fb->data = int_fb_list->int_fb[i].data;
+ fb->size = int_fb_list->int_fb[i].size;
+ int_fb_list->int_fb[i].in_use = 1;
+
+ // Set the frame buffer's private data to point at the internal frame buffer.
+ fb->priv = &int_fb_list->int_fb[i];
+ return 0;
+}
+
+int vp9_release_frame_buffer(void *cb_priv, vpx_codec_frame_buffer_t *fb) {
+ InternalFrameBuffer *const int_fb = (InternalFrameBuffer *)fb->priv;
+ (void)cb_priv;
+ int_fb->in_use = 0;
+ return 0;
+}
diff --git a/libvpx/vp9/common/vp9_frame_buffers.h b/libvpx/vp9/common/vp9_frame_buffers.h
new file mode 100644
index 0000000..e2cfe61
--- /dev/null
+++ b/libvpx/vp9/common/vp9_frame_buffers.h
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_COMMON_VP9_FRAME_BUFFERS_H_
+#define VP9_COMMON_VP9_FRAME_BUFFERS_H_
+
+#include "vpx/vpx_frame_buffer.h"
+#include "vpx/vpx_integer.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct InternalFrameBuffer {
+ uint8_t *data;
+ size_t size;
+ int in_use;
+} InternalFrameBuffer;
+
+typedef struct InternalFrameBufferList {
+ int num_internal_frame_buffers;
+ InternalFrameBuffer *int_fb;
+} InternalFrameBufferList;
+
+// Initializes |list|. Returns 0 on success.
+int vp9_alloc_internal_frame_buffers(InternalFrameBufferList *list);
+
+// Free any data allocated to the frame buffers.
+void vp9_free_internal_frame_buffers(InternalFrameBufferList *list);
+
+// Callback used by libvpx to request an external frame buffer. |cb_priv|
+// Callback private data, which points to an InternalFrameBufferList.
+// |min_size| is the minimum size in bytes needed to decode the next frame.
+// |fb| pointer to the frame buffer.
+int vp9_get_frame_buffer(void *cb_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb);
+
+// Callback used by libvpx when there are no references to the frame buffer.
+// |cb_priv| is not used. |fb| pointer to the frame buffer.
+int vp9_release_frame_buffer(void *cb_priv, vpx_codec_frame_buffer_t *fb);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_COMMON_VP9_FRAME_BUFFERS_H_
diff --git a/libvpx/vp9/common/vp9_idct.c b/libvpx/vp9/common/vp9_idct.c
index ea8683e..20b78bf 100644
--- a/libvpx/vp9/common/vp9_idct.c
+++ b/libvpx/vp9/common/vp9_idct.c
@@ -96,7 +96,7 @@ void vp9_iwht4x4_1_add_c(const int16_t *in, uint8_t *dest, int dest_stride) {
}
}
-static void idct4_1d(const int16_t *input, int16_t *output) {
+static void idct4(const int16_t *input, int16_t *output) {
int16_t step[4];
int temp1, temp2;
// stage 1
@@ -124,7 +124,7 @@ void vp9_idct4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride) {
// Rows
for (i = 0; i < 4; ++i) {
- idct4_1d(input, outptr);
+ idct4(input, outptr);
input += 4;
outptr += 4;
}
@@ -133,7 +133,7 @@ void vp9_idct4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 4; ++i) {
for (j = 0; j < 4; ++j)
temp_in[j] = out[j * 4 + i];
- idct4_1d(temp_in, temp_out);
+ idct4(temp_in, temp_out);
for (j = 0; j < 4; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 4)
+ dest[j * stride + i]);
@@ -156,7 +156,7 @@ void vp9_idct4x4_1_add_c(const int16_t *input, uint8_t *dest, int dest_stride) {
}
}
-static void idct8_1d(const int16_t *input, int16_t *output) {
+static void idct8(const int16_t *input, int16_t *output) {
int16_t step1[8], step2[8];
int temp1, temp2;
// stage 1
@@ -174,7 +174,7 @@ static void idct8_1d(const int16_t *input, int16_t *output) {
step1[6] = dct_const_round_shift(temp2);
// stage 2 & stage 3 - even half
- idct4_1d(step1, step1);
+ idct4(step1, step1);
// stage 2 - odd half
step2[4] = step1[4] + step1[5];
@@ -209,7 +209,7 @@ void vp9_idct8x8_64_add_c(const int16_t *input, uint8_t *dest, int stride) {
// First transform rows
for (i = 0; i < 8; ++i) {
- idct8_1d(input, outptr);
+ idct8(input, outptr);
input += 8;
outptr += 8;
}
@@ -218,7 +218,7 @@ void vp9_idct8x8_64_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 8; ++i) {
for (j = 0; j < 8; ++j)
temp_in[j] = out[j * 8 + i];
- idct8_1d(temp_in, temp_out);
+ idct8(temp_in, temp_out);
for (j = 0; j < 8; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5)
+ dest[j * stride + i]);
@@ -238,7 +238,7 @@ void vp9_idct8x8_1_add_c(const int16_t *input, uint8_t *dest, int stride) {
}
}
-static void iadst4_1d(const int16_t *input, int16_t *output) {
+static void iadst4(const int16_t *input, int16_t *output) {
int s0, s1, s2, s3, s4, s5, s6, s7;
int x0 = input[0];
@@ -283,10 +283,10 @@ static void iadst4_1d(const int16_t *input, int16_t *output) {
void vp9_iht4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride,
int tx_type) {
const transform_2d IHT_4[] = {
- { idct4_1d, idct4_1d }, // DCT_DCT = 0
- { iadst4_1d, idct4_1d }, // ADST_DCT = 1
- { idct4_1d, iadst4_1d }, // DCT_ADST = 2
- { iadst4_1d, iadst4_1d } // ADST_ADST = 3
+ { idct4, idct4 }, // DCT_DCT = 0
+ { iadst4, idct4 }, // ADST_DCT = 1
+ { idct4, iadst4 }, // DCT_ADST = 2
+ { iadst4, iadst4 } // ADST_ADST = 3
};
int i, j;
@@ -311,7 +311,7 @@ void vp9_iht4x4_16_add_c(const int16_t *input, uint8_t *dest, int stride,
+ dest[j * stride + i]);
}
}
-static void iadst8_1d(const int16_t *input, int16_t *output) {
+static void iadst8(const int16_t *input, int16_t *output) {
int s0, s1, s2, s3, s4, s5, s6, s7;
int x0 = input[7];
@@ -389,10 +389,10 @@ static void iadst8_1d(const int16_t *input, int16_t *output) {
}
static const transform_2d IHT_8[] = {
- { idct8_1d, idct8_1d }, // DCT_DCT = 0
- { iadst8_1d, idct8_1d }, // ADST_DCT = 1
- { idct8_1d, iadst8_1d }, // DCT_ADST = 2
- { iadst8_1d, iadst8_1d } // ADST_ADST = 3
+ { idct8, idct8 }, // DCT_DCT = 0
+ { iadst8, idct8 }, // ADST_DCT = 1
+ { idct8, iadst8 }, // DCT_ADST = 2
+ { iadst8, iadst8 } // ADST_ADST = 3
};
void vp9_iht8x8_64_add_c(const int16_t *input, uint8_t *dest, int stride,
@@ -430,7 +430,7 @@ void vp9_idct8x8_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
// First transform rows
// only first 4 row has non-zero coefs
for (i = 0; i < 4; ++i) {
- idct8_1d(input, outptr);
+ idct8(input, outptr);
input += 8;
outptr += 8;
}
@@ -439,14 +439,14 @@ void vp9_idct8x8_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 8; ++i) {
for (j = 0; j < 8; ++j)
temp_in[j] = out[j * 8 + i];
- idct8_1d(temp_in, temp_out);
+ idct8(temp_in, temp_out);
for (j = 0; j < 8; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 5)
+ dest[j * stride + i]);
}
}
-static void idct16_1d(const int16_t *input, int16_t *output) {
+static void idct16(const int16_t *input, int16_t *output) {
int16_t step1[16], step2[16];
int temp1, temp2;
@@ -619,7 +619,7 @@ void vp9_idct16x16_256_add_c(const int16_t *input, uint8_t *dest, int stride) {
// First transform rows
for (i = 0; i < 16; ++i) {
- idct16_1d(input, outptr);
+ idct16(input, outptr);
input += 16;
outptr += 16;
}
@@ -628,14 +628,14 @@ void vp9_idct16x16_256_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 16; ++i) {
for (j = 0; j < 16; ++j)
temp_in[j] = out[j * 16 + i];
- idct16_1d(temp_in, temp_out);
+ idct16(temp_in, temp_out);
for (j = 0; j < 16; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * stride + i]);
}
}
-static void iadst16_1d(const int16_t *input, int16_t *output) {
+static void iadst16(const int16_t *input, int16_t *output) {
int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15;
int x0 = input[15];
@@ -807,10 +807,10 @@ static void iadst16_1d(const int16_t *input, int16_t *output) {
}
static const transform_2d IHT_16[] = {
- { idct16_1d, idct16_1d }, // DCT_DCT = 0
- { iadst16_1d, idct16_1d }, // ADST_DCT = 1
- { idct16_1d, iadst16_1d }, // DCT_ADST = 2
- { iadst16_1d, iadst16_1d } // ADST_ADST = 3
+ { idct16, idct16 }, // DCT_DCT = 0
+ { iadst16, idct16 }, // ADST_DCT = 1
+ { idct16, iadst16 }, // DCT_ADST = 2
+ { iadst16, iadst16 } // ADST_ADST = 3
};
void vp9_iht16x16_256_add_c(const int16_t *input, uint8_t *dest, int stride,
@@ -835,7 +835,8 @@ void vp9_iht16x16_256_add_c(const int16_t *input, uint8_t *dest, int stride,
ht.cols(temp_in, temp_out);
for (j = 0; j < 16; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
- + dest[j * stride + i]); }
+ + dest[j * stride + i]);
+ }
}
void vp9_idct16x16_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
@@ -847,7 +848,7 @@ void vp9_idct16x16_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
// First transform rows. Since all non-zero dct coefficients are in
// upper-left 4x4 area, we only need to calculate first 4 rows here.
for (i = 0; i < 4; ++i) {
- idct16_1d(input, outptr);
+ idct16(input, outptr);
input += 16;
outptr += 16;
}
@@ -856,7 +857,7 @@ void vp9_idct16x16_10_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 16; ++i) {
for (j = 0; j < 16; ++j)
temp_in[j] = out[j*16 + i];
- idct16_1d(temp_in, temp_out);
+ idct16(temp_in, temp_out);
for (j = 0; j < 16; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * stride + i]);
@@ -876,7 +877,7 @@ void vp9_idct16x16_1_add_c(const int16_t *input, uint8_t *dest, int stride) {
}
}
-static void idct32_1d(const int16_t *input, int16_t *output) {
+static void idct32(const int16_t *input, int16_t *output) {
int16_t step1[32], step2[32];
int temp1, temp2;
@@ -1262,7 +1263,7 @@ void vp9_idct32x32_1024_add_c(const int16_t *input, uint8_t *dest, int stride) {
zero_coeff[j] = zero_coeff[2 * j] | zero_coeff[2 * j + 1];
if (zero_coeff[0] | zero_coeff[1])
- idct32_1d(input, outptr);
+ idct32(input, outptr);
else
vpx_memset(outptr, 0, sizeof(int16_t) * 32);
input += 32;
@@ -1273,10 +1274,10 @@ void vp9_idct32x32_1024_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 32; ++i) {
for (j = 0; j < 32; ++j)
temp_in[j] = out[j * 32 + i];
- idct32_1d(temp_in, temp_out);
+ idct32(temp_in, temp_out);
for (j = 0; j < 32; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
- + dest[j * stride + i]);
+ + dest[j * stride + i]);
}
}
@@ -1289,7 +1290,7 @@ void vp9_idct32x32_34_add_c(const int16_t *input, uint8_t *dest, int stride) {
// Rows
// only upper-left 8x8 has non-zero coeff
for (i = 0; i < 8; ++i) {
- idct32_1d(input, outptr);
+ idct32(input, outptr);
input += 32;
outptr += 32;
}
@@ -1298,7 +1299,7 @@ void vp9_idct32x32_34_add_c(const int16_t *input, uint8_t *dest, int stride) {
for (i = 0; i < 32; ++i) {
for (j = 0; j < 32; ++j)
temp_in[j] = out[j * 32 + i];
- idct32_1d(temp_in, temp_out);
+ idct32(temp_in, temp_out);
for (j = 0; j < 32; ++j)
dest[j * stride + i] = clip_pixel(ROUND_POWER_OF_TWO(temp_out[j], 6)
+ dest[j * stride + i]);
@@ -1344,43 +1345,37 @@ void vp9_idct8x8_add(const int16_t *input, uint8_t *dest, int stride, int eob) {
// coefficients. Use eobs to decide what to do.
// TODO(yunqingwang): "eobs = 1" case is also handled in vp9_short_idct8x8_c.
// Combine that with code here.
- if (eob) {
- if (eob == 1)
- // DC only DCT coefficient
- vp9_idct8x8_1_add(input, dest, stride);
- else if (eob <= 10)
- vp9_idct8x8_10_add(input, dest, stride);
- else
- vp9_idct8x8_64_add(input, dest, stride);
- }
+ if (eob == 1)
+ // DC only DCT coefficient
+ vp9_idct8x8_1_add(input, dest, stride);
+ else if (eob <= 10)
+ vp9_idct8x8_10_add(input, dest, stride);
+ else
+ vp9_idct8x8_64_add(input, dest, stride);
}
void vp9_idct16x16_add(const int16_t *input, uint8_t *dest, int stride,
int eob) {
/* The calculation can be simplified if there are not many non-zero dct
* coefficients. Use eobs to separate different cases. */
- if (eob) {
- if (eob == 1)
- /* DC only DCT coefficient. */
- vp9_idct16x16_1_add(input, dest, stride);
- else if (eob <= 10)
- vp9_idct16x16_10_add(input, dest, stride);
- else
- vp9_idct16x16_256_add(input, dest, stride);
- }
+ if (eob == 1)
+ /* DC only DCT coefficient. */
+ vp9_idct16x16_1_add(input, dest, stride);
+ else if (eob <= 10)
+ vp9_idct16x16_10_add(input, dest, stride);
+ else
+ vp9_idct16x16_256_add(input, dest, stride);
}
void vp9_idct32x32_add(const int16_t *input, uint8_t *dest, int stride,
int eob) {
- if (eob) {
- if (eob == 1)
- vp9_idct32x32_1_add(input, dest, stride);
- else if (eob <= 34)
- // non-zero coeff only in upper-left 8x8
- vp9_idct32x32_34_add(input, dest, stride);
- else
- vp9_idct32x32_1024_add(input, dest, stride);
- }
+ if (eob == 1)
+ vp9_idct32x32_1_add(input, dest, stride);
+ else if (eob <= 34)
+ // non-zero coeff only in upper-left 8x8
+ vp9_idct32x32_34_add(input, dest, stride);
+ else
+ vp9_idct32x32_1024_add(input, dest, stride);
}
// iht
@@ -1397,9 +1392,7 @@ void vp9_iht8x8_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest,
if (tx_type == DCT_DCT) {
vp9_idct8x8_add(input, dest, stride, eob);
} else {
- if (eob > 0) {
- vp9_iht8x8_64_add(input, dest, stride, tx_type);
- }
+ vp9_iht8x8_64_add(input, dest, stride, tx_type);
}
}
@@ -1408,8 +1401,6 @@ void vp9_iht16x16_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest,
if (tx_type == DCT_DCT) {
vp9_idct16x16_add(input, dest, stride, eob);
} else {
- if (eob > 0) {
- vp9_iht16x16_256_add(input, dest, stride, tx_type);
- }
+ vp9_iht16x16_256_add(input, dest, stride, tx_type);
}
}
diff --git a/libvpx/vp9/common/vp9_idct.h b/libvpx/vp9/common/vp9_idct.h
index 2b3f35f..ceca795 100644
--- a/libvpx/vp9/common/vp9_idct.h
+++ b/libvpx/vp9/common/vp9_idct.h
@@ -18,6 +18,10 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_enums.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// Constants and Macros used by all idct/dct functions
#define DCT_CONST_BITS 14
@@ -77,8 +81,7 @@ static const int sinpi_4_9 = 15212;
static INLINE int dct_const_round_shift(int input) {
int rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
- assert(INT16_MIN <= rv && rv <= INT16_MAX);
- return rv;
+ return (int16_t)rv;
}
typedef void (*transform_1d)(const int16_t*, int16_t*);
@@ -104,4 +107,8 @@ void vp9_iht16x16_add(TX_TYPE tx_type, const int16_t *input, uint8_t *dest,
int stride, int eob);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_IDCT_H_
diff --git a/libvpx/vp9/common/vp9_loopfilter.c b/libvpx/vp9/common/vp9_loopfilter.c
index ff504a1..af8afed 100644
--- a/libvpx/vp9/common/vp9_loopfilter.c
+++ b/libvpx/vp9/common/vp9_loopfilter.c
@@ -16,26 +16,6 @@
#include "vp9/common/vp9_seg_common.h"
-// This structure holds bit masks for all 8x8 blocks in a 64x64 region.
-// Each 1 bit represents a position in which we want to apply the loop filter.
-// Left_ entries refer to whether we apply a filter on the border to the
-// left of the block. Above_ entries refer to whether or not to apply a
-// filter on the above border. Int_ entries refer to whether or not to
-// apply borders on the 4x4 edges within the 8x8 block that each bit
-// represents.
-// Since each transform is accompanied by a potentially different type of
-// loop filter there is a different entry in the array for each transform size.
-typedef struct {
- uint64_t left_y[TX_SIZES];
- uint64_t above_y[TX_SIZES];
- uint64_t int_4x4_y;
- uint16_t left_uv[TX_SIZES];
- uint16_t above_uv[TX_SIZES];
- uint16_t int_4x4_uv;
- uint8_t lfl_y[64];
- uint8_t lfl_uv[16];
-} LOOP_FILTER_MASK;
-
// 64 bit masks for left transform size. Each 1 represents a position where
// we should apply a loop filter across the left border of an 8x8 block
// boundary.
@@ -221,23 +201,10 @@ static const uint16_t size_mask_uv[BLOCK_SIZES] = {
static const uint16_t left_border_uv = 0x1111;
static const uint16_t above_border_uv = 0x000f;
-
-static void lf_init_lut(loop_filter_info_n *lfi) {
- lfi->mode_lf_lut[DC_PRED] = 0;
- lfi->mode_lf_lut[D45_PRED] = 0;
- lfi->mode_lf_lut[D135_PRED] = 0;
- lfi->mode_lf_lut[D117_PRED] = 0;
- lfi->mode_lf_lut[D153_PRED] = 0;
- lfi->mode_lf_lut[D207_PRED] = 0;
- lfi->mode_lf_lut[D63_PRED] = 0;
- lfi->mode_lf_lut[V_PRED] = 0;
- lfi->mode_lf_lut[H_PRED] = 0;
- lfi->mode_lf_lut[TM_PRED] = 0;
- lfi->mode_lf_lut[ZEROMV] = 0;
- lfi->mode_lf_lut[NEARESTMV] = 1;
- lfi->mode_lf_lut[NEARMV] = 1;
- lfi->mode_lf_lut[NEWMV] = 1;
-}
+static const int mode_lf_lut[MB_MODE_COUNT] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // INTRA_MODES
+ 1, 1, 0, 1 // INTER_MODES (ZEROMV == 0)
+};
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {
int lvl;
@@ -270,9 +237,6 @@ void vp9_loop_filter_init(VP9_COMMON *cm) {
update_sharpness(lfi, lf->sharpness_level);
lf->last_sharpness_level = lf->sharpness_level;
- // init LUT for lvl and hev thr picking
- lf_init_lut(lfi);
-
// init hev threshold const vectors
for (lvl = 0; lvl <= MAX_LOOP_FILTER; lvl++)
vpx_memset(lfi->lfthr[lvl].hev_thr, (lvl >> 4), SIMD_WIDTH);
@@ -283,10 +247,10 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm, int default_filt_lvl) {
// n_shift is the a multiplier for lf_deltas
// the multiplier is 1 for when filter_lvl is between 0 and 31;
// 2 when filter_lvl is between 32 and 63
- const int n_shift = default_filt_lvl >> 5;
+ const int scale = 1 << (default_filt_lvl >> 5);
loop_filter_info_n *const lfi = &cm->lf_info;
struct loopfilter *const lf = &cm->lf;
- struct segmentation *const seg = &cm->seg;
+ const struct segmentation *const seg = &cm->seg;
// update limits if sharpness has changed
if (lf->last_sharpness_level != lf->sharpness_level) {
@@ -295,86 +259,130 @@ void vp9_loop_filter_frame_init(VP9_COMMON *cm, int default_filt_lvl) {
}
for (seg_id = 0; seg_id < MAX_SEGMENTS; seg_id++) {
- int lvl_seg = default_filt_lvl, ref, mode, intra_lvl;
-
- // Set the baseline filter values for each segment
+ int lvl_seg = default_filt_lvl;
if (vp9_segfeature_active(seg, seg_id, SEG_LVL_ALT_LF)) {
const int data = vp9_get_segdata(seg, seg_id, SEG_LVL_ALT_LF);
- lvl_seg = seg->abs_delta == SEGMENT_ABSDATA
- ? data
- : clamp(default_filt_lvl + data, 0, MAX_LOOP_FILTER);
+ lvl_seg = clamp(seg->abs_delta == SEGMENT_ABSDATA ?
+ data : default_filt_lvl + data,
+ 0, MAX_LOOP_FILTER);
}
if (!lf->mode_ref_delta_enabled) {
// we could get rid of this if we assume that deltas are set to
// zero when not in use; encoder always uses deltas
vpx_memset(lfi->lvl[seg_id], lvl_seg, sizeof(lfi->lvl[seg_id]));
- continue;
- }
-
- intra_lvl = lvl_seg + lf->ref_deltas[INTRA_FRAME] * (1 << n_shift);
- lfi->lvl[seg_id][INTRA_FRAME][0] = clamp(intra_lvl, 0, MAX_LOOP_FILTER);
-
- for (ref = LAST_FRAME; ref < MAX_REF_FRAMES; ++ref)
- for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
- const int inter_lvl = lvl_seg + lf->ref_deltas[ref] * (1 << n_shift)
- + lf->mode_deltas[mode] * (1 << n_shift);
- lfi->lvl[seg_id][ref][mode] = clamp(inter_lvl, 0, MAX_LOOP_FILTER);
+ } else {
+ int ref, mode;
+ const int intra_lvl = lvl_seg + lf->ref_deltas[INTRA_FRAME] * scale;
+ lfi->lvl[seg_id][INTRA_FRAME][0] = clamp(intra_lvl, 0, MAX_LOOP_FILTER);
+
+ for (ref = LAST_FRAME; ref < MAX_REF_FRAMES; ++ref) {
+ for (mode = 0; mode < MAX_MODE_LF_DELTAS; ++mode) {
+ const int inter_lvl = lvl_seg + lf->ref_deltas[ref] * scale
+ + lf->mode_deltas[mode] * scale;
+ lfi->lvl[seg_id][ref][mode] = clamp(inter_lvl, 0, MAX_LOOP_FILTER);
+ }
}
+ }
}
}
-static uint8_t build_lfi(const loop_filter_info_n *lfi_n,
- const MB_MODE_INFO *mbmi) {
- const int seg = mbmi->segment_id;
- const int ref = mbmi->ref_frame[0];
- const int mode = lfi_n->mode_lf_lut[mbmi->mode];
- const int filter_level = lfi_n->lvl[seg][ref][mode];
-
- return filter_level;
-}
-
-static void filter_selectively_vert(uint8_t *s, int pitch,
- unsigned int mask_16x16,
- unsigned int mask_8x8,
- unsigned int mask_4x4,
- unsigned int mask_4x4_int,
- const loop_filter_info_n *lfi_n,
- const uint8_t *lfl) {
+static void filter_selectively_vert_row2(PLANE_TYPE plane_type,
+ uint8_t *s, int pitch,
+ unsigned int mask_16x16_l,
+ unsigned int mask_8x8_l,
+ unsigned int mask_4x4_l,
+ unsigned int mask_4x4_int_l,
+ const loop_filter_info_n *lfi_n,
+ const uint8_t *lfl) {
+ const int mask_shift = plane_type ? 4 : 8;
+ const int mask_cutoff = plane_type ? 0xf : 0xff;
+ const int lfl_forward = plane_type ? 4 : 8;
+
+ unsigned int mask_16x16_0 = mask_16x16_l & mask_cutoff;
+ unsigned int mask_8x8_0 = mask_8x8_l & mask_cutoff;
+ unsigned int mask_4x4_0 = mask_4x4_l & mask_cutoff;
+ unsigned int mask_4x4_int_0 = mask_4x4_int_l & mask_cutoff;
+ unsigned int mask_16x16_1 = (mask_16x16_l >> mask_shift) & mask_cutoff;
+ unsigned int mask_8x8_1 = (mask_8x8_l >> mask_shift) & mask_cutoff;
+ unsigned int mask_4x4_1 = (mask_4x4_l >> mask_shift) & mask_cutoff;
+ unsigned int mask_4x4_int_1 = (mask_4x4_int_l >> mask_shift) & mask_cutoff;
unsigned int mask;
- for (mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int;
- mask; mask >>= 1) {
- const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl;
+ for (mask = mask_16x16_0 | mask_8x8_0 | mask_4x4_0 | mask_4x4_int_0 |
+ mask_16x16_1 | mask_8x8_1 | mask_4x4_1 | mask_4x4_int_1;
+ mask; mask >>= 1) {
+ const loop_filter_thresh *lfi0 = lfi_n->lfthr + *lfl;
+ const loop_filter_thresh *lfi1 = lfi_n->lfthr + *(lfl + lfl_forward);
+ // TODO(yunqingwang): count in loopfilter functions should be removed.
if (mask & 1) {
- if (mask_16x16 & 1) {
- vp9_mb_lpf_vertical_edge_w(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr);
- assert(!(mask_8x8 & 1));
- assert(!(mask_4x4 & 1));
- assert(!(mask_4x4_int & 1));
- } else if (mask_8x8 & 1) {
- vp9_mbloop_filter_vertical_edge(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
- assert(!(mask_16x16 & 1));
- assert(!(mask_4x4 & 1));
- } else if (mask_4x4 & 1) {
- vp9_loop_filter_vertical_edge(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
- assert(!(mask_16x16 & 1));
- assert(!(mask_8x8 & 1));
+ if ((mask_16x16_0 | mask_16x16_1) & 1) {
+ if ((mask_16x16_0 & mask_16x16_1) & 1) {
+ vp9_lpf_vertical_16_dual(s, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr);
+ } else if (mask_16x16_0 & 1) {
+ vp9_lpf_vertical_16(s, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr);
+ } else {
+ vp9_lpf_vertical_16(s + 8 *pitch, pitch, lfi1->mblim,
+ lfi1->lim, lfi1->hev_thr);
+ }
+ }
+
+ if ((mask_8x8_0 | mask_8x8_1) & 1) {
+ if ((mask_8x8_0 & mask_8x8_1) & 1) {
+ vp9_lpf_vertical_8_dual(s, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr, lfi1->mblim, lfi1->lim,
+ lfi1->hev_thr);
+ } else if (mask_8x8_0 & 1) {
+ vp9_lpf_vertical_8(s, pitch, lfi0->mblim, lfi0->lim, lfi0->hev_thr,
+ 1);
+ } else {
+ vp9_lpf_vertical_8(s + 8 * pitch, pitch, lfi1->mblim, lfi1->lim,
+ lfi1->hev_thr, 1);
+ }
+ }
+
+ if ((mask_4x4_0 | mask_4x4_1) & 1) {
+ if ((mask_4x4_0 & mask_4x4_1) & 1) {
+ vp9_lpf_vertical_4_dual(s, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr, lfi1->mblim, lfi1->lim,
+ lfi1->hev_thr);
+ } else if (mask_4x4_0 & 1) {
+ vp9_lpf_vertical_4(s, pitch, lfi0->mblim, lfi0->lim, lfi0->hev_thr,
+ 1);
+ } else {
+ vp9_lpf_vertical_4(s + 8 * pitch, pitch, lfi1->mblim, lfi1->lim,
+ lfi1->hev_thr, 1);
+ }
+ }
+
+ if ((mask_4x4_int_0 | mask_4x4_int_1) & 1) {
+ if ((mask_4x4_int_0 & mask_4x4_int_1) & 1) {
+ vp9_lpf_vertical_4_dual(s + 4, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr, lfi1->mblim, lfi1->lim,
+ lfi1->hev_thr);
+ } else if (mask_4x4_int_0 & 1) {
+ vp9_lpf_vertical_4(s + 4, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr, 1);
+ } else {
+ vp9_lpf_vertical_4(s + 8 * pitch + 4, pitch, lfi1->mblim, lfi1->lim,
+ lfi1->hev_thr, 1);
+ }
}
}
- if (mask_4x4_int & 1)
- vp9_loop_filter_vertical_edge(s + 4, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
+
s += 8;
lfl += 1;
- mask_16x16 >>= 1;
- mask_8x8 >>= 1;
- mask_4x4 >>= 1;
- mask_4x4_int >>= 1;
+ mask_16x16_0 >>= 1;
+ mask_8x8_0 >>= 1;
+ mask_4x4_0 >>= 1;
+ mask_4x4_int_0 >>= 1;
+ mask_16x16_1 >>= 1;
+ mask_8x8_1 >>= 1;
+ mask_4x4_1 >>= 1;
+ mask_4x4_int_1 >>= 1;
}
}
@@ -396,95 +404,73 @@ static void filter_selectively_horiz(uint8_t *s, int pitch,
if (mask & 1) {
if (mask_16x16 & 1) {
if ((mask_16x16 & 3) == 3) {
- vp9_mb_lpf_horizontal_edge_w(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 2);
+ vp9_lpf_horizontal_16(s, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 2);
count = 2;
} else {
- vp9_mb_lpf_horizontal_edge_w(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
+ vp9_lpf_horizontal_16(s, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
}
- assert(!(mask_8x8 & 1));
- assert(!(mask_4x4 & 1));
- assert(!(mask_4x4_int & 1));
} else if (mask_8x8 & 1) {
if ((mask_8x8 & 3) == 3) {
// Next block's thresholds
const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + 1);
- // TODO(yunqingwang): Combine next 2 calls as 1 wide filtering.
- vp9_mbloop_filter_horizontal_edge(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
- vp9_mbloop_filter_horizontal_edge(s + 8, pitch, lfin->mblim,
- lfin->lim, lfin->hev_thr, 1);
+ vp9_lpf_horizontal_8_dual(s, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, lfin->mblim, lfin->lim,
+ lfin->hev_thr);
if ((mask_4x4_int & 3) == 3) {
- // TODO(yunqingwang): Combine next 2 calls as 1 wide filtering.
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
- vp9_loop_filter_horizontal_edge(s + 8 + 4 * pitch, pitch,
- lfin->mblim, lfin->lim,
- lfin->hev_thr, 1);
+ vp9_lpf_horizontal_4_dual(s + 4 * pitch, pitch, lfi->mblim,
+ lfi->lim, lfi->hev_thr, lfin->mblim,
+ lfin->lim, lfin->hev_thr);
} else {
if (mask_4x4_int & 1)
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
+ vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
else if (mask_4x4_int & 2)
- vp9_loop_filter_horizontal_edge(s + 8 + 4 * pitch, pitch,
- lfin->mblim, lfin->lim,
- lfin->hev_thr, 1);
+ vp9_lpf_horizontal_4(s + 8 + 4 * pitch, pitch, lfin->mblim,
+ lfin->lim, lfin->hev_thr, 1);
}
count = 2;
} else {
- vp9_mbloop_filter_horizontal_edge(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
+ vp9_lpf_horizontal_8(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
if (mask_4x4_int & 1)
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
+ vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
}
- assert(!(mask_16x16 & 1));
- assert(!(mask_4x4 & 1));
} else if (mask_4x4 & 1) {
if ((mask_4x4 & 3) == 3) {
// Next block's thresholds
const loop_filter_thresh *lfin = lfi_n->lfthr + *(lfl + 1);
- // TODO(yunqingwang): Combine next 2 calls as 1 wide filtering.
- vp9_loop_filter_horizontal_edge(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
- vp9_loop_filter_horizontal_edge(s + 8, pitch, lfin->mblim, lfin->lim,
- lfin->hev_thr, 1);
-
+ vp9_lpf_horizontal_4_dual(s, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, lfin->mblim, lfin->lim,
+ lfin->hev_thr);
if ((mask_4x4_int & 3) == 3) {
- // TODO(yunqingwang): Combine next 2 calls as 1 wide filtering.
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
- vp9_loop_filter_horizontal_edge(s + 8 + 4 * pitch, pitch,
- lfin->mblim, lfin->lim,
- lfin->hev_thr, 1);
+ vp9_lpf_horizontal_4_dual(s + 4 * pitch, pitch, lfi->mblim,
+ lfi->lim, lfi->hev_thr, lfin->mblim,
+ lfin->lim, lfin->hev_thr);
} else {
if (mask_4x4_int & 1)
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
+ vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
else if (mask_4x4_int & 2)
- vp9_loop_filter_horizontal_edge(s + 8 + 4 * pitch, pitch,
- lfin->mblim, lfin->lim,
- lfin->hev_thr, 1);
+ vp9_lpf_horizontal_4(s + 8 + 4 * pitch, pitch, lfin->mblim,
+ lfin->lim, lfin->hev_thr, 1);
}
count = 2;
} else {
- vp9_loop_filter_horizontal_edge(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 1);
+ vp9_lpf_horizontal_4(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
- if (mask_4x4_int & 1)
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
+ if (mask_4x4_int & 1)
+ vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
}
- assert(!(mask_16x16 & 1));
- assert(!(mask_8x8 & 1));
} else if (mask_4x4_int & 1) {
- vp9_loop_filter_horizontal_edge(s + 4 * pitch, pitch, lfi->mblim,
- lfi->lim, lfi->hev_thr, 1);
+ vp9_lpf_horizontal_4(s + 4 * pitch, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
}
}
s += 8 * count;
@@ -510,11 +496,10 @@ static void build_masks(const loop_filter_info_n *const lfi_n,
const BLOCK_SIZE block_size = mi->mbmi.sb_type;
const TX_SIZE tx_size_y = mi->mbmi.tx_size;
const TX_SIZE tx_size_uv = get_uv_tx_size(&mi->mbmi);
- const int skip = mi->mbmi.skip_coeff;
+ const int skip = mi->mbmi.skip;
const int seg = mi->mbmi.segment_id;
const int ref = mi->mbmi.ref_frame[0];
- const int mode = lfi_n->mode_lf_lut[mi->mbmi.mode];
- const int filter_level = lfi_n->lvl[seg][ref][mode];
+ const int filter_level = lfi_n->lvl[seg][ref][mode_lf_lut[mi->mbmi.mode]];
uint64_t *left_y = &lfm->left_y[tx_size_y];
uint64_t *above_y = &lfm->above_y[tx_size_y];
uint64_t *int_4x4_y = &lfm->int_4x4_y;
@@ -592,11 +577,10 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n,
LOOP_FILTER_MASK *lfm) {
const BLOCK_SIZE block_size = mi->mbmi.sb_type;
const TX_SIZE tx_size_y = mi->mbmi.tx_size;
- const int skip = mi->mbmi.skip_coeff;
+ const int skip = mi->mbmi.skip;
const int seg = mi->mbmi.segment_id;
const int ref = mi->mbmi.ref_frame[0];
- const int mode = lfi_n->mode_lf_lut[mi->mbmi.mode];
- const int filter_level = lfi_n->lvl[seg][ref][mode];
+ const int filter_level = lfi_n->lvl[seg][ref][mode_lf_lut[mi->mbmi.mode]];
uint64_t *left_y = &lfm->left_y[tx_size_y];
uint64_t *above_y = &lfm->above_y[tx_size_y];
uint64_t *int_4x4_y = &lfm->int_4x4_y;
@@ -634,9 +618,9 @@ static void build_y_mask(const loop_filter_info_n *const lfi_n,
// This function sets up the bit masks for the entire 64x64 region represented
// by mi_row, mi_col.
// TODO(JBB): This function only works for yv12.
-static void setup_mask(VP9_COMMON *const cm, const int mi_row, const int mi_col,
- MODE_INFO **mi_8x8, const int mode_info_stride,
- LOOP_FILTER_MASK *lfm) {
+void vp9_setup_mask(VP9_COMMON *const cm, const int mi_row, const int mi_col,
+ MODE_INFO **mi_8x8, const int mode_info_stride,
+ LOOP_FILTER_MASK *lfm) {
int idx_32, idx_16, idx_8;
const loop_filter_info_n *const lfi_n = &cm->lf_info;
MODE_INFO **mip = mi_8x8;
@@ -864,9 +848,66 @@ static void setup_mask(VP9_COMMON *const cm, const int mi_row, const int mi_col,
lfm->left_uv[i] &= 0xeeee;
}
}
+
+ // Assert if we try to apply 2 different loop filters at the same position.
+ assert(!(lfm->left_y[TX_16X16] & lfm->left_y[TX_8X8]));
+ assert(!(lfm->left_y[TX_16X16] & lfm->left_y[TX_4X4]));
+ assert(!(lfm->left_y[TX_8X8] & lfm->left_y[TX_4X4]));
+ assert(!(lfm->int_4x4_y & lfm->left_y[TX_16X16]));
+ assert(!(lfm->left_uv[TX_16X16]&lfm->left_uv[TX_8X8]));
+ assert(!(lfm->left_uv[TX_16X16] & lfm->left_uv[TX_4X4]));
+ assert(!(lfm->left_uv[TX_8X8] & lfm->left_uv[TX_4X4]));
+ assert(!(lfm->int_4x4_uv & lfm->left_uv[TX_16X16]));
+ assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_8X8]));
+ assert(!(lfm->above_y[TX_16X16] & lfm->above_y[TX_4X4]));
+ assert(!(lfm->above_y[TX_8X8] & lfm->above_y[TX_4X4]));
+ assert(!(lfm->int_4x4_y & lfm->above_y[TX_16X16]));
+ assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_8X8]));
+ assert(!(lfm->above_uv[TX_16X16] & lfm->above_uv[TX_4X4]));
+ assert(!(lfm->above_uv[TX_8X8] & lfm->above_uv[TX_4X4]));
+ assert(!(lfm->int_4x4_uv & lfm->above_uv[TX_16X16]));
+}
+
+static uint8_t build_lfi(const loop_filter_info_n *lfi_n,
+ const MB_MODE_INFO *mbmi) {
+ const int seg = mbmi->segment_id;
+ const int ref = mbmi->ref_frame[0];
+ return lfi_n->lvl[seg][ref][mode_lf_lut[mbmi->mode]];
+}
+
+static void filter_selectively_vert(uint8_t *s, int pitch,
+ unsigned int mask_16x16,
+ unsigned int mask_8x8,
+ unsigned int mask_4x4,
+ unsigned int mask_4x4_int,
+ const loop_filter_info_n *lfi_n,
+ const uint8_t *lfl) {
+ unsigned int mask;
+
+ for (mask = mask_16x16 | mask_8x8 | mask_4x4 | mask_4x4_int;
+ mask; mask >>= 1) {
+ const loop_filter_thresh *lfi = lfi_n->lfthr + *lfl;
+
+ if (mask & 1) {
+ if (mask_16x16 & 1) {
+ vp9_lpf_vertical_16(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr);
+ } else if (mask_8x8 & 1) {
+ vp9_lpf_vertical_8(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
+ } else if (mask_4x4 & 1) {
+ vp9_lpf_vertical_4(s, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
+ }
+ }
+ if (mask_4x4_int & 1)
+ vp9_lpf_vertical_4(s + 4, pitch, lfi->mblim, lfi->lim, lfi->hev_thr, 1);
+ s += 8;
+ lfl += 1;
+ mask_16x16 >>= 1;
+ mask_8x8 >>= 1;
+ mask_4x4 >>= 1;
+ mask_4x4_int >>= 1;
+ }
}
-#if CONFIG_NON420
static void filter_block_plane_non420(VP9_COMMON *cm,
struct macroblockd_plane *plane,
MODE_INFO **mi_8x8,
@@ -894,15 +935,15 @@ static void filter_block_plane_non420(VP9_COMMON *cm,
// Determine the vertical edges that need filtering
for (c = 0; c < MI_BLOCK_SIZE && mi_col + c < cm->mi_cols; c += col_step) {
const MODE_INFO *mi = mi_8x8[c];
- const int skip_this = mi[0].mbmi.skip_coeff
- && is_inter_block(&mi[0].mbmi);
+ const BLOCK_SIZE sb_type = mi[0].mbmi.sb_type;
+ const int skip_this = mi[0].mbmi.skip && is_inter_block(&mi[0].mbmi);
// left edge of current unit is block/partition edge -> no skip
- const int block_edge_left = b_width_log2(mi[0].mbmi.sb_type) ?
- !(c & ((1 << (b_width_log2(mi[0].mbmi.sb_type)-1)) - 1)) : 1;
+ const int block_edge_left = (num_4x4_blocks_wide_lookup[sb_type] > 1) ?
+ !(c & (num_8x8_blocks_wide_lookup[sb_type] - 1)) : 1;
const int skip_this_c = skip_this && !block_edge_left;
// top edge of current unit is block/partition edge -> no skip
- const int block_edge_above = b_height_log2(mi[0].mbmi.sb_type) ?
- !(r & ((1 << (b_height_log2(mi[0].mbmi.sb_type)-1)) - 1)) : 1;
+ const int block_edge_above = (num_4x4_blocks_high_lookup[sb_type] > 1) ?
+ !(r & (num_8x8_blocks_high_lookup[sb_type] - 1)) : 1;
const int skip_this_r = skip_this && !block_edge_above;
const TX_SIZE tx_size = (plane->plane_type == PLANE_TYPE_UV)
? get_uv_tx_size(&mi[0].mbmi)
@@ -1004,15 +1045,13 @@ static void filter_block_plane_non420(VP9_COMMON *cm,
dst->buf += 8 * dst->stride;
}
}
-#endif
-static void filter_block_plane(VP9_COMMON *const cm,
- struct macroblockd_plane *const plane,
- int mi_row,
- LOOP_FILTER_MASK *lfm) {
+void vp9_filter_block_plane(VP9_COMMON *const cm,
+ struct macroblockd_plane *const plane,
+ int mi_row,
+ LOOP_FILTER_MASK *lfm) {
struct buf_2d *const dst = &plane->dst;
uint8_t* const dst0 = dst->buf;
- unsigned int mask_4x4_int_row[MI_BLOCK_SIZE] = {0};
int r, c;
if (!plane->plane_type) {
@@ -1021,23 +1060,27 @@ static void filter_block_plane(VP9_COMMON *const cm,
uint64_t mask_4x4 = lfm->left_y[TX_4X4];
uint64_t mask_4x4_int = lfm->int_4x4_y;
- // Vertical pass
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r++) {
- mask_4x4_int_row[r] = mask_4x4_int & 0xff;
+ // Vertical pass: do 2 rows at one time
+ for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
+ unsigned int mask_16x16_l = mask_16x16 & 0xffff;
+ unsigned int mask_8x8_l = mask_8x8 & 0xffff;
+ unsigned int mask_4x4_l = mask_4x4 & 0xffff;
+ unsigned int mask_4x4_int_l = mask_4x4_int & 0xffff;
// Disable filtering on the leftmost column
- filter_selectively_vert(dst->buf, dst->stride,
- mask_16x16 & 0xff,
- mask_8x8 & 0xff,
- mask_4x4 & 0xff,
- mask_4x4_int_row[r],
- &cm->lf_info, &lfm->lfl_y[r << 3]);
-
- dst->buf += 8 * dst->stride;
- mask_16x16 >>= 8;
- mask_8x8 >>= 8;
- mask_4x4 >>= 8;
- mask_4x4_int >>= 8;
+ filter_selectively_vert_row2(plane->plane_type,
+ dst->buf, dst->stride,
+ mask_16x16_l,
+ mask_8x8_l,
+ mask_4x4_l,
+ mask_4x4_int_l,
+ &cm->lf_info, &lfm->lfl_y[r << 3]);
+
+ dst->buf += 16 * dst->stride;
+ mask_16x16 >>= 16;
+ mask_8x8 >>= 16;
+ mask_4x4 >>= 16;
+ mask_4x4_int >>= 16;
}
// Horizontal pass
@@ -1045,6 +1088,7 @@ static void filter_block_plane(VP9_COMMON *const cm,
mask_16x16 = lfm->above_y[TX_16X16];
mask_8x8 = lfm->above_y[TX_8X8];
mask_4x4 = lfm->above_y[TX_4X4];
+ mask_4x4_int = lfm->int_4x4_y;
for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r++) {
unsigned int mask_16x16_r;
@@ -1065,13 +1109,14 @@ static void filter_block_plane(VP9_COMMON *const cm,
mask_16x16_r,
mask_8x8_r,
mask_4x4_r,
- mask_4x4_int_row[r],
+ mask_4x4_int & 0xff,
&cm->lf_info, &lfm->lfl_y[r << 3]);
dst->buf += 8 * dst->stride;
mask_16x16 >>= 8;
mask_8x8 >>= 8;
mask_4x4 >>= 8;
+ mask_4x4_int >>= 8;
}
} else {
uint16_t mask_16x16 = lfm->left_uv[TX_16X16];
@@ -1079,27 +1124,37 @@ static void filter_block_plane(VP9_COMMON *const cm,
uint16_t mask_4x4 = lfm->left_uv[TX_4X4];
uint16_t mask_4x4_int = lfm->int_4x4_uv;
- // Vertical pass
- for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
+ // Vertical pass: do 2 rows at one time
+ for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 4) {
if (plane->plane_type == 1) {
- for (c = 0; c < (MI_BLOCK_SIZE >> 1); c++)
+ for (c = 0; c < (MI_BLOCK_SIZE >> 1); c++) {
lfm->lfl_uv[(r << 1) + c] = lfm->lfl_y[(r << 3) + (c << 1)];
+ lfm->lfl_uv[((r + 2) << 1) + c] = lfm->lfl_y[((r + 2) << 3) +
+ (c << 1)];
+ }
}
- mask_4x4_int_row[r] = mask_4x4_int & 0xf;
- // Disable filtering on the leftmost column
- filter_selectively_vert(dst->buf, dst->stride,
- mask_16x16 & 0xf,
- mask_8x8 & 0xf,
- mask_4x4 & 0xf,
- mask_4x4_int_row[r],
- &cm->lf_info, &lfm->lfl_uv[r << 1]);
-
- dst->buf += 8 * dst->stride;
- mask_16x16 >>= 4;
- mask_8x8 >>= 4;
- mask_4x4 >>= 4;
- mask_4x4_int >>= 4;
+ {
+ unsigned int mask_16x16_l = mask_16x16 & 0xff;
+ unsigned int mask_8x8_l = mask_8x8 & 0xff;
+ unsigned int mask_4x4_l = mask_4x4 & 0xff;
+ unsigned int mask_4x4_int_l = mask_4x4_int & 0xff;
+
+ // Disable filtering on the leftmost column
+ filter_selectively_vert_row2(plane->plane_type,
+ dst->buf, dst->stride,
+ mask_16x16_l,
+ mask_8x8_l,
+ mask_4x4_l,
+ mask_4x4_int_l,
+ &cm->lf_info, &lfm->lfl_uv[r << 1]);
+
+ dst->buf += 16 * dst->stride;
+ mask_16x16 >>= 8;
+ mask_8x8 >>= 8;
+ mask_4x4 >>= 8;
+ mask_4x4_int >>= 8;
+ }
}
// Horizontal pass
@@ -1107,11 +1162,12 @@ static void filter_block_plane(VP9_COMMON *const cm,
mask_16x16 = lfm->above_uv[TX_16X16];
mask_8x8 = lfm->above_uv[TX_8X8];
mask_4x4 = lfm->above_uv[TX_4X4];
+ mask_4x4_int = lfm->int_4x4_uv;
for (r = 0; r < MI_BLOCK_SIZE && mi_row + r < cm->mi_rows; r += 2) {
const int skip_border_4x4_r = mi_row + r == cm->mi_rows - 1;
const unsigned int mask_4x4_int_r = skip_border_4x4_r ?
- 0 : (mask_4x4_int_row[r]);
+ 0 : (mask_4x4_int & 0xf);
unsigned int mask_16x16_r;
unsigned int mask_8x8_r;
unsigned int mask_4x4_r;
@@ -1137,6 +1193,7 @@ static void filter_block_plane(VP9_COMMON *const cm,
mask_16x16 >>= 4;
mask_8x8 >>= 4;
mask_4x4 >>= 4;
+ mask_4x4_int >>= 4;
}
}
}
@@ -1147,10 +1204,8 @@ void vp9_loop_filter_rows(const YV12_BUFFER_CONFIG *frame_buffer,
const int num_planes = y_only ? 1 : MAX_MB_PLANE;
int mi_row, mi_col;
LOOP_FILTER_MASK lfm;
-#if CONFIG_NON420
int use_420 = y_only || (xd->plane[1].subsampling_y == 1 &&
xd->plane[1].subsampling_x == 1);
-#endif
for (mi_row = start; mi_row < stop; mi_row += MI_BLOCK_SIZE) {
MODE_INFO **mi_8x8 = cm->mi_grid_visible + mi_row * cm->mode_info_stride;
@@ -1158,25 +1213,19 @@ void vp9_loop_filter_rows(const YV12_BUFFER_CONFIG *frame_buffer,
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
int plane;
- setup_dst_planes(xd, frame_buffer, mi_row, mi_col);
+ vp9_setup_dst_planes(xd, frame_buffer, mi_row, mi_col);
// TODO(JBB): Make setup_mask work for non 420.
-#if CONFIG_NON420
if (use_420)
-#endif
- setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col, cm->mode_info_stride,
- &lfm);
+ vp9_setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col,
+ cm->mode_info_stride, &lfm);
for (plane = 0; plane < num_planes; ++plane) {
-#if CONFIG_NON420
if (use_420)
-#endif
- filter_block_plane(cm, &xd->plane[plane], mi_row, &lfm);
-#if CONFIG_NON420
+ vp9_filter_block_plane(cm, &xd->plane[plane], mi_row, &lfm);
else
filter_block_plane_non420(cm, &xd->plane[plane], mi_8x8 + mi_col,
mi_row, mi_col);
-#endif
}
}
}
@@ -1184,12 +1233,12 @@ void vp9_loop_filter_rows(const YV12_BUFFER_CONFIG *frame_buffer,
void vp9_loop_filter_frame(VP9_COMMON *cm, MACROBLOCKD *xd,
int frame_filter_level,
- int y_only, int partial) {
+ int y_only, int partial_frame) {
int start_mi_row, end_mi_row, mi_rows_to_filter;
if (!frame_filter_level) return;
start_mi_row = 0;
mi_rows_to_filter = cm->mi_rows;
- if (partial && cm->mi_rows > 8) {
+ if (partial_frame && cm->mi_rows > 8) {
start_mi_row = cm->mi_rows >> 1;
start_mi_row &= 0xfffffff8;
mi_rows_to_filter = MAX(cm->mi_rows / 8, 8);
diff --git a/libvpx/vp9/common/vp9_loopfilter.h b/libvpx/vp9/common/vp9_loopfilter.h
index 62389ea..97ae9d2 100644
--- a/libvpx/vp9/common/vp9_loopfilter.h
+++ b/libvpx/vp9/common/vp9_loopfilter.h
@@ -17,6 +17,10 @@
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_seg_common.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_LOOP_FILTER 63
#define MAX_SHARPNESS 7
@@ -54,12 +58,44 @@ typedef struct {
typedef struct {
loop_filter_thresh lfthr[MAX_LOOP_FILTER + 1];
uint8_t lvl[MAX_SEGMENTS][MAX_REF_FRAMES][MAX_MODE_LF_DELTAS];
- uint8_t mode_lf_lut[MB_MODE_COUNT];
} loop_filter_info_n;
+// This structure holds bit masks for all 8x8 blocks in a 64x64 region.
+// Each 1 bit represents a position in which we want to apply the loop filter.
+// Left_ entries refer to whether we apply a filter on the border to the
+// left of the block. Above_ entries refer to whether or not to apply a
+// filter on the above border. Int_ entries refer to whether or not to
+// apply borders on the 4x4 edges within the 8x8 block that each bit
+// represents.
+// Since each transform is accompanied by a potentially different type of
+// loop filter there is a different entry in the array for each transform size.
+typedef struct {
+ uint64_t left_y[TX_SIZES];
+ uint64_t above_y[TX_SIZES];
+ uint64_t int_4x4_y;
+ uint16_t left_uv[TX_SIZES];
+ uint16_t above_uv[TX_SIZES];
+ uint16_t int_4x4_uv;
+ uint8_t lfl_y[64];
+ uint8_t lfl_uv[16];
+} LOOP_FILTER_MASK;
+
/* assorted loopfilter functions which get used elsewhere */
struct VP9Common;
struct macroblockd;
+struct VP9LfSyncData;
+
+// This function sets up the bit masks for the entire 64x64 region represented
+// by mi_row, mi_col.
+void vp9_setup_mask(struct VP9Common *const cm,
+ const int mi_row, const int mi_col,
+ MODE_INFO **mi_8x8, const int mode_info_stride,
+ LOOP_FILTER_MASK *lfm);
+
+void vp9_filter_block_plane(struct VP9Common *const cm,
+ struct macroblockd_plane *const plane,
+ int mi_row,
+ LOOP_FILTER_MASK *lfm);
void vp9_loop_filter_init(struct VP9Common *cm);
@@ -71,7 +107,7 @@ void vp9_loop_filter_frame_init(struct VP9Common *cm, int default_filt_lvl);
void vp9_loop_filter_frame(struct VP9Common *cm,
struct macroblockd *mbd,
int filter_level,
- int y_only, int partial);
+ int y_only, int partial_frame);
// Apply the loop filter to [start, stop) macro block rows in frame_buffer.
void vp9_loop_filter_rows(const YV12_BUFFER_CONFIG *frame_buffer,
@@ -87,8 +123,15 @@ typedef struct LoopFilterWorkerData {
int start;
int stop;
int y_only;
+
+ struct VP9LfSyncData *lf_sync;
+ int num_lf_workers;
} LFWorkerData;
// Operates on the rows described by LFWorkerData passed as 'arg1'.
int vp9_loop_filter_worker(void *arg1, void *arg2);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_LOOPFILTER_H_
diff --git a/libvpx/vp9/common/vp9_loopfilter_filters.c b/libvpx/vp9/common/vp9_loopfilter_filters.c
index 2c4bf6c..25d3311 100644
--- a/libvpx/vp9/common/vp9_loopfilter_filters.c
+++ b/libvpx/vp9/common/vp9_loopfilter_filters.c
@@ -70,7 +70,7 @@ static INLINE int8_t hev_mask(uint8_t thresh, uint8_t p1, uint8_t p0,
return hev;
}
-static INLINE void filter4(int8_t mask, uint8_t hev, uint8_t *op1,
+static INLINE void filter4(int8_t mask, uint8_t thresh, uint8_t *op1,
uint8_t *op0, uint8_t *oq0, uint8_t *oq1) {
int8_t filter1, filter2;
@@ -78,6 +78,7 @@ static INLINE void filter4(int8_t mask, uint8_t hev, uint8_t *op1,
const int8_t ps0 = (int8_t) *op0 ^ 0x80;
const int8_t qs0 = (int8_t) *oq0 ^ 0x80;
const int8_t qs1 = (int8_t) *oq1 ^ 0x80;
+ const uint8_t hev = hev_mask(thresh, *op1, *op0, *oq0, *oq1);
// add outer taps if we have high edge variance
int8_t filter = signed_char_clamp(ps1 - qs1) & hev;
@@ -101,11 +102,9 @@ static INLINE void filter4(int8_t mask, uint8_t hev, uint8_t *op1,
*op1 = signed_char_clamp(ps1 + filter) ^ 0x80;
}
-void vp9_loop_filter_horizontal_edge_c(uint8_t *s, int p /* pitch */,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_4_c(uint8_t *s, int p /* pitch */,
+ const uint8_t *blimit, const uint8_t *limit,
+ const uint8_t *thresh, int count) {
int i;
// loop filter designed to work using chars so that we can make maximum use
@@ -115,17 +114,22 @@ void vp9_loop_filter_horizontal_edge_c(uint8_t *s, int p /* pitch */,
const uint8_t q0 = s[0 * p], q1 = s[1 * p], q2 = s[2 * p], q3 = s[3 * p];
const int8_t mask = filter_mask(*limit, *blimit,
p3, p2, p1, p0, q0, q1, q2, q3);
- const int8_t hev = hev_mask(*thresh, p1, p0, q0, q1);
- filter4(mask, hev, s - 2 * p, s - 1 * p, s, s + 1 * p);
+ filter4(mask, *thresh, s - 2 * p, s - 1 * p, s, s + 1 * p);
++s;
}
}
-void vp9_loop_filter_vertical_edge_c(uint8_t *s, int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_4_dual_c(uint8_t *s, int p, const uint8_t *blimit0,
+ const uint8_t *limit0, const uint8_t *thresh0,
+ const uint8_t *blimit1, const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_horizontal_4_c(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_horizontal_4_c(s + 8, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_4_c(uint8_t *s, int pitch, const uint8_t *blimit,
+ const uint8_t *limit, const uint8_t *thresh,
+ int count) {
int i;
// loop filter designed to work using chars so that we can make maximum use
@@ -135,13 +139,21 @@ void vp9_loop_filter_vertical_edge_c(uint8_t *s, int pitch,
const uint8_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3];
const int8_t mask = filter_mask(*limit, *blimit,
p3, p2, p1, p0, q0, q1, q2, q3);
- const int8_t hev = hev_mask(*thresh, p1, p0, q0, q1);
- filter4(mask, hev, s - 2, s - 1, s, s + 1);
+ filter4(mask, *thresh, s - 2, s - 1, s, s + 1);
s += pitch;
}
}
-static INLINE void filter8(int8_t mask, uint8_t hev, uint8_t flat,
+void vp9_lpf_vertical_4_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0,
+ const uint8_t *limit0, const uint8_t *thresh0,
+ const uint8_t *blimit1, const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_vertical_4_c(s, pitch, blimit0, limit0, thresh0, 1);
+ vp9_lpf_vertical_4_c(s + 8 * pitch, pitch, blimit1, limit1,
+ thresh1, 1);
+}
+
+static INLINE void filter8(int8_t mask, uint8_t thresh, uint8_t flat,
uint8_t *op3, uint8_t *op2,
uint8_t *op1, uint8_t *op0,
uint8_t *oq0, uint8_t *oq1,
@@ -158,15 +170,13 @@ static INLINE void filter8(int8_t mask, uint8_t hev, uint8_t flat,
*oq1 = ROUND_POWER_OF_TWO(p1 + p0 + q0 + 2 * q1 + q2 + q3 + q3, 3);
*oq2 = ROUND_POWER_OF_TWO(p0 + q0 + q1 + 2 * q2 + q3 + q3 + q3, 3);
} else {
- filter4(mask, hev, op1, op0, oq0, oq1);
+ filter4(mask, thresh, op1, op0, oq0, oq1);
}
}
-void vp9_mbloop_filter_horizontal_edge_c(uint8_t *s, int p,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_8_c(uint8_t *s, int p, const uint8_t *blimit,
+ const uint8_t *limit, const uint8_t *thresh,
+ int count) {
int i;
// loop filter designed to work using chars so that we can make maximum use
@@ -177,19 +187,24 @@ void vp9_mbloop_filter_horizontal_edge_c(uint8_t *s, int p,
const int8_t mask = filter_mask(*limit, *blimit,
p3, p2, p1, p0, q0, q1, q2, q3);
- const int8_t hev = hev_mask(*thresh, p1, p0, q0, q1);
const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3);
- filter8(mask, hev, flat, s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p,
- s, s + 1 * p, s + 2 * p, s + 3 * p);
+ filter8(mask, *thresh, flat, s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p,
+ s, s + 1 * p, s + 2 * p, s + 3 * p);
++s;
}
}
-void vp9_mbloop_filter_vertical_edge_c(uint8_t *s, int pitch,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_8_dual_c(uint8_t *s, int p, const uint8_t *blimit0,
+ const uint8_t *limit0, const uint8_t *thresh0,
+ const uint8_t *blimit1, const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_horizontal_8_c(s, p, blimit0, limit0, thresh0, 1);
+ vp9_lpf_horizontal_8_c(s + 8, p, blimit1, limit1, thresh1, 1);
+}
+
+void vp9_lpf_vertical_8_c(uint8_t *s, int pitch, const uint8_t *blimit,
+ const uint8_t *limit, const uint8_t *thresh,
+ int count) {
int i;
for (i = 0; i < 8 * count; ++i) {
@@ -197,15 +212,23 @@ void vp9_mbloop_filter_vertical_edge_c(uint8_t *s, int pitch,
const uint8_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3];
const int8_t mask = filter_mask(*limit, *blimit,
p3, p2, p1, p0, q0, q1, q2, q3);
- const int8_t hev = hev_mask(thresh[0], p1, p0, q0, q1);
const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3);
- filter8(mask, hev, flat, s - 4, s - 3, s - 2, s - 1,
- s, s + 1, s + 2, s + 3);
+ filter8(mask, *thresh, flat, s - 4, s - 3, s - 2, s - 1,
+ s, s + 1, s + 2, s + 3);
s += pitch;
}
}
-static INLINE void filter16(int8_t mask, uint8_t hev,
+void vp9_lpf_vertical_8_dual_c(uint8_t *s, int pitch, const uint8_t *blimit0,
+ const uint8_t *limit0, const uint8_t *thresh0,
+ const uint8_t *blimit1, const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ vp9_lpf_vertical_8_c(s, pitch, blimit0, limit0, thresh0, 1);
+ vp9_lpf_vertical_8_c(s + 8 * pitch, pitch, blimit1, limit1,
+ thresh1, 1);
+}
+
+static INLINE void filter16(int8_t mask, uint8_t thresh,
uint8_t flat, uint8_t flat2,
uint8_t *op7, uint8_t *op6,
uint8_t *op5, uint8_t *op4,
@@ -252,15 +275,13 @@ static INLINE void filter16(int8_t mask, uint8_t hev,
*oq6 = ROUND_POWER_OF_TWO(p0 +
q0 + q1 + q2 + q3 + q4 + q5 + q6 * 2 + q7 * 7, 4);
} else {
- filter8(mask, hev, flat, op3, op2, op1, op0, oq0, oq1, oq2, oq3);
+ filter8(mask, thresh, flat, op3, op2, op1, op0, oq0, oq1, oq2, oq3);
}
}
-void vp9_mb_lpf_horizontal_edge_w_c(uint8_t *s, int p,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh,
- int count) {
+void vp9_lpf_horizontal_16_c(uint8_t *s, int p, const uint8_t *blimit,
+ const uint8_t *limit, const uint8_t *thresh,
+ int count) {
int i;
// loop filter designed to work using chars so that we can make maximum use
@@ -270,13 +291,12 @@ void vp9_mb_lpf_horizontal_edge_w_c(uint8_t *s, int p,
const uint8_t q0 = s[0 * p], q1 = s[1 * p], q2 = s[2 * p], q3 = s[3 * p];
const int8_t mask = filter_mask(*limit, *blimit,
p3, p2, p1, p0, q0, q1, q2, q3);
- const int8_t hev = hev_mask(*thresh, p1, p0, q0, q1);
const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3);
const int8_t flat2 = flat_mask5(1,
s[-8 * p], s[-7 * p], s[-6 * p], s[-5 * p], p0,
q0, s[4 * p], s[5 * p], s[6 * p], s[7 * p]);
- filter16(mask, hev, flat, flat2,
+ filter16(mask, *thresh, flat, flat2,
s - 8 * p, s - 7 * p, s - 6 * p, s - 5 * p,
s - 4 * p, s - 3 * p, s - 2 * p, s - 1 * p,
s, s + 1 * p, s + 2 * p, s + 3 * p,
@@ -285,25 +305,35 @@ void vp9_mb_lpf_horizontal_edge_w_c(uint8_t *s, int p,
}
}
-void vp9_mb_lpf_vertical_edge_w_c(uint8_t *s, int p,
- const uint8_t *blimit,
- const uint8_t *limit,
- const uint8_t *thresh) {
+static void mb_lpf_vertical_edge_w(uint8_t *s, int p,
+ const uint8_t *blimit,
+ const uint8_t *limit,
+ const uint8_t *thresh,
+ int count) {
int i;
- for (i = 0; i < 8; ++i) {
+ for (i = 0; i < count; ++i) {
const uint8_t p3 = s[-4], p2 = s[-3], p1 = s[-2], p0 = s[-1];
const uint8_t q0 = s[0], q1 = s[1], q2 = s[2], q3 = s[3];
const int8_t mask = filter_mask(*limit, *blimit,
p3, p2, p1, p0, q0, q1, q2, q3);
- const int8_t hev = hev_mask(*thresh, p1, p0, q0, q1);
const int8_t flat = flat_mask4(1, p3, p2, p1, p0, q0, q1, q2, q3);
const int8_t flat2 = flat_mask5(1, s[-8], s[-7], s[-6], s[-5], p0,
q0, s[4], s[5], s[6], s[7]);
- filter16(mask, hev, flat, flat2,
+ filter16(mask, *thresh, flat, flat2,
s - 8, s - 7, s - 6, s - 5, s - 4, s - 3, s - 2, s - 1,
s, s + 1, s + 2, s + 3, s + 4, s + 5, s + 6, s + 7);
s += p;
}
}
+
+void vp9_lpf_vertical_16_c(uint8_t *s, int p, const uint8_t *blimit,
+ const uint8_t *limit, const uint8_t *thresh) {
+ mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 8);
+}
+
+void vp9_lpf_vertical_16_dual_c(uint8_t *s, int p, const uint8_t *blimit,
+ const uint8_t *limit, const uint8_t *thresh) {
+ mb_lpf_vertical_edge_w(s, p, blimit, limit, thresh, 16);
+}
diff --git a/libvpx/vp9/common/vp9_mv.h b/libvpx/vp9/common/vp9_mv.h
index 31a79b9..3eb7f9d 100644
--- a/libvpx/vp9/common/vp9_mv.h
+++ b/libvpx/vp9/common/vp9_mv.h
@@ -15,7 +15,11 @@
#include "vp9/common/vp9_common.h"
-typedef struct {
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct mv {
int16_t row;
int16_t col;
} MV;
@@ -25,15 +29,19 @@ typedef union int_mv {
MV as_mv;
} int_mv; /* facilitates faster equality tests and copies */
-typedef struct {
+typedef struct mv32 {
int32_t row;
int32_t col;
} MV32;
-static void clamp_mv(MV *mv, int min_col, int max_col,
- int min_row, int max_row) {
+static INLINE void clamp_mv(MV *mv, int min_col, int max_col,
+ int min_row, int max_row) {
mv->col = clamp(mv->col, min_col, max_col);
mv->row = clamp(mv->row, min_row, max_row);
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_MV_H_
diff --git a/libvpx/vp9/common/vp9_mvref_common.c b/libvpx/vp9/common/vp9_mvref_common.c
index 8df8aec..9f2c2df 100644
--- a/libvpx/vp9/common/vp9_mvref_common.c
+++ b/libvpx/vp9/common/vp9_mvref_common.c
@@ -13,6 +13,11 @@
#define MVREF_NEIGHBOURS 8
+typedef struct position {
+ int row;
+ int col;
+} POSITION;
+
typedef enum {
BOTH_ZERO = 0,
ZERO_PLUS_PREDICTED = 1,
@@ -71,7 +76,7 @@ static const int counter_to_context[19] = {
BOTH_INTRA // 18
};
-static const MV mv_ref_blocks[BLOCK_SIZES][MVREF_NEIGHBOURS] = {
+static const POSITION mv_ref_blocks[BLOCK_SIZES][MVREF_NEIGHBOURS] = {
// 4X4
{{-1, 0}, {0, -1}, {-1, -1}, {-2, 0}, {0, -2}, {-2, -1}, {-1, -2}, {-2, -2}},
// 4X8
@@ -172,26 +177,27 @@ static INLINE int_mv scale_mv(const MB_MODE_INFO *mbmi, int ref,
// are inside the borders of the tile.
static INLINE int is_inside(const TileInfo *const tile,
int mi_col, int mi_row, int mi_rows,
- const MV *mv) {
- return !(mi_row + mv->row < 0 ||
- mi_col + mv->col < tile->mi_col_start ||
- mi_row + mv->row >= mi_rows ||
- mi_col + mv->col >= tile->mi_col_end);
+ const POSITION *mi_pos) {
+ return !(mi_row + mi_pos->row < 0 ||
+ mi_col + mi_pos->col < tile->mi_col_start ||
+ mi_row + mi_pos->row >= mi_rows ||
+ mi_col + mi_pos->col >= tile->mi_col_end);
}
// This function searches the neighbourhood of a given MB/SB
// to try and find candidate reference vectors.
-void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
- const TileInfo *const tile,
- MODE_INFO *mi, const MODE_INFO *prev_mi,
- MV_REFERENCE_FRAME ref_frame,
- int_mv *mv_ref_list,
- int block_idx,
- int mi_row, int mi_col) {
+static void find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
+ const TileInfo *const tile,
+ MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
+ int_mv *mv_ref_list,
+ int block, int mi_row, int mi_col) {
const int *ref_sign_bias = cm->ref_frame_sign_bias;
int i, refmv_count = 0;
- const MV *const mv_ref_search = mv_ref_blocks[mi->mbmi.sb_type];
- const MB_MODE_INFO *const prev_mbmi = prev_mi ? &prev_mi->mbmi : NULL;
+ const MODE_INFO *prev_mi = cm->coding_use_prev_mi && cm->prev_mi ?
+ xd->prev_mi_8x8[0] : NULL;
+ const POSITION *const mv_ref_search = mv_ref_blocks[mi->mbmi.sb_type];
+ const MB_MODE_INFO *const prev_mbmi = cm->coding_use_prev_mi && prev_mi ?
+ &prev_mi->mbmi : NULL;
int different_ref_found = 0;
int context_counter = 0;
@@ -202,26 +208,19 @@ void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
// if the size < 8x8 we get the mv from the bmi substructure,
// and we also need to keep a mode count.
for (i = 0; i < 2; ++i) {
- const MV *const mv_ref = &mv_ref_search[i];
+ const POSITION *const mv_ref = &mv_ref_search[i];
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
const MODE_INFO *const candidate_mi = xd->mi_8x8[mv_ref->col + mv_ref->row
* xd->mode_info_stride];
const MB_MODE_INFO *const candidate = &candidate_mi->mbmi;
// Keep counts for entropy encoding.
context_counter += mode_2_counter[candidate->mode];
+ different_ref_found = 1;
- // Check if the candidate comes from the same reference frame.
- if (candidate->ref_frame[0] == ref_frame) {
- ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0,
- mv_ref->col, block_idx));
- different_ref_found = candidate->ref_frame[1] != ref_frame;
- } else {
- if (candidate->ref_frame[1] == ref_frame)
- // Add second motion vector if it has the same ref_frame.
- ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1,
- mv_ref->col, block_idx));
- different_ref_found = 1;
- }
+ if (candidate->ref_frame[0] == ref_frame)
+ ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 0, mv_ref->col, block));
+ else if (candidate->ref_frame[1] == ref_frame)
+ ADD_MV_REF_LIST(get_sub_block_mv(candidate_mi, 1, mv_ref->col, block));
}
}
@@ -229,20 +228,17 @@ void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
// as before except we don't need to keep track of sub blocks or
// mode counts.
for (; i < MVREF_NEIGHBOURS; ++i) {
- const MV *const mv_ref = &mv_ref_search[i];
+ const POSITION *const mv_ref = &mv_ref_search[i];
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
const MB_MODE_INFO *const candidate = &xd->mi_8x8[mv_ref->col +
mv_ref->row
* xd->mode_info_stride]->mbmi;
+ different_ref_found = 1;
- if (candidate->ref_frame[0] == ref_frame) {
+ if (candidate->ref_frame[0] == ref_frame)
ADD_MV_REF_LIST(candidate->mv[0]);
- different_ref_found = candidate->ref_frame[1] != ref_frame;
- } else {
- if (candidate->ref_frame[1] == ref_frame)
- ADD_MV_REF_LIST(candidate->mv[1]);
- different_ref_found = 1;
- }
+ else if (candidate->ref_frame[1] == ref_frame)
+ ADD_MV_REF_LIST(candidate->mv[1]);
}
}
@@ -259,7 +255,7 @@ void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
// different reference frames.
if (different_ref_found) {
for (i = 0; i < MVREF_NEIGHBOURS; ++i) {
- const MV *mv_ref = &mv_ref_search[i];
+ const POSITION *mv_ref = &mv_ref_search[i];
if (is_inside(tile, mi_col, mi_row, cm->mi_rows, mv_ref)) {
const MB_MODE_INFO *const candidate = &xd->mi_8x8[mv_ref->col +
mv_ref->row
@@ -284,3 +280,84 @@ void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i)
clamp_mv_ref(&mv_ref_list[i].as_mv, xd);
}
+
+void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
+ const TileInfo *const tile,
+ MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
+ int_mv *mv_ref_list,
+ int mi_row, int mi_col) {
+ find_mv_refs_idx(cm, xd, tile, mi, ref_frame, mv_ref_list, -1,
+ mi_row, mi_col);
+}
+
+static void lower_mv_precision(MV *mv, int allow_hp) {
+ const int use_hp = allow_hp && vp9_use_mv_hp(mv);
+ if (!use_hp) {
+ if (mv->row & 1)
+ mv->row += (mv->row > 0 ? -1 : 1);
+ if (mv->col & 1)
+ mv->col += (mv->col > 0 ? -1 : 1);
+ }
+}
+
+
+void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
+ int_mv *mvlist, int_mv *nearest, int_mv *near) {
+ int i;
+ // Make sure all the candidates are properly clamped etc
+ for (i = 0; i < MAX_MV_REF_CANDIDATES; ++i) {
+ lower_mv_precision(&mvlist[i].as_mv, allow_hp);
+ clamp_mv2(&mvlist[i].as_mv, xd);
+ }
+ *nearest = mvlist[0];
+ *near = mvlist[1];
+}
+
+void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
+ const TileInfo *const tile,
+ int block, int ref, int mi_row, int mi_col,
+ int_mv *nearest, int_mv *near) {
+ int_mv mv_list[MAX_MV_REF_CANDIDATES];
+ MODE_INFO *const mi = xd->mi_8x8[0];
+ b_mode_info *bmi = mi->bmi;
+ int n;
+
+ assert(MAX_MV_REF_CANDIDATES == 2);
+
+ find_mv_refs_idx(cm, xd, tile, mi, mi->mbmi.ref_frame[ref], mv_list, block,
+ mi_row, mi_col);
+
+ near->as_int = 0;
+ switch (block) {
+ case 0:
+ nearest->as_int = mv_list[0].as_int;
+ near->as_int = mv_list[1].as_int;
+ break;
+ case 1:
+ case 2:
+ nearest->as_int = bmi[0].as_mv[ref].as_int;
+ for (n = 0; n < MAX_MV_REF_CANDIDATES; ++n)
+ if (nearest->as_int != mv_list[n].as_int) {
+ near->as_int = mv_list[n].as_int;
+ break;
+ }
+ break;
+ case 3: {
+ int_mv candidates[2 + MAX_MV_REF_CANDIDATES];
+ candidates[0] = bmi[1].as_mv[ref];
+ candidates[1] = bmi[0].as_mv[ref];
+ candidates[2] = mv_list[0];
+ candidates[3] = mv_list[1];
+
+ nearest->as_int = bmi[2].as_mv[ref].as_int;
+ for (n = 0; n < 2 + MAX_MV_REF_CANDIDATES; ++n)
+ if (nearest->as_int != candidates[n].as_int) {
+ near->as_int = candidates[n].as_int;
+ break;
+ }
+ break;
+ }
+ default:
+ assert("Invalid block index.");
+ }
+}
diff --git a/libvpx/vp9/common/vp9_mvref_common.h b/libvpx/vp9/common/vp9_mvref_common.h
index ce4c559..903ac02 100644
--- a/libvpx/vp9/common/vp9_mvref_common.h
+++ b/libvpx/vp9/common/vp9_mvref_common.h
@@ -7,29 +7,46 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VP9_COMMON_VP9_MVREF_COMMON_H_
+#define VP9_COMMON_VP9_MVREF_COMMON_H_
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_blockd.h"
-#ifndef VP9_COMMON_VP9_MVREF_COMMON_H_
-#define VP9_COMMON_VP9_MVREF_COMMON_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LEFT_TOP_MARGIN ((VP9_ENC_BORDER_IN_PIXELS - VP9_INTERP_EXTEND) << 3)
+#define RIGHT_BOTTOM_MARGIN ((VP9_ENC_BORDER_IN_PIXELS -\
+ VP9_INTERP_EXTEND) << 3)
-void vp9_find_mv_refs_idx(const VP9_COMMON *cm, const MACROBLOCKD *xd,
- const TileInfo *const tile,
- MODE_INFO *mi, const MODE_INFO *prev_mi,
- MV_REFERENCE_FRAME ref_frame,
- int_mv *mv_ref_list,
- int block_idx,
- int mi_row, int mi_col);
-
-static INLINE void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
- const TileInfo *const tile,
- MODE_INFO *mi, const MODE_INFO *prev_mi,
- MV_REFERENCE_FRAME ref_frame,
- int_mv *mv_ref_list,
- int mi_row, int mi_col) {
- vp9_find_mv_refs_idx(cm, xd, tile, mi, prev_mi, ref_frame,
- mv_ref_list, -1, mi_row, mi_col);
+// TODO(jingning): this mv clamping function should be block size dependent.
+static INLINE void clamp_mv2(MV *mv, const MACROBLOCKD *xd) {
+ clamp_mv(mv, xd->mb_to_left_edge - LEFT_TOP_MARGIN,
+ xd->mb_to_right_edge + RIGHT_BOTTOM_MARGIN,
+ xd->mb_to_top_edge - LEFT_TOP_MARGIN,
+ xd->mb_to_bottom_edge + RIGHT_BOTTOM_MARGIN);
}
+void vp9_find_mv_refs(const VP9_COMMON *cm, const MACROBLOCKD *xd,
+ const TileInfo *const tile,
+ MODE_INFO *mi, MV_REFERENCE_FRAME ref_frame,
+ int_mv *mv_ref_list, int mi_row, int mi_col);
+
+// check a list of motion vectors by sad score using a number rows of pixels
+// above and a number cols of pixels in the left to select the one with best
+// score to use as ref motion vector
+void vp9_find_best_ref_mvs(MACROBLOCKD *xd, int allow_hp,
+ int_mv *mvlist, int_mv *nearest, int_mv *near);
+
+void vp9_append_sub8x8_mvs_for_idx(VP9_COMMON *cm, MACROBLOCKD *xd,
+ const TileInfo *const tile,
+ int block, int ref, int mi_row, int mi_col,
+ int_mv *nearest, int_mv *near);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_MVREF_COMMON_H_
diff --git a/libvpx/vp9/common/vp9_onyx.h b/libvpx/vp9/common/vp9_onyx.h
deleted file mode 100644
index 452dd6b..0000000
--- a/libvpx/vp9/common/vp9_onyx.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_COMMON_VP9_ONYX_H_
-#define VP9_COMMON_VP9_ONYX_H_
-
-#ifdef __cplusplus
-extern "C"
-{ // NOLINT
-#endif
-
-#include "./vpx_config.h"
-#include "vpx/internal/vpx_codec_internal.h"
-#include "vpx/vp8cx.h"
-#include "vpx_scale/yv12config.h"
-#include "vp9/common/vp9_ppflags.h"
-
-#define MAX_SEGMENTS 8
-
- typedef int *VP9_PTR;
-
- /* Create/destroy static data structures. */
-
- typedef enum {
- NORMAL = 0,
- FOURFIVE = 1,
- THREEFIVE = 2,
- ONETWO = 3
- } VPX_SCALING;
-
- typedef enum {
- VP9_LAST_FLAG = 1,
- VP9_GOLD_FLAG = 2,
- VP9_ALT_FLAG = 4
- } VP9_REFFRAME;
-
-
- typedef enum {
- USAGE_STREAM_FROM_SERVER = 0x0,
- USAGE_LOCAL_FILE_PLAYBACK = 0x1,
- USAGE_CONSTRAINED_QUALITY = 0x2,
- USAGE_CONSTANT_QUALITY = 0x3,
- } END_USAGE;
-
-
- typedef enum {
- MODE_GOODQUALITY = 0x1,
- MODE_BESTQUALITY = 0x2,
- MODE_FIRSTPASS = 0x3,
- MODE_SECONDPASS = 0x4,
- MODE_SECONDPASS_BEST = 0x5,
- } MODE;
-
- typedef enum {
- FRAMEFLAGS_KEY = 1,
- FRAMEFLAGS_GOLDEN = 2,
- FRAMEFLAGS_ALTREF = 4,
- } FRAMETYPE_FLAGS;
-
- typedef struct {
- int version; // 4 versions of bitstream defined:
- // 0 - best quality/slowest decode,
- // 3 - lowest quality/fastest decode
- int width; // width of data passed to the compressor
- int height; // height of data passed to the compressor
- double framerate; // set to passed in framerate
- int64_t target_bandwidth; // bandwidth to be used in kilobits per second
-
- int noise_sensitivity; // pre processing blur: recommendation 0
- int Sharpness; // sharpening output: recommendation 0:
- int cpu_used;
- unsigned int rc_max_intra_bitrate_pct;
-
- // mode ->
- // (0)=Realtime/Live Encoding. This mode is optimized for realtime
- // encoding (for example, capturing a television signal or feed from
- // a live camera). ( speed setting controls how fast )
- // (1)=Good Quality Fast Encoding. The encoder balances quality with the
- // amount of time it takes to encode the output. ( speed setting
- // controls how fast )
- // (2)=One Pass - Best Quality. The encoder places priority on the
- // quality of the output over encoding speed. The output is compressed
- // at the highest possible quality. This option takes the longest
- // amount of time to encode. ( speed setting ignored )
- // (3)=Two Pass - First Pass. The encoder generates a file of statistics
- // for use in the second encoding pass. ( speed setting controls how
- // fast )
- // (4)=Two Pass - Second Pass. The encoder uses the statistics that were
- // generated in the first encoding pass to create the compressed
- // output. ( speed setting controls how fast )
- // (5)=Two Pass - Second Pass Best. The encoder uses the statistics that
- // were generated in the first encoding pass to create the compressed
- // output using the highest possible quality, and taking a
- // longer amount of time to encode.. ( speed setting ignored )
- int Mode;
-
- // Key Framing Operations
- int auto_key; // autodetect cut scenes and set the keyframes
- int key_freq; // maximum distance to key frame.
-
- int allow_lag; // allow lagged compression (if 0 lagin frames is ignored)
- int lag_in_frames; // how many frames lag before we start encoding
-
- // ----------------------------------------------------------------
- // DATARATE CONTROL OPTIONS
-
- int end_usage; // vbr or cbr
-
- // buffer targeting aggressiveness
- int under_shoot_pct;
- int over_shoot_pct;
-
- // buffering parameters
- int64_t starting_buffer_level; // in seconds
- int64_t optimal_buffer_level;
- int64_t maximum_buffer_size;
-
- // controlling quality
- int fixed_q;
- int worst_allowed_q;
- int best_allowed_q;
- int cq_level;
- int lossless;
-
- // two pass datarate control
- int two_pass_vbrbias; // two pass datarate control tweaks
- int two_pass_vbrmin_section;
- int two_pass_vbrmax_section;
- // END DATARATE CONTROL OPTIONS
- // ----------------------------------------------------------------
-
- // Spatial scalability
- int ss_number_layers;
-
- // these parameters aren't to be used in final build don't use!!!
- int play_alternate;
- int alt_freq;
-
- int encode_breakout; // early breakout : for video conf recommend 800
-
- /* Bitfield defining the error resiliency features to enable.
- * Can provide decodable frames after losses in previous
- * frames and decodable partitions after losses in the same frame.
- */
- unsigned int error_resilient_mode;
-
- /* Bitfield defining the parallel decoding mode where the
- * decoding in successive frames may be conducted in parallel
- * just by decoding the frame headers.
- */
- unsigned int frame_parallel_decoding_mode;
-
- int arnr_max_frames;
- int arnr_strength;
- int arnr_type;
-
- int tile_columns;
- int tile_rows;
-
- struct vpx_fixed_buf two_pass_stats_in;
- struct vpx_codec_pkt_list *output_pkt_list;
-
- vp8e_tuning tuning;
- } VP9_CONFIG;
-
-
- void vp9_initialize_enc();
-
- VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf);
- void vp9_remove_compressor(VP9_PTR *comp);
-
- void vp9_change_config(VP9_PTR onyx, VP9_CONFIG *oxcf);
-
- // receive a frames worth of data. caller can assume that a copy of this
- // frame is made and not just a copy of the pointer..
- int vp9_receive_raw_frame(VP9_PTR comp, unsigned int frame_flags,
- YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
- int64_t end_time_stamp);
-
- int vp9_get_compressed_data(VP9_PTR comp, unsigned int *frame_flags,
- unsigned long *size, unsigned char *dest,
- int64_t *time_stamp, int64_t *time_end,
- int flush);
-
- int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest,
- vp9_ppflags_t *flags);
-
- int vp9_use_as_reference(VP9_PTR comp, int ref_frame_flags);
-
- int vp9_update_reference(VP9_PTR comp, int ref_frame_flags);
-
- int vp9_copy_reference_enc(VP9_PTR comp, VP9_REFFRAME ref_frame_flag,
- YV12_BUFFER_CONFIG *sd);
-
- int vp9_get_reference_enc(VP9_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
-
- int vp9_set_reference_enc(VP9_PTR comp, VP9_REFFRAME ref_frame_flag,
- YV12_BUFFER_CONFIG *sd);
-
- int vp9_update_entropy(VP9_PTR comp, int update);
-
- int vp9_set_roimap(VP9_PTR comp, unsigned char *map,
- unsigned int rows, unsigned int cols,
- int delta_q[MAX_SEGMENTS],
- int delta_lf[MAX_SEGMENTS],
- unsigned int threshold[MAX_SEGMENTS]);
-
- int vp9_set_active_map(VP9_PTR comp, unsigned char *map,
- unsigned int rows, unsigned int cols);
-
- int vp9_set_internal_size(VP9_PTR comp,
- VPX_SCALING horiz_mode, VPX_SCALING vert_mode);
-
- int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
- unsigned int height);
-
- void vp9_set_svc(VP9_PTR comp, int use_svc);
-
- int vp9_get_quantizer(VP9_PTR c);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // VP9_COMMON_VP9_ONYX_H_
diff --git a/libvpx/vp9/common/vp9_onyxc_int.h b/libvpx/vp9/common/vp9_onyxc_int.h
index a2af57a..52889f7 100644
--- a/libvpx/vp9/common/vp9_onyxc_int.h
+++ b/libvpx/vp9/common/vp9_onyxc_int.h
@@ -18,6 +18,7 @@
#include "vp9/common/vp9_entropymv.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
+#include "vp9/common/vp9_frame_buffers.h"
#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_tile_common.h"
@@ -25,62 +26,42 @@
#include "vp9/common/vp9_postproc.h"
#endif
-#define ALLOWED_REFS_PER_FRAME 3
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define REFS_PER_FRAME 3
-#define NUM_REF_FRAMES_LOG2 3
-#define NUM_REF_FRAMES (1 << NUM_REF_FRAMES_LOG2)
+#define REF_FRAMES_LOG2 3
+#define REF_FRAMES (1 << REF_FRAMES_LOG2)
// 1 scratch frame for the new frame, 3 for scaled references on the encoder
// TODO(jkoleszar): These 3 extra references could probably come from the
// normal reference pool.
-#define NUM_YV12_BUFFERS (NUM_REF_FRAMES + 4)
-
-#define NUM_FRAME_CONTEXTS_LOG2 2
-#define NUM_FRAME_CONTEXTS (1 << NUM_FRAME_CONTEXTS_LOG2)
-
-typedef struct frame_contexts {
- vp9_prob y_mode_prob[BLOCK_SIZE_GROUPS][INTRA_MODES - 1];
- vp9_prob uv_mode_prob[INTRA_MODES][INTRA_MODES - 1];
- vp9_prob partition_prob[PARTITION_CONTEXTS][PARTITION_TYPES - 1];
- vp9_coeff_probs_model coef_probs[TX_SIZES][BLOCK_TYPES];
- vp9_prob switchable_interp_prob[SWITCHABLE_FILTER_CONTEXTS]
- [SWITCHABLE_FILTERS - 1];
- vp9_prob inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1];
- vp9_prob intra_inter_prob[INTRA_INTER_CONTEXTS];
- vp9_prob comp_inter_prob[COMP_INTER_CONTEXTS];
- vp9_prob single_ref_prob[REF_CONTEXTS][2];
- vp9_prob comp_ref_prob[REF_CONTEXTS];
- struct tx_probs tx_probs;
- vp9_prob mbskip_probs[MBSKIP_CONTEXTS];
- nmv_context nmvc;
-} FRAME_CONTEXT;
+#define FRAME_BUFFERS (REF_FRAMES + 4)
-typedef struct {
- unsigned int y_mode[BLOCK_SIZE_GROUPS][INTRA_MODES];
- unsigned int uv_mode[INTRA_MODES][INTRA_MODES];
- unsigned int partition[PARTITION_CONTEXTS][PARTITION_TYPES];
- vp9_coeff_count_model coef[TX_SIZES][BLOCK_TYPES];
- unsigned int eob_branch[TX_SIZES][BLOCK_TYPES][REF_TYPES]
- [COEF_BANDS][PREV_COEF_CONTEXTS];
- unsigned int switchable_interp[SWITCHABLE_FILTER_CONTEXTS]
- [SWITCHABLE_FILTERS];
- unsigned int inter_mode[INTER_MODE_CONTEXTS][INTER_MODES];
- unsigned int intra_inter[INTRA_INTER_CONTEXTS][2];
- unsigned int comp_inter[COMP_INTER_CONTEXTS][2];
- unsigned int single_ref[REF_CONTEXTS][2][2];
- unsigned int comp_ref[REF_CONTEXTS][2];
- struct tx_counts tx;
- unsigned int mbskip[MBSKIP_CONTEXTS][2];
- nmv_context_counts mv;
-} FRAME_COUNTS;
+#define FRAME_CONTEXTS_LOG2 2
+#define FRAME_CONTEXTS (1 << FRAME_CONTEXTS_LOG2)
+
+extern const struct {
+ PARTITION_CONTEXT above;
+ PARTITION_CONTEXT left;
+} partition_context_lookup[BLOCK_SIZES];
typedef enum {
- SINGLE_PREDICTION_ONLY = 0,
- COMP_PREDICTION_ONLY = 1,
- HYBRID_PREDICTION = 2,
- NB_PREDICTION_TYPES = 3,
-} COMPPREDMODE_TYPE;
+ SINGLE_REFERENCE = 0,
+ COMPOUND_REFERENCE = 1,
+ REFERENCE_MODE_SELECT = 2,
+ REFERENCE_MODES = 3,
+} REFERENCE_MODE;
+
+
+typedef struct {
+ int ref_count;
+ vpx_codec_frame_buffer_t raw_frame_buffer;
+ YV12_BUFFER_CONFIG buf;
+} RefCntBuffer;
typedef struct VP9Common {
struct vpx_internal_error_info error;
@@ -108,17 +89,16 @@ typedef struct VP9Common {
YV12_BUFFER_CONFIG *frame_to_show;
- YV12_BUFFER_CONFIG yv12_fb[NUM_YV12_BUFFERS];
- int fb_idx_ref_cnt[NUM_YV12_BUFFERS]; /* reference counts */
- int ref_frame_map[NUM_REF_FRAMES]; /* maps fb_idx to reference slot */
+ RefCntBuffer frame_bufs[FRAME_BUFFERS];
+
+ int ref_frame_map[REF_FRAMES]; /* maps fb_idx to reference slot */
// TODO(jkoleszar): could expand active_ref_idx to 4, with 0 as intra, and
// roll new_fb_idx into it.
- // Each frame can reference ALLOWED_REFS_PER_FRAME buffers
- int active_ref_idx[ALLOWED_REFS_PER_FRAME];
- struct scale_factors active_ref_scale[ALLOWED_REFS_PER_FRAME];
- struct scale_factors_common active_ref_scale_comm[ALLOWED_REFS_PER_FRAME];
+ // Each frame can reference REFS_PER_FRAME buffers
+ RefBuffer frame_refs[REFS_PER_FRAME];
+
int new_fb_idx;
YV12_BUFFER_CONFIG post_proc_buffer;
@@ -128,6 +108,7 @@ typedef struct VP9Common {
int show_frame;
int last_show_frame;
+ int show_existing_frame;
// Flag signaling that the frame is encoded using only INTRA modes.
int intra_only;
@@ -175,7 +156,7 @@ typedef struct VP9Common {
// Persistent mb segment id map used in prediction.
unsigned char *last_frame_seg_map;
- INTERPOLATION_TYPE mcomp_filter_type;
+ INTERP_FILTER interp_filter;
loop_filter_info_n lf_info;
@@ -190,10 +171,10 @@ typedef struct VP9Common {
int allow_comp_inter_inter;
MV_REFERENCE_FRAME comp_fixed_ref;
MV_REFERENCE_FRAME comp_var_ref[2];
- COMPPREDMODE_TYPE comp_pred_mode;
+ REFERENCE_MODE reference_mode;
FRAME_CONTEXT fc; /* this frame entropy */
- FRAME_CONTEXT frame_contexts[NUM_FRAME_CONTEXTS];
+ FRAME_CONTEXT frame_contexts[FRAME_CONTEXTS];
unsigned int frame_context_idx; /* Context to use/update */
FRAME_COUNTS counts;
@@ -207,45 +188,54 @@ typedef struct VP9Common {
int error_resilient_mode;
int frame_parallel_decoding_mode;
+ // Flag indicates if prev_mi can be used in coding:
+ // 0: encoder assumes decoder does not have prev_mi
+ // 1: encoder assumes decoder has and uses prev_mi
+ unsigned int coding_use_prev_mi;
+
int log2_tile_cols, log2_tile_rows;
-} VP9_COMMON;
-// ref == 0 => LAST_FRAME
-// ref == 1 => GOLDEN_FRAME
-// ref == 2 => ALTREF_FRAME
-static YV12_BUFFER_CONFIG *get_frame_ref_buffer(VP9_COMMON *cm, int ref) {
- return &cm->yv12_fb[cm->active_ref_idx[ref]];
-}
+ // Private data associated with the frame buffer callbacks.
+ void *cb_priv;
+ vpx_get_frame_buffer_cb_fn_t get_fb_cb;
+ vpx_release_frame_buffer_cb_fn_t release_fb_cb;
-static YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) {
- return &cm->yv12_fb[cm->new_fb_idx];
+ // Handles memory for the codec.
+ InternalFrameBufferList int_frame_buffers;
+} VP9_COMMON;
+
+static INLINE YV12_BUFFER_CONFIG *get_frame_new_buffer(VP9_COMMON *cm) {
+ return &cm->frame_bufs[cm->new_fb_idx].buf;
}
-static int get_free_fb(VP9_COMMON *cm) {
+static INLINE int get_free_fb(VP9_COMMON *cm) {
int i;
- for (i = 0; i < NUM_YV12_BUFFERS; i++)
- if (cm->fb_idx_ref_cnt[i] == 0)
+ for (i = 0; i < FRAME_BUFFERS; i++)
+ if (cm->frame_bufs[i].ref_count == 0)
break;
- assert(i < NUM_YV12_BUFFERS);
- cm->fb_idx_ref_cnt[i] = 1;
+ assert(i < FRAME_BUFFERS);
+ cm->frame_bufs[i].ref_count = 1;
return i;
}
-static void ref_cnt_fb(int *buf, int *idx, int new_idx) {
- if (buf[*idx] > 0)
- buf[*idx]--;
+static INLINE void ref_cnt_fb(RefCntBuffer *bufs, int *idx, int new_idx) {
+ const int ref_index = *idx;
+
+ if (ref_index >= 0 && bufs[ref_index].ref_count > 0)
+ bufs[ref_index].ref_count--;
*idx = new_idx;
- buf[new_idx]++;
+ bufs[new_idx].ref_count++;
}
-static int mi_cols_aligned_to_sb(int n_mis) {
+static INLINE int mi_cols_aligned_to_sb(int n_mis) {
return ALIGN_POWER_OF_TWO(n_mis, MI_BLOCK_SIZE_LOG2);
}
-static INLINE const vp9_prob* get_partition_probs(VP9_COMMON *cm, int ctx) {
+static INLINE const vp9_prob* get_partition_probs(const VP9_COMMON *cm,
+ int ctx) {
return cm->frame_type == KEY_FRAME ? vp9_kf_partition_probs[ctx]
: cm->fc.partition_prob[ctx];
}
@@ -265,10 +255,10 @@ static INLINE void set_skip_context(
}
}
-static void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
- int mi_row, int bh,
- int mi_col, int bw,
- int mi_rows, int mi_cols) {
+static INLINE void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
+ int mi_row, int bh,
+ int mi_col, int bw,
+ int mi_rows, int mi_cols) {
xd->mb_to_top_edge = -((mi_row * MI_SIZE) * 8);
xd->mb_to_bottom_edge = ((mi_rows - bh - mi_row) * MI_SIZE) * 8;
xd->mb_to_left_edge = -((mi_col * MI_SIZE) * 8);
@@ -279,10 +269,9 @@ static void set_mi_row_col(MACROBLOCKD *xd, const TileInfo *const tile,
xd->left_available = (mi_col > tile->mi_col_start);
}
-static void set_prev_mi(VP9_COMMON *cm) {
+static INLINE void set_prev_mi(VP9_COMMON *cm) {
const int use_prev_in_find_mv_refs = cm->width == cm->last_width &&
cm->height == cm->last_height &&
- !cm->error_resilient_mode &&
!cm->intra_only &&
cm->last_show_frame;
// Special case: set prev_mi to NULL when the previous mode info
@@ -298,54 +287,46 @@ static INLINE int frame_is_intra_only(const VP9_COMMON *const cm) {
static INLINE void update_partition_context(
PARTITION_CONTEXT *above_seg_context,
PARTITION_CONTEXT left_seg_context[8],
- int mi_row, int mi_col,
- BLOCK_SIZE sb_type,
- BLOCK_SIZE sb_size) {
- PARTITION_CONTEXT *above_ctx = above_seg_context + mi_col;
- PARTITION_CONTEXT *left_ctx = left_seg_context + (mi_row & MI_MASK);
-
- const int bsl = b_width_log2(sb_size), bs = (1 << bsl) / 2;
- const int bwl = b_width_log2(sb_type);
- const int bhl = b_height_log2(sb_type);
- const int boffset = b_width_log2(BLOCK_64X64) - bsl;
- const char pcval0 = ~(0xe << boffset);
- const char pcval1 = ~(0xf << boffset);
- const char pcvalue[2] = {pcval0, pcval1};
-
- assert(MAX(bwl, bhl) <= bsl);
+ int mi_row, int mi_col, BLOCK_SIZE subsize, BLOCK_SIZE bsize) {
+ PARTITION_CONTEXT *const above_ctx = above_seg_context + mi_col;
+ PARTITION_CONTEXT *const left_ctx = left_seg_context + (mi_row & MI_MASK);
+
+ // num_4x4_blocks_wide_lookup[bsize] / 2
+ const int bs = num_8x8_blocks_wide_lookup[bsize];
// update the partition context at the end notes. set partition bits
// of block sizes larger than the current one to be one, and partition
// bits of smaller block sizes to be zero.
- vpx_memset(above_ctx, pcvalue[bwl == bsl], bs);
- vpx_memset(left_ctx, pcvalue[bhl == bsl], bs);
+ vpx_memset(above_ctx, partition_context_lookup[subsize].above, bs);
+ vpx_memset(left_ctx, partition_context_lookup[subsize].left, bs);
}
static INLINE int partition_plane_context(
const PARTITION_CONTEXT *above_seg_context,
const PARTITION_CONTEXT left_seg_context[8],
- int mi_row, int mi_col,
- BLOCK_SIZE sb_type) {
+ int mi_row, int mi_col, BLOCK_SIZE bsize) {
const PARTITION_CONTEXT *above_ctx = above_seg_context + mi_col;
const PARTITION_CONTEXT *left_ctx = left_seg_context + (mi_row & MI_MASK);
- int bsl = mi_width_log2(sb_type), bs = 1 << bsl;
+ const int bsl = mi_width_log2(bsize);
+ const int bs = 1 << bsl;
int above = 0, left = 0, i;
- int boffset = mi_width_log2(BLOCK_64X64) - bsl;
- assert(mi_width_log2(sb_type) == mi_height_log2(sb_type));
+ assert(b_width_log2(bsize) == b_height_log2(bsize));
assert(bsl >= 0);
- assert(boffset >= 0);
-
- for (i = 0; i < bs; i++)
- above |= (above_ctx[i] & (1 << boffset));
- for (i = 0; i < bs; i++)
- left |= (left_ctx[i] & (1 << boffset));
- above = (above > 0);
- left = (left > 0);
+ for (i = 0; i < bs; i++) {
+ above |= above_ctx[i];
+ left |= left_ctx[i];
+ }
+ above = (above & bs) > 0;
+ left = (left & bs) > 0;
return (left * 2 + above) + bsl * PARTITION_PLOFFSET;
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_ONYXC_INT_H_
diff --git a/libvpx/vp9/common/vp9_postproc.c b/libvpx/vp9/common/vp9_postproc.c
index 212a28a..7baa9ee 100644
--- a/libvpx/vp9/common/vp9_postproc.c
+++ b/libvpx/vp9/common/vp9_postproc.c
@@ -13,13 +13,16 @@
#include <stdio.h>
#include "./vpx_config.h"
+#include "./vpx_scale_rtcd.h"
+#include "./vp9_rtcd.h"
+
+#include "vpx_scale/vpx_scale.h"
#include "vpx_scale/yv12config.h"
+
+#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_postproc.h"
-#include "vp9/common/vp9_textblit.h"
-#include "vpx_scale/vpx_scale.h"
#include "vp9/common/vp9_systemdependent.h"
-#include "./vp9_rtcd.h"
-#include "./vpx_scale_rtcd.h"
+#include "vp9/common/vp9_textblit.h"
#define RGB_TO_YUV(t) \
( (0.257*(float)(t >> 16)) + (0.504*(float)(t >> 8 & 0xff)) + \
@@ -127,9 +130,6 @@ const short vp9_rv[] = {
0, 9, 5, 5, 11, 10, 13, 9, 10, 13,
};
-
-/****************************************************************************
- */
void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr,
uint8_t *dst_ptr,
int src_pixels_per_line,
@@ -371,7 +371,7 @@ void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst,
}
}
-double vp9_gaussian(double sigma, double mu, double x) {
+static double gaussian(double sigma, double mu, double x) {
return 1 / (sigma * sqrt(2.0 * 3.14159265)) *
(exp(-(x - mu) * (x - mu) / (2 * sigma * sigma)));
}
@@ -396,7 +396,7 @@ static void fillrd(struct postproc_state *state, int q, int a) {
next = 0;
for (i = -32; i < 32; i++) {
- int a = (int)(.5 + 256 * vp9_gaussian(sigma, 0, i));
+ int a = (int)(0.5 + 256 * gaussian(sigma, 0, i));
if (a) {
for (j = 0; j < a; j++) {
@@ -425,27 +425,6 @@ static void fillrd(struct postproc_state *state, int q, int a) {
state->last_noise = a;
}
-/****************************************************************************
- *
- * ROUTINE : plane_add_noise_c
- *
- * INPUTS : unsigned char *Start starting address of buffer to
- * add gaussian noise to
- * unsigned int width width of plane
- * unsigned int height height of plane
- * int pitch distance between subsequent lines of frame
- * int q quantizer used to determine amount of noise
- * to add
- *
- * OUTPUTS : None.
- *
- * RETURNS : void.
- *
- * FUNCTION : adds gaussian noise to a plane of pixels
- *
- * SPECIAL NOTES : None.
- *
- ****************************************************************************/
void vp9_plane_add_noise_c(uint8_t *start, char *noise,
char blackclamp[16],
char whiteclamp[16],
@@ -628,49 +607,40 @@ static void constrain_line(int x0, int *x1, int y0, int *y1,
int vp9_post_proc_frame(struct VP9Common *cm,
YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *ppflags) {
- int q = cm->lf.filter_level * 10 / 6;
- int flags = ppflags->post_proc_flag;
- int deblock_level = ppflags->deblocking_level;
- int noise_level = ppflags->noise_level;
+ const int q = MIN(63, cm->lf.filter_level * 10 / 6);
+ const int flags = ppflags->post_proc_flag;
+ YV12_BUFFER_CONFIG *const ppbuf = &cm->post_proc_buffer;
+ struct postproc_state *const ppstate = &cm->postproc_state;
if (!cm->frame_to_show)
return -1;
- if (q > 63)
- q = 63;
-
if (!flags) {
*dest = *cm->frame_to_show;
return 0;
}
-#if ARCH_X86||ARCH_X86_64
- vpx_reset_mmx_state();
-#endif
+ vp9_clear_system_state();
if (flags & VP9D_DEMACROBLOCK) {
- deblock_and_de_macro_block(cm->frame_to_show, &cm->post_proc_buffer,
- q + (deblock_level - 5) * 10, 1, 0);
+ deblock_and_de_macro_block(cm->frame_to_show, ppbuf,
+ q + (ppflags->deblocking_level - 5) * 10, 1, 0);
} else if (flags & VP9D_DEBLOCK) {
- vp9_deblock(cm->frame_to_show, &cm->post_proc_buffer, q);
+ vp9_deblock(cm->frame_to_show, ppbuf, q);
} else {
- vp8_yv12_copy_frame(cm->frame_to_show, &cm->post_proc_buffer);
+ vp8_yv12_copy_frame(cm->frame_to_show, ppbuf);
}
if (flags & VP9D_ADDNOISE) {
- if (cm->postproc_state.last_q != q
- || cm->postproc_state.last_noise != noise_level) {
- fillrd(&cm->postproc_state, 63 - q, noise_level);
+ const int noise_level = ppflags->noise_level;
+ if (ppstate->last_q != q ||
+ ppstate->last_noise != noise_level) {
+ fillrd(ppstate, 63 - q, noise_level);
}
- vp9_plane_add_noise(cm->post_proc_buffer.y_buffer,
- cm->postproc_state.noise,
- cm->postproc_state.blackclamp,
- cm->postproc_state.whiteclamp,
- cm->postproc_state.bothclamp,
- cm->post_proc_buffer.y_width,
- cm->post_proc_buffer.y_height,
- cm->post_proc_buffer.y_stride);
+ vp9_plane_add_noise(ppbuf->y_buffer, ppstate->noise, ppstate->blackclamp,
+ ppstate->whiteclamp, ppstate->bothclamp,
+ ppbuf->y_width, ppbuf->y_height, ppbuf->y_stride);
}
#if 0 && CONFIG_POSTPROC_VISUALIZER
@@ -684,16 +654,14 @@ int vp9_post_proc_frame(struct VP9Common *cm,
cm->filter_level,
flags,
cm->mb_cols, cm->mb_rows);
- vp9_blit_text(message, cm->post_proc_buffer.y_buffer,
- cm->post_proc_buffer.y_stride);
+ vp9_blit_text(message, ppbuf->y_buffer, ppbuf->y_stride);
}
if (flags & VP9D_DEBUG_TXT_MBLK_MODES) {
int i, j;
uint8_t *y_ptr;
- YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
- int mb_rows = post->y_height >> 4;
- int mb_cols = post->y_width >> 4;
+ int mb_rows = ppbuf->y_height >> 4;
+ int mb_cols = ppbuf->y_width >> 4;
int mb_index = 0;
MODE_INFO *mi = cm->mi;
@@ -719,9 +687,8 @@ int vp9_post_proc_frame(struct VP9Common *cm,
if (flags & VP9D_DEBUG_TXT_DC_DIFF) {
int i, j;
uint8_t *y_ptr;
- YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
- int mb_rows = post->y_height >> 4;
- int mb_cols = post->y_width >> 4;
+ int mb_rows = ppbuf->y_height >> 4;
+ int mb_cols = ppbuf->y_width >> 4;
int mb_index = 0;
MODE_INFO *mi = cm->mi;
@@ -733,7 +700,7 @@ int vp9_post_proc_frame(struct VP9Common *cm,
char zz[4];
int dc_diff = !(mi[mb_index].mbmi.mode != I4X4_PRED &&
mi[mb_index].mbmi.mode != SPLITMV &&
- mi[mb_index].mbmi.skip_coeff);
+ mi[mb_index].mbmi.skip);
if (cm->frame_type == KEY_FRAME)
snprintf(zz, sizeof(zz) - 1, "a");
@@ -755,17 +722,15 @@ int vp9_post_proc_frame(struct VP9Common *cm,
snprintf(message, sizeof(message),
"Bitrate: %10.2f framerate: %10.2f ",
cm->bitrate, cm->framerate);
- vp9_blit_text(message, cm->post_proc_buffer.y_buffer,
- cm->post_proc_buffer.y_stride);
+ vp9_blit_text(message, ppbuf->y_buffer, ppbuf->y_stride);
}
/* Draw motion vectors */
if ((flags & VP9D_DEBUG_DRAW_MV) && ppflags->display_mv_flag) {
- YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
- int width = post->y_width;
- int height = post->y_height;
- uint8_t *y_buffer = cm->post_proc_buffer.y_buffer;
- int y_stride = cm->post_proc_buffer.y_stride;
+ int width = ppbuf->y_width;
+ int height = ppbuf->y_height;
+ uint8_t *y_buffer = ppbuf->y_buffer;
+ int y_stride = ppbuf->y_stride;
MODE_INFO *mi = cm->mi;
int x0, y0;
@@ -904,13 +869,12 @@ int vp9_post_proc_frame(struct VP9Common *cm,
if ((flags & VP9D_DEBUG_CLR_BLK_MODES)
&& (ppflags->display_mb_modes_flag || ppflags->display_b_modes_flag)) {
int y, x;
- YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
- int width = post->y_width;
- int height = post->y_height;
- uint8_t *y_ptr = cm->post_proc_buffer.y_buffer;
- uint8_t *u_ptr = cm->post_proc_buffer.u_buffer;
- uint8_t *v_ptr = cm->post_proc_buffer.v_buffer;
- int y_stride = cm->post_proc_buffer.y_stride;
+ int width = ppbuf->y_width;
+ int height = ppbuf->y_height;
+ uint8_t *y_ptr = ppbuf->y_buffer;
+ uint8_t *u_ptr = ppbuf->u_buffer;
+ uint8_t *v_ptr = ppbuf->v_buffer;
+ int y_stride = ppbuf->y_stride;
MODE_INFO *mi = cm->mi;
for (y = 0; y < height; y += 16) {
@@ -969,13 +933,12 @@ int vp9_post_proc_frame(struct VP9Common *cm,
if ((flags & VP9D_DEBUG_CLR_FRM_REF_BLKS) &&
ppflags->display_ref_frame_flag) {
int y, x;
- YV12_BUFFER_CONFIG *post = &cm->post_proc_buffer;
- int width = post->y_width;
- int height = post->y_height;
- uint8_t *y_ptr = cm->post_proc_buffer.y_buffer;
- uint8_t *u_ptr = cm->post_proc_buffer.u_buffer;
- uint8_t *v_ptr = cm->post_proc_buffer.v_buffer;
- int y_stride = cm->post_proc_buffer.y_stride;
+ int width = ppbuf->y_width;
+ int height = ppbuf->y_height;
+ uint8_t *y_ptr = ppbuf->y_buffer;
+ uint8_t *u_ptr = ppbuf->u_buffer;
+ uint8_t *v_ptr = ppbuf->v_buffer;
+ int y_stride = ppbuf->y_stride;
MODE_INFO *mi = cm->mi;
for (y = 0; y < height; y += 16) {
@@ -1002,7 +965,7 @@ int vp9_post_proc_frame(struct VP9Common *cm,
}
#endif
- *dest = cm->post_proc_buffer;
+ *dest = *ppbuf;
/* handle problem with extending borders */
dest->y_width = cm->width;
diff --git a/libvpx/vp9/common/vp9_postproc.h b/libvpx/vp9/common/vp9_postproc.h
index c63beae..b07d5d0 100644
--- a/libvpx/vp9/common/vp9_postproc.h
+++ b/libvpx/vp9/common/vp9_postproc.h
@@ -13,6 +13,11 @@
#define VP9_COMMON_VP9_POSTPROC_H_
#include "vpx_ports/mem.h"
+#include "vp9/common/vp9_ppflags.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
struct postproc_state {
int last_q;
@@ -23,8 +28,7 @@ struct postproc_state {
DECLARE_ALIGNED(16, char, bothclamp[16]);
};
-#include "vp9/common/vp9_onyxc_int.h"
-#include "vp9/common/vp9_ppflags.h"
+struct VP9Common;
int vp9_post_proc_frame(struct VP9Common *cm,
YV12_BUFFER_CONFIG *dest, vp9_ppflags_t *flags);
@@ -33,4 +37,8 @@ void vp9_denoise(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, int q);
void vp9_deblock(const YV12_BUFFER_CONFIG *src, YV12_BUFFER_CONFIG *dst, int q);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_POSTPROC_H_
diff --git a/libvpx/vp9/common/vp9_ppflags.h b/libvpx/vp9/common/vp9_ppflags.h
index 561c930..8168935 100644
--- a/libvpx/vp9/common/vp9_ppflags.h
+++ b/libvpx/vp9/common/vp9_ppflags.h
@@ -11,6 +11,10 @@
#ifndef VP9_COMMON_VP9_PPFLAGS_H_
#define VP9_COMMON_VP9_PPFLAGS_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
enum {
VP9D_NOFILTERING = 0,
VP9D_DEBLOCK = 1 << 0,
@@ -35,4 +39,8 @@ typedef struct {
int display_mv_flag;
} vp9_ppflags_t;
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_PPFLAGS_H_
diff --git a/libvpx/vp9/common/vp9_pragmas.h b/libvpx/vp9/common/vp9_pragmas.h
index f079161..0efc713 100644
--- a/libvpx/vp9/common/vp9_pragmas.h
+++ b/libvpx/vp9/common/vp9_pragmas.h
@@ -11,6 +11,10 @@
#ifndef VP9_COMMON_VP9_PRAGMAS_H_
#define VP9_COMMON_VP9_PRAGMAS_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#ifdef __INTEL_COMPILER
#pragma warning(disable:997 1011 170)
#endif
@@ -19,4 +23,8 @@
#pragma warning(disable:4799)
#endif
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_PRAGMAS_H_
diff --git a/libvpx/vp9/common/vp9_pred_common.c b/libvpx/vp9/common/vp9_pred_common.c
index 6018e17..197bcb6 100644
--- a/libvpx/vp9/common/vp9_pred_common.c
+++ b/libvpx/vp9/common/vp9_pred_common.c
@@ -14,134 +14,110 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_seg_common.h"
-#include "vp9/common/vp9_treecoder.h"
-static INLINE const MB_MODE_INFO *get_above_mbmi(const MODE_INFO *const above) {
- return (above != NULL) ? &above->mbmi : NULL;
-}
-
-static INLINE const MB_MODE_INFO *get_left_mbmi(const MODE_INFO *const left) {
- return (left != NULL) ? &left->mbmi : NULL;
+static INLINE const MB_MODE_INFO *get_mbmi(const MODE_INFO *const mi) {
+ return (mi != NULL) ? &mi->mbmi : NULL;
}
// Returns a context number for the given MB prediction signal
-unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
+int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd) {
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
- // left
- const int left_mv_pred = left_in_image ? is_inter_block(&left_mi->mbmi)
- : 0;
- const int left_interp = left_in_image && left_mv_pred
- ? left_mi->mbmi.interp_filter
- : SWITCHABLE_FILTERS;
-
- // above
- const int above_mv_pred = above_in_image ? is_inter_block(&above_mi->mbmi)
- : 0;
- const int above_interp = above_in_image && above_mv_pred
- ? above_mi->mbmi.interp_filter
- : SWITCHABLE_FILTERS;
-
- if (left_interp == above_interp)
- return left_interp;
- else if (left_interp == SWITCHABLE_FILTERS &&
- above_interp != SWITCHABLE_FILTERS)
- return above_interp;
- else if (left_interp != SWITCHABLE_FILTERS &&
- above_interp == SWITCHABLE_FILTERS)
- return left_interp;
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int left_type = left_mbmi != NULL && is_inter_block(left_mbmi) ?
+ left_mbmi->interp_filter : SWITCHABLE_FILTERS;
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const int above_type = above_mbmi != NULL && is_inter_block(above_mbmi) ?
+ above_mbmi->interp_filter : SWITCHABLE_FILTERS;
+
+ if (left_type == above_type)
+ return left_type;
+ else if (left_type == SWITCHABLE_FILTERS && above_type != SWITCHABLE_FILTERS)
+ return above_type;
+ else if (left_type != SWITCHABLE_FILTERS && above_type == SWITCHABLE_FILTERS)
+ return left_type;
else
return SWITCHABLE_FILTERS;
}
-// Returns a context number for the given MB prediction signal
-unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd) {
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
- const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
- const int above_intra = above_in_image ? !is_inter_block(above_mbmi) : 1;
- const int left_intra = left_in_image ? !is_inter_block(left_mbmi) : 1;
- // The mode info data structure has a one element border above and to the
- // left of the entries corresponding to real macroblocks.
- // The prediction flags in these dummy entries are initialized to 0.
- // 0 - inter/inter, inter/--, --/inter, --/--
- // 1 - intra/inter, inter/intra
- // 2 - intra/--, --/intra
- // 3 - intra/intra
- if (above_in_image && left_in_image) // both edges available
+// The mode info data structure has a one element border above and to the
+// left of the entries corresponding to real macroblocks.
+// The prediction flags in these dummy entries are initialized to 0.
+// 0 - inter/inter, inter/--, --/inter, --/--
+// 1 - intra/inter, inter/intra
+// 2 - intra/--, --/intra
+// 3 - intra/intra
+int vp9_get_intra_inter_context(const MACROBLOCKD *xd) {
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int has_above = above_mbmi != NULL;
+ const int has_left = left_mbmi != NULL;
+
+ if (has_above && has_left) { // both edges available
+ const int above_intra = !is_inter_block(above_mbmi);
+ const int left_intra = !is_inter_block(left_mbmi);
return left_intra && above_intra ? 3
: left_intra || above_intra;
- else if (above_in_image || left_in_image) // one edge available
- return 2 * (above_in_image ? above_intra : left_intra);
- else
+ } else if (has_above || has_left) { // one edge available
+ return 2 * !is_inter_block(has_above ? above_mbmi : left_mbmi);
+ } else {
return 0;
+ }
}
-// Returns a context number for the given MB prediction signal
-unsigned char vp9_get_pred_context_comp_inter_inter(const VP9_COMMON *cm,
- const MACROBLOCKD *xd) {
- int pred_context;
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
- const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
+
+int vp9_get_reference_mode_context(const VP9_COMMON *cm,
+ const MACROBLOCKD *xd) {
+ int ctx;
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int has_above = above_mbmi != NULL;
+ const int has_left = left_mbmi != NULL;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
- if (above_in_image && left_in_image) { // both edges available
+ if (has_above && has_left) { // both edges available
if (!has_second_ref(above_mbmi) && !has_second_ref(left_mbmi))
// neither edge uses comp pred (0/1)
- pred_context = (above_mbmi->ref_frame[0] == cm->comp_fixed_ref) ^
- (left_mbmi->ref_frame[0] == cm->comp_fixed_ref);
+ ctx = (above_mbmi->ref_frame[0] == cm->comp_fixed_ref) ^
+ (left_mbmi->ref_frame[0] == cm->comp_fixed_ref);
else if (!has_second_ref(above_mbmi))
// one of two edges uses comp pred (2/3)
- pred_context = 2 + (above_mbmi->ref_frame[0] == cm->comp_fixed_ref ||
- !is_inter_block(above_mbmi));
+ ctx = 2 + (above_mbmi->ref_frame[0] == cm->comp_fixed_ref ||
+ !is_inter_block(above_mbmi));
else if (!has_second_ref(left_mbmi))
// one of two edges uses comp pred (2/3)
- pred_context = 2 + (left_mbmi->ref_frame[0] == cm->comp_fixed_ref ||
- !is_inter_block(left_mbmi));
+ ctx = 2 + (left_mbmi->ref_frame[0] == cm->comp_fixed_ref ||
+ !is_inter_block(left_mbmi));
else // both edges use comp pred (4)
- pred_context = 4;
- } else if (above_in_image || left_in_image) { // one edge available
- const MB_MODE_INFO *edge_mbmi = above_in_image ? above_mbmi : left_mbmi;
+ ctx = 4;
+ } else if (has_above || has_left) { // one edge available
+ const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi;
if (!has_second_ref(edge_mbmi))
// edge does not use comp pred (0/1)
- pred_context = edge_mbmi->ref_frame[0] == cm->comp_fixed_ref;
+ ctx = edge_mbmi->ref_frame[0] == cm->comp_fixed_ref;
else
// edge uses comp pred (3)
- pred_context = 3;
+ ctx = 3;
} else { // no edges available (1)
- pred_context = 1;
+ ctx = 1;
}
- assert(pred_context >= 0 && pred_context < COMP_INTER_CONTEXTS);
- return pred_context;
+ assert(ctx >= 0 && ctx < COMP_INTER_CONTEXTS);
+ return ctx;
}
// Returns a context number for the given MB prediction signal
-unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
- const MACROBLOCKD *xd) {
+int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
+ const MACROBLOCKD *xd) {
int pred_context;
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
- const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
- const int above_intra = above_in_image ? !is_inter_block(above_mbmi) : 1;
- const int left_intra = left_in_image ? !is_inter_block(left_mbmi) : 1;
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int above_in_image = above_mbmi != NULL;
+ const int left_in_image = left_mbmi != NULL;
+
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
@@ -150,6 +126,9 @@ unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
const int var_ref_idx = !fix_ref_idx;
if (above_in_image && left_in_image) { // both edges available
+ const int above_intra = !is_inter_block(above_mbmi);
+ const int left_intra = !is_inter_block(left_mbmi);
+
if (above_intra && left_intra) { // intra/intra (2)
pred_context = 2;
} else if (above_intra || left_intra) { // intra/inter
@@ -163,10 +142,10 @@ unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
} else { // inter/inter
const int l_sg = !has_second_ref(left_mbmi);
const int a_sg = !has_second_ref(above_mbmi);
- MV_REFERENCE_FRAME vrfa = a_sg ? above_mbmi->ref_frame[0]
- : above_mbmi->ref_frame[var_ref_idx];
- MV_REFERENCE_FRAME vrfl = l_sg ? left_mbmi->ref_frame[0]
- : left_mbmi->ref_frame[var_ref_idx];
+ const MV_REFERENCE_FRAME vrfa = a_sg ? above_mbmi->ref_frame[0]
+ : above_mbmi->ref_frame[var_ref_idx];
+ const MV_REFERENCE_FRAME vrfl = l_sg ? left_mbmi->ref_frame[0]
+ : left_mbmi->ref_frame[var_ref_idx];
if (vrfa == vrfl && cm->comp_var_ref[1] == vrfa) {
pred_context = 0;
@@ -179,8 +158,8 @@ unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
else
pred_context = 1;
} else if (l_sg || a_sg) { // single/comp
- MV_REFERENCE_FRAME vrfc = l_sg ? vrfa : vrfl;
- MV_REFERENCE_FRAME rfs = a_sg ? vrfa : vrfl;
+ const MV_REFERENCE_FRAME vrfc = l_sg ? vrfa : vrfl;
+ const MV_REFERENCE_FRAME rfs = a_sg ? vrfa : vrfl;
if (vrfc == cm->comp_var_ref[1] && rfs != cm->comp_var_ref[1])
pred_context = 1;
else if (rfs == cm->comp_var_ref[1] && vrfc != cm->comp_var_ref[1])
@@ -212,21 +191,21 @@ unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
return pred_context;
}
-unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
+
+int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
int pred_context;
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
- const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
- const int above_intra = above_in_image ? !is_inter_block(above_mbmi) : 1;
- const int left_intra = left_in_image ? !is_inter_block(left_mbmi) : 1;
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int has_above = above_mbmi != NULL;
+ const int has_left = left_mbmi != NULL;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
- if (above_in_image && left_in_image) { // both edges available
+ if (has_above && has_left) { // both edges available
+ const int above_intra = !is_inter_block(above_mbmi);
+ const int left_intra = !is_inter_block(left_mbmi);
+
if (above_intra && left_intra) { // intra/intra
pred_context = 2;
} else if (above_intra || left_intra) { // intra/inter or inter/intra
@@ -237,30 +216,31 @@ unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
pred_context = 1 + (edge_mbmi->ref_frame[0] == LAST_FRAME ||
edge_mbmi->ref_frame[1] == LAST_FRAME);
} else { // inter/inter
- if (!has_second_ref(above_mbmi) && !has_second_ref(left_mbmi)) {
- pred_context = 2 * (above_mbmi->ref_frame[0] == LAST_FRAME) +
- 2 * (left_mbmi->ref_frame[0] == LAST_FRAME);
- } else if (has_second_ref(above_mbmi) && has_second_ref(left_mbmi)) {
- pred_context = 1 + (above_mbmi->ref_frame[0] == LAST_FRAME ||
- above_mbmi->ref_frame[1] == LAST_FRAME ||
- left_mbmi->ref_frame[0] == LAST_FRAME ||
- left_mbmi->ref_frame[1] == LAST_FRAME);
- } else {
- const MV_REFERENCE_FRAME rfs = !has_second_ref(above_mbmi) ?
- above_mbmi->ref_frame[0] : left_mbmi->ref_frame[0];
- const MV_REFERENCE_FRAME crf1 = has_second_ref(above_mbmi) ?
- above_mbmi->ref_frame[0] : left_mbmi->ref_frame[0];
- const MV_REFERENCE_FRAME crf2 = has_second_ref(above_mbmi) ?
- above_mbmi->ref_frame[1] : left_mbmi->ref_frame[1];
+ const int above_has_second = has_second_ref(above_mbmi);
+ const int left_has_second = has_second_ref(left_mbmi);
+ const MV_REFERENCE_FRAME above0 = above_mbmi->ref_frame[0];
+ const MV_REFERENCE_FRAME above1 = above_mbmi->ref_frame[1];
+ const MV_REFERENCE_FRAME left0 = left_mbmi->ref_frame[0];
+ const MV_REFERENCE_FRAME left1 = left_mbmi->ref_frame[1];
+
+ if (above_has_second && left_has_second) {
+ pred_context = 1 + (above0 == LAST_FRAME || above1 == LAST_FRAME ||
+ left0 == LAST_FRAME || left1 == LAST_FRAME);
+ } else if (above_has_second || left_has_second) {
+ const MV_REFERENCE_FRAME rfs = !above_has_second ? above0 : left0;
+ const MV_REFERENCE_FRAME crf1 = above_has_second ? above0 : left0;
+ const MV_REFERENCE_FRAME crf2 = above_has_second ? above1 : left1;
if (rfs == LAST_FRAME)
pred_context = 3 + (crf1 == LAST_FRAME || crf2 == LAST_FRAME);
else
- pred_context = crf1 == LAST_FRAME || crf2 == LAST_FRAME;
+ pred_context = (crf1 == LAST_FRAME || crf2 == LAST_FRAME);
+ } else {
+ pred_context = 2 * (above0 == LAST_FRAME) + 2 * (left0 == LAST_FRAME);
}
}
- } else if (above_in_image || left_in_image) { // one edge available
- const MB_MODE_INFO *edge_mbmi = above_in_image ? above_mbmi : left_mbmi;
+ } else if (has_above || has_left) { // one edge available
+ const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi;
if (!is_inter_block(edge_mbmi)) { // intra
pred_context = 2;
} else { // inter
@@ -278,22 +258,21 @@ unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd) {
return pred_context;
}
-unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
+int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
int pred_context;
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
- const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
- const int above_intra = above_in_image ? !is_inter_block(above_mbmi) : 1;
- const int left_intra = left_in_image ? !is_inter_block(left_mbmi) : 1;
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int has_above = above_mbmi != NULL;
+ const int has_left = left_mbmi != NULL;
// Note:
// The mode info data structure has a one element border above and to the
// left of the entries correpsonding to real macroblocks.
// The prediction flags in these dummy entries are initialised to 0.
- if (above_in_image && left_in_image) { // both edges available
+ if (has_above && has_left) { // both edges available
+ const int above_intra = !is_inter_block(above_mbmi);
+ const int left_intra = !is_inter_block(left_mbmi);
+
if (above_intra && left_intra) { // intra/intra
pred_context = 2;
} else if (above_intra || left_intra) { // intra/inter or inter/intra
@@ -308,36 +287,25 @@ unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
edge_mbmi->ref_frame[1] == GOLDEN_FRAME);
}
} else { // inter/inter
- if (!has_second_ref(above_mbmi) && !has_second_ref(left_mbmi)) {
- if (above_mbmi->ref_frame[0] == LAST_FRAME &&
- left_mbmi->ref_frame[0] == LAST_FRAME) {
- pred_context = 3;
- } else if (above_mbmi->ref_frame[0] == LAST_FRAME ||
- left_mbmi->ref_frame[0] == LAST_FRAME) {
- const MB_MODE_INFO *edge_mbmi =
- above_mbmi->ref_frame[0] == LAST_FRAME ? left_mbmi : above_mbmi;
-
- pred_context = 4 * (edge_mbmi->ref_frame[0] == GOLDEN_FRAME);
- } else {
- pred_context = 2 * (above_mbmi->ref_frame[0] == GOLDEN_FRAME) +
- 2 * (left_mbmi->ref_frame[0] == GOLDEN_FRAME);
- }
- } else if (has_second_ref(above_mbmi) && has_second_ref(left_mbmi)) {
- if (above_mbmi->ref_frame[0] == left_mbmi->ref_frame[0] &&
- above_mbmi->ref_frame[1] == left_mbmi->ref_frame[1])
- pred_context = 3 * (above_mbmi->ref_frame[0] == GOLDEN_FRAME ||
- above_mbmi->ref_frame[1] == GOLDEN_FRAME ||
- left_mbmi->ref_frame[0] == GOLDEN_FRAME ||
- left_mbmi->ref_frame[1] == GOLDEN_FRAME);
+ const int above_has_second = has_second_ref(above_mbmi);
+ const int left_has_second = has_second_ref(left_mbmi);
+ const MV_REFERENCE_FRAME above0 = above_mbmi->ref_frame[0];
+ const MV_REFERENCE_FRAME above1 = above_mbmi->ref_frame[1];
+ const MV_REFERENCE_FRAME left0 = left_mbmi->ref_frame[0];
+ const MV_REFERENCE_FRAME left1 = left_mbmi->ref_frame[1];
+
+ if (above_has_second && left_has_second) {
+ if (above0 == left0 && above1 == left1)
+ pred_context = 3 * (above0 == GOLDEN_FRAME ||
+ above1 == GOLDEN_FRAME ||
+ left0 == GOLDEN_FRAME ||
+ left1 == GOLDEN_FRAME);
else
pred_context = 2;
- } else {
- const MV_REFERENCE_FRAME rfs = !has_second_ref(above_mbmi) ?
- above_mbmi->ref_frame[0] : left_mbmi->ref_frame[0];
- const MV_REFERENCE_FRAME crf1 = has_second_ref(above_mbmi) ?
- above_mbmi->ref_frame[0] : left_mbmi->ref_frame[0];
- const MV_REFERENCE_FRAME crf2 = has_second_ref(above_mbmi) ?
- above_mbmi->ref_frame[1] : left_mbmi->ref_frame[1];
+ } else if (above_has_second || left_has_second) {
+ const MV_REFERENCE_FRAME rfs = !above_has_second ? above0 : left0;
+ const MV_REFERENCE_FRAME crf1 = above_has_second ? above0 : left0;
+ const MV_REFERENCE_FRAME crf2 = above_has_second ? above1 : left1;
if (rfs == GOLDEN_FRAME)
pred_context = 3 + (crf1 == GOLDEN_FRAME || crf2 == GOLDEN_FRAME);
@@ -345,10 +313,21 @@ unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
pred_context = crf1 == GOLDEN_FRAME || crf2 == GOLDEN_FRAME;
else
pred_context = 1 + 2 * (crf1 == GOLDEN_FRAME || crf2 == GOLDEN_FRAME);
+ } else {
+ if (above0 == LAST_FRAME && left0 == LAST_FRAME) {
+ pred_context = 3;
+ } else if (above0 == LAST_FRAME || left0 == LAST_FRAME) {
+ const MV_REFERENCE_FRAME edge0 = (above0 == LAST_FRAME) ? left0
+ : above0;
+ pred_context = 4 * (edge0 == GOLDEN_FRAME);
+ } else {
+ pred_context = 2 * (above0 == GOLDEN_FRAME) +
+ 2 * (left0 == GOLDEN_FRAME);
+ }
}
}
- } else if (above_in_image || left_in_image) { // one edge available
- const MB_MODE_INFO *edge_mbmi = above_in_image ? above_mbmi : left_mbmi;
+ } else if (has_above || has_left) { // one edge available
+ const MB_MODE_INFO *edge_mbmi = has_above ? above_mbmi : left_mbmi;
if (!is_inter_block(edge_mbmi) ||
(edge_mbmi->ref_frame[0] == LAST_FRAME && !has_second_ref(edge_mbmi)))
@@ -368,36 +347,23 @@ unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd) {
// The mode info data structure has a one element border above and to the
// left of the entries corresponding to real blocks.
// The prediction flags in these dummy entries are initialized to 0.
-unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd) {
- const MODE_INFO *const above_mi = get_above_mi(xd);
- const MODE_INFO *const left_mi = get_left_mi(xd);
- const MB_MODE_INFO *const above_mbmi = get_above_mbmi(above_mi);
- const MB_MODE_INFO *const left_mbmi = get_left_mbmi(left_mi);
- const int above_in_image = above_mi != NULL;
- const int left_in_image = left_mi != NULL;
+int vp9_get_tx_size_context(const MACROBLOCKD *xd) {
const int max_tx_size = max_txsize_lookup[xd->mi_8x8[0]->mbmi.sb_type];
- int above_context = max_tx_size;
- int left_context = max_tx_size;
-
- if (above_in_image)
- above_context = above_mbmi->skip_coeff ? max_tx_size
- : above_mbmi->tx_size;
-
- if (left_in_image)
- left_context = left_mbmi->skip_coeff ? max_tx_size
- : left_mbmi->tx_size;
-
- if (!left_in_image)
- left_context = above_context;
-
- if (!above_in_image)
- above_context = left_context;
-
- return above_context + left_context > max_tx_size;
-}
-
-void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag) {
- xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag;
+ const MB_MODE_INFO *const above_mbmi = get_mbmi(get_above_mi(xd));
+ const MB_MODE_INFO *const left_mbmi = get_mbmi(get_left_mi(xd));
+ const int has_above = above_mbmi != NULL;
+ const int has_left = left_mbmi != NULL;
+ int above_ctx = (has_above && !above_mbmi->skip) ? above_mbmi->tx_size
+ : max_tx_size;
+ int left_ctx = (has_left && !left_mbmi->skip) ? left_mbmi->tx_size
+ : max_tx_size;
+ if (!has_left)
+ left_ctx = above_ctx;
+
+ if (!has_above)
+ above_ctx = left_ctx;
+
+ return (above_ctx + left_ctx) > max_tx_size;
}
int vp9_get_segment_id(VP9_COMMON *cm, const uint8_t *segment_ids,
diff --git a/libvpx/vp9/common/vp9_pred_common.h b/libvpx/vp9/common/vp9_pred_common.h
index 9190930..6c7a0d3 100644
--- a/libvpx/vp9/common/vp9_pred_common.h
+++ b/libvpx/vp9/common/vp9_pred_common.h
@@ -14,6 +14,10 @@
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
static INLINE const MODE_INFO *get_above_mi(const MACROBLOCKD *const xd) {
return xd->up_available ? xd->mi_8x8[-xd->mode_info_stride] : NULL;
}
@@ -35,55 +39,42 @@ static INLINE int vp9_get_pred_context_seg_id(const MACROBLOCKD *xd) {
return above_sip + left_sip;
}
-static INLINE vp9_prob vp9_get_pred_prob_seg_id(struct segmentation *seg,
+static INLINE vp9_prob vp9_get_pred_prob_seg_id(const struct segmentation *seg,
const MACROBLOCKD *xd) {
return seg->pred_probs[vp9_get_pred_context_seg_id(xd)];
}
-void vp9_set_pred_flag_seg_id(MACROBLOCKD *xd, uint8_t pred_flag);
-
-static INLINE int vp9_get_pred_context_mbskip(const MACROBLOCKD *xd) {
+static INLINE int vp9_get_skip_context(const MACROBLOCKD *xd) {
const MODE_INFO *const above_mi = get_above_mi(xd);
const MODE_INFO *const left_mi = get_left_mi(xd);
- const int above_skip_coeff = (above_mi != NULL) ?
- above_mi->mbmi.skip_coeff : 0;
- const int left_skip_coeff = (left_mi != NULL) ? left_mi->mbmi.skip_coeff : 0;
-
- return above_skip_coeff + left_skip_coeff;
+ const int above_skip = (above_mi != NULL) ? above_mi->mbmi.skip : 0;
+ const int left_skip = (left_mi != NULL) ? left_mi->mbmi.skip : 0;
+ return above_skip + left_skip;
}
-static INLINE vp9_prob vp9_get_pred_prob_mbskip(const VP9_COMMON *cm,
- const MACROBLOCKD *xd) {
- return cm->fc.mbskip_probs[vp9_get_pred_context_mbskip(xd)];
+static INLINE vp9_prob vp9_get_skip_prob(const VP9_COMMON *cm,
+ const MACROBLOCKD *xd) {
+ return cm->fc.skip_probs[vp9_get_skip_context(xd)];
}
-static INLINE unsigned char vp9_get_pred_flag_mbskip(const MACROBLOCKD *xd) {
- return xd->mi_8x8[0]->mbmi.skip_coeff;
-}
+int vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
-unsigned char vp9_get_pred_context_switchable_interp(const MACROBLOCKD *xd);
+int vp9_get_intra_inter_context(const MACROBLOCKD *xd);
-unsigned char vp9_get_pred_context_intra_inter(const MACROBLOCKD *xd);
-
-static INLINE vp9_prob vp9_get_pred_prob_intra_inter(const VP9_COMMON *cm,
- const MACROBLOCKD *xd) {
- const int pred_context = vp9_get_pred_context_intra_inter(xd);
- return cm->fc.intra_inter_prob[pred_context];
+static INLINE vp9_prob vp9_get_intra_inter_prob(const VP9_COMMON *cm,
+ const MACROBLOCKD *xd) {
+ return cm->fc.intra_inter_prob[vp9_get_intra_inter_context(xd)];
}
-unsigned char vp9_get_pred_context_comp_inter_inter(const VP9_COMMON *cm,
- const MACROBLOCKD *xd);
+int vp9_get_reference_mode_context(const VP9_COMMON *cm, const MACROBLOCKD *xd);
-
-static INLINE
-vp9_prob vp9_get_pred_prob_comp_inter_inter(const VP9_COMMON *cm,
- const MACROBLOCKD *xd) {
- const int pred_context = vp9_get_pred_context_comp_inter_inter(cm, xd);
- return cm->fc.comp_inter_prob[pred_context];
+static INLINE vp9_prob vp9_get_reference_mode_prob(const VP9_COMMON *cm,
+ const MACROBLOCKD *xd) {
+ return cm->fc.comp_inter_prob[vp9_get_reference_mode_context(cm, xd)];
}
-unsigned char vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
- const MACROBLOCKD *xd);
+int vp9_get_pred_context_comp_ref_p(const VP9_COMMON *cm,
+ const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
@@ -91,26 +82,24 @@ static INLINE vp9_prob vp9_get_pred_prob_comp_ref_p(const VP9_COMMON *cm,
return cm->fc.comp_ref_prob[pred_context];
}
-unsigned char vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
+int vp9_get_pred_context_single_ref_p1(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_single_ref_p1(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
- const int pred_context = vp9_get_pred_context_single_ref_p1(xd);
- return cm->fc.single_ref_prob[pred_context][0];
+ return cm->fc.single_ref_prob[vp9_get_pred_context_single_ref_p1(xd)][0];
}
-unsigned char vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
+int vp9_get_pred_context_single_ref_p2(const MACROBLOCKD *xd);
static INLINE vp9_prob vp9_get_pred_prob_single_ref_p2(const VP9_COMMON *cm,
const MACROBLOCKD *xd) {
- const int pred_context = vp9_get_pred_context_single_ref_p2(xd);
- return cm->fc.single_ref_prob[pred_context][1];
+ return cm->fc.single_ref_prob[vp9_get_pred_context_single_ref_p2(xd)][1];
}
-unsigned char vp9_get_pred_context_tx_size(const MACROBLOCKD *xd);
+int vp9_get_tx_size_context(const MACROBLOCKD *xd);
-static const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
- const struct tx_probs *tx_probs) {
+static INLINE const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
+ const struct tx_probs *tx_probs) {
switch (max_tx_size) {
case TX_8X8:
return tx_probs->p8x8[ctx];
@@ -119,19 +108,19 @@ static const vp9_prob *get_tx_probs(TX_SIZE max_tx_size, int ctx,
case TX_32X32:
return tx_probs->p32x32[ctx];
default:
- assert(!"Invalid max_tx_size.");
+ assert(0 && "Invalid max_tx_size.");
return NULL;
}
}
-static const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size, const MACROBLOCKD *xd,
- const struct tx_probs *tx_probs) {
- const int ctx = vp9_get_pred_context_tx_size(xd);
- return get_tx_probs(max_tx_size, ctx, tx_probs);
+static INLINE const vp9_prob *get_tx_probs2(TX_SIZE max_tx_size,
+ const MACROBLOCKD *xd,
+ const struct tx_probs *tx_probs) {
+ return get_tx_probs(max_tx_size, vp9_get_tx_size_context(xd), tx_probs);
}
-static unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx,
- struct tx_counts *tx_counts) {
+static INLINE unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx,
+ struct tx_counts *tx_counts) {
switch (max_tx_size) {
case TX_8X8:
return tx_counts->p8x8[ctx];
@@ -140,9 +129,13 @@ static unsigned int *get_tx_counts(TX_SIZE max_tx_size, int ctx,
case TX_32X32:
return tx_counts->p32x32[ctx];
default:
- assert(!"Invalid max_tx_size.");
+ assert(0 && "Invalid max_tx_size.");
return NULL;
}
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_PRED_COMMON_H_
diff --git a/libvpx/vp9/common/vp9_prob.c b/libvpx/vp9/common/vp9_prob.c
new file mode 100644
index 0000000..a1befc6
--- /dev/null
+++ b/libvpx/vp9/common/vp9_prob.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "vp9/common/vp9_prob.h"
+
+const uint8_t vp9_norm[256] = {
+ 0, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+
+static unsigned int tree_merge_probs_impl(unsigned int i,
+ const vp9_tree_index *tree,
+ const vp9_prob *pre_probs,
+ const unsigned int *counts,
+ unsigned int count_sat,
+ unsigned int max_update,
+ vp9_prob *probs) {
+ const int l = tree[i];
+ const unsigned int left_count = (l <= 0)
+ ? counts[-l]
+ : tree_merge_probs_impl(l, tree, pre_probs, counts,
+ count_sat, max_update, probs);
+ const int r = tree[i + 1];
+ const unsigned int right_count = (r <= 0)
+ ? counts[-r]
+ : tree_merge_probs_impl(r, tree, pre_probs, counts,
+ count_sat, max_update, probs);
+ const unsigned int ct[2] = { left_count, right_count };
+ probs[i >> 1] = merge_probs(pre_probs[i >> 1], ct,
+ count_sat, max_update);
+ return left_count + right_count;
+}
+
+void vp9_tree_merge_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs,
+ const unsigned int *counts, unsigned int count_sat,
+ unsigned int max_update_factor, vp9_prob *probs) {
+ tree_merge_probs_impl(0, tree, pre_probs, counts, count_sat,
+ max_update_factor, probs);
+}
diff --git a/libvpx/vp9/common/vp9_prob.h b/libvpx/vp9/common/vp9_prob.h
new file mode 100644
index 0000000..f361480
--- /dev/null
+++ b/libvpx/vp9/common/vp9_prob.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_COMMON_VP9_PROB_H_
+#define VP9_COMMON_VP9_PROB_H_
+
+#include "./vpx_config.h"
+
+#include "vpx_ports/mem.h"
+#include "vpx/vpx_integer.h"
+
+#include "vp9/common/vp9_common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef uint8_t vp9_prob;
+
+#define MAX_PROB 255
+
+#define vp9_prob_half ((vp9_prob) 128)
+
+typedef int8_t vp9_tree_index;
+
+#define TREE_SIZE(leaf_count) (2 * (leaf_count) - 2)
+
+#define vp9_complement(x) (255 - x)
+
+/* We build coding trees compactly in arrays.
+ Each node of the tree is a pair of vp9_tree_indices.
+ Array index often references a corresponding probability table.
+ Index <= 0 means done encoding/decoding and value = -Index,
+ Index > 0 means need another bit, specification at index.
+ Nonnegative indices are always even; processing begins at node 0. */
+
+typedef const vp9_tree_index vp9_tree[];
+
+static INLINE vp9_prob clip_prob(int p) {
+ return (p > 255) ? 255u : (p < 1) ? 1u : p;
+}
+
+// int64 is not needed for normal frame level calculations.
+// However when outputting entropy stats accumulated over many frames
+// or even clips we can overflow int math.
+#ifdef ENTROPY_STATS
+static INLINE vp9_prob get_prob(int num, int den) {
+ return (den == 0) ? 128u : clip_prob(((int64_t)num * 256 + (den >> 1)) / den);
+}
+#else
+static INLINE vp9_prob get_prob(int num, int den) {
+ return (den == 0) ? 128u : clip_prob((num * 256 + (den >> 1)) / den);
+}
+#endif
+
+static INLINE vp9_prob get_binary_prob(int n0, int n1) {
+ return get_prob(n0, n0 + n1);
+}
+
+/* This function assumes prob1 and prob2 are already within [1,255] range. */
+static INLINE vp9_prob weighted_prob(int prob1, int prob2, int factor) {
+ return ROUND_POWER_OF_TWO(prob1 * (256 - factor) + prob2 * factor, 8);
+}
+
+static INLINE vp9_prob merge_probs(vp9_prob pre_prob,
+ const unsigned int ct[2],
+ unsigned int count_sat,
+ unsigned int max_update_factor) {
+ const vp9_prob prob = get_binary_prob(ct[0], ct[1]);
+ const unsigned int count = MIN(ct[0] + ct[1], count_sat);
+ const unsigned int factor = max_update_factor * count / count_sat;
+ return weighted_prob(pre_prob, prob, factor);
+}
+
+void vp9_tree_merge_probs(const vp9_tree_index *tree, const vp9_prob *pre_probs,
+ const unsigned int *counts, unsigned int count_sat,
+ unsigned int max_update_factor, vp9_prob *probs);
+
+
+DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_COMMON_VP9_PROB_H_
diff --git a/libvpx/vp9/common/vp9_quant_common.c b/libvpx/vp9/common/vp9_quant_common.c
index 6dbdb42..def1255 100644
--- a/libvpx/vp9/common/vp9_quant_common.c
+++ b/libvpx/vp9/common/vp9_quant_common.c
@@ -130,12 +130,13 @@ int16_t vp9_ac_quant(int qindex, int delta) {
}
-int vp9_get_qindex(struct segmentation *seg, int segment_id, int base_qindex) {
+int vp9_get_qindex(const struct segmentation *seg, int segment_id,
+ int base_qindex) {
if (vp9_segfeature_active(seg, segment_id, SEG_LVL_ALT_Q)) {
const int data = vp9_get_segdata(seg, segment_id, SEG_LVL_ALT_Q);
- return seg->abs_delta == SEGMENT_ABSDATA ?
- data : // Abs value
- clamp(base_qindex + data, 0, MAXQ); // Delta value
+ const int seg_qindex = seg->abs_delta == SEGMENT_ABSDATA ?
+ data : base_qindex + data;
+ return clamp(seg_qindex, 0, MAXQ);
} else {
return base_qindex;
}
diff --git a/libvpx/vp9/common/vp9_quant_common.h b/libvpx/vp9/common/vp9_quant_common.h
index 83f2fb6..5811040 100644
--- a/libvpx/vp9/common/vp9_quant_common.h
+++ b/libvpx/vp9/common/vp9_quant_common.h
@@ -13,6 +13,10 @@
#include "vp9/common/vp9_blockd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MINQ 0
#define MAXQ 255
#define QINDEX_RANGE (MAXQ - MINQ + 1)
@@ -23,6 +27,11 @@ void vp9_init_quant_tables();
int16_t vp9_dc_quant(int qindex, int delta);
int16_t vp9_ac_quant(int qindex, int delta);
-int vp9_get_qindex(struct segmentation *seg, int segment_id, int base_qindex);
+int vp9_get_qindex(const struct segmentation *seg, int segment_id,
+ int base_qindex);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_COMMON_VP9_QUANT_COMMON_H_
diff --git a/libvpx/vp9/common/vp9_reconinter.c b/libvpx/vp9/common/vp9_reconinter.c
index 7cc66c8..005f370 100644
--- a/libvpx/vp9/common/vp9_reconinter.c
+++ b/libvpx/vp9/common/vp9_reconinter.c
@@ -20,59 +20,81 @@
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_reconintra.h"
-void vp9_setup_interp_filters(MACROBLOCKD *xd,
- INTERPOLATION_TYPE mcomp_filter_type,
- VP9_COMMON *cm) {
- if (xd->mi_8x8 && xd->mi_8x8[0]) {
- MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
-
- set_scale_factors(xd, mbmi->ref_frame[0] - LAST_FRAME,
- mbmi->ref_frame[1] - LAST_FRAME,
- cm->active_ref_scale);
- } else {
- set_scale_factors(xd, -1, -1, cm->active_ref_scale);
- }
+static void build_mc_border(const uint8_t *src, int src_stride,
+ uint8_t *dst, int dst_stride,
+ int x, int y, int b_w, int b_h, int w, int h) {
+ // Get a pointer to the start of the real data for this row.
+ const uint8_t *ref_row = src - x - y * src_stride;
+
+ if (y >= h)
+ ref_row += (h - 1) * src_stride;
+ else if (y > 0)
+ ref_row += y * src_stride;
+
+ do {
+ int right = 0, copy;
+ int left = x < 0 ? -x : 0;
+
+ if (left > b_w)
+ left = b_w;
+
+ if (x + b_w > w)
+ right = x + b_w - w;
+
+ if (right > b_w)
+ right = b_w;
+
+ copy = b_w - left - right;
+
+ if (left)
+ memset(dst, ref_row[0], left);
+
+ if (copy)
+ memcpy(dst + left, ref_row + x + left, copy);
- xd->subpix.filter_x = xd->subpix.filter_y =
- vp9_get_filter_kernel(mcomp_filter_type == SWITCHABLE ?
- EIGHTTAP : mcomp_filter_type);
+ if (right)
+ memset(dst + left + copy, ref_row[w - 1], right);
- assert(((intptr_t)xd->subpix.filter_x & 0xff) == 0);
+ dst += dst_stride;
+ ++y;
+
+ if (y > 0 && y < h)
+ ref_row += src_stride;
+ } while (--b_h);
}
static void inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
- const MV32 *mv,
- const struct scale_factors *scale,
+ const int subpel_x,
+ const int subpel_y,
+ const struct scale_factors *sf,
int w, int h, int ref,
- const struct subpix_fn_table *subpix,
+ const InterpKernel *kernel,
int xs, int ys) {
- const int subpel_x = mv->col & SUBPEL_MASK;
- const int subpel_y = mv->row & SUBPEL_MASK;
-
- src += (mv->row >> SUBPEL_BITS) * src_stride + (mv->col >> SUBPEL_BITS);
- scale->sfc->predict[subpel_x != 0][subpel_y != 0][ref](
+ sf->predict[subpel_x != 0][subpel_y != 0][ref](
src, src_stride, dst, dst_stride,
- subpix->filter_x[subpel_x], xs,
- subpix->filter_y[subpel_y], ys,
- w, h);
+ kernel[subpel_x], xs, kernel[subpel_y], ys, w, h);
}
void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const MV *src_mv,
- const struct scale_factors *scale,
+ const struct scale_factors *sf,
int w, int h, int ref,
- const struct subpix_fn_table *subpix,
- enum mv_precision precision) {
+ const InterpKernel *kernel,
+ enum mv_precision precision,
+ int x, int y) {
const int is_q4 = precision == MV_PRECISION_Q4;
const MV mv_q4 = { is_q4 ? src_mv->row : src_mv->row * 2,
is_q4 ? src_mv->col : src_mv->col * 2 };
- const struct scale_factors_common *sfc = scale->sfc;
- const MV32 mv = sfc->scale_mv(&mv_q4, scale);
+ MV32 mv = vp9_scale_mv(&mv_q4, x, y, sf);
+ const int subpel_x = mv.col & SUBPEL_MASK;
+ const int subpel_y = mv.row & SUBPEL_MASK;
+
+ src += (mv.row >> SUBPEL_BITS) * src_stride + (mv.col >> SUBPEL_BITS);
- inter_predictor(src, src_stride, dst, dst_stride, &mv, scale,
- w, h, ref, subpix, sfc->x_step_q4, sfc->y_step_q4);
+ inter_predictor(src, src_stride, dst, dst_stride, subpel_x, subpel_y,
+ sf, w, h, ref, kernel, sf->x_step_q4, sf->y_step_q4);
}
static INLINE int round_mv_comp_q4(int value) {
@@ -117,30 +139,17 @@ MV clamp_mv_to_umv_border_sb(const MACROBLOCKD *xd, const MV *src_mv,
return clamped_mv;
}
-
-// TODO(jkoleszar): In principle, pred_w, pred_h are unnecessary, as we could
-// calculate the subsampled BLOCK_SIZE, but that type isn't defined for
-// sizes smaller than 16x16 yet.
static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
- BLOCK_SIZE bsize, int pred_w, int pred_h,
+ int bw, int bh,
+ int x, int y, int w, int h,
int mi_x, int mi_y) {
struct macroblockd_plane *const pd = &xd->plane[plane];
- const int bwl = b_width_log2(bsize) - pd->subsampling_x;
- const int bw = 4 << bwl;
- const int bh = plane_block_height(bsize, pd);
- const int x = 4 * (block & ((1 << bwl) - 1));
- const int y = 4 * (block >> bwl);
const MODE_INFO *mi = xd->mi_8x8[0];
const int is_compound = has_second_ref(&mi->mbmi);
int ref;
- assert(x < bw);
- assert(y < bh);
- assert(mi->mbmi.sb_type < BLOCK_8X8 || 4 << pred_w == bw);
- assert(mi->mbmi.sb_type < BLOCK_8X8 || 4 << pred_h == bh);
-
for (ref = 0; ref < 1 + is_compound; ++ref) {
- struct scale_factors *const scale = &xd->scale_factor[ref];
+ const struct scale_factors *const sf = &xd->block_refs[ref]->sf;
struct buf_2d *const pre_buf = &pd->pre[ref];
struct buf_2d *const dst_buf = &pd->dst;
uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x;
@@ -165,25 +174,27 @@ static void build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
uint8_t *pre;
MV32 scaled_mv;
- int xs, ys;
-
- if (vp9_is_scaled(scale->sfc)) {
- pre = pre_buf->buf + scaled_buffer_offset(x, y, pre_buf->stride, scale);
- scale->sfc->set_scaled_offsets(scale, mi_y + y, mi_x + x);
- scaled_mv = scale->sfc->scale_mv(&mv_q4, scale);
- xs = scale->sfc->x_step_q4;
- ys = scale->sfc->y_step_q4;
+ int xs, ys, subpel_x, subpel_y;
+
+ if (vp9_is_scaled(sf)) {
+ pre = pre_buf->buf + scaled_buffer_offset(x, y, pre_buf->stride, sf);
+ scaled_mv = vp9_scale_mv(&mv_q4, mi_x + x, mi_y + y, sf);
+ xs = sf->x_step_q4;
+ ys = sf->y_step_q4;
} else {
pre = pre_buf->buf + (y * pre_buf->stride + x);
scaled_mv.row = mv_q4.row;
scaled_mv.col = mv_q4.col;
xs = ys = 16;
}
+ subpel_x = scaled_mv.col & SUBPEL_MASK;
+ subpel_y = scaled_mv.row & SUBPEL_MASK;
+ pre += (scaled_mv.row >> SUBPEL_BITS) * pre_buf->stride
+ + (scaled_mv.col >> SUBPEL_BITS);
inter_predictor(pre, pre_buf->stride, dst, dst_buf->stride,
- &scaled_mv, scale,
- 4 << pred_w, 4 << pred_h, ref,
- &xd->subpix, xs, ys);
+ subpel_x, subpel_y, sf, w, h, ref, xd->interp_kernel,
+ xs, ys);
}
}
@@ -191,20 +202,26 @@ static void build_inter_predictors_for_planes(MACROBLOCKD *xd, BLOCK_SIZE bsize,
int mi_row, int mi_col,
int plane_from, int plane_to) {
int plane;
+ const int mi_x = mi_col * MI_SIZE;
+ const int mi_y = mi_row * MI_SIZE;
for (plane = plane_from; plane <= plane_to; ++plane) {
- const int mi_x = mi_col * MI_SIZE;
- const int mi_y = mi_row * MI_SIZE;
- const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
- const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y;
+ const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize,
+ &xd->plane[plane]);
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
+ const int bw = 4 * num_4x4_w;
+ const int bh = 4 * num_4x4_h;
if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) {
int i = 0, x, y;
assert(bsize == BLOCK_8X8);
- for (y = 0; y < 1 << bhl; ++y)
- for (x = 0; x < 1 << bwl; ++x)
- build_inter_predictors(xd, plane, i++, bsize, 0, 0, mi_x, mi_y);
+ for (y = 0; y < num_4x4_h; ++y)
+ for (x = 0; x < num_4x4_w; ++x)
+ build_inter_predictors(xd, plane, i++, bw, bh,
+ 4 * x, 4 * y, 4, 4, mi_x, mi_y);
} else {
- build_inter_predictors(xd, plane, 0, bsize, bwl, bhl, mi_x, mi_y);
+ build_inter_predictors(xd, plane, 0, bw, bh,
+ 0, 0, bw, bh, mi_x, mi_y);
}
}
}
@@ -224,22 +241,206 @@ void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
MAX_MB_PLANE - 1);
}
-// TODO(dkovalev: find better place for this function)
-void vp9_setup_scale_factors(VP9_COMMON *cm, int i) {
- const int ref = cm->active_ref_idx[i];
- struct scale_factors *const sf = &cm->active_ref_scale[i];
- struct scale_factors_common *const sfc = &cm->active_ref_scale_comm[i];
- if (ref >= NUM_YV12_BUFFERS) {
- vp9_zero(*sf);
- vp9_zero(*sfc);
- } else {
- YV12_BUFFER_CONFIG *const fb = &cm->yv12_fb[ref];
- vp9_setup_scale_factors_for_frame(sf, sfc,
- fb->y_crop_width, fb->y_crop_height,
- cm->width, cm->height);
-
- if (vp9_is_scaled(sfc))
- vp9_extend_frame_borders(fb, cm->subsampling_x, cm->subsampling_y);
+// TODO(jingning): This function serves as a placeholder for decoder prediction
+// using on demand border extension. It should be moved to /decoder/ directory.
+static void dec_build_inter_predictors(MACROBLOCKD *xd, int plane, int block,
+ int bw, int bh,
+ int x, int y, int w, int h,
+ int mi_x, int mi_y) {
+ struct macroblockd_plane *const pd = &xd->plane[plane];
+ const MODE_INFO *mi = xd->mi_8x8[0];
+ const int is_compound = has_second_ref(&mi->mbmi);
+ int ref;
+
+ for (ref = 0; ref < 1 + is_compound; ++ref) {
+ const struct scale_factors *const sf = &xd->block_refs[ref]->sf;
+ struct buf_2d *const pre_buf = &pd->pre[ref];
+ struct buf_2d *const dst_buf = &pd->dst;
+ uint8_t *const dst = dst_buf->buf + dst_buf->stride * y + x;
+
+ // TODO(jkoleszar): All chroma MVs in SPLITMV mode are taken as the
+ // same MV (the average of the 4 luma MVs) but we could do something
+ // smarter for non-4:2:0. Just punt for now, pending the changes to get
+ // rid of SPLITMV mode entirely.
+ const MV mv = mi->mbmi.sb_type < BLOCK_8X8
+ ? (plane == 0 ? mi->bmi[block].as_mv[ref].as_mv
+ : mi_mv_pred_q4(mi, ref))
+ : mi->mbmi.mv[ref].as_mv;
+
+ // TODO(jkoleszar): This clamping is done in the incorrect place for the
+ // scaling case. It needs to be done on the scaled MV, not the pre-scaling
+ // MV. Note however that it performs the subsampling aware scaling so
+ // that the result is always q4.
+ // mv_precision precision is MV_PRECISION_Q4.
+ const MV mv_q4 = clamp_mv_to_umv_border_sb(xd, &mv, bw, bh,
+ pd->subsampling_x,
+ pd->subsampling_y);
+
+ MV32 scaled_mv;
+ int xs, ys, x0, y0, x0_16, y0_16, frame_width, frame_height, buf_stride,
+ subpel_x, subpel_y;
+ uint8_t *ref_frame, *buf_ptr;
+ const YV12_BUFFER_CONFIG *ref_buf = xd->block_refs[ref]->buf;
+
+ // Get reference frame pointer, width and height.
+ if (plane == 0) {
+ frame_width = ref_buf->y_crop_width;
+ frame_height = ref_buf->y_crop_height;
+ ref_frame = ref_buf->y_buffer;
+ } else {
+ frame_width = ref_buf->uv_crop_width;
+ frame_height = ref_buf->uv_crop_height;
+ ref_frame = plane == 1 ? ref_buf->u_buffer : ref_buf->v_buffer;
+ }
+
+ if (vp9_is_scaled(sf)) {
+ // Co-ordinate of containing block to pixel precision.
+ int x_start = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x));
+ int y_start = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y));
+
+ // Co-ordinate of the block to 1/16th pixel precision.
+ x0_16 = (x_start + x) << SUBPEL_BITS;
+ y0_16 = (y_start + y) << SUBPEL_BITS;
+
+ // Co-ordinate of current block in reference frame
+ // to 1/16th pixel precision.
+ x0_16 = sf->scale_value_x(x0_16, sf);
+ y0_16 = sf->scale_value_y(y0_16, sf);
+
+ // Map the top left corner of the block into the reference frame.
+ // NOTE: This must be done in this way instead of
+ // sf->scale_value_x(x_start + x, sf).
+ x0 = sf->scale_value_x(x_start, sf) + sf->scale_value_x(x, sf);
+ y0 = sf->scale_value_y(y_start, sf) + sf->scale_value_y(y, sf);
+
+ // Scale the MV and incorporate the sub-pixel offset of the block
+ // in the reference frame.
+ scaled_mv = vp9_scale_mv(&mv_q4, mi_x + x, mi_y + y, sf);
+ xs = sf->x_step_q4;
+ ys = sf->y_step_q4;
+ } else {
+ // Co-ordinate of containing block to pixel precision.
+ x0 = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)) + x;
+ y0 = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)) + y;
+
+ // Co-ordinate of the block to 1/16th pixel precision.
+ x0_16 = x0 << SUBPEL_BITS;
+ y0_16 = y0 << SUBPEL_BITS;
+
+ scaled_mv.row = mv_q4.row;
+ scaled_mv.col = mv_q4.col;
+ xs = ys = 16;
+ }
+ subpel_x = scaled_mv.col & SUBPEL_MASK;
+ subpel_y = scaled_mv.row & SUBPEL_MASK;
+
+ // Calculate the top left corner of the best matching block in the reference frame.
+ x0 += scaled_mv.col >> SUBPEL_BITS;
+ y0 += scaled_mv.row >> SUBPEL_BITS;
+ x0_16 += scaled_mv.col;
+ y0_16 += scaled_mv.row;
+
+ // Get reference block pointer.
+ buf_ptr = ref_frame + y0 * pre_buf->stride + x0;
+ buf_stride = pre_buf->stride;
+
+ // Do border extension if there is motion or the
+ // width/height is not a multiple of 8 pixels.
+ if (scaled_mv.col || scaled_mv.row ||
+ (frame_width & 0x7) || (frame_height & 0x7)) {
+ // Get reference block bottom right coordinate.
+ int x1 = ((x0_16 + (w - 1) * xs) >> SUBPEL_BITS) + 1;
+ int y1 = ((y0_16 + (h - 1) * ys) >> SUBPEL_BITS) + 1;
+ int x_pad = 0, y_pad = 0;
+
+ if (subpel_x || (sf->x_step_q4 & SUBPEL_MASK)) {
+ x0 -= VP9_INTERP_EXTEND - 1;
+ x1 += VP9_INTERP_EXTEND;
+ x_pad = 1;
+ }
+
+ if (subpel_y || (sf->y_step_q4 & SUBPEL_MASK)) {
+ y0 -= VP9_INTERP_EXTEND - 1;
+ y1 += VP9_INTERP_EXTEND;
+ y_pad = 1;
+ }
+
+ // Skip border extension if block is inside the frame.
+ if (x0 < 0 || x0 > frame_width - 1 || x1 < 0 || x1 > frame_width ||
+ y0 < 0 || y0 > frame_height - 1 || y1 < 0 || y1 > frame_height - 1) {
+ uint8_t *buf_ptr1 = ref_frame + y0 * pre_buf->stride + x0;
+ // Extend the border.
+ build_mc_border(buf_ptr1, pre_buf->stride, xd->mc_buf, x1 - x0 + 1,
+ x0, y0, x1 - x0 + 1, y1 - y0 + 1, frame_width,
+ frame_height);
+ buf_stride = x1 - x0 + 1;
+ buf_ptr = xd->mc_buf + y_pad * 3 * buf_stride + x_pad * 3;
+ }
+ }
+
+ inter_predictor(buf_ptr, buf_stride, dst, dst_buf->stride, subpel_x,
+ subpel_y, sf, w, h, ref, xd->interp_kernel, xs, ys);
+ }
+}
+
+void vp9_dec_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
+ BLOCK_SIZE bsize) {
+ int plane;
+ const int mi_x = mi_col * MI_SIZE;
+ const int mi_y = mi_row * MI_SIZE;
+ for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
+ const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize,
+ &xd->plane[plane]);
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
+ const int bw = 4 * num_4x4_w;
+ const int bh = 4 * num_4x4_h;
+
+ if (xd->mi_8x8[0]->mbmi.sb_type < BLOCK_8X8) {
+ int i = 0, x, y;
+ assert(bsize == BLOCK_8X8);
+ for (y = 0; y < num_4x4_h; ++y)
+ for (x = 0; x < num_4x4_w; ++x)
+ dec_build_inter_predictors(xd, plane, i++, bw, bh,
+ 4 * x, 4 * y, 4, 4, mi_x, mi_y);
+ } else {
+ dec_build_inter_predictors(xd, plane, 0, bw, bh,
+ 0, 0, bw, bh, mi_x, mi_y);
+ }
}
}
+void vp9_setup_dst_planes(MACROBLOCKD *xd,
+ const YV12_BUFFER_CONFIG *src,
+ int mi_row, int mi_col) {
+ uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
+ int i;
+
+ for (i = 0; i < MAX_MB_PLANE; ++i) {
+ struct macroblockd_plane *const pd = &xd->plane[i];
+ setup_pred_plane(&pd->dst, buffers[i], strides[i], mi_row, mi_col, NULL,
+ pd->subsampling_x, pd->subsampling_y);
+ }
+}
+
+void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx,
+ const YV12_BUFFER_CONFIG *src,
+ int mi_row, int mi_col,
+ const struct scale_factors *sf) {
+ if (src != NULL) {
+ int i;
+ uint8_t *const buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
+ src->alpha_buffer};
+ const int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
+ src->alpha_stride};
+
+ for (i = 0; i < MAX_MB_PLANE; ++i) {
+ struct macroblockd_plane *const pd = &xd->plane[i];
+ setup_pred_plane(&pd->pre[idx], buffers[i], strides[i], mi_row, mi_col,
+ sf, pd->subsampling_x, pd->subsampling_y);
+ }
+ }
+}
diff --git a/libvpx/vp9/common/vp9_reconinter.h b/libvpx/vp9/common/vp9_reconinter.h
index 2c8a6e4..86f3158 100644
--- a/libvpx/vp9/common/vp9_reconinter.h
+++ b/libvpx/vp9/common/vp9_reconinter.h
@@ -14,7 +14,10 @@
#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_onyxc_int.h"
-struct subpix_fn_table;
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_build_inter_predictors_sby(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
@@ -24,80 +27,45 @@ void vp9_build_inter_predictors_sbuv(MACROBLOCKD *xd, int mi_row, int mi_col,
void vp9_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
BLOCK_SIZE bsize);
-void vp9_setup_interp_filters(MACROBLOCKD *xd,
- INTERPOLATION_TYPE filter,
- VP9_COMMON *cm);
+void vp9_dec_build_inter_predictors_sb(MACROBLOCKD *xd, int mi_row, int mi_col,
+ BLOCK_SIZE bsize);
void vp9_build_inter_predictor(const uint8_t *src, int src_stride,
uint8_t *dst, int dst_stride,
const MV *mv_q3,
- const struct scale_factors *scale,
+ const struct scale_factors *sf,
int w, int h, int do_avg,
- const struct subpix_fn_table *subpix,
- enum mv_precision precision);
-
-static int scaled_buffer_offset(int x_offset, int y_offset, int stride,
- const struct scale_factors *scale) {
- const int x = scale ? scale->sfc->scale_value_x(x_offset, scale->sfc) :
- x_offset;
- const int y = scale ? scale->sfc->scale_value_y(y_offset, scale->sfc) :
- y_offset;
+ const InterpKernel *kernel,
+ enum mv_precision precision,
+ int x, int y);
+
+static INLINE int scaled_buffer_offset(int x_offset, int y_offset, int stride,
+ const struct scale_factors *sf) {
+ const int x = sf ? sf->scale_value_x(x_offset, sf) : x_offset;
+ const int y = sf ? sf->scale_value_y(y_offset, sf) : y_offset;
return y * stride + x;
}
-static void setup_pred_plane(struct buf_2d *dst,
- uint8_t *src, int stride,
- int mi_row, int mi_col,
- const struct scale_factors *scale,
- int subsampling_x, int subsampling_y) {
+static INLINE void setup_pred_plane(struct buf_2d *dst,
+ uint8_t *src, int stride,
+ int mi_row, int mi_col,
+ const struct scale_factors *scale,
+ int subsampling_x, int subsampling_y) {
const int x = (MI_SIZE * mi_col) >> subsampling_x;
const int y = (MI_SIZE * mi_row) >> subsampling_y;
dst->buf = src + scaled_buffer_offset(x, y, stride, scale);
dst->stride = stride;
}
-// TODO(jkoleszar): audit all uses of this that don't set mb_row, mb_col
-static void setup_dst_planes(MACROBLOCKD *xd,
- const YV12_BUFFER_CONFIG *src,
- int mi_row, int mi_col) {
- uint8_t *buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
- src->alpha_buffer};
- int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
- src->alpha_stride};
- int i;
-
- for (i = 0; i < MAX_MB_PLANE; ++i) {
- struct macroblockd_plane *pd = &xd->plane[i];
- setup_pred_plane(&pd->dst, buffers[i], strides[i], mi_row, mi_col, NULL,
- pd->subsampling_x, pd->subsampling_y);
- }
-}
-
-static void setup_pre_planes(MACROBLOCKD *xd, int i,
- const YV12_BUFFER_CONFIG *src,
- int mi_row, int mi_col,
- const struct scale_factors *sf) {
- if (src) {
- int j;
- uint8_t* buffers[4] = {src->y_buffer, src->u_buffer, src->v_buffer,
- src->alpha_buffer};
- int strides[4] = {src->y_stride, src->uv_stride, src->uv_stride,
- src->alpha_stride};
-
- for (j = 0; j < MAX_MB_PLANE; ++j) {
- struct macroblockd_plane *pd = &xd->plane[j];
- setup_pred_plane(&pd->pre[i], buffers[j], strides[j],
- mi_row, mi_col, sf, pd->subsampling_x, pd->subsampling_y);
- }
- }
-}
+void vp9_setup_dst_planes(MACROBLOCKD *xd, const YV12_BUFFER_CONFIG *src,
+ int mi_row, int mi_col);
-static void set_scale_factors(MACROBLOCKD *xd, int ref0, int ref1,
- struct scale_factors sf[MAX_REF_FRAMES]) {
- xd->scale_factor[0] = sf[ref0 >= 0 ? ref0 : 0];
- xd->scale_factor[1] = sf[ref1 >= 0 ? ref1 : 0];
-}
+void vp9_setup_pre_planes(MACROBLOCKD *xd, int idx,
+ const YV12_BUFFER_CONFIG *src, int mi_row, int mi_col,
+ const struct scale_factors *sf);
-void vp9_setup_scale_factors(VP9_COMMON *cm, int i);
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_COMMON_VP9_RECONINTER_H_
diff --git a/libvpx/vp9/common/vp9_reconintra.c b/libvpx/vp9/common/vp9_reconintra.c
index eb643b0..915c1c1 100644
--- a/libvpx/vp9/common/vp9_reconintra.c
+++ b/libvpx/vp9/common/vp9_reconintra.c
@@ -18,21 +18,17 @@
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_onyxc_int.h"
-const TX_TYPE mode2txfm_map[MB_MODE_COUNT] = {
- DCT_DCT, // DC
- ADST_DCT, // V
- DCT_ADST, // H
- DCT_DCT, // D45
- ADST_ADST, // D135
- ADST_DCT, // D117
- DCT_ADST, // D153
- DCT_ADST, // D207
- ADST_DCT, // D63
- ADST_ADST, // TM
- DCT_DCT, // NEARESTMV
- DCT_DCT, // NEARMV
- DCT_DCT, // ZEROMV
- DCT_DCT // NEWMV
+const TX_TYPE intra_mode_to_tx_type_lookup[INTRA_MODES] = {
+ DCT_DCT, // DC
+ ADST_DCT, // V
+ DCT_ADST, // H
+ DCT_DCT, // D45
+ ADST_ADST, // D135
+ ADST_DCT, // D117
+ DCT_ADST, // D153
+ DCT_ADST, // D207
+ ADST_DCT, // D63
+ ADST_ADST, // TM
};
#define intra_pred_sized(type, size) \
@@ -313,17 +309,21 @@ static void init_intra_pred_fn_ptrs(void) {
#undef intra_pred_allsizes
}
-static void build_intra_predictors(const uint8_t *ref, int ref_stride,
- uint8_t *dst, int dst_stride,
+static void build_intra_predictors(const MACROBLOCKD *xd, const uint8_t *ref,
+ int ref_stride, uint8_t *dst, int dst_stride,
MB_PREDICTION_MODE mode, TX_SIZE tx_size,
int up_available, int left_available,
- int right_available) {
+ int right_available, int x, int y,
+ int plane) {
int i;
DECLARE_ALIGNED_ARRAY(16, uint8_t, left_col, 64);
DECLARE_ALIGNED_ARRAY(16, uint8_t, above_data, 128 + 16);
uint8_t *above_row = above_data + 16;
const uint8_t *const_above_row = above_row;
const int bs = 4 << tx_size;
+ int frame_width, frame_height;
+ int x0, y0;
+ const struct macroblockd_plane *const pd = &xd->plane[plane];
// 127 127 127 .. 127 127 127 127 127 127
// 129 A B .. Y Z
@@ -334,26 +334,90 @@ static void build_intra_predictors(const uint8_t *ref, int ref_stride,
once(init_intra_pred_fn_ptrs);
+ // Get current frame pointer, width and height.
+ if (plane == 0) {
+ frame_width = xd->cur_buf->y_width;
+ frame_height = xd->cur_buf->y_height;
+ } else {
+ frame_width = xd->cur_buf->uv_width;
+ frame_height = xd->cur_buf->uv_height;
+ }
+
+ // Get block position in current frame.
+ x0 = (-xd->mb_to_left_edge >> (3 + pd->subsampling_x)) + x;
+ y0 = (-xd->mb_to_top_edge >> (3 + pd->subsampling_y)) + y;
+
// left
if (left_available) {
- for (i = 0; i < bs; i++)
- left_col[i] = ref[i * ref_stride - 1];
+ if (xd->mb_to_bottom_edge < 0) {
+ /* slower path if the block needs border extension */
+ if (y0 + bs <= frame_height) {
+ for (i = 0; i < bs; ++i)
+ left_col[i] = ref[i * ref_stride - 1];
+ } else {
+ const int extend_bottom = frame_height - y0;
+ for (i = 0; i < extend_bottom; ++i)
+ left_col[i] = ref[i * ref_stride - 1];
+ for (; i < bs; ++i)
+ left_col[i] = ref[(extend_bottom - 1) * ref_stride - 1];
+ }
+ } else {
+ /* faster path if the block does not need extension */
+ for (i = 0; i < bs; ++i)
+ left_col[i] = ref[i * ref_stride - 1];
+ }
} else {
vpx_memset(left_col, 129, bs);
}
+ // TODO(hkuang) do not extend 2*bs pixels for all modes.
// above
if (up_available) {
const uint8_t *above_ref = ref - ref_stride;
- if (bs == 4 && right_available && left_available) {
- const_above_row = above_ref;
- } else {
- vpx_memcpy(above_row, above_ref, bs);
- if (bs == 4 && right_available)
- vpx_memcpy(above_row + bs, above_ref + bs, bs);
- else
- vpx_memset(above_row + bs, above_row[bs - 1], bs);
+ if (xd->mb_to_right_edge < 0) {
+ /* slower path if the block needs border extension */
+ if (x0 + 2 * bs <= frame_width) {
+ if (right_available && bs == 4) {
+ vpx_memcpy(above_row, above_ref, 2 * bs);
+ } else {
+ vpx_memcpy(above_row, above_ref, bs);
+ vpx_memset(above_row + bs, above_row[bs - 1], bs);
+ }
+ } else if (x0 + bs <= frame_width) {
+ const int r = frame_width - x0;
+ if (right_available && bs == 4) {
+ vpx_memcpy(above_row, above_ref, r);
+ vpx_memset(above_row + r, above_row[r - 1],
+ x0 + 2 * bs - frame_width);
+ } else {
+ vpx_memcpy(above_row, above_ref, bs);
+ vpx_memset(above_row + bs, above_row[bs - 1], bs);
+ }
+ } else if (x0 <= frame_width) {
+ const int r = frame_width - x0;
+ if (right_available && bs == 4) {
+ vpx_memcpy(above_row, above_ref, r);
+ vpx_memset(above_row + r, above_row[r - 1],
+ x0 + 2 * bs - frame_width);
+ } else {
+ vpx_memcpy(above_row, above_ref, r);
+ vpx_memset(above_row + r, above_row[r - 1],
+ x0 + 2 * bs - frame_width);
+ }
+ }
above_row[-1] = left_available ? above_ref[-1] : 129;
+ } else {
+ /* faster path if the block does not need extension */
+ if (bs == 4 && right_available && left_available) {
+ const_above_row = above_ref;
+ } else {
+ vpx_memcpy(above_row, above_ref, bs);
+ if (bs == 4 && right_available)
+ vpx_memcpy(above_row + bs, above_ref + bs, bs);
+ else
+ vpx_memset(above_row + bs, above_row[bs - 1], bs);
+ above_row[-1] = left_available ? above_ref[-1] : 129;
+ }
}
} else {
vpx_memset(above_row, 127, bs * 2);
@@ -370,16 +434,19 @@ static void build_intra_predictors(const uint8_t *ref, int ref_stride,
}
void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in,
- TX_SIZE tx_size, int mode,
- const uint8_t *ref, int ref_stride,
- uint8_t *dst, int dst_stride) {
+ TX_SIZE tx_size, MB_PREDICTION_MODE mode,
+ const uint8_t *ref, int ref_stride,
+ uint8_t *dst, int dst_stride,
+ int aoff, int loff, int plane) {
const int bwl = bwl_in - tx_size;
const int wmask = (1 << bwl) - 1;
const int have_top = (block_idx >> bwl) || xd->up_available;
const int have_left = (block_idx & wmask) || xd->left_available;
const int have_right = ((block_idx & wmask) != wmask);
+ const int x = aoff * 4;
+ const int y = loff * 4;
assert(bwl >= 0);
- build_intra_predictors(ref, ref_stride, dst, dst_stride, mode, tx_size,
- have_top, have_left, have_right);
+ build_intra_predictors(xd, ref, ref_stride, dst, dst_stride, mode, tx_size,
+ have_top, have_left, have_right, x, y, plane);
}
diff --git a/libvpx/vp9/common/vp9_reconintra.h b/libvpx/vp9/common/vp9_reconintra.h
index 6e3f55c..abc1767 100644
--- a/libvpx/vp9/common/vp9_reconintra.h
+++ b/libvpx/vp9/common/vp9_reconintra.h
@@ -14,8 +14,17 @@
#include "vpx/vpx_integer.h"
#include "vp9/common/vp9_blockd.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_predict_intra_block(const MACROBLOCKD *xd, int block_idx, int bwl_in,
- TX_SIZE tx_size, int mode,
+ TX_SIZE tx_size, MB_PREDICTION_MODE mode,
const uint8_t *ref, int ref_stride,
- uint8_t *dst, int dst_stride);
+ uint8_t *dst, int dst_stride,
+ int aoff, int loff, int plane);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_RECONINTRA_H_
diff --git a/libvpx/vp9/common/vp9_rtcd_defs.pl b/libvpx/vp9/common/vp9_rtcd_defs.pl
new file mode 100644
index 0000000..e4cd9d4
--- /dev/null
+++ b/libvpx/vp9/common/vp9_rtcd_defs.pl
@@ -0,0 +1,778 @@
+sub vp9_common_forward_decls() {
+print <<EOF
+/*
+ * VP9
+ */
+
+#include "vpx/vpx_integer.h"
+#include "vp9/common/vp9_enums.h"
+
+struct macroblockd;
+
+/* Encoder forward decls */
+struct macroblock;
+struct vp9_variance_vtable;
+
+#define DEC_MVCOSTS int *mvjcost, int *mvcost[2]
+struct mv;
+union int_mv;
+struct yv12_buffer_config;
+EOF
+}
+forward_decls qw/vp9_common_forward_decls/;
+
+# x86inc.asm doesn't work if pic is enabled on 32 bit platforms so no assembly.
+if (vpx_config("CONFIG_USE_X86INC") eq "yes") {
+ $mmx_x86inc = 'mmx';
+ $sse_x86inc = 'sse';
+ $sse2_x86inc = 'sse2';
+ $ssse3_x86inc = 'ssse3';
+ $avx_x86inc = 'avx';
+ $avx2_x86inc = 'avx2';
+} else {
+ $mmx_x86inc = $sse_x86inc = $sse2_x86inc = $ssse3_x86inc =
+ $avx_x86inc = $avx2_x86inc = '';
+}
+
+# this variable is for functions that are 64 bit only.
+if ($opts{arch} eq "x86_64") {
+ $mmx_x86_64 = 'mmx';
+ $sse2_x86_64 = 'sse2';
+ $ssse3_x86_64 = 'ssse3';
+ $avx_x86_64 = 'avx';
+ $avx2_x86_64 = 'avx2';
+} else {
+ $mmx_x86_64 = $sse2_x86_64 = $ssse3_x86_64 =
+ $avx_x86_64 = $avx2_x86_64 = '';
+}
+
+#
+# RECON
+#
+add_proto qw/void vp9_d207_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d207_predictor_4x4/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d45_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d45_predictor_4x4/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d63_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d63_predictor_4x4/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_h_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_h_predictor_4x4 neon dspr2/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d117_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d117_predictor_4x4/;
+
+add_proto qw/void vp9_d135_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d135_predictor_4x4/;
+
+add_proto qw/void vp9_d153_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d153_predictor_4x4/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_v_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_v_predictor_4x4 neon/, "$sse_x86inc";
+
+add_proto qw/void vp9_tm_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_tm_predictor_4x4 neon dspr2/, "$sse_x86inc";
+
+add_proto qw/void vp9_dc_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_predictor_4x4 dspr2/, "$sse_x86inc";
+
+add_proto qw/void vp9_dc_top_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_top_predictor_4x4/;
+
+add_proto qw/void vp9_dc_left_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_left_predictor_4x4/;
+
+add_proto qw/void vp9_dc_128_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_128_predictor_4x4/;
+
+add_proto qw/void vp9_d207_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d207_predictor_8x8/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d45_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d45_predictor_8x8/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d63_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d63_predictor_8x8/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_h_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_h_predictor_8x8 neon dspr2/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d117_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d117_predictor_8x8/;
+
+add_proto qw/void vp9_d135_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d135_predictor_8x8/;
+
+add_proto qw/void vp9_d153_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d153_predictor_8x8/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_v_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_v_predictor_8x8 neon/, "$sse_x86inc";
+
+add_proto qw/void vp9_tm_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_tm_predictor_8x8 neon dspr2/, "$sse2_x86inc";
+
+add_proto qw/void vp9_dc_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_predictor_8x8 dspr2/, "$sse_x86inc";
+
+add_proto qw/void vp9_dc_top_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_top_predictor_8x8/;
+
+add_proto qw/void vp9_dc_left_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_left_predictor_8x8/;
+
+add_proto qw/void vp9_dc_128_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_128_predictor_8x8/;
+
+add_proto qw/void vp9_d207_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d207_predictor_16x16/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d45_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d45_predictor_16x16/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d63_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d63_predictor_16x16/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_h_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_h_predictor_16x16 neon dspr2/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d117_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d117_predictor_16x16/;
+
+add_proto qw/void vp9_d135_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d135_predictor_16x16/;
+
+add_proto qw/void vp9_d153_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d153_predictor_16x16/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_v_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_v_predictor_16x16 neon/, "$sse2_x86inc";
+
+add_proto qw/void vp9_tm_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_tm_predictor_16x16 neon/, "$sse2_x86inc";
+
+add_proto qw/void vp9_dc_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_predictor_16x16 dspr2/, "$sse2_x86inc";
+
+add_proto qw/void vp9_dc_top_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_top_predictor_16x16/;
+
+add_proto qw/void vp9_dc_left_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_left_predictor_16x16/;
+
+add_proto qw/void vp9_dc_128_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_128_predictor_16x16/;
+
+add_proto qw/void vp9_d207_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d207_predictor_32x32/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d45_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d45_predictor_32x32/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d63_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d63_predictor_32x32/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_h_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_h_predictor_32x32 neon/, "$ssse3_x86inc";
+
+add_proto qw/void vp9_d117_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d117_predictor_32x32/;
+
+add_proto qw/void vp9_d135_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d135_predictor_32x32/;
+
+add_proto qw/void vp9_d153_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_d153_predictor_32x32/;
+
+add_proto qw/void vp9_v_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_v_predictor_32x32 neon/, "$sse2_x86inc";
+
+add_proto qw/void vp9_tm_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_tm_predictor_32x32 neon/, "$sse2_x86_64";
+
+add_proto qw/void vp9_dc_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_predictor_32x32/, "$sse2_x86inc";
+
+add_proto qw/void vp9_dc_top_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_top_predictor_32x32/;
+
+add_proto qw/void vp9_dc_left_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_left_predictor_32x32/;
+
+add_proto qw/void vp9_dc_128_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left";
+specialize qw/vp9_dc_128_predictor_32x32/;
+
+#
+# Loopfilter
+#
+add_proto qw/void vp9_lpf_vertical_16/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh";
+specialize qw/vp9_lpf_vertical_16 sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_vertical_16_dual/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh";
+specialize qw/vp9_lpf_vertical_16_dual sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_vertical_8/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count";
+specialize qw/vp9_lpf_vertical_8 sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_vertical_8_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1";
+specialize qw/vp9_lpf_vertical_8_dual sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_vertical_4/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count";
+specialize qw/vp9_lpf_vertical_4 mmx neon dspr2/;
+
+add_proto qw/void vp9_lpf_vertical_4_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1";
+specialize qw/vp9_lpf_vertical_4_dual sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_horizontal_16/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count";
+specialize qw/vp9_lpf_horizontal_16 sse2 avx2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_horizontal_8/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count";
+specialize qw/vp9_lpf_horizontal_8 sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_horizontal_8_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1";
+specialize qw/vp9_lpf_horizontal_8_dual sse2 neon dspr2/;
+
+add_proto qw/void vp9_lpf_horizontal_4/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count";
+specialize qw/vp9_lpf_horizontal_4 mmx neon dspr2/;
+
+add_proto qw/void vp9_lpf_horizontal_4_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1";
+specialize qw/vp9_lpf_horizontal_4_dual sse2 neon dspr2/;
+
+#
+# post proc
+#
+if (vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
+add_proto qw/void vp9_mbpost_proc_down/, "uint8_t *dst, int pitch, int rows, int cols, int flimit";
+specialize qw/vp9_mbpost_proc_down mmx sse2/;
+$vp9_mbpost_proc_down_sse2=vp9_mbpost_proc_down_xmm;
+
+add_proto qw/void vp9_mbpost_proc_across_ip/, "uint8_t *src, int pitch, int rows, int cols, int flimit";
+specialize qw/vp9_mbpost_proc_across_ip sse2/;
+$vp9_mbpost_proc_across_ip_sse2=vp9_mbpost_proc_across_ip_xmm;
+
+add_proto qw/void vp9_post_proc_down_and_across/, "const uint8_t *src_ptr, uint8_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit";
+specialize qw/vp9_post_proc_down_and_across mmx sse2/;
+$vp9_post_proc_down_and_across_sse2=vp9_post_proc_down_and_across_xmm;
+
+add_proto qw/void vp9_plane_add_noise/, "uint8_t *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int Width, unsigned int Height, int Pitch";
+specialize qw/vp9_plane_add_noise mmx sse2/;
+$vp9_plane_add_noise_sse2=vp9_plane_add_noise_wmt;
+}
+
+add_proto qw/void vp9_blend_mb_inner/, "uint8_t *y, uint8_t *u, uint8_t *v, int y1, int u1, int v1, int alpha, int stride";
+specialize qw/vp9_blend_mb_inner/;
+
+add_proto qw/void vp9_blend_mb_outer/, "uint8_t *y, uint8_t *u, uint8_t *v, int y1, int u1, int v1, int alpha, int stride";
+specialize qw/vp9_blend_mb_outer/;
+
+add_proto qw/void vp9_blend_b/, "uint8_t *y, uint8_t *u, uint8_t *v, int y1, int u1, int v1, int alpha, int stride";
+specialize qw/vp9_blend_b/;
+
+#
+# Sub Pixel Filters
+#
+add_proto qw/void vp9_convolve_copy/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve_copy neon dspr2/, "$sse2_x86inc";
+
+add_proto qw/void vp9_convolve_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve_avg neon dspr2/, "$sse2_x86inc";
+
+add_proto qw/void vp9_convolve8/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve8 sse2 ssse3 avx2 neon dspr2/;
+
+add_proto qw/void vp9_convolve8_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve8_horiz sse2 ssse3 avx2 neon dspr2/;
+
+add_proto qw/void vp9_convolve8_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve8_vert sse2 ssse3 avx2 neon dspr2/;
+
+add_proto qw/void vp9_convolve8_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve8_avg sse2 ssse3 neon dspr2/;
+
+add_proto qw/void vp9_convolve8_avg_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve8_avg_horiz sse2 ssse3 neon dspr2/;
+
+add_proto qw/void vp9_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h";
+specialize qw/vp9_convolve8_avg_vert sse2 ssse3 neon dspr2/;
+
+#
+# dct
+#
+add_proto qw/void vp9_idct4x4_1_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct4x4_1_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct4x4_16_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct4x4_16_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct8x8_1_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct8x8_1_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct8x8_64_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct8x8_64_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct8x8_10_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct8x8_10_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct16x16_1_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct16x16_1_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct16x16_256_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct16x16_256_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct16x16_10_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct16x16_10_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct32x32_1024_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct32x32_1024_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_idct32x32_34_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct32x32_34_add sse2 neon dspr2/;
+$vp9_idct32x32_34_add_neon=vp9_idct32x32_1024_add_neon;
+
+add_proto qw/void vp9_idct32x32_1_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_idct32x32_1_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_iht4x4_16_add/, "const int16_t *input, uint8_t *dest, int dest_stride, int tx_type";
+specialize qw/vp9_iht4x4_16_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_iht8x8_64_add/, "const int16_t *input, uint8_t *dest, int dest_stride, int tx_type";
+specialize qw/vp9_iht8x8_64_add sse2 neon dspr2/;
+
+add_proto qw/void vp9_iht16x16_256_add/, "const int16_t *input, uint8_t *output, int pitch, int tx_type";
+specialize qw/vp9_iht16x16_256_add sse2 dspr2/;
+
+# dct and add
+
+add_proto qw/void vp9_iwht4x4_1_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_iwht4x4_1_add/;
+
+add_proto qw/void vp9_iwht4x4_16_add/, "const int16_t *input, uint8_t *dest, int dest_stride";
+specialize qw/vp9_iwht4x4_16_add/;
+
+#
+# Encoder functions below this point.
+#
+if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") {
+
+
+# variance
+add_proto qw/unsigned int vp9_variance32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance32x16/, "$sse2_x86inc", "$avx2_x86inc";
+
+add_proto qw/unsigned int vp9_variance16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance16x32/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance64x32/, "$sse2_x86inc", "$avx2_x86inc";
+
+add_proto qw/unsigned int vp9_variance32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance32x64/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance32x32/, "$sse2_x86inc", "$avx2_x86inc";
+
+add_proto qw/unsigned int vp9_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance64x64/, "$sse2_x86inc", "$avx2_x86inc";
+
+add_proto qw/unsigned int vp9_variance16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance16x16 mmx/, "$sse2_x86inc", "$avx2_x86inc";
+
+add_proto qw/unsigned int vp9_variance16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance16x8 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance8x16 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance8x8 mmx/, "$sse2_x86inc";
+
+add_proto qw/void vp9_get_sse_sum_8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum";
+specialize qw/vp9_get_sse_sum_8x8 sse2/;
+$vp9_get_sse_sum_8x8_sse2=vp9_get8x8var_sse2;
+
+add_proto qw/unsigned int vp9_variance8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance8x4/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance4x8/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance4x4 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance64x64 avx2/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance64x64 avx2/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance32x64/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance32x64/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance64x32/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance64x32/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance32x16/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance32x16/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance16x32/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance16x32/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance32x32 avx2/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance32x32 avx2/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance16x16/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance16x16/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance8x16/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance8x16/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance16x8/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance16x8/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance8x8/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance8x8/, "$sse2_x86inc", "$ssse3_x86inc";
+
+# TODO(jingning): need to convert 8x4/4x8 functions into mmx/sse form
+add_proto qw/unsigned int vp9_sub_pixel_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance8x4/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance8x4/, "$sse2_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance4x8/, "$sse_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance4x8/, "$sse_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sub_pixel_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_variance4x4/, "$sse_x86inc", "$ssse3_x86inc";
+#vp9_sub_pixel_variance4x4_sse2=vp9_sub_pixel_variance4x4_wmt
+
+add_proto qw/unsigned int vp9_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred";
+specialize qw/vp9_sub_pixel_avg_variance4x4/, "$sse_x86inc", "$ssse3_x86inc";
+
+add_proto qw/unsigned int vp9_sad64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad64x64/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad32x64/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad64x32/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad32x16/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad16x32/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad32x32/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad16x16 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad16x8 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad8x16 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad8x8 mmx/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad8x4/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad4x8/, "$sse_x86inc";
+
+add_proto qw/unsigned int vp9_sad4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad";
+specialize qw/vp9_sad4x4 mmx/, "$sse_x86inc";
+
+add_proto qw/unsigned int vp9_sad64x64_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad64x64_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad32x64_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad32x64_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad64x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad64x32_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad32x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad32x16_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad16x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad16x32_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad32x32_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad32x32_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad16x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad16x16_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad16x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad16x8_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad8x16_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad8x16_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad8x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad8x8_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad8x4_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad8x4_avg/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_sad4x8_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad4x8_avg/, "$sse_x86inc";
+
+add_proto qw/unsigned int vp9_sad4x4_avg/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad";
+specialize qw/vp9_sad4x4_avg/, "$sse_x86inc";
+
+add_proto qw/unsigned int vp9_variance_halfpixvar16x16_h/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar16x16_h/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance_halfpixvar16x16_v/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar16x16_v/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance_halfpixvar16x16_hv/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar16x16_hv/, "$sse2_x86inc";
+
+add_proto qw/unsigned int vp9_variance_halfpixvar64x64_h/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar64x64_h/;
+
+add_proto qw/unsigned int vp9_variance_halfpixvar64x64_v/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar64x64_v/;
+
+add_proto qw/unsigned int vp9_variance_halfpixvar64x64_hv/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar64x64_hv/;
+
+add_proto qw/unsigned int vp9_variance_halfpixvar32x32_h/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar32x32_h/;
+
+add_proto qw/unsigned int vp9_variance_halfpixvar32x32_v/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar32x32_v/;
+
+add_proto qw/unsigned int vp9_variance_halfpixvar32x32_hv/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_variance_halfpixvar32x32_hv/;
+
+add_proto qw/void vp9_sad64x64x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad64x64x3/;
+
+add_proto qw/void vp9_sad32x32x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad32x32x3/;
+
+add_proto qw/void vp9_sad16x16x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad16x16x3 sse3 ssse3/;
+
+add_proto qw/void vp9_sad16x8x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad16x8x3 sse3 ssse3/;
+
+add_proto qw/void vp9_sad8x16x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad8x16x3 sse3/;
+
+add_proto qw/void vp9_sad8x8x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad8x8x3 sse3/;
+
+add_proto qw/void vp9_sad4x4x3/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad4x4x3 sse3/;
+
+add_proto qw/void vp9_sad64x64x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad64x64x8/;
+
+add_proto qw/void vp9_sad32x32x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad32x32x8/;
+
+add_proto qw/void vp9_sad16x16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad16x16x8 sse4/;
+
+add_proto qw/void vp9_sad16x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad16x8x8 sse4/;
+
+add_proto qw/void vp9_sad8x16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad8x16x8 sse4/;
+
+add_proto qw/void vp9_sad8x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad8x8x8 sse4/;
+
+add_proto qw/void vp9_sad8x4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad8x4x8/;
+
+add_proto qw/void vp9_sad4x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad4x8x8/;
+
+add_proto qw/void vp9_sad4x4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array";
+specialize qw/vp9_sad4x4x8 sse4/;
+
+add_proto qw/void vp9_sad64x64x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad64x64x4d sse2/;
+
+add_proto qw/void vp9_sad32x64x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad32x64x4d sse2/;
+
+add_proto qw/void vp9_sad64x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad64x32x4d sse2/;
+
+add_proto qw/void vp9_sad32x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad32x16x4d sse2/;
+
+add_proto qw/void vp9_sad16x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad16x32x4d sse2/;
+
+add_proto qw/void vp9_sad32x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad32x32x4d sse2/;
+
+add_proto qw/void vp9_sad16x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad16x16x4d sse2/;
+
+add_proto qw/void vp9_sad16x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad16x8x4d sse2/;
+
+add_proto qw/void vp9_sad8x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad8x16x4d sse2/;
+
+add_proto qw/void vp9_sad8x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad8x8x4d sse2/;
+
+# TODO(jingning): need to convert these 4x8/8x4 functions into sse2 form
+add_proto qw/void vp9_sad8x4x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad8x4x4d sse2/;
+
+add_proto qw/void vp9_sad4x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad4x8x4d sse/;
+
+add_proto qw/void vp9_sad4x4x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array";
+specialize qw/vp9_sad4x4x4d sse/;
+
+#add_proto qw/unsigned int vp9_sub_pixel_mse16x16/, "const uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, const uint8_t *dst_ptr, int dst_pixels_per_line, unsigned int *sse";
+#specialize qw/vp9_sub_pixel_mse16x16 sse2 mmx/;
+
+add_proto qw/unsigned int vp9_mse16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse";
+specialize qw/vp9_mse16x16 mmx/, "$sse2_x86inc", "$avx2_x86inc";
+
+add_proto qw/unsigned int vp9_mse8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse";
+specialize qw/vp9_mse8x16/;
+
+add_proto qw/unsigned int vp9_mse16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse";
+specialize qw/vp9_mse16x8/;
+
+add_proto qw/unsigned int vp9_mse8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse";
+specialize qw/vp9_mse8x8/;
+
+add_proto qw/unsigned int vp9_sub_pixel_mse64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_mse64x64/;
+
+add_proto qw/unsigned int vp9_sub_pixel_mse32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse";
+specialize qw/vp9_sub_pixel_mse32x32/;
+
+add_proto qw/unsigned int vp9_get_mb_ss/, "const int16_t *";
+specialize qw/vp9_get_mb_ss mmx sse2/;
+# ENCODEMB INVOKE
+
+add_proto qw/int64_t vp9_block_error/, "const int16_t *coeff, const int16_t *dqcoeff, intptr_t block_size, int64_t *ssz";
+specialize qw/vp9_block_error/, "$sse2_x86inc";
+
+add_proto qw/void vp9_subtract_block/, "int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride";
+specialize qw/vp9_subtract_block/, "$sse2_x86inc";
+
+add_proto qw/void vp9_quantize_b/, "const int16_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, const int16_t *dequant_ptr, int zbin_oq_value, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
+specialize qw/vp9_quantize_b/, "$ssse3_x86_64";
+
+add_proto qw/void vp9_quantize_b_32x32/, "const int16_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, const int16_t *dequant_ptr, int zbin_oq_value, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan";
+specialize qw/vp9_quantize_b_32x32/, "$ssse3_x86_64";
+
+#
+# Structured Similarity (SSIM)
+#
+if (vpx_config("CONFIG_INTERNAL_STATS") eq "yes") {
+ add_proto qw/void vp9_ssim_parms_8x8/, "uint8_t *s, int sp, uint8_t *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr";
+ specialize qw/vp9_ssim_parms_8x8/, "$sse2_x86_64";
+
+ add_proto qw/void vp9_ssim_parms_16x16/, "uint8_t *s, int sp, uint8_t *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr";
+ specialize qw/vp9_ssim_parms_16x16/, "$sse2_x86_64";
+}
+
+# fdct functions
+add_proto qw/void vp9_fht4x4/, "const int16_t *input, int16_t *output, int stride, int tx_type";
+specialize qw/vp9_fht4x4 sse2 avx2/;
+
+add_proto qw/void vp9_fht8x8/, "const int16_t *input, int16_t *output, int stride, int tx_type";
+specialize qw/vp9_fht8x8 sse2 avx2/;
+
+add_proto qw/void vp9_fht16x16/, "const int16_t *input, int16_t *output, int stride, int tx_type";
+specialize qw/vp9_fht16x16 sse2 avx2/;
+
+add_proto qw/void vp9_fwht4x4/, "const int16_t *input, int16_t *output, int stride";
+specialize qw/vp9_fwht4x4/;
+
+add_proto qw/void vp9_fdct4x4/, "const int16_t *input, int16_t *output, int stride";
+specialize qw/vp9_fdct4x4 sse2 avx2/;
+
+add_proto qw/void vp9_fdct8x8/, "const int16_t *input, int16_t *output, int stride";
+specialize qw/vp9_fdct8x8 sse2 avx2/;
+
+add_proto qw/void vp9_fdct16x16/, "const int16_t *input, int16_t *output, int stride";
+specialize qw/vp9_fdct16x16 sse2 avx2/;
+
+add_proto qw/void vp9_fdct32x32/, "const int16_t *input, int16_t *output, int stride";
+specialize qw/vp9_fdct32x32 sse2 avx2/;
+
+add_proto qw/void vp9_fdct32x32_rd/, "const int16_t *input, int16_t *output, int stride";
+specialize qw/vp9_fdct32x32_rd sse2 avx2/;
+
+#
+# Motion search
+#
+add_proto qw/int vp9_full_search_sad/, "const struct macroblock *x, const struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv, struct mv *best_mv";
+specialize qw/vp9_full_search_sad sse3 sse4_1/;
+$vp9_full_search_sad_sse3=vp9_full_search_sadx3;
+$vp9_full_search_sad_sse4_1=vp9_full_search_sadx8;
+
+add_proto qw/int vp9_refining_search_sad/, "const struct macroblock *x, struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv";
+specialize qw/vp9_refining_search_sad sse3/;
+$vp9_refining_search_sad_sse3=vp9_refining_search_sadx4;
+
+add_proto qw/int vp9_diamond_search_sad/, "const struct macroblock *x, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv";
+specialize qw/vp9_diamond_search_sad sse3/;
+$vp9_diamond_search_sad_sse3=vp9_diamond_search_sadx4;
+
+add_proto qw/int vp9_full_range_search/, "const struct macroblock *x, struct mv *ref_mv, struct mv *best_mv, int search_param, int sad_per_bit, int *num00, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv";
+specialize qw/vp9_full_range_search/;
+
+add_proto qw/void vp9_temporal_filter_apply/, "uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count";
+specialize qw/vp9_temporal_filter_apply sse2/;
+
+}
+# end encoder functions
+1;
diff --git a/libvpx/vp9/common/vp9_rtcd_defs.sh b/libvpx/vp9/common/vp9_rtcd_defs.sh
deleted file mode 100644
index 2c0864e..0000000
--- a/libvpx/vp9/common/vp9_rtcd_defs.sh
+++ /dev/null
@@ -1,744 +0,0 @@
-vp9_common_forward_decls() {
-cat <<EOF
-/*
- * VP9
- */
-
-#include "vpx/vpx_integer.h"
-#include "vp9/common/vp9_enums.h"
-
-struct macroblockd;
-
-/* Encoder forward decls */
-struct macroblock;
-struct vp9_variance_vtable;
-
-#define DEC_MVCOSTS int *mvjcost, int *mvcost[2]
-union int_mv;
-struct yv12_buffer_config;
-EOF
-}
-forward_decls vp9_common_forward_decls
-
-# x86inc.asm doesn't work if pic is enabled on 32 bit platforms so no assembly.
-[ "$CONFIG_USE_X86INC" = "yes" ] && mmx_x86inc=mmx && sse_x86inc=sse &&
- sse2_x86inc=sse2 && ssse3_x86inc=ssse3 && avx_x86inc=avx && avx2_x86inc=avx2
-
-# this variable is for functions that are 64 bit only.
-[ $arch = "x86_64" ] && mmx_x86_64=mmx && sse2_x86_64=sse2 &&
- ssse3_x86_64=ssse3 && avx_x86_64=avx && avx2_x86_64=avx2
-
-#
-# RECON
-#
-prototype void vp9_d207_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d207_predictor_4x4 $ssse3_x86inc
-
-prototype void vp9_d45_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d45_predictor_4x4 $ssse3_x86inc
-
-prototype void vp9_d63_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d63_predictor_4x4 $ssse3_x86inc
-
-prototype void vp9_h_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_h_predictor_4x4 $ssse3_x86inc dspr2
-
-prototype void vp9_d117_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d117_predictor_4x4
-
-prototype void vp9_d135_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d135_predictor_4x4
-
-prototype void vp9_d153_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d153_predictor_4x4 $ssse3_x86inc
-
-prototype void vp9_v_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_v_predictor_4x4 $sse_x86inc
-
-prototype void vp9_tm_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_tm_predictor_4x4 $sse_x86inc dspr2
-
-prototype void vp9_dc_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_predictor_4x4 $sse_x86inc dspr2
-
-prototype void vp9_dc_top_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_top_predictor_4x4
-
-prototype void vp9_dc_left_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_left_predictor_4x4
-
-prototype void vp9_dc_128_predictor_4x4 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_128_predictor_4x4
-
-prototype void vp9_d207_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d207_predictor_8x8 $ssse3_x86inc
-
-prototype void vp9_d45_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d45_predictor_8x8 $ssse3_x86inc
-
-prototype void vp9_d63_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d63_predictor_8x8 $ssse3_x86inc
-
-prototype void vp9_h_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_h_predictor_8x8 $ssse3_x86inc dspr2
-
-prototype void vp9_d117_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d117_predictor_8x8
-
-prototype void vp9_d135_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d135_predictor_8x8
-
-prototype void vp9_d153_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d153_predictor_8x8 $ssse3_x86inc
-
-prototype void vp9_v_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_v_predictor_8x8 $sse_x86inc
-
-prototype void vp9_tm_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_tm_predictor_8x8 $sse2_x86inc dspr2
-
-prototype void vp9_dc_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_predictor_8x8 $sse_x86inc dspr2
-
-prototype void vp9_dc_top_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_top_predictor_8x8
-
-prototype void vp9_dc_left_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_left_predictor_8x8
-
-prototype void vp9_dc_128_predictor_8x8 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_128_predictor_8x8
-
-prototype void vp9_d207_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d207_predictor_16x16 $ssse3_x86inc
-
-prototype void vp9_d45_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d45_predictor_16x16 $ssse3_x86inc
-
-prototype void vp9_d63_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d63_predictor_16x16 $ssse3_x86inc
-
-prototype void vp9_h_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_h_predictor_16x16 $ssse3_x86inc dspr2
-
-prototype void vp9_d117_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d117_predictor_16x16
-
-prototype void vp9_d135_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d135_predictor_16x16
-
-prototype void vp9_d153_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d153_predictor_16x16 $ssse3_x86inc
-
-prototype void vp9_v_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_v_predictor_16x16 $sse2_x86inc
-
-prototype void vp9_tm_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_tm_predictor_16x16 $sse2_x86inc
-
-prototype void vp9_dc_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_predictor_16x16 $sse2_x86inc dspr2
-
-prototype void vp9_dc_top_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_top_predictor_16x16
-
-prototype void vp9_dc_left_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_left_predictor_16x16
-
-prototype void vp9_dc_128_predictor_16x16 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_128_predictor_16x16
-
-prototype void vp9_d207_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d207_predictor_32x32 $ssse3_x86inc
-
-prototype void vp9_d45_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d45_predictor_32x32 $ssse3_x86inc
-
-prototype void vp9_d63_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d63_predictor_32x32 $ssse3_x86inc
-
-prototype void vp9_h_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_h_predictor_32x32 $ssse3_x86inc
-
-prototype void vp9_d117_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d117_predictor_32x32
-
-prototype void vp9_d135_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d135_predictor_32x32
-
-prototype void vp9_d153_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_d153_predictor_32x32
-
-prototype void vp9_v_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_v_predictor_32x32 $sse2_x86inc
-
-prototype void vp9_tm_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_tm_predictor_32x32 $sse2_x86_64
-
-prototype void vp9_dc_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_predictor_32x32 $sse2_x86inc
-
-prototype void vp9_dc_top_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_top_predictor_32x32
-
-prototype void vp9_dc_left_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_left_predictor_32x32
-
-prototype void vp9_dc_128_predictor_32x32 "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"
-specialize vp9_dc_128_predictor_32x32
-
-#
-# Loopfilter
-#
-prototype void vp9_mb_lpf_vertical_edge_w "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"
-specialize vp9_mb_lpf_vertical_edge_w sse2 neon dspr2
-
-prototype void vp9_mbloop_filter_vertical_edge "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count"
-specialize vp9_mbloop_filter_vertical_edge sse2 neon dspr2
-
-prototype void vp9_loop_filter_vertical_edge "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count"
-specialize vp9_loop_filter_vertical_edge mmx neon dspr2
-
-prototype void vp9_mb_lpf_horizontal_edge_w "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count"
-specialize vp9_mb_lpf_horizontal_edge_w sse2 avx2 neon dspr2
-
-prototype void vp9_mbloop_filter_horizontal_edge "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count"
-specialize vp9_mbloop_filter_horizontal_edge sse2 neon dspr2
-
-prototype void vp9_loop_filter_horizontal_edge "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int count"
-specialize vp9_loop_filter_horizontal_edge mmx neon dspr2
-
-#
-# post proc
-#
-if [ "$CONFIG_VP9_POSTPROC" = "yes" ]; then
-prototype void vp9_mbpost_proc_down "uint8_t *dst, int pitch, int rows, int cols, int flimit"
-specialize vp9_mbpost_proc_down mmx sse2
-vp9_mbpost_proc_down_sse2=vp9_mbpost_proc_down_xmm
-
-prototype void vp9_mbpost_proc_across_ip "uint8_t *src, int pitch, int rows, int cols, int flimit"
-specialize vp9_mbpost_proc_across_ip sse2
-vp9_mbpost_proc_across_ip_sse2=vp9_mbpost_proc_across_ip_xmm
-
-prototype void vp9_post_proc_down_and_across "const uint8_t *src_ptr, uint8_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit"
-specialize vp9_post_proc_down_and_across mmx sse2
-vp9_post_proc_down_and_across_sse2=vp9_post_proc_down_and_across_xmm
-
-prototype void vp9_plane_add_noise "uint8_t *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int Width, unsigned int Height, int Pitch"
-specialize vp9_plane_add_noise mmx sse2
-vp9_plane_add_noise_sse2=vp9_plane_add_noise_wmt
-fi
-
-prototype void vp9_blend_mb_inner "uint8_t *y, uint8_t *u, uint8_t *v, int y1, int u1, int v1, int alpha, int stride"
-specialize vp9_blend_mb_inner
-
-prototype void vp9_blend_mb_outer "uint8_t *y, uint8_t *u, uint8_t *v, int y1, int u1, int v1, int alpha, int stride"
-specialize vp9_blend_mb_outer
-
-prototype void vp9_blend_b "uint8_t *y, uint8_t *u, uint8_t *v, int y1, int u1, int v1, int alpha, int stride"
-specialize vp9_blend_b
-
-#
-# Sub Pixel Filters
-#
-prototype void vp9_convolve_copy "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve_copy $sse2_x86inc neon dspr2
-
-prototype void vp9_convolve_avg "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve_avg $sse2_x86inc neon dspr2
-
-prototype void vp9_convolve8 "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve8 sse2 ssse3 neon dspr2
-
-prototype void vp9_convolve8_horiz "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve8_horiz sse2 ssse3 neon dspr2
-
-prototype void vp9_convolve8_vert "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve8_vert sse2 ssse3 neon dspr2
-
-prototype void vp9_convolve8_avg "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve8_avg sse2 ssse3 neon dspr2
-
-prototype void vp9_convolve8_avg_horiz "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve8_avg_horiz sse2 ssse3 neon dspr2
-
-prototype void vp9_convolve8_avg_vert "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"
-specialize vp9_convolve8_avg_vert sse2 ssse3 neon dspr2
-
-#
-# dct
-#
-prototype void vp9_idct4x4_1_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct4x4_1_add sse2 neon dspr2
-
-prototype void vp9_idct4x4_16_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct4x4_16_add sse2 neon dspr2
-
-prototype void vp9_idct8x8_1_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct8x8_1_add sse2 neon dspr2
-
-prototype void vp9_idct8x8_64_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct8x8_64_add sse2 neon dspr2
-
-prototype void vp9_idct8x8_10_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct8x8_10_add sse2 neon dspr2
-
-prototype void vp9_idct16x16_1_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct16x16_1_add sse2 neon dspr2
-
-prototype void vp9_idct16x16_256_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct16x16_256_add sse2 neon dspr2
-
-prototype void vp9_idct16x16_10_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct16x16_10_add sse2 neon dspr2
-
-prototype void vp9_idct32x32_1024_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct32x32_1024_add sse2 neon dspr2
-
-prototype void vp9_idct32x32_34_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct32x32_34_add sse2 dspr2
-
-prototype void vp9_idct32x32_1_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_idct32x32_1_add sse2 neon dspr2
-
-prototype void vp9_iht4x4_16_add "const int16_t *input, uint8_t *dest, int dest_stride, int tx_type"
-specialize vp9_iht4x4_16_add sse2 neon dspr2
-
-prototype void vp9_iht8x8_64_add "const int16_t *input, uint8_t *dest, int dest_stride, int tx_type"
-specialize vp9_iht8x8_64_add sse2 neon dspr2
-
-prototype void vp9_iht16x16_256_add "const int16_t *input, uint8_t *output, int pitch, int tx_type"
-specialize vp9_iht16x16_256_add sse2 dspr2
-
-# dct and add
-
-prototype void vp9_iwht4x4_1_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_iwht4x4_1_add
-
-prototype void vp9_iwht4x4_16_add "const int16_t *input, uint8_t *dest, int dest_stride"
-specialize vp9_iwht4x4_16_add
-
-#
-# Encoder functions below this point.
-#
-if [ "$CONFIG_VP9_ENCODER" = "yes" ]; then
-
-
-# variance
-prototype unsigned int vp9_variance32x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance32x16 $sse2_x86inc
-
-prototype unsigned int vp9_variance16x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance16x32 $sse2_x86inc
-
-prototype unsigned int vp9_variance64x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance64x32 $sse2_x86inc
-
-prototype unsigned int vp9_variance32x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance32x64 $sse2_x86inc
-
-prototype unsigned int vp9_variance32x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance32x32 $sse2_x86inc
-
-prototype unsigned int vp9_variance64x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance64x64 $sse2_x86inc
-
-prototype unsigned int vp9_variance16x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance16x16 mmx $sse2_x86inc
-
-prototype unsigned int vp9_variance16x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance16x8 mmx $sse2_x86inc
-
-prototype unsigned int vp9_variance8x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance8x16 mmx $sse2_x86inc
-
-prototype unsigned int vp9_variance8x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance8x8 mmx $sse2_x86inc
-
-prototype void vp9_get_sse_sum_8x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"
-specialize vp9_get_sse_sum_8x8 sse2
-vp9_get_sse_sum_8x8_sse2=vp9_get8x8var_sse2
-
-prototype unsigned int vp9_variance8x4 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance8x4 $sse2_x86inc
-
-prototype unsigned int vp9_variance4x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance4x8 $sse2_x86inc
-
-prototype unsigned int vp9_variance4x4 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance4x4 mmx $sse2_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance64x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance64x64 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance64x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance64x64 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance32x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance32x64 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance32x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance32x64 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance64x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance64x32 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance64x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance64x32 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance32x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance32x16 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance32x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance32x16 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance16x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance16x32 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance16x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance16x32 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance32x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance32x32 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance32x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance32x32 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance16x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance16x16 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance16x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance16x16 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance8x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance8x16 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance8x16 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance8x16 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance16x8 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance16x8 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance16x8 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance16x8 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance8x8 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance8x8 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance8x8 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance8x8 $sse2_x86inc $ssse3_x86inc
-
-# TODO(jingning): need to convert 8x4/4x8 functions into mmx/sse form
-prototype unsigned int vp9_sub_pixel_variance8x4 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance8x4 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance8x4 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance8x4 $sse2_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance4x8 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance4x8 $sse_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_avg_variance4x8 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance4x8 $sse_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sub_pixel_variance4x4 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_variance4x4 $sse_x86inc $ssse3_x86inc
-#vp9_sub_pixel_variance4x4_sse2=vp9_sub_pixel_variance4x4_wmt
-
-prototype unsigned int vp9_sub_pixel_avg_variance4x4 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, const uint8_t *second_pred"
-specialize vp9_sub_pixel_avg_variance4x4 $sse_x86inc $ssse3_x86inc
-
-prototype unsigned int vp9_sad64x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad64x64 $sse2_x86inc
-
-prototype unsigned int vp9_sad32x64 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad32x64 $sse2_x86inc
-
-prototype unsigned int vp9_sad64x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad64x32 $sse2_x86inc
-
-prototype unsigned int vp9_sad32x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad32x16 $sse2_x86inc
-
-prototype unsigned int vp9_sad16x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad16x32 $sse2_x86inc
-
-prototype unsigned int vp9_sad32x32 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad32x32 $sse2_x86inc
-
-prototype unsigned int vp9_sad16x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad16x16 mmx $sse2_x86inc
-
-prototype unsigned int vp9_sad16x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad16x8 mmx $sse2_x86inc
-
-prototype unsigned int vp9_sad8x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad8x16 mmx $sse2_x86inc
-
-prototype unsigned int vp9_sad8x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad8x8 mmx $sse2_x86inc
-
-prototype unsigned int vp9_sad8x4 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad8x4 $sse2_x86inc
-
-prototype unsigned int vp9_sad4x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad4x8 $sse_x86inc
-
-prototype unsigned int vp9_sad4x4 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int max_sad"
-specialize vp9_sad4x4 mmx $sse_x86inc
-
-prototype unsigned int vp9_sad64x64_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad64x64_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad32x64_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad32x64_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad64x32_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad64x32_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad32x16_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad32x16_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad16x32_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad16x32_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad32x32_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad32x32_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad16x16_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad16x16_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad16x8_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad16x8_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad8x16_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad8x16_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad8x8_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad8x8_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad8x4_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad8x4_avg $sse2_x86inc
-
-prototype unsigned int vp9_sad4x8_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad4x8_avg $sse_x86inc
-
-prototype unsigned int vp9_sad4x4_avg "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred, unsigned int max_sad"
-specialize vp9_sad4x4_avg $sse_x86inc
-
-prototype unsigned int vp9_variance_halfpixvar16x16_h "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar16x16_h $sse2_x86inc
-
-prototype unsigned int vp9_variance_halfpixvar16x16_v "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar16x16_v $sse2_x86inc
-
-prototype unsigned int vp9_variance_halfpixvar16x16_hv "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar16x16_hv $sse2_x86inc
-
-prototype unsigned int vp9_variance_halfpixvar64x64_h "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar64x64_h
-
-prototype unsigned int vp9_variance_halfpixvar64x64_v "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar64x64_v
-
-prototype unsigned int vp9_variance_halfpixvar64x64_hv "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar64x64_hv
-
-prototype unsigned int vp9_variance_halfpixvar32x32_h "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar32x32_h
-
-prototype unsigned int vp9_variance_halfpixvar32x32_v "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar32x32_v
-
-prototype unsigned int vp9_variance_halfpixvar32x32_hv "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_variance_halfpixvar32x32_hv
-
-prototype void vp9_sad64x64x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad64x64x3
-
-prototype void vp9_sad32x32x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad32x32x3
-
-prototype void vp9_sad16x16x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad16x16x3 sse3 ssse3
-
-prototype void vp9_sad16x8x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad16x8x3 sse3 ssse3
-
-prototype void vp9_sad8x16x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad8x16x3 sse3
-
-prototype void vp9_sad8x8x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad8x8x3 sse3
-
-prototype void vp9_sad4x4x3 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sad_array"
-specialize vp9_sad4x4x3 sse3
-
-prototype void vp9_sad64x64x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad64x64x8
-
-prototype void vp9_sad32x32x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad32x32x8
-
-prototype void vp9_sad16x16x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad16x16x8 sse4
-
-prototype void vp9_sad16x8x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad16x8x8 sse4
-
-prototype void vp9_sad8x16x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad8x16x8 sse4
-
-prototype void vp9_sad8x8x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad8x8x8 sse4
-
-prototype void vp9_sad8x4x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad8x4x8
-
-prototype void vp9_sad4x8x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad4x8x8
-
-prototype void vp9_sad4x4x8 "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"
-specialize vp9_sad4x4x8 sse4
-
-prototype void vp9_sad64x64x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad64x64x4d sse2
-
-prototype void vp9_sad32x64x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad32x64x4d sse2
-
-prototype void vp9_sad64x32x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad64x32x4d sse2
-
-prototype void vp9_sad32x16x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad32x16x4d sse2
-
-prototype void vp9_sad16x32x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad16x32x4d sse2
-
-prototype void vp9_sad32x32x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad32x32x4d sse2
-
-prototype void vp9_sad16x16x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad16x16x4d sse2
-
-prototype void vp9_sad16x8x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad16x8x4d sse2
-
-prototype void vp9_sad8x16x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad8x16x4d sse2
-
-prototype void vp9_sad8x8x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad8x8x4d sse2
-
-# TODO(jingning): need to convert these 4x8/8x4 functions into sse2 form
-prototype void vp9_sad8x4x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad8x4x4d sse2
-
-prototype void vp9_sad4x8x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad4x8x4d sse
-
-prototype void vp9_sad4x4x4d "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, unsigned int *sad_array"
-specialize vp9_sad4x4x4d sse
-
-#prototype unsigned int vp9_sub_pixel_mse16x16 "const uint8_t *src_ptr, int src_pixels_per_line, int xoffset, int yoffset, const uint8_t *dst_ptr, int dst_pixels_per_line, unsigned int *sse"
-#specialize vp9_sub_pixel_mse16x16 sse2 mmx
-
-prototype unsigned int vp9_mse16x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"
-specialize vp9_mse16x16 mmx $sse2_x86inc
-
-prototype unsigned int vp9_mse8x16 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"
-specialize vp9_mse8x16
-
-prototype unsigned int vp9_mse16x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"
-specialize vp9_mse16x8
-
-prototype unsigned int vp9_mse8x8 "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"
-specialize vp9_mse8x8
-
-prototype unsigned int vp9_sub_pixel_mse64x64 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_mse64x64
-
-prototype unsigned int vp9_sub_pixel_mse32x32 "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"
-specialize vp9_sub_pixel_mse32x32
-
-prototype unsigned int vp9_get_mb_ss "const int16_t *"
-specialize vp9_get_mb_ss mmx sse2
-# ENCODEMB INVOKE
-
-prototype int64_t vp9_block_error "int16_t *coeff, int16_t *dqcoeff, intptr_t block_size, int64_t *ssz"
-specialize vp9_block_error $sse2_x86inc
-
-prototype void vp9_subtract_block "int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride"
-specialize vp9_subtract_block $sse2_x86inc
-
-prototype void vp9_quantize_b "const int16_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, const int16_t *dequant_ptr, int zbin_oq_value, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan"
-specialize vp9_quantize_b $ssse3_x86_64
-
-prototype void vp9_quantize_b_32x32 "const int16_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, int16_t *qcoeff_ptr, int16_t *dqcoeff_ptr, const int16_t *dequant_ptr, int zbin_oq_value, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan"
-specialize vp9_quantize_b_32x32 $ssse3_x86_64
-
-#
-# Structured Similarity (SSIM)
-#
-if [ "$CONFIG_INTERNAL_STATS" = "yes" ]; then
- prototype void vp9_ssim_parms_8x8 "uint8_t *s, int sp, uint8_t *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr"
- specialize vp9_ssim_parms_8x8 $sse2_x86_64
-
- prototype void vp9_ssim_parms_16x16 "uint8_t *s, int sp, uint8_t *r, int rp, unsigned long *sum_s, unsigned long *sum_r, unsigned long *sum_sq_s, unsigned long *sum_sq_r, unsigned long *sum_sxr"
- specialize vp9_ssim_parms_16x16 $sse2_x86_64
-fi
-
-# fdct functions
-prototype void vp9_short_fht4x4 "const int16_t *input, int16_t *output, int stride, int tx_type"
-specialize vp9_short_fht4x4 sse2
-
-prototype void vp9_short_fht8x8 "const int16_t *input, int16_t *output, int stride, int tx_type"
-specialize vp9_short_fht8x8 sse2
-
-prototype void vp9_short_fht16x16 "const int16_t *input, int16_t *output, int stride, int tx_type"
-specialize vp9_short_fht16x16 sse2
-
-prototype void vp9_fwht4x4 "const int16_t *input, int16_t *output, int stride"
-specialize vp9_fwht4x4
-
-prototype void vp9_fdct4x4 "const int16_t *input, int16_t *output, int stride"
-specialize vp9_fdct4x4 sse2
-
-prototype void vp9_fdct8x8 "const int16_t *input, int16_t *output, int stride"
-specialize vp9_fdct8x8 sse2
-
-prototype void vp9_fdct16x16 "const int16_t *input, int16_t *output, int stride"
-specialize vp9_fdct16x16 sse2
-
-prototype void vp9_fdct32x32 "const int16_t *input, int16_t *output, int stride"
-specialize vp9_fdct32x32 sse2
-
-prototype void vp9_fdct32x32_rd "const int16_t *input, int16_t *output, int stride"
-specialize vp9_fdct32x32_rd sse2
-
-#
-# Motion search
-#
-prototype int vp9_full_search_sad "struct macroblock *x, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv, int n"
-specialize vp9_full_search_sad sse3 sse4_1
-vp9_full_search_sad_sse3=vp9_full_search_sadx3
-vp9_full_search_sad_sse4_1=vp9_full_search_sadx8
-
-prototype int vp9_refining_search_sad "struct macroblock *x, union int_mv *ref_mv, int sad_per_bit, int distance, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
-specialize vp9_refining_search_sad sse3
-vp9_refining_search_sad_sse3=vp9_refining_search_sadx4
-
-prototype int vp9_diamond_search_sad "struct macroblock *x, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
-specialize vp9_diamond_search_sad sse3
-vp9_diamond_search_sad_sse3=vp9_diamond_search_sadx4
-
-prototype void vp9_temporal_filter_apply "uint8_t *frame1, unsigned int stride, uint8_t *frame2, unsigned int block_size, int strength, int filter_weight, unsigned int *accumulator, uint16_t *count"
-specialize vp9_temporal_filter_apply sse2
-
-prototype void vp9_yv12_copy_partial_frame "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc, int fraction"
-specialize vp9_yv12_copy_partial_frame
-
-
-fi
-# end encoder functions
diff --git a/libvpx/vp9/common/vp9_sadmxn.h b/libvpx/vp9/common/vp9_sadmxn.h
deleted file mode 100644
index b2dfd63..0000000
--- a/libvpx/vp9/common/vp9_sadmxn.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_COMMON_VP9_SADMXN_H_
-#define VP9_COMMON_VP9_SADMXN_H_
-
-#include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-
-static INLINE unsigned int sad_mx_n_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- int m,
- int n) {
- int r, c;
- unsigned int sad = 0;
-
- for (r = 0; r < n; r++) {
- for (c = 0; c < m; c++) {
- sad += abs(src_ptr[c] - ref_ptr[c]);
- }
-
- src_ptr += src_stride;
- ref_ptr += ref_stride;
- }
-
- return sad;
-}
-
-#endif // VP9_COMMON_VP9_SADMXN_H_
diff --git a/libvpx/vp9/common/vp9_scale.c b/libvpx/vp9/common/vp9_scale.c
index 3f0994f..e0f1e34 100644
--- a/libvpx/vp9/common/vp9_scale.c
+++ b/libvpx/vp9/common/vp9_scale.c
@@ -12,47 +12,19 @@
#include "vp9/common/vp9_filter.h"
#include "vp9/common/vp9_scale.h"
-static INLINE int scaled_x(int val, const struct scale_factors_common *sfc) {
- return val * sfc->x_scale_fp >> REF_SCALE_SHIFT;
+static INLINE int scaled_x(int val, const struct scale_factors *sf) {
+ return val * sf->x_scale_fp >> REF_SCALE_SHIFT;
}
-static INLINE int scaled_y(int val, const struct scale_factors_common *sfc) {
- return val * sfc->y_scale_fp >> REF_SCALE_SHIFT;
+static INLINE int scaled_y(int val, const struct scale_factors *sf) {
+ return val * sf->y_scale_fp >> REF_SCALE_SHIFT;
}
-static int unscaled_value(int val, const struct scale_factors_common *sfc) {
- (void) sfc;
+static int unscaled_value(int val, const struct scale_factors *sf) {
+ (void) sf;
return val;
}
-static MV32 scaled_mv(const MV *mv, const struct scale_factors *scale) {
- const MV32 res = {
- scaled_y(mv->row, scale->sfc) + scale->y_offset_q4,
- scaled_x(mv->col, scale->sfc) + scale->x_offset_q4
- };
- return res;
-}
-
-static MV32 unscaled_mv(const MV *mv, const struct scale_factors *scale) {
- const MV32 res = {
- mv->row,
- mv->col
- };
- return res;
-}
-
-static void set_offsets_with_scaling(struct scale_factors *scale,
- int row, int col) {
- scale->x_offset_q4 = scaled_x(col << SUBPEL_BITS, scale->sfc) & SUBPEL_MASK;
- scale->y_offset_q4 = scaled_y(row << SUBPEL_BITS, scale->sfc) & SUBPEL_MASK;
-}
-
-static void set_offsets_without_scaling(struct scale_factors *scale,
- int row, int col) {
- scale->x_offset_q4 = 0;
- scale->y_offset_q4 = 0;
-}
-
static int get_fixed_point_scale_factor(int other_size, int this_size) {
// Calculate scaling factor once for each reference frame
// and use fixed point scaling factors in decoding and encoding routines.
@@ -69,31 +41,36 @@ static int check_scale_factors(int other_w, int other_h,
this_h <= 16 * other_h;
}
-void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
- struct scale_factors_common *scale_comm,
+MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf) {
+ const int x_off_q4 = scaled_x(x << SUBPEL_BITS, sf) & SUBPEL_MASK;
+ const int y_off_q4 = scaled_y(y << SUBPEL_BITS, sf) & SUBPEL_MASK;
+ const MV32 res = {
+ scaled_y(mv->row, sf) + y_off_q4,
+ scaled_x(mv->col, sf) + x_off_q4
+ };
+ return res;
+}
+
+void vp9_setup_scale_factors_for_frame(struct scale_factors *sf,
int other_w, int other_h,
int this_w, int this_h) {
if (!check_scale_factors(other_w, other_h, this_w, this_h)) {
- scale_comm->x_scale_fp = REF_INVALID_SCALE;
- scale_comm->y_scale_fp = REF_INVALID_SCALE;
+ sf->x_scale_fp = REF_INVALID_SCALE;
+ sf->y_scale_fp = REF_INVALID_SCALE;
return;
}
- scale_comm->x_scale_fp = get_fixed_point_scale_factor(other_w, this_w);
- scale_comm->y_scale_fp = get_fixed_point_scale_factor(other_h, this_h);
- scale_comm->x_step_q4 = scaled_x(16, scale_comm);
- scale_comm->y_step_q4 = scaled_y(16, scale_comm);
+ sf->x_scale_fp = get_fixed_point_scale_factor(other_w, this_w);
+ sf->y_scale_fp = get_fixed_point_scale_factor(other_h, this_h);
+ sf->x_step_q4 = scaled_x(16, sf);
+ sf->y_step_q4 = scaled_y(16, sf);
- if (vp9_is_scaled(scale_comm)) {
- scale_comm->scale_value_x = scaled_x;
- scale_comm->scale_value_y = scaled_y;
- scale_comm->set_scaled_offsets = set_offsets_with_scaling;
- scale_comm->scale_mv = scaled_mv;
+ if (vp9_is_scaled(sf)) {
+ sf->scale_value_x = scaled_x;
+ sf->scale_value_y = scaled_y;
} else {
- scale_comm->scale_value_x = unscaled_value;
- scale_comm->scale_value_y = unscaled_value;
- scale_comm->set_scaled_offsets = set_offsets_without_scaling;
- scale_comm->scale_mv = unscaled_mv;
+ sf->scale_value_x = unscaled_value;
+ sf->scale_value_y = unscaled_value;
}
// TODO(agrange): Investigate the best choice of functions to use here
@@ -102,48 +79,44 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
// applied in one direction only, and not at all for 0,0, seems to give the
// best quality, but it may be worth trying an additional mode that does
// do the filtering on full-pel.
- if (scale_comm->x_step_q4 == 16) {
- if (scale_comm->y_step_q4 == 16) {
+ if (sf->x_step_q4 == 16) {
+ if (sf->y_step_q4 == 16) {
// No scaling in either direction.
- scale_comm->predict[0][0][0] = vp9_convolve_copy;
- scale_comm->predict[0][0][1] = vp9_convolve_avg;
- scale_comm->predict[0][1][0] = vp9_convolve8_vert;
- scale_comm->predict[0][1][1] = vp9_convolve8_avg_vert;
- scale_comm->predict[1][0][0] = vp9_convolve8_horiz;
- scale_comm->predict[1][0][1] = vp9_convolve8_avg_horiz;
+ sf->predict[0][0][0] = vp9_convolve_copy;
+ sf->predict[0][0][1] = vp9_convolve_avg;
+ sf->predict[0][1][0] = vp9_convolve8_vert;
+ sf->predict[0][1][1] = vp9_convolve8_avg_vert;
+ sf->predict[1][0][0] = vp9_convolve8_horiz;
+ sf->predict[1][0][1] = vp9_convolve8_avg_horiz;
} else {
// No scaling in x direction. Must always scale in the y direction.
- scale_comm->predict[0][0][0] = vp9_convolve8_vert;
- scale_comm->predict[0][0][1] = vp9_convolve8_avg_vert;
- scale_comm->predict[0][1][0] = vp9_convolve8_vert;
- scale_comm->predict[0][1][1] = vp9_convolve8_avg_vert;
- scale_comm->predict[1][0][0] = vp9_convolve8;
- scale_comm->predict[1][0][1] = vp9_convolve8_avg;
+ sf->predict[0][0][0] = vp9_convolve8_vert;
+ sf->predict[0][0][1] = vp9_convolve8_avg_vert;
+ sf->predict[0][1][0] = vp9_convolve8_vert;
+ sf->predict[0][1][1] = vp9_convolve8_avg_vert;
+ sf->predict[1][0][0] = vp9_convolve8;
+ sf->predict[1][0][1] = vp9_convolve8_avg;
}
} else {
- if (scale_comm->y_step_q4 == 16) {
+ if (sf->y_step_q4 == 16) {
// No scaling in the y direction. Must always scale in the x direction.
- scale_comm->predict[0][0][0] = vp9_convolve8_horiz;
- scale_comm->predict[0][0][1] = vp9_convolve8_avg_horiz;
- scale_comm->predict[0][1][0] = vp9_convolve8;
- scale_comm->predict[0][1][1] = vp9_convolve8_avg;
- scale_comm->predict[1][0][0] = vp9_convolve8_horiz;
- scale_comm->predict[1][0][1] = vp9_convolve8_avg_horiz;
+ sf->predict[0][0][0] = vp9_convolve8_horiz;
+ sf->predict[0][0][1] = vp9_convolve8_avg_horiz;
+ sf->predict[0][1][0] = vp9_convolve8;
+ sf->predict[0][1][1] = vp9_convolve8_avg;
+ sf->predict[1][0][0] = vp9_convolve8_horiz;
+ sf->predict[1][0][1] = vp9_convolve8_avg_horiz;
} else {
// Must always scale in both directions.
- scale_comm->predict[0][0][0] = vp9_convolve8;
- scale_comm->predict[0][0][1] = vp9_convolve8_avg;
- scale_comm->predict[0][1][0] = vp9_convolve8;
- scale_comm->predict[0][1][1] = vp9_convolve8_avg;
- scale_comm->predict[1][0][0] = vp9_convolve8;
- scale_comm->predict[1][0][1] = vp9_convolve8_avg;
+ sf->predict[0][0][0] = vp9_convolve8;
+ sf->predict[0][0][1] = vp9_convolve8_avg;
+ sf->predict[0][1][0] = vp9_convolve8;
+ sf->predict[0][1][1] = vp9_convolve8_avg;
+ sf->predict[1][0][0] = vp9_convolve8;
+ sf->predict[1][0][1] = vp9_convolve8_avg;
}
}
// 2D subpel motion always gets filtered in both directions
- scale_comm->predict[1][1][0] = vp9_convolve8;
- scale_comm->predict[1][1][1] = vp9_convolve8_avg;
-
- scale->sfc = scale_comm;
- scale->x_offset_q4 = 0; // calculated per block
- scale->y_offset_q4 = 0; // calculated per block
+ sf->predict[1][1][0] = vp9_convolve8;
+ sf->predict[1][1][1] = vp9_convolve8_avg;
}
diff --git a/libvpx/vp9/common/vp9_scale.h b/libvpx/vp9/common/vp9_scale.h
index 1437fcd..a9dda18 100644
--- a/libvpx/vp9/common/vp9_scale.h
+++ b/libvpx/vp9/common/vp9_scale.h
@@ -14,44 +14,44 @@
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_convolve.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define REF_SCALE_SHIFT 14
#define REF_NO_SCALE (1 << REF_SCALE_SHIFT)
#define REF_INVALID_SCALE -1
-struct scale_factors;
-struct scale_factors_common {
+struct scale_factors {
int x_scale_fp; // horizontal fixed point scale factor
int y_scale_fp; // vertical fixed point scale factor
int x_step_q4;
int y_step_q4;
- int (*scale_value_x)(int val, const struct scale_factors_common *sfc);
- int (*scale_value_y)(int val, const struct scale_factors_common *sfc);
- void (*set_scaled_offsets)(struct scale_factors *scale, int row, int col);
- MV32 (*scale_mv)(const MV *mv, const struct scale_factors *scale);
+ int (*scale_value_x)(int val, const struct scale_factors *sf);
+ int (*scale_value_y)(int val, const struct scale_factors *sf);
convolve_fn_t predict[2][2][2]; // horiz, vert, avg
};
-struct scale_factors {
- int x_offset_q4;
- int y_offset_q4;
- const struct scale_factors_common *sfc;
-};
+MV32 vp9_scale_mv(const MV *mv, int x, int y, const struct scale_factors *sf);
-void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
- struct scale_factors_common *scale_comm,
+void vp9_setup_scale_factors_for_frame(struct scale_factors *sf,
int other_w, int other_h,
int this_w, int this_h);
-static int vp9_is_valid_scale(const struct scale_factors_common *sfc) {
- return sfc->x_scale_fp != REF_INVALID_SCALE &&
- sfc->y_scale_fp != REF_INVALID_SCALE;
+static INLINE int vp9_is_valid_scale(const struct scale_factors *sf) {
+ return sf->x_scale_fp != REF_INVALID_SCALE &&
+ sf->y_scale_fp != REF_INVALID_SCALE;
}
-static int vp9_is_scaled(const struct scale_factors_common *sfc) {
- return sfc->x_scale_fp != REF_NO_SCALE ||
- sfc->y_scale_fp != REF_NO_SCALE;
+static INLINE int vp9_is_scaled(const struct scale_factors *sf) {
+ return sf->x_scale_fp != REF_NO_SCALE ||
+ sf->y_scale_fp != REF_NO_SCALE;
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_SCALE_H_
diff --git a/libvpx/vp9/common/vp9_scan.c b/libvpx/vp9/common/vp9_scan.c
index f17da91..1ec5a0c 100644
--- a/libvpx/vp9/common/vp9_scan.c
+++ b/libvpx/vp9/common/vp9_scan.c
@@ -12,28 +12,28 @@
#include "vp9/common/vp9_scan.h"
-DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_4x4[16]) = {
+DECLARE_ALIGNED(16, static const int16_t, default_scan_4x4[16]) = {
0, 4, 1, 5,
8, 2, 12, 9,
3, 6, 13, 10,
7, 14, 11, 15,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_4x4[16]) = {
+DECLARE_ALIGNED(16, static const int16_t, col_scan_4x4[16]) = {
0, 4, 8, 1,
12, 5, 9, 2,
13, 6, 10, 3,
7, 14, 11, 15,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_4x4[16]) = {
+DECLARE_ALIGNED(16, static const int16_t, row_scan_4x4[16]) = {
0, 1, 4, 2,
5, 3, 6, 8,
9, 7, 12, 10,
13, 11, 14, 15,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_8x8[64]) = {
+DECLARE_ALIGNED(16, static const int16_t, default_scan_8x8[64]) = {
0, 8, 1, 16, 9, 2, 17, 24,
10, 3, 18, 25, 32, 11, 4, 26,
33, 19, 40, 12, 34, 27, 5, 41,
@@ -44,7 +44,7 @@ DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_8x8[64]) = {
46, 39, 61, 54, 47, 62, 55, 63,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_8x8[64]) = {
+DECLARE_ALIGNED(16, static const int16_t, col_scan_8x8[64]) = {
0, 8, 16, 1, 24, 9, 32, 17,
2, 40, 25, 10, 33, 18, 48, 3,
26, 41, 11, 56, 19, 34, 4, 49,
@@ -55,7 +55,7 @@ DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_8x8[64]) = {
31, 61, 39, 54, 47, 62, 55, 63,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_8x8[64]) = {
+DECLARE_ALIGNED(16, static const int16_t, row_scan_8x8[64]) = {
0, 1, 2, 8, 9, 3, 16, 10,
4, 17, 11, 24, 5, 18, 25, 12,
19, 26, 32, 6, 13, 20, 33, 27,
@@ -66,7 +66,7 @@ DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_8x8[64]) = {
60, 39, 61, 47, 54, 55, 62, 63,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_16x16[256]) = {
+DECLARE_ALIGNED(16, static const int16_t, default_scan_16x16[256]) = {
0, 16, 1, 32, 17, 2, 48, 33, 18, 3, 64, 34, 49, 19, 65, 80,
50, 4, 35, 66, 20, 81, 96, 51, 5, 36, 82, 97, 67, 112, 21, 52,
98, 37, 83, 113, 6, 68, 128, 53, 22, 99, 114, 84, 7, 129, 38, 69,
@@ -87,7 +87,7 @@ DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_16x16[256]) = {
255,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_16x16[256]) = {
+DECLARE_ALIGNED(16, static const int16_t, col_scan_16x16[256]) = {
0, 16, 32, 48, 1, 64, 17, 80, 33, 96, 49, 2, 65, 112, 18, 81,
34, 128, 50, 97, 3, 66, 144, 19, 113, 35, 82, 160, 98, 51, 129, 4,
67, 176, 20, 114, 145, 83, 36, 99, 130, 52, 192, 5, 161, 68, 115, 21,
@@ -108,7 +108,7 @@ DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_16x16[256]) = {
255,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_16x16[256]) = {
+DECLARE_ALIGNED(16, static const int16_t, row_scan_16x16[256]) = {
0, 1, 2, 16, 3, 17, 4, 18, 32, 5, 33, 19, 6, 34, 48, 20,
49, 7, 35, 21, 50, 64, 8, 36, 65, 22, 51, 37, 80, 9, 66, 52,
23, 38, 81, 67, 10, 53, 24, 82, 68, 96, 39, 11, 54, 83, 97, 69,
@@ -130,7 +130,7 @@ DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_16x16[256]) = {
255,
};
-DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_32x32[1024]) = {
+DECLARE_ALIGNED(16, static const int16_t, default_scan_32x32[1024]) = {
0, 32, 1, 64, 33, 2, 96, 65, 34, 128, 3, 97, 66, 160,
129, 35, 98, 4, 67, 130, 161, 192, 36, 99, 224, 5, 162, 193,
68, 131, 37, 100,
@@ -233,38 +233,68 @@ DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_32x32[1024]) = {
// in {top, left, topleft, topright, bottomleft} order
// for each position in raster scan order.
// -1 indicates the neighbor does not exist.
-DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_col_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_row_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_col_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_row_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_col_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_row_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
-DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_32x32_neighbors[1025 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ default_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ col_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ row_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ col_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ row_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ default_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ col_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ row_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ default_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t,
+ default_scan_32x32_neighbors[1025 * MAX_NEIGHBORS]);
+DECLARE_ALIGNED(16, static int16_t, vp9_default_iscan_4x4[16]);
+DECLARE_ALIGNED(16, static int16_t, vp9_col_iscan_4x4[16]);
+DECLARE_ALIGNED(16, static int16_t, vp9_row_iscan_4x4[16]);
+DECLARE_ALIGNED(16, static int16_t, vp9_col_iscan_8x8[64]);
+DECLARE_ALIGNED(16, static int16_t, vp9_row_iscan_8x8[64]);
+DECLARE_ALIGNED(16, static int16_t, vp9_default_iscan_8x8[64]);
+DECLARE_ALIGNED(16, static int16_t, vp9_col_iscan_16x16[256]);
+DECLARE_ALIGNED(16, static int16_t, vp9_row_iscan_16x16[256]);
+DECLARE_ALIGNED(16, static int16_t, vp9_default_iscan_16x16[256]);
+DECLARE_ALIGNED(16, static int16_t, vp9_default_iscan_32x32[1024]);
-DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_4x4[16]);
-DECLARE_ALIGNED(16, int16_t, vp9_col_iscan_4x4[16]);
-DECLARE_ALIGNED(16, int16_t, vp9_row_iscan_4x4[16]);
-DECLARE_ALIGNED(16, int16_t, vp9_col_iscan_8x8[64]);
-DECLARE_ALIGNED(16, int16_t, vp9_row_iscan_8x8[64]);
-DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_8x8[64]);
-DECLARE_ALIGNED(16, int16_t, vp9_col_iscan_16x16[256]);
-DECLARE_ALIGNED(16, int16_t, vp9_row_iscan_16x16[256]);
-DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_16x16[256]);
-DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_32x32[1024]);
+const scan_order vp9_default_scan_orders[TX_SIZES] = {
+ {default_scan_4x4, vp9_default_iscan_4x4, default_scan_4x4_neighbors},
+ {default_scan_8x8, vp9_default_iscan_8x8, default_scan_8x8_neighbors},
+ {default_scan_16x16, vp9_default_iscan_16x16, default_scan_16x16_neighbors},
+ {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors},
+};
+
+const scan_order vp9_scan_orders[TX_SIZES][TX_TYPES] = {
+ { // TX_4X4
+ {default_scan_4x4, vp9_default_iscan_4x4, default_scan_4x4_neighbors},
+ {row_scan_4x4, vp9_row_iscan_4x4, row_scan_4x4_neighbors},
+ {col_scan_4x4, vp9_col_iscan_4x4, col_scan_4x4_neighbors},
+ {default_scan_4x4, vp9_default_iscan_4x4, default_scan_4x4_neighbors}
+ }, { // TX_8X8
+ {default_scan_8x8, vp9_default_iscan_8x8, default_scan_8x8_neighbors},
+ {row_scan_8x8, vp9_row_iscan_8x8, row_scan_8x8_neighbors},
+ {col_scan_8x8, vp9_col_iscan_8x8, col_scan_8x8_neighbors},
+ {default_scan_8x8, vp9_default_iscan_8x8, default_scan_8x8_neighbors}
+ }, { // TX_16X16
+ {default_scan_16x16, vp9_default_iscan_16x16, default_scan_16x16_neighbors},
+ {row_scan_16x16, vp9_row_iscan_16x16, row_scan_16x16_neighbors},
+ {col_scan_16x16, vp9_col_iscan_16x16, col_scan_16x16_neighbors},
+ {default_scan_16x16, vp9_default_iscan_16x16, default_scan_16x16_neighbors}
+ }, { // TX_32X32
+ {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors},
+ {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors},
+ {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors},
+ {default_scan_32x32, vp9_default_iscan_32x32, default_scan_32x32_neighbors},
+ }
+};
static int find_in_scan(const int16_t *scan, int l, int idx) {
int n, l2 = l * l;
@@ -276,9 +306,9 @@ static int find_in_scan(const int16_t *scan, int l, int idx) {
assert(0);
return -1;
}
-static void init_scan_neighbors(const int16_t *scan,
- int16_t *iscan,
- int l, int16_t *neighbors) {
+
+static void init_scan_neighbors(const int16_t *scan, int16_t *iscan, int l,
+ int16_t *neighbors) {
int l2 = l * l;
int n, i, j;
@@ -302,15 +332,15 @@ static void init_scan_neighbors(const int16_t *scan,
// use the combination of the two as a context.
int a = (i - 1) * l + j;
int b = i * l + j - 1;
- if (scan == vp9_col_scan_4x4 || scan == vp9_col_scan_8x8 ||
- scan == vp9_col_scan_16x16) {
+ if (scan == col_scan_4x4 || scan == col_scan_8x8 ||
+ scan == col_scan_16x16) {
// in the col/row scan cases (as well as left/top edge cases), we set
// both contexts to the same value, so we can branchlessly do a+b+1>>1
// which automatically becomes a if a == b
neighbors[MAX_NEIGHBORS * n + 0] =
neighbors[MAX_NEIGHBORS * n + 1] = a;
- } else if (scan == vp9_row_scan_4x4 || scan == vp9_row_scan_8x8 ||
- scan == vp9_row_scan_16x16) {
+ } else if (scan == row_scan_4x4 || scan == row_scan_8x8 ||
+ scan == row_scan_16x16) {
neighbors[MAX_NEIGHBORS * n + 0] =
neighbors[MAX_NEIGHBORS * n + 1] = b;
} else {
@@ -334,24 +364,24 @@ static void init_scan_neighbors(const int16_t *scan,
}
void vp9_init_neighbors() {
- init_scan_neighbors(vp9_default_scan_4x4, vp9_default_iscan_4x4, 4,
- vp9_default_scan_4x4_neighbors);
- init_scan_neighbors(vp9_row_scan_4x4, vp9_row_iscan_4x4, 4,
- vp9_row_scan_4x4_neighbors);
- init_scan_neighbors(vp9_col_scan_4x4, vp9_col_iscan_4x4, 4,
- vp9_col_scan_4x4_neighbors);
- init_scan_neighbors(vp9_default_scan_8x8, vp9_default_iscan_8x8, 8,
- vp9_default_scan_8x8_neighbors);
- init_scan_neighbors(vp9_row_scan_8x8, vp9_row_iscan_8x8, 8,
- vp9_row_scan_8x8_neighbors);
- init_scan_neighbors(vp9_col_scan_8x8, vp9_col_iscan_8x8, 8,
- vp9_col_scan_8x8_neighbors);
- init_scan_neighbors(vp9_default_scan_16x16, vp9_default_iscan_16x16, 16,
- vp9_default_scan_16x16_neighbors);
- init_scan_neighbors(vp9_row_scan_16x16, vp9_row_iscan_16x16, 16,
- vp9_row_scan_16x16_neighbors);
- init_scan_neighbors(vp9_col_scan_16x16, vp9_col_iscan_16x16, 16,
- vp9_col_scan_16x16_neighbors);
- init_scan_neighbors(vp9_default_scan_32x32, vp9_default_iscan_32x32, 32,
- vp9_default_scan_32x32_neighbors);
+ init_scan_neighbors(default_scan_4x4, vp9_default_iscan_4x4, 4,
+ default_scan_4x4_neighbors);
+ init_scan_neighbors(row_scan_4x4, vp9_row_iscan_4x4, 4,
+ row_scan_4x4_neighbors);
+ init_scan_neighbors(col_scan_4x4, vp9_col_iscan_4x4, 4,
+ col_scan_4x4_neighbors);
+ init_scan_neighbors(default_scan_8x8, vp9_default_iscan_8x8, 8,
+ default_scan_8x8_neighbors);
+ init_scan_neighbors(row_scan_8x8, vp9_row_iscan_8x8, 8,
+ row_scan_8x8_neighbors);
+ init_scan_neighbors(col_scan_8x8, vp9_col_iscan_8x8, 8,
+ col_scan_8x8_neighbors);
+ init_scan_neighbors(default_scan_16x16, vp9_default_iscan_16x16, 16,
+ default_scan_16x16_neighbors);
+ init_scan_neighbors(row_scan_16x16, vp9_row_iscan_16x16, 16,
+ row_scan_16x16_neighbors);
+ init_scan_neighbors(col_scan_16x16, vp9_col_iscan_16x16, 16,
+ col_scan_16x16_neighbors);
+ init_scan_neighbors(default_scan_32x32, vp9_default_iscan_32x32, 32,
+ default_scan_32x32_neighbors);
}
diff --git a/libvpx/vp9/common/vp9_scan.h b/libvpx/vp9/common/vp9_scan.h
index 14a1a7e..9613b67 100644
--- a/libvpx/vp9/common/vp9_scan.h
+++ b/libvpx/vp9/common/vp9_scan.h
@@ -15,180 +15,24 @@
#include "vpx_ports/mem.h"
#include "vp9/common/vp9_enums.h"
+#include "vp9/common/vp9_blockd.h"
-#define MAX_NEIGHBORS 2
-
-extern DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_4x4[16]);
-extern DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_4x4[16]);
-extern DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_4x4[16]);
-
-extern DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_8x8[64]);
-extern DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_8x8[64]);
-extern DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_8x8[64]);
-
-extern DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_16x16[256]);
-extern DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_16x16[256]);
-extern DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_16x16[256]);
-
-extern DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_32x32[1024]);
-
-extern DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_4x4[16]);
-extern DECLARE_ALIGNED(16, int16_t, vp9_col_iscan_4x4[16]);
-extern DECLARE_ALIGNED(16, int16_t, vp9_row_iscan_4x4[16]);
-
-extern DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_8x8[64]);
-extern DECLARE_ALIGNED(16, int16_t, vp9_col_iscan_8x8[64]);
-extern DECLARE_ALIGNED(16, int16_t, vp9_row_iscan_8x8[64]);
-
-extern DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_16x16[256]);
-extern DECLARE_ALIGNED(16, int16_t, vp9_col_iscan_16x16[256]);
-extern DECLARE_ALIGNED(16, int16_t, vp9_row_iscan_16x16[256]);
-
-extern DECLARE_ALIGNED(16, int16_t, vp9_default_iscan_32x32[1024]);
-
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_col_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_row_scan_4x4_neighbors[17 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_col_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_row_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_8x8_neighbors[65 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_col_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_row_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_16x16_neighbors[257 * MAX_NEIGHBORS]);
-extern DECLARE_ALIGNED(16, int16_t,
- vp9_default_scan_32x32_neighbors[1025 * MAX_NEIGHBORS]);
+#ifdef __cplusplus
+extern "C" {
+#endif
+#define MAX_NEIGHBORS 2
void vp9_init_neighbors();
-static INLINE const int16_t* get_scan_4x4(TX_TYPE tx_type) {
- switch (tx_type) {
- case ADST_DCT:
- return vp9_row_scan_4x4;
- case DCT_ADST:
- return vp9_col_scan_4x4;
- default:
- return vp9_default_scan_4x4;
- }
-}
-
-static INLINE void get_scan_nb_4x4(TX_TYPE tx_type,
- const int16_t **scan, const int16_t **nb) {
- switch (tx_type) {
- case ADST_DCT:
- *scan = vp9_row_scan_4x4;
- *nb = vp9_row_scan_4x4_neighbors;
- break;
- case DCT_ADST:
- *scan = vp9_col_scan_4x4;
- *nb = vp9_col_scan_4x4_neighbors;
- break;
- default:
- *scan = vp9_default_scan_4x4;
- *nb = vp9_default_scan_4x4_neighbors;
- break;
- }
-}
-
-static INLINE const int16_t* get_iscan_4x4(TX_TYPE tx_type) {
- switch (tx_type) {
- case ADST_DCT:
- return vp9_row_iscan_4x4;
- case DCT_ADST:
- return vp9_col_iscan_4x4;
- default:
- return vp9_default_iscan_4x4;
- }
-}
-
-static INLINE const int16_t* get_scan_8x8(TX_TYPE tx_type) {
- switch (tx_type) {
- case ADST_DCT:
- return vp9_row_scan_8x8;
- case DCT_ADST:
- return vp9_col_scan_8x8;
- default:
- return vp9_default_scan_8x8;
- }
-}
-
-static INLINE void get_scan_nb_8x8(TX_TYPE tx_type,
- const int16_t **scan, const int16_t **nb) {
- switch (tx_type) {
- case ADST_DCT:
- *scan = vp9_row_scan_8x8;
- *nb = vp9_row_scan_8x8_neighbors;
- break;
- case DCT_ADST:
- *scan = vp9_col_scan_8x8;
- *nb = vp9_col_scan_8x8_neighbors;
- break;
- default:
- *scan = vp9_default_scan_8x8;
- *nb = vp9_default_scan_8x8_neighbors;
- break;
- }
-}
-
-static INLINE const int16_t* get_iscan_8x8(TX_TYPE tx_type) {
- switch (tx_type) {
- case ADST_DCT:
- return vp9_row_iscan_8x8;
- case DCT_ADST:
- return vp9_col_iscan_8x8;
- default:
- return vp9_default_iscan_8x8;
- }
-}
-
-static INLINE const int16_t* get_scan_16x16(TX_TYPE tx_type) {
- switch (tx_type) {
- case ADST_DCT:
- return vp9_row_scan_16x16;
- case DCT_ADST:
- return vp9_col_scan_16x16;
- default:
- return vp9_default_scan_16x16;
- }
-}
+typedef struct {
+ const int16_t *scan;
+ const int16_t *iscan;
+ const int16_t *neighbors;
+} scan_order;
-static INLINE void get_scan_nb_16x16(TX_TYPE tx_type,
- const int16_t **scan, const int16_t **nb) {
- switch (tx_type) {
- case ADST_DCT:
- *scan = vp9_row_scan_16x16;
- *nb = vp9_row_scan_16x16_neighbors;
- break;
- case DCT_ADST:
- *scan = vp9_col_scan_16x16;
- *nb = vp9_col_scan_16x16_neighbors;
- break;
- default:
- *scan = vp9_default_scan_16x16;
- *nb = vp9_default_scan_16x16_neighbors;
- break;
- }
-}
-
-static INLINE const int16_t* get_iscan_16x16(TX_TYPE tx_type) {
- switch (tx_type) {
- case ADST_DCT:
- return vp9_row_iscan_16x16;
- case DCT_ADST:
- return vp9_col_iscan_16x16;
- default:
- return vp9_default_iscan_16x16;
- }
-}
+extern const scan_order vp9_default_scan_orders[TX_SIZES];
+extern const scan_order vp9_scan_orders[TX_SIZES][TX_TYPES];
static INLINE int get_coef_context(const int16_t *neighbors,
const uint8_t *token_cache, int c) {
@@ -196,4 +40,8 @@ static INLINE int get_coef_context(const int16_t *neighbors,
token_cache[neighbors[MAX_NEIGHBORS * c + 1]]) >> 1;
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_SCAN_H_
diff --git a/libvpx/vp9/common/vp9_seg_common.c b/libvpx/vp9/common/vp9_seg_common.c
index ef30404..910200e 100644
--- a/libvpx/vp9/common/vp9_seg_common.c
+++ b/libvpx/vp9/common/vp9_seg_common.c
@@ -41,11 +41,6 @@ void vp9_enable_segfeature(struct segmentation *seg, int segment_id,
seg->feature_mask[segment_id] |= 1 << feature_id;
}
-void vp9_disable_segfeature(struct segmentation *seg, int segment_id,
- SEG_LVL_FEATURES feature_id) {
- seg->feature_mask[segment_id] &= ~(1 << feature_id);
-}
-
int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id) {
return seg_feature_data_max[feature_id];
}
@@ -54,11 +49,6 @@ int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id) {
return seg_feature_data_signed[feature_id];
}
-void vp9_clear_segdata(struct segmentation *seg, int segment_id,
- SEG_LVL_FEATURES feature_id) {
- seg->feature_data[segment_id][feature_id] = 0;
-}
-
void vp9_set_segdata(struct segmentation *seg, int segment_id,
SEG_LVL_FEATURES feature_id, int seg_data) {
assert(seg_data <= seg_feature_data_max[feature_id]);
diff --git a/libvpx/vp9/common/vp9_seg_common.h b/libvpx/vp9/common/vp9_seg_common.h
index eb38c06..ff2d66a 100644
--- a/libvpx/vp9/common/vp9_seg_common.h
+++ b/libvpx/vp9/common/vp9_seg_common.h
@@ -11,7 +11,11 @@
#ifndef VP9_COMMON_VP9_SEG_COMMON_H_
#define VP9_COMMON_VP9_SEG_COMMON_H_
-#include "vp9/common/vp9_treecoder.h"
+#include "vp9/common/vp9_prob.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define SEGMENT_DELTADATA 0
#define SEGMENT_ABSDATA 1
@@ -55,18 +59,10 @@ void vp9_enable_segfeature(struct segmentation *seg,
int segment_id,
SEG_LVL_FEATURES feature_id);
-void vp9_disable_segfeature(struct segmentation *seg,
- int segment_id,
- SEG_LVL_FEATURES feature_id);
-
int vp9_seg_feature_data_max(SEG_LVL_FEATURES feature_id);
int vp9_is_segfeature_signed(SEG_LVL_FEATURES feature_id);
-void vp9_clear_segdata(struct segmentation *seg,
- int segment_id,
- SEG_LVL_FEATURES feature_id);
-
void vp9_set_segdata(struct segmentation *seg,
int segment_id,
SEG_LVL_FEATURES feature_id,
@@ -78,5 +74,9 @@ int vp9_get_segdata(const struct segmentation *seg,
extern const vp9_tree_index vp9_segment_tree[TREE_SIZE(MAX_SEGMENTS)];
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_SEG_COMMON_H_
diff --git a/libvpx/vp9/common/vp9_systemdependent.h b/libvpx/vp9/common/vp9_systemdependent.h
index 254a431..e971158 100644
--- a/libvpx/vp9/common/vp9_systemdependent.h
+++ b/libvpx/vp9/common/vp9_systemdependent.h
@@ -12,8 +12,16 @@
#define VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
#ifdef _MSC_VER
-#include <math.h>
-#define snprintf _snprintf
+# include <math.h> // the ceil() definition must precede intrin.h
+# if _MSC_VER > 1310 && (defined(_M_X64) || defined(_M_IX86))
+# include <intrin.h>
+# define USE_MSC_INTRIN
+# endif
+# define snprintf _snprintf
+#endif
+
+#ifdef __cplusplus
+extern "C" {
#endif
#include "./vpx_config.h"
@@ -26,7 +34,7 @@ void vpx_reset_mmx_state(void);
#if defined(_MSC_VER) && _MSC_VER < 1800
// round is not defined in MSVC before VS2013.
-static int round(double x) {
+static INLINE int round(double x) {
if (x < 0)
return (int)ceil(x - 0.5);
else
@@ -34,7 +42,42 @@ static int round(double x) {
}
#endif
-struct VP9Common;
-void vp9_machine_specific_config(struct VP9Common *cm);
+// use GNU builtins where available.
+#if defined(__GNUC__) && \
+ ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
+static INLINE int get_msb(unsigned int n) {
+ return 31 ^ __builtin_clz(n);
+}
+#elif defined(USE_MSC_INTRIN)
+#pragma intrinsic(_BitScanReverse)
+
+static INLINE int get_msb(unsigned int n) {
+ unsigned long first_set_bit;
+ _BitScanReverse(&first_set_bit, n);
+ return first_set_bit;
+}
+#undef USE_MSC_INTRIN
+#else
+// Returns (int)floor(log2(n)). n must be > 0.
+static INLINE int get_msb(unsigned int n) {
+ int log = 0;
+ unsigned int value = n;
+ int i;
+
+ for (i = 4; i >= 0; --i) {
+ const int shift = (1 << i);
+ const unsigned int x = value >> shift;
+ if (x != 0) {
+ value = x;
+ log += shift;
+ }
+ }
+ return log;
+}
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_COMMON_VP9_SYSTEMDEPENDENT_H_
diff --git a/libvpx/vp9/common/vp9_textblit.h b/libvpx/vp9/common/vp9_textblit.h
index c968628..158ec1b 100644
--- a/libvpx/vp9/common/vp9_textblit.h
+++ b/libvpx/vp9/common/vp9_textblit.h
@@ -11,9 +11,17 @@
#ifndef VP9_COMMON_VP9_TEXTBLIT_H_
#define VP9_COMMON_VP9_TEXTBLIT_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_blit_text(const char *msg, unsigned char *address, int pitch);
void vp9_blit_line(int x0, int x1, int y0, int y1, unsigned char *image,
int pitch);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_TEXTBLIT_H_
diff --git a/libvpx/vp9/common/vp9_tile_common.c b/libvpx/vp9/common/vp9_tile_common.c
index e3035d0..78909dd 100644
--- a/libvpx/vp9/common/vp9_tile_common.c
+++ b/libvpx/vp9/common/vp9_tile_common.c
@@ -15,46 +15,37 @@
#define MIN_TILE_WIDTH_B64 4
#define MAX_TILE_WIDTH_B64 64
-static int to_sbs(n_mis) {
- return mi_cols_aligned_to_sb(n_mis) >> MI_BLOCK_SIZE_LOG2;
+static int get_tile_offset(int idx, int mis, int log2) {
+ const int sb_cols = mi_cols_aligned_to_sb(mis) >> MI_BLOCK_SIZE_LOG2;
+ const int offset = ((idx * sb_cols) >> log2) << MI_BLOCK_SIZE_LOG2;
+ return MIN(offset, mis);
}
-static void get_tile_offsets(int *min_tile_off, int *max_tile_off,
- int tile_idx, int log2_n_tiles, int n_mis) {
- const int n_sbs = to_sbs(n_mis);
- const int sb_off1 = (tile_idx * n_sbs) >> log2_n_tiles;
- const int sb_off2 = ((tile_idx + 1) * n_sbs) >> log2_n_tiles;
-
- *min_tile_off = MIN(sb_off1 << 3, n_mis);
- *max_tile_off = MIN(sb_off2 << 3, n_mis);
-}
-
-void vp9_tile_init(TileInfo *tile, const VP9_COMMON *cm,
- int row_idx, int col_idx) {
- get_tile_offsets(&tile->mi_row_start, &tile->mi_row_end,
- row_idx, cm->log2_tile_rows, cm->mi_rows);
- get_tile_offsets(&tile->mi_col_start, &tile->mi_col_end,
- col_idx, cm->log2_tile_cols, cm->mi_cols);
+void vp9_tile_init(TileInfo *tile, const VP9_COMMON *cm, int row, int col) {
+ tile->mi_row_start = get_tile_offset(row, cm->mi_rows, cm->log2_tile_rows);
+ tile->mi_row_end = get_tile_offset(row + 1, cm->mi_rows, cm->log2_tile_rows);
+ tile->mi_col_start = get_tile_offset(col, cm->mi_cols, cm->log2_tile_cols);
+ tile->mi_col_end = get_tile_offset(col + 1, cm->mi_cols, cm->log2_tile_cols);
}
void vp9_get_tile_n_bits(int mi_cols,
int *min_log2_tile_cols, int *max_log2_tile_cols) {
- const int sb_cols = to_sbs(mi_cols);
- int min_log2_n_tiles, max_log2_n_tiles;
+ const int sb_cols = mi_cols_aligned_to_sb(mi_cols) >> MI_BLOCK_SIZE_LOG2;
+ int min_log2 = 0, max_log2 = 0;
- for (max_log2_n_tiles = 0;
- (sb_cols >> max_log2_n_tiles) >= MIN_TILE_WIDTH_B64;
- max_log2_n_tiles++) {}
- max_log2_n_tiles--;
- if (max_log2_n_tiles < 0)
- max_log2_n_tiles = 0;
+ // max
+ while ((sb_cols >> max_log2) >= MIN_TILE_WIDTH_B64)
+ ++max_log2;
+ --max_log2;
+ if (max_log2 < 0)
+ max_log2 = 0;
- for (min_log2_n_tiles = 0;
- (MAX_TILE_WIDTH_B64 << min_log2_n_tiles) < sb_cols;
- min_log2_n_tiles++) {}
+ // min
+ while ((MAX_TILE_WIDTH_B64 << min_log2) < sb_cols)
+ ++min_log2;
- assert(min_log2_n_tiles <= max_log2_n_tiles);
+ assert(min_log2 <= max_log2);
- *min_log2_tile_cols = min_log2_n_tiles;
- *max_log2_tile_cols = max_log2_n_tiles;
+ *min_log2_tile_cols = min_log2;
+ *max_log2_tile_cols = max_log2;
}
diff --git a/libvpx/vp9/common/vp9_tile_common.h b/libvpx/vp9/common/vp9_tile_common.h
index a110abb..a97719e 100644
--- a/libvpx/vp9/common/vp9_tile_common.h
+++ b/libvpx/vp9/common/vp9_tile_common.h
@@ -11,6 +11,10 @@
#ifndef VP9_COMMON_VP9_TILE_COMMON_H_
#define VP9_COMMON_VP9_TILE_COMMON_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct VP9Common;
typedef struct TileInfo {
@@ -18,12 +22,16 @@ typedef struct TileInfo {
int mi_col_start, mi_col_end;
} TileInfo;
-// initializes 'tile->mi_(row|col)_(start|end)' for (row_idx, col_idx) based on
+// initializes 'tile->mi_(row|col)_(start|end)' for (row, col) based on
// 'cm->log2_tile_(rows|cols)' & 'cm->mi_(rows|cols)'
void vp9_tile_init(TileInfo *tile, const struct VP9Common *cm,
- int row_idx, int col_idx);
+ int row, int col);
void vp9_get_tile_n_bits(int mi_cols,
int *min_log2_tile_cols, int *max_log2_tile_cols);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_VP9_TILE_COMMON_H_
diff --git a/libvpx/vp9/common/vp9_treecoder.c b/libvpx/vp9/common/vp9_treecoder.c
deleted file mode 100644
index e2a5b9f..0000000
--- a/libvpx/vp9/common/vp9_treecoder.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include <assert.h>
-
-#include "./vpx_config.h"
-#include "vp9/common/vp9_treecoder.h"
-
-static void tree2tok(struct vp9_token *const p, vp9_tree t,
- int i, int v, int l) {
- v += v;
- ++l;
-
- do {
- const vp9_tree_index j = t[i++];
-
- if (j <= 0) {
- p[-j].value = v;
- p[-j].len = l;
- } else {
- tree2tok(p, t, j, v, l);
- }
- } while (++v & 1);
-}
-
-void vp9_tokens_from_tree(struct vp9_token *p, vp9_tree t) {
- tree2tok(p, t, 0, 0, 0);
-}
-
-static unsigned int convert_distribution(unsigned int i, vp9_tree tree,
- unsigned int branch_ct[][2],
- const unsigned int num_events[]) {
- unsigned int left, right;
-
- if (tree[i] <= 0)
- left = num_events[-tree[i]];
- else
- left = convert_distribution(tree[i], tree, branch_ct, num_events);
-
- if (tree[i + 1] <= 0)
- right = num_events[-tree[i + 1]];
- else
- right = convert_distribution(tree[i + 1], tree, branch_ct, num_events);
-
- branch_ct[i >> 1][0] = left;
- branch_ct[i >> 1][1] = right;
- return left + right;
-}
-
-void vp9_tree_probs_from_distribution(vp9_tree tree,
- unsigned int branch_ct[/* n-1 */][2],
- const unsigned int num_events[/* n */]) {
- convert_distribution(0, tree, branch_ct, num_events);
-}
-
-
diff --git a/libvpx/vp9/common/vp9_treecoder.h b/libvpx/vp9/common/vp9_treecoder.h
deleted file mode 100644
index a79b156..0000000
--- a/libvpx/vp9/common/vp9_treecoder.h
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_COMMON_VP9_TREECODER_H_
-#define VP9_COMMON_VP9_TREECODER_H_
-
-#include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "vp9/common/vp9_common.h"
-
-typedef uint8_t vp9_prob;
-
-#define vp9_prob_half ((vp9_prob) 128)
-
-typedef int8_t vp9_tree_index;
-
-#define TREE_SIZE(leaf_count) (2 * (leaf_count) - 2)
-
-#define vp9_complement(x) (255 - x)
-
-/* We build coding trees compactly in arrays.
- Each node of the tree is a pair of vp9_tree_indices.
- Array index often references a corresponding probability table.
- Index <= 0 means done encoding/decoding and value = -Index,
- Index > 0 means need another bit, specification at index.
- Nonnegative indices are always even; processing begins at node 0. */
-
-typedef const vp9_tree_index vp9_tree[];
-
-struct vp9_token {
- int value;
- int len;
-};
-
-/* Construct encoding array from tree. */
-
-void vp9_tokens_from_tree(struct vp9_token*, vp9_tree);
-
-/* Convert array of token occurrence counts into a table of probabilities
- for the associated binary encoding tree. Also writes count of branches
- taken for each node on the tree; this facilitiates decisions as to
- probability updates. */
-
-void vp9_tree_probs_from_distribution(vp9_tree tree,
- unsigned int branch_ct[ /* n - 1 */ ][2],
- const unsigned int num_events[ /* n */ ]);
-
-
-static INLINE vp9_prob clip_prob(int p) {
- return (p > 255) ? 255u : (p < 1) ? 1u : p;
-}
-
-// int64 is not needed for normal frame level calculations.
-// However when outputing entropy stats accumulated over many frames
-// or even clips we can overflow int math.
-#ifdef ENTROPY_STATS
-static INLINE vp9_prob get_prob(int num, int den) {
- return (den == 0) ? 128u : clip_prob(((int64_t)num * 256 + (den >> 1)) / den);
-}
-#else
-static INLINE vp9_prob get_prob(int num, int den) {
- return (den == 0) ? 128u : clip_prob((num * 256 + (den >> 1)) / den);
-}
-#endif
-
-static INLINE vp9_prob get_binary_prob(int n0, int n1) {
- return get_prob(n0, n0 + n1);
-}
-
-/* this function assumes prob1 and prob2 are already within [1,255] range */
-static INLINE vp9_prob weighted_prob(int prob1, int prob2, int factor) {
- return ROUND_POWER_OF_TWO(prob1 * (256 - factor) + prob2 * factor, 8);
-}
-
-static INLINE vp9_prob merge_probs(vp9_prob pre_prob,
- const unsigned int ct[2],
- unsigned int count_sat,
- unsigned int max_update_factor) {
- const vp9_prob prob = get_binary_prob(ct[0], ct[1]);
- const unsigned int count = MIN(ct[0] + ct[1], count_sat);
- const unsigned int factor = max_update_factor * count / count_sat;
- return weighted_prob(pre_prob, prob, factor);
-}
-
-static unsigned int tree_merge_probs_impl(unsigned int i,
- const vp9_tree_index *tree,
- const vp9_prob *pre_probs,
- const unsigned int *counts,
- unsigned int count_sat,
- unsigned int max_update_factor,
- vp9_prob *probs) {
- const int l = tree[i];
- const unsigned int left_count = (l <= 0)
- ? counts[-l]
- : tree_merge_probs_impl(l, tree, pre_probs, counts,
- count_sat, max_update_factor, probs);
- const int r = tree[i + 1];
- const unsigned int right_count = (r <= 0)
- ? counts[-r]
- : tree_merge_probs_impl(r, tree, pre_probs, counts,
- count_sat, max_update_factor, probs);
- const unsigned int ct[2] = { left_count, right_count };
- probs[i >> 1] = merge_probs(pre_probs[i >> 1], ct,
- count_sat, max_update_factor);
- return left_count + right_count;
-}
-
-static void tree_merge_probs(const vp9_tree_index *tree,
- const vp9_prob *pre_probs,
- const unsigned int *counts,
- unsigned int count_sat,
- unsigned int max_update_factor, vp9_prob *probs) {
- tree_merge_probs_impl(0, tree, pre_probs, counts,
- count_sat, max_update_factor, probs);
-}
-
-
-#endif // VP9_COMMON_VP9_TREECODER_H_
diff --git a/libvpx/vp9/common/x86/vp9_asm_stubs.c b/libvpx/vp9/common/x86/vp9_asm_stubs.c
index 106e6d4..1b4904c 100644
--- a/libvpx/vp9/common/x86/vp9_asm_stubs.c
+++ b/libvpx/vp9/common/x86/vp9_asm_stubs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -13,45 +13,205 @@
#include "./vpx_config.h"
#include "./vp9_rtcd.h"
#include "vpx_ports/mem.h"
-///////////////////////////////////////////////////////////////////////////
-// the mmx function that does the bilinear filtering and var calculation //
-// int one pass //
-///////////////////////////////////////////////////////////////////////////
-DECLARE_ALIGNED(16, const short, vp9_bilinear_filters_mmx[16][8]) = {
- { 128, 128, 128, 128, 0, 0, 0, 0 },
- { 120, 120, 120, 120, 8, 8, 8, 8 },
- { 112, 112, 112, 112, 16, 16, 16, 16 },
- { 104, 104, 104, 104, 24, 24, 24, 24 },
- { 96, 96, 96, 96, 32, 32, 32, 32 },
- { 88, 88, 88, 88, 40, 40, 40, 40 },
- { 80, 80, 80, 80, 48, 48, 48, 48 },
- { 72, 72, 72, 72, 56, 56, 56, 56 },
- { 64, 64, 64, 64, 64, 64, 64, 64 },
- { 56, 56, 56, 56, 72, 72, 72, 72 },
- { 48, 48, 48, 48, 80, 80, 80, 80 },
- { 40, 40, 40, 40, 88, 88, 88, 88 },
- { 32, 32, 32, 32, 96, 96, 96, 96 },
- { 24, 24, 24, 24, 104, 104, 104, 104 },
- { 16, 16, 16, 16, 112, 112, 112, 112 },
- { 8, 8, 8, 8, 120, 120, 120, 120 }
-};
typedef void filter8_1dfunction (
const unsigned char *src_ptr,
- const unsigned int src_pitch,
+ const ptrdiff_t src_pitch,
unsigned char *output_ptr,
- unsigned int out_pitch,
+ ptrdiff_t out_pitch,
unsigned int output_height,
const short *filter
);
+#define FUN_CONV_1D(name, step_q4, filter, dir, src_start, avg, opt) \
+ void vp9_convolve8_##name##_##opt(const uint8_t *src, ptrdiff_t src_stride, \
+ uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *filter_x, int x_step_q4, \
+ const int16_t *filter_y, int y_step_q4, \
+ int w, int h) { \
+ if (step_q4 == 16 && filter[3] != 128) { \
+ if (filter[0] || filter[1] || filter[2]) { \
+ while (w >= 16) { \
+ vp9_filter_block1d16_##dir##8_##avg##opt(src_start, \
+ src_stride, \
+ dst, \
+ dst_stride, \
+ h, \
+ filter); \
+ src += 16; \
+ dst += 16; \
+ w -= 16; \
+ } \
+ while (w >= 8) { \
+ vp9_filter_block1d8_##dir##8_##avg##opt(src_start, \
+ src_stride, \
+ dst, \
+ dst_stride, \
+ h, \
+ filter); \
+ src += 8; \
+ dst += 8; \
+ w -= 8; \
+ } \
+ while (w >= 4) { \
+ vp9_filter_block1d4_##dir##8_##avg##opt(src_start, \
+ src_stride, \
+ dst, \
+ dst_stride, \
+ h, \
+ filter); \
+ src += 4; \
+ dst += 4; \
+ w -= 4; \
+ } \
+ } else { \
+ while (w >= 16) { \
+ vp9_filter_block1d16_##dir##2_##avg##opt(src, \
+ src_stride, \
+ dst, \
+ dst_stride, \
+ h, \
+ filter); \
+ src += 16; \
+ dst += 16; \
+ w -= 16; \
+ } \
+ while (w >= 8) { \
+ vp9_filter_block1d8_##dir##2_##avg##opt(src, \
+ src_stride, \
+ dst, \
+ dst_stride, \
+ h, \
+ filter); \
+ src += 8; \
+ dst += 8; \
+ w -= 8; \
+ } \
+ while (w >= 4) { \
+ vp9_filter_block1d4_##dir##2_##avg##opt(src, \
+ src_stride, \
+ dst, \
+ dst_stride, \
+ h, \
+ filter); \
+ src += 4; \
+ dst += 4; \
+ w -= 4; \
+ } \
+ } \
+ } \
+ if (w) { \
+ vp9_convolve8_##name##_c(src, src_stride, dst, dst_stride, \
+ filter_x, x_step_q4, filter_y, y_step_q4, \
+ w, h); \
+ } \
+}
+
+#define FUN_CONV_2D(avg, opt) \
+void vp9_convolve8_##avg##opt(const uint8_t *src, ptrdiff_t src_stride, \
+ uint8_t *dst, ptrdiff_t dst_stride, \
+ const int16_t *filter_x, int x_step_q4, \
+ const int16_t *filter_y, int y_step_q4, \
+ int w, int h) { \
+ assert(w <= 64); \
+ assert(h <= 64); \
+ if (x_step_q4 == 16 && y_step_q4 == 16) { \
+ if (filter_x[0] || filter_x[1] || filter_x[2] || filter_x[3] == 128 || \
+ filter_y[0] || filter_y[1] || filter_y[2] || filter_y[3] == 128) { \
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71); \
+ vp9_convolve8_horiz_##opt(src - 3 * src_stride, src_stride, fdata2, 64, \
+ filter_x, x_step_q4, filter_y, y_step_q4, \
+ w, h + 7); \
+ vp9_convolve8_##avg##vert_##opt(fdata2 + 3 * 64, 64, dst, dst_stride, \
+ filter_x, x_step_q4, filter_y, \
+ y_step_q4, w, h); \
+ } else { \
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 65); \
+ vp9_convolve8_horiz_##opt(src, src_stride, fdata2, 64, \
+ filter_x, x_step_q4, filter_y, y_step_q4, \
+ w, h + 1); \
+ vp9_convolve8_##avg##vert_##opt(fdata2, 64, dst, dst_stride, \
+ filter_x, x_step_q4, filter_y, \
+ y_step_q4, w, h); \
+ } \
+ } else { \
+ vp9_convolve8_##avg##c(src, src_stride, dst, dst_stride, \
+ filter_x, x_step_q4, filter_y, y_step_q4, w, h); \
+ } \
+}
+#if HAVE_AVX2
+filter8_1dfunction vp9_filter_block1d16_v8_avx2;
+filter8_1dfunction vp9_filter_block1d16_h8_avx2;
+filter8_1dfunction vp9_filter_block1d4_v8_ssse3;
+#if (ARCH_X86_64)
+filter8_1dfunction vp9_filter_block1d8_v8_intrin_ssse3;
+filter8_1dfunction vp9_filter_block1d8_h8_intrin_ssse3;
+filter8_1dfunction vp9_filter_block1d4_h8_intrin_ssse3;
+#define vp9_filter_block1d8_v8_avx2 vp9_filter_block1d8_v8_intrin_ssse3
+#define vp9_filter_block1d8_h8_avx2 vp9_filter_block1d8_h8_intrin_ssse3
+#define vp9_filter_block1d4_h8_avx2 vp9_filter_block1d4_h8_intrin_ssse3
+#else
+filter8_1dfunction vp9_filter_block1d8_v8_ssse3;
+filter8_1dfunction vp9_filter_block1d8_h8_ssse3;
+filter8_1dfunction vp9_filter_block1d4_h8_ssse3;
+#define vp9_filter_block1d8_v8_avx2 vp9_filter_block1d8_v8_ssse3
+#define vp9_filter_block1d8_h8_avx2 vp9_filter_block1d8_h8_ssse3
+#define vp9_filter_block1d4_h8_avx2 vp9_filter_block1d4_h8_ssse3
+#endif
+filter8_1dfunction vp9_filter_block1d16_v2_ssse3;
+filter8_1dfunction vp9_filter_block1d16_h2_ssse3;
+filter8_1dfunction vp9_filter_block1d8_v2_ssse3;
+filter8_1dfunction vp9_filter_block1d8_h2_ssse3;
+filter8_1dfunction vp9_filter_block1d4_v2_ssse3;
+filter8_1dfunction vp9_filter_block1d4_h2_ssse3;
+#define vp9_filter_block1d4_v8_avx2 vp9_filter_block1d4_v8_ssse3
+#define vp9_filter_block1d16_v2_avx2 vp9_filter_block1d16_v2_ssse3
+#define vp9_filter_block1d16_h2_avx2 vp9_filter_block1d16_h2_ssse3
+#define vp9_filter_block1d8_v2_avx2 vp9_filter_block1d8_v2_ssse3
+#define vp9_filter_block1d8_h2_avx2 vp9_filter_block1d8_h2_ssse3
+#define vp9_filter_block1d4_v2_avx2 vp9_filter_block1d4_v2_ssse3
+#define vp9_filter_block1d4_h2_avx2 vp9_filter_block1d4_h2_ssse3
+// void vp9_convolve8_horiz_avx2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_vert_avx2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , avx2);
+FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , avx2);
+
+// void vp9_convolve8_avx2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+FUN_CONV_2D(, avx2);
+#endif
#if HAVE_SSSE3
+#if (ARCH_X86_64)
+filter8_1dfunction vp9_filter_block1d16_v8_intrin_ssse3;
+filter8_1dfunction vp9_filter_block1d16_h8_intrin_ssse3;
+filter8_1dfunction vp9_filter_block1d8_v8_intrin_ssse3;
+filter8_1dfunction vp9_filter_block1d8_h8_intrin_ssse3;
+filter8_1dfunction vp9_filter_block1d4_v8_ssse3;
+filter8_1dfunction vp9_filter_block1d4_h8_intrin_ssse3;
+#define vp9_filter_block1d16_v8_ssse3 vp9_filter_block1d16_v8_intrin_ssse3
+#define vp9_filter_block1d16_h8_ssse3 vp9_filter_block1d16_h8_intrin_ssse3
+#define vp9_filter_block1d8_v8_ssse3 vp9_filter_block1d8_v8_intrin_ssse3
+#define vp9_filter_block1d8_h8_ssse3 vp9_filter_block1d8_h8_intrin_ssse3
+#define vp9_filter_block1d4_h8_ssse3 vp9_filter_block1d4_h8_intrin_ssse3
+#else
filter8_1dfunction vp9_filter_block1d16_v8_ssse3;
filter8_1dfunction vp9_filter_block1d16_h8_ssse3;
filter8_1dfunction vp9_filter_block1d8_v8_ssse3;
filter8_1dfunction vp9_filter_block1d8_h8_ssse3;
filter8_1dfunction vp9_filter_block1d4_v8_ssse3;
filter8_1dfunction vp9_filter_block1d4_h8_ssse3;
+#endif
filter8_1dfunction vp9_filter_block1d16_v8_avg_ssse3;
filter8_1dfunction vp9_filter_block1d16_h8_avg_ssse3;
filter8_1dfunction vp9_filter_block1d8_v8_avg_ssse3;
@@ -59,201 +219,57 @@ filter8_1dfunction vp9_filter_block1d8_h8_avg_ssse3;
filter8_1dfunction vp9_filter_block1d4_v8_avg_ssse3;
filter8_1dfunction vp9_filter_block1d4_h8_avg_ssse3;
-void vp9_convolve8_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- /* Ensure the filter can be compressed to int16_t. */
- if (x_step_q4 == 16 && filter_x[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_h8_ssse3(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_h8_ssse3(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_h8_ssse3(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
-
-void vp9_convolve8_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- if (y_step_q4 == 16 && filter_y[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_v8_ssse3(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_v8_ssse3(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_v8_ssse3(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
-
-void vp9_convolve8_avg_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- if (x_step_q4 == 16 && filter_x[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_h8_avg_ssse3(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_h8_avg_ssse3(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_h8_avg_ssse3(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
-
-void vp9_convolve8_avg_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- if (y_step_q4 == 16 && filter_y[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_v8_avg_ssse3(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_v8_avg_ssse3(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_v8_avg_ssse3(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
-
-void vp9_convolve8_ssse3(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
-
- assert(w <= 64);
- assert(h <= 64);
- if (x_step_q4 == 16 && y_step_q4 == 16) {
- vp9_convolve8_horiz_ssse3(src - 3 * src_stride, src_stride, fdata2, 64,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h + 7);
- vp9_convolve8_vert_ssse3(fdata2 + 3 * 64, 64, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- } else {
- vp9_convolve8_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- }
-}
+filter8_1dfunction vp9_filter_block1d16_v2_ssse3;
+filter8_1dfunction vp9_filter_block1d16_h2_ssse3;
+filter8_1dfunction vp9_filter_block1d8_v2_ssse3;
+filter8_1dfunction vp9_filter_block1d8_h2_ssse3;
+filter8_1dfunction vp9_filter_block1d4_v2_ssse3;
+filter8_1dfunction vp9_filter_block1d4_h2_ssse3;
+filter8_1dfunction vp9_filter_block1d16_v2_avg_ssse3;
+filter8_1dfunction vp9_filter_block1d16_h2_avg_ssse3;
+filter8_1dfunction vp9_filter_block1d8_v2_avg_ssse3;
+filter8_1dfunction vp9_filter_block1d8_h2_avg_ssse3;
+filter8_1dfunction vp9_filter_block1d4_v2_avg_ssse3;
+filter8_1dfunction vp9_filter_block1d4_h2_avg_ssse3;
-void vp9_convolve8_avg_ssse3(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
+// void vp9_convolve8_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_avg_horiz_ssse3(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_avg_vert_ssse3(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , ssse3);
+FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , ssse3);
+FUN_CONV_1D(avg_horiz, x_step_q4, filter_x, h, src, avg_, ssse3);
+FUN_CONV_1D(avg_vert, y_step_q4, filter_y, v, src - src_stride * 3, avg_,
+ ssse3);
- assert(w <= 64);
- assert(h <= 64);
- if (x_step_q4 == 16 && y_step_q4 == 16) {
- vp9_convolve8_horiz_ssse3(src - 3 * src_stride, src_stride, fdata2, 64,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h + 7);
- vp9_convolve8_avg_vert_ssse3(fdata2 + 3 * 64, 64, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- } else {
- vp9_convolve8_avg_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- }
-}
+// void vp9_convolve8_ssse3(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_avg_ssse3(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+FUN_CONV_2D(, ssse3);
+FUN_CONV_2D(avg_ , ssse3);
#endif
#if HAVE_SSE2
@@ -270,199 +286,54 @@ filter8_1dfunction vp9_filter_block1d8_h8_avg_sse2;
filter8_1dfunction vp9_filter_block1d4_v8_avg_sse2;
filter8_1dfunction vp9_filter_block1d4_h8_avg_sse2;
-void vp9_convolve8_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- /* Ensure the filter can be compressed to int16_t. */
- if (x_step_q4 == 16 && filter_x[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_h8_sse2(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_h8_sse2(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_h8_sse2(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
+filter8_1dfunction vp9_filter_block1d16_v2_sse2;
+filter8_1dfunction vp9_filter_block1d16_h2_sse2;
+filter8_1dfunction vp9_filter_block1d8_v2_sse2;
+filter8_1dfunction vp9_filter_block1d8_h2_sse2;
+filter8_1dfunction vp9_filter_block1d4_v2_sse2;
+filter8_1dfunction vp9_filter_block1d4_h2_sse2;
+filter8_1dfunction vp9_filter_block1d16_v2_avg_sse2;
+filter8_1dfunction vp9_filter_block1d16_h2_avg_sse2;
+filter8_1dfunction vp9_filter_block1d8_v2_avg_sse2;
+filter8_1dfunction vp9_filter_block1d8_h2_avg_sse2;
+filter8_1dfunction vp9_filter_block1d4_v2_avg_sse2;
+filter8_1dfunction vp9_filter_block1d4_h2_avg_sse2;
-void vp9_convolve8_vert_sse2(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- if (y_step_q4 == 16 && filter_y[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_v8_sse2(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_v8_sse2(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_v8_sse2(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
+// void vp9_convolve8_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_vert_sse2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_avg_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_avg_vert_sse2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+FUN_CONV_1D(horiz, x_step_q4, filter_x, h, src, , sse2);
+FUN_CONV_1D(vert, y_step_q4, filter_y, v, src - src_stride * 3, , sse2);
+FUN_CONV_1D(avg_horiz, x_step_q4, filter_x, h, src, avg_, sse2);
+FUN_CONV_1D(avg_vert, y_step_q4, filter_y, v, src - src_stride * 3, avg_, sse2);
-void vp9_convolve8_avg_horiz_sse2(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- if (x_step_q4 == 16 && filter_x[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_h8_avg_sse2(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_h8_avg_sse2(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_h8_avg_sse2(src, src_stride,
- dst, dst_stride,
- h, filter_x);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_avg_horiz_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
-
-void vp9_convolve8_avg_vert_sse2(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- if (y_step_q4 == 16 && filter_y[3] != 128) {
- while (w >= 16) {
- vp9_filter_block1d16_v8_avg_sse2(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 16;
- dst += 16;
- w -= 16;
- }
- while (w >= 8) {
- vp9_filter_block1d8_v8_avg_sse2(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 8;
- dst += 8;
- w -= 8;
- }
- while (w >= 4) {
- vp9_filter_block1d4_v8_avg_sse2(src - src_stride * 3, src_stride,
- dst, dst_stride,
- h, filter_y);
- src += 4;
- dst += 4;
- w -= 4;
- }
- }
- if (w) {
- vp9_convolve8_avg_vert_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- }
-}
-
-void vp9_convolve8_sse2(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
-
- assert(w <= 64);
- assert(h <= 64);
- if (x_step_q4 == 16 && y_step_q4 == 16) {
- vp9_convolve8_horiz_sse2(src - 3 * src_stride, src_stride, fdata2, 64,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h + 7);
- vp9_convolve8_vert_sse2(fdata2 + 3 * 64, 64, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- } else {
- vp9_convolve8_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- }
-}
-
-void vp9_convolve8_avg_sse2(const uint8_t *src, ptrdiff_t src_stride,
- uint8_t *dst, ptrdiff_t dst_stride,
- const int16_t *filter_x, int x_step_q4,
- const int16_t *filter_y, int y_step_q4,
- int w, int h) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, fdata2, 64 * 71);
-
- assert(w <= 64);
- assert(h <= 64);
- if (x_step_q4 == 16 && y_step_q4 == 16) {
- vp9_convolve8_horiz_sse2(src - 3 * src_stride, src_stride, fdata2, 64,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h + 7);
- vp9_convolve8_avg_vert_sse2(fdata2 + 3 * 64, 64, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4,
- w, h);
- } else {
- vp9_convolve8_avg_c(src, src_stride, dst, dst_stride,
- filter_x, x_step_q4, filter_y, y_step_q4, w, h);
- }
-}
+// void vp9_convolve8_sse2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+// void vp9_convolve8_avg_sse2(const uint8_t *src, ptrdiff_t src_stride,
+// uint8_t *dst, ptrdiff_t dst_stride,
+// const int16_t *filter_x, int x_step_q4,
+// const int16_t *filter_y, int y_step_q4,
+// int w, int h);
+FUN_CONV_2D(, sse2);
+FUN_CONV_2D(avg_ , sse2);
#endif
diff --git a/libvpx/vp9/common/x86/vp9_idct_intrin_sse2.c b/libvpx/vp9/common/x86/vp9_idct_intrin_sse2.c
index 2a33844..13a5b5a 100644
--- a/libvpx/vp9/common/x86/vp9_idct_intrin_sse2.c
+++ b/libvpx/vp9/common/x86/vp9_idct_intrin_sse2.c
@@ -174,15 +174,13 @@ void vp9_idct4x4_1_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
static INLINE void transpose_4x4(__m128i *res) {
const __m128i tr0_0 = _mm_unpacklo_epi16(res[0], res[1]);
- const __m128i tr0_1 = _mm_unpacklo_epi16(res[2], res[3]);
- res[0] = _mm_unpacklo_epi32(tr0_0, tr0_1);
- res[2] = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ const __m128i tr0_1 = _mm_unpackhi_epi16(res[0], res[1]);
- res[1] = _mm_unpackhi_epi64(res[0], res[0]);
- res[3] = _mm_unpackhi_epi64(res[2], res[2]);
+ res[0] = _mm_unpacklo_epi16(tr0_0, tr0_1);
+ res[1] = _mm_unpackhi_epi16(tr0_0, tr0_1);
}
-static void idct4_1d_sse2(__m128i *in) {
+static void idct4_sse2(__m128i *in) {
const __m128i k__cospi_p16_p16 = pair_set_epi16(cospi_16_64, cospi_16_64);
const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64);
@@ -192,8 +190,8 @@ static void idct4_1d_sse2(__m128i *in) {
transpose_4x4(in);
// stage 1
- u[0] = _mm_unpacklo_epi16(in[0], in[2]);
- u[1] = _mm_unpacklo_epi16(in[1], in[3]);
+ u[0] = _mm_unpacklo_epi16(in[0], in[1]);
+ u[1] = _mm_unpackhi_epi16(in[0], in[1]);
v[0] = _mm_madd_epi16(u[0], k__cospi_p16_p16);
v[1] = _mm_madd_epi16(u[0], k__cospi_p16_m16);
v[2] = _mm_madd_epi16(u[1], k__cospi_p24_m08);
@@ -209,19 +207,16 @@ static void idct4_1d_sse2(__m128i *in) {
v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
- u[0] = _mm_packs_epi32(v[0], v[2]);
- u[1] = _mm_packs_epi32(v[1], v[3]);
- u[2] = _mm_unpackhi_epi64(u[0], u[0]);
- u[3] = _mm_unpackhi_epi64(u[1], u[1]);
+ u[0] = _mm_packs_epi32(v[0], v[1]);
+ u[1] = _mm_packs_epi32(v[3], v[2]);
// stage 2
- in[0] = _mm_add_epi16(u[0], u[3]);
- in[1] = _mm_add_epi16(u[1], u[2]);
- in[2] = _mm_sub_epi16(u[1], u[2]);
- in[3] = _mm_sub_epi16(u[0], u[3]);
+ in[0] = _mm_add_epi16(u[0], u[1]);
+ in[1] = _mm_sub_epi16(u[0], u[1]);
+ in[1] = _mm_shuffle_epi32(in[1], 0x4E);
}
-static void iadst4_1d_sse2(__m128i *in) {
+static void iadst4_sse2(__m128i *in) {
const __m128i k__sinpi_p01_p04 = pair_set_epi16(sinpi_1_9, sinpi_4_9);
const __m128i k__sinpi_p03_p02 = pair_set_epi16(sinpi_3_9, sinpi_2_9);
const __m128i k__sinpi_p02_m01 = pair_set_epi16(sinpi_2_9, -sinpi_1_9);
@@ -232,13 +227,14 @@ static void iadst4_1d_sse2(__m128i *in) {
__m128i u[8], v[8], in7;
transpose_4x4(in);
- in7 = _mm_add_epi16(in[0], in[3]);
- in7 = _mm_sub_epi16(in7, in[2]);
+ in7 = _mm_srli_si128(in[1], 8);
+ in7 = _mm_add_epi16(in7, in[0]);
+ in7 = _mm_sub_epi16(in7, in[1]);
- u[0] = _mm_unpacklo_epi16(in[0], in[2]);
- u[1] = _mm_unpacklo_epi16(in[1], in[3]);
+ u[0] = _mm_unpacklo_epi16(in[0], in[1]);
+ u[1] = _mm_unpackhi_epi16(in[0], in[1]);
u[2] = _mm_unpacklo_epi16(in7, kZero);
- u[3] = _mm_unpacklo_epi16(in[1], kZero);
+ u[3] = _mm_unpackhi_epi16(in[0], kZero);
v[0] = _mm_madd_epi16(u[0], k__sinpi_p01_p04); // s0 + s3
v[1] = _mm_madd_epi16(u[1], k__sinpi_p03_p02); // s2 + s5
@@ -265,39 +261,35 @@ static void iadst4_1d_sse2(__m128i *in) {
u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
- in[0] = _mm_packs_epi32(u[0], u[2]);
- in[1] = _mm_packs_epi32(u[1], u[3]);
- in[2] = _mm_unpackhi_epi64(in[0], in[0]);
- in[3] = _mm_unpackhi_epi64(in[1], in[1]);
+ in[0] = _mm_packs_epi32(u[0], u[1]);
+ in[1] = _mm_packs_epi32(u[2], u[3]);
}
void vp9_iht4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride,
int tx_type) {
- __m128i in[4];
+ __m128i in[2];
const __m128i zero = _mm_setzero_si128();
const __m128i eight = _mm_set1_epi16(8);
- in[0] = _mm_loadl_epi64((const __m128i *)input);
- in[1] = _mm_loadl_epi64((const __m128i *)(input + 4));
- in[2] = _mm_loadl_epi64((const __m128i *)(input + 8));
- in[3] = _mm_loadl_epi64((const __m128i *)(input + 12));
+ in[0]= _mm_loadu_si128((const __m128i *)(input));
+ in[1]= _mm_loadu_si128((const __m128i *)(input + 8));
switch (tx_type) {
case 0: // DCT_DCT
- idct4_1d_sse2(in);
- idct4_1d_sse2(in);
+ idct4_sse2(in);
+ idct4_sse2(in);
break;
case 1: // ADST_DCT
- idct4_1d_sse2(in);
- iadst4_1d_sse2(in);
+ idct4_sse2(in);
+ iadst4_sse2(in);
break;
case 2: // DCT_ADST
- iadst4_1d_sse2(in);
- idct4_1d_sse2(in);
+ iadst4_sse2(in);
+ idct4_sse2(in);
break;
case 3: // ADST_ADST
- iadst4_1d_sse2(in);
- iadst4_1d_sse2(in);
+ iadst4_sse2(in);
+ iadst4_sse2(in);
break;
default:
assert(0);
@@ -307,18 +299,35 @@ void vp9_iht4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride,
// Final round and shift
in[0] = _mm_add_epi16(in[0], eight);
in[1] = _mm_add_epi16(in[1], eight);
- in[2] = _mm_add_epi16(in[2], eight);
- in[3] = _mm_add_epi16(in[3], eight);
in[0] = _mm_srai_epi16(in[0], 4);
in[1] = _mm_srai_epi16(in[1], 4);
- in[2] = _mm_srai_epi16(in[2], 4);
- in[3] = _mm_srai_epi16(in[3], 4);
- RECON_AND_STORE4X4(dest, in[0]);
- RECON_AND_STORE4X4(dest, in[1]);
- RECON_AND_STORE4X4(dest, in[2]);
- RECON_AND_STORE4X4(dest, in[3]);
+ // Reconstruction and Store
+ {
+ __m128i d0 = _mm_cvtsi32_si128(*(const int *)(dest));
+ __m128i d2 = _mm_cvtsi32_si128(*(const int *)(dest + stride * 2));
+ d0 = _mm_unpacklo_epi32(d0,
+ _mm_cvtsi32_si128(*(const int *) (dest + stride)));
+ d2 = _mm_unpacklo_epi32(d2, _mm_cvtsi32_si128(
+ *(const int *) (dest + stride * 3)));
+ d0 = _mm_unpacklo_epi8(d0, zero);
+ d2 = _mm_unpacklo_epi8(d2, zero);
+ d0 = _mm_add_epi16(d0, in[0]);
+ d2 = _mm_add_epi16(d2, in[1]);
+ d0 = _mm_packus_epi16(d0, d2);
+ // store result[0]
+ *(int *)dest = _mm_cvtsi128_si32(d0);
+ // store result[1]
+ d0 = _mm_srli_si128(d0, 4);
+ *(int *)(dest + stride) = _mm_cvtsi128_si32(d0);
+ // store result[2]
+ d0 = _mm_srli_si128(d0, 4);
+ *(int *)(dest + stride * 2) = _mm_cvtsi128_si32(d0);
+ // store result[3]
+ d0 = _mm_srli_si128(d0, 4);
+ *(int *)(dest + stride * 3) = _mm_cvtsi128_si32(d0);
+ }
}
#define TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, \
@@ -352,37 +361,40 @@ void vp9_iht4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride,
out7 = _mm_unpackhi_epi64(tr1_3, tr1_7); \
}
-#define TRANSPOSE_4X8(in0, in1, in2, in3, in4, in5, in6, in7, \
- out0, out1, out2, out3, out4, out5, out6, out7) \
- { \
- const __m128i tr0_0 = _mm_unpacklo_epi16(in0, in1); \
- const __m128i tr0_1 = _mm_unpacklo_epi16(in2, in3); \
- const __m128i tr0_4 = _mm_unpacklo_epi16(in4, in5); \
- const __m128i tr0_5 = _mm_unpacklo_epi16(in6, in7); \
- \
+#define TRANSPOSE_4X8_10(tmp0, tmp1, tmp2, tmp3, \
+ out0, out1, out2, out3) \
+ { \
+ const __m128i tr0_0 = _mm_unpackhi_epi16(tmp0, tmp1); \
+ const __m128i tr0_1 = _mm_unpacklo_epi16(tmp1, tmp0); \
+ const __m128i tr0_4 = _mm_unpacklo_epi16(tmp2, tmp3); \
+ const __m128i tr0_5 = _mm_unpackhi_epi16(tmp3, tmp2); \
+ \
const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1); \
const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1); \
const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5); \
const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5); \
- \
+ \
out0 = _mm_unpacklo_epi64(tr1_0, tr1_4); \
out1 = _mm_unpackhi_epi64(tr1_0, tr1_4); \
out2 = _mm_unpacklo_epi64(tr1_2, tr1_6); \
out3 = _mm_unpackhi_epi64(tr1_2, tr1_6); \
- out4 = out5 = out6 = out7 = zero; \
}
-#define TRANSPOSE_8X4(in0, in1, in2, in3, out0, out1, out2, out3) \
+#define TRANSPOSE_8X4(in0, in1, in2, in3, out0, out1) \
{ \
const __m128i tr0_0 = _mm_unpacklo_epi16(in0, in1); \
const __m128i tr0_1 = _mm_unpacklo_epi16(in2, in3); \
- const __m128i tr0_2 = _mm_unpackhi_epi16(in0, in1); \
- const __m128i tr0_3 = _mm_unpackhi_epi16(in2, in3); \
\
in0 = _mm_unpacklo_epi32(tr0_0, tr0_1); /* i1 i0 */ \
in1 = _mm_unpackhi_epi32(tr0_0, tr0_1); /* i3 i2 */ \
- in2 = _mm_unpacklo_epi32(tr0_2, tr0_3); /* i5 i4 */ \
- in3 = _mm_unpackhi_epi32(tr0_2, tr0_3); /* i7 i6 */ \
+ }
+
+#define TRANSPOSE_8X8_10(in0, in1, in2, in3, out0, out1) \
+ { \
+ const __m128i tr0_0 = _mm_unpacklo_epi16(in0, in1); \
+ const __m128i tr0_1 = _mm_unpacklo_epi16(in2, in3); \
+ out0 = _mm_unpacklo_epi32(tr0_0, tr0_1); \
+ out1 = _mm_unpackhi_epi32(tr0_0, tr0_1); \
}
// Define Macro for multiplying elements by constants and adding them together.
@@ -422,7 +434,30 @@ void vp9_iht4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride,
res3 = _mm_packs_epi32(tmp6, tmp7); \
}
-#define IDCT8_1D \
+#define MULTIPLICATION_AND_ADD_2(lo_0, hi_0, cst0, cst1, res0, res1) \
+ { \
+ tmp0 = _mm_madd_epi16(lo_0, cst0); \
+ tmp1 = _mm_madd_epi16(hi_0, cst0); \
+ tmp2 = _mm_madd_epi16(lo_0, cst1); \
+ tmp3 = _mm_madd_epi16(hi_0, cst1); \
+ \
+ tmp0 = _mm_add_epi32(tmp0, rounding); \
+ tmp1 = _mm_add_epi32(tmp1, rounding); \
+ tmp2 = _mm_add_epi32(tmp2, rounding); \
+ tmp3 = _mm_add_epi32(tmp3, rounding); \
+ \
+ tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \
+ tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \
+ tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \
+ tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \
+ \
+ res0 = _mm_packs_epi32(tmp0, tmp1); \
+ res1 = _mm_packs_epi32(tmp2, tmp3); \
+ }
+
+#define IDCT8(in0, in1, in2, in3, in4, in5, in6, in7, \
+ out0, out1, out2, out3, out4, out5, out6, out7) \
+ { \
/* Stage1 */ \
{ \
const __m128i lo_17 = _mm_unpacklo_epi16(in1, in7); \
@@ -482,14 +517,15 @@ void vp9_iht4x4_16_add_sse2(const int16_t *input, uint8_t *dest, int stride,
} \
\
/* Stage4 */ \
- in0 = _mm_adds_epi16(stp1_0, stp2_7); \
- in1 = _mm_adds_epi16(stp1_1, stp1_6); \
- in2 = _mm_adds_epi16(stp1_2, stp1_5); \
- in3 = _mm_adds_epi16(stp1_3, stp2_4); \
- in4 = _mm_subs_epi16(stp1_3, stp2_4); \
- in5 = _mm_subs_epi16(stp1_2, stp1_5); \
- in6 = _mm_subs_epi16(stp1_1, stp1_6); \
- in7 = _mm_subs_epi16(stp1_0, stp2_7);
+ out0 = _mm_adds_epi16(stp1_0, stp2_7); \
+ out1 = _mm_adds_epi16(stp1_1, stp1_6); \
+ out2 = _mm_adds_epi16(stp1_2, stp1_5); \
+ out3 = _mm_adds_epi16(stp1_3, stp2_4); \
+ out4 = _mm_subs_epi16(stp1_3, stp2_4); \
+ out5 = _mm_subs_epi16(stp1_2, stp1_5); \
+ out6 = _mm_subs_epi16(stp1_1, stp1_6); \
+ out7 = _mm_subs_epi16(stp1_0, stp2_7); \
+ }
#define RECON_AND_STORE(dest, in_x) \
{ \
@@ -533,11 +569,12 @@ void vp9_idct8x8_64_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
// 2-D
for (i = 0; i < 2; i++) {
// 8x8 Transpose is copied from vp9_fdct8x8_sse2()
- TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
- in4, in5, in6, in7);
+ TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
// 4-stage 1D idct8x8
- IDCT8_1D
+ IDCT8(in0, in1, in2, in3, in4, in5, in6, in7,
+ in0, in1, in2, in3, in4, in5, in6, in7);
}
// Final rounding and shift
@@ -620,7 +657,24 @@ static INLINE void array_transpose_8x8(__m128i *in, __m128i *res) {
res[7] = _mm_unpackhi_epi64(tr1_6, tr1_7);
}
-static void idct8_1d_sse2(__m128i *in) {
+static INLINE void array_transpose_4X8(__m128i *in, __m128i * out) {
+ const __m128i tr0_0 = _mm_unpacklo_epi16(in[0], in[1]);
+ const __m128i tr0_1 = _mm_unpacklo_epi16(in[2], in[3]);
+ const __m128i tr0_4 = _mm_unpacklo_epi16(in[4], in[5]);
+ const __m128i tr0_5 = _mm_unpacklo_epi16(in[6], in[7]);
+
+ const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5);
+ const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5);
+
+ out[0] = _mm_unpacklo_epi64(tr1_0, tr1_4);
+ out[1] = _mm_unpackhi_epi64(tr1_0, tr1_4);
+ out[2] = _mm_unpacklo_epi64(tr1_2, tr1_6);
+ out[3] = _mm_unpackhi_epi64(tr1_2, tr1_6);
+}
+
+static void idct8_sse2(__m128i *in) {
const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING);
const __m128i stg1_0 = pair_set_epi16(cospi_28_64, -cospi_4_64);
const __m128i stg1_1 = pair_set_epi16(cospi_4_64, cospi_28_64);
@@ -636,32 +690,16 @@ static void idct8_1d_sse2(__m128i *in) {
__m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7;
__m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- in0 = in[0];
- in1 = in[1];
- in2 = in[2];
- in3 = in[3];
- in4 = in[4];
- in5 = in[5];
- in6 = in[6];
- in7 = in[7];
-
// 8x8 Transpose is copied from vp9_fdct8x8_sse2()
- TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
- in4, in5, in6, in7);
+ TRANSPOSE_8X8(in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7],
+ in0, in1, in2, in3, in4, in5, in6, in7);
// 4-stage 1D idct8x8
- IDCT8_1D
- in[0] = in0;
- in[1] = in1;
- in[2] = in2;
- in[3] = in3;
- in[4] = in4;
- in[5] = in5;
- in[6] = in6;
- in[7] = in7;
+ IDCT8(in0, in1, in2, in3, in4, in5, in6, in7,
+ in[0], in[1], in[2], in[3], in[4], in[5], in[6], in[7]);
}
-static void iadst8_1d_sse2(__m128i *in) {
+static void iadst8_sse2(__m128i *in) {
const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64);
const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64);
const __m128i k__cospi_p10_p22 = pair_set_epi16(cospi_10_64, cospi_22_64);
@@ -908,20 +946,20 @@ void vp9_iht8x8_64_add_sse2(const int16_t *input, uint8_t *dest, int stride,
switch (tx_type) {
case 0: // DCT_DCT
- idct8_1d_sse2(in);
- idct8_1d_sse2(in);
+ idct8_sse2(in);
+ idct8_sse2(in);
break;
case 1: // ADST_DCT
- idct8_1d_sse2(in);
- iadst8_1d_sse2(in);
+ idct8_sse2(in);
+ iadst8_sse2(in);
break;
case 2: // DCT_ADST
- iadst8_1d_sse2(in);
- idct8_1d_sse2(in);
+ iadst8_sse2(in);
+ idct8_sse2(in);
break;
case 3: // ADST_ADST
- iadst8_1d_sse2(in);
- iadst8_1d_sse2(in);
+ iadst8_sse2(in);
+ iadst8_sse2(in);
break;
default:
assert(0);
@@ -983,12 +1021,11 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
in3 = _mm_load_si128((const __m128i *)(input + 8 * 3));
// 8x4 Transpose
- TRANSPOSE_8X4(in0, in1, in2, in3, in0, in1, in2, in3)
-
+ TRANSPOSE_8X8_10(in0, in1, in2, in3, in0, in1);
// Stage1
{ //NOLINT
- const __m128i lo_17 = _mm_unpackhi_epi16(in0, in3);
- const __m128i lo_35 = _mm_unpackhi_epi16(in1, in2);
+ const __m128i lo_17 = _mm_unpackhi_epi16(in0, zero);
+ const __m128i lo_35 = _mm_unpackhi_epi16(in1, zero);
tmp0 = _mm_madd_epi16(lo_17, stg1_0);
tmp2 = _mm_madd_epi16(lo_17, stg1_1);
@@ -1004,16 +1041,14 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS);
tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS);
- stp1_4 = _mm_packs_epi32(tmp0, zero);
- stp1_7 = _mm_packs_epi32(tmp2, zero);
- stp1_5 = _mm_packs_epi32(tmp4, zero);
- stp1_6 = _mm_packs_epi32(tmp6, zero);
+ stp1_4 = _mm_packs_epi32(tmp0, tmp2);
+ stp1_5 = _mm_packs_epi32(tmp4, tmp6);
}
// Stage2
{ //NOLINT
- const __m128i lo_04 = _mm_unpacklo_epi16(in0, in2);
- const __m128i lo_26 = _mm_unpacklo_epi16(in1, in3);
+ const __m128i lo_04 = _mm_unpacklo_epi16(in0, zero);
+ const __m128i lo_26 = _mm_unpacklo_epi16(in1, zero);
tmp0 = _mm_madd_epi16(lo_04, stg2_0);
tmp2 = _mm_madd_epi16(lo_04, stg2_1);
@@ -1029,24 +1064,26 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS);
tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS);
- stp2_0 = _mm_packs_epi32(tmp0, zero);
- stp2_1 = _mm_packs_epi32(tmp2, zero);
- stp2_2 = _mm_packs_epi32(tmp4, zero);
- stp2_3 = _mm_packs_epi32(tmp6, zero);
+ stp2_0 = _mm_packs_epi32(tmp0, tmp2);
+ stp2_2 = _mm_packs_epi32(tmp6, tmp4);
- stp2_4 = _mm_adds_epi16(stp1_4, stp1_5);
- stp2_5 = _mm_subs_epi16(stp1_4, stp1_5);
- stp2_6 = _mm_subs_epi16(stp1_7, stp1_6);
- stp2_7 = _mm_adds_epi16(stp1_7, stp1_6);
+ tmp0 = _mm_adds_epi16(stp1_4, stp1_5);
+ tmp1 = _mm_subs_epi16(stp1_4, stp1_5);
+
+ stp2_4 = tmp0;
+ stp2_5 = _mm_unpacklo_epi64(tmp1, zero);
+ stp2_6 = _mm_unpackhi_epi64(tmp1, zero);
}
// Stage3
{ //NOLINT
const __m128i lo_56 = _mm_unpacklo_epi16(stp2_5, stp2_6);
- stp1_0 = _mm_adds_epi16(stp2_0, stp2_3);
- stp1_1 = _mm_adds_epi16(stp2_1, stp2_2);
- stp1_2 = _mm_subs_epi16(stp2_1, stp2_2);
- stp1_3 = _mm_subs_epi16(stp2_0, stp2_3);
+
+ tmp4 = _mm_adds_epi16(stp2_0, stp2_2);
+ tmp6 = _mm_subs_epi16(stp2_0, stp2_2);
+
+ stp1_2 = _mm_unpackhi_epi64(tmp6, tmp4);
+ stp1_3 = _mm_unpacklo_epi64(tmp6, tmp4);
tmp0 = _mm_madd_epi16(lo_56, stg3_0);
tmp2 = _mm_madd_epi16(lo_56, stg2_0); // stg3_1 = stg2_0
@@ -1056,27 +1093,19 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS);
tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS);
- stp1_5 = _mm_packs_epi32(tmp0, zero);
- stp1_6 = _mm_packs_epi32(tmp2, zero);
+ stp1_5 = _mm_packs_epi32(tmp0, tmp2);
}
// Stage4
- in0 = _mm_adds_epi16(stp1_0, stp2_7);
- in1 = _mm_adds_epi16(stp1_1, stp1_6);
- in2 = _mm_adds_epi16(stp1_2, stp1_5);
- in3 = _mm_adds_epi16(stp1_3, stp2_4);
- in4 = _mm_subs_epi16(stp1_3, stp2_4);
- in5 = _mm_subs_epi16(stp1_2, stp1_5);
- in6 = _mm_subs_epi16(stp1_1, stp1_6);
- in7 = _mm_subs_epi16(stp1_0, stp2_7);
-
- // Columns. 4x8 Transpose
- TRANSPOSE_4X8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
- in4, in5, in6, in7)
-
- // 1D idct8x8
- IDCT8_1D
+ tmp0 = _mm_adds_epi16(stp1_3, stp2_4);
+ tmp1 = _mm_adds_epi16(stp1_2, stp1_5);
+ tmp2 = _mm_subs_epi16(stp1_3, stp2_4);
+ tmp3 = _mm_subs_epi16(stp1_2, stp1_5);
+ TRANSPOSE_4X8_10(tmp0, tmp1, tmp2, tmp3, in0, in1, in2, in3)
+
+ IDCT8(in0, in1, in2, in3, zero, zero, zero, zero,
+ in0, in1, in2, in3, in4, in5, in6, in7);
// Final rounding and shift
in0 = _mm_adds_epi16(in0, final_rounding);
in1 = _mm_adds_epi16(in1, final_rounding);
@@ -1106,17 +1135,17 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
RECON_AND_STORE(dest, in7);
}
-#define IDCT16_1D \
+#define IDCT16 \
/* Stage2 */ \
{ \
- const __m128i lo_1_15 = _mm_unpacklo_epi16(in1, in15); \
- const __m128i hi_1_15 = _mm_unpackhi_epi16(in1, in15); \
- const __m128i lo_9_7 = _mm_unpacklo_epi16(in9, in7); \
- const __m128i hi_9_7 = _mm_unpackhi_epi16(in9, in7); \
- const __m128i lo_5_11 = _mm_unpacklo_epi16(in5, in11); \
- const __m128i hi_5_11 = _mm_unpackhi_epi16(in5, in11); \
- const __m128i lo_13_3 = _mm_unpacklo_epi16(in13, in3); \
- const __m128i hi_13_3 = _mm_unpackhi_epi16(in13, in3); \
+ const __m128i lo_1_15 = _mm_unpacklo_epi16(in[1], in[15]); \
+ const __m128i hi_1_15 = _mm_unpackhi_epi16(in[1], in[15]); \
+ const __m128i lo_9_7 = _mm_unpacklo_epi16(in[9], in[7]); \
+ const __m128i hi_9_7 = _mm_unpackhi_epi16(in[9], in[7]); \
+ const __m128i lo_5_11 = _mm_unpacklo_epi16(in[5], in[11]); \
+ const __m128i hi_5_11 = _mm_unpackhi_epi16(in[5], in[11]); \
+ const __m128i lo_13_3 = _mm_unpacklo_epi16(in[13], in[3]); \
+ const __m128i hi_13_3 = _mm_unpackhi_epi16(in[13], in[3]); \
\
MULTIPLICATION_AND_ADD(lo_1_15, hi_1_15, lo_9_7, hi_9_7, \
stg2_0, stg2_1, stg2_2, stg2_3, \
@@ -1129,10 +1158,10 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
\
/* Stage3 */ \
{ \
- const __m128i lo_2_14 = _mm_unpacklo_epi16(in2, in14); \
- const __m128i hi_2_14 = _mm_unpackhi_epi16(in2, in14); \
- const __m128i lo_10_6 = _mm_unpacklo_epi16(in10, in6); \
- const __m128i hi_10_6 = _mm_unpackhi_epi16(in10, in6); \
+ const __m128i lo_2_14 = _mm_unpacklo_epi16(in[2], in[14]); \
+ const __m128i hi_2_14 = _mm_unpackhi_epi16(in[2], in[14]); \
+ const __m128i lo_10_6 = _mm_unpacklo_epi16(in[10], in[6]); \
+ const __m128i hi_10_6 = _mm_unpackhi_epi16(in[10], in[6]); \
\
MULTIPLICATION_AND_ADD(lo_2_14, hi_2_14, lo_10_6, hi_10_6, \
stg3_0, stg3_1, stg3_2, stg3_3, \
@@ -1151,10 +1180,10 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
\
/* Stage4 */ \
{ \
- const __m128i lo_0_8 = _mm_unpacklo_epi16(in0, in8); \
- const __m128i hi_0_8 = _mm_unpackhi_epi16(in0, in8); \
- const __m128i lo_4_12 = _mm_unpacklo_epi16(in4, in12); \
- const __m128i hi_4_12 = _mm_unpackhi_epi16(in4, in12); \
+ const __m128i lo_0_8 = _mm_unpacklo_epi16(in[0], in[8]); \
+ const __m128i hi_0_8 = _mm_unpackhi_epi16(in[0], in[8]); \
+ const __m128i lo_4_12 = _mm_unpacklo_epi16(in[4], in[12]); \
+ const __m128i hi_4_12 = _mm_unpackhi_epi16(in[4], in[12]); \
\
const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); \
const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); \
@@ -1235,6 +1264,114 @@ void vp9_idct8x8_10_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
stp2_10, stp2_13, stp2_11, stp2_12) \
}
+#define IDCT16_10 \
+ /* Stage2 */ \
+ { \
+ const __m128i lo_1_15 = _mm_unpacklo_epi16(in[1], zero); \
+ const __m128i hi_1_15 = _mm_unpackhi_epi16(in[1], zero); \
+ const __m128i lo_13_3 = _mm_unpacklo_epi16(zero, in[3]); \
+ const __m128i hi_13_3 = _mm_unpackhi_epi16(zero, in[3]); \
+ \
+ MULTIPLICATION_AND_ADD(lo_1_15, hi_1_15, lo_13_3, hi_13_3, \
+ stg2_0, stg2_1, stg2_6, stg2_7, \
+ stp1_8_0, stp1_15, stp1_11, stp1_12_0) \
+ } \
+ \
+ /* Stage3 */ \
+ { \
+ const __m128i lo_2_14 = _mm_unpacklo_epi16(in[2], zero); \
+ const __m128i hi_2_14 = _mm_unpackhi_epi16(in[2], zero); \
+ \
+ MULTIPLICATION_AND_ADD_2(lo_2_14, hi_2_14, \
+ stg3_0, stg3_1, \
+ stp2_4, stp2_7) \
+ \
+ stp1_9 = stp1_8_0; \
+ stp1_10 = stp1_11; \
+ \
+ stp1_13 = stp1_12_0; \
+ stp1_14 = stp1_15; \
+ } \
+ \
+ /* Stage4 */ \
+ { \
+ const __m128i lo_0_8 = _mm_unpacklo_epi16(in[0], zero); \
+ const __m128i hi_0_8 = _mm_unpackhi_epi16(in[0], zero); \
+ \
+ const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); \
+ const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); \
+ const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \
+ const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \
+ \
+ MULTIPLICATION_AND_ADD_2(lo_0_8, hi_0_8, \
+ stg4_0, stg4_1, \
+ stp1_0, stp1_1) \
+ stp2_5 = stp2_4; \
+ stp2_6 = stp2_7; \
+ \
+ MULTIPLICATION_AND_ADD(lo_9_14, hi_9_14, lo_10_13, hi_10_13, \
+ stg4_4, stg4_5, stg4_6, stg4_7, \
+ stp2_9, stp2_14, stp2_10, stp2_13) \
+ } \
+ \
+ /* Stage5 */ \
+ { \
+ const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5); \
+ const __m128i hi_6_5 = _mm_unpackhi_epi16(stp2_6, stp2_5); \
+ \
+ stp1_2 = stp1_1; \
+ stp1_3 = stp1_0; \
+ \
+ tmp0 = _mm_madd_epi16(lo_6_5, stg4_1); \
+ tmp1 = _mm_madd_epi16(hi_6_5, stg4_1); \
+ tmp2 = _mm_madd_epi16(lo_6_5, stg4_0); \
+ tmp3 = _mm_madd_epi16(hi_6_5, stg4_0); \
+ \
+ tmp0 = _mm_add_epi32(tmp0, rounding); \
+ tmp1 = _mm_add_epi32(tmp1, rounding); \
+ tmp2 = _mm_add_epi32(tmp2, rounding); \
+ tmp3 = _mm_add_epi32(tmp3, rounding); \
+ \
+ tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \
+ tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \
+ tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \
+ tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \
+ \
+ stp1_5 = _mm_packs_epi32(tmp0, tmp1); \
+ stp1_6 = _mm_packs_epi32(tmp2, tmp3); \
+ \
+ stp1_8 = _mm_add_epi16(stp1_8_0, stp1_11); \
+ stp1_9 = _mm_add_epi16(stp2_9, stp2_10); \
+ stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); \
+ stp1_11 = _mm_sub_epi16(stp1_8_0, stp1_11); \
+ \
+ stp1_12 = _mm_sub_epi16(stp1_15, stp1_12_0); \
+ stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); \
+ stp1_14 = _mm_add_epi16(stp2_14, stp2_13); \
+ stp1_15 = _mm_add_epi16(stp1_15, stp1_12_0); \
+ } \
+ \
+ /* Stage6 */ \
+ { \
+ const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \
+ const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \
+ const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); \
+ const __m128i hi_11_12 = _mm_unpackhi_epi16(stp1_11, stp1_12); \
+ \
+ stp2_0 = _mm_add_epi16(stp1_0, stp2_7); \
+ stp2_1 = _mm_add_epi16(stp1_1, stp1_6); \
+ stp2_2 = _mm_add_epi16(stp1_2, stp1_5); \
+ stp2_3 = _mm_add_epi16(stp1_3, stp2_4); \
+ stp2_4 = _mm_sub_epi16(stp1_3, stp2_4); \
+ stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); \
+ stp2_6 = _mm_sub_epi16(stp1_1, stp1_6); \
+ stp2_7 = _mm_sub_epi16(stp1_0, stp2_7); \
+ \
+ MULTIPLICATION_AND_ADD(lo_10_13, hi_10_13, lo_11_12, hi_11_12, \
+ stg6_0, stg4_0, stg6_0, stg4_0, \
+ stp2_10, stp2_13, stp2_11, stp2_12) \
+ }
+
void vp9_idct16x16_256_add_sse2(const int16_t *input, uint8_t *dest,
int stride) {
const __m128i rounding = _mm_set1_epi32(DCT_CONST_ROUNDING);
@@ -1266,16 +1403,7 @@ void vp9_idct16x16_256_add_sse2(const int16_t *input, uint8_t *dest,
const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64);
- __m128i in0 = zero, in1 = zero, in2 = zero, in3 = zero, in4 = zero,
- in5 = zero, in6 = zero, in7 = zero, in8 = zero, in9 = zero,
- in10 = zero, in11 = zero, in12 = zero, in13 = zero,
- in14 = zero, in15 = zero;
- __m128i l0 = zero, l1 = zero, l2 = zero, l3 = zero, l4 = zero, l5 = zero,
- l6 = zero, l7 = zero, l8 = zero, l9 = zero, l10 = zero, l11 = zero,
- l12 = zero, l13 = zero, l14 = zero, l15 = zero;
- __m128i r0 = zero, r1 = zero, r2 = zero, r3 = zero, r4 = zero, r5 = zero,
- r6 = zero, r7 = zero, r8 = zero, r9 = zero, r10 = zero, r11 = zero,
- r12 = zero, r13 = zero, r14 = zero, r15 = zero;
+ __m128i in[16], l[16], r[16], *curr1;
__m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7,
stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15,
stp1_8_0, stp1_12_0;
@@ -1284,162 +1412,132 @@ void vp9_idct16x16_256_add_sse2(const int16_t *input, uint8_t *dest,
__m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int i;
- // We work on a 8x16 block each time, and loop 4 times for 2-D 16x16 idct.
- for (i = 0; i < 4; i++) {
- // 1-D idct
- if (i < 2) {
- if (i == 1) input += 128;
+ curr1 = l;
+ for (i = 0; i < 2; i++) {
+ // 1-D idct
// Load input data.
- in0 = _mm_load_si128((const __m128i *)input);
- in8 = _mm_load_si128((const __m128i *)(input + 8 * 1));
- in1 = _mm_load_si128((const __m128i *)(input + 8 * 2));
- in9 = _mm_load_si128((const __m128i *)(input + 8 * 3));
- in2 = _mm_load_si128((const __m128i *)(input + 8 * 4));
- in10 = _mm_load_si128((const __m128i *)(input + 8 * 5));
- in3 = _mm_load_si128((const __m128i *)(input + 8 * 6));
- in11 = _mm_load_si128((const __m128i *)(input + 8 * 7));
- in4 = _mm_load_si128((const __m128i *)(input + 8 * 8));
- in12 = _mm_load_si128((const __m128i *)(input + 8 * 9));
- in5 = _mm_load_si128((const __m128i *)(input + 8 * 10));
- in13 = _mm_load_si128((const __m128i *)(input + 8 * 11));
- in6 = _mm_load_si128((const __m128i *)(input + 8 * 12));
- in14 = _mm_load_si128((const __m128i *)(input + 8 * 13));
- in7 = _mm_load_si128((const __m128i *)(input + 8 * 14));
- in15 = _mm_load_si128((const __m128i *)(input + 8 * 15));
-
- TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
- in4, in5, in6, in7);
- TRANSPOSE_8X8(in8, in9, in10, in11, in12, in13, in14, in15, in8, in9,
- in10, in11, in12, in13, in14, in15);
- }
-
- if (i == 2) {
- TRANSPOSE_8X8(l0, l1, l2, l3, l4, l5, l6, l7, in0, in1, in2, in3, in4,
- in5, in6, in7);
- TRANSPOSE_8X8(r0, r1, r2, r3, r4, r5, r6, r7, in8, in9, in10, in11, in12,
- in13, in14, in15);
- }
-
- if (i == 3) {
- TRANSPOSE_8X8(l8, l9, l10, l11, l12, l13, l14, l15, in0, in1, in2, in3,
- in4, in5, in6, in7);
- TRANSPOSE_8X8(r8, r9, r10, r11, r12, r13, r14, r15, in8, in9, in10, in11,
- in12, in13, in14, in15);
- }
+ in[0] = _mm_load_si128((const __m128i *)input);
+ in[8] = _mm_load_si128((const __m128i *)(input + 8 * 1));
+ in[1] = _mm_load_si128((const __m128i *)(input + 8 * 2));
+ in[9] = _mm_load_si128((const __m128i *)(input + 8 * 3));
+ in[2] = _mm_load_si128((const __m128i *)(input + 8 * 4));
+ in[10] = _mm_load_si128((const __m128i *)(input + 8 * 5));
+ in[3] = _mm_load_si128((const __m128i *)(input + 8 * 6));
+ in[11] = _mm_load_si128((const __m128i *)(input + 8 * 7));
+ in[4] = _mm_load_si128((const __m128i *)(input + 8 * 8));
+ in[12] = _mm_load_si128((const __m128i *)(input + 8 * 9));
+ in[5] = _mm_load_si128((const __m128i *)(input + 8 * 10));
+ in[13] = _mm_load_si128((const __m128i *)(input + 8 * 11));
+ in[6] = _mm_load_si128((const __m128i *)(input + 8 * 12));
+ in[14] = _mm_load_si128((const __m128i *)(input + 8 * 13));
+ in[7] = _mm_load_si128((const __m128i *)(input + 8 * 14));
+ in[15] = _mm_load_si128((const __m128i *)(input + 8 * 15));
+
+ array_transpose_8x8(in, in);
+ array_transpose_8x8(in+8, in+8);
+
+ IDCT16
+
+ // Stage7
+ curr1[0] = _mm_add_epi16(stp2_0, stp1_15);
+ curr1[1] = _mm_add_epi16(stp2_1, stp1_14);
+ curr1[2] = _mm_add_epi16(stp2_2, stp2_13);
+ curr1[3] = _mm_add_epi16(stp2_3, stp2_12);
+ curr1[4] = _mm_add_epi16(stp2_4, stp2_11);
+ curr1[5] = _mm_add_epi16(stp2_5, stp2_10);
+ curr1[6] = _mm_add_epi16(stp2_6, stp1_9);
+ curr1[7] = _mm_add_epi16(stp2_7, stp1_8);
+ curr1[8] = _mm_sub_epi16(stp2_7, stp1_8);
+ curr1[9] = _mm_sub_epi16(stp2_6, stp1_9);
+ curr1[10] = _mm_sub_epi16(stp2_5, stp2_10);
+ curr1[11] = _mm_sub_epi16(stp2_4, stp2_11);
+ curr1[12] = _mm_sub_epi16(stp2_3, stp2_12);
+ curr1[13] = _mm_sub_epi16(stp2_2, stp2_13);
+ curr1[14] = _mm_sub_epi16(stp2_1, stp1_14);
+ curr1[15] = _mm_sub_epi16(stp2_0, stp1_15);
+
+ curr1 = r;
+ input += 128;
+ }
+ for (i = 0; i < 2; i++) {
+ // 1-D idct
+ array_transpose_8x8(l+i*8, in);
+ array_transpose_8x8(r+i*8, in+8);
- IDCT16_1D
+ IDCT16
- // Stage7
- if (i == 0) {
- // Left 8x16
- l0 = _mm_add_epi16(stp2_0, stp1_15);
- l1 = _mm_add_epi16(stp2_1, stp1_14);
- l2 = _mm_add_epi16(stp2_2, stp2_13);
- l3 = _mm_add_epi16(stp2_3, stp2_12);
- l4 = _mm_add_epi16(stp2_4, stp2_11);
- l5 = _mm_add_epi16(stp2_5, stp2_10);
- l6 = _mm_add_epi16(stp2_6, stp1_9);
- l7 = _mm_add_epi16(stp2_7, stp1_8);
- l8 = _mm_sub_epi16(stp2_7, stp1_8);
- l9 = _mm_sub_epi16(stp2_6, stp1_9);
- l10 = _mm_sub_epi16(stp2_5, stp2_10);
- l11 = _mm_sub_epi16(stp2_4, stp2_11);
- l12 = _mm_sub_epi16(stp2_3, stp2_12);
- l13 = _mm_sub_epi16(stp2_2, stp2_13);
- l14 = _mm_sub_epi16(stp2_1, stp1_14);
- l15 = _mm_sub_epi16(stp2_0, stp1_15);
- } else if (i == 1) {
- // Right 8x16
- r0 = _mm_add_epi16(stp2_0, stp1_15);
- r1 = _mm_add_epi16(stp2_1, stp1_14);
- r2 = _mm_add_epi16(stp2_2, stp2_13);
- r3 = _mm_add_epi16(stp2_3, stp2_12);
- r4 = _mm_add_epi16(stp2_4, stp2_11);
- r5 = _mm_add_epi16(stp2_5, stp2_10);
- r6 = _mm_add_epi16(stp2_6, stp1_9);
- r7 = _mm_add_epi16(stp2_7, stp1_8);
- r8 = _mm_sub_epi16(stp2_7, stp1_8);
- r9 = _mm_sub_epi16(stp2_6, stp1_9);
- r10 = _mm_sub_epi16(stp2_5, stp2_10);
- r11 = _mm_sub_epi16(stp2_4, stp2_11);
- r12 = _mm_sub_epi16(stp2_3, stp2_12);
- r13 = _mm_sub_epi16(stp2_2, stp2_13);
- r14 = _mm_sub_epi16(stp2_1, stp1_14);
- r15 = _mm_sub_epi16(stp2_0, stp1_15);
- } else {
// 2-D
- in0 = _mm_add_epi16(stp2_0, stp1_15);
- in1 = _mm_add_epi16(stp2_1, stp1_14);
- in2 = _mm_add_epi16(stp2_2, stp2_13);
- in3 = _mm_add_epi16(stp2_3, stp2_12);
- in4 = _mm_add_epi16(stp2_4, stp2_11);
- in5 = _mm_add_epi16(stp2_5, stp2_10);
- in6 = _mm_add_epi16(stp2_6, stp1_9);
- in7 = _mm_add_epi16(stp2_7, stp1_8);
- in8 = _mm_sub_epi16(stp2_7, stp1_8);
- in9 = _mm_sub_epi16(stp2_6, stp1_9);
- in10 = _mm_sub_epi16(stp2_5, stp2_10);
- in11 = _mm_sub_epi16(stp2_4, stp2_11);
- in12 = _mm_sub_epi16(stp2_3, stp2_12);
- in13 = _mm_sub_epi16(stp2_2, stp2_13);
- in14 = _mm_sub_epi16(stp2_1, stp1_14);
- in15 = _mm_sub_epi16(stp2_0, stp1_15);
+ in[0] = _mm_add_epi16(stp2_0, stp1_15);
+ in[1] = _mm_add_epi16(stp2_1, stp1_14);
+ in[2] = _mm_add_epi16(stp2_2, stp2_13);
+ in[3] = _mm_add_epi16(stp2_3, stp2_12);
+ in[4] = _mm_add_epi16(stp2_4, stp2_11);
+ in[5] = _mm_add_epi16(stp2_5, stp2_10);
+ in[6] = _mm_add_epi16(stp2_6, stp1_9);
+ in[7] = _mm_add_epi16(stp2_7, stp1_8);
+ in[8] = _mm_sub_epi16(stp2_7, stp1_8);
+ in[9] = _mm_sub_epi16(stp2_6, stp1_9);
+ in[10] = _mm_sub_epi16(stp2_5, stp2_10);
+ in[11] = _mm_sub_epi16(stp2_4, stp2_11);
+ in[12] = _mm_sub_epi16(stp2_3, stp2_12);
+ in[13] = _mm_sub_epi16(stp2_2, stp2_13);
+ in[14] = _mm_sub_epi16(stp2_1, stp1_14);
+ in[15] = _mm_sub_epi16(stp2_0, stp1_15);
// Final rounding and shift
- in0 = _mm_adds_epi16(in0, final_rounding);
- in1 = _mm_adds_epi16(in1, final_rounding);
- in2 = _mm_adds_epi16(in2, final_rounding);
- in3 = _mm_adds_epi16(in3, final_rounding);
- in4 = _mm_adds_epi16(in4, final_rounding);
- in5 = _mm_adds_epi16(in5, final_rounding);
- in6 = _mm_adds_epi16(in6, final_rounding);
- in7 = _mm_adds_epi16(in7, final_rounding);
- in8 = _mm_adds_epi16(in8, final_rounding);
- in9 = _mm_adds_epi16(in9, final_rounding);
- in10 = _mm_adds_epi16(in10, final_rounding);
- in11 = _mm_adds_epi16(in11, final_rounding);
- in12 = _mm_adds_epi16(in12, final_rounding);
- in13 = _mm_adds_epi16(in13, final_rounding);
- in14 = _mm_adds_epi16(in14, final_rounding);
- in15 = _mm_adds_epi16(in15, final_rounding);
-
- in0 = _mm_srai_epi16(in0, 6);
- in1 = _mm_srai_epi16(in1, 6);
- in2 = _mm_srai_epi16(in2, 6);
- in3 = _mm_srai_epi16(in3, 6);
- in4 = _mm_srai_epi16(in4, 6);
- in5 = _mm_srai_epi16(in5, 6);
- in6 = _mm_srai_epi16(in6, 6);
- in7 = _mm_srai_epi16(in7, 6);
- in8 = _mm_srai_epi16(in8, 6);
- in9 = _mm_srai_epi16(in9, 6);
- in10 = _mm_srai_epi16(in10, 6);
- in11 = _mm_srai_epi16(in11, 6);
- in12 = _mm_srai_epi16(in12, 6);
- in13 = _mm_srai_epi16(in13, 6);
- in14 = _mm_srai_epi16(in14, 6);
- in15 = _mm_srai_epi16(in15, 6);
-
- RECON_AND_STORE(dest, in0);
- RECON_AND_STORE(dest, in1);
- RECON_AND_STORE(dest, in2);
- RECON_AND_STORE(dest, in3);
- RECON_AND_STORE(dest, in4);
- RECON_AND_STORE(dest, in5);
- RECON_AND_STORE(dest, in6);
- RECON_AND_STORE(dest, in7);
- RECON_AND_STORE(dest, in8);
- RECON_AND_STORE(dest, in9);
- RECON_AND_STORE(dest, in10);
- RECON_AND_STORE(dest, in11);
- RECON_AND_STORE(dest, in12);
- RECON_AND_STORE(dest, in13);
- RECON_AND_STORE(dest, in14);
- RECON_AND_STORE(dest, in15);
+ in[0] = _mm_adds_epi16(in[0], final_rounding);
+ in[1] = _mm_adds_epi16(in[1], final_rounding);
+ in[2] = _mm_adds_epi16(in[2], final_rounding);
+ in[3] = _mm_adds_epi16(in[3], final_rounding);
+ in[4] = _mm_adds_epi16(in[4], final_rounding);
+ in[5] = _mm_adds_epi16(in[5], final_rounding);
+ in[6] = _mm_adds_epi16(in[6], final_rounding);
+ in[7] = _mm_adds_epi16(in[7], final_rounding);
+ in[8] = _mm_adds_epi16(in[8], final_rounding);
+ in[9] = _mm_adds_epi16(in[9], final_rounding);
+ in[10] = _mm_adds_epi16(in[10], final_rounding);
+ in[11] = _mm_adds_epi16(in[11], final_rounding);
+ in[12] = _mm_adds_epi16(in[12], final_rounding);
+ in[13] = _mm_adds_epi16(in[13], final_rounding);
+ in[14] = _mm_adds_epi16(in[14], final_rounding);
+ in[15] = _mm_adds_epi16(in[15], final_rounding);
+
+ in[0] = _mm_srai_epi16(in[0], 6);
+ in[1] = _mm_srai_epi16(in[1], 6);
+ in[2] = _mm_srai_epi16(in[2], 6);
+ in[3] = _mm_srai_epi16(in[3], 6);
+ in[4] = _mm_srai_epi16(in[4], 6);
+ in[5] = _mm_srai_epi16(in[5], 6);
+ in[6] = _mm_srai_epi16(in[6], 6);
+ in[7] = _mm_srai_epi16(in[7], 6);
+ in[8] = _mm_srai_epi16(in[8], 6);
+ in[9] = _mm_srai_epi16(in[9], 6);
+ in[10] = _mm_srai_epi16(in[10], 6);
+ in[11] = _mm_srai_epi16(in[11], 6);
+ in[12] = _mm_srai_epi16(in[12], 6);
+ in[13] = _mm_srai_epi16(in[13], 6);
+ in[14] = _mm_srai_epi16(in[14], 6);
+ in[15] = _mm_srai_epi16(in[15], 6);
+
+ RECON_AND_STORE(dest, in[0]);
+ RECON_AND_STORE(dest, in[1]);
+ RECON_AND_STORE(dest, in[2]);
+ RECON_AND_STORE(dest, in[3]);
+ RECON_AND_STORE(dest, in[4]);
+ RECON_AND_STORE(dest, in[5]);
+ RECON_AND_STORE(dest, in[6]);
+ RECON_AND_STORE(dest, in[7]);
+ RECON_AND_STORE(dest, in[8]);
+ RECON_AND_STORE(dest, in[9]);
+ RECON_AND_STORE(dest, in[10]);
+ RECON_AND_STORE(dest, in[11]);
+ RECON_AND_STORE(dest, in[12]);
+ RECON_AND_STORE(dest, in[13]);
+ RECON_AND_STORE(dest, in[14]);
+ RECON_AND_STORE(dest, in[15]);
dest += 8 - (stride * 16);
- }
}
}
@@ -1492,7 +1590,7 @@ static INLINE void array_transpose_16x16(__m128i *res0, __m128i *res1) {
res0[15] = tbuf[7];
}
-static void iadst16_1d_8col(__m128i *in) {
+static void iadst16_8col(__m128i *in) {
// perform 16x16 1-D ADST for 8 columns
__m128i s[16], x[16], u[32], v[32];
const __m128i k__cospi_p01_p31 = pair_set_epi16(cospi_1_64, cospi_31_64);
@@ -1962,7 +2060,7 @@ static void iadst16_1d_8col(__m128i *in) {
in[15] = _mm_sub_epi16(kZero, s[1]);
}
-static void idct16_1d_8col(__m128i *in) {
+static void idct16_8col(__m128i *in) {
const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64);
const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64);
const __m128i k__cospi_p14_m18 = pair_set_epi16(cospi_14_64, -cospi_18_64);
@@ -2306,16 +2404,16 @@ static void idct16_1d_8col(__m128i *in) {
in[15] = _mm_sub_epi16(s[0], s[15]);
}
-static void idct16_1d_sse2(__m128i *in0, __m128i *in1) {
+static void idct16_sse2(__m128i *in0, __m128i *in1) {
array_transpose_16x16(in0, in1);
- idct16_1d_8col(in0);
- idct16_1d_8col(in1);
+ idct16_8col(in0);
+ idct16_8col(in1);
}
-static void iadst16_1d_sse2(__m128i *in0, __m128i *in1) {
+static void iadst16_sse2(__m128i *in0, __m128i *in1) {
array_transpose_16x16(in0, in1);
- iadst16_1d_8col(in0);
- iadst16_1d_8col(in1);
+ iadst16_8col(in0);
+ iadst16_8col(in1);
}
static INLINE void load_buffer_8x16(const int16_t *input, __m128i *in) {
@@ -2404,20 +2502,20 @@ void vp9_iht16x16_256_add_sse2(const int16_t *input, uint8_t *dest, int stride,
switch (tx_type) {
case 0: // DCT_DCT
- idct16_1d_sse2(in0, in1);
- idct16_1d_sse2(in0, in1);
+ idct16_sse2(in0, in1);
+ idct16_sse2(in0, in1);
break;
case 1: // ADST_DCT
- idct16_1d_sse2(in0, in1);
- iadst16_1d_sse2(in0, in1);
+ idct16_sse2(in0, in1);
+ iadst16_sse2(in0, in1);
break;
case 2: // DCT_ADST
- iadst16_1d_sse2(in0, in1);
- idct16_1d_sse2(in0, in1);
+ iadst16_sse2(in0, in1);
+ idct16_sse2(in0, in1);
break;
case 3: // ADST_ADST
- iadst16_1d_sse2(in0, in1);
- iadst16_1d_sse2(in0, in1);
+ iadst16_sse2(in0, in1);
+ iadst16_sse2(in0, in1);
break;
default:
assert(0);
@@ -2437,149 +2535,87 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
const __m128i stg2_0 = pair_set_epi16(cospi_30_64, -cospi_2_64);
const __m128i stg2_1 = pair_set_epi16(cospi_2_64, cospi_30_64);
- const __m128i stg2_2 = pair_set_epi16(cospi_14_64, -cospi_18_64);
- const __m128i stg2_3 = pair_set_epi16(cospi_18_64, cospi_14_64);
- const __m128i stg2_4 = pair_set_epi16(cospi_22_64, -cospi_10_64);
- const __m128i stg2_5 = pair_set_epi16(cospi_10_64, cospi_22_64);
const __m128i stg2_6 = pair_set_epi16(cospi_6_64, -cospi_26_64);
const __m128i stg2_7 = pair_set_epi16(cospi_26_64, cospi_6_64);
const __m128i stg3_0 = pair_set_epi16(cospi_28_64, -cospi_4_64);
const __m128i stg3_1 = pair_set_epi16(cospi_4_64, cospi_28_64);
- const __m128i stg3_2 = pair_set_epi16(cospi_12_64, -cospi_20_64);
- const __m128i stg3_3 = pair_set_epi16(cospi_20_64, cospi_12_64);
const __m128i stg4_0 = pair_set_epi16(cospi_16_64, cospi_16_64);
const __m128i stg4_1 = pair_set_epi16(cospi_16_64, -cospi_16_64);
- const __m128i stg4_2 = pair_set_epi16(cospi_24_64, -cospi_8_64);
- const __m128i stg4_3 = pair_set_epi16(cospi_8_64, cospi_24_64);
const __m128i stg4_4 = pair_set_epi16(-cospi_8_64, cospi_24_64);
const __m128i stg4_5 = pair_set_epi16(cospi_24_64, cospi_8_64);
const __m128i stg4_6 = pair_set_epi16(-cospi_24_64, -cospi_8_64);
const __m128i stg4_7 = pair_set_epi16(-cospi_8_64, cospi_24_64);
const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64);
-
- __m128i in0 = zero, in1 = zero, in2 = zero, in3 = zero, in4 = zero,
- in5 = zero, in6 = zero, in7 = zero, in8 = zero, in9 = zero,
- in10 = zero, in11 = zero, in12 = zero, in13 = zero,
- in14 = zero, in15 = zero;
- __m128i l0 = zero, l1 = zero, l2 = zero, l3 = zero, l4 = zero, l5 = zero,
- l6 = zero, l7 = zero, l8 = zero, l9 = zero, l10 = zero, l11 = zero,
- l12 = zero, l13 = zero, l14 = zero, l15 = zero;
-
- __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7,
+ __m128i in[16], l[16];
+ __m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6,
stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15,
stp1_8_0, stp1_12_0;
__m128i stp2_0, stp2_1, stp2_2, stp2_3, stp2_4, stp2_5, stp2_6, stp2_7,
- stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14, stp2_15;
+ stp2_8, stp2_9, stp2_10, stp2_11, stp2_12, stp2_13, stp2_14;
__m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int i;
- // 1-D idct. Load input data.
- in0 = _mm_load_si128((const __m128i *)input);
- in8 = _mm_load_si128((const __m128i *)(input + 8 * 1));
- in1 = _mm_load_si128((const __m128i *)(input + 8 * 2));
- in9 = _mm_load_si128((const __m128i *)(input + 8 * 3));
- in2 = _mm_load_si128((const __m128i *)(input + 8 * 4));
- in10 = _mm_load_si128((const __m128i *)(input + 8 * 5));
- in3 = _mm_load_si128((const __m128i *)(input + 8 * 6));
- in11 = _mm_load_si128((const __m128i *)(input + 8 * 7));
+ // First 1-D inverse DCT
+ // Load input data.
+ in[0] = _mm_load_si128((const __m128i *)input);
+ in[1] = _mm_load_si128((const __m128i *)(input + 8 * 2));
+ in[2] = _mm_load_si128((const __m128i *)(input + 8 * 4));
+ in[3] = _mm_load_si128((const __m128i *)(input + 8 * 6));
- TRANSPOSE_8X4(in0, in1, in2, in3, in0, in1, in2, in3);
- TRANSPOSE_8X4(in8, in9, in10, in11, in8, in9, in10, in11);
+ TRANSPOSE_8X4(in[0], in[1], in[2], in[3], in[0], in[1]);
// Stage2
{
- const __m128i lo_1_15 = _mm_unpackhi_epi16(in0, in11);
- const __m128i lo_9_7 = _mm_unpackhi_epi16(in8, in3);
- const __m128i lo_5_11 = _mm_unpackhi_epi16(in2, in9);
- const __m128i lo_13_3 = _mm_unpackhi_epi16(in10, in1);
+ const __m128i lo_1_15 = _mm_unpackhi_epi16(in[0], zero);
+ const __m128i lo_13_3 = _mm_unpackhi_epi16(zero, in[1]);
tmp0 = _mm_madd_epi16(lo_1_15, stg2_0);
tmp2 = _mm_madd_epi16(lo_1_15, stg2_1);
- tmp4 = _mm_madd_epi16(lo_9_7, stg2_2);
- tmp6 = _mm_madd_epi16(lo_9_7, stg2_3);
- tmp1 = _mm_madd_epi16(lo_5_11, stg2_4);
- tmp3 = _mm_madd_epi16(lo_5_11, stg2_5);
tmp5 = _mm_madd_epi16(lo_13_3, stg2_6);
tmp7 = _mm_madd_epi16(lo_13_3, stg2_7);
tmp0 = _mm_add_epi32(tmp0, rounding);
tmp2 = _mm_add_epi32(tmp2, rounding);
- tmp4 = _mm_add_epi32(tmp4, rounding);
- tmp6 = _mm_add_epi32(tmp6, rounding);
- tmp1 = _mm_add_epi32(tmp1, rounding);
- tmp3 = _mm_add_epi32(tmp3, rounding);
tmp5 = _mm_add_epi32(tmp5, rounding);
tmp7 = _mm_add_epi32(tmp7, rounding);
tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS);
tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS);
- tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS);
- tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS);
- tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS);
- tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS);
tmp5 = _mm_srai_epi32(tmp5, DCT_CONST_BITS);
tmp7 = _mm_srai_epi32(tmp7, DCT_CONST_BITS);
- stp2_8 = _mm_packs_epi32(tmp0, zero);
- stp2_15 = _mm_packs_epi32(tmp2, zero);
- stp2_9 = _mm_packs_epi32(tmp4, zero);
- stp2_14 = _mm_packs_epi32(tmp6, zero);
-
- stp2_10 = _mm_packs_epi32(tmp1, zero);
- stp2_13 = _mm_packs_epi32(tmp3, zero);
- stp2_11 = _mm_packs_epi32(tmp5, zero);
- stp2_12 = _mm_packs_epi32(tmp7, zero);
+ stp2_8 = _mm_packs_epi32(tmp0, tmp2);
+ stp2_11 = _mm_packs_epi32(tmp5, tmp7);
}
// Stage3
{
- const __m128i lo_2_14 = _mm_unpacklo_epi16(in1, in11);
- const __m128i lo_10_6 = _mm_unpacklo_epi16(in9, in3);
+ const __m128i lo_2_14 = _mm_unpacklo_epi16(in[1], zero);
tmp0 = _mm_madd_epi16(lo_2_14, stg3_0);
tmp2 = _mm_madd_epi16(lo_2_14, stg3_1);
- tmp4 = _mm_madd_epi16(lo_10_6, stg3_2);
- tmp6 = _mm_madd_epi16(lo_10_6, stg3_3);
tmp0 = _mm_add_epi32(tmp0, rounding);
tmp2 = _mm_add_epi32(tmp2, rounding);
- tmp4 = _mm_add_epi32(tmp4, rounding);
- tmp6 = _mm_add_epi32(tmp6, rounding);
-
tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS);
tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS);
- tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS);
- tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS);
-
- stp1_4 = _mm_packs_epi32(tmp0, zero);
- stp1_7 = _mm_packs_epi32(tmp2, zero);
- stp1_5 = _mm_packs_epi32(tmp4, zero);
- stp1_6 = _mm_packs_epi32(tmp6, zero);
- stp1_8_0 = _mm_add_epi16(stp2_8, stp2_9);
- stp1_9 = _mm_sub_epi16(stp2_8, stp2_9);
- stp1_10 = _mm_sub_epi16(stp2_11, stp2_10);
- stp1_11 = _mm_add_epi16(stp2_11, stp2_10);
+ stp1_13 = _mm_unpackhi_epi64(stp2_11, zero);
+ stp1_14 = _mm_unpackhi_epi64(stp2_8, zero);
- stp1_12_0 = _mm_add_epi16(stp2_12, stp2_13);
- stp1_13 = _mm_sub_epi16(stp2_12, stp2_13);
- stp1_14 = _mm_sub_epi16(stp2_15, stp2_14);
- stp1_15 = _mm_add_epi16(stp2_15, stp2_14);
+ stp1_4 = _mm_packs_epi32(tmp0, tmp2);
}
// Stage4
{
- const __m128i lo_0_8 = _mm_unpacklo_epi16(in0, in8);
- const __m128i lo_4_12 = _mm_unpacklo_epi16(in2, in10);
- const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14);
- const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13);
+ const __m128i lo_0_8 = _mm_unpacklo_epi16(in[0], zero);
+ const __m128i lo_9_14 = _mm_unpacklo_epi16(stp2_8, stp1_14);
+ const __m128i lo_10_13 = _mm_unpacklo_epi16(stp2_11, stp1_13);
tmp0 = _mm_madd_epi16(lo_0_8, stg4_0);
tmp2 = _mm_madd_epi16(lo_0_8, stg4_1);
- tmp4 = _mm_madd_epi16(lo_4_12, stg4_2);
- tmp6 = _mm_madd_epi16(lo_4_12, stg4_3);
tmp1 = _mm_madd_epi16(lo_9_14, stg4_4);
tmp3 = _mm_madd_epi16(lo_9_14, stg4_5);
tmp5 = _mm_madd_epi16(lo_10_13, stg4_6);
@@ -2587,8 +2623,6 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
tmp0 = _mm_add_epi32(tmp0, rounding);
tmp2 = _mm_add_epi32(tmp2, rounding);
- tmp4 = _mm_add_epi32(tmp4, rounding);
- tmp6 = _mm_add_epi32(tmp6, rounding);
tmp1 = _mm_add_epi32(tmp1, rounding);
tmp3 = _mm_add_epi32(tmp3, rounding);
tmp5 = _mm_add_epi32(tmp5, rounding);
@@ -2596,49 +2630,40 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS);
tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS);
- tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS);
- tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS);
tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS);
tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS);
tmp5 = _mm_srai_epi32(tmp5, DCT_CONST_BITS);
tmp7 = _mm_srai_epi32(tmp7, DCT_CONST_BITS);
- stp2_0 = _mm_packs_epi32(tmp0, zero);
- stp2_1 = _mm_packs_epi32(tmp2, zero);
- stp2_2 = _mm_packs_epi32(tmp4, zero);
- stp2_3 = _mm_packs_epi32(tmp6, zero);
- stp2_9 = _mm_packs_epi32(tmp1, zero);
- stp2_14 = _mm_packs_epi32(tmp3, zero);
- stp2_10 = _mm_packs_epi32(tmp5, zero);
- stp2_13 = _mm_packs_epi32(tmp7, zero);
-
- stp2_4 = _mm_add_epi16(stp1_4, stp1_5);
- stp2_5 = _mm_sub_epi16(stp1_4, stp1_5);
- stp2_6 = _mm_sub_epi16(stp1_7, stp1_6);
- stp2_7 = _mm_add_epi16(stp1_7, stp1_6);
+ stp1_0 = _mm_packs_epi32(tmp0, tmp0);
+ stp1_1 = _mm_packs_epi32(tmp2, tmp2);
+ stp2_9 = _mm_packs_epi32(tmp1, tmp3);
+ stp2_10 = _mm_packs_epi32(tmp5, tmp7);
+
+ stp2_6 = _mm_unpackhi_epi64(stp1_4, zero);
}
// Stage5 and Stage6
{
- stp1_0 = _mm_add_epi16(stp2_0, stp2_3);
- stp1_1 = _mm_add_epi16(stp2_1, stp2_2);
- stp1_2 = _mm_sub_epi16(stp2_1, stp2_2);
- stp1_3 = _mm_sub_epi16(stp2_0, stp2_3);
-
- stp1_8 = _mm_add_epi16(stp1_8_0, stp1_11);
- stp1_9 = _mm_add_epi16(stp2_9, stp2_10);
- stp1_10 = _mm_sub_epi16(stp2_9, stp2_10);
- stp1_11 = _mm_sub_epi16(stp1_8_0, stp1_11);
-
- stp1_12 = _mm_sub_epi16(stp1_15, stp1_12_0);
- stp1_13 = _mm_sub_epi16(stp2_14, stp2_13);
- stp1_14 = _mm_add_epi16(stp2_14, stp2_13);
- stp1_15 = _mm_add_epi16(stp1_15, stp1_12_0);
+ tmp0 = _mm_add_epi16(stp2_8, stp2_11);
+ tmp1 = _mm_sub_epi16(stp2_8, stp2_11);
+ tmp2 = _mm_add_epi16(stp2_9, stp2_10);
+ tmp3 = _mm_sub_epi16(stp2_9, stp2_10);
+
+ stp1_9 = _mm_unpacklo_epi64(tmp2, zero);
+ stp1_10 = _mm_unpacklo_epi64(tmp3, zero);
+ stp1_8 = _mm_unpacklo_epi64(tmp0, zero);
+ stp1_11 = _mm_unpacklo_epi64(tmp1, zero);
+
+ stp1_13 = _mm_unpackhi_epi64(tmp3, zero);
+ stp1_14 = _mm_unpackhi_epi64(tmp2, zero);
+ stp1_12 = _mm_unpackhi_epi64(tmp1, zero);
+ stp1_15 = _mm_unpackhi_epi64(tmp0, zero);
}
// Stage6
{
- const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5);
+ const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp1_4);
const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13);
const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12);
@@ -2663,124 +2688,121 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
tmp4 = _mm_srai_epi32(tmp4, DCT_CONST_BITS);
tmp6 = _mm_srai_epi32(tmp6, DCT_CONST_BITS);
- stp1_5 = _mm_packs_epi32(tmp1, zero);
- stp1_6 = _mm_packs_epi32(tmp3, zero);
+ stp1_6 = _mm_packs_epi32(tmp3, tmp1);
+
stp2_10 = _mm_packs_epi32(tmp0, zero);
stp2_13 = _mm_packs_epi32(tmp2, zero);
stp2_11 = _mm_packs_epi32(tmp4, zero);
stp2_12 = _mm_packs_epi32(tmp6, zero);
- stp2_0 = _mm_add_epi16(stp1_0, stp2_7);
- stp2_1 = _mm_add_epi16(stp1_1, stp1_6);
- stp2_2 = _mm_add_epi16(stp1_2, stp1_5);
- stp2_3 = _mm_add_epi16(stp1_3, stp2_4);
- stp2_4 = _mm_sub_epi16(stp1_3, stp2_4);
- stp2_5 = _mm_sub_epi16(stp1_2, stp1_5);
- stp2_6 = _mm_sub_epi16(stp1_1, stp1_6);
- stp2_7 = _mm_sub_epi16(stp1_0, stp2_7);
+ tmp0 = _mm_add_epi16(stp1_0, stp1_4);
+ tmp1 = _mm_sub_epi16(stp1_0, stp1_4);
+ tmp2 = _mm_add_epi16(stp1_1, stp1_6);
+ tmp3 = _mm_sub_epi16(stp1_1, stp1_6);
+
+ stp2_0 = _mm_unpackhi_epi64(tmp0, zero);
+ stp2_1 = _mm_unpacklo_epi64(tmp2, zero);
+ stp2_2 = _mm_unpackhi_epi64(tmp2, zero);
+ stp2_3 = _mm_unpacklo_epi64(tmp0, zero);
+ stp2_4 = _mm_unpacklo_epi64(tmp1, zero);
+ stp2_5 = _mm_unpackhi_epi64(tmp3, zero);
+ stp2_6 = _mm_unpacklo_epi64(tmp3, zero);
+ stp2_7 = _mm_unpackhi_epi64(tmp1, zero);
}
// Stage7. Left 8x16 only.
- l0 = _mm_add_epi16(stp2_0, stp1_15);
- l1 = _mm_add_epi16(stp2_1, stp1_14);
- l2 = _mm_add_epi16(stp2_2, stp2_13);
- l3 = _mm_add_epi16(stp2_3, stp2_12);
- l4 = _mm_add_epi16(stp2_4, stp2_11);
- l5 = _mm_add_epi16(stp2_5, stp2_10);
- l6 = _mm_add_epi16(stp2_6, stp1_9);
- l7 = _mm_add_epi16(stp2_7, stp1_8);
- l8 = _mm_sub_epi16(stp2_7, stp1_8);
- l9 = _mm_sub_epi16(stp2_6, stp1_9);
- l10 = _mm_sub_epi16(stp2_5, stp2_10);
- l11 = _mm_sub_epi16(stp2_4, stp2_11);
- l12 = _mm_sub_epi16(stp2_3, stp2_12);
- l13 = _mm_sub_epi16(stp2_2, stp2_13);
- l14 = _mm_sub_epi16(stp2_1, stp1_14);
- l15 = _mm_sub_epi16(stp2_0, stp1_15);
-
- // 2-D idct. We do 2 8x16 blocks.
+ l[0] = _mm_add_epi16(stp2_0, stp1_15);
+ l[1] = _mm_add_epi16(stp2_1, stp1_14);
+ l[2] = _mm_add_epi16(stp2_2, stp2_13);
+ l[3] = _mm_add_epi16(stp2_3, stp2_12);
+ l[4] = _mm_add_epi16(stp2_4, stp2_11);
+ l[5] = _mm_add_epi16(stp2_5, stp2_10);
+ l[6] = _mm_add_epi16(stp2_6, stp1_9);
+ l[7] = _mm_add_epi16(stp2_7, stp1_8);
+ l[8] = _mm_sub_epi16(stp2_7, stp1_8);
+ l[9] = _mm_sub_epi16(stp2_6, stp1_9);
+ l[10] = _mm_sub_epi16(stp2_5, stp2_10);
+ l[11] = _mm_sub_epi16(stp2_4, stp2_11);
+ l[12] = _mm_sub_epi16(stp2_3, stp2_12);
+ l[13] = _mm_sub_epi16(stp2_2, stp2_13);
+ l[14] = _mm_sub_epi16(stp2_1, stp1_14);
+ l[15] = _mm_sub_epi16(stp2_0, stp1_15);
+
+ // Second 1-D inverse transform, performed per 8x16 block
for (i = 0; i < 2; i++) {
- if (i == 0)
- TRANSPOSE_4X8(l0, l1, l2, l3, l4, l5, l6, l7, in0, in1, in2, in3, in4,
- in5, in6, in7);
-
- if (i == 1)
- TRANSPOSE_4X8(l8, l9, l10, l11, l12, l13, l14, l15, in0, in1, in2, in3,
- in4, in5, in6, in7);
-
- in8 = in9 = in10 = in11 = in12 = in13 = in14 = in15 = zero;
+ array_transpose_4X8(l + 8*i, in);
- IDCT16_1D
+ IDCT16_10
// Stage7
- in0 = _mm_add_epi16(stp2_0, stp1_15);
- in1 = _mm_add_epi16(stp2_1, stp1_14);
- in2 = _mm_add_epi16(stp2_2, stp2_13);
- in3 = _mm_add_epi16(stp2_3, stp2_12);
- in4 = _mm_add_epi16(stp2_4, stp2_11);
- in5 = _mm_add_epi16(stp2_5, stp2_10);
- in6 = _mm_add_epi16(stp2_6, stp1_9);
- in7 = _mm_add_epi16(stp2_7, stp1_8);
- in8 = _mm_sub_epi16(stp2_7, stp1_8);
- in9 = _mm_sub_epi16(stp2_6, stp1_9);
- in10 = _mm_sub_epi16(stp2_5, stp2_10);
- in11 = _mm_sub_epi16(stp2_4, stp2_11);
- in12 = _mm_sub_epi16(stp2_3, stp2_12);
- in13 = _mm_sub_epi16(stp2_2, stp2_13);
- in14 = _mm_sub_epi16(stp2_1, stp1_14);
- in15 = _mm_sub_epi16(stp2_0, stp1_15);
+ in[0] = _mm_add_epi16(stp2_0, stp1_15);
+ in[1] = _mm_add_epi16(stp2_1, stp1_14);
+ in[2] = _mm_add_epi16(stp2_2, stp2_13);
+ in[3] = _mm_add_epi16(stp2_3, stp2_12);
+ in[4] = _mm_add_epi16(stp2_4, stp2_11);
+ in[5] = _mm_add_epi16(stp2_5, stp2_10);
+ in[6] = _mm_add_epi16(stp2_6, stp1_9);
+ in[7] = _mm_add_epi16(stp2_7, stp1_8);
+ in[8] = _mm_sub_epi16(stp2_7, stp1_8);
+ in[9] = _mm_sub_epi16(stp2_6, stp1_9);
+ in[10] = _mm_sub_epi16(stp2_5, stp2_10);
+ in[11] = _mm_sub_epi16(stp2_4, stp2_11);
+ in[12] = _mm_sub_epi16(stp2_3, stp2_12);
+ in[13] = _mm_sub_epi16(stp2_2, stp2_13);
+ in[14] = _mm_sub_epi16(stp2_1, stp1_14);
+ in[15] = _mm_sub_epi16(stp2_0, stp1_15);
// Final rounding and shift
- in0 = _mm_adds_epi16(in0, final_rounding);
- in1 = _mm_adds_epi16(in1, final_rounding);
- in2 = _mm_adds_epi16(in2, final_rounding);
- in3 = _mm_adds_epi16(in3, final_rounding);
- in4 = _mm_adds_epi16(in4, final_rounding);
- in5 = _mm_adds_epi16(in5, final_rounding);
- in6 = _mm_adds_epi16(in6, final_rounding);
- in7 = _mm_adds_epi16(in7, final_rounding);
- in8 = _mm_adds_epi16(in8, final_rounding);
- in9 = _mm_adds_epi16(in9, final_rounding);
- in10 = _mm_adds_epi16(in10, final_rounding);
- in11 = _mm_adds_epi16(in11, final_rounding);
- in12 = _mm_adds_epi16(in12, final_rounding);
- in13 = _mm_adds_epi16(in13, final_rounding);
- in14 = _mm_adds_epi16(in14, final_rounding);
- in15 = _mm_adds_epi16(in15, final_rounding);
-
- in0 = _mm_srai_epi16(in0, 6);
- in1 = _mm_srai_epi16(in1, 6);
- in2 = _mm_srai_epi16(in2, 6);
- in3 = _mm_srai_epi16(in3, 6);
- in4 = _mm_srai_epi16(in4, 6);
- in5 = _mm_srai_epi16(in5, 6);
- in6 = _mm_srai_epi16(in6, 6);
- in7 = _mm_srai_epi16(in7, 6);
- in8 = _mm_srai_epi16(in8, 6);
- in9 = _mm_srai_epi16(in9, 6);
- in10 = _mm_srai_epi16(in10, 6);
- in11 = _mm_srai_epi16(in11, 6);
- in12 = _mm_srai_epi16(in12, 6);
- in13 = _mm_srai_epi16(in13, 6);
- in14 = _mm_srai_epi16(in14, 6);
- in15 = _mm_srai_epi16(in15, 6);
-
- RECON_AND_STORE(dest, in0);
- RECON_AND_STORE(dest, in1);
- RECON_AND_STORE(dest, in2);
- RECON_AND_STORE(dest, in3);
- RECON_AND_STORE(dest, in4);
- RECON_AND_STORE(dest, in5);
- RECON_AND_STORE(dest, in6);
- RECON_AND_STORE(dest, in7);
- RECON_AND_STORE(dest, in8);
- RECON_AND_STORE(dest, in9);
- RECON_AND_STORE(dest, in10);
- RECON_AND_STORE(dest, in11);
- RECON_AND_STORE(dest, in12);
- RECON_AND_STORE(dest, in13);
- RECON_AND_STORE(dest, in14);
- RECON_AND_STORE(dest, in15);
+ in[0] = _mm_adds_epi16(in[0], final_rounding);
+ in[1] = _mm_adds_epi16(in[1], final_rounding);
+ in[2] = _mm_adds_epi16(in[2], final_rounding);
+ in[3] = _mm_adds_epi16(in[3], final_rounding);
+ in[4] = _mm_adds_epi16(in[4], final_rounding);
+ in[5] = _mm_adds_epi16(in[5], final_rounding);
+ in[6] = _mm_adds_epi16(in[6], final_rounding);
+ in[7] = _mm_adds_epi16(in[7], final_rounding);
+ in[8] = _mm_adds_epi16(in[8], final_rounding);
+ in[9] = _mm_adds_epi16(in[9], final_rounding);
+ in[10] = _mm_adds_epi16(in[10], final_rounding);
+ in[11] = _mm_adds_epi16(in[11], final_rounding);
+ in[12] = _mm_adds_epi16(in[12], final_rounding);
+ in[13] = _mm_adds_epi16(in[13], final_rounding);
+ in[14] = _mm_adds_epi16(in[14], final_rounding);
+ in[15] = _mm_adds_epi16(in[15], final_rounding);
+
+ in[0] = _mm_srai_epi16(in[0], 6);
+ in[1] = _mm_srai_epi16(in[1], 6);
+ in[2] = _mm_srai_epi16(in[2], 6);
+ in[3] = _mm_srai_epi16(in[3], 6);
+ in[4] = _mm_srai_epi16(in[4], 6);
+ in[5] = _mm_srai_epi16(in[5], 6);
+ in[6] = _mm_srai_epi16(in[6], 6);
+ in[7] = _mm_srai_epi16(in[7], 6);
+ in[8] = _mm_srai_epi16(in[8], 6);
+ in[9] = _mm_srai_epi16(in[9], 6);
+ in[10] = _mm_srai_epi16(in[10], 6);
+ in[11] = _mm_srai_epi16(in[11], 6);
+ in[12] = _mm_srai_epi16(in[12], 6);
+ in[13] = _mm_srai_epi16(in[13], 6);
+ in[14] = _mm_srai_epi16(in[14], 6);
+ in[15] = _mm_srai_epi16(in[15], 6);
+
+ RECON_AND_STORE(dest, in[0]);
+ RECON_AND_STORE(dest, in[1]);
+ RECON_AND_STORE(dest, in[2]);
+ RECON_AND_STORE(dest, in[3]);
+ RECON_AND_STORE(dest, in[4]);
+ RECON_AND_STORE(dest, in[5]);
+ RECON_AND_STORE(dest, in[6]);
+ RECON_AND_STORE(dest, in[7]);
+ RECON_AND_STORE(dest, in[8]);
+ RECON_AND_STORE(dest, in[9]);
+ RECON_AND_STORE(dest, in[10]);
+ RECON_AND_STORE(dest, in[11]);
+ RECON_AND_STORE(dest, in[12]);
+ RECON_AND_STORE(dest, in[13]);
+ RECON_AND_STORE(dest, in[14]);
+ RECON_AND_STORE(dest, in[15]);
dest += 8 - (stride * 16);
}
@@ -2792,28 +2814,329 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
input += 8; \
} \
-#define IDCT32_1D \
+#define IDCT32_34 \
+/* Stage1 */ \
+{ \
+ const __m128i zero = _mm_setzero_si128();\
+ const __m128i lo_1_31 = _mm_unpacklo_epi16(in[1], zero); \
+ const __m128i hi_1_31 = _mm_unpackhi_epi16(in[1], zero); \
+ \
+ const __m128i lo_25_7= _mm_unpacklo_epi16(zero, in[7]); \
+ const __m128i hi_25_7 = _mm_unpackhi_epi16(zero, in[7]); \
+ \
+ const __m128i lo_5_27 = _mm_unpacklo_epi16(in[5], zero); \
+ const __m128i hi_5_27 = _mm_unpackhi_epi16(in[5], zero); \
+ \
+ const __m128i lo_29_3 = _mm_unpacklo_epi16(zero, in[3]); \
+ const __m128i hi_29_3 = _mm_unpackhi_epi16(zero, in[3]); \
+ \
+ MULTIPLICATION_AND_ADD_2(lo_1_31, hi_1_31, stg1_0, \
+ stg1_1, stp1_16, stp1_31); \
+ MULTIPLICATION_AND_ADD_2(lo_25_7, hi_25_7, stg1_6, \
+ stg1_7, stp1_19, stp1_28); \
+ MULTIPLICATION_AND_ADD_2(lo_5_27, hi_5_27, stg1_8, \
+ stg1_9, stp1_20, stp1_27); \
+ MULTIPLICATION_AND_ADD_2(lo_29_3, hi_29_3, stg1_14, \
+ stg1_15, stp1_23, stp1_24); \
+} \
+\
+/* Stage2 */ \
+{ \
+ const __m128i zero = _mm_setzero_si128();\
+ const __m128i lo_2_30 = _mm_unpacklo_epi16(in[2], zero); \
+ const __m128i hi_2_30 = _mm_unpackhi_epi16(in[2], zero); \
+ \
+ const __m128i lo_26_6 = _mm_unpacklo_epi16(zero, in[6]); \
+ const __m128i hi_26_6 = _mm_unpackhi_epi16(zero, in[6]); \
+ \
+ MULTIPLICATION_AND_ADD_2(lo_2_30, hi_2_30, stg2_0, \
+ stg2_1, stp2_8, stp2_15); \
+ MULTIPLICATION_AND_ADD_2(lo_26_6, hi_26_6, stg2_6, \
+ stg2_7, stp2_11, stp2_12); \
+ \
+ stp2_16 = stp1_16; \
+ stp2_19 = stp1_19; \
+ \
+ stp2_20 = stp1_20; \
+ stp2_23 = stp1_23; \
+ \
+ stp2_24 = stp1_24; \
+ stp2_27 = stp1_27; \
+ \
+ stp2_28 = stp1_28; \
+ stp2_31 = stp1_31; \
+} \
+\
+/* Stage3 */ \
+{ \
+ const __m128i zero = _mm_setzero_si128();\
+ const __m128i lo_4_28 = _mm_unpacklo_epi16(in[4], zero); \
+ const __m128i hi_4_28 = _mm_unpackhi_epi16(in[4], zero); \
+ \
+ const __m128i lo_17_30 = _mm_unpacklo_epi16(stp1_16, stp1_31); \
+ const __m128i hi_17_30 = _mm_unpackhi_epi16(stp1_16, stp1_31); \
+ const __m128i lo_18_29 = _mm_unpacklo_epi16(stp1_19, stp1_28); \
+ const __m128i hi_18_29 = _mm_unpackhi_epi16(stp1_19, stp1_28); \
+ \
+ const __m128i lo_21_26 = _mm_unpacklo_epi16(stp1_20, stp1_27); \
+ const __m128i hi_21_26 = _mm_unpackhi_epi16(stp1_20, stp1_27); \
+ const __m128i lo_22_25 = _mm_unpacklo_epi16(stp1_23, stp1_24); \
+ const __m128i hi_22_25 = _mm_unpackhi_epi16(stp1_23, stp2_24); \
+ \
+ MULTIPLICATION_AND_ADD_2(lo_4_28, hi_4_28, stg3_0, \
+ stg3_1, stp1_4, stp1_7); \
+ \
+ stp1_8 = stp2_8; \
+ stp1_11 = stp2_11; \
+ stp1_12 = stp2_12; \
+ stp1_15 = stp2_15; \
+ \
+ MULTIPLICATION_AND_ADD(lo_17_30, hi_17_30, lo_18_29, hi_18_29, stg3_4, \
+ stg3_5, stg3_6, stg3_4, stp1_17, stp1_30, \
+ stp1_18, stp1_29) \
+ MULTIPLICATION_AND_ADD(lo_21_26, hi_21_26, lo_22_25, hi_22_25, stg3_8, \
+ stg3_9, stg3_10, stg3_8, stp1_21, stp1_26, \
+ stp1_22, stp1_25) \
+ \
+ stp1_16 = stp2_16; \
+ stp1_31 = stp2_31; \
+ stp1_19 = stp2_19; \
+ stp1_20 = stp2_20; \
+ stp1_23 = stp2_23; \
+ stp1_24 = stp2_24; \
+ stp1_27 = stp2_27; \
+ stp1_28 = stp2_28; \
+} \
+\
+/* Stage4 */ \
+{ \
+ const __m128i zero = _mm_setzero_si128();\
+ const __m128i lo_0_16 = _mm_unpacklo_epi16(in[0], zero); \
+ const __m128i hi_0_16 = _mm_unpackhi_epi16(in[0], zero); \
+ \
+ const __m128i lo_9_14 = _mm_unpacklo_epi16(stp2_8, stp2_15); \
+ const __m128i hi_9_14 = _mm_unpackhi_epi16(stp2_8, stp2_15); \
+ const __m128i lo_10_13 = _mm_unpacklo_epi16(stp2_11, stp2_12); \
+ const __m128i hi_10_13 = _mm_unpackhi_epi16(stp2_11, stp2_12); \
+ \
+ MULTIPLICATION_AND_ADD_2(lo_0_16, hi_0_16, stg4_0, \
+ stg4_1, stp2_0, stp2_1); \
+ \
+ stp2_4 = stp1_4; \
+ stp2_5 = stp1_4; \
+ stp2_6 = stp1_7; \
+ stp2_7 = stp1_7; \
+ \
+ MULTIPLICATION_AND_ADD(lo_9_14, hi_9_14, lo_10_13, hi_10_13, stg4_4, \
+ stg4_5, stg4_6, stg4_4, stp2_9, stp2_14, \
+ stp2_10, stp2_13) \
+ \
+ stp2_8 = stp1_8; \
+ stp2_15 = stp1_15; \
+ stp2_11 = stp1_11; \
+ stp2_12 = stp1_12; \
+ \
+ stp2_16 = _mm_add_epi16(stp1_16, stp1_19); \
+ stp2_17 = _mm_add_epi16(stp1_17, stp1_18); \
+ stp2_18 = _mm_sub_epi16(stp1_17, stp1_18); \
+ stp2_19 = _mm_sub_epi16(stp1_16, stp1_19); \
+ stp2_20 = _mm_sub_epi16(stp1_23, stp1_20); \
+ stp2_21 = _mm_sub_epi16(stp1_22, stp1_21); \
+ stp2_22 = _mm_add_epi16(stp1_22, stp1_21); \
+ stp2_23 = _mm_add_epi16(stp1_23, stp1_20); \
+ \
+ stp2_24 = _mm_add_epi16(stp1_24, stp1_27); \
+ stp2_25 = _mm_add_epi16(stp1_25, stp1_26); \
+ stp2_26 = _mm_sub_epi16(stp1_25, stp1_26); \
+ stp2_27 = _mm_sub_epi16(stp1_24, stp1_27); \
+ stp2_28 = _mm_sub_epi16(stp1_31, stp1_28); \
+ stp2_29 = _mm_sub_epi16(stp1_30, stp1_29); \
+ stp2_30 = _mm_add_epi16(stp1_29, stp1_30); \
+ stp2_31 = _mm_add_epi16(stp1_28, stp1_31); \
+} \
+\
+/* Stage5 */ \
+{ \
+ const __m128i lo_6_5 = _mm_unpacklo_epi16(stp2_6, stp2_5); \
+ const __m128i hi_6_5 = _mm_unpackhi_epi16(stp2_6, stp2_5); \
+ const __m128i lo_18_29 = _mm_unpacklo_epi16(stp2_18, stp2_29); \
+ const __m128i hi_18_29 = _mm_unpackhi_epi16(stp2_18, stp2_29); \
+ \
+ const __m128i lo_19_28 = _mm_unpacklo_epi16(stp2_19, stp2_28); \
+ const __m128i hi_19_28 = _mm_unpackhi_epi16(stp2_19, stp2_28); \
+ const __m128i lo_20_27 = _mm_unpacklo_epi16(stp2_20, stp2_27); \
+ const __m128i hi_20_27 = _mm_unpackhi_epi16(stp2_20, stp2_27); \
+ \
+ const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \
+ const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \
+ \
+ stp1_0 = stp2_0; \
+ stp1_1 = stp2_1; \
+ stp1_2 = stp2_1; \
+ stp1_3 = stp2_0; \
+ \
+ tmp0 = _mm_madd_epi16(lo_6_5, stg4_1); \
+ tmp1 = _mm_madd_epi16(hi_6_5, stg4_1); \
+ tmp2 = _mm_madd_epi16(lo_6_5, stg4_0); \
+ tmp3 = _mm_madd_epi16(hi_6_5, stg4_0); \
+ \
+ tmp0 = _mm_add_epi32(tmp0, rounding); \
+ tmp1 = _mm_add_epi32(tmp1, rounding); \
+ tmp2 = _mm_add_epi32(tmp2, rounding); \
+ tmp3 = _mm_add_epi32(tmp3, rounding); \
+ \
+ tmp0 = _mm_srai_epi32(tmp0, DCT_CONST_BITS); \
+ tmp1 = _mm_srai_epi32(tmp1, DCT_CONST_BITS); \
+ tmp2 = _mm_srai_epi32(tmp2, DCT_CONST_BITS); \
+ tmp3 = _mm_srai_epi32(tmp3, DCT_CONST_BITS); \
+ \
+ stp1_5 = _mm_packs_epi32(tmp0, tmp1); \
+ stp1_6 = _mm_packs_epi32(tmp2, tmp3); \
+ \
+ stp1_4 = stp2_4; \
+ stp1_7 = stp2_7; \
+ \
+ stp1_8 = _mm_add_epi16(stp2_8, stp2_11); \
+ stp1_9 = _mm_add_epi16(stp2_9, stp2_10); \
+ stp1_10 = _mm_sub_epi16(stp2_9, stp2_10); \
+ stp1_11 = _mm_sub_epi16(stp2_8, stp2_11); \
+ stp1_12 = _mm_sub_epi16(stp2_15, stp2_12); \
+ stp1_13 = _mm_sub_epi16(stp2_14, stp2_13); \
+ stp1_14 = _mm_add_epi16(stp2_14, stp2_13); \
+ stp1_15 = _mm_add_epi16(stp2_15, stp2_12); \
+ \
+ stp1_16 = stp2_16; \
+ stp1_17 = stp2_17; \
+ \
+ MULTIPLICATION_AND_ADD(lo_18_29, hi_18_29, lo_19_28, hi_19_28, stg4_4, \
+ stg4_5, stg4_4, stg4_5, stp1_18, stp1_29, \
+ stp1_19, stp1_28) \
+ MULTIPLICATION_AND_ADD(lo_20_27, hi_20_27, lo_21_26, hi_21_26, stg4_6, \
+ stg4_4, stg4_6, stg4_4, stp1_20, stp1_27, \
+ stp1_21, stp1_26) \
+ \
+ stp1_22 = stp2_22; \
+ stp1_23 = stp2_23; \
+ stp1_24 = stp2_24; \
+ stp1_25 = stp2_25; \
+ stp1_30 = stp2_30; \
+ stp1_31 = stp2_31; \
+} \
+\
+/* Stage6 */ \
+{ \
+ const __m128i lo_10_13 = _mm_unpacklo_epi16(stp1_10, stp1_13); \
+ const __m128i hi_10_13 = _mm_unpackhi_epi16(stp1_10, stp1_13); \
+ const __m128i lo_11_12 = _mm_unpacklo_epi16(stp1_11, stp1_12); \
+ const __m128i hi_11_12 = _mm_unpackhi_epi16(stp1_11, stp1_12); \
+ \
+ stp2_0 = _mm_add_epi16(stp1_0, stp1_7); \
+ stp2_1 = _mm_add_epi16(stp1_1, stp1_6); \
+ stp2_2 = _mm_add_epi16(stp1_2, stp1_5); \
+ stp2_3 = _mm_add_epi16(stp1_3, stp1_4); \
+ stp2_4 = _mm_sub_epi16(stp1_3, stp1_4); \
+ stp2_5 = _mm_sub_epi16(stp1_2, stp1_5); \
+ stp2_6 = _mm_sub_epi16(stp1_1, stp1_6); \
+ stp2_7 = _mm_sub_epi16(stp1_0, stp1_7); \
+ \
+ stp2_8 = stp1_8; \
+ stp2_9 = stp1_9; \
+ stp2_14 = stp1_14; \
+ stp2_15 = stp1_15; \
+ \
+ MULTIPLICATION_AND_ADD(lo_10_13, hi_10_13, lo_11_12, hi_11_12, \
+ stg6_0, stg4_0, stg6_0, stg4_0, stp2_10, \
+ stp2_13, stp2_11, stp2_12) \
+ \
+ stp2_16 = _mm_add_epi16(stp1_16, stp1_23); \
+ stp2_17 = _mm_add_epi16(stp1_17, stp1_22); \
+ stp2_18 = _mm_add_epi16(stp1_18, stp1_21); \
+ stp2_19 = _mm_add_epi16(stp1_19, stp1_20); \
+ stp2_20 = _mm_sub_epi16(stp1_19, stp1_20); \
+ stp2_21 = _mm_sub_epi16(stp1_18, stp1_21); \
+ stp2_22 = _mm_sub_epi16(stp1_17, stp1_22); \
+ stp2_23 = _mm_sub_epi16(stp1_16, stp1_23); \
+ \
+ stp2_24 = _mm_sub_epi16(stp1_31, stp1_24); \
+ stp2_25 = _mm_sub_epi16(stp1_30, stp1_25); \
+ stp2_26 = _mm_sub_epi16(stp1_29, stp1_26); \
+ stp2_27 = _mm_sub_epi16(stp1_28, stp1_27); \
+ stp2_28 = _mm_add_epi16(stp1_27, stp1_28); \
+ stp2_29 = _mm_add_epi16(stp1_26, stp1_29); \
+ stp2_30 = _mm_add_epi16(stp1_25, stp1_30); \
+ stp2_31 = _mm_add_epi16(stp1_24, stp1_31); \
+} \
+\
+/* Stage7 */ \
+{ \
+ const __m128i lo_20_27 = _mm_unpacklo_epi16(stp2_20, stp2_27); \
+ const __m128i hi_20_27 = _mm_unpackhi_epi16(stp2_20, stp2_27); \
+ const __m128i lo_21_26 = _mm_unpacklo_epi16(stp2_21, stp2_26); \
+ const __m128i hi_21_26 = _mm_unpackhi_epi16(stp2_21, stp2_26); \
+ \
+ const __m128i lo_22_25 = _mm_unpacklo_epi16(stp2_22, stp2_25); \
+ const __m128i hi_22_25 = _mm_unpackhi_epi16(stp2_22, stp2_25); \
+ const __m128i lo_23_24 = _mm_unpacklo_epi16(stp2_23, stp2_24); \
+ const __m128i hi_23_24 = _mm_unpackhi_epi16(stp2_23, stp2_24); \
+ \
+ stp1_0 = _mm_add_epi16(stp2_0, stp2_15); \
+ stp1_1 = _mm_add_epi16(stp2_1, stp2_14); \
+ stp1_2 = _mm_add_epi16(stp2_2, stp2_13); \
+ stp1_3 = _mm_add_epi16(stp2_3, stp2_12); \
+ stp1_4 = _mm_add_epi16(stp2_4, stp2_11); \
+ stp1_5 = _mm_add_epi16(stp2_5, stp2_10); \
+ stp1_6 = _mm_add_epi16(stp2_6, stp2_9); \
+ stp1_7 = _mm_add_epi16(stp2_7, stp2_8); \
+ stp1_8 = _mm_sub_epi16(stp2_7, stp2_8); \
+ stp1_9 = _mm_sub_epi16(stp2_6, stp2_9); \
+ stp1_10 = _mm_sub_epi16(stp2_5, stp2_10); \
+ stp1_11 = _mm_sub_epi16(stp2_4, stp2_11); \
+ stp1_12 = _mm_sub_epi16(stp2_3, stp2_12); \
+ stp1_13 = _mm_sub_epi16(stp2_2, stp2_13); \
+ stp1_14 = _mm_sub_epi16(stp2_1, stp2_14); \
+ stp1_15 = _mm_sub_epi16(stp2_0, stp2_15); \
+ \
+ stp1_16 = stp2_16; \
+ stp1_17 = stp2_17; \
+ stp1_18 = stp2_18; \
+ stp1_19 = stp2_19; \
+ \
+ MULTIPLICATION_AND_ADD(lo_20_27, hi_20_27, lo_21_26, hi_21_26, stg6_0, \
+ stg4_0, stg6_0, stg4_0, stp1_20, stp1_27, \
+ stp1_21, stp1_26) \
+ MULTIPLICATION_AND_ADD(lo_22_25, hi_22_25, lo_23_24, hi_23_24, stg6_0, \
+ stg4_0, stg6_0, stg4_0, stp1_22, stp1_25, \
+ stp1_23, stp1_24) \
+ \
+ stp1_28 = stp2_28; \
+ stp1_29 = stp2_29; \
+ stp1_30 = stp2_30; \
+ stp1_31 = stp2_31; \
+}
+
+
+#define IDCT32 \
/* Stage1 */ \
{ \
- const __m128i lo_1_31 = _mm_unpacklo_epi16(in1, in31); \
- const __m128i hi_1_31 = _mm_unpackhi_epi16(in1, in31); \
- const __m128i lo_17_15 = _mm_unpacklo_epi16(in17, in15); \
- const __m128i hi_17_15 = _mm_unpackhi_epi16(in17, in15); \
- \
- const __m128i lo_9_23 = _mm_unpacklo_epi16(in9, in23); \
- const __m128i hi_9_23 = _mm_unpackhi_epi16(in9, in23); \
- const __m128i lo_25_7= _mm_unpacklo_epi16(in25, in7); \
- const __m128i hi_25_7 = _mm_unpackhi_epi16(in25, in7); \
- \
- const __m128i lo_5_27 = _mm_unpacklo_epi16(in5, in27); \
- const __m128i hi_5_27 = _mm_unpackhi_epi16(in5, in27); \
- const __m128i lo_21_11 = _mm_unpacklo_epi16(in21, in11); \
- const __m128i hi_21_11 = _mm_unpackhi_epi16(in21, in11); \
- \
- const __m128i lo_13_19 = _mm_unpacklo_epi16(in13, in19); \
- const __m128i hi_13_19 = _mm_unpackhi_epi16(in13, in19); \
- const __m128i lo_29_3 = _mm_unpacklo_epi16(in29, in3); \
- const __m128i hi_29_3 = _mm_unpackhi_epi16(in29, in3); \
+ const __m128i lo_1_31 = _mm_unpacklo_epi16(in[1], in[31]); \
+ const __m128i hi_1_31 = _mm_unpackhi_epi16(in[1], in[31]); \
+ const __m128i lo_17_15 = _mm_unpacklo_epi16(in[17], in[15]); \
+ const __m128i hi_17_15 = _mm_unpackhi_epi16(in[17], in[15]); \
+ \
+ const __m128i lo_9_23 = _mm_unpacklo_epi16(in[9], in[23]); \
+ const __m128i hi_9_23 = _mm_unpackhi_epi16(in[9], in[23]); \
+ const __m128i lo_25_7= _mm_unpacklo_epi16(in[25], in[7]); \
+ const __m128i hi_25_7 = _mm_unpackhi_epi16(in[25], in[7]); \
+ \
+ const __m128i lo_5_27 = _mm_unpacklo_epi16(in[5], in[27]); \
+ const __m128i hi_5_27 = _mm_unpackhi_epi16(in[5], in[27]); \
+ const __m128i lo_21_11 = _mm_unpacklo_epi16(in[21], in[11]); \
+ const __m128i hi_21_11 = _mm_unpackhi_epi16(in[21], in[11]); \
+ \
+ const __m128i lo_13_19 = _mm_unpacklo_epi16(in[13], in[19]); \
+ const __m128i hi_13_19 = _mm_unpackhi_epi16(in[13], in[19]); \
+ const __m128i lo_29_3 = _mm_unpacklo_epi16(in[29], in[3]); \
+ const __m128i hi_29_3 = _mm_unpackhi_epi16(in[29], in[3]); \
\
MULTIPLICATION_AND_ADD(lo_1_31, hi_1_31, lo_17_15, hi_17_15, stg1_0, \
stg1_1, stg1_2, stg1_3, stp1_16, stp1_31, \
@@ -2831,15 +3154,15 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
\
/* Stage2 */ \
{ \
- const __m128i lo_2_30 = _mm_unpacklo_epi16(in2, in30); \
- const __m128i hi_2_30 = _mm_unpackhi_epi16(in2, in30); \
- const __m128i lo_18_14 = _mm_unpacklo_epi16(in18, in14); \
- const __m128i hi_18_14 = _mm_unpackhi_epi16(in18, in14); \
+ const __m128i lo_2_30 = _mm_unpacklo_epi16(in[2], in[30]); \
+ const __m128i hi_2_30 = _mm_unpackhi_epi16(in[2], in[30]); \
+ const __m128i lo_18_14 = _mm_unpacklo_epi16(in[18], in[14]); \
+ const __m128i hi_18_14 = _mm_unpackhi_epi16(in[18], in[14]); \
\
- const __m128i lo_10_22 = _mm_unpacklo_epi16(in10, in22); \
- const __m128i hi_10_22 = _mm_unpackhi_epi16(in10, in22); \
- const __m128i lo_26_6 = _mm_unpacklo_epi16(in26, in6); \
- const __m128i hi_26_6 = _mm_unpackhi_epi16(in26, in6); \
+ const __m128i lo_10_22 = _mm_unpacklo_epi16(in[10], in[22]); \
+ const __m128i hi_10_22 = _mm_unpackhi_epi16(in[10], in[22]); \
+ const __m128i lo_26_6 = _mm_unpacklo_epi16(in[26], in[6]); \
+ const __m128i hi_26_6 = _mm_unpackhi_epi16(in[26], in[6]); \
\
MULTIPLICATION_AND_ADD(lo_2_30, hi_2_30, lo_18_14, hi_18_14, stg2_0, \
stg2_1, stg2_2, stg2_3, stp2_8, stp2_15, stp2_9, \
@@ -2871,10 +3194,10 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
\
/* Stage3 */ \
{ \
- const __m128i lo_4_28 = _mm_unpacklo_epi16(in4, in28); \
- const __m128i hi_4_28 = _mm_unpackhi_epi16(in4, in28); \
- const __m128i lo_20_12 = _mm_unpacklo_epi16(in20, in12); \
- const __m128i hi_20_12 = _mm_unpackhi_epi16(in20, in12); \
+ const __m128i lo_4_28 = _mm_unpacklo_epi16(in[4], in[28]); \
+ const __m128i hi_4_28 = _mm_unpackhi_epi16(in[4], in[28]); \
+ const __m128i lo_20_12 = _mm_unpacklo_epi16(in[20], in[12]); \
+ const __m128i hi_20_12 = _mm_unpackhi_epi16(in[20], in[12]); \
\
const __m128i lo_17_30 = _mm_unpacklo_epi16(stp2_17, stp2_30); \
const __m128i hi_17_30 = _mm_unpackhi_epi16(stp2_17, stp2_30); \
@@ -2918,10 +3241,10 @@ void vp9_idct16x16_10_add_sse2(const int16_t *input, uint8_t *dest,
\
/* Stage4 */ \
{ \
- const __m128i lo_0_16 = _mm_unpacklo_epi16(in0, in16); \
- const __m128i hi_0_16 = _mm_unpackhi_epi16(in0, in16); \
- const __m128i lo_8_24 = _mm_unpacklo_epi16(in8, in24); \
- const __m128i hi_8_24 = _mm_unpackhi_epi16(in8, in24); \
+ const __m128i lo_0_16 = _mm_unpacklo_epi16(in[0], in[16]); \
+ const __m128i hi_0_16 = _mm_unpackhi_epi16(in[0], in[16]); \
+ const __m128i lo_8_24 = _mm_unpacklo_epi16(in[8], in[24]); \
+ const __m128i hi_8_24 = _mm_unpackhi_epi16(in[8], in[24]); \
\
const __m128i lo_9_14 = _mm_unpacklo_epi16(stp1_9, stp1_14); \
const __m128i hi_9_14 = _mm_unpackhi_epi16(stp1_9, stp1_14); \
@@ -3178,10 +3501,7 @@ void vp9_idct32x32_34_add_sse2(const int16_t *input, uint8_t *dest,
const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64);
- __m128i in0, in1, in2, in3, in4, in5, in6, in7, in8, in9, in10, in11, in12,
- in13, in14, in15, in16, in17, in18, in19, in20, in21, in22, in23,
- in24, in25, in26, in27, in28, in29, in30, in31;
- __m128i col[128];
+ __m128i in[32], col[32];
__m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7,
stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15,
stp1_16, stp1_17, stp1_18, stp1_19, stp1_20, stp1_21, stp1_22,
@@ -3193,296 +3513,225 @@ void vp9_idct32x32_34_add_sse2(const int16_t *input, uint8_t *dest,
stp2_23, stp2_24, stp2_25, stp2_26, stp2_27, stp2_28, stp2_29,
stp2_30, stp2_31;
__m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int i, j, i32;
-
- // We work on a 8x32 block each time, and loop 8 times for 2-D 32x32 idct.
- for (i = 0; i < 8; i++) {
- i32 = (i << 5);
- if (i == 0) {
- // First 1-D idct: first 8 rows
- // Load input data.
- LOAD_DQCOEFF(in0, input);
- LOAD_DQCOEFF(in8, input);
- LOAD_DQCOEFF(in16, input);
- LOAD_DQCOEFF(in24, input);
- LOAD_DQCOEFF(in1, input);
- LOAD_DQCOEFF(in9, input);
- LOAD_DQCOEFF(in17, input);
- LOAD_DQCOEFF(in25, input);
- LOAD_DQCOEFF(in2, input);
- LOAD_DQCOEFF(in10, input);
- LOAD_DQCOEFF(in18, input);
- LOAD_DQCOEFF(in26, input);
- LOAD_DQCOEFF(in3, input);
- LOAD_DQCOEFF(in11, input);
- LOAD_DQCOEFF(in19, input);
- LOAD_DQCOEFF(in27, input);
-
- LOAD_DQCOEFF(in4, input);
- LOAD_DQCOEFF(in12, input);
- LOAD_DQCOEFF(in20, input);
- LOAD_DQCOEFF(in28, input);
- LOAD_DQCOEFF(in5, input);
- LOAD_DQCOEFF(in13, input);
- LOAD_DQCOEFF(in21, input);
- LOAD_DQCOEFF(in29, input);
- LOAD_DQCOEFF(in6, input);
- LOAD_DQCOEFF(in14, input);
- LOAD_DQCOEFF(in22, input);
- LOAD_DQCOEFF(in30, input);
- LOAD_DQCOEFF(in7, input);
- LOAD_DQCOEFF(in15, input);
- LOAD_DQCOEFF(in23, input);
- LOAD_DQCOEFF(in31, input);
-
- // Transpose 32x8 block to 8x32 block
- TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
- in4, in5, in6, in7);
- TRANSPOSE_8X8(in8, in9, in10, in11, in12, in13, in14, in15, in8, in9,
- in10, in11, in12, in13, in14, in15);
- TRANSPOSE_8X8(in16, in17, in18, in19, in20, in21, in22, in23, in16, in17,
- in18, in19, in20, in21, in22, in23);
- TRANSPOSE_8X8(in24, in25, in26, in27, in28, in29, in30, in31, in24, in25,
- in26, in27, in28, in29, in30, in31);
- } else if (i < 4) {
- // First 1-D idct: next 24 zero-coeff rows
- col[i32 + 0] = _mm_setzero_si128();
- col[i32 + 1] = _mm_setzero_si128();
- col[i32 + 2] = _mm_setzero_si128();
- col[i32 + 3] = _mm_setzero_si128();
- col[i32 + 4] = _mm_setzero_si128();
- col[i32 + 5] = _mm_setzero_si128();
- col[i32 + 6] = _mm_setzero_si128();
- col[i32 + 7] = _mm_setzero_si128();
- col[i32 + 8] = _mm_setzero_si128();
- col[i32 + 9] = _mm_setzero_si128();
- col[i32 + 10] = _mm_setzero_si128();
- col[i32 + 11] = _mm_setzero_si128();
- col[i32 + 12] = _mm_setzero_si128();
- col[i32 + 13] = _mm_setzero_si128();
- col[i32 + 14] = _mm_setzero_si128();
- col[i32 + 15] = _mm_setzero_si128();
- col[i32 + 16] = _mm_setzero_si128();
- col[i32 + 17] = _mm_setzero_si128();
- col[i32 + 18] = _mm_setzero_si128();
- col[i32 + 19] = _mm_setzero_si128();
- col[i32 + 20] = _mm_setzero_si128();
- col[i32 + 21] = _mm_setzero_si128();
- col[i32 + 22] = _mm_setzero_si128();
- col[i32 + 23] = _mm_setzero_si128();
- col[i32 + 24] = _mm_setzero_si128();
- col[i32 + 25] = _mm_setzero_si128();
- col[i32 + 26] = _mm_setzero_si128();
- col[i32 + 27] = _mm_setzero_si128();
- col[i32 + 28] = _mm_setzero_si128();
- col[i32 + 29] = _mm_setzero_si128();
- col[i32 + 30] = _mm_setzero_si128();
- col[i32 + 31] = _mm_setzero_si128();
- continue;
- } else {
- // Second 1-D idct
- j = i - 4;
-
- // Transpose 32x8 block to 8x32 block
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in0, in1, in2, in3, in4,
- in5, in6, in7);
- j += 4;
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in8, in9, in10,
- in11, in12, in13, in14, in15);
- j += 4;
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in16, in17, in18,
- in19, in20, in21, in22, in23);
- j += 4;
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in24, in25, in26, in27,
- in28, in29, in30, in31);
- }
-
- IDCT32_1D
+ int i;
+ // Load input data.
+ LOAD_DQCOEFF(in[0], input);
+ LOAD_DQCOEFF(in[8], input);
+ LOAD_DQCOEFF(in[16], input);
+ LOAD_DQCOEFF(in[24], input);
+ LOAD_DQCOEFF(in[1], input);
+ LOAD_DQCOEFF(in[9], input);
+ LOAD_DQCOEFF(in[17], input);
+ LOAD_DQCOEFF(in[25], input);
+ LOAD_DQCOEFF(in[2], input);
+ LOAD_DQCOEFF(in[10], input);
+ LOAD_DQCOEFF(in[18], input);
+ LOAD_DQCOEFF(in[26], input);
+ LOAD_DQCOEFF(in[3], input);
+ LOAD_DQCOEFF(in[11], input);
+ LOAD_DQCOEFF(in[19], input);
+ LOAD_DQCOEFF(in[27], input);
+
+ LOAD_DQCOEFF(in[4], input);
+ LOAD_DQCOEFF(in[12], input);
+ LOAD_DQCOEFF(in[20], input);
+ LOAD_DQCOEFF(in[28], input);
+ LOAD_DQCOEFF(in[5], input);
+ LOAD_DQCOEFF(in[13], input);
+ LOAD_DQCOEFF(in[21], input);
+ LOAD_DQCOEFF(in[29], input);
+ LOAD_DQCOEFF(in[6], input);
+ LOAD_DQCOEFF(in[14], input);
+ LOAD_DQCOEFF(in[22], input);
+ LOAD_DQCOEFF(in[30], input);
+ LOAD_DQCOEFF(in[7], input);
+ LOAD_DQCOEFF(in[15], input);
+ LOAD_DQCOEFF(in[23], input);
+ LOAD_DQCOEFF(in[31], input);
- // final stage
- if (i < 4) {
- // 1_D: Store 32 intermediate results for each 8x32 block.
- col[i32 + 0] = _mm_add_epi16(stp1_0, stp1_31);
- col[i32 + 1] = _mm_add_epi16(stp1_1, stp1_30);
- col[i32 + 2] = _mm_add_epi16(stp1_2, stp1_29);
- col[i32 + 3] = _mm_add_epi16(stp1_3, stp1_28);
- col[i32 + 4] = _mm_add_epi16(stp1_4, stp1_27);
- col[i32 + 5] = _mm_add_epi16(stp1_5, stp1_26);
- col[i32 + 6] = _mm_add_epi16(stp1_6, stp1_25);
- col[i32 + 7] = _mm_add_epi16(stp1_7, stp1_24);
- col[i32 + 8] = _mm_add_epi16(stp1_8, stp1_23);
- col[i32 + 9] = _mm_add_epi16(stp1_9, stp1_22);
- col[i32 + 10] = _mm_add_epi16(stp1_10, stp1_21);
- col[i32 + 11] = _mm_add_epi16(stp1_11, stp1_20);
- col[i32 + 12] = _mm_add_epi16(stp1_12, stp1_19);
- col[i32 + 13] = _mm_add_epi16(stp1_13, stp1_18);
- col[i32 + 14] = _mm_add_epi16(stp1_14, stp1_17);
- col[i32 + 15] = _mm_add_epi16(stp1_15, stp1_16);
- col[i32 + 16] = _mm_sub_epi16(stp1_15, stp1_16);
- col[i32 + 17] = _mm_sub_epi16(stp1_14, stp1_17);
- col[i32 + 18] = _mm_sub_epi16(stp1_13, stp1_18);
- col[i32 + 19] = _mm_sub_epi16(stp1_12, stp1_19);
- col[i32 + 20] = _mm_sub_epi16(stp1_11, stp1_20);
- col[i32 + 21] = _mm_sub_epi16(stp1_10, stp1_21);
- col[i32 + 22] = _mm_sub_epi16(stp1_9, stp1_22);
- col[i32 + 23] = _mm_sub_epi16(stp1_8, stp1_23);
- col[i32 + 24] = _mm_sub_epi16(stp1_7, stp1_24);
- col[i32 + 25] = _mm_sub_epi16(stp1_6, stp1_25);
- col[i32 + 26] = _mm_sub_epi16(stp1_5, stp1_26);
- col[i32 + 27] = _mm_sub_epi16(stp1_4, stp1_27);
- col[i32 + 28] = _mm_sub_epi16(stp1_3, stp1_28);
- col[i32 + 29] = _mm_sub_epi16(stp1_2, stp1_29);
- col[i32 + 30] = _mm_sub_epi16(stp1_1, stp1_30);
- col[i32 + 31] = _mm_sub_epi16(stp1_0, stp1_31);
- } else {
+ array_transpose_8x8(in, in);
+ array_transpose_8x8(in+8, in+8);
+ array_transpose_8x8(in+16, in+16);
+ array_transpose_8x8(in+24, in+24);
+
+ IDCT32
+
+ // 1_D: Store 32 intermediate results for each 8x32 block.
+ col[0] = _mm_add_epi16(stp1_0, stp1_31);
+ col[1] = _mm_add_epi16(stp1_1, stp1_30);
+ col[2] = _mm_add_epi16(stp1_2, stp1_29);
+ col[3] = _mm_add_epi16(stp1_3, stp1_28);
+ col[4] = _mm_add_epi16(stp1_4, stp1_27);
+ col[5] = _mm_add_epi16(stp1_5, stp1_26);
+ col[6] = _mm_add_epi16(stp1_6, stp1_25);
+ col[7] = _mm_add_epi16(stp1_7, stp1_24);
+ col[8] = _mm_add_epi16(stp1_8, stp1_23);
+ col[9] = _mm_add_epi16(stp1_9, stp1_22);
+ col[10] = _mm_add_epi16(stp1_10, stp1_21);
+ col[11] = _mm_add_epi16(stp1_11, stp1_20);
+ col[12] = _mm_add_epi16(stp1_12, stp1_19);
+ col[13] = _mm_add_epi16(stp1_13, stp1_18);
+ col[14] = _mm_add_epi16(stp1_14, stp1_17);
+ col[15] = _mm_add_epi16(stp1_15, stp1_16);
+ col[16] = _mm_sub_epi16(stp1_15, stp1_16);
+ col[17] = _mm_sub_epi16(stp1_14, stp1_17);
+ col[18] = _mm_sub_epi16(stp1_13, stp1_18);
+ col[19] = _mm_sub_epi16(stp1_12, stp1_19);
+ col[20] = _mm_sub_epi16(stp1_11, stp1_20);
+ col[21] = _mm_sub_epi16(stp1_10, stp1_21);
+ col[22] = _mm_sub_epi16(stp1_9, stp1_22);
+ col[23] = _mm_sub_epi16(stp1_8, stp1_23);
+ col[24] = _mm_sub_epi16(stp1_7, stp1_24);
+ col[25] = _mm_sub_epi16(stp1_6, stp1_25);
+ col[26] = _mm_sub_epi16(stp1_5, stp1_26);
+ col[27] = _mm_sub_epi16(stp1_4, stp1_27);
+ col[28] = _mm_sub_epi16(stp1_3, stp1_28);
+ col[29] = _mm_sub_epi16(stp1_2, stp1_29);
+ col[30] = _mm_sub_epi16(stp1_1, stp1_30);
+ col[31] = _mm_sub_epi16(stp1_0, stp1_31);
+ for (i = 0; i < 4; i++) {
const __m128i zero = _mm_setzero_si128();
+ // Transpose 32x8 block to 8x32 block
+ array_transpose_8x8(col+i*8, in);
+ IDCT32_34
// 2_D: Calculate the results and store them to destination.
- in0 = _mm_add_epi16(stp1_0, stp1_31);
- in1 = _mm_add_epi16(stp1_1, stp1_30);
- in2 = _mm_add_epi16(stp1_2, stp1_29);
- in3 = _mm_add_epi16(stp1_3, stp1_28);
- in4 = _mm_add_epi16(stp1_4, stp1_27);
- in5 = _mm_add_epi16(stp1_5, stp1_26);
- in6 = _mm_add_epi16(stp1_6, stp1_25);
- in7 = _mm_add_epi16(stp1_7, stp1_24);
- in8 = _mm_add_epi16(stp1_8, stp1_23);
- in9 = _mm_add_epi16(stp1_9, stp1_22);
- in10 = _mm_add_epi16(stp1_10, stp1_21);
- in11 = _mm_add_epi16(stp1_11, stp1_20);
- in12 = _mm_add_epi16(stp1_12, stp1_19);
- in13 = _mm_add_epi16(stp1_13, stp1_18);
- in14 = _mm_add_epi16(stp1_14, stp1_17);
- in15 = _mm_add_epi16(stp1_15, stp1_16);
- in16 = _mm_sub_epi16(stp1_15, stp1_16);
- in17 = _mm_sub_epi16(stp1_14, stp1_17);
- in18 = _mm_sub_epi16(stp1_13, stp1_18);
- in19 = _mm_sub_epi16(stp1_12, stp1_19);
- in20 = _mm_sub_epi16(stp1_11, stp1_20);
- in21 = _mm_sub_epi16(stp1_10, stp1_21);
- in22 = _mm_sub_epi16(stp1_9, stp1_22);
- in23 = _mm_sub_epi16(stp1_8, stp1_23);
- in24 = _mm_sub_epi16(stp1_7, stp1_24);
- in25 = _mm_sub_epi16(stp1_6, stp1_25);
- in26 = _mm_sub_epi16(stp1_5, stp1_26);
- in27 = _mm_sub_epi16(stp1_4, stp1_27);
- in28 = _mm_sub_epi16(stp1_3, stp1_28);
- in29 = _mm_sub_epi16(stp1_2, stp1_29);
- in30 = _mm_sub_epi16(stp1_1, stp1_30);
- in31 = _mm_sub_epi16(stp1_0, stp1_31);
+ in[0] = _mm_add_epi16(stp1_0, stp1_31);
+ in[1] = _mm_add_epi16(stp1_1, stp1_30);
+ in[2] = _mm_add_epi16(stp1_2, stp1_29);
+ in[3] = _mm_add_epi16(stp1_3, stp1_28);
+ in[4] = _mm_add_epi16(stp1_4, stp1_27);
+ in[5] = _mm_add_epi16(stp1_5, stp1_26);
+ in[6] = _mm_add_epi16(stp1_6, stp1_25);
+ in[7] = _mm_add_epi16(stp1_7, stp1_24);
+ in[8] = _mm_add_epi16(stp1_8, stp1_23);
+ in[9] = _mm_add_epi16(stp1_9, stp1_22);
+ in[10] = _mm_add_epi16(stp1_10, stp1_21);
+ in[11] = _mm_add_epi16(stp1_11, stp1_20);
+ in[12] = _mm_add_epi16(stp1_12, stp1_19);
+ in[13] = _mm_add_epi16(stp1_13, stp1_18);
+ in[14] = _mm_add_epi16(stp1_14, stp1_17);
+ in[15] = _mm_add_epi16(stp1_15, stp1_16);
+ in[16] = _mm_sub_epi16(stp1_15, stp1_16);
+ in[17] = _mm_sub_epi16(stp1_14, stp1_17);
+ in[18] = _mm_sub_epi16(stp1_13, stp1_18);
+ in[19] = _mm_sub_epi16(stp1_12, stp1_19);
+ in[20] = _mm_sub_epi16(stp1_11, stp1_20);
+ in[21] = _mm_sub_epi16(stp1_10, stp1_21);
+ in[22] = _mm_sub_epi16(stp1_9, stp1_22);
+ in[23] = _mm_sub_epi16(stp1_8, stp1_23);
+ in[24] = _mm_sub_epi16(stp1_7, stp1_24);
+ in[25] = _mm_sub_epi16(stp1_6, stp1_25);
+ in[26] = _mm_sub_epi16(stp1_5, stp1_26);
+ in[27] = _mm_sub_epi16(stp1_4, stp1_27);
+ in[28] = _mm_sub_epi16(stp1_3, stp1_28);
+ in[29] = _mm_sub_epi16(stp1_2, stp1_29);
+ in[30] = _mm_sub_epi16(stp1_1, stp1_30);
+ in[31] = _mm_sub_epi16(stp1_0, stp1_31);
// Final rounding and shift
- in0 = _mm_adds_epi16(in0, final_rounding);
- in1 = _mm_adds_epi16(in1, final_rounding);
- in2 = _mm_adds_epi16(in2, final_rounding);
- in3 = _mm_adds_epi16(in3, final_rounding);
- in4 = _mm_adds_epi16(in4, final_rounding);
- in5 = _mm_adds_epi16(in5, final_rounding);
- in6 = _mm_adds_epi16(in6, final_rounding);
- in7 = _mm_adds_epi16(in7, final_rounding);
- in8 = _mm_adds_epi16(in8, final_rounding);
- in9 = _mm_adds_epi16(in9, final_rounding);
- in10 = _mm_adds_epi16(in10, final_rounding);
- in11 = _mm_adds_epi16(in11, final_rounding);
- in12 = _mm_adds_epi16(in12, final_rounding);
- in13 = _mm_adds_epi16(in13, final_rounding);
- in14 = _mm_adds_epi16(in14, final_rounding);
- in15 = _mm_adds_epi16(in15, final_rounding);
- in16 = _mm_adds_epi16(in16, final_rounding);
- in17 = _mm_adds_epi16(in17, final_rounding);
- in18 = _mm_adds_epi16(in18, final_rounding);
- in19 = _mm_adds_epi16(in19, final_rounding);
- in20 = _mm_adds_epi16(in20, final_rounding);
- in21 = _mm_adds_epi16(in21, final_rounding);
- in22 = _mm_adds_epi16(in22, final_rounding);
- in23 = _mm_adds_epi16(in23, final_rounding);
- in24 = _mm_adds_epi16(in24, final_rounding);
- in25 = _mm_adds_epi16(in25, final_rounding);
- in26 = _mm_adds_epi16(in26, final_rounding);
- in27 = _mm_adds_epi16(in27, final_rounding);
- in28 = _mm_adds_epi16(in28, final_rounding);
- in29 = _mm_adds_epi16(in29, final_rounding);
- in30 = _mm_adds_epi16(in30, final_rounding);
- in31 = _mm_adds_epi16(in31, final_rounding);
-
- in0 = _mm_srai_epi16(in0, 6);
- in1 = _mm_srai_epi16(in1, 6);
- in2 = _mm_srai_epi16(in2, 6);
- in3 = _mm_srai_epi16(in3, 6);
- in4 = _mm_srai_epi16(in4, 6);
- in5 = _mm_srai_epi16(in5, 6);
- in6 = _mm_srai_epi16(in6, 6);
- in7 = _mm_srai_epi16(in7, 6);
- in8 = _mm_srai_epi16(in8, 6);
- in9 = _mm_srai_epi16(in9, 6);
- in10 = _mm_srai_epi16(in10, 6);
- in11 = _mm_srai_epi16(in11, 6);
- in12 = _mm_srai_epi16(in12, 6);
- in13 = _mm_srai_epi16(in13, 6);
- in14 = _mm_srai_epi16(in14, 6);
- in15 = _mm_srai_epi16(in15, 6);
- in16 = _mm_srai_epi16(in16, 6);
- in17 = _mm_srai_epi16(in17, 6);
- in18 = _mm_srai_epi16(in18, 6);
- in19 = _mm_srai_epi16(in19, 6);
- in20 = _mm_srai_epi16(in20, 6);
- in21 = _mm_srai_epi16(in21, 6);
- in22 = _mm_srai_epi16(in22, 6);
- in23 = _mm_srai_epi16(in23, 6);
- in24 = _mm_srai_epi16(in24, 6);
- in25 = _mm_srai_epi16(in25, 6);
- in26 = _mm_srai_epi16(in26, 6);
- in27 = _mm_srai_epi16(in27, 6);
- in28 = _mm_srai_epi16(in28, 6);
- in29 = _mm_srai_epi16(in29, 6);
- in30 = _mm_srai_epi16(in30, 6);
- in31 = _mm_srai_epi16(in31, 6);
-
- RECON_AND_STORE(dest, in0);
- RECON_AND_STORE(dest, in1);
- RECON_AND_STORE(dest, in2);
- RECON_AND_STORE(dest, in3);
- RECON_AND_STORE(dest, in4);
- RECON_AND_STORE(dest, in5);
- RECON_AND_STORE(dest, in6);
- RECON_AND_STORE(dest, in7);
- RECON_AND_STORE(dest, in8);
- RECON_AND_STORE(dest, in9);
- RECON_AND_STORE(dest, in10);
- RECON_AND_STORE(dest, in11);
- RECON_AND_STORE(dest, in12);
- RECON_AND_STORE(dest, in13);
- RECON_AND_STORE(dest, in14);
- RECON_AND_STORE(dest, in15);
- RECON_AND_STORE(dest, in16);
- RECON_AND_STORE(dest, in17);
- RECON_AND_STORE(dest, in18);
- RECON_AND_STORE(dest, in19);
- RECON_AND_STORE(dest, in20);
- RECON_AND_STORE(dest, in21);
- RECON_AND_STORE(dest, in22);
- RECON_AND_STORE(dest, in23);
- RECON_AND_STORE(dest, in24);
- RECON_AND_STORE(dest, in25);
- RECON_AND_STORE(dest, in26);
- RECON_AND_STORE(dest, in27);
- RECON_AND_STORE(dest, in28);
- RECON_AND_STORE(dest, in29);
- RECON_AND_STORE(dest, in30);
- RECON_AND_STORE(dest, in31);
+ in[0] = _mm_adds_epi16(in[0], final_rounding);
+ in[1] = _mm_adds_epi16(in[1], final_rounding);
+ in[2] = _mm_adds_epi16(in[2], final_rounding);
+ in[3] = _mm_adds_epi16(in[3], final_rounding);
+ in[4] = _mm_adds_epi16(in[4], final_rounding);
+ in[5] = _mm_adds_epi16(in[5], final_rounding);
+ in[6] = _mm_adds_epi16(in[6], final_rounding);
+ in[7] = _mm_adds_epi16(in[7], final_rounding);
+ in[8] = _mm_adds_epi16(in[8], final_rounding);
+ in[9] = _mm_adds_epi16(in[9], final_rounding);
+ in[10] = _mm_adds_epi16(in[10], final_rounding);
+ in[11] = _mm_adds_epi16(in[11], final_rounding);
+ in[12] = _mm_adds_epi16(in[12], final_rounding);
+ in[13] = _mm_adds_epi16(in[13], final_rounding);
+ in[14] = _mm_adds_epi16(in[14], final_rounding);
+ in[15] = _mm_adds_epi16(in[15], final_rounding);
+ in[16] = _mm_adds_epi16(in[16], final_rounding);
+ in[17] = _mm_adds_epi16(in[17], final_rounding);
+ in[18] = _mm_adds_epi16(in[18], final_rounding);
+ in[19] = _mm_adds_epi16(in[19], final_rounding);
+ in[20] = _mm_adds_epi16(in[20], final_rounding);
+ in[21] = _mm_adds_epi16(in[21], final_rounding);
+ in[22] = _mm_adds_epi16(in[22], final_rounding);
+ in[23] = _mm_adds_epi16(in[23], final_rounding);
+ in[24] = _mm_adds_epi16(in[24], final_rounding);
+ in[25] = _mm_adds_epi16(in[25], final_rounding);
+ in[26] = _mm_adds_epi16(in[26], final_rounding);
+ in[27] = _mm_adds_epi16(in[27], final_rounding);
+ in[28] = _mm_adds_epi16(in[28], final_rounding);
+ in[29] = _mm_adds_epi16(in[29], final_rounding);
+ in[30] = _mm_adds_epi16(in[30], final_rounding);
+ in[31] = _mm_adds_epi16(in[31], final_rounding);
+
+ in[0] = _mm_srai_epi16(in[0], 6);
+ in[1] = _mm_srai_epi16(in[1], 6);
+ in[2] = _mm_srai_epi16(in[2], 6);
+ in[3] = _mm_srai_epi16(in[3], 6);
+ in[4] = _mm_srai_epi16(in[4], 6);
+ in[5] = _mm_srai_epi16(in[5], 6);
+ in[6] = _mm_srai_epi16(in[6], 6);
+ in[7] = _mm_srai_epi16(in[7], 6);
+ in[8] = _mm_srai_epi16(in[8], 6);
+ in[9] = _mm_srai_epi16(in[9], 6);
+ in[10] = _mm_srai_epi16(in[10], 6);
+ in[11] = _mm_srai_epi16(in[11], 6);
+ in[12] = _mm_srai_epi16(in[12], 6);
+ in[13] = _mm_srai_epi16(in[13], 6);
+ in[14] = _mm_srai_epi16(in[14], 6);
+ in[15] = _mm_srai_epi16(in[15], 6);
+ in[16] = _mm_srai_epi16(in[16], 6);
+ in[17] = _mm_srai_epi16(in[17], 6);
+ in[18] = _mm_srai_epi16(in[18], 6);
+ in[19] = _mm_srai_epi16(in[19], 6);
+ in[20] = _mm_srai_epi16(in[20], 6);
+ in[21] = _mm_srai_epi16(in[21], 6);
+ in[22] = _mm_srai_epi16(in[22], 6);
+ in[23] = _mm_srai_epi16(in[23], 6);
+ in[24] = _mm_srai_epi16(in[24], 6);
+ in[25] = _mm_srai_epi16(in[25], 6);
+ in[26] = _mm_srai_epi16(in[26], 6);
+ in[27] = _mm_srai_epi16(in[27], 6);
+ in[28] = _mm_srai_epi16(in[28], 6);
+ in[29] = _mm_srai_epi16(in[29], 6);
+ in[30] = _mm_srai_epi16(in[30], 6);
+ in[31] = _mm_srai_epi16(in[31], 6);
+
+ RECON_AND_STORE(dest, in[0]);
+ RECON_AND_STORE(dest, in[1]);
+ RECON_AND_STORE(dest, in[2]);
+ RECON_AND_STORE(dest, in[3]);
+ RECON_AND_STORE(dest, in[4]);
+ RECON_AND_STORE(dest, in[5]);
+ RECON_AND_STORE(dest, in[6]);
+ RECON_AND_STORE(dest, in[7]);
+ RECON_AND_STORE(dest, in[8]);
+ RECON_AND_STORE(dest, in[9]);
+ RECON_AND_STORE(dest, in[10]);
+ RECON_AND_STORE(dest, in[11]);
+ RECON_AND_STORE(dest, in[12]);
+ RECON_AND_STORE(dest, in[13]);
+ RECON_AND_STORE(dest, in[14]);
+ RECON_AND_STORE(dest, in[15]);
+ RECON_AND_STORE(dest, in[16]);
+ RECON_AND_STORE(dest, in[17]);
+ RECON_AND_STORE(dest, in[18]);
+ RECON_AND_STORE(dest, in[19]);
+ RECON_AND_STORE(dest, in[20]);
+ RECON_AND_STORE(dest, in[21]);
+ RECON_AND_STORE(dest, in[22]);
+ RECON_AND_STORE(dest, in[23]);
+ RECON_AND_STORE(dest, in[24]);
+ RECON_AND_STORE(dest, in[25]);
+ RECON_AND_STORE(dest, in[26]);
+ RECON_AND_STORE(dest, in[27]);
+ RECON_AND_STORE(dest, in[28]);
+ RECON_AND_STORE(dest, in[29]);
+ RECON_AND_STORE(dest, in[30]);
+ RECON_AND_STORE(dest, in[31]);
dest += 8 - (stride * 32);
}
}
-}
void vp9_idct32x32_1024_add_sse2(const int16_t *input, uint8_t *dest,
int stride) {
@@ -3537,10 +3786,7 @@ void vp9_idct32x32_1024_add_sse2(const int16_t *input, uint8_t *dest,
const __m128i stg6_0 = pair_set_epi16(-cospi_16_64, cospi_16_64);
- __m128i in0, in1, in2, in3, in4, in5, in6, in7, in8, in9, in10, in11, in12,
- in13, in14, in15, in16, in17, in18, in19, in20, in21, in22, in23,
- in24, in25, in26, in27, in28, in29, in30, in31;
- __m128i col[128];
+ __m128i in[32], col[128], zero_idx[16];
__m128i stp1_0, stp1_1, stp1_2, stp1_3, stp1_4, stp1_5, stp1_6, stp1_7,
stp1_8, stp1_9, stp1_10, stp1_11, stp1_12, stp1_13, stp1_14, stp1_15,
stp1_16, stp1_17, stp1_18, stp1_19, stp1_20, stp1_21, stp1_22,
@@ -3553,66 +3799,63 @@ void vp9_idct32x32_1024_add_sse2(const int16_t *input, uint8_t *dest,
stp2_30, stp2_31;
__m128i tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int i, j, i32;
- __m128i zero_idx[16];
int zero_flag[2];
- // We work on a 8x32 block each time, and loop 8 times for 2-D 32x32 idct.
- for (i = 0; i < 8; i++) {
+ for (i = 0; i < 4; i++) {
i32 = (i << 5);
- if (i < 4) {
// First 1-D idct
// Load input data.
- LOAD_DQCOEFF(in0, input);
- LOAD_DQCOEFF(in8, input);
- LOAD_DQCOEFF(in16, input);
- LOAD_DQCOEFF(in24, input);
- LOAD_DQCOEFF(in1, input);
- LOAD_DQCOEFF(in9, input);
- LOAD_DQCOEFF(in17, input);
- LOAD_DQCOEFF(in25, input);
- LOAD_DQCOEFF(in2, input);
- LOAD_DQCOEFF(in10, input);
- LOAD_DQCOEFF(in18, input);
- LOAD_DQCOEFF(in26, input);
- LOAD_DQCOEFF(in3, input);
- LOAD_DQCOEFF(in11, input);
- LOAD_DQCOEFF(in19, input);
- LOAD_DQCOEFF(in27, input);
-
- LOAD_DQCOEFF(in4, input);
- LOAD_DQCOEFF(in12, input);
- LOAD_DQCOEFF(in20, input);
- LOAD_DQCOEFF(in28, input);
- LOAD_DQCOEFF(in5, input);
- LOAD_DQCOEFF(in13, input);
- LOAD_DQCOEFF(in21, input);
- LOAD_DQCOEFF(in29, input);
- LOAD_DQCOEFF(in6, input);
- LOAD_DQCOEFF(in14, input);
- LOAD_DQCOEFF(in22, input);
- LOAD_DQCOEFF(in30, input);
- LOAD_DQCOEFF(in7, input);
- LOAD_DQCOEFF(in15, input);
- LOAD_DQCOEFF(in23, input);
- LOAD_DQCOEFF(in31, input);
+ LOAD_DQCOEFF(in[0], input);
+ LOAD_DQCOEFF(in[8], input);
+ LOAD_DQCOEFF(in[16], input);
+ LOAD_DQCOEFF(in[24], input);
+ LOAD_DQCOEFF(in[1], input);
+ LOAD_DQCOEFF(in[9], input);
+ LOAD_DQCOEFF(in[17], input);
+ LOAD_DQCOEFF(in[25], input);
+ LOAD_DQCOEFF(in[2], input);
+ LOAD_DQCOEFF(in[10], input);
+ LOAD_DQCOEFF(in[18], input);
+ LOAD_DQCOEFF(in[26], input);
+ LOAD_DQCOEFF(in[3], input);
+ LOAD_DQCOEFF(in[11], input);
+ LOAD_DQCOEFF(in[19], input);
+ LOAD_DQCOEFF(in[27], input);
+
+ LOAD_DQCOEFF(in[4], input);
+ LOAD_DQCOEFF(in[12], input);
+ LOAD_DQCOEFF(in[20], input);
+ LOAD_DQCOEFF(in[28], input);
+ LOAD_DQCOEFF(in[5], input);
+ LOAD_DQCOEFF(in[13], input);
+ LOAD_DQCOEFF(in[21], input);
+ LOAD_DQCOEFF(in[29], input);
+ LOAD_DQCOEFF(in[6], input);
+ LOAD_DQCOEFF(in[14], input);
+ LOAD_DQCOEFF(in[22], input);
+ LOAD_DQCOEFF(in[30], input);
+ LOAD_DQCOEFF(in[7], input);
+ LOAD_DQCOEFF(in[15], input);
+ LOAD_DQCOEFF(in[23], input);
+ LOAD_DQCOEFF(in[31], input);
// checking if all entries are zero
- zero_idx[0] = _mm_or_si128(in0, in1);
- zero_idx[1] = _mm_or_si128(in2, in3);
- zero_idx[2] = _mm_or_si128(in4, in5);
- zero_idx[3] = _mm_or_si128(in6, in7);
- zero_idx[4] = _mm_or_si128(in8, in9);
- zero_idx[5] = _mm_or_si128(in10, in11);
- zero_idx[6] = _mm_or_si128(in12, in13);
- zero_idx[7] = _mm_or_si128(in14, in15);
- zero_idx[8] = _mm_or_si128(in16, in17);
- zero_idx[9] = _mm_or_si128(in18, in19);
- zero_idx[10] = _mm_or_si128(in20, in21);
- zero_idx[11] = _mm_or_si128(in22, in23);
- zero_idx[12] = _mm_or_si128(in24, in25);
- zero_idx[13] = _mm_or_si128(in26, in27);
- zero_idx[14] = _mm_or_si128(in28, in29);
- zero_idx[15] = _mm_or_si128(in30, in31);
+ zero_idx[0] = _mm_or_si128(in[0], in[1]);
+ zero_idx[1] = _mm_or_si128(in[2], in[3]);
+ zero_idx[2] = _mm_or_si128(in[4], in[5]);
+ zero_idx[3] = _mm_or_si128(in[6], in[7]);
+ zero_idx[4] = _mm_or_si128(in[8], in[9]);
+ zero_idx[5] = _mm_or_si128(in[10], in[11]);
+ zero_idx[6] = _mm_or_si128(in[12], in[13]);
+ zero_idx[7] = _mm_or_si128(in[14], in[15]);
+ zero_idx[8] = _mm_or_si128(in[16], in[17]);
+ zero_idx[9] = _mm_or_si128(in[18], in[19]);
+ zero_idx[10] = _mm_or_si128(in[20], in[21]);
+ zero_idx[11] = _mm_or_si128(in[22], in[23]);
+ zero_idx[12] = _mm_or_si128(in[24], in[25]);
+ zero_idx[13] = _mm_or_si128(in[26], in[27]);
+ zero_idx[14] = _mm_or_si128(in[28], in[29]);
+ zero_idx[15] = _mm_or_si128(in[30], in[31]);
zero_idx[0] = _mm_or_si128(zero_idx[0], zero_idx[1]);
zero_idx[1] = _mm_or_si128(zero_idx[2], zero_idx[3]);
@@ -3674,44 +3917,13 @@ void vp9_idct32x32_1024_add_sse2(const int16_t *input, uint8_t *dest,
}
// Transpose 32x8 block to 8x32 block
- TRANSPOSE_8X8(in0, in1, in2, in3, in4, in5, in6, in7, in0, in1, in2, in3,
- in4, in5, in6, in7);
- TRANSPOSE_8X8(in8, in9, in10, in11, in12, in13, in14, in15, in8, in9,
- in10, in11, in12, in13, in14, in15);
- TRANSPOSE_8X8(in16, in17, in18, in19, in20, in21, in22, in23, in16, in17,
- in18, in19, in20, in21, in22, in23);
- TRANSPOSE_8X8(in24, in25, in26, in27, in28, in29, in30, in31, in24, in25,
- in26, in27, in28, in29, in30, in31);
- } else {
- // Second 1-D idct
- j = i - 4;
-
- // Transpose 32x8 block to 8x32 block
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in0, in1, in2, in3, in4,
- in5, in6, in7);
- j += 4;
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in8, in9, in10,
- in11, in12, in13, in14, in15);
- j += 4;
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in16, in17, in18,
- in19, in20, in21, in22, in23);
- j += 4;
- TRANSPOSE_8X8(col[j * 8 + 0], col[j * 8 + 1], col[j * 8 + 2],
- col[j * 8 + 3], col[j * 8 + 4], col[j * 8 + 5],
- col[j * 8 + 6], col[j * 8 + 7], in24, in25, in26, in27,
- in28, in29, in30, in31);
- }
+ array_transpose_8x8(in, in);
+ array_transpose_8x8(in+8, in+8);
+ array_transpose_8x8(in+16, in+16);
+ array_transpose_8x8(in+24, in+24);
- IDCT32_1D
+ IDCT32
- // final stage
- if (i < 4) {
// 1_D: Store 32 intermediate results for each 8x32 block.
col[i32 + 0] = _mm_add_epi16(stp1_0, stp1_31);
col[i32 + 1] = _mm_add_epi16(stp1_1, stp1_30);
@@ -3745,146 +3957,156 @@ void vp9_idct32x32_1024_add_sse2(const int16_t *input, uint8_t *dest,
col[i32 + 29] = _mm_sub_epi16(stp1_2, stp1_29);
col[i32 + 30] = _mm_sub_epi16(stp1_1, stp1_30);
col[i32 + 31] = _mm_sub_epi16(stp1_0, stp1_31);
- } else {
+ }
+ for (i = 0; i < 4; i++) {
const __m128i zero = _mm_setzero_si128();
+ // Second 1-D idct
+ j = i << 3;
+
+ // Transpose 32x8 block to 8x32 block
+ array_transpose_8x8(col+j, in);
+ array_transpose_8x8(col+j+32, in+8);
+ array_transpose_8x8(col+j+64, in+16);
+ array_transpose_8x8(col+j+96, in+24);
+
+ IDCT32
// 2_D: Calculate the results and store them to destination.
- in0 = _mm_add_epi16(stp1_0, stp1_31);
- in1 = _mm_add_epi16(stp1_1, stp1_30);
- in2 = _mm_add_epi16(stp1_2, stp1_29);
- in3 = _mm_add_epi16(stp1_3, stp1_28);
- in4 = _mm_add_epi16(stp1_4, stp1_27);
- in5 = _mm_add_epi16(stp1_5, stp1_26);
- in6 = _mm_add_epi16(stp1_6, stp1_25);
- in7 = _mm_add_epi16(stp1_7, stp1_24);
- in8 = _mm_add_epi16(stp1_8, stp1_23);
- in9 = _mm_add_epi16(stp1_9, stp1_22);
- in10 = _mm_add_epi16(stp1_10, stp1_21);
- in11 = _mm_add_epi16(stp1_11, stp1_20);
- in12 = _mm_add_epi16(stp1_12, stp1_19);
- in13 = _mm_add_epi16(stp1_13, stp1_18);
- in14 = _mm_add_epi16(stp1_14, stp1_17);
- in15 = _mm_add_epi16(stp1_15, stp1_16);
- in16 = _mm_sub_epi16(stp1_15, stp1_16);
- in17 = _mm_sub_epi16(stp1_14, stp1_17);
- in18 = _mm_sub_epi16(stp1_13, stp1_18);
- in19 = _mm_sub_epi16(stp1_12, stp1_19);
- in20 = _mm_sub_epi16(stp1_11, stp1_20);
- in21 = _mm_sub_epi16(stp1_10, stp1_21);
- in22 = _mm_sub_epi16(stp1_9, stp1_22);
- in23 = _mm_sub_epi16(stp1_8, stp1_23);
- in24 = _mm_sub_epi16(stp1_7, stp1_24);
- in25 = _mm_sub_epi16(stp1_6, stp1_25);
- in26 = _mm_sub_epi16(stp1_5, stp1_26);
- in27 = _mm_sub_epi16(stp1_4, stp1_27);
- in28 = _mm_sub_epi16(stp1_3, stp1_28);
- in29 = _mm_sub_epi16(stp1_2, stp1_29);
- in30 = _mm_sub_epi16(stp1_1, stp1_30);
- in31 = _mm_sub_epi16(stp1_0, stp1_31);
+ in[0] = _mm_add_epi16(stp1_0, stp1_31);
+ in[1] = _mm_add_epi16(stp1_1, stp1_30);
+ in[2] = _mm_add_epi16(stp1_2, stp1_29);
+ in[3] = _mm_add_epi16(stp1_3, stp1_28);
+ in[4] = _mm_add_epi16(stp1_4, stp1_27);
+ in[5] = _mm_add_epi16(stp1_5, stp1_26);
+ in[6] = _mm_add_epi16(stp1_6, stp1_25);
+ in[7] = _mm_add_epi16(stp1_7, stp1_24);
+ in[8] = _mm_add_epi16(stp1_8, stp1_23);
+ in[9] = _mm_add_epi16(stp1_9, stp1_22);
+ in[10] = _mm_add_epi16(stp1_10, stp1_21);
+ in[11] = _mm_add_epi16(stp1_11, stp1_20);
+ in[12] = _mm_add_epi16(stp1_12, stp1_19);
+ in[13] = _mm_add_epi16(stp1_13, stp1_18);
+ in[14] = _mm_add_epi16(stp1_14, stp1_17);
+ in[15] = _mm_add_epi16(stp1_15, stp1_16);
+ in[16] = _mm_sub_epi16(stp1_15, stp1_16);
+ in[17] = _mm_sub_epi16(stp1_14, stp1_17);
+ in[18] = _mm_sub_epi16(stp1_13, stp1_18);
+ in[19] = _mm_sub_epi16(stp1_12, stp1_19);
+ in[20] = _mm_sub_epi16(stp1_11, stp1_20);
+ in[21] = _mm_sub_epi16(stp1_10, stp1_21);
+ in[22] = _mm_sub_epi16(stp1_9, stp1_22);
+ in[23] = _mm_sub_epi16(stp1_8, stp1_23);
+ in[24] = _mm_sub_epi16(stp1_7, stp1_24);
+ in[25] = _mm_sub_epi16(stp1_6, stp1_25);
+ in[26] = _mm_sub_epi16(stp1_5, stp1_26);
+ in[27] = _mm_sub_epi16(stp1_4, stp1_27);
+ in[28] = _mm_sub_epi16(stp1_3, stp1_28);
+ in[29] = _mm_sub_epi16(stp1_2, stp1_29);
+ in[30] = _mm_sub_epi16(stp1_1, stp1_30);
+ in[31] = _mm_sub_epi16(stp1_0, stp1_31);
// Final rounding and shift
- in0 = _mm_adds_epi16(in0, final_rounding);
- in1 = _mm_adds_epi16(in1, final_rounding);
- in2 = _mm_adds_epi16(in2, final_rounding);
- in3 = _mm_adds_epi16(in3, final_rounding);
- in4 = _mm_adds_epi16(in4, final_rounding);
- in5 = _mm_adds_epi16(in5, final_rounding);
- in6 = _mm_adds_epi16(in6, final_rounding);
- in7 = _mm_adds_epi16(in7, final_rounding);
- in8 = _mm_adds_epi16(in8, final_rounding);
- in9 = _mm_adds_epi16(in9, final_rounding);
- in10 = _mm_adds_epi16(in10, final_rounding);
- in11 = _mm_adds_epi16(in11, final_rounding);
- in12 = _mm_adds_epi16(in12, final_rounding);
- in13 = _mm_adds_epi16(in13, final_rounding);
- in14 = _mm_adds_epi16(in14, final_rounding);
- in15 = _mm_adds_epi16(in15, final_rounding);
- in16 = _mm_adds_epi16(in16, final_rounding);
- in17 = _mm_adds_epi16(in17, final_rounding);
- in18 = _mm_adds_epi16(in18, final_rounding);
- in19 = _mm_adds_epi16(in19, final_rounding);
- in20 = _mm_adds_epi16(in20, final_rounding);
- in21 = _mm_adds_epi16(in21, final_rounding);
- in22 = _mm_adds_epi16(in22, final_rounding);
- in23 = _mm_adds_epi16(in23, final_rounding);
- in24 = _mm_adds_epi16(in24, final_rounding);
- in25 = _mm_adds_epi16(in25, final_rounding);
- in26 = _mm_adds_epi16(in26, final_rounding);
- in27 = _mm_adds_epi16(in27, final_rounding);
- in28 = _mm_adds_epi16(in28, final_rounding);
- in29 = _mm_adds_epi16(in29, final_rounding);
- in30 = _mm_adds_epi16(in30, final_rounding);
- in31 = _mm_adds_epi16(in31, final_rounding);
-
- in0 = _mm_srai_epi16(in0, 6);
- in1 = _mm_srai_epi16(in1, 6);
- in2 = _mm_srai_epi16(in2, 6);
- in3 = _mm_srai_epi16(in3, 6);
- in4 = _mm_srai_epi16(in4, 6);
- in5 = _mm_srai_epi16(in5, 6);
- in6 = _mm_srai_epi16(in6, 6);
- in7 = _mm_srai_epi16(in7, 6);
- in8 = _mm_srai_epi16(in8, 6);
- in9 = _mm_srai_epi16(in9, 6);
- in10 = _mm_srai_epi16(in10, 6);
- in11 = _mm_srai_epi16(in11, 6);
- in12 = _mm_srai_epi16(in12, 6);
- in13 = _mm_srai_epi16(in13, 6);
- in14 = _mm_srai_epi16(in14, 6);
- in15 = _mm_srai_epi16(in15, 6);
- in16 = _mm_srai_epi16(in16, 6);
- in17 = _mm_srai_epi16(in17, 6);
- in18 = _mm_srai_epi16(in18, 6);
- in19 = _mm_srai_epi16(in19, 6);
- in20 = _mm_srai_epi16(in20, 6);
- in21 = _mm_srai_epi16(in21, 6);
- in22 = _mm_srai_epi16(in22, 6);
- in23 = _mm_srai_epi16(in23, 6);
- in24 = _mm_srai_epi16(in24, 6);
- in25 = _mm_srai_epi16(in25, 6);
- in26 = _mm_srai_epi16(in26, 6);
- in27 = _mm_srai_epi16(in27, 6);
- in28 = _mm_srai_epi16(in28, 6);
- in29 = _mm_srai_epi16(in29, 6);
- in30 = _mm_srai_epi16(in30, 6);
- in31 = _mm_srai_epi16(in31, 6);
-
- RECON_AND_STORE(dest, in0);
- RECON_AND_STORE(dest, in1);
- RECON_AND_STORE(dest, in2);
- RECON_AND_STORE(dest, in3);
- RECON_AND_STORE(dest, in4);
- RECON_AND_STORE(dest, in5);
- RECON_AND_STORE(dest, in6);
- RECON_AND_STORE(dest, in7);
- RECON_AND_STORE(dest, in8);
- RECON_AND_STORE(dest, in9);
- RECON_AND_STORE(dest, in10);
- RECON_AND_STORE(dest, in11);
- RECON_AND_STORE(dest, in12);
- RECON_AND_STORE(dest, in13);
- RECON_AND_STORE(dest, in14);
- RECON_AND_STORE(dest, in15);
- RECON_AND_STORE(dest, in16);
- RECON_AND_STORE(dest, in17);
- RECON_AND_STORE(dest, in18);
- RECON_AND_STORE(dest, in19);
- RECON_AND_STORE(dest, in20);
- RECON_AND_STORE(dest, in21);
- RECON_AND_STORE(dest, in22);
- RECON_AND_STORE(dest, in23);
- RECON_AND_STORE(dest, in24);
- RECON_AND_STORE(dest, in25);
- RECON_AND_STORE(dest, in26);
- RECON_AND_STORE(dest, in27);
- RECON_AND_STORE(dest, in28);
- RECON_AND_STORE(dest, in29);
- RECON_AND_STORE(dest, in30);
- RECON_AND_STORE(dest, in31);
+ in[0] = _mm_adds_epi16(in[0], final_rounding);
+ in[1] = _mm_adds_epi16(in[1], final_rounding);
+ in[2] = _mm_adds_epi16(in[2], final_rounding);
+ in[3] = _mm_adds_epi16(in[3], final_rounding);
+ in[4] = _mm_adds_epi16(in[4], final_rounding);
+ in[5] = _mm_adds_epi16(in[5], final_rounding);
+ in[6] = _mm_adds_epi16(in[6], final_rounding);
+ in[7] = _mm_adds_epi16(in[7], final_rounding);
+ in[8] = _mm_adds_epi16(in[8], final_rounding);
+ in[9] = _mm_adds_epi16(in[9], final_rounding);
+ in[10] = _mm_adds_epi16(in[10], final_rounding);
+ in[11] = _mm_adds_epi16(in[11], final_rounding);
+ in[12] = _mm_adds_epi16(in[12], final_rounding);
+ in[13] = _mm_adds_epi16(in[13], final_rounding);
+ in[14] = _mm_adds_epi16(in[14], final_rounding);
+ in[15] = _mm_adds_epi16(in[15], final_rounding);
+ in[16] = _mm_adds_epi16(in[16], final_rounding);
+ in[17] = _mm_adds_epi16(in[17], final_rounding);
+ in[18] = _mm_adds_epi16(in[18], final_rounding);
+ in[19] = _mm_adds_epi16(in[19], final_rounding);
+ in[20] = _mm_adds_epi16(in[20], final_rounding);
+ in[21] = _mm_adds_epi16(in[21], final_rounding);
+ in[22] = _mm_adds_epi16(in[22], final_rounding);
+ in[23] = _mm_adds_epi16(in[23], final_rounding);
+ in[24] = _mm_adds_epi16(in[24], final_rounding);
+ in[25] = _mm_adds_epi16(in[25], final_rounding);
+ in[26] = _mm_adds_epi16(in[26], final_rounding);
+ in[27] = _mm_adds_epi16(in[27], final_rounding);
+ in[28] = _mm_adds_epi16(in[28], final_rounding);
+ in[29] = _mm_adds_epi16(in[29], final_rounding);
+ in[30] = _mm_adds_epi16(in[30], final_rounding);
+ in[31] = _mm_adds_epi16(in[31], final_rounding);
+
+ in[0] = _mm_srai_epi16(in[0], 6);
+ in[1] = _mm_srai_epi16(in[1], 6);
+ in[2] = _mm_srai_epi16(in[2], 6);
+ in[3] = _mm_srai_epi16(in[3], 6);
+ in[4] = _mm_srai_epi16(in[4], 6);
+ in[5] = _mm_srai_epi16(in[5], 6);
+ in[6] = _mm_srai_epi16(in[6], 6);
+ in[7] = _mm_srai_epi16(in[7], 6);
+ in[8] = _mm_srai_epi16(in[8], 6);
+ in[9] = _mm_srai_epi16(in[9], 6);
+ in[10] = _mm_srai_epi16(in[10], 6);
+ in[11] = _mm_srai_epi16(in[11], 6);
+ in[12] = _mm_srai_epi16(in[12], 6);
+ in[13] = _mm_srai_epi16(in[13], 6);
+ in[14] = _mm_srai_epi16(in[14], 6);
+ in[15] = _mm_srai_epi16(in[15], 6);
+ in[16] = _mm_srai_epi16(in[16], 6);
+ in[17] = _mm_srai_epi16(in[17], 6);
+ in[18] = _mm_srai_epi16(in[18], 6);
+ in[19] = _mm_srai_epi16(in[19], 6);
+ in[20] = _mm_srai_epi16(in[20], 6);
+ in[21] = _mm_srai_epi16(in[21], 6);
+ in[22] = _mm_srai_epi16(in[22], 6);
+ in[23] = _mm_srai_epi16(in[23], 6);
+ in[24] = _mm_srai_epi16(in[24], 6);
+ in[25] = _mm_srai_epi16(in[25], 6);
+ in[26] = _mm_srai_epi16(in[26], 6);
+ in[27] = _mm_srai_epi16(in[27], 6);
+ in[28] = _mm_srai_epi16(in[28], 6);
+ in[29] = _mm_srai_epi16(in[29], 6);
+ in[30] = _mm_srai_epi16(in[30], 6);
+ in[31] = _mm_srai_epi16(in[31], 6);
+
+ RECON_AND_STORE(dest, in[0]);
+ RECON_AND_STORE(dest, in[1]);
+ RECON_AND_STORE(dest, in[2]);
+ RECON_AND_STORE(dest, in[3]);
+ RECON_AND_STORE(dest, in[4]);
+ RECON_AND_STORE(dest, in[5]);
+ RECON_AND_STORE(dest, in[6]);
+ RECON_AND_STORE(dest, in[7]);
+ RECON_AND_STORE(dest, in[8]);
+ RECON_AND_STORE(dest, in[9]);
+ RECON_AND_STORE(dest, in[10]);
+ RECON_AND_STORE(dest, in[11]);
+ RECON_AND_STORE(dest, in[12]);
+ RECON_AND_STORE(dest, in[13]);
+ RECON_AND_STORE(dest, in[14]);
+ RECON_AND_STORE(dest, in[15]);
+ RECON_AND_STORE(dest, in[16]);
+ RECON_AND_STORE(dest, in[17]);
+ RECON_AND_STORE(dest, in[18]);
+ RECON_AND_STORE(dest, in[19]);
+ RECON_AND_STORE(dest, in[20]);
+ RECON_AND_STORE(dest, in[21]);
+ RECON_AND_STORE(dest, in[22]);
+ RECON_AND_STORE(dest, in[23]);
+ RECON_AND_STORE(dest, in[24]);
+ RECON_AND_STORE(dest, in[25]);
+ RECON_AND_STORE(dest, in[26]);
+ RECON_AND_STORE(dest, in[27]);
+ RECON_AND_STORE(dest, in[28]);
+ RECON_AND_STORE(dest, in[29]);
+ RECON_AND_STORE(dest, in[30]);
+ RECON_AND_STORE(dest, in[31]);
dest += 8 - (stride * 32);
}
- }
} //NOLINT
void vp9_idct32x32_1_add_sse2(const int16_t *input, uint8_t *dest, int stride) {
diff --git a/libvpx/vp9/common/x86/vp9_loopfilter_intrin_avx2.c b/libvpx/vp9/common/x86/vp9_loopfilter_intrin_avx2.c
index 3c5cb8f..439c028 100644
--- a/libvpx/vp9/common/x86/vp9_loopfilter_intrin_avx2.c
+++ b/libvpx/vp9/common/x86/vp9_loopfilter_intrin_avx2.c
@@ -933,7 +933,7 @@ static void mb_lpf_horizontal_edge_w_avx2_16(unsigned char *s, int p,
}
}
-void vp9_mb_lpf_horizontal_edge_w_avx2(unsigned char *s, int p,
+void vp9_lpf_horizontal_16_avx2(unsigned char *s, int p,
const unsigned char *_blimit, const unsigned char *_limit,
const unsigned char *_thresh, int count) {
if (count == 1)
diff --git a/libvpx/vp9/common/x86/vp9_loopfilter_intrin_sse2.c b/libvpx/vp9/common/x86/vp9_loopfilter_intrin_sse2.c
index fa4dd9b..448ad5a 100644
--- a/libvpx/vp9/common/x86/vp9_loopfilter_intrin_sse2.c
+++ b/libvpx/vp9/common/x86/vp9_loopfilter_intrin_sse2.c
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <emmintrin.h> /* SSE2 */
+#include <emmintrin.h> // SSE2
#include "vp9/common/vp9_loopfilter.h"
#include "vpx_ports/emmintrin_compat.h"
@@ -17,20 +17,14 @@ static void mb_lpf_horizontal_edge_w_sse2_8(unsigned char *s,
const unsigned char *_blimit,
const unsigned char *_limit,
const unsigned char *_thresh) {
- __m128i mask, hev, flat, flat2;
const __m128i zero = _mm_set1_epi16(0);
const __m128i one = _mm_set1_epi8(1);
+ const __m128i blimit = _mm_load_si128((const __m128i *)_blimit);
+ const __m128i limit = _mm_load_si128((const __m128i *)_limit);
+ const __m128i thresh = _mm_load_si128((const __m128i *)_thresh);
+ __m128i mask, hev, flat, flat2;
__m128i q7p7, q6p6, q5p5, q4p4, q3p3, q2p2, q1p1, q0p0, p0q0, p1q1;
__m128i abs_p1p0;
- const unsigned int extended_thresh = _thresh[0] * 0x01010101u;
- const unsigned int extended_limit = _limit[0] * 0x01010101u;
- const unsigned int extended_blimit = _blimit[0] * 0x01010101u;
- const __m128i thresh =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_thresh), 0);
- const __m128i limit =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_limit), 0);
- const __m128i blimit =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_blimit), 0);
q4p4 = _mm_loadl_epi64((__m128i *)(s - 5 * p));
q4p4 = _mm_castps_si128(_mm_loadh_pi(_mm_castsi128_ps(q4p4),
@@ -105,7 +99,7 @@ static void mb_lpf_horizontal_edge_w_sse2_8(unsigned char *s,
filt = _mm_adds_epi8(filt, work_a);
filt = _mm_adds_epi8(filt, work_a);
filt = _mm_adds_epi8(filt, work_a);
- /* (vp9_filter + 3 * (qs0 - ps0)) & mask */
+ // (vp9_filter + 3 * (qs0 - ps0)) & mask
filt = _mm_and_si128(filt, mask);
filter1 = _mm_adds_epi8(filt, t4);
@@ -116,11 +110,11 @@ static void mb_lpf_horizontal_edge_w_sse2_8(unsigned char *s,
filter2 = _mm_unpacklo_epi8(zero, filter2);
filter2 = _mm_srai_epi16(filter2, 0xB);
- /* Filter1 >> 3 */
+ // Filter1 >> 3
filt = _mm_packs_epi16(filter2, _mm_subs_epi16(zero, filter1));
qs0ps0 = _mm_xor_si128(_mm_adds_epi8(qs0ps0, filt), t80);
- /* filt >> 1 */
+ // filt >> 1
filt = _mm_adds_epi16(filter1, t1);
filt = _mm_srai_epi16(filt, 1);
filt = _mm_andnot_si128(_mm_srai_epi16(_mm_unpacklo_epi8(zero, hev), 0x8),
@@ -375,32 +369,25 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
const unsigned char *_blimit,
const unsigned char *_limit,
const unsigned char *_thresh) {
- DECLARE_ALIGNED(16, unsigned char, flat2_op[7][16]);
- DECLARE_ALIGNED(16, unsigned char, flat2_oq[7][16]);
-
- DECLARE_ALIGNED(16, unsigned char, flat_op[3][16]);
- DECLARE_ALIGNED(16, unsigned char, flat_oq[3][16]);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat2_op, 7 * 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat2_oq, 7 * 16);
- DECLARE_ALIGNED(16, unsigned char, ap[8][16]);
- DECLARE_ALIGNED(16, unsigned char, aq[8][16]);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op, 3 * 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq, 3 * 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, ap, 8 * 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, aq, 8 * 16);
- __m128i mask, hev, flat, flat2;
const __m128i zero = _mm_set1_epi16(0);
const __m128i one = _mm_set1_epi8(1);
+ const __m128i blimit = _mm_load_si128((const __m128i *)_blimit);
+ const __m128i limit = _mm_load_si128((const __m128i *)_limit);
+ const __m128i thresh = _mm_load_si128((const __m128i *)_thresh);
+ __m128i mask, hev, flat, flat2;
__m128i p7, p6, p5;
__m128i p4, p3, p2, p1, p0, q0, q1, q2, q3, q4;
__m128i q5, q6, q7;
int i = 0;
- const unsigned int extended_thresh = _thresh[0] * 0x01010101u;
- const unsigned int extended_limit = _limit[0] * 0x01010101u;
- const unsigned int extended_blimit = _blimit[0] * 0x01010101u;
- const __m128i thresh =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_thresh), 0);
- const __m128i limit =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_limit), 0);
- const __m128i blimit =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_blimit), 0);
p4 = _mm_loadu_si128((__m128i *)(s - 5 * p));
p3 = _mm_loadu_si128((__m128i *)(s - 4 * p));
@@ -413,16 +400,16 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
q3 = _mm_loadu_si128((__m128i *)(s + 3 * p));
q4 = _mm_loadu_si128((__m128i *)(s + 4 * p));
- _mm_store_si128((__m128i *)ap[4], p4);
- _mm_store_si128((__m128i *)ap[3], p3);
- _mm_store_si128((__m128i *)ap[2], p2);
- _mm_store_si128((__m128i *)ap[1], p1);
- _mm_store_si128((__m128i *)ap[0], p0);
- _mm_store_si128((__m128i *)aq[4], q4);
- _mm_store_si128((__m128i *)aq[3], q3);
- _mm_store_si128((__m128i *)aq[2], q2);
- _mm_store_si128((__m128i *)aq[1], q1);
- _mm_store_si128((__m128i *)aq[0], q0);
+ _mm_store_si128((__m128i *)&ap[4 * 16], p4);
+ _mm_store_si128((__m128i *)&ap[3 * 16], p3);
+ _mm_store_si128((__m128i *)&ap[2 * 16], p2);
+ _mm_store_si128((__m128i *)&ap[1 * 16], p1);
+ _mm_store_si128((__m128i *)&ap[0 * 16], p0);
+ _mm_store_si128((__m128i *)&aq[4 * 16], q4);
+ _mm_store_si128((__m128i *)&aq[3 * 16], q3);
+ _mm_store_si128((__m128i *)&aq[2 * 16], q2);
+ _mm_store_si128((__m128i *)&aq[1 * 16], q1);
+ _mm_store_si128((__m128i *)&aq[0 * 16], q0);
{
@@ -486,13 +473,13 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
filt = _mm_adds_epi8(filt, work_a);
filt = _mm_adds_epi8(filt, work_a);
filt = _mm_adds_epi8(filt, work_a);
- /* (vp9_filter + 3 * (qs0 - ps0)) & mask */
+ // (vp9_filter + 3 * (qs0 - ps0)) & mask
filt = _mm_and_si128(filt, mask);
filter1 = _mm_adds_epi8(filt, t4);
filter2 = _mm_adds_epi8(filt, t3);
- /* Filter1 >> 3 */
+ // Filter1 >> 3
work_a = _mm_cmpgt_epi8(zero, filter1);
filter1 = _mm_srli_epi16(filter1, 3);
work_a = _mm_and_si128(work_a, te0);
@@ -500,7 +487,7 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
filter1 = _mm_or_si128(filter1, work_a);
qs0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
- /* Filter2 >> 3 */
+ // Filter2 >> 3
work_a = _mm_cmpgt_epi8(zero, filter2);
filter2 = _mm_srli_epi16(filter2, 3);
work_a = _mm_and_si128(work_a, te0);
@@ -508,7 +495,7 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
filter2 = _mm_or_si128(filter2, work_a);
ps0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
- /* filt >> 1 */
+ // filt >> 1
filt = _mm_adds_epi8(filter1, t1);
work_a = _mm_cmpgt_epi8(zero, filt);
filt = _mm_srli_epi16(filt, 1);
@@ -546,8 +533,8 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
_mm_subs_epu8(p0, p5)),
_mm_or_si128(_mm_subs_epu8(q5, q0),
_mm_subs_epu8(q0, q5)));
- _mm_store_si128((__m128i *)ap[5], p5);
- _mm_store_si128((__m128i *)aq[5], q5);
+ _mm_store_si128((__m128i *)&ap[5 * 16], p5);
+ _mm_store_si128((__m128i *)&aq[5 * 16], q5);
flat2 = _mm_max_epu8(work, flat2);
p6 = _mm_loadu_si128((__m128i *)(s - 7 * p));
q6 = _mm_loadu_si128((__m128i *)(s + 6 * p));
@@ -555,8 +542,8 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
_mm_subs_epu8(p0, p6)),
_mm_or_si128(_mm_subs_epu8(q6, q0),
_mm_subs_epu8(q0, q6)));
- _mm_store_si128((__m128i *)ap[6], p6);
- _mm_store_si128((__m128i *)aq[6], q6);
+ _mm_store_si128((__m128i *)&ap[6 * 16], p6);
+ _mm_store_si128((__m128i *)&aq[6 * 16], q6);
flat2 = _mm_max_epu8(work, flat2);
p7 = _mm_loadu_si128((__m128i *)(s - 8 * p));
@@ -565,8 +552,8 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
_mm_subs_epu8(p0, p7)),
_mm_or_si128(_mm_subs_epu8(q7, q0),
_mm_subs_epu8(q0, q7)));
- _mm_store_si128((__m128i *)ap[7], p7);
- _mm_store_si128((__m128i *)aq[7], q7);
+ _mm_store_si128((__m128i *)&ap[7 * 16], p7);
+ _mm_store_si128((__m128i *)&aq[7 * 16], q7);
flat2 = _mm_max_epu8(work, flat2);
flat2 = _mm_subs_epu8(flat2, one);
flat2 = _mm_cmpeq_epi8(flat2, zero);
@@ -586,22 +573,38 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
__m128i a, b, c;
unsigned int off = i * 8;
- p7 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[7] + off)), zero);
- p6 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[6] + off)), zero);
- p5 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[5] + off)), zero);
- p4 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[4] + off)), zero);
- p3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[3] + off)), zero);
- p2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[2] + off)), zero);
- p1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[1] + off)), zero);
- p0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(ap[0] + off)), zero);
- q0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[0] + off)), zero);
- q1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[1] + off)), zero);
- q2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[2] + off)), zero);
- q3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[3] + off)), zero);
- q4 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[4] + off)), zero);
- q5 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[5] + off)), zero);
- q6 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[6] + off)), zero);
- q7 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(aq[7] + off)), zero);
+ p7 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[7 * 16] + off)),
+ zero);
+ p6 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[6 * 16] + off)),
+ zero);
+ p5 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[5 * 16] + off)),
+ zero);
+ p4 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[4 * 16] + off)),
+ zero);
+ p3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[3 * 16] + off)),
+ zero);
+ p2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[2 * 16] + off)),
+ zero);
+ p1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[1 * 16] + off)),
+ zero);
+ p0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&ap[0 * 16] + off)),
+ zero);
+ q0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[0 * 16] + off)),
+ zero);
+ q1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[1 * 16] + off)),
+ zero);
+ q2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[2 * 16] + off)),
+ zero);
+ q3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[3 * 16] + off)),
+ zero);
+ q4 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[4 * 16] + off)),
+ zero);
+ q5 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[5 * 16] + off)),
+ zero);
+ q6 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[6 * 16] + off)),
+ zero);
+ q7 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(&aq[7 * 16] + off)),
+ zero);
c = _mm_sub_epi16(_mm_slli_epi16(p7, 3), p7); // p7 * 7
c = _mm_add_epi16(_mm_slli_epi16(p6, 1), _mm_add_epi16(p4, c));
@@ -610,117 +613,117 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
a = _mm_add_epi16(p3, _mm_add_epi16(p2, p1));
a = _mm_add_epi16(_mm_add_epi16(p0, q0), a);
- _mm_storel_epi64((__m128i *)&flat_op[2][i*8],
+ _mm_storel_epi64((__m128i *)&flat_op[2 * 16 + i * 8],
_mm_packus_epi16(_mm_srli_epi16(_mm_add_epi16(a, b), 3)
, b));
c = _mm_add_epi16(_mm_add_epi16(p5, eight), c);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[6][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[6 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q1, a);
b = _mm_add_epi16(_mm_sub_epi16(b, _mm_add_epi16(p3, p2)), p1);
- _mm_storel_epi64((__m128i *)&flat_op[1][i*8],
+ _mm_storel_epi64((__m128i *)&flat_op[1 * 16 + i * 8],
_mm_packus_epi16(_mm_srli_epi16(_mm_add_epi16(a, b), 3)
, b));
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p6)), p5);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[5][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[5 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q2, a);
b = _mm_add_epi16(_mm_sub_epi16(b, _mm_add_epi16(p3, p1)), p0);
- _mm_storel_epi64((__m128i *)&flat_op[0][i*8],
+ _mm_storel_epi64((__m128i *)&flat_op[i * 8],
_mm_packus_epi16(_mm_srli_epi16(_mm_add_epi16(a, b), 3)
, b));
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p5)), p4);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[4][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[4 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q3, a);
b = _mm_add_epi16(_mm_sub_epi16(b, _mm_add_epi16(p3, p0)), q0);
- _mm_storel_epi64((__m128i *)&flat_oq[0][i*8],
+ _mm_storel_epi64((__m128i *)&flat_oq[i * 8],
_mm_packus_epi16(_mm_srli_epi16(_mm_add_epi16(a, b), 3)
, b));
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p4)), p3);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[3][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[3 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
b = _mm_add_epi16(q3, b);
b = _mm_add_epi16(_mm_sub_epi16(b, _mm_add_epi16(p2, q0)), q1);
- _mm_storel_epi64((__m128i *)&flat_oq[1][i*8],
+ _mm_storel_epi64((__m128i *)&flat_oq[16 + i * 8],
_mm_packus_epi16(_mm_srli_epi16(_mm_add_epi16(a, b), 3)
, b));
c = _mm_add_epi16(q4, c);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p3)), p2);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[2][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[2 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
b = _mm_add_epi16(q3, b);
b = _mm_add_epi16(_mm_sub_epi16(b, _mm_add_epi16(p1, q1)), q2);
- _mm_storel_epi64((__m128i *)&flat_oq[2][i*8],
+ _mm_storel_epi64((__m128i *)&flat_oq[2 * 16 + i * 8],
_mm_packus_epi16(_mm_srli_epi16(_mm_add_epi16(a, b), 3)
, b));
a = _mm_add_epi16(q5, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p2)), p1);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[1][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q6, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p1)), p0);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_op[0][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_op[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p7, p0)), q0);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[0][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p6, q0)), q1);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[1][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p5, q1)), q2);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[2][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[2 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p4, q2)), q3);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[3][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[3 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p3, q3)), q4);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[4][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[4 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p2, q4)), q5);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[5][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[5 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
a = _mm_add_epi16(q7, a);
c = _mm_add_epi16(_mm_sub_epi16(c, _mm_add_epi16(p1, q5)), q6);
workp_shft = _mm_srli_epi16(_mm_add_epi16(a, c), 4);
- _mm_storel_epi64((__m128i *)&flat2_oq[6][i*8],
+ _mm_storel_epi64((__m128i *)&flat2_oq[6 * 16 + i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
temp_flat2 = _mm_srli_si128(temp_flat2, 8);
@@ -730,51 +733,51 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
// wide flat
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- work_a = _mm_load_si128((__m128i *)ap[2]);
- p2 = _mm_load_si128((__m128i *)flat_op[2]);
+ work_a = _mm_load_si128((__m128i *)&ap[2 * 16]);
+ p2 = _mm_load_si128((__m128i *)&flat_op[2 * 16]);
work_a = _mm_andnot_si128(flat, work_a);
p2 = _mm_and_si128(flat, p2);
p2 = _mm_or_si128(work_a, p2);
- _mm_store_si128((__m128i *)flat_op[2], p2);
+ _mm_store_si128((__m128i *)&flat_op[2 * 16], p2);
- p1 = _mm_load_si128((__m128i *)flat_op[1]);
+ p1 = _mm_load_si128((__m128i *)&flat_op[1 * 16]);
work_a = _mm_andnot_si128(flat, ps1);
p1 = _mm_and_si128(flat, p1);
p1 = _mm_or_si128(work_a, p1);
- _mm_store_si128((__m128i *)flat_op[1], p1);
+ _mm_store_si128((__m128i *)&flat_op[1 * 16], p1);
- p0 = _mm_load_si128((__m128i *)flat_op[0]);
+ p0 = _mm_load_si128((__m128i *)&flat_op[0]);
work_a = _mm_andnot_si128(flat, ps0);
p0 = _mm_and_si128(flat, p0);
p0 = _mm_or_si128(work_a, p0);
- _mm_store_si128((__m128i *)flat_op[0], p0);
+ _mm_store_si128((__m128i *)&flat_op[0], p0);
- q0 = _mm_load_si128((__m128i *)flat_oq[0]);
+ q0 = _mm_load_si128((__m128i *)&flat_oq[0]);
work_a = _mm_andnot_si128(flat, qs0);
q0 = _mm_and_si128(flat, q0);
q0 = _mm_or_si128(work_a, q0);
- _mm_store_si128((__m128i *)flat_oq[0], q0);
+ _mm_store_si128((__m128i *)&flat_oq[0], q0);
- q1 = _mm_load_si128((__m128i *)flat_oq[1]);
+ q1 = _mm_load_si128((__m128i *)&flat_oq[1 * 16]);
work_a = _mm_andnot_si128(flat, qs1);
q1 = _mm_and_si128(flat, q1);
q1 = _mm_or_si128(work_a, q1);
- _mm_store_si128((__m128i *)flat_oq[1], q1);
+ _mm_store_si128((__m128i *)&flat_oq[1 * 16], q1);
- work_a = _mm_load_si128((__m128i *)aq[2]);
- q2 = _mm_load_si128((__m128i *)flat_oq[2]);
+ work_a = _mm_load_si128((__m128i *)&aq[2 * 16]);
+ q2 = _mm_load_si128((__m128i *)&flat_oq[2 * 16]);
work_a = _mm_andnot_si128(flat, work_a);
q2 = _mm_and_si128(flat, q2);
q2 = _mm_or_si128(work_a, q2);
- _mm_store_si128((__m128i *)flat_oq[2], q2);
+ _mm_store_si128((__m128i *)&flat_oq[2 * 16], q2);
// write out op6 - op3
{
unsigned char *dst = (s - 7 * p);
for (i = 6; i > 2; i--) {
__m128i flat2_output;
- work_a = _mm_load_si128((__m128i *)ap[i]);
- flat2_output = _mm_load_si128((__m128i *)flat2_op[i]);
+ work_a = _mm_load_si128((__m128i *)&ap[i * 16]);
+ flat2_output = _mm_load_si128((__m128i *)&flat2_op[i * 16]);
work_a = _mm_andnot_si128(flat2, work_a);
flat2_output = _mm_and_si128(flat2, flat2_output);
work_a = _mm_or_si128(work_a, flat2_output);
@@ -783,43 +786,43 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
}
}
- work_a = _mm_load_si128((__m128i *)flat_op[2]);
- p2 = _mm_load_si128((__m128i *)flat2_op[2]);
+ work_a = _mm_load_si128((__m128i *)&flat_op[2 * 16]);
+ p2 = _mm_load_si128((__m128i *)&flat2_op[2 * 16]);
work_a = _mm_andnot_si128(flat2, work_a);
p2 = _mm_and_si128(flat2, p2);
p2 = _mm_or_si128(work_a, p2);
_mm_storeu_si128((__m128i *)(s - 3 * p), p2);
- work_a = _mm_load_si128((__m128i *)flat_op[1]);
- p1 = _mm_load_si128((__m128i *)flat2_op[1]);
+ work_a = _mm_load_si128((__m128i *)&flat_op[1 * 16]);
+ p1 = _mm_load_si128((__m128i *)&flat2_op[1 * 16]);
work_a = _mm_andnot_si128(flat2, work_a);
p1 = _mm_and_si128(flat2, p1);
p1 = _mm_or_si128(work_a, p1);
_mm_storeu_si128((__m128i *)(s - 2 * p), p1);
- work_a = _mm_load_si128((__m128i *)flat_op[0]);
- p0 = _mm_load_si128((__m128i *)flat2_op[0]);
+ work_a = _mm_load_si128((__m128i *)&flat_op[0]);
+ p0 = _mm_load_si128((__m128i *)&flat2_op[0]);
work_a = _mm_andnot_si128(flat2, work_a);
p0 = _mm_and_si128(flat2, p0);
p0 = _mm_or_si128(work_a, p0);
_mm_storeu_si128((__m128i *)(s - 1 * p), p0);
- work_a = _mm_load_si128((__m128i *)flat_oq[0]);
- q0 = _mm_load_si128((__m128i *)flat2_oq[0]);
+ work_a = _mm_load_si128((__m128i *)&flat_oq[0]);
+ q0 = _mm_load_si128((__m128i *)&flat2_oq[0]);
work_a = _mm_andnot_si128(flat2, work_a);
q0 = _mm_and_si128(flat2, q0);
q0 = _mm_or_si128(work_a, q0);
_mm_storeu_si128((__m128i *)(s - 0 * p), q0);
- work_a = _mm_load_si128((__m128i *)flat_oq[1]);
- q1 = _mm_load_si128((__m128i *)flat2_oq[1]);
+ work_a = _mm_load_si128((__m128i *)&flat_oq[1 * 16]);
+ q1 = _mm_load_si128((__m128i *)&flat2_oq[16]);
work_a = _mm_andnot_si128(flat2, work_a);
q1 = _mm_and_si128(flat2, q1);
q1 = _mm_or_si128(work_a, q1);
_mm_storeu_si128((__m128i *)(s + 1 * p), q1);
- work_a = _mm_load_si128((__m128i *)flat_oq[2]);
- q2 = _mm_load_si128((__m128i *)flat2_oq[2]);
+ work_a = _mm_load_si128((__m128i *)&flat_oq[2 * 16]);
+ q2 = _mm_load_si128((__m128i *)&flat2_oq[2 * 16]);
work_a = _mm_andnot_si128(flat2, work_a);
q2 = _mm_and_si128(flat2, q2);
q2 = _mm_or_si128(work_a, q2);
@@ -830,8 +833,8 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
unsigned char *dst = (s + 3 * p);
for (i = 3; i < 7; i++) {
__m128i flat2_output;
- work_a = _mm_load_si128((__m128i *)aq[i]);
- flat2_output = _mm_load_si128((__m128i *)flat2_oq[i]);
+ work_a = _mm_load_si128((__m128i *)&aq[i * 16]);
+ flat2_output = _mm_load_si128((__m128i *)&flat2_oq[i * 16]);
work_a = _mm_andnot_si128(flat2, work_a);
flat2_output = _mm_and_si128(flat2, flat2_output);
work_a = _mm_or_si128(work_a, flat2_output);
@@ -842,52 +845,275 @@ static void mb_lpf_horizontal_edge_w_sse2_16(unsigned char *s,
}
}
-void vp9_mb_lpf_horizontal_edge_w_sse2(unsigned char *s,
- int p,
- const unsigned char *_blimit,
- const unsigned char *_limit,
- const unsigned char *_thresh,
- int count) {
+// TODO(yunqingwang): remove count and call these 2 functions(8 or 16) directly.
+void vp9_lpf_horizontal_16_sse2(unsigned char *s, int p,
+ const unsigned char *_blimit,
+ const unsigned char *_limit,
+ const unsigned char *_thresh, int count) {
if (count == 1)
mb_lpf_horizontal_edge_w_sse2_8(s, p, _blimit, _limit, _thresh);
else
mb_lpf_horizontal_edge_w_sse2_16(s, p, _blimit, _limit, _thresh);
}
-void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
- int p,
- const unsigned char *_blimit,
- const unsigned char *_limit,
- const unsigned char *_thresh,
- int count) {
- DECLARE_ALIGNED(16, unsigned char, flat_op2[16]);
- DECLARE_ALIGNED(16, unsigned char, flat_op1[16]);
- DECLARE_ALIGNED(16, unsigned char, flat_op0[16]);
- DECLARE_ALIGNED(16, unsigned char, flat_oq2[16]);
- DECLARE_ALIGNED(16, unsigned char, flat_oq1[16]);
- DECLARE_ALIGNED(16, unsigned char, flat_oq0[16]);
- __m128i mask, hev, flat;
+void vp9_lpf_horizontal_8_sse2(unsigned char *s, int p,
+ const unsigned char *_blimit,
+ const unsigned char *_limit,
+ const unsigned char *_thresh, int count) {
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op2, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op1, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op0, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq2, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq1, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq0, 16);
const __m128i zero = _mm_set1_epi16(0);
+ const __m128i blimit = _mm_load_si128((const __m128i *)_blimit);
+ const __m128i limit = _mm_load_si128((const __m128i *)_limit);
+ const __m128i thresh = _mm_load_si128((const __m128i *)_thresh);
+ __m128i mask, hev, flat;
__m128i p3, p2, p1, p0, q0, q1, q2, q3;
- const unsigned int extended_thresh = _thresh[0] * 0x01010101u;
- const unsigned int extended_limit = _limit[0] * 0x01010101u;
- const unsigned int extended_blimit = _blimit[0] * 0x01010101u;
- const __m128i thresh =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_thresh), 0);
- const __m128i limit =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_limit), 0);
- const __m128i blimit =
- _mm_shuffle_epi32(_mm_cvtsi32_si128((int)extended_blimit), 0);
+ __m128i q3p3, q2p2, q1p1, q0p0, p1q1, p0q0;
(void)count;
- p3 = _mm_loadl_epi64((__m128i *)(s - 4 * p));
- p2 = _mm_loadl_epi64((__m128i *)(s - 3 * p));
- p1 = _mm_loadl_epi64((__m128i *)(s - 2 * p));
- p0 = _mm_loadl_epi64((__m128i *)(s - 1 * p));
- q0 = _mm_loadl_epi64((__m128i *)(s - 0 * p));
- q1 = _mm_loadl_epi64((__m128i *)(s + 1 * p));
- q2 = _mm_loadl_epi64((__m128i *)(s + 2 * p));
- q3 = _mm_loadl_epi64((__m128i *)(s + 3 * p));
+
+ q3p3 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 4 * p)),
+ _mm_loadl_epi64((__m128i *)(s + 3 * p)));
+ q2p2 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 3 * p)),
+ _mm_loadl_epi64((__m128i *)(s + 2 * p)));
+ q1p1 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 2 * p)),
+ _mm_loadl_epi64((__m128i *)(s + 1 * p)));
+ q0p0 = _mm_unpacklo_epi64(_mm_loadl_epi64((__m128i *)(s - 1 * p)),
+ _mm_loadl_epi64((__m128i *)(s - 0 * p)));
+ p1q1 = _mm_shuffle_epi32(q1p1, 78);
+ p0q0 = _mm_shuffle_epi32(q0p0, 78);
+
+ {
+ // filter_mask and hev_mask
+ const __m128i one = _mm_set1_epi8(1);
+ const __m128i fe = _mm_set1_epi8(0xfe);
+ const __m128i ff = _mm_cmpeq_epi8(fe, fe);
+ __m128i abs_p1q1, abs_p0q0, abs_q1q0, abs_p1p0, work;
+ abs_p1p0 = _mm_or_si128(_mm_subs_epu8(q1p1, q0p0),
+ _mm_subs_epu8(q0p0, q1p1));
+ abs_q1q0 = _mm_srli_si128(abs_p1p0, 8);
+
+ abs_p0q0 = _mm_or_si128(_mm_subs_epu8(q0p0, p0q0),
+ _mm_subs_epu8(p0q0, q0p0));
+ abs_p1q1 = _mm_or_si128(_mm_subs_epu8(q1p1, p1q1),
+ _mm_subs_epu8(p1q1, q1p1));
+ flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
+ hev = _mm_subs_epu8(flat, thresh);
+ hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
+
+ abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0);
+ abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
+ mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit);
+ mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
+ // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1;
+ mask = _mm_max_epu8(abs_p1p0, mask);
+ // mask |= (abs(p1 - p0) > limit) * -1;
+ // mask |= (abs(q1 - q0) > limit) * -1;
+
+ work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(q2p2, q1p1),
+ _mm_subs_epu8(q1p1, q2p2)),
+ _mm_or_si128(_mm_subs_epu8(q3p3, q2p2),
+ _mm_subs_epu8(q2p2, q3p3)));
+ mask = _mm_max_epu8(work, mask);
+ mask = _mm_max_epu8(mask, _mm_srli_si128(mask, 8));
+ mask = _mm_subs_epu8(mask, limit);
+ mask = _mm_cmpeq_epi8(mask, zero);
+
+ // flat_mask4
+
+ flat = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(q2p2, q0p0),
+ _mm_subs_epu8(q0p0, q2p2)),
+ _mm_or_si128(_mm_subs_epu8(q3p3, q0p0),
+ _mm_subs_epu8(q0p0, q3p3)));
+ flat = _mm_max_epu8(abs_p1p0, flat);
+ flat = _mm_max_epu8(flat, _mm_srli_si128(flat, 8));
+ flat = _mm_subs_epu8(flat, one);
+ flat = _mm_cmpeq_epi8(flat, zero);
+ flat = _mm_and_si128(flat, mask);
+ }
+
+ {
+ const __m128i four = _mm_set1_epi16(4);
+ unsigned char *src = s;
+ {
+ __m128i workp_a, workp_b, workp_shft;
+ p3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 4 * p)), zero);
+ p2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 3 * p)), zero);
+ p1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 2 * p)), zero);
+ p0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 1 * p)), zero);
+ q0 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 0 * p)), zero);
+ q1 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 1 * p)), zero);
+ q2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 2 * p)), zero);
+ q3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src + 3 * p)), zero);
+
+ workp_a = _mm_add_epi16(_mm_add_epi16(p3, p3), _mm_add_epi16(p2, p1));
+ workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0);
+ workp_b = _mm_add_epi16(_mm_add_epi16(q0, p2), p3);
+ workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
+ _mm_storel_epi64((__m128i *)&flat_op2[0],
+ _mm_packus_epi16(workp_shft, workp_shft));
+
+ workp_b = _mm_add_epi16(_mm_add_epi16(q0, q1), p1);
+ workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
+ _mm_storel_epi64((__m128i *)&flat_op1[0],
+ _mm_packus_epi16(workp_shft, workp_shft));
+
+ workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q2);
+ workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1), p0);
+ workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
+ _mm_storel_epi64((__m128i *)&flat_op0[0],
+ _mm_packus_epi16(workp_shft, workp_shft));
+
+ workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q3);
+ workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0), q0);
+ workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
+ _mm_storel_epi64((__m128i *)&flat_oq0[0],
+ _mm_packus_epi16(workp_shft, workp_shft));
+
+ workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2), q3);
+ workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0), q1);
+ workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
+ _mm_storel_epi64((__m128i *)&flat_oq1[0],
+ _mm_packus_epi16(workp_shft, workp_shft));
+
+ workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1), q3);
+ workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1), q2);
+ workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
+ _mm_storel_epi64((__m128i *)&flat_oq2[0],
+ _mm_packus_epi16(workp_shft, workp_shft));
+ }
+ }
+ // lp filter
+ {
+ const __m128i t4 = _mm_set1_epi8(4);
+ const __m128i t3 = _mm_set1_epi8(3);
+ const __m128i t80 = _mm_set1_epi8(0x80);
+ const __m128i t1 = _mm_set1_epi8(0x1);
+ const __m128i ps1 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s - 2 * p)),
+ t80);
+ const __m128i ps0 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s - 1 * p)),
+ t80);
+ const __m128i qs0 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s + 0 * p)),
+ t80);
+ const __m128i qs1 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s + 1 * p)),
+ t80);
+ __m128i filt;
+ __m128i work_a;
+ __m128i filter1, filter2;
+
+ filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev);
+ work_a = _mm_subs_epi8(qs0, ps0);
+ filt = _mm_adds_epi8(filt, work_a);
+ filt = _mm_adds_epi8(filt, work_a);
+ filt = _mm_adds_epi8(filt, work_a);
+ // (vp9_filter + 3 * (qs0 - ps0)) & mask
+ filt = _mm_and_si128(filt, mask);
+
+ filter1 = _mm_adds_epi8(filt, t4);
+ filter2 = _mm_adds_epi8(filt, t3);
+
+ // Filter1 >> 3
+ filter1 = _mm_unpacklo_epi8(zero, filter1);
+ filter1 = _mm_srai_epi16(filter1, 11);
+ filter1 = _mm_packs_epi16(filter1, filter1);
+
+ // Filter2 >> 3
+ filter2 = _mm_unpacklo_epi8(zero, filter2);
+ filter2 = _mm_srai_epi16(filter2, 11);
+ filter2 = _mm_packs_epi16(filter2, zero);
+
+ // filt >> 1
+ filt = _mm_adds_epi8(filter1, t1);
+ filt = _mm_unpacklo_epi8(zero, filt);
+ filt = _mm_srai_epi16(filt, 9);
+ filt = _mm_packs_epi16(filt, zero);
+
+ filt = _mm_andnot_si128(hev, filt);
+
+ work_a = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
+ q0 = _mm_loadl_epi64((__m128i *)flat_oq0);
+ work_a = _mm_andnot_si128(flat, work_a);
+ q0 = _mm_and_si128(flat, q0);
+ q0 = _mm_or_si128(work_a, q0);
+
+ work_a = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80);
+ q1 = _mm_loadl_epi64((__m128i *)flat_oq1);
+ work_a = _mm_andnot_si128(flat, work_a);
+ q1 = _mm_and_si128(flat, q1);
+ q1 = _mm_or_si128(work_a, q1);
+
+ work_a = _mm_loadu_si128((__m128i *)(s + 2 * p));
+ q2 = _mm_loadl_epi64((__m128i *)flat_oq2);
+ work_a = _mm_andnot_si128(flat, work_a);
+ q2 = _mm_and_si128(flat, q2);
+ q2 = _mm_or_si128(work_a, q2);
+
+ work_a = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
+ p0 = _mm_loadl_epi64((__m128i *)flat_op0);
+ work_a = _mm_andnot_si128(flat, work_a);
+ p0 = _mm_and_si128(flat, p0);
+ p0 = _mm_or_si128(work_a, p0);
+
+ work_a = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80);
+ p1 = _mm_loadl_epi64((__m128i *)flat_op1);
+ work_a = _mm_andnot_si128(flat, work_a);
+ p1 = _mm_and_si128(flat, p1);
+ p1 = _mm_or_si128(work_a, p1);
+
+ work_a = _mm_loadu_si128((__m128i *)(s - 3 * p));
+ p2 = _mm_loadl_epi64((__m128i *)flat_op2);
+ work_a = _mm_andnot_si128(flat, work_a);
+ p2 = _mm_and_si128(flat, p2);
+ p2 = _mm_or_si128(work_a, p2);
+
+ _mm_storel_epi64((__m128i *)(s - 3 * p), p2);
+ _mm_storel_epi64((__m128i *)(s - 2 * p), p1);
+ _mm_storel_epi64((__m128i *)(s - 1 * p), p0);
+ _mm_storel_epi64((__m128i *)(s + 0 * p), q0);
+ _mm_storel_epi64((__m128i *)(s + 1 * p), q1);
+ _mm_storel_epi64((__m128i *)(s + 2 * p), q2);
+ }
+}
+
+void vp9_lpf_horizontal_8_dual_sse2(uint8_t *s, int p,
+ const uint8_t *_blimit0,
+ const uint8_t *_limit0,
+ const uint8_t *_thresh0,
+ const uint8_t *_blimit1,
+ const uint8_t *_limit1,
+ const uint8_t *_thresh1) {
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op2, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op1, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_op0, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq2, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq1, 16);
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, flat_oq0, 16);
+ const __m128i zero = _mm_set1_epi16(0);
+ const __m128i blimit =
+ _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_blimit0),
+ _mm_load_si128((const __m128i *)_blimit1));
+ const __m128i limit =
+ _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_limit0),
+ _mm_load_si128((const __m128i *)_limit1));
+ const __m128i thresh =
+ _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_thresh0),
+ _mm_load_si128((const __m128i *)_thresh1));
+
+ __m128i mask, hev, flat;
+ __m128i p3, p2, p1, p0, q0, q1, q2, q3;
+
+ p3 = _mm_loadu_si128((__m128i *)(s - 4 * p));
+ p2 = _mm_loadu_si128((__m128i *)(s - 3 * p));
+ p1 = _mm_loadu_si128((__m128i *)(s - 2 * p));
+ p0 = _mm_loadu_si128((__m128i *)(s - 1 * p));
+ q0 = _mm_loadu_si128((__m128i *)(s - 0 * p));
+ q1 = _mm_loadu_si128((__m128i *)(s + 1 * p));
+ q2 = _mm_loadu_si128((__m128i *)(s + 2 * p));
+ q3 = _mm_loadu_si128((__m128i *)(s + 3 * p));
{
const __m128i abs_p1p0 = _mm_or_si128(_mm_subs_epu8(p1, p0),
_mm_subs_epu8(p0, p1));
@@ -901,6 +1127,8 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
__m128i abs_p1q1 = _mm_or_si128(_mm_subs_epu8(p1, q1),
_mm_subs_epu8(q1, p1));
__m128i work;
+
+ // filter_mask and hev_mask
flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
hev = _mm_subs_epu8(flat, thresh);
hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
@@ -926,6 +1154,7 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
mask = _mm_subs_epu8(mask, limit);
mask = _mm_cmpeq_epi8(mask, zero);
+ // flat_mask4
work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(p2, p0),
_mm_subs_epu8(p0, p2)),
_mm_or_si128(_mm_subs_epu8(q2, q0),
@@ -943,7 +1172,9 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
{
const __m128i four = _mm_set1_epi16(4);
unsigned char *src = s;
- {
+ int i = 0;
+
+ do {
__m128i workp_a, workp_b, workp_shft;
p3 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 4 * p)), zero);
p2 = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i *)(src - 3 * p)), zero);
@@ -958,38 +1189,40 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
workp_a = _mm_add_epi16(_mm_add_epi16(workp_a, four), p0);
workp_b = _mm_add_epi16(_mm_add_epi16(q0, p2), p3);
workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
- _mm_storel_epi64((__m128i *)&flat_op2[0],
+ _mm_storel_epi64((__m128i *)&flat_op2[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
workp_b = _mm_add_epi16(_mm_add_epi16(q0, q1), p1);
workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
- _mm_storel_epi64((__m128i *)&flat_op1[0],
+ _mm_storel_epi64((__m128i *)&flat_op1[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q2);
workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p1), p0);
workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
- _mm_storel_epi64((__m128i *)&flat_op0[0],
+ _mm_storel_epi64((__m128i *)&flat_op0[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p3), q3);
workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, p0), q0);
workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
- _mm_storel_epi64((__m128i *)&flat_oq0[0],
+ _mm_storel_epi64((__m128i *)&flat_oq0[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p2), q3);
workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q0), q1);
workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
- _mm_storel_epi64((__m128i *)&flat_oq1[0],
+ _mm_storel_epi64((__m128i *)&flat_oq1[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
workp_a = _mm_add_epi16(_mm_sub_epi16(workp_a, p1), q3);
workp_b = _mm_add_epi16(_mm_sub_epi16(workp_b, q1), q2);
workp_shft = _mm_srli_epi16(_mm_add_epi16(workp_a, workp_b), 3);
- _mm_storel_epi64((__m128i *)&flat_oq2[0],
+ _mm_storel_epi64((__m128i *)&flat_oq2[i * 8],
_mm_packus_epi16(workp_shft, workp_shft));
- }
+
+ src += 8;
+ } while (++i < 2);
}
// lp filter
{
@@ -1001,13 +1234,13 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
const __m128i t1 = _mm_set1_epi8(0x1);
const __m128i t7f = _mm_set1_epi8(0x7f);
- const __m128i ps1 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s - 2 * p)),
+ const __m128i ps1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 2 * p)),
t80);
- const __m128i ps0 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s - 1 * p)),
+ const __m128i ps0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 1 * p)),
t80);
- const __m128i qs0 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s + 0 * p)),
+ const __m128i qs0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 0 * p)),
t80);
- const __m128i qs1 = _mm_xor_si128(_mm_loadl_epi64((__m128i *)(s + 1 * p)),
+ const __m128i qs1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 1 * p)),
t80);
__m128i filt;
__m128i work_a;
@@ -1018,27 +1251,27 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
filt = _mm_adds_epi8(filt, work_a);
filt = _mm_adds_epi8(filt, work_a);
filt = _mm_adds_epi8(filt, work_a);
- /* (vp9_filter + 3 * (qs0 - ps0)) & mask */
+ // (vp9_filter + 3 * (qs0 - ps0)) & mask
filt = _mm_and_si128(filt, mask);
filter1 = _mm_adds_epi8(filt, t4);
filter2 = _mm_adds_epi8(filt, t3);
- /* Filter1 >> 3 */
+ // Filter1 >> 3
work_a = _mm_cmpgt_epi8(zero, filter1);
filter1 = _mm_srli_epi16(filter1, 3);
work_a = _mm_and_si128(work_a, te0);
filter1 = _mm_and_si128(filter1, t1f);
filter1 = _mm_or_si128(filter1, work_a);
- /* Filter2 >> 3 */
+ // Filter2 >> 3
work_a = _mm_cmpgt_epi8(zero, filter2);
filter2 = _mm_srli_epi16(filter2, 3);
work_a = _mm_and_si128(work_a, te0);
filter2 = _mm_and_si128(filter2, t1f);
filter2 = _mm_or_si128(filter2, work_a);
- /* filt >> 1 */
+ // filt >> 1
filt = _mm_adds_epi8(filter1, t1);
work_a = _mm_cmpgt_epi8(zero, filt);
filt = _mm_srli_epi16(filt, 1);
@@ -1049,47 +1282,185 @@ void vp9_mbloop_filter_horizontal_edge_sse2(unsigned char *s,
filt = _mm_andnot_si128(hev, filt);
work_a = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
- q0 = _mm_loadl_epi64((__m128i *)flat_oq0);
+ q0 = _mm_load_si128((__m128i *)flat_oq0);
work_a = _mm_andnot_si128(flat, work_a);
q0 = _mm_and_si128(flat, q0);
q0 = _mm_or_si128(work_a, q0);
work_a = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80);
- q1 = _mm_loadl_epi64((__m128i *)flat_oq1);
+ q1 = _mm_load_si128((__m128i *)flat_oq1);
work_a = _mm_andnot_si128(flat, work_a);
q1 = _mm_and_si128(flat, q1);
q1 = _mm_or_si128(work_a, q1);
work_a = _mm_loadu_si128((__m128i *)(s + 2 * p));
- q2 = _mm_loadl_epi64((__m128i *)flat_oq2);
+ q2 = _mm_load_si128((__m128i *)flat_oq2);
work_a = _mm_andnot_si128(flat, work_a);
q2 = _mm_and_si128(flat, q2);
q2 = _mm_or_si128(work_a, q2);
work_a = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
- p0 = _mm_loadl_epi64((__m128i *)flat_op0);
+ p0 = _mm_load_si128((__m128i *)flat_op0);
work_a = _mm_andnot_si128(flat, work_a);
p0 = _mm_and_si128(flat, p0);
p0 = _mm_or_si128(work_a, p0);
work_a = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80);
- p1 = _mm_loadl_epi64((__m128i *)flat_op1);
+ p1 = _mm_load_si128((__m128i *)flat_op1);
work_a = _mm_andnot_si128(flat, work_a);
p1 = _mm_and_si128(flat, p1);
p1 = _mm_or_si128(work_a, p1);
work_a = _mm_loadu_si128((__m128i *)(s - 3 * p));
- p2 = _mm_loadl_epi64((__m128i *)flat_op2);
+ p2 = _mm_load_si128((__m128i *)flat_op2);
work_a = _mm_andnot_si128(flat, work_a);
p2 = _mm_and_si128(flat, p2);
p2 = _mm_or_si128(work_a, p2);
- _mm_storel_epi64((__m128i *)(s - 3 * p), p2);
- _mm_storel_epi64((__m128i *)(s - 2 * p), p1);
- _mm_storel_epi64((__m128i *)(s - 1 * p), p0);
- _mm_storel_epi64((__m128i *)(s + 0 * p), q0);
- _mm_storel_epi64((__m128i *)(s + 1 * p), q1);
- _mm_storel_epi64((__m128i *)(s + 2 * p), q2);
+ _mm_storeu_si128((__m128i *)(s - 3 * p), p2);
+ _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
+ _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
+ _mm_storeu_si128((__m128i *)(s + 0 * p), q0);
+ _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
+ _mm_storeu_si128((__m128i *)(s + 2 * p), q2);
+ }
+}
+
+void vp9_lpf_horizontal_4_dual_sse2(unsigned char *s, int p,
+ const unsigned char *_blimit0,
+ const unsigned char *_limit0,
+ const unsigned char *_thresh0,
+ const unsigned char *_blimit1,
+ const unsigned char *_limit1,
+ const unsigned char *_thresh1) {
+ const __m128i blimit =
+ _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_blimit0),
+ _mm_load_si128((const __m128i *)_blimit1));
+ const __m128i limit =
+ _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_limit0),
+ _mm_load_si128((const __m128i *)_limit1));
+ const __m128i thresh =
+ _mm_unpacklo_epi64(_mm_load_si128((const __m128i *)_thresh0),
+ _mm_load_si128((const __m128i *)_thresh1));
+ const __m128i zero = _mm_set1_epi16(0);
+ __m128i p3, p2, p1, p0, q0, q1, q2, q3;
+ __m128i mask, hev, flat;
+
+ p3 = _mm_loadu_si128((__m128i *)(s - 4 * p));
+ p2 = _mm_loadu_si128((__m128i *)(s - 3 * p));
+ p1 = _mm_loadu_si128((__m128i *)(s - 2 * p));
+ p0 = _mm_loadu_si128((__m128i *)(s - 1 * p));
+ q0 = _mm_loadu_si128((__m128i *)(s - 0 * p));
+ q1 = _mm_loadu_si128((__m128i *)(s + 1 * p));
+ q2 = _mm_loadu_si128((__m128i *)(s + 2 * p));
+ q3 = _mm_loadu_si128((__m128i *)(s + 3 * p));
+
+ // filter_mask and hev_mask
+ {
+ const __m128i abs_p1p0 = _mm_or_si128(_mm_subs_epu8(p1, p0),
+ _mm_subs_epu8(p0, p1));
+ const __m128i abs_q1q0 = _mm_or_si128(_mm_subs_epu8(q1, q0),
+ _mm_subs_epu8(q0, q1));
+ const __m128i fe = _mm_set1_epi8(0xfe);
+ const __m128i ff = _mm_cmpeq_epi8(abs_p1p0, abs_p1p0);
+ __m128i abs_p0q0 = _mm_or_si128(_mm_subs_epu8(p0, q0),
+ _mm_subs_epu8(q0, p0));
+ __m128i abs_p1q1 = _mm_or_si128(_mm_subs_epu8(p1, q1),
+ _mm_subs_epu8(q1, p1));
+ __m128i work;
+
+ flat = _mm_max_epu8(abs_p1p0, abs_q1q0);
+ hev = _mm_subs_epu8(flat, thresh);
+ hev = _mm_xor_si128(_mm_cmpeq_epi8(hev, zero), ff);
+
+ abs_p0q0 =_mm_adds_epu8(abs_p0q0, abs_p0q0);
+ abs_p1q1 = _mm_srli_epi16(_mm_and_si128(abs_p1q1, fe), 1);
+ mask = _mm_subs_epu8(_mm_adds_epu8(abs_p0q0, abs_p1q1), blimit);
+ mask = _mm_xor_si128(_mm_cmpeq_epi8(mask, zero), ff);
+ // mask |= (abs(p0 - q0) * 2 + abs(p1 - q1) / 2 > blimit) * -1;
+ mask = _mm_max_epu8(flat, mask);
+ // mask |= (abs(p1 - p0) > limit) * -1;
+ // mask |= (abs(q1 - q0) > limit) * -1;
+ work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(p2, p1),
+ _mm_subs_epu8(p1, p2)),
+ _mm_or_si128(_mm_subs_epu8(p3, p2),
+ _mm_subs_epu8(p2, p3)));
+ mask = _mm_max_epu8(work, mask);
+ work = _mm_max_epu8(_mm_or_si128(_mm_subs_epu8(q2, q1),
+ _mm_subs_epu8(q1, q2)),
+ _mm_or_si128(_mm_subs_epu8(q3, q2),
+ _mm_subs_epu8(q2, q3)));
+ mask = _mm_max_epu8(work, mask);
+ mask = _mm_subs_epu8(mask, limit);
+ mask = _mm_cmpeq_epi8(mask, zero);
+ }
+
+ // filter4
+ {
+ const __m128i t4 = _mm_set1_epi8(4);
+ const __m128i t3 = _mm_set1_epi8(3);
+ const __m128i t80 = _mm_set1_epi8(0x80);
+ const __m128i te0 = _mm_set1_epi8(0xe0);
+ const __m128i t1f = _mm_set1_epi8(0x1f);
+ const __m128i t1 = _mm_set1_epi8(0x1);
+ const __m128i t7f = _mm_set1_epi8(0x7f);
+
+ const __m128i ps1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 2 * p)),
+ t80);
+ const __m128i ps0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s - 1 * p)),
+ t80);
+ const __m128i qs0 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 0 * p)),
+ t80);
+ const __m128i qs1 = _mm_xor_si128(_mm_loadu_si128((__m128i *)(s + 1 * p)),
+ t80);
+ __m128i filt;
+ __m128i work_a;
+ __m128i filter1, filter2;
+
+ filt = _mm_and_si128(_mm_subs_epi8(ps1, qs1), hev);
+ work_a = _mm_subs_epi8(qs0, ps0);
+ filt = _mm_adds_epi8(filt, work_a);
+ filt = _mm_adds_epi8(filt, work_a);
+ filt = _mm_adds_epi8(filt, work_a);
+ // (vp9_filter + 3 * (qs0 - ps0)) & mask
+ filt = _mm_and_si128(filt, mask);
+
+ filter1 = _mm_adds_epi8(filt, t4);
+ filter2 = _mm_adds_epi8(filt, t3);
+
+ // Filter1 >> 3
+ work_a = _mm_cmpgt_epi8(zero, filter1);
+ filter1 = _mm_srli_epi16(filter1, 3);
+ work_a = _mm_and_si128(work_a, te0);
+ filter1 = _mm_and_si128(filter1, t1f);
+ filter1 = _mm_or_si128(filter1, work_a);
+
+ // Filter2 >> 3
+ work_a = _mm_cmpgt_epi8(zero, filter2);
+ filter2 = _mm_srli_epi16(filter2, 3);
+ work_a = _mm_and_si128(work_a, te0);
+ filter2 = _mm_and_si128(filter2, t1f);
+ filter2 = _mm_or_si128(filter2, work_a);
+
+ // filt >> 1
+ filt = _mm_adds_epi8(filter1, t1);
+ work_a = _mm_cmpgt_epi8(zero, filt);
+ filt = _mm_srli_epi16(filt, 1);
+ work_a = _mm_and_si128(work_a, t80);
+ filt = _mm_and_si128(filt, t7f);
+ filt = _mm_or_si128(filt, work_a);
+
+ filt = _mm_andnot_si128(hev, filt);
+
+ q0 = _mm_xor_si128(_mm_subs_epi8(qs0, filter1), t80);
+ q1 = _mm_xor_si128(_mm_subs_epi8(qs1, filt), t80);
+ p0 = _mm_xor_si128(_mm_adds_epi8(ps0, filter2), t80);
+ p1 = _mm_xor_si128(_mm_adds_epi8(ps1, filt), t80);
+
+ _mm_storeu_si128((__m128i *)(s - 2 * p), p1);
+ _mm_storeu_si128((__m128i *)(s - 1 * p), p0);
+ _mm_storeu_si128((__m128i *)(s + 0 * p), q0);
+ _mm_storeu_si128((__m128i *)(s + 1 * p), q1);
}
}
@@ -1098,7 +1469,7 @@ static INLINE void transpose8x16(unsigned char *in0, unsigned char *in1,
__m128i x0, x1, x2, x3, x4, x5, x6, x7;
__m128i x8, x9, x10, x11, x12, x13, x14, x15;
- /* Read in 16 lines */
+ // Read in 16 lines
x0 = _mm_loadl_epi64((__m128i *)in0);
x8 = _mm_loadl_epi64((__m128i *)in1);
x1 = _mm_loadl_epi64((__m128i *)(in0 + in_p));
@@ -1136,7 +1507,7 @@ static INLINE void transpose8x16(unsigned char *in0, unsigned char *in1,
x14 = _mm_unpacklo_epi32(x12, x13);
x15 = _mm_unpackhi_epi32(x12, x13);
- /* Store first 4-line result */
+ // Store first 4-line result
_mm_storeu_si128((__m128i *)out, _mm_unpacklo_epi64(x6, x14));
_mm_storeu_si128((__m128i *)(out + out_p), _mm_unpackhi_epi64(x6, x14));
_mm_storeu_si128((__m128i *)(out + 2 * out_p), _mm_unpacklo_epi64(x7, x15));
@@ -1152,7 +1523,7 @@ static INLINE void transpose8x16(unsigned char *in0, unsigned char *in1,
x14 = _mm_unpacklo_epi32(x12, x13);
x15 = _mm_unpackhi_epi32(x12, x13);
- /* Store second 4-line result */
+ // Store second 4-line result
_mm_storeu_si128((__m128i *)(out + 4 * out_p), _mm_unpacklo_epi64(x6, x14));
_mm_storeu_si128((__m128i *)(out + 5 * out_p), _mm_unpackhi_epi64(x6, x14));
_mm_storeu_si128((__m128i *)(out + 6 * out_p), _mm_unpacklo_epi64(x7, x15));
@@ -1222,61 +1593,124 @@ static INLINE void transpose(unsigned char *src[], int in_p,
} while (++idx8x8 < num_8x8_to_transpose);
}
-void vp9_mbloop_filter_vertical_edge_sse2(unsigned char *s,
- int p,
- const unsigned char *blimit,
- const unsigned char *limit,
- const unsigned char *thresh,
- int count) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 256);
+void vp9_lpf_vertical_4_dual_sse2(uint8_t *s, int p, const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 16 * 8);
unsigned char *src[2];
unsigned char *dst[2];
- (void)count;
- /* Transpose 16x16 */
- transpose8x16(s - 8, s - 8 + p * 8, p, t_dst, 16);
- transpose8x16(s, s + p * 8, p, t_dst + 16 * 8, 16);
-
- /* Loop filtering */
- vp9_mbloop_filter_horizontal_edge_sse2(t_dst + 8 * 16, 16, blimit, limit,
- thresh, 1);
- src[0] = t_dst + 3 * 16;
- src[1] = t_dst + 3 * 16 + 8;
+ // Transpose 8x16
+ transpose8x16(s - 4, s - 4 + p * 8, p, t_dst, 16);
- dst[0] = s - 5;
- dst[1] = s - 5 + p * 8;
+ // Loop filtering
+ vp9_lpf_horizontal_4_dual_sse2(t_dst + 4 * 16, 16, blimit0, limit0, thresh0,
+ blimit1, limit1, thresh1);
+ src[0] = t_dst;
+ src[1] = t_dst + 8;
+ dst[0] = s - 4;
+ dst[1] = s - 4 + p * 8;
- /* Transpose 16x8 */
+ // Transpose back
transpose(src, 16, dst, p, 2);
}
-void vp9_mb_lpf_vertical_edge_w_sse2(unsigned char *s,
- int p,
- const unsigned char *blimit,
- const unsigned char *limit,
- const unsigned char *thresh) {
- DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 256);
- unsigned char *src[4];
- unsigned char *dst[4];
+void vp9_lpf_vertical_8_sse2(unsigned char *s, int p,
+ const unsigned char *blimit,
+ const unsigned char *limit,
+ const unsigned char *thresh, int count) {
+ DECLARE_ALIGNED_ARRAY(8, unsigned char, t_dst, 8 * 8);
+ unsigned char *src[1];
+ unsigned char *dst[1];
+ (void)count;
+ // Transpose 8x8
+ src[0] = s - 4;
dst[0] = t_dst;
- dst[1] = t_dst + 8 * 16;
- src[0] = s - 8;
- src[1] = s - 8 + 8;
+ transpose(src, p, dst, 8, 1);
+
+ // Loop filtering
+ vp9_lpf_horizontal_8_sse2(t_dst + 4 * 8, 8, blimit, limit, thresh, 1);
+
+ src[0] = t_dst;
+ dst[0] = s - 4;
- /* Transpose 16x16 */
- transpose(src, p, dst, 16, 2);
+ // Transpose back
+ transpose(src, 8, dst, p, 1);
+}
+
+void vp9_lpf_vertical_8_dual_sse2(uint8_t *s, int p, const uint8_t *blimit0,
+ const uint8_t *limit0,
+ const uint8_t *thresh0,
+ const uint8_t *blimit1,
+ const uint8_t *limit1,
+ const uint8_t *thresh1) {
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 16 * 8);
+ unsigned char *src[2];
+ unsigned char *dst[2];
- /* Loop filtering */
- vp9_mb_lpf_horizontal_edge_w_sse2(t_dst + 8 * 16, 16, blimit, limit,
- thresh, 1);
+ // Transpose 8x16
+ transpose8x16(s - 4, s - 4 + p * 8, p, t_dst, 16);
+ // Loop filtering
+ vp9_lpf_horizontal_8_dual_sse2(t_dst + 4 * 16, 16, blimit0, limit0, thresh0,
+ blimit1, limit1, thresh1);
src[0] = t_dst;
- src[1] = t_dst + 8 * 16;
+ src[1] = t_dst + 8;
- dst[0] = s - 8;
- dst[1] = s - 8 + 8;
+ dst[0] = s - 4;
+ dst[1] = s - 4 + p * 8;
+ // Transpose back
transpose(src, 16, dst, p, 2);
}
+
+void vp9_lpf_vertical_16_sse2(unsigned char *s, int p,
+ const unsigned char *blimit,
+ const unsigned char *limit,
+ const unsigned char *thresh) {
+ DECLARE_ALIGNED_ARRAY(8, unsigned char, t_dst, 8 * 16);
+ unsigned char *src[2];
+ unsigned char *dst[2];
+
+ src[0] = s - 8;
+ src[1] = s;
+ dst[0] = t_dst;
+ dst[1] = t_dst + 8 * 8;
+
+ // Transpose 16x8
+ transpose(src, p, dst, 8, 2);
+
+ // Loop filtering
+ mb_lpf_horizontal_edge_w_sse2_8(t_dst + 8 * 8, 8, blimit, limit, thresh);
+
+ src[0] = t_dst;
+ src[1] = t_dst + 8 * 8;
+ dst[0] = s - 8;
+ dst[1] = s;
+
+ // Transpose back
+ transpose(src, 8, dst, p, 2);
+}
+
+void vp9_lpf_vertical_16_dual_sse2(unsigned char *s, int p,
+ const uint8_t *blimit, const uint8_t *limit,
+ const uint8_t *thresh) {
+ DECLARE_ALIGNED_ARRAY(16, unsigned char, t_dst, 256);
+
+ // Transpose 16x16
+ transpose8x16(s - 8, s - 8 + 8 * p, p, t_dst, 16);
+ transpose8x16(s, s + 8 * p, p, t_dst + 8 * 16, 16);
+
+ // Loop filtering
+ mb_lpf_horizontal_edge_w_sse2_16(t_dst + 8 * 16, 16, blimit, limit,
+ thresh);
+
+ // Transpose back
+ transpose8x16(t_dst, t_dst + 8 * 16, 16, s - 8, p);
+ transpose8x16(t_dst + 8, t_dst + 8 + 8 * 16, 16, s - 8 + 8 * p, p);
+}
diff --git a/libvpx/vp9/common/x86/vp9_loopfilter_mmx.asm b/libvpx/vp9/common/x86/vp9_loopfilter_mmx.asm
index 4ebb51b..91055b9 100644
--- a/libvpx/vp9/common/x86/vp9_loopfilter_mmx.asm
+++ b/libvpx/vp9/common/x86/vp9_loopfilter_mmx.asm
@@ -12,7 +12,7 @@
%include "vpx_ports/x86_abi_support.asm"
-;void vp9_loop_filter_horizontal_edge_mmx
+;void vp9_lpf_horizontal_4_mmx
;(
; unsigned char *src_ptr,
; int src_pixel_step,
@@ -21,8 +21,8 @@
; const char *thresh,
; int count
;)
-global sym(vp9_loop_filter_horizontal_edge_mmx) PRIVATE
-sym(vp9_loop_filter_horizontal_edge_mmx):
+global sym(vp9_lpf_horizontal_4_mmx) PRIVATE
+sym(vp9_lpf_horizontal_4_mmx):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
@@ -224,7 +224,7 @@ sym(vp9_loop_filter_horizontal_edge_mmx):
ret
-;void vp9_loop_filter_vertical_edge_mmx
+;void vp9_lpf_vertical_4_mmx
;(
; unsigned char *src_ptr,
; int src_pixel_step,
@@ -233,8 +233,8 @@ sym(vp9_loop_filter_horizontal_edge_mmx):
; const char *thresh,
; int count
;)
-global sym(vp9_loop_filter_vertical_edge_mmx) PRIVATE
-sym(vp9_loop_filter_vertical_edge_mmx):
+global sym(vp9_lpf_vertical_4_mmx) PRIVATE
+sym(vp9_lpf_vertical_4_mmx):
push rbp
mov rbp, rsp
SHADOW_ARGS_TO_STACK 6
@@ -527,7 +527,7 @@ sym(vp9_loop_filter_vertical_edge_mmx):
pxor mm7, [GLOBAL(t80)] ; unoffset
; mm7 = q1
- ; tranpose and write back
+ ; transpose and write back
; mm1 = 72 62 52 42 32 22 12 02
; mm6 = 73 63 53 43 33 23 13 03
; mm3 = 74 64 54 44 34 24 14 04
diff --git a/libvpx/vp9/common/x86/vp9_postproc_x86.h b/libvpx/vp9/common/x86/vp9_postproc_x86.h
index 8870215..cab9d34 100644
--- a/libvpx/vp9/common/x86/vp9_postproc_x86.h
+++ b/libvpx/vp9/common/x86/vp9_postproc_x86.h
@@ -12,6 +12,10 @@
#ifndef VP9_COMMON_X86_VP9_POSTPROC_X86_H_
#define VP9_COMMON_X86_VP9_POSTPROC_X86_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* Note:
*
* This platform is commonly built for runtime CPU detection. If you modify
@@ -61,4 +65,8 @@ extern prototype_postproc_addnoise(vp9_plane_add_noise_wmt);
#endif
#endif
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_COMMON_X86_VP9_POSTPROC_X86_H_
diff --git a/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c b/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
new file mode 100644
index 0000000..7e9cc84
--- /dev/null
+++ b/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_avx2.c
@@ -0,0 +1,543 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <immintrin.h>
+#include "vpx_ports/mem.h"
+
+// filters for 16_h8 and 16_v8
+DECLARE_ALIGNED(32, static const uint8_t, filt1_global_avx2[32]) = {
+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8,
+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8
+};
+
+DECLARE_ALIGNED(32, static const uint8_t, filt2_global_avx2[32]) = {
+ 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10,
+ 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10
+};
+
+DECLARE_ALIGNED(32, static const uint8_t, filt3_global_avx2[32]) = {
+ 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12,
+ 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12
+};
+
+DECLARE_ALIGNED(32, static const uint8_t, filt4_global_avx2[32]) = {
+ 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14,
+ 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14
+};
+
+#if defined(__clang__)
+# if __clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ <= 3)
+# define MM256_BROADCASTSI128_SI256(x) \
+ _mm_broadcastsi128_si256((__m128i const *)&(x))
+# else // clang > 3.3
+# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
+# endif // clang <= 3.3
+#elif defined(__GNUC__)
+# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ <= 6)
+# define MM256_BROADCASTSI128_SI256(x) \
+ _mm_broadcastsi128_si256((__m128i const *)&(x))
+# elif __GNUC__ == 4 && __GNUC_MINOR__ == 7
+# define MM256_BROADCASTSI128_SI256(x) _mm_broadcastsi128_si256(x)
+# else // gcc > 4.7
+# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
+# endif // gcc <= 4.6
+#else // !(gcc || clang)
+# define MM256_BROADCASTSI128_SI256(x) _mm256_broadcastsi128_si256(x)
+#endif // __clang__
+
+void vp9_filter_block1d16_h8_avx2(unsigned char *src_ptr,
+ unsigned int src_pixels_per_line,
+ unsigned char *output_ptr,
+ unsigned int output_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i filtersReg;
+ __m256i addFilterReg64, filt1Reg, filt2Reg, filt3Reg, filt4Reg;
+ __m256i firstFilters, secondFilters, thirdFilters, forthFilters;
+ __m256i srcRegFilt32b1_1, srcRegFilt32b2_1, srcRegFilt32b2, srcRegFilt32b3;
+ __m256i srcReg32b1, srcReg32b2, filtersReg32;
+ unsigned int i;
+ unsigned int src_stride, dst_stride;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 = _mm256_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the same data
+ // in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+ // have the same data in both lanes of a 256 bit register
+ filtersReg32 = MM256_BROADCASTSI128_SI256(filtersReg);
+
+ // duplicate only the first 16 bits (first and second byte)
+ // across 256 bit register
+ firstFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x100u));
+ // duplicate only the second 16 bits (third and forth byte)
+ // across 256 bit register
+ secondFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x302u));
+ // duplicate only the third 16 bits (fifth and sixth byte)
+ // across 256 bit register
+ thirdFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x504u));
+ // duplicate only the forth 16 bits (seventh and eighth byte)
+ // across 256 bit register
+ forthFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x706u));
+
+ filt1Reg = _mm256_load_si256((__m256i const *)filt1_global_avx2);
+ filt2Reg = _mm256_load_si256((__m256i const *)filt2_global_avx2);
+ filt3Reg = _mm256_load_si256((__m256i const *)filt3_global_avx2);
+ filt4Reg = _mm256_load_si256((__m256i const *)filt4_global_avx2);
+
+ // multiple the size of the source and destination stride by two
+ src_stride = src_pixels_per_line << 1;
+ dst_stride = output_pitch << 1;
+ for (i = output_height; i > 1; i-=2) {
+ // load the 2 strides of source
+ srcReg32b1 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr-3)));
+ srcReg32b1 = _mm256_inserti128_si256(srcReg32b1,
+ _mm_loadu_si128((__m128i *)
+ (src_ptr+src_pixels_per_line-3)), 1);
+
+ // filter the source buffer
+ srcRegFilt32b1_1= _mm256_shuffle_epi8(srcReg32b1, filt1Reg);
+ srcRegFilt32b2= _mm256_shuffle_epi8(srcReg32b1, filt2Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt32b1_1 = _mm256_maddubs_epi16(srcRegFilt32b1_1, firstFilters);
+ srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, secondFilters);
+
+ // add and saturate the results together
+ srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1, srcRegFilt32b2);
+
+ // filter the source buffer
+ srcRegFilt32b3= _mm256_shuffle_epi8(srcReg32b1, filt4Reg);
+ srcRegFilt32b2= _mm256_shuffle_epi8(srcReg32b1, filt3Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt32b3 = _mm256_maddubs_epi16(srcRegFilt32b3, forthFilters);
+ srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, thirdFilters);
+
+ // add and saturate the results together
+ srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1,
+ _mm256_min_epi16(srcRegFilt32b3, srcRegFilt32b2));
+
+ // reading 2 strides of the next 16 bytes
+ // (part of it was being read by earlier read)
+ srcReg32b2 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+5)));
+ srcReg32b2 = _mm256_inserti128_si256(srcReg32b2,
+ _mm_loadu_si128((__m128i *)
+ (src_ptr+src_pixels_per_line+5)), 1);
+
+ // add and saturate the results together
+ srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1,
+ _mm256_max_epi16(srcRegFilt32b3, srcRegFilt32b2));
+
+ // filter the source buffer
+ srcRegFilt32b2_1 = _mm256_shuffle_epi8(srcReg32b2, filt1Reg);
+ srcRegFilt32b2 = _mm256_shuffle_epi8(srcReg32b2, filt2Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt32b2_1 = _mm256_maddubs_epi16(srcRegFilt32b2_1, firstFilters);
+ srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, secondFilters);
+
+ // add and saturate the results together
+ srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1, srcRegFilt32b2);
+
+ // filter the source buffer
+ srcRegFilt32b3= _mm256_shuffle_epi8(srcReg32b2, filt4Reg);
+ srcRegFilt32b2= _mm256_shuffle_epi8(srcReg32b2, filt3Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt32b3 = _mm256_maddubs_epi16(srcRegFilt32b3, forthFilters);
+ srcRegFilt32b2 = _mm256_maddubs_epi16(srcRegFilt32b2, thirdFilters);
+
+ // add and saturate the results together
+ srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1,
+ _mm256_min_epi16(srcRegFilt32b3, srcRegFilt32b2));
+ srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1,
+ _mm256_max_epi16(srcRegFilt32b3, srcRegFilt32b2));
+
+
+ srcRegFilt32b1_1 = _mm256_adds_epi16(srcRegFilt32b1_1, addFilterReg64);
+
+ srcRegFilt32b2_1 = _mm256_adds_epi16(srcRegFilt32b2_1, addFilterReg64);
+
+ // shift by 7 bit each 16 bit
+ srcRegFilt32b1_1 = _mm256_srai_epi16(srcRegFilt32b1_1, 7);
+ srcRegFilt32b2_1 = _mm256_srai_epi16(srcRegFilt32b2_1, 7);
+
+ // shrink to 8 bit each 16 bits, the first lane contain the first
+ // convolve result and the second lane contain the second convolve
+ // result
+ srcRegFilt32b1_1 = _mm256_packus_epi16(srcRegFilt32b1_1,
+ srcRegFilt32b2_1);
+
+ src_ptr+=src_stride;
+
+ // save 16 bytes
+ _mm_store_si128((__m128i*)output_ptr,
+ _mm256_castsi256_si128(srcRegFilt32b1_1));
+
+ // save the next 16 bits
+ _mm_store_si128((__m128i*)(output_ptr+output_pitch),
+ _mm256_extractf128_si256(srcRegFilt32b1_1, 1));
+ output_ptr+=dst_stride;
+ }
+
+ // if the number of strides is odd.
+ // process only 16 bytes
+ if (i > 0) {
+ __m128i srcReg1, srcReg2, srcRegFilt1_1, srcRegFilt2_1;
+ __m128i srcRegFilt2, srcRegFilt3;
+
+ srcReg1 = _mm_loadu_si128((__m128i *)(src_ptr-3));
+
+ // filter the source buffer
+ srcRegFilt1_1 = _mm_shuffle_epi8(srcReg1,
+ _mm256_castsi256_si128(filt1Reg));
+ srcRegFilt2 = _mm_shuffle_epi8(srcReg1,
+ _mm256_castsi256_si128(filt2Reg));
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt1_1 = _mm_maddubs_epi16(srcRegFilt1_1,
+ _mm256_castsi256_si128(firstFilters));
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2,
+ _mm256_castsi256_si128(secondFilters));
+
+ // add and saturate the results together
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, srcRegFilt2);
+
+ // filter the source buffer
+ srcRegFilt3= _mm_shuffle_epi8(srcReg1,
+ _mm256_castsi256_si128(filt4Reg));
+ srcRegFilt2= _mm_shuffle_epi8(srcReg1,
+ _mm256_castsi256_si128(filt3Reg));
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3,
+ _mm256_castsi256_si128(forthFilters));
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2,
+ _mm256_castsi256_si128(thirdFilters));
+
+ // add and saturate the results together
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1,
+ _mm_min_epi16(srcRegFilt3, srcRegFilt2));
+
+ // reading the next 16 bytes
+ // (part of it was being read by earlier read)
+ srcReg2 = _mm_loadu_si128((__m128i *)(src_ptr+5));
+
+ // add and saturate the results together
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1,
+ _mm_max_epi16(srcRegFilt3, srcRegFilt2));
+
+ // filter the source buffer
+ srcRegFilt2_1 = _mm_shuffle_epi8(srcReg2,
+ _mm256_castsi256_si128(filt1Reg));
+ srcRegFilt2 = _mm_shuffle_epi8(srcReg2,
+ _mm256_castsi256_si128(filt2Reg));
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt2_1 = _mm_maddubs_epi16(srcRegFilt2_1,
+ _mm256_castsi256_si128(firstFilters));
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2,
+ _mm256_castsi256_si128(secondFilters));
+
+ // add and saturate the results together
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, srcRegFilt2);
+
+ // filter the source buffer
+ srcRegFilt3 = _mm_shuffle_epi8(srcReg2,
+ _mm256_castsi256_si128(filt4Reg));
+ srcRegFilt2 = _mm_shuffle_epi8(srcReg2,
+ _mm256_castsi256_si128(filt3Reg));
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3,
+ _mm256_castsi256_si128(forthFilters));
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2,
+ _mm256_castsi256_si128(thirdFilters));
+
+ // add and saturate the results together
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1,
+ _mm_min_epi16(srcRegFilt3, srcRegFilt2));
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1,
+ _mm_max_epi16(srcRegFilt3, srcRegFilt2));
+
+
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1,
+ _mm256_castsi256_si128(addFilterReg64));
+
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1,
+ _mm256_castsi256_si128(addFilterReg64));
+
+ // shift by 7 bit each 16 bit
+ srcRegFilt1_1 = _mm_srai_epi16(srcRegFilt1_1, 7);
+ srcRegFilt2_1 = _mm_srai_epi16(srcRegFilt2_1, 7);
+
+ // shrink to 8 bit each 16 bits, the first lane contain the first
+ // convolve result and the second lane contain the second convolve
+ // result
+ srcRegFilt1_1 = _mm_packus_epi16(srcRegFilt1_1, srcRegFilt2_1);
+
+ // save 16 bytes
+ _mm_store_si128((__m128i*)output_ptr, srcRegFilt1_1);
+ }
+}
+
+void vp9_filter_block1d16_v8_avx2(unsigned char *src_ptr,
+ unsigned int src_pitch,
+ unsigned char *output_ptr,
+ unsigned int out_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i filtersReg;
+ __m256i addFilterReg64;
+ __m256i srcReg32b1, srcReg32b2, srcReg32b3, srcReg32b4, srcReg32b5;
+ __m256i srcReg32b6, srcReg32b7, srcReg32b8, srcReg32b9, srcReg32b10;
+ __m256i srcReg32b11, srcReg32b12, srcReg32b13, filtersReg32;
+ __m256i firstFilters, secondFilters, thirdFilters, forthFilters;
+ unsigned int i;
+ unsigned int src_stride, dst_stride;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 = _mm256_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the
+ // same data in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+ // have the same data in both lanes of a 256 bit register
+ filtersReg32 = MM256_BROADCASTSI128_SI256(filtersReg);
+
+ // duplicate only the first 16 bits (first and second byte)
+ // across 256 bit register
+ firstFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x100u));
+ // duplicate only the second 16 bits (third and forth byte)
+ // across 256 bit register
+ secondFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x302u));
+ // duplicate only the third 16 bits (fifth and sixth byte)
+ // across 256 bit register
+ thirdFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x504u));
+ // duplicate only the forth 16 bits (seventh and eighth byte)
+ // across 256 bit register
+ forthFilters = _mm256_shuffle_epi8(filtersReg32,
+ _mm256_set1_epi16(0x706u));
+
+ // multiple the size of the source and destination stride by two
+ src_stride = src_pitch << 1;
+ dst_stride = out_pitch << 1;
+
+ // load 16 bytes 7 times in stride of src_pitch
+ srcReg32b1 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr)));
+ srcReg32b2 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch)));
+ srcReg32b3 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*2)));
+ srcReg32b4 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*3)));
+ srcReg32b5 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*4)));
+ srcReg32b6 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*5)));
+ srcReg32b7 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*6)));
+
+ // have each consecutive loads on the same 256 register
+ srcReg32b1 = _mm256_inserti128_si256(srcReg32b1,
+ _mm256_castsi256_si128(srcReg32b2), 1);
+ srcReg32b2 = _mm256_inserti128_si256(srcReg32b2,
+ _mm256_castsi256_si128(srcReg32b3), 1);
+ srcReg32b3 = _mm256_inserti128_si256(srcReg32b3,
+ _mm256_castsi256_si128(srcReg32b4), 1);
+ srcReg32b4 = _mm256_inserti128_si256(srcReg32b4,
+ _mm256_castsi256_si128(srcReg32b5), 1);
+ srcReg32b5 = _mm256_inserti128_si256(srcReg32b5,
+ _mm256_castsi256_si128(srcReg32b6), 1);
+ srcReg32b6 = _mm256_inserti128_si256(srcReg32b6,
+ _mm256_castsi256_si128(srcReg32b7), 1);
+
+ // merge every two consecutive registers except the last one
+ srcReg32b10 = _mm256_unpacklo_epi8(srcReg32b1, srcReg32b2);
+ srcReg32b1 = _mm256_unpackhi_epi8(srcReg32b1, srcReg32b2);
+
+ // save
+ srcReg32b11 = _mm256_unpacklo_epi8(srcReg32b3, srcReg32b4);
+
+ // save
+ srcReg32b3 = _mm256_unpackhi_epi8(srcReg32b3, srcReg32b4);
+
+ // save
+ srcReg32b2 = _mm256_unpacklo_epi8(srcReg32b5, srcReg32b6);
+
+ // save
+ srcReg32b5 = _mm256_unpackhi_epi8(srcReg32b5, srcReg32b6);
+
+
+ for (i = output_height; i > 1; i-=2) {
+ // load the last 2 loads of 16 bytes and have every two
+ // consecutive loads in the same 256 bit register
+ srcReg32b8 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*7)));
+ srcReg32b7 = _mm256_inserti128_si256(srcReg32b7,
+ _mm256_castsi256_si128(srcReg32b8), 1);
+ srcReg32b9 = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*8)));
+ srcReg32b8 = _mm256_inserti128_si256(srcReg32b8,
+ _mm256_castsi256_si128(srcReg32b9), 1);
+
+ // merge every two consecutive registers
+ // save
+ srcReg32b4 = _mm256_unpacklo_epi8(srcReg32b7, srcReg32b8);
+ srcReg32b7 = _mm256_unpackhi_epi8(srcReg32b7, srcReg32b8);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcReg32b10 = _mm256_maddubs_epi16(srcReg32b10, firstFilters);
+ srcReg32b6 = _mm256_maddubs_epi16(srcReg32b4, forthFilters);
+ srcReg32b1 = _mm256_maddubs_epi16(srcReg32b1, firstFilters);
+ srcReg32b8 = _mm256_maddubs_epi16(srcReg32b7, forthFilters);
+
+ // add and saturate the results together
+ srcReg32b10 = _mm256_adds_epi16(srcReg32b10, srcReg32b6);
+ srcReg32b1 = _mm256_adds_epi16(srcReg32b1, srcReg32b8);
+
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcReg32b8 = _mm256_maddubs_epi16(srcReg32b11, secondFilters);
+ srcReg32b6 = _mm256_maddubs_epi16(srcReg32b3, secondFilters);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcReg32b12 = _mm256_maddubs_epi16(srcReg32b2, thirdFilters);
+ srcReg32b13 = _mm256_maddubs_epi16(srcReg32b5, thirdFilters);
+
+
+ // add and saturate the results together
+ srcReg32b10 = _mm256_adds_epi16(srcReg32b10,
+ _mm256_min_epi16(srcReg32b8, srcReg32b12));
+ srcReg32b1 = _mm256_adds_epi16(srcReg32b1,
+ _mm256_min_epi16(srcReg32b6, srcReg32b13));
+
+ // add and saturate the results together
+ srcReg32b10 = _mm256_adds_epi16(srcReg32b10,
+ _mm256_max_epi16(srcReg32b8, srcReg32b12));
+ srcReg32b1 = _mm256_adds_epi16(srcReg32b1,
+ _mm256_max_epi16(srcReg32b6, srcReg32b13));
+
+
+ srcReg32b10 = _mm256_adds_epi16(srcReg32b10, addFilterReg64);
+ srcReg32b1 = _mm256_adds_epi16(srcReg32b1, addFilterReg64);
+
+ // shift by 7 bit each 16 bit
+ srcReg32b10 = _mm256_srai_epi16(srcReg32b10, 7);
+ srcReg32b1 = _mm256_srai_epi16(srcReg32b1, 7);
+
+ // shrink to 8 bit each 16 bits, the first lane contain the first
+ // convolve result and the second lane contain the second convolve
+ // result
+ srcReg32b1 = _mm256_packus_epi16(srcReg32b10, srcReg32b1);
+
+ src_ptr+=src_stride;
+
+ // save 16 bytes
+ _mm_store_si128((__m128i*)output_ptr,
+ _mm256_castsi256_si128(srcReg32b1));
+
+ // save the next 16 bits
+ _mm_store_si128((__m128i*)(output_ptr+out_pitch),
+ _mm256_extractf128_si256(srcReg32b1, 1));
+
+ output_ptr+=dst_stride;
+
+ // save part of the registers for next strides
+ srcReg32b10 = srcReg32b11;
+ srcReg32b1 = srcReg32b3;
+ srcReg32b11 = srcReg32b2;
+ srcReg32b3 = srcReg32b5;
+ srcReg32b2 = srcReg32b4;
+ srcReg32b5 = srcReg32b7;
+ srcReg32b7 = srcReg32b9;
+ }
+ if (i > 0) {
+ __m128i srcRegFilt1, srcRegFilt3, srcRegFilt4, srcRegFilt5;
+ __m128i srcRegFilt6, srcRegFilt7, srcRegFilt8;
+ // load the last 16 bytes
+ srcRegFilt8 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*7));
+
+ // merge the last 2 results together
+ srcRegFilt4 = _mm_unpacklo_epi8(
+ _mm256_castsi256_si128(srcReg32b7), srcRegFilt8);
+ srcRegFilt7 = _mm_unpackhi_epi8(
+ _mm256_castsi256_si128(srcReg32b7), srcRegFilt8);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt1 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b10),
+ _mm256_castsi256_si128(firstFilters));
+ srcRegFilt4 = _mm_maddubs_epi16(srcRegFilt4,
+ _mm256_castsi256_si128(forthFilters));
+ srcRegFilt3 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b1),
+ _mm256_castsi256_si128(firstFilters));
+ srcRegFilt7 = _mm_maddubs_epi16(srcRegFilt7,
+ _mm256_castsi256_si128(forthFilters));
+
+ // add and saturate the results together
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt4);
+ srcRegFilt3 = _mm_adds_epi16(srcRegFilt3, srcRegFilt7);
+
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt4 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b11),
+ _mm256_castsi256_si128(secondFilters));
+ srcRegFilt5 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b3),
+ _mm256_castsi256_si128(secondFilters));
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt6 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b2),
+ _mm256_castsi256_si128(thirdFilters));
+ srcRegFilt7 = _mm_maddubs_epi16(_mm256_castsi256_si128(srcReg32b5),
+ _mm256_castsi256_si128(thirdFilters));
+
+ // add and saturate the results together
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1,
+ _mm_min_epi16(srcRegFilt4, srcRegFilt6));
+ srcRegFilt3 = _mm_adds_epi16(srcRegFilt3,
+ _mm_min_epi16(srcRegFilt5, srcRegFilt7));
+
+ // add and saturate the results together
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1,
+ _mm_max_epi16(srcRegFilt4, srcRegFilt6));
+ srcRegFilt3 = _mm_adds_epi16(srcRegFilt3,
+ _mm_max_epi16(srcRegFilt5, srcRegFilt7));
+
+
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1,
+ _mm256_castsi256_si128(addFilterReg64));
+ srcRegFilt3 = _mm_adds_epi16(srcRegFilt3,
+ _mm256_castsi256_si128(addFilterReg64));
+
+ // shift by 7 bit each 16 bit
+ srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7);
+ srcRegFilt3 = _mm_srai_epi16(srcRegFilt3, 7);
+
+ // shrink to 8 bit each 16 bits, the first lane contain the first
+ // convolve result and the second lane contain the second convolve
+ // result
+ srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt3);
+
+ // save 16 bytes
+ _mm_store_si128((__m128i*)output_ptr, srcRegFilt1);
+ }
+}
diff --git a/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c b/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c
new file mode 100644
index 0000000..cf28d8d
--- /dev/null
+++ b/libvpx/vp9/common/x86/vp9_subpixel_8t_intrin_ssse3.c
@@ -0,0 +1,490 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <tmmintrin.h>
+#include "vpx_ports/mem.h"
+#include "vpx_ports/emmintrin_compat.h"
+
+// filters only for the 4_h8 convolution
+DECLARE_ALIGNED(16, static const uint8_t, filt1_4_h8[16]) = {
+ 0, 1, 1, 2, 2, 3, 3, 4, 2, 3, 3, 4, 4, 5, 5, 6
+};
+
+DECLARE_ALIGNED(16, static const uint8_t, filt2_4_h8[16]) = {
+ 4, 5, 5, 6, 6, 7, 7, 8, 6, 7, 7, 8, 8, 9, 9, 10
+};
+
+// filters for 8_h8 and 16_h8
+DECLARE_ALIGNED(16, static const uint8_t, filt1_global[16]) = {
+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8
+};
+
+DECLARE_ALIGNED(16, static const uint8_t, filt2_global[16]) = {
+ 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10
+};
+
+DECLARE_ALIGNED(16, static const uint8_t, filt3_global[16]) = {
+ 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12
+};
+
+DECLARE_ALIGNED(16, static const uint8_t, filt4_global[16]) = {
+ 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14
+};
+
+void vp9_filter_block1d4_h8_intrin_ssse3(unsigned char *src_ptr,
+ unsigned int src_pixels_per_line,
+ unsigned char *output_ptr,
+ unsigned int output_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i firstFilters, secondFilters, thirdFilters, forthFilters;
+ __m128i srcRegFilt1, srcRegFilt2, srcRegFilt3, srcRegFilt4;
+ __m128i addFilterReg64, filtersReg, srcReg, minReg;
+ unsigned int i;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 =_mm_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the same data
+ // in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+
+ // duplicate only the first 16 bits in the filter into the first lane
+ firstFilters = _mm_shufflelo_epi16(filtersReg, 0);
+ // duplicate only the third 16 bit in the filter into the first lane
+ secondFilters = _mm_shufflelo_epi16(filtersReg, 0xAAu);
+ // duplicate only the seconds 16 bits in the filter into the second lane
+ firstFilters = _mm_shufflehi_epi16(firstFilters, 0x55u);
+ // duplicate only the forth 16 bits in the filter into the second lane
+ secondFilters = _mm_shufflehi_epi16(secondFilters, 0xFFu);
+
+ // loading the local filters
+ thirdFilters =_mm_load_si128((__m128i const *)filt1_4_h8);
+ forthFilters = _mm_load_si128((__m128i const *)filt2_4_h8);
+
+ for (i = 0; i < output_height; i++) {
+ srcReg = _mm_loadu_si128((__m128i *)(src_ptr-3));
+
+ // filter the source buffer
+ srcRegFilt1= _mm_shuffle_epi8(srcReg, thirdFilters);
+ srcRegFilt2= _mm_shuffle_epi8(srcReg, forthFilters);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, secondFilters);
+
+ // extract the higher half of the lane
+ srcRegFilt3 = _mm_srli_si128(srcRegFilt1, 8);
+ srcRegFilt4 = _mm_srli_si128(srcRegFilt2, 8);
+
+ minReg = _mm_min_epi16(srcRegFilt3, srcRegFilt2);
+
+ // add and saturate all the results together
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt4);
+ srcRegFilt3 = _mm_max_epi16(srcRegFilt3, srcRegFilt2);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, minReg);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt3);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64);
+
+ // shift by 7 bit each 16 bits
+ srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7);
+
+ // shrink to 8 bit each 16 bits
+ srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt1);
+ src_ptr+=src_pixels_per_line;
+
+ // save only 4 bytes
+ *((int*)&output_ptr[0])= _mm_cvtsi128_si32(srcRegFilt1);
+
+ output_ptr+=output_pitch;
+ }
+}
+
+void vp9_filter_block1d8_h8_intrin_ssse3(unsigned char *src_ptr,
+ unsigned int src_pixels_per_line,
+ unsigned char *output_ptr,
+ unsigned int output_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i firstFilters, secondFilters, thirdFilters, forthFilters, srcReg;
+ __m128i filt1Reg, filt2Reg, filt3Reg, filt4Reg;
+ __m128i srcRegFilt1, srcRegFilt2, srcRegFilt3, srcRegFilt4;
+ __m128i addFilterReg64, filtersReg, minReg;
+ unsigned int i;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 = _mm_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the same data
+ // in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+
+ // duplicate only the first 16 bits (first and second byte)
+ // across 128 bit register
+ firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u));
+ // duplicate only the second 16 bits (third and forth byte)
+ // across 128 bit register
+ secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u));
+ // duplicate only the third 16 bits (fifth and sixth byte)
+ // across 128 bit register
+ thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u));
+ // duplicate only the forth 16 bits (seventh and eighth byte)
+ // across 128 bit register
+ forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u));
+
+ filt1Reg = _mm_load_si128((__m128i const *)filt1_global);
+ filt2Reg = _mm_load_si128((__m128i const *)filt2_global);
+ filt3Reg = _mm_load_si128((__m128i const *)filt3_global);
+ filt4Reg = _mm_load_si128((__m128i const *)filt4_global);
+
+ for (i = 0; i < output_height; i++) {
+ srcReg = _mm_loadu_si128((__m128i *)(src_ptr-3));
+
+ // filter the source buffer
+ srcRegFilt1= _mm_shuffle_epi8(srcReg, filt1Reg);
+ srcRegFilt2= _mm_shuffle_epi8(srcReg, filt2Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, secondFilters);
+
+ // filter the source buffer
+ srcRegFilt3= _mm_shuffle_epi8(srcReg, filt3Reg);
+ srcRegFilt4= _mm_shuffle_epi8(srcReg, filt4Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, thirdFilters);
+ srcRegFilt4 = _mm_maddubs_epi16(srcRegFilt4, forthFilters);
+
+ // add and saturate all the results together
+ minReg = _mm_min_epi16(srcRegFilt4, srcRegFilt3);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt2);
+
+ srcRegFilt4= _mm_max_epi16(srcRegFilt4, srcRegFilt3);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, minReg);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt4);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64);
+
+ // shift by 7 bit each 16 bits
+ srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7);
+
+ // shrink to 8 bit each 16 bits
+ srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt1);
+
+ src_ptr+=src_pixels_per_line;
+
+ // save only 8 bytes
+ _mm_storel_epi64((__m128i*)&output_ptr[0], srcRegFilt1);
+
+ output_ptr+=output_pitch;
+ }
+}
+
+void vp9_filter_block1d16_h8_intrin_ssse3(unsigned char *src_ptr,
+ unsigned int src_pixels_per_line,
+ unsigned char *output_ptr,
+ unsigned int output_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i addFilterReg64, filtersReg, srcReg1, srcReg2;
+ __m128i filt1Reg, filt2Reg, filt3Reg, filt4Reg;
+ __m128i firstFilters, secondFilters, thirdFilters, forthFilters;
+ __m128i srcRegFilt1_1, srcRegFilt2_1, srcRegFilt2, srcRegFilt3;
+ unsigned int i;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 = _mm_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the same data
+ // in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+
+ // duplicate only the first 16 bits (first and second byte)
+ // across 128 bit register
+ firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u));
+ // duplicate only the second 16 bits (third and forth byte)
+ // across 128 bit register
+ secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u));
+ // duplicate only the third 16 bits (fifth and sixth byte)
+ // across 128 bit register
+ thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u));
+ // duplicate only the forth 16 bits (seventh and eighth byte)
+ // across 128 bit register
+ forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u));
+
+ filt1Reg = _mm_load_si128((__m128i const *)filt1_global);
+ filt2Reg = _mm_load_si128((__m128i const *)filt2_global);
+ filt3Reg = _mm_load_si128((__m128i const *)filt3_global);
+ filt4Reg = _mm_load_si128((__m128i const *)filt4_global);
+
+ for (i = 0; i < output_height; i++) {
+ srcReg1 = _mm_loadu_si128((__m128i *)(src_ptr-3));
+
+ // filter the source buffer
+ srcRegFilt1_1= _mm_shuffle_epi8(srcReg1, filt1Reg);
+ srcRegFilt2= _mm_shuffle_epi8(srcReg1, filt2Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt1_1 = _mm_maddubs_epi16(srcRegFilt1_1, firstFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, secondFilters);
+
+ // add and saturate the results together
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, srcRegFilt2);
+
+ // filter the source buffer
+ srcRegFilt3= _mm_shuffle_epi8(srcReg1, filt4Reg);
+ srcRegFilt2= _mm_shuffle_epi8(srcReg1, filt3Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, forthFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, thirdFilters);
+
+ // add and saturate the results together
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1,
+ _mm_min_epi16(srcRegFilt3, srcRegFilt2));
+
+ // reading the next 16 bytes.
+ // (part of it was being read by earlier read)
+ srcReg2 = _mm_loadu_si128((__m128i *)(src_ptr+5));
+
+ // add and saturate the results together
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1,
+ _mm_max_epi16(srcRegFilt3, srcRegFilt2));
+
+ // filter the source buffer
+ srcRegFilt2_1= _mm_shuffle_epi8(srcReg2, filt1Reg);
+ srcRegFilt2= _mm_shuffle_epi8(srcReg2, filt2Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt2_1 = _mm_maddubs_epi16(srcRegFilt2_1, firstFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, secondFilters);
+
+ // add and saturate the results together
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, srcRegFilt2);
+
+ // filter the source buffer
+ srcRegFilt3= _mm_shuffle_epi8(srcReg2, filt4Reg);
+ srcRegFilt2= _mm_shuffle_epi8(srcReg2, filt3Reg);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, forthFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, thirdFilters);
+
+ // add and saturate the results together
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1,
+ _mm_min_epi16(srcRegFilt3, srcRegFilt2));
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1,
+ _mm_max_epi16(srcRegFilt3, srcRegFilt2));
+
+ srcRegFilt1_1 = _mm_adds_epi16(srcRegFilt1_1, addFilterReg64);
+ srcRegFilt2_1 = _mm_adds_epi16(srcRegFilt2_1, addFilterReg64);
+
+ // shift by 7 bit each 16 bit
+ srcRegFilt1_1 = _mm_srai_epi16(srcRegFilt1_1, 7);
+ srcRegFilt2_1 = _mm_srai_epi16(srcRegFilt2_1, 7);
+
+ // shrink to 8 bit each 16 bits, the first lane contain the first
+ // convolve result and the second lane contain the second convolve
+ // result
+ srcRegFilt1_1 = _mm_packus_epi16(srcRegFilt1_1, srcRegFilt2_1);
+
+ src_ptr+=src_pixels_per_line;
+
+ // save 16 bytes
+ _mm_store_si128((__m128i*)output_ptr, srcRegFilt1_1);
+
+ output_ptr+=output_pitch;
+ }
+}
+
+void vp9_filter_block1d8_v8_intrin_ssse3(unsigned char *src_ptr,
+ unsigned int src_pitch,
+ unsigned char *output_ptr,
+ unsigned int out_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i addFilterReg64, filtersReg, minReg, srcRegFilt6;
+ __m128i firstFilters, secondFilters, thirdFilters, forthFilters;
+ __m128i srcRegFilt1, srcRegFilt2, srcRegFilt3, srcRegFilt4, srcRegFilt5;
+ unsigned int i;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 = _mm_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the same data
+ // in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+
+ // duplicate only the first 16 bits in the filter
+ firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u));
+ // duplicate only the second 16 bits in the filter
+ secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u));
+ // duplicate only the third 16 bits in the filter
+ thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u));
+ // duplicate only the forth 16 bits in the filter
+ forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u));
+
+ for (i = 0; i < output_height; i++) {
+ // load the first 8 bytes
+ srcRegFilt1 = _mm_loadl_epi64((__m128i *)&src_ptr[0]);
+ // load the next 8 bytes in stride of src_pitch
+ srcRegFilt2 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch)[0]);
+ srcRegFilt3 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch*2)[0]);
+ srcRegFilt4 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch*3)[0]);
+
+ // merge the result together
+ srcRegFilt1 = _mm_unpacklo_epi8(srcRegFilt1, srcRegFilt2);
+ srcRegFilt3 = _mm_unpacklo_epi8(srcRegFilt3, srcRegFilt4);
+
+ // load the next 8 bytes in stride of src_pitch
+ srcRegFilt2 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch*4)[0]);
+ srcRegFilt4 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch*5)[0]);
+ srcRegFilt5 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch*6)[0]);
+ srcRegFilt6 = _mm_loadl_epi64((__m128i *)&(src_ptr+src_pitch*7)[0]);
+
+ // merge the result together
+ srcRegFilt2 = _mm_unpacklo_epi8(srcRegFilt2, srcRegFilt4);
+ srcRegFilt5 = _mm_unpacklo_epi8(srcRegFilt5, srcRegFilt6);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters);
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, secondFilters);
+ srcRegFilt2 = _mm_maddubs_epi16(srcRegFilt2, thirdFilters);
+ srcRegFilt5 = _mm_maddubs_epi16(srcRegFilt5, forthFilters);
+
+ // add and saturate the results together
+ minReg = _mm_min_epi16(srcRegFilt2, srcRegFilt3);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt5);
+ srcRegFilt2 = _mm_max_epi16(srcRegFilt2, srcRegFilt3);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, minReg);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt2);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64);
+
+ // shift by 7 bit each 16 bit
+ srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7);
+
+ // shrink to 8 bit each 16 bits
+ srcRegFilt1 = _mm_packus_epi16(srcRegFilt1, srcRegFilt1);
+
+ src_ptr+=src_pitch;
+
+ // save only 8 bytes convolve result
+ _mm_storel_epi64((__m128i*)&output_ptr[0], srcRegFilt1);
+
+ output_ptr+=out_pitch;
+ }
+}
+
+void vp9_filter_block1d16_v8_intrin_ssse3(unsigned char *src_ptr,
+ unsigned int src_pitch,
+ unsigned char *output_ptr,
+ unsigned int out_pitch,
+ unsigned int output_height,
+ int16_t *filter) {
+ __m128i addFilterReg64, filtersReg, srcRegFilt1, srcRegFilt2, srcRegFilt3;
+ __m128i firstFilters, secondFilters, thirdFilters, forthFilters;
+ __m128i srcRegFilt4, srcRegFilt5, srcRegFilt6, srcRegFilt7, srcRegFilt8;
+ unsigned int i;
+
+ // create a register with 0,64,0,64,0,64,0,64,0,64,0,64,0,64,0,64
+ addFilterReg64 = _mm_set1_epi32((int)0x0400040u);
+ filtersReg = _mm_loadu_si128((__m128i *)filter);
+ // converting the 16 bit (short) to 8 bit (byte) and have the same data
+ // in both lanes of 128 bit register.
+ filtersReg =_mm_packs_epi16(filtersReg, filtersReg);
+
+ // duplicate only the first 16 bits in the filter
+ firstFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x100u));
+ // duplicate only the second 16 bits in the filter
+ secondFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x302u));
+ // duplicate only the third 16 bits in the filter
+ thirdFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x504u));
+ // duplicate only the forth 16 bits in the filter
+ forthFilters = _mm_shuffle_epi8(filtersReg, _mm_set1_epi16(0x706u));
+
+ for (i = 0; i < output_height; i++) {
+ // load the first 16 bytes
+ srcRegFilt1 = _mm_loadu_si128((__m128i *)(src_ptr));
+ // load the next 16 bytes in stride of src_pitch
+ srcRegFilt2 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch));
+ srcRegFilt3 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*6));
+ srcRegFilt4 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*7));
+
+ // merge the result together
+ srcRegFilt5 = _mm_unpacklo_epi8(srcRegFilt1, srcRegFilt2);
+ srcRegFilt6 = _mm_unpacklo_epi8(srcRegFilt3, srcRegFilt4);
+ srcRegFilt1 = _mm_unpackhi_epi8(srcRegFilt1, srcRegFilt2);
+ srcRegFilt3 = _mm_unpackhi_epi8(srcRegFilt3, srcRegFilt4);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt5 = _mm_maddubs_epi16(srcRegFilt5, firstFilters);
+ srcRegFilt6 = _mm_maddubs_epi16(srcRegFilt6, forthFilters);
+ srcRegFilt1 = _mm_maddubs_epi16(srcRegFilt1, firstFilters);
+ srcRegFilt3 = _mm_maddubs_epi16(srcRegFilt3, forthFilters);
+
+ // add and saturate the results together
+ srcRegFilt5 = _mm_adds_epi16(srcRegFilt5, srcRegFilt6);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, srcRegFilt3);
+
+ // load the next 16 bytes in stride of two/three src_pitch
+ srcRegFilt2 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*2));
+ srcRegFilt3 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*3));
+
+ // merge the result together
+ srcRegFilt4 = _mm_unpacklo_epi8(srcRegFilt2, srcRegFilt3);
+ srcRegFilt6 = _mm_unpackhi_epi8(srcRegFilt2, srcRegFilt3);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt4 = _mm_maddubs_epi16(srcRegFilt4, secondFilters);
+ srcRegFilt6 = _mm_maddubs_epi16(srcRegFilt6, secondFilters);
+
+ // load the next 16 bytes in stride of four/five src_pitch
+ srcRegFilt2 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*4));
+ srcRegFilt3 = _mm_loadu_si128((__m128i *)(src_ptr+src_pitch*5));
+
+ // merge the result together
+ srcRegFilt7 = _mm_unpacklo_epi8(srcRegFilt2, srcRegFilt3);
+ srcRegFilt8 = _mm_unpackhi_epi8(srcRegFilt2, srcRegFilt3);
+
+ // multiply 2 adjacent elements with the filter and add the result
+ srcRegFilt7 = _mm_maddubs_epi16(srcRegFilt7, thirdFilters);
+ srcRegFilt8 = _mm_maddubs_epi16(srcRegFilt8, thirdFilters);
+
+ // add and saturate the results together
+ srcRegFilt5 = _mm_adds_epi16(srcRegFilt5,
+ _mm_min_epi16(srcRegFilt4, srcRegFilt7));
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1,
+ _mm_min_epi16(srcRegFilt6, srcRegFilt8));
+
+ // add and saturate the results together
+ srcRegFilt5 = _mm_adds_epi16(srcRegFilt5,
+ _mm_max_epi16(srcRegFilt4, srcRegFilt7));
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1,
+ _mm_max_epi16(srcRegFilt6, srcRegFilt8));
+ srcRegFilt5 = _mm_adds_epi16(srcRegFilt5, addFilterReg64);
+ srcRegFilt1 = _mm_adds_epi16(srcRegFilt1, addFilterReg64);
+
+ // shift by 7 bit each 16 bit
+ srcRegFilt5 = _mm_srai_epi16(srcRegFilt5, 7);
+ srcRegFilt1 = _mm_srai_epi16(srcRegFilt1, 7);
+
+ // shrink to 8 bit each 16 bits, the first lane contain the first
+ // convolve result and the second lane contain the second convolve
+ // result
+ srcRegFilt1 = _mm_packus_epi16(srcRegFilt5, srcRegFilt1);
+
+ src_ptr+=src_pitch;
+
+ // save 16 bytes convolve result
+ _mm_store_si128((__m128i*)output_ptr, srcRegFilt1);
+
+ output_ptr+=out_pitch;
+ }
+}
diff --git a/libvpx/vp9/common/x86/vp9_subpixel_8t_ssse3.asm b/libvpx/vp9/common/x86/vp9_subpixel_8t_ssse3.asm
index 7a5cca0..634fa77 100644
--- a/libvpx/vp9/common/x86/vp9_subpixel_8t_ssse3.asm
+++ b/libvpx/vp9/common/x86/vp9_subpixel_8t_ssse3.asm
@@ -11,17 +11,6 @@
%include "vpx_ports/x86_abi_support.asm"
-;/************************************************************************************
-; Notes: filter_block1d_h6 applies a 6 tap filter horizontally to the input pixels. The
-; input pixel array has output_height rows. This routine assumes that output_height is an
-; even number. This function handles 8 pixels in horizontal direction, calculating ONE
-; rows each iteration to take advantage of the 128 bits operations.
-;
-; This is an implementation of some of the SSE optimizations first seen in ffvp8
-;
-;*************************************************************************************/
-
-
%macro VERTx4 1
mov rdx, arg(5) ;filter ptr
mov rsi, arg(0) ;src_ptr
@@ -81,11 +70,14 @@
pmaddubsw xmm4, k4k5
pmaddubsw xmm6, k6k7
+ movdqa xmm1, xmm2
paddsw xmm0, xmm6
- paddsw xmm0, xmm2
+ pmaxsw xmm2, xmm4
+ pminsw xmm4, xmm1
paddsw xmm0, xmm4
- paddsw xmm0, krd
+ paddsw xmm0, xmm2
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0
@@ -166,10 +158,13 @@
pmaddubsw xmm6, k6k7
paddsw xmm0, xmm6
- paddsw xmm0, xmm2
+ movdqa xmm1, xmm2
+ pmaxsw xmm2, xmm4
+ pminsw xmm4, xmm1
paddsw xmm0, xmm4
- paddsw xmm0, krd
+ paddsw xmm0, xmm2
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0
@@ -251,10 +246,13 @@
pmaddubsw xmm6, k6k7
paddsw xmm0, xmm6
- paddsw xmm0, xmm2
+ movdqa xmm1, xmm2
+ pmaxsw xmm2, xmm4
+ pminsw xmm4, xmm1
paddsw xmm0, xmm4
- paddsw xmm0, krd
+ paddsw xmm0, xmm2
+ paddsw xmm0, krd
psraw xmm0, 7
packuswb xmm0, xmm0
%if %1
@@ -538,14 +536,22 @@ sym(vp9_filter_block1d16_v8_avg_ssse3):
movdqa %2, %1
pshufb %1, [GLOBAL(shuf_t0t1)]
pshufb %2, [GLOBAL(shuf_t2t3)]
- pmaddubsw %1, xmm6
- pmaddubsw %2, xmm7
+ pmaddubsw %1, k0k1k4k5
+ pmaddubsw %2, k2k3k6k7
- paddsw %1, %2
- movdqa %2, %1
+ movdqa xmm4, %1
+ movdqa xmm5, %2
+ psrldq %1, 8
psrldq %2, 8
- paddsw %1, %2
- paddsw %1, xmm5
+ movdqa xmm6, xmm5
+
+ paddsw xmm4, %2
+ pmaxsw xmm5, %1
+ pminsw %1, xmm6
+ paddsw %1, xmm4
+ paddsw %1, xmm5
+
+ paddsw %1, krd
psraw %1, 7
packuswb %1, %1
%endm
@@ -565,6 +571,10 @@ sym(vp9_filter_block1d16_v8_avg_ssse3):
pshufhw xmm7, xmm7, 11111111b ;k2_k3_k6_k7
pshufd xmm5, xmm5, 0 ;rounding
+ movdqa k0k1k4k5, xmm6
+ movdqa k2k3k6k7, xmm7
+ movdqa krd, xmm5
+
movsxd rax, dword ptr arg(1) ;src_pixels_per_line
movsxd rdx, dword ptr arg(3) ;output_pitch
movsxd rcx, dword ptr arg(4) ;output_height
@@ -631,9 +641,13 @@ sym(vp9_filter_block1d16_v8_avg_ssse3):
pmaddubsw %3, k4k5
pmaddubsw %4, k6k7
- paddsw %1, %2
paddsw %1, %4
+ movdqa %4, %2
+ pmaxsw %2, %3
+ pminsw %3, %4
paddsw %1, %3
+ paddsw %1, %2
+
paddsw %1, krd
psraw %1, 7
packuswb %1, %1
@@ -779,12 +793,19 @@ sym(vp9_filter_block1d16_v8_avg_ssse3):
pmaddubsw xmm6, k4k5
pmaddubsw xmm7, k6k7
- paddsw xmm0, xmm1
paddsw xmm0, xmm3
+ movdqa xmm3, xmm1
+ pmaxsw xmm1, xmm2
+ pminsw xmm2, xmm3
paddsw xmm0, xmm2
- paddsw xmm4, xmm5
+ paddsw xmm0, xmm1
+
paddsw xmm4, xmm7
+ movdqa xmm7, xmm5
+ pmaxsw xmm5, xmm6
+ pminsw xmm6, xmm7
paddsw xmm4, xmm6
+ paddsw xmm4, xmm5
paddsw xmm0, krd
paddsw xmm4, krd
@@ -826,8 +847,16 @@ sym(vp9_filter_block1d4_h8_ssse3):
push rdi
; end prolog
+ ALIGN_STACK 16, rax
+ sub rsp, 16 * 3
+ %define k0k1k4k5 [rsp + 16 * 0]
+ %define k2k3k6k7 [rsp + 16 * 1]
+ %define krd [rsp + 16 * 2]
+
HORIZx4 0
+ add rsp, 16 * 3
+ pop rsp
; begin epilog
pop rdi
pop rsi
@@ -932,8 +961,16 @@ sym(vp9_filter_block1d4_h8_avg_ssse3):
push rdi
; end prolog
+ ALIGN_STACK 16, rax
+ sub rsp, 16 * 3
+ %define k0k1k4k5 [rsp + 16 * 0]
+ %define k2k3k6k7 [rsp + 16 * 1]
+ %define krd [rsp + 16 * 2]
+
HORIZx4 1
+ add rsp, 16 * 3
+ pop rsp
; begin epilog
pop rdi
pop rsi
diff --git a/libvpx/vp9/common/x86/vp9_subpixel_bilinear_sse2.asm b/libvpx/vp9/common/x86/vp9_subpixel_bilinear_sse2.asm
new file mode 100644
index 0000000..d94ccf2
--- /dev/null
+++ b/libvpx/vp9/common/x86/vp9_subpixel_bilinear_sse2.asm
@@ -0,0 +1,448 @@
+;
+; Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+;
+; Use of this source code is governed by a BSD-style license
+; that can be found in the LICENSE file in the root of the source
+; tree. An additional intellectual property rights grant can be found
+; in the file PATENTS. All contributing project authors may
+; be found in the AUTHORS file in the root of the source tree.
+;
+
+%include "vpx_ports/x86_abi_support.asm"
+
+%macro GET_PARAM_4 0
+ mov rdx, arg(5) ;filter ptr
+ mov rsi, arg(0) ;src_ptr
+ mov rdi, arg(2) ;output_ptr
+ mov rcx, 0x0400040
+
+ movdqa xmm3, [rdx] ;load filters
+ pshuflw xmm4, xmm3, 11111111b ;k3
+ psrldq xmm3, 8
+ pshuflw xmm3, xmm3, 0b ;k4
+ punpcklqdq xmm4, xmm3 ;k3k4
+
+ movq xmm3, rcx ;rounding
+ pshufd xmm3, xmm3, 0
+
+ pxor xmm2, xmm2
+
+ movsxd rax, DWORD PTR arg(1) ;pixels_per_line
+ movsxd rdx, DWORD PTR arg(3) ;out_pitch
+ movsxd rcx, DWORD PTR arg(4) ;output_height
+%endm
+
+%macro APPLY_FILTER_4 1
+
+ punpckldq xmm0, xmm1 ;two row in one register
+ punpcklbw xmm0, xmm2 ;unpack to word
+ pmullw xmm0, xmm4 ;multiply the filter factors
+
+ movdqa xmm1, xmm0
+ psrldq xmm1, 8
+ paddsw xmm0, xmm1
+
+ paddsw xmm0, xmm3 ;rounding
+ psraw xmm0, 7 ;shift
+ packuswb xmm0, xmm0 ;pack to byte
+
+%if %1
+ movd xmm1, [rdi]
+ pavgb xmm0, xmm1
+%endif
+
+ movd [rdi], xmm0
+ lea rsi, [rsi + rax]
+ lea rdi, [rdi + rdx]
+ dec rcx
+%endm
+
+%macro GET_PARAM 0
+ mov rdx, arg(5) ;filter ptr
+ mov rsi, arg(0) ;src_ptr
+ mov rdi, arg(2) ;output_ptr
+ mov rcx, 0x0400040
+
+ movdqa xmm7, [rdx] ;load filters
+
+ pshuflw xmm6, xmm7, 11111111b ;k3
+ pshufhw xmm7, xmm7, 0b ;k4
+ punpcklwd xmm6, xmm6
+ punpckhwd xmm7, xmm7
+
+ movq xmm4, rcx ;rounding
+ pshufd xmm4, xmm4, 0
+
+ pxor xmm5, xmm5
+
+ movsxd rax, DWORD PTR arg(1) ;pixels_per_line
+ movsxd rdx, DWORD PTR arg(3) ;out_pitch
+ movsxd rcx, DWORD PTR arg(4) ;output_height
+%endm
+
+%macro APPLY_FILTER_8 1
+ punpcklbw xmm0, xmm5
+ punpcklbw xmm1, xmm5
+
+ pmullw xmm0, xmm6
+ pmullw xmm1, xmm7
+ paddsw xmm0, xmm1
+ paddsw xmm0, xmm4 ;rounding
+ psraw xmm0, 7 ;shift
+ packuswb xmm0, xmm0 ;pack back to byte
+%if %1
+ movq xmm1, [rdi]
+ pavgb xmm0, xmm1
+%endif
+ movq [rdi], xmm0 ;store the result
+
+ lea rsi, [rsi + rax]
+ lea rdi, [rdi + rdx]
+ dec rcx
+%endm
+
+%macro APPLY_FILTER_16 1
+ punpcklbw xmm0, xmm5
+ punpcklbw xmm1, xmm5
+ punpckhbw xmm2, xmm5
+ punpckhbw xmm3, xmm5
+
+ pmullw xmm0, xmm6
+ pmullw xmm1, xmm7
+ pmullw xmm2, xmm6
+ pmullw xmm3, xmm7
+
+ paddsw xmm0, xmm1
+ paddsw xmm2, xmm3
+
+ paddsw xmm0, xmm4 ;rounding
+ paddsw xmm2, xmm4
+ psraw xmm0, 7 ;shift
+ psraw xmm2, 7
+ packuswb xmm0, xmm2 ;pack back to byte
+%if %1
+ movdqu xmm1, [rdi]
+ pavgb xmm0, xmm1
+%endif
+ movdqu [rdi], xmm0 ;store the result
+
+ lea rsi, [rsi + rax]
+ lea rdi, [rdi + rdx]
+ dec rcx
+%endm
+
+global sym(vp9_filter_block1d4_v2_sse2) PRIVATE
+sym(vp9_filter_block1d4_v2_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movd xmm0, [rsi] ;load src
+ movd xmm1, [rsi + rax]
+
+ APPLY_FILTER_4 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_v2_sse2) PRIVATE
+sym(vp9_filter_block1d8_v2_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movq xmm0, [rsi] ;0
+ movq xmm1, [rsi + rax] ;1
+
+ APPLY_FILTER_8 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_v2_sse2) PRIVATE
+sym(vp9_filter_block1d16_v2_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;0
+ movdqu xmm1, [rsi + rax] ;1
+ movdqa xmm2, xmm0
+ movdqa xmm3, xmm1
+
+ APPLY_FILTER_16 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d4_v2_avg_sse2) PRIVATE
+sym(vp9_filter_block1d4_v2_avg_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movd xmm0, [rsi] ;load src
+ movd xmm1, [rsi + rax]
+
+ APPLY_FILTER_4 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_v2_avg_sse2) PRIVATE
+sym(vp9_filter_block1d8_v2_avg_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movq xmm0, [rsi] ;0
+ movq xmm1, [rsi + rax] ;1
+
+ APPLY_FILTER_8 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_v2_avg_sse2) PRIVATE
+sym(vp9_filter_block1d16_v2_avg_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;0
+ movdqu xmm1, [rsi + rax] ;1
+ movdqa xmm2, xmm0
+ movdqa xmm3, xmm1
+
+ APPLY_FILTER_16 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d4_h2_sse2) PRIVATE
+sym(vp9_filter_block1d4_h2_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_4 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_h2_sse2) PRIVATE
+sym(vp9_filter_block1d8_h2_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_8 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_h2_sse2) PRIVATE
+sym(vp9_filter_block1d16_h2_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqu xmm1, [rsi + 1]
+ movdqa xmm2, xmm0
+ movdqa xmm3, xmm1
+
+ APPLY_FILTER_16 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d4_h2_avg_sse2) PRIVATE
+sym(vp9_filter_block1d4_h2_avg_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_4 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_h2_avg_sse2) PRIVATE
+sym(vp9_filter_block1d8_h2_avg_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_8 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_h2_avg_sse2) PRIVATE
+sym(vp9_filter_block1d16_h2_avg_sse2):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqu xmm1, [rsi + 1]
+ movdqa xmm2, xmm0
+ movdqa xmm3, xmm1
+
+ APPLY_FILTER_16 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
diff --git a/libvpx/vp9/common/x86/vp9_subpixel_bilinear_ssse3.asm b/libvpx/vp9/common/x86/vp9_subpixel_bilinear_ssse3.asm
new file mode 100644
index 0000000..b5e18fe
--- /dev/null
+++ b/libvpx/vp9/common/x86/vp9_subpixel_bilinear_ssse3.asm
@@ -0,0 +1,422 @@
+;
+; Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+;
+; Use of this source code is governed by a BSD-style license
+; that can be found in the LICENSE file in the root of the source
+; tree. An additional intellectual property rights grant can be found
+; in the file PATENTS. All contributing project authors may
+; be found in the AUTHORS file in the root of the source tree.
+;
+
+%include "vpx_ports/x86_abi_support.asm"
+
+%macro GET_PARAM_4 0
+ mov rdx, arg(5) ;filter ptr
+ mov rsi, arg(0) ;src_ptr
+ mov rdi, arg(2) ;output_ptr
+ mov rcx, 0x0400040
+
+ movdqa xmm3, [rdx] ;load filters
+ psrldq xmm3, 6
+ packsswb xmm3, xmm3
+ pshuflw xmm3, xmm3, 0b ;k3_k4
+
+ movq xmm2, rcx ;rounding
+ pshufd xmm2, xmm2, 0
+
+ movsxd rax, DWORD PTR arg(1) ;pixels_per_line
+ movsxd rdx, DWORD PTR arg(3) ;out_pitch
+ movsxd rcx, DWORD PTR arg(4) ;output_height
+%endm
+
+%macro APPLY_FILTER_4 1
+ punpcklbw xmm0, xmm1
+ pmaddubsw xmm0, xmm3
+
+ paddsw xmm0, xmm2 ;rounding
+ psraw xmm0, 7 ;shift
+ packuswb xmm0, xmm0 ;pack to byte
+
+%if %1
+ movd xmm1, [rdi]
+ pavgb xmm0, xmm1
+%endif
+ movd [rdi], xmm0
+ lea rsi, [rsi + rax]
+ lea rdi, [rdi + rdx]
+ dec rcx
+%endm
+
+%macro GET_PARAM 0
+ mov rdx, arg(5) ;filter ptr
+ mov rsi, arg(0) ;src_ptr
+ mov rdi, arg(2) ;output_ptr
+ mov rcx, 0x0400040
+
+ movdqa xmm7, [rdx] ;load filters
+ psrldq xmm7, 6
+ packsswb xmm7, xmm7
+ pshuflw xmm7, xmm7, 0b ;k3_k4
+ punpcklwd xmm7, xmm7
+
+ movq xmm6, rcx ;rounding
+ pshufd xmm6, xmm6, 0
+
+ movsxd rax, DWORD PTR arg(1) ;pixels_per_line
+ movsxd rdx, DWORD PTR arg(3) ;out_pitch
+ movsxd rcx, DWORD PTR arg(4) ;output_height
+%endm
+
+%macro APPLY_FILTER_8 1
+ punpcklbw xmm0, xmm1
+ pmaddubsw xmm0, xmm7
+
+ paddsw xmm0, xmm6 ;rounding
+ psraw xmm0, 7 ;shift
+ packuswb xmm0, xmm0 ;pack back to byte
+
+%if %1
+ movq xmm1, [rdi]
+ pavgb xmm0, xmm1
+%endif
+ movq [rdi], xmm0 ;store the result
+
+ lea rsi, [rsi + rax]
+ lea rdi, [rdi + rdx]
+ dec rcx
+%endm
+
+%macro APPLY_FILTER_16 1
+ punpcklbw xmm0, xmm1
+ punpckhbw xmm2, xmm1
+ pmaddubsw xmm0, xmm7
+ pmaddubsw xmm2, xmm7
+
+ paddsw xmm0, xmm6 ;rounding
+ paddsw xmm2, xmm6
+ psraw xmm0, 7 ;shift
+ psraw xmm2, 7
+ packuswb xmm0, xmm2 ;pack back to byte
+
+%if %1
+ movdqu xmm1, [rdi]
+ pavgb xmm0, xmm1
+%endif
+ movdqu [rdi], xmm0 ;store the result
+
+ lea rsi, [rsi + rax]
+ lea rdi, [rdi + rdx]
+ dec rcx
+%endm
+
+global sym(vp9_filter_block1d4_v2_ssse3) PRIVATE
+sym(vp9_filter_block1d4_v2_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movd xmm0, [rsi] ;load src
+ movd xmm1, [rsi + rax]
+
+ APPLY_FILTER_4 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_v2_ssse3) PRIVATE
+sym(vp9_filter_block1d8_v2_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movq xmm0, [rsi] ;0
+ movq xmm1, [rsi + rax] ;1
+
+ APPLY_FILTER_8 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_v2_ssse3) PRIVATE
+sym(vp9_filter_block1d16_v2_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;0
+ movdqu xmm1, [rsi + rax] ;1
+ movdqa xmm2, xmm0
+
+ APPLY_FILTER_16 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d4_v2_avg_ssse3) PRIVATE
+sym(vp9_filter_block1d4_v2_avg_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movd xmm0, [rsi] ;load src
+ movd xmm1, [rsi + rax]
+
+ APPLY_FILTER_4 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_v2_avg_ssse3) PRIVATE
+sym(vp9_filter_block1d8_v2_avg_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movq xmm0, [rsi] ;0
+ movq xmm1, [rsi + rax] ;1
+
+ APPLY_FILTER_8 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_v2_avg_ssse3) PRIVATE
+sym(vp9_filter_block1d16_v2_avg_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;0
+ movdqu xmm1, [rsi + rax] ;1
+ movdqa xmm2, xmm0
+
+ APPLY_FILTER_16 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d4_h2_ssse3) PRIVATE
+sym(vp9_filter_block1d4_h2_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_4 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_h2_ssse3) PRIVATE
+sym(vp9_filter_block1d8_h2_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_8 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_h2_ssse3) PRIVATE
+sym(vp9_filter_block1d16_h2_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqu xmm1, [rsi + 1]
+ movdqa xmm2, xmm0
+
+ APPLY_FILTER_16 0
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d4_h2_avg_ssse3) PRIVATE
+sym(vp9_filter_block1d4_h2_avg_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM_4
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_4 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d8_h2_avg_ssse3) PRIVATE
+sym(vp9_filter_block1d8_h2_avg_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqa xmm1, xmm0
+ psrldq xmm1, 1
+
+ APPLY_FILTER_8 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
+
+global sym(vp9_filter_block1d16_h2_avg_ssse3) PRIVATE
+sym(vp9_filter_block1d16_h2_avg_ssse3):
+ push rbp
+ mov rbp, rsp
+ SHADOW_ARGS_TO_STACK 6
+ SAVE_XMM 7
+ push rsi
+ push rdi
+ ; end prolog
+
+ GET_PARAM
+.loop:
+ movdqu xmm0, [rsi] ;load src
+ movdqu xmm1, [rsi + 1]
+ movdqa xmm2, xmm0
+
+ APPLY_FILTER_16 1
+ jnz .loop
+
+ ; begin epilog
+ pop rdi
+ pop rsi
+ RESTORE_XMM
+ UNSHADOW_ARGS
+ pop rbp
+ ret
diff --git a/libvpx/vp9/decoder/vp9_decodframe.c b/libvpx/vp9/decoder/vp9_decodeframe.c
index 3c4781b..6926657 100644
--- a/libvpx/vp9/decoder/vp9_decodframe.c
+++ b/libvpx/vp9/decoder/vp9_decodeframe.c
@@ -9,16 +9,19 @@
*/
#include <assert.h>
+#include <stdlib.h> // qsort()
#include "./vp9_rtcd.h"
+#include "./vpx_scale_rtcd.h"
+
#include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/mem_ops.h"
#include "vpx_scale/vpx_scale.h"
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
-#include "vp9/common/vp9_extend.h"
#include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_quant_common.h"
@@ -27,40 +30,26 @@
#include "vp9/common/vp9_seg_common.h"
#include "vp9/common/vp9_tile_common.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
-#include "vp9/decoder/vp9_decodframe.h"
+#include "vp9/decoder/vp9_decodeframe.h"
#include "vp9/decoder/vp9_detokenize.h"
#include "vp9/decoder/vp9_decodemv.h"
+#include "vp9/decoder/vp9_decoder.h"
#include "vp9/decoder/vp9_dsubexp.h"
-#include "vp9/decoder/vp9_onyxd_int.h"
+#include "vp9/decoder/vp9_dthread.h"
#include "vp9/decoder/vp9_read_bit_buffer.h"
+#include "vp9/decoder/vp9_reader.h"
#include "vp9/decoder/vp9_thread.h"
-#include "vp9/decoder/vp9_treereader.h"
-typedef struct TileWorkerData {
- VP9_COMMON *cm;
- vp9_reader bit_reader;
- DECLARE_ALIGNED(16, MACROBLOCKD, xd);
- DECLARE_ALIGNED(16, unsigned char, token_cache[1024]);
- DECLARE_ALIGNED(16, int16_t, qcoeff[MAX_MB_PLANE][64 * 64]);
- DECLARE_ALIGNED(16, int16_t, dqcoeff[MAX_MB_PLANE][64 * 64]);
- DECLARE_ALIGNED(16, uint16_t, eobs[MAX_MB_PLANE][256]);
-} TileWorkerData;
-
-static int read_be32(const uint8_t *p) {
- return (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
-}
-
-static int is_compound_prediction_allowed(const VP9_COMMON *cm) {
+static int is_compound_reference_allowed(const VP9_COMMON *cm) {
int i;
- for (i = 1; i < ALLOWED_REFS_PER_FRAME; ++i)
- if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1])
+ for (i = 1; i < REFS_PER_FRAME; ++i)
+ if (cm->ref_frame_sign_bias[i + 1] != cm->ref_frame_sign_bias[1])
return 1;
return 0;
}
-static void setup_compound_prediction(VP9_COMMON *cm) {
+static void setup_compound_reference_mode(VP9_COMMON *cm) {
if (cm->ref_frame_sign_bias[LAST_FRAME] ==
cm->ref_frame_sign_bias[GOLDEN_FRAME]) {
cm->comp_fixed_ref = ALTREF_FRAME;
@@ -78,9 +67,8 @@ static void setup_compound_prediction(VP9_COMMON *cm) {
}
}
-// len == 0 is not allowed
static int read_is_valid(const uint8_t *start, size_t len, const uint8_t *end) {
- return start + len > start && start + len <= end;
+ return len != 0 && len <= (size_t)(end - start);
}
static int decode_unsigned_max(struct vp9_read_bit_buffer *rb, int max) {
@@ -95,7 +83,7 @@ static TX_MODE read_tx_mode(vp9_reader *r) {
return tx_mode;
}
-static void read_tx_probs(struct tx_probs *tx_probs, vp9_reader *r) {
+static void read_tx_mode_probs(struct tx_probs *tx_probs, vp9_reader *r) {
int i, j;
for (i = 0; i < TX_SIZE_CONTEXTS; ++i)
@@ -125,42 +113,41 @@ static void read_inter_mode_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
vp9_diff_update_prob(r, &fc->inter_mode_probs[i][j]);
}
-static INLINE COMPPREDMODE_TYPE read_comp_pred_mode(vp9_reader *r) {
- COMPPREDMODE_TYPE mode = vp9_read_bit(r);
- if (mode)
- mode += vp9_read_bit(r);
- return mode;
+static REFERENCE_MODE read_frame_reference_mode(const VP9_COMMON *cm,
+ vp9_reader *r) {
+ if (is_compound_reference_allowed(cm)) {
+ return vp9_read_bit(r) ? (vp9_read_bit(r) ? REFERENCE_MODE_SELECT
+ : COMPOUND_REFERENCE)
+ : SINGLE_REFERENCE;
+ } else {
+ return SINGLE_REFERENCE;
+ }
}
-static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) {
+static void read_frame_reference_mode_probs(VP9_COMMON *cm, vp9_reader *r) {
+ FRAME_CONTEXT *const fc = &cm->fc;
int i;
- const int compound_allowed = is_compound_prediction_allowed(cm);
- cm->comp_pred_mode = compound_allowed ? read_comp_pred_mode(r)
- : SINGLE_PREDICTION_ONLY;
- if (compound_allowed)
- setup_compound_prediction(cm);
+ if (cm->reference_mode == REFERENCE_MODE_SELECT)
+ for (i = 0; i < COMP_INTER_CONTEXTS; ++i)
+ vp9_diff_update_prob(r, &fc->comp_inter_prob[i]);
- if (cm->comp_pred_mode == HYBRID_PREDICTION)
- for (i = 0; i < COMP_INTER_CONTEXTS; i++)
- vp9_diff_update_prob(r, &cm->fc.comp_inter_prob[i]);
-
- if (cm->comp_pred_mode != COMP_PREDICTION_ONLY)
- for (i = 0; i < REF_CONTEXTS; i++) {
- vp9_diff_update_prob(r, &cm->fc.single_ref_prob[i][0]);
- vp9_diff_update_prob(r, &cm->fc.single_ref_prob[i][1]);
+ if (cm->reference_mode != COMPOUND_REFERENCE)
+ for (i = 0; i < REF_CONTEXTS; ++i) {
+ vp9_diff_update_prob(r, &fc->single_ref_prob[i][0]);
+ vp9_diff_update_prob(r, &fc->single_ref_prob[i][1]);
}
- if (cm->comp_pred_mode != SINGLE_PREDICTION_ONLY)
- for (i = 0; i < REF_CONTEXTS; i++)
- vp9_diff_update_prob(r, &cm->fc.comp_ref_prob[i]);
+ if (cm->reference_mode != SINGLE_REFERENCE)
+ for (i = 0; i < REF_CONTEXTS; ++i)
+ vp9_diff_update_prob(r, &fc->comp_ref_prob[i]);
}
static void update_mv_probs(vp9_prob *p, int n, vp9_reader *r) {
int i;
for (i = 0; i < n; ++i)
- if (vp9_read(r, NMV_UPDATE_PROB))
- p[i] = (vp9_read_literal(r, 7) << 1) | 1;
+ if (vp9_read(r, MV_UPDATE_PROB))
+ p[i] = (vp9_read_literal(r, 7) << 1) | 1;
}
static void read_mv_probs(nmv_context *ctx, int allow_hp, vp9_reader *r) {
@@ -179,7 +166,7 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, vp9_reader *r) {
for (i = 0; i < 2; ++i) {
nmv_component *const comp_ctx = &ctx->comps[i];
for (j = 0; j < CLASS0_SIZE; ++j)
- update_mv_probs(comp_ctx->class0_fp[j], 3, r);
+ update_mv_probs(comp_ctx->class0_fp[j], MV_FP_SIZE - 1, r);
update_mv_probs(comp_ctx->fp, 3, r);
}
@@ -206,20 +193,7 @@ static void setup_plane_dequants(VP9_COMMON *cm, MACROBLOCKD *xd, int q_index) {
static void alloc_tile_storage(VP9D_COMP *pbi, int tile_rows, int tile_cols) {
VP9_COMMON *const cm = &pbi->common;
const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
- int i, tile_row, tile_col;
-
- CHECK_MEM_ERROR(cm, pbi->mi_streams,
- vpx_realloc(pbi->mi_streams, tile_rows * tile_cols *
- sizeof(*pbi->mi_streams)));
- for (tile_row = 0; tile_row < tile_rows; ++tile_row) {
- for (tile_col = 0; tile_col < tile_cols; ++tile_col) {
- TileInfo tile;
- vp9_tile_init(&tile, cm, tile_row, tile_col);
- pbi->mi_streams[tile_row * tile_cols + tile_col] =
- &cm->mi[tile.mi_row_start * cm->mode_info_stride
- + tile.mi_col_start];
- }
- }
+ int i;
// 2 contexts per 'mi unit', so that we have one context per 4x4 txfm
// block where mi unit size is 8x8.
@@ -242,16 +216,13 @@ static void alloc_tile_storage(VP9D_COMP *pbi, int tile_rows, int tile_cols) {
}
static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block,
- TX_SIZE tx_size, int x, int y) {
+ TX_SIZE tx_size, uint8_t *dst, int stride,
+ int eob) {
struct macroblockd_plane *const pd = &xd->plane[plane];
- const int eob = pd->eobs[block];
if (eob > 0) {
TX_TYPE tx_type;
const int plane_type = pd->plane_type;
- const int stride = pd->dst.stride;
int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- uint8_t *const dst = &pd->dst.buf[4 * y * stride + 4 * x];
-
switch (tx_size) {
case TX_4X4:
tx_type = get_tx_type_4x4(plane_type, xd, block);
@@ -261,11 +232,11 @@ static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block,
vp9_iht4x4_16_add(dqcoeff, dst, stride, tx_type);
break;
case TX_8X8:
- tx_type = get_tx_type_8x8(plane_type, xd);
+ tx_type = get_tx_type(plane_type, xd);
vp9_iht8x8_add(tx_type, dqcoeff, dst, stride, eob);
break;
case TX_16X16:
- tx_type = get_tx_type_16x16(plane_type, xd);
+ tx_type = get_tx_type(plane_type, xd);
vp9_iht16x16_add(tx_type, dqcoeff, dst, stride, eob);
break;
case TX_32X32:
@@ -273,7 +244,7 @@ static void inverse_transform_block(MACROBLOCKD* xd, int plane, int block,
vp9_idct32x32_add(dqcoeff, dst, stride, eob);
break;
default:
- assert(!"Invalid transform size");
+ assert(0 && "Invalid transform size");
}
if (eob == 1) {
@@ -293,7 +264,6 @@ struct intra_args {
VP9_COMMON *cm;
MACROBLOCKD *xd;
vp9_reader *r;
- uint8_t *token_cache;
};
static void predict_and_reconstruct_intra_block(int plane, int block,
@@ -304,26 +274,24 @@ static void predict_and_reconstruct_intra_block(int plane, int block,
MACROBLOCKD *const xd = args->xd;
struct macroblockd_plane *const pd = &xd->plane[plane];
MODE_INFO *const mi = xd->mi_8x8[0];
- const MB_PREDICTION_MODE mode = (plane == 0)
- ? ((mi->mbmi.sb_type < BLOCK_8X8) ? mi->bmi[block].as_mode
- : mi->mbmi.mode)
- : mi->mbmi.uv_mode;
+ const MB_PREDICTION_MODE mode = (plane == 0) ? get_y_mode(mi, block)
+ : mi->mbmi.uv_mode;
int x, y;
uint8_t *dst;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
dst = &pd->dst.buf[4 * y * pd->dst.stride + 4 * x];
- if (xd->mb_to_right_edge < 0 || xd->mb_to_bottom_edge < 0)
- extend_for_intra(xd, plane_bsize, plane, block, tx_size);
-
vp9_predict_intra_block(xd, block >> (tx_size << 1),
b_width_log2(plane_bsize), tx_size, mode,
- dst, pd->dst.stride, dst, pd->dst.stride);
-
- if (!mi->mbmi.skip_coeff) {
- vp9_decode_block_tokens(cm, xd, plane, block, plane_bsize, x, y, tx_size,
- args->r, args->token_cache);
- inverse_transform_block(xd, plane, block, tx_size, x, y);
+ dst, pd->dst.stride, dst, pd->dst.stride,
+ x, y, plane);
+
+ if (!mi->mbmi.skip) {
+ const int eob = vp9_decode_block_tokens(cm, xd, plane, block,
+ plane_bsize, x, y, tx_size,
+ args->r);
+ inverse_transform_block(xd, plane, block, tx_size, dst, pd->dst.stride,
+ eob);
}
}
@@ -332,7 +300,6 @@ struct inter_args {
MACROBLOCKD *xd;
vp9_reader *r;
int *eobtotal;
- uint8_t *token_cache;
};
static void reconstruct_inter_block(int plane, int block,
@@ -341,34 +308,34 @@ static void reconstruct_inter_block(int plane, int block,
struct inter_args *args = arg;
VP9_COMMON *const cm = args->cm;
MACROBLOCKD *const xd = args->xd;
- int x, y;
+ struct macroblockd_plane *const pd = &xd->plane[plane];
+ int x, y, eob;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
-
- *args->eobtotal += vp9_decode_block_tokens(cm, xd, plane, block,
- plane_bsize, x, y, tx_size,
- args->r, args->token_cache);
- inverse_transform_block(xd, plane, block, tx_size, x, y);
+ eob = vp9_decode_block_tokens(cm, xd, plane, block, plane_bsize, x, y,
+ tx_size, args->r);
+ inverse_transform_block(xd, plane, block, tx_size,
+ &pd->dst.buf[4 * y * pd->dst.stride + 4 * x],
+ pd->dst.stride, eob);
+ *args->eobtotal += eob;
}
static void set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
const TileInfo *const tile,
BLOCK_SIZE bsize, int mi_row, int mi_col) {
- const int bh = num_8x8_blocks_high_lookup[bsize];
const int bw = num_8x8_blocks_wide_lookup[bsize];
+ const int bh = num_8x8_blocks_high_lookup[bsize];
+ const int x_mis = MIN(bw, cm->mi_cols - mi_col);
+ const int y_mis = MIN(bh, cm->mi_rows - mi_row);
const int offset = mi_row * cm->mode_info_stride + mi_col;
- const int tile_offset = tile->mi_row_start * cm->mode_info_stride +
- tile->mi_col_start;
+ int x, y;
xd->mi_8x8 = cm->mi_grid_visible + offset;
xd->prev_mi_8x8 = cm->prev_mi_grid_visible + offset;
-
- // we are using the mode info context stream here
- xd->mi_8x8[0] = xd->mi_stream + offset - tile_offset;
+ xd->mi_8x8[0] = &cm->mi[offset];
xd->mi_8x8[0]->mbmi.sb_type = bsize;
-
- // Special case: if prev_mi is NULL, the previous mode info context
- // cannot be used.
- xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL;
+ for (y = 0; y < y_mis; ++y)
+ for (x = !y; x < x_mis; ++x)
+ xd->mi_8x8[y * cm->mode_info_stride + x] = xd->mi_8x8[0];
set_skip_context(xd, xd->above_context, xd->left_context, mi_row, mi_col);
@@ -376,29 +343,26 @@ static void set_offsets(VP9_COMMON *const cm, MACROBLOCKD *const xd,
// as they are always compared to values that are in 1/8th pel units
set_mi_row_col(xd, tile, mi_row, bh, mi_col, bw, cm->mi_rows, cm->mi_cols);
- setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
+ vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
}
static void set_ref(VP9_COMMON *const cm, MACROBLOCKD *const xd,
int idx, int mi_row, int mi_col) {
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
- const int ref = mbmi->ref_frame[idx] - LAST_FRAME;
- const YV12_BUFFER_CONFIG *cfg = get_frame_ref_buffer(cm, ref);
- const struct scale_factors_common *sfc = &cm->active_ref_scale_comm[ref];
- if (!vp9_is_valid_scale(sfc))
+ RefBuffer *ref_buffer = &cm->frame_refs[mbmi->ref_frame[idx] - LAST_FRAME];
+ xd->block_refs[idx] = ref_buffer;
+ if (!vp9_is_valid_scale(&ref_buffer->sf))
vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
"Invalid scale factors");
-
- xd->scale_factor[idx].sfc = sfc;
- setup_pre_planes(xd, idx, cfg, mi_row, mi_col, &xd->scale_factor[idx]);
- xd->corrupted |= cfg->corrupted;
+ vp9_setup_pre_planes(xd, idx, ref_buffer->buf, mi_row, mi_col,
+ &ref_buffer->sf);
+ xd->corrupted |= ref_buffer->buf->corrupted;
}
-static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd,
- const TileInfo *const tile,
- int mi_row, int mi_col,
- vp9_reader *r, BLOCK_SIZE bsize,
- uint8_t *token_cache) {
+static void decode_block(VP9_COMMON *const cm, MACROBLOCKD *const xd,
+ const TileInfo *const tile,
+ int mi_row, int mi_col,
+ vp9_reader *r, BLOCK_SIZE bsize) {
const int less8x8 = bsize < BLOCK_8X8;
MB_MODE_INFO *mbmi;
@@ -411,7 +375,7 @@ static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd,
// Has to be called after set_offsets
mbmi = &xd->mi_8x8[0]->mbmi;
- if (mbmi->skip_coeff) {
+ if (mbmi->skip) {
reset_skip_context(xd, bsize);
} else {
if (cm->seg.enabled)
@@ -420,32 +384,27 @@ static void decode_modes_b(VP9_COMMON *const cm, MACROBLOCKD *const xd,
}
if (!is_inter_block(mbmi)) {
- struct intra_args arg = {
- cm, xd, r, token_cache
- };
- foreach_transformed_block(xd, bsize, predict_and_reconstruct_intra_block,
- &arg);
+ struct intra_args arg = { cm, xd, r };
+ vp9_foreach_transformed_block(xd, bsize,
+ predict_and_reconstruct_intra_block, &arg);
} else {
// Setup
set_ref(cm, xd, 0, mi_row, mi_col);
if (has_second_ref(mbmi))
set_ref(cm, xd, 1, mi_row, mi_col);
- xd->subpix.filter_x = xd->subpix.filter_y =
- vp9_get_filter_kernel(mbmi->interp_filter);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
// Prediction
- vp9_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
+ vp9_dec_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
// Reconstruction
- if (!mbmi->skip_coeff) {
+ if (!mbmi->skip) {
int eobtotal = 0;
- struct inter_args arg = {
- cm, xd, r, &eobtotal, token_cache
- };
- foreach_transformed_block(xd, bsize, reconstruct_inter_block, &arg);
+ struct inter_args arg = { cm, xd, r, &eobtotal };
+ vp9_foreach_transformed_block(xd, bsize, reconstruct_inter_block, &arg);
if (!less8x8 && eobtotal == 0)
- mbmi->skip_coeff = 1; // skip loopfilter
+ mbmi->skip = 1; // skip loopfilter
}
}
@@ -464,7 +423,7 @@ static PARTITION_TYPE read_partition(VP9_COMMON *cm, MACROBLOCKD *xd, int hbs,
PARTITION_TYPE p;
if (has_rows && has_cols)
- p = treed_read(r, vp9_partition_tree, probs);
+ p = vp9_read_tree(r, vp9_partition_tree, probs);
else if (!has_rows && has_cols)
p = vp9_read(r, probs[1]) ? PARTITION_SPLIT : PARTITION_HORZ;
else if (has_rows && !has_cols)
@@ -478,11 +437,10 @@ static PARTITION_TYPE read_partition(VP9_COMMON *cm, MACROBLOCKD *xd, int hbs,
return p;
}
-static void decode_modes_sb(VP9_COMMON *const cm, MACROBLOCKD *const xd,
- const TileInfo *const tile,
- int mi_row, int mi_col,
- vp9_reader* r, BLOCK_SIZE bsize,
- uint8_t *token_cache) {
+static void decode_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd,
+ const TileInfo *const tile,
+ int mi_row, int mi_col,
+ vp9_reader* r, BLOCK_SIZE bsize) {
const int hbs = num_8x8_blocks_wide_lookup[bsize] / 2;
PARTITION_TYPE partition;
BLOCK_SIZE subsize;
@@ -493,36 +451,30 @@ static void decode_modes_sb(VP9_COMMON *const cm, MACROBLOCKD *const xd,
partition = read_partition(cm, xd, hbs, mi_row, mi_col, bsize, r);
subsize = get_subsize(bsize, partition);
if (subsize < BLOCK_8X8) {
- decode_modes_b(cm, xd, tile, mi_row, mi_col, r, subsize, token_cache);
+ decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
} else {
switch (partition) {
case PARTITION_NONE:
- decode_modes_b(cm, xd, tile, mi_row, mi_col, r, subsize, token_cache);
+ decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
break;
case PARTITION_HORZ:
- decode_modes_b(cm, xd, tile, mi_row, mi_col, r, subsize, token_cache);
+ decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
if (mi_row + hbs < cm->mi_rows)
- decode_modes_b(cm, xd, tile, mi_row + hbs, mi_col, r, subsize,
- token_cache);
+ decode_block(cm, xd, tile, mi_row + hbs, mi_col, r, subsize);
break;
case PARTITION_VERT:
- decode_modes_b(cm, xd, tile, mi_row, mi_col, r, subsize, token_cache);
+ decode_block(cm, xd, tile, mi_row, mi_col, r, subsize);
if (mi_col + hbs < cm->mi_cols)
- decode_modes_b(cm, xd, tile, mi_row, mi_col + hbs, r, subsize,
- token_cache);
+ decode_block(cm, xd, tile, mi_row, mi_col + hbs, r, subsize);
break;
case PARTITION_SPLIT:
- decode_modes_sb(cm, xd, tile, mi_row, mi_col, r, subsize,
- token_cache);
- decode_modes_sb(cm, xd, tile, mi_row, mi_col + hbs, r, subsize,
- token_cache);
- decode_modes_sb(cm, xd, tile, mi_row + hbs, mi_col, r, subsize,
- token_cache);
- decode_modes_sb(cm, xd, tile, mi_row + hbs, mi_col + hbs, r, subsize,
- token_cache);
+ decode_partition(cm, xd, tile, mi_row, mi_col, r, subsize);
+ decode_partition(cm, xd, tile, mi_row, mi_col + hbs, r, subsize);
+ decode_partition(cm, xd, tile, mi_row + hbs, mi_col, r, subsize);
+ decode_partition(cm, xd, tile, mi_row + hbs, mi_col + hbs, r, subsize);
break;
default:
- assert(!"Invalid partition type");
+ assert(0 && "Invalid partition type");
}
}
@@ -555,13 +507,12 @@ static void read_coef_probs_common(vp9_coeff_probs_model *coef_probs,
int i, j, k, l, m;
if (vp9_read_bit(r))
- for (i = 0; i < BLOCK_TYPES; i++)
- for (j = 0; j < REF_TYPES; j++)
- for (k = 0; k < COEF_BANDS; k++)
- for (l = 0; l < PREV_COEF_CONTEXTS; l++)
- if (k > 0 || l < 3)
- for (m = 0; m < UNCONSTRAINED_NODES; m++)
- vp9_diff_update_prob(r, &coef_probs[i][j][k][l][m]);
+ for (i = 0; i < PLANE_TYPES; ++i)
+ for (j = 0; j < REF_TYPES; ++j)
+ for (k = 0; k < COEF_BANDS; ++k)
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l)
+ for (m = 0; m < UNCONSTRAINED_NODES; ++m)
+ vp9_diff_update_prob(r, &coef_probs[i][j][k][l][m]);
}
static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode,
@@ -675,14 +626,13 @@ static void setup_quantization(VP9_COMMON *const cm, MACROBLOCKD *const xd,
xd->itxm_add = xd->lossless ? vp9_iwht4x4_add : vp9_idct4x4_add;
}
-static INTERPOLATION_TYPE read_interp_filter_type(
- struct vp9_read_bit_buffer *rb) {
- const INTERPOLATION_TYPE literal_to_type[] = { EIGHTTAP_SMOOTH,
- EIGHTTAP,
- EIGHTTAP_SHARP,
- BILINEAR };
+static INTERP_FILTER read_interp_filter(struct vp9_read_bit_buffer *rb) {
+ const INTERP_FILTER literal_to_filter[] = { EIGHTTAP_SMOOTH,
+ EIGHTTAP,
+ EIGHTTAP_SHARP,
+ BILINEAR };
return vp9_rb_read_bit(rb) ? SWITCHABLE
- : literal_to_type[vp9_rb_read_literal(rb, 2)];
+ : literal_to_filter[vp9_rb_read_literal(rb, 2)];
}
static void read_frame_size(struct vp9_read_bit_buffer *rb,
@@ -705,12 +655,6 @@ static void apply_frame_size(VP9D_COMP *pbi, int width, int height) {
if (cm->width != width || cm->height != height) {
// Change in frame size.
- if (cm->width == 0 || cm->height == 0) {
- // Assign new frame buffer on first call.
- cm->new_fb_idx = NUM_YV12_BUFFERS - 1;
- cm->fb_idx_ref_cnt[cm->new_fb_idx] = 1;
- }
-
// TODO(agrange) Don't test width/height, check overall size.
if (width > cm->width || height > cm->height) {
// Rescale frame buffers only if they're not big enough already.
@@ -725,9 +669,14 @@ static void apply_frame_size(VP9D_COMP *pbi, int width, int height) {
vp9_update_frame_size(cm);
}
- vp9_realloc_frame_buffer(get_frame_new_buffer(cm), cm->width, cm->height,
- cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS);
+ if (vp9_realloc_frame_buffer(
+ get_frame_new_buffer(cm), cm->width, cm->height,
+ cm->subsampling_x, cm->subsampling_y, VP9_DEC_BORDER_IN_PIXELS,
+ &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer, cm->get_fb_cb,
+ cm->cb_priv)) {
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
+ "Failed to allocate frame buffer");
+ }
}
static void setup_frame_size(VP9D_COMP *pbi,
@@ -744,11 +693,11 @@ static void setup_frame_size_with_refs(VP9D_COMP *pbi,
int width, height;
int found = 0, i;
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i) {
+ for (i = 0; i < REFS_PER_FRAME; ++i) {
if (vp9_rb_read_bit(rb)) {
- YV12_BUFFER_CONFIG *const cfg = get_frame_ref_buffer(cm, i);
- width = cfg->y_crop_width;
- height = cfg->y_crop_height;
+ YV12_BUFFER_CONFIG *const buf = cm->frame_refs[i].buf;
+ width = buf->y_crop_width;
+ height = buf->y_crop_height;
found = 1;
break;
}
@@ -757,7 +706,7 @@ static void setup_frame_size_with_refs(VP9D_COMP *pbi,
if (!found)
read_frame_size(rb, &width, &height);
- if (!width || !height)
+ if (width <= 0 || height <= 0)
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME,
"Referenced frame with invalid size");
@@ -768,12 +717,10 @@ static void setup_frame_size_with_refs(VP9D_COMP *pbi,
static void setup_tile_context(VP9D_COMP *const pbi, MACROBLOCKD *const xd,
int tile_row, int tile_col) {
int i;
- const int tile_cols = 1 << pbi->common.log2_tile_cols;
- xd->mi_stream = pbi->mi_streams[tile_row * tile_cols + tile_col];
- for (i = 0; i < MAX_MB_PLANE; ++i) {
+ for (i = 0; i < MAX_MB_PLANE; ++i)
xd->above_context[i] = pbi->above_context[i];
- }
+
// see note in alloc_tile_storage().
xd->above_seg_context = pbi->above_seg_context;
}
@@ -802,8 +749,7 @@ static void decode_tile(VP9D_COMP *pbi, const TileInfo *const tile,
vp9_zero(xd->left_seg_context);
for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end;
mi_col += MI_BLOCK_SIZE) {
- decode_modes_sb(cm, xd, tile, mi_row, mi_col, r, BLOCK_64X64,
- pbi->token_cache);
+ decode_partition(cm, xd, tile, mi_row, mi_col, r, BLOCK_64X64);
}
if (pbi->do_loopfilter_inline) {
@@ -864,10 +810,14 @@ static size_t get_tile(const uint8_t *const data_end,
if (!is_last) {
if (!read_is_valid(*data, 4, data_end))
vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME,
- "Truncated packet or corrupt tile length");
+ "Truncated packet or corrupt tile length");
- size = read_be32(*data);
+ size = mem_get_be32(*data);
*data += 4;
+
+ if (size > (size_t)(data_end - *data))
+ vpx_internal_error(error_info, VPX_CODEC_CORRUPT_FRAME,
+ "Truncated packet or corrupt tile size");
} else {
size = data_end - *data;
}
@@ -877,6 +827,7 @@ static size_t get_tile(const uint8_t *const data_end,
typedef struct TileBuffer {
const uint8_t *data;
size_t size;
+ int col; // only used with multi-threaded decoding
} TileBuffer;
static const uint8_t *decode_tiles(VP9D_COMP *pbi, const uint8_t *data) {
@@ -944,9 +895,7 @@ static void setup_tile_macroblockd(TileWorkerData *const tile_data) {
int i;
for (i = 0; i < MAX_MB_PLANE; ++i) {
- pd[i].qcoeff = tile_data->qcoeff[i];
pd[i].dqcoeff = tile_data->dqcoeff[i];
- pd[i].eobs = tile_data->eobs[i];
vpx_memset(xd->plane[i].dqcoeff, 0, 64 * 64 * sizeof(int16_t));
}
}
@@ -962,23 +911,39 @@ static int tile_worker_hook(void *arg1, void *arg2) {
vp9_zero(tile_data->xd.left_seg_context);
for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end;
mi_col += MI_BLOCK_SIZE) {
- decode_modes_sb(tile_data->cm, &tile_data->xd, tile,
- mi_row, mi_col, &tile_data->bit_reader, BLOCK_64X64,
- tile_data->token_cache);
+ decode_partition(tile_data->cm, &tile_data->xd, tile,
+ mi_row, mi_col, &tile_data->bit_reader, BLOCK_64X64);
}
}
return !tile_data->xd.corrupted;
}
+// sorts in descending order
+static int compare_tile_buffers(const void *a, const void *b) {
+ const TileBuffer *const buf1 = (const TileBuffer*)a;
+ const TileBuffer *const buf2 = (const TileBuffer*)b;
+ if (buf1->size < buf2->size) {
+ return 1;
+ } else if (buf1->size == buf2->size) {
+ return 0;
+ } else {
+ return -1;
+ }
+}
+
static const uint8_t *decode_tiles_mt(VP9D_COMP *pbi, const uint8_t *data) {
VP9_COMMON *const cm = &pbi->common;
+ const uint8_t *bit_reader_end = NULL;
const uint8_t *const data_end = pbi->source + pbi->source_sz;
const int aligned_mi_cols = mi_cols_aligned_to_sb(cm->mi_cols);
const int tile_cols = 1 << cm->log2_tile_cols;
const int tile_rows = 1 << cm->log2_tile_rows;
const int num_workers = MIN(pbi->oxcf.max_threads & ~1, tile_cols);
- int tile_col = 0;
+ TileBuffer tile_buffers[1 << 6];
+ int n;
+ int final_worker = -1;
+ assert(tile_cols <= (1 << 6));
assert(tile_rows == 1);
(void)tile_rows;
@@ -992,7 +957,6 @@ static const uint8_t *decode_tiles_mt(VP9D_COMP *pbi, const uint8_t *data) {
++pbi->num_tile_workers;
vp9_worker_init(worker);
- worker->hook = (VP9WorkerHook)tile_worker_hook;
CHECK_MEM_ERROR(cm, worker->data1,
vpx_memalign(32, sizeof(TileWorkerData)));
CHECK_MEM_ERROR(cm, worker->data2, vpx_malloc(sizeof(TileInfo)));
@@ -1003,6 +967,11 @@ static const uint8_t *decode_tiles_mt(VP9D_COMP *pbi, const uint8_t *data) {
}
}
+ // Reset tile decoding hook
+ for (n = 0; n < pbi->num_tile_workers; ++n) {
+ pbi->tile_workers[n].hook = (VP9WorkerHook)tile_worker_hook;
+ }
+
// Note: this memset assumes above_context[0], [1] and [2]
// are allocated as part of the same buffer.
vpx_memset(pbi->above_context[0], 0,
@@ -1011,48 +980,82 @@ static const uint8_t *decode_tiles_mt(VP9D_COMP *pbi, const uint8_t *data) {
vpx_memset(pbi->above_seg_context, 0,
sizeof(*pbi->above_seg_context) * aligned_mi_cols);
- while (tile_col < tile_cols) {
+ // Load tile data into tile_buffers
+ for (n = 0; n < tile_cols; ++n) {
+ const size_t size =
+ get_tile(data_end, n == tile_cols - 1, &cm->error, &data);
+ TileBuffer *const buf = &tile_buffers[n];
+ buf->data = data;
+ buf->size = size;
+ buf->col = n;
+ data += size;
+ }
+
+ // Sort the buffers based on size in descending order.
+ qsort(tile_buffers, tile_cols, sizeof(tile_buffers[0]), compare_tile_buffers);
+
+ // Rearrange the tile buffers such that per-tile group the largest, and
+ // presumably the most difficult, tile will be decoded in the main thread.
+ // This should help minimize the number of instances where the main thread is
+ // waiting for a worker to complete.
+ {
+ int group_start = 0;
+ while (group_start < tile_cols) {
+ const TileBuffer largest = tile_buffers[group_start];
+ const int group_end = MIN(group_start + num_workers, tile_cols) - 1;
+ memmove(tile_buffers + group_start, tile_buffers + group_start + 1,
+ (group_end - group_start) * sizeof(tile_buffers[0]));
+ tile_buffers[group_end] = largest;
+ group_start = group_end + 1;
+ }
+ }
+
+ n = 0;
+ while (n < tile_cols) {
int i;
- for (i = 0; i < num_workers && tile_col < tile_cols; ++i) {
+ for (i = 0; i < num_workers && n < tile_cols; ++i) {
VP9Worker *const worker = &pbi->tile_workers[i];
TileWorkerData *const tile_data = (TileWorkerData*)worker->data1;
TileInfo *const tile = (TileInfo*)worker->data2;
- const size_t size =
- get_tile(data_end, tile_col == tile_cols - 1, &cm->error, &data);
+ TileBuffer *const buf = &tile_buffers[n];
tile_data->cm = cm;
tile_data->xd = pbi->mb;
tile_data->xd.corrupted = 0;
- vp9_tile_init(tile, tile_data->cm, 0, tile_col);
+ vp9_tile_init(tile, tile_data->cm, 0, buf->col);
- setup_token_decoder(data, data_end, size, &cm->error,
+ setup_token_decoder(buf->data, data_end, buf->size, &cm->error,
&tile_data->bit_reader);
- setup_tile_context(pbi, &tile_data->xd, 0, tile_col);
+ setup_tile_context(pbi, &tile_data->xd, 0, buf->col);
setup_tile_macroblockd(tile_data);
worker->had_error = 0;
- if (i == num_workers - 1 || tile_col == tile_cols - 1) {
+ if (i == num_workers - 1 || n == tile_cols - 1) {
vp9_worker_execute(worker);
} else {
vp9_worker_launch(worker);
}
- data += size;
- ++tile_col;
+ if (buf->col == tile_cols - 1) {
+ final_worker = i;
+ }
+
+ ++n;
}
for (; i > 0; --i) {
VP9Worker *const worker = &pbi->tile_workers[i - 1];
pbi->mb.corrupted |= !vp9_worker_sync(worker);
}
+ if (final_worker > -1) {
+ TileWorkerData *const tile_data =
+ (TileWorkerData*)pbi->tile_workers[final_worker].data1;
+ bit_reader_end = vp9_reader_find_end(&tile_data->bit_reader);
+ final_worker = -1;
+ }
}
- {
- const int final_worker = (tile_cols + num_workers - 1) % num_workers;
- TileWorkerData *const tile_data =
- (TileWorkerData*)pbi->tile_workers[final_worker].data1;
- return vp9_reader_find_end(&tile_data->bit_reader);
- }
+ return bit_reader_end;
}
static void check_sync_code(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
@@ -1064,7 +1067,7 @@ static void check_sync_code(VP9_COMMON *cm, struct vp9_read_bit_buffer *rb) {
}
}
-static void error_handler(void *data, size_t bit_offset) {
+static void error_handler(void *data) {
VP9_COMMON *const cm = (VP9_COMMON *)data;
vpx_internal_error(&cm->error, VPX_CODEC_CORRUPT_FRAME, "Truncated packet");
}
@@ -1089,12 +1092,20 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
cm->version = vp9_rb_read_bit(rb);
RESERVED;
- if (vp9_rb_read_bit(rb)) {
- // show an existing frame directly
- int frame_to_show = cm->ref_frame_map[vp9_rb_read_literal(rb, 3)];
- ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->new_fb_idx, frame_to_show);
+ cm->show_existing_frame = vp9_rb_read_bit(rb);
+ if (cm->show_existing_frame) {
+ // Show an existing frame directly.
+ const int frame_to_show = cm->ref_frame_map[vp9_rb_read_literal(rb, 3)];
+
+ if (cm->frame_bufs[frame_to_show].ref_count < 1)
+ vpx_internal_error(&cm->error, VPX_CODEC_UNSUP_BITSTREAM,
+ "Buffer %d does not contain a decoded frame",
+ frame_to_show);
+
+ ref_cnt_fb(cm->frame_bufs, &cm->new_fb_idx, frame_to_show);
pbi->refresh_frame_flags = 0;
cm->lf.filter_level = 0;
+ cm->show_frame = 1;
return 0;
}
@@ -1125,10 +1136,12 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
}
}
- pbi->refresh_frame_flags = (1 << NUM_REF_FRAMES) - 1;
+ pbi->refresh_frame_flags = (1 << REF_FRAMES) - 1;
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i)
- cm->active_ref_idx[i] = cm->new_fb_idx;
+ for (i = 0; i < REFS_PER_FRAME; ++i) {
+ cm->frame_refs[i].idx = cm->new_fb_idx;
+ cm->frame_refs[i].buf = get_frame_new_buffer(cm);
+ }
setup_frame_size(pbi, rb);
} else {
@@ -1140,38 +1153,49 @@ static size_t read_uncompressed_header(VP9D_COMP *pbi,
if (cm->intra_only) {
check_sync_code(cm, rb);
- pbi->refresh_frame_flags = vp9_rb_read_literal(rb, NUM_REF_FRAMES);
+ pbi->refresh_frame_flags = vp9_rb_read_literal(rb, REF_FRAMES);
setup_frame_size(pbi, rb);
} else {
- pbi->refresh_frame_flags = vp9_rb_read_literal(rb, NUM_REF_FRAMES);
+ pbi->refresh_frame_flags = vp9_rb_read_literal(rb, REF_FRAMES);
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i) {
- const int ref = vp9_rb_read_literal(rb, NUM_REF_FRAMES_LOG2);
- cm->active_ref_idx[i] = cm->ref_frame_map[ref];
+ for (i = 0; i < REFS_PER_FRAME; ++i) {
+ const int ref = vp9_rb_read_literal(rb, REF_FRAMES_LOG2);
+ const int idx = cm->ref_frame_map[ref];
+ cm->frame_refs[i].idx = idx;
+ cm->frame_refs[i].buf = &cm->frame_bufs[idx].buf;
cm->ref_frame_sign_bias[LAST_FRAME + i] = vp9_rb_read_bit(rb);
}
setup_frame_size_with_refs(pbi, rb);
cm->allow_high_precision_mv = vp9_rb_read_bit(rb);
- cm->mcomp_filter_type = read_interp_filter_type(rb);
-
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i)
- vp9_setup_scale_factors(cm, i);
+ cm->interp_filter = read_interp_filter(rb);
+
+ for (i = 0; i < REFS_PER_FRAME; ++i) {
+ RefBuffer *const ref_buf = &cm->frame_refs[i];
+ vp9_setup_scale_factors_for_frame(&ref_buf->sf,
+ ref_buf->buf->y_crop_width,
+ ref_buf->buf->y_crop_height,
+ cm->width, cm->height);
+ if (vp9_is_scaled(&ref_buf->sf))
+ vp9_extend_frame_borders(ref_buf->buf);
+ }
}
}
if (!cm->error_resilient_mode) {
+ cm->coding_use_prev_mi = 1;
cm->refresh_frame_context = vp9_rb_read_bit(rb);
cm->frame_parallel_decoding_mode = vp9_rb_read_bit(rb);
} else {
+ cm->coding_use_prev_mi = 0;
cm->refresh_frame_context = 0;
cm->frame_parallel_decoding_mode = 1;
}
// This flag will be overridden by the call to vp9_setup_past_independence
// below, forcing the use of context 0 for those frame types.
- cm->frame_context_idx = vp9_rb_read_literal(rb, NUM_FRAME_CONTEXTS_LOG2);
+ cm->frame_context_idx = vp9_rb_read_literal(rb, FRAME_CONTEXTS_LOG2);
if (frame_is_intra_only(cm) || cm->error_resilient_mode)
vp9_setup_past_independence(cm);
@@ -1204,11 +1228,11 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
cm->tx_mode = xd->lossless ? ONLY_4X4 : read_tx_mode(&r);
if (cm->tx_mode == TX_MODE_SELECT)
- read_tx_probs(&fc->tx_probs, &r);
+ read_tx_mode_probs(&fc->tx_probs, &r);
read_coef_probs(fc, cm->tx_mode, &r);
- for (k = 0; k < MBSKIP_CONTEXTS; ++k)
- vp9_diff_update_prob(&r, &fc->mbskip_probs[k]);
+ for (k = 0; k < SKIP_CONTEXTS; ++k)
+ vp9_diff_update_prob(&r, &fc->skip_probs[k]);
if (!frame_is_intra_only(cm)) {
nmv_context *const nmvc = &fc->nmvc;
@@ -1216,13 +1240,16 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
read_inter_mode_probs(fc, &r);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
read_switchable_interp_probs(fc, &r);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
vp9_diff_update_prob(&r, &fc->intra_inter_prob[i]);
- read_comp_pred(cm, &r);
+ cm->reference_mode = read_frame_reference_mode(cm, &r);
+ if (cm->reference_mode != SINGLE_REFERENCE)
+ setup_compound_reference_mode(cm);
+ read_frame_reference_mode_probs(cm, &r);
for (j = 0; j < BLOCK_SIZE_GROUPS; j++)
for (i = 0; i < INTRA_MODES - 1; ++i)
@@ -1282,8 +1309,7 @@ static void debug_check_frame_counts(const VP9_COMMON *const cm) {
assert(!memcmp(cm->counts.comp_ref, zero_counts.comp_ref,
sizeof(cm->counts.comp_ref)));
assert(!memcmp(&cm->counts.tx, &zero_counts.tx, sizeof(cm->counts.tx)));
- assert(!memcmp(cm->counts.mbskip, zero_counts.mbskip,
- sizeof(cm->counts.mbskip)));
+ assert(!memcmp(cm->counts.skip, zero_counts.skip, sizeof(cm->counts.skip)));
assert(!memcmp(&cm->counts.mv, &zero_counts.mv, sizeof(cm->counts.mv)));
}
#endif // NDEBUG
@@ -1302,6 +1328,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
const int tile_rows = 1 << cm->log2_tile_rows;
const int tile_cols = 1 << cm->log2_tile_cols;
YV12_BUFFER_CONFIG *const new_fb = get_frame_new_buffer(cm);
+ xd->cur_buf = new_fb;
if (!first_partition_size) {
// showing a frame directly
@@ -1331,10 +1358,13 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
alloc_tile_storage(pbi, tile_rows, tile_cols);
xd->mode_info_stride = cm->mode_info_stride;
- set_prev_mi(cm);
+ if (cm->coding_use_prev_mi)
+ set_prev_mi(cm);
+ else
+ cm->prev_mi = NULL;
setup_plane_dequants(cm, xd, cm->base_qindex);
- setup_block_dptrs(xd, cm->subsampling_x, cm->subsampling_y);
+ vp9_setup_block_planes(xd, cm->subsampling_x, cm->subsampling_y);
cm->fc = cm->frame_contexts[cm->frame_context_idx];
vp9_zero(cm->counts);
@@ -1353,9 +1383,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
*p_data_end = decode_tiles(pbi, data + first_partition_size);
}
- cm->last_width = cm->width;
- cm->last_height = cm->height;
-
new_fb->corrupted |= xd->corrupted;
if (!pbi->decoded_key_frame) {
diff --git a/libvpx/vp9/decoder/vp9_decodframe.h b/libvpx/vp9/decoder/vp9_decodeframe.h
index c665f6f..4537bc8 100644
--- a/libvpx/vp9/decoder/vp9_decodframe.h
+++ b/libvpx/vp9/decoder/vp9_decodeframe.h
@@ -9,8 +9,12 @@
*/
-#ifndef VP9_DECODER_VP9_DECODFRAME_H_
-#define VP9_DECODER_VP9_DECODFRAME_H_
+#ifndef VP9_DECODER_VP9_DECODEFRAME_H_
+#define VP9_DECODER_VP9_DECODEFRAME_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
struct VP9Common;
struct VP9Decompressor;
@@ -18,4 +22,8 @@ struct VP9Decompressor;
void vp9_init_dequantizer(struct VP9Common *cm);
int vp9_decode_frame(struct VP9Decompressor *cpi, const uint8_t **p_data_end);
-#endif // VP9_DECODER_VP9_DECODFRAME_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_DECODER_VP9_DECODEFRAME_H_
diff --git a/libvpx/vp9/decoder/vp9_decodemv.c b/libvpx/vp9/decoder/vp9_decodemv.c
index b948429..06a21ea 100644
--- a/libvpx/vp9/decoder/vp9_decodemv.c
+++ b/libvpx/vp9/decoder/vp9_decodemv.c
@@ -14,19 +14,17 @@
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_entropymv.h"
-#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_mvref_common.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_seg_common.h"
#include "vp9/decoder/vp9_decodemv.h"
-#include "vp9/decoder/vp9_decodframe.h"
-#include "vp9/decoder/vp9_onyxd_int.h"
-#include "vp9/decoder/vp9_treereader.h"
+#include "vp9/decoder/vp9_decodeframe.h"
+#include "vp9/decoder/vp9_reader.h"
static MB_PREDICTION_MODE read_intra_mode(vp9_reader *r, const vp9_prob *p) {
- return (MB_PREDICTION_MODE)treed_read(r, vp9_intra_mode_tree, p);
+ return (MB_PREDICTION_MODE)vp9_read_tree(r, vp9_intra_mode_tree, p);
}
static MB_PREDICTION_MODE read_intra_mode_y(VP9_COMMON *cm, vp9_reader *r,
@@ -49,8 +47,8 @@ static MB_PREDICTION_MODE read_intra_mode_uv(VP9_COMMON *cm, vp9_reader *r,
static MB_PREDICTION_MODE read_inter_mode(VP9_COMMON *cm, vp9_reader *r,
int ctx) {
- const int mode = treed_read(r, vp9_inter_mode_tree,
- cm->fc.inter_mode_probs[ctx]);
+ const int mode = vp9_read_tree(r, vp9_inter_mode_tree,
+ cm->fc.inter_mode_probs[ctx]);
if (!cm->frame_parallel_decoding_mode)
++cm->counts.inter_mode[ctx][mode];
@@ -58,14 +56,14 @@ static MB_PREDICTION_MODE read_inter_mode(VP9_COMMON *cm, vp9_reader *r,
}
static int read_segment_id(vp9_reader *r, const struct segmentation *seg) {
- return treed_read(r, vp9_segment_tree, seg->tree_probs);
+ return vp9_read_tree(r, vp9_segment_tree, seg->tree_probs);
}
static TX_SIZE read_selected_tx_size(VP9_COMMON *cm, MACROBLOCKD *xd,
TX_SIZE max_tx_size, vp9_reader *r) {
- const int ctx = vp9_get_pred_context_tx_size(xd);
+ const int ctx = vp9_get_tx_size_context(xd);
const vp9_prob *tx_probs = get_tx_probs(max_tx_size, ctx, &cm->fc.tx_probs);
- TX_SIZE tx_size = vp9_read(r, tx_probs[0]);
+ TX_SIZE tx_size = (TX_SIZE)vp9_read(r, tx_probs[0]);
if (tx_size != TX_4X4 && max_tx_size >= TX_16X16) {
tx_size += vp9_read(r, tx_probs[1]);
if (tx_size != TX_8X8 && max_tx_size >= TX_32X32)
@@ -123,23 +121,23 @@ static int read_intra_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
int mi_row, int mi_col, vp9_reader *r) {
struct segmentation *const seg = &cm->seg;
- const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
- int pred_segment_id, segment_id;
+ MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
+ const BLOCK_SIZE bsize = mbmi->sb_type;
+ int predicted_segment_id, segment_id;
if (!seg->enabled)
return 0; // Default for disabled segmentation
- pred_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map,
- bsize, mi_row, mi_col);
+ predicted_segment_id = vp9_get_segment_id(cm, cm->last_frame_seg_map,
+ bsize, mi_row, mi_col);
if (!seg->update_map)
- return pred_segment_id;
+ return predicted_segment_id;
if (seg->temporal_update) {
const vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
- const int pred_flag = vp9_read(r, pred_prob);
- vp9_set_pred_flag_seg_id(xd, pred_flag);
- segment_id = pred_flag ? pred_segment_id
- : read_segment_id(r, seg);
+ mbmi->seg_id_predicted = vp9_read(r, pred_prob);
+ segment_id = mbmi->seg_id_predicted ? predicted_segment_id
+ : read_segment_id(r, seg);
} else {
segment_id = read_segment_id(r, seg);
}
@@ -147,60 +145,57 @@ static int read_inter_segment_id(VP9_COMMON *const cm, MACROBLOCKD *const xd,
return segment_id;
}
-static int read_skip_coeff(VP9_COMMON *cm, const MACROBLOCKD *xd,
- int segment_id, vp9_reader *r) {
+static int read_skip(VP9_COMMON *cm, const MACROBLOCKD *xd,
+ int segment_id, vp9_reader *r) {
if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)) {
return 1;
} else {
- const int ctx = vp9_get_pred_context_mbskip(xd);
- const int skip = vp9_read(r, cm->fc.mbskip_probs[ctx]);
+ const int ctx = vp9_get_skip_context(xd);
+ const int skip = vp9_read(r, cm->fc.skip_probs[ctx]);
if (!cm->frame_parallel_decoding_mode)
- ++cm->counts.mbskip[ctx][skip];
+ ++cm->counts.skip[ctx][skip];
return skip;
}
}
static void read_intra_frame_mode_info(VP9_COMMON *const cm,
MACROBLOCKD *const xd,
- MODE_INFO *const m,
int mi_row, int mi_col, vp9_reader *r) {
- MB_MODE_INFO *const mbmi = &m->mbmi;
- const BLOCK_SIZE bsize = mbmi->sb_type;
+ MODE_INFO *const mi = xd->mi_8x8[0];
+ MB_MODE_INFO *const mbmi = &mi->mbmi;
const MODE_INFO *above_mi = xd->mi_8x8[-cm->mode_info_stride];
const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
+ const BLOCK_SIZE bsize = mbmi->sb_type;
+ int i;
mbmi->segment_id = read_intra_segment_id(cm, xd, mi_row, mi_col, r);
- mbmi->skip_coeff = read_skip_coeff(cm, xd, mbmi->segment_id, r);
+ mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, bsize, 1, r);
mbmi->ref_frame[0] = INTRA_FRAME;
mbmi->ref_frame[1] = NONE;
- if (bsize >= BLOCK_8X8) {
- const MB_PREDICTION_MODE A = above_block_mode(m, above_mi, 0);
- const MB_PREDICTION_MODE L = left_block_mode(m, left_mi, 0);
- mbmi->mode = read_intra_mode(r, vp9_kf_y_mode_prob[A][L]);
- } else {
- // Only 4x4, 4x8, 8x4 blocks
- const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
- const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2
- int idx, idy;
-
- for (idy = 0; idy < 2; idy += num_4x4_h) {
- for (idx = 0; idx < 2; idx += num_4x4_w) {
- const int ib = idy * 2 + idx;
- const MB_PREDICTION_MODE A = above_block_mode(m, above_mi, ib);
- const MB_PREDICTION_MODE L = left_block_mode(m, left_mi, ib);
- const MB_PREDICTION_MODE b_mode = read_intra_mode(r,
- vp9_kf_y_mode_prob[A][L]);
- m->bmi[ib].as_mode = b_mode;
- if (num_4x4_h == 2)
- m->bmi[ib + 2].as_mode = b_mode;
- if (num_4x4_w == 2)
- m->bmi[ib + 1].as_mode = b_mode;
- }
- }
-
- mbmi->mode = m->bmi[3].as_mode;
+ switch (bsize) {
+ case BLOCK_4X4:
+ for (i = 0; i < 4; ++i)
+ mi->bmi[i].as_mode =
+ read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, i));
+ mbmi->mode = mi->bmi[3].as_mode;
+ break;
+ case BLOCK_4X8:
+ mi->bmi[0].as_mode = mi->bmi[2].as_mode =
+ read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0));
+ mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode =
+ read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 1));
+ break;
+ case BLOCK_8X4:
+ mi->bmi[0].as_mode = mi->bmi[1].as_mode =
+ read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 0));
+ mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode =
+ read_intra_mode(r, get_y_mode_probs(mi, above_mi, left_mi, 2));
+ break;
+ default:
+ mbmi->mode = read_intra_mode(r,
+ get_y_mode_probs(mi, above_mi, left_mi, 0));
}
mbmi->uv_mode = read_intra_mode(r, vp9_kf_uv_mode_prob[mbmi->mode]);
@@ -210,12 +205,12 @@ static int read_mv_component(vp9_reader *r,
const nmv_component *mvcomp, int usehp) {
int mag, d, fr, hp;
const int sign = vp9_read(r, mvcomp->sign);
- const int mv_class = treed_read(r, vp9_mv_class_tree, mvcomp->classes);
+ const int mv_class = vp9_read_tree(r, vp9_mv_class_tree, mvcomp->classes);
const int class0 = mv_class == MV_CLASS_0;
// Integer part
if (class0) {
- d = treed_read(r, vp9_mv_class0_tree, mvcomp->class0);
+ d = vp9_read_tree(r, vp9_mv_class0_tree, mvcomp->class0);
} else {
int i;
const int n = mv_class + CLASS0_BITS - 1; // number of bits
@@ -226,8 +221,8 @@ static int read_mv_component(vp9_reader *r,
}
// Fractional part
- fr = treed_read(r, vp9_mv_fp_tree,
- class0 ? mvcomp->class0_fp[d] : mvcomp->fp);
+ fr = vp9_read_tree(r, vp9_mv_fp_tree, class0 ? mvcomp->class0_fp[d]
+ : mvcomp->fp);
// High precision part (if hp is not used, the default value of the hp is 1)
@@ -242,7 +237,7 @@ static int read_mv_component(vp9_reader *r,
static INLINE void read_mv(vp9_reader *r, MV *mv, const MV *ref,
const nmv_context *ctx,
nmv_context_counts *counts, int allow_hp) {
- const MV_JOINT_TYPE j = treed_read(r, vp9_mv_joint_tree, ctx->joints);
+ const MV_JOINT_TYPE j = vp9_read_tree(r, vp9_mv_joint_tree, ctx->joints);
const int use_hp = allow_hp && vp9_use_mv_hp(ref);
MV diff = {0, 0};
@@ -258,14 +253,19 @@ static INLINE void read_mv(vp9_reader *r, MV *mv, const MV *ref,
mv->col = ref->col + diff.col;
}
-static COMPPREDMODE_TYPE read_reference_mode(VP9_COMMON *cm,
- const MACROBLOCKD *xd,
- vp9_reader *r) {
- const int ctx = vp9_get_pred_context_comp_inter_inter(cm, xd);
- const int mode = vp9_read(r, cm->fc.comp_inter_prob[ctx]);
- if (!cm->frame_parallel_decoding_mode)
- ++cm->counts.comp_inter[ctx][mode];
- return mode; // SINGLE_PREDICTION_ONLY or COMP_PREDICTION_ONLY
+static REFERENCE_MODE read_block_reference_mode(VP9_COMMON *cm,
+ const MACROBLOCKD *xd,
+ vp9_reader *r) {
+ if (cm->reference_mode == REFERENCE_MODE_SELECT) {
+ const int ctx = vp9_get_reference_mode_context(cm, xd);
+ const REFERENCE_MODE mode =
+ (REFERENCE_MODE)vp9_read(r, cm->fc.comp_inter_prob[ctx]);
+ if (!cm->frame_parallel_decoding_mode)
+ ++cm->counts.comp_inter[ctx][mode];
+ return mode; // SINGLE_REFERENCE or COMPOUND_REFERENCE
+ } else {
+ return cm->reference_mode;
+ }
}
// Read the referncence frame
@@ -279,12 +279,9 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
ref_frame[0] = vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
ref_frame[1] = NONE;
} else {
- const COMPPREDMODE_TYPE mode = (cm->comp_pred_mode == HYBRID_PREDICTION)
- ? read_reference_mode(cm, xd, r)
- : cm->comp_pred_mode;
-
+ const REFERENCE_MODE mode = read_block_reference_mode(cm, xd, r);
// FIXME(rbultje) I'm pretty sure this breaks segmentation ref frame coding
- if (mode == COMP_PREDICTION_ONLY) {
+ if (mode == COMPOUND_REFERENCE) {
const int idx = cm->ref_frame_sign_bias[cm->comp_fixed_ref];
const int ctx = vp9_get_pred_context_comp_ref_p(cm, xd);
const int bit = vp9_read(r, fc->comp_ref_prob[ctx]);
@@ -292,7 +289,7 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
++counts->comp_ref[ctx][bit];
ref_frame[idx] = cm->comp_fixed_ref;
ref_frame[!idx] = cm->comp_var_ref[bit];
- } else if (mode == SINGLE_PREDICTION_ONLY) {
+ } else if (mode == SINGLE_REFERENCE) {
const int ctx0 = vp9_get_pred_context_single_ref_p1(xd);
const int bit0 = vp9_read(r, fc->single_ref_prob[ctx0][0]);
if (!cm->frame_parallel_decoding_mode)
@@ -309,17 +306,18 @@ static void read_ref_frames(VP9_COMMON *const cm, MACROBLOCKD *const xd,
ref_frame[1] = NONE;
} else {
- assert(!"Invalid prediction mode.");
+ assert(0 && "Invalid prediction mode.");
}
}
}
-static INLINE INTERPOLATION_TYPE read_switchable_filter_type(
+static INLINE INTERP_FILTER read_switchable_interp_filter(
VP9_COMMON *const cm, MACROBLOCKD *const xd, vp9_reader *r) {
const int ctx = vp9_get_pred_context_switchable_interp(xd);
- const int type = treed_read(r, vp9_switchable_interp_tree,
- cm->fc.switchable_interp_prob[ctx]);
+ const INTERP_FILTER type =
+ (INTERP_FILTER)vp9_read_tree(r, vp9_switchable_interp_tree,
+ cm->fc.switchable_interp_prob[ctx]);
if (!cm->frame_parallel_decoding_mode)
++cm->counts.switchable_interp[ctx][type];
return type;
@@ -329,39 +327,43 @@ static void read_intra_block_mode_info(VP9_COMMON *const cm, MODE_INFO *mi,
vp9_reader *r) {
MB_MODE_INFO *const mbmi = &mi->mbmi;
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
+ int i;
mbmi->ref_frame[0] = INTRA_FRAME;
mbmi->ref_frame[1] = NONE;
- if (bsize >= BLOCK_8X8) {
- mbmi->mode = read_intra_mode_y(cm, r, size_group_lookup[bsize]);
- } else {
- // Only 4x4, 4x8, 8x4 blocks
- const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
- const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2
- int idx, idy;
-
- for (idy = 0; idy < 2; idy += num_4x4_h) {
- for (idx = 0; idx < 2; idx += num_4x4_w) {
- const int ib = idy * 2 + idx;
- const int b_mode = read_intra_mode_y(cm, r, 0);
- mi->bmi[ib].as_mode = b_mode;
- if (num_4x4_h == 2)
- mi->bmi[ib + 2].as_mode = b_mode;
- if (num_4x4_w == 2)
- mi->bmi[ib + 1].as_mode = b_mode;
- }
- }
- mbmi->mode = mi->bmi[3].as_mode;
+ switch (bsize) {
+ case BLOCK_4X4:
+ for (i = 0; i < 4; ++i)
+ mi->bmi[i].as_mode = read_intra_mode_y(cm, r, 0);
+ mbmi->mode = mi->bmi[3].as_mode;
+ break;
+ case BLOCK_4X8:
+ mi->bmi[0].as_mode = mi->bmi[2].as_mode = read_intra_mode_y(cm, r, 0);
+ mi->bmi[1].as_mode = mi->bmi[3].as_mode = mbmi->mode =
+ read_intra_mode_y(cm, r, 0);
+ break;
+ case BLOCK_8X4:
+ mi->bmi[0].as_mode = mi->bmi[1].as_mode = read_intra_mode_y(cm, r, 0);
+ mi->bmi[2].as_mode = mi->bmi[3].as_mode = mbmi->mode =
+ read_intra_mode_y(cm, r, 0);
+ break;
+ default:
+ mbmi->mode = read_intra_mode_y(cm, r, size_group_lookup[bsize]);
}
mbmi->uv_mode = read_intra_mode_uv(cm, r, mbmi->mode);
}
+static INLINE int is_mv_valid(const MV *mv) {
+ return mv->row > MV_LOW && mv->row < MV_UPP &&
+ mv->col > MV_LOW && mv->col < MV_UPP;
+}
+
static INLINE int assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
- int_mv mv[2], int_mv best_mv[2],
- int_mv nearest_mv[2], int_mv near_mv[2],
- int is_compound, int allow_hp, vp9_reader *r) {
+ int_mv mv[2], int_mv ref_mv[2],
+ int_mv nearest_mv[2], int_mv near_mv[2],
+ int is_compound, int allow_hp, vp9_reader *r) {
int i;
int ret = 1;
@@ -369,30 +371,29 @@ static INLINE int assign_mv(VP9_COMMON *cm, MB_PREDICTION_MODE mode,
case NEWMV: {
nmv_context_counts *const mv_counts = cm->frame_parallel_decoding_mode ?
NULL : &cm->counts.mv;
- read_mv(r, &mv[0].as_mv, &best_mv[0].as_mv,
- &cm->fc.nmvc, mv_counts, allow_hp);
- if (is_compound)
- read_mv(r, &mv[1].as_mv, &best_mv[1].as_mv,
- &cm->fc.nmvc, mv_counts, allow_hp);
for (i = 0; i < 1 + is_compound; ++i) {
- ret = ret && mv[i].as_mv.row < MV_UPP && mv[i].as_mv.row > MV_LOW;
- ret = ret && mv[i].as_mv.col < MV_UPP && mv[i].as_mv.col > MV_LOW;
+ read_mv(r, &mv[i].as_mv, &ref_mv[i].as_mv, &cm->fc.nmvc, mv_counts,
+ allow_hp);
+ ret = ret && is_mv_valid(&mv[i].as_mv);
}
break;
}
case NEARESTMV: {
mv[0].as_int = nearest_mv[0].as_int;
- if (is_compound) mv[1].as_int = nearest_mv[1].as_int;
+ if (is_compound)
+ mv[1].as_int = nearest_mv[1].as_int;
break;
}
case NEARMV: {
mv[0].as_int = near_mv[0].as_int;
- if (is_compound) mv[1].as_int = near_mv[1].as_int;
+ if (is_compound)
+ mv[1].as_int = near_mv[1].as_int;
break;
}
case ZEROMV: {
mv[0].as_int = 0;
- if (is_compound) mv[1].as_int = 0;
+ if (is_compound)
+ mv[1].as_int = 0;
break;
}
default: {
@@ -408,8 +409,8 @@ static int read_is_inter_block(VP9_COMMON *const cm, MACROBLOCKD *const xd,
return vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME) !=
INTRA_FRAME;
} else {
- const int ctx = vp9_get_pred_context_intra_inter(xd);
- const int is_inter = vp9_read(r, vp9_get_pred_prob_intra_inter(cm, xd));
+ const int ctx = vp9_get_intra_inter_context(xd);
+ const int is_inter = vp9_read(r, cm->fc.intra_inter_prob[ctx]);
if (!cm->frame_parallel_decoding_mode)
++cm->counts.intra_inter[ctx][is_inter];
return is_inter;
@@ -425,20 +426,19 @@ static void read_inter_block_mode_info(VP9_COMMON *const cm,
const BLOCK_SIZE bsize = mbmi->sb_type;
const int allow_hp = cm->allow_high_precision_mv;
- int_mv nearest[2], nearmv[2], best[2];
- uint8_t inter_mode_ctx;
- MV_REFERENCE_FRAME ref0;
- int is_compound;
+ int_mv nearestmv[2], nearmv[2];
+ int inter_mode_ctx, ref, is_compound;
- mbmi->uv_mode = DC_PRED;
read_ref_frames(cm, xd, r, mbmi->segment_id, mbmi->ref_frame);
- ref0 = mbmi->ref_frame[0];
is_compound = has_second_ref(mbmi);
- vp9_find_mv_refs(cm, xd, tile, mi, xd->last_mi, ref0, mbmi->ref_mvs[ref0],
- mi_row, mi_col);
+ for (ref = 0; ref < 1 + is_compound; ++ref) {
+ const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
+ vp9_find_mv_refs(cm, xd, tile, mi, frame, mbmi->ref_mvs[frame],
+ mi_row, mi_col);
+ }
- inter_mode_ctx = mbmi->mode_context[ref0];
+ inter_mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]];
if (vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP)) {
mbmi->mode = ZEROMV;
@@ -452,58 +452,42 @@ static void read_inter_block_mode_info(VP9_COMMON *const cm,
mbmi->mode = read_inter_mode(cm, r, inter_mode_ctx);
}
- // nearest, nearby
if (bsize < BLOCK_8X8 || mbmi->mode != ZEROMV) {
- vp9_find_best_ref_mvs(xd, allow_hp,
- mbmi->ref_mvs[ref0], &nearest[0], &nearmv[0]);
- best[0].as_int = nearest[0].as_int;
- }
-
- if (is_compound) {
- const MV_REFERENCE_FRAME ref1 = mbmi->ref_frame[1];
- vp9_find_mv_refs(cm, xd, tile, mi, xd->last_mi,
- ref1, mbmi->ref_mvs[ref1], mi_row, mi_col);
-
- if (bsize < BLOCK_8X8 || mbmi->mode != ZEROMV) {
- vp9_find_best_ref_mvs(xd, allow_hp,
- mbmi->ref_mvs[ref1], &nearest[1], &nearmv[1]);
- best[1].as_int = nearest[1].as_int;
+ for (ref = 0; ref < 1 + is_compound; ++ref) {
+ vp9_find_best_ref_mvs(xd, allow_hp, mbmi->ref_mvs[mbmi->ref_frame[ref]],
+ &nearestmv[ref], &nearmv[ref]);
}
}
- mbmi->interp_filter = (cm->mcomp_filter_type == SWITCHABLE)
- ? read_switchable_filter_type(cm, xd, r)
- : cm->mcomp_filter_type;
+ mbmi->interp_filter = (cm->interp_filter == SWITCHABLE)
+ ? read_switchable_interp_filter(cm, xd, r)
+ : cm->interp_filter;
if (bsize < BLOCK_8X8) {
const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize]; // 1 or 2
const int num_4x4_h = num_4x4_blocks_high_lookup[bsize]; // 1 or 2
int idx, idy;
- int b_mode;
+ MB_PREDICTION_MODE b_mode;
+ int_mv nearest_sub8x8[2], near_sub8x8[2];
for (idy = 0; idy < 2; idy += num_4x4_h) {
for (idx = 0; idx < 2; idx += num_4x4_w) {
int_mv block[2];
const int j = idy * 2 + idx;
b_mode = read_inter_mode(cm, r, inter_mode_ctx);
- if (b_mode == NEARESTMV || b_mode == NEARMV) {
- vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, &nearest[0],
- &nearmv[0], j, 0,
- mi_row, mi_col);
+ if (b_mode == NEARESTMV || b_mode == NEARMV)
+ for (ref = 0; ref < 1 + is_compound; ++ref)
+ vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, j, ref, mi_row, mi_col,
+ &nearest_sub8x8[ref],
+ &near_sub8x8[ref]);
- if (is_compound)
- vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, &nearest[1],
- &nearmv[1], j, 1,
- mi_row, mi_col);
- }
-
- if (!assign_mv(cm, b_mode, block, best, nearest, nearmv,
+ if (!assign_mv(cm, b_mode, block, nearestmv,
+ nearest_sub8x8, near_sub8x8,
is_compound, allow_hp, r)) {
xd->corrupted |= 1;
break;
};
-
mi->bmi[j].as_mv[0].as_int = block[0].as_int;
if (is_compound)
mi->bmi[j].as_mv[1].as_int = block[1].as_int;
@@ -520,27 +504,26 @@ static void read_inter_block_mode_info(VP9_COMMON *const cm,
mbmi->mv[0].as_int = mi->bmi[3].as_mv[0].as_int;
mbmi->mv[1].as_int = mi->bmi[3].as_mv[1].as_int;
} else {
- xd->corrupted |= !assign_mv(cm, mbmi->mode, mbmi->mv,
- best, nearest, nearmv,
- is_compound, allow_hp, r);
+ xd->corrupted |= !assign_mv(cm, mbmi->mode, mbmi->mv, nearestmv,
+ nearestmv, nearmv, is_compound, allow_hp, r);
}
}
static void read_inter_frame_mode_info(VP9_COMMON *const cm,
MACROBLOCKD *const xd,
const TileInfo *const tile,
- MODE_INFO *const mi,
int mi_row, int mi_col, vp9_reader *r) {
+ MODE_INFO *const mi = xd->mi_8x8[0];
MB_MODE_INFO *const mbmi = &mi->mbmi;
int inter_block;
mbmi->mv[0].as_int = 0;
mbmi->mv[1].as_int = 0;
mbmi->segment_id = read_inter_segment_id(cm, xd, mi_row, mi_col, r);
- mbmi->skip_coeff = read_skip_coeff(cm, xd, mbmi->segment_id, r);
+ mbmi->skip = read_skip(cm, xd, mbmi->segment_id, r);
inter_block = read_is_inter_block(cm, xd, mbmi->segment_id, r);
mbmi->tx_size = read_tx_size(cm, xd, cm->tx_mode, mbmi->sb_type,
- !mbmi->skip_coeff || !inter_block, r);
+ !mbmi->skip || !inter_block, r);
if (inter_block)
read_inter_block_mode_info(cm, xd, tile, mi, mi_row, mi_col, r);
@@ -551,22 +534,8 @@ static void read_inter_frame_mode_info(VP9_COMMON *const cm,
void vp9_read_mode_info(VP9_COMMON *cm, MACROBLOCKD *xd,
const TileInfo *const tile,
int mi_row, int mi_col, vp9_reader *r) {
- MODE_INFO *const mi = xd->mi_8x8[0];
- const BLOCK_SIZE bsize = mi->mbmi.sb_type;
- const int bw = num_8x8_blocks_wide_lookup[bsize];
- const int bh = num_8x8_blocks_high_lookup[bsize];
- const int y_mis = MIN(bh, cm->mi_rows - mi_row);
- const int x_mis = MIN(bw, cm->mi_cols - mi_col);
- int x, y, z;
-
if (frame_is_intra_only(cm))
- read_intra_frame_mode_info(cm, xd, mi, mi_row, mi_col, r);
+ read_intra_frame_mode_info(cm, xd, mi_row, mi_col, r);
else
- read_inter_frame_mode_info(cm, xd, tile, mi, mi_row, mi_col, r);
-
- for (y = 0, z = 0; y < y_mis; y++, z += cm->mode_info_stride) {
- for (x = !y; x < x_mis; x++) {
- xd->mi_8x8[z + x] = mi;
- }
- }
+ read_inter_frame_mode_info(cm, xd, tile, mi_row, mi_col, r);
}
diff --git a/libvpx/vp9/decoder/vp9_decodemv.h b/libvpx/vp9/decoder/vp9_decodemv.h
index 8e9ae4a..7394b62 100644
--- a/libvpx/vp9/decoder/vp9_decodemv.h
+++ b/libvpx/vp9/decoder/vp9_decodemv.h
@@ -11,8 +11,11 @@
#ifndef VP9_DECODER_VP9_DECODEMV_H_
#define VP9_DECODER_VP9_DECODEMV_H_
-#include "vp9/decoder/vp9_onyxd_int.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
+#include "vp9/decoder/vp9_reader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
struct TileInfo;
@@ -20,4 +23,8 @@ void vp9_read_mode_info(VP9_COMMON *cm, MACROBLOCKD *xd,
const struct TileInfo *const tile,
int mi_row, int mi_col, vp9_reader *r);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_DECODER_VP9_DECODEMV_H_
diff --git a/libvpx/vp9/decoder/vp9_onyxd_if.c b/libvpx/vp9/decoder/vp9_decoder.c
index cb45d37..ebb329c 100644
--- a/libvpx/vp9/decoder/vp9_onyxd_if.c
+++ b/libvpx/vp9/decoder/vp9_decoder.c
@@ -12,22 +12,25 @@
#include <limits.h>
#include <stdio.h>
+#include "./vpx_scale_rtcd.h"
+
+#include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/vpx_timer.h"
+#include "vpx_scale/vpx_scale.h"
+
+#include "vp9/common/vp9_alloccommon.h"
+#include "vp9/common/vp9_loopfilter.h"
#include "vp9/common/vp9_onyxc_int.h"
#if CONFIG_VP9_POSTPROC
#include "vp9/common/vp9_postproc.h"
#endif
-#include "vp9/decoder/vp9_onyxd.h"
-#include "vp9/decoder/vp9_onyxd_int.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_alloccommon.h"
-#include "vp9/common/vp9_loopfilter.h"
#include "vp9/common/vp9_quant_common.h"
-#include "vpx_scale/vpx_scale.h"
#include "vp9/common/vp9_systemdependent.h"
-#include "vpx_ports/vpx_timer.h"
-#include "vp9/decoder/vp9_decodframe.h"
+
+#include "vp9/decoder/vp9_decodeframe.h"
+#include "vp9/decoder/vp9_decoder.h"
#include "vp9/decoder/vp9_detokenize.h"
-#include "./vpx_scale_rtcd.h"
+#include "vp9/decoder/vp9_dthread.h"
#define WRITE_RECON_BUFFER 0
#if WRITE_RECON_BUFFER == 1
@@ -112,14 +115,11 @@ static void init_macroblockd(VP9D_COMP *const pbi) {
struct macroblockd_plane *const pd = xd->plane;
int i;
- for (i = 0; i < MAX_MB_PLANE; ++i) {
- pd[i].qcoeff = pbi->qcoeff[i];
+ for (i = 0; i < MAX_MB_PLANE; ++i)
pd[i].dqcoeff = pbi->dqcoeff[i];
- pd[i].eobs = pbi->eobs[i];
- }
}
-VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
+VP9D_COMP *vp9_create_decompressor(VP9D_CONFIG *oxcf) {
VP9D_COMP *const pbi = vpx_memalign(32, sizeof(VP9D_COMP));
VP9_COMMON *const cm = pbi ? &pbi->common : NULL;
@@ -128,6 +128,9 @@ VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
vp9_zero(*pbi);
+ // Initialize the references to not point to any frame buffers.
+ memset(&cm->ref_frame_map, -1, sizeof(cm->ref_frame_map));
+
if (setjmp(cm->error.jmp)) {
cm->error.setjmp = 0;
vp9_remove_decompressor(pbi);
@@ -137,7 +140,7 @@ VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
cm->error.setjmp = 1;
vp9_initialize_dec();
- vp9_create_common(cm);
+ vp9_rtcd();
pbi->oxcf = *oxcf;
pbi->ready_for_new_data = 1;
@@ -160,9 +163,8 @@ VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf) {
return pbi;
}
-void vp9_remove_decompressor(VP9D_PTR ptr) {
+void vp9_remove_decompressor(VP9D_COMP *pbi) {
int i;
- VP9D_COMP *const pbi = (VP9D_COMP *)ptr;
if (!pbi)
return;
@@ -177,21 +179,30 @@ void vp9_remove_decompressor(VP9D_PTR ptr) {
vpx_free(worker->data2);
}
vpx_free(pbi->tile_workers);
- vpx_free(pbi->mi_streams);
+
+ if (pbi->num_tile_workers) {
+ VP9_COMMON *const cm = &pbi->common;
+ const int sb_rows =
+ mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
+ VP9LfSync *const lf_sync = &pbi->lf_row_sync;
+
+ vp9_loop_filter_dealloc(lf_sync, sb_rows);
+ }
+
vpx_free(pbi->above_context[0]);
vpx_free(pbi->above_seg_context);
vpx_free(pbi);
}
-static int equal_dimensions(YV12_BUFFER_CONFIG *a, YV12_BUFFER_CONFIG *b) {
+static int equal_dimensions(const YV12_BUFFER_CONFIG *a,
+ const YV12_BUFFER_CONFIG *b) {
return a->y_height == b->y_height && a->y_width == b->y_width &&
a->uv_height == b->uv_height && a->uv_width == b->uv_width;
}
-vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR ptr,
+vpx_codec_err_t vp9_copy_reference_dec(VP9D_COMP *pbi,
VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
- VP9D_COMP *pbi = (VP9D_COMP *) ptr;
VP9_COMMON *cm = &pbi->common;
/* TODO(jkoleszar): The decoder doesn't have any real knowledge of what the
@@ -200,7 +211,8 @@ vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR ptr,
* later commit that adds VP9-specific controls for this functionality.
*/
if (ref_frame_flag == VP9_LAST_FLAG) {
- YV12_BUFFER_CONFIG *cfg = &cm->yv12_fb[cm->ref_frame_map[0]];
+ const YV12_BUFFER_CONFIG *const cfg =
+ &cm->frame_bufs[cm->ref_frame_map[0]].buf;
if (!equal_dimensions(cfg, sd))
vpx_internal_error(&cm->error, VPX_CODEC_ERROR,
"Incorrect buffer dimensions");
@@ -215,11 +227,11 @@ vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR ptr,
}
-vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR ptr, VP9_REFFRAME ref_frame_flag,
+vpx_codec_err_t vp9_set_reference_dec(VP9D_COMP *pbi,
+ VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
- VP9D_COMP *pbi = (VP9D_COMP *) ptr;
VP9_COMMON *cm = &pbi->common;
- int *ref_fb_ptr = NULL;
+ RefBuffer *ref_buf = NULL;
/* TODO(jkoleszar): The decoder doesn't have any real knowledge of what the
* encoder is using the frame buffers for. This is just a stub to keep the
@@ -227,44 +239,46 @@ vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR ptr, VP9_REFFRAME ref_frame_flag,
* later commit that adds VP9-specific controls for this functionality.
*/
if (ref_frame_flag == VP9_LAST_FLAG) {
- ref_fb_ptr = &pbi->common.active_ref_idx[0];
+ ref_buf = &cm->frame_refs[0];
} else if (ref_frame_flag == VP9_GOLD_FLAG) {
- ref_fb_ptr = &pbi->common.active_ref_idx[1];
+ ref_buf = &cm->frame_refs[1];
} else if (ref_frame_flag == VP9_ALT_FLAG) {
- ref_fb_ptr = &pbi->common.active_ref_idx[2];
+ ref_buf = &cm->frame_refs[2];
} else {
vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
"Invalid reference frame");
return pbi->common.error.error_code;
}
- if (!equal_dimensions(&cm->yv12_fb[*ref_fb_ptr], sd)) {
+ if (!equal_dimensions(ref_buf->buf, sd)) {
vpx_internal_error(&pbi->common.error, VPX_CODEC_ERROR,
"Incorrect buffer dimensions");
} else {
+ int *ref_fb_ptr = &ref_buf->idx;
+
// Find an empty frame buffer.
const int free_fb = get_free_fb(cm);
- // Decrease fb_idx_ref_cnt since it will be increased again in
+ // Decrease ref_count since it will be increased again in
// ref_cnt_fb() below.
- cm->fb_idx_ref_cnt[free_fb]--;
+ cm->frame_bufs[free_fb].ref_count--;
// Manage the reference counters and copy image.
- ref_cnt_fb(cm->fb_idx_ref_cnt, ref_fb_ptr, free_fb);
- vp8_yv12_copy_frame(sd, &cm->yv12_fb[*ref_fb_ptr]);
+ ref_cnt_fb(cm->frame_bufs, ref_fb_ptr, free_fb);
+ ref_buf->buf = &cm->frame_bufs[*ref_fb_ptr].buf;
+ vp8_yv12_copy_frame(sd, ref_buf->buf);
}
return pbi->common.error.error_code;
}
-int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb) {
- VP9D_COMP *pbi = (VP9D_COMP *) ptr;
+int vp9_get_reference_dec(VP9D_COMP *pbi, int index, YV12_BUFFER_CONFIG **fb) {
VP9_COMMON *cm = &pbi->common;
- if (index < 0 || index >= NUM_REF_FRAMES)
+ if (index < 0 || index >= REF_FRAMES)
return -1;
- *fb = &cm->yv12_fb[cm->ref_frame_map[index]];
+ *fb = &cm->frame_bufs[cm->ref_frame_map[index]].buf;
return 0;
}
@@ -274,34 +288,39 @@ static void swap_frame_buffers(VP9D_COMP *pbi) {
VP9_COMMON *const cm = &pbi->common;
for (mask = pbi->refresh_frame_flags; mask; mask >>= 1) {
- if (mask & 1)
- ref_cnt_fb(cm->fb_idx_ref_cnt, &cm->ref_frame_map[ref_index],
+ if (mask & 1) {
+ const int old_idx = cm->ref_frame_map[ref_index];
+ ref_cnt_fb(cm->frame_bufs, &cm->ref_frame_map[ref_index],
cm->new_fb_idx);
+ if (old_idx >= 0 && cm->frame_bufs[old_idx].ref_count == 0)
+ cm->release_fb_cb(cm->cb_priv,
+ &cm->frame_bufs[old_idx].raw_frame_buffer);
+ }
++ref_index;
}
cm->frame_to_show = get_frame_new_buffer(cm);
- cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
+ cm->frame_bufs[cm->new_fb_idx].ref_count--;
// Invalidate these references until the next frame starts.
for (ref_index = 0; ref_index < 3; ref_index++)
- cm->active_ref_idx[ref_index] = INT_MAX;
+ cm->frame_refs[ref_index].idx = INT_MAX;
}
-int vp9_receive_compressed_data(VP9D_PTR ptr,
+int vp9_receive_compressed_data(VP9D_COMP *pbi,
size_t size, const uint8_t **psource,
int64_t time_stamp) {
- VP9D_COMP *pbi = (VP9D_COMP *) ptr;
- VP9_COMMON *cm = &pbi->common;
+ VP9_COMMON *cm = NULL;
const uint8_t *source = *psource;
int retcode = 0;
/*if(pbi->ready_for_new_data == 0)
return -1;*/
- if (ptr == 0)
+ if (!pbi)
return -1;
+ cm = &pbi->common;
cm->error.error_code = VPX_CODEC_OK;
pbi->source = source;
@@ -317,10 +336,14 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
* at this point, but if it becomes so, [0] may not always be the correct
* thing to do here.
*/
- if (cm->active_ref_idx[0] != INT_MAX)
- get_frame_ref_buffer(cm, 0)->corrupted = 1;
+ if (cm->frame_refs[0].idx != INT_MAX)
+ cm->frame_refs[0].buf->corrupted = 1;
}
+ // Check if the previous frame was a frame without any references to it.
+ if (cm->new_fb_idx >= 0 && cm->frame_bufs[cm->new_fb_idx].ref_count == 0)
+ cm->release_fb_cb(cm->cb_priv,
+ &cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer);
cm->new_fb_idx = get_free_fb(cm);
if (setjmp(cm->error.jmp)) {
@@ -334,11 +357,11 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
* at this point, but if it becomes so, [0] may not always be the correct
* thing to do here.
*/
- if (cm->active_ref_idx[0] != INT_MAX)
- get_frame_ref_buffer(cm, 0)->corrupted = 1;
+ if (cm->frame_refs[0].idx != INT_MAX)
+ cm->frame_refs[0].buf->corrupted = 1;
- if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
- cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
+ if (cm->frame_bufs[cm->new_fb_idx].ref_count > 0)
+ cm->frame_bufs[cm->new_fb_idx].ref_count--;
return -1;
}
@@ -350,8 +373,8 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
if (retcode < 0) {
cm->error.error_code = VPX_CODEC_ERROR;
cm->error.setjmp = 0;
- if (cm->fb_idx_ref_cnt[cm->new_fb_idx] > 0)
- cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
+ if (cm->frame_bufs[cm->new_fb_idx].ref_count > 0)
+ cm->frame_bufs[cm->new_fb_idx].ref_count--;
return retcode;
}
@@ -367,7 +390,13 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
#endif
if (!pbi->do_loopfilter_inline) {
- vp9_loop_filter_frame(cm, &pbi->mb, pbi->common.lf.filter_level, 0, 0);
+ // If multiple threads are used to decode tiles, then we use those threads
+ // to do parallel loopfiltering.
+ if (pbi->num_tile_workers) {
+ vp9_loop_filter_frame_mt(pbi, cm, &pbi->mb, cm->lf.filter_level, 0, 0);
+ } else {
+ vp9_loop_filter_frame(cm, &pbi->mb, cm->lf.filter_level, 0, 0);
+ }
}
#if WRITE_RECON_BUFFER == 2
@@ -379,10 +408,6 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
cm->current_video_frame + 3000);
#endif
- vp9_extend_frame_inner_borders(cm->frame_to_show,
- cm->subsampling_x,
- cm->subsampling_y);
-
#if WRITE_RECON_BUFFER == 1
if (cm->show_frame)
recon_write_yuv_frame("recon.yuv", cm->frame_to_show,
@@ -391,24 +416,14 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
vp9_clear_system_state();
- cm->last_show_frame = cm->show_frame;
+ cm->last_width = cm->width;
+ cm->last_height = cm->height;
+
+ if (!cm->show_existing_frame)
+ cm->last_show_frame = cm->show_frame;
if (cm->show_frame) {
- // current mip will be the prev_mip for the next frame
- MODE_INFO *temp = cm->prev_mip;
- MODE_INFO **temp2 = cm->prev_mi_grid_base;
- cm->prev_mip = cm->mip;
- cm->mip = temp;
- cm->prev_mi_grid_base = cm->mi_grid_base;
- cm->mi_grid_base = temp2;
-
- // update the upper left visible macroblock ptrs
- cm->mi = cm->mip + cm->mode_info_stride + 1;
- cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
- cm->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
- cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
-
- pbi->mb.mi_8x8 = cm->mi_grid_visible;
- pbi->mb.mi_8x8[0] = cm->mi;
+ if (!cm->show_existing_frame)
+ vp9_swap_mi_and_prev_mi(cm);
cm->current_video_frame++;
}
@@ -421,11 +436,10 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
return retcode;
}
-int vp9_get_raw_frame(VP9D_PTR ptr, YV12_BUFFER_CONFIG *sd,
+int vp9_get_raw_frame(VP9D_COMP *pbi, YV12_BUFFER_CONFIG *sd,
int64_t *time_stamp, int64_t *time_end_stamp,
vp9_ppflags_t *flags) {
int ret = -1;
- VP9D_COMP *pbi = (VP9D_COMP *) ptr;
if (pbi->ready_for_new_data == 1)
return ret;
diff --git a/libvpx/vp9/decoder/vp9_decoder.h b/libvpx/vp9/decoder/vp9_decoder.h
new file mode 100644
index 0000000..4cbff45
--- /dev/null
+++ b/libvpx/vp9/decoder/vp9_decoder.h
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_DECODER_VP9_DECODER_H_
+#define VP9_DECODER_VP9_DECODER_H_
+
+#include "./vpx_config.h"
+
+#include "vpx/vpx_codec.h"
+#include "vpx_scale/yv12config.h"
+
+#include "vp9/common/vp9_onyxc_int.h"
+#include "vp9/common/vp9_ppflags.h"
+
+#include "vp9/decoder/vp9_decoder.h"
+#include "vp9/decoder/vp9_dthread.h"
+#include "vp9/decoder/vp9_thread.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ int width;
+ int height;
+ int version;
+ int postprocess;
+ int max_threads;
+ int inv_tile_order;
+ int input_partition;
+} VP9D_CONFIG;
+
+typedef enum {
+ VP9_LAST_FLAG = 1,
+ VP9_GOLD_FLAG = 2,
+ VP9_ALT_FLAG = 4
+} VP9_REFFRAME;
+
+typedef struct VP9Decompressor {
+ DECLARE_ALIGNED(16, MACROBLOCKD, mb);
+
+ DECLARE_ALIGNED(16, VP9_COMMON, common);
+
+ DECLARE_ALIGNED(16, int16_t, dqcoeff[MAX_MB_PLANE][64 * 64]);
+
+ VP9D_CONFIG oxcf;
+
+ const uint8_t *source;
+ size_t source_sz;
+
+ int64_t last_time_stamp;
+ int ready_for_new_data;
+
+ int refresh_frame_flags;
+
+ int decoded_key_frame;
+
+ int initial_width;
+ int initial_height;
+
+ int do_loopfilter_inline; // apply loopfilter to available rows immediately
+ VP9Worker lf_worker;
+
+ VP9Worker *tile_workers;
+ int num_tile_workers;
+
+ VP9LfSync lf_row_sync;
+
+ ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
+ PARTITION_CONTEXT *above_seg_context;
+} VP9D_COMP;
+
+void vp9_initialize_dec();
+
+int vp9_receive_compressed_data(struct VP9Decompressor *pbi,
+ size_t size, const uint8_t **dest,
+ int64_t time_stamp);
+
+int vp9_get_raw_frame(struct VP9Decompressor *pbi,
+ YV12_BUFFER_CONFIG *sd,
+ int64_t *time_stamp, int64_t *time_end_stamp,
+ vp9_ppflags_t *flags);
+
+vpx_codec_err_t vp9_copy_reference_dec(struct VP9Decompressor *pbi,
+ VP9_REFFRAME ref_frame_flag,
+ YV12_BUFFER_CONFIG *sd);
+
+vpx_codec_err_t vp9_set_reference_dec(struct VP9Decompressor *pbi,
+ VP9_REFFRAME ref_frame_flag,
+ YV12_BUFFER_CONFIG *sd);
+
+int vp9_get_reference_dec(struct VP9Decompressor *pbi,
+ int index, YV12_BUFFER_CONFIG **fb);
+
+
+struct VP9Decompressor *vp9_create_decompressor(VP9D_CONFIG *oxcf);
+
+void vp9_remove_decompressor(struct VP9Decompressor *pbi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_DECODER_VP9_DECODER_H_
diff --git a/libvpx/vp9/decoder/vp9_detokenize.c b/libvpx/vp9/decoder/vp9_detokenize.c
index 05a2b42..52e78cd 100644
--- a/libvpx/vp9/decoder/vp9_detokenize.c
+++ b/libvpx/vp9/decoder/vp9_detokenize.c
@@ -13,24 +13,20 @@
#include "vp9/common/vp9_blockd.h"
#include "vp9/common/vp9_common.h"
-#include "vp9/common/vp9_seg_common.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
#include "vp9/decoder/vp9_detokenize.h"
-#include "vp9/decoder/vp9_onyxd_int.h"
-#include "vp9/decoder/vp9_treereader.h"
#define EOB_CONTEXT_NODE 0
#define ZERO_CONTEXT_NODE 1
#define ONE_CONTEXT_NODE 2
-#define LOW_VAL_CONTEXT_NODE 3
-#define TWO_CONTEXT_NODE 4
-#define THREE_CONTEXT_NODE 5
-#define HIGH_LOW_CONTEXT_NODE 6
-#define CAT_ONE_CONTEXT_NODE 7
-#define CAT_THREEFOUR_CONTEXT_NODE 8
-#define CAT_THREE_CONTEXT_NODE 9
-#define CAT_FIVE_CONTEXT_NODE 10
+#define LOW_VAL_CONTEXT_NODE 0
+#define TWO_CONTEXT_NODE 1
+#define THREE_CONTEXT_NODE 2
+#define HIGH_LOW_CONTEXT_NODE 3
+#define CAT_ONE_CONTEXT_NODE 4
+#define CAT_THREEFOUR_CONTEXT_NODE 5
+#define CAT_THREE_CONTEXT_NODE 6
+#define CAT_FIVE_CONTEXT_NODE 7
#define CAT1_MIN_VAL 5
#define CAT2_MIN_VAL 7
@@ -61,26 +57,20 @@ static const vp9_prob cat6_prob[15] = {
254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0
};
-static const int token_to_counttoken[MAX_ENTROPY_TOKENS] = {
- ZERO_TOKEN, ONE_TOKEN, TWO_TOKEN, TWO_TOKEN,
- TWO_TOKEN, TWO_TOKEN, TWO_TOKEN, TWO_TOKEN,
- TWO_TOKEN, TWO_TOKEN, TWO_TOKEN, DCT_EOB_MODEL_TOKEN
-};
-
#define INCREMENT_COUNT(token) \
do { \
if (!cm->frame_parallel_decoding_mode) \
- ++coef_counts[band][pt][token_to_counttoken[token]]; \
+ ++coef_counts[band][ctx][token]; \
} while (0)
-
#define WRITE_COEF_CONTINUE(val, token) \
{ \
- dqcoeff_ptr[scan[c]] = (vp9_read_bit(r) ? -val : val) * \
- dq[c > 0] / (1 + (tx_size == TX_32X32)); \
- INCREMENT_COUNT(token); \
+ v = (val * dqv) >> dq_shift; \
+ dqcoeff[scan[c]] = vp9_read_bit(r) ? -v : v; \
token_cache[scan[c]] = vp9_pt_energy_class[token]; \
++c; \
+ ctx = get_coef_context(nb, token_cache, c); \
+ dqv = dq[1]; \
continue; \
}
@@ -89,69 +79,62 @@ static const int token_to_counttoken[MAX_ENTROPY_TOKENS] = {
val += (vp9_read(r, prob) << bits_count); \
} while (0)
-static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
- vp9_reader *r, int block_idx,
- PLANE_TYPE type, int seg_eob, int16_t *dqcoeff_ptr,
- TX_SIZE tx_size, const int16_t *dq, int pt,
- uint8_t *token_cache) {
+static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd, PLANE_TYPE type,
+ int16_t *dqcoeff, TX_SIZE tx_size, const int16_t *dq,
+ int ctx, const int16_t *scan, const int16_t *nb,
+ vp9_reader *r) {
+ const int max_eob = 16 << (tx_size << 1);
const FRAME_CONTEXT *const fc = &cm->fc;
FRAME_COUNTS *const counts = &cm->counts;
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
int band, c = 0;
- const vp9_prob (*coef_probs)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES] =
+ const vp9_prob (*coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
fc->coef_probs[tx_size][type][ref];
- vp9_prob coef_probs_full[COEF_BANDS][PREV_COEF_CONTEXTS][ENTROPY_NODES];
- uint8_t load_map[COEF_BANDS][PREV_COEF_CONTEXTS] = { { 0 } };
const vp9_prob *prob;
- unsigned int (*coef_counts)[PREV_COEF_CONTEXTS][UNCONSTRAINED_NODES + 1] =
+ unsigned int (*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1] =
counts->coef[tx_size][type][ref];
- unsigned int (*eob_branch_count)[PREV_COEF_CONTEXTS] =
+ unsigned int (*eob_branch_count)[COEFF_CONTEXTS] =
counts->eob_branch[tx_size][type][ref];
- const int16_t *scan, *nb;
+ uint8_t token_cache[32 * 32];
const uint8_t *cat6;
const uint8_t *band_translate = get_band_translate(tx_size);
- get_scan(xd, tx_size, type, block_idx, &scan, &nb);
+ const int dq_shift = (tx_size == TX_32X32);
+ int v;
+ int16_t dqv = dq[0];
- while (c < seg_eob) {
+ while (c < max_eob) {
int val;
- if (c)
- pt = get_coef_context(nb, token_cache, c);
band = *band_translate++;
- prob = coef_probs[band][pt];
+ prob = coef_probs[band][ctx];
if (!cm->frame_parallel_decoding_mode)
- ++eob_branch_count[band][pt];
- if (!vp9_read(r, prob[EOB_CONTEXT_NODE]))
- break;
- goto DECODE_ZERO;
-
- SKIP_START:
- if (c >= seg_eob)
+ ++eob_branch_count[band][ctx];
+ if (!vp9_read(r, prob[EOB_CONTEXT_NODE])) {
+ INCREMENT_COUNT(EOB_MODEL_TOKEN);
break;
- if (c)
- pt = get_coef_context(nb, token_cache, c);
- band = *band_translate++;
- prob = coef_probs[band][pt];
+ }
- DECODE_ZERO:
- if (!vp9_read(r, prob[ZERO_CONTEXT_NODE])) {
+ while (!vp9_read(r, prob[ZERO_CONTEXT_NODE])) {
INCREMENT_COUNT(ZERO_TOKEN);
- token_cache[scan[c]] = vp9_pt_energy_class[ZERO_TOKEN];
+ dqv = dq[1];
+ token_cache[scan[c]] = 0;
++c;
- goto SKIP_START;
+ if (c >= max_eob)
+ return c; // zero tokens at the end (no eob token)
+ ctx = get_coef_context(nb, token_cache, c);
+ band = *band_translate++;
+ prob = coef_probs[band][ctx];
}
// ONE_CONTEXT_NODE_0_
if (!vp9_read(r, prob[ONE_CONTEXT_NODE])) {
+ INCREMENT_COUNT(ONE_TOKEN);
WRITE_COEF_CONTINUE(1, ONE_TOKEN);
}
- // Load full probabilities if not already loaded
- if (!load_map[band][pt]) {
- vp9_model_to_full_probs(coef_probs[band][pt],
- coef_probs_full[band][pt]);
- load_map[band][pt] = 1;
- }
- prob = coef_probs_full[band][pt];
- // LOW_VAL_CONTEXT_NODE_0_
+
+ INCREMENT_COUNT(TWO_TOKEN);
+
+ prob = vp9_pareto8_full[prob[PIVOT_NODE] - 1];
+
if (!vp9_read(r, prob[LOW_VAL_CONTEXT_NODE])) {
if (!vp9_read(r, prob[TWO_CONTEXT_NODE])) {
WRITE_COEF_CONTINUE(2, TWO_TOKEN);
@@ -161,35 +144,35 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
}
WRITE_COEF_CONTINUE(4, FOUR_TOKEN);
}
- // HIGH_LOW_CONTEXT_NODE_0_
+
if (!vp9_read(r, prob[HIGH_LOW_CONTEXT_NODE])) {
if (!vp9_read(r, prob[CAT_ONE_CONTEXT_NODE])) {
val = CAT1_MIN_VAL;
ADJUST_COEF(CAT1_PROB0, 0);
- WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY1);
+ WRITE_COEF_CONTINUE(val, CATEGORY1_TOKEN);
}
val = CAT2_MIN_VAL;
ADJUST_COEF(CAT2_PROB1, 1);
ADJUST_COEF(CAT2_PROB0, 0);
- WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY2);
+ WRITE_COEF_CONTINUE(val, CATEGORY2_TOKEN);
}
- // CAT_THREEFOUR_CONTEXT_NODE_0_
+
if (!vp9_read(r, prob[CAT_THREEFOUR_CONTEXT_NODE])) {
if (!vp9_read(r, prob[CAT_THREE_CONTEXT_NODE])) {
val = CAT3_MIN_VAL;
ADJUST_COEF(CAT3_PROB2, 2);
ADJUST_COEF(CAT3_PROB1, 1);
ADJUST_COEF(CAT3_PROB0, 0);
- WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY3);
+ WRITE_COEF_CONTINUE(val, CATEGORY3_TOKEN);
}
val = CAT4_MIN_VAL;
ADJUST_COEF(CAT4_PROB3, 3);
ADJUST_COEF(CAT4_PROB2, 2);
ADJUST_COEF(CAT4_PROB1, 1);
ADJUST_COEF(CAT4_PROB0, 0);
- WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY4);
+ WRITE_COEF_CONTINUE(val, CATEGORY4_TOKEN);
}
- // CAT_FIVE_CONTEXT_NODE_0_:
+
if (!vp9_read(r, prob[CAT_FIVE_CONTEXT_NODE])) {
val = CAT5_MIN_VAL;
ADJUST_COEF(CAT5_PROB4, 4);
@@ -197,7 +180,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
ADJUST_COEF(CAT5_PROB2, 2);
ADJUST_COEF(CAT5_PROB1, 1);
ADJUST_COEF(CAT5_PROB0, 0);
- WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY5);
+ WRITE_COEF_CONTINUE(val, CATEGORY5_TOKEN);
}
val = 0;
cat6 = cat6_prob;
@@ -205,12 +188,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
val = (val << 1) | vp9_read(r, *cat6++);
val += CAT6_MIN_VAL;
- WRITE_COEF_CONTINUE(val, DCT_VAL_CATEGORY6);
- }
-
- if (c < seg_eob) {
- if (!cm->frame_parallel_decoding_mode)
- ++coef_counts[band][pt][DCT_EOB_MODEL_TOKEN];
+ WRITE_COEF_CONTINUE(val, CATEGORY6_TOKEN);
}
return c;
@@ -218,18 +196,15 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
int plane, int block, BLOCK_SIZE plane_bsize,
- int x, int y, TX_SIZE tx_size, vp9_reader *r,
- uint8_t *token_cache) {
+ int x, int y, TX_SIZE tx_size, vp9_reader *r) {
struct macroblockd_plane *const pd = &xd->plane[plane];
- const int seg_eob = get_tx_eob(&cm->seg, xd->mi_8x8[0]->mbmi.segment_id,
- tx_size);
- const int pt = get_entropy_context(tx_size, pd->above_context + x,
- pd->left_context + y);
- const int eob = decode_coefs(cm, xd, r, block, pd->plane_type, seg_eob,
+ const int ctx = get_entropy_context(tx_size, pd->above_context + x,
+ pd->left_context + y);
+ const scan_order *so = get_scan(xd, tx_size, pd->plane_type, block);
+ const int eob = decode_coefs(cm, xd, pd->plane_type,
BLOCK_OFFSET(pd->dqcoeff, block), tx_size,
- pd->dequant, pt, token_cache);
- set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y);
- pd->eobs[block] = eob;
+ pd->dequant, ctx, so->scan, so->neighbors, r);
+ vp9_set_contexts(xd, pd, plane_bsize, tx_size, eob > 0, x, y);
return eob;
}
diff --git a/libvpx/vp9/decoder/vp9_detokenize.h b/libvpx/vp9/decoder/vp9_detokenize.h
index e858a19..5278e97 100644
--- a/libvpx/vp9/decoder/vp9_detokenize.h
+++ b/libvpx/vp9/decoder/vp9_detokenize.h
@@ -12,12 +12,19 @@
#ifndef VP9_DECODER_VP9_DETOKENIZE_H_
#define VP9_DECODER_VP9_DETOKENIZE_H_
-#include "vp9/decoder/vp9_onyxd_int.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
+#include "vp9/decoder/vp9_decoder.h"
+#include "vp9/decoder/vp9_reader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
int plane, int block, BLOCK_SIZE plane_bsize,
- int x, int y, TX_SIZE tx_size, vp9_reader *r,
- uint8_t *token_cache);
+ int x, int y, TX_SIZE tx_size, vp9_reader *r);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_DECODER_VP9_DETOKENIZE_H_
diff --git a/libvpx/vp9/decoder/vp9_dsubexp.c b/libvpx/vp9/decoder/vp9_dsubexp.c
index fcca017..e67b372 100644
--- a/libvpx/vp9/decoder/vp9_dsubexp.c
+++ b/libvpx/vp9/decoder/vp9_dsubexp.c
@@ -19,14 +19,10 @@ static int inv_recenter_nonneg(int v, int m) {
return v % 2 ? m - (v + 1) / 2 : m + v / 2;
}
-static int decode_uniform(vp9_reader *r, int n) {
- int v;
- const int l = get_unsigned_bits(n);
- const int m = (1 << l) - n;
- if (!l)
- return 0;
-
- v = vp9_read_literal(r, l - 1);
+static int decode_uniform(vp9_reader *r) {
+ const int l = 8;
+ const int m = (1 << l) - 191;
+ const int v = vp9_read_literal(r, l - 1);
return v < m ? v : (v << 1) - m + vp9_read_bit(r);
}
@@ -78,30 +74,19 @@ static int inv_remap_prob(int v, int m) {
}
}
-static int decode_term_subexp(vp9_reader *r, int k, int num_syms) {
- int i = 0, mk = 0, word;
- while (1) {
- const int b = i ? k + i - 1 : k;
- const int a = 1 << b;
- if (num_syms <= mk + 3 * a) {
- word = decode_uniform(r, num_syms - mk) + mk;
- break;
- } else {
- if (vp9_read_bit(r)) {
- i++;
- mk += a;
- } else {
- word = vp9_read_literal(r, b) + mk;
- break;
- }
- }
- }
- return word;
+static int decode_term_subexp(vp9_reader *r) {
+ if (!vp9_read_bit(r))
+ return vp9_read_literal(r, 4);
+ if (!vp9_read_bit(r))
+ return vp9_read_literal(r, 4) + 16;
+ if (!vp9_read_bit(r))
+ return vp9_read_literal(r, 5) + 32;
+ return decode_uniform(r) + 64;
}
void vp9_diff_update_prob(vp9_reader *r, vp9_prob* p) {
if (vp9_read(r, DIFF_UPDATE_PROB)) {
- const int delp = decode_term_subexp(r, SUBEXP_PARAM, 255);
+ const int delp = decode_term_subexp(r);
*p = (vp9_prob)inv_remap_prob(delp, *p);
}
}
diff --git a/libvpx/vp9/decoder/vp9_dsubexp.h b/libvpx/vp9/decoder/vp9_dsubexp.h
index aeb9399..436f434 100644
--- a/libvpx/vp9/decoder/vp9_dsubexp.h
+++ b/libvpx/vp9/decoder/vp9_dsubexp.h
@@ -12,8 +12,16 @@
#ifndef VP9_DECODER_VP9_DSUBEXP_H_
#define VP9_DECODER_VP9_DSUBEXP_H_
-#include "vp9/decoder/vp9_dboolhuff.h"
+#include "vp9/decoder/vp9_reader.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
void vp9_diff_update_prob(vp9_reader *r, vp9_prob* p);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_DECODER_VP9_DSUBEXP_H_
diff --git a/libvpx/vp9/decoder/vp9_dthread.c b/libvpx/vp9/decoder/vp9_dthread.c
new file mode 100644
index 0000000..4df8509
--- /dev/null
+++ b/libvpx/vp9/decoder/vp9_dthread.c
@@ -0,0 +1,275 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "./vpx_config.h"
+
+#include "vpx_mem/vpx_mem.h"
+
+#include "vp9/common/vp9_reconinter.h"
+
+#include "vp9/decoder/vp9_dthread.h"
+#include "vp9/decoder/vp9_decoder.h"
+
+#if CONFIG_MULTITHREAD
+static INLINE void mutex_lock(pthread_mutex_t *const mutex) {
+ const int kMaxTryLocks = 4000;
+ int locked = 0;
+ int i;
+
+ for (i = 0; i < kMaxTryLocks; ++i) {
+ if (!pthread_mutex_trylock(mutex)) {
+ locked = 1;
+ break;
+ }
+ }
+
+ if (!locked)
+ pthread_mutex_lock(mutex);
+}
+#endif // CONFIG_MULTITHREAD
+
+static INLINE void sync_read(VP9LfSync *const lf_sync, int r, int c) {
+#if CONFIG_MULTITHREAD
+ const int nsync = lf_sync->sync_range;
+
+ if (r && !(c & (nsync - 1))) {
+ mutex_lock(&lf_sync->mutex_[r - 1]);
+
+ while (c > lf_sync->cur_sb_col[r - 1] - nsync) {
+ pthread_cond_wait(&lf_sync->cond_[r - 1],
+ &lf_sync->mutex_[r - 1]);
+ }
+ pthread_mutex_unlock(&lf_sync->mutex_[r - 1]);
+ }
+#else
+ (void)lf_sync;
+ (void)r;
+ (void)c;
+#endif // CONFIG_MULTITHREAD
+}
+
+static INLINE void sync_write(VP9LfSync *const lf_sync, int r, int c,
+ const int sb_cols) {
+#if CONFIG_MULTITHREAD
+ const int nsync = lf_sync->sync_range;
+ int cur;
+ // Only signal when there are enough filtered SB for next row to run.
+ int sig = 1;
+
+ if (c < sb_cols - 1) {
+ cur = c;
+ if (c % nsync)
+ sig = 0;
+ } else {
+ cur = sb_cols + nsync;
+ }
+
+ if (sig) {
+ mutex_lock(&lf_sync->mutex_[r]);
+
+ lf_sync->cur_sb_col[r] = cur;
+
+ pthread_cond_signal(&lf_sync->cond_[r]);
+ pthread_mutex_unlock(&lf_sync->mutex_[r]);
+ }
+#else
+ (void)lf_sync;
+ (void)r;
+ (void)c;
+ (void)sb_cols;
+#endif // CONFIG_MULTITHREAD
+}
+
+// Implement row loopfiltering for each thread.
+static void loop_filter_rows_mt(const YV12_BUFFER_CONFIG *const frame_buffer,
+ VP9_COMMON *const cm, MACROBLOCKD *const xd,
+ int start, int stop, int y_only,
+ VP9LfSync *const lf_sync, int num_lf_workers) {
+ const int num_planes = y_only ? 1 : MAX_MB_PLANE;
+ int r, c; // SB row and col
+ LOOP_FILTER_MASK lfm;
+ const int sb_cols = mi_cols_aligned_to_sb(cm->mi_cols) >> MI_BLOCK_SIZE_LOG2;
+
+ for (r = start; r < stop; r += num_lf_workers) {
+ const int mi_row = r << MI_BLOCK_SIZE_LOG2;
+ MODE_INFO **mi_8x8 = cm->mi_grid_visible + mi_row * cm->mode_info_stride;
+
+ for (c = 0; c < sb_cols; ++c) {
+ const int mi_col = c << MI_BLOCK_SIZE_LOG2;
+ int plane;
+
+ sync_read(lf_sync, r, c);
+
+ vp9_setup_dst_planes(xd, frame_buffer, mi_row, mi_col);
+ vp9_setup_mask(cm, mi_row, mi_col, mi_8x8 + mi_col, cm->mode_info_stride,
+ &lfm);
+
+ for (plane = 0; plane < num_planes; ++plane) {
+ vp9_filter_block_plane(cm, &xd->plane[plane], mi_row, &lfm);
+ }
+
+ sync_write(lf_sync, r, c, sb_cols);
+ }
+ }
+}
+
+// Row-based multi-threaded loopfilter hook
+static int loop_filter_row_worker(void *arg1, void *arg2) {
+ TileWorkerData *const tile_data = (TileWorkerData*)arg1;
+ LFWorkerData *const lf_data = &tile_data->lfdata;
+
+ loop_filter_rows_mt(lf_data->frame_buffer, lf_data->cm, &lf_data->xd,
+ lf_data->start, lf_data->stop, lf_data->y_only,
+ lf_data->lf_sync, lf_data->num_lf_workers);
+ return 1;
+}
+
+// VP9 decoder: Implement multi-threaded loopfilter that uses the tile
+// threads.
+void vp9_loop_filter_frame_mt(VP9D_COMP *pbi,
+ VP9_COMMON *cm,
+ MACROBLOCKD *xd,
+ int frame_filter_level,
+ int y_only, int partial_frame) {
+ // Number of superblock rows and cols
+ const int sb_rows = mi_cols_aligned_to_sb(cm->mi_rows) >> MI_BLOCK_SIZE_LOG2;
+ int i;
+
+ // Allocate memory used in thread synchronization.
+ // This always needs to be done even if frame_filter_level is 0.
+ if (!cm->current_video_frame || cm->last_height != cm->height) {
+ VP9LfSync *const lf_sync = &pbi->lf_row_sync;
+
+ if (cm->last_height != cm->height) {
+ const int aligned_last_height =
+ ALIGN_POWER_OF_TWO(cm->last_height, MI_SIZE_LOG2);
+ const int last_sb_rows =
+ mi_cols_aligned_to_sb(aligned_last_height >> MI_SIZE_LOG2) >>
+ MI_BLOCK_SIZE_LOG2;
+
+ vp9_loop_filter_dealloc(lf_sync, last_sb_rows);
+ }
+
+ vp9_loop_filter_alloc(cm, lf_sync, sb_rows, cm->width);
+ }
+
+ if (!frame_filter_level) return;
+
+ vp9_loop_filter_frame_init(cm, frame_filter_level);
+
+ // Initialize cur_sb_col to -1 for all SB rows.
+ vpx_memset(pbi->lf_row_sync.cur_sb_col, -1,
+ sizeof(*pbi->lf_row_sync.cur_sb_col) * sb_rows);
+
+ // Set up loopfilter thread data.
+ for (i = 0; i < pbi->num_tile_workers; ++i) {
+ VP9Worker *const worker = &pbi->tile_workers[i];
+ TileWorkerData *const tile_data = (TileWorkerData*)worker->data1;
+ LFWorkerData *const lf_data = &tile_data->lfdata;
+
+ worker->hook = (VP9WorkerHook)loop_filter_row_worker;
+
+ // Loopfilter data
+ lf_data->frame_buffer = get_frame_new_buffer(cm);
+ lf_data->cm = cm;
+ lf_data->xd = pbi->mb;
+ lf_data->start = i;
+ lf_data->stop = sb_rows;
+ lf_data->y_only = y_only; // always do all planes in decoder
+
+ lf_data->lf_sync = &pbi->lf_row_sync;
+ lf_data->num_lf_workers = pbi->num_tile_workers;
+
+ // Start loopfiltering
+ if (i == pbi->num_tile_workers - 1) {
+ vp9_worker_execute(worker);
+ } else {
+ vp9_worker_launch(worker);
+ }
+ }
+
+ // Wait till all rows are finished
+ for (i = 0; i < pbi->num_tile_workers; ++i) {
+ vp9_worker_sync(&pbi->tile_workers[i]);
+ }
+}
+
+// Set up nsync by width.
+static int get_sync_range(int width) {
+ // nsync numbers are picked by testing. For example, for 4k
+ // video, using 4 gives best performance.
+ if (width < 640)
+ return 1;
+ else if (width <= 1280)
+ return 2;
+ else if (width <= 4096)
+ return 4;
+ else
+ return 8;
+}
+
+// Allocate memory for lf row synchronization
+void vp9_loop_filter_alloc(VP9_COMMON *cm, VP9LfSync *lf_sync, int rows,
+ int width) {
+#if CONFIG_MULTITHREAD
+ int i;
+
+ CHECK_MEM_ERROR(cm, lf_sync->mutex_,
+ vpx_malloc(sizeof(*lf_sync->mutex_) * rows));
+ for (i = 0; i < rows; ++i) {
+ pthread_mutex_init(&lf_sync->mutex_[i], NULL);
+ }
+
+ CHECK_MEM_ERROR(cm, lf_sync->cond_,
+ vpx_malloc(sizeof(*lf_sync->cond_) * rows));
+ for (i = 0; i < rows; ++i) {
+ pthread_cond_init(&lf_sync->cond_[i], NULL);
+ }
+#endif // CONFIG_MULTITHREAD
+
+ CHECK_MEM_ERROR(cm, lf_sync->cur_sb_col,
+ vpx_malloc(sizeof(*lf_sync->cur_sb_col) * rows));
+
+ // Set up nsync.
+ lf_sync->sync_range = get_sync_range(width);
+}
+
+// Deallocate lf synchronization related mutex and data
+void vp9_loop_filter_dealloc(VP9LfSync *lf_sync, int rows) {
+#if CONFIG_MULTITHREAD
+ if (lf_sync != NULL) {
+ int i;
+
+ if (lf_sync->mutex_ != NULL) {
+ for (i = 0; i < rows; ++i) {
+ pthread_mutex_destroy(&lf_sync->mutex_[i]);
+ }
+ vpx_free(lf_sync->mutex_);
+ }
+ if (lf_sync->cond_ != NULL) {
+ for (i = 0; i < rows; ++i) {
+ pthread_cond_destroy(&lf_sync->cond_[i]);
+ }
+ vpx_free(lf_sync->cond_);
+ }
+
+ vpx_free(lf_sync->cur_sb_col);
+ // clear the structure as the source of this call may be a resize in which
+ // case this call will be followed by an _alloc() which may fail.
+ vpx_memset(lf_sync, 0, sizeof(*lf_sync));
+ }
+#else
+ (void)rows;
+ if (lf_sync != NULL) {
+ vpx_free(lf_sync->cur_sb_col);
+ vpx_memset(lf_sync, 0, sizeof(*lf_sync));
+ }
+#endif // CONFIG_MULTITHREAD
+}
diff --git a/libvpx/vp9/decoder/vp9_dthread.h b/libvpx/vp9/decoder/vp9_dthread.h
new file mode 100644
index 0000000..6d4450f
--- /dev/null
+++ b/libvpx/vp9/decoder/vp9_dthread.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_DECODER_VP9_DTHREAD_H_
+#define VP9_DECODER_VP9_DTHREAD_H_
+
+#include "./vpx_config.h"
+#include "vp9/common/vp9_loopfilter.h"
+#include "vp9/decoder/vp9_reader.h"
+#include "vp9/decoder/vp9_thread.h"
+
+struct macroblockd;
+struct VP9Common;
+struct VP9Decompressor;
+
+typedef struct TileWorkerData {
+ struct VP9Common *cm;
+ vp9_reader bit_reader;
+ DECLARE_ALIGNED(16, struct macroblockd, xd);
+ DECLARE_ALIGNED(16, int16_t, dqcoeff[MAX_MB_PLANE][64 * 64]);
+
+ // Row-based parallel loopfilter data
+ LFWorkerData lfdata;
+} TileWorkerData;
+
+// Loopfilter row synchronization
+typedef struct VP9LfSyncData {
+#if CONFIG_MULTITHREAD
+ pthread_mutex_t *mutex_;
+ pthread_cond_t *cond_;
+#endif
+ // Allocate memory to store the loop-filtered superblock index in each row.
+ int *cur_sb_col;
+ // The optimal sync_range for different resolution and platform should be
+ // determined by testing. Currently, it is chosen to be a power-of-2 number.
+ int sync_range;
+} VP9LfSync;
+
+// Allocate memory for loopfilter row synchronization.
+void vp9_loop_filter_alloc(struct VP9Common *cm, struct VP9LfSyncData *lf_sync,
+ int rows, int width);
+
+// Deallocate loopfilter synchronization related mutex and data.
+void vp9_loop_filter_dealloc(struct VP9LfSyncData *lf_sync, int rows);
+
+// Multi-threaded loopfilter that uses the tile threads.
+void vp9_loop_filter_frame_mt(struct VP9Decompressor *pbi,
+ struct VP9Common *cm,
+ struct macroblockd *xd,
+ int frame_filter_level,
+ int y_only, int partial_frame);
+
+#endif // VP9_DECODER_VP9_DTHREAD_H_
diff --git a/libvpx/vp9/decoder/vp9_onyxd.h b/libvpx/vp9/decoder/vp9_onyxd.h
deleted file mode 100644
index a4b9c24..0000000
--- a/libvpx/vp9/decoder/vp9_onyxd.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_DECODER_VP9_ONYXD_H_
-#define VP9_DECODER_VP9_ONYXD_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include "vpx_scale/yv12config.h"
-#include "vp9/common/vp9_ppflags.h"
-#include "vpx/vpx_codec.h"
-
-typedef void *VP9D_PTR;
-
-typedef struct {
- int width;
- int height;
- int version;
- int postprocess;
- int max_threads;
- int inv_tile_order;
- int input_partition;
-} VP9D_CONFIG;
-
-typedef enum {
- VP9_LAST_FLAG = 1,
- VP9_GOLD_FLAG = 2,
- VP9_ALT_FLAG = 4
-} VP9_REFFRAME;
-
-void vp9_initialize_dec();
-
-int vp9_receive_compressed_data(VP9D_PTR comp,
- size_t size, const uint8_t **dest,
- int64_t time_stamp);
-
-int vp9_get_raw_frame(VP9D_PTR comp, YV12_BUFFER_CONFIG *sd,
- int64_t *time_stamp, int64_t *time_end_stamp,
- vp9_ppflags_t *flags);
-
-vpx_codec_err_t vp9_copy_reference_dec(VP9D_PTR comp,
- VP9_REFFRAME ref_frame_flag,
- YV12_BUFFER_CONFIG *sd);
-
-vpx_codec_err_t vp9_set_reference_dec(VP9D_PTR comp,
- VP9_REFFRAME ref_frame_flag,
- YV12_BUFFER_CONFIG *sd);
-
-int vp9_get_reference_dec(VP9D_PTR ptr, int index, YV12_BUFFER_CONFIG **fb);
-
-
-VP9D_PTR vp9_create_decompressor(VP9D_CONFIG *oxcf);
-
-void vp9_remove_decompressor(VP9D_PTR comp);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // VP9_DECODER_VP9_ONYXD_H_
diff --git a/libvpx/vp9/decoder/vp9_onyxd_int.h b/libvpx/vp9/decoder/vp9_onyxd_int.h
deleted file mode 100644
index d3d29e9..0000000
--- a/libvpx/vp9/decoder/vp9_onyxd_int.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_DECODER_VP9_ONYXD_INT_H_
-#define VP9_DECODER_VP9_ONYXD_INT_H_
-
-#include "./vpx_config.h"
-
-#include "vp9/common/vp9_onyxc_int.h"
-#include "vp9/decoder/vp9_onyxd.h"
-#include "vp9/decoder/vp9_thread.h"
-
-typedef struct VP9Decompressor {
- DECLARE_ALIGNED(16, MACROBLOCKD, mb);
-
- DECLARE_ALIGNED(16, VP9_COMMON, common);
-
- DECLARE_ALIGNED(16, int16_t, qcoeff[MAX_MB_PLANE][64 * 64]);
- DECLARE_ALIGNED(16, int16_t, dqcoeff[MAX_MB_PLANE][64 * 64]);
- DECLARE_ALIGNED(16, uint16_t, eobs[MAX_MB_PLANE][256]);
-
- VP9D_CONFIG oxcf;
-
- const uint8_t *source;
- size_t source_sz;
-
- int64_t last_time_stamp;
- int ready_for_new_data;
-
- int refresh_frame_flags;
-
- int decoded_key_frame;
-
- int initial_width;
- int initial_height;
-
- int do_loopfilter_inline; // apply loopfilter to available rows immediately
- VP9Worker lf_worker;
-
- VP9Worker *tile_workers;
- int num_tile_workers;
-
- /* Each tile column has its own MODE_INFO stream. This array indexes them by
- tile column index. */
- MODE_INFO **mi_streams;
-
- ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
- PARTITION_CONTEXT *above_seg_context;
-
- DECLARE_ALIGNED(16, uint8_t, token_cache[1024]);
-} VP9D_COMP;
-
-#endif // VP9_DECODER_VP9_ONYXD_INT_H_
diff --git a/libvpx/vp9/decoder/vp9_read_bit_buffer.c b/libvpx/vp9/decoder/vp9_read_bit_buffer.c
new file mode 100644
index 0000000..778a635
--- /dev/null
+++ b/libvpx/vp9/decoder/vp9_read_bit_buffer.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#include "vp9/decoder/vp9_read_bit_buffer.h"
+
+size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb) {
+ return rb->bit_offset / CHAR_BIT + (rb->bit_offset % CHAR_BIT > 0);
+}
+
+int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb) {
+ const size_t off = rb->bit_offset;
+ const size_t p = off / CHAR_BIT;
+ const int q = CHAR_BIT - 1 - (int)off % CHAR_BIT;
+ if (rb->bit_buffer + p >= rb->bit_buffer_end) {
+ rb->error_handler(rb->error_handler_data);
+ return 0;
+ } else {
+ const int bit = (rb->bit_buffer[p] & (1 << q)) >> q;
+ rb->bit_offset = off + 1;
+ return bit;
+ }
+}
+
+int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits) {
+ int value = 0, bit;
+ for (bit = bits - 1; bit >= 0; bit--)
+ value |= vp9_rb_read_bit(rb) << bit;
+ return value;
+}
+
+int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb,
+ int bits) {
+ const int value = vp9_rb_read_literal(rb, bits);
+ return vp9_rb_read_bit(rb) ? -value : value;
+}
diff --git a/libvpx/vp9/decoder/vp9_read_bit_buffer.h b/libvpx/vp9/decoder/vp9_read_bit_buffer.h
index 41a6868..fc88bd7 100644
--- a/libvpx/vp9/decoder/vp9_read_bit_buffer.h
+++ b/libvpx/vp9/decoder/vp9_read_bit_buffer.h
@@ -15,7 +15,11 @@
#include "vpx/vpx_integer.h"
-typedef void (*vp9_rb_error_handler)(void *data, size_t bit_offset);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void (*vp9_rb_error_handler)(void *data);
struct vp9_read_bit_buffer {
const uint8_t *bit_buffer;
@@ -26,35 +30,16 @@ struct vp9_read_bit_buffer {
vp9_rb_error_handler error_handler;
};
-static size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb) {
- return rb->bit_offset / CHAR_BIT + (rb->bit_offset % CHAR_BIT > 0);
-}
-
-static int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb) {
- const size_t off = rb->bit_offset;
- const size_t p = off / CHAR_BIT;
- const int q = CHAR_BIT - 1 - (int)off % CHAR_BIT;
- if (rb->bit_buffer + p >= rb->bit_buffer_end) {
- rb->error_handler(rb->error_handler_data, rb->bit_offset);
- return 0;
- } else {
- const int bit = (rb->bit_buffer[p] & (1 << q)) >> q;
- rb->bit_offset = off + 1;
- return bit;
- }
-}
-
-static int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits) {
- int value = 0, bit;
- for (bit = bits - 1; bit >= 0; bit--)
- value |= vp9_rb_read_bit(rb) << bit;
- return value;
-}
-
-static int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb,
- int bits) {
- const int value = vp9_rb_read_literal(rb, bits);
- return vp9_rb_read_bit(rb) ? -value : value;
-}
+size_t vp9_rb_bytes_read(struct vp9_read_bit_buffer *rb);
+
+int vp9_rb_read_bit(struct vp9_read_bit_buffer *rb);
+
+int vp9_rb_read_literal(struct vp9_read_bit_buffer *rb, int bits);
+
+int vp9_rb_read_signed_literal(struct vp9_read_bit_buffer *rb, int bits);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_DECODER_VP9_READ_BIT_BUFFER_H_
diff --git a/libvpx/vp9/decoder/vp9_dboolhuff.c b/libvpx/vp9/decoder/vp9_reader.c
index 06acec4..fb44c88 100644
--- a/libvpx/vp9/decoder/vp9_dboolhuff.c
+++ b/libvpx/vp9/decoder/vp9_reader.c
@@ -11,39 +11,35 @@
#include "vpx_ports/mem.h"
#include "vpx_mem/vpx_mem.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
+#include "vp9/decoder/vp9_reader.h"
// This is meant to be a large, positive constant that can still be efficiently
// loaded as an immediate (on platforms like ARM, for example).
// Even relatively modest values like 100 would work fine.
#define LOTS_OF_BITS 0x40000000
-
int vp9_reader_init(vp9_reader *r, const uint8_t *buffer, size_t size) {
- int marker_bit;
-
- r->buffer_end = buffer + size;
- r->buffer = buffer;
- r->value = 0;
- r->count = -8;
- r->range = 255;
-
- if (size && !buffer)
+ if (size && !buffer) {
return 1;
-
- vp9_reader_fill(r);
- marker_bit = vp9_read_bit(r);
- return marker_bit != 0;
+ } else {
+ r->buffer_end = buffer + size;
+ r->buffer = buffer;
+ r->value = 0;
+ r->count = -8;
+ r->range = 255;
+ vp9_reader_fill(r);
+ return vp9_read_bit(r) != 0; // marker bit
+ }
}
void vp9_reader_fill(vp9_reader *r) {
const uint8_t *const buffer_end = r->buffer_end;
const uint8_t *buffer = r->buffer;
- VP9_BD_VALUE value = r->value;
+ BD_VALUE value = r->value;
int count = r->count;
- int shift = BD_VALUE_SIZE - 8 - (count + 8);
+ int shift = BD_VALUE_SIZE - CHAR_BIT - (count + CHAR_BIT);
int loop_end = 0;
- const int bits_left = (int)((buffer_end - buffer)*CHAR_BIT);
+ const int bits_left = (int)((buffer_end - buffer) * CHAR_BIT);
const int x = shift + CHAR_BIT - bits_left;
if (x >= 0) {
@@ -54,7 +50,7 @@ void vp9_reader_fill(vp9_reader *r) {
if (x < 0 || bits_left) {
while (shift >= loop_end) {
count += CHAR_BIT;
- value |= (VP9_BD_VALUE)*buffer++ << shift;
+ value |= (BD_VALUE)*buffer++ << shift;
shift -= CHAR_BIT;
}
}
diff --git a/libvpx/vp9/decoder/vp9_dboolhuff.h b/libvpx/vp9/decoder/vp9_reader.h
index fd8e74c..8fe6acb 100644
--- a/libvpx/vp9/decoder/vp9_dboolhuff.h
+++ b/libvpx/vp9/decoder/vp9_reader.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VP9_DECODER_VP9_DBOOLHUFF_H_
-#define VP9_DECODER_VP9_DBOOLHUFF_H_
+#ifndef VP9_DECODER_VP9_READER_H_
+#define VP9_DECODER_VP9_READER_H_
#include <stddef.h>
#include <limits.h>
@@ -18,46 +18,52 @@
#include "vpx_ports/mem.h"
#include "vpx/vpx_integer.h"
-typedef size_t VP9_BD_VALUE;
+#include "vp9/common/vp9_prob.h"
-#define BD_VALUE_SIZE ((int)sizeof(VP9_BD_VALUE)*CHAR_BIT)
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef size_t BD_VALUE;
+
+#define BD_VALUE_SIZE ((int)sizeof(BD_VALUE) * CHAR_BIT)
typedef struct {
const uint8_t *buffer_end;
const uint8_t *buffer;
- VP9_BD_VALUE value;
+ BD_VALUE value;
int count;
unsigned int range;
} vp9_reader;
-DECLARE_ALIGNED(16, extern const uint8_t, vp9_norm[256]);
-
int vp9_reader_init(vp9_reader *r, const uint8_t *buffer, size_t size);
void vp9_reader_fill(vp9_reader *r);
+int vp9_reader_has_error(vp9_reader *r);
+
const uint8_t *vp9_reader_find_end(vp9_reader *r);
-static int vp9_read(vp9_reader *br, int probability) {
+static int vp9_read(vp9_reader *r, int prob) {
unsigned int bit = 0;
- VP9_BD_VALUE value;
- VP9_BD_VALUE bigsplit;
+ BD_VALUE value;
+ BD_VALUE bigsplit;
int count;
unsigned int range;
- unsigned int split = ((br->range * probability) + (256 - probability)) >> 8;
+ unsigned int split = (r->range * prob + (256 - prob)) >> CHAR_BIT;
- if (br->count < 0)
- vp9_reader_fill(br);
+ if (r->count < 0)
+ vp9_reader_fill(r);
- value = br->value;
- count = br->count;
+ value = r->value;
+ count = r->count;
- bigsplit = (VP9_BD_VALUE)split << (BD_VALUE_SIZE - 8);
+ bigsplit = (BD_VALUE)split << (BD_VALUE_SIZE - CHAR_BIT);
range = split;
if (value >= bigsplit) {
- range = br->range - split;
+ range = r->range - split;
value = value - bigsplit;
bit = 1;
}
@@ -68,9 +74,9 @@ static int vp9_read(vp9_reader *br, int probability) {
value <<= shift;
count -= shift;
}
- br->value = value;
- br->count = count;
- br->range = range;
+ r->value = value;
+ r->count = count;
+ r->range = range;
return bit;
}
@@ -79,15 +85,27 @@ static int vp9_read_bit(vp9_reader *r) {
return vp9_read(r, 128); // vp9_prob_half
}
-static int vp9_read_literal(vp9_reader *br, int bits) {
- int z = 0, bit;
+static int vp9_read_literal(vp9_reader *r, int bits) {
+ int literal = 0, bit;
for (bit = bits - 1; bit >= 0; bit--)
- z |= vp9_read_bit(br) << bit;
+ literal |= vp9_read_bit(r) << bit;
- return z;
+ return literal;
}
-int vp9_reader_has_error(vp9_reader *r);
+static int vp9_read_tree(vp9_reader *r, const vp9_tree_index *tree,
+ const vp9_prob *probs) {
+ vp9_tree_index i = 0;
+
+ while ((i = tree[i + vp9_read(r, probs[i >> 1])]) > 0)
+ continue;
+
+ return -i;
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
-#endif // VP9_DECODER_VP9_DBOOLHUFF_H_
+#endif // VP9_DECODER_VP9_READER_H_
diff --git a/libvpx/vp9/decoder/vp9_thread.c b/libvpx/vp9/decoder/vp9_thread.c
index d953e72..5d31d3d 100644
--- a/libvpx/vp9/decoder/vp9_thread.c
+++ b/libvpx/vp9/decoder/vp9_thread.c
@@ -24,116 +24,6 @@ extern "C" {
#if CONFIG_MULTITHREAD
-#if defined(_WIN32)
-
-//------------------------------------------------------------------------------
-// simplistic pthread emulation layer
-
-#include <process.h> // NOLINT
-
-// _beginthreadex requires __stdcall
-#define THREADFN unsigned int __stdcall
-#define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
-
-static int pthread_create(pthread_t* const thread, const void* attr,
- unsigned int (__stdcall *start)(void*), void* arg) {
- (void)attr;
- *thread = (pthread_t)_beginthreadex(NULL, /* void *security */
- 0, /* unsigned stack_size */
- start,
- arg,
- 0, /* unsigned initflag */
- NULL); /* unsigned *thrdaddr */
- if (*thread == NULL) return 1;
- SetThreadPriority(*thread, THREAD_PRIORITY_ABOVE_NORMAL);
- return 0;
-}
-
-static int pthread_join(pthread_t thread, void** value_ptr) {
- (void)value_ptr;
- return (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0 ||
- CloseHandle(thread) == 0);
-}
-
-// Mutex
-static int pthread_mutex_init(pthread_mutex_t* const mutex, void* mutexattr) {
- (void)mutexattr;
- InitializeCriticalSection(mutex);
- return 0;
-}
-
-static int pthread_mutex_lock(pthread_mutex_t* const mutex) {
- EnterCriticalSection(mutex);
- return 0;
-}
-
-static int pthread_mutex_unlock(pthread_mutex_t* const mutex) {
- LeaveCriticalSection(mutex);
- return 0;
-}
-
-static int pthread_mutex_destroy(pthread_mutex_t* const mutex) {
- DeleteCriticalSection(mutex);
- return 0;
-}
-
-// Condition
-static int pthread_cond_destroy(pthread_cond_t* const condition) {
- int ok = 1;
- ok &= (CloseHandle(condition->waiting_sem_) != 0);
- ok &= (CloseHandle(condition->received_sem_) != 0);
- ok &= (CloseHandle(condition->signal_event_) != 0);
- return !ok;
-}
-
-static int pthread_cond_init(pthread_cond_t* const condition, void* cond_attr) {
- (void)cond_attr;
- condition->waiting_sem_ = CreateSemaphore(NULL, 0, 1, NULL);
- condition->received_sem_ = CreateSemaphore(NULL, 0, 1, NULL);
- condition->signal_event_ = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (condition->waiting_sem_ == NULL ||
- condition->received_sem_ == NULL ||
- condition->signal_event_ == NULL) {
- pthread_cond_destroy(condition);
- return 1;
- }
- return 0;
-}
-
-static int pthread_cond_signal(pthread_cond_t* const condition) {
- int ok = 1;
- if (WaitForSingleObject(condition->waiting_sem_, 0) == WAIT_OBJECT_0) {
- // a thread is waiting in pthread_cond_wait: allow it to be notified
- ok = SetEvent(condition->signal_event_);
- // wait until the event is consumed so the signaler cannot consume
- // the event via its own pthread_cond_wait.
- ok &= (WaitForSingleObject(condition->received_sem_, INFINITE) !=
- WAIT_OBJECT_0);
- }
- return !ok;
-}
-
-static int pthread_cond_wait(pthread_cond_t* const condition,
- pthread_mutex_t* const mutex) {
- int ok;
- // note that there is a consumer available so the signal isn't dropped in
- // pthread_cond_signal
- if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL))
- return 1;
- // now unlock the mutex so pthread_cond_signal may be issued
- pthread_mutex_unlock(mutex);
- ok = (WaitForSingleObject(condition->signal_event_, INFINITE) ==
- WAIT_OBJECT_0);
- ok &= ReleaseSemaphore(condition->received_sem_, 1, NULL);
- pthread_mutex_lock(mutex);
- return !ok;
-}
-
-#else // _WIN32
-# define THREADFN void*
-# define THREAD_RETURN(val) val
-#endif
-
//------------------------------------------------------------------------------
static THREADFN thread_loop(void *ptr) { // thread loop
diff --git a/libvpx/vp9/decoder/vp9_thread.h b/libvpx/vp9/decoder/vp9_thread.h
index a624f3c..2f8728d 100644
--- a/libvpx/vp9/decoder/vp9_thread.h
+++ b/libvpx/vp9/decoder/vp9_thread.h
@@ -19,14 +19,15 @@
#include "./vpx_config.h"
-#if defined(__cplusplus) || defined(c_plusplus)
+#ifdef __cplusplus
extern "C" {
#endif
#if CONFIG_MULTITHREAD
#if defined(_WIN32)
-
+#include <errno.h> // NOLINT
+#include <process.h> // NOLINT
#include <windows.h> // NOLINT
typedef HANDLE pthread_t;
typedef CRITICAL_SECTION pthread_mutex_t;
@@ -36,12 +37,120 @@ typedef struct {
HANDLE signal_event_;
} pthread_cond_t;
-#else
-
+//------------------------------------------------------------------------------
+// simplistic pthread emulation layer
+
+// _beginthreadex requires __stdcall
+#define THREADFN unsigned int __stdcall
+#define THREAD_RETURN(val) (unsigned int)((DWORD_PTR)val)
+
+static INLINE int pthread_create(pthread_t* const thread, const void* attr,
+ unsigned int (__stdcall *start)(void*),
+ void* arg) {
+ (void)attr;
+ *thread = (pthread_t)_beginthreadex(NULL, /* void *security */
+ 0, /* unsigned stack_size */
+ start,
+ arg,
+ 0, /* unsigned initflag */
+ NULL); /* unsigned *thrdaddr */
+ if (*thread == NULL) return 1;
+ SetThreadPriority(*thread, THREAD_PRIORITY_ABOVE_NORMAL);
+ return 0;
+}
+
+static INLINE int pthread_join(pthread_t thread, void** value_ptr) {
+ (void)value_ptr;
+ return (WaitForSingleObject(thread, INFINITE) != WAIT_OBJECT_0 ||
+ CloseHandle(thread) == 0);
+}
+
+// Mutex
+static INLINE int pthread_mutex_init(pthread_mutex_t *const mutex,
+ void* mutexattr) {
+ (void)mutexattr;
+ InitializeCriticalSection(mutex);
+ return 0;
+}
+
+static INLINE int pthread_mutex_trylock(pthread_mutex_t *const mutex) {
+ return TryEnterCriticalSection(mutex) ? 0 : EBUSY;
+}
+
+static INLINE int pthread_mutex_lock(pthread_mutex_t *const mutex) {
+ EnterCriticalSection(mutex);
+ return 0;
+}
+
+static INLINE int pthread_mutex_unlock(pthread_mutex_t *const mutex) {
+ LeaveCriticalSection(mutex);
+ return 0;
+}
+
+static INLINE int pthread_mutex_destroy(pthread_mutex_t *const mutex) {
+ DeleteCriticalSection(mutex);
+ return 0;
+}
+
+// Condition
+static INLINE int pthread_cond_destroy(pthread_cond_t *const condition) {
+ int ok = 1;
+ ok &= (CloseHandle(condition->waiting_sem_) != 0);
+ ok &= (CloseHandle(condition->received_sem_) != 0);
+ ok &= (CloseHandle(condition->signal_event_) != 0);
+ return !ok;
+}
+
+static INLINE int pthread_cond_init(pthread_cond_t *const condition,
+ void* cond_attr) {
+ (void)cond_attr;
+ condition->waiting_sem_ = CreateSemaphore(NULL, 0, 1, NULL);
+ condition->received_sem_ = CreateSemaphore(NULL, 0, 1, NULL);
+ condition->signal_event_ = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (condition->waiting_sem_ == NULL ||
+ condition->received_sem_ == NULL ||
+ condition->signal_event_ == NULL) {
+ pthread_cond_destroy(condition);
+ return 1;
+ }
+ return 0;
+}
+
+static INLINE int pthread_cond_signal(pthread_cond_t *const condition) {
+ int ok = 1;
+ if (WaitForSingleObject(condition->waiting_sem_, 0) == WAIT_OBJECT_0) {
+ // a thread is waiting in pthread_cond_wait: allow it to be notified
+ ok = SetEvent(condition->signal_event_);
+ // wait until the event is consumed so the signaler cannot consume
+ // the event via its own pthread_cond_wait.
+ ok &= (WaitForSingleObject(condition->received_sem_, INFINITE) !=
+ WAIT_OBJECT_0);
+ }
+ return !ok;
+}
+
+static INLINE int pthread_cond_wait(pthread_cond_t *const condition,
+ pthread_mutex_t *const mutex) {
+ int ok;
+ // note that there is a consumer available so the signal isn't dropped in
+ // pthread_cond_signal
+ if (!ReleaseSemaphore(condition->waiting_sem_, 1, NULL))
+ return 1;
+ // now unlock the mutex so pthread_cond_signal may be issued
+ pthread_mutex_unlock(mutex);
+ ok = (WaitForSingleObject(condition->signal_event_, INFINITE) ==
+ WAIT_OBJECT_0);
+ ok &= ReleaseSemaphore(condition->received_sem_, 1, NULL);
+ pthread_mutex_lock(mutex);
+ return !ok;
+}
+#else // _WIN32
#include <pthread.h> // NOLINT
+# define THREADFN void*
+# define THREAD_RETURN(val) val
+#endif
-#endif /* _WIN32 */
-#endif /* CONFIG_MULTITHREAD */
+#endif // CONFIG_MULTITHREAD
// State of the worker thread object
typedef enum {
@@ -91,7 +200,7 @@ void vp9_worker_end(VP9Worker* const worker);
//------------------------------------------------------------------------------
-#if defined(__cplusplus) || defined(c_plusplus)
+#ifdef __cplusplus
} // extern "C"
#endif
diff --git a/libvpx/vp9/decoder/vp9_treereader.h b/libvpx/vp9/decoder/vp9_treereader.h
deleted file mode 100644
index 41680d2..0000000
--- a/libvpx/vp9/decoder/vp9_treereader.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef VP9_DECODER_VP9_TREEREADER_H_
-#define VP9_DECODER_VP9_TREEREADER_H_
-
-#include "vp9/common/vp9_treecoder.h"
-#include "vp9/decoder/vp9_dboolhuff.h"
-
-// Intent of tree data structure is to make decoding trivial.
-static int treed_read(vp9_reader *const r, /* !!! must return a 0 or 1 !!! */
- vp9_tree t,
- const vp9_prob *const p) {
- register vp9_tree_index i = 0;
-
- while ((i = t[ i + vp9_read(r, p[i >> 1])]) > 0)
- continue;
-
- return -i;
-}
-
-#endif // VP9_DECODER_VP9_TREEREADER_H_
diff --git a/libvpx/vp9/encoder/vp9_bitstream.c b/libvpx/vp9/encoder/vp9_bitstream.c
index efbadba..1b4a6cc 100644
--- a/libvpx/vp9/encoder/vp9_bitstream.c
+++ b/libvpx/vp9/encoder/vp9_bitstream.c
@@ -14,179 +14,72 @@
#include "vpx/vpx_encoder.h"
#include "vpx_mem/vpx_mem.h"
+#include "vpx_ports/mem_ops.h"
+#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_entropymv.h"
-#include "vp9/common/vp9_findnearmv.h"
-#include "vp9/common/vp9_tile_common.h"
-#include "vp9/common/vp9_seg_common.h"
-#include "vp9/common/vp9_pred_common.h"
-#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_mvref_common.h"
-#include "vp9/common/vp9_treecoder.h"
-#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_pragmas.h"
+#include "vp9/common/vp9_pred_common.h"
+#include "vp9/common/vp9_seg_common.h"
+#include "vp9/common/vp9_systemdependent.h"
+#include "vp9/common/vp9_tile_common.h"
-#include "vp9/encoder/vp9_mcomp.h"
-#include "vp9/encoder/vp9_encodemv.h"
+#include "vp9/encoder/vp9_cost.h"
#include "vp9/encoder/vp9_bitstream.h"
+#include "vp9/encoder/vp9_encodemv.h"
+#include "vp9/encoder/vp9_mcomp.h"
#include "vp9/encoder/vp9_segmentation.h"
#include "vp9/encoder/vp9_subexp.h"
+#include "vp9/encoder/vp9_tokenize.h"
#include "vp9/encoder/vp9_write_bit_buffer.h"
+static struct vp9_token intra_mode_encodings[INTRA_MODES];
+static struct vp9_token switchable_interp_encodings[SWITCHABLE_FILTERS];
+static struct vp9_token partition_encodings[PARTITION_TYPES];
+static struct vp9_token inter_mode_encodings[INTER_MODES];
-#if defined(SECTIONBITS_OUTPUT)
-unsigned __int64 Sectionbits[500];
-#endif
-
-#ifdef ENTROPY_STATS
-int intra_mode_stats[INTRA_MODES]
- [INTRA_MODES]
- [INTRA_MODES];
-vp9_coeff_stats tree_update_hist[TX_SIZES][BLOCK_TYPES];
-
-extern unsigned int active_section;
-#endif
-
-
-#ifdef MODE_STATS
-int64_t tx_count_32x32p_stats[TX_SIZE_CONTEXTS][TX_SIZES];
-int64_t tx_count_16x16p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 1];
-int64_t tx_count_8x8p_stats[TX_SIZE_CONTEXTS][TX_SIZES - 2];
-int64_t switchable_interp_stats[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
-
-void init_tx_count_stats() {
- vp9_zero(tx_count_32x32p_stats);
- vp9_zero(tx_count_16x16p_stats);
- vp9_zero(tx_count_8x8p_stats);
-}
-
-void init_switchable_interp_stats() {
- vp9_zero(switchable_interp_stats);
+void vp9_entropy_mode_init() {
+ vp9_tokens_from_tree(intra_mode_encodings, vp9_intra_mode_tree);
+ vp9_tokens_from_tree(switchable_interp_encodings, vp9_switchable_interp_tree);
+ vp9_tokens_from_tree(partition_encodings, vp9_partition_tree);
+ vp9_tokens_from_tree(inter_mode_encodings, vp9_inter_mode_tree);
}
-static void update_tx_count_stats(VP9_COMMON *cm) {
- int i, j;
- for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- for (j = 0; j < TX_SIZES; j++) {
- tx_count_32x32p_stats[i][j] += cm->fc.tx_count_32x32p[i][j];
- }
- }
- for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- for (j = 0; j < TX_SIZES - 1; j++) {
- tx_count_16x16p_stats[i][j] += cm->fc.tx_count_16x16p[i][j];
- }
- }
- for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- for (j = 0; j < TX_SIZES - 2; j++) {
- tx_count_8x8p_stats[i][j] += cm->fc.tx_count_8x8p[i][j];
- }
- }
+static void write_intra_mode(vp9_writer *w, MB_PREDICTION_MODE mode,
+ const vp9_prob *probs) {
+ vp9_write_token(w, vp9_intra_mode_tree, probs, &intra_mode_encodings[mode]);
}
-static void update_switchable_interp_stats(VP9_COMMON *cm) {
- int i, j;
- for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
- for (j = 0; j < SWITCHABLE_FILTERS; ++j)
- switchable_interp_stats[i][j] += cm->fc.switchable_interp_count[i][j];
-}
-
-void write_tx_count_stats() {
- int i, j;
- FILE *fp = fopen("tx_count.bin", "wb");
- fwrite(tx_count_32x32p_stats, sizeof(tx_count_32x32p_stats), 1, fp);
- fwrite(tx_count_16x16p_stats, sizeof(tx_count_16x16p_stats), 1, fp);
- fwrite(tx_count_8x8p_stats, sizeof(tx_count_8x8p_stats), 1, fp);
- fclose(fp);
-
- printf(
- "vp9_default_tx_count_32x32p[TX_SIZE_CONTEXTS][TX_SIZES] = {\n");
- for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- printf(" { ");
- for (j = 0; j < TX_SIZES; j++) {
- printf("%"PRId64", ", tx_count_32x32p_stats[i][j]);
- }
- printf("},\n");
- }
- printf("};\n");
- printf(
- "vp9_default_tx_count_16x16p[TX_SIZE_CONTEXTS][TX_SIZES-1] = {\n");
- for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- printf(" { ");
- for (j = 0; j < TX_SIZES - 1; j++) {
- printf("%"PRId64", ", tx_count_16x16p_stats[i][j]);
- }
- printf("},\n");
- }
- printf("};\n");
- printf(
- "vp9_default_tx_count_8x8p[TX_SIZE_CONTEXTS][TX_SIZES-2] = {\n");
- for (i = 0; i < TX_SIZE_CONTEXTS; i++) {
- printf(" { ");
- for (j = 0; j < TX_SIZES - 2; j++) {
- printf("%"PRId64", ", tx_count_8x8p_stats[i][j]);
- }
- printf("},\n");
- }
- printf("};\n");
-}
-
-void write_switchable_interp_stats() {
- int i, j;
- FILE *fp = fopen("switchable_interp.bin", "wb");
- fwrite(switchable_interp_stats, sizeof(switchable_interp_stats), 1, fp);
- fclose(fp);
-
- printf(
- "vp9_default_switchable_filter_count[SWITCHABLE_FILTER_CONTEXTS]"
- "[SWITCHABLE_FILTERS] = {\n");
- for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
- printf(" { ");
- for (j = 0; j < SWITCHABLE_FILTERS; j++) {
- printf("%"PRId64", ", switchable_interp_stats[i][j]);
- }
- printf("},\n");
- }
- printf("};\n");
-}
-#endif
-
-static INLINE void write_be32(uint8_t *p, int value) {
- p[0] = value >> 24;
- p[1] = value >> 16;
- p[2] = value >> 8;
- p[3] = value;
+static void write_inter_mode(vp9_writer *w, MB_PREDICTION_MODE mode,
+ const vp9_prob *probs) {
+ assert(is_inter_mode(mode));
+ vp9_write_token(w, vp9_inter_mode_tree, probs,
+ &inter_mode_encodings[INTER_OFFSET(mode)]);
}
-void vp9_encode_unsigned_max(struct vp9_write_bit_buffer *wb,
- int data, int max) {
+static void encode_unsigned_max(struct vp9_write_bit_buffer *wb,
+ int data, int max) {
vp9_wb_write_literal(wb, data, get_unsigned_bits(max));
}
-static void update_mode(vp9_writer *w, int n, vp9_tree tree,
- vp9_prob Pcur[/* n-1 */],
- unsigned int bct[/* n-1 */][2],
- const unsigned int num_events[/* n */]) {
- int i = 0;
+static void prob_diff_update(const vp9_tree_index *tree,
+ vp9_prob probs[/*n - 1*/],
+ const unsigned int counts[/*n - 1*/],
+ int n, vp9_writer *w) {
+ int i;
+ unsigned int branch_ct[32][2];
- vp9_tree_probs_from_distribution(tree, bct, num_events);
- for (i = 0; i < n - 1; ++i)
- vp9_cond_prob_diff_update(w, &Pcur[i], bct[i]);
-}
+ // Assuming max number of probabilities <= 32
+ assert(n <= 32);
-static void update_mbintra_mode_probs(VP9_COMP* const cpi,
- vp9_writer* const bc) {
- VP9_COMMON *const cm = &cpi->common;
- int j;
- unsigned int bct[INTRA_MODES - 1][2];
-
- for (j = 0; j < BLOCK_SIZE_GROUPS; j++)
- update_mode(bc, INTRA_MODES, vp9_intra_mode_tree,
- cm->fc.y_mode_prob[j], bct,
- (unsigned int *)cpi->y_mode_count[j]);
+ vp9_tree_probs_from_distribution(tree, branch_ct, counts);
+ for (i = 0; i < n - 1; ++i)
+ vp9_cond_prob_diff_update(w, &probs[i], branch_ct[i]);
}
-static void write_selected_tx_size(const VP9_COMP *cpi, MODE_INFO *m,
+static void write_selected_tx_size(const VP9_COMP *cpi,
TX_SIZE tx_size, BLOCK_SIZE bsize,
vp9_writer *w) {
const TX_SIZE max_tx_size = max_txsize_lookup[bsize];
@@ -201,66 +94,35 @@ static void write_selected_tx_size(const VP9_COMP *cpi, MODE_INFO *m,
}
}
-static int write_skip_coeff(const VP9_COMP *cpi, int segment_id, MODE_INFO *m,
- vp9_writer *w) {
+static int write_skip(const VP9_COMP *cpi, int segment_id, const MODE_INFO *mi,
+ vp9_writer *w) {
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
if (vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP)) {
return 1;
} else {
- const int skip_coeff = m->mbmi.skip_coeff;
- vp9_write(w, skip_coeff, vp9_get_pred_prob_mbskip(&cpi->common, xd));
- return skip_coeff;
+ const int skip = mi->mbmi.skip;
+ vp9_write(w, skip, vp9_get_skip_prob(&cpi->common, xd));
+ return skip;
}
}
-void vp9_update_skip_probs(VP9_COMP *cpi, vp9_writer *w) {
- VP9_COMMON *cm = &cpi->common;
+static void update_skip_probs(VP9_COMMON *cm, vp9_writer *w) {
int k;
- for (k = 0; k < MBSKIP_CONTEXTS; ++k)
- vp9_cond_prob_diff_update(w, &cm->fc.mbskip_probs[k], cm->counts.mbskip[k]);
-}
-
-static void write_intra_mode(vp9_writer *bc, int m, const vp9_prob *p) {
- write_token(bc, vp9_intra_mode_tree, p, vp9_intra_mode_encodings + m);
+ for (k = 0; k < SKIP_CONTEXTS; ++k)
+ vp9_cond_prob_diff_update(w, &cm->fc.skip_probs[k], cm->counts.skip[k]);
}
-static void update_switchable_interp_probs(VP9_COMP *cpi, vp9_writer *w) {
- VP9_COMMON *const cm = &cpi->common;
- unsigned int branch_ct[SWITCHABLE_FILTERS - 1][2];
- int i, j;
- for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j) {
- vp9_tree_probs_from_distribution(vp9_switchable_interp_tree, branch_ct,
- cm->counts.switchable_interp[j]);
-
- for (i = 0; i < SWITCHABLE_FILTERS - 1; ++i)
- vp9_cond_prob_diff_update(w, &cm->fc.switchable_interp_prob[j][i],
- branch_ct[i]);
- }
-
-#ifdef MODE_STATS
- if (!cpi->dummy_packing)
- update_switchable_interp_stats(cm);
-#endif
-}
-
-static void update_inter_mode_probs(VP9_COMMON *cm, vp9_writer *w) {
- int i, j;
-
- for (i = 0; i < INTER_MODE_CONTEXTS; ++i) {
- unsigned int branch_ct[INTER_MODES - 1][2];
- vp9_tree_probs_from_distribution(vp9_inter_mode_tree, branch_ct,
- cm->counts.inter_mode[i]);
-
- for (j = 0; j < INTER_MODES - 1; ++j)
- vp9_cond_prob_diff_update(w, &cm->fc.inter_mode_probs[i][j],
- branch_ct[j]);
- }
+static void update_switchable_interp_probs(VP9_COMMON *cm, vp9_writer *w) {
+ int j;
+ for (j = 0; j < SWITCHABLE_FILTER_CONTEXTS; ++j)
+ prob_diff_update(vp9_switchable_interp_tree,
+ cm->fc.switchable_interp_prob[j],
+ cm->counts.switchable_interp[j], SWITCHABLE_FILTERS, w);
}
-static void pack_mb_tokens(vp9_writer* const w,
- TOKENEXTRA **tp,
- const TOKENEXTRA *const stop) {
+static void pack_mb_tokens(vp9_writer *w,
+ TOKENEXTRA **tp, const TOKENEXTRA *stop) {
TOKENEXTRA *p = *tp;
while (p < stop && p->token != EOSB_TOKEN) {
@@ -268,18 +130,8 @@ static void pack_mb_tokens(vp9_writer* const w,
const struct vp9_token *const a = &vp9_coef_encodings[t];
const vp9_extra_bit *const b = &vp9_extra_bits[t];
int i = 0;
- const vp9_prob *pp;
int v = a->value;
int n = a->len;
- vp9_prob probs[ENTROPY_NODES];
-
- if (t >= TWO_TOKEN) {
- vp9_model_to_full_probs(p->context_tree, probs);
- pp = probs;
- } else {
- pp = p->context_tree;
- }
- assert(pp != 0);
/* skip one or two nodes */
if (p->skip_eob_node) {
@@ -287,11 +139,24 @@ static void pack_mb_tokens(vp9_writer* const w,
i = 2 * p->skip_eob_node;
}
- do {
- const int bb = (v >> --n) & 1;
- vp9_write(w, bb, pp[i >> 1]);
- i = vp9_coef_tree[i + bb];
- } while (n);
+ // TODO(jbb): expanding this can lead to big gains. It allows
+ // much better branch prediction and would enable us to avoid numerous
+ // lookups and compares.
+
+ // If we have a token that's in the constrained set, the coefficient tree
+ // is split into two treed writes. The first treed write takes care of the
+ // unconstrained nodes. The second treed write takes care of the
+ // constrained nodes.
+ if (t >= TWO_TOKEN && t < EOB_TOKEN) {
+ int len = UNCONSTRAINED_NODES - p->skip_eob_node;
+ int bits = v >> (n - len);
+ vp9_write_tree(w, vp9_coef_tree, p->context_tree, bits, len, i);
+ vp9_write_tree(w, vp9_coef_con_tree,
+ vp9_pareto8_full[p->context_tree[PIVOT_NODE] - 1],
+ v, n - len, 0);
+ } else {
+ vp9_write_tree(w, vp9_coef_tree, p->context_tree, v, n, i);
+ }
if (b->base_val) {
const int e = p->extra, l = b->len;
@@ -317,231 +182,190 @@ static void pack_mb_tokens(vp9_writer* const w,
*tp = p + (p->token == EOSB_TOKEN);
}
-static void write_sb_mv_ref(vp9_writer *w, MB_PREDICTION_MODE mode,
- const vp9_prob *p) {
- assert(is_inter_mode(mode));
- write_token(w, vp9_inter_mode_tree, p,
- &vp9_inter_mode_encodings[INTER_OFFSET(mode)]);
-}
-
-
static void write_segment_id(vp9_writer *w, const struct segmentation *seg,
int segment_id) {
if (seg->enabled && seg->update_map)
- treed_write(w, vp9_segment_tree, seg->tree_probs, segment_id, 3);
+ vp9_write_tree(w, vp9_segment_tree, seg->tree_probs, segment_id, 3, 0);
}
// This function encodes the reference frame
-static void encode_ref_frame(VP9_COMP *cpi, vp9_writer *bc) {
- VP9_COMMON *const cm = &cpi->common;
- MACROBLOCK *const x = &cpi->mb;
- MACROBLOCKD *const xd = &x->e_mbd;
- MB_MODE_INFO *mi = &xd->mi_8x8[0]->mbmi;
- const int segment_id = mi->segment_id;
- int seg_ref_active = vp9_segfeature_active(&cm->seg, segment_id,
- SEG_LVL_REF_FRAME);
+static void write_ref_frames(const VP9_COMP *cpi, vp9_writer *w) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
+ const MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
+ const int is_compound = has_second_ref(mbmi);
+ const int segment_id = mbmi->segment_id;
+
// If segment level coding of this signal is disabled...
// or the segment allows multiple reference frame options
- if (!seg_ref_active) {
+ if (vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME)) {
+ assert(!is_compound);
+ assert(mbmi->ref_frame[0] ==
+ vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME));
+ } else {
// does the feature use compound prediction or not
// (if not specified at the frame/segment level)
- if (cm->comp_pred_mode == HYBRID_PREDICTION) {
- vp9_write(bc, mi->ref_frame[1] > INTRA_FRAME,
- vp9_get_pred_prob_comp_inter_inter(cm, xd));
+ if (cm->reference_mode == REFERENCE_MODE_SELECT) {
+ vp9_write(w, is_compound, vp9_get_reference_mode_prob(cm, xd));
} else {
- assert((mi->ref_frame[1] <= INTRA_FRAME) ==
- (cm->comp_pred_mode == SINGLE_PREDICTION_ONLY));
+ assert(!is_compound == (cm->reference_mode == SINGLE_REFERENCE));
}
- if (mi->ref_frame[1] > INTRA_FRAME) {
- vp9_write(bc, mi->ref_frame[0] == GOLDEN_FRAME,
+ if (is_compound) {
+ vp9_write(w, mbmi->ref_frame[0] == GOLDEN_FRAME,
vp9_get_pred_prob_comp_ref_p(cm, xd));
} else {
- vp9_write(bc, mi->ref_frame[0] != LAST_FRAME,
- vp9_get_pred_prob_single_ref_p1(cm, xd));
- if (mi->ref_frame[0] != LAST_FRAME)
- vp9_write(bc, mi->ref_frame[0] != GOLDEN_FRAME,
- vp9_get_pred_prob_single_ref_p2(cm, xd));
+ const int bit0 = mbmi->ref_frame[0] != LAST_FRAME;
+ vp9_write(w, bit0, vp9_get_pred_prob_single_ref_p1(cm, xd));
+ if (bit0) {
+ const int bit1 = mbmi->ref_frame[0] != GOLDEN_FRAME;
+ vp9_write(w, bit1, vp9_get_pred_prob_single_ref_p2(cm, xd));
+ }
}
- } else {
- assert(mi->ref_frame[1] <= INTRA_FRAME);
- assert(vp9_get_segdata(&cm->seg, segment_id, SEG_LVL_REF_FRAME) ==
- mi->ref_frame[0]);
}
-
- // If using the prediction model we have nothing further to do because
- // the reference frame is fully coded by the segment.
}
-static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m, vp9_writer *bc) {
+static void pack_inter_mode_mvs(VP9_COMP *cpi, const MODE_INFO *mi,
+ vp9_writer *w) {
VP9_COMMON *const cm = &cpi->common;
const nmv_context *nmvc = &cm->fc.nmvc;
- MACROBLOCK *const x = &cpi->mb;
- MACROBLOCKD *const xd = &x->e_mbd;
- struct segmentation *seg = &cm->seg;
- MB_MODE_INFO *const mi = &m->mbmi;
- const MV_REFERENCE_FRAME rf = mi->ref_frame[0];
- const MB_PREDICTION_MODE mode = mi->mode;
- const int segment_id = mi->segment_id;
- int skip_coeff;
- const BLOCK_SIZE bsize = mi->sb_type;
+ const MACROBLOCK *const x = &cpi->mb;
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const struct segmentation *const seg = &cm->seg;
+ const MB_MODE_INFO *const mbmi = &mi->mbmi;
+ const MB_PREDICTION_MODE mode = mbmi->mode;
+ const int segment_id = mbmi->segment_id;
+ const BLOCK_SIZE bsize = mbmi->sb_type;
const int allow_hp = cm->allow_high_precision_mv;
-
-#ifdef ENTROPY_STATS
- active_section = 9;
-#endif
+ const int is_inter = is_inter_block(mbmi);
+ const int is_compound = has_second_ref(mbmi);
+ int skip, ref;
if (seg->update_map) {
if (seg->temporal_update) {
- const int pred_flag = mi->seg_id_predicted;
+ const int pred_flag = mbmi->seg_id_predicted;
vp9_prob pred_prob = vp9_get_pred_prob_seg_id(seg, xd);
- vp9_write(bc, pred_flag, pred_prob);
+ vp9_write(w, pred_flag, pred_prob);
if (!pred_flag)
- write_segment_id(bc, seg, segment_id);
+ write_segment_id(w, seg, segment_id);
} else {
- write_segment_id(bc, seg, segment_id);
+ write_segment_id(w, seg, segment_id);
}
}
- skip_coeff = write_skip_coeff(cpi, segment_id, m, bc);
+ skip = write_skip(cpi, segment_id, mi, w);
if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME))
- vp9_write(bc, rf != INTRA_FRAME,
- vp9_get_pred_prob_intra_inter(cm, xd));
+ vp9_write(w, is_inter, vp9_get_intra_inter_prob(cm, xd));
if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT &&
- !(rf != INTRA_FRAME &&
- (skip_coeff || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) {
- write_selected_tx_size(cpi, m, mi->tx_size, bsize, bc);
+ !(is_inter &&
+ (skip || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) {
+ write_selected_tx_size(cpi, mbmi->tx_size, bsize, w);
}
- if (rf == INTRA_FRAME) {
-#ifdef ENTROPY_STATS
- active_section = 6;
-#endif
-
+ if (!is_inter) {
if (bsize >= BLOCK_8X8) {
- write_intra_mode(bc, mode, cm->fc.y_mode_prob[size_group_lookup[bsize]]);
+ write_intra_mode(w, mode, cm->fc.y_mode_prob[size_group_lookup[bsize]]);
} else {
int idx, idy;
- const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
- const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
- for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
- for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
- const MB_PREDICTION_MODE bm = m->bmi[idy * 2 + idx].as_mode;
- write_intra_mode(bc, bm, cm->fc.y_mode_prob[0]);
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
+ for (idy = 0; idy < 2; idy += num_4x4_h) {
+ for (idx = 0; idx < 2; idx += num_4x4_w) {
+ const MB_PREDICTION_MODE b_mode = mi->bmi[idy * 2 + idx].as_mode;
+ write_intra_mode(w, b_mode, cm->fc.y_mode_prob[0]);
}
}
}
- write_intra_mode(bc, mi->uv_mode, cm->fc.uv_mode_prob[mode]);
+ write_intra_mode(w, mbmi->uv_mode, cm->fc.uv_mode_prob[mode]);
} else {
- vp9_prob *mv_ref_p;
- encode_ref_frame(cpi, bc);
- mv_ref_p = cpi->common.fc.inter_mode_probs[mi->mode_context[rf]];
-
-#ifdef ENTROPY_STATS
- active_section = 3;
-#endif
+ const int mode_ctx = mbmi->mode_context[mbmi->ref_frame[0]];
+ const vp9_prob *const inter_probs = cm->fc.inter_mode_probs[mode_ctx];
+ write_ref_frames(cpi, w);
// If segment skip is not enabled code the mode.
if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
if (bsize >= BLOCK_8X8) {
- write_sb_mv_ref(bc, mode, mv_ref_p);
- ++cm->counts.inter_mode[mi->mode_context[rf]]
- [INTER_OFFSET(mode)];
+ write_inter_mode(w, mode, inter_probs);
+ ++cm->counts.inter_mode[mode_ctx][INTER_OFFSET(mode)];
}
}
- if (cm->mcomp_filter_type == SWITCHABLE) {
+ if (cm->interp_filter == SWITCHABLE) {
const int ctx = vp9_get_pred_context_switchable_interp(xd);
- write_token(bc, vp9_switchable_interp_tree,
- cm->fc.switchable_interp_prob[ctx],
- &vp9_switchable_interp_encodings[mi->interp_filter]);
+ vp9_write_token(w, vp9_switchable_interp_tree,
+ cm->fc.switchable_interp_prob[ctx],
+ &switchable_interp_encodings[mbmi->interp_filter]);
} else {
- assert(mi->interp_filter == cm->mcomp_filter_type);
+ assert(mbmi->interp_filter == cm->interp_filter);
}
if (bsize < BLOCK_8X8) {
- const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
- const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
int idx, idy;
- for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
- for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
+ for (idy = 0; idy < 2; idy += num_4x4_h) {
+ for (idx = 0; idx < 2; idx += num_4x4_w) {
const int j = idy * 2 + idx;
- const MB_PREDICTION_MODE blockmode = m->bmi[j].as_mode;
- write_sb_mv_ref(bc, blockmode, mv_ref_p);
- ++cm->counts.inter_mode[mi->mode_context[rf]]
- [INTER_OFFSET(blockmode)];
-
- if (blockmode == NEWMV) {
-#ifdef ENTROPY_STATS
- active_section = 11;
-#endif
- vp9_encode_mv(cpi, bc, &m->bmi[j].as_mv[0].as_mv,
- &mi->best_mv[0].as_mv, nmvc, allow_hp);
-
- if (has_second_ref(mi))
- vp9_encode_mv(cpi, bc, &m->bmi[j].as_mv[1].as_mv,
- &mi->best_mv[1].as_mv, nmvc, allow_hp);
+ const MB_PREDICTION_MODE b_mode = mi->bmi[j].as_mode;
+ write_inter_mode(w, b_mode, inter_probs);
+ ++cm->counts.inter_mode[mode_ctx][INTER_OFFSET(b_mode)];
+ if (b_mode == NEWMV) {
+ for (ref = 0; ref < 1 + is_compound; ++ref)
+ vp9_encode_mv(cpi, w, &mi->bmi[j].as_mv[ref].as_mv,
+ &mbmi->ref_mvs[mbmi->ref_frame[ref]][0].as_mv,
+ nmvc, allow_hp);
}
}
}
- } else if (mode == NEWMV) {
-#ifdef ENTROPY_STATS
- active_section = 5;
-#endif
- vp9_encode_mv(cpi, bc, &mi->mv[0].as_mv,
- &mi->best_mv[0].as_mv, nmvc, allow_hp);
-
- if (has_second_ref(mi))
- vp9_encode_mv(cpi, bc, &mi->mv[1].as_mv,
- &mi->best_mv[1].as_mv, nmvc, allow_hp);
+ } else {
+ if (mode == NEWMV) {
+ for (ref = 0; ref < 1 + is_compound; ++ref)
+ vp9_encode_mv(cpi, w, &mbmi->mv[ref].as_mv,
+ &mbmi->ref_mvs[mbmi->ref_frame[ref]][0].as_mv, nmvc,
+ allow_hp);
+ }
}
}
}
static void write_mb_modes_kf(const VP9_COMP *cpi, MODE_INFO **mi_8x8,
- vp9_writer *bc) {
+ vp9_writer *w) {
const VP9_COMMON *const cm = &cpi->common;
const MACROBLOCKD *const xd = &cpi->mb.e_mbd;
const struct segmentation *const seg = &cm->seg;
- MODE_INFO *m = mi_8x8[0];
- const int ym = m->mbmi.mode;
- const int segment_id = m->mbmi.segment_id;
- MODE_INFO *above_mi = mi_8x8[-xd->mode_info_stride];
- MODE_INFO *left_mi = xd->left_available ? mi_8x8[-1] : NULL;
+ const MODE_INFO *const mi = mi_8x8[0];
+ const MODE_INFO *const above_mi = mi_8x8[-xd->mode_info_stride];
+ const MODE_INFO *const left_mi = xd->left_available ? mi_8x8[-1] : NULL;
+ const MB_MODE_INFO *const mbmi = &mi->mbmi;
+ const BLOCK_SIZE bsize = mbmi->sb_type;
if (seg->update_map)
- write_segment_id(bc, seg, m->mbmi.segment_id);
+ write_segment_id(w, seg, mbmi->segment_id);
- write_skip_coeff(cpi, segment_id, m, bc);
+ write_skip(cpi, mbmi->segment_id, mi, w);
- if (m->mbmi.sb_type >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT)
- write_selected_tx_size(cpi, m, m->mbmi.tx_size, m->mbmi.sb_type, bc);
+ if (bsize >= BLOCK_8X8 && cm->tx_mode == TX_MODE_SELECT)
+ write_selected_tx_size(cpi, mbmi->tx_size, bsize, w);
- if (m->mbmi.sb_type >= BLOCK_8X8) {
- const MB_PREDICTION_MODE A = above_block_mode(m, above_mi, 0);
- const MB_PREDICTION_MODE L = left_block_mode(m, left_mi, 0);
- write_intra_mode(bc, ym, vp9_kf_y_mode_prob[A][L]);
+ if (bsize >= BLOCK_8X8) {
+ write_intra_mode(w, mbmi->mode, get_y_mode_probs(mi, above_mi, left_mi, 0));
} else {
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
int idx, idy;
- const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[m->mbmi.sb_type];
- const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[m->mbmi.sb_type];
- for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
- for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
- int i = idy * 2 + idx;
- const MB_PREDICTION_MODE A = above_block_mode(m, above_mi, i);
- const MB_PREDICTION_MODE L = left_block_mode(m, left_mi, i);
- const int bm = m->bmi[i].as_mode;
-#ifdef ENTROPY_STATS
- ++intra_mode_stats[A][L][bm];
-#endif
- write_intra_mode(bc, bm, vp9_kf_y_mode_prob[A][L]);
+
+ for (idy = 0; idy < 2; idy += num_4x4_h) {
+ for (idx = 0; idx < 2; idx += num_4x4_w) {
+ const int block = idy * 2 + idx;
+ write_intra_mode(w, mi->bmi[block].as_mode,
+ get_y_mode_probs(mi, above_mi, left_mi, block));
}
}
}
- write_intra_mode(bc, m->mbmi.uv_mode, vp9_kf_uv_mode_prob[ym]);
+ write_intra_mode(w, mbmi->uv_mode, vp9_kf_uv_mode_prob[mbmi->mode]);
}
static void write_modes_b(VP9_COMP *cpi, const TileInfo *const tile,
@@ -560,14 +384,8 @@ static void write_modes_b(VP9_COMP *cpi, const TileInfo *const tile,
cm->mi_rows, cm->mi_cols);
if (frame_is_intra_only(cm)) {
write_mb_modes_kf(cpi, xd->mi_8x8, w);
-#ifdef ENTROPY_STATS
- active_section = 8;
-#endif
} else {
pack_inter_mode_mvs(cpi, m, w);
-#ifdef ENTROPY_STATS
- active_section = 1;
-#endif
}
assert(*tok < tok_end);
@@ -585,7 +403,7 @@ static void write_partition(VP9_COMP *cpi, int hbs, int mi_row, int mi_col,
const int has_cols = (mi_col + hbs) < cm->mi_cols;
if (has_rows && has_cols) {
- write_token(w, vp9_partition_tree, probs, &vp9_partition_encodings[p]);
+ vp9_write_token(w, vp9_partition_tree, probs, &partition_encodings[p]);
} else if (!has_rows && has_cols) {
assert(p == PARTITION_SPLIT || p == PARTITION_HORZ);
vp9_write(w, p == PARTITION_SPLIT, probs[1]);
@@ -667,17 +485,15 @@ static void write_modes(VP9_COMP *cpi, const TileInfo *const tile,
static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size) {
vp9_coeff_probs_model *coef_probs = cpi->frame_coef_probs[tx_size];
vp9_coeff_count *coef_counts = cpi->coef_counts[tx_size];
- unsigned int (*eob_branch_ct)[REF_TYPES][COEF_BANDS][PREV_COEF_CONTEXTS] =
+ unsigned int (*eob_branch_ct)[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] =
cpi->common.counts.eob_branch[tx_size];
vp9_coeff_stats *coef_branch_ct = cpi->frame_branch_ct[tx_size];
int i, j, k, l, m;
- for (i = 0; i < BLOCK_TYPES; ++i) {
+ for (i = 0; i < PLANE_TYPES; ++i) {
for (j = 0; j < REF_TYPES; ++j) {
for (k = 0; k < COEF_BANDS; ++k) {
- for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
- if (l >= 3 && k == 0)
- continue;
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
vp9_tree_probs_from_distribution(vp9_coef_tree,
coef_branch_ct[i][j][k][l],
coef_counts[i][j][k][l]);
@@ -687,28 +503,12 @@ static void build_tree_distribution(VP9_COMP *cpi, TX_SIZE tx_size) {
coef_probs[i][j][k][l][m] = get_binary_prob(
coef_branch_ct[i][j][k][l][m][0],
coef_branch_ct[i][j][k][l][m][1]);
-#ifdef ENTROPY_STATS
- if (!cpi->dummy_packing) {
- int t;
- for (t = 0; t < MAX_ENTROPY_TOKENS; ++t)
- context_counters[tx_size][i][j][k][l][t] +=
- coef_counts[i][j][k][l][t];
- context_counters[tx_size][i][j][k][l][MAX_ENTROPY_TOKENS] +=
- eob_branch_ct[i][j][k][l];
- }
-#endif
}
}
}
}
}
-static void build_coeff_contexts(VP9_COMP *cpi) {
- TX_SIZE t;
- for (t = TX_4X4; t <= TX_32X32; t++)
- build_tree_distribution(cpi, t);
-}
-
static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
TX_SIZE tx_size) {
vp9_coeff_probs_model *new_frame_coef_probs = cpi->frame_coef_probs[tx_size];
@@ -723,22 +523,19 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
/* dry run to see if there is any udpate at all needed */
int savings = 0;
int update[2] = {0, 0};
- for (i = 0; i < BLOCK_TYPES; ++i) {
+ for (i = 0; i < PLANE_TYPES; ++i) {
for (j = 0; j < REF_TYPES; ++j) {
for (k = 0; k < COEF_BANDS; ++k) {
- for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
for (t = 0; t < entropy_nodes_update; ++t) {
vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
const vp9_prob oldp = old_frame_coef_probs[i][j][k][l][t];
int s;
int u = 0;
-
- if (l >= 3 && k == 0)
- continue;
if (t == PIVOT_NODE)
s = vp9_prob_diff_update_savings_search_model(
frame_branch_ct[i][j][k][l][0],
- old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+ old_frame_coef_probs[i][j][k][l], &newp, upd);
else
s = vp9_prob_diff_update_savings_search(
frame_branch_ct[i][j][k][l][t], oldp, &newp, upd);
@@ -762,10 +559,10 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
return;
}
vp9_write_bit(bc, 1);
- for (i = 0; i < BLOCK_TYPES; ++i) {
+ for (i = 0; i < PLANE_TYPES; ++i) {
for (j = 0; j < REF_TYPES; ++j) {
for (k = 0; k < COEF_BANDS; ++k) {
- for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
// calc probs and branch cts for this frame only
for (t = 0; t < entropy_nodes_update; ++t) {
vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
@@ -773,12 +570,10 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
const vp9_prob upd = DIFF_UPDATE_PROB;
int s;
int u = 0;
- if (l >= 3 && k == 0)
- continue;
if (t == PIVOT_NODE)
s = vp9_prob_diff_update_savings_search_model(
frame_branch_ct[i][j][k][l][0],
- old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+ old_frame_coef_probs[i][j][k][l], &newp, upd);
else
s = vp9_prob_diff_update_savings_search(
frame_branch_ct[i][j][k][l][t],
@@ -786,10 +581,6 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
if (s > 0 && newp != *oldp)
u = 1;
vp9_write(bc, u, upd);
-#ifdef ENTROPY_STATS
- if (!cpi->dummy_packing)
- ++tree_update_hist[tx_size][i][j][k][l][t][u];
-#endif
if (u) {
/* send/use new probability */
vp9_write_prob_diff_update(bc, newp, *oldp);
@@ -806,25 +597,23 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
case 1:
case 2: {
const int prev_coef_contexts_to_update =
- (cpi->sf.use_fast_coef_updates == 2 ?
- PREV_COEF_CONTEXTS >> 1 : PREV_COEF_CONTEXTS);
+ cpi->sf.use_fast_coef_updates == 2 ? COEFF_CONTEXTS >> 1
+ : COEFF_CONTEXTS;
const int coef_band_to_update =
- (cpi->sf.use_fast_coef_updates == 2 ?
- COEF_BANDS >> 1 : COEF_BANDS);
+ cpi->sf.use_fast_coef_updates == 2 ? COEF_BANDS >> 1
+ : COEF_BANDS;
int updates = 0;
int noupdates_before_first = 0;
- for (i = 0; i < BLOCK_TYPES; ++i) {
+ for (i = 0; i < PLANE_TYPES; ++i) {
for (j = 0; j < REF_TYPES; ++j) {
for (k = 0; k < COEF_BANDS; ++k) {
- for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
// calc probs and branch cts for this frame only
for (t = 0; t < entropy_nodes_update; ++t) {
vp9_prob newp = new_frame_coef_probs[i][j][k][l][t];
vp9_prob *oldp = old_frame_coef_probs[i][j][k][l] + t;
int s;
int u = 0;
- if (l >= 3 && k == 0)
- continue;
if (l >= prev_coef_contexts_to_update ||
k >= coef_band_to_update) {
u = 0;
@@ -832,7 +621,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
if (t == PIVOT_NODE)
s = vp9_prob_diff_update_savings_search_model(
frame_branch_ct[i][j][k][l][0],
- old_frame_coef_probs[i][j][k][l], &newp, upd, i, j);
+ old_frame_coef_probs[i][j][k][l], &newp, upd);
else
s = vp9_prob_diff_update_savings_search(
frame_branch_ct[i][j][k][l][t],
@@ -843,10 +632,6 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
updates += u;
if (u == 0 && updates == 0) {
noupdates_before_first++;
-#ifdef ENTROPY_STATS
- if (!cpi->dummy_packing)
- ++tree_update_hist[tx_size][i][j][k][l][t][u];
-#endif
continue;
}
if (u == 1 && updates == 1) {
@@ -857,10 +642,6 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
vp9_write(bc, 0, upd);
}
vp9_write(bc, u, upd);
-#ifdef ENTROPY_STATS
- if (!cpi->dummy_packing)
- ++tree_update_hist[tx_size][i][j][k][l][t][u];
-#endif
if (u) {
/* send/use new probability */
vp9_write_prob_diff_update(bc, newp, *oldp);
@@ -882,25 +663,17 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
}
}
-static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
+static void update_coef_probs(VP9_COMP *cpi, vp9_writer* w) {
const TX_MODE tx_mode = cpi->common.tx_mode;
-
+ const TX_SIZE max_tx_size = tx_mode_to_biggest_tx_size[tx_mode];
+ TX_SIZE tx_size;
vp9_clear_system_state();
- // Build the cofficient contexts based on counts collected in encode loop
- build_coeff_contexts(cpi);
-
- update_coef_probs_common(bc, cpi, TX_4X4);
-
- // do not do this if not even allowed
- if (tx_mode > ONLY_4X4)
- update_coef_probs_common(bc, cpi, TX_8X8);
-
- if (tx_mode > ALLOW_8X8)
- update_coef_probs_common(bc, cpi, TX_16X16);
+ for (tx_size = TX_4X4; tx_size <= TX_32X32; ++tx_size)
+ build_tree_distribution(cpi, tx_size);
- if (tx_mode > ALLOW_16X16)
- update_coef_probs_common(bc, cpi, TX_32X32);
+ for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size)
+ update_coef_probs_common(w, cpi, tx_size);
}
static void encode_loopfilter(struct loopfilter *lf,
@@ -916,38 +689,27 @@ static void encode_loopfilter(struct loopfilter *lf,
vp9_wb_write_bit(wb, lf->mode_ref_delta_enabled);
if (lf->mode_ref_delta_enabled) {
- // Do the deltas need to be updated
vp9_wb_write_bit(wb, lf->mode_ref_delta_update);
if (lf->mode_ref_delta_update) {
- // Send update
for (i = 0; i < MAX_REF_LF_DELTAS; i++) {
const int delta = lf->ref_deltas[i];
-
- // Frame level data
- if (delta != lf->last_ref_deltas[i]) {
+ const int changed = delta != lf->last_ref_deltas[i];
+ vp9_wb_write_bit(wb, changed);
+ if (changed) {
lf->last_ref_deltas[i] = delta;
- vp9_wb_write_bit(wb, 1);
-
- assert(delta != 0);
vp9_wb_write_literal(wb, abs(delta) & 0x3F, 6);
vp9_wb_write_bit(wb, delta < 0);
- } else {
- vp9_wb_write_bit(wb, 0);
}
}
- // Send update
for (i = 0; i < MAX_MODE_LF_DELTAS; i++) {
const int delta = lf->mode_deltas[i];
- if (delta != lf->last_mode_deltas[i]) {
+ const int changed = delta != lf->last_mode_deltas[i];
+ vp9_wb_write_bit(wb, changed);
+ if (changed) {
lf->last_mode_deltas[i] = delta;
- vp9_wb_write_bit(wb, 1);
-
- assert(delta != 0);
vp9_wb_write_literal(wb, abs(delta) & 0x3F, 6);
vp9_wb_write_bit(wb, delta < 0);
- } else {
- vp9_wb_write_bit(wb, 0);
}
}
}
@@ -1024,10 +786,10 @@ static void encode_segmentation(VP9_COMP *cpi,
const int data_max = vp9_seg_feature_data_max(j);
if (vp9_is_segfeature_signed(j)) {
- vp9_encode_unsigned_max(wb, abs(data), data_max);
+ encode_unsigned_max(wb, abs(data), data_max);
vp9_wb_write_bit(wb, data < 0);
} else {
- vp9_encode_unsigned_max(wb, data, data_max);
+ encode_unsigned_max(wb, data, data_max);
}
}
}
@@ -1036,9 +798,7 @@ static void encode_segmentation(VP9_COMP *cpi,
}
-static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) {
- VP9_COMMON *const cm = &cpi->common;
-
+static void encode_txfm_probs(VP9_COMMON *cm, vp9_writer *w) {
// Mode
vp9_write_literal(w, MIN(cm->tx_mode, ALLOW_32X32), 2);
if (cm->tx_mode >= ALLOW_32X32)
@@ -1071,26 +831,20 @@ static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) {
vp9_cond_prob_diff_update(w, &cm->fc.tx_probs.p32x32[i][j],
ct_32x32p[j]);
}
-#ifdef MODE_STATS
- if (!cpi->dummy_packing)
- update_tx_count_stats(cm);
-#endif
}
}
-static void write_interp_filter_type(INTERPOLATION_TYPE type,
- struct vp9_write_bit_buffer *wb) {
- const int type_to_literal[] = { 1, 0, 2, 3 };
+static void write_interp_filter(INTERP_FILTER filter,
+ struct vp9_write_bit_buffer *wb) {
+ const int filter_to_literal[] = { 1, 0, 2, 3 };
- vp9_wb_write_bit(wb, type == SWITCHABLE);
- if (type != SWITCHABLE)
- vp9_wb_write_literal(wb, type_to_literal[type], 2);
+ vp9_wb_write_bit(wb, filter == SWITCHABLE);
+ if (filter != SWITCHABLE)
+ vp9_wb_write_literal(wb, filter_to_literal[filter], 2);
}
-static void fix_mcomp_filter_type(VP9_COMP *cpi) {
- VP9_COMMON *const cm = &cpi->common;
-
- if (cm->mcomp_filter_type == SWITCHABLE) {
+static void fix_interp_filter(VP9_COMMON *cm) {
+ if (cm->interp_filter == SWITCHABLE) {
// Check to see if only one of the filters is actually used
int count[SWITCHABLE_FILTERS];
int i, j, c = 0;
@@ -1104,7 +858,7 @@ static void fix_mcomp_filter_type(VP9_COMP *cpi) {
// Only one filter is used. So set the filter at frame level
for (i = 0; i < SWITCHABLE_FILTERS; ++i) {
if (count[i]) {
- cm->mcomp_filter_type = i;
+ cm->interp_filter = i;
break;
}
}
@@ -1207,7 +961,7 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) {
vp9_stop_encode(&residual_bc);
if (tile_col < tile_cols - 1 || tile_row < tile_rows - 1) {
// size of this tile
- write_be32(data_ptr + total_size, residual_bc.pos);
+ mem_put_be32(data_ptr + total_size, residual_bc.pos);
total_size += 4;
}
@@ -1218,9 +972,8 @@ static size_t encode_tiles(VP9_COMP *cpi, uint8_t *data_ptr) {
return total_size;
}
-static void write_display_size(VP9_COMP *cpi, struct vp9_write_bit_buffer *wb) {
- VP9_COMMON *const cm = &cpi->common;
-
+static void write_display_size(const VP9_COMMON *cm,
+ struct vp9_write_bit_buffer *wb) {
const int scaling_active = cm->width != cm->display_width ||
cm->height != cm->display_height;
vp9_wb_write_bit(wb, scaling_active);
@@ -1230,24 +983,22 @@ static void write_display_size(VP9_COMP *cpi, struct vp9_write_bit_buffer *wb) {
}
}
-static void write_frame_size(VP9_COMP *cpi,
+static void write_frame_size(const VP9_COMMON *cm,
struct vp9_write_bit_buffer *wb) {
- VP9_COMMON *const cm = &cpi->common;
vp9_wb_write_literal(wb, cm->width - 1, 16);
vp9_wb_write_literal(wb, cm->height - 1, 16);
- write_display_size(cpi, wb);
+ write_display_size(cm, wb);
}
static void write_frame_size_with_refs(VP9_COMP *cpi,
struct vp9_write_bit_buffer *wb) {
VP9_COMMON *const cm = &cpi->common;
- int refs[ALLOWED_REFS_PER_FRAME] = {cpi->lst_fb_idx, cpi->gld_fb_idx,
- cpi->alt_fb_idx};
- int i, found = 0;
+ int found = 0;
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i) {
- YV12_BUFFER_CONFIG *cfg = &cm->yv12_fb[cm->ref_frame_map[refs[i]]];
+ MV_REFERENCE_FRAME ref_frame;
+ for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
+ YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi, ref_frame);
found = cm->width == cfg->y_crop_width &&
cm->height == cfg->y_crop_height;
@@ -1267,7 +1018,7 @@ static void write_frame_size_with_refs(VP9_COMP *cpi,
vp9_wb_write_literal(wb, cm->height - 1, 16);
}
- write_display_size(cpi, wb);
+ write_display_size(cm, wb);
}
static void write_sync_code(struct vp9_write_bit_buffer *wb) {
@@ -1309,10 +1060,8 @@ static void write_uncompressed_header(VP9_COMP *cpi,
vp9_wb_write_bit(wb, 0); // has extra plane
}
- write_frame_size(cpi, wb);
+ write_frame_size(cm, wb);
} else {
- const int refs[ALLOWED_REFS_PER_FRAME] = {cpi->lst_fb_idx, cpi->gld_fb_idx,
- cpi->alt_fb_idx};
if (!cm->show_frame)
vp9_wb_write_bit(wb, cm->intra_only);
@@ -1322,22 +1071,23 @@ static void write_uncompressed_header(VP9_COMP *cpi,
if (cm->intra_only) {
write_sync_code(wb);
- vp9_wb_write_literal(wb, get_refresh_mask(cpi), NUM_REF_FRAMES);
- write_frame_size(cpi, wb);
+ vp9_wb_write_literal(wb, get_refresh_mask(cpi), REF_FRAMES);
+ write_frame_size(cm, wb);
} else {
- int i;
- vp9_wb_write_literal(wb, get_refresh_mask(cpi), NUM_REF_FRAMES);
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i) {
- vp9_wb_write_literal(wb, refs[i], NUM_REF_FRAMES_LOG2);
- vp9_wb_write_bit(wb, cm->ref_frame_sign_bias[LAST_FRAME + i]);
+ MV_REFERENCE_FRAME ref_frame;
+ vp9_wb_write_literal(wb, get_refresh_mask(cpi), REF_FRAMES);
+ for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
+ vp9_wb_write_literal(wb, get_ref_frame_idx(cpi, ref_frame),
+ REF_FRAMES_LOG2);
+ vp9_wb_write_bit(wb, cm->ref_frame_sign_bias[ref_frame]);
}
write_frame_size_with_refs(cpi, wb);
vp9_wb_write_bit(wb, cm->allow_high_precision_mv);
- fix_mcomp_filter_type(cpi);
- write_interp_filter_type(cm->mcomp_filter_type, wb);
+ fix_interp_filter(cm);
+ write_interp_filter(cm->interp_filter, wb);
}
}
@@ -1346,7 +1096,7 @@ static void write_uncompressed_header(VP9_COMP *cpi,
vp9_wb_write_bit(wb, cm->frame_parallel_decoding_mode);
}
- vp9_wb_write_literal(wb, cm->frame_context_idx, NUM_FRAME_CONTEXTS_LOG2);
+ vp9_wb_write_literal(wb, cm->frame_context_idx, FRAME_CONTEXTS_LOG2);
encode_loopfilter(&cm->lf, wb);
encode_quantization(cm, wb);
@@ -1366,36 +1116,30 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
if (xd->lossless)
cm->tx_mode = ONLY_4X4;
else
- encode_txfm_probs(cpi, &header_bc);
+ encode_txfm_probs(cm, &header_bc);
update_coef_probs(cpi, &header_bc);
-
-#ifdef ENTROPY_STATS
- active_section = 2;
-#endif
-
- vp9_update_skip_probs(cpi, &header_bc);
+ update_skip_probs(cm, &header_bc);
if (!frame_is_intra_only(cm)) {
int i;
-#ifdef ENTROPY_STATS
- active_section = 1;
-#endif
- update_inter_mode_probs(cm, &header_bc);
+ for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
+ prob_diff_update(vp9_inter_mode_tree, cm->fc.inter_mode_probs[i],
+ cm->counts.inter_mode[i], INTER_MODES, &header_bc);
+
vp9_zero(cm->counts.inter_mode);
- if (cm->mcomp_filter_type == SWITCHABLE)
- update_switchable_interp_probs(cpi, &header_bc);
+ if (cm->interp_filter == SWITCHABLE)
+ update_switchable_interp_probs(cm, &header_bc);
for (i = 0; i < INTRA_INTER_CONTEXTS; i++)
vp9_cond_prob_diff_update(&header_bc, &fc->intra_inter_prob[i],
- cpi->intra_inter_count[i]);
+ cm->counts.intra_inter[i]);
if (cm->allow_comp_inter_inter) {
- const int comp_pred_mode = cpi->common.comp_pred_mode;
- const int use_compound_pred = comp_pred_mode != SINGLE_PREDICTION_ONLY;
- const int use_hybrid_pred = comp_pred_mode == HYBRID_PREDICTION;
+ const int use_compound_pred = cm->reference_mode != SINGLE_REFERENCE;
+ const int use_hybrid_pred = cm->reference_mode == REFERENCE_MODE_SELECT;
vp9_write_bit(&header_bc, use_compound_pred);
if (use_compound_pred) {
@@ -1403,34 +1147,33 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
if (use_hybrid_pred)
for (i = 0; i < COMP_INTER_CONTEXTS; i++)
vp9_cond_prob_diff_update(&header_bc, &fc->comp_inter_prob[i],
- cpi->comp_inter_count[i]);
+ cm->counts.comp_inter[i]);
}
}
- if (cm->comp_pred_mode != COMP_PREDICTION_ONLY) {
+ if (cm->reference_mode != COMPOUND_REFERENCE) {
for (i = 0; i < REF_CONTEXTS; i++) {
vp9_cond_prob_diff_update(&header_bc, &fc->single_ref_prob[i][0],
- cpi->single_ref_count[i][0]);
+ cm->counts.single_ref[i][0]);
vp9_cond_prob_diff_update(&header_bc, &fc->single_ref_prob[i][1],
- cpi->single_ref_count[i][1]);
+ cm->counts.single_ref[i][1]);
}
}
- if (cm->comp_pred_mode != SINGLE_PREDICTION_ONLY)
+ if (cm->reference_mode != SINGLE_REFERENCE)
for (i = 0; i < REF_CONTEXTS; i++)
vp9_cond_prob_diff_update(&header_bc, &fc->comp_ref_prob[i],
- cpi->comp_ref_count[i]);
+ cm->counts.comp_ref[i]);
- update_mbintra_mode_probs(cpi, &header_bc);
+ for (i = 0; i < BLOCK_SIZE_GROUPS; ++i)
+ prob_diff_update(vp9_intra_mode_tree, cm->fc.y_mode_prob[i],
+ cm->counts.y_mode[i], INTRA_MODES, &header_bc);
- for (i = 0; i < PARTITION_CONTEXTS; ++i) {
- unsigned int bct[PARTITION_TYPES - 1][2];
- update_mode(&header_bc, PARTITION_TYPES, vp9_partition_tree,
- fc->partition_prob[i], bct,
- (unsigned int *)cpi->partition_count[i]);
- }
+ for (i = 0; i < PARTITION_CONTEXTS; ++i)
+ prob_diff_update(vp9_partition_tree, fc->partition_prob[i],
+ cm->counts.partition[i], PARTITION_TYPES, &header_bc);
- vp9_write_nmv_probs(cpi, cm->allow_high_precision_mv, &header_bc);
+ vp9_write_nmv_probs(cm, cm->allow_high_precision_mv, &header_bc);
}
vp9_stop_encode(&header_bc);
@@ -1439,7 +1182,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
return header_bc.pos;
}
-void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
+void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size) {
uint8_t *data = dest;
size_t first_part_size;
struct vp9_write_bit_buffer wb = {data, 0};
@@ -1453,71 +1196,15 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) {
vp9_compute_update_table();
-#ifdef ENTROPY_STATS
- if (cm->frame_type == INTER_FRAME)
- active_section = 0;
- else
- active_section = 7;
-#endif
-
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
first_part_size = write_compressed_header(cpi, data);
data += first_part_size;
- vp9_wb_write_literal(&saved_wb, first_part_size, 16);
+ // TODO(jbb): Figure out what to do if first_part_size > 16 bits.
+ vp9_wb_write_literal(&saved_wb, (int)first_part_size, 16);
data += encode_tiles(cpi, data);
*size = data - dest;
}
-#ifdef ENTROPY_STATS
-static void print_tree_update_for_type(FILE *f,
- vp9_coeff_stats *tree_update_hist,
- int block_types, const char *header) {
- int i, j, k, l, m;
-
- fprintf(f, "const vp9_coeff_prob %s = {\n", header);
- for (i = 0; i < block_types; i++) {
- fprintf(f, " { \n");
- for (j = 0; j < REF_TYPES; j++) {
- fprintf(f, " { \n");
- for (k = 0; k < COEF_BANDS; k++) {
- fprintf(f, " {\n");
- for (l = 0; l < PREV_COEF_CONTEXTS; l++) {
- fprintf(f, " {");
- for (m = 0; m < ENTROPY_NODES; m++) {
- fprintf(f, "%3d, ",
- get_binary_prob(tree_update_hist[i][j][k][l][m][0],
- tree_update_hist[i][j][k][l][m][1]));
- }
- fprintf(f, "},\n");
- }
- fprintf(f, "},\n");
- }
- fprintf(f, " },\n");
- }
- fprintf(f, " },\n");
- }
- fprintf(f, "};\n");
-}
-
-void print_tree_update_probs() {
- FILE *f = fopen("coefupdprob.h", "w");
- fprintf(f, "\n/* Update probabilities for token entropy tree. */\n\n");
-
- print_tree_update_for_type(f, tree_update_hist[TX_4X4], BLOCK_TYPES,
- "vp9_coef_update_probs_4x4[BLOCK_TYPES]");
- print_tree_update_for_type(f, tree_update_hist[TX_8X8], BLOCK_TYPES,
- "vp9_coef_update_probs_8x8[BLOCK_TYPES]");
- print_tree_update_for_type(f, tree_update_hist[TX_16X16], BLOCK_TYPES,
- "vp9_coef_update_probs_16x16[BLOCK_TYPES]");
- print_tree_update_for_type(f, tree_update_hist[TX_32X32], BLOCK_TYPES,
- "vp9_coef_update_probs_32x32[BLOCK_TYPES]");
-
- fclose(f);
- f = fopen("treeupdate.bin", "wb");
- fwrite(tree_update_hist, sizeof(tree_update_hist), 1, f);
- fclose(f);
-}
-#endif
diff --git a/libvpx/vp9/encoder/vp9_bitstream.h b/libvpx/vp9/encoder/vp9_bitstream.h
index b3dbee1..ddfd0ed 100644
--- a/libvpx/vp9/encoder/vp9_bitstream.h
+++ b/libvpx/vp9/encoder/vp9_bitstream.h
@@ -12,6 +12,18 @@
#ifndef VP9_ENCODER_VP9_BITSTREAM_H_
#define VP9_ENCODER_VP9_BITSTREAM_H_
-void vp9_update_skip_probs(VP9_COMP *cpi, vp9_writer *bc);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct VP9_COMP;
+
+void vp9_entropy_mode_init();
+
+void vp9_pack_bitstream(struct VP9_COMP *cpi, uint8_t *dest, size_t *size);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_BITSTREAM_H_
diff --git a/libvpx/vp9/encoder/vp9_block.h b/libvpx/vp9/encoder/vp9_block.h
index 4445970..888984c 100644
--- a/libvpx/vp9/encoder/vp9_block.h
+++ b/libvpx/vp9/encoder/vp9_block.h
@@ -11,12 +11,15 @@
#ifndef VP9_ENCODER_VP9_BLOCK_H_
#define VP9_ENCODER_VP9_BLOCK_H_
-#include "vp9/common/vp9_onyx.h"
#include "vp9/common/vp9_entropymv.h"
#include "vp9/common/vp9_entropy.h"
#include "vpx_ports/mem.h"
#include "vp9/common/vp9_onyxc_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// motion search site
typedef struct {
MV mv;
@@ -41,12 +44,10 @@ typedef struct {
int is_coded;
int num_4x4_blk;
int skip;
- int_mv best_ref_mv;
- int_mv second_best_ref_mv;
+ int_mv best_ref_mv[2];
int_mv ref_mvs[MAX_REF_FRAMES][MAX_MV_REF_CANDIDATES];
int rate;
int distortion;
- int64_t intra_error;
int best_mode_index;
int rddiv;
int rdmult;
@@ -59,17 +60,14 @@ typedef struct {
// motion vector cache for adaptive motion search control in partition
// search loop
int_mv pred_mv[MAX_REF_FRAMES];
-
- // Bit flag for each mode whether it has high error in comparison to others.
- unsigned int modes_with_high_error;
-
- // Bit flag for each ref frame whether it has high error compared to others.
- unsigned int frames_with_high_error;
+ INTERP_FILTER pred_interp_filter;
} PICK_MODE_CONTEXT;
struct macroblock_plane {
DECLARE_ALIGNED(16, int16_t, src_diff[64 * 64]);
+ int16_t *qcoeff;
int16_t *coeff;
+ uint16_t *eobs;
struct buf_2d src;
// Quantizer setings
@@ -84,8 +82,8 @@ struct macroblock_plane {
/* The [2] dimension is for whether we skip the EOB node (i.e. if previous
* coefficient in this block was zero) or not. */
-typedef unsigned int vp9_coeff_cost[BLOCK_TYPES][REF_TYPES][COEF_BANDS][2]
- [PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS];
+typedef unsigned int vp9_coeff_cost[PLANE_TYPES][REF_TYPES][COEF_BANDS][2]
+ [COEFF_CONTEXTS][ENTROPY_TOKENS];
typedef struct macroblock MACROBLOCK;
struct macroblock {
@@ -115,6 +113,8 @@ struct macroblock {
int mv_best_ref_index[MAX_REF_FRAMES];
unsigned int max_mv_context[MAX_REF_FRAMES];
unsigned int source_variance;
+ unsigned int pred_sse[MAX_REF_FRAMES];
+ int pred_mv_sad[MAX_REF_FRAMES];
int nmvjointcost[MV_JOINTS];
int nmvcosts[2][MV_VALS];
@@ -130,9 +130,9 @@ struct macroblock {
int *nmvsadcost_hp[2];
int **mvsadcost;
- int mbmode_cost[MB_MODE_COUNT];
+ int mbmode_cost[INTRA_MODES];
unsigned inter_mode_cost[INTER_MODE_CONTEXTS][INTER_MODES];
- int intra_uv_mode_cost[2][MB_MODE_COUNT];
+ int intra_uv_mode_cost[FRAME_TYPES][INTRA_MODES];
int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES];
int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
@@ -153,7 +153,7 @@ struct macroblock {
int encode_breakout;
- unsigned char *active_ptr;
+ int in_active_map;
// note that token_costs is the cost when eob node is skipped
vp9_coeff_cost token_costs[TX_SIZES];
@@ -166,9 +166,7 @@ struct macroblock {
int skip_encode;
// Used to store sub partition's choices.
- int fast_ms;
int_mv pred_mv[MAX_REF_FRAMES];
- int subblock_ref;
// TODO(jingning): Need to refactor the structure arrays that buffers the
// coding mode decisions of each partition type.
@@ -233,23 +231,8 @@ static PICK_MODE_CONTEXT *get_block_context(MACROBLOCK *x, BLOCK_SIZE bsize) {
}
}
-struct rdcost_block_args {
- MACROBLOCK *x;
- ENTROPY_CONTEXT t_above[16];
- ENTROPY_CONTEXT t_left[16];
- TX_SIZE tx_size;
- int bw;
- int bh;
- int rate;
- int64_t dist;
- int64_t sse;
- int this_rate;
- int64_t this_dist;
- int64_t this_sse;
- int64_t this_rd;
- int64_t best_rd;
- int skip;
- const int16_t *scan, *nb;
-};
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_BLOCK_H_
diff --git a/libvpx/vp9/encoder/vp9_boolhuff.c b/libvpx/vp9/encoder/vp9_cost.c
index 32c136e..1c3c3d2 100644
--- a/libvpx/vp9/encoder/vp9_boolhuff.c
+++ b/libvpx/vp9/encoder/vp9_cost.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
@@ -8,18 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <assert.h>
-#include "vp9/encoder/vp9_boolhuff.h"
-#include "vp9/common/vp9_entropy.h"
-
-#if defined(SECTIONBITS_OUTPUT)
-unsigned __int64 Sectionbits[500];
-
-#endif
-
-#ifdef ENTROPY_STATS
-unsigned int active_section = 0;
-#endif
+#include "vp9/encoder/vp9_cost.h"
const unsigned int vp9_prob_cost[256] = {
2047, 2047, 1791, 1641, 1535, 1452, 1385, 1328, 1279, 1235, 1196, 1161,
@@ -45,24 +34,29 @@ const unsigned int vp9_prob_cost[256] = {
22, 21, 19, 18, 16, 15, 13, 12, 10, 9, 7, 6,
4, 3, 1, 1};
-void vp9_start_encode(vp9_writer *br, uint8_t *source) {
- br->lowvalue = 0;
- br->range = 255;
- br->value = 0;
- br->count = -24;
- br->buffer = source;
- br->pos = 0;
- vp9_write_bit(br, 0);
-}
+static void cost(int *costs, vp9_tree tree, const vp9_prob *probs,
+ int i, int c) {
+ const vp9_prob prob = probs[i / 2];
+ int b;
-void vp9_stop_encode(vp9_writer *br) {
- int i;
+ for (b = 0; b <= 1; ++b) {
+ const int cc = c + vp9_cost_bit(prob, b);
+ const vp9_tree_index ii = tree[i + b];
- for (i = 0; i < 32; i++)
- vp9_write_bit(br, 0);
+ if (ii <= 0)
+ costs[-ii] = cc;
+ else
+ cost(costs, tree, probs, ii, cc);
+ }
+}
- // Ensure there's no ambigous collision with any index marker bytes
- if ((br->buffer[br->pos - 1] & 0xe0) == 0xc0)
- br->buffer[br->pos++] = 0;
+void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree) {
+ cost(costs, tree, probs, 0, 0);
}
+void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree) {
+ assert(tree[0] <= 0 && tree[1] > 0);
+
+ costs[-tree[0]] = vp9_cost_bit(probs[0], 0);
+ cost(costs, tree, probs, 2, 0);
+}
diff --git a/libvpx/vp9/encoder/vp9_cost.h b/libvpx/vp9/encoder/vp9_cost.h
new file mode 100644
index 0000000..6d2b940
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_cost.h
@@ -0,0 +1,55 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_ENCODER_VP9_COST_H_
+#define VP9_ENCODER_VP9_COST_H_
+
+#include "vp9/common/vp9_prob.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const unsigned int vp9_prob_cost[256];
+
+#define vp9_cost_zero(prob) (vp9_prob_cost[prob])
+
+#define vp9_cost_one(prob) vp9_cost_zero(vp9_complement(prob))
+
+#define vp9_cost_bit(prob, bit) vp9_cost_zero((bit) ? vp9_complement(prob) \
+ : (prob))
+
+static INLINE unsigned int cost_branch256(const unsigned int ct[2],
+ vp9_prob p) {
+ return ct[0] * vp9_cost_zero(p) + ct[1] * vp9_cost_one(p);
+}
+
+static INLINE int treed_cost(vp9_tree tree, const vp9_prob *probs,
+ int bits, int len) {
+ int cost = 0;
+ vp9_tree_index i = 0;
+
+ do {
+ const int bit = (bits >> --len) & 1;
+ cost += vp9_cost_bit(probs[i >> 1], bit);
+ i = tree[i + bit];
+ } while (len);
+
+ return cost;
+}
+
+void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree);
+void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_COST_H_
diff --git a/libvpx/vp9/encoder/vp9_craq.c b/libvpx/vp9/encoder/vp9_craq.c
new file mode 100644
index 0000000..40437c7
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_craq.c
@@ -0,0 +1,267 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <limits.h>
+#include <math.h>
+
+#include "vp9/encoder/vp9_craq.h"
+
+#include "vp9/common/vp9_seg_common.h"
+
+#include "vp9/encoder/vp9_ratectrl.h"
+#include "vp9/encoder/vp9_rdopt.h"
+#include "vp9/encoder/vp9_segmentation.h"
+
+
+// Check if we should turn off cyclic refresh based on bitrate condition.
+static int apply_cyclic_refresh_bitrate(VP9_COMP *const cpi) {
+ // Turn off cyclic refresh if bits available per frame is not sufficiently
+ // larger than bit cost of segmentation. Segment map bit cost should scale
+ // with number of seg blocks, so compare available bits to number of blocks.
+ // Average bits available per frame = av_per_frame_bandwidth
+ // Number of (8x8) blocks in frame = mi_rows * mi_cols;
+ float factor = 0.5;
+ int number_blocks = cpi->common.mi_rows * cpi->common.mi_cols;
+ // The condition below corresponds to turning off at target bitrates:
+ // ~24kbps for CIF, 72kbps for VGA (at 30fps).
+ if (cpi->rc.av_per_frame_bandwidth < factor * number_blocks)
+ return 0;
+ else
+ return 1;
+}
+
+// Check if this coding block, of size bsize, should be considered for refresh
+// (lower-qp coding). Decision can be based on various factors, such as
+// size of the coding block (i.e., below min_block size rejected), coding
+// mode, and rate/distortion.
+static int candidate_refresh_aq(VP9_COMP *const cpi,
+ MODE_INFO *const mi,
+ int bsize,
+ int use_rd) {
+ CYCLIC_REFRESH *const cr = &cpi->cyclic_refresh;
+ if (use_rd) {
+ // If projected rate is below the thresh_rate (well below target,
+ // so undershoot expected), accept it for lower-qp coding.
+ if (cr->projected_rate_sb < cr->thresh_rate_sb)
+ return 1;
+ // Otherwise, reject the block for lower-qp coding if any of the following:
+ // 1) prediction block size is below min_block_size
+ // 2) mode is non-zero mv and projected distortion is above thresh_dist
+ // 3) mode is an intra-mode (we may want to allow some of this under
+ // another thresh_dist)
+ else if ((bsize < cr->min_block_size) ||
+ (mi->mbmi.mv[0].as_int != 0 &&
+ cr->projected_dist_sb > cr->thresh_dist_sb) ||
+ !is_inter_block(&mi->mbmi))
+ return 0;
+ else
+ return 1;
+ } else {
+ // Rate/distortion not used for update.
+ if ((bsize < cr->min_block_size) ||
+ (mi->mbmi.mv[0].as_int != 0) ||
+ !is_inter_block(&mi->mbmi))
+ return 0;
+ else
+ return 1;
+ }
+}
+
+// Prior to coding a given prediction block, of size bsize at (mi_row, mi_col),
+// check if we should reset the segment_id, and update the cyclic_refresh map
+// and segmentation map.
+void vp9_update_segment_aq(VP9_COMP *const cpi,
+ MODE_INFO *const mi,
+ int mi_row,
+ int mi_col,
+ int bsize,
+ int use_rd) {
+ CYCLIC_REFRESH *const cr = &cpi->cyclic_refresh;
+ VP9_COMMON *const cm = &cpi->common;
+ const int bw = num_8x8_blocks_wide_lookup[bsize];
+ const int bh = num_8x8_blocks_high_lookup[bsize];
+ const int xmis = MIN(cm->mi_cols - mi_col, bw);
+ const int ymis = MIN(cm->mi_rows - mi_row, bh);
+ const int block_index = mi_row * cm->mi_cols + mi_col;
+ // Default is to not update the refresh map.
+ int new_map_value = cr->map[block_index];
+ int x = 0; int y = 0;
+ int current_segment = mi->mbmi.segment_id;
+ int refresh_this_block = candidate_refresh_aq(cpi, mi, bsize, use_rd);
+ // Check if we should reset the segment_id for this block.
+ if (current_segment && !refresh_this_block)
+ mi->mbmi.segment_id = 0;
+
+ // Update the cyclic refresh map, to be used for setting segmentation map
+ // for the next frame. If the block will be refreshed this frame, mark it
+ // as clean. The magnitude of the -ve influences how long before we consider
+ // it for refresh again.
+ if (mi->mbmi.segment_id == 1) {
+ new_map_value = -cr->time_for_refresh;
+ } else if (refresh_this_block) {
+ // Else if it is accepted as candidate for refresh, and has not already
+ // been refreshed (marked as 1) then mark it as a candidate for cleanup
+ // for future time (marked as 0), otherwise don't update it.
+ if (cr->map[block_index] == 1)
+ new_map_value = 0;
+ } else {
+ // Leave it marked as block that is not candidate for refresh.
+ new_map_value = 1;
+ }
+ // Update entries in the cyclic refresh map with new_map_value, and
+ // copy mbmi->segment_id into global segmentation map.
+ for (y = 0; y < ymis; y++)
+ for (x = 0; x < xmis; x++) {
+ cr->map[block_index + y * cm->mi_cols + x] = new_map_value;
+ cpi->segmentation_map[block_index + y * cm->mi_cols + x] =
+ mi->mbmi.segment_id;
+ }
+ // Keep track of actual number (in units of 8x8) of blocks in segment 1 used
+ // for encoding this frame.
+ if (mi->mbmi.segment_id)
+ cr->num_seg_blocks += xmis * ymis;
+}
+
+// Setup cyclic background refresh: set delta q and segmentation map.
+void vp9_setup_cyclic_refresh_aq(VP9_COMP *const cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ CYCLIC_REFRESH *const cr = &cpi->cyclic_refresh;
+ struct segmentation *const seg = &cm->seg;
+ unsigned char *seg_map = cpi->segmentation_map;
+ int apply_cyclic_refresh = apply_cyclic_refresh_bitrate(cpi);
+ // Don't apply refresh on key frame or enhancement layer frames.
+ if (!apply_cyclic_refresh ||
+ (cpi->common.frame_type == KEY_FRAME) ||
+ (cpi->svc.temporal_layer_id > 0)) {
+ // Set segmentation map to 0 and disable.
+ vpx_memset(seg_map, 0, cm->mi_rows * cm->mi_cols);
+ vp9_disable_segmentation(&cm->seg);
+ if (cpi->common.frame_type == KEY_FRAME)
+ cr->mb_index = 0;
+ return;
+ } else {
+ int qindex_delta = 0;
+ int mbs_in_frame = cm->mi_rows * cm->mi_cols;
+ int i, x, y, block_count, bl_index, bl_index2;
+ int sum_map, new_value, mi_row, mi_col, xmis, ymis, qindex2;
+
+ // Rate target ratio to set q delta.
+ float rate_ratio_qdelta = 2.0;
+ vp9_clear_system_state();
+ // Some of these parameters may be set via codec-control function later.
+ cr->max_mbs_perframe = 10;
+ cr->max_qdelta_perc = 50;
+ cr->min_block_size = BLOCK_16X16;
+ cr->time_for_refresh = 1;
+ // Set rate threshold to some fraction of target (and scaled by 256).
+ cr->thresh_rate_sb = (cpi->rc.sb64_target_rate * 256) >> 2;
+ // Distortion threshold, quadratic in Q, scale factor to be adjusted.
+ cr->thresh_dist_sb = 8 * (int)(vp9_convert_qindex_to_q(cm->base_qindex) *
+ vp9_convert_qindex_to_q(cm->base_qindex));
+ if (cpi->sf.use_nonrd_pick_mode) {
+ // May want to be more conservative with thresholds in non-rd mode for now
+ // as rate/distortion are derived from model based on prediction residual.
+ cr->thresh_rate_sb = (cpi->rc.sb64_target_rate * 256) >> 3;
+ cr->thresh_dist_sb = 4 * (int)(vp9_convert_qindex_to_q(cm->base_qindex) *
+ vp9_convert_qindex_to_q(cm->base_qindex));
+ }
+
+ cr->num_seg_blocks = 0;
+ // Set up segmentation.
+ // Clear down the segment map.
+ vpx_memset(seg_map, 0, cm->mi_rows * cm->mi_cols);
+ vp9_enable_segmentation(&cm->seg);
+ vp9_clearall_segfeatures(seg);
+ // Select delta coding method.
+ seg->abs_delta = SEGMENT_DELTADATA;
+
+ // Note: setting temporal_update has no effect, as the seg-map coding method
+ // (temporal or spatial) is determined in vp9_choose_segmap_coding_method(),
+ // based on the coding cost of each method. For error_resilient mode on the
+ // last_frame_seg_map is set to 0, so if temporal coding is used, it is
+ // relative to 0 previous map.
+ // seg->temporal_update = 0;
+
+ // Segment 0 "Q" feature is disabled so it defaults to the baseline Q.
+ vp9_disable_segfeature(seg, 0, SEG_LVL_ALT_Q);
+ // Use segment 1 for in-frame Q adjustment.
+ vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_Q);
+
+ // Set the q delta for segment 1.
+ qindex_delta = vp9_compute_qdelta_by_rate(cpi,
+ cm->base_qindex,
+ rate_ratio_qdelta);
+ // TODO(marpan): Incorporate the actual-vs-target rate over/undershoot from
+ // previous encoded frame.
+ if ((-qindex_delta) > cr->max_qdelta_perc * cm->base_qindex / 100) {
+ qindex_delta = -cr->max_qdelta_perc * cm->base_qindex / 100;
+ }
+
+ // Compute rd-mult for segment 1.
+ qindex2 = clamp(cm->base_qindex + cm->y_dc_delta_q + qindex_delta, 0, MAXQ);
+ cr->rdmult = vp9_compute_rd_mult(cpi, qindex2);
+
+ vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, qindex_delta);
+ // Number of target macroblocks to get the q delta (segment 1).
+ block_count = cr->max_mbs_perframe * mbs_in_frame / 100;
+ // Set the segmentation map: cycle through the macroblocks, starting at
+ // cr->mb_index, and stopping when either block_count blocks have been found
+ // to be refreshed, or we have passed through whole frame.
+ // Note the setting of seg_map below is done in two steps (one over 8x8)
+ // and then another over SB, in order to keep the value constant over SB.
+ // TODO(marpan): Do this in one pass in SB order.
+ assert(cr->mb_index < mbs_in_frame);
+ i = cr->mb_index;
+ do {
+ // If the macroblock is as a candidate for clean up then mark it
+ // for possible boost/refresh (segment 1). The segment id may get reset to
+ // 0 later if the macroblock gets coded anything other than ZEROMV.
+ if (cr->map[i] == 0) {
+ seg_map[i] = 1;
+ block_count--;
+ } else if (cr->map[i] < 0) {
+ cr->map[i]++;
+ }
+ i++;
+ if (i == mbs_in_frame) {
+ i = 0;
+ }
+ } while (block_count && i != cr->mb_index);
+ cr->mb_index = i;
+ // Enforce constant segment map over superblock.
+ for (mi_row = 0; mi_row < cm->mi_rows; mi_row += MI_BLOCK_SIZE)
+ for (mi_col = 0; mi_col < cm->mi_cols; mi_col += MI_BLOCK_SIZE) {
+ bl_index = mi_row * cm->mi_cols + mi_col;
+ xmis = num_8x8_blocks_wide_lookup[BLOCK_64X64];
+ ymis = num_8x8_blocks_high_lookup[BLOCK_64X64];
+ xmis = MIN(cm->mi_cols - mi_col, xmis);
+ ymis = MIN(cm->mi_rows - mi_row, ymis);
+ sum_map = 0;
+ for (y = 0; y < ymis; y++)
+ for (x = 0; x < xmis; x++) {
+ bl_index2 = bl_index + y * cm->mi_cols + x;
+ sum_map += seg_map[bl_index2];
+ }
+ new_value = 0;
+ // If segment is partial over superblock, reset.
+ if (sum_map > 0 && sum_map < xmis * ymis) {
+ if (sum_map < xmis * ymis / 2)
+ new_value = 0;
+ else
+ new_value = 1;
+ for (y = 0; y < ymis; y++)
+ for (x = 0; x < xmis; x++) {
+ bl_index2 = bl_index + y * cm->mi_cols + x;
+ seg_map[bl_index2] = new_value;
+ }
+ }
+ }
+ }
+}
diff --git a/libvpx/vp9/encoder/vp9_craq.h b/libvpx/vp9/encoder/vp9_craq.h
new file mode 100644
index 0000000..1f81f3e
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_craq.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+
+#ifndef VP9_ENCODER_VP9_CRAQ_H_
+#define VP9_ENCODER_VP9_CRAQ_H_
+
+#include "vp9/encoder/vp9_onyx_int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Check if we should turn off cyclic refresh based on bitrate condition.
+static int apply_cyclic_refresh_bitrate(VP9_COMP *const cpi);
+
+// Check if this coding block, of size bsize, should be considered for refresh
+// (lower-qp coding).
+static int candidate_refresh_aq(VP9_COMP *const cpi,
+ MODE_INFO *const mi,
+ int bsize,
+ int use_rd);
+
+// Prior to coding a given prediction block, of size bsize at (mi_row, mi_col),
+// check if we should reset the segment_id, and update the cyclic_refresh map
+// and segmentation map.
+void vp9_update_segment_aq(VP9_COMP *const cpi,
+ MODE_INFO *const mi,
+ int mi_row,
+ int mi_col,
+ int bsize,
+ int use_rd);
+
+// Setup cyclic background refresh: set delta q and segmentation map.
+void vp9_setup_cyclic_refresh_aq(VP9_COMP *const cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_CRAQ_H_
diff --git a/libvpx/vp9/encoder/vp9_dct.c b/libvpx/vp9/encoder/vp9_dct.c
index 065992a..d523239 100644
--- a/libvpx/vp9/encoder/vp9_dct.c
+++ b/libvpx/vp9/encoder/vp9_dct.c
@@ -18,7 +18,11 @@
#include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_systemdependent.h"
-#include "vp9/encoder/vp9_dct.h"
+static INLINE int fdct_round_shift(int input) {
+ int rv = ROUND_POWER_OF_TWO(input, DCT_CONST_BITS);
+ assert(INT16_MIN <= rv && rv <= INT16_MAX);
+ return rv;
+}
static void fdct4(const int16_t *input, int16_t *output) {
int16_t step[4];
@@ -31,19 +35,19 @@ static void fdct4(const int16_t *input, int16_t *output) {
temp1 = (step[0] + step[1]) * cospi_16_64;
temp2 = (step[0] - step[1]) * cospi_16_64;
- output[0] = dct_const_round_shift(temp1);
- output[2] = dct_const_round_shift(temp2);
+ output[0] = fdct_round_shift(temp1);
+ output[2] = fdct_round_shift(temp2);
temp1 = step[2] * cospi_24_64 + step[3] * cospi_8_64;
temp2 = -step[2] * cospi_8_64 + step[3] * cospi_24_64;
- output[1] = dct_const_round_shift(temp1);
- output[3] = dct_const_round_shift(temp2);
+ output[1] = fdct_round_shift(temp1);
+ output[3] = fdct_round_shift(temp2);
}
void vp9_fdct4x4_c(const int16_t *input, int16_t *output, int stride) {
// The 2D transform is done with two passes which are actually pretty
// similar. In the first one, we transform the columns and transpose
// the results. In the second one, we transform the rows. To achieve that,
- // as the first pass results are transposed, we tranpose the columns (that
+ // as the first pass results are transposed, we transpose the columns (that
// is the transposed rows) and transpose the results (so that it goes back
// in normal/row positions).
int pass;
@@ -80,12 +84,12 @@ void vp9_fdct4x4_c(const int16_t *input, int16_t *output, int stride) {
step[3] = input[0] - input[3];
temp1 = (step[0] + step[1]) * cospi_16_64;
temp2 = (step[0] - step[1]) * cospi_16_64;
- out[0] = dct_const_round_shift(temp1);
- out[2] = dct_const_round_shift(temp2);
+ out[0] = fdct_round_shift(temp1);
+ out[2] = fdct_round_shift(temp2);
temp1 = step[2] * cospi_24_64 + step[3] * cospi_8_64;
temp2 = -step[2] * cospi_8_64 + step[3] * cospi_24_64;
- out[1] = dct_const_round_shift(temp1);
- out[3] = dct_const_round_shift(temp2);
+ out[1] = fdct_round_shift(temp1);
+ out[3] = fdct_round_shift(temp2);
// Do next column (which is a transposed row in second/horizontal pass)
in++;
out += 4;
@@ -138,10 +142,10 @@ static void fadst4(const int16_t *input, int16_t *output) {
s3 = x2 - x0 + x3;
// 1-D transform scaling factor is sqrt(2).
- output[0] = dct_const_round_shift(s0);
- output[1] = dct_const_round_shift(s1);
- output[2] = dct_const_round_shift(s2);
- output[3] = dct_const_round_shift(s3);
+ output[0] = fdct_round_shift(s0);
+ output[1] = fdct_round_shift(s1);
+ output[2] = fdct_round_shift(s2);
+ output[3] = fdct_round_shift(s3);
}
static const transform_2d FHT_4[] = {
@@ -151,32 +155,36 @@ static const transform_2d FHT_4[] = {
{ fadst4, fadst4 } // ADST_ADST = 3
};
-void vp9_short_fht4x4_c(const int16_t *input, int16_t *output,
- int stride, int tx_type) {
- int16_t out[4 * 4];
- int16_t *outptr = &out[0];
- int i, j;
- int16_t temp_in[4], temp_out[4];
- const transform_2d ht = FHT_4[tx_type];
+void vp9_fht4x4_c(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
+ if (tx_type == DCT_DCT) {
+ vp9_fdct4x4_c(input, output, stride);
+ } else {
+ int16_t out[4 * 4];
+ int16_t *outptr = &out[0];
+ int i, j;
+ int16_t temp_in[4], temp_out[4];
+ const transform_2d ht = FHT_4[tx_type];
- // Columns
- for (i = 0; i < 4; ++i) {
- for (j = 0; j < 4; ++j)
- temp_in[j] = input[j * stride + i] * 16;
- if (i == 0 && temp_in[0])
- temp_in[0] += 1;
- ht.cols(temp_in, temp_out);
- for (j = 0; j < 4; ++j)
- outptr[j * 4 + i] = temp_out[j];
- }
+ // Columns
+ for (i = 0; i < 4; ++i) {
+ for (j = 0; j < 4; ++j)
+ temp_in[j] = input[j * stride + i] * 16;
+ if (i == 0 && temp_in[0])
+ temp_in[0] += 1;
+ ht.cols(temp_in, temp_out);
+ for (j = 0; j < 4; ++j)
+ outptr[j * 4 + i] = temp_out[j];
+ }
- // Rows
- for (i = 0; i < 4; ++i) {
- for (j = 0; j < 4; ++j)
- temp_in[j] = out[j + i * 4];
- ht.rows(temp_in, temp_out);
- for (j = 0; j < 4; ++j)
- output[j + i * 4] = (temp_out[j] + 1) >> 2;
+ // Rows
+ for (i = 0; i < 4; ++i) {
+ for (j = 0; j < 4; ++j)
+ temp_in[j] = out[j + i * 4];
+ ht.rows(temp_in, temp_out);
+ for (j = 0; j < 4; ++j)
+ output[j + i * 4] = (temp_out[j] + 1) >> 2;
+ }
}
}
@@ -204,16 +212,16 @@ static void fdct8(const int16_t *input, int16_t *output) {
t1 = (x0 - x1) * cospi_16_64;
t2 = x2 * cospi_24_64 + x3 * cospi_8_64;
t3 = -x2 * cospi_8_64 + x3 * cospi_24_64;
- output[0] = dct_const_round_shift(t0);
- output[2] = dct_const_round_shift(t2);
- output[4] = dct_const_round_shift(t1);
- output[6] = dct_const_round_shift(t3);
+ output[0] = fdct_round_shift(t0);
+ output[2] = fdct_round_shift(t2);
+ output[4] = fdct_round_shift(t1);
+ output[6] = fdct_round_shift(t3);
// Stage 2
t0 = (s6 - s5) * cospi_16_64;
t1 = (s6 + s5) * cospi_16_64;
- t2 = dct_const_round_shift(t0);
- t3 = dct_const_round_shift(t1);
+ t2 = fdct_round_shift(t0);
+ t3 = fdct_round_shift(t1);
// Stage 3
x0 = s4 + t2;
@@ -226,10 +234,10 @@ static void fdct8(const int16_t *input, int16_t *output) {
t1 = x1 * cospi_12_64 + x2 * cospi_20_64;
t2 = x2 * cospi_12_64 + x1 * -cospi_20_64;
t3 = x3 * cospi_28_64 + x0 * -cospi_4_64;
- output[1] = dct_const_round_shift(t0);
- output[3] = dct_const_round_shift(t2);
- output[5] = dct_const_round_shift(t1);
- output[7] = dct_const_round_shift(t3);
+ output[1] = fdct_round_shift(t0);
+ output[3] = fdct_round_shift(t2);
+ output[5] = fdct_round_shift(t1);
+ output[7] = fdct_round_shift(t3);
}
void vp9_fdct8x8_c(const int16_t *input, int16_t *final_output, int stride) {
@@ -264,16 +272,16 @@ void vp9_fdct8x8_c(const int16_t *input, int16_t *final_output, int stride) {
t1 = (x0 - x1) * cospi_16_64;
t2 = x2 * cospi_24_64 + x3 * cospi_8_64;
t3 = -x2 * cospi_8_64 + x3 * cospi_24_64;
- output[0 * 8] = dct_const_round_shift(t0);
- output[2 * 8] = dct_const_round_shift(t2);
- output[4 * 8] = dct_const_round_shift(t1);
- output[6 * 8] = dct_const_round_shift(t3);
+ output[0 * 8] = fdct_round_shift(t0);
+ output[2 * 8] = fdct_round_shift(t2);
+ output[4 * 8] = fdct_round_shift(t1);
+ output[6 * 8] = fdct_round_shift(t3);
// Stage 2
t0 = (s6 - s5) * cospi_16_64;
t1 = (s6 + s5) * cospi_16_64;
- t2 = dct_const_round_shift(t0);
- t3 = dct_const_round_shift(t1);
+ t2 = fdct_round_shift(t0);
+ t3 = fdct_round_shift(t1);
// Stage 3
x0 = s4 + t2;
@@ -286,10 +294,10 @@ void vp9_fdct8x8_c(const int16_t *input, int16_t *final_output, int stride) {
t1 = x1 * cospi_12_64 + x2 * cospi_20_64;
t2 = x2 * cospi_12_64 + x1 * -cospi_20_64;
t3 = x3 * cospi_28_64 + x0 * -cospi_4_64;
- output[1 * 8] = dct_const_round_shift(t0);
- output[3 * 8] = dct_const_round_shift(t2);
- output[5 * 8] = dct_const_round_shift(t1);
- output[7 * 8] = dct_const_round_shift(t3);
+ output[1 * 8] = fdct_round_shift(t0);
+ output[3 * 8] = fdct_round_shift(t2);
+ output[5 * 8] = fdct_round_shift(t1);
+ output[7 * 8] = fdct_round_shift(t3);
input++;
output++;
}
@@ -307,7 +315,7 @@ void vp9_fdct16x16_c(const int16_t *input, int16_t *output, int stride) {
// The 2D transform is done with two passes which are actually pretty
// similar. In the first one, we transform the columns and transpose
// the results. In the second one, we transform the rows. To achieve that,
- // as the first pass results are transposed, we tranpose the columns (that
+ // as the first pass results are transposed, we transpose the columns (that
// is the transposed rows) and transpose the results (so that it goes back
// in normal/row positions).
int pass;
@@ -388,16 +396,16 @@ void vp9_fdct16x16_c(const int16_t *input, int16_t *output, int stride) {
t1 = (x0 - x1) * cospi_16_64;
t2 = x3 * cospi_8_64 + x2 * cospi_24_64;
t3 = x3 * cospi_24_64 - x2 * cospi_8_64;
- out[0] = dct_const_round_shift(t0);
- out[4] = dct_const_round_shift(t2);
- out[8] = dct_const_round_shift(t1);
- out[12] = dct_const_round_shift(t3);
+ out[0] = fdct_round_shift(t0);
+ out[4] = fdct_round_shift(t2);
+ out[8] = fdct_round_shift(t1);
+ out[12] = fdct_round_shift(t3);
// Stage 2
t0 = (s6 - s5) * cospi_16_64;
t1 = (s6 + s5) * cospi_16_64;
- t2 = dct_const_round_shift(t0);
- t3 = dct_const_round_shift(t1);
+ t2 = fdct_round_shift(t0);
+ t3 = fdct_round_shift(t1);
// Stage 3
x0 = s4 + t2;
@@ -410,22 +418,22 @@ void vp9_fdct16x16_c(const int16_t *input, int16_t *output, int stride) {
t1 = x1 * cospi_12_64 + x2 * cospi_20_64;
t2 = x2 * cospi_12_64 + x1 * -cospi_20_64;
t3 = x3 * cospi_28_64 + x0 * -cospi_4_64;
- out[2] = dct_const_round_shift(t0);
- out[6] = dct_const_round_shift(t2);
- out[10] = dct_const_round_shift(t1);
- out[14] = dct_const_round_shift(t3);
+ out[2] = fdct_round_shift(t0);
+ out[6] = fdct_round_shift(t2);
+ out[10] = fdct_round_shift(t1);
+ out[14] = fdct_round_shift(t3);
}
// Work on the next eight values; step1 -> odd_results
{
// step 2
temp1 = (step1[5] - step1[2]) * cospi_16_64;
temp2 = (step1[4] - step1[3]) * cospi_16_64;
- step2[2] = dct_const_round_shift(temp1);
- step2[3] = dct_const_round_shift(temp2);
+ step2[2] = fdct_round_shift(temp1);
+ step2[3] = fdct_round_shift(temp2);
temp1 = (step1[4] + step1[3]) * cospi_16_64;
temp2 = (step1[5] + step1[2]) * cospi_16_64;
- step2[4] = dct_const_round_shift(temp1);
- step2[5] = dct_const_round_shift(temp2);
+ step2[4] = fdct_round_shift(temp1);
+ step2[5] = fdct_round_shift(temp2);
// step 3
step3[0] = step1[0] + step2[3];
step3[1] = step1[1] + step2[2];
@@ -438,12 +446,12 @@ void vp9_fdct16x16_c(const int16_t *input, int16_t *output, int stride) {
// step 4
temp1 = step3[1] * -cospi_8_64 + step3[6] * cospi_24_64;
temp2 = step3[2] * -cospi_24_64 - step3[5] * cospi_8_64;
- step2[1] = dct_const_round_shift(temp1);
- step2[2] = dct_const_round_shift(temp2);
+ step2[1] = fdct_round_shift(temp1);
+ step2[2] = fdct_round_shift(temp2);
temp1 = step3[2] * -cospi_8_64 + step3[5] * cospi_24_64;
temp2 = step3[1] * cospi_24_64 + step3[6] * cospi_8_64;
- step2[5] = dct_const_round_shift(temp1);
- step2[6] = dct_const_round_shift(temp2);
+ step2[5] = fdct_round_shift(temp1);
+ step2[6] = fdct_round_shift(temp2);
// step 5
step1[0] = step3[0] + step2[1];
step1[1] = step3[0] - step2[1];
@@ -456,20 +464,20 @@ void vp9_fdct16x16_c(const int16_t *input, int16_t *output, int stride) {
// step 6
temp1 = step1[0] * cospi_30_64 + step1[7] * cospi_2_64;
temp2 = step1[1] * cospi_14_64 + step1[6] * cospi_18_64;
- out[1] = dct_const_round_shift(temp1);
- out[9] = dct_const_round_shift(temp2);
+ out[1] = fdct_round_shift(temp1);
+ out[9] = fdct_round_shift(temp2);
temp1 = step1[2] * cospi_22_64 + step1[5] * cospi_10_64;
temp2 = step1[3] * cospi_6_64 + step1[4] * cospi_26_64;
- out[5] = dct_const_round_shift(temp1);
- out[13] = dct_const_round_shift(temp2);
+ out[5] = fdct_round_shift(temp1);
+ out[13] = fdct_round_shift(temp2);
temp1 = step1[3] * -cospi_26_64 + step1[4] * cospi_6_64;
temp2 = step1[2] * -cospi_10_64 + step1[5] * cospi_22_64;
- out[3] = dct_const_round_shift(temp1);
- out[11] = dct_const_round_shift(temp2);
+ out[3] = fdct_round_shift(temp1);
+ out[11] = fdct_round_shift(temp2);
temp1 = step1[1] * -cospi_18_64 + step1[6] * cospi_14_64;
temp2 = step1[0] * -cospi_2_64 + step1[7] * cospi_30_64;
- out[7] = dct_const_round_shift(temp1);
- out[15] = dct_const_round_shift(temp2);
+ out[7] = fdct_round_shift(temp1);
+ out[15] = fdct_round_shift(temp2);
}
// Do next column (which is a transposed row in second/horizontal pass)
in++;
@@ -503,14 +511,14 @@ static void fadst8(const int16_t *input, int16_t *output) {
s6 = cospi_26_64 * x6 + cospi_6_64 * x7;
s7 = cospi_6_64 * x6 - cospi_26_64 * x7;
- x0 = dct_const_round_shift(s0 + s4);
- x1 = dct_const_round_shift(s1 + s5);
- x2 = dct_const_round_shift(s2 + s6);
- x3 = dct_const_round_shift(s3 + s7);
- x4 = dct_const_round_shift(s0 - s4);
- x5 = dct_const_round_shift(s1 - s5);
- x6 = dct_const_round_shift(s2 - s6);
- x7 = dct_const_round_shift(s3 - s7);
+ x0 = fdct_round_shift(s0 + s4);
+ x1 = fdct_round_shift(s1 + s5);
+ x2 = fdct_round_shift(s2 + s6);
+ x3 = fdct_round_shift(s3 + s7);
+ x4 = fdct_round_shift(s0 - s4);
+ x5 = fdct_round_shift(s1 - s5);
+ x6 = fdct_round_shift(s2 - s6);
+ x7 = fdct_round_shift(s3 - s7);
// stage 2
s0 = x0;
@@ -526,10 +534,10 @@ static void fadst8(const int16_t *input, int16_t *output) {
x1 = s1 + s3;
x2 = s0 - s2;
x3 = s1 - s3;
- x4 = dct_const_round_shift(s4 + s6);
- x5 = dct_const_round_shift(s5 + s7);
- x6 = dct_const_round_shift(s4 - s6);
- x7 = dct_const_round_shift(s5 - s7);
+ x4 = fdct_round_shift(s4 + s6);
+ x5 = fdct_round_shift(s5 + s7);
+ x6 = fdct_round_shift(s4 - s6);
+ x7 = fdct_round_shift(s5 - s7);
// stage 3
s2 = cospi_16_64 * (x2 + x3);
@@ -537,10 +545,10 @@ static void fadst8(const int16_t *input, int16_t *output) {
s6 = cospi_16_64 * (x6 + x7);
s7 = cospi_16_64 * (x6 - x7);
- x2 = dct_const_round_shift(s2);
- x3 = dct_const_round_shift(s3);
- x6 = dct_const_round_shift(s6);
- x7 = dct_const_round_shift(s7);
+ x2 = fdct_round_shift(s2);
+ x3 = fdct_round_shift(s3);
+ x6 = fdct_round_shift(s6);
+ x7 = fdct_round_shift(s7);
output[0] = x0;
output[1] = - x4;
@@ -559,30 +567,34 @@ static const transform_2d FHT_8[] = {
{ fadst8, fadst8 } // ADST_ADST = 3
};
-void vp9_short_fht8x8_c(const int16_t *input, int16_t *output,
- int stride, int tx_type) {
- int16_t out[64];
- int16_t *outptr = &out[0];
- int i, j;
- int16_t temp_in[8], temp_out[8];
- const transform_2d ht = FHT_8[tx_type];
-
- // Columns
- for (i = 0; i < 8; ++i) {
- for (j = 0; j < 8; ++j)
- temp_in[j] = input[j * stride + i] * 4;
- ht.cols(temp_in, temp_out);
- for (j = 0; j < 8; ++j)
- outptr[j * 8 + i] = temp_out[j];
- }
+void vp9_fht8x8_c(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
+ if (tx_type == DCT_DCT) {
+ vp9_fdct8x8_c(input, output, stride);
+ } else {
+ int16_t out[64];
+ int16_t *outptr = &out[0];
+ int i, j;
+ int16_t temp_in[8], temp_out[8];
+ const transform_2d ht = FHT_8[tx_type];
+
+ // Columns
+ for (i = 0; i < 8; ++i) {
+ for (j = 0; j < 8; ++j)
+ temp_in[j] = input[j * stride + i] * 4;
+ ht.cols(temp_in, temp_out);
+ for (j = 0; j < 8; ++j)
+ outptr[j * 8 + i] = temp_out[j];
+ }
- // Rows
- for (i = 0; i < 8; ++i) {
- for (j = 0; j < 8; ++j)
- temp_in[j] = out[j + i * 8];
- ht.rows(temp_in, temp_out);
- for (j = 0; j < 8; ++j)
- output[j + i * 8] = (temp_out[j] + (temp_out[j] < 0)) >> 1;
+ // Rows
+ for (i = 0; i < 8; ++i) {
+ for (j = 0; j < 8; ++j)
+ temp_in[j] = out[j + i * 8];
+ ht.rows(temp_in, temp_out);
+ for (j = 0; j < 8; ++j)
+ output[j + i * 8] = (temp_out[j] + (temp_out[j] < 0)) >> 1;
+ }
}
}
@@ -693,16 +705,16 @@ static void fdct16(const int16_t in[16], int16_t out[16]) {
t1 = (x0 - x1) * cospi_16_64;
t2 = x3 * cospi_8_64 + x2 * cospi_24_64;
t3 = x3 * cospi_24_64 - x2 * cospi_8_64;
- out[0] = dct_const_round_shift(t0);
- out[4] = dct_const_round_shift(t2);
- out[8] = dct_const_round_shift(t1);
- out[12] = dct_const_round_shift(t3);
+ out[0] = fdct_round_shift(t0);
+ out[4] = fdct_round_shift(t2);
+ out[8] = fdct_round_shift(t1);
+ out[12] = fdct_round_shift(t3);
// Stage 2
t0 = (s6 - s5) * cospi_16_64;
t1 = (s6 + s5) * cospi_16_64;
- t2 = dct_const_round_shift(t0);
- t3 = dct_const_round_shift(t1);
+ t2 = fdct_round_shift(t0);
+ t3 = fdct_round_shift(t1);
// Stage 3
x0 = s4 + t2;
@@ -715,21 +727,21 @@ static void fdct16(const int16_t in[16], int16_t out[16]) {
t1 = x1 * cospi_12_64 + x2 * cospi_20_64;
t2 = x2 * cospi_12_64 + x1 * -cospi_20_64;
t3 = x3 * cospi_28_64 + x0 * -cospi_4_64;
- out[2] = dct_const_round_shift(t0);
- out[6] = dct_const_round_shift(t2);
- out[10] = dct_const_round_shift(t1);
- out[14] = dct_const_round_shift(t3);
+ out[2] = fdct_round_shift(t0);
+ out[6] = fdct_round_shift(t2);
+ out[10] = fdct_round_shift(t1);
+ out[14] = fdct_round_shift(t3);
}
// step 2
temp1 = (step1[5] - step1[2]) * cospi_16_64;
temp2 = (step1[4] - step1[3]) * cospi_16_64;
- step2[2] = dct_const_round_shift(temp1);
- step2[3] = dct_const_round_shift(temp2);
+ step2[2] = fdct_round_shift(temp1);
+ step2[3] = fdct_round_shift(temp2);
temp1 = (step1[4] + step1[3]) * cospi_16_64;
temp2 = (step1[5] + step1[2]) * cospi_16_64;
- step2[4] = dct_const_round_shift(temp1);
- step2[5] = dct_const_round_shift(temp2);
+ step2[4] = fdct_round_shift(temp1);
+ step2[5] = fdct_round_shift(temp2);
// step 3
step3[0] = step1[0] + step2[3];
@@ -744,12 +756,12 @@ static void fdct16(const int16_t in[16], int16_t out[16]) {
// step 4
temp1 = step3[1] * -cospi_8_64 + step3[6] * cospi_24_64;
temp2 = step3[2] * -cospi_24_64 - step3[5] * cospi_8_64;
- step2[1] = dct_const_round_shift(temp1);
- step2[2] = dct_const_round_shift(temp2);
+ step2[1] = fdct_round_shift(temp1);
+ step2[2] = fdct_round_shift(temp2);
temp1 = step3[2] * -cospi_8_64 + step3[5] * cospi_24_64;
temp2 = step3[1] * cospi_24_64 + step3[6] * cospi_8_64;
- step2[5] = dct_const_round_shift(temp1);
- step2[6] = dct_const_round_shift(temp2);
+ step2[5] = fdct_round_shift(temp1);
+ step2[6] = fdct_round_shift(temp2);
// step 5
step1[0] = step3[0] + step2[1];
@@ -764,23 +776,23 @@ static void fdct16(const int16_t in[16], int16_t out[16]) {
// step 6
temp1 = step1[0] * cospi_30_64 + step1[7] * cospi_2_64;
temp2 = step1[1] * cospi_14_64 + step1[6] * cospi_18_64;
- out[1] = dct_const_round_shift(temp1);
- out[9] = dct_const_round_shift(temp2);
+ out[1] = fdct_round_shift(temp1);
+ out[9] = fdct_round_shift(temp2);
temp1 = step1[2] * cospi_22_64 + step1[5] * cospi_10_64;
temp2 = step1[3] * cospi_6_64 + step1[4] * cospi_26_64;
- out[5] = dct_const_round_shift(temp1);
- out[13] = dct_const_round_shift(temp2);
+ out[5] = fdct_round_shift(temp1);
+ out[13] = fdct_round_shift(temp2);
temp1 = step1[3] * -cospi_26_64 + step1[4] * cospi_6_64;
temp2 = step1[2] * -cospi_10_64 + step1[5] * cospi_22_64;
- out[3] = dct_const_round_shift(temp1);
- out[11] = dct_const_round_shift(temp2);
+ out[3] = fdct_round_shift(temp1);
+ out[11] = fdct_round_shift(temp2);
temp1 = step1[1] * -cospi_18_64 + step1[6] * cospi_14_64;
temp2 = step1[0] * -cospi_2_64 + step1[7] * cospi_30_64;
- out[7] = dct_const_round_shift(temp1);
- out[15] = dct_const_round_shift(temp2);
+ out[7] = fdct_round_shift(temp1);
+ out[15] = fdct_round_shift(temp2);
}
static void fadst16(const int16_t *input, int16_t *output) {
@@ -821,22 +833,22 @@ static void fadst16(const int16_t *input, int16_t *output) {
s14 = x14 * cospi_29_64 + x15 * cospi_3_64;
s15 = x14 * cospi_3_64 - x15 * cospi_29_64;
- x0 = dct_const_round_shift(s0 + s8);
- x1 = dct_const_round_shift(s1 + s9);
- x2 = dct_const_round_shift(s2 + s10);
- x3 = dct_const_round_shift(s3 + s11);
- x4 = dct_const_round_shift(s4 + s12);
- x5 = dct_const_round_shift(s5 + s13);
- x6 = dct_const_round_shift(s6 + s14);
- x7 = dct_const_round_shift(s7 + s15);
- x8 = dct_const_round_shift(s0 - s8);
- x9 = dct_const_round_shift(s1 - s9);
- x10 = dct_const_round_shift(s2 - s10);
- x11 = dct_const_round_shift(s3 - s11);
- x12 = dct_const_round_shift(s4 - s12);
- x13 = dct_const_round_shift(s5 - s13);
- x14 = dct_const_round_shift(s6 - s14);
- x15 = dct_const_round_shift(s7 - s15);
+ x0 = fdct_round_shift(s0 + s8);
+ x1 = fdct_round_shift(s1 + s9);
+ x2 = fdct_round_shift(s2 + s10);
+ x3 = fdct_round_shift(s3 + s11);
+ x4 = fdct_round_shift(s4 + s12);
+ x5 = fdct_round_shift(s5 + s13);
+ x6 = fdct_round_shift(s6 + s14);
+ x7 = fdct_round_shift(s7 + s15);
+ x8 = fdct_round_shift(s0 - s8);
+ x9 = fdct_round_shift(s1 - s9);
+ x10 = fdct_round_shift(s2 - s10);
+ x11 = fdct_round_shift(s3 - s11);
+ x12 = fdct_round_shift(s4 - s12);
+ x13 = fdct_round_shift(s5 - s13);
+ x14 = fdct_round_shift(s6 - s14);
+ x15 = fdct_round_shift(s7 - s15);
// stage 2
s0 = x0;
@@ -864,14 +876,14 @@ static void fadst16(const int16_t *input, int16_t *output) {
x5 = s1 - s5;
x6 = s2 - s6;
x7 = s3 - s7;
- x8 = dct_const_round_shift(s8 + s12);
- x9 = dct_const_round_shift(s9 + s13);
- x10 = dct_const_round_shift(s10 + s14);
- x11 = dct_const_round_shift(s11 + s15);
- x12 = dct_const_round_shift(s8 - s12);
- x13 = dct_const_round_shift(s9 - s13);
- x14 = dct_const_round_shift(s10 - s14);
- x15 = dct_const_round_shift(s11 - s15);
+ x8 = fdct_round_shift(s8 + s12);
+ x9 = fdct_round_shift(s9 + s13);
+ x10 = fdct_round_shift(s10 + s14);
+ x11 = fdct_round_shift(s11 + s15);
+ x12 = fdct_round_shift(s8 - s12);
+ x13 = fdct_round_shift(s9 - s13);
+ x14 = fdct_round_shift(s10 - s14);
+ x15 = fdct_round_shift(s11 - s15);
// stage 3
s0 = x0;
@@ -895,18 +907,18 @@ static void fadst16(const int16_t *input, int16_t *output) {
x1 = s1 + s3;
x2 = s0 - s2;
x3 = s1 - s3;
- x4 = dct_const_round_shift(s4 + s6);
- x5 = dct_const_round_shift(s5 + s7);
- x6 = dct_const_round_shift(s4 - s6);
- x7 = dct_const_round_shift(s5 - s7);
+ x4 = fdct_round_shift(s4 + s6);
+ x5 = fdct_round_shift(s5 + s7);
+ x6 = fdct_round_shift(s4 - s6);
+ x7 = fdct_round_shift(s5 - s7);
x8 = s8 + s10;
x9 = s9 + s11;
x10 = s8 - s10;
x11 = s9 - s11;
- x12 = dct_const_round_shift(s12 + s14);
- x13 = dct_const_round_shift(s13 + s15);
- x14 = dct_const_round_shift(s12 - s14);
- x15 = dct_const_round_shift(s13 - s15);
+ x12 = fdct_round_shift(s12 + s14);
+ x13 = fdct_round_shift(s13 + s15);
+ x14 = fdct_round_shift(s12 - s14);
+ x15 = fdct_round_shift(s13 - s15);
// stage 4
s2 = (- cospi_16_64) * (x2 + x3);
@@ -918,14 +930,14 @@ static void fadst16(const int16_t *input, int16_t *output) {
s14 = (- cospi_16_64) * (x14 + x15);
s15 = cospi_16_64 * (x14 - x15);
- x2 = dct_const_round_shift(s2);
- x3 = dct_const_round_shift(s3);
- x6 = dct_const_round_shift(s6);
- x7 = dct_const_round_shift(s7);
- x10 = dct_const_round_shift(s10);
- x11 = dct_const_round_shift(s11);
- x14 = dct_const_round_shift(s14);
- x15 = dct_const_round_shift(s15);
+ x2 = fdct_round_shift(s2);
+ x3 = fdct_round_shift(s3);
+ x6 = fdct_round_shift(s6);
+ x7 = fdct_round_shift(s7);
+ x10 = fdct_round_shift(s10);
+ x11 = fdct_round_shift(s11);
+ x14 = fdct_round_shift(s14);
+ x15 = fdct_round_shift(s15);
output[0] = x0;
output[1] = - x8;
@@ -952,31 +964,34 @@ static const transform_2d FHT_16[] = {
{ fadst16, fadst16 } // ADST_ADST = 3
};
-void vp9_short_fht16x16_c(const int16_t *input, int16_t *output,
- int stride, int tx_type) {
- int16_t out[256];
- int16_t *outptr = &out[0];
- int i, j;
- int16_t temp_in[16], temp_out[16];
- const transform_2d ht = FHT_16[tx_type];
-
- // Columns
- for (i = 0; i < 16; ++i) {
- for (j = 0; j < 16; ++j)
- temp_in[j] = input[j * stride + i] * 4;
- ht.cols(temp_in, temp_out);
- for (j = 0; j < 16; ++j)
- outptr[j * 16 + i] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2;
-// outptr[j * 16 + i] = (temp_out[j] + 1 + (temp_out[j] > 0)) >> 2;
- }
+void vp9_fht16x16_c(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
+ if (tx_type == DCT_DCT) {
+ vp9_fdct16x16_c(input, output, stride);
+ } else {
+ int16_t out[256];
+ int16_t *outptr = &out[0];
+ int i, j;
+ int16_t temp_in[16], temp_out[16];
+ const transform_2d ht = FHT_16[tx_type];
+
+ // Columns
+ for (i = 0; i < 16; ++i) {
+ for (j = 0; j < 16; ++j)
+ temp_in[j] = input[j * stride + i] * 4;
+ ht.cols(temp_in, temp_out);
+ for (j = 0; j < 16; ++j)
+ outptr[j * 16 + i] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2;
+ }
- // Rows
- for (i = 0; i < 16; ++i) {
- for (j = 0; j < 16; ++j)
- temp_in[j] = out[j + i * 16];
- ht.rows(temp_in, temp_out);
- for (j = 0; j < 16; ++j)
- output[j + i * 16] = temp_out[j];
+ // Rows
+ for (i = 0; i < 16; ++i) {
+ for (j = 0; j < 16; ++j)
+ temp_in[j] = out[j + i * 16];
+ ht.rows(temp_in, temp_out);
+ for (j = 0; j < 16; ++j)
+ output[j + i * 16] = temp_out[j];
+ }
}
}
@@ -991,7 +1006,7 @@ static INLINE int half_round_shift(int input) {
return rv;
}
-static void dct32_1d(const int *input, int *output, int round) {
+static void fdct32(const int *input, int *output, int round) {
int step[32];
// Stage 1
step[0] = input[0] + input[(32 - 1)];
@@ -1323,7 +1338,7 @@ void vp9_fdct32x32_c(const int16_t *input, int16_t *out, int stride) {
int temp_in[32], temp_out[32];
for (j = 0; j < 32; ++j)
temp_in[j] = input[j * stride + i] * 4;
- dct32_1d(temp_in, temp_out, 0);
+ fdct32(temp_in, temp_out, 0);
for (j = 0; j < 32; ++j)
output[j * 32 + i] = (temp_out[j] + 1 + (temp_out[j] > 0)) >> 2;
}
@@ -1333,13 +1348,13 @@ void vp9_fdct32x32_c(const int16_t *input, int16_t *out, int stride) {
int temp_in[32], temp_out[32];
for (j = 0; j < 32; ++j)
temp_in[j] = output[j + i * 32];
- dct32_1d(temp_in, temp_out, 0);
+ fdct32(temp_in, temp_out, 0);
for (j = 0; j < 32; ++j)
out[j + i * 32] = (temp_out[j] + 1 + (temp_out[j] < 0)) >> 2;
}
}
-// Note that although we use dct_32_round in dct32_1d computation flow,
+// Note that although we use dct_32_round in dct32 computation flow,
// this 2d fdct32x32 for rate-distortion optimization loop is operating
// within 16 bits precision.
void vp9_fdct32x32_rd_c(const int16_t *input, int16_t *out, int stride) {
@@ -1351,7 +1366,7 @@ void vp9_fdct32x32_rd_c(const int16_t *input, int16_t *out, int stride) {
int temp_in[32], temp_out[32];
for (j = 0; j < 32; ++j)
temp_in[j] = input[j * stride + i] * 4;
- dct32_1d(temp_in, temp_out, 0);
+ fdct32(temp_in, temp_out, 0);
for (j = 0; j < 32; ++j)
// TODO(cd): see quality impact of only doing
// output[j * 32 + i] = (temp_out[j] + 1) >> 2;
@@ -1364,32 +1379,8 @@ void vp9_fdct32x32_rd_c(const int16_t *input, int16_t *out, int stride) {
int temp_in[32], temp_out[32];
for (j = 0; j < 32; ++j)
temp_in[j] = output[j + i * 32];
- dct32_1d(temp_in, temp_out, 1);
+ fdct32(temp_in, temp_out, 1);
for (j = 0; j < 32; ++j)
out[j + i * 32] = temp_out[j];
}
}
-
-void vp9_fht4x4(TX_TYPE tx_type, const int16_t *input, int16_t *output,
- int stride) {
- if (tx_type == DCT_DCT)
- vp9_fdct4x4(input, output, stride);
- else
- vp9_short_fht4x4(input, output, stride, tx_type);
-}
-
-void vp9_fht8x8(TX_TYPE tx_type, const int16_t *input, int16_t *output,
- int stride) {
- if (tx_type == DCT_DCT)
- vp9_fdct8x8(input, output, stride);
- else
- vp9_short_fht8x8(input, output, stride, tx_type);
-}
-
-void vp9_fht16x16(TX_TYPE tx_type, const int16_t *input, int16_t *output,
- int stride) {
- if (tx_type == DCT_DCT)
- vp9_fdct16x16(input, output, stride);
- else
- vp9_short_fht16x16(input, output, stride, tx_type);
-}
diff --git a/libvpx/vp9/encoder/vp9_encodeframe.c b/libvpx/vp9/encoder/vp9_encodeframe.c
index 3e75f3b..2f6c33d 100644
--- a/libvpx/vp9/encoder/vp9_encodeframe.c
+++ b/libvpx/vp9/encoder/vp9_encodeframe.c
@@ -20,8 +20,6 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
-#include "vp9/common/vp9_extend.h"
-#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_idct.h"
#include "vp9/common/vp9_mvref_common.h"
#include "vp9/common/vp9_pred_common.h"
@@ -29,26 +27,25 @@
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_seg_common.h"
+#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_tile_common.h"
+
#include "vp9/encoder/vp9_encodeframe.h"
-#include "vp9/encoder/vp9_encodeintra.h"
#include "vp9/encoder/vp9_encodemb.h"
#include "vp9/encoder/vp9_encodemv.h"
-#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_extend.h"
+#include "vp9/encoder/vp9_pickmode.h"
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_segmentation.h"
-#include "vp9/common/vp9_systemdependent.h"
#include "vp9/encoder/vp9_tokenize.h"
#include "vp9/encoder/vp9_vaq.h"
+#include "vp9/encoder/vp9_craq.h"
-
-#define DBG_PRNT_SEGMAP 0
-
-
-// #define ENC_DEBUG
-#ifdef ENC_DEBUG
-int enc_debug = 0;
-#endif
+#define GF_ZEROMV_ZBIN_BOOST 0
+#define LF_ZEROMV_ZBIN_BOOST 0
+#define MV_ZBIN_BOOST 0
+#define SPLIT_MV_ZBIN_BOOST 0
+#define INTRA_ZBIN_BOOST 0
static INLINE uint8_t *get_sb_index(MACROBLOCK *x, BLOCK_SIZE subsize) {
switch (subsize) {
@@ -80,21 +77,19 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x);
-/* activity_avg must be positive, or flat regions could get a zero weight
- * (infinite lambda), which confounds analysis.
- * This also avoids the need for divide by zero checks in
- * vp9_activity_masking().
- */
-#define ACTIVITY_AVG_MIN (64)
+// activity_avg must be positive, or flat regions could get a zero weight
+// (infinite lambda), which confounds analysis.
+// This also avoids the need for divide by zero checks in
+// vp9_activity_masking().
+#define ACTIVITY_AVG_MIN 64
-/* Motion vector component magnitude threshold for defining fast motion. */
-#define FAST_MOTION_MV_THRESH (24)
+// Motion vector component magnitude threshold for defining fast motion.
+#define FAST_MOTION_MV_THRESH 24
-/* This is used as a reference when computing the source variance for the
- * purposes of activity masking.
- * Eventually this should be replaced by custom no-reference routines,
- * which will be faster.
- */
+// This is used as a reference when computing the source variance for the
+// purposes of activity masking.
+// Eventually this should be replaced by custom no-reference routines,
+// which will be faster.
static const uint8_t VP9_VAR_OFFS[64] = {
128, 128, 128, 128, 128, 128, 128, 128,
128, 128, 128, 128, 128, 128, 128, 128,
@@ -106,36 +101,514 @@ static const uint8_t VP9_VAR_OFFS[64] = {
128, 128, 128, 128, 128, 128, 128, 128
};
-static unsigned int get_sby_perpixel_variance(VP9_COMP *cpi, MACROBLOCK *x,
+static unsigned int get_sby_perpixel_variance(VP9_COMP *cpi,
+ MACROBLOCK *x,
BLOCK_SIZE bs) {
unsigned int var, sse;
+ var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf, x->plane[0].src.stride,
+ VP9_VAR_OFFS, 0, &sse);
+ return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
+}
+
+static unsigned int get_sby_perpixel_diff_variance(VP9_COMP *cpi,
+ MACROBLOCK *x,
+ int mi_row,
+ int mi_col,
+ BLOCK_SIZE bs) {
+ const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, LAST_FRAME);
+ int offset = (mi_row * MI_SIZE) * yv12->y_stride + (mi_col * MI_SIZE);
+ unsigned int var, sse;
var = cpi->fn_ptr[bs].vf(x->plane[0].src.buf,
x->plane[0].src.stride,
- VP9_VAR_OFFS, 0, &sse);
- return (var + (1 << (num_pels_log2_lookup[bs] - 1))) >>
- num_pels_log2_lookup[bs];
+ yv12->y_buffer + offset,
+ yv12->y_stride,
+ &sse);
+ return ROUND_POWER_OF_TWO(var, num_pels_log2_lookup[bs]);
+}
+
+static BLOCK_SIZE get_rd_var_based_fixed_partition(VP9_COMP *cpi,
+ int mi_row,
+ int mi_col) {
+ unsigned int var = get_sby_perpixel_diff_variance(cpi, &cpi->mb,
+ mi_row, mi_col,
+ BLOCK_64X64);
+ if (var < 8)
+ return BLOCK_64X64;
+ else if (var < 128)
+ return BLOCK_32X32;
+ else if (var < 2048)
+ return BLOCK_16X16;
+ else
+ return BLOCK_8X8;
+}
+
+static BLOCK_SIZE get_nonrd_var_based_fixed_partition(VP9_COMP *cpi,
+ int mi_row,
+ int mi_col) {
+ unsigned int var = get_sby_perpixel_diff_variance(cpi, &cpi->mb,
+ mi_row, mi_col,
+ BLOCK_64X64);
+ if (var < 4)
+ return BLOCK_64X64;
+ else if (var < 10)
+ return BLOCK_32X32;
+ else
+ return BLOCK_16X16;
+}
+
+// Lighter version of set_offsets that only sets the mode info
+// pointers.
+static INLINE void set_modeinfo_offsets(VP9_COMMON *const cm,
+ MACROBLOCKD *const xd,
+ int mi_row,
+ int mi_col) {
+ const int idx_str = xd->mode_info_stride * mi_row + mi_col;
+ xd->mi_8x8 = cm->mi_grid_visible + idx_str;
+ xd->prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
+ xd->mi_8x8[0] = cm->mi + idx_str;
+}
+
+static int is_block_in_mb_map(VP9_COMP *cpi, int mi_row, int mi_col,
+ BLOCK_SIZE bsize) {
+ VP9_COMMON *const cm = &cpi->common;
+ const int mb_rows = cm->mb_rows;
+ const int mb_cols = cm->mb_cols;
+ const int mb_row = mi_row >> 1;
+ const int mb_col = mi_col >> 1;
+ const int mb_width = num_8x8_blocks_wide_lookup[bsize] >> 1;
+ const int mb_height = num_8x8_blocks_high_lookup[bsize] >> 1;
+ int r, c;
+ if (bsize <= BLOCK_16X16) {
+ return cpi->active_map[mb_row * mb_cols + mb_col];
+ }
+ for (r = 0; r < mb_height; ++r) {
+ for (c = 0; c < mb_width; ++c) {
+ int row = mb_row + r;
+ int col = mb_col + c;
+ if (row >= mb_rows || col >= mb_cols)
+ continue;
+ if (cpi->active_map[row * mb_cols + col])
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
+ int mi_row, int mi_col, BLOCK_SIZE bsize) {
+ MACROBLOCK *const x = &cpi->mb;
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCKD *const xd = &x->e_mbd;
+ MB_MODE_INFO *mbmi;
+ const int mi_width = num_8x8_blocks_wide_lookup[bsize];
+ const int mi_height = num_8x8_blocks_high_lookup[bsize];
+ const int mb_row = mi_row >> 1;
+ const int mb_col = mi_col >> 1;
+ const int idx_map = mb_row * cm->mb_cols + mb_col;
+ const struct segmentation *const seg = &cm->seg;
+
+ set_skip_context(xd, cpi->above_context, cpi->left_context, mi_row, mi_col);
+
+ // Activity map pointer
+ x->mb_activity_ptr = &cpi->mb_activity_map[idx_map];
+
+ if (cpi->active_map_enabled && !x->e_mbd.lossless) {
+ x->in_active_map = is_block_in_mb_map(cpi, mi_row, mi_col, bsize);
+ } else {
+ x->in_active_map = 1;
+ }
+
+ set_modeinfo_offsets(cm, xd, mi_row, mi_col);
+
+ mbmi = &xd->mi_8x8[0]->mbmi;
+
+ // Set up destination pointers.
+ vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), mi_row, mi_col);
+
+ // Set up limit values for MV components.
+ // Mv beyond the range do not produce new/different prediction block.
+ x->mv_row_min = -(((mi_row + mi_height) * MI_SIZE) + VP9_INTERP_EXTEND);
+ x->mv_col_min = -(((mi_col + mi_width) * MI_SIZE) + VP9_INTERP_EXTEND);
+ x->mv_row_max = (cm->mi_rows - mi_row) * MI_SIZE + VP9_INTERP_EXTEND;
+ x->mv_col_max = (cm->mi_cols - mi_col) * MI_SIZE + VP9_INTERP_EXTEND;
+
+ // Set up distance of MB to edge of frame in 1/8th pel units.
+ assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1)));
+ set_mi_row_col(xd, tile, mi_row, mi_height, mi_col, mi_width,
+ cm->mi_rows, cm->mi_cols);
+
+ // Set up source buffers.
+ vp9_setup_src_planes(x, cpi->Source, mi_row, mi_col);
+
+ // R/D setup.
+ x->rddiv = cpi->RDDIV;
+ x->rdmult = cpi->RDMULT;
+
+ // Setup segment ID.
+ if (seg->enabled) {
+ if (cpi->oxcf.aq_mode != VARIANCE_AQ) {
+ const uint8_t *const map = seg->update_map ? cpi->segmentation_map
+ : cm->last_frame_seg_map;
+ mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col);
+ }
+ vp9_init_plane_quantizers(cpi, x);
+
+ if (seg->enabled && cpi->seg0_cnt > 0 &&
+ !vp9_segfeature_active(seg, 0, SEG_LVL_REF_FRAME) &&
+ vp9_segfeature_active(seg, 1, SEG_LVL_REF_FRAME)) {
+ cpi->seg0_progress = (cpi->seg0_idx << 16) / cpi->seg0_cnt;
+ } else {
+ const int y = mb_row & ~3;
+ const int x = mb_col & ~3;
+ const int p16 = ((mb_row & 1) << 1) + (mb_col & 1);
+ const int p32 = ((mb_row & 2) << 2) + ((mb_col & 2) << 1);
+ const int tile_progress = tile->mi_col_start * cm->mb_rows >> 1;
+ const int mb_cols = (tile->mi_col_end - tile->mi_col_start) >> 1;
+
+ cpi->seg0_progress = ((y * mb_cols + x * 4 + p32 + p16 + tile_progress)
+ << 16) / cm->MBs;
+ }
+
+ x->encode_breakout = cpi->segment_encode_breakout[mbmi->segment_id];
+ } else {
+ mbmi->segment_id = 0;
+ x->encode_breakout = cpi->encode_breakout;
+ }
+}
+
+static void duplicate_modeinfo_in_sb(VP9_COMMON * const cm,
+ MACROBLOCKD *const xd,
+ int mi_row,
+ int mi_col,
+ BLOCK_SIZE bsize) {
+ const int block_width = num_8x8_blocks_wide_lookup[bsize];
+ const int block_height = num_8x8_blocks_high_lookup[bsize];
+ const int mis = xd->mode_info_stride;
+ int i, j;
+ for (j = 0; j < block_height; ++j)
+ for (i = 0; i < block_width; ++i) {
+ if (mi_row + j < cm->mi_rows && mi_col + i < cm->mi_cols)
+ xd->mi_8x8[j * mis + i] = xd->mi_8x8[0];
+ }
+}
+
+static void set_block_size(VP9_COMP * const cpi,
+ const TileInfo *const tile,
+ int mi_row, int mi_col,
+ BLOCK_SIZE bsize) {
+ if (cpi->common.mi_cols > mi_col && cpi->common.mi_rows > mi_row) {
+ MACROBLOCKD *const xd = &cpi->mb.e_mbd;
+ set_modeinfo_offsets(&cpi->common, xd, mi_row, mi_col);
+ xd->mi_8x8[0]->mbmi.sb_type = bsize;
+ duplicate_modeinfo_in_sb(&cpi->common, xd, mi_row, mi_col, bsize);
+ }
+}
+
+typedef struct {
+ int64_t sum_square_error;
+ int64_t sum_error;
+ int count;
+ int variance;
+} var;
+
+typedef struct {
+ var none;
+ var horz[2];
+ var vert[2];
+} partition_variance;
+
+typedef struct {
+ partition_variance part_variances;
+ var split[4];
+} v8x8;
+
+typedef struct {
+ partition_variance part_variances;
+ v8x8 split[4];
+} v16x16;
+
+typedef struct {
+ partition_variance part_variances;
+ v16x16 split[4];
+} v32x32;
+
+typedef struct {
+ partition_variance part_variances;
+ v32x32 split[4];
+} v64x64;
+
+typedef struct {
+ partition_variance *part_variances;
+ var *split[4];
+} variance_node;
+
+typedef enum {
+ V16X16,
+ V32X32,
+ V64X64,
+} TREE_LEVEL;
+
+static void tree_to_node(void *data, BLOCK_SIZE bsize, variance_node *node) {
+ int i;
+ switch (bsize) {
+ case BLOCK_64X64: {
+ v64x64 *vt = (v64x64 *) data;
+ node->part_variances = &vt->part_variances;
+ for (i = 0; i < 4; i++)
+ node->split[i] = &vt->split[i].part_variances.none;
+ break;
+ }
+ case BLOCK_32X32: {
+ v32x32 *vt = (v32x32 *) data;
+ node->part_variances = &vt->part_variances;
+ for (i = 0; i < 4; i++)
+ node->split[i] = &vt->split[i].part_variances.none;
+ break;
+ }
+ case BLOCK_16X16: {
+ v16x16 *vt = (v16x16 *) data;
+ node->part_variances = &vt->part_variances;
+ for (i = 0; i < 4; i++)
+ node->split[i] = &vt->split[i].part_variances.none;
+ break;
+ }
+ case BLOCK_8X8: {
+ v8x8 *vt = (v8x8 *) data;
+ node->part_variances = &vt->part_variances;
+ for (i = 0; i < 4; i++)
+ node->split[i] = &vt->split[i];
+ break;
+ }
+ default: {
+ assert(0);
+ }
+ }
+}
+
+// Set variance values given sum square error, sum error, count.
+static void fill_variance(int64_t s2, int64_t s, int c, var *v) {
+ v->sum_square_error = s2;
+ v->sum_error = s;
+ v->count = c;
+ if (c > 0)
+ v->variance = (int)(256 *
+ (v->sum_square_error - v->sum_error * v->sum_error /
+ v->count) / v->count);
+ else
+ v->variance = 0;
+}
+
+void sum_2_variances(const var *a, const var *b, var *r) {
+ fill_variance(a->sum_square_error + b->sum_square_error,
+ a->sum_error + b->sum_error, a->count + b->count, r);
+}
+
+static void fill_variance_tree(void *data, BLOCK_SIZE bsize) {
+ variance_node node;
+ tree_to_node(data, bsize, &node);
+ sum_2_variances(node.split[0], node.split[1], &node.part_variances->horz[0]);
+ sum_2_variances(node.split[2], node.split[3], &node.part_variances->horz[1]);
+ sum_2_variances(node.split[0], node.split[2], &node.part_variances->vert[0]);
+ sum_2_variances(node.split[1], node.split[3], &node.part_variances->vert[1]);
+ sum_2_variances(&node.part_variances->vert[0], &node.part_variances->vert[1],
+ &node.part_variances->none);
+}
+
+static int set_vt_partitioning(VP9_COMP *cpi,
+ void *data,
+ const TileInfo *const tile,
+ BLOCK_SIZE bsize,
+ int mi_row,
+ int mi_col,
+ int mi_size) {
+ VP9_COMMON * const cm = &cpi->common;
+ variance_node vt;
+ const int block_width = num_8x8_blocks_wide_lookup[bsize];
+ const int block_height = num_8x8_blocks_high_lookup[bsize];
+ // TODO(debargha): Choose this more intelligently.
+ const int64_t threshold_multiplier = 25;
+ int64_t threshold = threshold_multiplier * cpi->common.base_qindex;
+ assert(block_height == block_width);
+
+ tree_to_node(data, bsize, &vt);
+
+ // Split none is available only if we have more than half a block size
+ // in width and height inside the visible image.
+ if (mi_col + block_width / 2 < cm->mi_cols &&
+ mi_row + block_height / 2 < cm->mi_rows &&
+ vt.part_variances->none.variance < threshold) {
+ set_block_size(cpi, tile, mi_row, mi_col, bsize);
+ return 1;
+ }
+
+ // Vertical split is available on all but the bottom border.
+ if (mi_row + block_height / 2 < cm->mi_rows &&
+ vt.part_variances->vert[0].variance < threshold &&
+ vt.part_variances->vert[1].variance < threshold) {
+ BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_VERT);
+ set_block_size(cpi, tile, mi_row, mi_col, subsize);
+ set_block_size(cpi, tile, mi_row, mi_col + block_width / 2, subsize);
+ return 1;
+ }
+
+ // Horizontal split is available on all but the right border.
+ if (mi_col + block_width / 2 < cm->mi_cols &&
+ vt.part_variances->horz[0].variance < threshold &&
+ vt.part_variances->horz[1].variance < threshold) {
+ BLOCK_SIZE subsize = get_subsize(bsize, PARTITION_HORZ);
+ set_block_size(cpi, tile, mi_row, mi_col, subsize);
+ set_block_size(cpi, tile, mi_row + block_height / 2, mi_col, subsize);
+ return 1;
+ }
+ return 0;
+}
+
+// TODO(debargha): Fix this function and make it work as expected.
+static void choose_partitioning(VP9_COMP *cpi,
+ const TileInfo *const tile,
+ int mi_row, int mi_col) {
+ VP9_COMMON * const cm = &cpi->common;
+ MACROBLOCK *x = &cpi->mb;
+ MACROBLOCKD *xd = &cpi->mb.e_mbd;
+
+ int i, j, k;
+ v64x64 vt;
+ uint8_t *s;
+ const uint8_t *d;
+ int sp;
+ int dp;
+ int pixels_wide = 64, pixels_high = 64;
+ int_mv nearest_mv, near_mv;
+ const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, LAST_FRAME);
+ const struct scale_factors *const sf = &cm->frame_refs[LAST_FRAME - 1].sf;
+
+ vp9_zero(vt);
+ set_offsets(cpi, tile, mi_row, mi_col, BLOCK_64X64);
+
+ if (xd->mb_to_right_edge < 0)
+ pixels_wide += (xd->mb_to_right_edge >> 3);
+ if (xd->mb_to_bottom_edge < 0)
+ pixels_high += (xd->mb_to_bottom_edge >> 3);
+
+ s = x->plane[0].src.buf;
+ sp = x->plane[0].src.stride;
+
+ if (cm->frame_type != KEY_FRAME) {
+ vp9_setup_pre_planes(xd, 0, yv12, mi_row, mi_col, sf);
+
+ xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
+ xd->mi_8x8[0]->mbmi.sb_type = BLOCK_64X64;
+ vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv,
+ xd->mi_8x8[0]->mbmi.ref_mvs[LAST_FRAME],
+ &nearest_mv, &near_mv);
+
+ xd->mi_8x8[0]->mbmi.mv[0] = nearest_mv;
+ vp9_build_inter_predictors_sby(xd, mi_row, mi_col, BLOCK_64X64);
+
+ d = xd->plane[0].dst.buf;
+ dp = xd->plane[0].dst.stride;
+ } else {
+ d = VP9_VAR_OFFS;
+ dp = 0;
+ }
+
+ // Fill in the entire tree of 8x8 variances for splits.
+ for (i = 0; i < 4; i++) {
+ const int x32_idx = ((i & 1) << 5);
+ const int y32_idx = ((i >> 1) << 5);
+ for (j = 0; j < 4; j++) {
+ const int x16_idx = x32_idx + ((j & 1) << 4);
+ const int y16_idx = y32_idx + ((j >> 1) << 4);
+ v16x16 *vst = &vt.split[i].split[j];
+ for (k = 0; k < 4; k++) {
+ int x_idx = x16_idx + ((k & 1) << 3);
+ int y_idx = y16_idx + ((k >> 1) << 3);
+ unsigned int sse = 0;
+ int sum = 0;
+ if (x_idx < pixels_wide && y_idx < pixels_high)
+ vp9_get_sse_sum_8x8(s + y_idx * sp + x_idx, sp,
+ d + y_idx * dp + x_idx, dp, &sse, &sum);
+ fill_variance(sse, sum, 64, &vst->split[k].part_variances.none);
+ }
+ }
+ }
+ // Fill the rest of the variance tree by summing split partition values.
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ fill_variance_tree(&vt.split[i].split[j], BLOCK_16X16);
+ }
+ fill_variance_tree(&vt.split[i], BLOCK_32X32);
+ }
+ fill_variance_tree(&vt, BLOCK_64X64);
+
+ // Now go through the entire structure, splitting every block size until
+ // we get to one that's got a variance lower than our threshold, or we
+ // hit 8x8.
+ if (!set_vt_partitioning(cpi, &vt, tile, BLOCK_64X64,
+ mi_row, mi_col, 8)) {
+ for (i = 0; i < 4; ++i) {
+ const int x32_idx = ((i & 1) << 2);
+ const int y32_idx = ((i >> 1) << 2);
+ if (!set_vt_partitioning(cpi, &vt.split[i], tile, BLOCK_32X32,
+ (mi_row + y32_idx), (mi_col + x32_idx), 4)) {
+ for (j = 0; j < 4; ++j) {
+ const int x16_idx = ((j & 1) << 1);
+ const int y16_idx = ((j >> 1) << 1);
+ // NOTE: This is a temporary hack to disable 8x8 partitions,
+ // since it works really bad - possibly due to a bug
+#define DISABLE_8X8_VAR_BASED_PARTITION
+#ifdef DISABLE_8X8_VAR_BASED_PARTITION
+ if (mi_row + y32_idx + y16_idx + 1 < cm->mi_rows &&
+ mi_row + x32_idx + x16_idx + 1 < cm->mi_cols) {
+ set_block_size(cpi, tile,
+ (mi_row + y32_idx + y16_idx),
+ (mi_col + x32_idx + x16_idx),
+ BLOCK_16X16);
+ } else {
+ for (k = 0; k < 4; ++k) {
+ const int x8_idx = (k & 1);
+ const int y8_idx = (k >> 1);
+ set_block_size(cpi, tile,
+ (mi_row + y32_idx + y16_idx + y8_idx),
+ (mi_col + x32_idx + x16_idx + x8_idx),
+ BLOCK_8X8);
+ }
+ }
+#else
+ if (!set_vt_partitioning(cpi, &vt.split[i].split[j], tile,
+ BLOCK_16X16,
+ (mi_row + y32_idx + y16_idx),
+ (mi_col + x32_idx + x16_idx), 2)) {
+ for (k = 0; k < 4; ++k) {
+ const int x8_idx = (k & 1);
+ const int y8_idx = (k >> 1);
+ set_block_size(cpi, tile,
+ (mi_row + y32_idx + y16_idx + y8_idx),
+ (mi_col + x32_idx + x16_idx + x8_idx),
+ BLOCK_8X8);
+ }
+ }
+#endif
+ }
+ }
+ }
+ }
}
// Original activity measure from Tim T's code.
static unsigned int tt_activity_measure(MACROBLOCK *x) {
- unsigned int act;
unsigned int sse;
- /* TODO: This could also be done over smaller areas (8x8), but that would
- * require extensive changes elsewhere, as lambda is assumed to be fixed
- * over an entire MB in most of the code.
- * Another option is to compute four 8x8 variances, and pick a single
- * lambda using a non-linear combination (e.g., the smallest, or second
- * smallest, etc.).
- */
- act = vp9_variance16x16(x->plane[0].src.buf, x->plane[0].src.stride,
- VP9_VAR_OFFS, 0, &sse);
- act <<= 4;
-
- /* If the region is flat, lower the activity some more. */
- if (act < 8 << 12)
- act = act < 5 << 12 ? act : 5 << 12;
-
- return act;
+ // TODO: This could also be done over smaller areas (8x8), but that would
+ // require extensive changes elsewhere, as lambda is assumed to be fixed
+ // over an entire MB in most of the code.
+ // Another option is to compute four 8x8 variances, and pick a single
+ // lambda using a non-linear combination (e.g., the smallest, or second
+ // smallest, etc.).
+ const unsigned int act = vp9_variance16x16(x->plane[0].src.buf,
+ x->plane[0].src.stride,
+ VP9_VAR_OFFS, 0, &sse) << 4;
+ // If the region is flat, lower the activity some more.
+ return act < (8 << 12) ? MIN(act, 5 << 12) : act;
}
// Stub for alternative experimental activity measures.
@@ -150,7 +623,7 @@ static unsigned int mb_activity_measure(MACROBLOCK *x, int mb_row, int mb_col) {
unsigned int mb_activity;
if (ALT_ACT_MEASURE) {
- int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
+ const int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
// Or use and alternative.
mb_activity = alt_activity_measure(x, use_dc_pred);
@@ -159,10 +632,7 @@ static unsigned int mb_activity_measure(MACROBLOCK *x, int mb_row, int mb_col) {
mb_activity = tt_activity_measure(x);
}
- if (mb_activity < ACTIVITY_AVG_MIN)
- mb_activity = ACTIVITY_AVG_MIN;
-
- return mb_activity;
+ return MAX(mb_activity, ACTIVITY_AVG_MIN);
}
// Calculate an "average" mb activity value for the frame
@@ -277,9 +747,9 @@ static void calc_activity_index(VP9_COMP *cpi, MACROBLOCK *x) {
// Loop through all MBs. Note activity of each, average activity and
// calculate a normalized activity for each
static void build_activity_map(VP9_COMP *cpi) {
- MACROBLOCK * const x = &cpi->mb;
+ MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *xd = &x->e_mbd;
- VP9_COMMON * const cm = &cpi->common;
+ VP9_COMMON *const cm = &cpi->common;
#if ALT_ACT_MEASURE
YV12_BUFFER_CONFIG *new_yv12 = get_frame_new_buffer(cm);
@@ -338,19 +808,17 @@ static void build_activity_map(VP9_COMP *cpi) {
}
// Macroblock activity masking
-void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x) {
+static void activity_masking(VP9_COMP *cpi, MACROBLOCK *x) {
#if USE_ACT_INDEX
x->rdmult += *(x->mb_activity_ptr) * (x->rdmult >> 2);
x->errorperbit = x->rdmult * 100 / (110 * x->rddiv);
x->errorperbit += (x->errorperbit == 0);
#else
- int64_t a;
- int64_t b;
- int64_t act = *(x->mb_activity_ptr);
+ const int64_t act = *(x->mb_activity_ptr);
// Apply the masking to the RD multiplier.
- a = act + (2 * cpi->activity_avg);
- b = (2 * act) + cpi->activity_avg;
+ const int64_t a = act + (2 * cpi->activity_avg);
+ const int64_t b = (2 * act) + cpi->activity_avg;
x->rdmult = (unsigned int) (((int64_t) x->rdmult * b + (a >> 1)) / a);
x->errorperbit = x->rdmult * 100 / (110 * x->rddiv);
@@ -361,8 +829,55 @@ void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x) {
adjust_act_zbin(cpi, x);
}
+// Select a segment for the current SB64
+static void select_in_frame_q_segment(VP9_COMP *cpi,
+ int mi_row, int mi_col,
+ int output_enabled, int projected_rate) {
+ VP9_COMMON *const cm = &cpi->common;
+
+ const int mi_offset = mi_row * cm->mi_cols + mi_col;
+ const int bw = num_8x8_blocks_wide_lookup[BLOCK_64X64];
+ const int bh = num_8x8_blocks_high_lookup[BLOCK_64X64];
+ const int xmis = MIN(cm->mi_cols - mi_col, bw);
+ const int ymis = MIN(cm->mi_rows - mi_row, bh);
+ int complexity_metric = 64;
+ int x, y;
+
+ unsigned char segment;
+
+ if (!output_enabled) {
+ segment = 0;
+ } else {
+ // Rate depends on fraction of a SB64 in frame (xmis * ymis / bw * bh).
+ // It is converted to bits * 256 units
+ const int target_rate = (cpi->rc.sb64_target_rate * xmis * ymis * 256) /
+ (bw * bh);
+
+ if (projected_rate < (target_rate / 4)) {
+ segment = 1;
+ } else {
+ segment = 0;
+ }
+
+ if (target_rate > 0) {
+ complexity_metric =
+ clamp((int)((projected_rate * 64) / target_rate), 16, 255);
+ }
+ }
+
+ // Fill in the entires in the segment map corresponding to this SB64
+ for (y = 0; y < ymis; y++) {
+ for (x = 0; x < xmis; x++) {
+ cpi->segmentation_map[mi_offset + y * cm->mi_cols + x] = segment;
+ cpi->complexity_map[mi_offset + y * cm->mi_cols + x] =
+ (unsigned char)complexity_metric;
+ }
+ }
+}
+
static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
- BLOCK_SIZE bsize, int output_enabled) {
+ int mi_row, int mi_col, BLOCK_SIZE bsize,
+ int output_enabled) {
int i, x_idx, y;
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
@@ -372,33 +887,43 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
MODE_INFO *mi = &ctx->mic;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
MODE_INFO *mi_addr = xd->mi_8x8[0];
+ const struct segmentation *const seg = &cm->seg;
- int mb_mode_index = ctx->best_mode_index;
const int mis = cm->mode_info_stride;
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
const int mi_height = num_8x8_blocks_high_lookup[bsize];
int max_plane;
- assert(mi->mbmi.mode < MB_MODE_COUNT);
- assert(mi->mbmi.ref_frame[0] < MAX_REF_FRAMES);
- assert(mi->mbmi.ref_frame[1] < MAX_REF_FRAMES);
assert(mi->mbmi.sb_type == bsize);
+ // For in frame adaptive Q copy over the chosen segment id into the
+ // mode innfo context for the chosen mode / partition.
+ if ((cpi->oxcf.aq_mode == COMPLEXITY_AQ ||
+ cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) &&
+ output_enabled) {
+ // Check for reseting segment_id and update cyclic map.
+ if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && seg->enabled) {
+ vp9_update_segment_aq(cpi, xd->mi_8x8[0], mi_row, mi_col, bsize, 1);
+ vp9_init_plane_quantizers(cpi, x);
+ }
+ mi->mbmi.segment_id = xd->mi_8x8[0]->mbmi.segment_id;
+ }
+
*mi_addr = *mi;
max_plane = is_inter_block(mbmi) ? MAX_MB_PLANE : 1;
for (i = 0; i < max_plane; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][1];
- pd[i].qcoeff = ctx->qcoeff_pbuf[i][1];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][1];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
- pd[i].eobs = ctx->eobs_pbuf[i][1];
+ p[i].eobs = ctx->eobs_pbuf[i][1];
}
for (i = max_plane; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][2];
- pd[i].qcoeff = ctx->qcoeff_pbuf[i][2];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][2];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][2];
- pd[i].eobs = ctx->eobs_pbuf[i][2];
+ p[i].eobs = ctx->eobs_pbuf[i][2];
}
// Restore the coding context of the MB to that that was in place
@@ -406,12 +931,12 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
for (y = 0; y < mi_height; y++)
for (x_idx = 0; x_idx < mi_width; x_idx++)
if ((xd->mb_to_right_edge >> (3 + MI_SIZE_LOG2)) + mi_width > x_idx
- && (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > y)
+ && (xd->mb_to_bottom_edge >> (3 + MI_SIZE_LOG2)) + mi_height > y) {
xd->mi_8x8[x_idx + y * mis] = mi_addr;
+ }
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_mb_init_quantizer(cpi, x);
- }
+ if (cpi->oxcf.aq_mode)
+ vp9_init_plane_quantizers(cpi, x);
// FIXME(rbultje) I'm pretty sure this should go to the end of this block
// (i.e. after the output_enabled)
@@ -438,52 +963,41 @@ static void update_state(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
cpi->rd_tx_select_diff[i] += ctx->tx_rd_diff[i];
}
- if (frame_is_intra_only(cm)) {
#if CONFIG_INTERNAL_STATS
+ if (frame_is_intra_only(cm)) {
static const int kf_mode_index[] = {
- THR_DC /*DC_PRED*/,
- THR_V_PRED /*V_PRED*/,
- THR_H_PRED /*H_PRED*/,
- THR_D45_PRED /*D45_PRED*/,
+ THR_DC /*DC_PRED*/,
+ THR_V_PRED /*V_PRED*/,
+ THR_H_PRED /*H_PRED*/,
+ THR_D45_PRED /*D45_PRED*/,
THR_D135_PRED /*D135_PRED*/,
THR_D117_PRED /*D117_PRED*/,
THR_D153_PRED /*D153_PRED*/,
THR_D207_PRED /*D207_PRED*/,
- THR_D63_PRED /*D63_PRED*/,
- THR_TM /*TM_PRED*/,
+ THR_D63_PRED /*D63_PRED*/,
+ THR_TM /*TM_PRED*/,
};
- cpi->mode_chosen_counts[kf_mode_index[mi->mbmi.mode]]++;
-#endif
+ ++cpi->mode_chosen_counts[kf_mode_index[mbmi->mode]];
} else {
// Note how often each mode chosen as best
- cpi->mode_chosen_counts[mb_mode_index]++;
- if (is_inter_block(mbmi)
- && (mbmi->sb_type < BLOCK_8X8 || mbmi->mode == NEWMV)) {
- int_mv best_mv[2];
- const MV_REFERENCE_FRAME rf1 = mbmi->ref_frame[0];
- const MV_REFERENCE_FRAME rf2 = mbmi->ref_frame[1];
- best_mv[0].as_int = ctx->best_ref_mv.as_int;
- best_mv[1].as_int = ctx->second_best_ref_mv.as_int;
- if (mbmi->mode == NEWMV) {
- best_mv[0].as_int = mbmi->ref_mvs[rf1][0].as_int;
- if (rf2 > 0)
- best_mv[1].as_int = mbmi->ref_mvs[rf2][0].as_int;
- }
- mbmi->best_mv[0].as_int = best_mv[0].as_int;
- mbmi->best_mv[1].as_int = best_mv[1].as_int;
- vp9_update_mv_count(cpi, x, best_mv);
- }
+ ++cpi->mode_chosen_counts[ctx->best_mode_index];
+ }
+#endif
+ if (!frame_is_intra_only(cm)) {
+ if (is_inter_block(mbmi)) {
+ vp9_update_mv_count(cm, xd);
- if (cm->mcomp_filter_type == SWITCHABLE && is_inter_mode(mbmi->mode)) {
- const int ctx = vp9_get_pred_context_switchable_interp(xd);
- ++cm->counts.switchable_interp[ctx][mbmi->interp_filter];
+ if (cm->interp_filter == SWITCHABLE) {
+ const int ctx = vp9_get_pred_context_switchable_interp(xd);
+ ++cm->counts.switchable_interp[ctx][mbmi->interp_filter];
+ }
}
- cpi->rd_comp_pred_diff[SINGLE_PREDICTION_ONLY] += ctx->single_pred_diff;
- cpi->rd_comp_pred_diff[COMP_PREDICTION_ONLY] += ctx->comp_pred_diff;
- cpi->rd_comp_pred_diff[HYBRID_PREDICTION] += ctx->hybrid_pred_diff;
+ cpi->rd_comp_pred_diff[SINGLE_REFERENCE] += ctx->single_pred_diff;
+ cpi->rd_comp_pred_diff[COMPOUND_REFERENCE] += ctx->comp_pred_diff;
+ cpi->rd_comp_pred_diff[REFERENCE_MODE_SELECT] += ctx->hybrid_pred_diff;
- for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
+ for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
cpi->rd_filter_diff[i] += ctx->best_filter_diff[i];
}
}
@@ -496,113 +1010,31 @@ void vp9_setup_src_planes(MACROBLOCK *x, const YV12_BUFFER_CONFIG *src,
src->alpha_stride};
int i;
+ // Set current frame pointer.
+ x->e_mbd.cur_buf = src;
+
for (i = 0; i < MAX_MB_PLANE; i++)
setup_pred_plane(&x->plane[i].src, buffers[i], strides[i], mi_row, mi_col,
NULL, x->e_mbd.plane[i].subsampling_x,
x->e_mbd.plane[i].subsampling_y);
}
-static void set_offsets(VP9_COMP *cpi, const TileInfo *const tile,
- int mi_row, int mi_col, BLOCK_SIZE bsize) {
- MACROBLOCK *const x = &cpi->mb;
- VP9_COMMON *const cm = &cpi->common;
- MACROBLOCKD *const xd = &x->e_mbd;
- MB_MODE_INFO *mbmi;
- const int dst_fb_idx = cm->new_fb_idx;
- const int idx_str = xd->mode_info_stride * mi_row + mi_col;
- const int mi_width = num_8x8_blocks_wide_lookup[bsize];
- const int mi_height = num_8x8_blocks_high_lookup[bsize];
- const int mb_row = mi_row >> 1;
- const int mb_col = mi_col >> 1;
- const int idx_map = mb_row * cm->mb_cols + mb_col;
- const struct segmentation *const seg = &cm->seg;
-
- set_skip_context(xd, cpi->above_context, cpi->left_context, mi_row, mi_col);
-
- // Activity map pointer
- x->mb_activity_ptr = &cpi->mb_activity_map[idx_map];
- x->active_ptr = cpi->active_map + idx_map;
-
- xd->mi_8x8 = cm->mi_grid_visible + idx_str;
- xd->prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
-
- // Special case: if prev_mi is NULL, the previous mode info context
- // cannot be used.
- xd->last_mi = cm->prev_mi ? xd->prev_mi_8x8[0] : NULL;
-
- xd->mi_8x8[0] = cm->mi + idx_str;
-
- mbmi = &xd->mi_8x8[0]->mbmi;
-
- // Set up destination pointers
- setup_dst_planes(xd, &cm->yv12_fb[dst_fb_idx], mi_row, mi_col);
-
- // Set up limit values for MV components
- // mv beyond the range do not produce new/different prediction block
- x->mv_row_min = -(((mi_row + mi_height) * MI_SIZE) + VP9_INTERP_EXTEND);
- x->mv_col_min = -(((mi_col + mi_width) * MI_SIZE) + VP9_INTERP_EXTEND);
- x->mv_row_max = (cm->mi_rows - mi_row) * MI_SIZE + VP9_INTERP_EXTEND;
- x->mv_col_max = (cm->mi_cols - mi_col) * MI_SIZE + VP9_INTERP_EXTEND;
-
- // Set up distance of MB to edge of frame in 1/8th pel units
- assert(!(mi_col & (mi_width - 1)) && !(mi_row & (mi_height - 1)));
- set_mi_row_col(xd, tile, mi_row, mi_height, mi_col, mi_width,
- cm->mi_rows, cm->mi_cols);
-
- /* set up source buffers */
- vp9_setup_src_planes(x, cpi->Source, mi_row, mi_col);
-
- /* R/D setup */
- x->rddiv = cpi->RDDIV;
- x->rdmult = cpi->RDMULT;
-
- /* segment ID */
- if (seg->enabled) {
- if (!cpi->sf.variance_adaptive_quantization) {
- uint8_t *map = seg->update_map ? cpi->segmentation_map
- : cm->last_frame_seg_map;
- mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col);
- }
- vp9_mb_init_quantizer(cpi, x);
-
- if (seg->enabled && cpi->seg0_cnt > 0
- && !vp9_segfeature_active(seg, 0, SEG_LVL_REF_FRAME)
- && vp9_segfeature_active(seg, 1, SEG_LVL_REF_FRAME)) {
- cpi->seg0_progress = (cpi->seg0_idx << 16) / cpi->seg0_cnt;
- } else {
- const int y = mb_row & ~3;
- const int x = mb_col & ~3;
- const int p16 = ((mb_row & 1) << 1) + (mb_col & 1);
- const int p32 = ((mb_row & 2) << 2) + ((mb_col & 2) << 1);
- const int tile_progress = tile->mi_col_start * cm->mb_rows >> 1;
- const int mb_cols = (tile->mi_col_end - tile->mi_col_start) >> 1;
-
- cpi->seg0_progress = ((y * mb_cols + x * 4 + p32 + p16 + tile_progress)
- << 16) / cm->MBs;
- }
-
- x->encode_breakout = cpi->segment_encode_breakout[mbmi->segment_id];
- } else {
- mbmi->segment_id = 0;
- x->encode_breakout = cpi->oxcf.encode_breakout;
- }
-}
-
-static void pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
- int mi_row, int mi_col,
- int *totalrate, int64_t *totaldist,
- BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
- int64_t best_rd) {
+static void rd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
+ int mi_row, int mi_col,
+ int *totalrate, int64_t *totaldist,
+ BLOCK_SIZE bsize, PICK_MODE_CONTEXT *ctx,
+ int64_t best_rd) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
+ MB_MODE_INFO *mbmi;
struct macroblock_plane *const p = x->plane;
struct macroblockd_plane *const pd = xd->plane;
- int i;
- int orig_rdmult = x->rdmult;
+ const AQ_MODE aq_mode = cpi->oxcf.aq_mode;
+ int i, orig_rdmult;
double rdmult_ratio;
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
rdmult_ratio = 1.0; // avoid uninitialized warnings
// Use the lower precision, but faster, 32x32 fdct for mode selection.
@@ -619,41 +1051,62 @@ static void pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
}
set_offsets(cpi, tile, mi_row, mi_col, bsize);
- xd->mi_8x8[0]->mbmi.sb_type = bsize;
+ mbmi = &xd->mi_8x8[0]->mbmi;
+ mbmi->sb_type = bsize;
for (i = 0; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][0];
- pd[i].qcoeff = ctx->qcoeff_pbuf[i][0];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][0];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][0];
- pd[i].eobs = ctx->eobs_pbuf[i][0];
+ p[i].eobs = ctx->eobs_pbuf[i][0];
}
ctx->is_coded = 0;
x->skip_recode = 0;
// Set to zero to make sure we do not use the previous encoded frame stats
- xd->mi_8x8[0]->mbmi.skip_coeff = 0;
+ mbmi->skip = 0;
x->source_variance = get_sby_perpixel_variance(cpi, x, bsize);
- if (cpi->sf.variance_adaptive_quantization) {
- int energy;
- if (bsize <= BLOCK_16X16) {
- energy = x->mb_energy;
+ if (aq_mode == VARIANCE_AQ) {
+ const int energy = bsize <= BLOCK_16X16 ? x->mb_energy
+ : vp9_block_energy(cpi, x, bsize);
+
+ if (cm->frame_type == KEY_FRAME ||
+ cpi->refresh_alt_ref_frame ||
+ (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
+ mbmi->segment_id = vp9_vaq_segment_id(energy);
} else {
- energy = vp9_block_energy(cpi, x, bsize);
+ const uint8_t *const map = cm->seg.update_map ? cpi->segmentation_map
+ : cm->last_frame_seg_map;
+ mbmi->segment_id = vp9_get_segment_id(cm, map, bsize, mi_row, mi_col);
}
- xd->mi_8x8[0]->mbmi.segment_id = vp9_vaq_segment_id(energy);
rdmult_ratio = vp9_vaq_rdmult_ratio(energy);
- vp9_mb_init_quantizer(cpi, x);
+ vp9_init_plane_quantizers(cpi, x);
}
+ // Save rdmult before it might be changed, so it can be restored later.
+ orig_rdmult = x->rdmult;
if (cpi->oxcf.tuning == VP8_TUNE_SSIM)
- vp9_activity_masking(cpi, x);
-
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_clear_system_state(); // __asm emms;
- x->rdmult = round(x->rdmult * rdmult_ratio);
+ activity_masking(cpi, x);
+
+ if (aq_mode == VARIANCE_AQ) {
+ vp9_clear_system_state();
+ x->rdmult = (int)round(x->rdmult * rdmult_ratio);
+ } else if (aq_mode == COMPLEXITY_AQ) {
+ const int mi_offset = mi_row * cm->mi_cols + mi_col;
+ unsigned char complexity = cpi->complexity_map[mi_offset];
+ const int is_edge = (mi_row <= 1) || (mi_row >= (cm->mi_rows - 2)) ||
+ (mi_col <= 1) || (mi_col >= (cm->mi_cols - 2));
+ if (!is_edge && (complexity > 128))
+ x->rdmult += ((x->rdmult * (complexity - 128)) / 256);
+ } else if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ const uint8_t *const map = cm->seg.update_map ? cpi->segmentation_map
+ : cm->last_frame_seg_map;
+ // If segment 1, use rdmult for that segment.
+ if (vp9_get_segment_id(cm, map, bsize, mi_row, mi_col))
+ x->rdmult = cpi->cyclic_refresh.rdmult;
}
// Find best coding mode & reconstruct the MB so it is available
@@ -670,47 +1123,54 @@ static void pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
totaldist, bsize, ctx, best_rd);
}
- if (cpi->sf.variance_adaptive_quantization) {
+ if (aq_mode == VARIANCE_AQ) {
x->rdmult = orig_rdmult;
if (*totalrate != INT_MAX) {
- vp9_clear_system_state(); // __asm emms;
- *totalrate = round(*totalrate * rdmult_ratio);
+ vp9_clear_system_state();
+ *totalrate = (int)round(*totalrate * rdmult_ratio);
}
+ } else if ((cpi->oxcf.aq_mode == COMPLEXITY_AQ) ||
+ (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ)) {
+ x->rdmult = orig_rdmult;
}
}
static void update_stats(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
- MACROBLOCK *const x = &cpi->mb;
- MACROBLOCKD *const xd = &x->e_mbd;
- MODE_INFO *mi = xd->mi_8x8[0];
- MB_MODE_INFO *const mbmi = &mi->mbmi;
+ const MACROBLOCK *const x = &cpi->mb;
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const MODE_INFO *const mi = xd->mi_8x8[0];
+ const MB_MODE_INFO *const mbmi = &mi->mbmi;
if (!frame_is_intra_only(cm)) {
const int seg_ref_active = vp9_segfeature_active(&cm->seg, mbmi->segment_id,
SEG_LVL_REF_FRAME);
+ if (!seg_ref_active) {
+ FRAME_COUNTS *const counts = &cm->counts;
+ const int inter_block = is_inter_block(mbmi);
- if (!seg_ref_active)
- cpi->intra_inter_count[vp9_get_pred_context_intra_inter(xd)]
- [is_inter_block(mbmi)]++;
-
- // If the segment reference feature is enabled we have only a single
- // reference frame allowed for the segment so exclude it from
- // the reference frame counts used to work out probabilities.
- if (is_inter_block(mbmi) && !seg_ref_active) {
- if (cm->comp_pred_mode == HYBRID_PREDICTION)
- cpi->comp_inter_count[vp9_get_pred_context_comp_inter_inter(cm, xd)]
- [has_second_ref(mbmi)]++;
-
- if (has_second_ref(mbmi)) {
- cpi->comp_ref_count[vp9_get_pred_context_comp_ref_p(cm, xd)]
- [mbmi->ref_frame[0] == GOLDEN_FRAME]++;
- } else {
- cpi->single_ref_count[vp9_get_pred_context_single_ref_p1(xd)][0]
- [mbmi->ref_frame[0] != LAST_FRAME]++;
- if (mbmi->ref_frame[0] != LAST_FRAME)
- cpi->single_ref_count[vp9_get_pred_context_single_ref_p2(xd)][1]
- [mbmi->ref_frame[0] != GOLDEN_FRAME]++;
+ counts->intra_inter[vp9_get_intra_inter_context(xd)][inter_block]++;
+
+ // If the segment reference feature is enabled we have only a single
+ // reference frame allowed for the segment so exclude it from
+ // the reference frame counts used to work out probabilities.
+ if (inter_block) {
+ const MV_REFERENCE_FRAME ref0 = mbmi->ref_frame[0];
+
+ if (cm->reference_mode == REFERENCE_MODE_SELECT)
+ counts->comp_inter[vp9_get_reference_mode_context(cm, xd)]
+ [has_second_ref(mbmi)]++;
+
+ if (has_second_ref(mbmi)) {
+ counts->comp_ref[vp9_get_pred_context_comp_ref_p(cm, xd)]
+ [ref0 == GOLDEN_FRAME]++;
+ } else {
+ counts->single_ref[vp9_get_pred_context_single_ref_p1(xd)][0]
+ [ref0 != LAST_FRAME]++;
+ if (ref0 != LAST_FRAME)
+ counts->single_ref[vp9_get_pred_context_single_ref_p2(xd)][1]
+ [ref0 != GOLDEN_FRAME]++;
+ }
}
}
}
@@ -797,16 +1257,9 @@ static void save_context(VP9_COMP *cpi, int mi_row, int mi_col,
static void encode_b(VP9_COMP *cpi, const TileInfo *const tile,
TOKENEXTRA **tp, int mi_row, int mi_col,
- int output_enabled, BLOCK_SIZE bsize, int sub_index) {
- VP9_COMMON *const cm = &cpi->common;
+ int output_enabled, BLOCK_SIZE bsize) {
MACROBLOCK *const x = &cpi->mb;
- if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
- return;
-
- if (sub_index != -1)
- *get_sb_index(x, bsize) = sub_index;
-
if (bsize < BLOCK_8X8) {
// When ab_index = 0 all sub-blocks are handled, so for ab_index != 0
// there is nothing to be done.
@@ -814,7 +1267,8 @@ static void encode_b(VP9_COMP *cpi, const TileInfo *const tile,
return;
}
set_offsets(cpi, tile, mi_row, mi_col, bsize);
- update_state(cpi, get_block_context(x, bsize), bsize, output_enabled);
+ update_state(cpi, get_block_context(x, bsize), mi_row, mi_col, bsize,
+ output_enabled);
encode_superblock(cpi, tp, output_enabled, mi_row, mi_col, bsize);
if (output_enabled) {
@@ -830,64 +1284,73 @@ static void encode_sb(VP9_COMP *cpi, const TileInfo *const tile,
int output_enabled, BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
- BLOCK_SIZE c1 = BLOCK_8X8;
- const int bsl = b_width_log2(bsize), bs = (1 << bsl) / 4;
- int pl = 0;
+ const int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4;
+ int ctx;
PARTITION_TYPE partition;
BLOCK_SIZE subsize;
- int i;
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
return;
- c1 = BLOCK_4X4;
if (bsize >= BLOCK_8X8) {
- pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
+ ctx = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
- c1 = *(get_sb_partitioning(x, bsize));
+ subsize = *get_sb_partitioning(x, bsize);
+ } else {
+ ctx = 0;
+ subsize = BLOCK_4X4;
}
- partition = partition_lookup[bsl][c1];
+
+ partition = partition_lookup[bsl][subsize];
switch (partition) {
case PARTITION_NONE:
if (output_enabled && bsize >= BLOCK_8X8)
- cpi->partition_count[pl][PARTITION_NONE]++;
- encode_b(cpi, tile, tp, mi_row, mi_col, output_enabled, c1, -1);
+ cm->counts.partition[ctx][PARTITION_NONE]++;
+ encode_b(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
break;
case PARTITION_VERT:
if (output_enabled)
- cpi->partition_count[pl][PARTITION_VERT]++;
- encode_b(cpi, tile, tp, mi_row, mi_col, output_enabled, c1, 0);
- encode_b(cpi, tile, tp, mi_row, mi_col + bs, output_enabled, c1, 1);
+ cm->counts.partition[ctx][PARTITION_VERT]++;
+ *get_sb_index(x, subsize) = 0;
+ encode_b(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ if (mi_col + hbs < cm->mi_cols) {
+ *get_sb_index(x, subsize) = 1;
+ encode_b(cpi, tile, tp, mi_row, mi_col + hbs, output_enabled, subsize);
+ }
break;
case PARTITION_HORZ:
if (output_enabled)
- cpi->partition_count[pl][PARTITION_HORZ]++;
- encode_b(cpi, tile, tp, mi_row, mi_col, output_enabled, c1, 0);
- encode_b(cpi, tile, tp, mi_row + bs, mi_col, output_enabled, c1, 1);
+ cm->counts.partition[ctx][PARTITION_HORZ]++;
+ *get_sb_index(x, subsize) = 0;
+ encode_b(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ if (mi_row + hbs < cm->mi_rows) {
+ *get_sb_index(x, subsize) = 1;
+ encode_b(cpi, tile, tp, mi_row + hbs, mi_col, output_enabled, subsize);
+ }
break;
case PARTITION_SPLIT:
subsize = get_subsize(bsize, PARTITION_SPLIT);
-
if (output_enabled)
- cpi->partition_count[pl][PARTITION_SPLIT]++;
+ cm->counts.partition[ctx][PARTITION_SPLIT]++;
- for (i = 0; i < 4; i++) {
- const int x_idx = i & 1, y_idx = i >> 1;
-
- *get_sb_index(x, subsize) = i;
- encode_sb(cpi, tile, tp, mi_row + y_idx * bs, mi_col + x_idx * bs,
- output_enabled, subsize);
- }
+ *get_sb_index(x, subsize) = 0;
+ encode_sb(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ *get_sb_index(x, subsize) = 1;
+ encode_sb(cpi, tile, tp, mi_row, mi_col + hbs, output_enabled, subsize);
+ *get_sb_index(x, subsize) = 2;
+ encode_sb(cpi, tile, tp, mi_row + hbs, mi_col, output_enabled, subsize);
+ *get_sb_index(x, subsize) = 3;
+ encode_sb(cpi, tile, tp, mi_row + hbs, mi_col + hbs, output_enabled,
+ subsize);
break;
default:
- assert(0);
- break;
+ assert("Invalid partition type.");
}
if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8)
update_partition_context(cpi->above_seg_context, cpi->left_seg_context,
- mi_row, mi_col, c1, bsize);
+ mi_row, mi_col, subsize, bsize);
}
// Check to see if the given partition size is allowed for a specified number
@@ -896,10 +1359,10 @@ static void encode_sb(VP9_COMP *cpi, const TileInfo *const tile,
static BLOCK_SIZE find_partition_size(BLOCK_SIZE bsize,
int rows_left, int cols_left,
int *bh, int *bw) {
- if ((rows_left <= 0) || (cols_left <= 0)) {
+ if (rows_left <= 0 || cols_left <= 0) {
return MIN(bsize, BLOCK_8X8);
} else {
- for (; bsize > 0; --bsize) {
+ for (; bsize > 0; bsize -= 3) {
*bh = num_8x8_blocks_high_lookup[bsize];
*bw = num_8x8_blocks_wide_lookup[bsize];
if ((*bh <= rows_left) && (*bw <= cols_left)) {
@@ -915,15 +1378,15 @@ static BLOCK_SIZE find_partition_size(BLOCK_SIZE bsize,
// However, at the bottom and right borders of the image the requested size
// may not be allowed in which case this code attempts to choose the largest
// allowable partition.
-static void set_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
- MODE_INFO **mi_8x8, int mi_row, int mi_col) {
+static void set_fixed_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
+ MODE_INFO **mi_8x8, int mi_row, int mi_col,
+ BLOCK_SIZE bsize) {
VP9_COMMON *const cm = &cpi->common;
- BLOCK_SIZE bsize = cpi->sf.always_this_block_size;
const int mis = cm->mode_info_stride;
int row8x8_remaining = tile->mi_row_end - mi_row;
int col8x8_remaining = tile->mi_col_end - mi_col;
int block_row, block_col;
- MODE_INFO * mi_upper_left = cm->mi + mi_row * mis + mi_col;
+ MODE_INFO *mi_upper_left = cm->mi + mi_row * mis + mi_col;
int bh = num_8x8_blocks_high_lookup[bsize];
int bw = num_8x8_blocks_wide_lookup[bsize];
@@ -945,7 +1408,7 @@ static void set_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
for (block_col = 0; block_col < MI_BLOCK_SIZE; block_col += bw) {
int index = block_row * mis + block_col;
// Find a partition size that fits
- bsize = find_partition_size(cpi->sf.always_this_block_size,
+ bsize = find_partition_size(bsize,
(row8x8_remaining - block_row),
(col8x8_remaining - block_col), &bh, &bw);
mi_8x8[index] = mi_upper_left + index;
@@ -955,20 +1418,17 @@ static void set_partitioning(VP9_COMP *cpi, const TileInfo *const tile,
}
}
-static void copy_partitioning(VP9_COMP *cpi, MODE_INFO **mi_8x8,
+static void copy_partitioning(VP9_COMMON *cm, MODE_INFO **mi_8x8,
MODE_INFO **prev_mi_8x8) {
- VP9_COMMON *const cm = &cpi->common;
const int mis = cm->mode_info_stride;
int block_row, block_col;
for (block_row = 0; block_row < 8; ++block_row) {
for (block_col = 0; block_col < 8; ++block_col) {
- MODE_INFO * prev_mi = prev_mi_8x8[block_row * mis + block_col];
- BLOCK_SIZE sb_type = prev_mi ? prev_mi->mbmi.sb_type : 0;
- ptrdiff_t offset;
-
+ MODE_INFO *const prev_mi = prev_mi_8x8[block_row * mis + block_col];
+ const BLOCK_SIZE sb_type = prev_mi ? prev_mi->mbmi.sb_type : 0;
if (prev_mi) {
- offset = prev_mi - cm->prev_mi;
+ const ptrdiff_t offset = prev_mi - cm->prev_mi;
mi_8x8[block_row * mis + block_col] = cm->mi + offset;
mi_8x8[block_row * mis + block_col]->mbmi.sb_type = sb_type;
}
@@ -976,15 +1436,14 @@ static void copy_partitioning(VP9_COMP *cpi, MODE_INFO **mi_8x8,
}
}
-static int sb_has_motion(VP9_COMP *cpi, MODE_INFO **prev_mi_8x8) {
- VP9_COMMON *const cm = &cpi->common;
+static int sb_has_motion(const VP9_COMMON *cm, MODE_INFO **prev_mi_8x8) {
const int mis = cm->mode_info_stride;
int block_row, block_col;
if (cm->prev_mi) {
for (block_row = 0; block_row < 8; ++block_row) {
for (block_col = 0; block_col < 8; ++block_col) {
- MODE_INFO * prev_mi = prev_mi_8x8[block_row * mis + block_col];
+ const MODE_INFO *prev_mi = prev_mi_8x8[block_row * mis + block_col];
if (prev_mi) {
if (abs(prev_mi->mbmi.mv[0].as_mv.row) >= 8 ||
abs(prev_mi->mbmi.mv[0].as_mv.col) >= 8)
@@ -996,6 +1455,137 @@ static int sb_has_motion(VP9_COMP *cpi, MODE_INFO **prev_mi_8x8) {
return 0;
}
+static void update_state_rt(VP9_COMP *cpi, const PICK_MODE_CONTEXT *ctx,
+ int mi_row, int mi_col, int bsize) {
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCK *const x = &cpi->mb;
+ MACROBLOCKD *const xd = &x->e_mbd;
+ MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
+ const struct segmentation *const seg = &cm->seg;
+
+ // TODO(jingning) We might need PICK_MODE_CONTEXT to buffer coding modes
+ // associated with variable block sizes. Otherwise, remove this ctx
+ // from argument list.
+ (void)ctx;
+
+ // Check for reseting segment_id and update cyclic map.
+ if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ && seg->enabled) {
+ vp9_update_segment_aq(cpi, xd->mi_8x8[0], mi_row, mi_col, bsize, 1);
+ vp9_init_plane_quantizers(cpi, x);
+ }
+
+ if (is_inter_block(mbmi)) {
+ vp9_update_mv_count(cm, xd);
+
+ if (cm->interp_filter == SWITCHABLE) {
+ const int pred_ctx = vp9_get_pred_context_switchable_interp(xd);
+ ++cm->counts.switchable_interp[pred_ctx][mbmi->interp_filter];
+ }
+ }
+}
+
+static void encode_b_rt(VP9_COMP *cpi, const TileInfo *const tile,
+ TOKENEXTRA **tp, int mi_row, int mi_col,
+ int output_enabled, BLOCK_SIZE bsize) {
+ MACROBLOCK *const x = &cpi->mb;
+
+ if (bsize < BLOCK_8X8) {
+ // When ab_index = 0 all sub-blocks are handled, so for ab_index != 0
+ // there is nothing to be done.
+ if (x->ab_index > 0)
+ return;
+ }
+ set_offsets(cpi, tile, mi_row, mi_col, bsize);
+ update_state_rt(cpi, get_block_context(x, bsize), mi_row, mi_col, bsize);
+
+ encode_superblock(cpi, tp, output_enabled, mi_row, mi_col, bsize);
+ update_stats(cpi);
+
+ (*tp)->token = EOSB_TOKEN;
+ (*tp)++;
+}
+
+static void encode_sb_rt(VP9_COMP *cpi, const TileInfo *const tile,
+ TOKENEXTRA **tp, int mi_row, int mi_col,
+ int output_enabled, BLOCK_SIZE bsize) {
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCK *const x = &cpi->mb;
+ const int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4;
+ int ctx;
+ PARTITION_TYPE partition;
+ BLOCK_SIZE subsize;
+
+ if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
+ return;
+
+ if (bsize >= BLOCK_8X8) {
+ MACROBLOCKD *const xd = &cpi->mb.e_mbd;
+ const int idx_str = xd->mode_info_stride * mi_row + mi_col;
+ MODE_INFO ** mi_8x8 = cm->mi_grid_visible + idx_str;
+ ctx = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
+ mi_row, mi_col, bsize);
+ subsize = mi_8x8[0]->mbmi.sb_type;
+ } else {
+ ctx = 0;
+ subsize = BLOCK_4X4;
+ }
+
+ partition = partition_lookup[bsl][subsize];
+
+ switch (partition) {
+ case PARTITION_NONE:
+ if (output_enabled && bsize >= BLOCK_8X8)
+ cm->counts.partition[ctx][PARTITION_NONE]++;
+ encode_b_rt(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ break;
+ case PARTITION_VERT:
+ if (output_enabled)
+ cm->counts.partition[ctx][PARTITION_VERT]++;
+ *get_sb_index(x, subsize) = 0;
+ encode_b_rt(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ if (mi_col + hbs < cm->mi_cols) {
+ *get_sb_index(x, subsize) = 1;
+ encode_b_rt(cpi, tile, tp, mi_row, mi_col + hbs, output_enabled,
+ subsize);
+ }
+ break;
+ case PARTITION_HORZ:
+ if (output_enabled)
+ cm->counts.partition[ctx][PARTITION_HORZ]++;
+ *get_sb_index(x, subsize) = 0;
+ encode_b_rt(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ if (mi_row + hbs < cm->mi_rows) {
+ *get_sb_index(x, subsize) = 1;
+ encode_b_rt(cpi, tile, tp, mi_row + hbs, mi_col, output_enabled,
+ subsize);
+ }
+ break;
+ case PARTITION_SPLIT:
+ subsize = get_subsize(bsize, PARTITION_SPLIT);
+ if (output_enabled)
+ cm->counts.partition[ctx][PARTITION_SPLIT]++;
+
+ *get_sb_index(x, subsize) = 0;
+ encode_sb_rt(cpi, tile, tp, mi_row, mi_col, output_enabled, subsize);
+ *get_sb_index(x, subsize) = 1;
+ encode_sb_rt(cpi, tile, tp, mi_row, mi_col + hbs, output_enabled,
+ subsize);
+ *get_sb_index(x, subsize) = 2;
+ encode_sb_rt(cpi, tile, tp, mi_row + hbs, mi_col, output_enabled,
+ subsize);
+ *get_sb_index(x, subsize) = 3;
+ encode_sb_rt(cpi, tile, tp, mi_row + hbs, mi_col + hbs, output_enabled,
+ subsize);
+ break;
+ default:
+ assert("Invalid partition type.");
+ }
+
+ if (partition != PARTITION_SPLIT || bsize == BLOCK_8X8)
+ update_partition_context(cpi->above_seg_context, cpi->left_seg_context,
+ mi_row, mi_col, subsize, bsize);
+}
+
static void rd_use_partition(VP9_COMP *cpi,
const TileInfo *const tile,
MODE_INFO **mi_8x8,
@@ -1005,25 +1595,26 @@ static void rd_use_partition(VP9_COMP *cpi,
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
const int mis = cm->mode_info_stride;
- int bsl = b_width_log2(bsize);
+ const int bsl = b_width_log2(bsize);
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
- int ms = num_4x4_blocks_wide / 2;
- int mh = num_4x4_blocks_high / 2;
- int bss = (1 << bsl) / 4;
+ const int ms = num_4x4_blocks_wide / 2;
+ const int mh = num_4x4_blocks_high / 2;
+ const int bss = (1 << bsl) / 4;
int i, pl;
PARTITION_TYPE partition = PARTITION_NONE;
BLOCK_SIZE subsize;
ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE];
PARTITION_CONTEXT sl[8], sa[8];
int last_part_rate = INT_MAX;
- int64_t last_part_dist = INT_MAX;
- int split_rate = INT_MAX;
- int64_t split_dist = INT_MAX;
+ int64_t last_part_dist = INT64_MAX;
+ int64_t last_part_rd = INT64_MAX;
int none_rate = INT_MAX;
- int64_t none_dist = INT_MAX;
+ int64_t none_dist = INT64_MAX;
+ int64_t none_rd = INT64_MAX;
int chosen_rate = INT_MAX;
- int64_t chosen_dist = INT_MAX;
+ int64_t chosen_dist = INT64_MAX;
+ int64_t chosen_rd = INT64_MAX;
BLOCK_SIZE sub_subsize = BLOCK_4X4;
int splits_below = 0;
BLOCK_SIZE bs_type = mi_8x8[0]->mbmi.sb_type;
@@ -1032,7 +1623,6 @@ static void rd_use_partition(VP9_COMP *cpi,
return;
partition = partition_lookup[bsl][bs_type];
-
subsize = get_subsize(bsize, partition);
if (bsize < BLOCK_8X8) {
@@ -1053,10 +1643,8 @@ static void rd_use_partition(VP9_COMP *cpi,
x->mb_energy = vp9_block_energy(cpi, x, bsize);
}
- x->fast_ms = 0;
- x->subblock_ref = 0;
-
- if (cpi->sf.adjust_partitioning_from_last_frame) {
+ if (cpi->sf.partition_search_type == SEARCH_PARTITION &&
+ cpi->sf.adjust_partitioning_from_last_frame) {
// Check if any of the sub blocks are further split.
if (partition == PARTITION_SPLIT && subsize > BLOCK_8X8) {
sub_subsize = get_subsize(subsize, PARTITION_SPLIT);
@@ -1076,13 +1664,17 @@ static void rd_use_partition(VP9_COMP *cpi,
mi_row + (ms >> 1) < cm->mi_rows &&
mi_col + (ms >> 1) < cm->mi_cols) {
*(get_sb_partitioning(x, bsize)) = bsize;
- pick_sb_modes(cpi, tile, mi_row, mi_col, &none_rate, &none_dist, bsize,
- get_block_context(x, bsize), INT64_MAX);
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &none_rate, &none_dist, bsize,
+ get_block_context(x, bsize), INT64_MAX);
pl = partition_plane_context(cpi->above_seg_context,
cpi->left_seg_context,
mi_row, mi_col, bsize);
- none_rate += x->partition_cost[pl][PARTITION_NONE];
+
+ if (none_rate < INT_MAX) {
+ none_rate += x->partition_cost[pl][PARTITION_NONE];
+ none_rd = RDCOST(x->rdmult, x->rddiv, none_rate, none_dist);
+ }
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
mi_8x8[0]->mbmi.sb_type = bs_type;
@@ -1092,25 +1684,28 @@ static void rd_use_partition(VP9_COMP *cpi,
switch (partition) {
case PARTITION_NONE:
- pick_sb_modes(cpi, tile, mi_row, mi_col, &last_part_rate, &last_part_dist,
- bsize, get_block_context(x, bsize), INT64_MAX);
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &last_part_rate,
+ &last_part_dist, bsize,
+ get_block_context(x, bsize), INT64_MAX);
break;
case PARTITION_HORZ:
*get_sb_index(x, subsize) = 0;
- pick_sb_modes(cpi, tile, mi_row, mi_col, &last_part_rate, &last_part_dist,
- subsize, get_block_context(x, subsize), INT64_MAX);
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &last_part_rate,
+ &last_part_dist, subsize,
+ get_block_context(x, subsize), INT64_MAX);
if (last_part_rate != INT_MAX &&
bsize >= BLOCK_8X8 && mi_row + (mh >> 1) < cm->mi_rows) {
int rt = 0;
int64_t dt = 0;
- update_state(cpi, get_block_context(x, subsize), subsize, 0);
+ update_state(cpi, get_block_context(x, subsize), mi_row, mi_col,
+ subsize, 0);
encode_superblock(cpi, tp, 0, mi_row, mi_col, subsize);
*get_sb_index(x, subsize) = 1;
- pick_sb_modes(cpi, tile, mi_row + (ms >> 1), mi_col, &rt, &dt, subsize,
- get_block_context(x, subsize), INT64_MAX);
- if (rt == INT_MAX || dt == INT_MAX) {
+ rd_pick_sb_modes(cpi, tile, mi_row + (ms >> 1), mi_col, &rt, &dt,
+ subsize, get_block_context(x, subsize), INT64_MAX);
+ if (rt == INT_MAX || dt == INT64_MAX) {
last_part_rate = INT_MAX;
- last_part_dist = INT_MAX;
+ last_part_dist = INT64_MAX;
break;
}
@@ -1120,20 +1715,22 @@ static void rd_use_partition(VP9_COMP *cpi,
break;
case PARTITION_VERT:
*get_sb_index(x, subsize) = 0;
- pick_sb_modes(cpi, tile, mi_row, mi_col, &last_part_rate, &last_part_dist,
- subsize, get_block_context(x, subsize), INT64_MAX);
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &last_part_rate,
+ &last_part_dist, subsize,
+ get_block_context(x, subsize), INT64_MAX);
if (last_part_rate != INT_MAX &&
bsize >= BLOCK_8X8 && mi_col + (ms >> 1) < cm->mi_cols) {
int rt = 0;
int64_t dt = 0;
- update_state(cpi, get_block_context(x, subsize), subsize, 0);
+ update_state(cpi, get_block_context(x, subsize), mi_row, mi_col,
+ subsize, 0);
encode_superblock(cpi, tp, 0, mi_row, mi_col, subsize);
*get_sb_index(x, subsize) = 1;
- pick_sb_modes(cpi, tile, mi_row, mi_col + (ms >> 1), &rt, &dt, subsize,
- get_block_context(x, subsize), INT64_MAX);
- if (rt == INT_MAX || dt == INT_MAX) {
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col + (ms >> 1), &rt, &dt,
+ subsize, get_block_context(x, subsize), INT64_MAX);
+ if (rt == INT_MAX || dt == INT64_MAX) {
last_part_rate = INT_MAX;
- last_part_dist = INT_MAX;
+ last_part_dist = INT64_MAX;
break;
}
last_part_rate += rt;
@@ -1159,9 +1756,9 @@ static void rd_use_partition(VP9_COMP *cpi,
rd_use_partition(cpi, tile, mi_8x8 + jj * bss * mis + ii * bss, tp,
mi_row + y_idx, mi_col + x_idx, subsize, &rt, &dt,
i != 3);
- if (rt == INT_MAX || dt == INT_MAX) {
+ if (rt == INT_MAX || dt == INT64_MAX) {
last_part_rate = INT_MAX;
- last_part_dist = INT_MAX;
+ last_part_dist = INT64_MAX;
break;
}
last_part_rate += rt;
@@ -1174,16 +1771,19 @@ static void rd_use_partition(VP9_COMP *cpi,
pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
- if (last_part_rate < INT_MAX)
+ if (last_part_rate < INT_MAX) {
last_part_rate += x->partition_cost[pl][partition];
+ last_part_rd = RDCOST(x->rdmult, x->rddiv, last_part_rate, last_part_dist);
+ }
if (cpi->sf.adjust_partitioning_from_last_frame
+ && cpi->sf.partition_search_type == SEARCH_PARTITION
&& partition != PARTITION_SPLIT && bsize > BLOCK_8X8
&& (mi_row + ms < cm->mi_rows || mi_row + (ms >> 1) == cm->mi_rows)
&& (mi_col + ms < cm->mi_cols || mi_col + (ms >> 1) == cm->mi_cols)) {
BLOCK_SIZE split_subsize = get_subsize(bsize, PARTITION_SPLIT);
- split_rate = 0;
- split_dist = 0;
+ chosen_rate = 0;
+ chosen_dist = 0;
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
// Split partition.
@@ -1204,51 +1804,50 @@ static void rd_use_partition(VP9_COMP *cpi,
save_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
- pick_sb_modes(cpi, tile, mi_row + y_idx, mi_col + x_idx, &rt, &dt,
- split_subsize, get_block_context(x, split_subsize),
- INT64_MAX);
+ rd_pick_sb_modes(cpi, tile, mi_row + y_idx, mi_col + x_idx, &rt, &dt,
+ split_subsize, get_block_context(x, split_subsize),
+ INT64_MAX);
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
- if (rt == INT_MAX || dt == INT_MAX) {
- split_rate = INT_MAX;
- split_dist = INT_MAX;
+ if (rt == INT_MAX || dt == INT64_MAX) {
+ chosen_rate = INT_MAX;
+ chosen_dist = INT64_MAX;
break;
}
+ chosen_rate += rt;
+ chosen_dist += dt;
+
if (i != 3)
encode_sb(cpi, tile, tp, mi_row + y_idx, mi_col + x_idx, 0,
split_subsize);
- split_rate += rt;
- split_dist += dt;
pl = partition_plane_context(cpi->above_seg_context,
cpi->left_seg_context,
- mi_row + y_idx, mi_col + x_idx, bsize);
- split_rate += x->partition_cost[pl][PARTITION_NONE];
+ mi_row + y_idx, mi_col + x_idx,
+ split_subsize);
+ chosen_rate += x->partition_cost[pl][PARTITION_NONE];
}
pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
mi_row, mi_col, bsize);
- if (split_rate < INT_MAX) {
- split_rate += x->partition_cost[pl][PARTITION_SPLIT];
-
- chosen_rate = split_rate;
- chosen_dist = split_dist;
+ if (chosen_rate < INT_MAX) {
+ chosen_rate += x->partition_cost[pl][PARTITION_SPLIT];
+ chosen_rd = RDCOST(x->rdmult, x->rddiv, chosen_rate, chosen_dist);
}
}
// If last_part is better set the partitioning to that...
- if (RDCOST(x->rdmult, x->rddiv, last_part_rate, last_part_dist)
- < RDCOST(x->rdmult, x->rddiv, chosen_rate, chosen_dist)) {
+ if (last_part_rd < chosen_rd) {
mi_8x8[0]->mbmi.sb_type = bsize;
if (bsize >= BLOCK_8X8)
*(get_sb_partitioning(x, bsize)) = subsize;
chosen_rate = last_part_rate;
chosen_dist = last_part_dist;
+ chosen_rd = last_part_rd;
}
// If none was better set the partitioning to that...
- if (RDCOST(x->rdmult, x->rddiv, chosen_rate, chosen_dist)
- > RDCOST(x->rdmult, x->rddiv, none_rate, none_dist)) {
+ if (none_rd < chosen_rd) {
if (bsize >= BLOCK_8X8)
*(get_sb_partitioning(x, bsize)) = bsize;
chosen_rate = none_rate;
@@ -1260,25 +1859,44 @@ static void rd_use_partition(VP9_COMP *cpi,
// We must have chosen a partitioning and encoding or we'll fail later on.
// No other opportunities for success.
if ( bsize == BLOCK_64X64)
- assert(chosen_rate < INT_MAX && chosen_dist < INT_MAX);
+ assert(chosen_rate < INT_MAX && chosen_dist < INT64_MAX);
+
+ if (do_recon) {
+ int output_enabled = (bsize == BLOCK_64X64);
+
+ // Check the projected output rate for this SB against it's target
+ // and and if necessary apply a Q delta using segmentation to get
+ // closer to the target.
+ if ((cpi->oxcf.aq_mode == COMPLEXITY_AQ) && cm->seg.update_map) {
+ select_in_frame_q_segment(cpi, mi_row, mi_col,
+ output_enabled, chosen_rate);
+ }
+ if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ cpi->cyclic_refresh.projected_rate_sb = chosen_rate;
+ cpi->cyclic_refresh.projected_dist_sb = chosen_dist;
+ }
- if (do_recon)
- encode_sb(cpi, tile, tp, mi_row, mi_col, bsize == BLOCK_64X64, bsize);
+ encode_sb(cpi, tile, tp, mi_row, mi_col, output_enabled, bsize);
+ }
*rate = chosen_rate;
*dist = chosen_dist;
}
static const BLOCK_SIZE min_partition_size[BLOCK_SIZES] = {
- BLOCK_4X4, BLOCK_4X4, BLOCK_4X4, BLOCK_4X4,
- BLOCK_4X4, BLOCK_4X4, BLOCK_8X8, BLOCK_8X8,
- BLOCK_8X8, BLOCK_16X16, BLOCK_16X16, BLOCK_16X16, BLOCK_16X16
+ BLOCK_4X4, BLOCK_4X4, BLOCK_4X4,
+ BLOCK_4X4, BLOCK_4X4, BLOCK_4X4,
+ BLOCK_8X8, BLOCK_8X8, BLOCK_8X8,
+ BLOCK_16X16, BLOCK_16X16, BLOCK_16X16,
+ BLOCK_16X16
};
static const BLOCK_SIZE max_partition_size[BLOCK_SIZES] = {
- BLOCK_8X8, BLOCK_16X16, BLOCK_16X16, BLOCK_16X16,
- BLOCK_32X32, BLOCK_32X32, BLOCK_32X32, BLOCK_64X64,
- BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, BLOCK_64X64, BLOCK_64X64
+ BLOCK_8X8, BLOCK_16X16, BLOCK_16X16,
+ BLOCK_16X16, BLOCK_32X32, BLOCK_32X32,
+ BLOCK_32X32, BLOCK_64X64, BLOCK_64X64,
+ BLOCK_64X64, BLOCK_64X64, BLOCK_64X64,
+ BLOCK_64X64
};
// Look at all the mode_info entries for blocks that are part of this
@@ -1309,6 +1927,15 @@ static void get_sb_partition_size_range(VP9_COMP *cpi, MODE_INFO ** mi_8x8,
}
}
+// Next square block size less or equal than current block size.
+static const BLOCK_SIZE next_square_size[BLOCK_SIZES] = {
+ BLOCK_4X4, BLOCK_4X4, BLOCK_4X4,
+ BLOCK_8X8, BLOCK_8X8, BLOCK_8X8,
+ BLOCK_16X16, BLOCK_16X16, BLOCK_16X16,
+ BLOCK_32X32, BLOCK_32X32, BLOCK_32X32,
+ BLOCK_64X64
+};
+
// Look at neighboring blocks and set a min and max partition size based on
// what they chose.
static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
@@ -1364,104 +1991,24 @@ static void rd_auto_partition_range(VP9_COMP *cpi, const TileInfo *const tile,
}
}
- // Give a bit of leaway either side of the observed min and max
- *min_block_size = min_partition_size[*min_block_size];
- *max_block_size = max_partition_size[*max_block_size];
+ // adjust observed min and max
+ if (cpi->sf.auto_min_max_partition_size == RELAXED_NEIGHBORING_MIN_MAX) {
+ *min_block_size = min_partition_size[*min_block_size];
+ *max_block_size = max_partition_size[*max_block_size];
+ }
// Check border cases where max and min from neighbours may not be legal.
*max_block_size = find_partition_size(*max_block_size,
row8x8_remaining, col8x8_remaining,
&bh, &bw);
*min_block_size = MIN(*min_block_size, *max_block_size);
-}
-
-static void compute_fast_motion_search_level(VP9_COMP *cpi, BLOCK_SIZE bsize) {
- VP9_COMMON *const cm = &cpi->common;
- MACROBLOCK *const x = &cpi->mb;
- // Only use 8x8 result for non HD videos.
- // int use_8x8 = (MIN(cpi->common.width, cpi->common.height) < 720) ? 1 : 0;
- int use_8x8 = 1;
-
- if (cm->frame_type && !cpi->is_src_frame_alt_ref &&
- ((use_8x8 && bsize == BLOCK_16X16) ||
- bsize == BLOCK_32X32 || bsize == BLOCK_64X64)) {
- int ref0 = 0, ref1 = 0, ref2 = 0, ref3 = 0;
- PICK_MODE_CONTEXT *block_context = NULL;
-
- if (bsize == BLOCK_16X16) {
- block_context = x->sb8x8_context[x->sb_index][x->mb_index];
- } else if (bsize == BLOCK_32X32) {
- block_context = x->mb_context[x->sb_index];
- } else if (bsize == BLOCK_64X64) {
- block_context = x->sb32_context;
- }
-
- if (block_context) {
- ref0 = block_context[0].mic.mbmi.ref_frame[0];
- ref1 = block_context[1].mic.mbmi.ref_frame[0];
- ref2 = block_context[2].mic.mbmi.ref_frame[0];
- ref3 = block_context[3].mic.mbmi.ref_frame[0];
- }
-
- // Currently, only consider 4 inter reference frames.
- if (ref0 && ref1 && ref2 && ref3) {
- int d01, d23, d02, d13;
-
- // Motion vectors for the four subblocks.
- int16_t mvr0 = block_context[0].mic.mbmi.mv[0].as_mv.row;
- int16_t mvc0 = block_context[0].mic.mbmi.mv[0].as_mv.col;
- int16_t mvr1 = block_context[1].mic.mbmi.mv[0].as_mv.row;
- int16_t mvc1 = block_context[1].mic.mbmi.mv[0].as_mv.col;
- int16_t mvr2 = block_context[2].mic.mbmi.mv[0].as_mv.row;
- int16_t mvc2 = block_context[2].mic.mbmi.mv[0].as_mv.col;
- int16_t mvr3 = block_context[3].mic.mbmi.mv[0].as_mv.row;
- int16_t mvc3 = block_context[3].mic.mbmi.mv[0].as_mv.col;
-
- // Adjust sign if ref is alt_ref.
- if (cm->ref_frame_sign_bias[ref0]) {
- mvr0 *= -1;
- mvc0 *= -1;
- }
-
- if (cm->ref_frame_sign_bias[ref1]) {
- mvr1 *= -1;
- mvc1 *= -1;
- }
-
- if (cm->ref_frame_sign_bias[ref2]) {
- mvr2 *= -1;
- mvc2 *= -1;
- }
-
- if (cm->ref_frame_sign_bias[ref3]) {
- mvr3 *= -1;
- mvc3 *= -1;
- }
-
- // Calculate mv distances.
- d01 = MAX(abs(mvr0 - mvr1), abs(mvc0 - mvc1));
- d23 = MAX(abs(mvr2 - mvr3), abs(mvc2 - mvc3));
- d02 = MAX(abs(mvr0 - mvr2), abs(mvc0 - mvc2));
- d13 = MAX(abs(mvr1 - mvr3), abs(mvc1 - mvc3));
-
- if (d01 < FAST_MOTION_MV_THRESH && d23 < FAST_MOTION_MV_THRESH &&
- d02 < FAST_MOTION_MV_THRESH && d13 < FAST_MOTION_MV_THRESH) {
- // Set fast motion search level.
- x->fast_ms = 1;
-
- if (ref0 == ref1 && ref1 == ref2 && ref2 == ref3 &&
- d01 < 2 && d23 < 2 && d02 < 2 && d13 < 2) {
- // Set fast motion search level.
- x->fast_ms = 2;
-
- if (!d01 && !d23 && !d02 && !d13) {
- x->fast_ms = 3;
- x->subblock_ref = ref0;
- }
- }
- }
- }
+ // When use_square_partition_only is true, make sure at least one square
+ // partition is allowed by selecting the next smaller square size as
+ // *min_block_size.
+ if (cpi->sf.use_square_partition_only &&
+ next_square_size[*max_block_size] < *min_block_size) {
+ *min_block_size = next_square_size[*max_block_size];
}
}
@@ -1486,6 +2033,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE];
PARTITION_CONTEXT sl[8], sa[8];
TOKENEXTRA *tp_orig = *tp;
+ PICK_MODE_CONTEXT *ctx = get_block_context(x, bsize);
int i, pl;
BLOCK_SIZE subsize;
int this_rate, sum_rate = 0, best_rate = INT_MAX;
@@ -1496,12 +2044,14 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
// Override skipping rectangular partition operations for edge blocks
const int force_horz_split = (mi_row + ms >= cm->mi_rows);
const int force_vert_split = (mi_col + ms >= cm->mi_cols);
+ const int xss = x->e_mbd.plane[1].subsampling_x;
+ const int yss = x->e_mbd.plane[1].subsampling_y;
int partition_none_allowed = !force_horz_split && !force_vert_split;
- int partition_horz_allowed = !force_vert_split && bsize >= BLOCK_8X8;
- int partition_vert_allowed = !force_horz_split && bsize >= BLOCK_8X8;
-
- int partition_split_done = 0;
+ int partition_horz_allowed = !force_vert_split && yss <= xss &&
+ bsize >= BLOCK_8X8;
+ int partition_vert_allowed = !force_horz_split && xss <= yss &&
+ bsize >= BLOCK_8X8;
(void) *tp_orig;
if (bsize < BLOCK_8X8) {
@@ -1552,10 +2102,12 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
}
}
+ if (!x->in_active_map && (partition_horz_allowed || partition_vert_allowed))
+ do_split = 0;
// PARTITION_NONE
if (partition_none_allowed) {
- pick_sb_modes(cpi, tile, mi_row, mi_col, &this_rate, &this_dist, bsize,
- get_block_context(x, bsize), best_rd);
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &this_rate, &this_dist, bsize,
+ ctx, best_rd);
if (this_rate != INT_MAX) {
if (bsize >= BLOCK_8X8) {
pl = partition_plane_context(cpi->above_seg_context,
@@ -1565,7 +2117,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
}
sum_rd = RDCOST(x->rdmult, x->rddiv, this_rate, this_dist);
if (sum_rd < best_rd) {
- int64_t stop_thresh = 2048;
+ int64_t stop_thresh = 4096;
+ int64_t stop_thresh_rd;
best_rate = this_rate;
best_dist = this_dist;
@@ -1577,20 +2130,25 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
stop_thresh >>= 8 - (b_width_log2_lookup[bsize] +
b_height_log2_lookup[bsize]);
+ stop_thresh_rd = RDCOST(x->rdmult, x->rddiv, 0, stop_thresh);
// If obtained distortion is very small, choose current partition
// and stop splitting.
- if (this_dist < stop_thresh) {
+ if (!x->e_mbd.lossless && best_rd < stop_thresh_rd) {
do_split = 0;
do_rect = 0;
}
}
}
+ if (!x->in_active_map) {
+ do_split = 0;
+ do_rect = 0;
+ }
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
}
// store estimated motion vector
if (cpi->sf.adaptive_motion_search)
- store_pred_mv(x, get_block_context(x, bsize));
+ store_pred_mv(x, ctx);
// PARTITION_SPLIT
sum_rd = 0;
@@ -1607,7 +2165,11 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
*get_sb_index(x, subsize) = i;
if (cpi->sf.adaptive_motion_search)
- load_pred_mv(x, get_block_context(x, bsize));
+ load_pred_mv(x, ctx);
+ if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_interp_filter =
+ ctx->mic.mbmi.interp_filter;
rd_pick_partition(cpi, tile, tp, mi_row + y_idx, mi_col + x_idx, subsize,
&this_rate, &this_dist, i != 3, best_rd - sum_rd);
@@ -1637,38 +2199,38 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
if (cpi->sf.less_rectangular_check)
do_rect &= !partition_none_allowed;
}
- partition_split_done = 1;
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
}
- x->fast_ms = 0;
- x->subblock_ref = 0;
-
- if (partition_split_done &&
- cpi->sf.using_small_partition_info) {
- compute_fast_motion_search_level(cpi, bsize);
- }
-
// PARTITION_HORZ
if (partition_horz_allowed && do_rect) {
subsize = get_subsize(bsize, PARTITION_HORZ);
*get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search)
- load_pred_mv(x, get_block_context(x, bsize));
- pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
- get_block_context(x, subsize), best_rd);
+ load_pred_mv(x, ctx);
+ if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_interp_filter =
+ ctx->mic.mbmi.interp_filter;
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
+ get_block_context(x, subsize), best_rd);
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
if (sum_rd < best_rd && mi_row + ms < cm->mi_rows) {
- update_state(cpi, get_block_context(x, subsize), subsize, 0);
+ update_state(cpi, get_block_context(x, subsize), mi_row, mi_col,
+ subsize, 0);
encode_superblock(cpi, tp, 0, mi_row, mi_col, subsize);
*get_sb_index(x, subsize) = 1;
if (cpi->sf.adaptive_motion_search)
- load_pred_mv(x, get_block_context(x, bsize));
- pick_sb_modes(cpi, tile, mi_row + ms, mi_col, &this_rate,
- &this_dist, subsize, get_block_context(x, subsize),
- best_rd - sum_rd);
+ load_pred_mv(x, ctx);
+ if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_interp_filter =
+ ctx->mic.mbmi.interp_filter;
+ rd_pick_sb_modes(cpi, tile, mi_row + ms, mi_col, &this_rate,
+ &this_dist, subsize, get_block_context(x, subsize),
+ best_rd - sum_rd);
if (this_rate == INT_MAX) {
sum_rd = INT64_MAX;
} else {
@@ -1699,20 +2261,29 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
*get_sb_index(x, subsize) = 0;
if (cpi->sf.adaptive_motion_search)
- load_pred_mv(x, get_block_context(x, bsize));
- pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
- get_block_context(x, subsize), best_rd);
+ load_pred_mv(x, ctx);
+ if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_interp_filter =
+ ctx->mic.mbmi.interp_filter;
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col, &sum_rate, &sum_dist, subsize,
+ get_block_context(x, subsize), best_rd);
sum_rd = RDCOST(x->rdmult, x->rddiv, sum_rate, sum_dist);
if (sum_rd < best_rd && mi_col + ms < cm->mi_cols) {
- update_state(cpi, get_block_context(x, subsize), subsize, 0);
+ update_state(cpi, get_block_context(x, subsize), mi_row, mi_col,
+ subsize, 0);
encode_superblock(cpi, tp, 0, mi_row, mi_col, subsize);
*get_sb_index(x, subsize) = 1;
if (cpi->sf.adaptive_motion_search)
- load_pred_mv(x, get_block_context(x, bsize));
- pick_sb_modes(cpi, tile, mi_row, mi_col + ms, &this_rate,
- &this_dist, subsize, get_block_context(x, subsize),
- best_rd - sum_rd);
+ load_pred_mv(x, ctx);
+ if (cpi->sf.adaptive_pred_interp_filter && bsize == BLOCK_8X8 &&
+ partition_none_allowed)
+ get_block_context(x, subsize)->pred_interp_filter =
+ ctx->mic.mbmi.interp_filter;
+ rd_pick_sb_modes(cpi, tile, mi_row, mi_col + ms, &this_rate,
+ &this_dist, subsize, get_block_context(x, subsize),
+ best_rd - sum_rd);
if (this_rate == INT_MAX) {
sum_rd = INT64_MAX;
} else {
@@ -1737,59 +2308,42 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
restore_context(cpi, mi_row, mi_col, a, l, sa, sl, bsize);
}
-
+ // TODO(jbb): This code added so that we avoid static analysis
+ // warning related to the fact that best_rd isn't used after this
+ // point. This code should be refactored so that the duplicate
+ // checks occur in some sub function and thus are used...
+ (void) best_rd;
*rate = best_rate;
*dist = best_dist;
- if (best_rate < INT_MAX && best_dist < INT64_MAX && do_recon)
- encode_sb(cpi, tile, tp, mi_row, mi_col, bsize == BLOCK_64X64, bsize);
+ if (best_rate < INT_MAX && best_dist < INT64_MAX && do_recon) {
+ int output_enabled = (bsize == BLOCK_64X64);
+
+ // Check the projected output rate for this SB against it's target
+ // and and if necessary apply a Q delta using segmentation to get
+ // closer to the target.
+ if ((cpi->oxcf.aq_mode == COMPLEXITY_AQ) && cm->seg.update_map) {
+ select_in_frame_q_segment(cpi, mi_row, mi_col, output_enabled, best_rate);
+ }
+ if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ cpi->cyclic_refresh.projected_rate_sb = best_rate;
+ cpi->cyclic_refresh.projected_dist_sb = best_dist;
+ }
+
+ encode_sb(cpi, tile, tp, mi_row, mi_col, output_enabled, bsize);
+ }
if (bsize == BLOCK_64X64) {
assert(tp_orig < *tp);
assert(best_rate < INT_MAX);
- assert(best_dist < INT_MAX);
+ assert(best_dist < INT64_MAX);
} else {
assert(tp_orig == *tp);
}
}
-// Examines 64x64 block and chooses a best reference frame
-static void rd_pick_reference_frame(VP9_COMP *cpi, const TileInfo *const tile,
- int mi_row, int mi_col) {
- VP9_COMMON * const cm = &cpi->common;
- MACROBLOCK * const x = &cpi->mb;
- int bsl = b_width_log2(BLOCK_64X64), bs = 1 << bsl;
- int ms = bs / 2;
- ENTROPY_CONTEXT l[16 * MAX_MB_PLANE], a[16 * MAX_MB_PLANE];
- PARTITION_CONTEXT sl[8], sa[8];
- int pl;
- int r;
- int64_t d;
-
- save_context(cpi, mi_row, mi_col, a, l, sa, sl, BLOCK_64X64);
-
- // Default is non mask (all reference frames allowed.
- cpi->ref_frame_mask = 0;
-
- // Do RD search for 64x64.
- if ((mi_row + (ms >> 1) < cm->mi_rows) &&
- (mi_col + (ms >> 1) < cm->mi_cols)) {
- cpi->set_ref_frame_mask = 1;
- pick_sb_modes(cpi, tile, mi_row, mi_col, &r, &d, BLOCK_64X64,
- get_block_context(x, BLOCK_64X64), INT64_MAX);
- pl = partition_plane_context(cpi->above_seg_context, cpi->left_seg_context,
- mi_row, mi_col, BLOCK_64X64);
- r += x->partition_cost[pl][PARTITION_NONE];
-
- *(get_sb_partitioning(x, BLOCK_64X64)) = BLOCK_64X64;
- cpi->set_ref_frame_mask = 0;
- }
-
- restore_context(cpi, mi_row, mi_col, a, l, sa, sl, BLOCK_64X64);
-}
-
-static void encode_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
- int mi_row, TOKENEXTRA **tp) {
- VP9_COMMON * const cm = &cpi->common;
+static void encode_rd_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
+ int mi_row, TOKENEXTRA **tp) {
+ VP9_COMMON *const cm = &cpi->common;
int mi_col;
// Initialize the left context for the new SB row
@@ -1802,33 +2356,58 @@ static void encode_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
int dummy_rate;
int64_t dummy_dist;
- vp9_zero(cpi->mb.pred_mv);
+ BLOCK_SIZE i;
+ MACROBLOCK *x = &cpi->mb;
+
+ if (cpi->sf.adaptive_pred_interp_filter) {
+ for (i = BLOCK_4X4; i < BLOCK_8X8; ++i) {
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[i];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[i];
+ const int num_4x4_blk = MAX(4, num_4x4_w * num_4x4_h);
+ for (x->sb_index = 0; x->sb_index < 4; ++x->sb_index)
+ for (x->mb_index = 0; x->mb_index < 4; ++x->mb_index)
+ for (x->b_index = 0; x->b_index < 16 / num_4x4_blk; ++x->b_index)
+ get_block_context(x, i)->pred_interp_filter = SWITCHABLE;
+ }
+ }
- if (cpi->sf.reference_masking)
- rd_pick_reference_frame(cpi, tile, mi_row, mi_col);
+ vp9_zero(cpi->mb.pred_mv);
- if (cpi->sf.use_lastframe_partitioning ||
- cpi->sf.use_one_partition_size_always ) {
+ if ((cpi->sf.partition_search_type == SEARCH_PARTITION &&
+ cpi->sf.use_lastframe_partitioning) ||
+ cpi->sf.partition_search_type == FIXED_PARTITION ||
+ cpi->sf.partition_search_type == VAR_BASED_FIXED_PARTITION) {
const int idx_str = cm->mode_info_stride * mi_row + mi_col;
MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
-
cpi->mb.source_variance = UINT_MAX;
- if (cpi->sf.use_one_partition_size_always) {
+ if (cpi->sf.partition_search_type == FIXED_PARTITION) {
set_offsets(cpi, tile, mi_row, mi_col, BLOCK_64X64);
- set_partitioning(cpi, tile, mi_8x8, mi_row, mi_col);
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col,
+ cpi->sf.always_this_block_size);
+ rd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
+ &dummy_rate, &dummy_dist, 1);
+ } else if (cpi->sf.partition_search_type == VAR_BASED_FIXED_PARTITION) {
+ BLOCK_SIZE bsize;
+ set_offsets(cpi, tile, mi_row, mi_col, BLOCK_64X64);
+ bsize = get_rd_var_based_fixed_partition(cpi, mi_row, mi_col);
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, bsize);
+ rd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
+ &dummy_rate, &dummy_dist, 1);
+ } else if (cpi->sf.partition_search_type == VAR_BASED_PARTITION) {
+ choose_partitioning(cpi, tile, mi_row, mi_col);
rd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
&dummy_rate, &dummy_dist, 1);
} else {
- if ((cpi->common.current_video_frame
+ if ((cm->current_video_frame
% cpi->sf.last_partitioning_redo_frequency) == 0
|| cm->prev_mi == 0
- || cpi->common.show_frame == 0
- || cpi->common.frame_type == KEY_FRAME
- || cpi->is_src_frame_alt_ref
+ || cm->show_frame == 0
+ || cm->frame_type == KEY_FRAME
+ || cpi->rc.is_src_frame_alt_ref
|| ((cpi->sf.use_lastframe_partitioning ==
LAST_FRAME_PARTITION_LOW_MOTION) &&
- sb_has_motion(cpi, prev_mi_8x8))) {
+ sb_has_motion(cm, prev_mi_8x8))) {
// If required set upper and lower partition size limits
if (cpi->sf.auto_min_max_partition_size) {
set_offsets(cpi, tile, mi_row, mi_col, BLOCK_64X64);
@@ -1839,7 +2418,7 @@ static void encode_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
rd_pick_partition(cpi, tile, tp, mi_row, mi_col, BLOCK_64X64,
&dummy_rate, &dummy_dist, 1, INT64_MAX);
} else {
- copy_partitioning(cpi, mi_8x8, prev_mi_8x8);
+ copy_partitioning(cm, mi_8x8, prev_mi_8x8);
rd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
&dummy_rate, &dummy_dist, 1);
}
@@ -1869,33 +2448,29 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
xd->mode_info_stride = cm->mode_info_stride;
- // reset intra mode contexts
- if (frame_is_intra_only(cm))
- vp9_init_mbmode_probs(cm);
-
// Copy data over into macro block data structures.
vp9_setup_src_planes(x, cpi->Source, 0, 0);
// TODO(jkoleszar): are these initializations required?
- setup_pre_planes(xd, 0, &cm->yv12_fb[cm->ref_frame_map[cpi->lst_fb_idx]],
- 0, 0, NULL);
- setup_dst_planes(xd, get_frame_new_buffer(cm), 0, 0);
+ vp9_setup_pre_planes(xd, 0, get_ref_frame_buffer(cpi, LAST_FRAME), 0, 0,
+ NULL);
+ vp9_setup_dst_planes(xd, get_frame_new_buffer(cm), 0, 0);
- setup_block_dptrs(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
+ vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
xd->mi_8x8[0]->mbmi.mode = DC_PRED;
xd->mi_8x8[0]->mbmi.uv_mode = DC_PRED;
- vp9_zero(cpi->y_mode_count);
- vp9_zero(cpi->y_uv_mode_count);
+ vp9_zero(cm->counts.y_mode);
+ vp9_zero(cm->counts.uv_mode);
vp9_zero(cm->counts.inter_mode);
- vp9_zero(cpi->partition_count);
- vp9_zero(cpi->intra_inter_count);
- vp9_zero(cpi->comp_inter_count);
- vp9_zero(cpi->single_ref_count);
- vp9_zero(cpi->comp_ref_count);
+ vp9_zero(cm->counts.partition);
+ vp9_zero(cm->counts.intra_inter);
+ vp9_zero(cm->counts.comp_inter);
+ vp9_zero(cm->counts.single_ref);
+ vp9_zero(cm->counts.comp_ref);
vp9_zero(cm->counts.tx);
- vp9_zero(cm->counts.mbskip);
+ vp9_zero(cm->counts.skip);
// Note: this memset assumes above_context[0], [1] and [2]
// are allocated as part of the same buffer.
@@ -1922,125 +2497,6 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
}
}
-static void switch_tx_mode(VP9_COMP *cpi) {
- if (cpi->sf.tx_size_search_method == USE_LARGESTALL &&
- cpi->common.tx_mode >= ALLOW_32X32)
- cpi->common.tx_mode = ALLOW_32X32;
-}
-
-static void encode_frame_internal(VP9_COMP *cpi) {
- int mi_row;
- MACROBLOCK * const x = &cpi->mb;
- VP9_COMMON * const cm = &cpi->common;
- MACROBLOCKD * const xd = &x->e_mbd;
-
-// fprintf(stderr, "encode_frame_internal frame %d (%d) type %d\n",
-// cpi->common.current_video_frame, cpi->common.show_frame,
-// cm->frame_type);
-
-// debug output
-#if DBG_PRNT_SEGMAP
- {
- FILE *statsfile;
- statsfile = fopen("segmap2.stt", "a");
- fprintf(statsfile, "\n");
- fclose(statsfile);
- }
-#endif
-
- vp9_zero(cm->counts.switchable_interp);
- vp9_zero(cpi->tx_stepdown_count);
-
- xd->mi_8x8 = cm->mi_grid_visible;
- // required for vp9_frame_init_quantizer
- xd->mi_8x8[0] = cm->mi;
-
- xd->last_mi = cm->prev_mi;
-
- vp9_zero(cpi->NMVcount);
- vp9_zero(cpi->coef_counts);
- vp9_zero(cm->counts.eob_branch);
-
- cpi->mb.e_mbd.lossless = cm->base_qindex == 0 && cm->y_dc_delta_q == 0
- && cm->uv_dc_delta_q == 0 && cm->uv_ac_delta_q == 0;
- switch_lossless_mode(cpi, cpi->mb.e_mbd.lossless);
-
- vp9_frame_init_quantizer(cpi);
-
- vp9_initialize_rd_consts(cpi);
- vp9_initialize_me_consts(cpi, cm->base_qindex);
- switch_tx_mode(cpi);
-
- if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
- // Initialize encode frame context.
- init_encode_frame_mb_context(cpi);
-
- // Build a frame level activity map
- build_activity_map(cpi);
- }
-
- // Re-initialize encode frame context.
- init_encode_frame_mb_context(cpi);
-
- vp9_zero(cpi->rd_comp_pred_diff);
- vp9_zero(cpi->rd_filter_diff);
- vp9_zero(cpi->rd_tx_select_diff);
- vp9_zero(cpi->rd_tx_select_threshes);
-
- set_prev_mi(cm);
-
- {
- struct vpx_usec_timer emr_timer;
- vpx_usec_timer_start(&emr_timer);
-
- {
- // Take tiles into account and give start/end MB
- int tile_col, tile_row;
- TOKENEXTRA *tp = cpi->tok;
- const int tile_cols = 1 << cm->log2_tile_cols;
- const int tile_rows = 1 << cm->log2_tile_rows;
-
- for (tile_row = 0; tile_row < tile_rows; tile_row++) {
- for (tile_col = 0; tile_col < tile_cols; tile_col++) {
- TileInfo tile;
- TOKENEXTRA *tp_old = tp;
-
- // For each row of SBs in the frame
- vp9_tile_init(&tile, cm, tile_row, tile_col);
- for (mi_row = tile.mi_row_start;
- mi_row < tile.mi_row_end; mi_row += 8)
- encode_sb_row(cpi, &tile, mi_row, &tp);
-
- cpi->tok_count[tile_row][tile_col] = (unsigned int)(tp - tp_old);
- assert(tp - cpi->tok <= get_token_alloc(cm->mb_rows, cm->mb_cols));
- }
- }
- }
-
- vpx_usec_timer_mark(&emr_timer);
- cpi->time_encode_sb_row += vpx_usec_timer_elapsed(&emr_timer);
- }
-
- if (cpi->sf.skip_encode_sb) {
- int j;
- unsigned int intra_count = 0, inter_count = 0;
- for (j = 0; j < INTRA_INTER_CONTEXTS; ++j) {
- intra_count += cpi->intra_inter_count[j][0];
- inter_count += cpi->intra_inter_count[j][1];
- }
- cpi->sf.skip_encode_frame = ((intra_count << 2) < inter_count);
- cpi->sf.skip_encode_frame &= (cm->frame_type != KEY_FRAME);
- cpi->sf.skip_encode_frame &= cm->show_frame;
- } else {
- cpi->sf.skip_encode_frame = 0;
- }
-
-#if 0
- // Keep record of the total distortion this time around for future use
- cpi->last_frame_distortion = cpi->frame_distortion;
-#endif
-}
-
static int check_dual_ref_flags(VP9_COMP *cpi) {
const int ref_flags = cpi->ref_frame_flags;
@@ -2057,7 +2513,7 @@ static int get_skip_flag(MODE_INFO **mi_8x8, int mis, int ymbs, int xmbs) {
for (y = 0; y < ymbs; y++) {
for (x = 0; x < xmbs; x++) {
- if (!mi_8x8[y * mis + x]->mbmi.skip_coeff)
+ if (!mi_8x8[y * mis + x]->mbmi.skip)
return 0;
}
}
@@ -2075,15 +2531,14 @@ static void set_txfm_flag(MODE_INFO **mi_8x8, int mis, int ymbs, int xmbs,
}
}
-static void reset_skip_txfm_size_b(VP9_COMP *cpi, MODE_INFO **mi_8x8,
- int mis, TX_SIZE max_tx_size, int bw, int bh,
- int mi_row, int mi_col, BLOCK_SIZE bsize) {
- VP9_COMMON * const cm = &cpi->common;
-
+static void reset_skip_txfm_size_b(const VP9_COMMON *cm, int mis,
+ TX_SIZE max_tx_size, int bw, int bh,
+ int mi_row, int mi_col,
+ MODE_INFO **mi_8x8) {
if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols) {
return;
} else {
- MB_MODE_INFO * const mbmi = &mi_8x8[0]->mbmi;
+ const MB_MODE_INFO *const mbmi = &mi_8x8[0]->mbmi;
if (mbmi->tx_size > max_tx_size) {
const int ymbs = MIN(bh, cm->mi_rows - mi_row);
const int xmbs = MIN(bw, cm->mi_cols - mi_col);
@@ -2095,10 +2550,9 @@ static void reset_skip_txfm_size_b(VP9_COMP *cpi, MODE_INFO **mi_8x8,
}
}
-static void reset_skip_txfm_size_sb(VP9_COMP *cpi, MODE_INFO **mi_8x8,
+static void reset_skip_txfm_size_sb(VP9_COMMON *cm, MODE_INFO **mi_8x8,
TX_SIZE max_tx_size, int mi_row, int mi_col,
BLOCK_SIZE bsize) {
- VP9_COMMON * const cm = &cpi->common;
const int mis = cm->mode_info_stride;
int bw, bh;
const int bs = num_8x8_blocks_wide_lookup[bsize], hbs = bs / 2;
@@ -2110,19 +2564,18 @@ static void reset_skip_txfm_size_sb(VP9_COMP *cpi, MODE_INFO **mi_8x8,
bh = num_8x8_blocks_high_lookup[mi_8x8[0]->mbmi.sb_type];
if (bw == bs && bh == bs) {
- reset_skip_txfm_size_b(cpi, mi_8x8, mis, max_tx_size, bs, bs, mi_row,
- mi_col, bsize);
+ reset_skip_txfm_size_b(cm, mis, max_tx_size, bs, bs, mi_row, mi_col,
+ mi_8x8);
} else if (bw == bs && bh < bs) {
- reset_skip_txfm_size_b(cpi, mi_8x8, mis, max_tx_size, bs, hbs, mi_row,
- mi_col, bsize);
- reset_skip_txfm_size_b(cpi, mi_8x8 + hbs * mis, mis, max_tx_size, bs, hbs,
- mi_row + hbs, mi_col, bsize);
+ reset_skip_txfm_size_b(cm, mis, max_tx_size, bs, hbs, mi_row, mi_col,
+ mi_8x8);
+ reset_skip_txfm_size_b(cm, mis, max_tx_size, bs, hbs, mi_row + hbs,
+ mi_col, mi_8x8 + hbs * mis);
} else if (bw < bs && bh == bs) {
- reset_skip_txfm_size_b(cpi, mi_8x8, mis, max_tx_size, hbs, bs, mi_row,
- mi_col, bsize);
- reset_skip_txfm_size_b(cpi, mi_8x8 + hbs, mis, max_tx_size, hbs, bs, mi_row,
- mi_col + hbs, bsize);
-
+ reset_skip_txfm_size_b(cm, mis, max_tx_size, hbs, bs, mi_row, mi_col,
+ mi_8x8);
+ reset_skip_txfm_size_b(cm, mis, max_tx_size, hbs, bs, mi_row,
+ mi_col + hbs, mi_8x8 + hbs);
} else {
const BLOCK_SIZE subsize = subsize_lookup[PARTITION_SPLIT][bsize];
int n;
@@ -2133,71 +2586,420 @@ static void reset_skip_txfm_size_sb(VP9_COMP *cpi, MODE_INFO **mi_8x8,
const int mi_dc = hbs * (n & 1);
const int mi_dr = hbs * (n >> 1);
- reset_skip_txfm_size_sb(cpi, &mi_8x8[mi_dr * mis + mi_dc], max_tx_size,
+ reset_skip_txfm_size_sb(cm, &mi_8x8[mi_dr * mis + mi_dc], max_tx_size,
mi_row + mi_dr, mi_col + mi_dc, subsize);
}
}
}
-static void reset_skip_txfm_size(VP9_COMP *cpi, TX_SIZE txfm_max) {
- VP9_COMMON * const cm = &cpi->common;
+static void reset_skip_txfm_size(VP9_COMMON *cm, TX_SIZE txfm_max) {
int mi_row, mi_col;
const int mis = cm->mode_info_stride;
-// MODE_INFO *mi, *mi_ptr = cm->mi;
MODE_INFO **mi_8x8, **mi_ptr = cm->mi_grid_visible;
for (mi_row = 0; mi_row < cm->mi_rows; mi_row += 8, mi_ptr += 8 * mis) {
mi_8x8 = mi_ptr;
for (mi_col = 0; mi_col < cm->mi_cols; mi_col += 8, mi_8x8 += 8) {
- reset_skip_txfm_size_sb(cpi, mi_8x8, txfm_max, mi_row, mi_col,
+ reset_skip_txfm_size_sb(cm, mi_8x8, txfm_max, mi_row, mi_col,
BLOCK_64X64);
}
}
}
-static int get_frame_type(VP9_COMP *cpi) {
- int frame_type;
+static MV_REFERENCE_FRAME get_frame_type(const VP9_COMP *cpi) {
if (frame_is_intra_only(&cpi->common))
- frame_type = 0;
- else if (cpi->is_src_frame_alt_ref && cpi->refresh_golden_frame)
- frame_type = 3;
+ return INTRA_FRAME;
+ else if (cpi->rc.is_src_frame_alt_ref && cpi->refresh_golden_frame)
+ return ALTREF_FRAME;
else if (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)
- frame_type = 1;
+ return LAST_FRAME;
else
- frame_type = 2;
- return frame_type;
+ return GOLDEN_FRAME;
}
-static void select_tx_mode(VP9_COMP *cpi) {
+static TX_MODE select_tx_mode(const VP9_COMP *cpi) {
if (cpi->oxcf.lossless) {
- cpi->common.tx_mode = ONLY_4X4;
+ return ONLY_4X4;
} else if (cpi->common.current_video_frame == 0) {
- cpi->common.tx_mode = TX_MODE_SELECT;
+ return TX_MODE_SELECT;
} else {
if (cpi->sf.tx_size_search_method == USE_LARGESTALL) {
- cpi->common.tx_mode = ALLOW_32X32;
+ return ALLOW_32X32;
} else if (cpi->sf.tx_size_search_method == USE_FULL_RD) {
- int frame_type = get_frame_type(cpi);
- cpi->common.tx_mode =
- cpi->rd_tx_select_threshes[frame_type][ALLOW_32X32]
- > cpi->rd_tx_select_threshes[frame_type][TX_MODE_SELECT] ?
- ALLOW_32X32 : TX_MODE_SELECT;
+ const MV_REFERENCE_FRAME frame_type = get_frame_type(cpi);
+ return cpi->rd_tx_select_threshes[frame_type][ALLOW_32X32] >
+ cpi->rd_tx_select_threshes[frame_type][TX_MODE_SELECT] ?
+ ALLOW_32X32 : TX_MODE_SELECT;
} else {
unsigned int total = 0;
int i;
for (i = 0; i < TX_SIZES; ++i)
total += cpi->tx_stepdown_count[i];
+
if (total) {
- double fraction = (double)cpi->tx_stepdown_count[0] / total;
- cpi->common.tx_mode = fraction > 0.90 ? ALLOW_32X32 : TX_MODE_SELECT;
- // printf("fraction = %f\n", fraction);
- } // else keep unchanged
+ const double fraction = (double)cpi->tx_stepdown_count[0] / total;
+ return fraction > 0.90 ? ALLOW_32X32 : TX_MODE_SELECT;
+ } else {
+ return cpi->common.tx_mode;
+ }
}
}
}
+// Start RTC Exploration
+typedef enum {
+ BOTH_ZERO = 0,
+ ZERO_PLUS_PREDICTED = 1,
+ BOTH_PREDICTED = 2,
+ NEW_PLUS_NON_INTRA = 3,
+ BOTH_NEW = 4,
+ INTRA_PLUS_NON_INTRA = 5,
+ BOTH_INTRA = 6,
+ INVALID_CASE = 9
+} motion_vector_context;
+
+static void set_mode_info(MB_MODE_INFO *mbmi, BLOCK_SIZE bsize,
+ MB_PREDICTION_MODE mode) {
+ mbmi->mode = mode;
+ mbmi->uv_mode = mode;
+ mbmi->mv[0].as_int = 0;
+ mbmi->mv[1].as_int = 0;
+ mbmi->ref_frame[0] = INTRA_FRAME;
+ mbmi->ref_frame[1] = NONE;
+ mbmi->tx_size = max_txsize_lookup[bsize];
+ mbmi->skip = 0;
+ mbmi->sb_type = bsize;
+ mbmi->segment_id = 0;
+}
+
+static void nonrd_pick_sb_modes(VP9_COMP *cpi, const TileInfo *const tile,
+ int mi_row, int mi_col,
+ int *rate, int64_t *dist,
+ BLOCK_SIZE bsize) {
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCK *const x = &cpi->mb;
+ MACROBLOCKD *const xd = &x->e_mbd;
+ set_offsets(cpi, tile, mi_row, mi_col, bsize);
+ xd->mi_8x8[0]->mbmi.sb_type = bsize;
+
+ if (!frame_is_intra_only(cm)) {
+ vp9_pick_inter_mode(cpi, x, tile, mi_row, mi_col,
+ rate, dist, bsize);
+ } else {
+ MB_PREDICTION_MODE intramode = DC_PRED;
+ set_mode_info(&xd->mi_8x8[0]->mbmi, bsize, intramode);
+ }
+ duplicate_modeinfo_in_sb(cm, xd, mi_row, mi_col, bsize);
+}
+
+static void nonrd_use_partition(VP9_COMP *cpi,
+ const TileInfo *const tile,
+ MODE_INFO **mi_8x8,
+ TOKENEXTRA **tp,
+ int mi_row, int mi_col,
+ BLOCK_SIZE bsize, int output_enabled,
+ int *totrate, int64_t *totdist) {
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCK *const x = &cpi->mb;
+ const int bsl = b_width_log2(bsize), hbs = (1 << bsl) / 4;
+ const int mis = cm->mode_info_stride;
+ PARTITION_TYPE partition;
+ BLOCK_SIZE subsize;
+ int rate;
+ int64_t dist;
+
+ if (mi_row >= cm->mi_rows || mi_col >= cm->mi_cols)
+ return;
+
+ if (bsize >= BLOCK_8X8) {
+ subsize = mi_8x8[0]->mbmi.sb_type;
+ } else {
+ subsize = BLOCK_4X4;
+ }
+
+ partition = partition_lookup[bsl][subsize];
+
+ switch (partition) {
+ case PARTITION_NONE:
+ nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
+ break;
+ case PARTITION_VERT:
+ *get_sb_index(x, subsize) = 0;
+ nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
+ if (mi_col + hbs < cm->mi_cols) {
+ *get_sb_index(x, subsize) = 1;
+ nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col + hbs,
+ &rate, &dist, subsize);
+ if (rate != INT_MAX && dist != INT64_MAX &&
+ *totrate != INT_MAX && *totdist != INT64_MAX) {
+ *totrate += rate;
+ *totdist += dist;
+ }
+ }
+ break;
+ case PARTITION_HORZ:
+ *get_sb_index(x, subsize) = 0;
+ nonrd_pick_sb_modes(cpi, tile, mi_row, mi_col, totrate, totdist, subsize);
+ if (mi_row + hbs < cm->mi_rows) {
+ *get_sb_index(x, subsize) = 1;
+ nonrd_pick_sb_modes(cpi, tile, mi_row + hbs, mi_col,
+ &rate, &dist, subsize);
+ if (rate != INT_MAX && dist != INT64_MAX &&
+ *totrate != INT_MAX && *totdist != INT64_MAX) {
+ *totrate += rate;
+ *totdist += dist;
+ }
+ }
+ break;
+ case PARTITION_SPLIT:
+ subsize = get_subsize(bsize, PARTITION_SPLIT);
+
+ *get_sb_index(x, subsize) = 0;
+ nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col,
+ subsize, output_enabled, totrate, totdist);
+ *get_sb_index(x, subsize) = 1;
+ nonrd_use_partition(cpi, tile, mi_8x8 + hbs, tp,
+ mi_row, mi_col + hbs, subsize, output_enabled,
+ &rate, &dist);
+ if (rate != INT_MAX && dist != INT64_MAX &&
+ *totrate != INT_MAX && *totdist != INT64_MAX) {
+ *totrate += rate;
+ *totdist += dist;
+ }
+ *get_sb_index(x, subsize) = 2;
+ nonrd_use_partition(cpi, tile, mi_8x8 + hbs * mis, tp,
+ mi_row + hbs, mi_col, subsize, output_enabled,
+ &rate, &dist);
+ if (rate != INT_MAX && dist != INT64_MAX &&
+ *totrate != INT_MAX && *totdist != INT64_MAX) {
+ *totrate += rate;
+ *totdist += dist;
+ }
+ *get_sb_index(x, subsize) = 3;
+ nonrd_use_partition(cpi, tile, mi_8x8 + hbs * mis + hbs, tp,
+ mi_row + hbs, mi_col + hbs, subsize, output_enabled,
+ &rate, &dist);
+ if (rate != INT_MAX && dist != INT64_MAX &&
+ *totrate != INT_MAX && *totdist != INT64_MAX) {
+ *totrate += rate;
+ *totdist += dist;
+ }
+ break;
+ default:
+ assert("Invalid partition type.");
+ }
+
+ if (bsize == BLOCK_64X64 && output_enabled) {
+ if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ cpi->cyclic_refresh.projected_rate_sb = *totrate;
+ cpi->cyclic_refresh.projected_dist_sb = *totdist;
+ }
+ encode_sb_rt(cpi, tile, tp, mi_row, mi_col, 1, bsize);
+ }
+}
+
+static void encode_nonrd_sb_row(VP9_COMP *cpi, const TileInfo *const tile,
+ int mi_row, TOKENEXTRA **tp) {
+ VP9_COMMON *cm = &cpi->common;
+ int mi_col;
+
+ // Initialize the left context for the new SB row
+ vpx_memset(&cpi->left_context, 0, sizeof(cpi->left_context));
+ vpx_memset(cpi->left_seg_context, 0, sizeof(cpi->left_seg_context));
+
+ // Code each SB in the row
+ for (mi_col = tile->mi_col_start; mi_col < tile->mi_col_end;
+ mi_col += MI_BLOCK_SIZE) {
+ int dummy_rate;
+ int64_t dummy_dist;
+ const int idx_str = cm->mode_info_stride * mi_row + mi_col;
+ MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str;
+ MODE_INFO **prev_mi_8x8 = cm->prev_mi_grid_visible + idx_str;
+
+ BLOCK_SIZE bsize = cpi->sf.partition_search_type == FIXED_PARTITION ?
+ cpi->sf.always_this_block_size :
+ get_nonrd_var_based_fixed_partition(cpi, mi_row, mi_col);
+
+ cpi->mb.source_variance = UINT_MAX;
+
+ // Set the partition type of the 64X64 block
+ if (cpi->sf.partition_search_type == VAR_BASED_PARTITION)
+ choose_partitioning(cpi, tile, mi_row, mi_col);
+ else if (cpi->sf.partition_search_type == REFERENCE_PARTITION) {
+ if (cpi->sf.partition_check) {
+ MACROBLOCK *x = &cpi->mb;
+ int rate1, rate2, rate3;
+ int64_t dist1, dist2, dist3;
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, BLOCK_8X8);
+ nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
+ 0, &rate1, &dist1);
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, BLOCK_16X16);
+ nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
+ 0, &rate2, &dist2);
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, BLOCK_32X32);
+ nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64,
+ 0, &rate3, &dist3);
+
+ if (RDCOST(x->rdmult, x->rddiv, rate1, dist1) <
+ RDCOST(x->rdmult, x->rddiv, rate2, dist2)) {
+ if (RDCOST(x->rdmult, x->rddiv, rate1, dist1) <
+ RDCOST(x->rdmult, x->rddiv, rate3, dist3))
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col,
+ BLOCK_8X8);
+ else
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col,
+ BLOCK_32X32);
+ } else {
+ if (RDCOST(x->rdmult, x->rddiv, rate2, dist2) <
+ RDCOST(x->rdmult, x->rddiv, rate3, dist3))
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col,
+ BLOCK_16X16);
+ else
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col,
+ BLOCK_32X32);
+ }
+
+ } else {
+ if (!sb_has_motion(cm, prev_mi_8x8))
+ copy_partitioning(cm, mi_8x8, prev_mi_8x8);
+ else
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, bsize);
+ }
+ }
+ else
+ set_fixed_partitioning(cpi, tile, mi_8x8, mi_row, mi_col, bsize);
+
+ nonrd_use_partition(cpi, tile, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64, 1,
+ &dummy_rate, &dummy_dist);
+ }
+}
+// end RTC play code
+
+static void encode_frame_internal(VP9_COMP *cpi) {
+ int mi_row;
+ MACROBLOCK *const x = &cpi->mb;
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCKD *const xd = &x->e_mbd;
+
+// fprintf(stderr, "encode_frame_internal frame %d (%d) type %d\n",
+// cpi->common.current_video_frame, cpi->common.show_frame,
+// cm->frame_type);
+
+ vp9_zero(cm->counts.switchable_interp);
+ vp9_zero(cpi->tx_stepdown_count);
+
+ xd->mi_8x8 = cm->mi_grid_visible;
+ // required for vp9_frame_init_quantizer
+ xd->mi_8x8[0] = cm->mi;
+
+ vp9_zero(cm->counts.mv);
+ vp9_zero(cpi->coef_counts);
+ vp9_zero(cm->counts.eob_branch);
+
+ // Set frame level transform size use case
+ cm->tx_mode = select_tx_mode(cpi);
+
+ cpi->mb.e_mbd.lossless = cm->base_qindex == 0 && cm->y_dc_delta_q == 0
+ && cm->uv_dc_delta_q == 0 && cm->uv_ac_delta_q == 0;
+ switch_lossless_mode(cpi, cpi->mb.e_mbd.lossless);
+
+ vp9_frame_init_quantizer(cpi);
+
+ vp9_initialize_rd_consts(cpi);
+ vp9_initialize_me_consts(cpi, cm->base_qindex);
+
+ if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
+ // Initialize encode frame context.
+ init_encode_frame_mb_context(cpi);
+
+ // Build a frame level activity map
+ build_activity_map(cpi);
+ }
+
+ // Re-initialize encode frame context.
+ init_encode_frame_mb_context(cpi);
+
+ vp9_zero(cpi->rd_comp_pred_diff);
+ vp9_zero(cpi->rd_filter_diff);
+ vp9_zero(cpi->rd_tx_select_diff);
+ vp9_zero(cpi->rd_tx_select_threshes);
+
+ set_prev_mi(cm);
+
+ if (cpi->sf.use_nonrd_pick_mode) {
+ // Initialize internal buffer pointers for rtc coding, where non-RD
+ // mode decision is used and hence no buffer pointer swap needed.
+ int i;
+ struct macroblock_plane *const p = x->plane;
+ struct macroblockd_plane *const pd = xd->plane;
+ PICK_MODE_CONTEXT *ctx = &cpi->mb.sb64_context;
+
+ for (i = 0; i < MAX_MB_PLANE; ++i) {
+ p[i].coeff = ctx->coeff_pbuf[i][0];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][0];
+ pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][0];
+ p[i].eobs = ctx->eobs_pbuf[i][0];
+ }
+ vp9_zero(x->zcoeff_blk);
+ }
+
+ {
+ struct vpx_usec_timer emr_timer;
+ vpx_usec_timer_start(&emr_timer);
+
+ {
+ // Take tiles into account and give start/end MB
+ int tile_col, tile_row;
+ TOKENEXTRA *tp = cpi->tok;
+ const int tile_cols = 1 << cm->log2_tile_cols;
+ const int tile_rows = 1 << cm->log2_tile_rows;
+
+ for (tile_row = 0; tile_row < tile_rows; tile_row++) {
+ for (tile_col = 0; tile_col < tile_cols; tile_col++) {
+ TileInfo tile;
+ TOKENEXTRA *tp_old = tp;
+
+ // For each row of SBs in the frame
+ vp9_tile_init(&tile, cm, tile_row, tile_col);
+ for (mi_row = tile.mi_row_start;
+ mi_row < tile.mi_row_end; mi_row += MI_BLOCK_SIZE) {
+ if (cpi->sf.use_nonrd_pick_mode && cm->frame_type != KEY_FRAME)
+ encode_nonrd_sb_row(cpi, &tile, mi_row, &tp);
+ else
+ encode_rd_sb_row(cpi, &tile, mi_row, &tp);
+ }
+ cpi->tok_count[tile_row][tile_col] = (unsigned int)(tp - tp_old);
+ assert(tp - cpi->tok <= get_token_alloc(cm->mb_rows, cm->mb_cols));
+ }
+ }
+ }
+
+ vpx_usec_timer_mark(&emr_timer);
+ cpi->time_encode_sb_row += vpx_usec_timer_elapsed(&emr_timer);
+ }
+
+ if (cpi->sf.skip_encode_sb) {
+ int j;
+ unsigned int intra_count = 0, inter_count = 0;
+ for (j = 0; j < INTRA_INTER_CONTEXTS; ++j) {
+ intra_count += cm->counts.intra_inter[j][0];
+ inter_count += cm->counts.intra_inter[j][1];
+ }
+ cpi->sf.skip_encode_frame = (intra_count << 2) < inter_count &&
+ cm->frame_type != KEY_FRAME &&
+ cm->show_frame;
+ } else {
+ cpi->sf.skip_encode_frame = 0;
+ }
+
+#if 0
+ // Keep record of the total distortion this time around for future use
+ cpi->last_frame_distortion = cpi->frame_distortion;
+#endif
+}
+
void vp9_encode_frame(VP9_COMP *cpi) {
- VP9_COMMON * const cm = &cpi->common;
+ VP9_COMMON *const cm = &cpi->common;
// In the longer term the encoder should be generalized to match the
// decoder such that we allow compound where one of the 3 buffers has a
@@ -2206,10 +3008,10 @@ void vp9_encode_frame(VP9_COMP *cpi) {
// side behavior is where the ALT ref buffer has opposite sign bias to
// the other two.
if (!frame_is_intra_only(cm)) {
- if ((cm->ref_frame_sign_bias[ALTREF_FRAME]
- == cm->ref_frame_sign_bias[GOLDEN_FRAME])
- || (cm->ref_frame_sign_bias[ALTREF_FRAME]
- == cm->ref_frame_sign_bias[LAST_FRAME])) {
+ if ((cm->ref_frame_sign_bias[ALTREF_FRAME] ==
+ cm->ref_frame_sign_bias[GOLDEN_FRAME]) ||
+ (cm->ref_frame_sign_bias[ALTREF_FRAME] ==
+ cm->ref_frame_sign_bias[LAST_FRAME])) {
cm->allow_comp_inter_inter = 0;
} else {
cm->allow_comp_inter_inter = 1;
@@ -2219,9 +3021,9 @@ void vp9_encode_frame(VP9_COMP *cpi) {
}
}
- if (cpi->sf.RD) {
- int i, pred_type;
- INTERPOLATION_TYPE filter_type;
+ if (cpi->sf.frame_parameter_update) {
+ int i;
+ REFERENCE_MODE reference_mode;
/*
* This code does a single RD pass over the whole frame assuming
* either compound, single or hybrid prediction as per whatever has
@@ -2231,66 +3033,51 @@ void vp9_encode_frame(VP9_COMP *cpi) {
* that for subsequent frames.
* It does the same analysis for transform size selection also.
*/
- int frame_type = get_frame_type(cpi);
+ const MV_REFERENCE_FRAME frame_type = get_frame_type(cpi);
+ const int64_t *mode_thresh = cpi->rd_prediction_type_threshes[frame_type];
+ const int64_t *filter_thresh = cpi->rd_filter_threshes[frame_type];
/* prediction (compound, single or hybrid) mode selection */
if (frame_type == 3 || !cm->allow_comp_inter_inter)
- pred_type = SINGLE_PREDICTION_ONLY;
- else if (cpi->rd_prediction_type_threshes[frame_type][1]
- > cpi->rd_prediction_type_threshes[frame_type][0]
- && cpi->rd_prediction_type_threshes[frame_type][1]
- > cpi->rd_prediction_type_threshes[frame_type][2]
- && check_dual_ref_flags(cpi) && cpi->static_mb_pct == 100)
- pred_type = COMP_PREDICTION_ONLY;
- else if (cpi->rd_prediction_type_threshes[frame_type][0]
- > cpi->rd_prediction_type_threshes[frame_type][2])
- pred_type = SINGLE_PREDICTION_ONLY;
+ reference_mode = SINGLE_REFERENCE;
+ else if (mode_thresh[COMPOUND_REFERENCE] > mode_thresh[SINGLE_REFERENCE] &&
+ mode_thresh[COMPOUND_REFERENCE] >
+ mode_thresh[REFERENCE_MODE_SELECT] &&
+ check_dual_ref_flags(cpi) &&
+ cpi->static_mb_pct == 100)
+ reference_mode = COMPOUND_REFERENCE;
+ else if (mode_thresh[SINGLE_REFERENCE] > mode_thresh[REFERENCE_MODE_SELECT])
+ reference_mode = SINGLE_REFERENCE;
else
- pred_type = HYBRID_PREDICTION;
-
- /* filter type selection */
- // FIXME(rbultje) for some odd reason, we often select smooth_filter
- // as default filter for ARF overlay frames. This is a REALLY BAD
- // IDEA so we explicitly disable it here.
- if (frame_type != 3 &&
- cpi->rd_filter_threshes[frame_type][1] >
- cpi->rd_filter_threshes[frame_type][0] &&
- cpi->rd_filter_threshes[frame_type][1] >
- cpi->rd_filter_threshes[frame_type][2] &&
- cpi->rd_filter_threshes[frame_type][1] >
- cpi->rd_filter_threshes[frame_type][SWITCHABLE_FILTERS]) {
- filter_type = EIGHTTAP_SMOOTH;
- } else if (cpi->rd_filter_threshes[frame_type][2] >
- cpi->rd_filter_threshes[frame_type][0] &&
- cpi->rd_filter_threshes[frame_type][2] >
- cpi->rd_filter_threshes[frame_type][SWITCHABLE_FILTERS]) {
- filter_type = EIGHTTAP_SHARP;
- } else if (cpi->rd_filter_threshes[frame_type][0] >
- cpi->rd_filter_threshes[frame_type][SWITCHABLE_FILTERS]) {
- filter_type = EIGHTTAP;
- } else {
- filter_type = SWITCHABLE;
+ reference_mode = REFERENCE_MODE_SELECT;
+
+ if (cm->interp_filter == SWITCHABLE) {
+ if (frame_type != ALTREF_FRAME &&
+ filter_thresh[EIGHTTAP_SMOOTH] > filter_thresh[EIGHTTAP] &&
+ filter_thresh[EIGHTTAP_SMOOTH] > filter_thresh[EIGHTTAP_SHARP] &&
+ filter_thresh[EIGHTTAP_SMOOTH] > filter_thresh[SWITCHABLE - 1]) {
+ cm->interp_filter = EIGHTTAP_SMOOTH;
+ } else if (filter_thresh[EIGHTTAP_SHARP] > filter_thresh[EIGHTTAP] &&
+ filter_thresh[EIGHTTAP_SHARP] > filter_thresh[SWITCHABLE - 1]) {
+ cm->interp_filter = EIGHTTAP_SHARP;
+ } else if (filter_thresh[EIGHTTAP] > filter_thresh[SWITCHABLE - 1]) {
+ cm->interp_filter = EIGHTTAP;
+ }
}
- cpi->mb.e_mbd.lossless = 0;
- if (cpi->oxcf.lossless) {
- cpi->mb.e_mbd.lossless = 1;
- }
+ cpi->mb.e_mbd.lossless = cpi->oxcf.lossless;
+ cm->reference_mode = reference_mode;
- /* transform size selection (4x4, 8x8, 16x16 or select-per-mb) */
- select_tx_mode(cpi);
- cpi->common.comp_pred_mode = pred_type;
- cpi->common.mcomp_filter_type = filter_type;
encode_frame_internal(cpi);
- for (i = 0; i < NB_PREDICTION_TYPES; ++i) {
- const int diff = (int) (cpi->rd_comp_pred_diff[i] / cpi->common.MBs);
+ for (i = 0; i < REFERENCE_MODES; ++i) {
+ const int diff = (int) (cpi->rd_comp_pred_diff[i] / cm->MBs);
cpi->rd_prediction_type_threshes[frame_type][i] += diff;
cpi->rd_prediction_type_threshes[frame_type][i] >>= 1;
}
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
- const int64_t diff = cpi->rd_filter_diff[i] / cpi->common.MBs;
+ const int64_t diff = cpi->rd_filter_diff[i] / cm->MBs;
cpi->rd_filter_threshes[frame_type][i] =
(cpi->rd_filter_threshes[frame_type][i] + diff) / 2;
}
@@ -2299,32 +3086,31 @@ void vp9_encode_frame(VP9_COMP *cpi) {
int64_t pd = cpi->rd_tx_select_diff[i];
int diff;
if (i == TX_MODE_SELECT)
- pd -= RDCOST(cpi->mb.rdmult, cpi->mb.rddiv,
- 2048 * (TX_SIZES - 1), 0);
- diff = (int) (pd / cpi->common.MBs);
+ pd -= RDCOST(cpi->mb.rdmult, cpi->mb.rddiv, 2048 * (TX_SIZES - 1), 0);
+ diff = (int) (pd / cm->MBs);
cpi->rd_tx_select_threshes[frame_type][i] += diff;
cpi->rd_tx_select_threshes[frame_type][i] /= 2;
}
- if (cpi->common.comp_pred_mode == HYBRID_PREDICTION) {
+ if (cm->reference_mode == REFERENCE_MODE_SELECT) {
int single_count_zero = 0;
int comp_count_zero = 0;
for (i = 0; i < COMP_INTER_CONTEXTS; i++) {
- single_count_zero += cpi->comp_inter_count[i][0];
- comp_count_zero += cpi->comp_inter_count[i][1];
+ single_count_zero += cm->counts.comp_inter[i][0];
+ comp_count_zero += cm->counts.comp_inter[i][1];
}
if (comp_count_zero == 0) {
- cpi->common.comp_pred_mode = SINGLE_PREDICTION_ONLY;
- vp9_zero(cpi->comp_inter_count);
+ cm->reference_mode = SINGLE_REFERENCE;
+ vp9_zero(cm->counts.comp_inter);
} else if (single_count_zero == 0) {
- cpi->common.comp_pred_mode = COMP_PREDICTION_ONLY;
- vp9_zero(cpi->comp_inter_count);
+ cm->reference_mode = COMPOUND_REFERENCE;
+ vp9_zero(cm->counts.comp_inter);
}
}
- if (cpi->common.tx_mode == TX_MODE_SELECT) {
+ if (cm->tx_mode == TX_MODE_SELECT) {
int count4x4 = 0;
int count8x8_lp = 0, count8x8_8x8p = 0;
int count16x16_16x16p = 0, count16x16_lp = 0;
@@ -2344,43 +3130,47 @@ void vp9_encode_frame(VP9_COMP *cpi) {
count32x32 += cm->counts.tx.p32x32[i][TX_32X32];
}
- if (count4x4 == 0 && count16x16_lp == 0 && count16x16_16x16p == 0
- && count32x32 == 0) {
- cpi->common.tx_mode = ALLOW_8X8;
- reset_skip_txfm_size(cpi, TX_8X8);
- } else if (count8x8_8x8p == 0 && count16x16_16x16p == 0
- && count8x8_lp == 0 && count16x16_lp == 0 && count32x32 == 0) {
- cpi->common.tx_mode = ONLY_4X4;
- reset_skip_txfm_size(cpi, TX_4X4);
+ if (count4x4 == 0 && count16x16_lp == 0 && count16x16_16x16p == 0 &&
+ count32x32 == 0) {
+ cm->tx_mode = ALLOW_8X8;
+ reset_skip_txfm_size(cm, TX_8X8);
+ } else if (count8x8_8x8p == 0 && count16x16_16x16p == 0 &&
+ count8x8_lp == 0 && count16x16_lp == 0 && count32x32 == 0) {
+ cm->tx_mode = ONLY_4X4;
+ reset_skip_txfm_size(cm, TX_4X4);
} else if (count8x8_lp == 0 && count16x16_lp == 0 && count4x4 == 0) {
- cpi->common.tx_mode = ALLOW_32X32;
+ cm->tx_mode = ALLOW_32X32;
} else if (count32x32 == 0 && count8x8_lp == 0 && count4x4 == 0) {
- cpi->common.tx_mode = ALLOW_16X16;
- reset_skip_txfm_size(cpi, TX_16X16);
+ cm->tx_mode = ALLOW_16X16;
+ reset_skip_txfm_size(cm, TX_16X16);
}
}
} else {
+ cpi->mb.e_mbd.lossless = cpi->oxcf.lossless;
+ cm->reference_mode = SINGLE_REFERENCE;
+ // Force the usage of the BILINEAR interp_filter.
+ cm->interp_filter = BILINEAR;
encode_frame_internal(cpi);
}
}
-static void sum_intra_stats(VP9_COMP *cpi, const MODE_INFO *mi) {
+static void sum_intra_stats(FRAME_COUNTS *counts, const MODE_INFO *mi) {
const MB_PREDICTION_MODE y_mode = mi->mbmi.mode;
const MB_PREDICTION_MODE uv_mode = mi->mbmi.uv_mode;
const BLOCK_SIZE bsize = mi->mbmi.sb_type;
- ++cpi->y_uv_mode_count[y_mode][uv_mode];
-
if (bsize < BLOCK_8X8) {
int idx, idy;
- const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
- const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
- for (idy = 0; idy < 2; idy += num_4x4_blocks_high)
- for (idx = 0; idx < 2; idx += num_4x4_blocks_wide)
- ++cpi->y_mode_count[0][mi->bmi[idy * 2 + idx].as_mode];
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[bsize];
+ for (idy = 0; idy < 2; idy += num_4x4_h)
+ for (idx = 0; idx < 2; idx += num_4x4_w)
+ ++counts->y_mode[0][mi->bmi[idy * 2 + idx].as_mode];
} else {
- ++cpi->y_mode_count[size_group_lookup[bsize]][y_mode];
+ ++counts->y_mode[size_group_lookup[bsize]][y_mode];
}
+
+ ++counts->uv_mode[y_mode][uv_mode];
}
// Experimental stub function to create a per MB zbin adjustment based on
@@ -2389,13 +3179,10 @@ static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x) {
#if USE_ACT_INDEX
x->act_zbin_adj = *(x->mb_activity_ptr);
#else
- int64_t a;
- int64_t b;
- int64_t act = *(x->mb_activity_ptr);
-
// Apply the masking to the RD multiplier.
- a = act + 4 * cpi->activity_avg;
- b = 4 * act + cpi->activity_avg;
+ const int64_t act = *(x->mb_activity_ptr);
+ const int64_t a = act + 4 * cpi->activity_avg;
+ const int64_t b = 4 * act + cpi->activity_avg;
if (act > cpi->activity_avg)
x->act_zbin_adj = (int) (((int64_t) b + (a >> 1)) / a) - 1;
@@ -2403,11 +3190,30 @@ static void adjust_act_zbin(VP9_COMP *cpi, MACROBLOCK *x) {
x->act_zbin_adj = 1 - (int) (((int64_t) a + (b >> 1)) / b);
#endif
}
+
+static int get_zbin_mode_boost(const MB_MODE_INFO *mbmi, int enabled) {
+ if (enabled) {
+ if (is_inter_block(mbmi)) {
+ if (mbmi->mode == ZEROMV) {
+ return mbmi->ref_frame[0] != LAST_FRAME ? GF_ZEROMV_ZBIN_BOOST
+ : LF_ZEROMV_ZBIN_BOOST;
+ } else {
+ return mbmi->sb_type < BLOCK_8X8 ? SPLIT_MV_ZBIN_BOOST
+ : MV_ZBIN_BOOST;
+ }
+ } else {
+ return INTRA_ZBIN_BOOST;
+ }
+ } else {
+ return 0;
+ }
+}
+
static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
int mi_row, int mi_col, BLOCK_SIZE bsize) {
- VP9_COMMON * const cm = &cpi->common;
- MACROBLOCK * const x = &cpi->mb;
- MACROBLOCKD * const xd = &x->e_mbd;
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCK *const x = &cpi->mb;
+ MACROBLOCKD *const xd = &x->e_mbd;
MODE_INFO **mi_8x8 = xd->mi_8x8;
MODE_INFO *mi = mi_8x8[0];
MB_MODE_INFO *mbmi = &mi->mbmi;
@@ -2416,12 +3222,17 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
const int mis = cm->mode_info_stride;
const int mi_width = num_8x8_blocks_wide_lookup[bsize];
const int mi_height = num_8x8_blocks_high_lookup[bsize];
- x->skip_recode = !x->select_txfm_size && mbmi->sb_type >= BLOCK_8X8;
+
+ x->skip_recode = !x->select_txfm_size && mbmi->sb_type >= BLOCK_8X8 &&
+ (cpi->oxcf.aq_mode != COMPLEXITY_AQ &&
+ cpi->oxcf.aq_mode != CYCLIC_REFRESH_AQ) &&
+ !cpi->sf.use_nonrd_pick_mode;
x->skip_optimize = ctx->is_coded;
ctx->is_coded = 1;
x->use_lp32x32fdct = cpi->sf.use_lp32x32fdct;
x->skip_encode = (!output_enabled && cpi->sf.skip_encode_frame &&
x->q_index < QIDX_SKIP_THRESH);
+
if (x->skip_encode)
return;
@@ -2431,7 +3242,8 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
vp9_update_zbin_extra(cpi, x);
}
} else {
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
// Adjust the zbin based on this MB rate.
@@ -2440,98 +3252,65 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
// Experimental code. Special case for gf and arf zeromv modes.
// Increase zbin size to suppress noise
- cpi->zbin_mode_boost = 0;
- if (cpi->zbin_mode_boost_enabled) {
- if (is_inter_block(mbmi)) {
- if (mbmi->mode == ZEROMV) {
- if (mbmi->ref_frame[0] != LAST_FRAME)
- cpi->zbin_mode_boost = GF_ZEROMV_ZBIN_BOOST;
- else
- cpi->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST;
- } else if (mbmi->sb_type < BLOCK_8X8) {
- cpi->zbin_mode_boost = SPLIT_MV_ZBIN_BOOST;
- } else {
- cpi->zbin_mode_boost = MV_ZBIN_BOOST;
- }
- } else {
- cpi->zbin_mode_boost = INTRA_ZBIN_BOOST;
- }
- }
-
+ cpi->zbin_mode_boost = get_zbin_mode_boost(mbmi,
+ cpi->zbin_mode_boost_enabled);
vp9_update_zbin_extra(cpi, x);
}
if (!is_inter_block(mbmi)) {
- vp9_encode_intra_block_y(x, MAX(bsize, BLOCK_8X8));
- vp9_encode_intra_block_uv(x, MAX(bsize, BLOCK_8X8));
+ int plane;
+ mbmi->skip = 1;
+ for (plane = 0; plane < MAX_MB_PLANE; ++plane)
+ vp9_encode_intra_block_plane(x, MAX(bsize, BLOCK_8X8), plane);
if (output_enabled)
- sum_intra_stats(cpi, mi);
+ sum_intra_stats(&cm->counts, mi);
+ vp9_tokenize_sb(cpi, t, !output_enabled, MAX(bsize, BLOCK_8X8));
} else {
- int idx = cm->ref_frame_map[get_ref_frame_idx(cpi, mbmi->ref_frame[0])];
- YV12_BUFFER_CONFIG *ref_fb = &cm->yv12_fb[idx];
- YV12_BUFFER_CONFIG *second_ref_fb = NULL;
- if (has_second_ref(mbmi)) {
- idx = cm->ref_frame_map[get_ref_frame_idx(cpi, mbmi->ref_frame[1])];
- second_ref_fb = &cm->yv12_fb[idx];
+ int ref;
+ const int is_compound = has_second_ref(mbmi);
+ for (ref = 0; ref < 1 + is_compound; ++ref) {
+ YV12_BUFFER_CONFIG *cfg = get_ref_frame_buffer(cpi,
+ mbmi->ref_frame[ref]);
+ vp9_setup_pre_planes(xd, ref, cfg, mi_row, mi_col,
+ &xd->block_refs[ref]->sf);
}
-
- assert(cm->frame_type != KEY_FRAME);
-
- setup_pre_planes(xd, 0, ref_fb, mi_row, mi_col,
- &xd->scale_factor[0]);
- setup_pre_planes(xd, 1, second_ref_fb, mi_row, mi_col,
- &xd->scale_factor[1]);
-
vp9_build_inter_predictors_sb(xd, mi_row, mi_col, MAX(bsize, BLOCK_8X8));
- }
-
- if (!is_inter_block(mbmi)) {
- vp9_tokenize_sb(cpi, t, !output_enabled, MAX(bsize, BLOCK_8X8));
- } else if (!x->skip) {
- vp9_encode_sb(x, MAX(bsize, BLOCK_8X8));
- vp9_tokenize_sb(cpi, t, !output_enabled, MAX(bsize, BLOCK_8X8));
- } else {
- int mb_skip_context = xd->left_available ? mi_8x8[-1]->mbmi.skip_coeff : 0;
- mb_skip_context += mi_8x8[-mis] ? mi_8x8[-mis]->mbmi.skip_coeff : 0;
- mbmi->skip_coeff = 1;
- if (output_enabled)
- cm->counts.mbskip[mb_skip_context][1]++;
- reset_skip_context(xd, MAX(bsize, BLOCK_8X8));
+ if (!x->skip) {
+ mbmi->skip = 1;
+ vp9_encode_sb(x, MAX(bsize, BLOCK_8X8));
+ vp9_tokenize_sb(cpi, t, !output_enabled, MAX(bsize, BLOCK_8X8));
+ } else {
+ mbmi->skip = 1;
+ if (output_enabled)
+ cm->counts.skip[vp9_get_skip_context(xd)][1]++;
+ reset_skip_context(xd, MAX(bsize, BLOCK_8X8));
+ }
}
if (output_enabled) {
if (cm->tx_mode == TX_MODE_SELECT &&
mbmi->sb_type >= BLOCK_8X8 &&
!(is_inter_block(mbmi) &&
- (mbmi->skip_coeff ||
+ (mbmi->skip ||
vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP)))) {
- const uint8_t context = vp9_get_pred_context_tx_size(xd);
- ++get_tx_counts(max_txsize_lookup[bsize],
- context, &cm->counts.tx)[mbmi->tx_size];
+ ++get_tx_counts(max_txsize_lookup[bsize], vp9_get_tx_size_context(xd),
+ &cm->counts.tx)[mbmi->tx_size];
} else {
int x, y;
- TX_SIZE sz = tx_mode_to_biggest_tx_size[cm->tx_mode];
- assert(sizeof(tx_mode_to_biggest_tx_size) /
- sizeof(tx_mode_to_biggest_tx_size[0]) == TX_MODES);
+ TX_SIZE tx_size;
// The new intra coding scheme requires no change of transform size
if (is_inter_block(&mi->mbmi)) {
- if (sz == TX_32X32 && bsize < BLOCK_32X32)
- sz = TX_16X16;
- if (sz == TX_16X16 && bsize < BLOCK_16X16)
- sz = TX_8X8;
- if (sz == TX_8X8 && bsize < BLOCK_8X8)
- sz = TX_4X4;
- } else if (bsize >= BLOCK_8X8) {
- sz = mbmi->tx_size;
+ tx_size = MIN(tx_mode_to_biggest_tx_size[cm->tx_mode],
+ max_txsize_lookup[bsize]);
} else {
- sz = TX_4X4;
+ tx_size = (bsize >= BLOCK_8X8) ? mbmi->tx_size : TX_4X4;
}
for (y = 0; y < mi_height; y++)
for (x = 0; x < mi_width; x++)
if (mi_col + x < cm->mi_cols && mi_row + y < cm->mi_rows)
- mi_8x8[mis * y + x]->mbmi.tx_size = sz;
+ mi_8x8[mis * y + x]->mbmi.tx_size = tx_size;
}
}
}
diff --git a/libvpx/vp9/encoder/vp9_encodeframe.h b/libvpx/vp9/encoder/vp9_encodeframe.h
index 3e9f538..72343cd 100644
--- a/libvpx/vp9/encoder/vp9_encodeframe.h
+++ b/libvpx/vp9/encoder/vp9_encodeframe.h
@@ -12,11 +12,22 @@
#ifndef VP9_ENCODER_VP9_ENCODEFRAME_H_
#define VP9_ENCODER_VP9_ENCODEFRAME_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct macroblock;
struct yv12_buffer_config;
+struct VP9_COMP;
void vp9_setup_src_planes(struct macroblock *x,
const struct yv12_buffer_config *src,
int mi_row, int mi_col);
+void vp9_encode_frame(struct VP9_COMP *cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_ENCODEFRAME_H_
diff --git a/libvpx/vp9/encoder/vp9_encodeintra.c b/libvpx/vp9/encoder/vp9_encodeintra.c
deleted file mode 100644
index 32b4593..0000000
--- a/libvpx/vp9/encoder/vp9_encodeintra.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "./vpx_config.h"
-#include "./vp9_rtcd.h"
-#include "vp9/encoder/vp9_quantize.h"
-#include "vp9/common/vp9_reconintra.h"
-#include "vp9/encoder/vp9_encodemb.h"
-#include "vp9/encoder/vp9_encodeintra.h"
-
-int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred) {
- MB_MODE_INFO * mbmi = &x->e_mbd.mi_8x8[0]->mbmi;
- x->skip_encode = 0;
- mbmi->mode = DC_PRED;
- mbmi->ref_frame[0] = INTRA_FRAME;
- mbmi->tx_size = use_16x16_pred ? (mbmi->sb_type >= BLOCK_16X16 ? TX_16X16
- : TX_8X8)
- : TX_4X4;
- vp9_encode_intra_block_y(x, mbmi->sb_type);
- return vp9_get_mb_ss(x->plane[0].src_diff);
-}
diff --git a/libvpx/vp9/encoder/vp9_encodeintra.h b/libvpx/vp9/encoder/vp9_encodeintra.h
deleted file mode 100644
index e217924..0000000
--- a/libvpx/vp9/encoder/vp9_encodeintra.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef VP9_ENCODER_VP9_ENCODEINTRA_H_
-#define VP9_ENCODER_VP9_ENCODEINTRA_H_
-
-#include "vp9/encoder/vp9_onyx_int.h"
-
-int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred);
-void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, void *arg);
-
-#endif // VP9_ENCODER_VP9_ENCODEINTRA_H_
diff --git a/libvpx/vp9/encoder/vp9_encodemb.c b/libvpx/vp9/encoder/vp9_encodemb.c
index a85ddee..fae03bf 100644
--- a/libvpx/vp9/encoder/vp9_encodemb.c
+++ b/libvpx/vp9/encoder/vp9_encodemb.c
@@ -19,56 +19,49 @@
#include "vp9/common/vp9_reconintra.h"
#include "vp9/common/vp9_systemdependent.h"
-#include "vp9/encoder/vp9_dct.h"
#include "vp9/encoder/vp9_encodemb.h"
#include "vp9/encoder/vp9_quantize.h"
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_tokenize.h"
+struct optimize_ctx {
+ ENTROPY_CONTEXT ta[MAX_MB_PLANE][16];
+ ENTROPY_CONTEXT tl[MAX_MB_PLANE][16];
+};
+
+struct encode_b_args {
+ MACROBLOCK *x;
+ struct optimize_ctx *ctx;
+ unsigned char *skip;
+};
+
void vp9_subtract_block_c(int rows, int cols,
- int16_t *diff_ptr, ptrdiff_t diff_stride,
- const uint8_t *src_ptr, ptrdiff_t src_stride,
- const uint8_t *pred_ptr, ptrdiff_t pred_stride) {
+ int16_t *diff, ptrdiff_t diff_stride,
+ const uint8_t *src, ptrdiff_t src_stride,
+ const uint8_t *pred, ptrdiff_t pred_stride) {
int r, c;
for (r = 0; r < rows; r++) {
for (c = 0; c < cols; c++)
- diff_ptr[c] = src_ptr[c] - pred_ptr[c];
+ diff[c] = src[c] - pred[c];
- diff_ptr += diff_stride;
- pred_ptr += pred_stride;
- src_ptr += src_stride;
+ diff += diff_stride;
+ pred += pred_stride;
+ src += src_stride;
}
}
-static void subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
+void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
struct macroblock_plane *const p = &x->plane[plane];
- const MACROBLOCKD *const xd = &x->e_mbd;
- const struct macroblockd_plane *const pd = &xd->plane[plane];
- const int bw = plane_block_width(bsize, pd);
- const int bh = plane_block_height(bsize, pd);
+ const struct macroblockd_plane *const pd = &x->e_mbd.plane[plane];
+ const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
+ const int bw = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
+ const int bh = 4 * num_4x4_blocks_high_lookup[plane_bsize];
- vp9_subtract_block(bh, bw, p->src_diff, bw,
- p->src.buf, p->src.stride,
+ vp9_subtract_block(bh, bw, p->src_diff, bw, p->src.buf, p->src.stride,
pd->dst.buf, pd->dst.stride);
}
-void vp9_subtract_sby(MACROBLOCK *x, BLOCK_SIZE bsize) {
- subtract_plane(x, bsize, 0);
-}
-
-void vp9_subtract_sbuv(MACROBLOCK *x, BLOCK_SIZE bsize) {
- int i;
-
- for (i = 1; i < MAX_MB_PLANE; i++)
- subtract_plane(x, bsize, i);
-}
-
-void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
- vp9_subtract_sby(x, bsize);
- vp9_subtract_sbuv(x, bsize);
-}
-
#define RDTRUNC(RM, DM, R, D) ((128 + (R) * (RM)) & 0xFF)
typedef struct vp9_token_state vp9_token_state;
@@ -112,19 +105,19 @@ static int trellis_get_coeff_context(const int16_t *scan,
return pt;
}
-static void optimize_b(MACROBLOCK *mb,
- int plane, int block, BLOCK_SIZE plane_bsize,
- ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
- TX_SIZE tx_size) {
+static void optimize_b(int plane, int block, BLOCK_SIZE plane_bsize,
+ TX_SIZE tx_size, MACROBLOCK *mb,
+ ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l) {
MACROBLOCKD *const xd = &mb->e_mbd;
+ struct macroblock_plane *p = &mb->plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
const int ref = is_inter_block(&xd->mi_8x8[0]->mbmi);
vp9_token_state tokens[1025][2];
unsigned best_index[1025][2];
- const int16_t *coeff_ptr = BLOCK_OFFSET(mb->plane[plane].coeff, block);
- int16_t *qcoeff_ptr;
- int16_t *dqcoeff_ptr;
- int eob = pd->eobs[block], final_eob, sz = 0;
+ const int16_t *coeff = BLOCK_OFFSET(mb->plane[plane].coeff, block);
+ int16_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
+ int16_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
+ int eob = p->eobs[block], final_eob, sz = 0;
const int i0 = 0;
int rc, x, next, i;
int64_t rdmult, rddiv, rd_cost0, rd_cost1;
@@ -133,40 +126,39 @@ static void optimize_b(MACROBLOCK *mb,
PLANE_TYPE type = pd->plane_type;
int err_mult = plane_rd_mult[type];
const int default_eob = 16 << (tx_size << 1);
- const int16_t *scan, *nb;
const int mul = 1 + (tx_size == TX_32X32);
uint8_t token_cache[1024];
const int16_t *dequant_ptr = pd->dequant;
const uint8_t *const band_translate = get_band_translate(tx_size);
+ const scan_order *so = get_scan(xd, tx_size, type, block);
+ const int16_t *scan = so->scan;
+ const int16_t *nb = so->neighbors;
assert((!type && !plane) || (type && plane));
- dqcoeff_ptr = BLOCK_OFFSET(pd->dqcoeff, block);
- qcoeff_ptr = BLOCK_OFFSET(pd->qcoeff, block);
- get_scan(xd, tx_size, type, block, &scan, &nb);
assert(eob <= default_eob);
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
rdmult = mb->rdmult * err_mult;
- if (mb->e_mbd.mi_8x8[0]->mbmi.ref_frame[0] == INTRA_FRAME)
+ if (!is_inter_block(&mb->e_mbd.mi_8x8[0]->mbmi))
rdmult = (rdmult * 9) >> 4;
rddiv = mb->rddiv;
/* Initialize the sentinel node of the trellis. */
tokens[eob][0].rate = 0;
tokens[eob][0].error = 0;
tokens[eob][0].next = default_eob;
- tokens[eob][0].token = DCT_EOB_TOKEN;
+ tokens[eob][0].token = EOB_TOKEN;
tokens[eob][0].qc = 0;
*(tokens[eob] + 1) = *(tokens[eob] + 0);
next = eob;
for (i = 0; i < eob; i++)
token_cache[scan[i]] = vp9_pt_energy_class[vp9_dct_value_tokens_ptr[
- qcoeff_ptr[scan[i]]].token];
+ qcoeff[scan[i]]].token];
for (i = eob; i-- > i0;) {
int base_bits, d2, dx;
rc = scan[i];
- x = qcoeff_ptr[rc];
+ x = qcoeff[rc];
/* Only add a trellis state for non-zero coefficients. */
if (x) {
int shortcut = 0;
@@ -191,7 +183,7 @@ static void optimize_b(MACROBLOCK *mb,
/* And pick the best. */
best = rd_cost1 < rd_cost0;
base_bits = *(vp9_dct_value_cost_ptr + x);
- dx = mul * (dqcoeff_ptr[rc] - coeff_ptr[rc]);
+ dx = mul * (dqcoeff[rc] - coeff[rc]);
d2 = dx * dx;
tokens[i][0].rate = base_bits + (best ? rate1 : rate0);
tokens[i][0].error = d2 + (best ? error1 : error0);
@@ -204,8 +196,8 @@ static void optimize_b(MACROBLOCK *mb,
rate0 = tokens[next][0].rate;
rate1 = tokens[next][1].rate;
- if ((abs(x)*dequant_ptr[rc != 0] > abs(coeff_ptr[rc]) * mul) &&
- (abs(x)*dequant_ptr[rc != 0] < abs(coeff_ptr[rc]) * mul +
+ if ((abs(x)*dequant_ptr[rc != 0] > abs(coeff[rc]) * mul) &&
+ (abs(x)*dequant_ptr[rc != 0] < abs(coeff[rc]) * mul +
dequant_ptr[rc != 0]))
shortcut = 1;
else
@@ -221,21 +213,19 @@ static void optimize_b(MACROBLOCK *mb,
/* If we reduced this coefficient to zero, check to see if
* we need to move the EOB back here.
*/
- t0 = tokens[next][0].token == DCT_EOB_TOKEN ?
- DCT_EOB_TOKEN : ZERO_TOKEN;
- t1 = tokens[next][1].token == DCT_EOB_TOKEN ?
- DCT_EOB_TOKEN : ZERO_TOKEN;
+ t0 = tokens[next][0].token == EOB_TOKEN ? EOB_TOKEN : ZERO_TOKEN;
+ t1 = tokens[next][1].token == EOB_TOKEN ? EOB_TOKEN : ZERO_TOKEN;
} else {
t0 = t1 = (vp9_dct_value_tokens_ptr + x)->token;
}
if (next < default_eob) {
band = band_translate[i + 1];
- if (t0 != DCT_EOB_TOKEN) {
+ if (t0 != EOB_TOKEN) {
pt = trellis_get_coeff_context(scan, nb, i, t0, token_cache);
rate0 += mb->token_costs[tx_size][type][ref][band][!x][pt]
[tokens[next][0].token];
}
- if (t1 != DCT_EOB_TOKEN) {
+ if (t1 != EOB_TOKEN) {
pt = trellis_get_coeff_context(scan, nb, i, t1, token_cache);
rate1 += mb->token_costs[tx_size][type][ref][band][!x][pt]
[tokens[next][1].token];
@@ -267,12 +257,12 @@ static void optimize_b(MACROBLOCK *mb,
t0 = tokens[next][0].token;
t1 = tokens[next][1].token;
/* Update the cost of each path if we're past the EOB token. */
- if (t0 != DCT_EOB_TOKEN) {
+ if (t0 != EOB_TOKEN) {
tokens[next][0].rate +=
mb->token_costs[tx_size][type][ref][band][1][0][t0];
tokens[next][0].token = ZERO_TOKEN;
}
- if (t1 != DCT_EOB_TOKEN) {
+ if (t1 != EOB_TOKEN) {
tokens[next][1].rate +=
mb->token_costs[tx_size][type][ref][band][1][0][t1];
tokens[next][1].token = ZERO_TOKEN;
@@ -296,116 +286,78 @@ static void optimize_b(MACROBLOCK *mb,
UPDATE_RD_COST();
best = rd_cost1 < rd_cost0;
final_eob = i0 - 1;
- vpx_memset(qcoeff_ptr, 0, sizeof(*qcoeff_ptr) * (16 << (tx_size * 2)));
- vpx_memset(dqcoeff_ptr, 0, sizeof(*dqcoeff_ptr) * (16 << (tx_size * 2)));
+ vpx_memset(qcoeff, 0, sizeof(*qcoeff) * (16 << (tx_size * 2)));
+ vpx_memset(dqcoeff, 0, sizeof(*dqcoeff) * (16 << (tx_size * 2)));
for (i = next; i < eob; i = next) {
x = tokens[i][best].qc;
if (x) {
final_eob = i;
}
rc = scan[i];
- qcoeff_ptr[rc] = x;
- dqcoeff_ptr[rc] = (x * dequant_ptr[rc != 0]) / mul;
+ qcoeff[rc] = x;
+ dqcoeff[rc] = (x * dequant_ptr[rc != 0]) / mul;
next = tokens[i][best].next;
best = best_index[i][best];
}
final_eob++;
- xd->plane[plane].eobs[block] = final_eob;
+ mb->plane[plane].eobs[block] = final_eob;
*a = *l = (final_eob > 0);
}
-void vp9_optimize_b(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, MACROBLOCK *mb, struct optimize_ctx *ctx) {
- int x, y;
- txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x, &y);
- optimize_b(mb, plane, block, plane_bsize,
- &ctx->ta[plane][x], &ctx->tl[plane][y], tx_size);
-}
-
-static void optimize_init_b(int plane, BLOCK_SIZE bsize,
- struct encode_b_args *args) {
- const MACROBLOCKD *xd = &args->x->e_mbd;
- const struct macroblockd_plane* const pd = &xd->plane[plane];
- const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
- const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
- const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
- const MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
- const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size;
-
- vp9_get_entropy_contexts(tx_size, args->ctx->ta[plane], args->ctx->tl[plane],
- pd->above_context, pd->left_context,
- num_4x4_w, num_4x4_h);
+static INLINE void fdct32x32(int rd_transform,
+ const int16_t *src, int16_t *dst, int src_stride) {
+ if (rd_transform)
+ vp9_fdct32x32_rd(src, dst, src_stride);
+ else
+ vp9_fdct32x32(src, dst, src_stride);
}
-void vp9_xform_quant(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, void *arg) {
- struct encode_b_args* const args = arg;
- MACROBLOCK* const x = args->x;
- MACROBLOCKD* const xd = &x->e_mbd;
- struct macroblock_plane *const p = &x->plane[plane];
- struct macroblockd_plane *const pd = &xd->plane[plane];
- int16_t *coeff = BLOCK_OFFSET(p->coeff, block);
- int16_t *qcoeff = BLOCK_OFFSET(pd->qcoeff, block);
- int16_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- const int16_t *scan, *iscan;
- uint16_t *eob = &pd->eobs[block];
- const int bwl = b_width_log2(plane_bsize), bw = 1 << bwl;
- const int twl = bwl - tx_size, twmask = (1 << twl) - 1;
- int xoff, yoff;
- int16_t *src_diff;
+void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size) {
+ MACROBLOCKD *const xd = &x->e_mbd;
+ const struct macroblock_plane *const p = &x->plane[plane];
+ const struct macroblockd_plane *const pd = &xd->plane[plane];
+ const scan_order *const scan_order = &vp9_default_scan_orders[tx_size];
+ int16_t *const coeff = BLOCK_OFFSET(p->coeff, block);
+ int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
+ int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
+ uint16_t *const eob = &p->eobs[block];
+ const int diff_stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
+ int i, j;
+ const int16_t *src_diff;
+ txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
+ src_diff = &p->src_diff[4 * (j * diff_stride + i)];
switch (tx_size) {
case TX_32X32:
- scan = vp9_default_scan_32x32;
- iscan = vp9_default_iscan_32x32;
- block >>= 6;
- xoff = 32 * (block & twmask);
- yoff = 32 * (block >> twl);
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- if (x->use_lp32x32fdct)
- vp9_fdct32x32_rd(src_diff, coeff, bw * 4);
- else
- vp9_fdct32x32(src_diff, coeff, bw * 4);
+ fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride);
vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob, scan_order->scan,
+ scan_order->iscan);
break;
case TX_16X16:
- scan = vp9_default_scan_16x16;
- iscan = vp9_default_iscan_16x16;
- block >>= 4;
- xoff = 16 * (block & twmask);
- yoff = 16 * (block >> twl);
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- vp9_fdct16x16(src_diff, coeff, bw * 4);
+ vp9_fdct16x16(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob,
+ scan_order->scan, scan_order->iscan);
break;
case TX_8X8:
- scan = vp9_default_scan_8x8;
- iscan = vp9_default_iscan_8x8;
- block >>= 2;
- xoff = 8 * (block & twmask);
- yoff = 8 * (block >> twl);
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- vp9_fdct8x8(src_diff, coeff, bw * 4);
+ vp9_fdct8x8(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob,
+ scan_order->scan, scan_order->iscan);
break;
case TX_4X4:
- scan = vp9_default_scan_4x4;
- iscan = vp9_default_iscan_4x4;
- xoff = 4 * (block & twmask);
- yoff = 4 * (block >> twl);
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- x->fwd_txm4x4(src_diff, coeff, bw * 4);
+ x->fwd_txm4x4(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob,
+ scan_order->scan, scan_order->iscan);
break;
default:
assert(0);
@@ -418,108 +370,110 @@ static void encode_block(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
struct optimize_ctx *const ctx = args->ctx;
+ struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
int i, j;
uint8_t *dst;
+ ENTROPY_CONTEXT *a, *l;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i];
+ a = &ctx->ta[plane][i];
+ l = &ctx->tl[plane][j];
// TODO(jingning): per transformed block zero forcing only enabled for
// luma component. will integrate chroma components as well.
if (x->zcoeff_blk[tx_size][block] && plane == 0) {
- pd->eobs[block] = 0;
- ctx->ta[plane][i] = 0;
- ctx->tl[plane][j] = 0;
+ p->eobs[block] = 0;
+ *a = *l = 0;
return;
}
if (!x->skip_recode)
- vp9_xform_quant(plane, block, plane_bsize, tx_size, arg);
+ vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
- vp9_optimize_b(plane, block, plane_bsize, tx_size, x, ctx);
+ optimize_b(plane, block, plane_bsize, tx_size, x, a, l);
} else {
- ctx->ta[plane][i] = pd->eobs[block] > 0;
- ctx->tl[plane][j] = pd->eobs[block] > 0;
+ *a = *l = p->eobs[block] > 0;
}
- if (x->skip_encode || pd->eobs[block] == 0)
+ if (p->eobs[block])
+ *(args->skip) = 0;
+
+ if (x->skip_encode || p->eobs[block] == 0)
return;
switch (tx_size) {
case TX_32X32:
- vp9_idct32x32_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
+ vp9_idct32x32_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
break;
case TX_16X16:
- vp9_idct16x16_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
+ vp9_idct16x16_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
break;
case TX_8X8:
- vp9_idct8x8_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
+ vp9_idct8x8_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
break;
case TX_4X4:
// this is like vp9_short_idct4x4 but has a special case around eob<=1
// which is significant (not just an optimization) for the lossless
// case.
- xd->itxm_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
+ xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
break;
default:
- assert(!"Invalid transform size");
+ assert(0 && "Invalid transform size");
}
}
static void encode_block_pass1(int plane, int block, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
- struct encode_b_args *const args = arg;
- MACROBLOCK *const x = args->x;
+ MACROBLOCK *const x = (MACROBLOCK *)arg;
MACROBLOCKD *const xd = &x->e_mbd;
+ struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
- const int raster_block = txfrm_block_to_raster_block(plane_bsize, tx_size,
- block);
-
int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- uint8_t *const dst = raster_block_offset_uint8(plane_bsize, raster_block,
- pd->dst.buf, pd->dst.stride);
-
- vp9_xform_quant(plane, block, plane_bsize, tx_size, arg);
+ int i, j;
+ uint8_t *dst;
+ txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
+ dst = &pd->dst.buf[4 * j * pd->dst.stride + 4 * i];
- if (pd->eobs[block] == 0)
- return;
+ vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
- xd->itxm_add(dqcoeff, dst, pd->dst.stride, pd->eobs[block]);
+ if (p->eobs[block] > 0)
+ xd->itxm_add(dqcoeff, dst, pd->dst.stride, p->eobs[block]);
}
-void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE bsize) {
- MACROBLOCKD *const xd = &x->e_mbd;
- struct optimize_ctx ctx;
- struct encode_b_args arg = {x, &ctx};
-
- vp9_subtract_sby(x, bsize);
- if (x->optimize)
- optimize_init_b(0, bsize, &arg);
-
- foreach_transformed_block_in_plane(xd, bsize, 0, encode_block_pass1, &arg);
+void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize) {
+ vp9_subtract_plane(x, bsize, 0);
+ vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, 0,
+ encode_block_pass1, x);
}
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize) {
MACROBLOCKD *const xd = &x->e_mbd;
struct optimize_ctx ctx;
- struct encode_b_args arg = {x, &ctx};
-
- if (!x->skip_recode)
- vp9_subtract_sb(x, bsize);
+ MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
+ struct encode_b_args arg = {x, &ctx, &mbmi->skip};
+ int plane;
+
+ for (plane = 0; plane < MAX_MB_PLANE; ++plane) {
+ if (!x->skip_recode)
+ vp9_subtract_plane(x, bsize, plane);
+
+ if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
+ const struct macroblockd_plane* const pd = &xd->plane[plane];
+ const TX_SIZE tx_size = plane ? get_uv_tx_size(mbmi) : mbmi->tx_size;
+ vp9_get_entropy_contexts(bsize, tx_size, pd,
+ ctx.ta[plane], ctx.tl[plane]);
+ }
- if (x->optimize && (!x->skip_recode || !x->skip_optimize)) {
- int i;
- for (i = 0; i < MAX_MB_PLANE; ++i)
- optimize_init_b(i, bsize, &arg);
+ vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block,
+ &arg);
}
-
- foreach_transformed_block(xd, bsize, encode_block, &arg);
}
-void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, void *arg) {
+static void encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
+ TX_SIZE tx_size, void *arg) {
struct encode_b_args* const args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
@@ -527,127 +481,104 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
struct macroblock_plane *const p = &x->plane[plane];
struct macroblockd_plane *const pd = &xd->plane[plane];
int16_t *coeff = BLOCK_OFFSET(p->coeff, block);
- int16_t *qcoeff = BLOCK_OFFSET(pd->qcoeff, block);
+ int16_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
int16_t *dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
- const int16_t *scan, *iscan;
+ const scan_order *scan_order;
TX_TYPE tx_type;
MB_PREDICTION_MODE mode;
- const int bwl = b_width_log2(plane_bsize), bw = 1 << bwl;
- const int twl = bwl - tx_size, twmask = (1 << twl) - 1;
- int xoff, yoff;
+ const int bwl = b_width_log2(plane_bsize);
+ const int diff_stride = 4 * (1 << bwl);
uint8_t *src, *dst;
int16_t *src_diff;
- uint16_t *eob = &pd->eobs[block];
-
- if (xd->mb_to_right_edge < 0 || xd->mb_to_bottom_edge < 0)
- extend_for_intra(xd, plane_bsize, plane, block, tx_size);
-
- // if (x->optimize)
- // vp9_optimize_b(plane, block, plane_bsize, tx_size, x, args->ctx);
+ uint16_t *eob = &p->eobs[block];
+ const int src_stride = p->src.stride;
+ const int dst_stride = pd->dst.stride;
+ int i, j;
+ txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &i, &j);
+ dst = &pd->dst.buf[4 * (j * dst_stride + i)];
+ src = &p->src.buf[4 * (j * src_stride + i)];
+ src_diff = &p->src_diff[4 * (j * diff_stride + i)];
switch (tx_size) {
case TX_32X32:
- scan = vp9_default_scan_32x32;
- iscan = vp9_default_iscan_32x32;
+ scan_order = &vp9_default_scan_orders[TX_32X32];
mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
- block >>= 6;
- xoff = 32 * (block & twmask);
- yoff = 32 * (block >> twl);
- dst = pd->dst.buf + yoff * pd->dst.stride + xoff;
- vp9_predict_intra_block(xd, block, bwl, TX_32X32, mode,
- dst, pd->dst.stride, dst, pd->dst.stride);
-
+ vp9_predict_intra_block(xd, block >> 6, bwl, TX_32X32, mode,
+ x->skip_encode ? src : dst,
+ x->skip_encode ? src_stride : dst_stride,
+ dst, dst_stride, i, j, plane);
if (!x->skip_recode) {
- src = p->src.buf + yoff * p->src.stride + xoff;
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- vp9_subtract_block(32, 32, src_diff, bw * 4,
- src, p->src.stride, dst, pd->dst.stride);
- if (x->use_lp32x32fdct)
- vp9_fdct32x32_rd(src_diff, coeff, bw * 4);
- else
- vp9_fdct32x32(src_diff, coeff, bw * 4);
+ vp9_subtract_block(32, 32, src_diff, diff_stride,
+ src, src_stride, dst, dst_stride);
+ fdct32x32(x->use_lp32x32fdct, src_diff, coeff, diff_stride);
vp9_quantize_b_32x32(coeff, 1024, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob, scan_order->scan,
+ scan_order->iscan);
}
if (!x->skip_encode && *eob)
- vp9_idct32x32_add(dqcoeff, dst, pd->dst.stride, *eob);
+ vp9_idct32x32_add(dqcoeff, dst, dst_stride, *eob);
break;
case TX_16X16:
- tx_type = get_tx_type_16x16(pd->plane_type, xd);
- scan = get_scan_16x16(tx_type);
- iscan = get_iscan_16x16(tx_type);
+ tx_type = get_tx_type(pd->plane_type, xd);
+ scan_order = &vp9_scan_orders[TX_16X16][tx_type];
mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
- block >>= 4;
- xoff = 16 * (block & twmask);
- yoff = 16 * (block >> twl);
- dst = pd->dst.buf + yoff * pd->dst.stride + xoff;
- vp9_predict_intra_block(xd, block, bwl, TX_16X16, mode,
- dst, pd->dst.stride, dst, pd->dst.stride);
+ vp9_predict_intra_block(xd, block >> 4, bwl, TX_16X16, mode,
+ x->skip_encode ? src : dst,
+ x->skip_encode ? src_stride : dst_stride,
+ dst, dst_stride, i, j, plane);
if (!x->skip_recode) {
- src = p->src.buf + yoff * p->src.stride + xoff;
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- vp9_subtract_block(16, 16, src_diff, bw * 4,
- src, p->src.stride, dst, pd->dst.stride);
- vp9_fht16x16(tx_type, src_diff, coeff, bw * 4);
+ vp9_subtract_block(16, 16, src_diff, diff_stride,
+ src, src_stride, dst, dst_stride);
+ vp9_fht16x16(src_diff, coeff, diff_stride, tx_type);
vp9_quantize_b(coeff, 256, x->skip_block, p->zbin, p->round,
p->quant, p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob, scan_order->scan,
+ scan_order->iscan);
}
if (!x->skip_encode && *eob)
- vp9_iht16x16_add(tx_type, dqcoeff, dst, pd->dst.stride, *eob);
+ vp9_iht16x16_add(tx_type, dqcoeff, dst, dst_stride, *eob);
break;
case TX_8X8:
- tx_type = get_tx_type_8x8(pd->plane_type, xd);
- scan = get_scan_8x8(tx_type);
- iscan = get_iscan_8x8(tx_type);
+ tx_type = get_tx_type(pd->plane_type, xd);
+ scan_order = &vp9_scan_orders[TX_8X8][tx_type];
mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
- block >>= 2;
- xoff = 8 * (block & twmask);
- yoff = 8 * (block >> twl);
- dst = pd->dst.buf + yoff * pd->dst.stride + xoff;
- vp9_predict_intra_block(xd, block, bwl, TX_8X8, mode,
- dst, pd->dst.stride, dst, pd->dst.stride);
+ vp9_predict_intra_block(xd, block >> 2, bwl, TX_8X8, mode,
+ x->skip_encode ? src : dst,
+ x->skip_encode ? src_stride : dst_stride,
+ dst, dst_stride, i, j, plane);
if (!x->skip_recode) {
- src = p->src.buf + yoff * p->src.stride + xoff;
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- vp9_subtract_block(8, 8, src_diff, bw * 4,
- src, p->src.stride, dst, pd->dst.stride);
- vp9_fht8x8(tx_type, src_diff, coeff, bw * 4);
+ vp9_subtract_block(8, 8, src_diff, diff_stride,
+ src, src_stride, dst, dst_stride);
+ vp9_fht8x8(src_diff, coeff, diff_stride, tx_type);
vp9_quantize_b(coeff, 64, x->skip_block, p->zbin, p->round, p->quant,
p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob, scan_order->scan,
+ scan_order->iscan);
}
if (!x->skip_encode && *eob)
- vp9_iht8x8_add(tx_type, dqcoeff, dst, pd->dst.stride, *eob);
+ vp9_iht8x8_add(tx_type, dqcoeff, dst, dst_stride, *eob);
break;
case TX_4X4:
tx_type = get_tx_type_4x4(pd->plane_type, xd, block);
- scan = get_scan_4x4(tx_type);
- iscan = get_iscan_4x4(tx_type);
- if (mbmi->sb_type < BLOCK_8X8 && plane == 0)
- mode = xd->mi_8x8[0]->bmi[block].as_mode;
- else
- mode = plane == 0 ? mbmi->mode : mbmi->uv_mode;
-
- xoff = 4 * (block & twmask);
- yoff = 4 * (block >> twl);
- dst = pd->dst.buf + yoff * pd->dst.stride + xoff;
+ scan_order = &vp9_scan_orders[TX_4X4][tx_type];
+ mode = plane == 0 ? get_y_mode(xd->mi_8x8[0], block) : mbmi->uv_mode;
vp9_predict_intra_block(xd, block, bwl, TX_4X4, mode,
- dst, pd->dst.stride, dst, pd->dst.stride);
+ x->skip_encode ? src : dst,
+ x->skip_encode ? src_stride : dst_stride,
+ dst, dst_stride, i, j, plane);
if (!x->skip_recode) {
- src = p->src.buf + yoff * p->src.stride + xoff;
- src_diff = p->src_diff + 4 * bw * yoff + xoff;
- vp9_subtract_block(4, 4, src_diff, bw * 4,
- src, p->src.stride, dst, pd->dst.stride);
+ vp9_subtract_block(4, 4, src_diff, diff_stride,
+ src, src_stride, dst, dst_stride);
if (tx_type != DCT_DCT)
- vp9_short_fht4x4(src_diff, coeff, bw * 4, tx_type);
+ vp9_fht4x4(src_diff, coeff, diff_stride, tx_type);
else
- x->fwd_txm4x4(src_diff, coeff, bw * 4);
+ x->fwd_txm4x4(src_diff, coeff, diff_stride);
vp9_quantize_b(coeff, 16, x->skip_block, p->zbin, p->round, p->quant,
p->quant_shift, qcoeff, dqcoeff,
- pd->dequant, p->zbin_extra, eob, scan, iscan);
+ pd->dequant, p->zbin_extra, eob, scan_order->scan,
+ scan_order->iscan);
}
if (!x->skip_encode && *eob) {
@@ -655,28 +586,42 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
// this is like vp9_short_idct4x4 but has a special case around eob<=1
// which is significant (not just an optimization) for the lossless
// case.
- xd->itxm_add(dqcoeff, dst, pd->dst.stride, *eob);
+ xd->itxm_add(dqcoeff, dst, dst_stride, *eob);
else
- vp9_iht4x4_16_add(dqcoeff, dst, pd->dst.stride, tx_type);
+ vp9_iht4x4_16_add(dqcoeff, dst, dst_stride, tx_type);
}
break;
default:
assert(0);
}
+ if (*eob)
+ *(args->skip) = 0;
}
-void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE bsize) {
- MACROBLOCKD* const xd = &x->e_mbd;
- struct optimize_ctx ctx;
- struct encode_b_args arg = {x, &ctx};
-
- foreach_transformed_block_in_plane(xd, bsize, 0, vp9_encode_block_intra,
- &arg);
+void vp9_encode_block_intra(MACROBLOCK *x, int plane, int block,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
+ unsigned char *skip) {
+ struct encode_b_args arg = {x, NULL, skip};
+ encode_block_intra(plane, block, plane_bsize, tx_size, &arg);
}
-void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE bsize) {
- MACROBLOCKD* const xd = &x->e_mbd;
- struct optimize_ctx ctx;
- struct encode_b_args arg = {x, &ctx};
- foreach_transformed_block_uv(xd, bsize, vp9_encode_block_intra, &arg);
+
+
+void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ struct encode_b_args arg = {x, NULL, &xd->mi_8x8[0]->mbmi.skip};
+
+ vp9_foreach_transformed_block_in_plane(xd, bsize, plane, encode_block_intra,
+ &arg);
}
+int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred) {
+ MB_MODE_INFO * mbmi = &x->e_mbd.mi_8x8[0]->mbmi;
+ x->skip_encode = 0;
+ mbmi->mode = DC_PRED;
+ mbmi->ref_frame[0] = INTRA_FRAME;
+ mbmi->tx_size = use_16x16_pred ? (mbmi->sb_type >= BLOCK_16X16 ? TX_16X16
+ : TX_8X8)
+ : TX_4X4;
+ vp9_encode_intra_block_plane(x, mbmi->sb_type, 0);
+ return vp9_get_mb_ss(x->plane[0].src_diff);
+}
diff --git a/libvpx/vp9/encoder/vp9_encodemb.h b/libvpx/vp9/encoder/vp9_encodemb.h
index 61dd735..dcf6e87 100644
--- a/libvpx/vp9/encoder/vp9_encodemb.h
+++ b/libvpx/vp9/encoder/vp9_encodemb.h
@@ -16,39 +16,28 @@
#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/common/vp9_onyxc_int.h"
-typedef struct {
- MB_PREDICTION_MODE mode;
- MV_REFERENCE_FRAME ref_frame;
- MV_REFERENCE_FRAME second_ref_frame;
-} MODE_DEFINITION;
-
-typedef struct {
- MV_REFERENCE_FRAME ref_frame;
- MV_REFERENCE_FRAME second_ref_frame;
-} REF_DEFINITION;
-
-struct optimize_ctx {
- ENTROPY_CONTEXT ta[MAX_MB_PLANE][16];
- ENTROPY_CONTEXT tl[MAX_MB_PLANE][16];
-};
-
-struct encode_b_args {
- MACROBLOCK *x;
- struct optimize_ctx *ctx;
-};
+#ifdef __cplusplus
+extern "C" {
+#endif
void vp9_encode_sb(MACROBLOCK *x, BLOCK_SIZE bsize);
-void vp9_encode_sby(MACROBLOCK *x, BLOCK_SIZE bsize);
+void vp9_encode_sby_pass1(MACROBLOCK *x, BLOCK_SIZE bsize);
-void vp9_xform_quant(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, void *arg);
+void vp9_xform_quant(MACROBLOCK *x, int plane, int block,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size);
-void vp9_subtract_sby(MACROBLOCK *x, BLOCK_SIZE bsize);
-void vp9_subtract_sbuv(MACROBLOCK *x, BLOCK_SIZE bsize);
-void vp9_subtract_sb(MACROBLOCK *x, BLOCK_SIZE bsize);
+void vp9_subtract_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
-void vp9_encode_intra_block_y(MACROBLOCK *x, BLOCK_SIZE bsize);
-void vp9_encode_intra_block_uv(MACROBLOCK *x, BLOCK_SIZE bsize);
+void vp9_encode_block_intra(MACROBLOCK *x, int plane, int block,
+ BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
+ unsigned char *skip);
+void vp9_encode_intra_block_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
+
+int vp9_encode_intra(MACROBLOCK *x, int use_16x16_pred);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_ENCODEMB_H_
diff --git a/libvpx/vp9/encoder/vp9_encodemv.c b/libvpx/vp9/encoder/vp9_encodemv.c
index 030ca64..2a10bbf 100644
--- a/libvpx/vp9/encoder/vp9_encodemv.c
+++ b/libvpx/vp9/encoder/vp9_encodemv.c
@@ -13,12 +13,21 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_entropymode.h"
#include "vp9/common/vp9_systemdependent.h"
+
+#include "vp9/encoder/vp9_cost.h"
#include "vp9/encoder/vp9_encodemv.h"
+static struct vp9_token mv_joint_encodings[MV_JOINTS];
+static struct vp9_token mv_class_encodings[MV_CLASSES];
+static struct vp9_token mv_fp_encodings[MV_FP_SIZE];
+static struct vp9_token mv_class0_encodings[CLASS0_SIZE];
-#ifdef ENTROPY_STATS
-extern unsigned int active_section;
-#endif
+void vp9_entropy_mv_init() {
+ vp9_tokens_from_tree(mv_joint_encodings, vp9_mv_joint_tree);
+ vp9_tokens_from_tree(mv_class_encodings, vp9_mv_class_tree);
+ vp9_tokens_from_tree(mv_class0_encodings, vp9_mv_class0_tree);
+ vp9_tokens_from_tree(mv_fp_encodings, vp9_mv_fp_tree);
+}
static void encode_mv_component(vp9_writer* w, int comp,
const nmv_component* mvcomp, int usehp) {
@@ -36,13 +45,13 @@ static void encode_mv_component(vp9_writer* w, int comp,
vp9_write(w, sign, mvcomp->sign);
// Class
- write_token(w, vp9_mv_class_tree, mvcomp->classes,
- &vp9_mv_class_encodings[mv_class]);
+ vp9_write_token(w, vp9_mv_class_tree, mvcomp->classes,
+ &mv_class_encodings[mv_class]);
// Integer bits
if (mv_class == MV_CLASS_0) {
- write_token(w, vp9_mv_class0_tree, mvcomp->class0,
- &vp9_mv_class0_encodings[d]);
+ vp9_write_token(w, vp9_mv_class0_tree, mvcomp->class0,
+ &mv_class0_encodings[d]);
} else {
int i;
const int n = mv_class + CLASS0_BITS - 1; // number of bits
@@ -51,9 +60,9 @@ static void encode_mv_component(vp9_writer* w, int comp,
}
// Fractional bits
- write_token(w, vp9_mv_fp_tree,
- mv_class == MV_CLASS_0 ? mvcomp->class0_fp[d] : mvcomp->fp,
- &vp9_mv_fp_encodings[fr]);
+ vp9_write_token(w, vp9_mv_fp_tree,
+ mv_class == MV_CLASS_0 ? mvcomp->class0_fp[d] : mvcomp->fp,
+ &mv_fp_encodings[fr]);
// High precision bit
if (usehp)
@@ -68,7 +77,7 @@ static void build_nmv_component_cost_table(int *mvcost,
int i, v;
int sign_cost[2], class_cost[MV_CLASSES], class0_cost[CLASS0_SIZE];
int bits_cost[MV_OFFSET_BITS][2];
- int class0_fp_cost[CLASS0_SIZE][4], fp_cost[4];
+ int class0_fp_cost[CLASS0_SIZE][MV_FP_SIZE], fp_cost[MV_FP_SIZE];
int class0_hp_cost[2], hp_cost[2];
sign_cost[0] = vp9_cost_zero(mvcomp->sign);
@@ -126,138 +135,66 @@ static void build_nmv_component_cost_table(int *mvcost,
static int update_mv(vp9_writer *w, const unsigned int ct[2], vp9_prob *cur_p,
vp9_prob upd_p) {
- const vp9_prob new_p = get_binary_prob(ct[0], ct[1]);
- vp9_prob mod_p = new_p | 1;
- const int cur_b = cost_branch256(ct, *cur_p);
- const int mod_b = cost_branch256(ct, mod_p);
- const int cost = 7 * 256 + (vp9_cost_one(upd_p) - vp9_cost_zero(upd_p));
- if (cur_b - mod_b > cost) {
- *cur_p = mod_p;
- vp9_write(w, 1, upd_p);
- vp9_write_literal(w, mod_p >> 1, 7);
- return 1;
- } else {
- vp9_write(w, 0, upd_p);
- return 0;
+ const vp9_prob new_p = get_binary_prob(ct[0], ct[1]) | 1;
+ const int update = cost_branch256(ct, *cur_p) + vp9_cost_zero(upd_p) >
+ cost_branch256(ct, new_p) + vp9_cost_one(upd_p) + 7 * 256;
+ vp9_write(w, update, upd_p);
+ if (update) {
+ *cur_p = new_p;
+ vp9_write_literal(w, new_p >> 1, 7);
}
+ return update;
}
-static void counts_to_nmv_context(
- nmv_context_counts *nmv_count,
- int usehp,
- unsigned int (*branch_ct_joint)[2],
- unsigned int (*branch_ct_sign)[2],
- unsigned int (*branch_ct_classes)[MV_CLASSES - 1][2],
- unsigned int (*branch_ct_class0)[CLASS0_SIZE - 1][2],
- unsigned int (*branch_ct_bits)[MV_OFFSET_BITS][2],
- unsigned int (*branch_ct_class0_fp)[CLASS0_SIZE][4 - 1][2],
- unsigned int (*branch_ct_fp)[4 - 1][2],
- unsigned int (*branch_ct_class0_hp)[2],
- unsigned int (*branch_ct_hp)[2]) {
- int i, j, k;
- vp9_tree_probs_from_distribution(vp9_mv_joint_tree, branch_ct_joint,
- nmv_count->joints);
- for (i = 0; i < 2; ++i) {
- const uint32_t s0 = nmv_count->comps[i].sign[0];
- const uint32_t s1 = nmv_count->comps[i].sign[1];
-
- branch_ct_sign[i][0] = s0;
- branch_ct_sign[i][1] = s1;
- vp9_tree_probs_from_distribution(vp9_mv_class_tree,
- branch_ct_classes[i],
- nmv_count->comps[i].classes);
- vp9_tree_probs_from_distribution(vp9_mv_class0_tree,
- branch_ct_class0[i],
- nmv_count->comps[i].class0);
- for (j = 0; j < MV_OFFSET_BITS; ++j) {
- const uint32_t b0 = nmv_count->comps[i].bits[j][0];
- const uint32_t b1 = nmv_count->comps[i].bits[j][1];
-
- branch_ct_bits[i][j][0] = b0;
- branch_ct_bits[i][j][1] = b1;
- }
- }
- for (i = 0; i < 2; ++i) {
- for (k = 0; k < CLASS0_SIZE; ++k) {
- vp9_tree_probs_from_distribution(vp9_mv_fp_tree,
- branch_ct_class0_fp[i][k],
- nmv_count->comps[i].class0_fp[k]);
- }
- vp9_tree_probs_from_distribution(vp9_mv_fp_tree,
- branch_ct_fp[i],
- nmv_count->comps[i].fp);
- }
- if (usehp) {
- for (i = 0; i < 2; ++i) {
- const uint32_t c0_hp0 = nmv_count->comps[i].class0_hp[0];
- const uint32_t c0_hp1 = nmv_count->comps[i].class0_hp[1];
- const uint32_t hp0 = nmv_count->comps[i].hp[0];
- const uint32_t hp1 = nmv_count->comps[i].hp[1];
+static void write_mv_update(const vp9_tree_index *tree,
+ vp9_prob probs[/*n - 1*/],
+ const unsigned int counts[/*n - 1*/],
+ int n, vp9_writer *w) {
+ int i;
+ unsigned int branch_ct[32][2];
- branch_ct_class0_hp[i][0] = c0_hp0;
- branch_ct_class0_hp[i][1] = c0_hp1;
+ // Assuming max number of probabilities <= 32
+ assert(n <= 32);
- branch_ct_hp[i][0] = hp0;
- branch_ct_hp[i][1] = hp1;
- }
- }
+ vp9_tree_probs_from_distribution(tree, branch_ct, counts);
+ for (i = 0; i < n - 1; ++i)
+ update_mv(w, branch_ct[i], &probs[i], MV_UPDATE_PROB);
}
-void vp9_write_nmv_probs(VP9_COMP* const cpi, int usehp, vp9_writer* const bc) {
+void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer *w) {
int i, j;
- unsigned int branch_ct_joint[MV_JOINTS - 1][2];
- unsigned int branch_ct_sign[2][2];
- unsigned int branch_ct_classes[2][MV_CLASSES - 1][2];
- unsigned int branch_ct_class0[2][CLASS0_SIZE - 1][2];
- unsigned int branch_ct_bits[2][MV_OFFSET_BITS][2];
- unsigned int branch_ct_class0_fp[2][CLASS0_SIZE][4 - 1][2];
- unsigned int branch_ct_fp[2][4 - 1][2];
- unsigned int branch_ct_class0_hp[2][2];
- unsigned int branch_ct_hp[2][2];
- nmv_context *mvc = &cpi->common.fc.nmvc;
-
- counts_to_nmv_context(&cpi->NMVcount, usehp,
- branch_ct_joint, branch_ct_sign, branch_ct_classes,
- branch_ct_class0, branch_ct_bits,
- branch_ct_class0_fp, branch_ct_fp,
- branch_ct_class0_hp, branch_ct_hp);
-
- for (j = 0; j < MV_JOINTS - 1; ++j)
- update_mv(bc, branch_ct_joint[j], &mvc->joints[j], NMV_UPDATE_PROB);
-
- for (i = 0; i < 2; ++i) {
- update_mv(bc, branch_ct_sign[i], &mvc->comps[i].sign, NMV_UPDATE_PROB);
- for (j = 0; j < MV_CLASSES - 1; ++j)
- update_mv(bc, branch_ct_classes[i][j], &mvc->comps[i].classes[j],
- NMV_UPDATE_PROB);
+ nmv_context *const mvc = &cm->fc.nmvc;
+ nmv_context_counts *const counts = &cm->counts.mv;
- for (j = 0; j < CLASS0_SIZE - 1; ++j)
- update_mv(bc, branch_ct_class0[i][j], &mvc->comps[i].class0[j],
- NMV_UPDATE_PROB);
+ write_mv_update(vp9_mv_joint_tree, mvc->joints, counts->joints, MV_JOINTS, w);
+ for (i = 0; i < 2; ++i) {
+ nmv_component *comp = &mvc->comps[i];
+ nmv_component_counts *comp_counts = &counts->comps[i];
+
+ update_mv(w, comp_counts->sign, &comp->sign, MV_UPDATE_PROB);
+ write_mv_update(vp9_mv_class_tree, comp->classes, comp_counts->classes,
+ MV_CLASSES, w);
+ write_mv_update(vp9_mv_class0_tree, comp->class0, comp_counts->class0,
+ CLASS0_SIZE, w);
for (j = 0; j < MV_OFFSET_BITS; ++j)
- update_mv(bc, branch_ct_bits[i][j], &mvc->comps[i].bits[j],
- NMV_UPDATE_PROB);
+ update_mv(w, comp_counts->bits[j], &comp->bits[j], MV_UPDATE_PROB);
}
for (i = 0; i < 2; ++i) {
- for (j = 0; j < CLASS0_SIZE; ++j) {
- int k;
- for (k = 0; k < 3; ++k)
- update_mv(bc, branch_ct_class0_fp[i][j][k],
- &mvc->comps[i].class0_fp[j][k], NMV_UPDATE_PROB);
- }
+ for (j = 0; j < CLASS0_SIZE; ++j)
+ write_mv_update(vp9_mv_fp_tree, mvc->comps[i].class0_fp[j],
+ counts->comps[i].class0_fp[j], MV_FP_SIZE, w);
- for (j = 0; j < 3; ++j)
- update_mv(bc, branch_ct_fp[i][j], &mvc->comps[i].fp[j], NMV_UPDATE_PROB);
+ write_mv_update(vp9_mv_fp_tree, mvc->comps[i].fp, counts->comps[i].fp,
+ MV_FP_SIZE, w);
}
if (usehp) {
for (i = 0; i < 2; ++i) {
- update_mv(bc, branch_ct_class0_hp[i], &mvc->comps[i].class0_hp,
- NMV_UPDATE_PROB);
- update_mv(bc, branch_ct_hp[i], &mvc->comps[i].hp,
- NMV_UPDATE_PROB);
+ update_mv(w, counts->comps[i].class0_hp, &mvc->comps[i].class0_hp,
+ MV_UPDATE_PROB);
+ update_mv(w, counts->comps[i].hp, &mvc->comps[i].hp, MV_UPDATE_PROB);
}
}
}
@@ -270,7 +207,7 @@ void vp9_encode_mv(VP9_COMP* cpi, vp9_writer* w,
const MV_JOINT_TYPE j = vp9_get_mv_joint(&diff);
usehp = usehp && vp9_use_mv_hp(ref);
- write_token(w, vp9_mv_joint_tree, mvctx->joints, &vp9_mv_joint_encodings[j]);
+ vp9_write_token(w, vp9_mv_joint_tree, mvctx->joints, &mv_joint_encodings[j]);
if (mv_joint_vertical(j))
encode_mv_component(w, diff.row, &mvctx->comps[0], usehp);
@@ -285,34 +222,28 @@ void vp9_encode_mv(VP9_COMP* cpi, vp9_writer* w,
}
}
-void vp9_build_nmv_cost_table(int *mvjoint,
- int *mvcost[2],
- const nmv_context* const mvctx,
- int usehp,
- int mvc_flag_v,
- int mvc_flag_h) {
- vp9_clear_system_state();
- vp9_cost_tokens(mvjoint, mvctx->joints, vp9_mv_joint_tree);
- if (mvc_flag_v)
- build_nmv_component_cost_table(mvcost[0], &mvctx->comps[0], usehp);
- if (mvc_flag_h)
- build_nmv_component_cost_table(mvcost[1], &mvctx->comps[1], usehp);
+void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2],
+ const nmv_context* ctx, int usehp) {
+ vp9_cost_tokens(mvjoint, ctx->joints, vp9_mv_joint_tree);
+ build_nmv_component_cost_table(mvcost[0], &ctx->comps[0], usehp);
+ build_nmv_component_cost_table(mvcost[1], &ctx->comps[1], usehp);
}
-static void inc_mvs(int_mv mv[2], int_mv ref[2], int is_compound,
+static void inc_mvs(const MB_MODE_INFO *mbmi, const int_mv mvs[2],
nmv_context_counts *counts) {
int i;
- for (i = 0; i < 1 + is_compound; ++i) {
- const MV diff = { mv[i].as_mv.row - ref[i].as_mv.row,
- mv[i].as_mv.col - ref[i].as_mv.col };
+
+ for (i = 0; i < 1 + has_second_ref(mbmi); ++i) {
+ const MV *ref = &mbmi->ref_mvs[mbmi->ref_frame[i]][0].as_mv;
+ const MV diff = {mvs[i].as_mv.row - ref->row,
+ mvs[i].as_mv.col - ref->col};
vp9_inc_mv(&diff, counts);
}
}
-void vp9_update_mv_count(VP9_COMP *cpi, MACROBLOCK *x, int_mv best_ref_mv[2]) {
- MODE_INFO *mi = x->e_mbd.mi_8x8[0];
- MB_MODE_INFO *const mbmi = &mi->mbmi;
- const int is_compound = has_second_ref(mbmi);
+void vp9_update_mv_count(VP9_COMMON *cm, const MACROBLOCKD *xd) {
+ const MODE_INFO *mi = xd->mi_8x8[0];
+ const MB_MODE_INFO *const mbmi = &mi->mbmi;
if (mbmi->sb_type < BLOCK_8X8) {
const int num_4x4_w = num_4x4_blocks_wide_lookup[mbmi->sb_type];
@@ -323,10 +254,12 @@ void vp9_update_mv_count(VP9_COMP *cpi, MACROBLOCK *x, int_mv best_ref_mv[2]) {
for (idx = 0; idx < 2; idx += num_4x4_w) {
const int i = idy * 2 + idx;
if (mi->bmi[i].as_mode == NEWMV)
- inc_mvs(mi->bmi[i].as_mv, best_ref_mv, is_compound, &cpi->NMVcount);
+ inc_mvs(mbmi, mi->bmi[i].as_mv, &cm->counts.mv);
}
}
- } else if (mbmi->mode == NEWMV) {
- inc_mvs(mbmi->mv, best_ref_mv, is_compound, &cpi->NMVcount);
+ } else {
+ if (mbmi->mode == NEWMV)
+ inc_mvs(mbmi, mbmi->mv, &cm->counts.mv);
}
}
+
diff --git a/libvpx/vp9/encoder/vp9_encodemv.h b/libvpx/vp9/encoder/vp9_encodemv.h
index 6331778..50cb961 100644
--- a/libvpx/vp9/encoder/vp9_encodemv.h
+++ b/libvpx/vp9/encoder/vp9_encodemv.h
@@ -14,18 +14,24 @@
#include "vp9/encoder/vp9_onyx_int.h"
-void vp9_write_nmv_probs(VP9_COMP* const, int usehp, vp9_writer* const);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vp9_entropy_mv_init();
+
+void vp9_write_nmv_probs(VP9_COMMON *cm, int usehp, vp9_writer *w);
void vp9_encode_mv(VP9_COMP *cpi, vp9_writer* w, const MV* mv, const MV* ref,
const nmv_context* mvctx, int usehp);
-void vp9_build_nmv_cost_table(int *mvjoint,
- int *mvcost[2],
- const nmv_context* const mvctx,
- int usehp,
- int mvc_flag_v,
- int mvc_flag_h);
+void vp9_build_nmv_cost_table(int *mvjoint, int *mvcost[2],
+ const nmv_context* mvctx, int usehp);
+
+void vp9_update_mv_count(VP9_COMMON *cm, const MACROBLOCKD *xd);
-void vp9_update_mv_count(VP9_COMP *cpi, MACROBLOCK *x, int_mv best_ref_mv[2]);
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_ENCODEMV_H_
diff --git a/libvpx/vp9/common/vp9_extend.c b/libvpx/vp9/encoder/vp9_extend.c
index 836bf0e..dcbb5ac 100644
--- a/libvpx/vp9/common/vp9_extend.c
+++ b/libvpx/vp9/encoder/vp9_extend.c
@@ -11,7 +11,7 @@
#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_common.h"
-#include "vp9/common/vp9_extend.h"
+#include "vp9/encoder/vp9_extend.h"
static void copy_and_extend_plane(const uint8_t *src, int src_pitch,
uint8_t *dst, int dst_pitch,
diff --git a/libvpx/vp9/common/vp9_extend.h b/libvpx/vp9/encoder/vp9_extend.h
index 7ff79b7..058fe09 100644
--- a/libvpx/vp9/common/vp9_extend.h
+++ b/libvpx/vp9/encoder/vp9_extend.h
@@ -8,12 +8,16 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VP9_COMMON_VP9_EXTEND_H_
-#define VP9_COMMON_VP9_EXTEND_H_
+#ifndef VP9_ENCODER_VP9_EXTEND_H_
+#define VP9_ENCODER_VP9_EXTEND_H_
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_copy_and_extend_frame(const YV12_BUFFER_CONFIG *src,
YV12_BUFFER_CONFIG *dst);
@@ -22,4 +26,8 @@ void vp9_copy_and_extend_frame_with_rect(const YV12_BUFFER_CONFIG *src,
YV12_BUFFER_CONFIG *dst,
int srcy, int srcx,
int srch, int srcw);
-#endif // VP9_COMMON_VP9_EXTEND_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_EXTEND_H_
diff --git a/libvpx/vp9/encoder/vp9_firstpass.c b/libvpx/vp9/encoder/vp9_firstpass.c
index 974c300..c4c219b 100644
--- a/libvpx/vp9/encoder/vp9_firstpass.c
+++ b/libvpx/vp9/encoder/vp9_firstpass.c
@@ -8,32 +8,34 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <math.h>
#include <limits.h>
+#include <math.h>
#include <stdio.h>
-#include "vp9/encoder/vp9_block.h"
-#include "vp9/encoder/vp9_onyx_int.h"
-#include "vp9/encoder/vp9_variance.h"
-#include "vp9/encoder/vp9_encodeintra.h"
-#include "vp9/encoder/vp9_mcomp.h"
-#include "vp9/encoder/vp9_firstpass.h"
+
+#include "./vpx_scale_rtcd.h"
+
+#include "vpx_mem/vpx_mem.h"
#include "vpx_scale/vpx_scale.h"
+#include "vpx_scale/yv12config.h"
+
+#include "vp9/common/vp9_entropymv.h"
+#include "vp9/common/vp9_quant_common.h"
+#include "vp9/common/vp9_reconinter.h" // vp9_setup_dst_planes()
+#include "vp9/common/vp9_systemdependent.h"
+
+#include "vp9/encoder/vp9_block.h"
#include "vp9/encoder/vp9_encodeframe.h"
#include "vp9/encoder/vp9_encodemb.h"
-#include "vp9/common/vp9_extend.h"
-#include "vp9/common/vp9_systemdependent.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vpx_scale/yv12config.h"
+#include "vp9/encoder/vp9_encodemv.h"
+#include "vp9/encoder/vp9_extend.h"
+#include "vp9/encoder/vp9_firstpass.h"
+#include "vp9/encoder/vp9_mcomp.h"
+#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/encoder/vp9_quantize.h"
-#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_ratectrl.h"
-#include "vp9/common/vp9_quant_common.h"
-#include "vp9/common/vp9_entropymv.h"
-#include "vp9/encoder/vp9_encodemv.h"
+#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_vaq.h"
-#include "./vpx_scale_rtcd.h"
-// TODO(jkoleszar): for setup_dst_planes
-#include "vp9/common/vp9_reconinter.h"
+#include "vp9/encoder/vp9_variance.h"
#define OUTPUT_FPF 0
@@ -50,8 +52,16 @@
#define DOUBLE_DIVIDE_CHECK(x) ((x) < 0 ? (x) - 0.000001 : (x) + 0.000001)
-#define POW1 (double)cpi->oxcf.two_pass_vbrbias/100.0
-#define POW2 (double)cpi->oxcf.two_pass_vbrbias/100.0
+#define MIN_KF_BOOST 300
+
+#define DISABLE_RC_LONG_TERM_MEM 0
+
+#if CONFIG_MULTIPLE_ARF
+// Set MIN_GF_INTERVAL to 1 for the full decomposition.
+#define MIN_GF_INTERVAL 2
+#else
+#define MIN_GF_INTERVAL 4
+#endif
static void swap_yv12(YV12_BUFFER_CONFIG *a, YV12_BUFFER_CONFIG *b) {
YV12_BUFFER_CONFIG temp = *a;
@@ -59,51 +69,41 @@ static void swap_yv12(YV12_BUFFER_CONFIG *a, YV12_BUFFER_CONFIG *b) {
*b = temp;
}
-static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame);
-
-static int select_cq_level(int qindex) {
- int ret_val = QINDEX_RANGE - 1;
- int i;
-
- double target_q = (vp9_convert_qindex_to_q(qindex) * 0.5847) + 1.0;
-
- for (i = 0; i < QINDEX_RANGE; i++) {
- if (target_q <= vp9_convert_qindex_to_q(i)) {
- ret_val = i;
- break;
- }
- }
-
- return ret_val;
+static int gfboost_qadjust(int qindex) {
+ const double q = vp9_convert_qindex_to_q(qindex);
+ return (int)((0.00000828 * q * q * q) +
+ (-0.0055 * q * q) +
+ (1.32 * q) + 79.3);
}
-
// Resets the first pass file to the given position using a relative seek from
// the current position.
-static void reset_fpf_position(VP9_COMP *cpi, FIRSTPASS_STATS *position) {
- cpi->twopass.stats_in = position;
+static void reset_fpf_position(struct twopass_rc *p,
+ const FIRSTPASS_STATS *position) {
+ p->stats_in = position;
}
-static int lookup_next_frame_stats(VP9_COMP *cpi, FIRSTPASS_STATS *next_frame) {
- if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end)
+static int lookup_next_frame_stats(const struct twopass_rc *p,
+ FIRSTPASS_STATS *next_frame) {
+ if (p->stats_in >= p->stats_in_end)
return EOF;
- *next_frame = *cpi->twopass.stats_in;
+ *next_frame = *p->stats_in;
return 1;
}
-// Read frame stats at an offset from the current position
-static int read_frame_stats(VP9_COMP *cpi,
- FIRSTPASS_STATS *frame_stats,
- int offset) {
- FIRSTPASS_STATS *fps_ptr = cpi->twopass.stats_in;
- // Check legality of offset
+// Read frame stats at an offset from the current position.
+static int read_frame_stats(const struct twopass_rc *p,
+ FIRSTPASS_STATS *frame_stats, int offset) {
+ const FIRSTPASS_STATS *fps_ptr = p->stats_in;
+
+ // Check legality of offset.
if (offset >= 0) {
- if (&fps_ptr[offset] >= cpi->twopass.stats_in_end)
+ if (&fps_ptr[offset] >= p->stats_in_end)
return EOF;
} else if (offset < 0) {
- if (&fps_ptr[offset] < cpi->twopass.stats_in_start)
+ if (&fps_ptr[offset] < p->stats_in_start)
return EOF;
}
@@ -111,19 +111,17 @@ static int read_frame_stats(VP9_COMP *cpi,
return 1;
}
-static int input_stats(VP9_COMP *cpi, FIRSTPASS_STATS *fps) {
- if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end)
+static int input_stats(struct twopass_rc *p, FIRSTPASS_STATS *fps) {
+ if (p->stats_in >= p->stats_in_end)
return EOF;
- *fps = *cpi->twopass.stats_in;
- cpi->twopass.stats_in =
- (void *)((char *)cpi->twopass.stats_in + sizeof(FIRSTPASS_STATS));
+ *fps = *p->stats_in;
+ ++p->stats_in;
return 1;
}
-static void output_stats(const VP9_COMP *cpi,
- struct vpx_codec_pkt_list *pktlist,
- FIRSTPASS_STATS *stats) {
+static void output_stats(FIRSTPASS_STATS *stats,
+ struct vpx_codec_pkt_list *pktlist) {
struct vpx_codec_cx_pkt pkt;
pkt.kind = VPX_CODEC_STATS_PKT;
pkt.data.twopass_stats.buf = stats;
@@ -132,12 +130,11 @@ static void output_stats(const VP9_COMP *cpi,
// TEMP debug code
#if OUTPUT_FPF
-
{
FILE *fpfile;
fpfile = fopen("firstpass.stt", "a");
- fprintf(stdout, "%12.0f %12.0f %12.0f %12.0f %12.0f %12.4f %12.4f"
+ fprintf(fpfile, "%12.0f %12.0f %12.0f %12.0f %12.0f %12.4f %12.4f"
"%12.4f %12.4f %12.4f %12.4f %12.4f %12.4f %12.4f"
"%12.0f %12.0f %12.4f %12.0f %12.0f %12.4f\n",
stats->frame,
@@ -184,10 +181,13 @@ static void zero_stats(FIRSTPASS_STATS *section) {
section->new_mv_count = 0.0;
section->count = 0.0;
section->duration = 1.0;
+ section->spatial_layer_id = 0;
}
-static void accumulate_stats(FIRSTPASS_STATS *section, FIRSTPASS_STATS *frame) {
+static void accumulate_stats(FIRSTPASS_STATS *section,
+ const FIRSTPASS_STATS *frame) {
section->frame += frame->frame;
+ section->spatial_layer_id = frame->spatial_layer_id;
section->intra_error += frame->intra_error;
section->coded_error += frame->coded_error;
section->sr_coded_error += frame->sr_coded_error;
@@ -208,7 +208,8 @@ static void accumulate_stats(FIRSTPASS_STATS *section, FIRSTPASS_STATS *frame) {
section->duration += frame->duration;
}
-static void subtract_stats(FIRSTPASS_STATS *section, FIRSTPASS_STATS *frame) {
+static void subtract_stats(FIRSTPASS_STATS *section,
+ const FIRSTPASS_STATS *frame) {
section->frame -= frame->frame;
section->intra_error -= frame->intra_error;
section->coded_error -= frame->coded_error;
@@ -254,13 +255,17 @@ static void avg_stats(FIRSTPASS_STATS *section) {
// Calculate a modified Error used in distributing bits between easier and
// harder frames.
-static double calculate_modified_err(VP9_COMP *cpi,
- FIRSTPASS_STATS *this_frame) {
- const FIRSTPASS_STATS *const stats = &cpi->twopass.total_stats;
+static double calculate_modified_err(const VP9_COMP *cpi,
+ const FIRSTPASS_STATS *this_frame) {
+ const struct twopass_rc *const twopass = &cpi->twopass;
+ const FIRSTPASS_STATS *const stats = &twopass->total_stats;
const double av_err = stats->ssim_weighted_pred_err / stats->count;
- const double this_err = this_frame->ssim_weighted_pred_err;
- return av_err * pow(this_err / DOUBLE_DIVIDE_CHECK(av_err),
- this_err > av_err ? POW1 : POW2);
+ double modified_error = av_err * pow(this_frame->ssim_weighted_pred_err /
+ DOUBLE_DIVIDE_CHECK(av_err),
+ cpi->oxcf.two_pass_vbrbias / 100.0);
+
+ return fclamp(modified_error,
+ twopass->modified_error_min, twopass->modified_error_max);
}
static const double weight_table[256] = {
@@ -303,43 +308,35 @@ static const double weight_table[256] = {
1.000000, 1.000000, 1.000000, 1.000000
};
-static double simple_weight(YV12_BUFFER_CONFIG *source) {
+static double simple_weight(const YV12_BUFFER_CONFIG *buf) {
int i, j;
+ double sum = 0.0;
+ const int w = buf->y_crop_width;
+ const int h = buf->y_crop_height;
+ const uint8_t *row = buf->y_buffer;
+
+ for (i = 0; i < h; ++i) {
+ const uint8_t *pixel = row;
+ for (j = 0; j < w; ++j)
+ sum += weight_table[*pixel++];
+ row += buf->y_stride;
+ }
- uint8_t *src = source->y_buffer;
- double sum_weights = 0.0;
-
- // Loop through the Y plane examining levels and creating a weight for
- // the image.
- i = source->y_height;
- do {
- j = source->y_width;
- do {
- sum_weights += weight_table[ *src];
- src++;
- } while (--j);
- src -= source->y_width;
- src += source->y_stride;
- } while (--i);
-
- sum_weights /= (source->y_height * source->y_width);
-
- return sum_weights;
+ return MAX(0.1, sum / (w * h));
}
+// This function returns the maximum target rate per frame.
+static int frame_max_bits(const VP9_COMP *cpi) {
+ int64_t max_bits =
+ ((int64_t)cpi->rc.av_per_frame_bandwidth *
+ (int64_t)cpi->oxcf.two_pass_vbrmax_section) / 100;
-// This function returns the current per frame maximum bitrate target.
-static int frame_max_bits(VP9_COMP *cpi) {
- // Max allocation for a single frame based on the max section guidelines
- // passed in and how many bits are left.
- // For VBR base this on the bits and frames left plus the
- // two_pass_vbrmax_section rate passed in by the user.
- const double max_bits = (1.0 * cpi->twopass.bits_left /
- (cpi->twopass.total_stats.count - cpi->common.current_video_frame)) *
- (cpi->oxcf.two_pass_vbrmax_section / 100.0);
+ if (max_bits < 0)
+ max_bits = 0;
+ else if (max_bits > cpi->rc.max_frame_bandwidth)
+ max_bits = cpi->rc.max_frame_bandwidth;
- // Trap case where we are out of bits.
- return MAX((int)max_bits, 0);
+ return (int)max_bits;
}
void vp9_init_first_pass(VP9_COMP *cpi) {
@@ -347,135 +344,123 @@ void vp9_init_first_pass(VP9_COMP *cpi) {
}
void vp9_end_first_pass(VP9_COMP *cpi) {
- output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.total_stats);
+ if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
+ int i;
+ for (i = 0; i < cpi->svc.number_spatial_layers; ++i) {
+ output_stats(&cpi->svc.layer_context[i].twopass.total_stats,
+ cpi->output_pkt_list);
+ }
+ } else {
+ output_stats(&cpi->twopass.total_stats, cpi->output_pkt_list);
+ }
}
-static void zz_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
- YV12_BUFFER_CONFIG *recon_buffer,
- int *best_motion_err, int recon_yoffset) {
- MACROBLOCKD *const xd = &x->e_mbd;
-
- // Set up pointers for this macro block recon buffer
- xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
-
- switch (xd->mi_8x8[0]->mbmi.sb_type) {
+static vp9_variance_fn_t get_block_variance_fn(BLOCK_SIZE bsize) {
+ switch (bsize) {
case BLOCK_8X8:
- vp9_mse8x8(x->plane[0].src.buf, x->plane[0].src.stride,
- xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
- (unsigned int *)(best_motion_err));
- break;
+ return vp9_mse8x8;
case BLOCK_16X8:
- vp9_mse16x8(x->plane[0].src.buf, x->plane[0].src.stride,
- xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
- (unsigned int *)(best_motion_err));
- break;
+ return vp9_mse16x8;
case BLOCK_8X16:
- vp9_mse8x16(x->plane[0].src.buf, x->plane[0].src.stride,
- xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
- (unsigned int *)(best_motion_err));
- break;
+ return vp9_mse8x16;
default:
- vp9_mse16x16(x->plane[0].src.buf, x->plane[0].src.stride,
- xd->plane[0].pre[0].buf, xd->plane[0].pre[0].stride,
- (unsigned int *)(best_motion_err));
- break;
+ return vp9_mse16x16;
}
}
+static unsigned int zz_motion_search(const MACROBLOCK *x) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *const src = x->plane[0].src.buf;
+ const int src_stride = x->plane[0].src.stride;
+ const uint8_t *const ref = xd->plane[0].pre[0].buf;
+ const int ref_stride = xd->plane[0].pre[0].stride;
+ unsigned int sse;
+ vp9_variance_fn_t fn = get_block_variance_fn(xd->mi_8x8[0]->mbmi.sb_type);
+ fn(src, src_stride, ref, ref_stride, &sse);
+ return sse;
+}
+
static void first_pass_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
- int_mv *ref_mv, MV *best_mv,
- YV12_BUFFER_CONFIG *recon_buffer,
- int *best_motion_err, int recon_yoffset) {
+ const MV *ref_mv, MV *best_mv,
+ int *best_motion_err) {
MACROBLOCKD *const xd = &x->e_mbd;
- int num00;
-
- int_mv tmp_mv;
- int_mv ref_mv_full;
-
- int tmp_err;
+ MV tmp_mv = {0, 0};
+ MV ref_mv_full = {ref_mv->row >> 3, ref_mv->col >> 3};
+ int num00, tmp_err, n, sr = 0;
int step_param = 3;
int further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
- int n;
- vp9_variance_fn_ptr_t v_fn_ptr =
- cpi->fn_ptr[xd->mi_8x8[0]->mbmi.sb_type];
+ const BLOCK_SIZE bsize = xd->mi_8x8[0]->mbmi.sb_type;
+ vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[bsize];
int new_mv_mode_penalty = 256;
+ const int quart_frm = MIN(cpi->common.width, cpi->common.height);
- int sr = 0;
- int quart_frm = MIN(cpi->common.width, cpi->common.height);
-
- // refine the motion search range accroding to the frame dimension
- // for first pass test
+ // Refine the motion search range according to the frame dimension
+ // for first pass test.
while ((quart_frm << sr) < MAX_FULL_PEL_VAL)
- sr++;
- if (sr)
- sr--;
+ ++sr;
- step_param += sr;
+ step_param += sr;
further_steps -= sr;
- // override the default variance function to use MSE
- switch (xd->mi_8x8[0]->mbmi.sb_type) {
- case BLOCK_8X8:
- v_fn_ptr.vf = vp9_mse8x8;
- break;
- case BLOCK_16X8:
- v_fn_ptr.vf = vp9_mse16x8;
- break;
- case BLOCK_8X16:
- v_fn_ptr.vf = vp9_mse8x16;
- break;
- default:
- v_fn_ptr.vf = vp9_mse16x16;
- break;
- }
-
- // Set up pointers for this macro block recon buffer
- xd->plane[0].pre[0].buf = recon_buffer->y_buffer + recon_yoffset;
+ // Override the default variance function to use MSE.
+ v_fn_ptr.vf = get_block_variance_fn(bsize);
- // Initial step/diamond search centred on best mv
- tmp_mv.as_int = 0;
- ref_mv_full.as_mv.col = ref_mv->as_mv.col >> 3;
- ref_mv_full.as_mv.row = ref_mv->as_mv.row >> 3;
- tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv, step_param,
+ // Center the initial step/diamond search on best mv.
+ tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv,
+ step_param,
x->sadperbit16, &num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
+ if (tmp_err < INT_MAX)
+ tmp_err = vp9_get_mvpred_var(x, &tmp_mv, ref_mv, &v_fn_ptr, 1);
if (tmp_err < INT_MAX - new_mv_mode_penalty)
tmp_err += new_mv_mode_penalty;
if (tmp_err < *best_motion_err) {
*best_motion_err = tmp_err;
- best_mv->row = tmp_mv.as_mv.row;
- best_mv->col = tmp_mv.as_mv.col;
+ best_mv->row = tmp_mv.row;
+ best_mv->col = tmp_mv.col;
}
- // Further step/diamond searches as necessary
+ // Carry out further step/diamond searches as necessary.
n = num00;
num00 = 0;
while (n < further_steps) {
- n++;
+ ++n;
if (num00) {
- num00--;
+ --num00;
} else {
tmp_err = cpi->diamond_search_sad(x, &ref_mv_full, &tmp_mv,
step_param + n, x->sadperbit16,
&num00, &v_fn_ptr,
x->nmvjointcost,
x->mvcost, ref_mv);
+ if (tmp_err < INT_MAX)
+ tmp_err = vp9_get_mvpred_var(x, &tmp_mv, ref_mv, &v_fn_ptr, 1);
if (tmp_err < INT_MAX - new_mv_mode_penalty)
tmp_err += new_mv_mode_penalty;
if (tmp_err < *best_motion_err) {
*best_motion_err = tmp_err;
- best_mv->row = tmp_mv.as_mv.row;
- best_mv->col = tmp_mv.as_mv.col;
+ best_mv->row = tmp_mv.row;
+ best_mv->col = tmp_mv.col;
}
}
}
}
+static BLOCK_SIZE get_bsize(const VP9_COMMON *cm, int mb_row, int mb_col) {
+ if (2 * mb_col + 1 < cm->mi_cols) {
+ return 2 * mb_row + 1 < cm->mi_rows ? BLOCK_16X16
+ : BLOCK_16X8;
+ } else {
+ return 2 * mb_row + 1 < cm->mi_rows ? BLOCK_8X16
+ : BLOCK_8X8;
+ }
+}
+
void vp9_first_pass(VP9_COMP *cpi) {
int mb_row, mb_col;
MACROBLOCK *const x = &cpi->mb;
@@ -484,24 +469,23 @@ void vp9_first_pass(VP9_COMP *cpi) {
TileInfo tile;
struct macroblock_plane *const p = x->plane;
struct macroblockd_plane *const pd = xd->plane;
- PICK_MODE_CONTEXT *ctx = &x->sb64_context;
+ const PICK_MODE_CONTEXT *ctx = &x->sb64_context;
int i;
int recon_yoffset, recon_uvoffset;
- const int lst_yv12_idx = cm->ref_frame_map[cpi->lst_fb_idx];
- const int gld_yv12_idx = cm->ref_frame_map[cpi->gld_fb_idx];
- YV12_BUFFER_CONFIG *const lst_yv12 = &cm->yv12_fb[lst_yv12_idx];
- YV12_BUFFER_CONFIG *const gld_yv12 = &cm->yv12_fb[gld_yv12_idx];
+ YV12_BUFFER_CONFIG *const lst_yv12 = get_ref_frame_buffer(cpi, LAST_FRAME);
+ YV12_BUFFER_CONFIG *gld_yv12 = get_ref_frame_buffer(cpi, GOLDEN_FRAME);
YV12_BUFFER_CONFIG *const new_yv12 = get_frame_new_buffer(cm);
- const int recon_y_stride = lst_yv12->y_stride;
- const int recon_uv_stride = lst_yv12->uv_stride;
+ int recon_y_stride = lst_yv12->y_stride;
+ int recon_uv_stride = lst_yv12->uv_stride;
+ int uv_mb_height = 16 >> (lst_yv12->y_height > lst_yv12->uv_height);
int64_t intra_error = 0;
int64_t coded_error = 0;
int64_t sr_coded_error = 0;
int sum_mvr = 0, sum_mvc = 0;
int sum_mvr_abs = 0, sum_mvc_abs = 0;
- int sum_mvrs = 0, sum_mvcs = 0;
+ int64_t sum_mvrs = 0, sum_mvcs = 0;
int mvcount = 0;
int intercount = 0;
int second_ref_count = 0;
@@ -510,112 +494,115 @@ void vp9_first_pass(VP9_COMP *cpi) {
int new_mv_count = 0;
int sum_in_vectors = 0;
uint32_t lastmv_as_int = 0;
+ struct twopass_rc *twopass = &cpi->twopass;
+ const MV zero_mv = {0, 0};
+ const YV12_BUFFER_CONFIG *first_ref_buf = lst_yv12;
+
+ vp9_clear_system_state();
+
+ if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
+ MV_REFERENCE_FRAME ref_frame = LAST_FRAME;
+ const YV12_BUFFER_CONFIG *scaled_ref_buf = NULL;
+ twopass = &cpi->svc.layer_context[cpi->svc.spatial_layer_id].twopass;
+
+ vp9_scale_references(cpi);
- int_mv zero_ref_mv;
+ // Use either last frame or alt frame for motion search.
+ if (cpi->ref_frame_flags & VP9_LAST_FLAG) {
+ scaled_ref_buf = vp9_get_scaled_ref_frame(cpi, LAST_FRAME);
+ ref_frame = LAST_FRAME;
+ } else if (cpi->ref_frame_flags & VP9_ALT_FLAG) {
+ scaled_ref_buf = vp9_get_scaled_ref_frame(cpi, ALTREF_FRAME);
+ ref_frame = ALTREF_FRAME;
+ }
- zero_ref_mv.as_int = 0;
+ if (scaled_ref_buf != NULL) {
+ // Update the stride since we are using scaled reference buffer
+ first_ref_buf = scaled_ref_buf;
+ recon_y_stride = first_ref_buf->y_stride;
+ recon_uv_stride = first_ref_buf->uv_stride;
+ uv_mb_height = 16 >> (first_ref_buf->y_height > first_ref_buf->uv_height);
+ }
- vp9_clear_system_state(); // __asm emms;
+ // Disable golden frame for svc first pass for now.
+ gld_yv12 = NULL;
+ set_ref_ptrs(cm, xd, ref_frame, NONE);
+ }
vp9_setup_src_planes(x, cpi->Source, 0, 0);
- setup_pre_planes(xd, 0, lst_yv12, 0, 0, NULL);
- setup_dst_planes(xd, new_yv12, 0, 0);
+ vp9_setup_pre_planes(xd, 0, first_ref_buf, 0, 0, NULL);
+ vp9_setup_dst_planes(xd, new_yv12, 0, 0);
xd->mi_8x8 = cm->mi_grid_visible;
- // required for vp9_frame_init_quantizer
xd->mi_8x8[0] = cm->mi;
- setup_block_dptrs(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
+ vp9_setup_block_planes(&x->e_mbd, cm->subsampling_x, cm->subsampling_y);
vp9_frame_init_quantizer(cpi);
for (i = 0; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][1];
- pd[i].qcoeff = ctx->qcoeff_pbuf[i][1];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][1];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
- pd[i].eobs = ctx->eobs_pbuf[i][1];
+ p[i].eobs = ctx->eobs_pbuf[i][1];
}
x->skip_recode = 0;
+ vp9_init_mv_probs(cm);
+ vp9_initialize_rd_consts(cpi);
- // Initialise the MV cost table to the defaults
- // if( cm->current_video_frame == 0)
- // if ( 0 )
- {
- vp9_init_mv_probs(cm);
- vp9_initialize_rd_consts(cpi);
- }
-
- // tiling is ignored in the first pass
+ // Tiling is ignored in the first pass.
vp9_tile_init(&tile, cm, 0, 0);
- // for each macroblock row in image
- for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) {
+ for (mb_row = 0; mb_row < cm->mb_rows; ++mb_row) {
int_mv best_ref_mv;
best_ref_mv.as_int = 0;
- // reset above block coeffs
+ // Reset above block coeffs.
xd->up_available = (mb_row != 0);
recon_yoffset = (mb_row * recon_y_stride * 16);
- recon_uvoffset = (mb_row * recon_uv_stride * 8);
+ recon_uvoffset = (mb_row * recon_uv_stride * uv_mb_height);
// Set up limit values for motion vectors to prevent them extending
- // outside the UMV borders
+ // outside the UMV borders.
x->mv_row_min = -((mb_row * 16) + BORDER_MV_PIXELS_B16);
x->mv_row_max = ((cm->mb_rows - 1 - mb_row) * 16)
+ BORDER_MV_PIXELS_B16;
- // for each macroblock col in image
- for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) {
+ for (mb_col = 0; mb_col < cm->mb_cols; ++mb_col) {
int this_error;
- int gf_motion_error = INT_MAX;
- int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
- double error_weight;
+ const int use_dc_pred = (mb_col || mb_row) && (!mb_col || !mb_row);
+ double error_weight = 1.0;
+ const BLOCK_SIZE bsize = get_bsize(cm, mb_row, mb_col);
- vp9_clear_system_state(); // __asm emms;
- error_weight = 1.0; // avoid uninitialized warnings
+ vp9_clear_system_state();
xd->plane[0].dst.buf = new_yv12->y_buffer + recon_yoffset;
xd->plane[1].dst.buf = new_yv12->u_buffer + recon_uvoffset;
xd->plane[2].dst.buf = new_yv12->v_buffer + recon_uvoffset;
xd->left_available = (mb_col != 0);
-
- if (mb_col * 2 + 1 < cm->mi_cols) {
- if (mb_row * 2 + 1 < cm->mi_rows) {
- xd->mi_8x8[0]->mbmi.sb_type = BLOCK_16X16;
- } else {
- xd->mi_8x8[0]->mbmi.sb_type = BLOCK_16X8;
- }
- } else {
- if (mb_row * 2 + 1 < cm->mi_rows) {
- xd->mi_8x8[0]->mbmi.sb_type = BLOCK_8X16;
- } else {
- xd->mi_8x8[0]->mbmi.sb_type = BLOCK_8X8;
- }
- }
+ xd->mi_8x8[0]->mbmi.sb_type = bsize;
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
set_mi_row_col(xd, &tile,
- mb_row << 1,
- num_8x8_blocks_high_lookup[xd->mi_8x8[0]->mbmi.sb_type],
- mb_col << 1,
- num_8x8_blocks_wide_lookup[xd->mi_8x8[0]->mbmi.sb_type],
+ mb_row << 1, num_8x8_blocks_high_lookup[bsize],
+ mb_col << 1, num_8x8_blocks_wide_lookup[bsize],
cm->mi_rows, cm->mi_cols);
- if (cpi->sf.variance_adaptive_quantization) {
- int energy = vp9_block_energy(cpi, x, xd->mi_8x8[0]->mbmi.sb_type);
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ const int energy = vp9_block_energy(cpi, x, bsize);
error_weight = vp9_vaq_inv_q_ratio(energy);
}
- // do intra 16x16 prediction
+ // Do intra 16x16 prediction.
this_error = vp9_encode_intra(x, use_dc_pred);
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_clear_system_state(); // __asm emms;
- this_error *= error_weight;
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_clear_system_state();
+ this_error = (int)(this_error * error_weight);
}
- // intrapenalty below deals with situations where the intra and inter
- // error scores are very low (eg a plain black frame).
+ // Intrapenalty below deals with situations where the intra and inter
+ // error scores are very low (e.g. a plain black frame).
// We do not have special cases in first pass for 0,0 and nearest etc so
// all inter modes carry an overhead cost estimate for the mv.
// When the error score is very low this causes us to pick all or lots of
@@ -623,44 +610,42 @@ void vp9_first_pass(VP9_COMP *cpi) {
// This penalty adds a cost matching that of a 0,0 mv to the intra case.
this_error += intrapenalty;
- // Cumulative intra error total
+ // Accumulate the intra error.
intra_error += (int64_t)this_error;
// Set up limit values for motion vectors to prevent them extending
// outside the UMV borders.
x->mv_col_min = -((mb_col * 16) + BORDER_MV_PIXELS_B16);
- x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16)
- + BORDER_MV_PIXELS_B16;
+ x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) + BORDER_MV_PIXELS_B16;
- // Other than for the first frame do a motion search
+ // Other than for the first frame do a motion search.
if (cm->current_video_frame > 0) {
- int tmp_err;
- int motion_error = INT_MAX;
+ int tmp_err, motion_error;
int_mv mv, tmp_mv;
- // Simple 0,0 motion with no mv overhead
- zz_motion_search(cpi, x, lst_yv12, &motion_error, recon_yoffset);
+ xd->plane[0].pre[0].buf = first_ref_buf->y_buffer + recon_yoffset;
+ motion_error = zz_motion_search(x);
+ // Assume 0,0 motion with no mv overhead.
mv.as_int = tmp_mv.as_int = 0;
// Test last reference frame using the previous best mv as the
- // starting point (best reference) for the search
- first_pass_motion_search(cpi, x, &best_ref_mv,
- &mv.as_mv, lst_yv12,
- &motion_error, recon_yoffset);
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_clear_system_state(); // __asm emms;
- motion_error *= error_weight;
+ // starting point (best reference) for the search.
+ first_pass_motion_search(cpi, x, &best_ref_mv.as_mv, &mv.as_mv,
+ &motion_error);
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_clear_system_state();
+ motion_error = (int)(motion_error * error_weight);
}
// If the current best reference mv is not centered on 0,0 then do a 0,0
// based search as well.
if (best_ref_mv.as_int) {
tmp_err = INT_MAX;
- first_pass_motion_search(cpi, x, &zero_ref_mv, &tmp_mv.as_mv,
- lst_yv12, &tmp_err, recon_yoffset);
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_clear_system_state(); // __asm emms;
- tmp_err *= error_weight;
+ first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv.as_mv,
+ &tmp_err);
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_clear_system_state();
+ tmp_err = (int)(tmp_err * error_weight);
}
if (tmp_err < motion_error) {
@@ -669,34 +654,33 @@ void vp9_first_pass(VP9_COMP *cpi) {
}
}
- // Experimental search in an older reference frame
- if (cm->current_video_frame > 1) {
- // Simple 0,0 motion with no mv overhead
- zz_motion_search(cpi, x, gld_yv12,
- &gf_motion_error, recon_yoffset);
-
- first_pass_motion_search(cpi, x, &zero_ref_mv,
- &tmp_mv.as_mv, gld_yv12,
- &gf_motion_error, recon_yoffset);
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_clear_system_state(); // __asm emms;
- gf_motion_error *= error_weight;
- }
+ // Search in an older reference frame.
+ if (cm->current_video_frame > 1 && gld_yv12 != NULL) {
+ // Assume 0,0 motion with no mv overhead.
+ int gf_motion_error;
- if ((gf_motion_error < motion_error) &&
- (gf_motion_error < this_error)) {
- second_ref_count++;
+ xd->plane[0].pre[0].buf = gld_yv12->y_buffer + recon_yoffset;
+ gf_motion_error = zz_motion_search(x);
+
+ first_pass_motion_search(cpi, x, &zero_mv, &tmp_mv.as_mv,
+ &gf_motion_error);
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_clear_system_state();
+ gf_motion_error = (int)(gf_motion_error * error_weight);
}
- // Reset to last frame as reference buffer
- xd->plane[0].pre[0].buf = lst_yv12->y_buffer + recon_yoffset;
- xd->plane[1].pre[0].buf = lst_yv12->u_buffer + recon_uvoffset;
- xd->plane[2].pre[0].buf = lst_yv12->v_buffer + recon_uvoffset;
+ if (gf_motion_error < motion_error && gf_motion_error < this_error)
+ ++second_ref_count;
+
+ // Reset to last frame as reference buffer.
+ xd->plane[0].pre[0].buf = first_ref_buf->y_buffer + recon_yoffset;
+ xd->plane[1].pre[0].buf = first_ref_buf->u_buffer + recon_uvoffset;
+ xd->plane[2].pre[0].buf = first_ref_buf->v_buffer + recon_uvoffset;
- // In accumulating a score for the older reference frame
- // take the best of the motion predicted score and
- // the intra coded error (just as will be done for)
- // accumulation of "coded_error" for the last frame.
+ // In accumulating a score for the older reference frame take the
+ // best of the motion predicted score and the intra coded error
+ // (just as will be done for) accumulation of "coded_error" for
+ // the last frame.
if (gf_motion_error < this_error)
sr_coded_error += gf_motion_error;
else
@@ -704,74 +688,69 @@ void vp9_first_pass(VP9_COMP *cpi) {
} else {
sr_coded_error += motion_error;
}
- /* Intra assumed best */
+ // Start by assuming that intra mode is best.
best_ref_mv.as_int = 0;
if (motion_error <= this_error) {
- // Keep a count of cases where the inter and intra were
- // very close and very low. This helps with scene cut
- // detection for example in cropped clips with black bars
- // at the sides or top and bottom.
- if ((((this_error - intrapenalty) * 9) <=
- (motion_error * 10)) &&
- (this_error < (2 * intrapenalty))) {
- neutral_count++;
- }
+ // Keep a count of cases where the inter and intra were very close
+ // and very low. This helps with scene cut detection for example in
+ // cropped clips with black bars at the sides or top and bottom.
+ if (((this_error - intrapenalty) * 9 <= motion_error * 10) &&
+ this_error < 2 * intrapenalty)
+ ++neutral_count;
mv.as_mv.row *= 8;
mv.as_mv.col *= 8;
this_error = motion_error;
- vp9_set_mbmode_and_mvs(x, NEWMV, &mv);
+ xd->mi_8x8[0]->mbmi.mode = NEWMV;
+ xd->mi_8x8[0]->mbmi.mv[0] = mv;
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
xd->mi_8x8[0]->mbmi.ref_frame[0] = LAST_FRAME;
xd->mi_8x8[0]->mbmi.ref_frame[1] = NONE;
- vp9_build_inter_predictors_sby(xd, mb_row << 1,
- mb_col << 1,
- xd->mi_8x8[0]->mbmi.sb_type);
- vp9_encode_sby(x, xd->mi_8x8[0]->mbmi.sb_type);
+ vp9_build_inter_predictors_sby(xd, mb_row << 1, mb_col << 1, bsize);
+ vp9_encode_sby_pass1(x, bsize);
sum_mvr += mv.as_mv.row;
sum_mvr_abs += abs(mv.as_mv.row);
sum_mvc += mv.as_mv.col;
sum_mvc_abs += abs(mv.as_mv.col);
sum_mvrs += mv.as_mv.row * mv.as_mv.row;
sum_mvcs += mv.as_mv.col * mv.as_mv.col;
- intercount++;
+ ++intercount;
best_ref_mv.as_int = mv.as_int;
- // Was the vector non-zero
if (mv.as_int) {
- mvcount++;
+ ++mvcount;
- // Was it different from the last non zero vector
+ // Non-zero vector, was it different from the last non zero vector?
if (mv.as_int != lastmv_as_int)
- new_mv_count++;
+ ++new_mv_count;
lastmv_as_int = mv.as_int;
- // Does the Row vector point inwards or outwards
+ // Does the row vector point inwards or outwards?
if (mb_row < cm->mb_rows / 2) {
if (mv.as_mv.row > 0)
- sum_in_vectors--;
+ --sum_in_vectors;
else if (mv.as_mv.row < 0)
- sum_in_vectors++;
+ ++sum_in_vectors;
} else if (mb_row > cm->mb_rows / 2) {
if (mv.as_mv.row > 0)
- sum_in_vectors++;
+ ++sum_in_vectors;
else if (mv.as_mv.row < 0)
- sum_in_vectors--;
+ --sum_in_vectors;
}
- // Does the Row vector point inwards or outwards
+ // Does the col vector point inwards or outwards?
if (mb_col < cm->mb_cols / 2) {
if (mv.as_mv.col > 0)
- sum_in_vectors--;
+ --sum_in_vectors;
else if (mv.as_mv.col < 0)
- sum_in_vectors++;
+ ++sum_in_vectors;
} else if (mb_col > cm->mb_cols / 2) {
if (mv.as_mv.col > 0)
- sum_in_vectors++;
+ ++sum_in_vectors;
else if (mv.as_mv.col < 0)
- sum_in_vectors--;
+ --sum_in_vectors;
}
}
}
@@ -780,108 +759,104 @@ void vp9_first_pass(VP9_COMP *cpi) {
}
coded_error += (int64_t)this_error;
- // adjust to the next column of macroblocks
+ // Adjust to the next column of MBs.
x->plane[0].src.buf += 16;
- x->plane[1].src.buf += 8;
- x->plane[2].src.buf += 8;
+ x->plane[1].src.buf += uv_mb_height;
+ x->plane[2].src.buf += uv_mb_height;
recon_yoffset += 16;
- recon_uvoffset += 8;
+ recon_uvoffset += uv_mb_height;
}
- // adjust to the next row of mbs
+ // Adjust to the next row of MBs.
x->plane[0].src.buf += 16 * x->plane[0].src.stride - 16 * cm->mb_cols;
- x->plane[1].src.buf += 8 * x->plane[1].src.stride - 8 * cm->mb_cols;
- x->plane[2].src.buf += 8 * x->plane[1].src.stride - 8 * cm->mb_cols;
+ x->plane[1].src.buf += uv_mb_height * x->plane[1].src.stride -
+ uv_mb_height * cm->mb_cols;
+ x->plane[2].src.buf += uv_mb_height * x->plane[1].src.stride -
+ uv_mb_height * cm->mb_cols;
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
}
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
{
- double weight = 0.0;
-
FIRSTPASS_STATS fps;
- fps.frame = cm->current_video_frame;
+ fps.frame = cm->current_video_frame;
+ fps.spatial_layer_id = cpi->svc.spatial_layer_id;
fps.intra_error = (double)(intra_error >> 8);
fps.coded_error = (double)(coded_error >> 8);
fps.sr_coded_error = (double)(sr_coded_error >> 8);
- weight = simple_weight(cpi->Source);
-
-
- if (weight < 0.1)
- weight = 0.1;
-
- fps.ssim_weighted_pred_err = fps.coded_error * weight;
-
- fps.pcnt_inter = 0.0;
- fps.pcnt_motion = 0.0;
- fps.MVr = 0.0;
- fps.mvr_abs = 0.0;
- fps.MVc = 0.0;
- fps.mvc_abs = 0.0;
- fps.MVrv = 0.0;
- fps.MVcv = 0.0;
- fps.mv_in_out_count = 0.0;
- fps.new_mv_count = 0.0;
- fps.count = 1.0;
-
- fps.pcnt_inter = 1.0 * (double)intercount / cm->MBs;
- fps.pcnt_second_ref = 1.0 * (double)second_ref_count / cm->MBs;
- fps.pcnt_neutral = 1.0 * (double)neutral_count / cm->MBs;
+ fps.ssim_weighted_pred_err = fps.coded_error * simple_weight(cpi->Source);
+ fps.count = 1.0;
+ fps.pcnt_inter = (double)intercount / cm->MBs;
+ fps.pcnt_second_ref = (double)second_ref_count / cm->MBs;
+ fps.pcnt_neutral = (double)neutral_count / cm->MBs;
if (mvcount > 0) {
- fps.MVr = (double)sum_mvr / (double)mvcount;
- fps.mvr_abs = (double)sum_mvr_abs / (double)mvcount;
- fps.MVc = (double)sum_mvc / (double)mvcount;
- fps.mvc_abs = (double)sum_mvc_abs / (double)mvcount;
- fps.MVrv = ((double)sum_mvrs - (fps.MVr * fps.MVr / (double)mvcount)) /
- (double)mvcount;
- fps.MVcv = ((double)sum_mvcs - (fps.MVc * fps.MVc / (double)mvcount)) /
- (double)mvcount;
- fps.mv_in_out_count = (double)sum_in_vectors / (double)(mvcount * 2);
+ fps.MVr = (double)sum_mvr / mvcount;
+ fps.mvr_abs = (double)sum_mvr_abs / mvcount;
+ fps.MVc = (double)sum_mvc / mvcount;
+ fps.mvc_abs = (double)sum_mvc_abs / mvcount;
+ fps.MVrv = ((double)sum_mvrs - (fps.MVr * fps.MVr / mvcount)) / mvcount;
+ fps.MVcv = ((double)sum_mvcs - (fps.MVc * fps.MVc / mvcount)) / mvcount;
+ fps.mv_in_out_count = (double)sum_in_vectors / (mvcount * 2);
fps.new_mv_count = new_mv_count;
-
- fps.pcnt_motion = 1.0 * (double)mvcount / cpi->common.MBs;
+ fps.pcnt_motion = (double)mvcount / cm->MBs;
+ } else {
+ fps.MVr = 0.0;
+ fps.mvr_abs = 0.0;
+ fps.MVc = 0.0;
+ fps.mvc_abs = 0.0;
+ fps.MVrv = 0.0;
+ fps.MVcv = 0.0;
+ fps.mv_in_out_count = 0.0;
+ fps.new_mv_count = 0.0;
+ fps.pcnt_motion = 0.0;
}
// TODO(paulwilkins): Handle the case when duration is set to 0, or
// something less than the full time between subsequent values of
// cpi->source_time_stamp.
- fps.duration = (double)(cpi->source->ts_end
- - cpi->source->ts_start);
+ fps.duration = (double)(cpi->source->ts_end - cpi->source->ts_start);
- // don't want to do output stats with a stack variable!
- cpi->twopass.this_frame_stats = fps;
- output_stats(cpi, cpi->output_pkt_list, &cpi->twopass.this_frame_stats);
- accumulate_stats(&cpi->twopass.total_stats, &fps);
+ // Don't want to do output stats with a stack variable!
+ twopass->this_frame_stats = fps;
+ output_stats(&twopass->this_frame_stats, cpi->output_pkt_list);
+ accumulate_stats(&twopass->total_stats, &fps);
}
// Copy the previous Last Frame back into gf and and arf buffers if
- // the prediction is good enough... but also dont allow it to lag too far
- if ((cpi->twopass.sr_update_lag > 3) ||
+ // the prediction is good enough... but also don't allow it to lag too far.
+ if ((twopass->sr_update_lag > 3) ||
((cm->current_video_frame > 0) &&
- (cpi->twopass.this_frame_stats.pcnt_inter > 0.20) &&
- ((cpi->twopass.this_frame_stats.intra_error /
- DOUBLE_DIVIDE_CHECK(cpi->twopass.this_frame_stats.coded_error)) >
- 2.0))) {
- vp8_yv12_copy_frame(lst_yv12, gld_yv12);
- cpi->twopass.sr_update_lag = 1;
+ (twopass->this_frame_stats.pcnt_inter > 0.20) &&
+ ((twopass->this_frame_stats.intra_error /
+ DOUBLE_DIVIDE_CHECK(twopass->this_frame_stats.coded_error)) > 2.0))) {
+ if (gld_yv12 != NULL) {
+ vp8_yv12_copy_frame(lst_yv12, gld_yv12);
+ }
+ twopass->sr_update_lag = 1;
+ } else {
+ ++twopass->sr_update_lag;
+ }
+
+ if (cpi->use_svc && cpi->svc.number_temporal_layers == 1) {
+ vp9_update_reference_frames(cpi);
} else {
- cpi->twopass.sr_update_lag++;
+ // Swap frame pointers so last frame refers to the frame we just compressed.
+ swap_yv12(lst_yv12, new_yv12);
}
- // swap frame pointers so last frame refers to the frame we just compressed
- swap_yv12(lst_yv12, new_yv12);
- vp9_extend_frame_borders(lst_yv12, cm->subsampling_x, cm->subsampling_y);
+ vp9_extend_frame_borders(lst_yv12);
// Special case for the first frame. Copy into the GF buffer as a second
// reference.
- if (cm->current_video_frame == 0)
+ if (cm->current_video_frame == 0 && gld_yv12 != NULL) {
vp8_yv12_copy_frame(lst_yv12, gld_yv12);
+ }
- // use this to see what the first pass reconstruction looks like
+ // Use this to see what the first pass reconstruction looks like.
if (0) {
char filename[512];
FILE *recon_file;
@@ -897,52 +872,7 @@ void vp9_first_pass(VP9_COMP *cpi) {
fclose(recon_file);
}
- cm->current_video_frame++;
-}
-
-// Estimate a cost per mb attributable to overheads such as the coding of
-// modes and motion vectors.
-// Currently simplistic in its assumptions for testing.
-//
-
-
-static double bitcost(double prob) {
- return -(log(prob) / log(2.0));
-}
-
-static int64_t estimate_modemvcost(VP9_COMP *cpi,
- FIRSTPASS_STATS *fpstats) {
-#if 0
- int mv_cost;
- int mode_cost;
-
- double av_pct_inter = fpstats->pcnt_inter / fpstats->count;
- double av_pct_motion = fpstats->pcnt_motion / fpstats->count;
- double av_intra = (1.0 - av_pct_inter);
-
- double zz_cost;
- double motion_cost;
- double intra_cost;
-
- zz_cost = bitcost(av_pct_inter - av_pct_motion);
- motion_cost = bitcost(av_pct_motion);
- intra_cost = bitcost(av_intra);
-
- // Estimate of extra bits per mv overhead for mbs
- // << 9 is the normalization to the (bits * 512) used in vp9_bits_per_mb
- mv_cost = ((int)(fpstats->new_mv_count / fpstats->count) * 8) << 9;
-
- // Crude estimate of overhead cost from modes
- // << 9 is the normalization to (bits * 512) used in vp9_bits_per_mb
- mode_cost =
- (int)((((av_pct_inter - av_pct_motion) * zz_cost) +
- (av_pct_motion * motion_cost) +
- (av_intra * intra_cost)) * cpi->common.MBs) << 9;
-
- // return mv_cost + mode_cost;
- // TODO(paulwilkins): Fix overhead costs for extended Q range.
-#endif
- return 0;
+ ++cm->current_video_frame;
}
static double calc_correction_factor(double err_per_mb,
@@ -953,206 +883,47 @@ static double calc_correction_factor(double err_per_mb,
const double error_term = err_per_mb / err_divisor;
// Adjustment based on actual quantizer to power term.
- const double power_term = MIN(vp9_convert_qindex_to_q(q) * 0.01 + pt_low,
+ const double power_term = MIN(vp9_convert_qindex_to_q(q) * 0.0125 + pt_low,
pt_high);
- // Calculate correction factor
+ // Calculate correction factor.
if (power_term < 1.0)
assert(error_term >= 0.0);
return fclamp(pow(error_term, power_term), 0.05, 5.0);
}
-// Given a current maxQ value sets a range for future values.
-// PGW TODO..
-// This code removes direct dependency on QIndex to determine the range
-// (now uses the actual quantizer) but has not been tuned.
-static void adjust_maxq_qrange(VP9_COMP *cpi) {
- int i;
- // Set the max corresponding to cpi->avg_q * 2.0
- double q = cpi->avg_q * 2.0;
- cpi->twopass.maxq_max_limit = cpi->worst_quality;
- for (i = cpi->best_quality; i <= cpi->worst_quality; i++) {
- cpi->twopass.maxq_max_limit = i;
- if (vp9_convert_qindex_to_q(i) >= q)
- break;
- }
-
- // Set the min corresponding to cpi->avg_q * 0.5
- q = cpi->avg_q * 0.5;
- cpi->twopass.maxq_min_limit = cpi->best_quality;
- for (i = cpi->worst_quality; i >= cpi->best_quality; i--) {
- cpi->twopass.maxq_min_limit = i;
- if (vp9_convert_qindex_to_q(i) <= q)
- break;
- }
-}
-
-static int estimate_max_q(VP9_COMP *cpi,
- FIRSTPASS_STATS *fpstats,
- int section_target_bandwitdh) {
+int vp9_twopass_worst_quality(VP9_COMP *cpi, FIRSTPASS_STATS *fpstats,
+ int section_target_bandwitdh) {
int q;
- int num_mbs = cpi->common.MBs;
+ const int num_mbs = cpi->common.MBs;
int target_norm_bits_per_mb;
+ const RATE_CONTROL *const rc = &cpi->rc;
- double section_err = fpstats->coded_error / fpstats->count;
- double sr_correction;
- double err_per_mb = section_err / num_mbs;
- double err_correction_factor;
- double speed_correction = 1.0;
+ const double section_err = fpstats->coded_error / fpstats->count;
+ const double err_per_mb = section_err / num_mbs;
if (section_target_bandwitdh <= 0)
- return cpi->twopass.maxq_max_limit; // Highest value allowed
+ return rc->worst_quality; // Highest value allowed
target_norm_bits_per_mb = section_target_bandwitdh < (1 << 20)
? (512 * section_target_bandwitdh) / num_mbs
: 512 * (section_target_bandwitdh / num_mbs);
- // Look at the drop in prediction quality between the last frame
- // and the GF buffer (which contained an older frame).
- if (fpstats->sr_coded_error > fpstats->coded_error) {
- double sr_err_diff = (fpstats->sr_coded_error - fpstats->coded_error) /
- (fpstats->count * cpi->common.MBs);
- sr_correction = fclamp(pow(sr_err_diff / 32.0, 0.25), 0.75, 1.25);
- } else {
- sr_correction = 0.75;
- }
-
- // Calculate a corrective factor based on a rolling ratio of bits spent
- // vs target bits
- if (cpi->rolling_target_bits > 0 &&
- cpi->active_worst_quality < cpi->worst_quality) {
- double rolling_ratio = (double)cpi->rolling_actual_bits /
- (double)cpi->rolling_target_bits;
-
- if (rolling_ratio < 0.95)
- cpi->twopass.est_max_qcorrection_factor -= 0.005;
- else if (rolling_ratio > 1.05)
- cpi->twopass.est_max_qcorrection_factor += 0.005;
-
- cpi->twopass.est_max_qcorrection_factor = fclamp(
- cpi->twopass.est_max_qcorrection_factor, 0.1, 10.0);
- }
-
- // Corrections for higher compression speed settings
- // (reduced compression expected)
- // FIXME(jimbankoski): Once we settle on vp9 speed features we need to
- // change this code.
- if (cpi->compressor_speed == 1)
- speed_correction = cpi->oxcf.cpu_used <= 5 ?
- 1.04 + (/*cpi->oxcf.cpu_used*/0 * 0.04) :
- 1.25;
-
// Try and pick a max Q that will be high enough to encode the
// content at the given rate.
- for (q = cpi->twopass.maxq_min_limit; q < cpi->twopass.maxq_max_limit; q++) {
- int bits_per_mb_at_this_q;
-
- err_correction_factor = calc_correction_factor(err_per_mb,
- ERR_DIVISOR, 0.4, 0.90, q) *
- sr_correction * speed_correction *
- cpi->twopass.est_max_qcorrection_factor;
-
- bits_per_mb_at_this_q = vp9_bits_per_mb(INTER_FRAME, q,
- err_correction_factor);
-
+ for (q = rc->best_quality; q < rc->worst_quality; ++q) {
+ const double err_correction_factor = calc_correction_factor(err_per_mb,
+ ERR_DIVISOR, 0.5, 0.90, q);
+ const int bits_per_mb_at_this_q = vp9_rc_bits_per_mb(INTER_FRAME, q,
+ err_correction_factor);
if (bits_per_mb_at_this_q <= target_norm_bits_per_mb)
break;
}
// Restriction on active max q for constrained quality mode.
- if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY &&
- q < cpi->cq_target_quality)
- q = cpi->cq_target_quality;
-
- // Adjust maxq_min_limit and maxq_max_limit limits based on
- // average q observed in clip for non kf/gf/arf frames
- // Give average a chance to settle though.
- // PGW TODO.. This code is broken for the extended Q range
- if (cpi->ni_frames > ((int)cpi->twopass.total_stats.count >> 8) &&
- cpi->ni_frames > 25)
- adjust_maxq_qrange(cpi);
-
- return q;
-}
-
-// For cq mode estimate a cq level that matches the observed
-// complexity and data rate.
-static int estimate_cq(VP9_COMP *cpi,
- FIRSTPASS_STATS *fpstats,
- int section_target_bandwitdh) {
- int q;
- int num_mbs = cpi->common.MBs;
- int target_norm_bits_per_mb;
-
- double section_err = (fpstats->coded_error / fpstats->count);
- double err_per_mb = section_err / num_mbs;
- double err_correction_factor;
- double sr_err_diff;
- double sr_correction;
- double speed_correction = 1.0;
- double clip_iiratio;
- double clip_iifactor;
-
- target_norm_bits_per_mb = (section_target_bandwitdh < (1 << 20))
- ? (512 * section_target_bandwitdh) / num_mbs
- : 512 * (section_target_bandwitdh / num_mbs);
-
-
- // Corrections for higher compression speed settings
- // (reduced compression expected)
- if (cpi->compressor_speed == 1) {
- if (cpi->oxcf.cpu_used <= 5)
- speed_correction = 1.04 + (/*cpi->oxcf.cpu_used*/ 0 * 0.04);
- else
- speed_correction = 1.25;
- }
-
- // Look at the drop in prediction quality between the last frame
- // and the GF buffer (which contained an older frame).
- if (fpstats->sr_coded_error > fpstats->coded_error) {
- sr_err_diff =
- (fpstats->sr_coded_error - fpstats->coded_error) /
- (fpstats->count * cpi->common.MBs);
- sr_correction = (sr_err_diff / 32.0);
- sr_correction = pow(sr_correction, 0.25);
- if (sr_correction < 0.75)
- sr_correction = 0.75;
- else if (sr_correction > 1.25)
- sr_correction = 1.25;
- } else {
- sr_correction = 0.75;
- }
-
- // II ratio correction factor for clip as a whole
- clip_iiratio = cpi->twopass.total_stats.intra_error /
- DOUBLE_DIVIDE_CHECK(cpi->twopass.total_stats.coded_error);
- clip_iifactor = 1.0 - ((clip_iiratio - 10.0) * 0.025);
- if (clip_iifactor < 0.80)
- clip_iifactor = 0.80;
-
- // Try and pick a Q that can encode the content at the given rate.
- for (q = 0; q < MAXQ; q++) {
- int bits_per_mb_at_this_q;
-
- // Error per MB based correction factor
- err_correction_factor =
- calc_correction_factor(err_per_mb, 100.0, 0.4, 0.90, q) *
- sr_correction * speed_correction * clip_iifactor;
-
- bits_per_mb_at_this_q =
- vp9_bits_per_mb(INTER_FRAME, q, err_correction_factor);
-
- if (bits_per_mb_at_this_q <= target_norm_bits_per_mb)
- break;
- }
-
- // Clip value to range "best allowed to (worst allowed - 1)"
- q = select_cq_level(q);
- if (q >= cpi->worst_quality)
- q = cpi->worst_quality - 1;
- if (q < cpi->best_quality)
- q = cpi->best_quality;
+ if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY)
+ q = MAX(q, cpi->cq_target_quality);
return q;
}
@@ -1161,132 +932,105 @@ extern void vp9_new_framerate(VP9_COMP *cpi, double framerate);
void vp9_init_second_pass(VP9_COMP *cpi) {
FIRSTPASS_STATS this_frame;
- FIRSTPASS_STATS *start_pos;
+ const FIRSTPASS_STATS *start_pos;
+ struct twopass_rc *const twopass = &cpi->twopass;
+ const VP9_CONFIG *const oxcf = &cpi->oxcf;
- double lower_bounds_min_rate = FRAME_OVERHEAD_BITS * cpi->oxcf.framerate;
- double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth *
- cpi->oxcf.two_pass_vbrmin_section / 100);
-
- if (two_pass_min_rate < lower_bounds_min_rate)
- two_pass_min_rate = lower_bounds_min_rate;
-
- zero_stats(&cpi->twopass.total_stats);
- zero_stats(&cpi->twopass.total_left_stats);
+ zero_stats(&twopass->total_stats);
+ zero_stats(&twopass->total_left_stats);
- if (!cpi->twopass.stats_in_end)
+ if (!twopass->stats_in_end)
return;
- cpi->twopass.total_stats = *cpi->twopass.stats_in_end;
- cpi->twopass.total_left_stats = cpi->twopass.total_stats;
+ twopass->total_stats = *twopass->stats_in_end;
+ twopass->total_left_stats = twopass->total_stats;
- // each frame can have a different duration, as the frame rate in the source
- // isn't guaranteed to be constant. The frame rate prior to the first frame
- // encoded in the second pass is a guess. However the sum duration is not.
- // Its calculated based on the actual durations of all frames from the first
- // pass.
- vp9_new_framerate(cpi, 10000000.0 * cpi->twopass.total_stats.count /
- cpi->twopass.total_stats.duration);
+ // Each frame can have a different duration, as the frame rate in the source
+ // isn't guaranteed to be constant. The frame rate prior to the first frame
+ // encoded in the second pass is a guess. However, the sum duration is not.
+ // It is calculated based on the actual durations of all frames from the
+ // first pass.
+ vp9_new_framerate(cpi, 10000000.0 * twopass->total_stats.count /
+ twopass->total_stats.duration);
- cpi->output_framerate = cpi->oxcf.framerate;
- cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats.duration *
- cpi->oxcf.target_bandwidth / 10000000.0);
- cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats.duration *
- two_pass_min_rate / 10000000.0);
+ cpi->output_framerate = oxcf->framerate;
+ twopass->bits_left = (int64_t)(twopass->total_stats.duration *
+ oxcf->target_bandwidth / 10000000.0);
// Calculate a minimum intra value to be used in determining the IIratio
// scores used in the second pass. We have this minimum to make sure
// that clips that are static but "low complexity" in the intra domain
- // are still boosted appropriately for KF/GF/ARF
- cpi->twopass.kf_intra_err_min = KF_MB_INTRA_MIN * cpi->common.MBs;
- cpi->twopass.gf_intra_err_min = GF_MB_INTRA_MIN * cpi->common.MBs;
+ // are still boosted appropriately for KF/GF/ARF.
+ twopass->kf_intra_err_min = KF_MB_INTRA_MIN * cpi->common.MBs;
+ twopass->gf_intra_err_min = GF_MB_INTRA_MIN * cpi->common.MBs;
- // This variable monitors how far behind the second ref update is lagging
- cpi->twopass.sr_update_lag = 1;
+ // This variable monitors how far behind the second ref update is lagging.
+ twopass->sr_update_lag = 1;
// Scan the first pass file and calculate an average Intra / Inter error score
// ratio for the sequence.
{
double sum_iiratio = 0.0;
- double IIRatio;
+ start_pos = twopass->stats_in;
- start_pos = cpi->twopass.stats_in; // Note the starting "file" position.
-
- while (input_stats(cpi, &this_frame) != EOF) {
- IIRatio = this_frame.intra_error
- / DOUBLE_DIVIDE_CHECK(this_frame.coded_error);
- IIRatio = (IIRatio < 1.0) ? 1.0 : (IIRatio > 20.0) ? 20.0 : IIRatio;
- sum_iiratio += IIRatio;
+ while (input_stats(twopass, &this_frame) != EOF) {
+ const double iiratio = this_frame.intra_error /
+ DOUBLE_DIVIDE_CHECK(this_frame.coded_error);
+ sum_iiratio += fclamp(iiratio, 1.0, 20.0);
}
- cpi->twopass.avg_iiratio = sum_iiratio /
- DOUBLE_DIVIDE_CHECK((double)cpi->twopass.total_stats.count);
+ twopass->avg_iiratio = sum_iiratio /
+ DOUBLE_DIVIDE_CHECK((double)twopass->total_stats.count);
- // Reset file position
- reset_fpf_position(cpi, start_pos);
+ reset_fpf_position(twopass, start_pos);
}
// Scan the first pass file and calculate a modified total error based upon
// the bias/power function used to allocate bits.
{
- start_pos = cpi->twopass.stats_in; // Note starting "file" position
+ double av_error = twopass->total_stats.ssim_weighted_pred_err /
+ DOUBLE_DIVIDE_CHECK(twopass->total_stats.count);
+
+ start_pos = twopass->stats_in;
- cpi->twopass.modified_error_total = 0.0;
- cpi->twopass.modified_error_used = 0.0;
+ twopass->modified_error_total = 0.0;
+ twopass->modified_error_min =
+ (av_error * oxcf->two_pass_vbrmin_section) / 100;
+ twopass->modified_error_max =
+ (av_error * oxcf->two_pass_vbrmax_section) / 100;
- while (input_stats(cpi, &this_frame) != EOF) {
- cpi->twopass.modified_error_total +=
+ while (input_stats(twopass, &this_frame) != EOF) {
+ twopass->modified_error_total +=
calculate_modified_err(cpi, &this_frame);
}
- cpi->twopass.modified_error_left = cpi->twopass.modified_error_total;
+ twopass->modified_error_left = twopass->modified_error_total;
- reset_fpf_position(cpi, start_pos); // Reset file position
+ reset_fpf_position(twopass, start_pos);
}
}
-void vp9_end_second_pass(VP9_COMP *cpi) {
-}
-
-// This function gives and estimate of how badly we believe
-// the prediction quality is decaying from frame to frame.
-static double get_prediction_decay_rate(VP9_COMP *cpi,
- FIRSTPASS_STATS *next_frame) {
- double prediction_decay_rate;
- double second_ref_decay;
- double mb_sr_err_diff;
-
- // Initial basis is the % mbs inter coded
- prediction_decay_rate = next_frame->pcnt_inter;
-
+// This function gives an estimate of how badly we believe the prediction
+// quality is decaying from frame to frame.
+static double get_prediction_decay_rate(const VP9_COMMON *cm,
+ const FIRSTPASS_STATS *next_frame) {
// Look at the observed drop in prediction quality between the last frame
// and the GF buffer (which contains an older frame).
- mb_sr_err_diff = (next_frame->sr_coded_error - next_frame->coded_error) /
- cpi->common.MBs;
- if (mb_sr_err_diff <= 512.0) {
- second_ref_decay = 1.0 - (mb_sr_err_diff / 512.0);
- second_ref_decay = pow(second_ref_decay, 0.5);
- if (second_ref_decay < 0.85)
- second_ref_decay = 0.85;
- else if (second_ref_decay > 1.0)
- second_ref_decay = 1.0;
- } else {
- second_ref_decay = 0.85;
- }
+ const double mb_sr_err_diff = (next_frame->sr_coded_error -
+ next_frame->coded_error) / cm->MBs;
+ const double second_ref_decay = mb_sr_err_diff <= 512.0
+ ? fclamp(pow(1.0 - (mb_sr_err_diff / 512.0), 0.5), 0.85, 1.0)
+ : 0.85;
- if (second_ref_decay < prediction_decay_rate)
- prediction_decay_rate = second_ref_decay;
-
- return prediction_decay_rate;
+ return MIN(second_ref_decay, next_frame->pcnt_inter);
}
// Function to test for a condition where a complex transition is followed
// by a static section. For example in slide shows where there is a fade
// between slides. This is to help with more optimal kf and gf positioning.
-static int detect_transition_to_still(
- VP9_COMP *cpi,
- int frame_interval,
- int still_interval,
- double loop_decay_rate,
- double last_decay_rate) {
+static int detect_transition_to_still(VP9_COMP *cpi, int frame_interval,
+ int still_interval,
+ double loop_decay_rate,
+ double last_decay_rate) {
int trans_to_still = 0;
// Break clause to detect very still sections after motion
@@ -1296,25 +1040,21 @@ static int detect_transition_to_still(
loop_decay_rate >= 0.999 &&
last_decay_rate < 0.9) {
int j;
- FIRSTPASS_STATS *position = cpi->twopass.stats_in;
+ const FIRSTPASS_STATS *position = cpi->twopass.stats_in;
FIRSTPASS_STATS tmp_next_frame;
- double zz_inter;
- // Look ahead a few frames to see if static condition
- // persists...
- for (j = 0; j < still_interval; j++) {
- if (EOF == input_stats(cpi, &tmp_next_frame))
+ // Look ahead a few frames to see if static condition persists...
+ for (j = 0; j < still_interval; ++j) {
+ if (EOF == input_stats(&cpi->twopass, &tmp_next_frame))
break;
- zz_inter =
- (tmp_next_frame.pcnt_inter - tmp_next_frame.pcnt_motion);
- if (zz_inter < 0.999)
+ if (tmp_next_frame.pcnt_inter - tmp_next_frame.pcnt_motion < 0.999)
break;
}
- // Reset file position
- reset_fpf_position(cpi, position);
- // Only if it does do we signal a transition to still
+ reset_fpf_position(&cpi->twopass, position);
+
+ // Only if it does do we signal a transition to still.
if (j == still_interval)
trans_to_still = 1;
}
@@ -1324,20 +1064,20 @@ static int detect_transition_to_still(
// This function detects a flash through the high relative pcnt_second_ref
// score in the frame following a flash frame. The offset passed in should
-// reflect this
-static int detect_flash(VP9_COMP *cpi, int offset) {
+// reflect this.
+static int detect_flash(const struct twopass_rc *twopass, int offset) {
FIRSTPASS_STATS next_frame;
int flash_detected = 0;
// Read the frame data.
// The return is FALSE (no flash detected) if not a valid frame
- if (read_frame_stats(cpi, &next_frame, offset) != EOF) {
+ if (read_frame_stats(twopass, &next_frame, offset) != EOF) {
// What we are looking for here is a situation where there is a
// brief break in prediction (such as a flash) but subsequent frames
// are reasonably well predicted by an earlier (pre flash) frame.
// The recovery after a flash is indicated by a high pcnt_second_ref
- // comapred to pcnt_inter.
+ // compared to pcnt_inter.
if (next_frame.pcnt_second_ref > next_frame.pcnt_inter &&
next_frame.pcnt_second_ref >= 0.5)
flash_detected = 1;
@@ -1346,56 +1086,48 @@ static int detect_flash(VP9_COMP *cpi, int offset) {
return flash_detected;
}
-// Update the motion related elements to the GF arf boost calculation
+// Update the motion related elements to the GF arf boost calculation.
static void accumulate_frame_motion_stats(
FIRSTPASS_STATS *this_frame,
double *this_frame_mv_in_out,
double *mv_in_out_accumulator,
double *abs_mv_in_out_accumulator,
double *mv_ratio_accumulator) {
- // double this_frame_mv_in_out;
- double this_frame_mvr_ratio;
- double this_frame_mvc_ratio;
double motion_pct;
// Accumulate motion stats.
motion_pct = this_frame->pcnt_motion;
- // Accumulate Motion In/Out of frame stats
+ // Accumulate Motion In/Out of frame stats.
*this_frame_mv_in_out = this_frame->mv_in_out_count * motion_pct;
*mv_in_out_accumulator += this_frame->mv_in_out_count * motion_pct;
- *abs_mv_in_out_accumulator +=
- fabs(this_frame->mv_in_out_count * motion_pct);
+ *abs_mv_in_out_accumulator += fabs(this_frame->mv_in_out_count * motion_pct);
// Accumulate a measure of how uniform (or conversely how random)
- // the motion field is. (A ratio of absmv / mv)
+ // the motion field is (a ratio of absmv / mv).
if (motion_pct > 0.05) {
- this_frame_mvr_ratio = fabs(this_frame->mvr_abs) /
+ const double this_frame_mvr_ratio = fabs(this_frame->mvr_abs) /
DOUBLE_DIVIDE_CHECK(fabs(this_frame->MVr));
- this_frame_mvc_ratio = fabs(this_frame->mvc_abs) /
+ const double this_frame_mvc_ratio = fabs(this_frame->mvc_abs) /
DOUBLE_DIVIDE_CHECK(fabs(this_frame->MVc));
- *mv_ratio_accumulator +=
- (this_frame_mvr_ratio < this_frame->mvr_abs)
+ *mv_ratio_accumulator += (this_frame_mvr_ratio < this_frame->mvr_abs)
? (this_frame_mvr_ratio * motion_pct)
: this_frame->mvr_abs * motion_pct;
- *mv_ratio_accumulator +=
- (this_frame_mvc_ratio < this_frame->mvc_abs)
+ *mv_ratio_accumulator += (this_frame_mvc_ratio < this_frame->mvc_abs)
? (this_frame_mvc_ratio * motion_pct)
: this_frame->mvc_abs * motion_pct;
}
}
// Calculate a baseline boost number for the current frame.
-static double calc_frame_boost(
- VP9_COMP *cpi,
- FIRSTPASS_STATS *this_frame,
- double this_frame_mv_in_out) {
+static double calc_frame_boost(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame,
+ double this_frame_mv_in_out) {
double frame_boost;
- // Underlying boost factor is based on inter intra error ratio
+ // Underlying boost factor is based on inter intra error ratio.
if (this_frame->intra_error > cpi->twopass.gf_intra_err_min)
frame_boost = (IIFACTOR * this_frame->intra_error /
DOUBLE_DIVIDE_CHECK(this_frame->coded_error));
@@ -1403,28 +1135,23 @@ static double calc_frame_boost(
frame_boost = (IIFACTOR * cpi->twopass.gf_intra_err_min /
DOUBLE_DIVIDE_CHECK(this_frame->coded_error));
- // Increase boost for frames where new data coming into frame
- // (eg zoom out). Slightly reduce boost if there is a net balance
- // of motion out of the frame (zoom in).
- // The range for this_frame_mv_in_out is -1.0 to +1.0
+ // Increase boost for frames where new data coming into frame (e.g. zoom out).
+ // Slightly reduce boost if there is a net balance of motion out of the frame
+ // (zoom in). The range for this_frame_mv_in_out is -1.0 to +1.0.
if (this_frame_mv_in_out > 0.0)
frame_boost += frame_boost * (this_frame_mv_in_out * 2.0);
- // In extreme case boost is halved
+ // In the extreme case the boost is halved.
else
frame_boost += frame_boost * (this_frame_mv_in_out / 2.0);
- // Clip to maximum
- if (frame_boost > GF_RMAX)
- frame_boost = GF_RMAX;
-
- return frame_boost;
+ return MIN(frame_boost, GF_RMAX);
}
static int calc_arf_boost(VP9_COMP *cpi, int offset,
int f_frames, int b_frames,
int *f_boost, int *b_boost) {
FIRSTPASS_STATS this_frame;
-
+ struct twopass_rc *const twopass = &cpi->twopass;
int i;
double boost_score = 0.0;
double mv_ratio_accumulator = 0.0;
@@ -1435,12 +1162,12 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset,
int arf_boost;
int flash_detected = 0;
- // Search forward from the proposed arf/next gf position
- for (i = 0; i < f_frames; i++) {
- if (read_frame_stats(cpi, &this_frame, (i + offset)) == EOF)
+ // Search forward from the proposed arf/next gf position.
+ for (i = 0; i < f_frames; ++i) {
+ if (read_frame_stats(twopass, &this_frame, (i + offset)) == EOF)
break;
- // Update the motion related elements to the boost calculation
+ // Update the motion related elements to the boost calculation.
accumulate_frame_motion_stats(&this_frame,
&this_frame_mv_in_out, &mv_in_out_accumulator,
&abs_mv_in_out_accumulator,
@@ -1448,12 +1175,12 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset,
// We want to discount the flash frame itself and the recovery
// frame that follows as both will have poor scores.
- flash_detected = detect_flash(cpi, (i + offset)) ||
- detect_flash(cpi, (i + offset + 1));
+ flash_detected = detect_flash(twopass, i + offset) ||
+ detect_flash(twopass, i + offset + 1);
- // Cumulative effect of prediction quality decay
+ // Accumulate the effect of prediction quality decay.
if (!flash_detected) {
- decay_accumulator *= get_prediction_decay_rate(cpi, &this_frame);
+ decay_accumulator *= get_prediction_decay_rate(&cpi->common, &this_frame);
decay_accumulator = decay_accumulator < MIN_DECAY_FACTOR
? MIN_DECAY_FACTOR : decay_accumulator;
}
@@ -1464,7 +1191,7 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset,
*f_boost = (int)boost_score;
- // Reset for backward looking loop
+ // Reset for backward looking loop.
boost_score = 0.0;
mv_ratio_accumulator = 0.0;
decay_accumulator = 1.0;
@@ -1472,12 +1199,12 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset,
mv_in_out_accumulator = 0.0;
abs_mv_in_out_accumulator = 0.0;
- // Search backward towards last gf position
- for (i = -1; i >= -b_frames; i--) {
- if (read_frame_stats(cpi, &this_frame, (i + offset)) == EOF)
+ // Search backward towards last gf position.
+ for (i = -1; i >= -b_frames; --i) {
+ if (read_frame_stats(twopass, &this_frame, (i + offset)) == EOF)
break;
- // Update the motion related elements to the boost calculation
+ // Update the motion related elements to the boost calculation.
accumulate_frame_motion_stats(&this_frame,
&this_frame_mv_in_out, &mv_in_out_accumulator,
&abs_mv_in_out_accumulator,
@@ -1485,12 +1212,12 @@ static int calc_arf_boost(VP9_COMP *cpi, int offset,
// We want to discount the the flash frame itself and the recovery
// frame that follows as both will have poor scores.
- flash_detected = detect_flash(cpi, (i + offset)) ||
- detect_flash(cpi, (i + offset + 1));
+ flash_detected = detect_flash(twopass, i + offset) ||
+ detect_flash(twopass, i + offset + 1);
- // Cumulative effect of prediction quality decay
+ // Cumulative effect of prediction quality decay.
if (!flash_detected) {
- decay_accumulator *= get_prediction_decay_rate(cpi, &this_frame);
+ decay_accumulator *= get_prediction_decay_rate(&cpi->common, &this_frame);
decay_accumulator = decay_accumulator < MIN_DECAY_FACTOR
? MIN_DECAY_FACTOR : decay_accumulator;
}
@@ -1538,8 +1265,7 @@ static void schedule_frames(VP9_COMP *cpi, const int start, const int end,
return;
}
- // ARF Group: work out the ARF schedule.
- // Mark ARF frames as negative.
+ // ARF Group: Work out the ARF schedule and mark ARF frames as negative.
if (end < 0) {
// printf("start:%d end:%d\n", -end, -end);
// ARF frame is at the end of the range.
@@ -1591,6 +1317,8 @@ void define_fixed_arf_period(VP9_COMP *cpi) {
cpi->this_frame_weight = cpi->arf_weight[cpi->sequence_number];
assert(cpi->this_frame_weight >= 0);
+ cpi->twopass.gf_zeromotion_pct = 0;
+
// Initialize frame coding order variables.
cpi->new_frame_coding_order_period = 0;
cpi->next_frame_in_order = 0;
@@ -1599,16 +1327,16 @@ void define_fixed_arf_period(VP9_COMP *cpi) {
vp9_zero(cpi->arf_buffer_idx);
vpx_memset(cpi->arf_weight, -1, sizeof(cpi->arf_weight));
- if (cpi->twopass.frames_to_key <= (FIXED_ARF_GROUP_SIZE + 8)) {
+ if (cpi->rc.frames_to_key <= (FIXED_ARF_GROUP_SIZE + 8)) {
// Setup a GF group close to the keyframe.
- cpi->source_alt_ref_pending = 0;
- cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
- schedule_frames(cpi, 0, (cpi->baseline_gf_interval - 1), 2, 0, 0);
+ cpi->rc.source_alt_ref_pending = 0;
+ cpi->rc.baseline_gf_interval = cpi->rc.frames_to_key;
+ schedule_frames(cpi, 0, (cpi->rc.baseline_gf_interval - 1), 2, 0, 0);
} else {
// Setup a fixed period ARF group.
- cpi->source_alt_ref_pending = 1;
- cpi->baseline_gf_interval = FIXED_ARF_GROUP_SIZE;
- schedule_frames(cpi, 0, -(cpi->baseline_gf_interval - 1), 2, 1, 0);
+ cpi->rc.source_alt_ref_pending = 1;
+ cpi->rc.baseline_gf_interval = FIXED_ARF_GROUP_SIZE;
+ schedule_frames(cpi, 0, -(cpi->rc.baseline_gf_interval - 1), 2, 1, 0);
}
// Replace level indicator of -1 with correct level.
@@ -1647,7 +1375,8 @@ void define_fixed_arf_period(VP9_COMP *cpi) {
// Analyse and define a gf/arf group.
static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
FIRSTPASS_STATS next_frame = { 0 };
- FIRSTPASS_STATS *start_pos;
+ const FIRSTPASS_STATS *start_pos;
+ struct twopass_rc *const twopass = &cpi->twopass;
int i;
double boost_score = 0.0;
double old_boost_score = 0.0;
@@ -1659,40 +1388,40 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
double decay_accumulator = 1.0;
double zero_motion_accumulator = 1.0;
- double loop_decay_rate = 1.00; // Starting decay rate
+ double loop_decay_rate = 1.00;
double last_loop_decay_rate = 1.00;
double this_frame_mv_in_out = 0.0;
double mv_in_out_accumulator = 0.0;
double abs_mv_in_out_accumulator = 0.0;
double mv_ratio_accumulator_thresh;
- int max_bits = frame_max_bits(cpi); // Max for a single frame
+ const int max_bits = frame_max_bits(cpi); // Max bits for a single frame.
- unsigned int allow_alt_ref =
- cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames;
+ unsigned int allow_alt_ref = cpi->oxcf.play_alternate &&
+ cpi->oxcf.lag_in_frames;
int f_boost = 0;
int b_boost = 0;
int flash_detected;
int active_max_gf_interval;
+ RATE_CONTROL *const rc = &cpi->rc;
- cpi->twopass.gf_group_bits = 0;
+ twopass->gf_group_bits = 0;
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
- start_pos = cpi->twopass.stats_in;
+ start_pos = twopass->stats_in;
// Load stats for the current frame.
mod_frame_err = calculate_modified_err(cpi, this_frame);
- // Note the error of the frame at the start of the group (this will be
- // the GF frame error if we code a normal gf
+ // Note the error of the frame at the start of the group. This will be
+ // the GF frame error if we code a normal gf.
gf_first_frame_err = mod_frame_err;
- // Special treatment if the current frame is a key frame (which is also
- // a gf). If it is then its error score (and hence bit allocation) need
- // to be subtracted out from the calculation for the GF group
- if (cpi->common.frame_type == KEY_FRAME)
+ // If this is a key frame or the overlay from a previous arf then
+ // the error score / cost of this frame has already been accounted for.
+ if (cpi->common.frame_type == KEY_FRAME || rc->source_alt_ref_active)
gf_group_err -= gf_first_frame_err;
// Motion breakout threshold for loop below depends on image size.
@@ -1704,50 +1433,49 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// bits to spare and are better with a smaller interval and smaller boost.
// At high Q when there are few bits to spare we are better with a longer
// interval to spread the cost of the GF.
+ //
active_max_gf_interval =
- 12 + ((int)vp9_convert_qindex_to_q(cpi->active_worst_quality) >> 5);
+ 12 + ((int)vp9_convert_qindex_to_q(rc->last_q[INTER_FRAME]) >> 5);
- if (active_max_gf_interval > cpi->max_gf_interval)
- active_max_gf_interval = cpi->max_gf_interval;
+ if (active_max_gf_interval > rc->max_gf_interval)
+ active_max_gf_interval = rc->max_gf_interval;
i = 0;
- while (((i < cpi->twopass.static_scene_max_gf_interval) ||
- ((cpi->twopass.frames_to_key - i) < MIN_GF_INTERVAL)) &&
- (i < cpi->twopass.frames_to_key)) {
- i++; // Increment the loop counter
+ while (i < rc->static_scene_max_gf_interval && i < rc->frames_to_key) {
+ ++i;
- // Accumulate error score of frames in this gf group
+ // Accumulate error score of frames in this gf group.
mod_frame_err = calculate_modified_err(cpi, this_frame);
gf_group_err += mod_frame_err;
- if (EOF == input_stats(cpi, &next_frame))
+ if (EOF == input_stats(twopass, &next_frame))
break;
// Test for the case where there is a brief flash but the prediction
// quality back to an earlier frame is then restored.
- flash_detected = detect_flash(cpi, 0);
+ flash_detected = detect_flash(twopass, 0);
- // Update the motion related elements to the boost calculation
+ // Update the motion related elements to the boost calculation.
accumulate_frame_motion_stats(&next_frame,
&this_frame_mv_in_out, &mv_in_out_accumulator,
&abs_mv_in_out_accumulator,
&mv_ratio_accumulator);
- // Cumulative effect of prediction quality decay
+ // Accumulate the effect of prediction quality decay.
if (!flash_detected) {
last_loop_decay_rate = loop_decay_rate;
- loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame);
+ loop_decay_rate = get_prediction_decay_rate(&cpi->common, &next_frame);
decay_accumulator = decay_accumulator * loop_decay_rate;
// Monitor for static sections.
if ((next_frame.pcnt_inter - next_frame.pcnt_motion) <
zero_motion_accumulator) {
- zero_motion_accumulator =
- (next_frame.pcnt_inter - next_frame.pcnt_motion);
+ zero_motion_accumulator = next_frame.pcnt_inter -
+ next_frame.pcnt_motion;
}
- // Break clause to detect very still sections after motion
- // (for example a static image after a fade or other transition).
+ // Break clause to detect very still sections after motion. For example,
+ // a static image after a fade or other transition.
if (detect_transition_to_still(cpi, i, 5, loop_decay_rate,
last_loop_decay_rate)) {
allow_alt_ref = 0;
@@ -1755,20 +1483,17 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
}
}
- // Calculate a boost number for this frame
- boost_score +=
- (decay_accumulator *
+ // Calculate a boost number for this frame.
+ boost_score += (decay_accumulator *
calc_frame_boost(cpi, &next_frame, this_frame_mv_in_out));
// Break out conditions.
if (
- // Break at cpi->max_gf_interval unless almost totally static
+ // Break at cpi->max_gf_interval unless almost totally static.
(i >= active_max_gf_interval && (zero_motion_accumulator < 0.995)) ||
(
- // Don't break out with a very short interval
+ // Don't break out with a very short interval.
(i > MIN_GF_INTERVAL) &&
- // Don't break out very close to a key frame
- ((cpi->twopass.frames_to_key - i) >= MIN_GF_INTERVAL) &&
((boost_score > 125.0) || (next_frame.pcnt_inter < 0.75)) &&
(!flash_detected) &&
((mv_ratio_accumulator > mv_ratio_accumulator_thresh) ||
@@ -1784,26 +1509,23 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
old_boost_score = boost_score;
}
- cpi->gf_zeromotion_pct = (int)(zero_motion_accumulator * 1000.0);
+ twopass->gf_zeromotion_pct = (int)(zero_motion_accumulator * 1000.0);
- // Don't allow a gf too near the next kf
- if ((cpi->twopass.frames_to_key - i) < MIN_GF_INTERVAL) {
- while (i < cpi->twopass.frames_to_key) {
- i++;
+ // Don't allow a gf too near the next kf.
+ if ((rc->frames_to_key - i) < MIN_GF_INTERVAL) {
+ while (i < (rc->frames_to_key + !rc->next_key_frame_forced)) {
+ ++i;
- if (EOF == input_stats(cpi, this_frame))
+ if (EOF == input_stats(twopass, this_frame))
break;
- if (i < cpi->twopass.frames_to_key) {
+ if (i < rc->frames_to_key) {
mod_frame_err = calculate_modified_err(cpi, this_frame);
gf_group_err += mod_frame_err;
}
}
}
- // Set the interval until the next gf or arf.
- cpi->baseline_gf_interval = i;
-
#if CONFIG_MULTIPLE_ARF
if (cpi->multi_arf_enabled) {
// Initialize frame coding order variables.
@@ -1816,36 +1538,39 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
}
#endif
- // Should we use the alternate reference frame
+ // Set the interval until the next gf.
+ if (cpi->common.frame_type == KEY_FRAME || rc->source_alt_ref_active)
+ rc->baseline_gf_interval = i - 1;
+ else
+ rc->baseline_gf_interval = i;
+
+ // Should we use the alternate reference frame.
if (allow_alt_ref &&
(i < cpi->oxcf.lag_in_frames) &&
(i >= MIN_GF_INTERVAL) &&
- // dont use ARF very near next kf
- (i <= (cpi->twopass.frames_to_key - MIN_GF_INTERVAL)) &&
- ((next_frame.pcnt_inter > 0.75) ||
- (next_frame.pcnt_second_ref > 0.5)) &&
- ((mv_in_out_accumulator / (double)i > -0.2) ||
- (mv_in_out_accumulator > -2.0)) &&
- (boost_score > 100)) {
- // Alternative boost calculation for alt ref
- cpi->gfu_boost = calc_arf_boost(cpi, 0, (i - 1), (i - 1), &f_boost,
- &b_boost);
- cpi->source_alt_ref_pending = 1;
+ // For real scene cuts (not forced kfs) don't allow arf very near kf.
+ (rc->next_key_frame_forced ||
+ (i <= (rc->frames_to_key - MIN_GF_INTERVAL)))) {
+ // Calculate the boost for alt ref.
+ rc->gfu_boost = calc_arf_boost(cpi, 0, (i - 1), (i - 1), &f_boost,
+ &b_boost);
+ rc->source_alt_ref_pending = 1;
#if CONFIG_MULTIPLE_ARF
// Set the ARF schedule.
if (cpi->multi_arf_enabled) {
- schedule_frames(cpi, 0, -(cpi->baseline_gf_interval - 1), 2, 1, 0);
+ schedule_frames(cpi, 0, -(rc->baseline_gf_interval - 1), 2, 1, 0);
}
#endif
} else {
- cpi->gfu_boost = (int)boost_score;
- cpi->source_alt_ref_pending = 0;
+ rc->gfu_boost = (int)boost_score;
+ rc->source_alt_ref_pending = 0;
#if CONFIG_MULTIPLE_ARF
// Set the GF schedule.
if (cpi->multi_arf_enabled) {
- schedule_frames(cpi, 0, cpi->baseline_gf_interval - 1, 2, 0, 0);
- assert(cpi->new_frame_coding_order_period == cpi->baseline_gf_interval);
+ schedule_frames(cpi, 0, rc->baseline_gf_interval - 1, 2, 0, 0);
+ assert(cpi->new_frame_coding_order_period ==
+ rc->baseline_gf_interval);
}
#endif
}
@@ -1888,65 +1613,43 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
#endif
#endif
- // Now decide how many bits should be allocated to the GF group as a
- // proportion of those remaining in the kf group.
- // The final key frame group in the clip is treated as a special case
- // where cpi->twopass.kf_group_bits is tied to cpi->twopass.bits_left.
- // This is also important for short clips where there may only be one
- // key frame.
- if (cpi->twopass.frames_to_key >= (int)(cpi->twopass.total_stats.count -
- cpi->common.current_video_frame)) {
- cpi->twopass.kf_group_bits =
- (cpi->twopass.bits_left > 0) ? cpi->twopass.bits_left : 0;
- }
-
- // Calculate the bits to be allocated to the group as a whole
- if ((cpi->twopass.kf_group_bits > 0) &&
- (cpi->twopass.kf_group_error_left > 0)) {
- cpi->twopass.gf_group_bits =
- (int64_t)(cpi->twopass.kf_group_bits *
+ // Calculate the bits to be allocated to the group as a whole.
+ if (twopass->kf_group_bits > 0 && twopass->kf_group_error_left > 0) {
+ twopass->gf_group_bits = (int64_t)(cpi->twopass.kf_group_bits *
(gf_group_err / cpi->twopass.kf_group_error_left));
} else {
- cpi->twopass.gf_group_bits = 0;
+ twopass->gf_group_bits = 0;
}
- cpi->twopass.gf_group_bits =
- (cpi->twopass.gf_group_bits < 0)
- ? 0
- : (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits)
- ? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits;
+ twopass->gf_group_bits = (twopass->gf_group_bits < 0) ?
+ 0 : (twopass->gf_group_bits > twopass->kf_group_bits) ?
+ twopass->kf_group_bits : twopass->gf_group_bits;
// Clip cpi->twopass.gf_group_bits based on user supplied data rate
- // variability limit (cpi->oxcf.two_pass_vbrmax_section)
- if (cpi->twopass.gf_group_bits >
- (int64_t)max_bits * cpi->baseline_gf_interval)
- cpi->twopass.gf_group_bits = (int64_t)max_bits * cpi->baseline_gf_interval;
-
- // Reset the file position
- reset_fpf_position(cpi, start_pos);
+ // variability limit, cpi->oxcf.two_pass_vbrmax_section.
+ if (twopass->gf_group_bits > (int64_t)max_bits * rc->baseline_gf_interval)
+ twopass->gf_group_bits = (int64_t)max_bits * rc->baseline_gf_interval;
- // Update the record of error used so far (only done once per gf group)
- cpi->twopass.modified_error_used += gf_group_err;
+ // Reset the file position.
+ reset_fpf_position(twopass, start_pos);
// Assign bits to the arf or gf.
- for (i = 0;
- i <= (cpi->source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME);
- ++i) {
+ for (i = 0; i <= (rc->source_alt_ref_pending &&
+ cpi->common.frame_type != KEY_FRAME); ++i) {
int allocation_chunks;
- int q = cpi->oxcf.fixed_q < 0 ? cpi->last_q[INTER_FRAME]
- : cpi->oxcf.fixed_q;
+ int q = rc->last_q[INTER_FRAME];
int gf_bits;
- int boost = (cpi->gfu_boost * vp9_gfboost_qadjust(q)) / 100;
+ int boost = (rc->gfu_boost * gfboost_qadjust(q)) / 100;
- // Set max and minimum boost and hence minimum allocation
- boost = clamp(boost, 125, (cpi->baseline_gf_interval + 1) * 200);
+ // Set max and minimum boost and hence minimum allocation.
+ boost = clamp(boost, 125, (rc->baseline_gf_interval + 1) * 200);
- if (cpi->source_alt_ref_pending && i == 0)
- allocation_chunks = ((cpi->baseline_gf_interval + 1) * 100) + boost;
+ if (rc->source_alt_ref_pending && i == 0)
+ allocation_chunks = ((rc->baseline_gf_interval + 1) * 100) + boost;
else
- allocation_chunks = (cpi->baseline_gf_interval * 100) + (boost - 100);
+ allocation_chunks = (rc->baseline_gf_interval * 100) + (boost - 100);
- // Prevent overflow
+ // Prevent overflow.
if (boost > 1023) {
int divisor = boost >> 10;
boost /= divisor;
@@ -1954,18 +1657,18 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
}
// Calculate the number of bits to be spent on the gf or arf based on
- // the boost number
- gf_bits = (int)((double)boost * (cpi->twopass.gf_group_bits /
- (double)allocation_chunks));
+ // the boost number.
+ gf_bits = (int)((double)boost * (twopass->gf_group_bits /
+ (double)allocation_chunks));
// If the frame that is to be boosted is simpler than the average for
// the gf/arf group then use an alternative calculation
- // based on the error score of the frame itself
- if (mod_frame_err < gf_group_err / (double)cpi->baseline_gf_interval) {
- double alt_gf_grp_bits =
- (double)cpi->twopass.kf_group_bits *
- (mod_frame_err * (double)cpi->baseline_gf_interval) /
- DOUBLE_DIVIDE_CHECK(cpi->twopass.kf_group_error_left);
+ // based on the error score of the frame itself.
+ if (rc->baseline_gf_interval < 1 ||
+ mod_frame_err < gf_group_err / (double)rc->baseline_gf_interval) {
+ double alt_gf_grp_bits = (double)twopass->kf_group_bits *
+ (mod_frame_err * (double)rc->baseline_gf_interval) /
+ DOUBLE_DIVIDE_CHECK(twopass->kf_group_error_left);
int alt_gf_bits = (int)((double)boost * (alt_gf_grp_bits /
(double)allocation_chunks));
@@ -1976,68 +1679,68 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// If it is harder than other frames in the group make sure it at
// least receives an allocation in keeping with its relative error
// score, otherwise it may be worse off than an "un-boosted" frame.
- int alt_gf_bits = (int)((double)cpi->twopass.kf_group_bits *
+ int alt_gf_bits = (int)((double)twopass->kf_group_bits *
mod_frame_err /
- DOUBLE_DIVIDE_CHECK(cpi->twopass.kf_group_error_left));
+ DOUBLE_DIVIDE_CHECK(twopass->kf_group_error_left));
if (alt_gf_bits > gf_bits)
gf_bits = alt_gf_bits;
}
- // Dont allow a negative value for gf_bits
+ // Don't allow a negative value for gf_bits.
if (gf_bits < 0)
gf_bits = 0;
- // Add in minimum for a frame
- gf_bits += cpi->min_frame_bandwidth;
-
if (i == 0) {
- cpi->twopass.gf_bits = gf_bits;
+ twopass->gf_bits = gf_bits;
}
- if (i == 1 || (!cpi->source_alt_ref_pending
- && (cpi->common.frame_type != KEY_FRAME))) {
- // Per frame bit target for this frame
- cpi->per_frame_bandwidth = gf_bits;
+ if (i == 1 ||
+ (!rc->source_alt_ref_pending &&
+ cpi->common.frame_type != KEY_FRAME)) {
+ // Calculate the per frame bit target for this frame.
+ vp9_rc_set_frame_target(cpi, gf_bits);
}
}
{
- // Adjust KF group bits and error remaining
- cpi->twopass.kf_group_error_left -= (int64_t)gf_group_err;
- cpi->twopass.kf_group_bits -= cpi->twopass.gf_group_bits;
-
- if (cpi->twopass.kf_group_bits < 0)
- cpi->twopass.kf_group_bits = 0;
-
- // Note the error score left in the remaining frames of the group.
- // For normal GFs we want to remove the error score for the first frame
- // of the group (except in Key frame case where this has already
- // happened)
- if (!cpi->source_alt_ref_pending && cpi->common.frame_type != KEY_FRAME)
- cpi->twopass.gf_group_error_left = (int64_t)(gf_group_err
+ // Adjust KF group bits and error remaining.
+ twopass->kf_group_error_left -= (int64_t)gf_group_err;
+ twopass->kf_group_bits -= twopass->gf_group_bits;
+
+ if (twopass->kf_group_bits < 0)
+ twopass->kf_group_bits = 0;
+
+ // If this is an arf update we want to remove the score for the overlay
+ // frame at the end which will usually be very cheap to code.
+ // The overlay frame has already, in effect, been coded so we want to spread
+ // the remaining bits among the other frames.
+ // For normal GFs remove the score for the GF itself unless this is
+ // also a key frame in which case it has already been accounted for.
+ if (rc->source_alt_ref_pending) {
+ twopass->gf_group_error_left = (int64_t)(gf_group_err - mod_frame_err);
+ } else if (cpi->common.frame_type != KEY_FRAME) {
+ twopass->gf_group_error_left = (int64_t)(gf_group_err
- gf_first_frame_err);
- else
- cpi->twopass.gf_group_error_left = (int64_t)gf_group_err;
+ } else {
+ twopass->gf_group_error_left = (int64_t)gf_group_err;
+ }
- cpi->twopass.gf_group_bits -= cpi->twopass.gf_bits
- - cpi->min_frame_bandwidth;
+ twopass->gf_group_bits -= twopass->gf_bits;
- if (cpi->twopass.gf_group_bits < 0)
- cpi->twopass.gf_group_bits = 0;
+ if (twopass->gf_group_bits < 0)
+ twopass->gf_group_bits = 0;
// This condition could fail if there are two kfs very close together
- // despite (MIN_GF_INTERVAL) and would cause a divide by 0 in the
+ // despite MIN_GF_INTERVAL and would cause a divide by 0 in the
// calculation of alt_extra_bits.
- if (cpi->baseline_gf_interval >= 3) {
- const int boost = cpi->source_alt_ref_pending ? b_boost : cpi->gfu_boost;
+ if (rc->baseline_gf_interval >= 3) {
+ const int boost = rc->source_alt_ref_pending ? b_boost : rc->gfu_boost;
if (boost >= 150) {
- int alt_extra_bits;
- int pct_extra = (boost - 100) / 50;
- pct_extra = (pct_extra > 20) ? 20 : pct_extra;
-
- alt_extra_bits = (int)((cpi->twopass.gf_group_bits * pct_extra) / 100);
- cpi->twopass.gf_group_bits -= alt_extra_bits;
+ const int pct_extra = MIN(20, (boost - 100) / 50);
+ const int alt_extra_bits = (int)((twopass->gf_group_bits * pct_extra) /
+ 100);
+ twopass->gf_group_bits -= alt_extra_bits;
}
}
}
@@ -2046,32 +1749,29 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
FIRSTPASS_STATS sectionstats;
zero_stats(&sectionstats);
- reset_fpf_position(cpi, start_pos);
+ reset_fpf_position(twopass, start_pos);
- for (i = 0; i < cpi->baseline_gf_interval; i++) {
- input_stats(cpi, &next_frame);
+ for (i = 0; i < rc->baseline_gf_interval; ++i) {
+ input_stats(twopass, &next_frame);
accumulate_stats(&sectionstats, &next_frame);
}
avg_stats(&sectionstats);
- cpi->twopass.section_intra_rating = (int)
+ twopass->section_intra_rating = (int)
(sectionstats.intra_error /
DOUBLE_DIVIDE_CHECK(sectionstats.coded_error));
- reset_fpf_position(cpi, start_pos);
+ reset_fpf_position(twopass, start_pos);
}
}
// Allocate bits to a normal frame that is neither a gf an arf or a key frame.
static void assign_std_frame_bits(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
int target_frame_size;
-
double modified_err;
double err_fraction;
-
- // Max for a single frame.
- int max_bits = frame_max_bits(cpi);
+ const int max_bits = frame_max_bits(cpi); // Max for a single frame.
// Calculate modified prediction error used in bit allocation.
modified_err = calculate_modified_err(cpi, this_frame);
@@ -2087,15 +1787,8 @@ static void assign_std_frame_bits(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
// Clip target size to 0 - max_bits (or cpi->twopass.gf_group_bits) at
// the top end.
- if (target_frame_size < 0) {
- target_frame_size = 0;
- } else {
- if (target_frame_size > max_bits)
- target_frame_size = max_bits;
-
- if (target_frame_size > cpi->twopass.gf_group_bits)
- target_frame_size = (int)cpi->twopass.gf_group_bits;
- }
+ target_frame_size = clamp(target_frame_size, 0,
+ MIN(max_bits, (int)cpi->twopass.gf_group_bits));
// Adjust error and bits remaining.
cpi->twopass.gf_group_error_left -= (int64_t)modified_err;
@@ -2104,272 +1797,69 @@ static void assign_std_frame_bits(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
if (cpi->twopass.gf_group_bits < 0)
cpi->twopass.gf_group_bits = 0;
- // Add in the minimum number of bits that is set aside for every frame.
- target_frame_size += cpi->min_frame_bandwidth;
-
// Per frame bit target for this frame.
- cpi->per_frame_bandwidth = target_frame_size;
-}
-
-// Make a damped adjustment to the active max q.
-static int adjust_active_maxq(int old_maxqi, int new_maxqi) {
- int i;
- const double old_q = vp9_convert_qindex_to_q(old_maxqi);
- const double new_q = vp9_convert_qindex_to_q(new_maxqi);
- const double target_q = ((old_q * 7.0) + new_q) / 8.0;
-
- if (target_q > old_q) {
- for (i = old_maxqi; i <= new_maxqi; i++)
- if (vp9_convert_qindex_to_q(i) >= target_q)
- return i;
- } else {
- for (i = old_maxqi; i >= new_maxqi; i--)
- if (vp9_convert_qindex_to_q(i) <= target_q)
- return i;
- }
-
- return new_maxqi;
-}
-
-void vp9_second_pass(VP9_COMP *cpi) {
- int tmp_q;
- int frames_left = (int)(cpi->twopass.total_stats.count -
- cpi->common.current_video_frame);
-
- FIRSTPASS_STATS this_frame;
- FIRSTPASS_STATS this_frame_copy;
-
- double this_frame_intra_error;
- double this_frame_coded_error;
-
- if (!cpi->twopass.stats_in)
- return;
-
- vp9_clear_system_state();
-
- if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
- cpi->active_worst_quality = cpi->oxcf.cq_level;
- } else {
- // Special case code for first frame.
- if (cpi->common.current_video_frame == 0) {
- int section_target_bandwidth =
- (int)(cpi->twopass.bits_left / frames_left);
- cpi->twopass.est_max_qcorrection_factor = 1.0;
-
- // Set a cq_level in constrained quality mode.
- // Commenting this code out for now since it does not seem to be
- // working well.
- /*
- if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
- int est_cq = estimate_cq(cpi, &cpi->twopass.total_left_stats,
- section_target_bandwidth);
-
- if (est_cq > cpi->cq_target_quality)
- cpi->cq_target_quality = est_cq;
- else
- cpi->cq_target_quality = cpi->oxcf.cq_level;
- }
- */
-
- // guess at maxq needed in 2nd pass
- cpi->twopass.maxq_max_limit = cpi->worst_quality;
- cpi->twopass.maxq_min_limit = cpi->best_quality;
-
- tmp_q = estimate_max_q(cpi, &cpi->twopass.total_left_stats,
- section_target_bandwidth);
-
- cpi->active_worst_quality = tmp_q;
- cpi->ni_av_qi = tmp_q;
- cpi->avg_q = vp9_convert_qindex_to_q(tmp_q);
-
- // Limit the maxq value returned subsequently.
- // This increases the risk of overspend or underspend if the initial
- // estimate for the clip is bad, but helps prevent excessive
- // variation in Q, especially near the end of a clip
- // where for example a small overspend may cause Q to crash
- adjust_maxq_qrange(cpi);
- }
-
- // The last few frames of a clip almost always have to few or too many
- // bits and for the sake of over exact rate control we dont want to make
- // radical adjustments to the allowed quantizer range just to use up a
- // few surplus bits or get beneath the target rate.
- else if ((cpi->common.current_video_frame <
- (((unsigned int)cpi->twopass.total_stats.count * 255) >> 8)) &&
- ((cpi->common.current_video_frame + cpi->baseline_gf_interval) <
- (unsigned int)cpi->twopass.total_stats.count)) {
- int section_target_bandwidth =
- (int)(cpi->twopass.bits_left / frames_left);
- if (frames_left < 1)
- frames_left = 1;
-
- tmp_q = estimate_max_q(
- cpi,
- &cpi->twopass.total_left_stats,
- section_target_bandwidth);
-
- // Make a damped adjustment to active max Q
- cpi->active_worst_quality =
- adjust_active_maxq(cpi->active_worst_quality, tmp_q);
- }
- }
- vp9_zero(this_frame);
- if (EOF == input_stats(cpi, &this_frame))
- return;
-
- this_frame_intra_error = this_frame.intra_error;
- this_frame_coded_error = this_frame.coded_error;
-
- // keyframe and section processing !
- if (cpi->twopass.frames_to_key == 0) {
- // Define next KF group and assign bits to it
- this_frame_copy = this_frame;
- find_next_key_frame(cpi, &this_frame_copy);
- }
-
- // Is this a GF / ARF (Note that a KF is always also a GF)
- if (cpi->frames_till_gf_update_due == 0) {
- // Define next gf group and assign bits to it
- this_frame_copy = this_frame;
-
- cpi->gf_zeromotion_pct = 0;
-
-#if CONFIG_MULTIPLE_ARF
- if (cpi->multi_arf_enabled) {
- define_fixed_arf_period(cpi);
- } else {
-#endif
- define_gf_group(cpi, &this_frame_copy);
-#if CONFIG_MULTIPLE_ARF
- }
-#endif
-
- if (cpi->gf_zeromotion_pct > 995) {
- // As long as max_thresh for encode breakout is small enough, it is ok
- // to enable it for no-show frame, i.e. set enable_encode_breakout to 2.
- if (!cpi->common.show_frame)
- cpi->enable_encode_breakout = 0;
- else
- cpi->enable_encode_breakout = 2;
- }
-
- // If we are going to code an altref frame at the end of the group
- // and the current frame is not a key frame....
- // If the previous group used an arf this frame has already benefited
- // from that arf boost and it should not be given extra bits
- // If the previous group was NOT coded using arf we may want to apply
- // some boost to this GF as well
- if (cpi->source_alt_ref_pending && (cpi->common.frame_type != KEY_FRAME)) {
- // Assign a standard frames worth of bits from those allocated
- // to the GF group
- int bak = cpi->per_frame_bandwidth;
- this_frame_copy = this_frame;
- assign_std_frame_bits(cpi, &this_frame_copy);
- cpi->per_frame_bandwidth = bak;
- }
- } else {
- // Otherwise this is an ordinary frame
- // Assign bits from those allocated to the GF group
- this_frame_copy = this_frame;
- assign_std_frame_bits(cpi, &this_frame_copy);
- }
-
- // Keep a globally available copy of this and the next frame's iiratio.
- cpi->twopass.this_iiratio = (int)(this_frame_intra_error /
- DOUBLE_DIVIDE_CHECK(this_frame_coded_error));
- {
- FIRSTPASS_STATS next_frame;
- if (lookup_next_frame_stats(cpi, &next_frame) != EOF) {
- cpi->twopass.next_iiratio = (int)(next_frame.intra_error /
- DOUBLE_DIVIDE_CHECK(next_frame.coded_error));
- }
- }
-
- // Set nominal per second bandwidth for this frame
- cpi->target_bandwidth = (int)(cpi->per_frame_bandwidth
- * cpi->output_framerate);
- if (cpi->target_bandwidth < 0)
- cpi->target_bandwidth = 0;
-
- cpi->twopass.frames_to_key--;
-
- // Update the total stats remaining structure
- subtract_stats(&cpi->twopass.total_left_stats, &this_frame);
+ vp9_rc_set_frame_target(cpi, target_frame_size);
}
static int test_candidate_kf(VP9_COMP *cpi,
- FIRSTPASS_STATS *last_frame,
- FIRSTPASS_STATS *this_frame,
- FIRSTPASS_STATS *next_frame) {
+ const FIRSTPASS_STATS *last_frame,
+ const FIRSTPASS_STATS *this_frame,
+ const FIRSTPASS_STATS *next_frame) {
int is_viable_kf = 0;
- // Does the frame satisfy the primary criteria of a key frame
- // If so, then examine how well it predicts subsequent frames
+ // Does the frame satisfy the primary criteria of a key frame?
+ // If so, then examine how well it predicts subsequent frames.
if ((this_frame->pcnt_second_ref < 0.10) &&
(next_frame->pcnt_second_ref < 0.10) &&
((this_frame->pcnt_inter < 0.05) ||
- (((this_frame->pcnt_inter - this_frame->pcnt_neutral) < .35) &&
+ (((this_frame->pcnt_inter - this_frame->pcnt_neutral) < 0.35) &&
((this_frame->intra_error /
DOUBLE_DIVIDE_CHECK(this_frame->coded_error)) < 2.5) &&
((fabs(last_frame->coded_error - this_frame->coded_error) /
- DOUBLE_DIVIDE_CHECK(this_frame->coded_error) >
- .40) ||
+ DOUBLE_DIVIDE_CHECK(this_frame->coded_error) > 0.40) ||
(fabs(last_frame->intra_error - this_frame->intra_error) /
- DOUBLE_DIVIDE_CHECK(this_frame->intra_error) >
- .40) ||
+ DOUBLE_DIVIDE_CHECK(this_frame->intra_error) > 0.40) ||
((next_frame->intra_error /
DOUBLE_DIVIDE_CHECK(next_frame->coded_error)) > 3.5))))) {
int i;
- FIRSTPASS_STATS *start_pos;
-
- FIRSTPASS_STATS local_next_frame;
-
+ const FIRSTPASS_STATS *start_pos = cpi->twopass.stats_in;
+ FIRSTPASS_STATS local_next_frame = *next_frame;
double boost_score = 0.0;
double old_boost_score = 0.0;
double decay_accumulator = 1.0;
- double next_iiratio;
- local_next_frame = *next_frame;
-
- // Note the starting file position so we can reset to it
- start_pos = cpi->twopass.stats_in;
-
- // Examine how well the key frame predicts subsequent frames
- for (i = 0; i < 16; i++) {
- next_iiratio = (IIKFACTOR1 * local_next_frame.intra_error /
- DOUBLE_DIVIDE_CHECK(local_next_frame.coded_error));
+ // Examine how well the key frame predicts subsequent frames.
+ for (i = 0; i < 16; ++i) {
+ double next_iiratio = (IIKFACTOR1 * local_next_frame.intra_error /
+ DOUBLE_DIVIDE_CHECK(local_next_frame.coded_error));
if (next_iiratio > RMAX)
next_iiratio = RMAX;
- // Cumulative effect of decay in prediction quality
+ // Cumulative effect of decay in prediction quality.
if (local_next_frame.pcnt_inter > 0.85)
- decay_accumulator = decay_accumulator * local_next_frame.pcnt_inter;
+ decay_accumulator *= local_next_frame.pcnt_inter;
else
- decay_accumulator =
- decay_accumulator * ((0.85 + local_next_frame.pcnt_inter) / 2.0);
-
- // decay_accumulator = decay_accumulator * local_next_frame.pcnt_inter;
+ decay_accumulator *= (0.85 + local_next_frame.pcnt_inter) / 2.0;
- // Keep a running total
+ // Keep a running total.
boost_score += (decay_accumulator * next_iiratio);
- // Test various breakout clauses
+ // Test various breakout clauses.
if ((local_next_frame.pcnt_inter < 0.05) ||
(next_iiratio < 1.5) ||
(((local_next_frame.pcnt_inter -
local_next_frame.pcnt_neutral) < 0.20) &&
(next_iiratio < 3.0)) ||
((boost_score - old_boost_score) < 3.0) ||
- (local_next_frame.intra_error < 200)
- ) {
+ (local_next_frame.intra_error < 200)) {
break;
}
old_boost_score = boost_score;
// Get the next frame details
- if (EOF == input_stats(cpi, &local_next_frame))
+ if (EOF == input_stats(&cpi->twopass, &local_next_frame))
break;
}
@@ -2379,7 +1869,7 @@ static int test_candidate_kf(VP9_COMP *cpi,
is_viable_kf = 1;
} else {
// Reset the file position
- reset_fpf_position(cpi, start_pos);
+ reset_fpf_position(&cpi->twopass, start_pos);
is_viable_kf = 0;
}
@@ -2387,12 +1877,15 @@ static int test_candidate_kf(VP9_COMP *cpi,
return is_viable_kf;
}
+
static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
int i, j;
+ RATE_CONTROL *const rc = &cpi->rc;
+ struct twopass_rc *const twopass = &cpi->twopass;
FIRSTPASS_STATS last_frame;
- FIRSTPASS_STATS first_frame;
+ const FIRSTPASS_STATS first_frame = *this_frame;
FIRSTPASS_STATS next_frame;
- FIRSTPASS_STATS *start_position;
+ const FIRSTPASS_STATS *start_position = twopass->stats_in;
double decay_accumulator = 1.0;
double zero_motion_accumulator = 1.0;
@@ -2401,202 +1894,165 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
double kf_mod_err = 0.0;
double kf_group_err = 0.0;
- double kf_group_intra_err = 0.0;
- double kf_group_coded_err = 0.0;
double recent_loop_decay[8] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
vp9_zero(next_frame);
- vp9_clear_system_state(); // __asm emms;
- start_position = cpi->twopass.stats_in;
-
cpi->common.frame_type = KEY_FRAME;
- // is this a forced key frame by interval
- cpi->this_key_frame_forced = cpi->next_key_frame_forced;
-
- // Clear the alt ref active flag as this can never be active on a key frame
- cpi->source_alt_ref_active = 0;
+ // Is this a forced key frame by interval.
+ rc->this_key_frame_forced = rc->next_key_frame_forced;
- // Kf is always a gf so clear frames till next gf counter
- cpi->frames_till_gf_update_due = 0;
+ // Clear the alt ref active flag as this can never be active on a key frame.
+ rc->source_alt_ref_active = 0;
- cpi->twopass.frames_to_key = 1;
+ // KF is always a GF so clear frames till next gf counter.
+ rc->frames_till_gf_update_due = 0;
- // Take a copy of the initial frame details
- first_frame = *this_frame;
+ rc->frames_to_key = 1;
- cpi->twopass.kf_group_bits = 0; // Total bits available to kf group
- cpi->twopass.kf_group_error_left = 0; // Group modified error score.
+ twopass->kf_group_bits = 0; // Total bits available to kf group
+ twopass->kf_group_error_left = 0; // Group modified error score.
kf_mod_err = calculate_modified_err(cpi, this_frame);
- // find the next keyframe
+ // Find the next keyframe.
i = 0;
- while (cpi->twopass.stats_in < cpi->twopass.stats_in_end) {
- // Accumulate kf group error
+ while (twopass->stats_in < twopass->stats_in_end) {
+ // Accumulate kf group error.
kf_group_err += calculate_modified_err(cpi, this_frame);
- // These figures keep intra and coded error counts for all frames including
- // key frames in the group. The effect of the key frame itself can be
- // subtracted out using the first_frame data collected above.
- kf_group_intra_err += this_frame->intra_error;
- kf_group_coded_err += this_frame->coded_error;
-
- // load a the next frame's stats
+ // Load the next frame's stats.
last_frame = *this_frame;
- input_stats(cpi, this_frame);
+ input_stats(twopass, this_frame);
// Provided that we are not at the end of the file...
- if (cpi->oxcf.auto_key
- && lookup_next_frame_stats(cpi, &next_frame) != EOF) {
- // Normal scene cut check
+ if (cpi->oxcf.auto_key &&
+ lookup_next_frame_stats(twopass, &next_frame) != EOF) {
+ // Check for a scene cut.
if (test_candidate_kf(cpi, &last_frame, this_frame, &next_frame))
break;
-
- // How fast is prediction quality decaying
- loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame);
+ // How fast is the prediction quality decaying?
+ loop_decay_rate = get_prediction_decay_rate(&cpi->common, &next_frame);
// We want to know something about the recent past... rather than
- // as used elsewhere where we are concened with decay in prediction
+ // as used elsewhere where we are concerned with decay in prediction
// quality since the last GF or KF.
recent_loop_decay[i % 8] = loop_decay_rate;
decay_accumulator = 1.0;
- for (j = 0; j < 8; j++)
+ for (j = 0; j < 8; ++j)
decay_accumulator *= recent_loop_decay[j];
// Special check for transition or high motion followed by a
- // to a static scene.
+ // static scene.
if (detect_transition_to_still(cpi, i, cpi->key_frame_frequency - i,
loop_decay_rate, decay_accumulator))
break;
- // Step on to the next frame
- cpi->twopass.frames_to_key++;
+ // Step on to the next frame.
+ ++rc->frames_to_key;
// If we don't have a real key frame within the next two
- // forcekeyframeevery intervals then break out of the loop.
- if (cpi->twopass.frames_to_key >= 2 * (int)cpi->key_frame_frequency)
+ // key_frame_frequency intervals then break out of the loop.
+ if (rc->frames_to_key >= 2 * (int)cpi->key_frame_frequency)
break;
} else {
- cpi->twopass.frames_to_key++;
+ ++rc->frames_to_key;
}
- i++;
+ ++i;
}
// If there is a max kf interval set by the user we must obey it.
// We already breakout of the loop above at 2x max.
- // This code centers the extra kf if the actual natural
- // interval is between 1x and 2x
- if (cpi->oxcf.auto_key
- && cpi->twopass.frames_to_key > (int)cpi->key_frame_frequency) {
- FIRSTPASS_STATS *current_pos = cpi->twopass.stats_in;
- FIRSTPASS_STATS tmp_frame;
-
- cpi->twopass.frames_to_key /= 2;
+ // This code centers the extra kf if the actual natural interval
+ // is between 1x and 2x.
+ if (cpi->oxcf.auto_key &&
+ rc->frames_to_key > (int)cpi->key_frame_frequency) {
+ FIRSTPASS_STATS tmp_frame = first_frame;
- // Copy first frame details
- tmp_frame = first_frame;
+ rc->frames_to_key /= 2;
- // Reset to the start of the group
- reset_fpf_position(cpi, start_position);
+ // Reset to the start of the group.
+ reset_fpf_position(twopass, start_position);
kf_group_err = 0;
- kf_group_intra_err = 0;
- kf_group_coded_err = 0;
- // Rescan to get the correct error data for the forced kf group
- for (i = 0; i < cpi->twopass.frames_to_key; i++) {
- // Accumulate kf group errors
+ // Rescan to get the correct error data for the forced kf group.
+ for (i = 0; i < rc->frames_to_key; ++i) {
kf_group_err += calculate_modified_err(cpi, &tmp_frame);
- kf_group_intra_err += tmp_frame.intra_error;
- kf_group_coded_err += tmp_frame.coded_error;
-
- // Load a the next frame's stats
- input_stats(cpi, &tmp_frame);
+ input_stats(twopass, &tmp_frame);
}
-
- // Reset to the start of the group
- reset_fpf_position(cpi, current_pos);
-
- cpi->next_key_frame_forced = 1;
+ rc->next_key_frame_forced = 1;
+ } else if (twopass->stats_in == twopass->stats_in_end) {
+ rc->next_key_frame_forced = 1;
} else {
- cpi->next_key_frame_forced = 0;
+ rc->next_key_frame_forced = 0;
}
- // Special case for the last frame of the file
- if (cpi->twopass.stats_in >= cpi->twopass.stats_in_end) {
- // Accumulate kf group error
- kf_group_err += calculate_modified_err(cpi, this_frame);
- // These figures keep intra and coded error counts for all frames including
- // key frames in the group. The effect of the key frame itself can be
- // subtracted out using the first_frame data collected above.
- kf_group_intra_err += this_frame->intra_error;
- kf_group_coded_err += this_frame->coded_error;
+ // Special case for the last key frame of the file.
+ if (twopass->stats_in >= twopass->stats_in_end) {
+ // Accumulate kf group error.
+ kf_group_err += calculate_modified_err(cpi, this_frame);
}
// Calculate the number of bits that should be assigned to the kf group.
- if ((cpi->twopass.bits_left > 0) &&
- (cpi->twopass.modified_error_left > 0.0)) {
- // Max for a single normal frame (not key frame)
- int max_bits = frame_max_bits(cpi);
+ if (twopass->bits_left > 0 && twopass->modified_error_left > 0.0) {
+ // Maximum number of bits for a single normal frame (not key frame).
+ const int max_bits = frame_max_bits(cpi);
- // Maximum bits for the kf group
+ // Maximum number of bits allocated to the key frame group.
int64_t max_grp_bits;
// Default allocation based on bits left and relative
- // complexity of the section
- cpi->twopass.kf_group_bits = (int64_t)(cpi->twopass.bits_left *
- (kf_group_err /
- cpi->twopass.modified_error_left));
+ // complexity of the section.
+ twopass->kf_group_bits = (int64_t)(twopass->bits_left *
+ (kf_group_err / twopass->modified_error_left));
// Clip based on maximum per frame rate defined by the user.
- max_grp_bits = (int64_t)max_bits * (int64_t)cpi->twopass.frames_to_key;
- if (cpi->twopass.kf_group_bits > max_grp_bits)
- cpi->twopass.kf_group_bits = max_grp_bits;
+ max_grp_bits = (int64_t)max_bits * (int64_t)rc->frames_to_key;
+ if (twopass->kf_group_bits > max_grp_bits)
+ twopass->kf_group_bits = max_grp_bits;
} else {
- cpi->twopass.kf_group_bits = 0;
+ twopass->kf_group_bits = 0;
}
- // Reset the first pass file position
- reset_fpf_position(cpi, start_position);
+ // Reset the first pass file position.
+ reset_fpf_position(twopass, start_position);
// Determine how big to make this keyframe based on how well the subsequent
// frames use inter blocks.
decay_accumulator = 1.0;
boost_score = 0.0;
- loop_decay_rate = 1.00; // Starting decay rate
// Scan through the kf group collating various stats.
- for (i = 0; i < cpi->twopass.frames_to_key; i++) {
- double r;
-
- if (EOF == input_stats(cpi, &next_frame))
+ for (i = 0; i < rc->frames_to_key; ++i) {
+ if (EOF == input_stats(twopass, &next_frame))
break;
// Monitor for static sections.
if ((next_frame.pcnt_inter - next_frame.pcnt_motion) <
- zero_motion_accumulator) {
- zero_motion_accumulator =
- (next_frame.pcnt_inter - next_frame.pcnt_motion);
+ zero_motion_accumulator) {
+ zero_motion_accumulator = (next_frame.pcnt_inter -
+ next_frame.pcnt_motion);
}
// For the first few frames collect data to decide kf boost.
- if (i <= (cpi->max_gf_interval * 2)) {
- if (next_frame.intra_error > cpi->twopass.kf_intra_err_min)
+ if (i <= (rc->max_gf_interval * 2)) {
+ double r;
+ if (next_frame.intra_error > twopass->kf_intra_err_min)
r = (IIKFACTOR2 * next_frame.intra_error /
DOUBLE_DIVIDE_CHECK(next_frame.coded_error));
else
- r = (IIKFACTOR2 * cpi->twopass.kf_intra_err_min /
+ r = (IIKFACTOR2 * twopass->kf_intra_err_min /
DOUBLE_DIVIDE_CHECK(next_frame.coded_error));
if (r > RMAX)
r = RMAX;
- // How fast is prediction quality decaying
- if (!detect_flash(cpi, 0)) {
- loop_decay_rate = get_prediction_decay_rate(cpi, &next_frame);
- decay_accumulator = decay_accumulator * loop_decay_rate;
+ // How fast is prediction quality decaying.
+ if (!detect_flash(twopass, 0)) {
+ loop_decay_rate = get_prediction_decay_rate(&cpi->common, &next_frame);
+ decay_accumulator *= loop_decay_rate;
decay_accumulator = decay_accumulator < MIN_DECAY_FACTOR
? MIN_DECAY_FACTOR : decay_accumulator;
}
@@ -2609,121 +2065,249 @@ static void find_next_key_frame(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
FIRSTPASS_STATS sectionstats;
zero_stats(&sectionstats);
- reset_fpf_position(cpi, start_position);
+ reset_fpf_position(twopass, start_position);
- for (i = 0; i < cpi->twopass.frames_to_key; i++) {
- input_stats(cpi, &next_frame);
+ for (i = 0; i < rc->frames_to_key; ++i) {
+ input_stats(twopass, &next_frame);
accumulate_stats(&sectionstats, &next_frame);
}
avg_stats(&sectionstats);
- cpi->twopass.section_intra_rating = (int)
- (sectionstats.intra_error
- / DOUBLE_DIVIDE_CHECK(sectionstats.coded_error));
+ twopass->section_intra_rating = (int) (sectionstats.intra_error /
+ DOUBLE_DIVIDE_CHECK(sectionstats.coded_error));
}
- // Reset the first pass file position
- reset_fpf_position(cpi, start_position);
+ // Reset the first pass file position.
+ reset_fpf_position(twopass, start_position);
- // Work out how many bits to allocate for the key frame itself
+ // Work out how many bits to allocate for the key frame itself.
if (1) {
int kf_boost = (int)boost_score;
int allocation_chunks;
int alt_kf_bits;
- if (kf_boost < (cpi->twopass.frames_to_key * 3))
- kf_boost = (cpi->twopass.frames_to_key * 3);
+ if (kf_boost < (rc->frames_to_key * 3))
+ kf_boost = (rc->frames_to_key * 3);
- if (kf_boost < 300) // Min KF boost
- kf_boost = 300;
+ if (kf_boost < MIN_KF_BOOST)
+ kf_boost = MIN_KF_BOOST;
// Make a note of baseline boost and the zero motion
// accumulator value for use elsewhere.
- cpi->kf_boost = kf_boost;
- cpi->kf_zeromotion_pct = (int)(zero_motion_accumulator * 100.0);
-
- // We do three calculations for kf size.
- // The first is based on the error score for the whole kf group.
- // The second (optionaly) on the key frames own error if this is
- // smaller than the average for the group.
- // The final one insures that the frame receives at least the
- // allocation it would have received based on its own error score vs
- // the error score remaining
- // Special case if the sequence appears almost totaly static
- // In this case we want to spend almost all of the bits on the
- // key frame.
- // cpi->twopass.frames_to_key-1 because key frame itself is taken
- // care of by kf_boost.
+ rc->kf_boost = kf_boost;
+ twopass->kf_zeromotion_pct = (int)(zero_motion_accumulator * 100.0);
+
+ // Key frame size depends on:
+ // (1) the error score for the whole key frame group,
+ // (2) the key frames' own error if this is smaller than the
+ // average for the group (optional),
+ // (3) insuring that the frame receives at least the allocation it would
+ // have received based on its own error score vs the error score
+ // remaining.
+ // Special case:
+ // If the sequence appears almost totally static we want to spend almost
+ // all of the bits on the key frame.
+ //
+ // We use (cpi->rc.frames_to_key - 1) below because the key frame itself is
+ // taken care of by kf_boost.
if (zero_motion_accumulator >= 0.99) {
- allocation_chunks =
- ((cpi->twopass.frames_to_key - 1) * 10) + kf_boost;
+ allocation_chunks = ((rc->frames_to_key - 1) * 10) + kf_boost;
} else {
- allocation_chunks =
- ((cpi->twopass.frames_to_key - 1) * 100) + kf_boost;
+ allocation_chunks = ((rc->frames_to_key - 1) * 100) + kf_boost;
}
- // Prevent overflow
+ // Prevent overflow.
if (kf_boost > 1028) {
int divisor = kf_boost >> 10;
kf_boost /= divisor;
allocation_chunks /= divisor;
}
- cpi->twopass.kf_group_bits =
- (cpi->twopass.kf_group_bits < 0) ? 0 : cpi->twopass.kf_group_bits;
+ twopass->kf_group_bits = (twopass->kf_group_bits < 0) ? 0
+ : twopass->kf_group_bits;
- // Calculate the number of bits to be spent on the key frame
- cpi->twopass.kf_bits =
- (int)((double)kf_boost *
- ((double)cpi->twopass.kf_group_bits / (double)allocation_chunks));
+ // Calculate the number of bits to be spent on the key frame.
+ twopass->kf_bits = (int)((double)kf_boost *
+ ((double)twopass->kf_group_bits / allocation_chunks));
// If the key frame is actually easier than the average for the
- // kf group (which does sometimes happen... eg a blank intro frame)
- // Then use an alternate calculation based on the kf error score
+ // kf group (which does sometimes happen, e.g. a blank intro frame)
+ // then use an alternate calculation based on the kf error score
// which should give a smaller key frame.
- if (kf_mod_err < kf_group_err / cpi->twopass.frames_to_key) {
- double alt_kf_grp_bits =
- ((double)cpi->twopass.bits_left *
- (kf_mod_err * (double)cpi->twopass.frames_to_key) /
- DOUBLE_DIVIDE_CHECK(cpi->twopass.modified_error_left));
+ if (kf_mod_err < kf_group_err / rc->frames_to_key) {
+ double alt_kf_grp_bits = ((double)twopass->bits_left *
+ (kf_mod_err * (double)rc->frames_to_key) /
+ DOUBLE_DIVIDE_CHECK(twopass->modified_error_left));
alt_kf_bits = (int)((double)kf_boost *
(alt_kf_grp_bits / (double)allocation_chunks));
- if (cpi->twopass.kf_bits > alt_kf_bits) {
- cpi->twopass.kf_bits = alt_kf_bits;
- }
+ if (twopass->kf_bits > alt_kf_bits)
+ twopass->kf_bits = alt_kf_bits;
} else {
- // Else if it is much harder than other frames in the group make sure
- // it at least receives an allocation in keeping with its relative
- // error score
- alt_kf_bits =
- (int)((double)cpi->twopass.bits_left *
- (kf_mod_err /
- DOUBLE_DIVIDE_CHECK(cpi->twopass.modified_error_left)));
-
- if (alt_kf_bits > cpi->twopass.kf_bits) {
- cpi->twopass.kf_bits = alt_kf_bits;
+ // Else if it is much harder than other frames in the group make sure
+ // it at least receives an allocation in keeping with its relative
+ // error score.
+ alt_kf_bits = (int)((double)twopass->bits_left * (kf_mod_err /
+ DOUBLE_DIVIDE_CHECK(twopass->modified_error_left)));
+
+ if (alt_kf_bits > twopass->kf_bits) {
+ twopass->kf_bits = alt_kf_bits;
}
}
-
- cpi->twopass.kf_group_bits -= cpi->twopass.kf_bits;
- // Add in the minimum frame allowance
- cpi->twopass.kf_bits += cpi->min_frame_bandwidth;
-
- // Peer frame bit target for this frame
- cpi->per_frame_bandwidth = cpi->twopass.kf_bits;
- // Convert to a per second bitrate
- cpi->target_bandwidth = (int)(cpi->twopass.kf_bits *
- cpi->output_framerate);
+ twopass->kf_group_bits -= twopass->kf_bits;
+ // Per frame bit target for this frame.
+ vp9_rc_set_frame_target(cpi, twopass->kf_bits);
}
- // Note the total error score of the kf group minus the key frame itself
- cpi->twopass.kf_group_error_left = (int)(kf_group_err - kf_mod_err);
+ // Note the total error score of the kf group minus the key frame itself.
+ twopass->kf_group_error_left = (int)(kf_group_err - kf_mod_err);
// Adjust the count of total modified error left.
// The count of bits left is adjusted elsewhere based on real coded frame
// sizes.
- cpi->twopass.modified_error_left -= kf_group_err;
+ twopass->modified_error_left -= kf_group_err;
+}
+
+void vp9_rc_get_first_pass_params(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ if (!cpi->refresh_alt_ref_frame &&
+ (cm->current_video_frame == 0 ||
+ (cm->frame_flags & FRAMEFLAGS_KEY))) {
+ cm->frame_type = KEY_FRAME;
+ } else {
+ cm->frame_type = INTER_FRAME;
+ }
+ // Do not use periodic key frames.
+ cpi->rc.frames_to_key = INT_MAX;
+}
+
+void vp9_rc_get_second_pass_params(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
+ struct twopass_rc *const twopass = &cpi->twopass;
+ const int frames_left = (int)(twopass->total_stats.count -
+ cm->current_video_frame);
+ FIRSTPASS_STATS this_frame;
+ FIRSTPASS_STATS this_frame_copy;
+
+ double this_frame_intra_error;
+ double this_frame_coded_error;
+ int target;
+
+ if (!twopass->stats_in)
+ return;
+
+ if (cpi->refresh_alt_ref_frame) {
+ cm->frame_type = INTER_FRAME;
+ vp9_rc_set_frame_target(cpi, twopass->gf_bits);
+ return;
+ }
+
+ vp9_clear_system_state();
+
+ if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
+ twopass->active_worst_quality = cpi->oxcf.cq_level;
+ } else if (cm->current_video_frame == 0) {
+ // Special case code for first frame.
+ const int section_target_bandwidth = (int)(twopass->bits_left /
+ frames_left);
+ const int tmp_q = vp9_twopass_worst_quality(cpi, &twopass->total_left_stats,
+ section_target_bandwidth);
+ twopass->active_worst_quality = tmp_q;
+ rc->ni_av_qi = tmp_q;
+ rc->avg_q = vp9_convert_qindex_to_q(tmp_q);
+ }
+ vp9_zero(this_frame);
+ if (EOF == input_stats(twopass, &this_frame))
+ return;
+
+ this_frame_intra_error = this_frame.intra_error;
+ this_frame_coded_error = this_frame.coded_error;
+
+ // Keyframe and section processing.
+ if (rc->frames_to_key == 0 ||
+ (cm->frame_flags & FRAMEFLAGS_KEY)) {
+ // Define next KF group and assign bits to it.
+ this_frame_copy = this_frame;
+ find_next_key_frame(cpi, &this_frame_copy);
+ } else {
+ cm->frame_type = INTER_FRAME;
+ }
+
+ // Is this frame a GF / ARF? (Note: a key frame is always also a GF).
+ if (rc->frames_till_gf_update_due == 0) {
+ // Define next gf group and assign bits to it.
+ this_frame_copy = this_frame;
+
+#if CONFIG_MULTIPLE_ARF
+ if (cpi->multi_arf_enabled) {
+ define_fixed_arf_period(cpi);
+ } else {
+#endif
+ define_gf_group(cpi, &this_frame_copy);
+#if CONFIG_MULTIPLE_ARF
+ }
+#endif
+
+ if (twopass->gf_zeromotion_pct > 995) {
+ // As long as max_thresh for encode breakout is small enough, it is ok
+ // to enable it for show frame, i.e. set allow_encode_breakout to
+ // ENCODE_BREAKOUT_LIMITED.
+ if (!cm->show_frame)
+ cpi->allow_encode_breakout = ENCODE_BREAKOUT_DISABLED;
+ else
+ cpi->allow_encode_breakout = ENCODE_BREAKOUT_LIMITED;
+ }
+
+ rc->frames_till_gf_update_due = rc->baseline_gf_interval;
+ cpi->refresh_golden_frame = 1;
+ } else {
+ // Otherwise this is an ordinary frame.
+ // Assign bits from those allocated to the GF group.
+ this_frame_copy = this_frame;
+ assign_std_frame_bits(cpi, &this_frame_copy);
+ }
+
+ // Keep a globally available copy of this and the next frame's iiratio.
+ twopass->this_iiratio = (int)(this_frame_intra_error /
+ DOUBLE_DIVIDE_CHECK(this_frame_coded_error));
+ {
+ FIRSTPASS_STATS next_frame;
+ if (lookup_next_frame_stats(twopass, &next_frame) != EOF) {
+ twopass->next_iiratio = (int)(next_frame.intra_error /
+ DOUBLE_DIVIDE_CHECK(next_frame.coded_error));
+ }
+ }
+
+ if (cpi->common.frame_type == KEY_FRAME)
+ target = vp9_rc_clamp_iframe_target_size(cpi, rc->this_frame_target);
+ else
+ target = vp9_rc_clamp_pframe_target_size(cpi, rc->this_frame_target);
+ vp9_rc_set_frame_target(cpi, target);
+
+ // Update the total stats remaining structure.
+ subtract_stats(&twopass->total_left_stats, &this_frame);
+}
+
+void vp9_twopass_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
+#ifdef DISABLE_RC_LONG_TERM_MEM
+ cpi->twopass.bits_left -= cpi->rc.this_frame_target;
+#else
+ cpi->twopass.bits_left -= 8 * bytes_used;
+ // Update bits left to the kf and gf groups to account for overshoot or
+ // undershoot on these frames.
+ if (cm->frame_type == KEY_FRAME) {
+ cpi->twopass.kf_group_bits += cpi->rc.this_frame_target -
+ cpi->rc.projected_frame_size;
+
+ cpi->twopass.kf_group_bits = MAX(cpi->twopass.kf_group_bits, 0);
+ } else if (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) {
+ cpi->twopass.gf_group_bits += cpi->rc.this_frame_target -
+ cpi->rc.projected_frame_size;
+
+ cpi->twopass.gf_group_bits = MAX(cpi->twopass.gf_group_bits, 0);
+ }
+#endif
}
diff --git a/libvpx/vp9/encoder/vp9_firstpass.h b/libvpx/vp9/encoder/vp9_firstpass.h
index c18d11e..bf7b5a1 100644
--- a/libvpx/vp9/encoder/vp9_firstpass.h
+++ b/libvpx/vp9/encoder/vp9_firstpass.h
@@ -10,14 +10,95 @@
#ifndef VP9_ENCODER_VP9_FIRSTPASS_H_
#define VP9_ENCODER_VP9_FIRSTPASS_H_
-#include "vp9/encoder/vp9_onyx_int.h"
-void vp9_init_first_pass(VP9_COMP *cpi);
-void vp9_first_pass(VP9_COMP *cpi);
-void vp9_end_first_pass(VP9_COMP *cpi);
+#ifdef __cplusplus
+extern "C" {
+#endif
-void vp9_init_second_pass(VP9_COMP *cpi);
-void vp9_second_pass(VP9_COMP *cpi);
-void vp9_end_second_pass(VP9_COMP *cpi);
+typedef struct {
+ double frame;
+ double intra_error;
+ double coded_error;
+ double sr_coded_error;
+ double ssim_weighted_pred_err;
+ double pcnt_inter;
+ double pcnt_motion;
+ double pcnt_second_ref;
+ double pcnt_neutral;
+ double MVr;
+ double mvr_abs;
+ double MVc;
+ double mvc_abs;
+ double MVrv;
+ double MVcv;
+ double mv_in_out_count;
+ double new_mv_count;
+ double duration;
+ double count;
+ int spatial_layer_id;
+} FIRSTPASS_STATS;
+
+struct twopass_rc {
+ unsigned int section_intra_rating;
+ unsigned int next_iiratio;
+ unsigned int this_iiratio;
+ FIRSTPASS_STATS total_stats;
+ FIRSTPASS_STATS this_frame_stats;
+ const FIRSTPASS_STATS *stats_in;
+ const FIRSTPASS_STATS *stats_in_start;
+ const FIRSTPASS_STATS *stats_in_end;
+ FIRSTPASS_STATS total_left_stats;
+ int first_pass_done;
+ int64_t bits_left;
+ int64_t clip_bits_total;
+ double avg_iiratio;
+ double modified_error_min;
+ double modified_error_max;
+ double modified_error_total;
+ double modified_error_left;
+ double kf_intra_err_min;
+ double gf_intra_err_min;
+ int kf_bits;
+ // Remaining error from uncoded frames in a gf group. Two pass use only
+ int64_t gf_group_error_left;
+
+ // Projected total bits available for a key frame group of frames
+ int64_t kf_group_bits;
+
+ // Error score of frames still to be coded in kf group
+ int64_t kf_group_error_left;
+
+ // Projected Bits available for a group of frames including 1 GF or ARF
+ int64_t gf_group_bits;
+ // Bits for the golden frame or ARF - 2 pass only
+ int gf_bits;
+ int alt_extra_bits;
+
+ int sr_update_lag;
+
+ int kf_zeromotion_pct;
+ int gf_zeromotion_pct;
+
+ int active_worst_quality;
+};
+
+struct VP9_COMP;
+
+void vp9_init_first_pass(struct VP9_COMP *cpi);
+void vp9_rc_get_first_pass_params(struct VP9_COMP *cpi);
+void vp9_first_pass(struct VP9_COMP *cpi);
+void vp9_end_first_pass(struct VP9_COMP *cpi);
+
+void vp9_init_second_pass(struct VP9_COMP *cpi);
+void vp9_rc_get_second_pass_params(struct VP9_COMP *cpi);
+int vp9_twopass_worst_quality(struct VP9_COMP *cpi, FIRSTPASS_STATS *fpstats,
+ int section_target_bandwitdh);
+
+// Post encode update of the rate control parameters for 2-pass
+void vp9_twopass_postencode_update(struct VP9_COMP *cpi,
+ uint64_t bytes_used);
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_FIRSTPASS_H_
diff --git a/libvpx/vp9/encoder/vp9_lookahead.c b/libvpx/vp9/encoder/vp9_lookahead.c
index c28c868..a88d5ec 100644
--- a/libvpx/vp9/encoder/vp9_lookahead.c
+++ b/libvpx/vp9/encoder/vp9_lookahead.c
@@ -11,9 +11,12 @@
#include <stdlib.h>
#include "./vpx_config.h"
+
#include "vp9/common/vp9_common.h"
+
+#include "vp9/encoder/vp9_extend.h"
#include "vp9/encoder/vp9_lookahead.h"
-#include "vp9/common/vp9_extend.h"
+#include "vp9/encoder/vp9_onyx_int.h"
struct lookahead_ctx {
unsigned int max_sz; /* Absolute size of the queue */
@@ -73,7 +76,7 @@ struct lookahead_ctx * vp9_lookahead_init(unsigned int width,
for (i = 0; i < depth; i++)
if (vp9_alloc_frame_buffer(&ctx->buf[i].img,
width, height, subsampling_x, subsampling_y,
- VP9BORDERINPIXELS))
+ VP9_ENC_BORDER_IN_PIXELS))
goto bail;
}
return ctx;
@@ -85,8 +88,7 @@ struct lookahead_ctx * vp9_lookahead_init(unsigned int width,
#define USE_PARTIAL_COPY 0
int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
- int64_t ts_start, int64_t ts_end, unsigned int flags,
- unsigned char *active_map) {
+ int64_t ts_start, int64_t ts_end, unsigned int flags) {
struct lookahead_entry *buf;
#if USE_PARTIAL_COPY
int row, col, active_end;
@@ -173,7 +175,6 @@ struct lookahead_entry * vp9_lookahead_peek(struct lookahead_ctx *ctx,
int index) {
struct lookahead_entry *buf = NULL;
- assert(index < (int)ctx->max_sz);
if (index < (int)ctx->sz) {
index += ctx->read_idx;
if (index >= (int)ctx->max_sz)
diff --git a/libvpx/vp9/encoder/vp9_lookahead.h b/libvpx/vp9/encoder/vp9_lookahead.h
index c773f8f..ff63c0d 100644
--- a/libvpx/vp9/encoder/vp9_lookahead.h
+++ b/libvpx/vp9/encoder/vp9_lookahead.h
@@ -14,6 +14,10 @@
#include "vpx_scale/yv12config.h"
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_LAG_BUFFERS 25
struct lookahead_entry {
@@ -59,8 +63,7 @@ void vp9_lookahead_destroy(struct lookahead_ctx *ctx);
* \param[in] active_map Map that specifies which macroblock is active
*/
int vp9_lookahead_push(struct lookahead_ctx *ctx, YV12_BUFFER_CONFIG *src,
- int64_t ts_start, int64_t ts_end, unsigned int flags,
- unsigned char *active_map);
+ int64_t ts_start, int64_t ts_end, unsigned int flags);
/**\brief Get the next source buffer to encode
@@ -94,4 +97,8 @@ struct lookahead_entry *vp9_lookahead_peek(struct lookahead_ctx *ctx,
*/
unsigned int vp9_lookahead_depth(struct lookahead_ctx *ctx);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_LOOKAHEAD_H_
diff --git a/libvpx/vp9/encoder/vp9_mbgraph.c b/libvpx/vp9/encoder/vp9_mbgraph.c
index 7b605b2..6520389 100644
--- a/libvpx/vp9/encoder/vp9_mbgraph.c
+++ b/libvpx/vp9/encoder/vp9_mbgraph.c
@@ -11,7 +11,6 @@
#include <limits.h>
#include "vpx_mem/vpx_mem.h"
-#include "vp9/encoder/vp9_encodeintra.h"
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_segmentation.h"
#include "vp9/encoder/vp9_mcomp.h"
@@ -23,55 +22,49 @@
static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
- int_mv *ref_mv,
- int_mv *dst_mv,
+ const MV *ref_mv,
+ MV *dst_mv,
int mb_row,
int mb_col) {
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
vp9_variance_fn_ptr_t v_fn_ptr = cpi->fn_ptr[BLOCK_16X16];
- unsigned int best_err;
const int tmp_col_min = x->mv_col_min;
const int tmp_col_max = x->mv_col_max;
const int tmp_row_min = x->mv_row_min;
const int tmp_row_max = x->mv_row_max;
- int_mv ref_full;
+ MV ref_full;
// Further step/diamond searches as necessary
int step_param = cpi->sf.reduce_first_step_size +
(cpi->speed < 8 ? (cpi->speed > 5 ? 1 : 0) : 2);
step_param = MIN(step_param, (cpi->sf.max_step_search_steps - 2));
- vp9_clamp_mv_min_max(x, &ref_mv->as_mv);
+ vp9_set_mv_search_range(x, ref_mv);
- ref_full.as_mv.col = ref_mv->as_mv.col >> 3;
- ref_full.as_mv.row = ref_mv->as_mv.row >> 3;
+ ref_full.col = ref_mv->col >> 3;
+ ref_full.row = ref_mv->row >> 3;
/*cpi->sf.search_method == HEX*/
- best_err = vp9_hex_search(x, &ref_full.as_mv, step_param, x->errorperbit,
- 0, &v_fn_ptr,
- 0, &ref_mv->as_mv, &dst_mv->as_mv);
+ vp9_hex_search(x, &ref_full, step_param, x->errorperbit, 0, &v_fn_ptr, 0,
+ ref_mv, dst_mv);
// Try sub-pixel MC
// if (bestsme > error_thresh && bestsme < INT_MAX)
{
int distortion;
unsigned int sse;
- best_err = cpi->find_fractional_mv_step(
- x,
- &dst_mv->as_mv, &ref_mv->as_mv,
- cpi->common.allow_high_precision_mv,
- x->errorperbit, &v_fn_ptr,
- 0, cpi->sf.subpel_iters_per_step, NULL, NULL,
- & distortion, &sse);
+ cpi->find_fractional_mv_step(
+ x, dst_mv, ref_mv, cpi->common.allow_high_precision_mv, x->errorperbit,
+ &v_fn_ptr, 0, cpi->sf.subpel_iters_per_step, NULL, NULL, &distortion,
+ &sse);
}
- vp9_set_mbmode_and_mvs(x, NEWMV, dst_mv);
+ xd->mi_8x8[0]->mbmi.mode = NEWMV;
+ xd->mi_8x8[0]->mbmi.mv[0].as_mv = *dst_mv;
+
vp9_build_inter_predictors_sby(xd, mb_row, mb_col, BLOCK_16X16);
- best_err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
- xd->plane[0].dst.buf, xd->plane[0].dst.stride,
- INT_MAX);
/* restore UMV window */
x->mv_col_min = tmp_col_min;
@@ -79,11 +72,13 @@ static unsigned int do_16x16_motion_iteration(VP9_COMP *cpi,
x->mv_row_min = tmp_row_min;
x->mv_row_max = tmp_row_max;
- return best_err;
+ return vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
+ xd->plane[0].dst.buf, xd->plane[0].dst.stride,
+ INT_MAX);
}
-static int do_16x16_motion_search(VP9_COMP *cpi, int_mv *ref_mv, int_mv *dst_mv,
- int mb_row, int mb_col) {
+static int do_16x16_motion_search(VP9_COMP *cpi, const int_mv *ref_mv,
+ int_mv *dst_mv, int mb_row, int mb_col) {
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
unsigned int err, tmp_err;
@@ -98,7 +93,8 @@ static int do_16x16_motion_search(VP9_COMP *cpi, int_mv *ref_mv, int_mv *dst_mv,
// Test last reference frame using the previous best mv as the
// starting point (best reference) for the search
- tmp_err = do_16x16_motion_iteration(cpi, ref_mv, &tmp_mv, mb_row, mb_col);
+ tmp_err = do_16x16_motion_iteration(cpi, &ref_mv->as_mv, &tmp_mv.as_mv,
+ mb_row, mb_col);
if (tmp_err < err) {
err = tmp_err;
dst_mv->as_int = tmp_mv.as_int;
@@ -111,7 +107,7 @@ static int do_16x16_motion_search(VP9_COMP *cpi, int_mv *ref_mv, int_mv *dst_mv,
int_mv zero_ref_mv, tmp_mv;
zero_ref_mv.as_int = 0;
- tmp_err = do_16x16_motion_iteration(cpi, &zero_ref_mv, &tmp_mv,
+ tmp_err = do_16x16_motion_iteration(cpi, &zero_ref_mv.as_mv, &tmp_mv.as_mv,
mb_row, mb_col);
if (tmp_err < err) {
dst_mv->as_int = tmp_mv.as_int;
@@ -138,7 +134,6 @@ static int do_16x16_zerozero_search(VP9_COMP *cpi, int_mv *dst_mv) {
return err;
}
static int find_best_16x16_intra(VP9_COMP *cpi,
- int mb_y_offset,
MB_PREDICTION_MODE *pbest_mode) {
MACROBLOCK *const x = &cpi->mb;
MACROBLOCKD *const xd = &x->e_mbd;
@@ -153,7 +148,8 @@ static int find_best_16x16_intra(VP9_COMP *cpi,
xd->mi_8x8[0]->mbmi.mode = mode;
vp9_predict_intra_block(xd, 0, 2, TX_16X16, mode,
x->plane[0].src.buf, x->plane[0].src.stride,
- xd->plane[0].dst.buf, xd->plane[0].dst.stride);
+ xd->plane[0].dst.buf, xd->plane[0].dst.stride,
+ 0, 0, 0);
err = vp9_sad16x16(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf, xd->plane[0].dst.stride, best_err);
@@ -178,10 +174,7 @@ static void update_mbgraph_mb_stats
int mb_y_offset,
YV12_BUFFER_CONFIG *golden_ref,
int_mv *prev_golden_ref_mv,
- int gld_y_offset,
YV12_BUFFER_CONFIG *alt_ref,
- int_mv *prev_alt_ref_mv,
- int arf_y_offset,
int mb_row,
int mb_col
) {
@@ -198,7 +191,7 @@ static void update_mbgraph_mb_stats
xd->plane[0].dst.stride = get_frame_new_buffer(cm)->y_stride;
// do intra 16x16 prediction
- intra_error = find_best_16x16_intra(cpi, mb_y_offset,
+ intra_error = find_best_16x16_intra(cpi,
&stats->ref[INTRA_FRAME].m.mode);
if (intra_error <= 0)
intra_error = 1;
@@ -282,8 +275,7 @@ static void update_mbgraph_frame_stats(VP9_COMP *cpi,
MBGRAPH_MB_STATS *mb_stats = &stats->mb_stats[offset + mb_col];
update_mbgraph_mb_stats(cpi, mb_stats, buf, mb_y_in_offset,
- golden_ref, &gld_left_mv, gld_y_in_offset,
- alt_ref, &arf_left_mv, arf_y_in_offset,
+ golden_ref, &gld_left_mv, alt_ref,
mb_row, mb_col);
arf_left_mv.as_int = mb_stats->ref[ALTREF_FRAME].m.mv.as_int;
gld_left_mv.as_int = mb_stats->ref[GOLDEN_FRAME].m.mv.as_int;
@@ -324,8 +316,8 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
1));
// We are not interested in results beyond the alt ref itself.
- if (n_frames > cpi->frames_till_gf_update_due)
- n_frames = cpi->frames_till_gf_update_due;
+ if (n_frames > cpi->rc.frames_till_gf_update_due)
+ n_frames = cpi->rc.frames_till_gf_update_due;
// defer cost to reference frames
for (i = n_frames - 1; i >= 0; i--) {
@@ -356,7 +348,7 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
for (mi_col = 0; mi_col < cm->mi_cols; mi_col++) {
// If any of the blocks in the sequence failed then the MB
// goes in segment 0
- if (arf_not_zz[mi_row/2*cm->mb_cols + mi_col/2]) {
+ if (arf_not_zz[mi_row / 2 * cm->mb_cols + mi_col / 2]) {
ncnt[0]++;
cpi->segmentation_map[mi_row * cm->mi_cols + mi_col] = 0;
} else {
@@ -379,10 +371,10 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
cpi->static_mb_pct = 0;
cpi->seg0_cnt = ncnt[0];
- vp9_enable_segmentation((VP9_PTR)cpi);
+ vp9_enable_segmentation(&cm->seg);
} else {
cpi->static_mb_pct = 0;
- vp9_disable_segmentation((VP9_PTR)cpi);
+ vp9_disable_segmentation(&cm->seg);
}
// Free localy allocated storage
@@ -392,15 +384,13 @@ static void separate_arf_mbs(VP9_COMP *cpi) {
void vp9_update_mbgraph_stats(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
int i, n_frames = vp9_lookahead_depth(cpi->lookahead);
- YV12_BUFFER_CONFIG *golden_ref =
- &cm->yv12_fb[cm->ref_frame_map[cpi->gld_fb_idx]];
+ YV12_BUFFER_CONFIG *golden_ref = get_ref_frame_buffer(cpi, GOLDEN_FRAME);
// we need to look ahead beyond where the ARF transitions into
// being a GF - so exit if we don't look ahead beyond that
- if (n_frames <= cpi->frames_till_gf_update_due)
+ if (n_frames <= cpi->rc.frames_till_gf_update_due)
return;
- if (n_frames > (int)cpi->frames_till_alt_ref_frame)
- n_frames = cpi->frames_till_alt_ref_frame;
+
if (n_frames > MAX_LAG_BUFFERS)
n_frames = MAX_LAG_BUFFERS;
@@ -426,7 +416,7 @@ void vp9_update_mbgraph_stats(VP9_COMP *cpi) {
golden_ref, cpi->Source);
}
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
separate_arf_mbs(cpi);
}
diff --git a/libvpx/vp9/encoder/vp9_mbgraph.h b/libvpx/vp9/encoder/vp9_mbgraph.h
index c5bca4d..bc2a704 100644
--- a/libvpx/vp9/encoder/vp9_mbgraph.h
+++ b/libvpx/vp9/encoder/vp9_mbgraph.h
@@ -11,6 +11,30 @@
#ifndef VP9_ENCODER_VP9_MBGRAPH_H_
#define VP9_ENCODER_VP9_MBGRAPH_H_
-void vp9_update_mbgraph_stats(VP9_COMP *cpi);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ struct {
+ int err;
+ union {
+ int_mv mv;
+ MB_PREDICTION_MODE mode;
+ } m;
+ } ref[MAX_REF_FRAMES];
+} MBGRAPH_MB_STATS;
+
+typedef struct {
+ MBGRAPH_MB_STATS *mb_stats;
+} MBGRAPH_FRAME_STATS;
+
+struct VP9_COMP;
+
+void vp9_update_mbgraph_stats(struct VP9_COMP *cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_MBGRAPH_H_
diff --git a/libvpx/vp9/encoder/vp9_mcomp.c b/libvpx/vp9/encoder/vp9_mcomp.c
index a52f5b1..2ae8a2a 100644
--- a/libvpx/vp9/encoder/vp9_mcomp.c
+++ b/libvpx/vp9/encoder/vp9_mcomp.c
@@ -16,7 +16,6 @@
#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_findnearmv.h"
#include "vp9/common/vp9_common.h"
#include "vp9/encoder/vp9_onyx_int.h"
@@ -24,11 +23,16 @@
// #define NEW_DIAMOND_SEARCH
-void vp9_clamp_mv_min_max(MACROBLOCK *x, MV *mv) {
- const int col_min = (mv->col >> 3) - MAX_FULL_PEL_VAL + (mv->col & 7 ? 1 : 0);
- const int row_min = (mv->row >> 3) - MAX_FULL_PEL_VAL + (mv->row & 7 ? 1 : 0);
- const int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL;
- const int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL;
+void vp9_set_mv_search_range(MACROBLOCK *x, const MV *mv) {
+ int col_min = (mv->col >> 3) - MAX_FULL_PEL_VAL + (mv->col & 7 ? 1 : 0);
+ int row_min = (mv->row >> 3) - MAX_FULL_PEL_VAL + (mv->row & 7 ? 1 : 0);
+ int col_max = (mv->col >> 3) + MAX_FULL_PEL_VAL;
+ int row_max = (mv->row >> 3) + MAX_FULL_PEL_VAL;
+
+ col_min = MAX(col_min, (MV_LOW >> 3) + 1);
+ row_min = MAX(row_min, (MV_LOW >> 3) + 1);
+ col_max = MIN(col_max, (MV_UPP >> 3) - 1);
+ row_max = MIN(row_max, (MV_UPP >> 3) - 1);
// Get intersection of UMV window and valid MV window to reduce # of checks
// in diamond search.
@@ -51,9 +55,6 @@ int vp9_init_search_range(VP9_COMP *cpi, int size) {
while ((size << sr) < MAX_FULL_PEL_VAL)
sr++;
- if (sr)
- sr--;
-
sr += cpi->sf.reduce_first_step_size;
sr = MIN(sr, (cpi->sf.max_step_search_steps - 2));
return sr;
@@ -97,42 +98,23 @@ static int mvsad_err_cost(const MV *mv, const MV *ref,
}
void vp9_init_dsmotion_compensation(MACROBLOCK *x, int stride) {
- int len;
- int search_site_count = 0;
+ int len, ss_count = 1;
- // Generate offsets for 4 search sites per step.
- x->ss[search_site_count].mv.col = 0;
- x->ss[search_site_count].mv.row = 0;
- x->ss[search_site_count].offset = 0;
- search_site_count++;
+ x->ss[0].mv.col = x->ss[0].mv.row = 0;
+ x->ss[0].offset = 0;
for (len = MAX_FIRST_STEP; len > 0; len /= 2) {
- // Compute offsets for search sites.
- x->ss[search_site_count].mv.col = 0;
- x->ss[search_site_count].mv.row = -len;
- x->ss[search_site_count].offset = -len * stride;
- search_site_count++;
-
- // Compute offsets for search sites.
- x->ss[search_site_count].mv.col = 0;
- x->ss[search_site_count].mv.row = len;
- x->ss[search_site_count].offset = len * stride;
- search_site_count++;
-
- // Compute offsets for search sites.
- x->ss[search_site_count].mv.col = -len;
- x->ss[search_site_count].mv.row = 0;
- x->ss[search_site_count].offset = -len;
- search_site_count++;
-
- // Compute offsets for search sites.
- x->ss[search_site_count].mv.col = len;
- x->ss[search_site_count].mv.row = 0;
- x->ss[search_site_count].offset = len;
- search_site_count++;
+ // Generate offsets for 4 search sites per step.
+ const MV ss_mvs[] = {{-len, 0}, {len, 0}, {0, -len}, {0, len}};
+ int i;
+ for (i = 0; i < 4; ++i) {
+ search_site *const ss = &x->ss[ss_count++];
+ ss->mv = ss_mvs[i];
+ ss->offset = ss->mv.row * stride + ss->mv.col;
+ }
}
- x->ss_count = search_site_count;
+ x->ss_count = ss_count;
x->searches_per_step = 4;
}
@@ -178,35 +160,35 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride) {
error_per_bit + 4096) >> 13 : 0)
-#define SP(x) (((x) & 7) << 1) // convert motion vector component to offset
- // for svf calc
-
-#define IFMVCV(r, c, s, e) \
- if (c >= minc && c <= maxc && r >= minr && r <= maxr) \
- s \
- else \
- e;
+// convert motion vector component to offset for svf calc
+static INLINE int sp(int x) {
+ return (x & 7) << 1;
+}
-/* pointer to predictor base of a motionvector */
-#define PRE(r, c) (y + (((r) >> 3) * y_stride + ((c) >> 3) -(offset)))
+static INLINE const uint8_t *pre(const uint8_t *buf, int stride, int r, int c,
+ int offset) {
+ return &buf[(r >> 3) * stride + (c >> 3) - offset];
+}
/* returns subpixel variance error function */
#define DIST(r, c) \
- vfp->svf(PRE(r, c), y_stride, SP(c), SP(r), z, src_stride, &sse)
+ vfp->svf(pre(y, y_stride, r, c, offset), y_stride, sp(c), sp(r), z, \
+ src_stride, &sse)
/* checks if (r, c) has better score than previous best */
#define CHECK_BETTER(v, r, c) \
- IFMVCV(r, c, { \
- thismse = (DIST(r, c)); \
- if ((v = MVC(r, c) + thismse) < besterr) { \
- besterr = v; \
- br = r; \
- bc = c; \
- *distortion = thismse; \
- *sse1 = sse; \
- } \
- }, \
- v = INT_MAX;)
+ if (c >= minc && c <= maxc && r >= minr && r <= maxr) { \
+ thismse = (DIST(r, c)); \
+ if ((v = MVC(r, c) + thismse) < besterr) { \
+ besterr = v; \
+ br = r; \
+ bc = c; \
+ *distortion = thismse; \
+ *sse1 = sse; \
+ } \
+ } else { \
+ v = INT_MAX; \
+ }
#define FIRST_LEVEL_CHECKS \
{ \
@@ -273,105 +255,7 @@ void vp9_init3smotion_compensation(MACROBLOCK *x, int stride) {
} \
}
-int vp9_find_best_sub_pixel_iterative(MACROBLOCK *x,
- MV *bestmv, const MV *ref_mv,
- int allow_hp,
- int error_per_bit,
- const vp9_variance_fn_ptr_t *vfp,
- int forced_stop,
- int iters_per_step,
- int *mvjcost, int *mvcost[2],
- int *distortion,
- unsigned int *sse1) {
- uint8_t *z = x->plane[0].src.buf;
- int src_stride = x->plane[0].src.stride;
- MACROBLOCKD *xd = &x->e_mbd;
-
- unsigned int besterr = INT_MAX;
- unsigned int sse;
- unsigned int whichdir;
- unsigned int halfiters = iters_per_step;
- unsigned int quarteriters = iters_per_step;
- unsigned int eighthiters = iters_per_step;
- int thismse;
-
- const int y_stride = xd->plane[0].pre[0].stride;
- const int offset = bestmv->row * y_stride + bestmv->col;
- uint8_t *y = xd->plane[0].pre[0].buf + offset;
-
- int rr = ref_mv->row;
- int rc = ref_mv->col;
- int br = bestmv->row * 8;
- int bc = bestmv->col * 8;
- int hstep = 4;
- const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX);
- const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX);
- const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX);
- const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX);
-
- int tr = br;
- int tc = bc;
-
- // central mv
- bestmv->row <<= 3;
- bestmv->col <<= 3;
-
- // calculate central point error
- besterr = vfp->vf(y, y_stride, z, src_stride, sse1);
- *distortion = besterr;
- besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit);
-
- // TODO(jbb): Each subsequent iteration checks at least one point in
- // common with the last iteration could be 2 if diagonal is selected.
- while (halfiters--) {
- // 1/2 pel
- FIRST_LEVEL_CHECKS;
- // no reason to check the same one again.
- if (tr == br && tc == bc)
- break;
- tr = br;
- tc = bc;
- }
-
- // TODO(yaowu): Each subsequent iteration checks at least one point in common
- // with the last iteration could be 2 if diagonal is selected.
-
- // Note forced_stop: 0 - full, 1 - qtr only, 2 - half only
- if (forced_stop != 2) {
- hstep >>= 1;
- while (quarteriters--) {
- FIRST_LEVEL_CHECKS;
- // no reason to check the same one again.
- if (tr == br && tc == bc)
- break;
- tr = br;
- tc = bc;
- }
- }
-
- if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
- hstep >>= 1;
- while (eighthiters--) {
- FIRST_LEVEL_CHECKS;
- // no reason to check the same one again.
- if (tr == br && tc == bc)
- break;
- tr = br;
- tc = bc;
- }
- }
-
- bestmv->row = br;
- bestmv->col = bc;
-
- if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) ||
- (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3)))
- return INT_MAX;
-
- return besterr;
-}
-
-int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
+int vp9_find_best_sub_pixel_tree(const MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
@@ -381,9 +265,9 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
int *mvjcost, int *mvcost[2],
int *distortion,
unsigned int *sse1) {
- uint8_t *z = x->plane[0].src.buf;
+ const uint8_t *z = x->plane[0].src.buf;
const int src_stride = x->plane[0].src.stride;
- MACROBLOCKD *xd = &x->e_mbd;
+ const MACROBLOCKD *xd = &x->e_mbd;
unsigned int besterr = INT_MAX;
unsigned int sse;
unsigned int whichdir;
@@ -394,7 +278,7 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
const int y_stride = xd->plane[0].pre[0].stride;
const int offset = bestmv->row * y_stride + bestmv->col;
- uint8_t *y = xd->plane[0].pre[0].buf + offset;
+ const uint8_t *y = xd->plane[0].pre[0].buf + offset;
int rr = ref_mv->row;
int rc = ref_mv->col;
@@ -446,6 +330,10 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
tr = br;
tc = bc;
}
+ // These lines insure static analysis doesn't warn that
+ // tr and tc aren't used after the above point.
+ (void) tr;
+ (void) tc;
bestmv->row = br;
bestmv->col = bc;
@@ -460,113 +348,10 @@ int vp9_find_best_sub_pixel_tree(MACROBLOCK *x,
#undef DIST
/* returns subpixel variance error function */
#define DIST(r, c) \
- vfp->svaf(PRE(r, c), y_stride, SP(c), SP(r), \
+ vfp->svaf(pre(y, y_stride, r, c, offset), y_stride, sp(c), sp(r), \
z, src_stride, &sse, second_pred)
-int vp9_find_best_sub_pixel_comp_iterative(MACROBLOCK *x,
- MV *bestmv, const MV *ref_mv,
- int allow_hp,
- int error_per_bit,
- const vp9_variance_fn_ptr_t *vfp,
- int forced_stop,
- int iters_per_step,
- int *mvjcost, int *mvcost[2],
- int *distortion,
- unsigned int *sse1,
- const uint8_t *second_pred,
- int w, int h) {
- uint8_t *const z = x->plane[0].src.buf;
- const int src_stride = x->plane[0].src.stride;
- MACROBLOCKD *const xd = &x->e_mbd;
-
- unsigned int besterr = INT_MAX;
- unsigned int sse;
- unsigned int whichdir;
- unsigned int halfiters = iters_per_step;
- unsigned int quarteriters = iters_per_step;
- unsigned int eighthiters = iters_per_step;
- int thismse;
-
- DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64);
- const int y_stride = xd->plane[0].pre[0].stride;
- const int offset = bestmv->row * y_stride + bestmv->col;
- uint8_t *const y = xd->plane[0].pre[0].buf + offset;
-
- int rr = ref_mv->row;
- int rc = ref_mv->col;
- int br = bestmv->row * 8;
- int bc = bestmv->col * 8;
- int hstep = 4;
- const int minc = MAX(x->mv_col_min * 8, ref_mv->col - MV_MAX);
- const int maxc = MIN(x->mv_col_max * 8, ref_mv->col + MV_MAX);
- const int minr = MAX(x->mv_row_min * 8, ref_mv->row - MV_MAX);
- const int maxr = MIN(x->mv_row_max * 8, ref_mv->row + MV_MAX);
-
- int tr = br;
- int tc = bc;
-
- // central mv
- bestmv->row *= 8;
- bestmv->col *= 8;
-
- // calculate central point error
- // TODO(yunqingwang): central pointer error was already calculated in full-
- // pixel search, and can be passed in this function.
- comp_avg_pred(comp_pred, second_pred, w, h, y, y_stride);
- besterr = vfp->vf(comp_pred, w, z, src_stride, sse1);
- *distortion = besterr;
- besterr += mv_err_cost(bestmv, ref_mv, mvjcost, mvcost, error_per_bit);
-
- // Each subsequent iteration checks at least one point in
- // common with the last iteration could be 2 ( if diag selected)
- while (halfiters--) {
- // 1/2 pel
- FIRST_LEVEL_CHECKS;
- // no reason to check the same one again.
- if (tr == br && tc == bc)
- break;
- tr = br;
- tc = bc;
- }
-
- // Each subsequent iteration checks at least one point in common with
- // the last iteration could be 2 ( if diag selected) 1/4 pel
-
- // Note forced_stop: 0 - full, 1 - qtr only, 2 - half only
- if (forced_stop != 2) {
- hstep >>= 1;
- while (quarteriters--) {
- FIRST_LEVEL_CHECKS;
- // no reason to check the same one again.
- if (tr == br && tc == bc)
- break;
- tr = br;
- tc = bc;
- }
- }
-
- if (allow_hp && vp9_use_mv_hp(ref_mv) && forced_stop == 0) {
- hstep >>= 1;
- while (eighthiters--) {
- FIRST_LEVEL_CHECKS;
- // no reason to check the same one again.
- if (tr == br && tc == bc)
- break;
- tr = br;
- tc = bc;
- }
- }
- bestmv->row = br;
- bestmv->col = bc;
-
- if ((abs(bestmv->col - ref_mv->col) > (MAX_FULL_PEL_VAL << 3)) ||
- (abs(bestmv->row - ref_mv->row) > (MAX_FULL_PEL_VAL << 3)))
- return INT_MAX;
-
- return besterr;
-}
-
-int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
+int vp9_find_best_sub_pixel_comp_tree(const MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
@@ -578,9 +363,9 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
unsigned int *sse1,
const uint8_t *second_pred,
int w, int h) {
- uint8_t *z = x->plane[0].src.buf;
+ const uint8_t *z = x->plane[0].src.buf;
const int src_stride = x->plane[0].src.stride;
- MACROBLOCKD *xd = &x->e_mbd;
+ const MACROBLOCKD *xd = &x->e_mbd;
unsigned int besterr = INT_MAX;
unsigned int sse;
unsigned int whichdir;
@@ -592,7 +377,7 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
DECLARE_ALIGNED_ARRAY(16, uint8_t, comp_pred, 64 * 64);
const int y_stride = xd->plane[0].pre[0].stride;
const int offset = bestmv->row * y_stride + bestmv->col;
- uint8_t *y = xd->plane[0].pre[0].buf + offset;
+ const uint8_t *y = xd->plane[0].pre[0].buf + offset;
int rr = ref_mv->row;
int rc = ref_mv->col;
@@ -652,6 +437,11 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
tr = br;
tc = bc;
}
+ // These lines insure static analysis doesn't warn that
+ // tr and tc aren't used after the above point.
+ (void) tr;
+ (void) tc;
+
bestmv->row = br;
bestmv->col = bc;
@@ -665,48 +455,34 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
#undef MVC
#undef PRE
#undef DIST
-#undef IFMVCV
#undef CHECK_BETTER
-#undef SP
-#define CHECK_BOUNDS(range) \
- {\
- all_in = 1;\
- all_in &= ((br-range) >= x->mv_row_min);\
- all_in &= ((br+range) <= x->mv_row_max);\
- all_in &= ((bc-range) >= x->mv_col_min);\
- all_in &= ((bc+range) <= x->mv_col_max);\
- }
+static INLINE int check_bounds(const MACROBLOCK *x, int row, int col,
+ int range) {
+ return ((row - range) >= x->mv_row_min) &
+ ((row + range) <= x->mv_row_max) &
+ ((col - range) >= x->mv_col_min) &
+ ((col + range) <= x->mv_col_max);
+}
-#define CHECK_POINT \
- {\
- if (this_mv.col < x->mv_col_min) continue;\
- if (this_mv.col > x->mv_col_max) continue;\
- if (this_mv.row < x->mv_row_min) continue;\
- if (this_mv.row > x->mv_row_max) continue;\
- }
+static INLINE int is_mv_in(const MACROBLOCK *x, const MV *mv) {
+ return (mv->col >= x->mv_col_min) && (mv->col <= x->mv_col_max) &&
+ (mv->row >= x->mv_row_min) && (mv->row <= x->mv_row_max);
+}
#define CHECK_BETTER \
{\
- if (thissad < bestsad)\
- {\
+ if (thissad < bestsad) {\
if (use_mvcost) \
- thissad += mvsad_err_cost(&this_mv, &fcenter_mv.as_mv, \
- mvjsadcost, mvsadcost, \
- sad_per_bit);\
- if (thissad < bestsad)\
- {\
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv, \
+ mvjsadcost, mvsadcost, sad_per_bit);\
+ if (thissad < bestsad) {\
bestsad = thissad;\
best_site = i;\
}\
}\
}
-#define get_next_chkpts(list, i, n) \
- list[0] = ((i) == 0 ? (n) - 1 : (i) - 1); \
- list[1] = (i); \
- list[2] = ((i) == (n) - 1 ? 0 : (i) + 1);
-
#define MAX_PATTERN_SCALES 11
#define MAX_PATTERN_CANDIDATES 8 // max number of canddiates per scale
#define PATTERN_CANDIDATES_REF 3 // number of refinement candidates
@@ -715,7 +491,7 @@ int vp9_find_best_sub_pixel_comp_tree(MACROBLOCK *x,
// Each scale can have a different number of candidates and shape of
// candidates as indicated in the num_candidates and candidates arrays
// passed into this function
-static int vp9_pattern_search(MACROBLOCK *x,
+static int vp9_pattern_search(const MACROBLOCK *x,
MV *ref_mv,
int search_param,
int sad_per_bit,
@@ -727,43 +503,39 @@ static int vp9_pattern_search(MACROBLOCK *x,
const int num_candidates[MAX_PATTERN_SCALES],
const MV candidates[MAX_PATTERN_SCALES]
[MAX_PATTERN_CANDIDATES]) {
- const MACROBLOCKD* const xd = &x->e_mbd;
+ const MACROBLOCKD *const xd = &x->e_mbd;
static const int search_param_to_steps[MAX_MVSEARCH_STEPS] = {
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0,
};
int i, j, s, t;
- uint8_t *what = x->plane[0].src.buf;
- int what_stride = x->plane[0].src.stride;
- int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
int br, bc;
MV this_mv;
int bestsad = INT_MAX;
int thissad;
- uint8_t *base_offset;
- uint8_t *this_offset;
+ const uint8_t *base_offset;
+ const uint8_t *this_offset;
int k = -1;
- int all_in;
int best_site = -1;
- int_mv fcenter_mv;
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
int best_init_s = search_param_to_steps[search_param];
- int *mvjsadcost = x->nmvjointsadcost;
+ const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- fcenter_mv.as_mv.row = center_mv->row >> 3;
- fcenter_mv.as_mv.col = center_mv->col >> 3;
-
// adjust ref_mv to make sure it is within MV range
clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
br = ref_mv->row;
bc = ref_mv->col;
// Work out the start point for the search
- base_offset = (uint8_t *)(xd->plane[0].pre[0].buf);
+ base_offset = xd->plane[0].pre[0].buf;
this_offset = base_offset + (br * in_what_stride) + bc;
this_mv.row = br;
this_mv.col = bc;
bestsad = vfp->sdf(what, what_stride, this_offset, in_what_stride, 0x7fffffff)
- + mvsad_err_cost(&this_mv, &fcenter_mv.as_mv,
+ + mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
// Search all possible scales upto the search param around the center point
@@ -774,8 +546,7 @@ static int vp9_pattern_search(MACROBLOCK *x,
best_init_s = -1;
for (t = 0; t <= s; ++t) {
best_site = -1;
- CHECK_BOUNDS((1 << t))
- if (all_in) {
+ if (check_bounds(x, br, bc, 1 << t)) {
for (i = 0; i < num_candidates[t]; i++) {
this_mv.row = br + candidates[t][i].row;
this_mv.col = bc + candidates[t][i].col;
@@ -789,7 +560,8 @@ static int vp9_pattern_search(MACROBLOCK *x,
for (i = 0; i < num_candidates[t]; i++) {
this_mv.row = br + candidates[t][i].row;
this_mv.col = bc + candidates[t][i].col;
- CHECK_POINT
+ if (!is_mv_in(x, &this_mv))
+ continue;
this_offset = base_offset + (this_mv.row * in_what_stride) +
this_mv.col;
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
@@ -818,8 +590,7 @@ static int vp9_pattern_search(MACROBLOCK *x,
do {
// No need to search all 6 points the 1st time if initial search was used
if (!do_init_search || s != best_init_s) {
- CHECK_BOUNDS((1 << s))
- if (all_in) {
+ if (check_bounds(x, br, bc, 1 << s)) {
for (i = 0; i < num_candidates[s]; i++) {
this_mv.row = br + candidates[s][i].row;
this_mv.col = bc + candidates[s][i].col;
@@ -833,7 +604,8 @@ static int vp9_pattern_search(MACROBLOCK *x,
for (i = 0; i < num_candidates[s]; i++) {
this_mv.row = br + candidates[s][i].row;
this_mv.col = bc + candidates[s][i].col;
- CHECK_POINT
+ if (!is_mv_in(x, &this_mv))
+ continue;
this_offset = base_offset + (this_mv.row * in_what_stride) +
this_mv.col;
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
@@ -854,10 +626,11 @@ static int vp9_pattern_search(MACROBLOCK *x,
do {
int next_chkpts_indices[PATTERN_CANDIDATES_REF];
best_site = -1;
- CHECK_BOUNDS((1 << s))
+ next_chkpts_indices[0] = (k == 0) ? num_candidates[s] - 1 : k - 1;
+ next_chkpts_indices[1] = k;
+ next_chkpts_indices[2] = (k == num_candidates[s] - 1) ? 0 : k + 1;
- get_next_chkpts(next_chkpts_indices, k, num_candidates[s]);
- if (all_in) {
+ if (check_bounds(x, br, bc, 1 << s)) {
for (i = 0; i < PATTERN_CANDIDATES_REF; i++) {
this_mv.row = br + candidates[s][next_chkpts_indices[i]].row;
this_mv.col = bc + candidates[s][next_chkpts_indices[i]].col;
@@ -871,7 +644,8 @@ static int vp9_pattern_search(MACROBLOCK *x,
for (i = 0; i < PATTERN_CANDIDATES_REF; i++) {
this_mv.row = br + candidates[s][next_chkpts_indices[i]].row;
this_mv.col = bc + candidates[s][next_chkpts_indices[i]].col;
- CHECK_POINT
+ if (!is_mv_in(x, &this_mv))
+ continue;
this_offset = base_offset + (this_mv.row * (in_what_stride)) +
this_mv.col;
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
@@ -892,18 +666,15 @@ static int vp9_pattern_search(MACROBLOCK *x,
// Check 4 1-away neighbors if do_refine is true.
// For most well-designed schemes do_refine will not be necessary.
if (do_refine) {
- static const MV neighbors[4] = {
- {0, -1}, { -1, 0}, {1, 0}, {0, 1},
- };
+ static const MV neighbors[4] = { {0, -1}, { -1, 0}, {1, 0}, {0, 1} };
for (j = 0; j < 16; j++) {
best_site = -1;
- CHECK_BOUNDS(1)
- if (all_in) {
+ if (check_bounds(x, br, bc, 1)) {
for (i = 0; i < 4; i++) {
this_mv.row = br + neighbors[i].row;
this_mv.col = bc + neighbors[i].col;
- this_offset = base_offset + (this_mv.row * (in_what_stride)) +
- this_mv.col;
+ this_offset = base_offset + this_mv.row * in_what_stride +
+ this_mv.col;
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
bestsad);
CHECK_BETTER
@@ -912,14 +683,15 @@ static int vp9_pattern_search(MACROBLOCK *x,
for (i = 0; i < 4; i++) {
this_mv.row = br + neighbors[i].row;
this_mv.col = bc + neighbors[i].col;
- CHECK_POINT
- this_offset = base_offset + (this_mv.row * (in_what_stride)) +
- this_mv.col;
+ if (!is_mv_in(x, &this_mv))
+ continue;
+ this_offset = base_offset + this_mv.row * in_what_stride +
+ this_mv.col;
thissad = vfp->sdf(what, what_stride, this_offset, in_what_stride,
bestsad);
CHECK_BETTER
}
- }
+ }
if (best_site == -1) {
break;
@@ -933,22 +705,54 @@ static int vp9_pattern_search(MACROBLOCK *x,
best_mv->row = br;
best_mv->col = bc;
- this_offset = base_offset + (best_mv->row * in_what_stride) +
- best_mv->col;
this_mv.row = best_mv->row * 8;
this_mv.col = best_mv->col * 8;
- if (bestsad == INT_MAX)
- return INT_MAX;
+ return bestsad;
+}
- return vfp->vf(what, what_stride, this_offset, in_what_stride,
- (unsigned int *)&bestsad) +
- use_mvcost ? mv_err_cost(&this_mv, center_mv,
- x->nmvjointcost, x->mvcost, x->errorperbit)
- : 0;
+int vp9_get_mvpred_var(const MACROBLOCK *x,
+ const MV *best_mv, const MV *center_mv,
+ const vp9_variance_fn_ptr_t *vfp,
+ int use_mvcost) {
+ unsigned int unused;
+
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *base_offset = xd->plane[0].pre[0].buf;
+ const uint8_t *this_offset = &base_offset[best_mv->row * in_what_stride +
+ best_mv->col];
+ const MV mv = {best_mv->row * 8, best_mv->col * 8};
+ return vfp->vf(what, what_stride, this_offset, in_what_stride, &unused) +
+ (use_mvcost ? mv_err_cost(&mv, center_mv, x->nmvjointcost,
+ x->mvcost, x->errorperbit) : 0);
}
+int vp9_get_mvpred_av_var(const MACROBLOCK *x,
+ MV *best_mv,
+ const MV *center_mv,
+ const uint8_t *second_pred,
+ const vp9_variance_fn_ptr_t *vfp,
+ int use_mvcost) {
+ unsigned int bestsad;
+ MV this_mv;
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *base_offset = xd->plane[0].pre[0].buf;
+ const uint8_t *this_offset = base_offset + (best_mv->row * in_what_stride) +
+ best_mv->col;
+ this_mv.row = best_mv->row * 8;
+ this_mv.col = best_mv->col * 8;
+ return vfp->svaf(this_offset, in_what_stride, 0, 0, what, what_stride,
+ &bestsad, second_pred) +
+ (use_mvcost ? mv_err_cost(&this_mv, center_mv, x->nmvjointcost,
+ x->mvcost, x->errorperbit) : 0);
+}
-int vp9_hex_search(MACROBLOCK *x,
+int vp9_hex_search(const MACROBLOCK *x,
MV *ref_mv,
int search_param,
int sad_per_bit,
@@ -976,14 +780,13 @@ int vp9_hex_search(MACROBLOCK *x,
{{-512, -1024}, {512, -1024}, {1024, 0}, {512, 1024}, { -512, 1024},
{ -1024, 0}},
};
- return
- vp9_pattern_search(x, ref_mv, search_param, sad_per_bit,
- do_init_search, 0, vfp, use_mvcost,
- center_mv, best_mv,
- hex_num_candidates, hex_candidates);
+ return vp9_pattern_search(x, ref_mv, search_param, sad_per_bit,
+ do_init_search, 0, vfp, use_mvcost,
+ center_mv, best_mv,
+ hex_num_candidates, hex_candidates);
}
-int vp9_bigdia_search(MACROBLOCK *x,
+int vp9_bigdia_search(const MACROBLOCK *x,
MV *ref_mv,
int search_param,
int sad_per_bit,
@@ -1024,7 +827,7 @@ int vp9_bigdia_search(MACROBLOCK *x,
bigdia_num_candidates, bigdia_candidates);
}
-int vp9_square_search(MACROBLOCK *x,
+int vp9_square_search(const MACROBLOCK *x,
MV *ref_mv,
int search_param,
int sad_per_bit,
@@ -1063,92 +866,201 @@ int vp9_square_search(MACROBLOCK *x,
do_init_search, 0, vfp, use_mvcost,
center_mv, best_mv,
square_num_candidates, square_candidates);
-};
+}
+
+int vp9_fast_hex_search(const MACROBLOCK *x,
+ MV *ref_mv,
+ int search_param,
+ int sad_per_bit,
+ int do_init_search, // must be zero for fast_hex
+ const vp9_variance_fn_ptr_t *vfp,
+ int use_mvcost,
+ const MV *center_mv,
+ MV *best_mv) {
+ return vp9_hex_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param),
+ sad_per_bit, do_init_search, vfp, use_mvcost,
+ center_mv, best_mv);
+}
+
+int vp9_fast_dia_search(const MACROBLOCK *x,
+ MV *ref_mv,
+ int search_param,
+ int sad_per_bit,
+ int do_init_search,
+ const vp9_variance_fn_ptr_t *vfp,
+ int use_mvcost,
+ const MV *center_mv,
+ MV *best_mv) {
+ return vp9_bigdia_search(x, ref_mv, MAX(MAX_MVSEARCH_STEPS - 2, search_param),
+ sad_per_bit, do_init_search, vfp, use_mvcost,
+ center_mv, best_mv);
+}
-#undef CHECK_BOUNDS
-#undef CHECK_POINT
#undef CHECK_BETTER
-int vp9_diamond_search_sad_c(MACROBLOCK *x,
- int_mv *ref_mv, int_mv *best_mv,
+int vp9_full_range_search_c(const MACROBLOCK *x, MV *ref_mv, MV *best_mv,
+ int search_param, int sad_per_bit, int *num00,
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *in_what;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ MV this_mv;
+
+ unsigned int bestsad = INT_MAX;
+ int ref_row, ref_col;
+
+ unsigned int thissad;
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
+
+ const int *mvjsadcost = x->nmvjointsadcost;
+ int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
+
+ int tr, tc;
+ int best_tr = 0;
+ int best_tc = 0;
+ int range = 64;
+
+ int start_col, end_col;
+ int start_row, end_row;
+ int i;
+
+ clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
+ ref_row = ref_mv->row;
+ ref_col = ref_mv->col;
+ *num00 = 11;
+ best_mv->row = ref_row;
+ best_mv->col = ref_col;
+
+ // Work out the start point for the search
+ in_what = xd->plane[0].pre[0].buf + ref_row * in_what_stride + ref_col;
+
+ // Check the starting position
+ bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride, 0x7fffffff)
+ + mvsad_err_cost(best_mv, &fcenter_mv,
+ mvjsadcost, mvsadcost, sad_per_bit);
+
+ start_row = MAX(-range, x->mv_row_min - ref_row);
+ start_col = MAX(-range, x->mv_col_min - ref_col);
+ end_row = MIN(range, x->mv_row_max - ref_row);
+ end_col = MIN(range, x->mv_col_max - ref_col);
+
+ for (tr = start_row; tr <= end_row; ++tr) {
+ for (tc = start_col; tc <= end_col; tc += 4) {
+ if ((tc + 3) <= end_col) {
+ unsigned int sad_array[4];
+ unsigned char const *addr_ref[4];
+ for (i = 0; i < 4; ++i)
+ addr_ref[i] = in_what + tr * in_what_stride + tc + i;
+
+ fn_ptr->sdx4df(what, what_stride, addr_ref, in_what_stride, sad_array);
+
+ for (i = 0; i < 4; ++i) {
+ if (sad_array[i] < bestsad) {
+ this_mv.row = ref_row + tr;
+ this_mv.col = ref_col + tc + i;
+ thissad = sad_array[i] +
+ mvsad_err_cost(&this_mv, &fcenter_mv,
+ mvjsadcost, mvsadcost, sad_per_bit);
+ if (thissad < bestsad) {
+ bestsad = thissad;
+ best_tr = tr;
+ best_tc = tc + i;
+ }
+ }
+ }
+ } else {
+ for (i = 0; i < end_col - tc; ++i) {
+ const uint8_t *check_here = in_what + tr * in_what_stride + tc + i;
+ thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
+ bestsad);
+
+ if (thissad < bestsad) {
+ this_mv.row = ref_row + tr;
+ this_mv.col = ref_col + tc + i;
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
+ mvjsadcost, mvsadcost, sad_per_bit);
+
+ if (thissad < bestsad) {
+ bestsad = thissad;
+ best_tr = tr;
+ best_tc = tc + i;
+ }
+ }
+ }
+ }
+ }
+ }
+ best_mv->row += best_tr;
+ best_mv->col += best_tc;
+ return bestsad;
+}
+
+int vp9_diamond_search_sad_c(const MACROBLOCK *x,
+ MV *ref_mv, MV *best_mv,
int search_param, int sad_per_bit, int *num00,
- vp9_variance_fn_ptr_t *fn_ptr, int *mvjcost,
- int *mvcost[2], int_mv *center_mv) {
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv) {
int i, j, step;
- const MACROBLOCKD* const xd = &x->e_mbd;
- uint8_t *what = x->plane[0].src.buf;
- int what_stride = x->plane[0].src.stride;
- uint8_t *in_what;
- int in_what_stride = xd->plane[0].pre[0].stride;
- uint8_t *best_address;
-
- int tot_steps;
- int_mv this_mv;
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *in_what;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *best_address;
int bestsad = INT_MAX;
int best_site = 0;
int last_site = 0;
int ref_row, ref_col;
- int this_row_offset, this_col_offset;
- search_site *ss;
- uint8_t *check_here;
- int thissad;
- int_mv fcenter_mv;
+ // search_param determines the length of the initial step and hence the number
+ // of iterations
+ // 0 = initial step (MAX_FIRST_STEP) pel : 1 = (MAX_FIRST_STEP/2) pel, 2 =
+ // (MAX_FIRST_STEP/4) pel... etc.
+ const search_site *const ss = &x->ss[search_param * x->searches_per_step];
+ const int tot_steps = (x->ss_count / x->searches_per_step) - search_param;
- int *mvjsadcost = x->nmvjointsadcost;
- int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
+ const int *mvjsadcost = x->nmvjointsadcost;
+ int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- clamp_mv(&ref_mv->as_mv,
- x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
- ref_row = ref_mv->as_mv.row;
- ref_col = ref_mv->as_mv.col;
+ clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
+ ref_row = ref_mv->row;
+ ref_col = ref_mv->col;
*num00 = 0;
- best_mv->as_mv.row = ref_row;
- best_mv->as_mv.col = ref_col;
+ best_mv->row = ref_row;
+ best_mv->col = ref_col;
// Work out the start point for the search
- in_what = (uint8_t *)(xd->plane[0].pre[0].buf +
- (ref_row * (xd->plane[0].pre[0].stride)) + ref_col);
+ in_what = xd->plane[0].pre[0].buf + ref_row * in_what_stride + ref_col;
best_address = in_what;
// Check the starting position
bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride, 0x7fffffff)
- + mvsad_err_cost(&best_mv->as_mv, &fcenter_mv.as_mv,
+ + mvsad_err_cost(best_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
- // search_param determines the length of the initial step and hence the number
- // of iterations
- // 0 = initial step (MAX_FIRST_STEP) pel : 1 = (MAX_FIRST_STEP/2) pel, 2 =
- // (MAX_FIRST_STEP/4) pel... etc.
- ss = &x->ss[search_param * x->searches_per_step];
- tot_steps = (x->ss_count / x->searches_per_step) - search_param;
-
i = 1;
for (step = 0; step < tot_steps; step++) {
for (j = 0; j < x->searches_per_step; j++) {
- // Trap illegal vectors
- this_row_offset = best_mv->as_mv.row + ss[i].mv.row;
- this_col_offset = best_mv->as_mv.col + ss[i].mv.col;
-
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = ss[i].offset + best_address;
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
+ const MV this_mv = {best_mv->row + ss[i].mv.row,
+ best_mv->col + ss[i].mv.col};
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *const check_here = ss[i].offset + best_address;
+ int thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
@@ -1162,30 +1074,25 @@ int vp9_diamond_search_sad_c(MACROBLOCK *x,
}
if (best_site != last_site) {
- best_mv->as_mv.row += ss[best_site].mv.row;
- best_mv->as_mv.col += ss[best_site].mv.col;
+ best_mv->row += ss[best_site].mv.row;
+ best_mv->col += ss[best_site].mv.col;
best_address += ss[best_site].offset;
last_site = best_site;
#if defined(NEW_DIAMOND_SEARCH)
while (1) {
- this_row_offset = best_mv->as_mv.row + ss[best_site].mv.row;
- this_col_offset = best_mv->as_mv.col + ss[best_site].mv.col;
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = ss[best_site].offset + best_address;
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
+ const MV this_mv = {best_mv->row + ss[best_site].mv.row,
+ best_mv->col + ss[best_site].mv.col};
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *const check_here = ss[best_site].offset + best_address;
+ int thissad = fn_ptr->sdf(what, what_stride, check_here,
+ in_what_stride, bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row += ss[best_site].mv.row;
- best_mv->as_mv.col += ss[best_site].mv.col;
+ best_mv->row += ss[best_site].mv.row;
+ best_mv->col += ss[best_site].mv.col;
best_address += ss[best_site].offset;
continue;
}
@@ -1198,35 +1105,23 @@ int vp9_diamond_search_sad_c(MACROBLOCK *x,
(*num00)++;
}
}
-
- this_mv.as_mv.row = best_mv->as_mv.row * 8;
- this_mv.as_mv.col = best_mv->as_mv.col * 8;
-
- if (bestsad == INT_MAX)
- return INT_MAX;
-
- return fn_ptr->vf(what, what_stride, best_address, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
+ return bestsad;
}
-int vp9_diamond_search_sadx4(MACROBLOCK *x,
- int_mv *ref_mv, int_mv *best_mv, int search_param,
+int vp9_diamond_search_sadx4(const MACROBLOCK *x,
+ MV *ref_mv, MV *best_mv, int search_param,
int sad_per_bit, int *num00,
- vp9_variance_fn_ptr_t *fn_ptr,
- int *mvjcost, int *mvcost[2], int_mv *center_mv) {
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv) {
int i, j, step;
- const MACROBLOCKD* const xd = &x->e_mbd;
+ const MACROBLOCKD *const xd = &x->e_mbd;
uint8_t *what = x->plane[0].src.buf;
- int what_stride = x->plane[0].src.stride;
- uint8_t *in_what;
- int in_what_stride = xd->plane[0].pre[0].stride;
- uint8_t *best_address;
-
- int tot_steps;
- int_mv this_mv;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *in_what;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *best_address;
unsigned int bestsad = INT_MAX;
int best_site = 0;
@@ -1234,46 +1129,36 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x,
int ref_row;
int ref_col;
- int this_row_offset;
- int this_col_offset;
- search_site *ss;
- uint8_t *check_here;
- unsigned int thissad;
- int_mv fcenter_mv;
+ // search_param determines the length of the initial step and hence the number
+ // of iterations.
+ // 0 = initial step (MAX_FIRST_STEP) pel
+ // 1 = (MAX_FIRST_STEP/2) pel,
+ // 2 = (MAX_FIRST_STEP/4) pel...
+ const search_site *ss = &x->ss[search_param * x->searches_per_step];
+ const int tot_steps = (x->ss_count / x->searches_per_step) - search_param;
- int *mvjsadcost = x->nmvjointsadcost;
- int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
+ const int *mvjsadcost = x->nmvjointsadcost;
+ int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- clamp_mv(&ref_mv->as_mv,
- x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
- ref_row = ref_mv->as_mv.row;
- ref_col = ref_mv->as_mv.col;
+ clamp_mv(ref_mv, x->mv_col_min, x->mv_col_max, x->mv_row_min, x->mv_row_max);
+ ref_row = ref_mv->row;
+ ref_col = ref_mv->col;
*num00 = 0;
- best_mv->as_mv.row = ref_row;
- best_mv->as_mv.col = ref_col;
+ best_mv->row = ref_row;
+ best_mv->col = ref_col;
// Work out the start point for the search
- in_what = (uint8_t *)(xd->plane[0].pre[0].buf +
- (ref_row * (xd->plane[0].pre[0].stride)) + ref_col);
+ in_what = xd->plane[0].pre[0].buf + ref_row * in_what_stride + ref_col;
best_address = in_what;
// Check the starting position
bestsad = fn_ptr->sdf(what, what_stride, in_what, in_what_stride, 0x7fffffff)
- + mvsad_err_cost(&best_mv->as_mv, &fcenter_mv.as_mv,
+ + mvsad_err_cost(best_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
- // search_param determines the length of the initial step and hence the number
- // of iterations.
- // 0 = initial step (MAX_FIRST_STEP) pel
- // 1 = (MAX_FIRST_STEP/2) pel,
- // 2 = (MAX_FIRST_STEP/4) pel...
- ss = &x->ss[search_param * x->searches_per_step];
- tot_steps = (x->ss_count / x->searches_per_step) - search_param;
-
i = 1;
for (step = 0; step < tot_steps; step++) {
@@ -1281,10 +1166,10 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x,
// All_in is true if every one of the points we are checking are within
// the bounds of the image.
- all_in &= ((best_mv->as_mv.row + ss[i].mv.row) > x->mv_row_min);
- all_in &= ((best_mv->as_mv.row + ss[i + 1].mv.row) < x->mv_row_max);
- all_in &= ((best_mv->as_mv.col + ss[i + 2].mv.col) > x->mv_col_min);
- all_in &= ((best_mv->as_mv.col + ss[i + 3].mv.col) < x->mv_col_max);
+ all_in &= ((best_mv->row + ss[i].mv.row) > x->mv_row_min);
+ all_in &= ((best_mv->row + ss[i + 1].mv.row) < x->mv_row_max);
+ all_in &= ((best_mv->col + ss[i + 2].mv.col) > x->mv_col_min);
+ all_in &= ((best_mv->col + ss[i + 3].mv.col) < x->mv_col_max);
// If all the pixels are within the bounds we don't check whether the
// search point is valid in this loop, otherwise we check each point
@@ -1303,9 +1188,9 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x,
for (t = 0; t < 4; t++, i++) {
if (sad_array[t] < bestsad) {
- this_mv.as_mv.row = best_mv->as_mv.row + ss[i].mv.row;
- this_mv.as_mv.col = best_mv->as_mv.col + ss[i].mv.col;
- sad_array[t] += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ const MV this_mv = {best_mv->row + ss[i].mv.row,
+ best_mv->col + ss[i].mv.col};
+ sad_array[t] += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (sad_array[t] < bestsad) {
@@ -1318,21 +1203,16 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x,
} else {
for (j = 0; j < x->searches_per_step; j++) {
// Trap illegal vectors
- this_row_offset = best_mv->as_mv.row + ss[i].mv.row;
- this_col_offset = best_mv->as_mv.col + ss[i].mv.col;
-
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = ss[i].offset + best_address;
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
+ const MV this_mv = {best_mv->row + ss[i].mv.row,
+ best_mv->col + ss[i].mv.col};
+
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *const check_here = ss[i].offset + best_address;
+ unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
+ in_what_stride, bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
@@ -1345,30 +1225,25 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x,
}
}
if (best_site != last_site) {
- best_mv->as_mv.row += ss[best_site].mv.row;
- best_mv->as_mv.col += ss[best_site].mv.col;
+ best_mv->row += ss[best_site].mv.row;
+ best_mv->col += ss[best_site].mv.col;
best_address += ss[best_site].offset;
last_site = best_site;
#if defined(NEW_DIAMOND_SEARCH)
while (1) {
- this_row_offset = best_mv->as_mv.row + ss[best_site].mv.row;
- this_col_offset = best_mv->as_mv.col + ss[best_site].mv.col;
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = ss[best_site].offset + best_address;
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
+ const MV this_mv = {best_mv->row + ss[best_site].mv.row,
+ best_mv->col + ss[best_site].mv.col};
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *const check_here = ss[best_site].offset + best_address;
+ unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
+ in_what_stride, bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row += ss[best_site].mv.row;
- best_mv->as_mv.col += ss[best_site].mv.col;
+ best_mv->row += ss[best_site].mv.row;
+ best_mv->col += ss[best_site].mv.col;
best_address += ss[best_site].offset;
continue;
}
@@ -1381,46 +1256,35 @@ int vp9_diamond_search_sadx4(MACROBLOCK *x,
(*num00)++;
}
}
-
- this_mv.as_mv.row = best_mv->as_mv.row * 8;
- this_mv.as_mv.col = best_mv->as_mv.col * 8;
-
- if (bestsad == INT_MAX)
- return INT_MAX;
-
- return fn_ptr->vf(what, what_stride, best_address, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
+ return bestsad;
}
/* do_refine: If last step (1-away) of n-step search doesn't pick the center
point as the best match, we will do a final 1-away diamond
refining search */
-int vp9_full_pixel_diamond(VP9_COMP *cpi, MACROBLOCK *x,
- int_mv *mvp_full, int step_param,
- int sadpb, int further_steps,
- int do_refine, vp9_variance_fn_ptr_t *fn_ptr,
- int_mv *ref_mv, int_mv *dst_mv) {
- int_mv temp_mv;
- int thissme, n, num00;
+int vp9_full_pixel_diamond(const VP9_COMP *cpi, MACROBLOCK *x,
+ MV *mvp_full, int step_param,
+ int sadpb, int further_steps, int do_refine,
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ const MV *ref_mv, MV *dst_mv) {
+ MV temp_mv;
+ int thissme, n, num00 = 0;
int bestsme = cpi->diamond_search_sad(x, mvp_full, &temp_mv,
- step_param, sadpb, &num00,
+ step_param, sadpb, &n,
fn_ptr, x->nmvjointcost,
x->mvcost, ref_mv);
- dst_mv->as_int = temp_mv.as_int;
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &temp_mv, ref_mv, fn_ptr, 1);
+ *dst_mv = temp_mv;
- n = num00;
- num00 = 0;
-
- /* If there won't be more n-step search, check to see if refining search is
- * needed. */
+ // If there won't be more n-step search, check to see if refining search is
+ // needed.
if (n > further_steps)
do_refine = 0;
while (n < further_steps) {
- n++;
+ ++n;
if (num00) {
num00--;
@@ -1429,187 +1293,126 @@ int vp9_full_pixel_diamond(VP9_COMP *cpi, MACROBLOCK *x,
step_param + n, sadpb, &num00,
fn_ptr, x->nmvjointcost, x->mvcost,
ref_mv);
+ if (thissme < INT_MAX)
+ thissme = vp9_get_mvpred_var(x, &temp_mv, ref_mv, fn_ptr, 1);
- /* check to see if refining search is needed. */
- if (num00 > (further_steps - n))
+ // check to see if refining search is needed.
+ if (num00 > further_steps - n)
do_refine = 0;
if (thissme < bestsme) {
bestsme = thissme;
- dst_mv->as_int = temp_mv.as_int;
+ *dst_mv = temp_mv;
}
}
}
- /* final 1-away diamond refining search */
- if (do_refine == 1) {
- int search_range = 8;
- int_mv best_mv;
- best_mv.as_int = dst_mv->as_int;
+ // final 1-away diamond refining search
+ if (do_refine) {
+ const int search_range = 8;
+ MV best_mv = *dst_mv;
thissme = cpi->refining_search_sad(x, &best_mv, sadpb, search_range,
fn_ptr, x->nmvjointcost, x->mvcost,
ref_mv);
-
+ if (thissme < INT_MAX)
+ thissme = vp9_get_mvpred_var(x, &best_mv, ref_mv, fn_ptr, 1);
if (thissme < bestsme) {
bestsme = thissme;
- dst_mv->as_int = best_mv.as_int;
+ *dst_mv = best_mv;
}
}
return bestsme;
}
-int vp9_full_search_sad_c(MACROBLOCK *x, int_mv *ref_mv,
+int vp9_full_search_sad_c(const MACROBLOCK *x, const MV *ref_mv,
int sad_per_bit, int distance,
- vp9_variance_fn_ptr_t *fn_ptr, int *mvjcost,
- int *mvcost[2],
- int_mv *center_mv, int n) {
- const MACROBLOCKD* const xd = &x->e_mbd;
- uint8_t *what = x->plane[0].src.buf;
- int what_stride = x->plane[0].src.stride;
- uint8_t *in_what;
- int in_what_stride = xd->plane[0].pre[0].stride;
- int mv_stride = xd->plane[0].pre[0].stride;
- uint8_t *bestaddress;
- int_mv *best_mv = &x->e_mbd.mi_8x8[0]->bmi[n].as_mv[0];
- int_mv this_mv;
- int bestsad = INT_MAX;
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv, MV *best_mv) {
int r, c;
-
- uint8_t *check_here;
- int thissad;
-
- int ref_row = ref_mv->as_mv.row;
- int ref_col = ref_mv->as_mv.col;
-
- int row_min = ref_row - distance;
- int row_max = ref_row + distance;
- int col_min = ref_col - distance;
- int col_max = ref_col + distance;
- int_mv fcenter_mv;
-
- int *mvjsadcost = x->nmvjointsadcost;
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *const what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *const in_what = xd->plane[0].pre[0].buf;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const int row_min = MAX(ref_mv->row - distance, x->mv_row_min);
+ const int row_max = MIN(ref_mv->row + distance, x->mv_row_max);
+ const int col_min = MAX(ref_mv->col - distance, x->mv_col_min);
+ const int col_max = MIN(ref_mv->col + distance, x->mv_col_max);
+ const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
-
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
-
- // Work out the mid point for the search
- in_what = xd->plane[0].pre[0].buf;
- bestaddress = in_what + (ref_row * xd->plane[0].pre[0].stride) + ref_col;
-
- best_mv->as_mv.row = ref_row;
- best_mv->as_mv.col = ref_col;
-
- // Baseline value at the centre
- bestsad = fn_ptr->sdf(what, what_stride, bestaddress,
- in_what_stride, 0x7fffffff)
- + mvsad_err_cost(&best_mv->as_mv, &fcenter_mv.as_mv,
- mvjsadcost, mvsadcost, sad_per_bit);
-
- // Apply further limits to prevent us looking using vectors that stretch
- // beyond the UMV border
- col_min = MAX(col_min, x->mv_col_min);
- col_max = MIN(col_max, x->mv_col_max);
- row_min = MAX(row_min, x->mv_row_min);
- row_max = MIN(row_max, x->mv_row_max);
-
- for (r = row_min; r < row_max; r++) {
- this_mv.as_mv.row = r;
- check_here = r * mv_stride + in_what + col_min;
-
- for (c = col_min; c < col_max; c++) {
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
-
- this_mv.as_mv.col = c;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
- mvjsadcost, mvsadcost, sad_per_bit);
-
- if (thissad < bestsad) {
- bestsad = thissad;
- best_mv->as_mv.row = r;
- best_mv->as_mv.col = c;
- bestaddress = check_here;
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
+ const uint8_t *best_address = &in_what[ref_mv->row * in_what_stride +
+ ref_mv->col];
+ int best_sad = fn_ptr->sdf(what, what_stride, best_address, in_what_stride,
+ 0x7fffffff) +
+ mvsad_err_cost(ref_mv, &fcenter_mv, mvjsadcost, mvsadcost, sad_per_bit);
+ *best_mv = *ref_mv;
+
+ for (r = row_min; r < row_max; ++r) {
+ for (c = col_min; c < col_max; ++c) {
+ const MV this_mv = {r, c};
+ const uint8_t *check_here = &in_what[r * in_what_stride + c];
+ const int sad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
+ best_sad) +
+ mvsad_err_cost(&this_mv, &fcenter_mv,
+ mvjsadcost, mvsadcost, sad_per_bit);
+
+ if (sad < best_sad) {
+ best_sad = sad;
+ *best_mv = this_mv;
}
-
- check_here++;
}
}
-
- this_mv.as_mv.row = best_mv->as_mv.row * 8;
- this_mv.as_mv.col = best_mv->as_mv.col * 8;
-
- if (bestsad < INT_MAX)
- return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
- else
- return INT_MAX;
+ return best_sad;
}
-int vp9_full_search_sadx3(MACROBLOCK *x, int_mv *ref_mv,
+int vp9_full_search_sadx3(const MACROBLOCK *x, const MV *ref_mv,
int sad_per_bit, int distance,
- vp9_variance_fn_ptr_t *fn_ptr, int *mvjcost,
- int *mvcost[2], int_mv *center_mv, int n) {
- const MACROBLOCKD* const xd = &x->e_mbd;
- uint8_t *what = x->plane[0].src.buf;
- int what_stride = x->plane[0].src.stride;
- uint8_t *in_what;
- int in_what_stride = xd->plane[0].pre[0].stride;
- int mv_stride = xd->plane[0].pre[0].stride;
- uint8_t *bestaddress;
- int_mv *best_mv = &x->e_mbd.mi_8x8[0]->bmi[n].as_mv[0];
- int_mv this_mv;
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv, MV *best_mv) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *const what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *const in_what = xd->plane[0].pre[0].buf;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ MV this_mv;
unsigned int bestsad = INT_MAX;
int r, c;
-
- uint8_t *check_here;
unsigned int thissad;
+ int ref_row = ref_mv->row;
+ int ref_col = ref_mv->col;
- int ref_row = ref_mv->as_mv.row;
- int ref_col = ref_mv->as_mv.col;
-
- int row_min = ref_row - distance;
- int row_max = ref_row + distance;
- int col_min = ref_col - distance;
- int col_max = ref_col + distance;
-
+ // Apply further limits to prevent us looking using vectors that stretch
+ // beyond the UMV border
+ const int row_min = MAX(ref_row - distance, x->mv_row_min);
+ const int row_max = MIN(ref_row + distance, x->mv_row_max);
+ const int col_min = MAX(ref_col - distance, x->mv_col_min);
+ const int col_max = MIN(ref_col + distance, x->mv_col_max);
unsigned int sad_array[3];
- int_mv fcenter_mv;
-
- int *mvjsadcost = x->nmvjointsadcost;
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
+ const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
-
// Work out the mid point for the search
- in_what = xd->plane[0].pre[0].buf;
- bestaddress = in_what + (ref_row * xd->plane[0].pre[0].stride) + ref_col;
+ const uint8_t *bestaddress = &in_what[ref_row * in_what_stride + ref_col];
- best_mv->as_mv.row = ref_row;
- best_mv->as_mv.col = ref_col;
+ best_mv->row = ref_row;
+ best_mv->col = ref_col;
// Baseline value at the centre
bestsad = fn_ptr->sdf(what, what_stride,
bestaddress, in_what_stride, 0x7fffffff)
- + mvsad_err_cost(&best_mv->as_mv, &fcenter_mv.as_mv,
+ + mvsad_err_cost(best_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
- // Apply further limits to prevent us looking using vectors that stretch
- // beyond the UMV border
- col_min = MAX(col_min, x->mv_col_min);
- col_max = MIN(col_max, x->mv_col_max);
- row_min = MAX(row_min, x->mv_row_min);
- row_max = MIN(row_max, x->mv_row_max);
-
for (r = row_min; r < row_max; r++) {
- this_mv.as_mv.row = r;
- check_here = r * mv_stride + in_what + col_min;
+ const uint8_t *check_here = &in_what[r * in_what_stride + col_min];
+ this_mv.row = r;
c = col_min;
- while ((c + 2) < col_max) {
+ while ((c + 2) < col_max && fn_ptr->sdx3f != NULL) {
int i;
fn_ptr->sdx3f(what, what_stride, check_here, in_what_stride, sad_array);
@@ -1618,18 +1421,16 @@ int vp9_full_search_sadx3(MACROBLOCK *x, int_mv *ref_mv,
thissad = sad_array[i];
if (thissad < bestsad) {
- this_mv.as_mv.col = c;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ this_mv.col = c;
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row = r;
- best_mv->as_mv.col = c;
- bestaddress = check_here;
+ best_mv->row = r;
+ best_mv->col = c;
}
}
-
check_here++;
c++;
}
@@ -1640,15 +1441,14 @@ int vp9_full_search_sadx3(MACROBLOCK *x, int_mv *ref_mv,
bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.col = c;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ this_mv.col = c;
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row = r;
- best_mv->as_mv.col = c;
- bestaddress = check_here;
+ best_mv->row = r;
+ best_mv->col = c;
}
}
@@ -1656,80 +1456,54 @@ int vp9_full_search_sadx3(MACROBLOCK *x, int_mv *ref_mv,
c++;
}
}
-
- this_mv.as_mv.row = best_mv->as_mv.row * 8;
- this_mv.as_mv.col = best_mv->as_mv.col * 8;
-
- if (bestsad < INT_MAX)
- return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
- else
- return INT_MAX;
+ return bestsad;
}
-int vp9_full_search_sadx8(MACROBLOCK *x, int_mv *ref_mv,
+int vp9_full_search_sadx8(const MACROBLOCK *x, const MV *ref_mv,
int sad_per_bit, int distance,
- vp9_variance_fn_ptr_t *fn_ptr,
+ const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- int_mv *center_mv, int n) {
- const MACROBLOCKD* const xd = &x->e_mbd;
- uint8_t *what = x->plane[0].src.buf;
- int what_stride = x->plane[0].src.stride;
- uint8_t *in_what;
- int in_what_stride = xd->plane[0].pre[0].stride;
- int mv_stride = xd->plane[0].pre[0].stride;
- uint8_t *bestaddress;
- int_mv *best_mv = &x->e_mbd.mi_8x8[0]->bmi[n].as_mv[0];
- int_mv this_mv;
+ const MV *center_mv, MV *best_mv) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const uint8_t *const what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *const in_what = xd->plane[0].pre[0].buf;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ MV this_mv;
unsigned int bestsad = INT_MAX;
int r, c;
-
- uint8_t *check_here;
unsigned int thissad;
+ int ref_row = ref_mv->row;
+ int ref_col = ref_mv->col;
- int ref_row = ref_mv->as_mv.row;
- int ref_col = ref_mv->as_mv.col;
-
- int row_min = ref_row - distance;
- int row_max = ref_row + distance;
- int col_min = ref_col - distance;
- int col_max = ref_col + distance;
-
+ // Apply further limits to prevent us looking using vectors that stretch
+ // beyond the UMV border
+ const int row_min = MAX(ref_row - distance, x->mv_row_min);
+ const int row_max = MIN(ref_row + distance, x->mv_row_max);
+ const int col_min = MAX(ref_col - distance, x->mv_col_min);
+ const int col_max = MIN(ref_col + distance, x->mv_col_max);
DECLARE_ALIGNED_ARRAY(16, uint32_t, sad_array8, 8);
unsigned int sad_array[3];
- int_mv fcenter_mv;
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
- int *mvjsadcost = x->nmvjointsadcost;
+ const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
-
// Work out the mid point for the search
- in_what = xd->plane[0].pre[0].buf;
- bestaddress = in_what + (ref_row * xd->plane[0].pre[0].stride) + ref_col;
+ const uint8_t *bestaddress = &in_what[ref_row * in_what_stride + ref_col];
- best_mv->as_mv.row = ref_row;
- best_mv->as_mv.col = ref_col;
+ best_mv->row = ref_row;
+ best_mv->col = ref_col;
- // Baseline value at the centre
+ // Baseline value at the center
bestsad = fn_ptr->sdf(what, what_stride,
bestaddress, in_what_stride, 0x7fffffff)
- + mvsad_err_cost(&best_mv->as_mv, &fcenter_mv.as_mv,
+ + mvsad_err_cost(best_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
- // Apply further limits to prevent us looking using vectors that stretch
- // beyond the UMV border
- col_min = MAX(col_min, x->mv_col_min);
- col_max = MIN(col_max, x->mv_col_max);
- row_min = MAX(row_min, x->mv_row_min);
- row_max = MIN(row_max, x->mv_row_max);
-
for (r = row_min; r < row_max; r++) {
- this_mv.as_mv.row = r;
- check_here = r * mv_stride + in_what + col_min;
+ const uint8_t *check_here = &in_what[r * in_what_stride + col_min];
+ this_mv.row = r;
c = col_min;
while ((c + 7) < col_max) {
@@ -1741,15 +1515,14 @@ int vp9_full_search_sadx8(MACROBLOCK *x, int_mv *ref_mv,
thissad = (unsigned int)sad_array8[i];
if (thissad < bestsad) {
- this_mv.as_mv.col = c;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ this_mv.col = c;
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row = r;
- best_mv->as_mv.col = c;
- bestaddress = check_here;
+ best_mv->row = r;
+ best_mv->col = c;
}
}
@@ -1767,15 +1540,14 @@ int vp9_full_search_sadx8(MACROBLOCK *x, int_mv *ref_mv,
thissad = sad_array[i];
if (thissad < bestsad) {
- this_mv.as_mv.col = c;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ this_mv.col = c;
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row = r;
- best_mv->as_mv.col = c;
- bestaddress = check_here;
+ best_mv->row = r;
+ best_mv->col = c;
}
}
@@ -1789,15 +1561,14 @@ int vp9_full_search_sadx8(MACROBLOCK *x, int_mv *ref_mv,
bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.col = c;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ this_mv.col = c;
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, sad_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
- best_mv->as_mv.row = r;
- best_mv->as_mv.col = c;
- bestaddress = check_here;
+ best_mv->row = r;
+ best_mv->col = c;
}
}
@@ -1805,70 +1576,46 @@ int vp9_full_search_sadx8(MACROBLOCK *x, int_mv *ref_mv,
c++;
}
}
-
- this_mv.as_mv.row = best_mv->as_mv.row * 8;
- this_mv.as_mv.col = best_mv->as_mv.col * 8;
-
- if (bestsad < INT_MAX)
- return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
- else
- return INT_MAX;
+ return bestsad;
}
-int vp9_refining_search_sad_c(MACROBLOCK *x,
- int_mv *ref_mv, int error_per_bit,
- int search_range, vp9_variance_fn_ptr_t *fn_ptr,
- int *mvjcost, int *mvcost[2], int_mv *center_mv) {
- const MACROBLOCKD* const xd = &x->e_mbd;
- MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}};
- int i, j;
- int this_row_offset, this_col_offset;
- int what_stride = x->plane[0].src.stride;
- int in_what_stride = xd->plane[0].pre[0].stride;
- uint8_t *what = x->plane[0].src.buf;
- uint8_t *best_address = xd->plane[0].pre[0].buf +
- (ref_mv->as_mv.row * xd->plane[0].pre[0].stride) +
- ref_mv->as_mv.col;
- uint8_t *check_here;
- unsigned int thissad;
- int_mv this_mv;
- unsigned int bestsad = INT_MAX;
- int_mv fcenter_mv;
+int vp9_refining_search_sad_c(const MACROBLOCK *x,
+ MV *ref_mv, int error_per_bit,
+ int search_range,
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}};
+ int i, j;
- int *mvjsadcost = x->nmvjointsadcost;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *const what = x->plane[0].src.buf;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *const in_what = xd->plane[0].pre[0].buf;
+ const uint8_t *best_address = &in_what[ref_mv->row * in_what_stride +
+ ref_mv->col];
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
+ const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
-
- bestsad = fn_ptr->sdf(what, what_stride, best_address,
- in_what_stride, 0x7fffffff) +
- mvsad_err_cost(&ref_mv->as_mv, &fcenter_mv.as_mv,
- mvjsadcost, mvsadcost, error_per_bit);
+ unsigned int bestsad = fn_ptr->sdf(what, what_stride, best_address,
+ in_what_stride, 0x7fffffff) +
+ mvsad_err_cost(ref_mv, &fcenter_mv, mvjsadcost, mvsadcost, error_per_bit);
for (i = 0; i < search_range; i++) {
int best_site = -1;
for (j = 0; j < 4; j++) {
- this_row_offset = ref_mv->as_mv.row + neighbors[j].row;
- this_col_offset = ref_mv->as_mv.col + neighbors[j].col;
-
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = (neighbors[j].row) * in_what_stride + neighbors[j].col +
- best_address;
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
-
+ const MV this_mv = {ref_mv->row + neighbors[j].row,
+ ref_mv->col + neighbors[j].col};
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *check_here = &in_what[this_mv.row * in_what_stride +
+ this_mv.col];
+ unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
+ in_what_stride, bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, error_per_bit);
if (thissad < bestsad) {
@@ -1882,80 +1629,63 @@ int vp9_refining_search_sad_c(MACROBLOCK *x,
if (best_site == -1) {
break;
} else {
- ref_mv->as_mv.row += neighbors[best_site].row;
- ref_mv->as_mv.col += neighbors[best_site].col;
- best_address += (neighbors[best_site].row) * in_what_stride +
- neighbors[best_site].col;
+ ref_mv->row += neighbors[best_site].row;
+ ref_mv->col += neighbors[best_site].col;
}
}
-
- this_mv.as_mv.row = ref_mv->as_mv.row * 8;
- this_mv.as_mv.col = ref_mv->as_mv.col * 8;
-
- if (bestsad < INT_MAX)
- return fn_ptr->vf(what, what_stride, best_address, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
- else
- return INT_MAX;
+ return bestsad;
}
-int vp9_refining_search_sadx4(MACROBLOCK *x,
- int_mv *ref_mv, int error_per_bit,
- int search_range, vp9_variance_fn_ptr_t *fn_ptr,
- int *mvjcost, int *mvcost[2], int_mv *center_mv) {
- const MACROBLOCKD* const xd = &x->e_mbd;
+int vp9_refining_search_sadx4(const MACROBLOCK *x,
+ MV *ref_mv, int error_per_bit,
+ int search_range,
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv) {
+ const MACROBLOCKD *const xd = &x->e_mbd;
MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}};
int i, j;
- int this_row_offset, this_col_offset;
- int what_stride = x->plane[0].src.stride;
- int in_what_stride = xd->plane[0].pre[0].stride;
- uint8_t *what = x->plane[0].src.buf;
- uint8_t *best_address = xd->plane[0].pre[0].buf +
- (ref_mv->as_mv.row * xd->plane[0].pre[0].stride) +
- ref_mv->as_mv.col;
- uint8_t *check_here;
- unsigned int thissad;
- int_mv this_mv;
- unsigned int bestsad = INT_MAX;
- int_mv fcenter_mv;
+ const int what_stride = x->plane[0].src.stride;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *what = x->plane[0].src.buf;
+ const uint8_t *best_address = xd->plane[0].pre[0].buf +
+ (ref_mv->row * xd->plane[0].pre[0].stride) +
+ ref_mv->col;
- int *mvjsadcost = x->nmvjointsadcost;
- int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
+ const int *mvjsadcost = x->nmvjointsadcost;
+ int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- bestsad = fn_ptr->sdf(what, what_stride, best_address,
- in_what_stride, 0x7fffffff) +
- mvsad_err_cost(&ref_mv->as_mv, &fcenter_mv.as_mv,
- mvjsadcost, mvsadcost, error_per_bit);
+ unsigned int bestsad = fn_ptr->sdf(what, what_stride, best_address,
+ in_what_stride, 0x7fffffff) +
+ mvsad_err_cost(ref_mv, &fcenter_mv, mvjsadcost, mvsadcost, error_per_bit);
for (i = 0; i < search_range; i++) {
int best_site = -1;
- int all_in = ((ref_mv->as_mv.row - 1) > x->mv_row_min) &
- ((ref_mv->as_mv.row + 1) < x->mv_row_max) &
- ((ref_mv->as_mv.col - 1) > x->mv_col_min) &
- ((ref_mv->as_mv.col + 1) < x->mv_col_max);
+ int all_in = ((ref_mv->row - 1) > x->mv_row_min) &
+ ((ref_mv->row + 1) < x->mv_row_max) &
+ ((ref_mv->col - 1) > x->mv_col_min) &
+ ((ref_mv->col + 1) < x->mv_col_max);
if (all_in) {
unsigned int sad_array[4];
- unsigned char const *block_offset[4];
- block_offset[0] = best_address - in_what_stride;
- block_offset[1] = best_address - 1;
- block_offset[2] = best_address + 1;
- block_offset[3] = best_address + in_what_stride;
+ uint8_t const *block_offset[4] = {
+ best_address - in_what_stride,
+ best_address - 1,
+ best_address + 1,
+ best_address + in_what_stride
+ };
fn_ptr->sdx4df(what, what_stride, block_offset, in_what_stride,
sad_array);
for (j = 0; j < 4; j++) {
if (sad_array[j] < bestsad) {
- this_mv.as_mv.row = ref_mv->as_mv.row + neighbors[j].row;
- this_mv.as_mv.col = ref_mv->as_mv.col + neighbors[j].col;
- sad_array[j] += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ const MV this_mv = {ref_mv->row + neighbors[j].row,
+ ref_mv->col + neighbors[j].col};
+ sad_array[j] += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, error_per_bit);
if (sad_array[j] < bestsad) {
@@ -1966,22 +1696,17 @@ int vp9_refining_search_sadx4(MACROBLOCK *x,
}
} else {
for (j = 0; j < 4; j++) {
- this_row_offset = ref_mv->as_mv.row + neighbors[j].row;
- this_col_offset = ref_mv->as_mv.col + neighbors[j].col;
-
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = (neighbors[j].row) * in_what_stride + neighbors[j].col +
- best_address;
- thissad = fn_ptr->sdf(what, what_stride, check_here, in_what_stride,
- bestsad);
+ const MV this_mv = {ref_mv->row + neighbors[j].row,
+ ref_mv->col + neighbors[j].col};
+
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *check_here = neighbors[j].row * in_what_stride +
+ neighbors[j].col + best_address;
+ unsigned int thissad = fn_ptr->sdf(what, what_stride, check_here,
+ in_what_stride, bestsad);
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, error_per_bit);
if (thissad < bestsad) {
@@ -1996,85 +1721,64 @@ int vp9_refining_search_sadx4(MACROBLOCK *x,
if (best_site == -1) {
break;
} else {
- ref_mv->as_mv.row += neighbors[best_site].row;
- ref_mv->as_mv.col += neighbors[best_site].col;
+ ref_mv->row += neighbors[best_site].row;
+ ref_mv->col += neighbors[best_site].col;
best_address += (neighbors[best_site].row) * in_what_stride +
neighbors[best_site].col;
}
}
- this_mv.as_mv.row = ref_mv->as_mv.row * 8;
- this_mv.as_mv.col = ref_mv->as_mv.col * 8;
-
- if (bestsad < INT_MAX)
- return fn_ptr->vf(what, what_stride, best_address, in_what_stride,
- (unsigned int *)(&thissad)) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
- else
- return INT_MAX;
+ return bestsad;
}
-/* This function is called when we do joint motion search in comp_inter_inter
- * mode.
- */
-int vp9_refining_search_8p_c(MACROBLOCK *x,
- int_mv *ref_mv, int error_per_bit,
- int search_range, vp9_variance_fn_ptr_t *fn_ptr,
- int *mvjcost, int *mvcost[2], int_mv *center_mv,
+// This function is called when we do joint motion search in comp_inter_inter
+// mode.
+int vp9_refining_search_8p_c(const MACROBLOCK *x,
+ MV *ref_mv, int error_per_bit,
+ int search_range,
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ int *mvjcost, int *mvcost[2],
+ const MV *center_mv,
const uint8_t *second_pred, int w, int h) {
- const MACROBLOCKD* const xd = &x->e_mbd;
- MV neighbors[8] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0},
- {-1, -1}, {1, -1}, {-1, 1}, {1, 1}};
+ const MACROBLOCKD *const xd = &x->e_mbd;
+ const MV neighbors[8] = {{-1, 0}, {0, -1}, {0, 1}, {1, 0},
+ {-1, -1}, {1, -1}, {-1, 1}, {1, 1}};
int i, j;
- int this_row_offset, this_col_offset;
- int what_stride = x->plane[0].src.stride;
- int in_what_stride = xd->plane[0].pre[0].stride;
- uint8_t *what = x->plane[0].src.buf;
- uint8_t *best_address = xd->plane[0].pre[0].buf +
- (ref_mv->as_mv.row * xd->plane[0].pre[0].stride) +
- ref_mv->as_mv.col;
- uint8_t *check_here;
+ const uint8_t *what = x->plane[0].src.buf;
+ const int what_stride = x->plane[0].src.stride;
+ const uint8_t *in_what = xd->plane[0].pre[0].buf;
+ const int in_what_stride = xd->plane[0].pre[0].stride;
+ const uint8_t *best_address = &in_what[ref_mv->row * in_what_stride +
+ ref_mv->col];
unsigned int thissad;
- int_mv this_mv;
- unsigned int bestsad = INT_MAX;
- int_mv fcenter_mv;
+ MV this_mv;
+ const MV fcenter_mv = {center_mv->row >> 3, center_mv->col >> 3};
- int *mvjsadcost = x->nmvjointsadcost;
+ const int *mvjsadcost = x->nmvjointsadcost;
int *mvsadcost[2] = {x->nmvsadcost[0], x->nmvsadcost[1]};
- fcenter_mv.as_mv.row = center_mv->as_mv.row >> 3;
- fcenter_mv.as_mv.col = center_mv->as_mv.col >> 3;
-
/* Get compound pred by averaging two pred blocks. */
- bestsad = fn_ptr->sdaf(what, what_stride, best_address, in_what_stride,
- second_pred, 0x7fffffff) +
- mvsad_err_cost(&ref_mv->as_mv, &fcenter_mv.as_mv,
- mvjsadcost, mvsadcost, error_per_bit);
+ unsigned int bestsad = fn_ptr->sdaf(what, what_stride,
+ best_address, in_what_stride,
+ second_pred, 0x7fffffff) +
+ mvsad_err_cost(ref_mv, &fcenter_mv, mvjsadcost, mvsadcost, error_per_bit);
- for (i = 0; i < search_range; i++) {
+ for (i = 0; i < search_range; ++i) {
int best_site = -1;
for (j = 0; j < 8; j++) {
- this_row_offset = ref_mv->as_mv.row + neighbors[j].row;
- this_col_offset = ref_mv->as_mv.col + neighbors[j].col;
+ this_mv.row = ref_mv->row + neighbors[j].row;
+ this_mv.col = ref_mv->col + neighbors[j].col;
- if ((this_col_offset > x->mv_col_min) &&
- (this_col_offset < x->mv_col_max) &&
- (this_row_offset > x->mv_row_min) &&
- (this_row_offset < x->mv_row_max)) {
- check_here = (neighbors[j].row) * in_what_stride + neighbors[j].col +
- best_address;
+ if (is_mv_in(x, &this_mv)) {
+ const uint8_t *check_here = &in_what[this_mv.row * in_what_stride +
+ this_mv.col];
- /* Get compound block and use it to calculate SAD. */
thissad = fn_ptr->sdaf(what, what_stride, check_here, in_what_stride,
second_pred, bestsad);
-
if (thissad < bestsad) {
- this_mv.as_mv.row = this_row_offset;
- this_mv.as_mv.col = this_col_offset;
- thissad += mvsad_err_cost(&this_mv.as_mv, &fcenter_mv.as_mv,
+ thissad += mvsad_err_cost(&this_mv, &fcenter_mv,
mvjsadcost, mvsadcost, error_per_bit);
if (thissad < bestsad) {
bestsad = thissad;
@@ -2087,24 +1791,9 @@ int vp9_refining_search_8p_c(MACROBLOCK *x,
if (best_site == -1) {
break;
} else {
- ref_mv->as_mv.row += neighbors[best_site].row;
- ref_mv->as_mv.col += neighbors[best_site].col;
- best_address += (neighbors[best_site].row) * in_what_stride +
- neighbors[best_site].col;
+ ref_mv->row += neighbors[best_site].row;
+ ref_mv->col += neighbors[best_site].col;
}
}
-
- this_mv.as_mv.row = ref_mv->as_mv.row * 8;
- this_mv.as_mv.col = ref_mv->as_mv.col * 8;
-
- if (bestsad < INT_MAX) {
- // FIXME(rbultje, yunqing): add full-pixel averaging variance functions
- // so we don't have to use the subpixel with xoff=0,yoff=0 here.
- return fn_ptr->svaf(best_address, in_what_stride, 0, 0, what, what_stride,
- (unsigned int *)(&thissad), second_pred) +
- mv_err_cost(&this_mv.as_mv, &center_mv->as_mv,
- mvjcost, mvcost, x->errorperbit);
- } else {
- return INT_MAX;
- }
+ return bestsad;
}
diff --git a/libvpx/vp9/encoder/vp9_mcomp.h b/libvpx/vp9/encoder/vp9_mcomp.h
index bcab679..917de75 100644
--- a/libvpx/vp9/encoder/vp9_mcomp.h
+++ b/libvpx/vp9/encoder/vp9_mcomp.h
@@ -15,11 +15,16 @@
#include "vp9/encoder/vp9_block.h"
#include "vp9/encoder/vp9_variance.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// The maximum number of steps in a step search given the largest
// allowed initial step
#define MAX_MVSEARCH_STEPS 11
-// Max full pel mv specified in 1 pel units
-#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS)) - 1)
+// Max full pel mv specified in the unit of full pixel
+// Enable the use of motion vector in range [-1023, 1023].
+#define MAX_FULL_PEL_VAL ((1 << (MAX_MVSEARCH_STEPS - 1)) - 1)
// Maximum size of the first step in full pel units
#define MAX_FIRST_STEP (1 << (MAX_MVSEARCH_STEPS-1))
// Allowed motion vector pixel distance outside image border
@@ -27,9 +32,21 @@
#define BORDER_MV_PIXELS_B16 (16 + VP9_INTERP_EXTEND)
-void vp9_clamp_mv_min_max(MACROBLOCK *x, MV *mv);
+void vp9_set_mv_search_range(MACROBLOCK *x, const MV *mv);
int vp9_mv_bit_cost(const MV *mv, const MV *ref,
const int *mvjcost, int *mvcost[2], int weight);
+
+// Utility to compute variance + MV rate cost for a given MV
+int vp9_get_mvpred_var(const MACROBLOCK *x,
+ const MV *best_mv, const MV *center_mv,
+ const vp9_variance_fn_ptr_t *vfp,
+ int use_mvcost);
+int vp9_get_mvpred_av_var(const MACROBLOCK *x,
+ MV *best_mv,
+ const MV *center_mv,
+ const uint8_t *second_pred,
+ const vp9_variance_fn_ptr_t *vfp,
+ int use_mvcost);
void vp9_init_dsmotion_compensation(MACROBLOCK *x, int stride);
void vp9_init3smotion_compensation(MACROBLOCK *x, int stride);
@@ -37,42 +54,31 @@ struct VP9_COMP;
int vp9_init_search_range(struct VP9_COMP *cpi, int size);
// Runs sequence of diamond searches in smaller steps for RD
-int vp9_full_pixel_diamond(struct VP9_COMP *cpi, MACROBLOCK *x,
- int_mv *mvp_full, int step_param,
+int vp9_full_pixel_diamond(const struct VP9_COMP *cpi, MACROBLOCK *x,
+ MV *mvp_full, int step_param,
int sadpb, int further_steps, int do_refine,
- vp9_variance_fn_ptr_t *fn_ptr,
- int_mv *ref_mv, int_mv *dst_mv);
-
-int vp9_hex_search(MACROBLOCK *x,
- MV *ref_mv,
- int search_param,
- int error_per_bit,
- int do_init_search,
- const vp9_variance_fn_ptr_t *vf,
- int use_mvcost,
- const MV *center_mv,
- MV *best_mv);
-int vp9_bigdia_search(MACROBLOCK *x,
- MV *ref_mv,
- int search_param,
- int error_per_bit,
- int do_init_search,
- const vp9_variance_fn_ptr_t *vf,
- int use_mvcost,
- const MV *center_mv,
- MV *best_mv);
-int vp9_square_search(MACROBLOCK *x,
- MV *ref_mv,
- int search_param,
- int error_per_bit,
- int do_init_search,
- const vp9_variance_fn_ptr_t *vf,
- int use_mvcost,
- const MV *center_mv,
- MV *best_mv);
+ const vp9_variance_fn_ptr_t *fn_ptr,
+ const MV *ref_mv, MV *dst_mv);
+
+typedef int (integer_mv_pattern_search_fn) (
+ const MACROBLOCK *x,
+ MV *ref_mv,
+ int search_param,
+ int error_per_bit,
+ int do_init_search,
+ const vp9_variance_fn_ptr_t *vf,
+ int use_mvcost,
+ const MV *center_mv,
+ MV *best_mv);
+
+integer_mv_pattern_search_fn vp9_hex_search;
+integer_mv_pattern_search_fn vp9_bigdia_search;
+integer_mv_pattern_search_fn vp9_square_search;
+integer_mv_pattern_search_fn vp9_fast_hex_search;
+integer_mv_pattern_search_fn vp9_fast_dia_search;
typedef int (fractional_mv_step_fp) (
- MACROBLOCK *x,
+ const MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
@@ -83,11 +89,11 @@ typedef int (fractional_mv_step_fp) (
int *mvcost[2],
int *distortion,
unsigned int *sse);
-extern fractional_mv_step_fp vp9_find_best_sub_pixel_iterative;
+
extern fractional_mv_step_fp vp9_find_best_sub_pixel_tree;
typedef int (fractional_mv_step_comp_fp) (
- MACROBLOCK *x,
+ const MACROBLOCK *x,
MV *bestmv, const MV *ref_mv,
int allow_hp,
int error_per_bit,
@@ -98,34 +104,40 @@ typedef int (fractional_mv_step_comp_fp) (
int *distortion, unsigned int *sse1,
const uint8_t *second_pred,
int w, int h);
-extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_iterative;
+
extern fractional_mv_step_comp_fp vp9_find_best_sub_pixel_comp_tree;
-typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x,
- int_mv *ref_mv, int sad_per_bit,
- int distance, vp9_variance_fn_ptr_t *fn_ptr,
+typedef int (*vp9_full_search_fn_t)(const MACROBLOCK *x,
+ const MV *ref_mv, int sad_per_bit,
+ int distance,
+ const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- int_mv *center_mv, int n);
+ const MV *center_mv, MV *best_mv);
-typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x,
- int_mv *ref_mv, int sad_per_bit,
+typedef int (*vp9_refining_search_fn_t)(const MACROBLOCK *x,
+ MV *ref_mv, int sad_per_bit,
int distance,
- vp9_variance_fn_ptr_t *fn_ptr,
+ const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- int_mv *center_mv);
+ const MV *center_mv);
-typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x,
- int_mv *ref_mv, int_mv *best_mv,
+typedef int (*vp9_diamond_search_fn_t)(const MACROBLOCK *x,
+ MV *ref_mv, MV *best_mv,
int search_param, int sad_per_bit,
int *num00,
- vp9_variance_fn_ptr_t *fn_ptr,
+ const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- int_mv *center_mv);
+ const MV *center_mv);
-int vp9_refining_search_8p_c(MACROBLOCK *x,
- int_mv *ref_mv, int error_per_bit,
- int search_range, vp9_variance_fn_ptr_t *fn_ptr,
+int vp9_refining_search_8p_c(const MACROBLOCK *x,
+ MV *ref_mv, int error_per_bit,
+ int search_range,
+ const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- int_mv *center_mv, const uint8_t *second_pred,
+ const MV *center_mv, const uint8_t *second_pred,
int w, int h);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_MCOMP_H_
diff --git a/libvpx/vp9/encoder/vp9_modecosts.c b/libvpx/vp9/encoder/vp9_modecosts.c
deleted file mode 100644
index 7eb6592..0000000
--- a/libvpx/vp9/encoder/vp9_modecosts.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include "vp9/common/vp9_blockd.h"
-#include "vp9/encoder/vp9_onyx_int.h"
-#include "vp9/encoder/vp9_treewriter.h"
-#include "vp9/common/vp9_entropymode.h"
-
-
-void vp9_init_mode_costs(VP9_COMP *c) {
- VP9_COMMON *const cm = &c->common;
- const vp9_tree_index *KT = vp9_intra_mode_tree;
- int i, j;
-
- for (i = 0; i < INTRA_MODES; i++) {
- for (j = 0; j < INTRA_MODES; j++) {
- vp9_cost_tokens((int *)c->mb.y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j],
- KT);
- }
- }
-
- // TODO(rbultje) separate tables for superblock costing?
- vp9_cost_tokens(c->mb.mbmode_cost, cm->fc.y_mode_prob[1],
- vp9_intra_mode_tree);
- vp9_cost_tokens(c->mb.intra_uv_mode_cost[1],
- cm->fc.uv_mode_prob[INTRA_MODES - 1], vp9_intra_mode_tree);
- vp9_cost_tokens(c->mb.intra_uv_mode_cost[0],
- vp9_kf_uv_mode_prob[INTRA_MODES - 1],
- vp9_intra_mode_tree);
-
- for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
- vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i],
- cm->fc.switchable_interp_prob[i],
- vp9_switchable_interp_tree);
-}
diff --git a/libvpx/vp9/encoder/vp9_modecosts.h b/libvpx/vp9/encoder/vp9_modecosts.h
deleted file mode 100644
index f43033e..0000000
--- a/libvpx/vp9/encoder/vp9_modecosts.h
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef VP9_ENCODER_VP9_MODECOSTS_H_
-#define VP9_ENCODER_VP9_MODECOSTS_H_
-
-void vp9_init_mode_costs(VP9_COMP *x);
-
-#endif // VP9_ENCODER_VP9_MODECOSTS_H_
diff --git a/libvpx/vp9/encoder/vp9_onyx_if.c b/libvpx/vp9/encoder/vp9_onyx_if.c
index dd4705d..cccc1a9 100644
--- a/libvpx/vp9/encoder/vp9_onyx_if.c
+++ b/libvpx/vp9/encoder/vp9_onyx_if.c
@@ -14,6 +14,8 @@
#include "./vpx_config.h"
#include "./vpx_scale_rtcd.h"
+#include "vpx/internal/vpx_psnr.h"
+#include "vpx_ports/vpx_timer.h"
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_filter.h"
@@ -24,23 +26,30 @@
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_systemdependent.h"
#include "vp9/common/vp9_tile_common.h"
+
+#include "vp9/encoder/vp9_bitstream.h"
+#include "vp9/encoder/vp9_craq.h"
+#include "vp9/encoder/vp9_encodeframe.h"
+#include "vp9/encoder/vp9_encodemv.h"
#include "vp9/encoder/vp9_firstpass.h"
#include "vp9/encoder/vp9_mbgraph.h"
#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/encoder/vp9_picklpf.h"
-#include "vp9/encoder/vp9_psnr.h"
#include "vp9/encoder/vp9_ratectrl.h"
#include "vp9/encoder/vp9_rdopt.h"
#include "vp9/encoder/vp9_segmentation.h"
#include "vp9/encoder/vp9_temporal_filter.h"
#include "vp9/encoder/vp9_vaq.h"
+#include "vp9/encoder/vp9_resize.h"
+#include "vp9/encoder/vp9_svc_layercontext.h"
-#include "vpx_ports/vpx_timer.h"
-
+#define ALL_INTRA_MODES 0x3FF
+#define INTRA_DC_ONLY 0x01
+#define INTRA_DC_TM ((1 << TM_PRED) | (1 << DC_PRED))
+#define INTRA_DC_H_V ((1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED))
+#define INTRA_DC_TM_H_V (INTRA_DC_TM | (1 << V_PRED) | (1 << H_PRED))
-extern void print_tree_update_probs();
-
-static void set_default_lf_deltas(struct loopfilter *lf);
+void vp9_coef_tree_initialize();
#define DEFAULT_INTERP_FILTER SWITCHABLE
@@ -59,6 +68,11 @@ static void set_default_lf_deltas(struct loopfilter *lf);
#define DISABLE_COMPOUND_SPLIT 0x18
#define LAST_AND_INTRA_SPLIT_ONLY 0x1E
+// Max rate target for 1080P and below encodes under normal circumstances
+// (1920 * 1080 / (16 * 16)) * MAX_MB_RATE bits per MB
+#define MAX_MB_RATE 250
+#define MAXRATE_1080P 2025000
+
#if CONFIG_INTERNAL_STATS
extern double vp9_calc_ssim(YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *dest, int lumamask,
@@ -87,41 +101,12 @@ FILE *kf_list;
FILE *keyfile;
#endif
+void vp9_init_quantizer(VP9_COMP *cpi);
-#ifdef ENTROPY_STATS
-extern int intra_mode_stats[INTRA_MODES]
- [INTRA_MODES]
- [INTRA_MODES];
-#endif
-
-#ifdef MODE_STATS
-extern void init_tx_count_stats();
-extern void write_tx_count_stats();
-extern void init_switchable_interp_stats();
-extern void write_switchable_interp_stats();
-#endif
-
-#ifdef SPEEDSTATS
-unsigned int frames_at_speed[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0};
-#endif
-
-#if defined(SECTIONBITS_OUTPUT)
-extern unsigned __int64 Sectionbits[500];
-#endif
-
-extern void vp9_init_quantizer(VP9_COMP *cpi);
+static const double in_frame_q_adj_ratio[MAX_SEGMENTS] =
+ {1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0};
-// Tables relating active max Q to active min Q
-static int kf_low_motion_minq[QINDEX_RANGE];
-static int kf_high_motion_minq[QINDEX_RANGE];
-static int gf_low_motion_minq[QINDEX_RANGE];
-static int gf_high_motion_minq[QINDEX_RANGE];
-static int inter_minq[QINDEX_RANGE];
-static int afq_low_motion_minq[QINDEX_RANGE];
-static int afq_high_motion_minq[QINDEX_RANGE];
-
-static INLINE void Scale2Ratio(int mode, int *hr, int *hs) {
+static INLINE void Scale2Ratio(VPX_SCALING mode, int *hr, int *hs) {
switch (mode) {
case NORMAL:
*hr = 1;
@@ -147,98 +132,9 @@ static INLINE void Scale2Ratio(int mode, int *hr, int *hs) {
}
}
-// Functions to compute the active minq lookup table entries based on a
-// formulaic approach to facilitate easier adjustment of the Q tables.
-// The formulae were derived from computing a 3rd order polynomial best
-// fit to the original data (after plotting real maxq vs minq (not q index))
-static int calculate_minq_index(double maxq,
- double x3, double x2, double x1, double c) {
- int i;
- const double minqtarget = MIN(((x3 * maxq + x2) * maxq + x1) * maxq + c,
- maxq);
-
- // Special case handling to deal with the step from q2.0
- // down to lossless mode represented by q 1.0.
- if (minqtarget <= 2.0)
- return 0;
-
- for (i = 0; i < QINDEX_RANGE; i++) {
- if (minqtarget <= vp9_convert_qindex_to_q(i))
- return i;
- }
-
- return QINDEX_RANGE - 1;
-}
-
-static void init_minq_luts(void) {
- int i;
-
- for (i = 0; i < QINDEX_RANGE; i++) {
- const double maxq = vp9_convert_qindex_to_q(i);
-
-
- kf_low_motion_minq[i] = calculate_minq_index(maxq,
- 0.000001,
- -0.0004,
- 0.15,
- 0.0);
- kf_high_motion_minq[i] = calculate_minq_index(maxq,
- 0.000002,
- -0.0012,
- 0.5,
- 0.0);
-
- gf_low_motion_minq[i] = calculate_minq_index(maxq,
- 0.0000015,
- -0.0009,
- 0.32,
- 0.0);
- gf_high_motion_minq[i] = calculate_minq_index(maxq,
- 0.0000021,
- -0.00125,
- 0.50,
- 0.0);
- inter_minq[i] = calculate_minq_index(maxq,
- 0.00000271,
- -0.00113,
- 0.75,
- 0.0);
- afq_low_motion_minq[i] = calculate_minq_index(maxq,
- 0.0000015,
- -0.0009,
- 0.33,
- 0.0);
- afq_high_motion_minq[i] = calculate_minq_index(maxq,
- 0.0000021,
- -0.00125,
- 0.55,
- 0.0);
- }
-}
-
-static int get_active_quality(int q,
- int gfu_boost,
- int low,
- int high,
- int *low_motion_minq,
- int *high_motion_minq) {
- int active_best_quality;
- if (gfu_boost > high) {
- active_best_quality = low_motion_minq[q];
- } else if (gfu_boost < low) {
- active_best_quality = high_motion_minq[q];
- } else {
- const int gap = high - low;
- const int offset = high - gfu_boost;
- const int qdiff = high_motion_minq[q] - low_motion_minq[q];
- const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap;
- active_best_quality = low_motion_minq[q] + adjustment;
- }
- return active_best_quality;
-}
-
-static void set_mvcost(VP9_COMP *cpi) {
+static void set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) {
MACROBLOCK *const mb = &cpi->mb;
+ cpi->common.allow_high_precision_mv = allow_high_precision_mv;
if (cpi->common.allow_high_precision_mv) {
mb->mvcost = mb->nmvcost_hp;
mb->mvsadcost = mb->nmvsadcost_hp;
@@ -253,51 +149,37 @@ void vp9_initialize_enc() {
if (!init_done) {
vp9_initialize_common();
+ vp9_coef_tree_initialize();
vp9_tokenize_initialize();
vp9_init_quant_tables();
vp9_init_me_luts();
- init_minq_luts();
+ vp9_rc_init_minq_luts();
// init_base_skip_probs();
+ vp9_entropy_mv_init();
+ vp9_entropy_mode_init();
init_done = 1;
}
}
-static void setup_features(VP9_COMMON *cm) {
- struct loopfilter *const lf = &cm->lf;
- struct segmentation *const seg = &cm->seg;
-
- // Set up default state for MB feature flags
- seg->enabled = 0;
-
- seg->update_map = 0;
- seg->update_data = 0;
- vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs));
-
- vp9_clearall_segfeatures(seg);
-
- lf->mode_ref_delta_enabled = 0;
- lf->mode_ref_delta_update = 0;
- vp9_zero(lf->ref_deltas);
- vp9_zero(lf->mode_deltas);
- vp9_zero(lf->last_ref_deltas);
- vp9_zero(lf->last_mode_deltas);
-
- set_default_lf_deltas(lf);
-}
-
static void dealloc_compressor_data(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+
// Delete sementation map
vpx_free(cpi->segmentation_map);
- cpi->segmentation_map = 0;
- vpx_free(cpi->common.last_frame_seg_map);
- cpi->common.last_frame_seg_map = 0;
+ cpi->segmentation_map = NULL;
+ vpx_free(cm->last_frame_seg_map);
+ cm->last_frame_seg_map = NULL;
vpx_free(cpi->coding_context.last_frame_seg_map_copy);
- cpi->coding_context.last_frame_seg_map_copy = 0;
+ cpi->coding_context.last_frame_seg_map_copy = NULL;
+ vpx_free(cpi->complexity_map);
+ cpi->complexity_map = 0;
+ vpx_free(cpi->cyclic_refresh.map);
+ cpi->cyclic_refresh.map = 0;
vpx_free(cpi->active_map);
cpi->active_map = 0;
- vp9_free_frame_buffers(&cpi->common);
+ vp9_free_frame_buffers(cm);
vp9_free_frame_buffer(&cpi->last_frame_uf);
vp9_free_frame_buffer(&cpi->scaled_source);
@@ -321,22 +203,22 @@ static void dealloc_compressor_data(VP9_COMP *cpi) {
}
// Computes a q delta (in "q index" terms) to get from a starting q value
-// to a target value
-// target q value
-int vp9_compute_qdelta(VP9_COMP *cpi, double qstart, double qtarget) {
+// to a target q value
+int vp9_compute_qdelta(const VP9_COMP *cpi, double qstart, double qtarget) {
+ const RATE_CONTROL *const rc = &cpi->rc;
+ int start_index = rc->worst_quality;
+ int target_index = rc->worst_quality;
int i;
- int start_index = cpi->worst_quality;
- int target_index = cpi->worst_quality;
// Convert the average q value to an index.
- for (i = cpi->best_quality; i < cpi->worst_quality; i++) {
+ for (i = rc->best_quality; i < rc->worst_quality; ++i) {
start_index = i;
if (vp9_convert_qindex_to_q(i) >= qstart)
break;
}
// Convert the q target to an index
- for (i = cpi->best_quality; i < cpi->worst_quality; i++) {
+ for (i = rc->best_quality; i < rc->worst_quality; ++i) {
target_index = i;
if (vp9_convert_qindex_to_q(i) >= qtarget)
break;
@@ -345,11 +227,77 @@ int vp9_compute_qdelta(VP9_COMP *cpi, double qstart, double qtarget) {
return target_index - start_index;
}
+// Computes a q delta (in "q index" terms) to get from a starting q value
+// to a value that should equate to the given rate ratio.
+int vp9_compute_qdelta_by_rate(VP9_COMP *cpi, int base_q_index,
+ double rate_target_ratio) {
+ int i;
+ int target_index = cpi->rc.worst_quality;
+
+ // Look up the current projected bits per block for the base index
+ const int base_bits_per_mb = vp9_rc_bits_per_mb(cpi->common.frame_type,
+ base_q_index, 1.0);
+
+ // Find the target bits per mb based on the base value and given ratio.
+ const int target_bits_per_mb = (int)(rate_target_ratio * base_bits_per_mb);
+
+ // Convert the q target to an index
+ for (i = cpi->rc.best_quality; i < cpi->rc.worst_quality; ++i) {
+ target_index = i;
+ if (vp9_rc_bits_per_mb(cpi->common.frame_type, i, 1.0) <=
+ target_bits_per_mb )
+ break;
+ }
+
+ return target_index - base_q_index;
+}
+
+// This function sets up a set of segments with delta Q values around
+// the baseline frame quantizer.
+static void setup_in_frame_q_adj(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ struct segmentation *const seg = &cm->seg;
+
+ // Make SURE use of floating point in this function is safe.
+ vp9_clear_system_state();
+
+ if (cm->frame_type == KEY_FRAME ||
+ cpi->refresh_alt_ref_frame ||
+ (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
+ int segment;
+
+ // Clear down the segment map
+ vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
+
+ // Clear down the complexity map used for rd
+ vpx_memset(cpi->complexity_map, 0, cm->mi_rows * cm->mi_cols);
+
+ vp9_enable_segmentation(seg);
+ vp9_clearall_segfeatures(seg);
+
+ // Select delta coding method
+ seg->abs_delta = SEGMENT_DELTADATA;
+
+ // Segment 0 "Q" feature is disabled so it defaults to the baseline Q
+ vp9_disable_segfeature(seg, 0, SEG_LVL_ALT_Q);
+
+ // Use some of the segments for in frame Q adjustment
+ for (segment = 1; segment < 2; segment++) {
+ const int qindex_delta =
+ vp9_compute_qdelta_by_rate(cpi,
+ cm->base_qindex,
+ in_frame_q_adj_ratio[segment]);
+ vp9_enable_segfeature(seg, segment, SEG_LVL_ALT_Q);
+ vp9_set_segdata(seg, segment, SEG_LVL_ALT_Q, qindex_delta);
+ }
+ }
+}
static void configure_static_seg_features(VP9_COMP *cpi) {
- VP9_COMMON *cm = &cpi->common;
- struct segmentation *seg = &cm->seg;
+ VP9_COMMON *const cm = &cpi->common;
+ const RATE_CONTROL *const rc = &cpi->rc;
+ struct segmentation *const seg = &cm->seg;
- int high_q = (int)(cpi->avg_q > 48.0);
+ int high_q = (int)(rc->avg_q > 48.0);
int qi_delta;
// Disable and clear down for KF
@@ -361,7 +309,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
cpi->static_mb_pct = 0;
// Disable segmentation
- vp9_disable_segmentation((VP9_PTR)cpi);
+ vp9_disable_segmentation(seg);
// Clear down the segment features.
vp9_clearall_segfeatures(seg);
@@ -374,7 +322,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
cpi->static_mb_pct = 0;
// Disable segmentation and individual segment features by default
- vp9_disable_segmentation((VP9_PTR)cpi);
+ vp9_disable_segmentation(seg);
vp9_clearall_segfeatures(seg);
// Scan frames from current to arf frame.
@@ -387,8 +335,8 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
seg->update_map = 1;
seg->update_data = 1;
- qi_delta = vp9_compute_qdelta(cpi, cpi->avg_q, (cpi->avg_q * 0.875));
- vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, (qi_delta - 2));
+ qi_delta = vp9_compute_qdelta(cpi, rc->avg_q, rc->avg_q * 0.875);
+ vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, qi_delta - 2);
vp9_set_segdata(seg, 1, SEG_LVL_ALT_LF, -2);
vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_Q);
@@ -401,16 +349,15 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
// All other frames if segmentation has been enabled
// First normal frame in a valid gf or alt ref group
- if (cpi->frames_since_golden == 0) {
+ if (rc->frames_since_golden == 0) {
// Set up segment features for normal frames in an arf group
- if (cpi->source_alt_ref_active) {
+ if (rc->source_alt_ref_active) {
seg->update_map = 0;
seg->update_data = 1;
seg->abs_delta = SEGMENT_DELTADATA;
- qi_delta = vp9_compute_qdelta(cpi, cpi->avg_q,
- (cpi->avg_q * 1.125));
- vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, (qi_delta + 2));
+ qi_delta = vp9_compute_qdelta(cpi, rc->avg_q, rc->avg_q * 1.125);
+ vp9_set_segdata(seg, 1, SEG_LVL_ALT_Q, qi_delta + 2);
vp9_enable_segfeature(seg, 1, SEG_LVL_ALT_Q);
vp9_set_segdata(seg, 1, SEG_LVL_ALT_LF, -2);
@@ -426,7 +373,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
// Disable segmentation and clear down features if alt ref
// is not active for this group
- vp9_disable_segmentation((VP9_PTR)cpi);
+ vp9_disable_segmentation(seg);
vpx_memset(cpi->segmentation_map, 0, cm->mi_rows * cm->mi_cols);
@@ -435,7 +382,7 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
vp9_clearall_segfeatures(seg);
}
- } else if (cpi->is_src_frame_alt_ref) {
+ } else if (rc->is_src_frame_alt_ref) {
// Special case where we are coding over the top of a previous
// alt ref frame.
// Segment coding disabled for compred testing
@@ -467,69 +414,6 @@ static void configure_static_seg_features(VP9_COMP *cpi) {
}
}
-#ifdef ENTROPY_STATS
-void vp9_update_mode_context_stats(VP9_COMP *cpi) {
- VP9_COMMON *cm = &cpi->common;
- int i, j;
- unsigned int (*inter_mode_counts)[INTER_MODES - 1][2] =
- cm->fc.inter_mode_counts;
- int64_t (*mv_ref_stats)[INTER_MODES - 1][2] = cpi->mv_ref_stats;
- FILE *f;
-
- // Read the past stats counters
- f = fopen("mode_context.bin", "rb");
- if (!f) {
- vpx_memset(cpi->mv_ref_stats, 0, sizeof(cpi->mv_ref_stats));
- } else {
- fread(cpi->mv_ref_stats, sizeof(cpi->mv_ref_stats), 1, f);
- fclose(f);
- }
-
- // Add in the values for this frame
- for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
- for (j = 0; j < INTER_MODES - 1; j++) {
- mv_ref_stats[i][j][0] += (int64_t)inter_mode_counts[i][j][0];
- mv_ref_stats[i][j][1] += (int64_t)inter_mode_counts[i][j][1];
- }
- }
-
- // Write back the accumulated stats
- f = fopen("mode_context.bin", "wb");
- fwrite(cpi->mv_ref_stats, sizeof(cpi->mv_ref_stats), 1, f);
- fclose(f);
-}
-
-void print_mode_context(VP9_COMP *cpi) {
- FILE *f = fopen("vp9_modecont.c", "a");
- int i, j;
-
- fprintf(f, "#include \"vp9_entropy.h\"\n");
- fprintf(
- f,
- "const int inter_mode_probs[INTER_MODE_CONTEXTS][INTER_MODES - 1] =");
- fprintf(f, "{\n");
- for (j = 0; j < INTER_MODE_CONTEXTS; j++) {
- fprintf(f, " {/* %d */ ", j);
- fprintf(f, " ");
- for (i = 0; i < INTER_MODES - 1; i++) {
- int this_prob;
- int64_t count = cpi->mv_ref_stats[j][i][0] + cpi->mv_ref_stats[j][i][1];
- if (count)
- this_prob = ((cpi->mv_ref_stats[j][i][0] * 256) + (count >> 1)) / count;
- else
- this_prob = 128;
-
- // context probs
- fprintf(f, "%5d, ", this_prob);
- }
- fprintf(f, " },\n");
- }
-
- fprintf(f, "};\n");
- fclose(f);
-}
-#endif // ENTROPY_STATS
-
// DEBUG: Print out the segment id of each MB in the current frame.
static void print_seg_map(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
@@ -553,44 +437,30 @@ static void print_seg_map(VP9_COMP *cpi) {
static void update_reference_segmentation_map(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
+ MODE_INFO **mi_8x8_ptr = cm->mi_grid_visible;
+ uint8_t *cache_ptr = cm->last_frame_seg_map;
int row, col;
- MODE_INFO **mi_8x8, **mi_8x8_ptr = cm->mi_grid_visible;
- uint8_t *cache_ptr = cm->last_frame_seg_map, *cache;
for (row = 0; row < cm->mi_rows; row++) {
- mi_8x8 = mi_8x8_ptr;
- cache = cache_ptr;
+ MODE_INFO **mi_8x8 = mi_8x8_ptr;
+ uint8_t *cache = cache_ptr;
for (col = 0; col < cm->mi_cols; col++, mi_8x8++, cache++)
cache[0] = mi_8x8[0]->mbmi.segment_id;
mi_8x8_ptr += cm->mode_info_stride;
cache_ptr += cm->mi_cols;
}
}
-
-static void set_default_lf_deltas(struct loopfilter *lf) {
- lf->mode_ref_delta_enabled = 1;
- lf->mode_ref_delta_update = 1;
-
- vp9_zero(lf->ref_deltas);
- vp9_zero(lf->mode_deltas);
-
- // Test of ref frame deltas
- lf->ref_deltas[INTRA_FRAME] = 2;
- lf->ref_deltas[LAST_FRAME] = 0;
- lf->ref_deltas[GOLDEN_FRAME] = -2;
- lf->ref_deltas[ALTREF_FRAME] = -2;
-
- lf->mode_deltas[0] = 0; // Zero
- lf->mode_deltas[1] = 0; // New mv
+static int is_slowest_mode(int mode) {
+ return (mode == MODE_SECONDPASS_BEST || mode == MODE_BESTQUALITY);
}
-static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) {
+static void set_rd_speed_thresholds(VP9_COMP *cpi) {
SPEED_FEATURES *sf = &cpi->sf;
int i;
// Set baseline threshold values
for (i = 0; i < MAX_MODES; ++i)
- sf->thresh_mult[i] = mode == 0 ? -500 : 0;
+ sf->thresh_mult[i] = is_slowest_mode(cpi->oxcf.mode) ? -500 : 0;
sf->thresh_mult[THR_NEARESTMV] = 0;
sf->thresh_mult[THR_NEARESTG] = 0;
@@ -666,12 +536,12 @@ static void set_rd_speed_thresholds(VP9_COMP *cpi, int mode) {
}
}
-static void set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi, int mode) {
+static void set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) {
SPEED_FEATURES *sf = &cpi->sf;
int i;
for (i = 0; i < MAX_REFS; ++i)
- sf->thresh_mult_sub8x8[i] = mode == 0 ? -500 : 0;
+ sf->thresh_mult_sub8x8[i] = is_slowest_mode(cpi->oxcf.mode) ? -500 : 0;
sf->thresh_mult_sub8x8[THR_LAST] += 2500;
sf->thresh_mult_sub8x8[THR_GOLD] += 2500;
@@ -701,26 +571,348 @@ static void set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi, int mode) {
sf->thresh_mult_sub8x8[THR_COMP_GA] = INT_MAX;
}
+static void set_good_speed_feature(VP9_COMMON *cm,
+ SPEED_FEATURES *sf,
+ int speed) {
+ int i;
+ sf->adaptive_rd_thresh = 1;
+ sf->recode_loop = ((speed < 1) ? ALLOW_RECODE : ALLOW_RECODE_KFMAXBW);
+ if (speed == 1) {
+ sf->use_square_partition_only = !frame_is_intra_only(cm);
+ sf->less_rectangular_check = 1;
+ sf->tx_size_search_method = frame_is_intra_only(cm)
+ ? USE_FULL_RD : USE_LARGESTALL;
+
+ if (MIN(cm->width, cm->height) >= 720)
+ sf->disable_split_mask = cm->show_frame ?
+ DISABLE_ALL_SPLIT : DISABLE_ALL_INTER_SPLIT;
+ else
+ sf->disable_split_mask = DISABLE_COMPOUND_SPLIT;
+
+ sf->use_rd_breakout = 1;
+ sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_interp_filter = 1;
+ sf->auto_mv_step_size = 1;
+ sf->adaptive_rd_thresh = 2;
+ sf->recode_loop = ALLOW_RECODE_KFARFGF;
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
+ }
+ if (speed == 2) {
+ sf->use_square_partition_only = !frame_is_intra_only(cm);
+ sf->less_rectangular_check = 1;
+ sf->tx_size_search_method = frame_is_intra_only(cm)
+ ? USE_FULL_RD : USE_LARGESTALL;
+
+ if (MIN(cm->width, cm->height) >= 720)
+ sf->disable_split_mask = cm->show_frame ?
+ DISABLE_ALL_SPLIT : DISABLE_ALL_INTER_SPLIT;
+ else
+ sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
+
+ sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
+ FLAG_SKIP_INTRA_BESTINTER |
+ FLAG_SKIP_COMP_BESTINTRA |
+ FLAG_SKIP_INTRA_LOWVAR;
+ sf->use_rd_breakout = 1;
+ sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_interp_filter = 2;
+ sf->reference_masking = 1;
+ sf->auto_mv_step_size = 1;
+
+ sf->disable_filter_search_var_thresh = 50;
+ sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
+
+ sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
+ sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION;
+ sf->adjust_partitioning_from_last_frame = 1;
+ sf->last_partitioning_redo_frequency = 3;
+
+ sf->adaptive_rd_thresh = 2;
+ sf->recode_loop = ALLOW_RECODE_KFARFGF;
+ sf->use_lp32x32fdct = 1;
+ sf->mode_skip_start = 11;
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
+ }
+ if (speed == 3) {
+ sf->use_square_partition_only = 1;
+ sf->tx_size_search_method = USE_LARGESTALL;
+
+ if (MIN(cm->width, cm->height) >= 720)
+ sf->disable_split_mask = DISABLE_ALL_SPLIT;
+ else
+ sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
+
+ sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
+ FLAG_SKIP_INTRA_BESTINTER |
+ FLAG_SKIP_COMP_BESTINTRA |
+ FLAG_SKIP_INTRA_LOWVAR;
+
+ sf->use_rd_breakout = 1;
+ sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_interp_filter = 2;
+ sf->reference_masking = 1;
+ sf->auto_mv_step_size = 1;
+
+ sf->disable_split_var_thresh = 32;
+ sf->disable_filter_search_var_thresh = 100;
+ sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
+
+ sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
+ sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL;
+ sf->adjust_partitioning_from_last_frame = 1;
+ sf->last_partitioning_redo_frequency = 3;
+
+ sf->use_uv_intra_rd_estimate = 1;
+ sf->skip_encode_sb = 1;
+ sf->use_lp32x32fdct = 1;
+ sf->subpel_iters_per_step = 1;
+ sf->use_fast_coef_updates = 2;
+ sf->use_fast_coef_costing = 1;
+
+ sf->adaptive_rd_thresh = 4;
+ sf->mode_skip_start = 6;
+ }
+ if (speed == 4) {
+ sf->use_square_partition_only = 1;
+ sf->tx_size_search_method = USE_LARGESTALL;
+ sf->disable_split_mask = DISABLE_ALL_SPLIT;
+
+ sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
+ FLAG_SKIP_INTRA_BESTINTER |
+ FLAG_SKIP_COMP_BESTINTRA |
+ FLAG_SKIP_COMP_REFMISMATCH |
+ FLAG_SKIP_INTRA_LOWVAR |
+ FLAG_EARLY_TERMINATE;
+
+ sf->use_rd_breakout = 1;
+ sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_interp_filter = 2;
+ sf->reference_masking = 1;
+ sf->auto_mv_step_size = 1;
+
+ sf->disable_split_var_thresh = 64;
+ sf->disable_filter_search_var_thresh = 200;
+ sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
+
+ sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
+ sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL;
+ sf->adjust_partitioning_from_last_frame = 1;
+ sf->last_partitioning_redo_frequency = 3;
+
+ sf->use_uv_intra_rd_estimate = 1;
+ sf->skip_encode_sb = 1;
+ sf->use_lp32x32fdct = 1;
+ sf->subpel_iters_per_step = 1;
+ sf->use_fast_coef_updates = 2;
+ sf->use_fast_coef_costing = 1;
+
+ sf->adaptive_rd_thresh = 4;
+ sf->mode_skip_start = 6;
+ }
+ if (speed >= 5) {
+ sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
+ sf->partition_search_type = FIXED_PARTITION;
+ sf->tx_size_search_method = frame_is_intra_only(cm) ?
+ USE_FULL_RD : USE_LARGESTALL;
+ sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
+ FLAG_SKIP_INTRA_BESTINTER |
+ FLAG_SKIP_COMP_BESTINTRA |
+ FLAG_SKIP_COMP_REFMISMATCH |
+ FLAG_SKIP_INTRA_LOWVAR |
+ FLAG_EARLY_TERMINATE;
+ sf->use_rd_breakout = 1;
+ sf->use_lp32x32fdct = 1;
+ sf->optimize_coefficients = 0;
+ sf->auto_mv_step_size = 1;
+ sf->reference_masking = 1;
+
+ sf->disable_split_mask = DISABLE_ALL_SPLIT;
+ sf->search_method = HEX;
+ sf->subpel_iters_per_step = 1;
+ sf->disable_split_var_thresh = 64;
+ sf->disable_filter_search_var_thresh = 500;
+ for (i = 0; i < TX_SIZES; i++) {
+ sf->intra_y_mode_mask[i] = INTRA_DC_ONLY;
+ sf->intra_uv_mode_mask[i] = INTRA_DC_ONLY;
+ }
+ sf->use_fast_coef_updates = 2;
+ sf->use_fast_coef_costing = 1;
+ sf->adaptive_rd_thresh = 4;
+ sf->mode_skip_start = 6;
+ }
+}
+
+static void set_rt_speed_feature(VP9_COMMON *cm,
+ SPEED_FEATURES *sf,
+ int speed) {
+ sf->static_segmentation = 0;
+ sf->adaptive_rd_thresh = 1;
+ sf->recode_loop = ((speed < 1) ? ALLOW_RECODE : ALLOW_RECODE_KFMAXBW);
+ sf->encode_breakout_thresh = 1;
+ sf->use_fast_coef_costing = 1;
+
+ if (speed == 1) {
+ sf->use_square_partition_only = !frame_is_intra_only(cm);
+ sf->less_rectangular_check = 1;
+ sf->tx_size_search_method =
+ frame_is_intra_only(cm) ? USE_FULL_RD : USE_LARGESTALL;
+
+ if (MIN(cm->width, cm->height) >= 720)
+ sf->disable_split_mask = cm->show_frame ?
+ DISABLE_ALL_SPLIT : DISABLE_ALL_INTER_SPLIT;
+ else
+ sf->disable_split_mask = DISABLE_COMPOUND_SPLIT;
+
+ sf->use_rd_breakout = 1;
+ sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_interp_filter = 1;
+ sf->auto_mv_step_size = 1;
+ sf->adaptive_rd_thresh = 2;
+ sf->recode_loop = ALLOW_RECODE_KFARFGF;
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
+ sf->encode_breakout_thresh = 8;
+ }
+ if (speed >= 2) {
+ sf->use_square_partition_only = !frame_is_intra_only(cm);
+ sf->less_rectangular_check = 1;
+ sf->tx_size_search_method =
+ frame_is_intra_only(cm) ? USE_FULL_RD : USE_LARGESTALL;
+
+ if (MIN(cm->width, cm->height) >= 720)
+ sf->disable_split_mask = cm->show_frame ?
+ DISABLE_ALL_SPLIT : DISABLE_ALL_INTER_SPLIT;
+ else
+ sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
+
+ sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH
+ | FLAG_SKIP_INTRA_BESTINTER | FLAG_SKIP_COMP_BESTINTRA
+ | FLAG_SKIP_INTRA_LOWVAR;
+
+ sf->use_rd_breakout = 1;
+ sf->adaptive_motion_search = 1;
+ sf->adaptive_pred_interp_filter = 2;
+ sf->auto_mv_step_size = 1;
+ sf->reference_masking = 1;
+
+ sf->disable_filter_search_var_thresh = 50;
+ sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
+
+ sf->auto_min_max_partition_size = RELAXED_NEIGHBORING_MIN_MAX;
+ sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION;
+ sf->adjust_partitioning_from_last_frame = 1;
+ sf->last_partitioning_redo_frequency = 3;
+
+ sf->adaptive_rd_thresh = 2;
+ sf->recode_loop = ALLOW_RECODE_KFARFGF;
+ sf->use_lp32x32fdct = 1;
+ sf->mode_skip_start = 11;
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
+ sf->encode_breakout_thresh = 200;
+ }
+ if (speed >= 3) {
+ sf->use_square_partition_only = 1;
+ sf->tx_size_search_method = USE_LARGESTALL;
+
+ if (MIN(cm->width, cm->height) >= 720)
+ sf->disable_split_mask = DISABLE_ALL_SPLIT;
+ else
+ sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
+
+ sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH
+ | FLAG_SKIP_INTRA_BESTINTER | FLAG_SKIP_COMP_BESTINTRA
+ | FLAG_SKIP_INTRA_LOWVAR;
+
+ sf->disable_filter_search_var_thresh = 100;
+ sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL;
+ sf->use_uv_intra_rd_estimate = 1;
+ sf->skip_encode_sb = 1;
+ sf->subpel_iters_per_step = 1;
+ sf->use_fast_coef_updates = 2;
+ sf->adaptive_rd_thresh = 4;
+ sf->mode_skip_start = 6;
+ sf->encode_breakout_thresh = 400;
+ }
+ if (speed >= 4) {
+ sf->optimize_coefficients = 0;
+ sf->disable_split_mask = DISABLE_ALL_SPLIT;
+ sf->use_fast_lpf_pick = 2;
+ sf->encode_breakout_thresh = 700;
+ }
+ if (speed >= 5) {
+ int i;
+ sf->last_partitioning_redo_frequency = 4;
+ sf->adaptive_rd_thresh = 5;
+ sf->use_fast_coef_costing = 0;
+ sf->auto_min_max_partition_size = STRICT_NEIGHBORING_MIN_MAX;
+ sf->adjust_partitioning_from_last_frame =
+ cm->last_frame_type != cm->frame_type || (0 ==
+ (cm->current_video_frame + 1) % sf->last_partitioning_redo_frequency);
+ sf->subpel_force_stop = 1;
+ for (i = 0; i < TX_SIZES; i++) {
+ sf->intra_y_mode_mask[i] = INTRA_DC_H_V;
+ sf->intra_uv_mode_mask[i] = INTRA_DC_ONLY;
+ }
+ sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_ONLY;
+ sf->frame_parameter_update = 0;
+ sf->encode_breakout_thresh = 1000;
+ sf->search_method = FAST_HEX;
+ sf->disable_inter_mode_mask[BLOCK_32X32] = 1 << INTER_OFFSET(ZEROMV);
+ sf->disable_inter_mode_mask[BLOCK_32X64] = ~(1 << INTER_OFFSET(NEARESTMV));
+ sf->disable_inter_mode_mask[BLOCK_64X32] = ~(1 << INTER_OFFSET(NEARESTMV));
+ sf->disable_inter_mode_mask[BLOCK_64X64] = ~(1 << INTER_OFFSET(NEARESTMV));
+ sf->max_intra_bsize = BLOCK_32X32;
+ }
+ if (speed >= 6) {
+ sf->partition_check =
+ (cm->current_video_frame % sf->last_partitioning_redo_frequency == 1);
+ sf->partition_search_type = REFERENCE_PARTITION;
+ sf->use_nonrd_pick_mode = 1;
+ sf->search_method = FAST_DIAMOND;
+ }
+ if (speed >= 7) {
+ sf->partition_search_type = VAR_BASED_FIXED_PARTITION;
+ sf->use_nonrd_pick_mode = 1;
+ sf->search_method = FAST_DIAMOND;
+ }
+ if (speed >= 8) {
+ int i;
+ for (i = 0; i < BLOCK_SIZES; ++i)
+ sf->disable_inter_mode_mask[i] = 14; // only search NEARESTMV (0)
+ }
+}
+
void vp9_set_speed_features(VP9_COMP *cpi) {
SPEED_FEATURES *sf = &cpi->sf;
- int mode = cpi->compressor_speed;
+ VP9_COMMON *cm = &cpi->common;
int speed = cpi->speed;
int i;
- // Only modes 0 and 1 supported for now in experimental code basae
- if (mode > 1)
- mode = 1;
+ // Convert negative speed to positive
+ if (speed < 0)
+ speed = -speed;
+#if CONFIG_INTERNAL_STATS
for (i = 0; i < MAX_MODES; ++i)
cpi->mode_chosen_counts[i] = 0;
+#endif
// best quality defaults
- sf->RD = 1;
+ sf->frame_parameter_update = 1;
sf->search_method = NSTEP;
- sf->auto_filter = 1;
- sf->recode_loop = 1;
+ sf->recode_loop = ALLOW_RECODE;
sf->subpel_search_method = SUBPEL_TREE;
sf->subpel_iters_per_step = 2;
+ sf->subpel_force_stop = 0;
sf->optimize_coefficients = !cpi->oxcf.lossless;
sf->reduce_first_step_size = 0;
sf->auto_mv_step_size = 0;
@@ -731,12 +923,12 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->tx_size_search_method = USE_FULL_RD;
sf->use_lp32x32fdct = 0;
sf->adaptive_motion_search = 0;
- sf->use_avoid_tested_higherror = 0;
+ sf->adaptive_pred_interp_filter = 0;
sf->reference_masking = 0;
- sf->use_one_partition_size_always = 0;
+ sf->partition_search_type = SEARCH_PARTITION;
sf->less_rectangular_check = 0;
sf->use_square_partition_only = 0;
- sf->auto_min_max_partition_size = 0;
+ sf->auto_min_max_partition_size = NOT_IN_USE;
sf->max_partition_size = BLOCK_64X64;
sf->min_partition_size = BLOCK_4X4;
sf->adjust_partitioning_from_last_frame = 0;
@@ -754,205 +946,35 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->use_uv_intra_rd_estimate = 0;
sf->use_fast_lpf_pick = 0;
sf->use_fast_coef_updates = 0;
- sf->using_small_partition_info = 0;
+ sf->use_fast_coef_costing = 0;
sf->mode_skip_start = MAX_MODES; // Mode index at which mode skip mask set
-
-#if CONFIG_MULTIPLE_ARF
- // Switch segmentation off.
- sf->static_segmentation = 0;
-#else
- sf->static_segmentation = 0;
-#endif
-
- sf->variance_adaptive_quantization = 0;
-
- switch (mode) {
- case 0: // This is the best quality mode.
+ sf->use_nonrd_pick_mode = 0;
+ sf->encode_breakout_thresh = 0;
+ for (i = 0; i < BLOCK_SIZES; ++i)
+ sf->disable_inter_mode_mask[i] = 0;
+ sf->max_intra_bsize = BLOCK_64X64;
+ // This setting only takes effect when partition_search_type is set
+ // to FIXED_PARTITION.
+ sf->always_this_block_size = BLOCK_16X16;
+
+ switch (cpi->oxcf.mode) {
+ case MODE_BESTQUALITY:
+ case MODE_SECONDPASS_BEST: // This is the best quality mode.
+ cpi->diamond_search_sad = vp9_full_range_search;
break;
-
- case 1:
-#if CONFIG_MULTIPLE_ARF
- // Switch segmentation off.
- sf->static_segmentation = 0;
-#else
- sf->static_segmentation = 0;
-#endif
- sf->use_avoid_tested_higherror = 1;
- sf->adaptive_rd_thresh = 1;
- sf->recode_loop = (speed < 1);
-
- if (speed == 1) {
- sf->use_square_partition_only = !frame_is_intra_only(&cpi->common);
- sf->less_rectangular_check = 1;
- sf->tx_size_search_method = frame_is_intra_only(&cpi->common)
- ? USE_FULL_RD : USE_LARGESTALL;
-
- if (MIN(cpi->common.width, cpi->common.height) >= 720)
- sf->disable_split_mask = cpi->common.show_frame ?
- DISABLE_ALL_SPLIT : DISABLE_ALL_INTER_SPLIT;
- else
- sf->disable_split_mask = DISABLE_COMPOUND_SPLIT;
-
- sf->use_rd_breakout = 1;
- sf->adaptive_motion_search = 1;
- sf->auto_mv_step_size = 1;
- sf->adaptive_rd_thresh = 2;
- sf->recode_loop = 2;
- sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
- sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
- sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
- }
- if (speed == 2) {
- sf->use_square_partition_only = !frame_is_intra_only(&cpi->common);
- sf->less_rectangular_check = 1;
- sf->tx_size_search_method = frame_is_intra_only(&cpi->common)
- ? USE_FULL_RD : USE_LARGESTALL;
-
- if (MIN(cpi->common.width, cpi->common.height) >= 720)
- sf->disable_split_mask = cpi->common.show_frame ?
- DISABLE_ALL_SPLIT : DISABLE_ALL_INTER_SPLIT;
- else
- sf->disable_split_mask = LAST_AND_INTRA_SPLIT_ONLY;
-
-
- sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
- FLAG_SKIP_INTRA_BESTINTER |
- FLAG_SKIP_COMP_BESTINTRA |
- FLAG_SKIP_INTRA_LOWVAR;
-
- sf->use_rd_breakout = 1;
- sf->adaptive_motion_search = 1;
- sf->auto_mv_step_size = 1;
-
- sf->disable_filter_search_var_thresh = 16;
- sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
-
- sf->auto_min_max_partition_size = 1;
- sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_LOW_MOTION;
- sf->adjust_partitioning_from_last_frame = 1;
- sf->last_partitioning_redo_frequency = 3;
-
- sf->adaptive_rd_thresh = 2;
- sf->recode_loop = 2;
- sf->use_lp32x32fdct = 1;
- sf->mode_skip_start = 11;
- sf->intra_y_mode_mask[TX_32X32] = INTRA_DC_H_V;
- sf->intra_y_mode_mask[TX_16X16] = INTRA_DC_H_V;
- sf->intra_uv_mode_mask[TX_32X32] = INTRA_DC_H_V;
- sf->intra_uv_mode_mask[TX_16X16] = INTRA_DC_H_V;
- }
- if (speed == 3) {
- sf->use_square_partition_only = 1;
- sf->tx_size_search_method = USE_LARGESTALL;
-
- if (MIN(cpi->common.width, cpi->common.height) >= 720)
- sf->disable_split_mask = DISABLE_ALL_SPLIT;
- else
- sf->disable_split_mask = DISABLE_ALL_INTER_SPLIT;
-
- sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
- FLAG_SKIP_INTRA_BESTINTER |
- FLAG_SKIP_COMP_BESTINTRA |
- FLAG_SKIP_INTRA_LOWVAR;
-
- sf->use_rd_breakout = 1;
- sf->adaptive_motion_search = 1;
- sf->auto_mv_step_size = 1;
-
- sf->disable_filter_search_var_thresh = 16;
- sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
-
- sf->auto_min_max_partition_size = 1;
- sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL;
- sf->adjust_partitioning_from_last_frame = 1;
- sf->last_partitioning_redo_frequency = 3;
-
- sf->use_uv_intra_rd_estimate = 1;
- sf->skip_encode_sb = 1;
- sf->use_lp32x32fdct = 1;
- sf->subpel_iters_per_step = 1;
- sf->use_fast_coef_updates = 2;
-
- sf->adaptive_rd_thresh = 4;
- sf->mode_skip_start = 6;
- }
- if (speed == 4) {
- sf->use_square_partition_only = 1;
- sf->tx_size_search_method = USE_LARGESTALL;
- sf->disable_split_mask = DISABLE_ALL_SPLIT;
-
- sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
- FLAG_SKIP_INTRA_BESTINTER |
- FLAG_SKIP_COMP_BESTINTRA |
- FLAG_SKIP_COMP_REFMISMATCH |
- FLAG_SKIP_INTRA_LOWVAR |
- FLAG_EARLY_TERMINATE;
-
- sf->use_rd_breakout = 1;
- sf->adaptive_motion_search = 1;
- sf->auto_mv_step_size = 1;
-
- sf->disable_filter_search_var_thresh = 16;
- sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
-
- sf->auto_min_max_partition_size = 1;
- sf->use_lastframe_partitioning = LAST_FRAME_PARTITION_ALL;
- sf->adjust_partitioning_from_last_frame = 1;
- sf->last_partitioning_redo_frequency = 3;
-
- sf->use_uv_intra_rd_estimate = 1;
- sf->skip_encode_sb = 1;
- sf->use_lp32x32fdct = 1;
- sf->subpel_iters_per_step = 1;
- sf->use_fast_coef_updates = 2;
-
- sf->adaptive_rd_thresh = 4;
- sf->mode_skip_start = 6;
-
- /* sf->intra_y_mode_mask = INTRA_DC_ONLY;
- sf->intra_uv_mode_mask = INTRA_DC_ONLY;
- sf->search_method = BIGDIA;
- sf->disable_split_var_thresh = 64;
- sf->disable_filter_search_var_thresh = 64; */
- }
- if (speed == 5) {
- sf->comp_inter_joint_search_thresh = BLOCK_SIZES;
- sf->use_one_partition_size_always = 1;
- sf->always_this_block_size = BLOCK_16X16;
- sf->tx_size_search_method = frame_is_intra_only(&cpi->common) ?
- USE_FULL_RD : USE_LARGESTALL;
- sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
- FLAG_SKIP_INTRA_BESTINTER |
- FLAG_SKIP_COMP_BESTINTRA |
- FLAG_SKIP_COMP_REFMISMATCH |
- FLAG_SKIP_INTRA_LOWVAR |
- FLAG_EARLY_TERMINATE;
- sf->use_rd_breakout = 1;
- sf->use_lp32x32fdct = 1;
- sf->optimize_coefficients = 0;
- sf->auto_mv_step_size = 1;
- // sf->reduce_first_step_size = 1;
- // sf->reference_masking = 1;
-
- sf->disable_split_mask = DISABLE_ALL_SPLIT;
- sf->search_method = HEX;
- sf->subpel_iters_per_step = 1;
- sf->disable_split_var_thresh = 64;
- sf->disable_filter_search_var_thresh = 96;
- for (i = 0; i < TX_SIZES; i++) {
- sf->intra_y_mode_mask[i] = INTRA_DC_ONLY;
- sf->intra_uv_mode_mask[i] = INTRA_DC_ONLY;
- }
- sf->use_fast_coef_updates = 2;
- sf->adaptive_rd_thresh = 4;
- sf->mode_skip_start = 6;
- }
+ case MODE_FIRSTPASS:
+ case MODE_GOODQUALITY:
+ case MODE_SECONDPASS:
+ set_good_speed_feature(cm, sf, speed);
+ break;
+ case MODE_REALTIME:
+ set_rt_speed_feature(cm, sf, speed);
break;
}; /* switch */
// Set rd thresholds based on mode and speed setting
- set_rd_speed_thresholds(cpi, mode);
- set_rd_speed_thresholds_sub8x8(cpi, mode);
+ set_rd_speed_thresholds(cpi);
+ set_rd_speed_thresholds_sub8x8(cpi);
// Slow quant, dct and trellis not worthwhile for first pass
// so make sure they are always turned off.
@@ -962,7 +984,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
// No recode for 1 pass.
if (cpi->pass == 0) {
- sf->recode_loop = 0;
+ sf->recode_loop = DISALLOW_RECODE;
sf->optimize_coefficients = 0;
}
@@ -971,36 +993,37 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
cpi->mb.fwd_txm4x4 = vp9_fwht4x4;
}
- if (cpi->sf.subpel_search_method == SUBPEL_ITERATIVE) {
- cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_iterative;
- cpi->find_fractional_mv_step_comp = vp9_find_best_sub_pixel_comp_iterative;
- } else if (cpi->sf.subpel_search_method == SUBPEL_TREE) {
+ if (cpi->sf.subpel_search_method == SUBPEL_TREE) {
cpi->find_fractional_mv_step = vp9_find_best_sub_pixel_tree;
cpi->find_fractional_mv_step_comp = vp9_find_best_sub_pixel_comp_tree;
}
cpi->mb.optimize = cpi->sf.optimize_coefficients == 1 && cpi->pass != 1;
-#ifdef SPEEDSTATS
- frames_at_speed[cpi->speed]++;
-#endif
+ if (cpi->encode_breakout && cpi->oxcf.mode == MODE_REALTIME &&
+ sf->encode_breakout_thresh > cpi->encode_breakout)
+ cpi->encode_breakout = sf->encode_breakout_thresh;
+
+ if (sf->disable_split_mask == DISABLE_ALL_SPLIT)
+ sf->adaptive_pred_interp_filter = 0;
}
static void alloc_raw_frame_buffers(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
+ const VP9_CONFIG *oxcf = &cpi->oxcf;
- cpi->lookahead = vp9_lookahead_init(cpi->oxcf.width, cpi->oxcf.height,
+ cpi->lookahead = vp9_lookahead_init(oxcf->width, oxcf->height,
cm->subsampling_x, cm->subsampling_y,
- cpi->oxcf.lag_in_frames);
+ oxcf->lag_in_frames);
if (!cpi->lookahead)
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate lag buffers");
if (vp9_realloc_frame_buffer(&cpi->alt_ref_buffer,
- cpi->oxcf.width, cpi->oxcf.height,
+ oxcf->width, oxcf->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS))
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ VP9_ENC_BORDER_IN_PIXELS, NULL, NULL, NULL))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate altref buffer");
}
@@ -1008,21 +1031,21 @@ void vp9_alloc_compressor_data(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
if (vp9_alloc_frame_buffers(cm, cm->width, cm->height))
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate frame buffers");
if (vp9_alloc_frame_buffer(&cpi->last_frame_uf,
cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS))
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ VP9_ENC_BORDER_IN_PIXELS))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate last frame buffer");
if (vp9_alloc_frame_buffer(&cpi->scaled_source,
cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS))
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ VP9_ENC_BORDER_IN_PIXELS))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate scaled source buffer");
vpx_free(cpi->tok);
@@ -1067,15 +1090,15 @@ static void update_frame_size(VP9_COMP *cpi) {
if (vp9_realloc_frame_buffer(&cpi->last_frame_uf,
cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS))
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ VP9_ENC_BORDER_IN_PIXELS, NULL, NULL, NULL))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to reallocate last frame buffer");
if (vp9_realloc_frame_buffer(&cpi->scaled_source,
cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS))
- vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
+ VP9_ENC_BORDER_IN_PIXELS, NULL, NULL, NULL))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
"Failed to reallocate scaled source buffer");
{
@@ -1098,10 +1121,9 @@ static void update_frame_size(VP9_COMP *cpi) {
}
}
-
// Table that converts 0-63 Q range values passed in outside to the Qindex
// range used internally.
-static const int q_trans[] = {
+const int q_trans[] = {
0, 4, 8, 12, 16, 20, 24, 28,
32, 36, 40, 44, 48, 52, 56, 60,
64, 68, 72, 76, 80, 84, 88, 92,
@@ -1121,42 +1143,56 @@ int vp9_reverse_trans(int x) {
return 63;
};
+
void vp9_new_framerate(VP9_COMP *cpi, double framerate) {
- if (framerate < 0.1)
- framerate = 30;
+ VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
+ VP9_CONFIG *const oxcf = &cpi->oxcf;
+ int vbr_max_bits;
- cpi->oxcf.framerate = framerate;
+ oxcf->framerate = framerate < 0.1 ? 30 : framerate;
cpi->output_framerate = cpi->oxcf.framerate;
- cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth
- / cpi->output_framerate);
- cpi->av_per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth
- / cpi->output_framerate);
- cpi->min_frame_bandwidth = (int)(cpi->av_per_frame_bandwidth *
- cpi->oxcf.two_pass_vbrmin_section / 100);
-
-
- cpi->min_frame_bandwidth = MAX(cpi->min_frame_bandwidth, FRAME_OVERHEAD_BITS);
+ rc->av_per_frame_bandwidth = (int)(oxcf->target_bandwidth /
+ cpi->output_framerate);
+ rc->min_frame_bandwidth = (int)(rc->av_per_frame_bandwidth *
+ oxcf->two_pass_vbrmin_section / 100);
+
+
+ rc->min_frame_bandwidth = MAX(rc->min_frame_bandwidth, FRAME_OVERHEAD_BITS);
+
+ // A maximum bitrate for a frame is defined.
+ // The baseline for this aligns with HW implementations that
+ // can support decode of 1080P content up to a bitrate of MAX_MB_RATE bits
+ // per 16x16 MB (averaged over a frame). However this limit is extended if
+ // a very high rate is given on the command line or the the rate cannnot
+ // be acheived because of a user specificed max q (e.g. when the user
+ // specifies lossless encode.
+ //
+ vbr_max_bits = (int)(((int64_t)rc->av_per_frame_bandwidth *
+ oxcf->two_pass_vbrmax_section) / 100);
+ rc->max_frame_bandwidth = MAX(MAX((cm->MBs * MAX_MB_RATE), MAXRATE_1080P),
+ vbr_max_bits);
// Set Maximum gf/arf interval
- cpi->max_gf_interval = 16;
+ rc->max_gf_interval = 16;
// Extended interval for genuinely static scenes
- cpi->twopass.static_scene_max_gf_interval = cpi->key_frame_frequency >> 1;
+ rc->static_scene_max_gf_interval = cpi->key_frame_frequency >> 1;
// Special conditions when alt ref frame enabled in lagged compress mode
- if (cpi->oxcf.play_alternate && cpi->oxcf.lag_in_frames) {
- if (cpi->max_gf_interval > cpi->oxcf.lag_in_frames - 1)
- cpi->max_gf_interval = cpi->oxcf.lag_in_frames - 1;
+ if (oxcf->play_alternate && oxcf->lag_in_frames) {
+ if (rc->max_gf_interval > oxcf->lag_in_frames - 1)
+ rc->max_gf_interval = oxcf->lag_in_frames - 1;
- if (cpi->twopass.static_scene_max_gf_interval > cpi->oxcf.lag_in_frames - 1)
- cpi->twopass.static_scene_max_gf_interval = cpi->oxcf.lag_in_frames - 1;
+ if (rc->static_scene_max_gf_interval > oxcf->lag_in_frames - 1)
+ rc->static_scene_max_gf_interval = oxcf->lag_in_frames - 1;
}
- if (cpi->max_gf_interval > cpi->twopass.static_scene_max_gf_interval)
- cpi->max_gf_interval = cpi->twopass.static_scene_max_gf_interval;
+ if (rc->max_gf_interval > rc->static_scene_max_gf_interval)
+ rc->max_gf_interval = rc->static_scene_max_gf_interval;
}
-static int64_t rescale(int val, int64_t num, int denom) {
+int64_t vp9_rescale(int64_t val, int64_t num, int denom) {
int64_t llnum = num;
int64_t llden = denom;
int64_t llval = val;
@@ -1175,9 +1211,9 @@ static void set_tile_limits(VP9_COMP *cpi) {
cm->log2_tile_rows = cpi->oxcf.tile_rows;
}
-static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
+static void init_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
int i;
cpi->oxcf = *oxcf;
@@ -1190,25 +1226,47 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cm->subsampling_y = 0;
vp9_alloc_compressor_data(cpi);
+ // Spatial scalability.
+ cpi->svc.number_spatial_layers = oxcf->ss_number_layers;
+ // Temporal scalability.
+ cpi->svc.number_temporal_layers = oxcf->ts_number_layers;
+
+ if (cpi->svc.number_temporal_layers > 1 &&
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ vp9_init_layer_context(cpi);
+ }
+
// change includes all joint functionality
- vp9_change_config(ptr, oxcf);
+ vp9_change_config(cpi, oxcf);
// Initialize active best and worst q and average q values.
- cpi->active_worst_quality = cpi->oxcf.worst_allowed_q;
- cpi->active_best_quality = cpi->oxcf.best_allowed_q;
- cpi->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
+ if (cpi->pass == 0 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ rc->avg_frame_qindex[0] = cpi->oxcf.worst_allowed_q;
+ rc->avg_frame_qindex[1] = cpi->oxcf.worst_allowed_q;
+ rc->avg_frame_qindex[2] = cpi->oxcf.worst_allowed_q;
+ } else {
+ rc->avg_frame_qindex[0] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ rc->avg_frame_qindex[1] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ rc->avg_frame_qindex[2] = (cpi->oxcf.worst_allowed_q +
+ cpi->oxcf.best_allowed_q) / 2;
+ }
+ rc->last_q[0] = cpi->oxcf.best_allowed_q;
+ rc->last_q[1] = cpi->oxcf.best_allowed_q;
+ rc->last_q[2] = cpi->oxcf.best_allowed_q;
// Initialise the starting buffer levels
- cpi->buffer_level = cpi->oxcf.starting_buffer_level;
- cpi->bits_off_target = cpi->oxcf.starting_buffer_level;
+ rc->buffer_level = cpi->oxcf.starting_buffer_level;
+ rc->bits_off_target = cpi->oxcf.starting_buffer_level;
- cpi->rolling_target_bits = cpi->av_per_frame_bandwidth;
- cpi->rolling_actual_bits = cpi->av_per_frame_bandwidth;
- cpi->long_rolling_target_bits = cpi->av_per_frame_bandwidth;
- cpi->long_rolling_actual_bits = cpi->av_per_frame_bandwidth;
+ rc->rolling_target_bits = rc->av_per_frame_bandwidth;
+ rc->rolling_actual_bits = rc->av_per_frame_bandwidth;
+ rc->long_rolling_target_bits = rc->av_per_frame_bandwidth;
+ rc->long_rolling_actual_bits = rc->av_per_frame_bandwidth;
- cpi->total_actual_bits = 0;
- cpi->total_target_vs_actual = 0;
+ rc->total_actual_bits = 0;
+ rc->total_target_vs_actual = 0;
cpi->static_mb_pct = 0;
@@ -1216,9 +1274,6 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cpi->gld_fb_idx = 1;
cpi->alt_fb_idx = 2;
- cpi->current_layer = 0;
- cpi->use_svc = 0;
-
set_tile_limits(cpi);
cpi->fixed_divide[0] = 0;
@@ -1226,9 +1281,7 @@ static void init_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cpi->fixed_divide[i] = 0x80000 / i;
}
-
-void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
+void vp9_change_config(struct VP9_COMP *cpi, VP9_CONFIG *oxcf) {
VP9_COMMON *const cm = &cpi->common;
if (!cpi || !oxcf)
@@ -1240,28 +1293,35 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cpi->oxcf = *oxcf;
- switch (cpi->oxcf.Mode) {
+ if (cpi->oxcf.cpu_used == -6)
+ cpi->oxcf.play_alternate = 0;
+
+ switch (cpi->oxcf.mode) {
// Real time and one pass deprecated in test code base
case MODE_GOODQUALITY:
cpi->pass = 0;
- cpi->compressor_speed = 2;
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
break;
+ case MODE_BESTQUALITY:
+ cpi->pass = 0;
+ break;
+
case MODE_FIRSTPASS:
cpi->pass = 1;
- cpi->compressor_speed = 1;
break;
case MODE_SECONDPASS:
cpi->pass = 2;
- cpi->compressor_speed = 1;
cpi->oxcf.cpu_used = clamp(cpi->oxcf.cpu_used, -5, 5);
break;
case MODE_SECONDPASS_BEST:
cpi->pass = 2;
- cpi->compressor_speed = 0;
+ break;
+
+ case MODE_REALTIME:
+ cpi->pass = 0;
break;
}
@@ -1272,20 +1332,17 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
cpi->oxcf.lossless = oxcf->lossless;
cpi->mb.e_mbd.itxm_add = cpi->oxcf.lossless ? vp9_iwht4x4_add
: vp9_idct4x4_add;
- cpi->baseline_gf_interval = DEFAULT_GF_INTERVAL;
+ cpi->rc.baseline_gf_interval = DEFAULT_GF_INTERVAL;
cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
- // cpi->use_golden_frame_only = 0;
- // cpi->use_last_frame_only = 0;
cpi->refresh_golden_frame = 0;
cpi->refresh_last_frame = 1;
cm->refresh_frame_context = 1;
cm->reset_frame_context = 0;
- setup_features(cm);
- cpi->common.allow_high_precision_mv = 0; // Default mv precision
- set_mvcost(cpi);
+ vp9_reset_segment_features(&cm->seg);
+ set_high_precision_mv(cpi, 0);
{
int i;
@@ -1293,9 +1350,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
for (i = 0; i < MAX_SEGMENTS; i++)
cpi->segment_encode_breakout[i] = cpi->oxcf.encode_breakout;
}
-
- // At the moment the first order values may not be > MAXQ
- cpi->oxcf.fixed_q = MIN(cpi->oxcf.fixed_q, MAXQ);
+ cpi->encode_breakout = cpi->oxcf.encode_breakout;
// local file playback mode == really big buffer
if (cpi->oxcf.end_usage == USAGE_LOCAL_FILE_PLAYBACK) {
@@ -1307,86 +1362,79 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
// Convert target bandwidth from Kbit/s to Bit/s
cpi->oxcf.target_bandwidth *= 1000;
- cpi->oxcf.starting_buffer_level = rescale(cpi->oxcf.starting_buffer_level,
- cpi->oxcf.target_bandwidth, 1000);
+ cpi->oxcf.starting_buffer_level =
+ vp9_rescale(cpi->oxcf.starting_buffer_level,
+ cpi->oxcf.target_bandwidth, 1000);
// Set or reset optimal and maximum buffer levels.
if (cpi->oxcf.optimal_buffer_level == 0)
cpi->oxcf.optimal_buffer_level = cpi->oxcf.target_bandwidth / 8;
else
- cpi->oxcf.optimal_buffer_level = rescale(cpi->oxcf.optimal_buffer_level,
- cpi->oxcf.target_bandwidth, 1000);
+ cpi->oxcf.optimal_buffer_level =
+ vp9_rescale(cpi->oxcf.optimal_buffer_level,
+ cpi->oxcf.target_bandwidth, 1000);
if (cpi->oxcf.maximum_buffer_size == 0)
cpi->oxcf.maximum_buffer_size = cpi->oxcf.target_bandwidth / 8;
else
- cpi->oxcf.maximum_buffer_size = rescale(cpi->oxcf.maximum_buffer_size,
- cpi->oxcf.target_bandwidth, 1000);
+ cpi->oxcf.maximum_buffer_size =
+ vp9_rescale(cpi->oxcf.maximum_buffer_size,
+ cpi->oxcf.target_bandwidth, 1000);
+ // Under a configuration change, where maximum_buffer_size may change,
+ // keep buffer level clipped to the maximum allowed buffer size.
+ cpi->rc.bits_off_target = MIN(cpi->rc.bits_off_target,
+ cpi->oxcf.maximum_buffer_size);
+ cpi->rc.buffer_level = MIN(cpi->rc.buffer_level,
+ cpi->oxcf.maximum_buffer_size);
// Set up frame rate and related parameters rate control values.
vp9_new_framerate(cpi, cpi->oxcf.framerate);
// Set absolute upper and lower quality limits
- cpi->worst_quality = cpi->oxcf.worst_allowed_q;
- cpi->best_quality = cpi->oxcf.best_allowed_q;
+ cpi->rc.worst_quality = cpi->oxcf.worst_allowed_q;
+ cpi->rc.best_quality = cpi->oxcf.best_allowed_q;
// active values should only be modified if out of new range
- cpi->active_worst_quality = clamp(cpi->active_worst_quality,
- cpi->oxcf.best_allowed_q,
- cpi->oxcf.worst_allowed_q);
-
- cpi->active_best_quality = clamp(cpi->active_best_quality,
- cpi->oxcf.best_allowed_q,
- cpi->oxcf.worst_allowed_q);
-
- cpi->buffered_mode = cpi->oxcf.optimal_buffer_level > 0;
cpi->cq_target_quality = cpi->oxcf.cq_level;
- cm->mcomp_filter_type = DEFAULT_INTERP_FILTER;
-
- cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
+ cm->interp_filter = DEFAULT_INTERP_FILTER;
cm->display_width = cpi->oxcf.width;
cm->display_height = cpi->oxcf.height;
// VP8 sharpness level mapping 0-7 (vs 0-10 in general VPx dialogs)
- cpi->oxcf.Sharpness = MIN(7, cpi->oxcf.Sharpness);
+ cpi->oxcf.sharpness = MIN(7, cpi->oxcf.sharpness);
- cpi->common.lf.sharpness_level = cpi->oxcf.Sharpness;
+ cpi->common.lf.sharpness_level = cpi->oxcf.sharpness;
if (cpi->initial_width) {
// Increasing the size of the frame beyond the first seen frame, or some
- // otherwise signalled maximum size, is not supported.
+ // otherwise signaled maximum size, is not supported.
// TODO(jkoleszar): exit gracefully.
assert(cm->width <= cpi->initial_width);
assert(cm->height <= cpi->initial_height);
}
update_frame_size(cpi);
- if (cpi->oxcf.fixed_q >= 0) {
- cpi->last_q[0] = cpi->oxcf.fixed_q;
- cpi->last_q[1] = cpi->oxcf.fixed_q;
- cpi->last_boosted_qindex = cpi->oxcf.fixed_q;
+ if (cpi->svc.number_temporal_layers > 1 &&
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ vp9_update_layer_context_change_config(cpi,
+ (int)cpi->oxcf.target_bandwidth);
}
- cpi->speed = cpi->oxcf.cpu_used;
+ cpi->speed = abs(cpi->oxcf.cpu_used);
- if (cpi->oxcf.lag_in_frames == 0) {
- // force to allowlag to 0 if lag_in_frames is 0;
- cpi->oxcf.allow_lag = 0;
- } else if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS) {
- // Limit on lag buffers as these are not currently dynamically allocated
+ // Limit on lag buffers as these are not currently dynamically allocated.
+ if (cpi->oxcf.lag_in_frames > MAX_LAG_BUFFERS)
cpi->oxcf.lag_in_frames = MAX_LAG_BUFFERS;
- }
- // YX Temp
#if CONFIG_MULTIPLE_ARF
vp9_zero(cpi->alt_ref_source);
#else
cpi->alt_ref_source = NULL;
#endif
- cpi->is_src_frame_alt_ref = 0;
+ cpi->rc.is_src_frame_alt_ref = 0;
#if 0
// Experimental RD Code
@@ -1395,6 +1443,9 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) {
#endif
set_tile_limits(cpi);
+
+ cpi->ext_refresh_frame_flags_pending = 0;
+ cpi->ext_refresh_frame_context_pending = 0;
}
#define M_LOG2_E 0.693147180559945309417
@@ -1442,6 +1493,7 @@ static void alloc_mode_context(VP9_COMMON *cm, int num_4x4_blk,
int num_pix = num_4x4_blk << 4;
int i, k;
ctx->num_4x4_blk = num_4x4_blk;
+
CHECK_MEM_ERROR(cm, ctx->zcoeff_blk,
vpx_calloc(num_4x4_blk, sizeof(uint8_t)));
for (i = 0; i < MAX_MB_PLANE; ++i) {
@@ -1485,7 +1537,6 @@ static void init_pick_mode_context(VP9_COMP *cpi) {
VP9_COMMON *const cm = &cpi->common;
MACROBLOCK *const x = &cpi->mb;
-
for (i = 0; i < BLOCK_SIZES; ++i) {
const int num_4x4_w = num_4x4_blocks_wide_lookup[i];
const int num_4x4_h = num_4x4_blocks_high_lookup[i];
@@ -1556,30 +1607,20 @@ static void free_pick_mode_context(MACROBLOCK *x) {
}
}
-VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
+VP9_COMP *vp9_create_compressor(VP9_CONFIG *oxcf) {
int i, j;
- volatile union {
- VP9_COMP *cpi;
- VP9_PTR ptr;
- } ctx;
+ VP9_COMP *const cpi = vpx_memalign(32, sizeof(VP9_COMP));
+ VP9_COMMON *const cm = cpi != NULL ? &cpi->common : NULL;
+ RATE_CONTROL *const rc = cpi != NULL ? &cpi->rc : NULL;
- VP9_COMP *cpi;
- VP9_COMMON *cm;
-
- cpi = ctx.cpi = vpx_memalign(32, sizeof(VP9_COMP));
- // Check that the CPI instance is valid
- if (!cpi)
- return 0;
-
- cm = &cpi->common;
+ if (!cm)
+ return NULL;
vp9_zero(*cpi);
if (setjmp(cm->error.jmp)) {
- VP9_PTR ptr = ctx.ptr;
-
- ctx.cpi->common.error.setjmp = 0;
- vp9_remove_compressor(&ptr);
+ cm->error.setjmp = 0;
+ vp9_remove_compressor(cpi);
return 0;
}
@@ -1588,35 +1629,36 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
CHECK_MEM_ERROR(cm, cpi->mb.ss, vpx_calloc(sizeof(search_site),
(MAX_MVSEARCH_STEPS * 8) + 1));
- vp9_create_common(cm);
+ vp9_rtcd();
- init_config((VP9_PTR)cpi, oxcf);
+ cpi->use_svc = 0;
+ init_config(cpi, oxcf);
init_pick_mode_context(cpi);
- cm->current_video_frame = 0;
- cpi->kf_overspend_bits = 0;
- cpi->kf_bitrate_adjustment = 0;
- cpi->frames_till_gf_update_due = 0;
- cpi->gf_overspend_bits = 0;
- cpi->non_gf_bitrate_adjustment = 0;
+ cm->current_video_frame = 0;
// Set reference frame sign bias for ALTREF frame to 1 (for now)
cm->ref_frame_sign_bias[ALTREF_FRAME] = 1;
- cpi->baseline_gf_interval = DEFAULT_GF_INTERVAL;
+ rc->baseline_gf_interval = DEFAULT_GF_INTERVAL;
cpi->gold_is_last = 0;
- cpi->alt_is_last = 0;
- cpi->gold_is_alt = 0;
-
- // Spatial scalability
- cpi->number_spatial_layers = oxcf->ss_number_layers;
+ cpi->alt_is_last = 0;
+ cpi->gold_is_alt = 0;
// Create the encoder segmentation map and set all entries to 0
CHECK_MEM_ERROR(cm, cpi->segmentation_map,
vpx_calloc(cm->mi_rows * cm->mi_cols, 1));
+ // Create a complexity map used for rd adjustment
+ CHECK_MEM_ERROR(cm, cpi->complexity_map,
+ vpx_calloc(cm->mi_rows * cm->mi_cols, 1));
+
+ // Create a map used for cyclic background refresh.
+ CHECK_MEM_ERROR(cm, cpi->cyclic_refresh.map,
+ vpx_calloc(cm->mi_rows * cm->mi_cols, 1));
+
// And a place holder structure is the coding context
// for use if we want to save and restore it
CHECK_MEM_ERROR(cm, cpi->coding_context.last_frame_seg_map_copy,
@@ -1633,26 +1675,16 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
sizeof(*cpi->mbgraph_stats[i].mb_stats), 1));
}
-#ifdef ENTROPY_STATS
- if (cpi->pass != 1)
- init_context_counters();
-#endif
-
-#ifdef MODE_STATS
- init_tx_count_stats();
- init_switchable_interp_stats();
-#endif
-
/*Initialize the feed-forward activity masking.*/
cpi->activity_avg = 90 << 12;
-
- cpi->frames_since_key = 8; // Sensible default for first frame.
cpi->key_frame_frequency = cpi->oxcf.key_freq;
- cpi->this_key_frame_forced = 0;
- cpi->next_key_frame_forced = 0;
- cpi->source_alt_ref_pending = 0;
- cpi->source_alt_ref_active = 0;
+ rc->frames_since_key = 8; // Sensible default for first frame.
+ rc->this_key_frame_forced = 0;
+ rc->next_key_frame_forced = 0;
+
+ rc->source_alt_ref_pending = 0;
+ rc->source_alt_ref_active = 0;
cpi->refresh_alt_ref_frame = 0;
#if CONFIG_MULTIPLE_ARF
@@ -1676,16 +1708,20 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
cpi->bytes = 0;
if (cpi->b_calculate_psnr) {
- cpi->total_sq_error = 0.0;
- cpi->total_sq_error2 = 0.0;
cpi->total_y = 0.0;
cpi->total_u = 0.0;
cpi->total_v = 0.0;
cpi->total = 0.0;
+ cpi->total_sq_error = 0;
+ cpi->total_samples = 0;
+
cpi->totalp_y = 0.0;
cpi->totalp_u = 0.0;
cpi->totalp_v = 0.0;
cpi->totalp = 0.0;
+ cpi->totalp_sq_error = 0;
+ cpi->totalp_samples = 0;
+
cpi->tot_recode_hits = 0;
cpi->summed_quality = 0;
cpi->summed_weights = 0;
@@ -1704,20 +1740,17 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
cpi->first_time_stamp_ever = INT64_MAX;
- cpi->frames_till_gf_update_due = 0;
- cpi->key_frame_count = 1;
+ rc->frames_till_gf_update_due = 0;
- cpi->ni_av_qi = cpi->oxcf.worst_allowed_q;
- cpi->ni_tot_qi = 0;
- cpi->ni_frames = 0;
- cpi->tot_q = 0.0;
- cpi->avg_q = vp9_convert_qindex_to_q(cpi->oxcf.worst_allowed_q);
- cpi->total_byte_count = 0;
+ rc->ni_av_qi = cpi->oxcf.worst_allowed_q;
+ rc->ni_tot_qi = 0;
+ rc->ni_frames = 0;
+ rc->tot_q = 0.0;
+ rc->avg_q = vp9_convert_qindex_to_q(cpi->oxcf.worst_allowed_q);
- cpi->rate_correction_factor = 1.0;
- cpi->key_frame_rate_correction_factor = 1.0;
- cpi->gf_rate_correction_factor = 1.0;
- cpi->twopass.est_max_qcorrection_factor = 1.0;
+ rc->rate_correction_factor = 1.0;
+ rc->key_frame_rate_correction_factor = 1.0;
+ rc->gf_rate_correction_factor = 1.0;
cal_nmvjointsadcost(cpi->mb.nmvjointsadcost);
cpi->mb.nmvcost[0] = &cpi->mb.nmvcosts[0][MV_MAX];
@@ -1732,9 +1765,6 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
cpi->mb.nmvsadcost_hp[1] = &cpi->mb.nmvsadcosts_hp[1][MV_MAX];
cal_nmvsadcosts_hp(cpi->mb.nmvsadcost_hp);
- for (i = 0; i < KEY_FRAME_CONTEXT; i++)
- cpi->prior_key_frame_distance[i] = (int)cpi->output_framerate;
-
#ifdef OUTPUT_YUV_SRC
yuv_file = fopen("bd.yuv", "ab");
#endif
@@ -1749,18 +1779,17 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
cpi->output_pkt_list = oxcf->output_pkt_list;
- cpi->enable_encode_breakout = 1;
+ cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
if (cpi->pass == 1) {
vp9_init_first_pass(cpi);
} else if (cpi->pass == 2) {
- size_t packet_sz = sizeof(FIRSTPASS_STATS);
- int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
+ const size_t packet_sz = sizeof(FIRSTPASS_STATS);
+ const int packets = (int)(oxcf->two_pass_stats_in.sz / packet_sz);
cpi->twopass.stats_in_start = oxcf->two_pass_stats_in.buf;
cpi->twopass.stats_in = cpi->twopass.stats_in_start;
- cpi->twopass.stats_in_end = (void *)((char *)cpi->twopass.stats_in
- + (packets - 1) * packet_sz);
+ cpi->twopass.stats_in_end = &cpi->twopass.stats_in[packets - 1];
vp9_init_second_pass(cpi);
}
@@ -1869,9 +1898,6 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
cpi->diamond_search_sad = vp9_diamond_search_sad;
cpi->refining_search_sad = vp9_refining_search_sad;
- // make sure frame 1 is okay
- cpi->error_bins[0] = cpi->common.MBs;
-
/* vp9_init_quantizer() is first called here. Add check in
* vp9_frame_init_quantizer() so that vp9_init_quantizer is only
* called later when needed. This will avoid unnecessary calls of
@@ -1881,44 +1907,24 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
vp9_loop_filter_init(cm);
- cpi->common.error.setjmp = 0;
+ cm->error.setjmp = 0;
- vp9_zero(cpi->y_uv_mode_count);
+ vp9_zero(cpi->common.counts.uv_mode);
#ifdef MODE_TEST_HIT_STATS
vp9_zero(cpi->mode_test_hits);
#endif
- return (VP9_PTR) cpi;
+ return cpi;
}
-void vp9_remove_compressor(VP9_PTR *ptr) {
- VP9_COMP *cpi = (VP9_COMP *)(*ptr);
+void vp9_remove_compressor(VP9_COMP *cpi) {
int i;
if (!cpi)
return;
if (cpi && (cpi->common.current_video_frame > 0)) {
- if (cpi->pass == 2) {
- vp9_end_second_pass(cpi);
- }
-
-#ifdef ENTROPY_STATS
- if (cpi->pass != 1) {
- print_context_counters();
- print_tree_update_probs();
- print_mode_context(cpi);
- }
-#endif
-
-#ifdef MODE_STATS
- if (cpi->pass != 1) {
- write_tx_count_stats();
- write_switchable_interp_stats();
- }
-#endif
-
#if CONFIG_INTERNAL_STATS
vp9_clear_system_state();
@@ -1934,22 +1940,22 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
/ time_encoded;
if (cpi->b_calculate_psnr) {
- YV12_BUFFER_CONFIG *lst_yv12 =
- &cpi->common.yv12_fb[cpi->common.ref_frame_map[cpi->lst_fb_idx]];
- double samples = 3.0 / 2 * cpi->count *
- lst_yv12->y_width * lst_yv12->y_height;
- double total_psnr = vp9_mse2psnr(samples, 255.0, cpi->total_sq_error);
- double total_psnr2 = vp9_mse2psnr(samples, 255.0, cpi->total_sq_error2);
- double total_ssim = 100 * pow(cpi->summed_quality /
- cpi->summed_weights, 8.0);
- double total_ssimp = 100 * pow(cpi->summedp_quality /
- cpi->summedp_weights, 8.0);
+ const double total_psnr =
+ vpx_sse_to_psnr((double)cpi->total_samples, 255.0,
+ (double)cpi->total_sq_error);
+ const double totalp_psnr =
+ vpx_sse_to_psnr((double)cpi->totalp_samples, 255.0,
+ (double)cpi->totalp_sq_error);
+ const double total_ssim = 100 * pow(cpi->summed_quality /
+ cpi->summed_weights, 8.0);
+ const double totalp_ssim = 100 * pow(cpi->summedp_quality /
+ cpi->summedp_weights, 8.0);
fprintf(f, "Bitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\tGLPsnrP\t"
"VPXSSIM\tVPSSIMP\t Time(ms)\n");
fprintf(f, "%7.2f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%8.0f\n",
dr, cpi->total / cpi->count, total_psnr,
- cpi->totalp / cpi->count, total_psnr2, total_ssim, total_ssimp,
+ cpi->totalp / cpi->count, totalp_psnr, total_ssim, totalp_ssim,
total_encode_time);
}
@@ -1995,56 +2001,6 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
}
#endif
-#ifdef ENTROPY_STATS
- {
- int i, j, k;
- FILE *fmode = fopen("vp9_modecontext.c", "w");
-
- fprintf(fmode, "\n#include \"vp9_entropymode.h\"\n\n");
- fprintf(fmode, "const unsigned int vp9_kf_default_bmode_counts ");
- fprintf(fmode, "[INTRA_MODES][INTRA_MODES]"
- "[INTRA_MODES] =\n{\n");
-
- for (i = 0; i < INTRA_MODES; i++) {
- fprintf(fmode, " { // Above Mode : %d\n", i);
-
- for (j = 0; j < INTRA_MODES; j++) {
- fprintf(fmode, " {");
-
- for (k = 0; k < INTRA_MODES; k++) {
- if (!intra_mode_stats[i][j][k])
- fprintf(fmode, " %5d, ", 1);
- else
- fprintf(fmode, " %5d, ", intra_mode_stats[i][j][k]);
- }
-
- fprintf(fmode, "}, // left_mode %d\n", j);
- }
-
- fprintf(fmode, " },\n");
- }
-
- fprintf(fmode, "};\n");
- fclose(fmode);
- }
-#endif
-
-
-#if defined(SECTIONBITS_OUTPUT)
-
- if (0) {
- int i;
- FILE *f = fopen("tokenbits.stt", "a");
-
- for (i = 0; i < 28; i++)
- fprintf(f, "%8d", (int)(Sectionbits[i] / 256));
-
- fprintf(f, "\n");
- fclose(f);
- }
-
-#endif
-
#if 0
{
printf("\n_pick_loop_filter_level:%d\n", cpi->time_pick_lpf / 1000);
@@ -2069,7 +2025,6 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
vp9_remove_common(&cpi->common);
vpx_free(cpi);
- *ptr = 0;
#ifdef OUTPUT_YUV_SRC
fclose(yuv_file);
@@ -2093,8 +2048,8 @@ void vp9_remove_compressor(VP9_PTR *ptr) {
}
-static uint64_t calc_plane_error(uint8_t *orig, int orig_stride,
- uint8_t *recon, int recon_stride,
+static uint64_t calc_plane_error(const uint8_t *orig, int orig_stride,
+ const uint8_t *recon, int recon_stride,
unsigned int cols, unsigned int rows) {
unsigned int row, col;
uint64_t total_sse = 0;
@@ -2111,8 +2066,8 @@ static uint64_t calc_plane_error(uint8_t *orig, int orig_stride,
/* Handle odd-sized width */
if (col < cols) {
unsigned int border_row, border_col;
- uint8_t *border_orig = orig;
- uint8_t *border_recon = recon;
+ const uint8_t *border_orig = orig;
+ const uint8_t *border_recon = recon;
for (border_row = 0; border_row < 16; border_row++) {
for (border_col = col; border_col < cols; border_col++) {
@@ -2143,136 +2098,122 @@ static uint64_t calc_plane_error(uint8_t *orig, int orig_stride,
return total_sse;
}
+typedef struct {
+ double psnr[4]; // total/y/u/v
+ uint64_t sse[4]; // total/y/u/v
+ uint32_t samples[4]; // total/y/u/v
+} PSNR_STATS;
+
+static void calc_psnr(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b,
+ PSNR_STATS *psnr) {
+ const int widths[3] = {a->y_width, a->uv_width, a->uv_width };
+ const int heights[3] = {a->y_height, a->uv_height, a->uv_height};
+ const uint8_t *a_planes[3] = {a->y_buffer, a->u_buffer, a->v_buffer };
+ const int a_strides[3] = {a->y_stride, a->uv_stride, a->uv_stride};
+ const uint8_t *b_planes[3] = {b->y_buffer, b->u_buffer, b->v_buffer };
+ const int b_strides[3] = {b->y_stride, b->uv_stride, b->uv_stride};
+ int i;
+ uint64_t total_sse = 0;
+ uint32_t total_samples = 0;
-static void generate_psnr_packet(VP9_COMP *cpi) {
- YV12_BUFFER_CONFIG *orig = cpi->Source;
- YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
- struct vpx_codec_cx_pkt pkt;
- uint64_t sse;
- int i;
- unsigned int width = orig->y_crop_width;
- unsigned int height = orig->y_crop_height;
+ for (i = 0; i < 3; ++i) {
+ const int w = widths[i];
+ const int h = heights[i];
+ const uint32_t samples = w * h;
+ const uint64_t sse = calc_plane_error(a_planes[i], a_strides[i],
+ b_planes[i], b_strides[i],
+ w, h);
+ psnr->sse[1 + i] = sse;
+ psnr->samples[1 + i] = samples;
+ psnr->psnr[1 + i] = vpx_sse_to_psnr(samples, 255.0, (double)sse);
- pkt.kind = VPX_CODEC_PSNR_PKT;
- sse = calc_plane_error(orig->y_buffer, orig->y_stride,
- recon->y_buffer, recon->y_stride,
- width, height);
- pkt.data.psnr.sse[0] = sse;
- pkt.data.psnr.sse[1] = sse;
- pkt.data.psnr.samples[0] = width * height;
- pkt.data.psnr.samples[1] = width * height;
-
- width = orig->uv_crop_width;
- height = orig->uv_crop_height;
-
- sse = calc_plane_error(orig->u_buffer, orig->uv_stride,
- recon->u_buffer, recon->uv_stride,
- width, height);
- pkt.data.psnr.sse[0] += sse;
- pkt.data.psnr.sse[2] = sse;
- pkt.data.psnr.samples[0] += width * height;
- pkt.data.psnr.samples[2] = width * height;
-
- sse = calc_plane_error(orig->v_buffer, orig->uv_stride,
- recon->v_buffer, recon->uv_stride,
- width, height);
- pkt.data.psnr.sse[0] += sse;
- pkt.data.psnr.sse[3] = sse;
- pkt.data.psnr.samples[0] += width * height;
- pkt.data.psnr.samples[3] = width * height;
-
- for (i = 0; i < 4; i++)
- pkt.data.psnr.psnr[i] = vp9_mse2psnr(pkt.data.psnr.samples[i], 255.0,
- (double)pkt.data.psnr.sse[i]);
+ total_sse += sse;
+ total_samples += samples;
+ }
- vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt);
+ psnr->sse[0] = total_sse;
+ psnr->samples[0] = total_samples;
+ psnr->psnr[0] = vpx_sse_to_psnr((double)total_samples, 255.0,
+ (double)total_sse);
}
+static void generate_psnr_packet(VP9_COMP *cpi) {
+ struct vpx_codec_cx_pkt pkt;
+ int i;
+ PSNR_STATS psnr;
+ calc_psnr(cpi->Source, cpi->common.frame_to_show, &psnr);
+ for (i = 0; i < 4; ++i) {
+ pkt.data.psnr.samples[i] = psnr.samples[i];
+ pkt.data.psnr.sse[i] = psnr.sse[i];
+ pkt.data.psnr.psnr[i] = psnr.psnr[i];
+ }
+ pkt.kind = VPX_CODEC_PSNR_PKT;
+ vpx_codec_pkt_list_add(cpi->output_pkt_list, &pkt);
+}
-int vp9_use_as_reference(VP9_PTR ptr, int ref_frame_flags) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
-
+int vp9_use_as_reference(VP9_COMP *cpi, int ref_frame_flags) {
if (ref_frame_flags > 7)
return -1;
cpi->ref_frame_flags = ref_frame_flags;
return 0;
}
-int vp9_update_reference(VP9_PTR ptr, int ref_frame_flags) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
-
- if (ref_frame_flags > 7)
- return -1;
-
- cpi->refresh_golden_frame = 0;
- cpi->refresh_alt_ref_frame = 0;
- cpi->refresh_last_frame = 0;
-
- if (ref_frame_flags & VP9_LAST_FLAG)
- cpi->refresh_last_frame = 1;
-
- if (ref_frame_flags & VP9_GOLD_FLAG)
- cpi->refresh_golden_frame = 1;
- if (ref_frame_flags & VP9_ALT_FLAG)
- cpi->refresh_alt_ref_frame = 1;
-
- return 0;
+void vp9_update_reference(VP9_COMP *cpi, int ref_frame_flags) {
+ cpi->ext_refresh_golden_frame = (ref_frame_flags & VP9_GOLD_FLAG) != 0;
+ cpi->ext_refresh_alt_ref_frame = (ref_frame_flags & VP9_ALT_FLAG) != 0;
+ cpi->ext_refresh_last_frame = (ref_frame_flags & VP9_LAST_FLAG) != 0;
+ cpi->ext_refresh_frame_flags_pending = 1;
}
-int vp9_copy_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag,
- YV12_BUFFER_CONFIG *sd) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
- VP9_COMMON *cm = &cpi->common;
- int ref_fb_idx;
-
+static YV12_BUFFER_CONFIG *get_vp9_ref_frame_buffer(VP9_COMP *cpi,
+ VP9_REFFRAME ref_frame_flag) {
+ MV_REFERENCE_FRAME ref_frame = NONE;
if (ref_frame_flag == VP9_LAST_FLAG)
- ref_fb_idx = cm->ref_frame_map[cpi->lst_fb_idx];
+ ref_frame = LAST_FRAME;
else if (ref_frame_flag == VP9_GOLD_FLAG)
- ref_fb_idx = cm->ref_frame_map[cpi->gld_fb_idx];
+ ref_frame = GOLDEN_FRAME;
else if (ref_frame_flag == VP9_ALT_FLAG)
- ref_fb_idx = cm->ref_frame_map[cpi->alt_fb_idx];
- else
- return -1;
+ ref_frame = ALTREF_FRAME;
- vp8_yv12_copy_frame(&cm->yv12_fb[ref_fb_idx], sd);
+ return ref_frame == NONE ? NULL : get_ref_frame_buffer(cpi, ref_frame);
+}
- return 0;
+int vp9_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+ YV12_BUFFER_CONFIG *sd) {
+ YV12_BUFFER_CONFIG *cfg = get_vp9_ref_frame_buffer(cpi, ref_frame_flag);
+ if (cfg) {
+ vp8_yv12_copy_frame(cfg, sd);
+ return 0;
+ } else {
+ return -1;
+ }
}
-int vp9_get_reference_enc(VP9_PTR ptr, int index, YV12_BUFFER_CONFIG **fb) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
+int vp9_get_reference_enc(VP9_COMP *cpi, int index, YV12_BUFFER_CONFIG **fb) {
VP9_COMMON *cm = &cpi->common;
- if (index < 0 || index >= NUM_REF_FRAMES)
+ if (index < 0 || index >= REF_FRAMES)
return -1;
- *fb = &cm->yv12_fb[cm->ref_frame_map[index]];
+ *fb = &cm->frame_bufs[cm->ref_frame_map[index]].buf;
return 0;
}
-int vp9_set_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag,
+int vp9_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
YV12_BUFFER_CONFIG *sd) {
- VP9_COMP *cpi = (VP9_COMP *)(ptr);
- VP9_COMMON *cm = &cpi->common;
-
- int ref_fb_idx;
-
- if (ref_frame_flag == VP9_LAST_FLAG)
- ref_fb_idx = cm->ref_frame_map[cpi->lst_fb_idx];
- else if (ref_frame_flag == VP9_GOLD_FLAG)
- ref_fb_idx = cm->ref_frame_map[cpi->gld_fb_idx];
- else if (ref_frame_flag == VP9_ALT_FLAG)
- ref_fb_idx = cm->ref_frame_map[cpi->alt_fb_idx];
- else
+ YV12_BUFFER_CONFIG *cfg = get_vp9_ref_frame_buffer(cpi, ref_frame_flag);
+ if (cfg) {
+ vp8_yv12_copy_frame(sd, cfg);
+ return 0;
+ } else {
return -1;
-
- vp8_yv12_copy_frame(sd, &cm->yv12_fb[ref_fb_idx]);
-
- return 0;
+ }
}
-int vp9_update_entropy(VP9_PTR comp, int update) {
- ((VP9_COMP *)comp)->common.refresh_frame_context = update;
+
+int vp9_update_entropy(VP9_COMP * cpi, int update) {
+ cpi->ext_refresh_frame_context = update;
+ cpi->ext_refresh_frame_context_pending = 1;
return 0;
}
@@ -2347,6 +2288,42 @@ void vp9_write_yuv_rec_frame(VP9_COMMON *cm) {
}
#endif
+static void scale_and_extend_frame_nonnormative(YV12_BUFFER_CONFIG *src_fb,
+ YV12_BUFFER_CONFIG *dst_fb) {
+ const int in_w = src_fb->y_crop_width;
+ const int in_h = src_fb->y_crop_height;
+ const int out_w = dst_fb->y_crop_width;
+ const int out_h = dst_fb->y_crop_height;
+ const int in_w_uv = src_fb->uv_crop_width;
+ const int in_h_uv = src_fb->uv_crop_height;
+ const int out_w_uv = dst_fb->uv_crop_width;
+ const int out_h_uv = dst_fb->uv_crop_height;
+ int i;
+
+ uint8_t *srcs[4] = {src_fb->y_buffer, src_fb->u_buffer, src_fb->v_buffer,
+ src_fb->alpha_buffer};
+ int src_strides[4] = {src_fb->y_stride, src_fb->uv_stride, src_fb->uv_stride,
+ src_fb->alpha_stride};
+
+ uint8_t *dsts[4] = {dst_fb->y_buffer, dst_fb->u_buffer, dst_fb->v_buffer,
+ dst_fb->alpha_buffer};
+ int dst_strides[4] = {dst_fb->y_stride, dst_fb->uv_stride, dst_fb->uv_stride,
+ dst_fb->alpha_stride};
+
+ for (i = 0; i < MAX_MB_PLANE; ++i) {
+ if (i == 0 || i == 3) {
+ // Y and alpha planes
+ vp9_resize_plane(srcs[i], in_h, in_w, src_strides[i],
+ dsts[i], out_h, out_w, dst_strides[i]);
+ } else {
+ // Chroma planes
+ vp9_resize_plane(srcs[i], in_h_uv, in_w_uv, src_strides[i],
+ dsts[i], out_h_uv, out_w_uv, dst_strides[i]);
+ }
+ }
+ vp8_yv12_extend_frame_borders(dst_fb);
+}
+
static void scale_and_extend_frame(YV12_BUFFER_CONFIG *src_fb,
YV12_BUFFER_CONFIG *dst_fb) {
const int in_w = src_fb->y_crop_width;
@@ -2368,7 +2345,7 @@ static void scale_and_extend_frame(YV12_BUFFER_CONFIG *src_fb,
for (y = 0; y < out_h; y += 16) {
for (x = 0; x < out_w; x += 16) {
for (i = 0; i < MAX_MB_PLANE; ++i) {
- const int factor = i == 0 ? 1 : 2;
+ const int factor = (i == 0 || i == 3 ? 1 : 2);
const int x_q4 = x * (16 / factor) * in_w / out_w;
const int y_q4 = y * (16 / factor) * in_h / out_h;
const int src_stride = src_strides[i];
@@ -2388,61 +2365,6 @@ static void scale_and_extend_frame(YV12_BUFFER_CONFIG *src_fb,
vp8_yv12_extend_frame_borders(dst_fb);
}
-
-static void update_alt_ref_frame_stats(VP9_COMP *cpi) {
- // this frame refreshes means next frames don't unless specified by user
- cpi->frames_since_golden = 0;
-
-#if CONFIG_MULTIPLE_ARF
- if (!cpi->multi_arf_enabled)
-#endif
- // Clear the alternate reference update pending flag.
- cpi->source_alt_ref_pending = 0;
-
- // Set the alternate reference frame active flag
- cpi->source_alt_ref_active = 1;
-}
-static void update_golden_frame_stats(VP9_COMP *cpi) {
- // Update the Golden frame usage counts.
- if (cpi->refresh_golden_frame) {
- // this frame refreshes means next frames don't unless specified by user
- cpi->refresh_golden_frame = 0;
- cpi->frames_since_golden = 0;
-
- // ******** Fixed Q test code only ************
- // If we are going to use the ALT reference for the next group of frames
- // set a flag to say so.
- if (cpi->oxcf.fixed_q >= 0 &&
- cpi->oxcf.play_alternate && !cpi->refresh_alt_ref_frame) {
- cpi->source_alt_ref_pending = 1;
- cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
-
- // TODO(ivan): For SVC encoder, GF automatic update is disabled by using
- // a large GF_interval.
- if (cpi->use_svc) {
- cpi->frames_till_gf_update_due = INT_MAX;
- }
- }
-
- if (!cpi->source_alt_ref_pending)
- cpi->source_alt_ref_active = 0;
-
- // Decrement count down till next gf
- if (cpi->frames_till_gf_update_due > 0)
- cpi->frames_till_gf_update_due--;
-
- } else if (!cpi->refresh_alt_ref_frame) {
- // Decrement count down till next gf
- if (cpi->frames_till_gf_update_due > 0)
- cpi->frames_till_gf_update_due--;
-
- if (cpi->frames_till_alt_ref_frame)
- cpi->frames_till_alt_ref_frame--;
-
- cpi->frames_since_golden++;
- }
-}
-
static int find_fp_qindex() {
int i;
@@ -2458,16 +2380,6 @@ static int find_fp_qindex() {
return i;
}
-static void Pass1Encode(VP9_COMP *cpi, unsigned long *size, unsigned char *dest,
- unsigned int *frame_flags) {
- (void) size;
- (void) dest;
- (void) frame_flags;
-
- vp9_set_quantizer(cpi, find_fp_qindex());
- vp9_first_pass(cpi);
-}
-
#define WRITE_RECON_BUFFER 0
#if WRITE_RECON_BUFFER
void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) {
@@ -2502,84 +2414,51 @@ void write_cx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame) {
}
#endif
-static double compute_edge_pixel_proportion(YV12_BUFFER_CONFIG *frame) {
-#define EDGE_THRESH 128
- int i, j;
- int num_edge_pels = 0;
- int num_pels = (frame->y_height - 2) * (frame->y_width - 2);
- uint8_t *prev = frame->y_buffer + 1;
- uint8_t *curr = frame->y_buffer + 1 + frame->y_stride;
- uint8_t *next = frame->y_buffer + 1 + 2 * frame->y_stride;
- for (i = 1; i < frame->y_height - 1; i++) {
- for (j = 1; j < frame->y_width - 1; j++) {
- /* Sobel hor and ver gradients */
- int v = 2 * (curr[1] - curr[-1]) + (prev[1] - prev[-1]) +
- (next[1] - next[-1]);
- int h = 2 * (prev[0] - next[0]) + (prev[1] - next[1]) +
- (prev[-1] - next[-1]);
- h = (h < 0 ? -h : h);
- v = (v < 0 ? -v : v);
- if (h > EDGE_THRESH || v > EDGE_THRESH)
- num_edge_pels++;
- curr++;
- prev++;
- next++;
- }
- curr += frame->y_stride - frame->y_width + 2;
- prev += frame->y_stride - frame->y_width + 2;
- next += frame->y_stride - frame->y_width + 2;
- }
- return (double)num_edge_pels / num_pels;
-}
-
// Function to test for conditions that indicate we should loop
// back and recode a frame.
-static int recode_loop_test(VP9_COMP *cpi,
+static int recode_loop_test(const VP9_COMP *cpi,
int high_limit, int low_limit,
int q, int maxq, int minq) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const RATE_CONTROL *const rc = &cpi->rc;
int force_recode = 0;
- VP9_COMMON *cm = &cpi->common;
- // Is frame recode allowed at all
- // Yes if either recode mode 1 is selected or mode two is selected
- // and the frame is a key frame. golden frame or alt_ref_frame
- if ((cpi->sf.recode_loop == 1) ||
- ((cpi->sf.recode_loop == 2) &&
- ((cm->frame_type == KEY_FRAME) ||
- cpi->refresh_golden_frame ||
- cpi->refresh_alt_ref_frame))) {
+ // Special case trap if maximum allowed frame size exceeded.
+ if (rc->projected_frame_size > rc->max_frame_bandwidth) {
+ force_recode = 1;
+
+ // Is frame recode allowed.
+ // Yes if either recode mode 1 is selected or mode 2 is selected
+ // and the frame is a key frame, golden frame or alt_ref_frame
+ } else if ((cpi->sf.recode_loop == ALLOW_RECODE) ||
+ ((cpi->sf.recode_loop == ALLOW_RECODE_KFARFGF) &&
+ (cm->frame_type == KEY_FRAME ||
+ cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame))) {
// General over and under shoot tests
- if (((cpi->projected_frame_size > high_limit) && (q < maxq)) ||
- ((cpi->projected_frame_size < low_limit) && (q > minq))) {
+ if ((rc->projected_frame_size > high_limit && q < maxq) ||
+ (rc->projected_frame_size < low_limit && q > minq)) {
force_recode = 1;
} else if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
// Deal with frame undershoot and whether or not we are
// below the automatically set cq level.
if (q > cpi->cq_target_quality &&
- cpi->projected_frame_size < ((cpi->this_frame_target * 7) >> 3)) {
+ rc->projected_frame_size < ((rc->this_frame_target * 7) >> 3)) {
force_recode = 1;
- } else if (q > cpi->oxcf.cq_level &&
- cpi->projected_frame_size < cpi->min_frame_bandwidth &&
- cpi->active_best_quality > cpi->oxcf.cq_level) {
- // Severe undershoot and between auto and user cq level
- force_recode = 1;
- cpi->active_best_quality = cpi->oxcf.cq_level;
}
}
}
-
return force_recode;
}
-static void update_reference_frames(VP9_COMP * const cpi) {
+void vp9_update_reference_frames(VP9_COMP *cpi) {
VP9_COMMON * const cm = &cpi->common;
// At this point the new frame has been encoded.
// If any buffer copy / swapping is signaled it should be done here.
if (cm->frame_type == KEY_FRAME) {
- ref_cnt_fb(cm->fb_idx_ref_cnt,
+ ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[cpi->gld_fb_idx], cm->new_fb_idx);
- ref_cnt_fb(cm->fb_idx_ref_cnt,
+ ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[cpi->alt_fb_idx], cm->new_fb_idx);
}
#if CONFIG_MULTIPLE_ARF
@@ -2600,7 +2479,7 @@ static void update_reference_frames(VP9_COMP * const cpi) {
*/
int tmp;
- ref_cnt_fb(cm->fb_idx_ref_cnt,
+ ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[cpi->alt_fb_idx], cm->new_fb_idx);
tmp = cpi->alt_fb_idx;
@@ -2614,18 +2493,18 @@ static void update_reference_frames(VP9_COMP * const cpi) {
arf_idx = cpi->arf_buffer_idx[cpi->sequence_number + 1];
}
#endif
- ref_cnt_fb(cm->fb_idx_ref_cnt,
+ ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[arf_idx], cm->new_fb_idx);
}
if (cpi->refresh_golden_frame) {
- ref_cnt_fb(cm->fb_idx_ref_cnt,
+ ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[cpi->gld_fb_idx], cm->new_fb_idx);
}
}
if (cpi->refresh_last_frame) {
- ref_cnt_fb(cm->fb_idx_ref_cnt,
+ ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[cpi->lst_fb_idx], cm->new_fb_idx);
}
}
@@ -2649,36 +2528,32 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
}
if (lf->filter_level > 0) {
- vp9_set_alt_lf_level(cpi, lf->filter_level);
vp9_loop_filter_frame(cm, xd, lf->filter_level, 0, 0);
}
- vp9_extend_frame_inner_borders(cm->frame_to_show,
- cm->subsampling_x, cm->subsampling_y);
+ vp9_extend_frame_inner_borders(cm->frame_to_show);
}
-static void scale_references(VP9_COMP *cpi) {
+void vp9_scale_references(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
- int i;
- int refs[ALLOWED_REFS_PER_FRAME] = {cpi->lst_fb_idx, cpi->gld_fb_idx,
- cpi->alt_fb_idx};
+ MV_REFERENCE_FRAME ref_frame;
- for (i = 0; i < 3; i++) {
- YV12_BUFFER_CONFIG *ref = &cm->yv12_fb[cm->ref_frame_map[refs[i]]];
+ for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
+ const int idx = cm->ref_frame_map[get_ref_frame_idx(cpi, ref_frame)];
+ YV12_BUFFER_CONFIG *const ref = &cm->frame_bufs[idx].buf;
if (ref->y_crop_width != cm->width ||
ref->y_crop_height != cm->height) {
- int new_fb = get_free_fb(cm);
-
- vp9_realloc_frame_buffer(&cm->yv12_fb[new_fb],
+ const int new_fb = get_free_fb(cm);
+ vp9_realloc_frame_buffer(&cm->frame_bufs[new_fb].buf,
cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS);
- scale_and_extend_frame(ref, &cm->yv12_fb[new_fb]);
- cpi->scaled_ref_idx[i] = new_fb;
+ VP9_ENC_BORDER_IN_PIXELS, NULL, NULL, NULL);
+ scale_and_extend_frame(ref, &cm->frame_bufs[new_fb].buf);
+ cpi->scaled_ref_idx[ref_frame - 1] = new_fb;
} else {
- cpi->scaled_ref_idx[i] = cm->ref_frame_map[refs[i]];
- cm->fb_idx_ref_cnt[cm->ref_frame_map[refs[i]]]++;
+ cpi->scaled_ref_idx[ref_frame - 1] = idx;
+ cm->frame_bufs[idx].ref_count++;
}
}
}
@@ -2688,7 +2563,7 @@ static void release_scaled_references(VP9_COMP *cpi) {
int i;
for (i = 0; i < 3; i++)
- cm->fb_idx_ref_cnt[cpi->scaled_ref_idx[i]]--;
+ cm->frame_bufs[cpi->scaled_ref_idx[i]].ref_count--;
}
static void full_to_model_count(unsigned int *model_count,
@@ -2697,22 +2572,20 @@ static void full_to_model_count(unsigned int *model_count,
model_count[ZERO_TOKEN] = full_count[ZERO_TOKEN];
model_count[ONE_TOKEN] = full_count[ONE_TOKEN];
model_count[TWO_TOKEN] = full_count[TWO_TOKEN];
- for (n = THREE_TOKEN; n < DCT_EOB_TOKEN; ++n)
+ for (n = THREE_TOKEN; n < EOB_TOKEN; ++n)
model_count[TWO_TOKEN] += full_count[n];
- model_count[DCT_EOB_MODEL_TOKEN] = full_count[DCT_EOB_TOKEN];
+ model_count[EOB_MODEL_TOKEN] = full_count[EOB_TOKEN];
}
-static void full_to_model_counts(
- vp9_coeff_count_model *model_count, vp9_coeff_count *full_count) {
+static void full_to_model_counts(vp9_coeff_count_model *model_count,
+ vp9_coeff_count *full_count) {
int i, j, k, l;
- for (i = 0; i < BLOCK_TYPES; ++i)
+
+ for (i = 0; i < PLANE_TYPES; ++i)
for (j = 0; j < REF_TYPES; ++j)
for (k = 0; k < COEF_BANDS; ++k)
- for (l = 0; l < PREV_COEF_CONTEXTS; ++l) {
- if (l >= 3 && k == 0)
- continue;
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l)
full_to_model_count(model_count[i][j][k][l], full_count[i][j][k][l]);
- }
}
#if 0 && CONFIG_INTERNAL_STATS
@@ -2721,34 +2594,37 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
FILE *const f = fopen("tmp.stt", cm->current_video_frame ? "a" : "w");
int recon_err;
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
recon_err = vp9_calc_ss_err(cpi->Source, get_frame_new_buffer(cm));
if (cpi->twopass.total_left_stats.coded_error != 0.0)
- fprintf(f, "%10d %10d %10d %10d %10d %10d %10d %10d %10d"
- "%7.2f %7.2f %7.2f %7.2f %7.2f %7.2f %7.2f"
- "%6d %6d %5d %5d %5d %8.2f %10d %10.3f"
- "%10.3f %8d %10d %10d %10d\n",
- cpi->common.current_video_frame, cpi->this_frame_target,
- cpi->projected_frame_size, 0,
- (cpi->projected_frame_size - cpi->this_frame_target),
- (int)cpi->total_target_vs_actual,
- (int)(cpi->oxcf.starting_buffer_level - cpi->bits_off_target),
- (int)cpi->total_actual_bits, cm->base_qindex,
+ fprintf(f, "%10u %10d %10d %10d %10d %10d "
+ "%10"PRId64" %10"PRId64" %10d "
+ "%7.2lf %7.2lf %7.2lf %7.2lf %7.2lf"
+ "%6d %6d %5d %5d %5d "
+ "%10"PRId64" %10.3lf"
+ "%10lf %8u %10d %10d %10d\n",
+ cpi->common.current_video_frame, cpi->rc.this_frame_target,
+ cpi->rc.projected_frame_size,
+ cpi->rc.projected_frame_size / cpi->common.MBs,
+ (cpi->rc.projected_frame_size - cpi->rc.this_frame_target),
+ cpi->rc.total_target_vs_actual,
+ (cpi->oxcf.starting_buffer_level - cpi->rc.bits_off_target),
+ cpi->rc.total_actual_bits, cm->base_qindex,
vp9_convert_qindex_to_q(cm->base_qindex),
(double)vp9_dc_quant(cm->base_qindex, 0) / 4.0,
- vp9_convert_qindex_to_q(cpi->active_best_quality),
- vp9_convert_qindex_to_q(cpi->active_worst_quality), cpi->avg_q,
- vp9_convert_qindex_to_q(cpi->ni_av_qi),
+ cpi->rc.avg_q,
+ vp9_convert_qindex_to_q(cpi->rc.ni_av_qi),
vp9_convert_qindex_to_q(cpi->cq_target_quality),
cpi->refresh_last_frame, cpi->refresh_golden_frame,
- cpi->refresh_alt_ref_frame, cm->frame_type, cpi->gfu_boost,
- cpi->twopass.est_max_qcorrection_factor, (int)cpi->twopass.bits_left,
+ cpi->refresh_alt_ref_frame, cm->frame_type, cpi->rc.gfu_boost,
+ cpi->twopass.bits_left,
cpi->twopass.total_left_stats.coded_error,
- (double)cpi->twopass.bits_left /
+ cpi->twopass.bits_left /
(1 + cpi->twopass.total_left_stats.coded_error),
- cpi->tot_recode_hits, recon_err, cpi->kf_boost, cpi->kf_zeromotion_pct);
+ cpi->tot_recode_hits, recon_err, cpi->rc.kf_boost,
+ cpi->twopass.kf_zeromotion_pct);
fclose(f);
@@ -2762,8 +2638,6 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
for (i = 0; i < MAX_MODES; ++i)
fprintf(fmodes, "%5d ", cpi->mode_chosen_counts[i]);
- for (i = 0; i < MAX_REFS; ++i)
- fprintf(fmodes, "%5d ", cpi->sub8x8_mode_chosen_counts[i]);
fprintf(fmodes, "\n");
@@ -2772,403 +2646,68 @@ static void output_frame_level_debug_stats(VP9_COMP *cpi) {
}
#endif
-static int pick_q_and_adjust_q_bounds(VP9_COMP *cpi,
- int * bottom_index, int * top_index) {
- // Set an active best quality and if necessary active worst quality
- int q = cpi->active_worst_quality;
+static void encode_without_recode_loop(VP9_COMP *cpi,
+ size_t *size,
+ uint8_t *dest,
+ int q) {
VP9_COMMON *const cm = &cpi->common;
+ vp9_clear_system_state();
+ vp9_set_quantizer(cpi, q);
- if (frame_is_intra_only(cm)) {
-#if !CONFIG_MULTIPLE_ARF
- // Handle the special case for key frames forced when we have75 reached
- // the maximum key frame interval. Here force the Q to a range
- // based on the ambient Q to reduce the risk of popping.
- if (cpi->this_key_frame_forced) {
- int delta_qindex;
- int qindex = cpi->last_boosted_qindex;
- double last_boosted_q = vp9_convert_qindex_to_q(qindex);
-
- delta_qindex = vp9_compute_qdelta(cpi, last_boosted_q,
- (last_boosted_q * 0.75));
-
- cpi->active_best_quality = MAX(qindex + delta_qindex,
- cpi->best_quality);
- } else {
- int high = 5000;
- int low = 400;
- double q_adj_factor = 1.0;
- double q_val;
-
- // Baseline value derived from cpi->active_worst_quality and kf boost
- cpi->active_best_quality = get_active_quality(q, cpi->kf_boost,
- low, high,
- kf_low_motion_minq,
- kf_high_motion_minq);
-
- // Allow somewhat lower kf minq with small image formats.
- if ((cm->width * cm->height) <= (352 * 288)) {
- q_adj_factor -= 0.25;
- }
-
- // Make a further adjustment based on the kf zero motion measure.
- q_adj_factor += 0.05 - (0.001 * (double)cpi->kf_zeromotion_pct);
-
- // Convert the adjustment factor to a qindex delta
- // on active_best_quality.
- q_val = vp9_convert_qindex_to_q(cpi->active_best_quality);
- cpi->active_best_quality +=
- vp9_compute_qdelta(cpi, q_val, (q_val * q_adj_factor));
- }
-#else
- double current_q;
- // Force the KF quantizer to be 30% of the active_worst_quality.
- current_q = vp9_convert_qindex_to_q(cpi->active_worst_quality);
- cpi->active_best_quality = cpi->active_worst_quality
- + vp9_compute_qdelta(cpi, current_q, current_q * 0.3);
-#endif
- } else if (!cpi->is_src_frame_alt_ref &&
- (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
- int high = 2000;
- int low = 400;
-
- // Use the lower of cpi->active_worst_quality and recent
- // average Q as basis for GF/ARF best Q limit unless last frame was
- // a key frame.
- if (cpi->frames_since_key > 1 &&
- cpi->avg_frame_qindex < cpi->active_worst_quality) {
- q = cpi->avg_frame_qindex;
- }
- // For constrained quality dont allow Q less than the cq level
- if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
- if (q < cpi->cq_target_quality)
- q = cpi->cq_target_quality;
- if (cpi->frames_since_key > 1) {
- cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost,
- low, high,
- afq_low_motion_minq,
- afq_high_motion_minq);
- } else {
- cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost,
- low, high,
- gf_low_motion_minq,
- gf_high_motion_minq);
- }
- // Constrained quality use slightly lower active best.
- cpi->active_best_quality = cpi->active_best_quality * 15 / 16;
-
- } else if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
- if (!cpi->refresh_alt_ref_frame) {
- cpi->active_best_quality = cpi->cq_target_quality;
- } else {
- if (cpi->frames_since_key > 1) {
- cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost,
- low, high,
- afq_low_motion_minq,
- afq_high_motion_minq);
- } else {
- cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost,
- low, high,
- gf_low_motion_minq,
- gf_high_motion_minq);
- }
- }
- } else {
- cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost,
- low, high,
- gf_low_motion_minq,
- gf_high_motion_minq);
- }
- } else {
- if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
- cpi->active_best_quality = cpi->cq_target_quality;
- } else {
- cpi->active_best_quality = inter_minq[q];
- // 1-pass: for now, use the average Q for the active_best, if its lower
- // than active_worst.
- if (cpi->pass == 0 && (cpi->avg_frame_qindex < q))
- cpi->active_best_quality = inter_minq[cpi->avg_frame_qindex];
-
- // For the constrained quality mode we don't want
- // q to fall below the cq level.
- if ((cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) &&
- (cpi->active_best_quality < cpi->cq_target_quality)) {
- // If we are strongly undershooting the target rate in the last
- // frames then use the user passed in cq value not the auto
- // cq value.
- if (cpi->rolling_actual_bits < cpi->min_frame_bandwidth)
- cpi->active_best_quality = cpi->oxcf.cq_level;
- else
- cpi->active_best_quality = cpi->cq_target_quality;
- }
- }
- }
-
- // Clip the active best and worst quality values to limits
- if (cpi->active_worst_quality > cpi->worst_quality)
- cpi->active_worst_quality = cpi->worst_quality;
-
- if (cpi->active_best_quality < cpi->best_quality)
- cpi->active_best_quality = cpi->best_quality;
-
- if (cpi->active_best_quality > cpi->worst_quality)
- cpi->active_best_quality = cpi->worst_quality;
-
- if (cpi->active_worst_quality < cpi->active_best_quality)
- cpi->active_worst_quality = cpi->active_best_quality;
-
- // Limit Q range for the adaptive loop.
- if (cm->frame_type == KEY_FRAME && !cpi->this_key_frame_forced) {
- *top_index =
- (cpi->active_worst_quality + cpi->active_best_quality * 3) / 4;
- // If this is the first (key) frame in 1-pass, active best is the user
- // best-allowed, and leave the top_index to active_worst.
- if (cpi->pass == 0 && cpi->common.current_video_frame == 0) {
- cpi->active_best_quality = cpi->oxcf.best_allowed_q;
- *top_index = cpi->oxcf.worst_allowed_q;
- }
- } else if (!cpi->is_src_frame_alt_ref &&
- (cpi->oxcf.end_usage != USAGE_STREAM_FROM_SERVER) &&
- (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
- *top_index =
- (cpi->active_worst_quality + cpi->active_best_quality) / 2;
- } else {
- *top_index = cpi->active_worst_quality;
- }
- *bottom_index = cpi->active_best_quality;
-
- if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
- q = cpi->active_best_quality;
- // Special case code to try and match quality with forced key frames
- } else if ((cm->frame_type == KEY_FRAME) && cpi->this_key_frame_forced) {
- q = cpi->last_boosted_qindex;
+ // Set up entropy context depending on frame type. The decoder mandates
+ // the use of the default context, index 0, for keyframes and inter
+ // frames where the error_resilient_mode or intra_only flag is set. For
+ // other inter-frames the encoder currently uses only two contexts;
+ // context 1 for ALTREF frames and context 0 for the others.
+ if (cm->frame_type == KEY_FRAME) {
+ vp9_setup_key_frame(cpi);
} else {
- // Determine initial Q to try.
- if (cpi->pass == 0) {
- // 1-pass: for now, use per-frame-bw for target size of frame, scaled
- // by |x| for key frame.
- int scale = (cm->frame_type == KEY_FRAME) ? 5 : 1;
- q = vp9_regulate_q(cpi, scale * cpi->av_per_frame_bandwidth);
- } else {
- q = vp9_regulate_q(cpi, cpi->this_frame_target);
+ if (!cm->intra_only && !cm->error_resilient_mode && !cpi->use_svc) {
+ cpi->common.frame_context_idx = cpi->refresh_alt_ref_frame;
}
- if (q > *top_index)
- q = *top_index;
- }
-
- return q;
+ vp9_setup_inter_frame(cpi);
+ }
+ // Variance adaptive and in frame q adjustment experiments are mutually
+ // exclusive.
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_vaq_frame_setup(cpi);
+ } else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) {
+ setup_in_frame_q_adj(cpi);
+ } else if (cpi->oxcf.aq_mode == CYCLIC_REFRESH_AQ) {
+ vp9_setup_cyclic_refresh_aq(cpi);
+ }
+ // transform / motion compensation build reconstruction frame
+ vp9_encode_frame(cpi);
+
+ // Update the skip mb flag probabilities based on the distribution
+ // seen in the last encoder iteration.
+ // update_base_skip_probs(cpi);
+ vp9_clear_system_state();
}
-static void encode_frame_to_data_rate(VP9_COMP *cpi,
- unsigned long *size,
- unsigned char *dest,
- unsigned int *frame_flags) {
- VP9_COMMON *const cm = &cpi->common;
- TX_SIZE t;
- int q;
- int frame_over_shoot_limit;
- int frame_under_shoot_limit;
+static void encode_with_recode_loop(VP9_COMP *cpi,
+ size_t *size,
+ uint8_t *dest,
+ int q,
+ int bottom_index,
+ int top_index) {
+ VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
+ int loop_count = 0;
int loop = 0;
- int loop_count;
-
- int q_low;
- int q_high;
-
- int top_index;
- int bottom_index;
- int active_worst_qchanged = 0;
-
int overshoot_seen = 0;
int undershoot_seen = 0;
+ int q_low = bottom_index, q_high = top_index;
+ int frame_over_shoot_limit;
+ int frame_under_shoot_limit;
- SPEED_FEATURES *const sf = &cpi->sf;
- unsigned int max_mv_def = MIN(cpi->common.width, cpi->common.height);
- struct segmentation *const seg = &cm->seg;
-
- /* Scale the source buffer, if required. */
- if (cm->mi_cols * 8 != cpi->un_scaled_source->y_width ||
- cm->mi_rows * 8 != cpi->un_scaled_source->y_height) {
- scale_and_extend_frame(cpi->un_scaled_source, &cpi->scaled_source);
- cpi->Source = &cpi->scaled_source;
- } else {
- cpi->Source = cpi->un_scaled_source;
- }
- scale_references(cpi);
-
- // Clear down mmx registers to allow floating point in what follows.
- vp9_clear_system_state();
-
- // For an alt ref frame in 2 pass we skip the call to the second
- // pass function that sets the target bandwidth so we must set it here.
- if (cpi->refresh_alt_ref_frame) {
- // Set a per frame bit target for the alt ref frame.
- cpi->per_frame_bandwidth = cpi->twopass.gf_bits;
- // Set a per second target bitrate.
- cpi->target_bandwidth = (int)(cpi->twopass.gf_bits * cpi->output_framerate);
- }
-
- // Clear zbin over-quant value and mode boost values.
- cpi->zbin_mode_boost = 0;
-
- // Enable or disable mode based tweaking of the zbin.
- // For 2 pass only used where GF/ARF prediction quality
- // is above a threshold.
- cpi->zbin_mode_boost = 0;
- cpi->zbin_mode_boost_enabled = 0;
-
- // Current default encoder behavior for the altref sign bias.
- cpi->common.ref_frame_sign_bias[ALTREF_FRAME] = cpi->source_alt_ref_active;
-
- // Check to see if a key frame is signaled.
- // For two pass with auto key frame enabled cm->frame_type may already be
- // set, but not for one pass.
- if ((cm->current_video_frame == 0) ||
- (cm->frame_flags & FRAMEFLAGS_KEY) ||
- (cpi->oxcf.auto_key && (cpi->frames_since_key %
- cpi->key_frame_frequency == 0))) {
- // Set frame type to key frame for the force key frame, if we exceed the
- // maximum distance in an automatic keyframe selection or for the first
- // frame.
- cm->frame_type = KEY_FRAME;
- }
-
- // Set default state for segment based loop filter update flags.
- cm->lf.mode_ref_delta_update = 0;
-
- // Initialize cpi->mv_step_param to default based on max resolution.
- cpi->mv_step_param = vp9_init_search_range(cpi, max_mv_def);
- // Initialize cpi->max_mv_magnitude and cpi->mv_step_param if appropriate.
- if (sf->auto_mv_step_size) {
- if (frame_is_intra_only(&cpi->common)) {
- // Initialize max_mv_magnitude for use in the first INTER frame
- // after a key/intra-only frame.
- cpi->max_mv_magnitude = max_mv_def;
- } else {
- if (cm->show_frame)
- // Allow mv_steps to correspond to twice the max mv magnitude found
- // in the previous frame, capped by the default max_mv_magnitude based
- // on resolution.
- cpi->mv_step_param = vp9_init_search_range(
- cpi, MIN(max_mv_def, 2 * cpi->max_mv_magnitude));
- cpi->max_mv_magnitude = 0;
- }
- }
-
- // Set various flags etc to special state if it is a key frame.
- if (frame_is_intra_only(cm)) {
- vp9_setup_key_frame(cpi);
- // Reset the loop filter deltas and segmentation map.
- setup_features(cm);
-
- // If segmentation is enabled force a map update for key frames.
- if (seg->enabled) {
- seg->update_map = 1;
- seg->update_data = 1;
- }
-
- // The alternate reference frame cannot be active for a key frame.
- cpi->source_alt_ref_active = 0;
-
- cm->error_resilient_mode = (cpi->oxcf.error_resilient_mode != 0);
- cm->frame_parallel_decoding_mode =
- (cpi->oxcf.frame_parallel_decoding_mode != 0);
- if (cm->error_resilient_mode) {
- cm->frame_parallel_decoding_mode = 1;
- cm->reset_frame_context = 0;
- cm->refresh_frame_context = 0;
- } else if (cm->intra_only) {
- // Only reset the current context.
- cm->reset_frame_context = 2;
- }
- }
-
- // Configure experimental use of segmentation for enhanced coding of
- // static regions if indicated.
- // Only allowed in second pass of two pass (as requires lagged coding)
- // and if the relevant speed feature flag is set.
- if ((cpi->pass == 2) && (cpi->sf.static_segmentation)) {
- configure_static_seg_features(cpi);
- }
-
- // Decide how big to make the frame.
- vp9_pick_frame_size(cpi);
-
- vp9_clear_system_state();
-
- q = pick_q_and_adjust_q_bounds(cpi, &bottom_index, &top_index);
-
- q_high = top_index;
- q_low = bottom_index;
-
- vp9_compute_frame_size_bounds(cpi, &frame_under_shoot_limit,
- &frame_over_shoot_limit);
-
-#if CONFIG_MULTIPLE_ARF
- // Force the quantizer determined by the coding order pattern.
- if (cpi->multi_arf_enabled && (cm->frame_type != KEY_FRAME) &&
- cpi->oxcf.end_usage != USAGE_CONSTANT_QUALITY) {
- double new_q;
- double current_q = vp9_convert_qindex_to_q(cpi->active_worst_quality);
- int level = cpi->this_frame_weight;
- assert(level >= 0);
-
- // Set quantizer steps at 10% increments.
- new_q = current_q * (1.0 - (0.2 * (cpi->max_arf_level - level)));
- q = cpi->active_worst_quality + vp9_compute_qdelta(cpi, current_q, new_q);
-
- bottom_index = q;
- top_index = q;
- q_low = q;
- q_high = q;
-
- printf("frame:%d q:%d\n", cm->current_video_frame, q);
- }
-#endif
-
- loop_count = 0;
- vp9_zero(cpi->rd_tx_select_threshes);
-
- if (!frame_is_intra_only(cm)) {
- cm->mcomp_filter_type = DEFAULT_INTERP_FILTER;
- /* TODO: Decide this more intelligently */
- cm->allow_high_precision_mv = q < HIGH_PRECISION_MV_QTHRESH;
- set_mvcost(cpi);
- }
-
-#if CONFIG_VP9_POSTPROC
-
- if (cpi->oxcf.noise_sensitivity > 0) {
- int l = 0;
-
- switch (cpi->oxcf.noise_sensitivity) {
- case 1:
- l = 20;
- break;
- case 2:
- l = 40;
- break;
- case 3:
- l = 60;
- break;
- case 4:
- case 5:
- l = 100;
- break;
- case 6:
- l = 150;
- break;
- }
-
- vp9_denoise(cpi->Source, cpi->Source, l);
- }
-
-#endif
-
-#ifdef OUTPUT_YUV_SRC
- vp9_write_yuv_frame(cpi->Source);
-#endif
+ // Decide frame size bounds
+ vp9_rc_compute_frame_size_bounds(cpi, rc->this_frame_target,
+ &frame_under_shoot_limit,
+ &frame_over_shoot_limit);
do {
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
vp9_set_quantizer(cpi, q);
@@ -3181,45 +2720,52 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
if (cm->frame_type == KEY_FRAME) {
vp9_setup_key_frame(cpi);
} else {
- if (!cm->intra_only && !cm->error_resilient_mode) {
+ if (!cm->intra_only && !cm->error_resilient_mode && !cpi->use_svc) {
cpi->common.frame_context_idx = cpi->refresh_alt_ref_frame;
}
vp9_setup_inter_frame(cpi);
}
}
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_vaq_frame_setup(cpi);
+ // Variance adaptive and in frame q adjustment experiments are mutually
+ // exclusive.
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_vaq_frame_setup(cpi);
+ } else if (cpi->oxcf.aq_mode == COMPLEXITY_AQ) {
+ setup_in_frame_q_adj(cpi);
}
// transform / motion compensation build reconstruction frame
-
vp9_encode_frame(cpi);
// Update the skip mb flag probabilities based on the distribution
// seen in the last encoder iteration.
// update_base_skip_probs(cpi);
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
// Dummy pack of the bitstream using up to date stats to get an
// accurate estimate of output frame size to determine if we need
// to recode.
- vp9_save_coding_context(cpi);
- cpi->dummy_packing = 1;
- vp9_pack_bitstream(cpi, dest, size);
- cpi->projected_frame_size = (*size) << 3;
- vp9_restore_coding_context(cpi);
+ if (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF) {
+ vp9_save_coding_context(cpi);
+ cpi->dummy_packing = 1;
+ if (!cpi->sf.use_nonrd_pick_mode)
+ vp9_pack_bitstream(cpi, dest, size);
+
+ rc->projected_frame_size = (int)(*size) << 3;
+ vp9_restore_coding_context(cpi);
- if (frame_over_shoot_limit == 0)
- frame_over_shoot_limit = 1;
- active_worst_qchanged = 0;
+ if (frame_over_shoot_limit == 0)
+ frame_over_shoot_limit = 1;
+ }
if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
loop = 0;
} else {
- // Special case handling for forced key frames
- if ((cm->frame_type == KEY_FRAME) && cpi->this_key_frame_forced) {
+ if ((cm->frame_type == KEY_FRAME) &&
+ rc->this_key_frame_forced &&
+ (rc->projected_frame_size < rc->max_frame_bandwidth)) {
int last_q = q;
int kf_err = vp9_calc_ss_err(cpi->Source, get_frame_new_buffer(cm));
@@ -3232,9 +2778,9 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
// The key frame is not good enough or we can afford
// to make it better without undue risk of popping.
if ((kf_err > high_err_target &&
- cpi->projected_frame_size <= frame_over_shoot_limit) ||
+ rc->projected_frame_size <= frame_over_shoot_limit) ||
(kf_err > low_err_target &&
- cpi->projected_frame_size <= frame_under_shoot_limit)) {
+ rc->projected_frame_size <= frame_under_shoot_limit)) {
// Lower q_high
q_high = q > q_low ? q - 1 : q_low;
@@ -3242,7 +2788,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
q = (q * high_err_target) / kf_err;
q = MIN(q, (q_high + q_low) >> 1);
} else if (kf_err < low_err_target &&
- cpi->projected_frame_size >= frame_under_shoot_limit) {
+ rc->projected_frame_size >= frame_under_shoot_limit) {
// The key frame is much better than the previous frame
// Raise q_low
q_low = q < q_high ? q + 1 : q_high;
@@ -3258,7 +2804,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
loop = q != last_q;
} else if (recode_loop_test(
cpi, frame_over_shoot_limit, frame_under_shoot_limit,
- q, top_index, bottom_index)) {
+ q, MAX(q_high, top_index), bottom_index)) {
// Is the projected frame size out of range and are we allowed
// to attempt to recode.
int last_q = q;
@@ -3268,28 +2814,30 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
// Update correction factor & compute new Q to try...
// Frame is too large
- if (cpi->projected_frame_size > cpi->this_frame_target) {
+ if (rc->projected_frame_size > rc->this_frame_target) {
+ // Special case if the projected size is > the max allowed.
+ if (rc->projected_frame_size >= rc->max_frame_bandwidth)
+ q_high = rc->worst_quality;
+
// Raise Qlow as to at least the current value
q_low = q < q_high ? q + 1 : q_high;
if (undershoot_seen || loop_count > 1) {
// Update rate_correction_factor unless
- // cpi->active_worst_quality has changed.
- if (!active_worst_qchanged)
- vp9_update_rate_correction_factors(cpi, 1);
+ vp9_rc_update_rate_correction_factors(cpi, 1);
q = (q_high + q_low + 1) / 2;
} else {
// Update rate_correction_factor unless
- // cpi->active_worst_quality has changed.
- if (!active_worst_qchanged)
- vp9_update_rate_correction_factors(cpi, 0);
+ vp9_rc_update_rate_correction_factors(cpi, 0);
- q = vp9_regulate_q(cpi, cpi->this_frame_target);
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ bottom_index, MAX(q_high, top_index));
while (q < q_low && retries < 10) {
- vp9_update_rate_correction_factors(cpi, 0);
- q = vp9_regulate_q(cpi, cpi->this_frame_target);
+ vp9_rc_update_rate_correction_factors(cpi, 0);
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ bottom_index, MAX(q_high, top_index));
retries++;
}
}
@@ -3300,31 +2848,25 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
q_high = q > q_low ? q - 1 : q_low;
if (overshoot_seen || loop_count > 1) {
- // Update rate_correction_factor unless
- // cpi->active_worst_quality has changed.
- if (!active_worst_qchanged)
- vp9_update_rate_correction_factors(cpi, 1);
-
+ vp9_rc_update_rate_correction_factors(cpi, 1);
q = (q_high + q_low) / 2;
} else {
- // Update rate_correction_factor unless
- // cpi->active_worst_quality has changed.
- if (!active_worst_qchanged)
- vp9_update_rate_correction_factors(cpi, 0);
-
- q = vp9_regulate_q(cpi, cpi->this_frame_target);
-
+ vp9_rc_update_rate_correction_factors(cpi, 0);
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ bottom_index, top_index);
// Special case reset for qlow for constrained quality.
// This should only trigger where there is very substantial
// undershoot on a frame and the auto cq level is above
// the user passsed in value.
- if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY && q < q_low) {
+ if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY &&
+ q < q_low) {
q_low = q;
}
while (q > q_high && retries < 10) {
- vp9_update_rate_correction_factors(cpi, 0);
- q = vp9_regulate_q(cpi, cpi->this_frame_target);
+ vp9_rc_update_rate_correction_factors(cpi, 0);
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ bottom_index, top_index);
retries++;
}
}
@@ -3341,7 +2883,9 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
}
}
- if (cpi->is_src_frame_alt_ref)
+ // Special case for overlay frame.
+ if (rc->is_src_frame_alt_ref &&
+ rc->projected_frame_size < rc->max_frame_bandwidth)
loop = 0;
if (loop) {
@@ -3352,14 +2896,225 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
#endif
}
} while (loop);
+}
+
+static void get_ref_frame_flags(VP9_COMP *cpi) {
+ if (cpi->refresh_last_frame & cpi->refresh_golden_frame)
+ cpi->gold_is_last = 1;
+ else if (cpi->refresh_last_frame ^ cpi->refresh_golden_frame)
+ cpi->gold_is_last = 0;
+
+ if (cpi->refresh_last_frame & cpi->refresh_alt_ref_frame)
+ cpi->alt_is_last = 1;
+ else if (cpi->refresh_last_frame ^ cpi->refresh_alt_ref_frame)
+ cpi->alt_is_last = 0;
+
+ if (cpi->refresh_alt_ref_frame & cpi->refresh_golden_frame)
+ cpi->gold_is_alt = 1;
+ else if (cpi->refresh_alt_ref_frame ^ cpi->refresh_golden_frame)
+ cpi->gold_is_alt = 0;
+
+ cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
+
+ if (cpi->gold_is_last)
+ cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
+
+ if (cpi->rc.frames_till_gf_update_due == INT_MAX)
+ cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
+
+ if (cpi->alt_is_last)
+ cpi->ref_frame_flags &= ~VP9_ALT_FLAG;
+
+ if (cpi->gold_is_alt)
+ cpi->ref_frame_flags &= ~VP9_ALT_FLAG;
+}
+
+static void set_ext_overrides(VP9_COMP *cpi) {
+ // Overrides the defaults with the externally supplied values with
+ // vp9_update_reference() and vp9_update_entropy() calls
+ // Note: The overrides are valid only for the next frame passed
+ // to encode_frame_to_data_rate() function
+ if (cpi->ext_refresh_frame_context_pending) {
+ cpi->common.refresh_frame_context = cpi->ext_refresh_frame_context;
+ cpi->ext_refresh_frame_context_pending = 0;
+ }
+ if (cpi->ext_refresh_frame_flags_pending) {
+ cpi->refresh_last_frame = cpi->ext_refresh_last_frame;
+ cpi->refresh_golden_frame = cpi->ext_refresh_golden_frame;
+ cpi->refresh_alt_ref_frame = cpi->ext_refresh_alt_ref_frame;
+ cpi->ext_refresh_frame_flags_pending = 0;
+ }
+}
+
+static void encode_frame_to_data_rate(VP9_COMP *cpi,
+ size_t *size,
+ uint8_t *dest,
+ unsigned int *frame_flags) {
+ VP9_COMMON *const cm = &cpi->common;
+ TX_SIZE t;
+ int q;
+ int top_index;
+ int bottom_index;
+
+ const SPEED_FEATURES *const sf = &cpi->sf;
+ const unsigned int max_mv_def = MIN(cm->width, cm->height);
+ struct segmentation *const seg = &cm->seg;
+
+ set_ext_overrides(cpi);
+
+ /* Scale the source buffer, if required. */
+ if (cm->mi_cols * MI_SIZE != cpi->un_scaled_source->y_width ||
+ cm->mi_rows * MI_SIZE != cpi->un_scaled_source->y_height) {
+ scale_and_extend_frame_nonnormative(cpi->un_scaled_source,
+ &cpi->scaled_source);
+ cpi->Source = &cpi->scaled_source;
+ } else {
+ cpi->Source = cpi->un_scaled_source;
+ }
+ vp9_scale_references(cpi);
+
+ vp9_clear_system_state();
+
+ // Enable or disable mode based tweaking of the zbin.
+ // For 2 pass only used where GF/ARF prediction quality
+ // is above a threshold.
+ cpi->zbin_mode_boost = 0;
+ cpi->zbin_mode_boost_enabled = 0;
+
+ // Current default encoder behavior for the altref sign bias.
+ cm->ref_frame_sign_bias[ALTREF_FRAME] = cpi->rc.source_alt_ref_active;
+
+ // Set default state for segment based loop filter update flags.
+ cm->lf.mode_ref_delta_update = 0;
+
+ // Initialize cpi->mv_step_param to default based on max resolution.
+ cpi->mv_step_param = vp9_init_search_range(cpi, max_mv_def);
+ // Initialize cpi->max_mv_magnitude and cpi->mv_step_param if appropriate.
+ if (sf->auto_mv_step_size) {
+ if (frame_is_intra_only(cm)) {
+ // Initialize max_mv_magnitude for use in the first INTER frame
+ // after a key/intra-only frame.
+ cpi->max_mv_magnitude = max_mv_def;
+ } else {
+ if (cm->show_frame)
+ // Allow mv_steps to correspond to twice the max mv magnitude found
+ // in the previous frame, capped by the default max_mv_magnitude based
+ // on resolution.
+ cpi->mv_step_param = vp9_init_search_range(cpi, MIN(max_mv_def, 2 *
+ cpi->max_mv_magnitude));
+ cpi->max_mv_magnitude = 0;
+ }
+ }
+
+ // Set various flags etc to special state if it is a key frame.
+ if (frame_is_intra_only(cm)) {
+ vp9_setup_key_frame(cpi);
+ // Reset the loop filter deltas and segmentation map.
+ vp9_reset_segment_features(&cm->seg);
+
+ // If segmentation is enabled force a map update for key frames.
+ if (seg->enabled) {
+ seg->update_map = 1;
+ seg->update_data = 1;
+ }
+
+ // The alternate reference frame cannot be active for a key frame.
+ cpi->rc.source_alt_ref_active = 0;
+
+ cm->error_resilient_mode = (cpi->oxcf.error_resilient_mode != 0);
+ cm->frame_parallel_decoding_mode =
+ (cpi->oxcf.frame_parallel_decoding_mode != 0);
+
+ // By default, encoder assumes decoder can use prev_mi.
+ cm->coding_use_prev_mi = 1;
+ if (cm->error_resilient_mode) {
+ cm->coding_use_prev_mi = 0;
+ cm->frame_parallel_decoding_mode = 1;
+ cm->reset_frame_context = 0;
+ cm->refresh_frame_context = 0;
+ } else if (cm->intra_only) {
+ // Only reset the current context.
+ cm->reset_frame_context = 2;
+ }
+ }
+
+ // Configure experimental use of segmentation for enhanced coding of
+ // static regions if indicated.
+ // Only allowed in second pass of two pass (as requires lagged coding)
+ // and if the relevant speed feature flag is set.
+ if (cpi->pass == 2 && cpi->sf.static_segmentation)
+ configure_static_seg_features(cpi);
+
+ // For 1 pass CBR, check if we are dropping this frame.
+ // Never drop on key frame.
+ if (cpi->pass == 0 &&
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER &&
+ cm->frame_type != KEY_FRAME) {
+ if (vp9_rc_drop_frame(cpi)) {
+ vp9_rc_postencode_update_drop_frame(cpi);
+ ++cm->current_video_frame;
+ return;
+ }
+ }
+
+ vp9_clear_system_state();
+
+ vp9_zero(cpi->rd_tx_select_threshes);
+
+#if CONFIG_VP9_POSTPROC
+ if (cpi->oxcf.noise_sensitivity > 0) {
+ int l = 0;
+ switch (cpi->oxcf.noise_sensitivity) {
+ case 1:
+ l = 20;
+ break;
+ case 2:
+ l = 40;
+ break;
+ case 3:
+ l = 60;
+ break;
+ case 4:
+ case 5:
+ l = 100;
+ break;
+ case 6:
+ l = 150;
+ break;
+ }
+ vp9_denoise(cpi->Source, cpi->Source, l);
+ }
+#endif
+
+#ifdef OUTPUT_YUV_SRC
+ vp9_write_yuv_frame(cpi->Source);
+#endif
+
+ // Decide q and q bounds.
+ q = vp9_rc_pick_q_and_bounds(cpi, &bottom_index, &top_index);
+
+ if (!frame_is_intra_only(cm)) {
+ cm->interp_filter = DEFAULT_INTERP_FILTER;
+ /* TODO: Decide this more intelligently */
+ set_high_precision_mv(cpi, q < HIGH_PRECISION_MV_QTHRESH);
+ }
+
+ vp9_set_speed_features(cpi);
+
+ if (cpi->sf.recode_loop == DISALLOW_RECODE) {
+ encode_without_recode_loop(cpi, size, dest, q);
+ } else {
+ encode_with_recode_loop(cpi, size, dest, q, bottom_index, top_index);
+ }
// Special case code to reduce pulsing when key frames are forced at a
// fixed interval. Note the reconstruction error if it is the frame before
// the force key frame
- if (cpi->next_key_frame_forced && (cpi->twopass.frames_to_key == 0)) {
+ if (cpi->rc.next_key_frame_forced && cpi->rc.frames_to_key == 1) {
cpi->ambient_err = vp9_calc_ss_err(cpi->Source, get_frame_new_buffer(cm));
}
+ // If the encoder forced a KEY_FRAME decision
if (cm->frame_type == KEY_FRAME)
cpi->refresh_last_frame = 1;
@@ -3394,188 +3149,37 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
update_reference_segmentation_map(cpi);
release_scaled_references(cpi);
- update_reference_frames(cpi);
+ vp9_update_reference_frames(cpi);
for (t = TX_4X4; t <= TX_32X32; t++)
- full_to_model_counts(cpi->common.counts.coef[t],
- cpi->coef_counts[t]);
- if (!cpi->common.error_resilient_mode &&
- !cpi->common.frame_parallel_decoding_mode) {
- vp9_adapt_coef_probs(&cpi->common);
- }
-
- if (!frame_is_intra_only(&cpi->common)) {
- FRAME_COUNTS *counts = &cpi->common.counts;
-
- vp9_copy(counts->y_mode, cpi->y_mode_count);
- vp9_copy(counts->uv_mode, cpi->y_uv_mode_count);
- vp9_copy(counts->partition, cpi->partition_count);
- vp9_copy(counts->intra_inter, cpi->intra_inter_count);
- vp9_copy(counts->comp_inter, cpi->comp_inter_count);
- vp9_copy(counts->single_ref, cpi->single_ref_count);
- vp9_copy(counts->comp_ref, cpi->comp_ref_count);
- counts->mv = cpi->NMVcount;
- if (!cpi->common.error_resilient_mode &&
- !cpi->common.frame_parallel_decoding_mode) {
- vp9_adapt_mode_probs(&cpi->common);
- vp9_adapt_mv_probs(&cpi->common, cpi->common.allow_high_precision_mv);
- }
- }
-
-#ifdef ENTROPY_STATS
- vp9_update_mode_context_stats(cpi);
-#endif
-
- /* Move storing frame_type out of the above loop since it is also
- * needed in motion search besides loopfilter */
- cm->last_frame_type = cm->frame_type;
-
- // Update rate control heuristics
- cpi->total_byte_count += (*size);
- cpi->projected_frame_size = (*size) << 3;
-
- // Post encode loop adjustment of Q prediction.
- if (!active_worst_qchanged)
- vp9_update_rate_correction_factors(cpi, (cpi->sf.recode_loop ||
- cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ? 2 : 0);
-
-
- cpi->last_q[cm->frame_type] = cm->base_qindex;
-
- // Keep record of last boosted (KF/KF/ARF) Q value.
- // If the current frame is coded at a lower Q then we also update it.
- // If all mbs in this group are skipped only update if the Q value is
- // better than that already stored.
- // This is used to help set quality in forced key frames to reduce popping
- if ((cm->base_qindex < cpi->last_boosted_qindex) ||
- ((cpi->static_mb_pct < 100) &&
- ((cm->frame_type == KEY_FRAME) ||
- cpi->refresh_alt_ref_frame ||
- (cpi->refresh_golden_frame && !cpi->is_src_frame_alt_ref)))) {
- cpi->last_boosted_qindex = cm->base_qindex;
- }
-
- if (cm->frame_type == KEY_FRAME) {
- vp9_adjust_key_frame_context(cpi);
- }
-
- // Keep a record of ambient average Q.
- if (cm->frame_type != KEY_FRAME)
- cpi->avg_frame_qindex = (2 + 3 * cpi->avg_frame_qindex +
- cm->base_qindex) >> 2;
-
- // Keep a record from which we can calculate the average Q excluding GF
- // updates and key frames.
- if (cm->frame_type != KEY_FRAME &&
- !cpi->refresh_golden_frame &&
- !cpi->refresh_alt_ref_frame) {
- cpi->ni_frames++;
- cpi->tot_q += vp9_convert_qindex_to_q(q);
- cpi->avg_q = cpi->tot_q / (double)cpi->ni_frames;
-
- // Calculate the average Q for normal inter frames (not key or GFU frames).
- cpi->ni_tot_qi += q;
- cpi->ni_av_qi = cpi->ni_tot_qi / cpi->ni_frames;
- }
-
- // Update the buffer level variable.
- // Non-viewable frames are a special case and are treated as pure overhead.
- if (!cm->show_frame)
- cpi->bits_off_target -= cpi->projected_frame_size;
- else
- cpi->bits_off_target += cpi->av_per_frame_bandwidth -
- cpi->projected_frame_size;
-
- // Clip the buffer level at the maximum buffer size
- if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size)
- cpi->bits_off_target = cpi->oxcf.maximum_buffer_size;
-
- // Rolling monitors of whether we are over or underspending used to help
- // regulate min and Max Q in two pass.
- if (cm->frame_type != KEY_FRAME) {
- cpi->rolling_target_bits =
- ((cpi->rolling_target_bits * 3) + cpi->this_frame_target + 2) / 4;
- cpi->rolling_actual_bits =
- ((cpi->rolling_actual_bits * 3) + cpi->projected_frame_size + 2) / 4;
- cpi->long_rolling_target_bits =
- ((cpi->long_rolling_target_bits * 31) + cpi->this_frame_target + 16) / 32;
- cpi->long_rolling_actual_bits =
- ((cpi->long_rolling_actual_bits * 31) +
- cpi->projected_frame_size + 16) / 32;
- }
-
- // Actual bits spent
- cpi->total_actual_bits += cpi->projected_frame_size;
-
- // Debug stats
- cpi->total_target_vs_actual += (cpi->this_frame_target -
- cpi->projected_frame_size);
-
- cpi->buffer_level = cpi->bits_off_target;
-
-#ifndef DISABLE_RC_LONG_TERM_MEM
- // Update bits left to the kf and gf groups to account for overshoot or
- // undershoot on these frames
- if (cm->frame_type == KEY_FRAME) {
- cpi->twopass.kf_group_bits += cpi->this_frame_target -
- cpi->projected_frame_size;
+ full_to_model_counts(cm->counts.coef[t], cpi->coef_counts[t]);
- cpi->twopass.kf_group_bits = MAX(cpi->twopass.kf_group_bits, 0);
- } else if (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) {
- cpi->twopass.gf_group_bits += cpi->this_frame_target -
- cpi->projected_frame_size;
+ if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode)
+ vp9_adapt_coef_probs(cm);
- cpi->twopass.gf_group_bits = MAX(cpi->twopass.gf_group_bits, 0);
+ if (!frame_is_intra_only(cm)) {
+ if (!cm->error_resilient_mode && !cm->frame_parallel_decoding_mode) {
+ vp9_adapt_mode_probs(cm);
+ vp9_adapt_mv_probs(cm, cm->allow_high_precision_mv);
+ }
}
-#endif
#if 0
output_frame_level_debug_stats(cpi);
#endif
if (cpi->refresh_golden_frame == 1)
- cm->frame_flags = cm->frame_flags | FRAMEFLAGS_GOLDEN;
+ cm->frame_flags |= FRAMEFLAGS_GOLDEN;
else
- cm->frame_flags = cm->frame_flags&~FRAMEFLAGS_GOLDEN;
+ cm->frame_flags &= ~FRAMEFLAGS_GOLDEN;
if (cpi->refresh_alt_ref_frame == 1)
- cm->frame_flags = cm->frame_flags | FRAMEFLAGS_ALTREF;
+ cm->frame_flags |= FRAMEFLAGS_ALTREF;
else
- cm->frame_flags = cm->frame_flags&~FRAMEFLAGS_ALTREF;
-
-
- if (cpi->refresh_last_frame & cpi->refresh_golden_frame)
- cpi->gold_is_last = 1;
- else if (cpi->refresh_last_frame ^ cpi->refresh_golden_frame)
- cpi->gold_is_last = 0;
-
- if (cpi->refresh_last_frame & cpi->refresh_alt_ref_frame)
- cpi->alt_is_last = 1;
- else if (cpi->refresh_last_frame ^ cpi->refresh_alt_ref_frame)
- cpi->alt_is_last = 0;
-
- if (cpi->refresh_alt_ref_frame & cpi->refresh_golden_frame)
- cpi->gold_is_alt = 1;
- else if (cpi->refresh_alt_ref_frame ^ cpi->refresh_golden_frame)
- cpi->gold_is_alt = 0;
+ cm->frame_flags &= ~FRAMEFLAGS_ALTREF;
- cpi->ref_frame_flags = VP9_ALT_FLAG | VP9_GOLD_FLAG | VP9_LAST_FLAG;
+ get_ref_frame_flags(cpi);
- if (cpi->gold_is_last)
- cpi->ref_frame_flags &= ~VP9_GOLD_FLAG;
-
- if (cpi->alt_is_last)
- cpi->ref_frame_flags &= ~VP9_ALT_FLAG;
-
- if (cpi->gold_is_alt)
- cpi->ref_frame_flags &= ~VP9_ALT_FLAG;
-
- if (cpi->oxcf.play_alternate && cpi->refresh_alt_ref_frame
- && (cm->frame_type != KEY_FRAME))
- // Update the alternate reference frame stats as appropriate.
- update_alt_ref_frame_stats(cpi);
- else
- // Update the Golden frame stats as appropriate.
- update_golden_frame_stats(cpi);
+ vp9_rc_postencode_update(cpi, *size);
if (cm->frame_type == KEY_FRAME) {
// Tell the caller that the frame was coded as a key frame
@@ -3589,9 +3193,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
cpi->new_frame_coding_order_period = -1;
}
#endif
-
- // As this frame is a key frame the next defaults to an inter frame.
- cm->frame_type = INTER_FRAME;
} else {
*frame_flags = cm->frame_flags&~FRAMEFLAGS_KEY;
@@ -3621,91 +3222,96 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
cm->last_height = cm->height;
// reset to normal state now that we are done.
- cm->last_show_frame = cm->show_frame;
- if (cm->show_frame) {
- // current mip will be the prev_mip for the next frame
- MODE_INFO *temp = cm->prev_mip;
- MODE_INFO **temp2 = cm->prev_mi_grid_base;
- cm->prev_mip = cm->mip;
- cm->mip = temp;
- cm->prev_mi_grid_base = cm->mi_grid_base;
- cm->mi_grid_base = temp2;
+ if (!cm->show_existing_frame)
+ cm->last_show_frame = cm->show_frame;
- // update the upper left visible macroblock ptrs
- cm->mi = cm->mip + cm->mode_info_stride + 1;
- cm->mi_grid_visible = cm->mi_grid_base + cm->mode_info_stride + 1;
-
- cpi->mb.e_mbd.mi_8x8 = cm->mi_grid_visible;
- cpi->mb.e_mbd.mi_8x8[0] = cm->mi;
+ if (cm->show_frame) {
+ vp9_swap_mi_and_prev_mi(cm);
// Don't increment frame counters if this was an altref buffer
// update not a real frame
++cm->current_video_frame;
- ++cpi->frames_since_key;
}
+
// restore prev_mi
cm->prev_mi = cm->prev_mip + cm->mode_info_stride + 1;
cm->prev_mi_grid_visible = cm->prev_mi_grid_base + cm->mode_info_stride + 1;
}
-static void Pass2Encode(VP9_COMP *cpi, unsigned long *size,
- unsigned char *dest, unsigned int *frame_flags) {
- cpi->enable_encode_breakout = 1;
-
- if (!cpi->refresh_alt_ref_frame)
- vp9_second_pass(cpi);
+static void SvcEncode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
+ unsigned int *frame_flags) {
+ vp9_rc_get_svc_params(cpi);
+ encode_frame_to_data_rate(cpi, size, dest, frame_flags);
+}
+static void Pass0Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
+ unsigned int *frame_flags) {
+ if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ vp9_rc_get_one_pass_cbr_params(cpi);
+ } else {
+ vp9_rc_get_one_pass_vbr_params(cpi);
+ }
encode_frame_to_data_rate(cpi, size, dest, frame_flags);
- // vp9_print_modes_and_motion_vectors(&cpi->common, "encode.stt");
-#ifdef DISABLE_RC_LONG_TERM_MEM
- cpi->twopass.bits_left -= cpi->this_frame_target;
-#else
- cpi->twopass.bits_left -= 8 * *size;
-#endif
+}
+
+static void Pass1Encode(VP9_COMP *cpi, size_t *size, uint8_t *dest,
+ unsigned int *frame_flags) {
+ (void) size;
+ (void) dest;
+ (void) frame_flags;
- if (!cpi->refresh_alt_ref_frame) {
- double lower_bounds_min_rate = FRAME_OVERHEAD_BITS * cpi->oxcf.framerate;
- double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
- * cpi->oxcf.two_pass_vbrmin_section
- / 100);
+ vp9_rc_get_first_pass_params(cpi);
+ vp9_set_quantizer(cpi, find_fp_qindex());
+ vp9_first_pass(cpi);
+}
- if (two_pass_min_rate < lower_bounds_min_rate)
- two_pass_min_rate = lower_bounds_min_rate;
+static void Pass2Encode(VP9_COMP *cpi, size_t *size,
+ uint8_t *dest, unsigned int *frame_flags) {
+ cpi->allow_encode_breakout = ENCODE_BREAKOUT_ENABLED;
- cpi->twopass.bits_left += (int64_t)(two_pass_min_rate
- / cpi->oxcf.framerate);
- }
+ vp9_rc_get_second_pass_params(cpi);
+ encode_frame_to_data_rate(cpi, size, dest, frame_flags);
+
+ vp9_twopass_postencode_update(cpi, *size);
}
-static void check_initial_width(VP9_COMP *cpi, YV12_BUFFER_CONFIG *sd) {
- VP9_COMMON *cm = &cpi->common;
+static void check_initial_width(VP9_COMP *cpi, int subsampling_x,
+ int subsampling_y) {
+ VP9_COMMON *const cm = &cpi->common;
+
if (!cpi->initial_width) {
- // TODO(jkoleszar): Support 1/4 subsampling?
- cm->subsampling_x = (sd != NULL) && sd->uv_width < sd->y_width;
- cm->subsampling_y = (sd != NULL) && sd->uv_height < sd->y_height;
+ cm->subsampling_x = subsampling_x;
+ cm->subsampling_y = subsampling_y;
alloc_raw_frame_buffers(cpi);
-
cpi->initial_width = cm->width;
cpi->initial_height = cm->height;
}
}
-int vp9_receive_raw_frame(VP9_PTR ptr, unsigned int frame_flags,
+int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags,
YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
int64_t end_time) {
- VP9_COMP *cpi = (VP9_COMP *) ptr;
- struct vpx_usec_timer timer;
- int res = 0;
+ VP9_COMMON *cm = &cpi->common;
+ struct vpx_usec_timer timer;
+ int res = 0;
+ const int subsampling_x = sd->uv_width < sd->y_width;
+ const int subsampling_y = sd->uv_height < sd->y_height;
- check_initial_width(cpi, sd);
+ check_initial_width(cpi, subsampling_x, subsampling_y);
vpx_usec_timer_start(&timer);
- if (vp9_lookahead_push(cpi->lookahead, sd, time_stamp, end_time, frame_flags,
- cpi->active_map_enabled ? cpi->active_map : NULL))
+ if (vp9_lookahead_push(cpi->lookahead,
+ sd, time_stamp, end_time, frame_flags))
res = -1;
vpx_usec_timer_mark(&timer);
cpi->time_receive_data += vpx_usec_timer_elapsed(&timer);
+ if (cm->version == 0 && (subsampling_x != 1 || subsampling_y != 1)) {
+ vpx_internal_error(&cm->error, VPX_CODEC_INVALID_PARAM,
+ "Non-4:2:0 color space requires profile >= 1");
+ res = -1;
+ }
+
return res;
}
@@ -3730,15 +3336,52 @@ int is_next_frame_arf(VP9_COMP *cpi) {
}
#endif
-int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
- unsigned long *size, unsigned char *dest,
+void adjust_frame_rate(VP9_COMP *cpi) {
+ int64_t this_duration;
+ int step = 0;
+
+ if (cpi->source->ts_start == cpi->first_time_stamp_ever) {
+ this_duration = cpi->source->ts_end - cpi->source->ts_start;
+ step = 1;
+ } else {
+ int64_t last_duration = cpi->last_end_time_stamp_seen
+ - cpi->last_time_stamp_seen;
+
+ this_duration = cpi->source->ts_end - cpi->last_end_time_stamp_seen;
+
+ // do a step update if the duration changes by 10%
+ if (last_duration)
+ step = (int)((this_duration - last_duration) * 10 / last_duration);
+ }
+
+ if (this_duration) {
+ if (step) {
+ vp9_new_framerate(cpi, 10000000.0 / this_duration);
+ } else {
+ // Average this frame's rate into the last second's average
+ // frame rate. If we haven't seen 1 second yet, then average
+ // over the whole interval seen.
+ const double interval = MIN((double)(cpi->source->ts_end
+ - cpi->first_time_stamp_ever), 10000000.0);
+ double avg_duration = 10000000.0 / cpi->oxcf.framerate;
+ avg_duration *= (interval - avg_duration + this_duration);
+ avg_duration /= interval;
+
+ vp9_new_framerate(cpi, 10000000.0 / avg_duration);
+ }
+ }
+ cpi->last_time_stamp_seen = cpi->source->ts_start;
+ cpi->last_end_time_stamp_seen = cpi->source->ts_end;
+}
+
+int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
+ size_t *size, uint8_t *dest,
int64_t *time_stamp, int64_t *time_end, int flush) {
- VP9_COMP *cpi = (VP9_COMP *) ptr;
VP9_COMMON *cm = &cpi->common;
+ MACROBLOCKD *xd = &cpi->mb.e_mbd;
struct vpx_usec_timer cmptimer;
- YV12_BUFFER_CONFIG *force_src_buffer = NULL;
- int i;
- // FILE *fp_out = fopen("enc_frame_type.txt", "a");
+ YV12_BUFFER_CONFIG *force_src_buffer = NULL;
+ MV_REFERENCE_FRAME ref_frame;
if (!cpi)
return -1;
@@ -3747,11 +3390,17 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
cpi->source = NULL;
- cpi->common.allow_high_precision_mv = ALTREF_HIGH_PRECISION_MV;
- set_mvcost(cpi);
+ set_high_precision_mv(cpi, ALTREF_HIGH_PRECISION_MV);
+
+ // Normal defaults
+ cm->reset_frame_context = 0;
+ cm->refresh_frame_context = 1;
+ cpi->refresh_last_frame = 1;
+ cpi->refresh_golden_frame = 0;
+ cpi->refresh_alt_ref_frame = 0;
// Should we code an alternate reference frame.
- if (cpi->oxcf.play_alternate && cpi->source_alt_ref_pending) {
+ if (cpi->oxcf.play_alternate && cpi->rc.source_alt_ref_pending) {
int frames_to_arf;
#if CONFIG_MULTIPLE_ARF
@@ -3760,12 +3409,12 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
if (cpi->multi_arf_enabled && (cpi->pass == 2))
frames_to_arf = (-cpi->frame_coding_order[cpi->sequence_number])
- - cpi->next_frame_in_order;
+ - cpi->next_frame_in_order;
else
#endif
- frames_to_arf = cpi->frames_till_gf_update_due;
+ frames_to_arf = cpi->rc.frames_till_gf_update_due;
- assert(frames_to_arf < cpi->twopass.frames_to_key);
+ assert(frames_to_arf <= cpi->rc.frames_to_key);
if ((cpi->source = vp9_lookahead_peek(cpi->lookahead, frames_to_arf))) {
#if CONFIG_MULTIPLE_ARF
@@ -3777,11 +3426,9 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
if (cpi->oxcf.arnr_max_frames > 0) {
// Produce the filtered ARF frame.
// TODO(agrange) merge these two functions.
- configure_arnr_filter(cpi, cm->current_video_frame + frames_to_arf,
- cpi->gfu_boost);
+ vp9_configure_arnr_filter(cpi, frames_to_arf, cpi->rc.gfu_boost);
vp9_temporal_filter_prepare(cpi, frames_to_arf);
- vp9_extend_frame_borders(&cpi->alt_ref_buffer,
- cm->subsampling_x, cm->subsampling_y);
+ vp9_extend_frame_borders(&cpi->alt_ref_buffer);
force_src_buffer = &cpi->alt_ref_buffer;
}
@@ -3789,15 +3436,14 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
cpi->refresh_alt_ref_frame = 1;
cpi->refresh_golden_frame = 0;
cpi->refresh_last_frame = 0;
- cpi->is_src_frame_alt_ref = 0;
-
- // TODO(agrange) This needs to vary depending on where the next ARF is.
- cpi->frames_till_alt_ref_frame = frames_to_arf;
+ cpi->rc.is_src_frame_alt_ref = 0;
#if CONFIG_MULTIPLE_ARF
if (!cpi->multi_arf_enabled)
#endif
- cpi->source_alt_ref_pending = 0; // Clear Pending altf Ref flag.
+ cpi->rc.source_alt_ref_pending = 0;
+ } else {
+ cpi->rc.source_alt_ref_pending = 0;
}
}
@@ -3811,19 +3457,19 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
#if CONFIG_MULTIPLE_ARF
// Is this frame the ARF overlay.
- cpi->is_src_frame_alt_ref = 0;
+ cpi->rc.is_src_frame_alt_ref = 0;
for (i = 0; i < cpi->arf_buffered; ++i) {
if (cpi->source == cpi->alt_ref_source[i]) {
- cpi->is_src_frame_alt_ref = 1;
+ cpi->rc.is_src_frame_alt_ref = 1;
cpi->refresh_golden_frame = 1;
break;
}
}
#else
- cpi->is_src_frame_alt_ref = cpi->alt_ref_source
- && (cpi->source == cpi->alt_ref_source);
+ cpi->rc.is_src_frame_alt_ref = cpi->alt_ref_source
+ && (cpi->source == cpi->alt_ref_source);
#endif
- if (cpi->is_src_frame_alt_ref) {
+ if (cpi->rc.is_src_frame_alt_ref) {
// Current frame is an ARF overlay frame.
#if CONFIG_MULTIPLE_ARF
cpi->alt_ref_source[i] = NULL;
@@ -3847,21 +3493,9 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
*time_end = cpi->source->ts_end;
*frame_flags = cpi->source->flags;
- // fprintf(fp_out, " Frame:%d", cm->current_video_frame);
-#if CONFIG_MULTIPLE_ARF
- if (cpi->multi_arf_enabled) {
- // fprintf(fp_out, " seq_no:%d this_frame_weight:%d",
- // cpi->sequence_number, cpi->this_frame_weight);
- } else {
- // fprintf(fp_out, "\n");
- }
-#else
- // fprintf(fp_out, "\n");
-#endif
-
#if CONFIG_MULTIPLE_ARF
if ((cm->frame_type != KEY_FRAME) && (cpi->pass == 2))
- cpi->source_alt_ref_pending = is_next_frame_arf(cpi);
+ cpi->rc.source_alt_ref_pending = is_next_frame_arf(cpi);
#endif
} else {
*size = 0;
@@ -3869,8 +3503,6 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
vp9_end_first_pass(cpi); /* get last stats packet */
cpi->twopass.first_pass_done = 1;
}
-
- // fclose(fp_out);
return -1;
}
@@ -3880,55 +3512,26 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
}
// adjust frame rates based on timestamps given
- if (!cpi->refresh_alt_ref_frame) {
- int64_t this_duration;
- int step = 0;
-
- if (cpi->source->ts_start == cpi->first_time_stamp_ever) {
- this_duration = cpi->source->ts_end - cpi->source->ts_start;
- step = 1;
- } else {
- int64_t last_duration = cpi->last_end_time_stamp_seen
- - cpi->last_time_stamp_seen;
-
- this_duration = cpi->source->ts_end - cpi->last_end_time_stamp_seen;
-
- // do a step update if the duration changes by 10%
- if (last_duration)
- step = (int)((this_duration - last_duration) * 10 / last_duration);
- }
-
- if (this_duration) {
- if (step) {
- vp9_new_framerate(cpi, 10000000.0 / this_duration);
- } else {
- // Average this frame's rate into the last second's average
- // frame rate. If we haven't seen 1 second yet, then average
- // over the whole interval seen.
- const double interval = MIN((double)(cpi->source->ts_end
- - cpi->first_time_stamp_ever), 10000000.0);
- double avg_duration = 10000000.0 / cpi->oxcf.framerate;
- avg_duration *= (interval - avg_duration + this_duration);
- avg_duration /= interval;
-
- vp9_new_framerate(cpi, 10000000.0 / avg_duration);
- }
- }
+ if (cm->show_frame) {
+ adjust_frame_rate(cpi);
+ }
- cpi->last_time_stamp_seen = cpi->source->ts_start;
- cpi->last_end_time_stamp_seen = cpi->source->ts_end;
+ if (cpi->svc.number_temporal_layers > 1 &&
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ vp9_update_layer_framerate(cpi);
+ vp9_restore_layer_context(cpi);
}
// start with a 0 size frame
*size = 0;
// Clear down mmx registers
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
/* find a free buffer for the new frame, releasing the reference previously
* held.
*/
- cm->fb_idx_ref_cnt[cm->new_fb_idx]--;
+ cm->frame_bufs[cm->new_fb_idx].ref_count--;
cm->new_fb_idx = get_free_fb(cm);
#if CONFIG_MULTIPLE_ARF
@@ -3942,65 +3545,64 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
}
#endif
- /* Get the mapping of L/G/A to the reference buffer pool */
- cm->active_ref_idx[0] = cm->ref_frame_map[cpi->lst_fb_idx];
- cm->active_ref_idx[1] = cm->ref_frame_map[cpi->gld_fb_idx];
- cm->active_ref_idx[2] = cm->ref_frame_map[cpi->alt_fb_idx];
-
-#if 0 // CONFIG_MULTIPLE_ARF
- if (cpi->multi_arf_enabled) {
- fprintf(fp_out, " idx(%d, %d, %d, %d) active(%d, %d, %d)",
- cpi->lst_fb_idx, cpi->gld_fb_idx, cpi->alt_fb_idx, cm->new_fb_idx,
- cm->active_ref_idx[0], cm->active_ref_idx[1], cm->active_ref_idx[2]);
- if (cpi->refresh_alt_ref_frame)
- fprintf(fp_out, " type:ARF");
- if (cpi->is_src_frame_alt_ref)
- fprintf(fp_out, " type:OVERLAY[%d]", cpi->alt_fb_idx);
- fprintf(fp_out, "\n");
- }
-#endif
-
- cm->frame_type = INTER_FRAME;
cm->frame_flags = *frame_flags;
// Reset the frame pointers to the current frame size
vp9_realloc_frame_buffer(get_frame_new_buffer(cm),
cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
- VP9BORDERINPIXELS);
+ VP9_ENC_BORDER_IN_PIXELS, NULL, NULL, NULL);
+
+ for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
+ const int idx = cm->ref_frame_map[get_ref_frame_idx(cpi, ref_frame)];
+ YV12_BUFFER_CONFIG *const buf = &cm->frame_bufs[idx].buf;
+ RefBuffer *const ref_buf = &cm->frame_refs[ref_frame - 1];
+ ref_buf->buf = buf;
+ ref_buf->idx = idx;
+ vp9_setup_scale_factors_for_frame(&ref_buf->sf,
+ buf->y_crop_width, buf->y_crop_height,
+ cm->width, cm->height);
- // Calculate scaling factors for each of the 3 available references
- for (i = 0; i < ALLOWED_REFS_PER_FRAME; ++i)
- vp9_setup_scale_factors(cm, i);
+ if (vp9_is_scaled(&ref_buf->sf))
+ vp9_extend_frame_borders(buf);
+ }
- vp9_setup_interp_filters(&cpi->mb.e_mbd, DEFAULT_INTERP_FILTER, cm);
+ set_ref_ptrs(cm, xd, LAST_FRAME, LAST_FRAME);
+ xd->interp_kernel = vp9_get_interp_kernel(
+ DEFAULT_INTERP_FILTER == SWITCHABLE ? EIGHTTAP : DEFAULT_INTERP_FILTER);
- if (cpi->sf.variance_adaptive_quantization) {
- vp9_vaq_init();
+ if (cpi->oxcf.aq_mode == VARIANCE_AQ) {
+ vp9_vaq_init();
}
- if (cpi->pass == 1) {
+ if (cpi->pass == 1 &&
+ (!cpi->use_svc || cpi->svc.number_temporal_layers == 1)) {
Pass1Encode(cpi, size, dest, frame_flags);
- } else if (cpi->pass == 2) {
+ } else if (cpi->pass == 2 && !cpi->use_svc) {
Pass2Encode(cpi, size, dest, frame_flags);
+ } else if (cpi->use_svc) {
+ SvcEncode(cpi, size, dest, frame_flags);
} else {
- encode_frame_to_data_rate(cpi, size, dest, frame_flags);
+ // One pass encode
+ Pass0Encode(cpi, size, dest, frame_flags);
}
if (cm->refresh_frame_context)
cm->frame_contexts[cm->frame_context_idx] = cm->fc;
+ // Frame was dropped, release scaled references.
+ if (*size == 0) {
+ release_scaled_references(cpi);
+ }
+
if (*size > 0) {
- // if its a dropped frame honor the requests on subsequent frames
cpi->droppable = !frame_is_reference(cpi);
+ }
- // return to normal state
- cm->reset_frame_context = 0;
- cm->refresh_frame_context = 1;
- cpi->refresh_alt_ref_frame = 0;
- cpi->refresh_golden_frame = 0;
- cpi->refresh_last_frame = 1;
- cm->frame_type = INTER_FRAME;
+ // Save layer specific state.
+ if (cpi->svc.number_temporal_layers > 1 &&
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ vp9_save_layer_context(cpi);
}
vpx_usec_timer_mark(&cmptimer);
@@ -4012,82 +3614,49 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
#if CONFIG_INTERNAL_STATS
if (cpi->pass != 1) {
- cpi->bytes += *size;
+ cpi->bytes += (int)(*size);
if (cm->show_frame) {
cpi->count++;
if (cpi->b_calculate_psnr) {
- double ye, ue, ve;
- double frame_psnr;
- YV12_BUFFER_CONFIG *orig = cpi->Source;
- YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
- YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer;
- int y_samples = orig->y_height * orig->y_width;
- int uv_samples = orig->uv_height * orig->uv_width;
- int t_samples = y_samples + 2 * uv_samples;
- double sq_error;
-
- ye = (double)calc_plane_error(orig->y_buffer, orig->y_stride,
- recon->y_buffer, recon->y_stride,
- orig->y_crop_width, orig->y_crop_height);
-
- ue = (double)calc_plane_error(orig->u_buffer, orig->uv_stride,
- recon->u_buffer, recon->uv_stride,
- orig->uv_crop_width, orig->uv_crop_height);
-
- ve = (double)calc_plane_error(orig->v_buffer, orig->uv_stride,
- recon->v_buffer, recon->uv_stride,
- orig->uv_crop_width, orig->uv_crop_height);
-
- sq_error = ye + ue + ve;
-
- frame_psnr = vp9_mse2psnr(t_samples, 255.0, sq_error);
-
- cpi->total_y += vp9_mse2psnr(y_samples, 255.0, ye);
- cpi->total_u += vp9_mse2psnr(uv_samples, 255.0, ue);
- cpi->total_v += vp9_mse2psnr(uv_samples, 255.0, ve);
- cpi->total_sq_error += sq_error;
- cpi->total += frame_psnr;
+ YV12_BUFFER_CONFIG *orig = cpi->Source;
+ YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
+ YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer;
+ PSNR_STATS psnr;
+ calc_psnr(orig, recon, &psnr);
+
+ cpi->total += psnr.psnr[0];
+ cpi->total_y += psnr.psnr[1];
+ cpi->total_u += psnr.psnr[2];
+ cpi->total_v += psnr.psnr[3];
+ cpi->total_sq_error += psnr.sse[0];
+ cpi->total_samples += psnr.samples[0];
+
{
- double frame_psnr2, frame_ssim2 = 0;
- double weight = 0;
+ PSNR_STATS psnr2;
+ double frame_ssim2 = 0, weight = 0;
#if CONFIG_VP9_POSTPROC
vp9_deblock(cm->frame_to_show, &cm->post_proc_buffer,
cm->lf.filter_level * 10 / 6);
#endif
vp9_clear_system_state();
- ye = (double)calc_plane_error(orig->y_buffer, orig->y_stride,
- pp->y_buffer, pp->y_stride,
- orig->y_crop_width, orig->y_crop_height);
+ calc_psnr(orig, pp, &psnr2);
- ue = (double)calc_plane_error(orig->u_buffer, orig->uv_stride,
- pp->u_buffer, pp->uv_stride,
- orig->uv_crop_width, orig->uv_crop_height);
+ cpi->totalp += psnr2.psnr[0];
+ cpi->totalp_y += psnr2.psnr[1];
+ cpi->totalp_u += psnr2.psnr[2];
+ cpi->totalp_v += psnr2.psnr[3];
+ cpi->totalp_sq_error += psnr2.sse[0];
+ cpi->totalp_samples += psnr2.samples[0];
- ve = (double)calc_plane_error(orig->v_buffer, orig->uv_stride,
- pp->v_buffer, pp->uv_stride,
- orig->uv_crop_width, orig->uv_crop_height);
-
- sq_error = ye + ue + ve;
-
- frame_psnr2 = vp9_mse2psnr(t_samples, 255.0, sq_error);
-
- cpi->totalp_y += vp9_mse2psnr(y_samples, 255.0, ye);
- cpi->totalp_u += vp9_mse2psnr(uv_samples, 255.0, ue);
- cpi->totalp_v += vp9_mse2psnr(uv_samples, 255.0, ve);
- cpi->total_sq_error2 += sq_error;
- cpi->totalp += frame_psnr2;
-
- frame_ssim2 = vp9_calc_ssim(cpi->Source,
- recon, 1, &weight);
+ frame_ssim2 = vp9_calc_ssim(orig, recon, 1, &weight);
cpi->summed_quality += frame_ssim2 * weight;
cpi->summed_weights += weight;
- frame_ssim2 = vp9_calc_ssim(cpi->Source,
- &cm->post_proc_buffer, 1, &weight);
+ frame_ssim2 = vp9_calc_ssim(orig, &cm->post_proc_buffer, 1, &weight);
cpi->summedp_quality += frame_ssim2 * weight;
cpi->summedp_weights += weight;
@@ -4105,8 +3674,7 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
if (cpi->b_calculate_ssimg) {
double y, u, v, frame_all;
- frame_all = vp9_calc_ssimg(cpi->Source, cm->frame_to_show,
- &y, &u, &v);
+ frame_all = vp9_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u, &v);
cpi->total_ssimg_y += y;
cpi->total_ssimg_u += u;
cpi->total_ssimg_v += v;
@@ -4116,27 +3684,27 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
}
#endif
- // fclose(fp_out);
return 0;
}
-int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest,
+int vp9_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest,
vp9_ppflags_t *flags) {
- VP9_COMP *cpi = (VP9_COMP *) comp;
+ VP9_COMMON *cm = &cpi->common;
- if (!cpi->common.show_frame) {
+ if (!cm->show_frame) {
return -1;
} else {
int ret;
#if CONFIG_VP9_POSTPROC
- ret = vp9_post_proc_frame(&cpi->common, dest, flags);
+ ret = vp9_post_proc_frame(cm, dest, flags);
#else
- if (cpi->common.frame_to_show) {
- *dest = *cpi->common.frame_to_show;
- dest->y_width = cpi->common.width;
- dest->y_height = cpi->common.height;
- dest->uv_height = cpi->common.height / 2;
+ if (cm->frame_to_show) {
+ *dest = *cm->frame_to_show;
+ dest->y_width = cm->width;
+ dest->y_height = cm->height;
+ dest->uv_width = cm->width >> cm->subsampling_x;
+ dest->uv_height = cm->height >> cm->subsampling_y;
ret = 0;
} else {
ret = -1;
@@ -4148,11 +3716,10 @@ int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest,
}
}
-int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
+int vp9_set_roimap(VP9_COMP *cpi, unsigned char *map, unsigned int rows,
unsigned int cols, int delta_q[MAX_SEGMENTS],
int delta_lf[MAX_SEGMENTS],
unsigned int threshold[MAX_SEGMENTS]) {
- VP9_COMP *cpi = (VP9_COMP *) comp;
signed char feature_data[SEG_LVL_MAX][MAX_SEGMENTS];
struct segmentation *seg = &cpi->common.seg;
int i;
@@ -4161,15 +3728,15 @@ int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
return -1;
if (!map) {
- vp9_disable_segmentation((VP9_PTR)cpi);
+ vp9_disable_segmentation(seg);
return 0;
}
// Set the segmentation Map
- vp9_set_segmentation_map((VP9_PTR)cpi, map);
+ vp9_set_segmentation_map(cpi, map);
// Activate segmentation.
- vp9_enable_segmentation((VP9_PTR)cpi);
+ vp9_enable_segmentation(seg);
// Set up the quant, LF and breakout threshold segment data
for (i = 0; i < MAX_SEGMENTS; i++) {
@@ -4193,15 +3760,13 @@ int vp9_set_roimap(VP9_PTR comp, unsigned char *map, unsigned int rows,
// Initialize the feature data structure
// SEGMENT_DELTADATA 0, SEGMENT_ABSDATA 1
- vp9_set_segment_data((VP9_PTR)cpi, &feature_data[0][0], SEGMENT_DELTADATA);
+ vp9_set_segment_data(seg, &feature_data[0][0], SEGMENT_DELTADATA);
return 0;
}
-int vp9_set_active_map(VP9_PTR comp, unsigned char *map,
+int vp9_set_active_map(VP9_COMP *cpi, unsigned char *map,
unsigned int rows, unsigned int cols) {
- VP9_COMP *cpi = (VP9_COMP *) comp;
-
if (rows == cpi->common.mb_rows && cols == cpi->common.mb_cols) {
if (map) {
vpx_memcpy(cpi->active_map, map, rows * cols);
@@ -4217,9 +3782,8 @@ int vp9_set_active_map(VP9_PTR comp, unsigned char *map,
}
}
-int vp9_set_internal_size(VP9_PTR comp,
+int vp9_set_internal_size(VP9_COMP *cpi,
VPX_SCALING horiz_mode, VPX_SCALING vert_mode) {
- VP9_COMP *cpi = (VP9_COMP *) comp;
VP9_COMMON *cm = &cpi->common;
int hr = 0, hs = 0, vr = 0, vs = 0;
@@ -4239,22 +3803,21 @@ int vp9_set_internal_size(VP9_PTR comp,
return 0;
}
-int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
+int vp9_set_size_literal(VP9_COMP *cpi, unsigned int width,
unsigned int height) {
- VP9_COMP *cpi = (VP9_COMP *)comp;
VP9_COMMON *cm = &cpi->common;
- check_initial_width(cpi, NULL);
+ check_initial_width(cpi, 1, 1);
if (width) {
cm->width = width;
if (cm->width * 5 < cpi->initial_width) {
cm->width = cpi->initial_width / 5 + 1;
- printf("Warning: Desired width too small, changed to %d \n", cm->width);
+ printf("Warning: Desired width too small, changed to %d\n", cm->width);
}
if (cm->width > cpi->initial_width) {
cm->width = cpi->initial_width;
- printf("Warning: Desired width too large, changed to %d \n", cm->width);
+ printf("Warning: Desired width too large, changed to %d\n", cm->width);
}
}
@@ -4262,11 +3825,11 @@ int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
cm->height = height;
if (cm->height * 5 < cpi->initial_height) {
cm->height = cpi->initial_height / 5 + 1;
- printf("Warning: Desired height too small, changed to %d \n", cm->height);
+ printf("Warning: Desired height too small, changed to %d\n", cm->height);
}
if (cm->height > cpi->initial_height) {
cm->height = cpi->initial_height;
- printf("Warning: Desired height too large, changed to %d \n", cm->height);
+ printf("Warning: Desired height too large, changed to %d\n", cm->height);
}
}
@@ -4276,36 +3839,36 @@ int vp9_set_size_literal(VP9_PTR comp, unsigned int width,
return 0;
}
-void vp9_set_svc(VP9_PTR comp, int use_svc) {
- VP9_COMP *cpi = (VP9_COMP *)comp;
+void vp9_set_svc(VP9_COMP *cpi, int use_svc) {
cpi->use_svc = use_svc;
return;
}
-int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest) {
+int vp9_calc_ss_err(const YV12_BUFFER_CONFIG *source,
+ const YV12_BUFFER_CONFIG *reference) {
int i, j;
int total = 0;
- uint8_t *src = source->y_buffer;
- uint8_t *dst = dest->y_buffer;
+ const uint8_t *src = source->y_buffer;
+ const uint8_t *ref = reference->y_buffer;
// Loop through the Y plane raw and reconstruction data summing
// (square differences)
for (i = 0; i < source->y_height; i += 16) {
for (j = 0; j < source->y_width; j += 16) {
unsigned int sse;
- total += vp9_mse16x16(src + j, source->y_stride, dst + j, dest->y_stride,
- &sse);
+ total += vp9_mse16x16(src + j, source->y_stride,
+ ref + j, reference->y_stride, &sse);
}
src += 16 * source->y_stride;
- dst += 16 * dest->y_stride;
+ ref += 16 * reference->y_stride;
}
return total;
}
-int vp9_get_quantizer(VP9_PTR c) {
- return ((VP9_COMP *)c)->common.base_qindex;
+int vp9_get_quantizer(VP9_COMP *cpi) {
+ return cpi->common.base_qindex;
}
diff --git a/libvpx/vp9/encoder/vp9_onyx_int.h b/libvpx/vp9/encoder/vp9_onyx_int.h
index 9e80212..f4b44ce 100644
--- a/libvpx/vp9/encoder/vp9_onyx_int.h
+++ b/libvpx/vp9/encoder/vp9_onyx_int.h
@@ -8,54 +8,43 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#ifndef VP9_ENCODER_VP9_ONYX_INT_H_
#define VP9_ENCODER_VP9_ONYX_INT_H_
#include <stdio.h>
+
#include "./vpx_config.h"
-#include "vp9/common/vp9_onyx.h"
-#include "vp9/encoder/vp9_treewriter.h"
-#include "vp9/encoder/vp9_tokenize.h"
-#include "vp9/common/vp9_onyxc_int.h"
-#include "vp9/encoder/vp9_variance.h"
-#include "vp9/encoder/vp9_encodemb.h"
-#include "vp9/encoder/vp9_quantize.h"
-#include "vp9/common/vp9_entropy.h"
-#include "vp9/common/vp9_entropymode.h"
#include "vpx_ports/mem.h"
#include "vpx/internal/vpx_codec_internal.h"
-#include "vp9/encoder/vp9_mcomp.h"
-#include "vp9/common/vp9_findnearmv.h"
-#include "vp9/encoder/vp9_lookahead.h"
+#include "vpx/vp8cx.h"
-#define DISABLE_RC_LONG_TERM_MEM 0
+#include "vp9/common/vp9_ppflags.h"
+#include "vp9/common/vp9_entropy.h"
+#include "vp9/common/vp9_entropymode.h"
+#include "vp9/common/vp9_onyxc_int.h"
-// #define MODE_TEST_HIT_STATS
+#include "vp9/encoder/vp9_encodemb.h"
+#include "vp9/encoder/vp9_firstpass.h"
+#include "vp9/encoder/vp9_lookahead.h"
+#include "vp9/encoder/vp9_mbgraph.h"
+#include "vp9/encoder/vp9_mcomp.h"
+#include "vp9/encoder/vp9_quantize.h"
+#include "vp9/encoder/vp9_ratectrl.h"
+#include "vp9/encoder/vp9_svc_layercontext.h"
+#include "vp9/encoder/vp9_tokenize.h"
+#include "vp9/encoder/vp9_variance.h"
-// #define SPEEDSTATS 1
-#if CONFIG_MULTIPLE_ARF
-// Set MIN_GF_INTERVAL to 1 for the full decomposition.
-#define MIN_GF_INTERVAL 2
-#else
-#define MIN_GF_INTERVAL 4
+#ifdef __cplusplus
+extern "C" {
#endif
-#define DEFAULT_GF_INTERVAL 7
-#define KEY_FRAME_CONTEXT 5
+// #define MODE_TEST_HIT_STATS
+
+#define DEFAULT_GF_INTERVAL 10
#define MAX_MODES 30
#define MAX_REFS 6
-#define MIN_THRESHMULT 32
-#define MAX_THRESHMULT 512
-
-#define GF_ZEROMV_ZBIN_BOOST 0
-#define LF_ZEROMV_ZBIN_BOOST 0
-#define MV_ZBIN_BOOST 0
-#define SPLIT_MV_ZBIN_BOOST 0
-#define INTRA_ZBIN_BOOST 0
-
typedef struct {
int nmvjointcost[MV_JOINTS];
int nmvcosts[2][MV_VALS];
@@ -70,58 +59,9 @@ typedef struct {
// 0 = ZERO_MV, MV
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
- int inter_mode_counts[INTER_MODE_CONTEXTS][INTER_MODES - 1][2];
FRAME_CONTEXT fc;
} CODING_CONTEXT;
-typedef struct {
- double frame;
- double intra_error;
- double coded_error;
- double sr_coded_error;
- double ssim_weighted_pred_err;
- double pcnt_inter;
- double pcnt_motion;
- double pcnt_second_ref;
- double pcnt_neutral;
- double MVr;
- double mvr_abs;
- double MVc;
- double mvc_abs;
- double MVrv;
- double MVcv;
- double mv_in_out_count;
- double new_mv_count;
- double duration;
- double count;
-} FIRSTPASS_STATS;
-
-typedef struct {
- int frames_so_far;
- double frame_intra_error;
- double frame_coded_error;
- double frame_pcnt_inter;
- double frame_pcnt_motion;
- double frame_mvr;
- double frame_mvr_abs;
- double frame_mvc;
- double frame_mvc_abs;
-} ONEPASS_FRAMESTATS;
-
-typedef struct {
- struct {
- int err;
- union {
- int_mv mv;
- MB_PREDICTION_MODE mode;
- } m;
- } ref[MAX_REF_FRAMES];
-} MBGRAPH_MB_STATS;
-
-typedef struct {
- MBGRAPH_MB_STATS *mb_stats;
-} MBGRAPH_FRAME_STATS;
-
// This enumerator type needs to be kept aligned with the mode order in
// const MODE_DEFINITION vp9_mode_order[MAX_MODES] used in the rd code.
typedef enum {
@@ -178,7 +118,9 @@ typedef enum {
NSTEP = 1,
HEX = 2,
BIGDIA = 3,
- SQUARE = 4
+ SQUARE = 4,
+ FAST_HEX = 5,
+ FAST_DIAMOND = 6
} SEARCH_METHODS;
typedef enum {
@@ -189,107 +131,472 @@ typedef enum {
} TX_SIZE_SEARCH_METHOD;
typedef enum {
- // Values should be powers of 2 so that they can be selected as bits of
- // an integer flags field
+ NOT_IN_USE = 0,
+ RELAXED_NEIGHBORING_MIN_MAX = 1,
+ STRICT_NEIGHBORING_MIN_MAX = 2
+} AUTO_MIN_MAX_MODE;
- // terminate search early based on distortion so far compared to
+typedef enum {
+ // Terminate search early based on distortion so far compared to
// qp step, distortion in the neighborhood of the frame, etc.
- FLAG_EARLY_TERMINATE = 1,
+ FLAG_EARLY_TERMINATE = 1 << 0,
- // skips comp inter modes if the best so far is an intra mode
- FLAG_SKIP_COMP_BESTINTRA = 2,
+ // Skips comp inter modes if the best so far is an intra mode.
+ FLAG_SKIP_COMP_BESTINTRA = 1 << 1,
- // skips comp inter modes if the best single intermode so far does
+ // Skips comp inter modes if the best single intermode so far does
// not have the same reference as one of the two references being
- // tested
- FLAG_SKIP_COMP_REFMISMATCH = 4,
+ // tested.
+ FLAG_SKIP_COMP_REFMISMATCH = 1 << 2,
- // skips oblique intra modes if the best so far is an inter mode
- FLAG_SKIP_INTRA_BESTINTER = 8,
+ // Skips oblique intra modes if the best so far is an inter mode.
+ FLAG_SKIP_INTRA_BESTINTER = 1 << 3,
- // skips oblique intra modes at angles 27, 63, 117, 153 if the best
- // intra so far is not one of the neighboring directions
- FLAG_SKIP_INTRA_DIRMISMATCH = 16,
+ // Skips oblique intra modes at angles 27, 63, 117, 153 if the best
+ // intra so far is not one of the neighboring directions.
+ FLAG_SKIP_INTRA_DIRMISMATCH = 1 << 4,
- // skips intra modes other than DC_PRED if the source variance
- // is small
- FLAG_SKIP_INTRA_LOWVAR = 32,
+ // Skips intra modes other than DC_PRED if the source variance is small
+ FLAG_SKIP_INTRA_LOWVAR = 1 << 5,
} MODE_SEARCH_SKIP_LOGIC;
typedef enum {
- SUBPEL_ITERATIVE = 0,
- SUBPEL_TREE = 1,
+ SUBPEL_TREE = 0,
// Other methods to come
} SUBPEL_SEARCH_METHODS;
-#define ALL_INTRA_MODES 0x3FF
-#define INTRA_DC_ONLY 0x01
-#define INTRA_DC_TM ((1 << TM_PRED) | (1 << DC_PRED))
-#define INTRA_DC_H_V ((1 << DC_PRED) | (1 << V_PRED) | (1 << H_PRED))
-#define INTRA_DC_TM_H_V (INTRA_DC_TM | (1 << V_PRED) | (1 << H_PRED))
-
typedef enum {
LAST_FRAME_PARTITION_OFF = 0,
LAST_FRAME_PARTITION_LOW_MOTION = 1,
LAST_FRAME_PARTITION_ALL = 2
} LAST_FRAME_PARTITION_METHOD;
+typedef enum {
+ // No recode.
+ DISALLOW_RECODE = 0,
+ // Allow recode for KF and exceeding maximum frame bandwidth.
+ ALLOW_RECODE_KFMAXBW = 1,
+ // Allow recode only for KF/ARF/GF frames.
+ ALLOW_RECODE_KFARFGF = 2,
+ // Allow recode for all frames based on bitrate constraints.
+ ALLOW_RECODE = 3,
+} RECODE_LOOP_TYPE;
+
+typedef enum {
+ // encode_breakout is disabled.
+ ENCODE_BREAKOUT_DISABLED = 0,
+ // encode_breakout is enabled.
+ ENCODE_BREAKOUT_ENABLED = 1,
+ // encode_breakout is enabled with small max_thresh limit.
+ ENCODE_BREAKOUT_LIMITED = 2
+} ENCODE_BREAKOUT_TYPE;
+
+typedef enum {
+ // Search partitions using RD/NONRD criterion
+ SEARCH_PARTITION = 0,
+
+ // Always use a fixed size partition
+ FIXED_PARTITION = 1,
+
+ // Use a fixed size partition in every 64X64 SB, where the size is
+ // determined based on source variance
+ VAR_BASED_FIXED_PARTITION = 2,
+
+ REFERENCE_PARTITION = 3,
+
+ // Use an arbitrary partitioning scheme based on source variance within
+ // a 64X64 SB
+ VAR_BASED_PARTITION
+} PARTITION_SEARCH_TYPE;
+
typedef struct {
- int RD;
+ // Frame level coding parameter update
+ int frame_parameter_update;
+
+ // Motion search method (Diamond, NSTEP, Hex, Big Diamond, Square, etc).
SEARCH_METHODS search_method;
- int auto_filter;
- int recode_loop;
+
+ RECODE_LOOP_TYPE recode_loop;
+
+ // Subpel_search_method can only be subpel_tree which does a subpixel
+ // logarithmic search that keeps stepping at 1/2 pixel units until
+ // you stop getting a gain, and then goes on to 1/4 and repeats
+ // the same process. Along the way it skips many diagonals.
SUBPEL_SEARCH_METHODS subpel_search_method;
+
+ // Maximum number of steps in logarithmic subpel search before giving up.
int subpel_iters_per_step;
+
+ // Control when to stop subpel search
+ int subpel_force_stop;
+
+ // Thresh_mult is used to set a threshold for the rd score. A higher value
+ // means that we will accept the best mode so far more often. This number
+ // is used in combination with the current block size, and thresh_freq_fact
+ // to pick a threshold.
int thresh_mult[MAX_MODES];
int thresh_mult_sub8x8[MAX_REFS];
+
+ // This parameter controls the number of steps we'll do in a diamond
+ // search.
int max_step_search_steps;
+
+ // This parameter controls which step in the n-step process we start at.
+ // It's changed adaptively based on circumstances.
int reduce_first_step_size;
+
+ // If this is set to 1, we limit the motion search range to 2 times the
+ // largest motion vector found in the last frame.
int auto_mv_step_size;
+
+ // Trellis (dynamic programming) optimization of quantized values (+1, 0).
int optimize_coefficients;
+
+ // Always set to 0. If on it enables 0 cost background transmission
+ // (except for the initial transmission of the segmentation). The feature is
+ // disabled because the addition of very large block sizes make the
+ // backgrounds very to cheap to encode, and the segmentation we have
+ // adds overhead.
int static_segmentation;
- int variance_adaptive_quantization;
+
+ // If 1 we iterate finding a best reference for 2 ref frames together - via
+ // a log search that iterates 4 times (check around mv for last for best
+ // error of combined predictor then check around mv for alt). If 0 we
+ // we just use the best motion vector found for each frame by itself.
int comp_inter_joint_search_thresh;
+
+ // This variable is used to cap the maximum number of times we skip testing a
+ // mode to be evaluated. A high value means we will be faster.
int adaptive_rd_thresh;
+
+ // Enables skipping the reconstruction step (idct, recon) in the
+ // intermediate steps assuming the last frame didn't have too many intra
+ // blocks and the q is less than a threshold.
int skip_encode_sb;
int skip_encode_frame;
+
+ // This variable allows us to reuse the last frames partition choices
+ // (64x64 v 32x32 etc) for this frame. It can be set to only use the last
+ // frame as a starting point in low motion scenes or always use it. If set
+ // we use last partitioning_redo frequency to determine how often to redo
+ // the partitioning from scratch. Adjust_partitioning_from_last_frame
+ // enables us to adjust up or down one partitioning from the last frames
+ // partitioning.
LAST_FRAME_PARTITION_METHOD use_lastframe_partitioning;
+
+ // Determine which method we use to determine transform size. We can choose
+ // between options like full rd, largest for prediction size, largest
+ // for intra and model coefs for the rest.
TX_SIZE_SEARCH_METHOD tx_size_search_method;
+
+ // Low precision 32x32 fdct keeps everything in 16 bits and thus is less
+ // precise but significantly faster than the non lp version.
int use_lp32x32fdct;
- int use_avoid_tested_higherror;
- int use_one_partition_size_always;
- int less_rectangular_check;
- int use_square_partition_only;
+
+ // TODO(JBB): remove this as its no longer used.
+
+ // After looking at the first set of modes (set by index here), skip
+ // checking modes for reference frames that don't match the reference frame
+ // of the best so far.
int mode_skip_start;
+
+ // TODO(JBB): Remove this.
int reference_masking;
+
+ PARTITION_SEARCH_TYPE partition_search_type;
+
+ // Used if partition_search_type = FIXED_SIZE_PARTITION
BLOCK_SIZE always_this_block_size;
- int auto_min_max_partition_size;
+
+ // Skip rectangular partition test when partition type none gives better
+ // rd than partition type split.
+ int less_rectangular_check;
+
+ // Disable testing non square partitions. (eg 16x32)
+ int use_square_partition_only;
+
+ // Sets min and max partition sizes for this 64x64 region based on the
+ // same 64x64 in last encoded frame, and the left and above neighbor.
+ AUTO_MIN_MAX_MODE auto_min_max_partition_size;
+
+ // Min and max partition size we enable (block_size) as per auto
+ // min max, but also used by adjust partitioning, and pick_partitioning.
BLOCK_SIZE min_partition_size;
BLOCK_SIZE max_partition_size;
+
+ // Whether or not we allow partitions one smaller or one greater than the last
+ // frame's partitioning. Only used if use_lastframe_partitioning is set.
int adjust_partitioning_from_last_frame;
+
+ // How frequently we re do the partitioning from scratch. Only used if
+ // use_lastframe_partitioning is set.
int last_partitioning_redo_frequency;
+
+ // Disables sub 8x8 blocksizes in different scenarios: Choices are to disable
+ // it always, to allow it for only Last frame and Intra, disable it for all
+ // inter modes or to enable it always.
int disable_split_mask;
- int using_small_partition_info;
+
// TODO(jingning): combine the related motion search speed features
+ // This allows us to use motion search at other sizes as a starting
+ // point for this motion search and limits the search range around it.
int adaptive_motion_search;
+ // Allows sub 8x8 modes to use the prediction filter that was determined
+ // best for 8x8 mode. If set to 0 we always re check all the filters for
+ // sizes less than 8x8, 1 means we check all filter modes if no 8x8 filter
+ // was selected, and 2 means we use 8 tap if no 8x8 filter mode was selected.
+ int adaptive_pred_interp_filter;
+
+ // Search through variable block partition types in non-RD mode decision
+ // encoding process for RTC.
+ int partition_check;
+
// Implements various heuristics to skip searching modes
// The heuristics selected are based on flags
// defined in the MODE_SEARCH_SKIP_HEURISTICS enum
unsigned int mode_search_skip_flags;
+
// A source variance threshold below which the split mode is disabled
unsigned int disable_split_var_thresh;
+
// A source variance threshold below which filter search is disabled
// Choose a very large value (UINT_MAX) to use 8-tap always
unsigned int disable_filter_search_var_thresh;
+
+ // These bit masks allow you to enable or disable intra modes for each
+ // transform size separately.
int intra_y_mode_mask[TX_SIZES];
int intra_uv_mode_mask[TX_SIZES];
+
+ // This variable enables an early break out of mode testing if the model for
+ // rd built from the prediction signal indicates a value that's much
+ // higher than the best rd we've seen so far.
int use_rd_breakout;
+
+ // This enables us to use an estimate for intra rd based on dc mode rather
+ // than choosing an actual uv mode in the stage of encoding before the actual
+ // final encode.
int use_uv_intra_rd_estimate;
+
+ // This feature controls how the loop filter level is determined:
+ // 0: Try the full image with different values.
+ // 1: Try a small portion of the image with different values.
+ // 2: Estimate the level based on quantizer and frame type
int use_fast_lpf_pick;
+
+ // This feature limits the number of coefficients updates we actually do
+ // by only looking at counts from 1/2 the bands.
int use_fast_coef_updates; // 0: 2-loop, 1: 1-loop, 2: 1-loop reduced
+
+ // This flag controls the use of non-RD mode decision.
+ int use_nonrd_pick_mode;
+
+ // This variable sets the encode_breakout threshold. Currently, it is only
+ // enabled in real time mode.
+ int encode_breakout_thresh;
+
+ // A binary mask indicating if NEARESTMV, NEARMV, ZEROMV, NEWMV
+ // modes are disabled in order from LSB to MSB for each BLOCK_SIZE.
+ int disable_inter_mode_mask[BLOCK_SIZES];
+
+ // This feature controls whether we do the expensive context update and
+ // calculation in the rd coefficient costing loop.
+ int use_fast_coef_costing;
+
+ // This variable controls the maximum block size where intra blocks can be
+ // used in inter frames.
+ // TODO(aconverse): Fold this into one of the other many mode skips
+ BLOCK_SIZE max_intra_bsize;
} SPEED_FEATURES;
+typedef enum {
+ NORMAL = 0,
+ FOURFIVE = 1,
+ THREEFIVE = 2,
+ ONETWO = 3
+} VPX_SCALING;
+
+typedef enum {
+ VP9_LAST_FLAG = 1 << 0,
+ VP9_GOLD_FLAG = 1 << 1,
+ VP9_ALT_FLAG = 1 << 2,
+} VP9_REFFRAME;
+
+typedef enum {
+ USAGE_LOCAL_FILE_PLAYBACK = 0,
+ USAGE_STREAM_FROM_SERVER = 1,
+ USAGE_CONSTRAINED_QUALITY = 2,
+ USAGE_CONSTANT_QUALITY = 3,
+} END_USAGE;
+
+typedef struct {
+ // Target percentage of blocks per frame that are cyclicly refreshed.
+ int max_mbs_perframe;
+ // Maximum q-delta as percentage of base q.
+ int max_qdelta_perc;
+ // Block size below which we don't apply cyclic refresh.
+ BLOCK_SIZE min_block_size;
+ // Macroblock starting index (unit of 8x8) for cycling through the frame.
+ int mb_index;
+ // Controls how long a block will need to wait to be refreshed again.
+ int time_for_refresh;
+ // Actual number of blocks that were applied delta-q (segment 1).
+ int num_seg_blocks;
+ // Actual encoding bits for segment 1.
+ int actual_seg_bits;
+ // RD mult. parameters for segment 1.
+ int rdmult;
+ // Cyclic refresh map.
+ signed char *map;
+ // Projected rate and distortion for the current superblock.
+ int64_t projected_rate_sb;
+ int64_t projected_dist_sb;
+ // Thresholds applied to projected rate/distortion of the superblock.
+ int64_t thresh_rate_sb;
+ int64_t thresh_dist_sb;
+} CYCLIC_REFRESH;
+typedef enum {
+ // Good Quality Fast Encoding. The encoder balances quality with the
+ // amount of time it takes to encode the output. (speed setting
+ // controls how fast)
+ MODE_GOODQUALITY = 1,
+
+ // One Pass - Best Quality. The encoder places priority on the
+ // quality of the output over encoding speed. The output is compressed
+ // at the highest possible quality. This option takes the longest
+ // amount of time to encode. (speed setting ignored)
+ MODE_BESTQUALITY = 2,
+
+ // Two Pass - First Pass. The encoder generates a file of statistics
+ // for use in the second encoding pass. (speed setting controls how fast)
+ MODE_FIRSTPASS = 3,
+
+ // Two Pass - Second Pass. The encoder uses the statistics that were
+ // generated in the first encoding pass to create the compressed
+ // output. (speed setting controls how fast)
+ MODE_SECONDPASS = 4,
+
+ // Two Pass - Second Pass Best. The encoder uses the statistics that
+ // were generated in the first encoding pass to create the compressed
+ // output using the highest possible quality, and taking a
+ // longer amount of time to encode. (speed setting ignored)
+ MODE_SECONDPASS_BEST = 5,
+
+ // Realtime/Live Encoding. This mode is optimized for realtime
+ // encoding (for example, capturing a television signal or feed from
+ // a live camera). (speed setting controls how fast)
+ MODE_REALTIME = 6,
+} MODE;
+
+typedef enum {
+ FRAMEFLAGS_KEY = 1 << 0,
+ FRAMEFLAGS_GOLDEN = 1 << 1,
+ FRAMEFLAGS_ALTREF = 1 << 2,
+} FRAMETYPE_FLAGS;
+
+typedef enum {
+ NO_AQ = 0,
+ VARIANCE_AQ = 1,
+ COMPLEXITY_AQ = 2,
+ CYCLIC_REFRESH_AQ = 3,
+ AQ_MODE_COUNT // This should always be the last member of the enum
+} AQ_MODE;
+
+typedef struct {
+ int version; // 4 versions of bitstream defined:
+ // 0 - best quality/slowest decode,
+ // 3 - lowest quality/fastest decode
+ int width; // width of data passed to the compressor
+ int height; // height of data passed to the compressor
+ double framerate; // set to passed in framerate
+ int64_t target_bandwidth; // bandwidth to be used in kilobits per second
+
+ int noise_sensitivity; // pre processing blur: recommendation 0
+ int sharpness; // sharpening output: recommendation 0:
+ int cpu_used;
+ unsigned int rc_max_intra_bitrate_pct;
+
+ MODE mode;
+
+ // Key Framing Operations
+ int auto_key; // autodetect cut scenes and set the keyframes
+ int key_freq; // maximum distance to key frame.
+
+ int lag_in_frames; // how many frames lag before we start encoding
+
+ // ----------------------------------------------------------------
+ // DATARATE CONTROL OPTIONS
+
+ END_USAGE end_usage; // vbr or cbr
+
+ // buffer targeting aggressiveness
+ int under_shoot_pct;
+ int over_shoot_pct;
+
+ // buffering parameters
+ int64_t starting_buffer_level; // in seconds
+ int64_t optimal_buffer_level;
+ int64_t maximum_buffer_size;
+
+ // Frame drop threshold.
+ int drop_frames_water_mark;
+
+ // controlling quality
+ int fixed_q;
+ int worst_allowed_q;
+ int best_allowed_q;
+ int cq_level;
+ int lossless;
+ AQ_MODE aq_mode; // Adaptive Quantization mode
+
+ // two pass datarate control
+ int two_pass_vbrbias; // two pass datarate control tweaks
+ int two_pass_vbrmin_section;
+ int two_pass_vbrmax_section;
+ // END DATARATE CONTROL OPTIONS
+ // ----------------------------------------------------------------
+
+ // Spatial and temporal scalability.
+ int ss_number_layers; // Number of spatial layers.
+ int ts_number_layers; // Number of temporal layers.
+ // Bitrate allocation for spatial layers.
+ int ss_target_bitrate[VPX_SS_MAX_LAYERS];
+ // Bitrate allocation (CBR mode) and framerate factor, for temporal layers.
+ int ts_target_bitrate[VPX_TS_MAX_LAYERS];
+ int ts_rate_decimator[VPX_TS_MAX_LAYERS];
+
+ // these parameters aren't to be used in final build don't use!!!
+ int play_alternate;
+ int alt_freq;
+
+ int encode_breakout; // early breakout : for video conf recommend 800
+
+ /* Bitfield defining the error resiliency features to enable.
+ * Can provide decodable frames after losses in previous
+ * frames and decodable partitions after losses in the same frame.
+ */
+ unsigned int error_resilient_mode;
+
+ /* Bitfield defining the parallel decoding mode where the
+ * decoding in successive frames may be conducted in parallel
+ * just by decoding the frame headers.
+ */
+ unsigned int frame_parallel_decoding_mode;
+
+ int arnr_max_frames;
+ int arnr_strength;
+ int arnr_type;
+
+ int tile_columns;
+ int tile_rows;
+
+ struct vpx_fixed_buf two_pass_stats_in;
+ struct vpx_codec_pkt_list *output_pkt_list;
+
+ vp8e_tuning tuning;
+} VP9_CONFIG;
+
typedef struct VP9_COMP {
DECLARE_ALIGNED(16, int16_t, y_quant[QINDEX_RANGE][8]);
DECLARE_ALIGNED(16, int16_t, y_quant_shift[QINDEX_RANGE][8]);
@@ -311,11 +618,10 @@ typedef struct VP9_COMP {
MACROBLOCK mb;
VP9_COMMON common;
VP9_CONFIG oxcf;
- struct rdcost_block_args rdcost_stack;
struct lookahead_ctx *lookahead;
struct lookahead_entry *source;
#if CONFIG_MULTIPLE_ARF
- struct lookahead_entry *alt_ref_source[NUM_REF_FRAMES];
+ struct lookahead_entry *alt_ref_source[REF_FRAMES];
#else
struct lookahead_entry *alt_ref_source;
#endif
@@ -324,11 +630,7 @@ typedef struct VP9_COMP {
YV12_BUFFER_CONFIG *un_scaled_source;
YV12_BUFFER_CONFIG scaled_source;
- unsigned int frames_till_alt_ref_frame;
- int source_alt_ref_pending;
- int source_alt_ref_active;
-
- int is_src_frame_alt_ref;
+ int key_frame_frequency;
int gold_is_last; // gold same as last frame ( short circuit gold searches)
int alt_is_last; // Alt same as last ( short circuit altref search)
@@ -339,25 +641,26 @@ typedef struct VP9_COMP {
int gld_fb_idx;
int alt_fb_idx;
- int current_layer;
- int use_svc;
-
#if CONFIG_MULTIPLE_ARF
- int alt_ref_fb_idx[NUM_REF_FRAMES - 3];
+ int alt_ref_fb_idx[REF_FRAMES - 3];
#endif
int refresh_last_frame;
int refresh_golden_frame;
int refresh_alt_ref_frame;
+
+ int ext_refresh_frame_flags_pending;
+ int ext_refresh_last_frame;
+ int ext_refresh_golden_frame;
+ int ext_refresh_alt_ref_frame;
+
+ int ext_refresh_frame_context_pending;
+ int ext_refresh_frame_context;
+
YV12_BUFFER_CONFIG last_frame_uf;
TOKENEXTRA *tok;
unsigned int tok_count[4][1 << 6];
-
- unsigned int frames_since_key;
- unsigned int key_frame_frequency;
- unsigned int this_key_frame_forced;
- unsigned int next_key_frame_forced;
#if CONFIG_MULTIPLE_ARF
// Position within a frame coding order (including any additional ARF frames).
unsigned int sequence_number;
@@ -368,164 +671,84 @@ typedef struct VP9_COMP {
// Ambient reconstruction err target for force key frames
int ambient_err;
- unsigned int mode_chosen_counts[MAX_MODES];
- unsigned int sub8x8_mode_chosen_counts[MAX_REFS];
- int64_t mode_skip_mask;
- int ref_frame_mask;
- int set_ref_frame_mask;
-
int rd_threshes[MAX_SEGMENTS][BLOCK_SIZES][MAX_MODES];
int rd_thresh_freq_fact[BLOCK_SIZES][MAX_MODES];
int rd_thresh_sub8x8[MAX_SEGMENTS][BLOCK_SIZES][MAX_REFS];
int rd_thresh_freq_sub8x8[BLOCK_SIZES][MAX_REFS];
- int64_t rd_comp_pred_diff[NB_PREDICTION_TYPES];
- int64_t rd_prediction_type_threshes[4][NB_PREDICTION_TYPES];
- unsigned int intra_inter_count[INTRA_INTER_CONTEXTS][2];
- unsigned int comp_inter_count[COMP_INTER_CONTEXTS][2];
- unsigned int single_ref_count[REF_CONTEXTS][2][2];
- unsigned int comp_ref_count[REF_CONTEXTS][2];
-
+ int64_t rd_comp_pred_diff[REFERENCE_MODES];
+ int64_t rd_prediction_type_threshes[MAX_REF_FRAMES][REFERENCE_MODES];
int64_t rd_tx_select_diff[TX_MODES];
// FIXME(rbultje) can this overflow?
- int rd_tx_select_threshes[4][TX_MODES];
+ int rd_tx_select_threshes[MAX_REF_FRAMES][TX_MODES];
int64_t rd_filter_diff[SWITCHABLE_FILTER_CONTEXTS];
- int64_t rd_filter_threshes[4][SWITCHABLE_FILTER_CONTEXTS];
+ int64_t rd_filter_threshes[MAX_REF_FRAMES][SWITCHABLE_FILTER_CONTEXTS];
int64_t rd_filter_cache[SWITCHABLE_FILTER_CONTEXTS];
+ int64_t mask_filter_rd;
int RDMULT;
int RDDIV;
CODING_CONTEXT coding_context;
- // Rate targetting variables
- int this_frame_target;
- int projected_frame_size;
- int last_q[2]; // Separate values for Intra/Inter
- int last_boosted_qindex; // Last boosted GF/KF/ARF q
-
- double rate_correction_factor;
- double key_frame_rate_correction_factor;
- double gf_rate_correction_factor;
-
- unsigned int frames_since_golden;
- int frames_till_gf_update_due; // Count down till next GF
-
- int gf_overspend_bits; // cumulative bits overspent because of GF boost
-
- int non_gf_bitrate_adjustment; // Following GF to recover extra bits spent
-
- int kf_overspend_bits; // Bits spent on key frames to be recovered on inters
- int kf_bitrate_adjustment; // number of bits to recover on each inter frame.
- int max_gf_interval;
- int baseline_gf_interval;
+ int zbin_mode_boost;
+ int zbin_mode_boost_enabled;
int active_arnr_frames; // <= cpi->oxcf.arnr_max_frames
int active_arnr_strength; // <= cpi->oxcf.arnr_max_strength
- int64_t key_frame_count;
- int prior_key_frame_distance[KEY_FRAME_CONTEXT];
- int per_frame_bandwidth; // Current section per frame bandwidth target
- int av_per_frame_bandwidth; // Average frame size target for clip
- int min_frame_bandwidth; // Minimum allocation used for any frame
- int inter_frame_target;
double output_framerate;
int64_t last_time_stamp_seen;
int64_t last_end_time_stamp_seen;
int64_t first_time_stamp_ever;
- int ni_av_qi;
- int ni_tot_qi;
- int ni_frames;
- int avg_frame_qindex;
- double tot_q;
- double avg_q;
-
- int zbin_mode_boost;
- int zbin_mode_boost_enabled;
-
- int64_t total_byte_count;
-
- int buffered_mode;
-
- int buffer_level;
- int bits_off_target;
-
- int rolling_target_bits;
- int rolling_actual_bits;
-
- int long_rolling_target_bits;
- int long_rolling_actual_bits;
-
- int64_t total_actual_bits;
- int total_target_vs_actual; // debug stats
-
- int worst_quality;
- int active_worst_quality;
- int best_quality;
- int active_best_quality;
+ RATE_CONTROL rc;
int cq_target_quality;
- int y_mode_count[4][INTRA_MODES];
- int y_uv_mode_count[INTRA_MODES][INTRA_MODES];
- unsigned int partition_count[PARTITION_CONTEXTS][PARTITION_TYPES];
-
- nmv_context_counts NMVcount;
+ vp9_coeff_count coef_counts[TX_SIZES][PLANE_TYPES];
+ vp9_coeff_probs_model frame_coef_probs[TX_SIZES][PLANE_TYPES];
+ vp9_coeff_stats frame_branch_ct[TX_SIZES][PLANE_TYPES];
- vp9_coeff_count coef_counts[TX_SIZES][BLOCK_TYPES];
- vp9_coeff_probs_model frame_coef_probs[TX_SIZES][BLOCK_TYPES];
- vp9_coeff_stats frame_branch_ct[TX_SIZES][BLOCK_TYPES];
-
- int gfu_boost;
- int last_boost;
- int kf_boost;
- int kf_zeromotion_pct;
- int gf_zeromotion_pct;
-
- int64_t target_bandwidth;
struct vpx_codec_pkt_list *output_pkt_list;
-#if 0
- // Experimental code for lagged and one pass
- ONEPASS_FRAMESTATS one_pass_frame_stats[MAX_LAG_BUFFERS];
- int one_pass_frame_index;
-#endif
MBGRAPH_FRAME_STATS mbgraph_stats[MAX_LAG_BUFFERS];
int mbgraph_n_frames; // number of frames filled in the above
int static_mb_pct; // % forced skip mbs by segmentation
int seg0_progress, seg0_idx, seg0_cnt;
- int decimation_factor;
- int decimation_count;
-
// for real time encoding
int speed;
- int compressor_speed;
- int auto_worst_q;
int cpu_used;
int pass;
- vp9_prob last_skip_false_probs[3][MBSKIP_CONTEXTS];
- int last_skip_probs_q[3];
-
int ref_frame_flags;
SPEED_FEATURES sf;
- int error_bins[1024];
unsigned int max_mv_magnitude;
int mv_step_param;
+ // Default value is 1. From first pass stats, encode_breakout may be disabled.
+ ENCODE_BREAKOUT_TYPE allow_encode_breakout;
+
+ // Get threshold from external input. In real time mode, it can be
+ // overwritten according to encoding speed.
+ int encode_breakout;
+
unsigned char *segmentation_map;
// segment threashold for encode breakout
int segment_encode_breakout[MAX_SEGMENTS];
+ unsigned char *complexity_map;
+
unsigned char *active_map;
unsigned int active_map_enabled;
+ CYCLIC_REFRESH cyclic_refresh;
+
fractional_mv_step_fp *find_fractional_mv_step;
fractional_mv_step_comp_fp *find_fractional_mv_step_comp;
vp9_full_search_fn_t full_search_sad;
@@ -537,63 +760,30 @@ typedef struct VP9_COMP {
uint64_t time_pick_lpf;
uint64_t time_encode_sb_row;
- struct twopass_rc {
- unsigned int section_intra_rating;
- unsigned int next_iiratio;
- unsigned int this_iiratio;
- FIRSTPASS_STATS total_stats;
- FIRSTPASS_STATS this_frame_stats;
- FIRSTPASS_STATS *stats_in, *stats_in_end, *stats_in_start;
- FIRSTPASS_STATS total_left_stats;
- int first_pass_done;
- int64_t bits_left;
- int64_t clip_bits_total;
- double avg_iiratio;
- double modified_error_total;
- double modified_error_used;
- double modified_error_left;
- double kf_intra_err_min;
- double gf_intra_err_min;
- int frames_to_key;
- int maxq_max_limit;
- int maxq_min_limit;
- int static_scene_max_gf_interval;
- int kf_bits;
- // Remaining error from uncoded frames in a gf group. Two pass use only
- int64_t gf_group_error_left;
-
- // Projected total bits available for a key frame group of frames
- int64_t kf_group_bits;
-
- // Error score of frames still to be coded in kf group
- int64_t kf_group_error_left;
-
- // Projected Bits available for a group of frames including 1 GF or ARF
- int64_t gf_group_bits;
- // Bits for the golden frame or ARF - 2 pass only
- int gf_bits;
- int alt_extra_bits;
-
- int sr_update_lag;
- double est_max_qcorrection_factor;
- } twopass;
+ struct twopass_rc twopass;
YV12_BUFFER_CONFIG alt_ref_buffer;
YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS];
int fixed_divide[512];
#if CONFIG_INTERNAL_STATS
+ unsigned int mode_chosen_counts[MAX_MODES];
+
int count;
double total_y;
double total_u;
double total_v;
double total;
- double total_sq_error;
+ uint64_t total_sq_error;
+ uint64_t total_samples;
+
double totalp_y;
double totalp_u;
double totalp_v;
double totalp;
- double total_sq_error2;
+ uint64_t totalp_sq_error;
+ uint64_t totalp_samples;
+
int bytes;
double summed_quality;
double summed_weights;
@@ -617,24 +807,21 @@ typedef struct VP9_COMP {
int *mb_norm_activity_map;
int output_partition;
- /* force next frame to intra when kf_auto says so */
+ // Force next frame to intra when kf_auto says so.
int force_next_frame_intra;
int droppable;
int dummy_packing; /* flag to indicate if packing is dummy */
- unsigned int switchable_interp_count[SWITCHABLE_FILTER_CONTEXTS]
- [SWITCHABLE_FILTERS];
-
unsigned int tx_stepdown_count[TX_SIZES];
int initial_width;
int initial_height;
- int number_spatial_layers;
- int enable_encode_breakout; // Default value is 1. From first pass stats,
- // encode_breakout may be disabled.
+ int use_svc;
+
+ SVC svc;
#if CONFIG_MULTIPLE_ARF
// ARF tracking variables.
@@ -649,17 +836,12 @@ typedef struct VP9_COMP {
int max_arf_level;
#endif
-#ifdef ENTROPY_STATS
- int64_t mv_ref_stats[INTER_MODE_CONTEXTS][INTER_MODES - 1][2];
-#endif
-
-
#ifdef MODE_TEST_HIT_STATS
// Debug / test stats
int64_t mode_test_hits[BLOCK_SIZES];
#endif
- /* Y,U,V,(A) */
+ // Y,U,V,(A)
ENTROPY_CONTEXT *above_context[MAX_MB_PLANE];
ENTROPY_CONTEXT left_context[MAX_MB_PLANE][16];
@@ -667,7 +849,62 @@ typedef struct VP9_COMP {
PARTITION_CONTEXT left_seg_context[8];
} VP9_COMP;
-static int get_ref_frame_idx(VP9_COMP *cpi, MV_REFERENCE_FRAME ref_frame) {
+void vp9_initialize_enc();
+
+struct VP9_COMP *vp9_create_compressor(VP9_CONFIG *oxcf);
+void vp9_remove_compressor(VP9_COMP *cpi);
+
+void vp9_change_config(VP9_COMP *cpi, VP9_CONFIG *oxcf);
+
+ // receive a frames worth of data. caller can assume that a copy of this
+ // frame is made and not just a copy of the pointer..
+int vp9_receive_raw_frame(VP9_COMP *cpi, unsigned int frame_flags,
+ YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
+ int64_t end_time_stamp);
+
+int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
+ size_t *size, uint8_t *dest,
+ int64_t *time_stamp, int64_t *time_end, int flush);
+
+int vp9_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest,
+ vp9_ppflags_t *flags);
+
+int vp9_use_as_reference(VP9_COMP *cpi, int ref_frame_flags);
+
+void vp9_update_reference(VP9_COMP *cpi, int ref_frame_flags);
+
+int vp9_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+ YV12_BUFFER_CONFIG *sd);
+
+int vp9_get_reference_enc(VP9_COMP *cpi, int index,
+ YV12_BUFFER_CONFIG **fb);
+
+int vp9_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
+ YV12_BUFFER_CONFIG *sd);
+
+int vp9_update_entropy(VP9_COMP *cpi, int update);
+
+int vp9_set_roimap(VP9_COMP *cpi, unsigned char *map,
+ unsigned int rows, unsigned int cols,
+ int delta_q[MAX_SEGMENTS],
+ int delta_lf[MAX_SEGMENTS],
+ unsigned int threshold[MAX_SEGMENTS]);
+
+int vp9_set_active_map(VP9_COMP *cpi, unsigned char *map,
+ unsigned int rows, unsigned int cols);
+
+int vp9_set_internal_size(VP9_COMP *cpi,
+ VPX_SCALING horiz_mode, VPX_SCALING vert_mode);
+
+int vp9_set_size_literal(VP9_COMP *cpi, unsigned int width,
+ unsigned int height);
+
+void vp9_set_svc(VP9_COMP *cpi, int use_svc);
+
+int vp9_get_quantizer(struct VP9_COMP *cpi);
+
+static int get_ref_frame_idx(const VP9_COMP *cpi,
+ MV_REFERENCE_FRAME ref_frame) {
if (ref_frame == LAST_FRAME) {
return cpi->lst_fb_idx;
} else if (ref_frame == GOLDEN_FRAME) {
@@ -677,34 +914,47 @@ static int get_ref_frame_idx(VP9_COMP *cpi, MV_REFERENCE_FRAME ref_frame) {
}
}
-static int get_scale_ref_frame_idx(VP9_COMP *cpi,
- MV_REFERENCE_FRAME ref_frame) {
- if (ref_frame == LAST_FRAME) {
- return 0;
- } else if (ref_frame == GOLDEN_FRAME) {
- return 1;
- } else {
- return 2;
- }
+static YV12_BUFFER_CONFIG *get_ref_frame_buffer(VP9_COMP *cpi,
+ MV_REFERENCE_FRAME ref_frame) {
+ VP9_COMMON *const cm = &cpi->common;
+ return &cm->frame_bufs[cm->ref_frame_map[get_ref_frame_idx(cpi,
+ ref_frame)]].buf;
}
-void vp9_encode_frame(VP9_COMP *cpi);
+void vp9_set_speed_features(VP9_COMP *cpi);
-void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest,
- unsigned long *size);
+int vp9_calc_ss_err(const YV12_BUFFER_CONFIG *source,
+ const YV12_BUFFER_CONFIG *reference);
-void vp9_activity_masking(VP9_COMP *cpi, MACROBLOCK *x);
+void vp9_alloc_compressor_data(VP9_COMP *cpi);
-void vp9_set_speed_features(VP9_COMP *cpi);
+int vp9_compute_qdelta(const VP9_COMP *cpi, double qstart, double qtarget);
-int vp9_calc_ss_err(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest);
+int vp9_compute_qdelta_by_rate(VP9_COMP *cpi, int base_q_index,
+ double rate_target_ratio);
-void vp9_alloc_compressor_data(VP9_COMP *cpi);
+void vp9_scale_references(VP9_COMP *cpi);
-int vp9_compute_qdelta(VP9_COMP *cpi, double qstart, double qtarget);
+void vp9_update_reference_frames(VP9_COMP *cpi);
static int get_token_alloc(int mb_rows, int mb_cols) {
return mb_rows * mb_cols * (48 * 16 + 4);
}
+extern const int q_trans[];
+
+int64_t vp9_rescale(int64_t val, int64_t num, int denom);
+
+static void set_ref_ptrs(VP9_COMMON *cm, MACROBLOCKD *xd,
+ MV_REFERENCE_FRAME ref0, MV_REFERENCE_FRAME ref1) {
+ xd->block_refs[0] = &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME
+ : 0];
+ xd->block_refs[1] = &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME
+ : 0];
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_ONYX_INT_H_
diff --git a/libvpx/vp9/encoder/vp9_picklpf.c b/libvpx/vp9/encoder/vp9_picklpf.c
index 476ecaa..b5f4901 100644
--- a/libvpx/vp9/encoder/vp9_picklpf.c
+++ b/libvpx/vp9/encoder/vp9_picklpf.c
@@ -14,158 +14,86 @@
#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/encoder/vp9_picklpf.h"
#include "vp9/encoder/vp9_quantize.h"
+#include "vp9/common/vp9_quant_common.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_scale/vpx_scale.h"
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_loopfilter.h"
#include "./vpx_scale_rtcd.h"
-void vp9_yv12_copy_partial_frame_c(YV12_BUFFER_CONFIG *src_ybc,
- YV12_BUFFER_CONFIG *dst_ybc, int fraction) {
- const int height = src_ybc->y_height;
- const int stride = src_ybc->y_stride;
- const int offset = stride * ((height >> 5) * 16 - 8);
- const int lines_to_copy = MAX(height >> (fraction + 4), 1) << 4;
-
- assert(src_ybc->y_stride == dst_ybc->y_stride);
- vpx_memcpy(dst_ybc->y_buffer + offset, src_ybc->y_buffer + offset,
- stride * (lines_to_copy + 16));
+static int get_max_filter_level(VP9_COMP *cpi) {
+ return cpi->twopass.section_intra_rating > 8 ? MAX_LOOP_FILTER * 3 / 4
+ : MAX_LOOP_FILTER;
}
-static int calc_partial_ssl_err(YV12_BUFFER_CONFIG *source,
- YV12_BUFFER_CONFIG *dest, int Fraction) {
- int i, j;
- int Total = 0;
- int srcoffset, dstoffset;
- uint8_t *src = source->y_buffer;
- uint8_t *dst = dest->y_buffer;
-
- int linestocopy = (source->y_height >> (Fraction + 4));
-
- if (linestocopy < 1)
- linestocopy = 1;
-
- linestocopy <<= 4;
+static int try_filter_frame(const YV12_BUFFER_CONFIG *sd, VP9_COMP *const cpi,
+ MACROBLOCKD *const xd, VP9_COMMON *const cm,
+ int filt_level, int partial_frame) {
+ int filt_err;
- srcoffset = source->y_stride * (dest->y_height >> 5) * 16;
- dstoffset = dest->y_stride * (dest->y_height >> 5) * 16;
-
- src += srcoffset;
- dst += dstoffset;
-
- // Loop through the raw Y plane and reconstruction data summing the square
- // differences.
- for (i = 0; i < linestocopy; i += 16) {
- for (j = 0; j < source->y_width; j += 16) {
- unsigned int sse;
- Total += vp9_mse16x16(src + j, source->y_stride, dst + j, dest->y_stride,
- &sse);
- }
-
- src += 16 * source->y_stride;
- dst += 16 * dest->y_stride;
- }
-
- return Total;
-}
-
-// Enforce a minimum filter level based upon baseline Q
-static int get_min_filter_level(VP9_COMP *cpi, int base_qindex) {
- int min_filter_level;
- min_filter_level = 0;
-
- return min_filter_level;
-}
-
-// Enforce a maximum filter level based upon baseline Q
-static int get_max_filter_level(VP9_COMP *cpi, int base_qindex) {
- int max_filter_level = MAX_LOOP_FILTER;
- (void)base_qindex;
-
- if (cpi->twopass.section_intra_rating > 8)
- max_filter_level = MAX_LOOP_FILTER * 3 / 4;
-
- return max_filter_level;
-}
+ vp9_loop_filter_frame(cm, xd, filt_level, 1, partial_frame);
+ filt_err = vp9_calc_ss_err(sd, cm->frame_to_show);
+ // Re-instate the unfiltered frame
+ vpx_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show);
-// Stub function for now Alt LF not used
-void vp9_set_alt_lf_level(VP9_COMP *cpi, int filt_val) {
+ return filt_err;
}
-void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
+static void search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
+ int partial_frame) {
+ MACROBLOCKD *const xd = &cpi->mb.e_mbd;
VP9_COMMON *const cm = &cpi->common;
struct loopfilter *const lf = &cm->lf;
-
- int best_err = 0;
- int filt_err = 0;
- const int min_filter_level = get_min_filter_level(cpi, cm->base_qindex);
- const int max_filter_level = get_max_filter_level(cpi, cm->base_qindex);
-
- int filter_step;
- int filt_high = 0;
- // Start search at previous frame filter level
- int filt_mid = lf->filter_level;
- int filt_low = 0;
+ const int min_filter_level = 0;
+ const int max_filter_level = get_max_filter_level(cpi);
+ int best_err;
int filt_best;
int filt_direction = 0;
-
- int Bias = 0; // Bias against raising loop filter in favor of lowering it.
-
- // Make a copy of the unfiltered / processed recon buffer
- vpx_yv12_copy_y(cm->frame_to_show, &cpi->last_frame_uf);
-
- lf->sharpness_level = cm->frame_type == KEY_FRAME ? 0
- : cpi->oxcf.Sharpness;
-
// Start the search at the previous frame filter level unless it is now out of
// range.
- filt_mid = clamp(lf->filter_level, min_filter_level, max_filter_level);
+ int filt_mid = clamp(lf->filter_level, min_filter_level, max_filter_level);
+ int filter_step = filt_mid < 16 ? 4 : filt_mid / 4;
+ // Sum squared error at each filter level
+ int ss_err[MAX_LOOP_FILTER + 1];
- // Define the initial step size
- filter_step = filt_mid < 16 ? 4 : filt_mid / 4;
+ // Set each entry to -1
+ vpx_memset(ss_err, 0xFF, sizeof(ss_err));
- // Get baseline error score
- vp9_set_alt_lf_level(cpi, filt_mid);
- vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_mid, 1, partial);
+ // Make a copy of the unfiltered / processed recon buffer
+ vpx_yv12_copy_y(cm->frame_to_show, &cpi->last_frame_uf);
- best_err = vp9_calc_ss_err(sd, cm->frame_to_show);
+ best_err = try_filter_frame(sd, cpi, xd, cm, filt_mid, partial_frame);
filt_best = filt_mid;
-
- // Re-instate the unfiltered frame
- vpx_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show);
+ ss_err[filt_mid] = best_err;
while (filter_step > 0) {
- Bias = (best_err >> (15 - (filt_mid / 8))) * filter_step;
+ const int filt_high = MIN(filt_mid + filter_step, max_filter_level);
+ const int filt_low = MAX(filt_mid - filter_step, min_filter_level);
+ int filt_err;
+
+ // Bias against raising loop filter in favor of lowering it.
+ int bias = (best_err >> (15 - (filt_mid / 8))) * filter_step;
if (cpi->twopass.section_intra_rating < 20)
- Bias = Bias * cpi->twopass.section_intra_rating / 20;
+ bias = bias * cpi->twopass.section_intra_rating / 20;
// yx, bias less for large block size
- if (cpi->common.tx_mode != ONLY_4X4)
- Bias >>= 1;
-
- filt_high = ((filt_mid + filter_step) > max_filter_level)
- ? max_filter_level
- : (filt_mid + filter_step);
- filt_low = ((filt_mid - filter_step) < min_filter_level)
- ? min_filter_level
- : (filt_mid - filter_step);
+ if (cm->tx_mode != ONLY_4X4)
+ bias >>= 1;
- if ((filt_direction <= 0) && (filt_low != filt_mid)) {
+ if (filt_direction <= 0 && filt_low != filt_mid) {
// Get Low filter error score
- vp9_set_alt_lf_level(cpi, filt_low);
- vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_low, 1, partial);
-
- filt_err = vp9_calc_ss_err(sd, cm->frame_to_show);
-
- // Re-instate the unfiltered frame
- vpx_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show);
-
+ if (ss_err[filt_low] < 0) {
+ filt_err = try_filter_frame(sd, cpi, xd, cm, filt_low, partial_frame);
+ ss_err[filt_low] = filt_err;
+ } else {
+ filt_err = ss_err[filt_low];
+ }
// If value is close to the best so far then bias towards a lower loop
// filter value.
- if ((filt_err - Bias) < best_err) {
+ if ((filt_err - bias) < best_err) {
// Was it actually better than the previous best?
if (filt_err < best_err)
best_err = filt_err;
@@ -175,17 +103,15 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
}
// Now look at filt_high
- if ((filt_direction >= 0) && (filt_high != filt_mid)) {
- vp9_set_alt_lf_level(cpi, filt_high);
- vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_high, 1, partial);
-
- filt_err = vp9_calc_ss_err(sd, cm->frame_to_show);
-
- // Re-instate the unfiltered frame
- vpx_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show);
-
+ if (filt_direction >= 0 && filt_high != filt_mid) {
+ if (ss_err[filt_high] < 0) {
+ filt_err = try_filter_frame(sd, cpi, xd, cm, filt_high, partial_frame);
+ ss_err[filt_high] = filt_err;
+ } else {
+ filt_err = ss_err[filt_high];
+ }
// Was it better than the previous best?
- if (filt_err < (best_err - Bias)) {
+ if (filt_err < (best_err - bias)) {
best_err = filt_err;
filt_best = filt_high;
}
@@ -203,3 +129,27 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
lf->filter_level = filt_best;
}
+
+void vp9_pick_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
+ int method) {
+ VP9_COMMON *const cm = &cpi->common;
+ struct loopfilter *const lf = &cm->lf;
+
+ lf->sharpness_level = cm->frame_type == KEY_FRAME ? 0
+ : cpi->oxcf.sharpness;
+
+ if (method == 2) {
+ const int min_filter_level = 0;
+ const int max_filter_level = get_max_filter_level(cpi);
+ const int q = vp9_ac_quant(cm->base_qindex, 0);
+ // These values were determined by linear fitting the result of the
+ // searched level
+ // filt_guess = q * 0.316206 + 3.87252
+ int filt_guess = (q * 20723 + 1015158 + (1 << 17)) >> 18;
+ if (cm->frame_type == KEY_FRAME)
+ filt_guess -= 4;
+ lf->filter_level = clamp(filt_guess, min_filter_level, max_filter_level);
+ } else {
+ search_filter_level(sd, cpi, method == 1);
+ }
+}
diff --git a/libvpx/vp9/encoder/vp9_picklpf.h b/libvpx/vp9/encoder/vp9_picklpf.h
index 9de4cf8..203ef87 100644
--- a/libvpx/vp9/encoder/vp9_picklpf.h
+++ b/libvpx/vp9/encoder/vp9_picklpf.h
@@ -12,11 +12,17 @@
#ifndef VP9_ENCODER_VP9_PICKLPF_H_
#define VP9_ENCODER_VP9_PICKLPF_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct yv12_buffer_config;
struct VP9_COMP;
-void vp9_set_alt_lf_level(struct VP9_COMP *cpi, int filt_val);
+void vp9_pick_filter_level(const struct yv12_buffer_config *sd,
+ struct VP9_COMP *cpi, int method);
+#ifdef __cplusplus
+} // extern "C"
+#endif
-void vp9_pick_filter_level(struct yv12_buffer_config *sd,
- struct VP9_COMP *cpi, int partial);
#endif // VP9_ENCODER_VP9_PICKLPF_H_
diff --git a/libvpx/vp9/encoder/vp9_pickmode.c b/libvpx/vp9/encoder/vp9_pickmode.c
new file mode 100644
index 0000000..6c84144
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_pickmode.c
@@ -0,0 +1,351 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <assert.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+
+#include "./vp9_rtcd.h"
+
+#include "vpx_mem/vpx_mem.h"
+
+#include "vp9/common/vp9_common.h"
+#include "vp9/common/vp9_mvref_common.h"
+#include "vp9/common/vp9_reconinter.h"
+#include "vp9/common/vp9_reconintra.h"
+
+#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_ratectrl.h"
+#include "vp9/encoder/vp9_rdopt.h"
+
+static void full_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
+ const TileInfo *const tile,
+ BLOCK_SIZE bsize, int mi_row, int mi_col,
+ int_mv *tmp_mv) {
+ MACROBLOCKD *xd = &x->e_mbd;
+ MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
+ struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
+ int step_param;
+ int sadpb = x->sadperbit16;
+ MV mvp_full;
+ int ref = mbmi->ref_frame[0];
+ const MV ref_mv = mbmi->ref_mvs[ref][0].as_mv;
+ int i;
+
+ int tmp_col_min = x->mv_col_min;
+ int tmp_col_max = x->mv_col_max;
+ int tmp_row_min = x->mv_row_min;
+ int tmp_row_max = x->mv_row_max;
+
+ const YV12_BUFFER_CONFIG *scaled_ref_frame = vp9_get_scaled_ref_frame(cpi,
+ ref);
+ if (scaled_ref_frame) {
+ int i;
+ // Swap out the reference frame for a version that's been scaled to
+ // match the resolution of the current frame, allowing the existing
+ // motion search code to be used without additional modifications.
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ backup_yv12[i] = xd->plane[i].pre[0];
+
+ vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
+ }
+
+ vp9_set_mv_search_range(x, &ref_mv);
+
+ // TODO(jingning) exploiting adaptive motion search control in non-RD
+ // mode decision too.
+ step_param = 6;
+
+ for (i = LAST_FRAME; i <= LAST_FRAME && cpi->common.show_frame; ++i) {
+ if ((x->pred_mv_sad[ref] >> 3) > x->pred_mv_sad[i]) {
+ tmp_mv->as_int = INVALID_MV;
+
+ if (scaled_ref_frame) {
+ int i;
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ xd->plane[i].pre[0] = backup_yv12[i];
+ }
+ return;
+ }
+ }
+
+ mvp_full = mbmi->ref_mvs[ref][x->mv_best_ref_index[ref]].as_mv;
+
+ mvp_full.col >>= 3;
+ mvp_full.row >>= 3;
+
+ if (cpi->sf.search_method == FAST_DIAMOND) {
+ // NOTE: this returns SAD
+ vp9_fast_dia_search(x, &mvp_full, step_param, sadpb, 0,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ } else if (cpi->sf.search_method == FAST_HEX) {
+ // NOTE: this returns SAD
+ vp9_fast_hex_search(x, &mvp_full, step_param, sadpb, 0,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ } else if (cpi->sf.search_method == HEX) {
+ // NOTE: this returns SAD
+ vp9_hex_search(x, &mvp_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ } else if (cpi->sf.search_method == SQUARE) {
+ // NOTE: this returns SAD
+ vp9_square_search(x, &mvp_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ } else if (cpi->sf.search_method == BIGDIA) {
+ // NOTE: this returns SAD
+ vp9_bigdia_search(x, &mvp_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ } else {
+ int further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
+ // NOTE: this returns variance
+ vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
+ sadpb, further_steps, 1,
+ &cpi->fn_ptr[bsize],
+ &ref_mv, &tmp_mv->as_mv);
+ }
+ x->mv_col_min = tmp_col_min;
+ x->mv_col_max = tmp_col_max;
+ x->mv_row_min = tmp_row_min;
+ x->mv_row_max = tmp_row_max;
+
+ if (scaled_ref_frame) {
+ int i;
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ xd->plane[i].pre[0] = backup_yv12[i];
+ }
+}
+
+static void sub_pixel_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
+ const TileInfo *const tile,
+ BLOCK_SIZE bsize, int mi_row, int mi_col,
+ MV *tmp_mv, int *rate_mv) {
+ MACROBLOCKD *xd = &x->e_mbd;
+ MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
+ struct buf_2d backup_yv12[MAX_MB_PLANE] = {{0}};
+ int ref = mbmi->ref_frame[0];
+ MV ref_mv = mbmi->ref_mvs[ref][0].as_mv;
+ int dis;
+
+ const YV12_BUFFER_CONFIG *scaled_ref_frame = vp9_get_scaled_ref_frame(cpi,
+ ref);
+ if (scaled_ref_frame) {
+ int i;
+ // Swap out the reference frame for a version that's been scaled to
+ // match the resolution of the current frame, allowing the existing
+ // motion search code to be used without additional modifications.
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ backup_yv12[i] = xd->plane[i].pre[0];
+
+ vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
+ }
+
+ cpi->find_fractional_mv_step(x, tmp_mv, &ref_mv,
+ cpi->common.allow_high_precision_mv,
+ x->errorperbit,
+ &cpi->fn_ptr[bsize],
+ cpi->sf.subpel_force_stop,
+ cpi->sf.subpel_iters_per_step,
+ x->nmvjointcost, x->mvcost,
+ &dis, &x->pred_sse[ref]);
+
+ // calculate the bit cost on motion vector
+ *rate_mv = vp9_mv_bit_cost(tmp_mv, &ref_mv,
+ x->nmvjointcost, x->mvcost, MV_COST_WEIGHT);
+
+ if (scaled_ref_frame) {
+ int i;
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ xd->plane[i].pre[0] = backup_yv12[i];
+ }
+}
+
+static void model_rd_for_sb_y(VP9_COMP *cpi, BLOCK_SIZE bsize,
+ MACROBLOCK *x, MACROBLOCKD *xd,
+ int *out_rate_sum, int64_t *out_dist_sum) {
+ // Note our transform coeffs are 8 times an orthogonal transform.
+ // Hence quantizer step is also 8 times. To get effective quantizer
+ // we need to divide by 8 before sending to modeling function.
+ unsigned int sse;
+ int rate;
+ int64_t dist;
+
+ struct macroblock_plane *const p = &x->plane[0];
+ struct macroblockd_plane *const pd = &xd->plane[0];
+ const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
+
+ int var = cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride,
+ pd->dst.buf, pd->dst.stride, &sse);
+
+ vp9_model_rd_from_var_lapndz(var + sse, 1 << num_pels_log2_lookup[bs],
+ pd->dequant[1] >> 3, &rate, &dist);
+
+ *out_rate_sum = rate;
+ *out_dist_sum = dist << 3;
+}
+
+// TODO(jingning) placeholder for inter-frame non-RD mode decision.
+// this needs various further optimizations. to be continued..
+int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
+ const TileInfo *const tile,
+ int mi_row, int mi_col,
+ int *returnrate,
+ int64_t *returndistortion,
+ BLOCK_SIZE bsize) {
+ MACROBLOCKD *xd = &x->e_mbd;
+ MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
+ struct macroblock_plane *const p = &x->plane[0];
+ struct macroblockd_plane *const pd = &xd->plane[0];
+ const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
+ MB_PREDICTION_MODE this_mode, best_mode = ZEROMV;
+ MV_REFERENCE_FRAME ref_frame, best_ref_frame = LAST_FRAME;
+ int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES];
+ struct buf_2d yv12_mb[4][MAX_MB_PLANE];
+ static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
+ VP9_ALT_FLAG };
+ int64_t best_rd = INT64_MAX;
+ int64_t this_rd = INT64_MAX;
+
+ int rate = INT_MAX;
+ int64_t dist = INT64_MAX;
+
+ VP9_COMMON *cm = &cpi->common;
+ int intra_cost_penalty = 20 * vp9_dc_quant(cm->base_qindex, cm->y_dc_delta_q);
+
+ const int64_t inter_mode_thresh = RDCOST(x->rdmult, x->rddiv,
+ intra_cost_penalty, 0);
+ const int64_t intra_mode_cost = 50;
+
+ x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
+
+ x->skip = 0;
+ if (!x->in_active_map)
+ x->skip = 1;
+ // initialize mode decisions
+ *returnrate = INT_MAX;
+ *returndistortion = INT64_MAX;
+ vpx_memset(mbmi, 0, sizeof(MB_MODE_INFO));
+ mbmi->sb_type = bsize;
+ mbmi->ref_frame[0] = NONE;
+ mbmi->ref_frame[1] = NONE;
+ mbmi->tx_size = MIN(max_txsize_lookup[bsize],
+ tx_mode_to_biggest_tx_size[cpi->common.tx_mode]);
+ mbmi->interp_filter = cpi->common.interp_filter == SWITCHABLE ?
+ EIGHTTAP : cpi->common.interp_filter;
+ mbmi->skip = 0;
+ mbmi->segment_id = 0;
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
+
+ for (ref_frame = LAST_FRAME; ref_frame <= LAST_FRAME ; ++ref_frame) {
+ x->pred_mv_sad[ref_frame] = INT_MAX;
+ if (cpi->ref_frame_flags & flag_list[ref_frame]) {
+ vp9_setup_buffer_inter(cpi, x, tile,
+ ref_frame, block_size, mi_row, mi_col,
+ frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb);
+ }
+ frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
+ frame_mv[ZEROMV][ref_frame].as_int = 0;
+ }
+
+ for (ref_frame = LAST_FRAME; ref_frame <= LAST_FRAME ; ++ref_frame) {
+ if (!(cpi->ref_frame_flags & flag_list[ref_frame]))
+ continue;
+
+ // Select prediction reference frames.
+ xd->plane[0].pre[0] = yv12_mb[ref_frame][0];
+
+ clamp_mv2(&frame_mv[NEARESTMV][ref_frame].as_mv, xd);
+ clamp_mv2(&frame_mv[NEARMV][ref_frame].as_mv, xd);
+
+ mbmi->ref_frame[0] = ref_frame;
+
+ for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) {
+ int rate_mv = 0;
+
+ if (cpi->sf.disable_inter_mode_mask[bsize] &
+ (1 << INTER_OFFSET(this_mode)))
+ continue;
+
+ if (this_mode == NEWMV) {
+ if (this_rd < (int64_t)(1 << num_pels_log2_lookup[bsize]))
+ continue;
+
+ full_pixel_motion_search(cpi, x, tile, bsize, mi_row, mi_col,
+ &frame_mv[NEWMV][ref_frame]);
+
+ if (frame_mv[NEWMV][ref_frame].as_int == INVALID_MV)
+ continue;
+
+ sub_pixel_motion_search(cpi, x, tile, bsize, mi_row, mi_col,
+ &frame_mv[NEWMV][ref_frame].as_mv, &rate_mv);
+ }
+
+ if (this_mode != NEARESTMV)
+ if (frame_mv[this_mode][ref_frame].as_int ==
+ frame_mv[NEARESTMV][ref_frame].as_int)
+ continue;
+
+ mbmi->mode = this_mode;
+ mbmi->mv[0].as_int = frame_mv[this_mode][ref_frame].as_int;
+ vp9_build_inter_predictors_sby(xd, mi_row, mi_col, bsize);
+
+ model_rd_for_sb_y(cpi, bsize, x, xd, &rate, &dist);
+ rate += rate_mv;
+ rate += x->inter_mode_cost[mbmi->mode_context[ref_frame]]
+ [INTER_OFFSET(this_mode)];
+ this_rd = RDCOST(x->rdmult, x->rddiv, rate, dist);
+
+ if (this_rd < best_rd) {
+ best_rd = this_rd;
+ *returnrate = rate;
+ *returndistortion = dist;
+ best_mode = this_mode;
+ best_ref_frame = ref_frame;
+ }
+ }
+ }
+
+ mbmi->mode = best_mode;
+ mbmi->ref_frame[0] = best_ref_frame;
+ mbmi->mv[0].as_int = frame_mv[best_mode][best_ref_frame].as_int;
+ xd->mi_8x8[0]->bmi[0].as_mv[0].as_int = mbmi->mv[0].as_int;
+
+ // Perform intra prediction search, if the best SAD is above a certain
+ // threshold.
+ if (best_rd > inter_mode_thresh) {
+ for (this_mode = DC_PRED; this_mode <= DC_PRED; ++this_mode) {
+ vp9_predict_intra_block(xd, 0, b_width_log2(bsize),
+ mbmi->tx_size, this_mode,
+ &p->src.buf[0], p->src.stride,
+ &pd->dst.buf[0], pd->dst.stride, 0, 0, 0);
+
+ model_rd_for_sb_y(cpi, bsize, x, xd, &rate, &dist);
+ rate += x->mbmode_cost[this_mode];
+ rate += intra_cost_penalty;
+ this_rd = RDCOST(x->rdmult, x->rddiv, rate, dist);
+
+ if (this_rd + intra_mode_cost < best_rd) {
+ best_rd = this_rd;
+ *returnrate = rate;
+ *returndistortion = dist;
+ mbmi->mode = this_mode;
+ mbmi->ref_frame[0] = INTRA_FRAME;
+ mbmi->uv_mode = this_mode;
+ mbmi->mv[0].as_int = INVALID_MV;
+ }
+ }
+ }
+
+ return INT64_MAX;
+}
diff --git a/libvpx/vp9/encoder/vp9_pickmode.h b/libvpx/vp9/encoder/vp9_pickmode.h
new file mode 100644
index 0000000..05ff187
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_pickmode.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_ENCODER_VP9_PICKMODE_H_
+#define VP9_ENCODER_VP9_PICKMODE_H_
+
+#include "vp9/encoder/vp9_onyx_int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
+ const struct TileInfo *const tile,
+ int mi_row, int mi_col,
+ int *returnrate,
+ int64_t *returndistortion,
+ BLOCK_SIZE bsize);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_PICKMODE_H_
diff --git a/libvpx/vp9/encoder/vp9_psnr.c b/libvpx/vp9/encoder/vp9_psnr.c
deleted file mode 100644
index 58294e1..0000000
--- a/libvpx/vp9/encoder/vp9_psnr.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <math.h>
-
-#include "vpx_scale/yv12config.h"
-
-#define MAX_PSNR 100
-
-double vp9_mse2psnr(double samples, double peak, double mse) {
- double psnr;
-
- if (mse > 0.0)
- psnr = 10.0 * log10(peak * peak * samples / mse);
- else
- psnr = MAX_PSNR; // Limit to prevent / 0
-
- if (psnr > MAX_PSNR)
- psnr = MAX_PSNR;
-
- return psnr;
-}
diff --git a/libvpx/vp9/encoder/vp9_quantize.c b/libvpx/vp9/encoder/vp9_quantize.c
index d24be96..4ab8995 100644
--- a/libvpx/vp9/encoder/vp9_quantize.c
+++ b/libvpx/vp9/encoder/vp9_quantize.c
@@ -9,18 +9,15 @@
*/
#include <math.h>
+
#include "vpx_mem/vpx_mem.h"
-#include "vp9/encoder/vp9_onyx_int.h"
-#include "vp9/encoder/vp9_rdopt.h"
-#include "vp9/encoder/vp9_quantize.h"
#include "vp9/common/vp9_quant_common.h"
-
#include "vp9/common/vp9_seg_common.h"
-#ifdef ENC_DEBUG
-extern int enc_debug;
-#endif
+#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_quantize.h"
+#include "vp9/encoder/vp9_rdopt.h"
void vp9_quantize_b_c(const int16_t *coeff_ptr, intptr_t count,
int skip_block,
@@ -30,7 +27,7 @@ void vp9_quantize_b_c(const int16_t *coeff_ptr, intptr_t count,
const int16_t *dequant_ptr,
int zbin_oq_value, uint16_t *eob_ptr,
const int16_t *scan, const int16_t *iscan) {
- int i, non_zero_count = count, eob = -1;
+ int i, non_zero_count = (int)count, eob = -1;
const int zbins[2] = { zbin_ptr[0] + zbin_oq_value,
zbin_ptr[1] + zbin_oq_value };
const int nzbins[2] = { zbins[0] * -1,
@@ -41,7 +38,7 @@ void vp9_quantize_b_c(const int16_t *coeff_ptr, intptr_t count,
if (!skip_block) {
// Pre-scan pass
- for (i = count - 1; i >= 0; i--) {
+ for (i = (int)count - 1; i >= 0; i--) {
const int rc = scan[i];
const int coeff = coeff_ptr[rc];
@@ -83,99 +80,64 @@ void vp9_quantize_b_32x32_c(const int16_t *coeff_ptr, intptr_t n_coeffs,
const int16_t *dequant_ptr,
int zbin_oq_value, uint16_t *eob_ptr,
const int16_t *scan, const int16_t *iscan) {
- int i, rc, eob;
- int zbins[2], nzbins[2];
- int x, y, z, sz;
+ const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0] + zbin_oq_value, 1),
+ ROUND_POWER_OF_TWO(zbin_ptr[1] + zbin_oq_value, 1) };
+ const int nzbins[2] = {zbins[0] * -1, zbins[1] * -1};
+
int idx = 0;
int idx_arr[1024];
+ int i, eob = -1;
- vpx_memset(qcoeff_ptr, 0, n_coeffs*sizeof(int16_t));
- vpx_memset(dqcoeff_ptr, 0, n_coeffs*sizeof(int16_t));
-
- eob = -1;
-
- // Base ZBIN
- zbins[0] = ROUND_POWER_OF_TWO(zbin_ptr[0] + zbin_oq_value, 1);
- zbins[1] = ROUND_POWER_OF_TWO(zbin_ptr[1] + zbin_oq_value, 1);
- nzbins[0] = zbins[0] * -1;
- nzbins[1] = zbins[1] * -1;
+ vpx_memset(qcoeff_ptr, 0, n_coeffs * sizeof(int16_t));
+ vpx_memset(dqcoeff_ptr, 0, n_coeffs * sizeof(int16_t));
if (!skip_block) {
// Pre-scan pass
for (i = 0; i < n_coeffs; i++) {
- rc = scan[i];
- z = coeff_ptr[rc];
+ const int rc = scan[i];
+ const int coeff = coeff_ptr[rc];
// If the coefficient is out of the base ZBIN range, keep it for
// quantization.
- if (z >= zbins[rc != 0] || z <= nzbins[rc != 0])
+ if (coeff >= zbins[rc != 0] || coeff <= nzbins[rc != 0])
idx_arr[idx++] = i;
}
// Quantization pass: only process the coefficients selected in
// pre-scan pass. Note: idx can be zero.
for (i = 0; i < idx; i++) {
- rc = scan[idx_arr[i]];
-
- z = coeff_ptr[rc];
- sz = (z >> 31); // sign of z
- x = (z ^ sz) - sz; // x = abs(z)
-
- x += ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1);
- x = clamp(x, INT16_MIN, INT16_MAX);
- y = ((((x * quant_ptr[rc != 0]) >> 16) + x) *
- quant_shift_ptr[rc != 0]) >> 15; // quantize (x)
-
- x = (y ^ sz) - sz; // get the sign back
- qcoeff_ptr[rc] = x; // write to destination
- dqcoeff_ptr[rc] = x * dequant_ptr[rc != 0] / 2; // dequantized value
-
- if (y)
- eob = idx_arr[i]; // last nonzero coeffs
+ const int rc = scan[idx_arr[i]];
+ const int coeff = coeff_ptr[rc];
+ const int coeff_sign = (coeff >> 31);
+ int tmp;
+ int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
+ abs_coeff += ROUND_POWER_OF_TWO(round_ptr[rc != 0], 1);
+ abs_coeff = clamp(abs_coeff, INT16_MIN, INT16_MAX);
+ tmp = ((((abs_coeff * quant_ptr[rc != 0]) >> 16) + abs_coeff) *
+ quant_shift_ptr[rc != 0]) >> 15;
+
+ qcoeff_ptr[rc] = (tmp ^ coeff_sign) - coeff_sign;
+ dqcoeff_ptr[rc] = qcoeff_ptr[rc] * dequant_ptr[rc != 0] / 2;
+
+ if (tmp)
+ eob = idx_arr[i];
}
}
*eob_ptr = eob + 1;
}
-struct plane_block_idx {
- int plane;
- int block;
-};
-
-// TODO(jkoleszar): returning a struct so it can be used in a const context,
-// expect to refactor this further later.
-static INLINE struct plane_block_idx plane_block_idx(int y_blocks,
- int b_idx) {
- const int v_offset = y_blocks * 5 / 4;
- struct plane_block_idx res;
-
- if (b_idx < y_blocks) {
- res.plane = 0;
- res.block = b_idx;
- } else if (b_idx < v_offset) {
- res.plane = 1;
- res.block = b_idx - y_blocks;
- } else {
- assert(b_idx < y_blocks * 3 / 2);
- res.plane = 2;
- res.block = b_idx - v_offset;
- }
- return res;
-}
-
-void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int y_blocks, int b_idx,
+void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
const int16_t *scan, const int16_t *iscan) {
MACROBLOCKD *const xd = &x->e_mbd;
- const struct plane_block_idx pb_idx = plane_block_idx(y_blocks, b_idx);
- struct macroblock_plane* p = &x->plane[pb_idx.plane];
- struct macroblockd_plane* pd = &xd->plane[pb_idx.plane];
+ struct macroblock_plane *p = &x->plane[plane];
+ struct macroblockd_plane *pd = &xd->plane[plane];
- vp9_quantize_b(BLOCK_OFFSET(p->coeff, pb_idx.block),
+ vp9_quantize_b(BLOCK_OFFSET(p->coeff, block),
16, x->skip_block,
p->zbin, p->round, p->quant, p->quant_shift,
- BLOCK_OFFSET(pd->qcoeff, pb_idx.block),
- BLOCK_OFFSET(pd->dqcoeff, pb_idx.block),
- pd->dequant, p->zbin_extra, &pd->eobs[pb_idx.block], scan, iscan);
+ BLOCK_OFFSET(p->qcoeff, block),
+ BLOCK_OFFSET(pd->dqcoeff, block),
+ pd->dequant, p->zbin_extra, &p->eobs[block], scan, iscan);
}
static void invert_quant(int16_t *quant, int16_t *shift, int d) {
@@ -190,44 +152,40 @@ static void invert_quant(int16_t *quant, int16_t *shift, int d) {
}
void vp9_init_quantizer(VP9_COMP *cpi) {
- int i, q;
VP9_COMMON *const cm = &cpi->common;
+ int i, q, quant;
for (q = 0; q < QINDEX_RANGE; q++) {
const int qzbin_factor = q == 0 ? 64 : (vp9_dc_quant(q, 0) < 148 ? 84 : 80);
const int qrounding_factor = q == 0 ? 64 : 48;
- // y
for (i = 0; i < 2; ++i) {
- const int quant = i == 0 ? vp9_dc_quant(q, cm->y_dc_delta_q)
- : vp9_ac_quant(q, 0);
+ // y
+ quant = i == 0 ? vp9_dc_quant(q, cm->y_dc_delta_q)
+ : vp9_ac_quant(q, 0);
invert_quant(&cpi->y_quant[q][i], &cpi->y_quant_shift[q][i], quant);
cpi->y_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant, 7);
cpi->y_round[q][i] = (qrounding_factor * quant) >> 7;
cm->y_dequant[q][i] = quant;
- }
- // uv
- for (i = 0; i < 2; ++i) {
- const int quant = i == 0 ? vp9_dc_quant(q, cm->uv_dc_delta_q)
- : vp9_ac_quant(q, cm->uv_ac_delta_q);
+ // uv
+ quant = i == 0 ? vp9_dc_quant(q, cm->uv_dc_delta_q)
+ : vp9_ac_quant(q, cm->uv_ac_delta_q);
invert_quant(&cpi->uv_quant[q][i], &cpi->uv_quant_shift[q][i], quant);
cpi->uv_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant, 7);
cpi->uv_round[q][i] = (qrounding_factor * quant) >> 7;
cm->uv_dequant[q][i] = quant;
- }
#if CONFIG_ALPHA
- // alpha
- for (i = 0; i < 2; ++i) {
- const int quant = i == 0 ? vp9_dc_quant(q, cm->a_dc_delta_q)
- : vp9_ac_quant(q, cm->a_ac_delta_q);
+ // alpha
+ quant = i == 0 ? vp9_dc_quant(q, cm->a_dc_delta_q)
+ : vp9_ac_quant(q, cm->a_ac_delta_q);
invert_quant(&cpi->a_quant[q][i], &cpi->a_quant_shift[q][i], quant);
cpi->a_zbin[q][i] = ROUND_POWER_OF_TWO(qzbin_factor * quant, 7);
cpi->a_round[q][i] = (qrounding_factor * quant) >> 7;
cm->a_dequant[q][i] = quant;
- }
#endif
+ }
for (i = 2; i < 8; i++) {
cpi->y_quant[q][i] = cpi->y_quant[q][1];
@@ -253,39 +211,31 @@ void vp9_init_quantizer(VP9_COMP *cpi) {
}
}
-void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) {
- int i;
- VP9_COMMON *const cm = &cpi->common;
+void vp9_init_plane_quantizers(VP9_COMP *cpi, MACROBLOCK *x) {
+ const VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *xd = &x->e_mbd;
- int zbin_extra;
- int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
- const int qindex = vp9_get_qindex(&cpi->common.seg, segment_id,
- cpi->common.base_qindex);
-
- int rdmult = vp9_compute_rd_mult(cpi, qindex + cm->y_dc_delta_q);
+ const int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
+ const int qindex = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex);
+ const int rdmult = vp9_compute_rd_mult(cpi, qindex + cm->y_dc_delta_q);
+ const int zbin = cpi->zbin_mode_boost + x->act_zbin_adj;
+ int i;
// Y
- zbin_extra = (cpi->common.y_dequant[qindex][1] *
- (cpi->zbin_mode_boost + x->act_zbin_adj)) >> 7;
-
x->plane[0].quant = cpi->y_quant[qindex];
x->plane[0].quant_shift = cpi->y_quant_shift[qindex];
x->plane[0].zbin = cpi->y_zbin[qindex];
x->plane[0].round = cpi->y_round[qindex];
- x->plane[0].zbin_extra = (int16_t)zbin_extra;
- x->e_mbd.plane[0].dequant = cpi->common.y_dequant[qindex];
+ x->plane[0].zbin_extra = (int16_t)((cm->y_dequant[qindex][1] * zbin) >> 7);
+ xd->plane[0].dequant = cm->y_dequant[qindex];
// UV
- zbin_extra = (cpi->common.uv_dequant[qindex][1] *
- (cpi->zbin_mode_boost + x->act_zbin_adj)) >> 7;
-
for (i = 1; i < 3; i++) {
x->plane[i].quant = cpi->uv_quant[qindex];
x->plane[i].quant_shift = cpi->uv_quant_shift[qindex];
x->plane[i].zbin = cpi->uv_zbin[qindex];
x->plane[i].round = cpi->uv_round[qindex];
- x->plane[i].zbin_extra = (int16_t)zbin_extra;
- x->e_mbd.plane[i].dequant = cpi->common.uv_dequant[qindex];
+ x->plane[i].zbin_extra = (int16_t)((cm->uv_dequant[qindex][1] * zbin) >> 7);
+ xd->plane[i].dequant = cm->uv_dequant[qindex];
}
#if CONFIG_ALPHA
@@ -293,19 +243,15 @@ void vp9_mb_init_quantizer(VP9_COMP *cpi, MACROBLOCK *x) {
x->plane[3].quant_shift = cpi->a_quant_shift[qindex];
x->plane[3].zbin = cpi->a_zbin[qindex];
x->plane[3].round = cpi->a_round[qindex];
- x->plane[3].zbin_extra = (int16_t)zbin_extra;
- x->e_mbd.plane[3].dequant = cpi->common.a_dequant[qindex];
+ x->plane[3].zbin_extra = (int16_t)((cm->a_dequant[qindex][1] * zbin) >> 7);
+ xd->plane[3].dequant = cm->a_dequant[qindex];
#endif
- x->skip_block = vp9_segfeature_active(&cpi->common.seg, segment_id,
- SEG_LVL_SKIP);
-
- /* save this macroblock QIndex for vp9_update_zbin_extra() */
+ x->skip_block = vp9_segfeature_active(&cm->seg, segment_id, SEG_LVL_SKIP);
x->q_index = qindex;
- /* R/D setup */
- cpi->mb.errorperbit = rdmult >> 6;
- cpi->mb.errorperbit += (cpi->mb.errorperbit == 0);
+ x->errorperbit = rdmult >> 6;
+ x->errorperbit += (x->errorperbit == 0);
vp9_initialize_me_consts(cpi, x->q_index);
}
@@ -323,26 +269,17 @@ void vp9_update_zbin_extra(VP9_COMP *cpi, MACROBLOCK *x) {
}
void vp9_frame_init_quantizer(VP9_COMP *cpi) {
- // Clear Zbin mode boost for default case
cpi->zbin_mode_boost = 0;
-
- // MB level quantizer setup
- vp9_mb_init_quantizer(cpi, &cpi->mb);
+ vp9_init_plane_quantizers(cpi, &cpi->mb);
}
void vp9_set_quantizer(struct VP9_COMP *cpi, int q) {
- VP9_COMMON *cm = &cpi->common;
+ VP9_COMMON *const cm = &cpi->common;
+ // quantizer has to be reinitialized with vp9_init_quantizer() if any
+ // delta_q changes.
cm->base_qindex = q;
-
- // if any of the delta_q values are changing update flag will
- // have to be set.
cm->y_dc_delta_q = 0;
cm->uv_dc_delta_q = 0;
cm->uv_ac_delta_q = 0;
-
- // quantizer has to be reinitialized if any delta_q changes.
- // As there are not any here for now this is inactive code.
- // if(update)
- // vp9_init_quantizer(cpi);
}
diff --git a/libvpx/vp9/encoder/vp9_quantize.h b/libvpx/vp9/encoder/vp9_quantize.h
index c078e1d..f356b12 100644
--- a/libvpx/vp9/encoder/vp9_quantize.h
+++ b/libvpx/vp9/encoder/vp9_quantize.h
@@ -13,7 +13,11 @@
#include "vp9/encoder/vp9_block.h"
-void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int y_blocks, int b_idx,
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vp9_regular_quantize_b_4x4(MACROBLOCK *x, int plane, int block,
const int16_t *scan, const int16_t *iscan);
struct VP9_COMP;
@@ -24,8 +28,12 @@ void vp9_frame_init_quantizer(struct VP9_COMP *cpi);
void vp9_update_zbin_extra(struct VP9_COMP *cpi, MACROBLOCK *x);
-void vp9_mb_init_quantizer(struct VP9_COMP *cpi, MACROBLOCK *x);
+void vp9_init_plane_quantizers(struct VP9_COMP *cpi, MACROBLOCK *x);
void vp9_init_quantizer(struct VP9_COMP *cpi);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_QUANTIZE_H_
diff --git a/libvpx/vp9/encoder/vp9_ratectrl.c b/libvpx/vp9/encoder/vp9_ratectrl.c
index 0aa3a68..edc48bb 100644
--- a/libvpx/vp9/encoder/vp9_ratectrl.c
+++ b/libvpx/vp9/encoder/vp9_ratectrl.c
@@ -8,23 +8,29 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
#include <assert.h>
+#include <limits.h>
#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vpx_mem/vpx_mem.h"
#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_common.h"
-#include "vp9/encoder/vp9_ratectrl.h"
#include "vp9/common/vp9_entropymode.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_systemdependent.h"
-#include "vp9/encoder/vp9_encodemv.h"
#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_seg_common.h"
+#include "vp9/common/vp9_systemdependent.h"
+
+#include "vp9/encoder/vp9_encodemv.h"
+#include "vp9/encoder/vp9_ratectrl.h"
+
+#define DEFAULT_KF_BOOST 2000
+#define DEFAULT_GF_BOOST 2000
+
+#define LIMIT_QRANGE_FOR_ALTREF_AND_KEY 1
#define MIN_BPB_FACTOR 0.005
#define MAX_BPB_FACTOR 50
@@ -32,8 +38,87 @@
// Bits Per MB at different Q (Multiplied by 512)
#define BPER_MB_NORMBITS 9
-static const unsigned int prior_key_frame_weight[KEY_FRAME_CONTEXT] =
- { 1, 2, 3, 4, 5 };
+// Tables relating active max Q to active min Q
+static int kf_low_motion_minq[QINDEX_RANGE];
+static int kf_high_motion_minq[QINDEX_RANGE];
+static int gf_low_motion_minq[QINDEX_RANGE];
+static int gf_high_motion_minq[QINDEX_RANGE];
+static int inter_minq[QINDEX_RANGE];
+static int afq_low_motion_minq[QINDEX_RANGE];
+static int afq_high_motion_minq[QINDEX_RANGE];
+static int gf_high = 2000;
+static int gf_low = 400;
+static int kf_high = 5000;
+static int kf_low = 400;
+
+// Functions to compute the active minq lookup table entries based on a
+// formulaic approach to facilitate easier adjustment of the Q tables.
+// The formulae were derived from computing a 3rd order polynomial best
+// fit to the original data (after plotting real maxq vs minq (not q index))
+static int calculate_minq_index(double maxq,
+ double x3, double x2, double x1, double c) {
+ int i;
+ const double minqtarget = MIN(((x3 * maxq + x2) * maxq + x1) * maxq + c,
+ maxq);
+
+ // Special case handling to deal with the step from q2.0
+ // down to lossless mode represented by q 1.0.
+ if (minqtarget <= 2.0)
+ return 0;
+
+ for (i = 0; i < QINDEX_RANGE; i++) {
+ if (minqtarget <= vp9_convert_qindex_to_q(i))
+ return i;
+ }
+
+ return QINDEX_RANGE - 1;
+}
+
+void vp9_rc_init_minq_luts(void) {
+ int i;
+
+ for (i = 0; i < QINDEX_RANGE; i++) {
+ const double maxq = vp9_convert_qindex_to_q(i);
+
+
+ kf_low_motion_minq[i] = calculate_minq_index(maxq,
+ 0.000001,
+ -0.0004,
+ 0.15,
+ 0.0);
+ kf_high_motion_minq[i] = calculate_minq_index(maxq,
+ 0.000002,
+ -0.0012,
+ 0.50,
+ 0.0);
+
+ gf_low_motion_minq[i] = calculate_minq_index(maxq,
+ 0.0000015,
+ -0.0009,
+ 0.32,
+ 0.0);
+ gf_high_motion_minq[i] = calculate_minq_index(maxq,
+ 0.0000021,
+ -0.00125,
+ 0.50,
+ 0.0);
+ afq_low_motion_minq[i] = calculate_minq_index(maxq,
+ 0.0000015,
+ -0.0009,
+ 0.33,
+ 0.0);
+ afq_high_motion_minq[i] = calculate_minq_index(maxq,
+ 0.0000021,
+ -0.00125,
+ 0.55,
+ 0.0);
+ inter_minq[i] = calculate_minq_index(maxq,
+ 0.00000271,
+ -0.00113,
+ 0.75,
+ 0.0);
+ }
+}
// These functions use formulaic calculations to make playing with the
// quantizer tables easier. If necessary they can be replaced by lookup
@@ -43,22 +128,8 @@ double vp9_convert_qindex_to_q(int qindex) {
return vp9_ac_quant(qindex, 0) / 4.0;
}
-int vp9_gfboost_qadjust(int qindex) {
- const double q = vp9_convert_qindex_to_q(qindex);
- return (int)((0.00000828 * q * q * q) +
- (-0.0055 * q * q) +
- (1.32 * q) + 79.3);
-}
-
-static int kfboost_qadjust(int qindex) {
- const double q = vp9_convert_qindex_to_q(qindex);
- return (int)((0.00000973 * q * q * q) +
- (-0.00613 * q * q) +
- (1.316 * q) + 121.2);
-}
-
-int vp9_bits_per_mb(FRAME_TYPE frame_type, int qindex,
- double correction_factor) {
+int vp9_rc_bits_per_mb(FRAME_TYPE frame_type, int qindex,
+ double correction_factor) {
const double q = vp9_convert_qindex_to_q(qindex);
int enumerator = frame_type == KEY_FRAME ? 3300000 : 2250000;
@@ -117,8 +188,6 @@ void vp9_setup_key_frame(VP9_COMP *cpi) {
vp9_setup_past_independence(cm);
- // interval before next GF
- cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
/* All buffers are implicitly updated on key frames. */
cpi->refresh_golden_frame = 1;
cpi->refresh_alt_ref_frame = 1;
@@ -129,13 +198,13 @@ void vp9_setup_inter_frame(VP9_COMP *cpi) {
if (cm->error_resilient_mode || cm->intra_only)
vp9_setup_past_independence(cm);
- assert(cm->frame_context_idx < NUM_FRAME_CONTEXTS);
+ assert(cm->frame_context_idx < FRAME_CONTEXTS);
cm->fc = cm->frame_contexts[cm->frame_context_idx];
}
static int estimate_bits_at_q(int frame_kind, int q, int mbs,
double correction_factor) {
- const int bpm = (int)(vp9_bits_per_mb(frame_kind, q, correction_factor));
+ const int bpm = (int)(vp9_rc_bits_per_mb(frame_kind, q, correction_factor));
// Attempt to retain reasonable accuracy without overflow. The cutoff is
// chosen such that the maximum product of Bpm and MBs fits 31 bits. The
@@ -144,118 +213,152 @@ static int estimate_bits_at_q(int frame_kind, int q, int mbs,
: (bpm * mbs) >> BPER_MB_NORMBITS;
}
-
-static void calc_iframe_target_size(VP9_COMP *cpi) {
- // boost defaults to half second
- int target;
-
- // Clear down mmx registers to allow floating point in what follows
- vp9_clear_system_state(); // __asm emms;
-
- // New Two pass RC
- target = cpi->per_frame_bandwidth;
-
- if (cpi->oxcf.rc_max_intra_bitrate_pct) {
- int max_rate = cpi->per_frame_bandwidth
- * cpi->oxcf.rc_max_intra_bitrate_pct / 100;
-
- if (target > max_rate)
- target = max_rate;
+int vp9_rc_clamp_pframe_target_size(const VP9_COMP *const cpi, int target) {
+ const RATE_CONTROL *rc = &cpi->rc;
+ const int min_frame_target = MAX(rc->min_frame_bandwidth,
+ rc->av_per_frame_bandwidth >> 5);
+ if (target < min_frame_target)
+ target = min_frame_target;
+ if (cpi->refresh_golden_frame && rc->is_src_frame_alt_ref) {
+ // If there is an active ARF at this location use the minimum
+ // bits on this frame even if it is a constructed arf.
+ // The active maximum quantizer insures that an appropriate
+ // number of bits will be spent if needed for constructed ARFs.
+ target = min_frame_target;
}
+ // Clip the frame target to the maximum allowed value.
+ if (target > rc->max_frame_bandwidth)
+ target = rc->max_frame_bandwidth;
+ return target;
+}
- cpi->this_frame_target = target;
+int vp9_rc_clamp_iframe_target_size(const VP9_COMP *const cpi, int target) {
+ const RATE_CONTROL *rc = &cpi->rc;
+ const VP9_CONFIG *oxcf = &cpi->oxcf;
+ if (oxcf->rc_max_intra_bitrate_pct) {
+ const int max_rate = rc->av_per_frame_bandwidth *
+ oxcf->rc_max_intra_bitrate_pct / 100;
+ target = MIN(target, max_rate);
+ }
+ if (target > rc->max_frame_bandwidth)
+ target = rc->max_frame_bandwidth;
+ return target;
}
-// Do the best we can to define the parameters for the next GF based
-// on what information we have available.
-//
-// In this experimental code only two pass is supported
-// so we just use the interval determined in the two pass code.
-static void calc_gf_params(VP9_COMP *cpi) {
- // Set the gf interval
- cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
+// Update the buffer level for higher layers, given the encoded current layer.
+static void update_layer_buffer_level(VP9_COMP *const cpi,
+ int encoded_frame_size) {
+ int temporal_layer = 0;
+ int current_temporal_layer = cpi->svc.temporal_layer_id;
+ for (temporal_layer = current_temporal_layer + 1;
+ temporal_layer < cpi->svc.number_temporal_layers; ++temporal_layer) {
+ LAYER_CONTEXT *lc = &cpi->svc.layer_context[temporal_layer];
+ RATE_CONTROL *lrc = &lc->rc;
+ int bits_off_for_this_layer = (int)(lc->target_bandwidth / lc->framerate -
+ encoded_frame_size);
+ lrc->bits_off_target += bits_off_for_this_layer;
+
+ // Clip buffer level to maximum buffer size for the layer.
+ lrc->bits_off_target = MIN(lrc->bits_off_target, lc->maximum_buffer_size);
+ lrc->buffer_level = lrc->bits_off_target;
+ }
}
+// Update the buffer level: leaky bucket model.
+static void update_buffer_level(VP9_COMP *cpi, int encoded_frame_size) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const VP9_CONFIG *oxcf = &cpi->oxcf;
+ RATE_CONTROL *const rc = &cpi->rc;
-static void calc_pframe_target_size(VP9_COMP *cpi) {
- const int min_frame_target = MAX(cpi->min_frame_bandwidth,
- cpi->av_per_frame_bandwidth >> 5);
- if (cpi->refresh_alt_ref_frame) {
- // Special alt reference frame case
- // Per frame bit target for the alt ref frame
- cpi->per_frame_bandwidth = cpi->twopass.gf_bits;
- cpi->this_frame_target = cpi->per_frame_bandwidth;
+ // Non-viewable frames are a special case and are treated as pure overhead.
+ if (!cm->show_frame) {
+ rc->bits_off_target -= encoded_frame_size;
} else {
- // Normal frames (gf,and inter)
- cpi->this_frame_target = cpi->per_frame_bandwidth;
+ rc->bits_off_target += rc->av_per_frame_bandwidth - encoded_frame_size;
}
- // Check that the total sum of adjustments is not above the maximum allowed.
- // That is, having allowed for the KF and GF penalties, we have not pushed
- // the current inter-frame target too low. If the adjustment we apply here is
- // not capable of recovering all the extra bits we have spent in the KF or GF,
- // then the remainder will have to be recovered over a longer time span via
- // other buffer / rate control mechanisms.
- if (cpi->this_frame_target < min_frame_target)
- cpi->this_frame_target = min_frame_target;
+ // Clip the buffer level to the maximum specified buffer size.
+ rc->bits_off_target = MIN(rc->bits_off_target, oxcf->maximum_buffer_size);
+ rc->buffer_level = rc->bits_off_target;
- if (!cpi->refresh_alt_ref_frame)
- // Note the baseline target data rate for this inter frame.
- cpi->inter_frame_target = cpi->this_frame_target;
-
- // Adjust target frame size for Golden Frames:
- if (cpi->frames_till_gf_update_due == 0) {
- const int q = (cpi->oxcf.fixed_q < 0) ? cpi->last_q[INTER_FRAME]
- : cpi->oxcf.fixed_q;
-
- cpi->refresh_golden_frame = 1;
+ if (cpi->use_svc && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ update_layer_buffer_level(cpi, encoded_frame_size);
+ }
+}
- calc_gf_params(cpi);
+int vp9_rc_drop_frame(VP9_COMP *cpi) {
+ const VP9_CONFIG *oxcf = &cpi->oxcf;
+ RATE_CONTROL *const rc = &cpi->rc;
- // If we are using alternate ref instead of gf then do not apply the boost
- // It will instead be applied to the altref update
- // Jims modified boost
- if (!cpi->source_alt_ref_active) {
- if (cpi->oxcf.fixed_q < 0) {
- // The spend on the GF is defined in the two pass code
- // for two pass encodes
- cpi->this_frame_target = cpi->per_frame_bandwidth;
+ if (!oxcf->drop_frames_water_mark) {
+ return 0;
+ } else {
+ if (rc->buffer_level < 0) {
+ // Always drop if buffer is below 0.
+ return 1;
+ } else {
+ // If buffer is below drop_mark, for now just drop every other frame
+ // (starting with the next frame) until it increases back over drop_mark.
+ int drop_mark = (int)(oxcf->drop_frames_water_mark *
+ oxcf->optimal_buffer_level / 100);
+ if ((rc->buffer_level > drop_mark) &&
+ (rc->decimation_factor > 0)) {
+ --rc->decimation_factor;
+ } else if (rc->buffer_level <= drop_mark &&
+ rc->decimation_factor == 0) {
+ rc->decimation_factor = 1;
+ }
+ if (rc->decimation_factor > 0) {
+ if (rc->decimation_count > 0) {
+ --rc->decimation_count;
+ return 1;
+ } else {
+ rc->decimation_count = rc->decimation_factor;
+ return 0;
+ }
} else {
- cpi->this_frame_target =
- (estimate_bits_at_q(1, q, cpi->common.MBs, 1.0)
- * cpi->last_boost) / 100;
+ rc->decimation_count = 0;
+ return 0;
}
- } else {
- // If there is an active ARF at this location use the minimum
- // bits on this frame even if it is a constructed arf.
- // The active maximum quantizer insures that an appropriate
- // number of bits will be spent if needed for constructed ARFs.
- cpi->this_frame_target = 0;
}
}
}
+static double get_rate_correction_factor(const VP9_COMP *cpi) {
+ if (cpi->common.frame_type == KEY_FRAME) {
+ return cpi->rc.key_frame_rate_correction_factor;
+ } else {
+ if ((cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) &&
+ !(cpi->use_svc && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER))
+ return cpi->rc.gf_rate_correction_factor;
+ else
+ return cpi->rc.rate_correction_factor;
+ }
+}
-void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var) {
+static void set_rate_correction_factor(VP9_COMP *cpi, double factor) {
+ if (cpi->common.frame_type == KEY_FRAME) {
+ cpi->rc.key_frame_rate_correction_factor = factor;
+ } else {
+ if ((cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) &&
+ !(cpi->use_svc && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER))
+ cpi->rc.gf_rate_correction_factor = factor;
+ else
+ cpi->rc.rate_correction_factor = factor;
+ }
+}
+
+void vp9_rc_update_rate_correction_factors(VP9_COMP *cpi, int damp_var) {
const int q = cpi->common.base_qindex;
int correction_factor = 100;
- double rate_correction_factor;
+ double rate_correction_factor = get_rate_correction_factor(cpi);
double adjustment_limit;
int projected_size_based_on_q = 0;
// Clear down mmx registers to allow floating point in what follows
- vp9_clear_system_state(); // __asm emms;
-
- if (cpi->common.frame_type == KEY_FRAME) {
- rate_correction_factor = cpi->key_frame_rate_correction_factor;
- } else {
- if (cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame)
- rate_correction_factor = cpi->gf_rate_correction_factor;
- else
- rate_correction_factor = cpi->rate_correction_factor;
- }
+ vp9_clear_system_state();
// Work out how big we would have expected the frame to be at this Q given
// the current correction factor.
@@ -263,11 +366,10 @@ void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var) {
projected_size_based_on_q = estimate_bits_at_q(cpi->common.frame_type, q,
cpi->common.MBs,
rate_correction_factor);
-
// Work out a size correction factor.
if (projected_size_based_on_q > 0)
- correction_factor =
- (100 * cpi->projected_frame_size) / projected_size_based_on_q;
+ correction_factor = (100 * cpi->rc.projected_frame_size) /
+ projected_size_based_on_q;
// More heavily damped adjustment used if we have been oscillating either side
// of target.
@@ -284,7 +386,6 @@ void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var) {
break;
}
- // if ( (correction_factor > 102) && (Q < cpi->active_worst_quality) )
if (correction_factor > 102) {
// We are not already at the worst allowable quality
correction_factor =
@@ -307,51 +408,31 @@ void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var) {
rate_correction_factor = MIN_BPB_FACTOR;
}
- if (cpi->common.frame_type == KEY_FRAME) {
- cpi->key_frame_rate_correction_factor = rate_correction_factor;
- } else {
- if (cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame)
- cpi->gf_rate_correction_factor = rate_correction_factor;
- else
- cpi->rate_correction_factor = rate_correction_factor;
- }
+ set_rate_correction_factor(cpi, rate_correction_factor);
}
-int vp9_regulate_q(VP9_COMP *cpi, int target_bits_per_frame) {
- int q = cpi->active_worst_quality;
-
- int i;
+int vp9_rc_regulate_q(const VP9_COMP *cpi, int target_bits_per_frame,
+ int active_best_quality, int active_worst_quality) {
+ const VP9_COMMON *const cm = &cpi->common;
+ int q = active_worst_quality;
int last_error = INT_MAX;
- int target_bits_per_mb;
- int bits_per_mb_at_this_q;
- double correction_factor;
-
- // Select the appropriate correction factor based upon type of frame.
- if (cpi->common.frame_type == KEY_FRAME) {
- correction_factor = cpi->key_frame_rate_correction_factor;
- } else {
- if (cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame)
- correction_factor = cpi->gf_rate_correction_factor;
- else
- correction_factor = cpi->rate_correction_factor;
- }
+ int i, target_bits_per_mb;
+ const double correction_factor = get_rate_correction_factor(cpi);
// Calculate required scaling factor based on target frame size and size of
// frame produced using previous Q.
if (target_bits_per_frame >= (INT_MAX >> BPER_MB_NORMBITS))
- target_bits_per_mb =
- (target_bits_per_frame / cpi->common.MBs)
- << BPER_MB_NORMBITS; // Case where we would overflow int
+ // Case where we would overflow int
+ target_bits_per_mb = (target_bits_per_frame / cm->MBs) << BPER_MB_NORMBITS;
else
- target_bits_per_mb =
- (target_bits_per_frame << BPER_MB_NORMBITS) / cpi->common.MBs;
+ target_bits_per_mb = (target_bits_per_frame << BPER_MB_NORMBITS) / cm->MBs;
- i = cpi->active_best_quality;
+ i = active_best_quality;
do {
- bits_per_mb_at_this_q = (int)vp9_bits_per_mb(cpi->common.frame_type, i,
- correction_factor);
+ const int bits_per_mb_at_this_q = (int)vp9_rc_bits_per_mb(cm->frame_type, i,
+ correction_factor);
if (bits_per_mb_at_this_q <= target_bits_per_mb) {
if ((target_bits_per_mb - bits_per_mb_at_this_q) <= last_error)
@@ -363,91 +444,630 @@ int vp9_regulate_q(VP9_COMP *cpi, int target_bits_per_frame) {
} else {
last_error = bits_per_mb_at_this_q - target_bits_per_mb;
}
- } while (++i <= cpi->active_worst_quality);
+ } while (++i <= active_worst_quality);
return q;
}
+static int get_active_quality(int q, int gfu_boost, int low, int high,
+ int *low_motion_minq, int *high_motion_minq) {
+ if (gfu_boost > high) {
+ return low_motion_minq[q];
+ } else if (gfu_boost < low) {
+ return high_motion_minq[q];
+ } else {
+ const int gap = high - low;
+ const int offset = high - gfu_boost;
+ const int qdiff = high_motion_minq[q] - low_motion_minq[q];
+ const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap;
+ return low_motion_minq[q] + adjustment;
+ }
+}
-static int estimate_keyframe_frequency(VP9_COMP *cpi) {
- int i;
+static int calc_active_worst_quality_one_pass_vbr(const VP9_COMP *cpi) {
+ const RATE_CONTROL *const rc = &cpi->rc;
+ const unsigned int curr_frame = cpi->common.current_video_frame;
+ int active_worst_quality;
- // Average key frame frequency
- int av_key_frame_frequency = 0;
+ if (cpi->common.frame_type == KEY_FRAME) {
+ active_worst_quality = curr_frame == 0 ? rc->worst_quality
+ : rc->last_q[KEY_FRAME] * 2;
+ } else {
+ if (!rc->is_src_frame_alt_ref &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
+ active_worst_quality = curr_frame == 1 ? rc->last_q[KEY_FRAME] * 5 / 4
+ : rc->last_q[INTER_FRAME];
+ } else {
+ active_worst_quality = curr_frame == 1 ? rc->last_q[KEY_FRAME] * 2
+ : rc->last_q[INTER_FRAME] * 2;
+ }
+ }
+
+ return MIN(active_worst_quality, rc->worst_quality);
+}
- /* First key frame at start of sequence is a special case. We have no
- * frequency data.
- */
- if (cpi->key_frame_count == 1) {
- /* Assume a default of 1 kf every 2 seconds, or the max kf interval,
- * whichever is smaller.
- */
- int key_freq = cpi->oxcf.key_freq > 0 ? cpi->oxcf.key_freq : 1;
- av_key_frame_frequency = (int)cpi->output_framerate * 2;
+// Adjust active_worst_quality level based on buffer level.
+static int calc_active_worst_quality_one_pass_cbr(const VP9_COMP *cpi) {
+ // Adjust active_worst_quality: If buffer is above the optimal/target level,
+ // bring active_worst_quality down depending on fullness of buffer.
+ // If buffer is below the optimal level, let the active_worst_quality go from
+ // ambient Q (at buffer = optimal level) to worst_quality level
+ // (at buffer = critical level).
+ const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const RATE_CONTROL *rc = &cpi->rc;
+ // Buffer level below which we push active_worst to worst_quality.
+ int64_t critical_level = oxcf->optimal_buffer_level >> 2;
+ int64_t buff_lvl_step = 0;
+ int adjustment = 0;
+ int active_worst_quality;
+ if (cpi->common.frame_type == KEY_FRAME)
+ return rc->worst_quality;
+ if (cpi->common.current_video_frame > 1)
+ active_worst_quality = MIN(rc->worst_quality,
+ rc->avg_frame_qindex[INTER_FRAME] * 5 / 4);
+ else
+ active_worst_quality = MIN(rc->worst_quality,
+ rc->avg_frame_qindex[KEY_FRAME] * 3 / 2);
+ if (rc->buffer_level > oxcf->optimal_buffer_level) {
+ // Adjust down.
+ // Maximum limit for down adjustment, ~30%.
+ int max_adjustment_down = active_worst_quality / 3;
+ if (max_adjustment_down) {
+ buff_lvl_step = ((oxcf->maximum_buffer_size -
+ oxcf->optimal_buffer_level) / max_adjustment_down);
+ if (buff_lvl_step)
+ adjustment = (int)((rc->buffer_level - oxcf->optimal_buffer_level) /
+ buff_lvl_step);
+ active_worst_quality -= adjustment;
+ }
+ } else if (rc->buffer_level > critical_level) {
+ // Adjust up from ambient Q.
+ if (critical_level) {
+ buff_lvl_step = (oxcf->optimal_buffer_level - critical_level);
+ if (buff_lvl_step) {
+ adjustment =
+ (int)((rc->worst_quality - rc->avg_frame_qindex[INTER_FRAME]) *
+ (oxcf->optimal_buffer_level - rc->buffer_level) /
+ buff_lvl_step);
+ }
+ active_worst_quality = rc->avg_frame_qindex[INTER_FRAME] + adjustment;
+ }
+ } else {
+ // Set to worst_quality if buffer is below critical level.
+ active_worst_quality = rc->worst_quality;
+ }
+ return active_worst_quality;
+}
- if (cpi->oxcf.auto_key && av_key_frame_frequency > key_freq)
- av_key_frame_frequency = cpi->oxcf.key_freq;
+static int rc_pick_q_and_bounds_one_pass_cbr(const VP9_COMP *cpi,
+ int *bottom_index,
+ int *top_index) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const RATE_CONTROL *const rc = &cpi->rc;
+ int active_best_quality;
+ int active_worst_quality = calc_active_worst_quality_one_pass_cbr(cpi);
+ int q;
+
+ if (frame_is_intra_only(cm)) {
+ active_best_quality = rc->best_quality;
+ // Handle the special case for key frames forced when we have75 reached
+ // the maximum key frame interval. Here force the Q to a range
+ // based on the ambient Q to reduce the risk of popping.
+ if (rc->this_key_frame_forced) {
+ int qindex = rc->last_boosted_qindex;
+ double last_boosted_q = vp9_convert_qindex_to_q(qindex);
+ int delta_qindex = vp9_compute_qdelta(cpi, last_boosted_q,
+ (last_boosted_q * 0.75));
+ active_best_quality = MAX(qindex + delta_qindex, rc->best_quality);
+ } else if (cm->current_video_frame > 0) {
+ // not first frame of one pass and kf_boost is set
+ double q_adj_factor = 1.0;
+ double q_val;
+
+ active_best_quality = get_active_quality(rc->avg_frame_qindex[KEY_FRAME],
+ rc->kf_boost,
+ kf_low, kf_high,
+ kf_low_motion_minq,
+ kf_high_motion_minq);
+
+ // Allow somewhat lower kf minq with small image formats.
+ if ((cm->width * cm->height) <= (352 * 288)) {
+ q_adj_factor -= 0.25;
+ }
- cpi->prior_key_frame_distance[KEY_FRAME_CONTEXT - 1]
- = av_key_frame_frequency;
+ // Convert the adjustment factor to a qindex delta
+ // on active_best_quality.
+ q_val = vp9_convert_qindex_to_q(active_best_quality);
+ active_best_quality += vp9_compute_qdelta(cpi, q_val, q_val *
+ q_adj_factor);
+ }
+ } else if (!rc->is_src_frame_alt_ref &&
+ !cpi->use_svc &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
+ // Use the lower of active_worst_quality and recent
+ // average Q as basis for GF/ARF best Q limit unless last frame was
+ // a key frame.
+ if (rc->frames_since_key > 1 &&
+ rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) {
+ q = rc->avg_frame_qindex[INTER_FRAME];
+ } else {
+ q = active_worst_quality;
+ }
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ gf_low_motion_minq, gf_high_motion_minq);
} else {
- unsigned int total_weight = 0;
- int last_kf_interval =
- (cpi->frames_since_key > 0) ? cpi->frames_since_key : 1;
-
- /* reset keyframe context and calculate weighted average of last
- * KEY_FRAME_CONTEXT keyframes
- */
- for (i = 0; i < KEY_FRAME_CONTEXT; i++) {
- if (i < KEY_FRAME_CONTEXT - 1)
- cpi->prior_key_frame_distance[i]
- = cpi->prior_key_frame_distance[i + 1];
+ // Use the lower of active_worst_quality and recent/average Q.
+ if (cm->current_video_frame > 1) {
+ if (rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality)
+ active_best_quality = inter_minq[rc->avg_frame_qindex[INTER_FRAME]];
else
- cpi->prior_key_frame_distance[i] = last_kf_interval;
+ active_best_quality = inter_minq[active_worst_quality];
+ } else {
+ if (rc->avg_frame_qindex[KEY_FRAME] < active_worst_quality)
+ active_best_quality = inter_minq[rc->avg_frame_qindex[KEY_FRAME]];
+ else
+ active_best_quality = inter_minq[active_worst_quality];
+ }
+ }
+
+ // Clip the active best and worst quality values to limits
+ active_best_quality = clamp(active_best_quality,
+ rc->best_quality, rc->worst_quality);
+ active_worst_quality = clamp(active_worst_quality,
+ active_best_quality, rc->worst_quality);
- av_key_frame_frequency += prior_key_frame_weight[i]
- * cpi->prior_key_frame_distance[i];
- total_weight += prior_key_frame_weight[i];
+ *top_index = active_worst_quality;
+ *bottom_index = active_best_quality;
+
+#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY
+ // Limit Q range for the adaptive loop.
+ if (cm->frame_type == KEY_FRAME && !rc->this_key_frame_forced) {
+ if (!(cm->current_video_frame == 0))
+ *top_index = (active_worst_quality + active_best_quality * 3) / 4;
+ }
+#endif
+ // Special case code to try and match quality with forced key frames
+ if (cm->frame_type == KEY_FRAME && rc->this_key_frame_forced) {
+ q = rc->last_boosted_qindex;
+ } else {
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ active_best_quality, active_worst_quality);
+ if (q > *top_index) {
+ // Special case when we are targeting the max allowed rate
+ if (cpi->rc.this_frame_target >= cpi->rc.max_frame_bandwidth)
+ *top_index = q;
+ else
+ q = *top_index;
}
+ }
+ assert(*top_index <= rc->worst_quality &&
+ *top_index >= rc->best_quality);
+ assert(*bottom_index <= rc->worst_quality &&
+ *bottom_index >= rc->best_quality);
+ assert(q <= rc->worst_quality && q >= rc->best_quality);
+ return q;
+}
- av_key_frame_frequency /= total_weight;
+static int rc_pick_q_and_bounds_one_pass_vbr(const VP9_COMP *cpi,
+ int *bottom_index,
+ int *top_index) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const RATE_CONTROL *const rc = &cpi->rc;
+ const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ int active_best_quality;
+ int active_worst_quality = calc_active_worst_quality_one_pass_vbr(cpi);
+ int q;
+
+ if (frame_is_intra_only(cm)) {
+ active_best_quality = rc->best_quality;
+#if !CONFIG_MULTIPLE_ARF
+ // Handle the special case for key frames forced when we have75 reached
+ // the maximum key frame interval. Here force the Q to a range
+ // based on the ambient Q to reduce the risk of popping.
+ if (rc->this_key_frame_forced) {
+ int qindex = rc->last_boosted_qindex;
+ double last_boosted_q = vp9_convert_qindex_to_q(qindex);
+ int delta_qindex = vp9_compute_qdelta(cpi, last_boosted_q,
+ (last_boosted_q * 0.75));
+ active_best_quality = MAX(qindex + delta_qindex, rc->best_quality);
+ } else if (cm->current_video_frame > 0) {
+ // not first frame of one pass and kf_boost is set
+ double q_adj_factor = 1.0;
+ double q_val;
+
+ active_best_quality = get_active_quality(rc->avg_frame_qindex[KEY_FRAME],
+ rc->kf_boost,
+ kf_low, kf_high,
+ kf_low_motion_minq,
+ kf_high_motion_minq);
+
+ // Allow somewhat lower kf minq with small image formats.
+ if ((cm->width * cm->height) <= (352 * 288)) {
+ q_adj_factor -= 0.25;
+ }
+
+ // Convert the adjustment factor to a qindex delta
+ // on active_best_quality.
+ q_val = vp9_convert_qindex_to_q(active_best_quality);
+ active_best_quality += vp9_compute_qdelta(cpi, q_val, q_val *
+ q_adj_factor);
+ }
+#else
+ double current_q;
+ // Force the KF quantizer to be 30% of the active_worst_quality.
+ current_q = vp9_convert_qindex_to_q(active_worst_quality);
+ active_best_quality = active_worst_quality
+ + vp9_compute_qdelta(cpi, current_q, current_q * 0.3);
+#endif
+ } else if (!rc->is_src_frame_alt_ref &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
+ // Use the lower of active_worst_quality and recent
+ // average Q as basis for GF/ARF best Q limit unless last frame was
+ // a key frame.
+ if (rc->frames_since_key > 1 &&
+ rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) {
+ q = rc->avg_frame_qindex[INTER_FRAME];
+ } else {
+ q = rc->avg_frame_qindex[KEY_FRAME];
+ }
+ // For constrained quality dont allow Q less than the cq level
+ if (oxcf->end_usage == USAGE_CONSTRAINED_QUALITY) {
+ if (q < cpi->cq_target_quality)
+ q = cpi->cq_target_quality;
+ if (rc->frames_since_key > 1) {
+ active_best_quality = get_active_quality(q, rc->gfu_boost,
+ gf_low, gf_high,
+ afq_low_motion_minq,
+ afq_high_motion_minq);
+ } else {
+ active_best_quality = get_active_quality(q, rc->gfu_boost,
+ gf_low, gf_high,
+ gf_low_motion_minq,
+ gf_high_motion_minq);
+ }
+ // Constrained quality use slightly lower active best.
+ active_best_quality = active_best_quality * 15 / 16;
+
+ } else if (oxcf->end_usage == USAGE_CONSTANT_QUALITY) {
+ if (!cpi->refresh_alt_ref_frame) {
+ active_best_quality = cpi->cq_target_quality;
+ } else {
+ if (rc->frames_since_key > 1) {
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ afq_low_motion_minq, afq_high_motion_minq);
+ } else {
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ gf_low_motion_minq, gf_high_motion_minq);
+ }
+ }
+ } else {
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ gf_low_motion_minq, gf_high_motion_minq);
+ }
+ } else {
+ if (oxcf->end_usage == USAGE_CONSTANT_QUALITY) {
+ active_best_quality = cpi->cq_target_quality;
+ } else {
+ // Use the lower of active_worst_quality and recent/average Q.
+ if (cm->current_video_frame > 1)
+ active_best_quality = inter_minq[rc->avg_frame_qindex[INTER_FRAME]];
+ else
+ active_best_quality = inter_minq[rc->avg_frame_qindex[KEY_FRAME]];
+ // For the constrained quality mode we don't want
+ // q to fall below the cq level.
+ if ((oxcf->end_usage == USAGE_CONSTRAINED_QUALITY) &&
+ (active_best_quality < cpi->cq_target_quality)) {
+ // If we are strongly undershooting the target rate in the last
+ // frames then use the user passed in cq value not the auto
+ // cq value.
+ if (rc->rolling_actual_bits < rc->min_frame_bandwidth)
+ active_best_quality = oxcf->cq_level;
+ else
+ active_best_quality = cpi->cq_target_quality;
+ }
+ }
+ }
+
+ // Clip the active best and worst quality values to limits
+ active_best_quality = clamp(active_best_quality,
+ rc->best_quality, rc->worst_quality);
+ active_worst_quality = clamp(active_worst_quality,
+ active_best_quality, rc->worst_quality);
+
+ *top_index = active_worst_quality;
+ *bottom_index = active_best_quality;
+
+#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY
+ // Limit Q range for the adaptive loop.
+ if (cm->frame_type == KEY_FRAME && !rc->this_key_frame_forced) {
+ if (!(cm->current_video_frame == 0))
+ *top_index = (active_worst_quality + active_best_quality * 3) / 4;
+ } else if (!rc->is_src_frame_alt_ref &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
+ *top_index = (active_worst_quality + active_best_quality) / 2;
+ }
+#endif
+ if (oxcf->end_usage == USAGE_CONSTANT_QUALITY) {
+ q = active_best_quality;
+ // Special case code to try and match quality with forced key frames
+ } else if ((cm->frame_type == KEY_FRAME) && rc->this_key_frame_forced) {
+ q = rc->last_boosted_qindex;
+ } else {
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ active_best_quality, active_worst_quality);
+ if (q > *top_index) {
+ // Special case when we are targeting the max allowed rate
+ if (cpi->rc.this_frame_target >= cpi->rc.max_frame_bandwidth)
+ *top_index = q;
+ else
+ q = *top_index;
+ }
+ }
+#if CONFIG_MULTIPLE_ARF
+ // Force the quantizer determined by the coding order pattern.
+ if (cpi->multi_arf_enabled && (cm->frame_type != KEY_FRAME) &&
+ cpi->oxcf.end_usage != USAGE_CONSTANT_QUALITY) {
+ double new_q;
+ double current_q = vp9_convert_qindex_to_q(active_worst_quality);
+ int level = cpi->this_frame_weight;
+ assert(level >= 0);
+ new_q = current_q * (1.0 - (0.2 * (cpi->max_arf_level - level)));
+ q = active_worst_quality +
+ vp9_compute_qdelta(cpi, current_q, new_q);
+
+ *bottom_index = q;
+ *top_index = q;
+ printf("frame:%d q:%d\n", cm->current_video_frame, q);
}
- return av_key_frame_frequency;
+#endif
+ assert(*top_index <= rc->worst_quality &&
+ *top_index >= rc->best_quality);
+ assert(*bottom_index <= rc->worst_quality &&
+ *bottom_index >= rc->best_quality);
+ assert(q <= rc->worst_quality && q >= rc->best_quality);
+ return q;
}
+static int rc_pick_q_and_bounds_two_pass(const VP9_COMP *cpi,
+ int *bottom_index,
+ int *top_index) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const RATE_CONTROL *const rc = &cpi->rc;
+ const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ int active_best_quality;
+ int active_worst_quality = cpi->twopass.active_worst_quality;
+ int q;
+
+ if (frame_is_intra_only(cm)) {
+#if !CONFIG_MULTIPLE_ARF
+ // Handle the special case for key frames forced when we have75 reached
+ // the maximum key frame interval. Here force the Q to a range
+ // based on the ambient Q to reduce the risk of popping.
+ if (rc->this_key_frame_forced) {
+ int qindex = rc->last_boosted_qindex;
+ double last_boosted_q = vp9_convert_qindex_to_q(qindex);
+ int delta_qindex = vp9_compute_qdelta(cpi, last_boosted_q,
+ (last_boosted_q * 0.75));
+ active_best_quality = MAX(qindex + delta_qindex, rc->best_quality);
+ } else {
+ // Not forced keyframe.
+ double q_adj_factor = 1.0;
+ double q_val;
+ // Baseline value derived from cpi->active_worst_quality and kf boost.
+ active_best_quality = get_active_quality(active_worst_quality,
+ rc->kf_boost,
+ kf_low, kf_high,
+ kf_low_motion_minq,
+ kf_high_motion_minq);
+
+ // Allow somewhat lower kf minq with small image formats.
+ if ((cm->width * cm->height) <= (352 * 288)) {
+ q_adj_factor -= 0.25;
+ }
-void vp9_adjust_key_frame_context(VP9_COMP *cpi) {
- // Clear down mmx registers to allow floating point in what follows
- vp9_clear_system_state();
+ // Make a further adjustment based on the kf zero motion measure.
+ q_adj_factor += 0.05 - (0.001 * (double)cpi->twopass.kf_zeromotion_pct);
- cpi->frames_since_key = 0;
- cpi->key_frame_count++;
+ // Convert the adjustment factor to a qindex delta
+ // on active_best_quality.
+ q_val = vp9_convert_qindex_to_q(active_best_quality);
+ active_best_quality += vp9_compute_qdelta(cpi, q_val, q_val *
+ q_adj_factor);
+ }
+#else
+ double current_q;
+ // Force the KF quantizer to be 30% of the active_worst_quality.
+ current_q = vp9_convert_qindex_to_q(active_worst_quality);
+ active_best_quality = active_worst_quality
+ + vp9_compute_qdelta(cpi, current_q, current_q * 0.3);
+#endif
+ } else if (!rc->is_src_frame_alt_ref &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
+ // Use the lower of active_worst_quality and recent
+ // average Q as basis for GF/ARF best Q limit unless last frame was
+ // a key frame.
+ if (rc->frames_since_key > 1 &&
+ rc->avg_frame_qindex[INTER_FRAME] < active_worst_quality) {
+ q = rc->avg_frame_qindex[INTER_FRAME];
+ } else {
+ q = active_worst_quality;
+ }
+ // For constrained quality dont allow Q less than the cq level
+ if (oxcf->end_usage == USAGE_CONSTRAINED_QUALITY) {
+ if (q < cpi->cq_target_quality)
+ q = cpi->cq_target_quality;
+ if (rc->frames_since_key > 1) {
+ active_best_quality = get_active_quality(q, rc->gfu_boost,
+ gf_low, gf_high,
+ afq_low_motion_minq,
+ afq_high_motion_minq);
+ } else {
+ active_best_quality = get_active_quality(q, rc->gfu_boost,
+ gf_low, gf_high,
+ gf_low_motion_minq,
+ gf_high_motion_minq);
+ }
+ // Constrained quality use slightly lower active best.
+ active_best_quality = active_best_quality * 15 / 16;
+
+ } else if (oxcf->end_usage == USAGE_CONSTANT_QUALITY) {
+ if (!cpi->refresh_alt_ref_frame) {
+ active_best_quality = cpi->cq_target_quality;
+ } else {
+ if (rc->frames_since_key > 1) {
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ afq_low_motion_minq, afq_high_motion_minq);
+ } else {
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ gf_low_motion_minq, gf_high_motion_minq);
+ }
+ }
+ } else {
+ active_best_quality = get_active_quality(
+ q, rc->gfu_boost, gf_low, gf_high,
+ gf_low_motion_minq, gf_high_motion_minq);
+ }
+ } else {
+ if (oxcf->end_usage == USAGE_CONSTANT_QUALITY) {
+ active_best_quality = cpi->cq_target_quality;
+ } else {
+ active_best_quality = inter_minq[active_worst_quality];
+
+ // For the constrained quality mode we don't want
+ // q to fall below the cq level.
+ if ((oxcf->end_usage == USAGE_CONSTRAINED_QUALITY) &&
+ (active_best_quality < cpi->cq_target_quality)) {
+ // If we are strongly undershooting the target rate in the last
+ // frames then use the user passed in cq value not the auto
+ // cq value.
+ if (rc->rolling_actual_bits < rc->min_frame_bandwidth)
+ active_best_quality = oxcf->cq_level;
+ else
+ active_best_quality = cpi->cq_target_quality;
+ }
+ }
+ }
+
+ // Clip the active best and worst quality values to limits.
+ active_best_quality = clamp(active_best_quality,
+ rc->best_quality, rc->worst_quality);
+ active_worst_quality = clamp(active_worst_quality,
+ active_best_quality, rc->worst_quality);
+
+ *top_index = active_worst_quality;
+ *bottom_index = active_best_quality;
+
+#if LIMIT_QRANGE_FOR_ALTREF_AND_KEY
+ // Limit Q range for the adaptive loop.
+ if (cm->frame_type == KEY_FRAME && !rc->this_key_frame_forced) {
+ *top_index = (active_worst_quality + active_best_quality * 3) / 4;
+ } else if (!rc->is_src_frame_alt_ref &&
+ (oxcf->end_usage != USAGE_STREAM_FROM_SERVER) &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) {
+ *top_index = (active_worst_quality + active_best_quality) / 2;
+ }
+#endif
+
+ if (oxcf->end_usage == USAGE_CONSTANT_QUALITY) {
+ q = active_best_quality;
+ // Special case code to try and match quality with forced key frames.
+ } else if ((cm->frame_type == KEY_FRAME) && rc->this_key_frame_forced) {
+ q = rc->last_boosted_qindex;
+ } else {
+ q = vp9_rc_regulate_q(cpi, rc->this_frame_target,
+ active_best_quality, active_worst_quality);
+ if (q > *top_index) {
+ // Special case when we are targeting the max allowed rate.
+ if (cpi->rc.this_frame_target >= cpi->rc.max_frame_bandwidth)
+ *top_index = q;
+ else
+ q = *top_index;
+ }
+ }
+#if CONFIG_MULTIPLE_ARF
+ // Force the quantizer determined by the coding order pattern.
+ if (cpi->multi_arf_enabled && (cm->frame_type != KEY_FRAME) &&
+ cpi->oxcf.end_usage != USAGE_CONSTANT_QUALITY) {
+ double new_q;
+ double current_q = vp9_convert_qindex_to_q(active_worst_quality);
+ int level = cpi->this_frame_weight;
+ assert(level >= 0);
+ new_q = current_q * (1.0 - (0.2 * (cpi->max_arf_level - level)));
+ q = active_worst_quality +
+ vp9_compute_qdelta(cpi, current_q, new_q);
+
+ *bottom_index = q;
+ *top_index = q;
+ printf("frame:%d q:%d\n", cm->current_video_frame, q);
+ }
+#endif
+ assert(*top_index <= rc->worst_quality &&
+ *top_index >= rc->best_quality);
+ assert(*bottom_index <= rc->worst_quality &&
+ *bottom_index >= rc->best_quality);
+ assert(q <= rc->worst_quality && q >= rc->best_quality);
+ return q;
}
+int vp9_rc_pick_q_and_bounds(const VP9_COMP *cpi,
+ int *bottom_index,
+ int *top_index) {
+ int q;
+ if (cpi->pass == 0) {
+ if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
+ q = rc_pick_q_and_bounds_one_pass_cbr(cpi, bottom_index, top_index);
+ else
+ q = rc_pick_q_and_bounds_one_pass_vbr(cpi, bottom_index, top_index);
+ } else {
+ q = rc_pick_q_and_bounds_two_pass(cpi, bottom_index, top_index);
+ }
-void vp9_compute_frame_size_bounds(VP9_COMP *cpi, int *frame_under_shoot_limit,
- int *frame_over_shoot_limit) {
+ // JBB : This is realtime mode. In real time mode the first frame
+ // should be larger. Q of 0 is disabled because we force tx size to be
+ // 16x16...
+ if (cpi->sf.use_nonrd_pick_mode) {
+ if (cpi->common.current_video_frame == 0)
+ q /= 3;
+ if (q == 0)
+ q++;
+ if (q < *bottom_index)
+ *bottom_index = q;
+ else if (q > *top_index)
+ *top_index = q;
+ }
+ return q;
+}
+
+void vp9_rc_compute_frame_size_bounds(const VP9_COMP *cpi,
+ int this_frame_target,
+ int *frame_under_shoot_limit,
+ int *frame_over_shoot_limit) {
// Set-up bounds on acceptable frame size:
- if (cpi->oxcf.fixed_q >= 0) {
- // Fixed Q scenario: frame size never outranges target (there is no target!)
+ if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) {
*frame_under_shoot_limit = 0;
*frame_over_shoot_limit = INT_MAX;
} else {
if (cpi->common.frame_type == KEY_FRAME) {
- *frame_over_shoot_limit = cpi->this_frame_target * 9 / 8;
- *frame_under_shoot_limit = cpi->this_frame_target * 7 / 8;
+ *frame_over_shoot_limit = this_frame_target * 9 / 8;
+ *frame_under_shoot_limit = this_frame_target * 7 / 8;
} else {
if (cpi->refresh_alt_ref_frame || cpi->refresh_golden_frame) {
- *frame_over_shoot_limit = cpi->this_frame_target * 9 / 8;
- *frame_under_shoot_limit = cpi->this_frame_target * 7 / 8;
+ *frame_over_shoot_limit = this_frame_target * 9 / 8;
+ *frame_under_shoot_limit = this_frame_target * 7 / 8;
} else {
// Stron overshoot limit for constrained quality
if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) {
- *frame_over_shoot_limit = cpi->this_frame_target * 11 / 8;
- *frame_under_shoot_limit = cpi->this_frame_target * 2 / 8;
+ *frame_over_shoot_limit = this_frame_target * 11 / 8;
+ *frame_under_shoot_limit = this_frame_target * 2 / 8;
} else {
- *frame_over_shoot_limit = cpi->this_frame_target * 11 / 8;
- *frame_under_shoot_limit = cpi->this_frame_target * 5 / 8;
+ *frame_over_shoot_limit = this_frame_target * 11 / 8;
+ *frame_under_shoot_limit = this_frame_target * 5 / 8;
}
}
}
@@ -459,18 +1079,316 @@ void vp9_compute_frame_size_bounds(VP9_COMP *cpi, int *frame_under_shoot_limit,
*frame_under_shoot_limit -= 200;
if (*frame_under_shoot_limit < 0)
*frame_under_shoot_limit = 0;
+
+ // Clip to maximum allowed rate for a frame.
+ if (*frame_over_shoot_limit > cpi->rc.max_frame_bandwidth) {
+ *frame_over_shoot_limit = cpi->rc.max_frame_bandwidth;
+ }
}
}
+void vp9_rc_set_frame_target(VP9_COMP *cpi, int target) {
+ const VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
-// return of 0 means drop frame
-int vp9_pick_frame_size(VP9_COMP *cpi) {
- VP9_COMMON *cm = &cpi->common;
+ rc->this_frame_target = target;
+ // Target rate per SB64 (including partial SB64s.
+ rc->sb64_target_rate = ((int64_t)rc->this_frame_target * 64 * 64) /
+ (cm->width * cm->height);
+}
+
+static void update_alt_ref_frame_stats(VP9_COMP *cpi) {
+ // this frame refreshes means next frames don't unless specified by user
+ cpi->rc.frames_since_golden = 0;
+
+#if CONFIG_MULTIPLE_ARF
+ if (!cpi->multi_arf_enabled)
+#endif
+ // Clear the alternate reference update pending flag.
+ cpi->rc.source_alt_ref_pending = 0;
+
+ // Set the alternate reference frame active flag
+ cpi->rc.source_alt_ref_active = 1;
+}
+
+static void update_golden_frame_stats(VP9_COMP *cpi) {
+ RATE_CONTROL *const rc = &cpi->rc;
+
+ // Update the Golden frame usage counts.
+ if (cpi->refresh_golden_frame) {
+ // this frame refreshes means next frames don't unless specified by user
+ rc->frames_since_golden = 0;
+
+ if (!rc->source_alt_ref_pending)
+ rc->source_alt_ref_active = 0;
+
+ // Decrement count down till next gf
+ if (rc->frames_till_gf_update_due > 0)
+ rc->frames_till_gf_update_due--;
+
+ } else if (!cpi->refresh_alt_ref_frame) {
+ // Decrement count down till next gf
+ if (rc->frames_till_gf_update_due > 0)
+ rc->frames_till_gf_update_due--;
+
+ rc->frames_since_golden++;
+ }
+}
+
+void vp9_rc_postencode_update(VP9_COMP *cpi, uint64_t bytes_used) {
+ VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
+
+ cm->last_frame_type = cm->frame_type;
+ // Update rate control heuristics
+ rc->projected_frame_size = (int)(bytes_used << 3);
+
+ // Post encode loop adjustment of Q prediction.
+ vp9_rc_update_rate_correction_factors(
+ cpi, (cpi->sf.recode_loop >= ALLOW_RECODE_KFARFGF ||
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) ? 2 : 0);
+
+ // Keep a record of last Q and ambient average Q.
+ if (cm->frame_type == KEY_FRAME) {
+ rc->last_q[KEY_FRAME] = cm->base_qindex;
+ rc->avg_frame_qindex[KEY_FRAME] = ROUND_POWER_OF_TWO(
+ 3 * rc->avg_frame_qindex[KEY_FRAME] + cm->base_qindex, 2);
+ } else if (!rc->is_src_frame_alt_ref &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame) &&
+ !(cpi->use_svc && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)) {
+ rc->last_q[2] = cm->base_qindex;
+ rc->avg_frame_qindex[2] = ROUND_POWER_OF_TWO(
+ 3 * rc->avg_frame_qindex[2] + cm->base_qindex, 2);
+ } else {
+ rc->last_q[INTER_FRAME] = cm->base_qindex;
+ rc->avg_frame_qindex[INTER_FRAME] = ROUND_POWER_OF_TWO(
+ 3 * rc->avg_frame_qindex[INTER_FRAME] + cm->base_qindex, 2);
+ rc->ni_frames++;
+ rc->tot_q += vp9_convert_qindex_to_q(cm->base_qindex);
+ rc->avg_q = rc->tot_q / (double)rc->ni_frames;
+
+ // Calculate the average Q for normal inter frames (not key or GFU frames).
+ rc->ni_tot_qi += cm->base_qindex;
+ rc->ni_av_qi = rc->ni_tot_qi / rc->ni_frames;
+ }
+
+ // Keep record of last boosted (KF/KF/ARF) Q value.
+ // If the current frame is coded at a lower Q then we also update it.
+ // If all mbs in this group are skipped only update if the Q value is
+ // better than that already stored.
+ // This is used to help set quality in forced key frames to reduce popping
+ if ((cm->base_qindex < rc->last_boosted_qindex) ||
+ ((cpi->static_mb_pct < 100) &&
+ ((cm->frame_type == KEY_FRAME) || cpi->refresh_alt_ref_frame ||
+ (cpi->refresh_golden_frame && !rc->is_src_frame_alt_ref)))) {
+ rc->last_boosted_qindex = cm->base_qindex;
+ }
+
+ update_buffer_level(cpi, rc->projected_frame_size);
+
+ // Rolling monitors of whether we are over or underspending used to help
+ // regulate min and Max Q in two pass.
+ if (cm->frame_type != KEY_FRAME) {
+ rc->rolling_target_bits = ROUND_POWER_OF_TWO(
+ rc->rolling_target_bits * 3 + rc->this_frame_target, 2);
+ rc->rolling_actual_bits = ROUND_POWER_OF_TWO(
+ rc->rolling_actual_bits * 3 + rc->projected_frame_size, 2);
+ rc->long_rolling_target_bits = ROUND_POWER_OF_TWO(
+ rc->long_rolling_target_bits * 31 + rc->this_frame_target, 5);
+ rc->long_rolling_actual_bits = ROUND_POWER_OF_TWO(
+ rc->long_rolling_actual_bits * 31 + rc->projected_frame_size, 5);
+ }
+
+ // Actual bits spent
+ rc->total_actual_bits += rc->projected_frame_size;
+
+ // Debug stats
+ rc->total_target_vs_actual += (rc->this_frame_target -
+ rc->projected_frame_size);
+
+ if (cpi->oxcf.play_alternate && cpi->refresh_alt_ref_frame &&
+ (cm->frame_type != KEY_FRAME))
+ // Update the alternate reference frame stats as appropriate.
+ update_alt_ref_frame_stats(cpi);
+ else
+ // Update the Golden frame stats as appropriate.
+ update_golden_frame_stats(cpi);
if (cm->frame_type == KEY_FRAME)
- calc_iframe_target_size(cpi);
+ rc->frames_since_key = 0;
+ if (cm->show_frame) {
+ rc->frames_since_key++;
+ rc->frames_to_key--;
+ }
+}
+
+void vp9_rc_postencode_update_drop_frame(VP9_COMP *cpi) {
+ // Update buffer level with zero size, update frame counters, and return.
+ update_buffer_level(cpi, 0);
+ cpi->common.last_frame_type = cpi->common.frame_type;
+ cpi->rc.frames_since_key++;
+ cpi->rc.frames_to_key--;
+}
+
+static int test_for_kf_one_pass(VP9_COMP *cpi) {
+ // Placeholder function for auto key frame
+ return 0;
+}
+// Use this macro to turn on/off use of alt-refs in one-pass mode.
+#define USE_ALTREF_FOR_ONE_PASS 1
+
+static int calc_pframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) {
+ static const int af_ratio = 10;
+ const RATE_CONTROL *rc = &cpi->rc;
+ int target;
+#if USE_ALTREF_FOR_ONE_PASS
+ target = (!rc->is_src_frame_alt_ref &&
+ (cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame)) ?
+ (rc->av_per_frame_bandwidth * cpi->rc.baseline_gf_interval * af_ratio) /
+ (cpi->rc.baseline_gf_interval + af_ratio - 1) :
+ (rc->av_per_frame_bandwidth * cpi->rc.baseline_gf_interval) /
+ (cpi->rc.baseline_gf_interval + af_ratio - 1);
+#else
+ target = rc->av_per_frame_bandwidth;
+#endif
+ return vp9_rc_clamp_pframe_target_size(cpi, target);
+}
+
+static int calc_iframe_target_size_one_pass_vbr(const VP9_COMP *const cpi) {
+ static const int kf_ratio = 25;
+ const RATE_CONTROL *rc = &cpi->rc;
+ int target = rc->av_per_frame_bandwidth * kf_ratio;
+ return vp9_rc_clamp_iframe_target_size(cpi, target);
+}
+
+void vp9_rc_get_one_pass_vbr_params(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
+ int target;
+ if (!cpi->refresh_alt_ref_frame &&
+ (cm->current_video_frame == 0 ||
+ (cm->frame_flags & FRAMEFLAGS_KEY) ||
+ rc->frames_to_key == 0 ||
+ (cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) {
+ cm->frame_type = KEY_FRAME;
+ rc->this_key_frame_forced = cm->current_video_frame != 0 &&
+ rc->frames_to_key == 0;
+ rc->frames_to_key = cpi->key_frame_frequency;
+ rc->kf_boost = DEFAULT_KF_BOOST;
+ rc->source_alt_ref_active = 0;
+ } else {
+ cm->frame_type = INTER_FRAME;
+ }
+ if (rc->frames_till_gf_update_due == 0) {
+ rc->baseline_gf_interval = DEFAULT_GF_INTERVAL;
+ rc->frames_till_gf_update_due = rc->baseline_gf_interval;
+ // NOTE: frames_till_gf_update_due must be <= frames_to_key.
+ if (rc->frames_till_gf_update_due > rc->frames_to_key)
+ rc->frames_till_gf_update_due = rc->frames_to_key;
+ cpi->refresh_golden_frame = 1;
+ rc->source_alt_ref_pending = USE_ALTREF_FOR_ONE_PASS;
+ rc->gfu_boost = DEFAULT_GF_BOOST;
+ }
+ if (cm->frame_type == KEY_FRAME)
+ target = calc_iframe_target_size_one_pass_vbr(cpi);
else
- calc_pframe_target_size(cpi);
+ target = calc_pframe_target_size_one_pass_vbr(cpi);
+ vp9_rc_set_frame_target(cpi, target);
+}
+
+static int calc_pframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
+ const VP9_CONFIG *oxcf = &cpi->oxcf;
+ const RATE_CONTROL *rc = &cpi->rc;
+ const int64_t diff = oxcf->optimal_buffer_level - rc->buffer_level;
+ const int64_t one_pct_bits = 1 + oxcf->optimal_buffer_level / 100;
+ int min_frame_target = MAX(rc->av_per_frame_bandwidth >> 4,
+ FRAME_OVERHEAD_BITS);
+ int target = rc->av_per_frame_bandwidth;
+ if (cpi->svc.number_temporal_layers > 1 &&
+ cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ // Note that for layers, av_per_frame_bandwidth is the cumulative
+ // per-frame-bandwidth. For the target size of this frame, use the
+ // layer average frame size (i.e., non-cumulative per-frame-bw).
+ int current_temporal_layer = cpi->svc.temporal_layer_id;
+ const LAYER_CONTEXT *lc = &cpi->svc.layer_context[current_temporal_layer];
+ target = lc->avg_frame_size;
+ min_frame_target = MAX(lc->avg_frame_size >> 4, FRAME_OVERHEAD_BITS);
+ }
+ if (diff > 0) {
+ // Lower the target bandwidth for this frame.
+ const int pct_low = (int)MIN(diff / one_pct_bits, oxcf->under_shoot_pct);
+ target -= (target * pct_low) / 200;
+ } else if (diff < 0) {
+ // Increase the target bandwidth for this frame.
+ const int pct_high = (int)MIN(-diff / one_pct_bits, oxcf->over_shoot_pct);
+ target += (target * pct_high) / 200;
+ }
+ return MAX(min_frame_target, target);
+}
- return 1;
+static int calc_iframe_target_size_one_pass_cbr(const VP9_COMP *cpi) {
+ const RATE_CONTROL *rc = &cpi->rc;
+ int target;
+
+ if (cpi->common.current_video_frame == 0) {
+ target = ((cpi->oxcf.starting_buffer_level / 2) > INT_MAX)
+ ? INT_MAX : (int)(cpi->oxcf.starting_buffer_level / 2);
+ } else {
+ const int initial_boost = 32;
+ int kf_boost = MAX(initial_boost, (int)(2 * cpi->output_framerate - 16));
+ if (rc->frames_since_key < cpi->output_framerate / 2) {
+ kf_boost = (int)(kf_boost * rc->frames_since_key /
+ (cpi->output_framerate / 2));
+ }
+ target = ((16 + kf_boost) * rc->av_per_frame_bandwidth) >> 4;
+ }
+ return vp9_rc_clamp_iframe_target_size(cpi, target);
+}
+
+void vp9_rc_get_svc_params(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ int target = cpi->rc.av_per_frame_bandwidth;
+ if ((cm->current_video_frame == 0) ||
+ (cm->frame_flags & FRAMEFLAGS_KEY) ||
+ (cpi->oxcf.auto_key && (cpi->rc.frames_since_key %
+ cpi->key_frame_frequency == 0))) {
+ cm->frame_type = KEY_FRAME;
+ cpi->rc.source_alt_ref_active = 0;
+ if (cpi->pass == 0 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ target = calc_iframe_target_size_one_pass_cbr(cpi);
+ }
+ } else {
+ cm->frame_type = INTER_FRAME;
+ if (cpi->pass == 0 && cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER) {
+ target = calc_pframe_target_size_one_pass_cbr(cpi);
+ }
+ }
+ vp9_rc_set_frame_target(cpi, target);
+ cpi->rc.frames_till_gf_update_due = INT_MAX;
+ cpi->rc.baseline_gf_interval = INT_MAX;
+}
+
+void vp9_rc_get_one_pass_cbr_params(VP9_COMP *cpi) {
+ VP9_COMMON *const cm = &cpi->common;
+ RATE_CONTROL *const rc = &cpi->rc;
+ int target;
+ if ((cm->current_video_frame == 0 ||
+ (cm->frame_flags & FRAMEFLAGS_KEY) ||
+ rc->frames_to_key == 0 ||
+ (cpi->oxcf.auto_key && test_for_kf_one_pass(cpi)))) {
+ cm->frame_type = KEY_FRAME;
+ rc->this_key_frame_forced = cm->current_video_frame != 0 &&
+ rc->frames_to_key == 0;
+ rc->frames_to_key = cpi->key_frame_frequency;
+ rc->kf_boost = DEFAULT_KF_BOOST;
+ rc->source_alt_ref_active = 0;
+ target = calc_iframe_target_size_one_pass_cbr(cpi);
+ } else {
+ cm->frame_type = INTER_FRAME;
+ target = calc_pframe_target_size_one_pass_cbr(cpi);
+ }
+ vp9_rc_set_frame_target(cpi, target);
+ // Don't use gf_update by default in CBR mode.
+ rc->frames_till_gf_update_due = INT_MAX;
+ rc->baseline_gf_interval = INT_MAX;
}
diff --git a/libvpx/vp9/encoder/vp9_ratectrl.h b/libvpx/vp9/encoder/vp9_ratectrl.h
index ddda713..ed6266f 100644
--- a/libvpx/vp9/encoder/vp9_ratectrl.h
+++ b/libvpx/vp9/encoder/vp9_ratectrl.h
@@ -12,28 +12,162 @@
#ifndef VP9_ENCODER_VP9_RATECTRL_H_
#define VP9_ENCODER_VP9_RATECTRL_H_
-#include "vp9/encoder/vp9_onyx_int.h"
+#include "vpx/vpx_integer.h"
+
+#include "vp9/common/vp9_blockd.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
#define FRAME_OVERHEAD_BITS 200
-void vp9_save_coding_context(VP9_COMP *cpi);
-void vp9_restore_coding_context(VP9_COMP *cpi);
+typedef struct {
+ // Rate targetting variables
+ int this_frame_target;
+ int projected_frame_size;
+ int sb64_target_rate;
+ int last_q[3]; // Separate values for Intra/Inter/ARF-GF
+ int last_boosted_qindex; // Last boosted GF/KF/ARF q
+
+ int gfu_boost;
+ int last_boost;
+ int kf_boost;
+
+ double rate_correction_factor;
+ double key_frame_rate_correction_factor;
+ double gf_rate_correction_factor;
+
+ int frames_since_golden;
+ int frames_till_gf_update_due;
+ int max_gf_interval;
+ int static_scene_max_gf_interval;
+ int baseline_gf_interval;
+ int frames_to_key;
+ int frames_since_key;
+ int this_key_frame_forced;
+ int next_key_frame_forced;
+ int source_alt_ref_pending;
+ int source_alt_ref_active;
+ int is_src_frame_alt_ref;
+
+ int av_per_frame_bandwidth; // Average frame size target for clip
+ int min_frame_bandwidth; // Minimum allocation used for any frame
+ int max_frame_bandwidth; // Maximum burst rate allowed for a frame.
+
+ int ni_av_qi;
+ int ni_tot_qi;
+ int ni_frames;
+ int avg_frame_qindex[3]; // 0 - KEY, 1 - INTER, 2 - ARF/GF
+ double tot_q;
+ double avg_q;
+
+ int64_t buffer_level;
+ int64_t bits_off_target;
+
+ int decimation_factor;
+ int decimation_count;
+
+ int rolling_target_bits;
+ int rolling_actual_bits;
+
+ int long_rolling_target_bits;
+ int long_rolling_actual_bits;
+
+ int64_t total_actual_bits;
+ int total_target_vs_actual; // debug stats
+
+ int worst_quality;
+ int best_quality;
+ // int active_best_quality;
+} RATE_CONTROL;
-void vp9_setup_key_frame(VP9_COMP *cpi);
-void vp9_update_rate_correction_factors(VP9_COMP *cpi, int damp_var);
-int vp9_regulate_q(VP9_COMP *cpi, int target_bits_per_frame);
-void vp9_adjust_key_frame_context(VP9_COMP *cpi);
-void vp9_compute_frame_size_bounds(VP9_COMP *cpi,
- int *frame_under_shoot_limit,
- int *frame_over_shoot_limit);
+struct VP9_COMP;
-// return of 0 means drop frame
-int vp9_pick_frame_size(VP9_COMP *cpi);
+void vp9_save_coding_context(struct VP9_COMP *cpi);
+void vp9_restore_coding_context(struct VP9_COMP *cpi);
+
+void vp9_setup_key_frame(struct VP9_COMP *cpi);
+void vp9_setup_inter_frame(struct VP9_COMP *cpi);
double vp9_convert_qindex_to_q(int qindex);
-int vp9_gfboost_qadjust(int qindex);
-int vp9_bits_per_mb(FRAME_TYPE frame_type, int qindex,
- double correction_factor);
-void vp9_setup_inter_frame(VP9_COMP *cpi);
+
+// initialize luts for minq
+void vp9_rc_init_minq_luts(void);
+
+// Generally at the high level, the following flow is expected
+// to be enforced for rate control:
+// First call per frame, one of:
+// vp9_rc_get_one_pass_vbr_params()
+// vp9_rc_get_one_pass_cbr_params()
+// vp9_rc_get_svc_params()
+// vp9_rc_get_first_pass_params()
+// vp9_rc_get_second_pass_params()
+// depending on the usage to set the rate control encode parameters desired.
+//
+// Then, call encode_frame_to_data_rate() to perform the
+// actual encode. This function will in turn call encode_frame()
+// one or more times, followed by one of:
+// vp9_rc_postencode_update()
+// vp9_rc_postencode_update_drop_frame()
+//
+// The majority of rate control parameters are only expected
+// to be set in the vp9_rc_get_..._params() functions and
+// updated during the vp9_rc_postencode_update...() functions.
+// The only exceptions are vp9_rc_drop_frame() and
+// vp9_rc_update_rate_correction_factors() functions.
+
+// Functions to set parameters for encoding before the actual
+// encode_frame_to_data_rate() function.
+void vp9_rc_get_one_pass_vbr_params(struct VP9_COMP *cpi);
+void vp9_rc_get_one_pass_cbr_params(struct VP9_COMP *cpi);
+void vp9_rc_get_svc_params(struct VP9_COMP *cpi);
+
+// Post encode update of the rate control parameters based
+// on bytes used
+void vp9_rc_postencode_update(struct VP9_COMP *cpi,
+ uint64_t bytes_used);
+// Post encode update of the rate control parameters for dropped frames
+void vp9_rc_postencode_update_drop_frame(struct VP9_COMP *cpi);
+
+// Updates rate correction factors
+// Changes only the rate correction factors in the rate control structure.
+void vp9_rc_update_rate_correction_factors(struct VP9_COMP *cpi, int damp_var);
+
+// Decide if we should drop this frame: For 1-pass CBR.
+// Changes only the decimation count in the rate control structure
+int vp9_rc_drop_frame(struct VP9_COMP *cpi);
+
+// Computes frame size bounds.
+void vp9_rc_compute_frame_size_bounds(const struct VP9_COMP *cpi,
+ int this_frame_target,
+ int *frame_under_shoot_limit,
+ int *frame_over_shoot_limit);
+
+// Picks q and q bounds given the target for bits
+int vp9_rc_pick_q_and_bounds(const struct VP9_COMP *cpi,
+ int *bottom_index,
+ int *top_index);
+
+// Estimates q to achieve a target bits per frame
+int vp9_rc_regulate_q(const struct VP9_COMP *cpi, int target_bits_per_frame,
+ int active_best_quality, int active_worst_quality);
+
+// Estimates bits per mb for a given qindex and correction factor.
+int vp9_rc_bits_per_mb(FRAME_TYPE frame_type, int qindex,
+ double correction_factor);
+
+// Clamping utilities for bitrate targets for iframes and pframes.
+int vp9_rc_clamp_iframe_target_size(const struct VP9_COMP *const cpi,
+ int target);
+int vp9_rc_clamp_pframe_target_size(const struct VP9_COMP *const cpi,
+ int target);
+// Utility to set frame_target into the RATE_CONTROL structure
+// This function is called only from the vp9_rc_get_..._params() functions.
+void vp9_rc_set_frame_target(struct VP9_COMP *cpi, int target);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_RATECTRL_H_
diff --git a/libvpx/vp9/encoder/vp9_rdopt.c b/libvpx/vp9/encoder/vp9_rdopt.c
index 78cb06b..2fd25ef 100644
--- a/libvpx/vp9/encoder/vp9_rdopt.c
+++ b/libvpx/vp9/encoder/vp9_rdopt.c
@@ -8,39 +8,43 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#include <stdio.h>
-#include <math.h>
-#include <limits.h>
#include <assert.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
-#include "vp9/common/vp9_pragmas.h"
-#include "vp9/encoder/vp9_tokenize.h"
-#include "vp9/encoder/vp9_treewriter.h"
-#include "vp9/encoder/vp9_onyx_int.h"
-#include "vp9/encoder/vp9_modecosts.h"
-#include "vp9/encoder/vp9_encodeintra.h"
+#include "./vp9_rtcd.h"
+
+#include "vpx_mem/vpx_mem.h"
+
+#include "vp9/common/vp9_common.h"
+#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_entropymode.h"
+#include "vp9/common/vp9_idct.h"
+#include "vp9/common/vp9_mvref_common.h"
+#include "vp9/common/vp9_pragmas.h"
+#include "vp9/common/vp9_pred_common.h"
+#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_reconinter.h"
#include "vp9/common/vp9_reconintra.h"
-#include "vp9/common/vp9_findnearmv.h"
-#include "vp9/common/vp9_quant_common.h"
+#include "vp9/common/vp9_seg_common.h"
+#include "vp9/common/vp9_systemdependent.h"
+
+#include "vp9/encoder/vp9_cost.h"
#include "vp9/encoder/vp9_encodemb.h"
-#include "vp9/encoder/vp9_quantize.h"
-#include "vp9/encoder/vp9_variance.h"
+#include "vp9/encoder/vp9_encodemv.h"
#include "vp9/encoder/vp9_mcomp.h"
-#include "vp9/encoder/vp9_rdopt.h"
+#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_quantize.h"
#include "vp9/encoder/vp9_ratectrl.h"
-#include "vpx_mem/vpx_mem.h"
-#include "vp9/common/vp9_systemdependent.h"
-#include "vp9/encoder/vp9_encodemv.h"
-#include "vp9/common/vp9_seg_common.h"
-#include "vp9/common/vp9_pred_common.h"
-#include "vp9/common/vp9_entropy.h"
-#include "./vp9_rtcd.h"
-#include "vp9/common/vp9_mvref_common.h"
-#include "vp9/common/vp9_common.h"
+#include "vp9/encoder/vp9_rdopt.h"
+#include "vp9/encoder/vp9_tokenize.h"
+#include "vp9/encoder/vp9_variance.h"
-#define INVALID_MV 0x80008000
+#define RD_THRESH_MAX_FACT 64
+#define RD_THRESH_INC 1
+#define RD_THRESH_POW 1.25
+#define RD_MULT_EPB_RATIO 64
/* Factor to weigh the rate for switchable interp filters */
#define SWITCHABLE_INTERP_RATE_FACTOR 1
@@ -51,53 +55,79 @@
#define MIN_EARLY_TERM_INDEX 3
+typedef struct {
+ MB_PREDICTION_MODE mode;
+ MV_REFERENCE_FRAME ref_frame[2];
+} MODE_DEFINITION;
+
+typedef struct {
+ MV_REFERENCE_FRAME ref_frame[2];
+} REF_DEFINITION;
+
+struct rdcost_block_args {
+ MACROBLOCK *x;
+ ENTROPY_CONTEXT t_above[16];
+ ENTROPY_CONTEXT t_left[16];
+ int rate;
+ int64_t dist;
+ int64_t sse;
+ int this_rate;
+ int64_t this_dist;
+ int64_t this_sse;
+ int64_t this_rd;
+ int64_t best_rd;
+ int skip;
+ int use_fast_coef_costing;
+ const scan_order *so;
+};
+
const MODE_DEFINITION vp9_mode_order[MAX_MODES] = {
- {NEARESTMV, LAST_FRAME, NONE},
- {NEARESTMV, ALTREF_FRAME, NONE},
- {NEARESTMV, GOLDEN_FRAME, NONE},
-
- {DC_PRED, INTRA_FRAME, NONE},
-
- {NEWMV, LAST_FRAME, NONE},
- {NEWMV, ALTREF_FRAME, NONE},
- {NEWMV, GOLDEN_FRAME, NONE},
-
- {NEARMV, LAST_FRAME, NONE},
- {NEARMV, ALTREF_FRAME, NONE},
- {NEARESTMV, LAST_FRAME, ALTREF_FRAME},
- {NEARESTMV, GOLDEN_FRAME, ALTREF_FRAME},
-
- {TM_PRED, INTRA_FRAME, NONE},
-
- {NEARMV, LAST_FRAME, ALTREF_FRAME},
- {NEWMV, LAST_FRAME, ALTREF_FRAME},
- {NEARMV, GOLDEN_FRAME, NONE},
- {NEARMV, GOLDEN_FRAME, ALTREF_FRAME},
- {NEWMV, GOLDEN_FRAME, ALTREF_FRAME},
-
- {ZEROMV, LAST_FRAME, NONE},
- {ZEROMV, GOLDEN_FRAME, NONE},
- {ZEROMV, ALTREF_FRAME, NONE},
- {ZEROMV, LAST_FRAME, ALTREF_FRAME},
- {ZEROMV, GOLDEN_FRAME, ALTREF_FRAME},
-
- {H_PRED, INTRA_FRAME, NONE},
- {V_PRED, INTRA_FRAME, NONE},
- {D135_PRED, INTRA_FRAME, NONE},
- {D207_PRED, INTRA_FRAME, NONE},
- {D153_PRED, INTRA_FRAME, NONE},
- {D63_PRED, INTRA_FRAME, NONE},
- {D117_PRED, INTRA_FRAME, NONE},
- {D45_PRED, INTRA_FRAME, NONE},
+ {NEARESTMV, {LAST_FRAME, NONE}},
+ {NEARESTMV, {ALTREF_FRAME, NONE}},
+ {NEARESTMV, {GOLDEN_FRAME, NONE}},
+
+ {DC_PRED, {INTRA_FRAME, NONE}},
+
+ {NEWMV, {LAST_FRAME, NONE}},
+ {NEWMV, {ALTREF_FRAME, NONE}},
+ {NEWMV, {GOLDEN_FRAME, NONE}},
+
+ {NEARMV, {LAST_FRAME, NONE}},
+ {NEARMV, {ALTREF_FRAME, NONE}},
+ {NEARESTMV, {LAST_FRAME, ALTREF_FRAME}},
+ {NEARESTMV, {GOLDEN_FRAME, ALTREF_FRAME}},
+
+ {TM_PRED, {INTRA_FRAME, NONE}},
+
+ {NEARMV, {LAST_FRAME, ALTREF_FRAME}},
+ {NEWMV, {LAST_FRAME, ALTREF_FRAME}},
+ {NEARMV, {GOLDEN_FRAME, NONE}},
+ {NEARMV, {GOLDEN_FRAME, ALTREF_FRAME}},
+ {NEWMV, {GOLDEN_FRAME, ALTREF_FRAME}},
+
+ {ZEROMV, {LAST_FRAME, NONE}},
+ {ZEROMV, {GOLDEN_FRAME, NONE}},
+ {ZEROMV, {ALTREF_FRAME, NONE}},
+ {ZEROMV, {LAST_FRAME, ALTREF_FRAME}},
+ {ZEROMV, {GOLDEN_FRAME, ALTREF_FRAME}},
+
+ {H_PRED, {INTRA_FRAME, NONE}},
+ {V_PRED, {INTRA_FRAME, NONE}},
+ {D135_PRED, {INTRA_FRAME, NONE}},
+ {D207_PRED, {INTRA_FRAME, NONE}},
+ {D153_PRED, {INTRA_FRAME, NONE}},
+ {D63_PRED, {INTRA_FRAME, NONE}},
+ {D117_PRED, {INTRA_FRAME, NONE}},
+ {D45_PRED, {INTRA_FRAME, NONE}},
};
const REF_DEFINITION vp9_ref_order[MAX_REFS] = {
- {LAST_FRAME, NONE},
- {GOLDEN_FRAME, NONE},
- {ALTREF_FRAME, NONE},
- {LAST_FRAME, ALTREF_FRAME},
- {GOLDEN_FRAME, ALTREF_FRAME},
- {INTRA_FRAME, NONE},
+ {{LAST_FRAME, NONE}},
+ {{GOLDEN_FRAME, NONE}},
+ {{ALTREF_FRAME, NONE}},
+ {{LAST_FRAME, ALTREF_FRAME}},
+ {{GOLDEN_FRAME, ALTREF_FRAME}},
+ {{INTRA_FRAME, NONE}},
};
// The baseline rd thresholds for breaking out of the rd loop for
@@ -107,31 +137,58 @@ const REF_DEFINITION vp9_ref_order[MAX_REFS] = {
static int rd_thresh_block_size_factor[BLOCK_SIZES] =
{2, 3, 3, 4, 6, 6, 8, 12, 12, 16, 24, 24, 32};
-#define RD_THRESH_MAX_FACT 64
-#define RD_THRESH_INC 1
-#define RD_THRESH_POW 1.25
-#define RD_MULT_EPB_RATIO 64
+static int raster_block_offset(BLOCK_SIZE plane_bsize,
+ int raster_block, int stride) {
+ const int bw = b_width_log2(plane_bsize);
+ const int y = 4 * (raster_block >> bw);
+ const int x = 4 * (raster_block & ((1 << bw) - 1));
+ return y * stride + x;
+}
+static int16_t* raster_block_offset_int16(BLOCK_SIZE plane_bsize,
+ int raster_block, int16_t *base) {
+ const int stride = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
+ return base + raster_block_offset(plane_bsize, raster_block, stride);
+}
-#define MV_COST_WEIGHT 108
-#define MV_COST_WEIGHT_SUB 120
+static void fill_mode_costs(VP9_COMP *cpi) {
+ MACROBLOCK *const x = &cpi->mb;
+ const FRAME_CONTEXT *const fc = &cpi->common.fc;
+ int i, j;
+
+ for (i = 0; i < INTRA_MODES; i++)
+ for (j = 0; j < INTRA_MODES; j++)
+ vp9_cost_tokens((int *)x->y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j],
+ vp9_intra_mode_tree);
+
+ // TODO(rbultje) separate tables for superblock costing?
+ vp9_cost_tokens(x->mbmode_cost, fc->y_mode_prob[1], vp9_intra_mode_tree);
+ vp9_cost_tokens(x->intra_uv_mode_cost[KEY_FRAME],
+ vp9_kf_uv_mode_prob[TM_PRED], vp9_intra_mode_tree);
+ vp9_cost_tokens(x->intra_uv_mode_cost[INTER_FRAME],
+ fc->uv_mode_prob[TM_PRED], vp9_intra_mode_tree);
+
+ for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
+ vp9_cost_tokens((int *)x->switchable_interp_costs[i],
+ fc->switchable_interp_prob[i], vp9_switchable_interp_tree);
+}
static void fill_token_costs(vp9_coeff_cost *c,
- vp9_coeff_probs_model (*p)[BLOCK_TYPES]) {
+ vp9_coeff_probs_model (*p)[PLANE_TYPES]) {
int i, j, k, l;
TX_SIZE t;
- for (t = TX_4X4; t <= TX_32X32; t++)
- for (i = 0; i < BLOCK_TYPES; i++)
- for (j = 0; j < REF_TYPES; j++)
- for (k = 0; k < COEF_BANDS; k++)
- for (l = 0; l < PREV_COEF_CONTEXTS; l++) {
+ for (t = TX_4X4; t <= TX_32X32; ++t)
+ for (i = 0; i < PLANE_TYPES; ++i)
+ for (j = 0; j < REF_TYPES; ++j)
+ for (k = 0; k < COEF_BANDS; ++k)
+ for (l = 0; l < BAND_COEFF_CONTEXTS(k); ++l) {
vp9_prob probs[ENTROPY_NODES];
vp9_model_to_full_probs(p[t][i][j][k][l], probs);
vp9_cost_tokens((int *)c[t][i][j][k][0][l], probs,
vp9_coef_tree);
vp9_cost_tokens_skip((int *)c[t][i][j][k][1][l], probs,
vp9_coef_tree);
- assert(c[t][i][j][k][0][l][DCT_EOB_TOKEN] ==
- c[t][i][j][k][1][l][DCT_EOB_TOKEN]);
+ assert(c[t][i][j][k][0][l][EOB_TOKEN] ==
+ c[t][i][j][k][1][l][EOB_TOKEN]);
}
}
@@ -155,13 +212,13 @@ void vp9_init_me_luts() {
// This is to make it easier to resolve the impact of experimental changes
// to the quantizer tables.
for (i = 0; i < QINDEX_RANGE; i++) {
- sad_per_bit16lut[i] =
- (int)((0.0418 * vp9_convert_qindex_to_q(i)) + 2.4107);
- sad_per_bit4lut[i] = (int)(0.063 * vp9_convert_qindex_to_q(i) + 2.742);
+ const double q = vp9_convert_qindex_to_q(i);
+ sad_per_bit16lut[i] = (int)(0.0418 * q + 2.4107);
+ sad_per_bit4lut[i] = (int)(0.063 * q + 2.742);
}
}
-int vp9_compute_rd_mult(VP9_COMP *cpi, int qindex) {
+int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex) {
const int q = vp9_dc_quant(qindex, 0);
// TODO(debargha): Adjust the function below
int rdmult = 88 * q * q / 25;
@@ -175,12 +232,9 @@ int vp9_compute_rd_mult(VP9_COMP *cpi, int qindex) {
}
static int compute_rd_thresh_factor(int qindex) {
- int q;
// TODO(debargha): Adjust the function below
- q = (int)(pow(vp9_dc_quant(qindex, 0) / 4.0, RD_THRESH_POW) * 5.12);
- if (q < 8)
- q = 8;
- return q;
+ const int q = (int)(pow(vp9_dc_quant(qindex, 0) / 4.0, RD_THRESH_POW) * 5.12);
+ return MAX(q, 8);
}
void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex) {
@@ -189,117 +243,88 @@ void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex) {
}
static void set_block_thresholds(VP9_COMP *cpi) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const SPEED_FEATURES *const sf = &cpi->sf;
int i, bsize, segment_id;
- VP9_COMMON *cm = &cpi->common;
for (segment_id = 0; segment_id < MAX_SEGMENTS; ++segment_id) {
- int q;
- int segment_qindex = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex);
- segment_qindex = clamp(segment_qindex + cm->y_dc_delta_q, 0, MAXQ);
- q = compute_rd_thresh_factor(segment_qindex);
+ const int qindex = clamp(vp9_get_qindex(&cm->seg, segment_id,
+ cm->base_qindex) + cm->y_dc_delta_q,
+ 0, MAXQ);
+ const int q = compute_rd_thresh_factor(qindex);
for (bsize = 0; bsize < BLOCK_SIZES; ++bsize) {
- // Threshold here seem unecessarily harsh but fine given actual
- // range of values used for cpi->sf.thresh_mult[]
- int thresh_max = INT_MAX / (q * rd_thresh_block_size_factor[bsize]);
-
- for (i = 0; i < MAX_MODES; ++i) {
- if (cpi->sf.thresh_mult[i] < thresh_max) {
- cpi->rd_threshes[segment_id][bsize][i] =
- cpi->sf.thresh_mult[i] * q *
- rd_thresh_block_size_factor[bsize] / 4;
- } else {
- cpi->rd_threshes[segment_id][bsize][i] = INT_MAX;
- }
- }
+ // Threshold here seems unnecessarily harsh but fine given actual
+ // range of values used for cpi->sf.thresh_mult[].
+ const int t = q * rd_thresh_block_size_factor[bsize];
+ const int thresh_max = INT_MAX / t;
+
+ for (i = 0; i < MAX_MODES; ++i)
+ cpi->rd_threshes[segment_id][bsize][i] =
+ sf->thresh_mult[i] < thresh_max ? sf->thresh_mult[i] * t / 4
+ : INT_MAX;
for (i = 0; i < MAX_REFS; ++i) {
- if (cpi->sf.thresh_mult_sub8x8[i] < thresh_max) {
- cpi->rd_thresh_sub8x8[segment_id][bsize][i] =
- cpi->sf.thresh_mult_sub8x8[i] * q *
- rd_thresh_block_size_factor[bsize] / 4;
- } else {
- cpi->rd_thresh_sub8x8[segment_id][bsize][i] = INT_MAX;
- }
+ cpi->rd_thresh_sub8x8[segment_id][bsize][i] =
+ sf->thresh_mult_sub8x8[i] < thresh_max
+ ? sf->thresh_mult_sub8x8[i] * t / 4
+ : INT_MAX;
}
}
}
}
void vp9_initialize_rd_consts(VP9_COMP *cpi) {
- VP9_COMMON *cm = &cpi->common;
- int qindex, i;
-
- vp9_clear_system_state(); // __asm emms;
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCK *const x = &cpi->mb;
+ int i;
- // Further tests required to see if optimum is different
- // for key frames, golden frames and arf frames.
- // if (cpi->common.refresh_golden_frame ||
- // cpi->common.refresh_alt_ref_frame)
- qindex = clamp(cm->base_qindex + cm->y_dc_delta_q, 0, MAXQ);
+ vp9_clear_system_state();
cpi->RDDIV = RDDIV_BITS; // in bits (to multiply D by 128)
- cpi->RDMULT = vp9_compute_rd_mult(cpi, qindex);
+ cpi->RDMULT = vp9_compute_rd_mult(cpi, cm->base_qindex + cm->y_dc_delta_q);
- cpi->mb.errorperbit = cpi->RDMULT / RD_MULT_EPB_RATIO;
- cpi->mb.errorperbit += (cpi->mb.errorperbit == 0);
+ x->errorperbit = cpi->RDMULT / RD_MULT_EPB_RATIO;
+ x->errorperbit += (x->errorperbit == 0);
- vp9_set_speed_features(cpi);
-
- cpi->mb.select_txfm_size = (cpi->sf.tx_size_search_method == USE_LARGESTALL &&
- cm->frame_type != KEY_FRAME) ?
- 0 : 1;
+ x->select_txfm_size = (cpi->sf.tx_size_search_method == USE_LARGESTALL &&
+ cm->frame_type != KEY_FRAME) ? 0 : 1;
set_block_thresholds(cpi);
- fill_token_costs(cpi->mb.token_costs, cm->fc.coef_probs);
-
- for (i = 0; i < PARTITION_CONTEXTS; i++)
- vp9_cost_tokens(cpi->mb.partition_cost[i], get_partition_probs(cm, i),
- vp9_partition_tree);
+ if (!cpi->sf.use_nonrd_pick_mode || cm->frame_type == KEY_FRAME) {
+ fill_token_costs(x->token_costs, cm->fc.coef_probs);
- /*rough estimate for costing*/
- vp9_init_mode_costs(cpi);
+ for (i = 0; i < PARTITION_CONTEXTS; i++)
+ vp9_cost_tokens(x->partition_cost[i], get_partition_probs(cm, i),
+ vp9_partition_tree);
+ }
- if (!frame_is_intra_only(cm)) {
- vp9_build_nmv_cost_table(
- cpi->mb.nmvjointcost,
- cm->allow_high_precision_mv ? cpi->mb.nmvcost_hp : cpi->mb.nmvcost,
- &cm->fc.nmvc,
- cm->allow_high_precision_mv, 1, 1);
+ if (!cpi->sf.use_nonrd_pick_mode || (cm->current_video_frame & 0x07) == 1 ||
+ cm->frame_type == KEY_FRAME) {
+ fill_mode_costs(cpi);
- for (i = 0; i < INTER_MODE_CONTEXTS; i++) {
- MB_PREDICTION_MODE m;
+ if (!frame_is_intra_only(cm)) {
+ vp9_build_nmv_cost_table(x->nmvjointcost,
+ cm->allow_high_precision_mv ? x->nmvcost_hp
+ : x->nmvcost,
+ &cm->fc.nmvc, cm->allow_high_precision_mv);
- for (m = NEARESTMV; m < MB_MODE_COUNT; m++)
- cpi->mb.inter_mode_cost[i][INTER_OFFSET(m)] =
- cost_token(vp9_inter_mode_tree,
- cm->fc.inter_mode_probs[i],
- &vp9_inter_mode_encodings[INTER_OFFSET(m)]);
+ for (i = 0; i < INTER_MODE_CONTEXTS; ++i)
+ vp9_cost_tokens((int *)x->inter_mode_cost[i],
+ cm->fc.inter_mode_probs[i], vp9_inter_mode_tree);
}
}
}
-static INLINE void linear_interpolate2(double x, int ntab, int inv_step,
- const double *tab1, const double *tab2,
- double *v1, double *v2) {
- double y = x * inv_step;
- int d = (int) y;
- if (d >= ntab - 1) {
- *v1 = tab1[ntab - 1];
- *v2 = tab2[ntab - 1];
- } else {
- double a = y - d;
- *v1 = tab1[d] * (1 - a) + tab1[d + 1] * a;
- *v2 = tab2[d] * (1 - a) + tab2[d + 1] * a;
- }
-}
+static const int MAX_XSQ_Q10 = 245727;
-static void model_rd_norm(double x, double *R, double *D) {
- static const int inv_tab_step = 8;
- static const int tab_size = 120;
+static void model_rd_norm(int xsq_q10, int *r_q10, int *d_q10) {
// NOTE: The tables below must be of the same size
- //
+
+ // The functions described below are sampled at the four most significant
+ // bits of x^2 + 8 / 256
+
// Normalized rate
// This table models the rate for a Laplacian source
// source with given variance when quantized with a uniform quantizer
@@ -307,22 +332,20 @@ static void model_rd_norm(double x, double *R, double *D) {
// Rn(x) = H(sqrt(r)) + sqrt(r)*[1 + H(r)/(1 - r)],
// where r = exp(-sqrt(2) * x) and x = qpstep / sqrt(variance),
// and H(x) is the binary entropy function.
- static const double rate_tab[] = {
- 64.00, 4.944, 3.949, 3.372, 2.966, 2.655, 2.403, 2.194,
- 2.014, 1.858, 1.720, 1.596, 1.485, 1.384, 1.291, 1.206,
- 1.127, 1.054, 0.986, 0.923, 0.863, 0.808, 0.756, 0.708,
- 0.662, 0.619, 0.579, 0.541, 0.506, 0.473, 0.442, 0.412,
- 0.385, 0.359, 0.335, 0.313, 0.291, 0.272, 0.253, 0.236,
- 0.220, 0.204, 0.190, 0.177, 0.165, 0.153, 0.142, 0.132,
- 0.123, 0.114, 0.106, 0.099, 0.091, 0.085, 0.079, 0.073,
- 0.068, 0.063, 0.058, 0.054, 0.050, 0.047, 0.043, 0.040,
- 0.037, 0.034, 0.032, 0.029, 0.027, 0.025, 0.023, 0.022,
- 0.020, 0.019, 0.017, 0.016, 0.015, 0.014, 0.013, 0.012,
- 0.011, 0.010, 0.009, 0.008, 0.008, 0.007, 0.007, 0.006,
- 0.006, 0.005, 0.005, 0.005, 0.004, 0.004, 0.004, 0.003,
- 0.003, 0.003, 0.003, 0.002, 0.002, 0.002, 0.002, 0.002,
- 0.002, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001,
- 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.000,
+ static const int rate_tab_q10[] = {
+ 65536, 6086, 5574, 5275, 5063, 4899, 4764, 4651,
+ 4553, 4389, 4255, 4142, 4044, 3958, 3881, 3811,
+ 3748, 3635, 3538, 3453, 3376, 3307, 3244, 3186,
+ 3133, 3037, 2952, 2877, 2809, 2747, 2690, 2638,
+ 2589, 2501, 2423, 2353, 2290, 2232, 2179, 2130,
+ 2084, 2001, 1928, 1862, 1802, 1748, 1698, 1651,
+ 1608, 1530, 1460, 1398, 1342, 1290, 1243, 1199,
+ 1159, 1086, 1021, 963, 911, 864, 821, 781,
+ 745, 680, 623, 574, 530, 490, 455, 424,
+ 395, 345, 304, 269, 239, 213, 190, 171,
+ 154, 126, 104, 87, 73, 61, 52, 44,
+ 38, 28, 21, 16, 12, 10, 8, 6,
+ 5, 3, 2, 1, 1, 1, 0, 0,
};
// Normalized distortion
// This table models the normalized distortion for a Laplacian source
@@ -331,54 +354,74 @@ static void model_rd_norm(double x, double *R, double *D) {
// Dn(x) = 1 - 1/sqrt(2) * x / sinh(x/sqrt(2))
// where x = qpstep / sqrt(variance)
// Note the actual distortion is Dn * variance.
- static const double dist_tab[] = {
- 0.000, 0.001, 0.005, 0.012, 0.021, 0.032, 0.045, 0.061,
- 0.079, 0.098, 0.119, 0.142, 0.166, 0.190, 0.216, 0.242,
- 0.269, 0.296, 0.324, 0.351, 0.378, 0.405, 0.432, 0.458,
- 0.484, 0.509, 0.534, 0.557, 0.580, 0.603, 0.624, 0.645,
- 0.664, 0.683, 0.702, 0.719, 0.735, 0.751, 0.766, 0.780,
- 0.794, 0.807, 0.819, 0.830, 0.841, 0.851, 0.861, 0.870,
- 0.878, 0.886, 0.894, 0.901, 0.907, 0.913, 0.919, 0.925,
- 0.930, 0.935, 0.939, 0.943, 0.947, 0.951, 0.954, 0.957,
- 0.960, 0.963, 0.966, 0.968, 0.971, 0.973, 0.975, 0.976,
- 0.978, 0.980, 0.981, 0.982, 0.984, 0.985, 0.986, 0.987,
- 0.988, 0.989, 0.990, 0.990, 0.991, 0.992, 0.992, 0.993,
- 0.993, 0.994, 0.994, 0.995, 0.995, 0.996, 0.996, 0.996,
- 0.996, 0.997, 0.997, 0.997, 0.997, 0.998, 0.998, 0.998,
- 0.998, 0.998, 0.998, 0.999, 0.999, 0.999, 0.999, 0.999,
- 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 0.999, 1.000,
+ static const int dist_tab_q10[] = {
+ 0, 0, 1, 1, 1, 2, 2, 2,
+ 3, 3, 4, 5, 5, 6, 7, 7,
+ 8, 9, 11, 12, 13, 15, 16, 17,
+ 18, 21, 24, 26, 29, 31, 34, 36,
+ 39, 44, 49, 54, 59, 64, 69, 73,
+ 78, 88, 97, 106, 115, 124, 133, 142,
+ 151, 167, 184, 200, 215, 231, 245, 260,
+ 274, 301, 327, 351, 375, 397, 418, 439,
+ 458, 495, 528, 559, 587, 613, 637, 659,
+ 680, 717, 749, 777, 801, 823, 842, 859,
+ 874, 899, 919, 936, 949, 960, 969, 977,
+ 983, 994, 1001, 1006, 1010, 1013, 1015, 1017,
+ 1018, 1020, 1022, 1022, 1023, 1023, 1023, 1024,
+ };
+ static const int xsq_iq_q10[] = {
+ 0, 4, 8, 12, 16, 20, 24, 28,
+ 32, 40, 48, 56, 64, 72, 80, 88,
+ 96, 112, 128, 144, 160, 176, 192, 208,
+ 224, 256, 288, 320, 352, 384, 416, 448,
+ 480, 544, 608, 672, 736, 800, 864, 928,
+ 992, 1120, 1248, 1376, 1504, 1632, 1760, 1888,
+ 2016, 2272, 2528, 2784, 3040, 3296, 3552, 3808,
+ 4064, 4576, 5088, 5600, 6112, 6624, 7136, 7648,
+ 8160, 9184, 10208, 11232, 12256, 13280, 14304, 15328,
+ 16352, 18400, 20448, 22496, 24544, 26592, 28640, 30688,
+ 32736, 36832, 40928, 45024, 49120, 53216, 57312, 61408,
+ 65504, 73696, 81888, 90080, 98272, 106464, 114656, 122848,
+ 131040, 147424, 163808, 180192, 196576, 212960, 229344, 245728,
};
/*
- assert(sizeof(rate_tab) == tab_size * sizeof(rate_tab[0]);
- assert(sizeof(dist_tab) == tab_size * sizeof(dist_tab[0]);
- assert(sizeof(rate_tab) == sizeof(dist_tab));
+ static const int tab_size = sizeof(rate_tab_q10) / sizeof(rate_tab_q10[0]);
+ assert(sizeof(dist_tab_q10) / sizeof(dist_tab_q10[0]) == tab_size);
+ assert(sizeof(xsq_iq_q10) / sizeof(xsq_iq_q10[0]) == tab_size);
+ assert(MAX_XSQ_Q10 + 1 == xsq_iq_q10[tab_size - 1]);
*/
- assert(x >= 0.0);
- linear_interpolate2(x, tab_size, inv_tab_step,
- rate_tab, dist_tab, R, D);
+ int tmp = (xsq_q10 >> 2) + 8;
+ int k = get_msb(tmp) - 3;
+ int xq = (k << 3) + ((tmp >> k) & 0x7);
+ const int one_q10 = 1 << 10;
+ const int a_q10 = ((xsq_q10 - xsq_iq_q10[xq]) << 10) >> (2 + k);
+ const int b_q10 = one_q10 - a_q10;
+ *r_q10 = (rate_tab_q10[xq] * b_q10 + rate_tab_q10[xq + 1] * a_q10) >> 10;
+ *d_q10 = (dist_tab_q10[xq] * b_q10 + dist_tab_q10[xq + 1] * a_q10) >> 10;
}
-static void model_rd_from_var_lapndz(int var, int n, int qstep,
- int *rate, int64_t *dist) {
+void vp9_model_rd_from_var_lapndz(unsigned int var, unsigned int n,
+ unsigned int qstep, int *rate,
+ int64_t *dist) {
// This function models the rate and distortion for a Laplacian
// source with given variance when quantized with a uniform quantizer
// with given stepsize. The closed form expressions are in:
// Hang and Chen, "Source Model for transform video coder and its
// application - Part I: Fundamental Theory", IEEE Trans. Circ.
// Sys. for Video Tech., April 1997.
- vp9_clear_system_state();
- if (var == 0 || n == 0) {
+ if (var == 0) {
*rate = 0;
*dist = 0;
} else {
- double D, R;
- double s2 = (double) var / n;
- double x = qstep / sqrt(s2);
- model_rd_norm(x, &R, &D);
- *rate = (int)((n << 8) * R + 0.5);
- *dist = (int)(var * D + 0.5);
+ int d_q10, r_q10;
+ const uint64_t xsq_q10_64 =
+ ((((uint64_t)qstep * qstep * n) << 10) + (var >> 1)) / var;
+ const int xsq_q10 = xsq_q10_64 > MAX_XSQ_Q10 ?
+ MAX_XSQ_Q10 : (int)xsq_q10_64;
+ model_rd_norm(xsq_q10, &r_q10, &d_q10);
+ *rate = (n * r_q10 + 2) >> 2;
+ *dist = (var * (int64_t)d_q10 + 512) >> 10;
}
- vp9_clear_system_state();
}
static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
@@ -387,26 +430,48 @@ static void model_rd_for_sb(VP9_COMP *cpi, BLOCK_SIZE bsize,
// Note our transform coeffs are 8 times an orthogonal transform.
// Hence quantizer step is also 8 times. To get effective quantizer
// we need to divide by 8 before sending to modeling function.
- int i, rate_sum = 0, dist_sum = 0;
+ int i;
+ int64_t rate_sum = 0;
+ int64_t dist_sum = 0;
+ const int ref = xd->mi_8x8[0]->mbmi.ref_frame[0];
+ unsigned int sse;
for (i = 0; i < MAX_MB_PLANE; ++i) {
struct macroblock_plane *const p = &x->plane[i];
struct macroblockd_plane *const pd = &xd->plane[i];
const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
- unsigned int sse;
- int rate;
- int64_t dist;
+
(void) cpi->fn_ptr[bs].vf(p->src.buf, p->src.stride,
pd->dst.buf, pd->dst.stride, &sse);
- // sse works better than var, since there is no dc prediction used
- model_rd_from_var_lapndz(sse, 1 << num_pels_log2_lookup[bs],
- pd->dequant[1] >> 3, &rate, &dist);
- rate_sum += rate;
- dist_sum += (int)dist;
+ if (i == 0)
+ x->pred_sse[ref] = sse;
+
+ // Fast approximate the modelling function.
+ if (cpi->speed > 4) {
+ int64_t rate;
+ int64_t dist;
+ int64_t square_error = sse;
+ int quantizer = (pd->dequant[1] >> 3);
+
+ if (quantizer < 120)
+ rate = (square_error * (280 - quantizer)) >> 8;
+ else
+ rate = 0;
+ dist = (square_error * quantizer) >> 8;
+ rate_sum += rate;
+ dist_sum += dist;
+ } else {
+ int rate;
+ int64_t dist;
+ vp9_model_rd_from_var_lapndz(sse, 1 << num_pels_log2_lookup[bs],
+ pd->dequant[1] >> 3, &rate, &dist);
+ rate_sum += rate;
+ dist_sum += dist;
+ }
}
- *out_rate_sum = rate_sum;
+ *out_rate_sum = (int)rate_sum;
*out_dist_sum = dist_sum << 4;
}
@@ -417,10 +482,10 @@ static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE bsize,
int *out_skip) {
int j, k;
BLOCK_SIZE bs;
- struct macroblock_plane *const p = &x->plane[0];
- struct macroblockd_plane *const pd = &xd->plane[0];
- const int width = 4 << num_4x4_blocks_wide_lookup[bsize];
- const int height = 4 << num_4x4_blocks_high_lookup[bsize];
+ const struct macroblock_plane *const p = &x->plane[0];
+ const struct macroblockd_plane *const pd = &xd->plane[0];
+ const int width = 4 * num_4x4_blocks_wide_lookup[bsize];
+ const int height = 4 * num_4x4_blocks_high_lookup[bsize];
int rate_sum = 0;
int64_t dist_sum = 0;
const int t = 4 << tx_size;
@@ -447,7 +512,8 @@ static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE bsize,
&pd->dst.buf[j * pd->dst.stride + k], pd->dst.stride,
&sse);
// sse works better than var, since there is no dc prediction used
- model_rd_from_var_lapndz(sse, t * t, pd->dequant[1] >> 3, &rate, &dist);
+ vp9_model_rd_from_var_lapndz(sse, t * t, pd->dequant[1] >> 3,
+ &rate, &dist);
rate_sum += rate;
dist_sum += dist;
*out_skip &= (rate < 1024);
@@ -458,15 +524,15 @@ static void model_rd_for_sb_y_tx(VP9_COMP *cpi, BLOCK_SIZE bsize,
*out_dist_sum = dist_sum << 4;
}
-int64_t vp9_block_error_c(int16_t *coeff, int16_t *dqcoeff,
+int64_t vp9_block_error_c(const int16_t *coeff, const int16_t *dqcoeff,
intptr_t block_size, int64_t *ssz) {
int i;
int64_t error = 0, sqcoeff = 0;
for (i = 0; i < block_size; i++) {
- int this_diff = coeff[i] - dqcoeff[i];
- error += (unsigned)this_diff * this_diff;
- sqcoeff += (unsigned) coeff[i] * coeff[i];
+ const int diff = coeff[i] - dqcoeff[i];
+ error += diff * diff;
+ sqcoeff += coeff[i] * coeff[i];
}
*ssz = sqcoeff;
@@ -484,40 +550,38 @@ static const int16_t band_counts[TX_SIZES][8] = {
{ 1, 2, 3, 4, 11, 256 - 21, 0 },
{ 1, 2, 3, 4, 11, 1024 - 21, 0 },
};
-
static INLINE int cost_coeffs(MACROBLOCK *x,
int plane, int block,
ENTROPY_CONTEXT *A, ENTROPY_CONTEXT *L,
TX_SIZE tx_size,
- const int16_t *scan, const int16_t *nb) {
+ const int16_t *scan, const int16_t *nb,
+ int use_fast_coef_costing) {
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
- struct macroblockd_plane *pd = &xd->plane[plane];
+ const struct macroblock_plane *p = &x->plane[plane];
+ const struct macroblockd_plane *pd = &xd->plane[plane];
const PLANE_TYPE type = pd->plane_type;
const int16_t *band_count = &band_counts[tx_size][1];
- const int eob = pd->eobs[block];
- const int16_t *const qcoeff_ptr = BLOCK_OFFSET(pd->qcoeff, block);
- const int ref = mbmi->ref_frame[0] != INTRA_FRAME;
- unsigned int (*token_costs)[2][PREV_COEF_CONTEXTS][MAX_ENTROPY_TOKENS] =
- x->token_costs[tx_size][type][ref];
- const ENTROPY_CONTEXT above_ec = !!*A, left_ec = !!*L;
+ const int eob = p->eobs[block];
+ const int16_t *const qcoeff = BLOCK_OFFSET(p->qcoeff, block);
+ unsigned int (*token_costs)[2][COEFF_CONTEXTS][ENTROPY_TOKENS] =
+ x->token_costs[tx_size][type][is_inter_block(mbmi)];
uint8_t *p_tok = x->token_cache;
- int pt = combine_entropy_contexts(above_ec, left_ec);
+ int pt = combine_entropy_contexts(*A, *L);
int c, cost;
-
// Check for consistency of tx_size with mode info
- assert(type == PLANE_TYPE_Y_WITH_DC ? mbmi->tx_size == tx_size
- : get_uv_tx_size(mbmi) == tx_size);
+ assert(type == PLANE_TYPE_Y ? mbmi->tx_size == tx_size
+ : get_uv_tx_size(mbmi) == tx_size);
if (eob == 0) {
// single eob token
- cost = token_costs[0][0][pt][DCT_EOB_TOKEN];
+ cost = token_costs[0][0][pt][EOB_TOKEN];
c = 0;
} else {
int band_left = *band_count++;
// dc token
- int v = qcoeff_ptr[0];
+ int v = qcoeff[0];
int prev_t = vp9_dct_value_tokens_ptr[v].token;
cost = (*token_costs)[0][pt][prev_t] + vp9_dct_value_cost_ptr[v];
p_tok[0] = vp9_pt_energy_class[prev_t];
@@ -528,11 +592,15 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
const int rc = scan[c];
int t;
- v = qcoeff_ptr[rc];
+ v = qcoeff[rc];
t = vp9_dct_value_tokens_ptr[v].token;
- pt = get_coef_context(nb, p_tok, c);
- cost += (*token_costs)[!prev_t][pt][t] + vp9_dct_value_cost_ptr[v];
- p_tok[rc] = vp9_pt_energy_class[t];
+ if (use_fast_coef_costing) {
+ cost += (*token_costs)[!prev_t][!prev_t][t] + vp9_dct_value_cost_ptr[v];
+ } else {
+ pt = get_coef_context(nb, p_tok, c);
+ cost += (*token_costs)[!prev_t][pt][t] + vp9_dct_value_cost_ptr[v];
+ p_tok[rc] = vp9_pt_energy_class[t];
+ }
prev_t = t;
if (!--band_left) {
band_left = *band_count++;
@@ -542,8 +610,12 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
// eob token
if (band_left) {
- pt = get_coef_context(nb, p_tok, c);
- cost += (*token_costs)[0][pt][DCT_EOB_TOKEN];
+ if (use_fast_coef_costing) {
+ cost += (*token_costs)[0][!prev_t][EOB_TOKEN];
+ } else {
+ pt = get_coef_context(nb, p_tok, c);
+ cost += (*token_costs)[0][pt][EOB_TOKEN];
+ }
}
}
@@ -552,24 +624,22 @@ static INLINE int cost_coeffs(MACROBLOCK *x,
return cost;
}
-
-static void dist_block(int plane, int block, TX_SIZE tx_size, void *arg) {
+static void dist_block(int plane, int block, TX_SIZE tx_size,
+ struct rdcost_block_args* args) {
const int ss_txfrm_size = tx_size << 1;
- struct rdcost_block_args* args = arg;
MACROBLOCK* const x = args->x;
MACROBLOCKD* const xd = &x->e_mbd;
- struct macroblock_plane *const p = &x->plane[plane];
- struct macroblockd_plane *const pd = &xd->plane[plane];
+ const struct macroblock_plane *const p = &x->plane[plane];
+ const struct macroblockd_plane *const pd = &xd->plane[plane];
int64_t this_sse;
- int shift = args->tx_size == TX_32X32 ? 0 : 2;
+ int shift = tx_size == TX_32X32 ? 0 : 2;
int16_t *const coeff = BLOCK_OFFSET(p->coeff, block);
int16_t *const dqcoeff = BLOCK_OFFSET(pd->dqcoeff, block);
args->dist = vp9_block_error(coeff, dqcoeff, 16 << ss_txfrm_size,
&this_sse) >> shift;
args->sse = this_sse >> shift;
- if (x->skip_encode &&
- xd->mi_8x8[0]->mbmi.ref_frame[0] == INTRA_FRAME) {
+ if (x->skip_encode && !is_inter_block(&xd->mi_8x8[0]->mbmi)) {
// TODO(jingning): tune the model to better capture the distortion.
int64_t p = (pd->dequant[1] * pd->dequant[1] *
(1 << ss_txfrm_size)) >> (shift + 2);
@@ -579,32 +649,31 @@ static void dist_block(int plane, int block, TX_SIZE tx_size, void *arg) {
}
static void rate_block(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, void *arg) {
- struct rdcost_block_args* args = arg;
-
+ TX_SIZE tx_size, struct rdcost_block_args* args) {
int x_idx, y_idx;
- txfrm_block_to_raster_xy(plane_bsize, args->tx_size, block, &x_idx, &y_idx);
+ txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &x_idx, &y_idx);
args->rate = cost_coeffs(args->x, plane, block, args->t_above + x_idx,
- args->t_left + y_idx, args->tx_size,
- args->scan, args->nb);
+ args->t_left + y_idx, tx_size,
+ args->so->scan, args->so->neighbors,
+ args->use_fast_coef_costing);
}
-static void block_yrd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
- TX_SIZE tx_size, void *arg) {
+static void block_rd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
+ TX_SIZE tx_size, void *arg) {
struct rdcost_block_args *args = arg;
MACROBLOCK *const x = args->x;
MACROBLOCKD *const xd = &x->e_mbd;
- struct encode_b_args encode_args = {x, NULL};
+ MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
int64_t rd1, rd2, rd;
if (args->skip)
return;
- if (!is_inter_block(&xd->mi_8x8[0]->mbmi))
- vp9_encode_block_intra(plane, block, plane_bsize, tx_size, &encode_args);
+ if (!is_inter_block(mbmi))
+ vp9_encode_block_intra(x, plane, block, plane_bsize, tx_size, &mbmi->skip);
else
- vp9_xform_quant(plane, block, plane_bsize, tx_size, &encode_args);
+ vp9_xform_quant(x, plane, block, plane_bsize, tx_size);
dist_block(plane, block, tx_size, args);
rate_block(plane, block, plane_bsize, tx_size, args);
@@ -613,8 +682,9 @@ static void block_yrd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
// TODO(jingning): temporarily enabled only for luma component
rd = MIN(rd1, rd2);
- if (!xd->lossless && plane == 0)
- x->zcoeff_blk[tx_size][block] = rd1 > rd2 || !xd->plane[plane].eobs[block];
+ if (plane == 0)
+ x->zcoeff_blk[tx_size][block] = !x->plane[plane].eobs[block] ||
+ (rd1 > rd2 && !xd->lossless);
args->this_rate += args->rate;
args->this_dist += args->dist;
@@ -627,10 +697,16 @@ static void block_yrd_txfm(int plane, int block, BLOCK_SIZE plane_bsize,
}
}
-void vp9_get_entropy_contexts(TX_SIZE tx_size,
- ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16],
- const ENTROPY_CONTEXT *above, const ENTROPY_CONTEXT *left,
- int num_4x4_w, int num_4x4_h) {
+void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
+ const struct macroblockd_plane *pd,
+ ENTROPY_CONTEXT t_above[16],
+ ENTROPY_CONTEXT t_left[16]) {
+ const BLOCK_SIZE plane_bsize = get_plane_block_size(bsize, pd);
+ const int num_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
+ const int num_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
+ const ENTROPY_CONTEXT *const above = pd->above_context;
+ const ENTROPY_CONTEXT *const left = pd->left_context;
+
int i;
switch (tx_size) {
case TX_4X4:
@@ -656,57 +732,42 @@ void vp9_get_entropy_contexts(TX_SIZE tx_size,
t_left[i] = !!*(const uint64_t *)&left[i];
break;
default:
- assert(!"Invalid transform size.");
+ assert(0 && "Invalid transform size.");
}
}
-static void init_rdcost_stack(MACROBLOCK *x, TX_SIZE tx_size,
- const int num_4x4_w, const int num_4x4_h,
- const int64_t ref_rdcost,
- struct rdcost_block_args *arg) {
- vpx_memset(arg, 0, sizeof(struct rdcost_block_args));
- arg->x = x;
- arg->tx_size = tx_size;
- arg->bw = num_4x4_w;
- arg->bh = num_4x4_h;
- arg->best_rd = ref_rdcost;
-}
-
static void txfm_rd_in_plane(MACROBLOCK *x,
- struct rdcost_block_args *rd_stack,
int *rate, int64_t *distortion,
int *skippable, int64_t *sse,
int64_t ref_best_rd, int plane,
- BLOCK_SIZE bsize, TX_SIZE tx_size) {
+ BLOCK_SIZE bsize, TX_SIZE tx_size,
+ int use_fast_coef_casting) {
MACROBLOCKD *const xd = &x->e_mbd;
- struct macroblockd_plane *const pd = &xd->plane[plane];
- const BLOCK_SIZE bs = get_plane_block_size(bsize, pd);
- const int num_4x4_w = num_4x4_blocks_wide_lookup[bs];
- const int num_4x4_h = num_4x4_blocks_high_lookup[bs];
+ const struct macroblockd_plane *const pd = &xd->plane[plane];
+ struct rdcost_block_args args = { 0 };
+ args.x = x;
+ args.best_rd = ref_best_rd;
+ args.use_fast_coef_costing = use_fast_coef_casting;
- init_rdcost_stack(x, tx_size, num_4x4_w, num_4x4_h,
- ref_best_rd, rd_stack);
if (plane == 0)
xd->mi_8x8[0]->mbmi.tx_size = tx_size;
- vp9_get_entropy_contexts(tx_size, rd_stack->t_above, rd_stack->t_left,
- pd->above_context, pd->left_context,
- num_4x4_w, num_4x4_h);
+ vp9_get_entropy_contexts(bsize, tx_size, pd, args.t_above, args.t_left);
- get_scan(xd, tx_size, pd->plane_type, 0, &rd_stack->scan, &rd_stack->nb);
+ args.so = get_scan(xd, tx_size, pd->plane_type, 0);
- foreach_transformed_block_in_plane(xd, bsize, plane,
- block_yrd_txfm, rd_stack);
- if (rd_stack->skip) {
+ vp9_foreach_transformed_block_in_plane(xd, bsize, plane,
+ block_rd_txfm, &args);
+ if (args.skip) {
*rate = INT_MAX;
*distortion = INT64_MAX;
*sse = INT64_MAX;
*skippable = 0;
} else {
- *distortion = rd_stack->this_dist;
- *rate = rd_stack->this_rate;
- *sse = rd_stack->this_sse;
- *skippable = vp9_is_skippable_in_plane(xd, bsize, plane);
+ *distortion = args.this_dist;
+ *rate = args.this_rate;
+ *sse = args.this_sse;
+ *skippable = vp9_is_skippable_in_plane(x, bsize, plane);
}
}
@@ -723,9 +784,9 @@ static void choose_largest_txfm_size(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->tx_size = MIN(max_tx_size, largest_tx_size);
- txfm_rd_in_plane(x, &cpi->rdcost_stack, rate, distortion, skip,
+ txfm_rd_in_plane(x, rate, distortion, skip,
&sse[mbmi->tx_size], ref_best_rd, 0, bs,
- mbmi->tx_size);
+ mbmi->tx_size, cpi->sf.use_fast_coef_costing);
cpi->tx_stepdown_count[0]++;
}
@@ -739,63 +800,49 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
- vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
- int64_t rd[TX_SIZES][2];
+ vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
+ int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX},
+ {INT64_MAX, INT64_MAX},
+ {INT64_MAX, INT64_MAX},
+ {INT64_MAX, INT64_MAX}};
int n, m;
int s0, s1;
+ const TX_SIZE max_mode_tx_size = tx_mode_to_biggest_tx_size[cm->tx_mode];
+ int64_t best_rd = INT64_MAX;
+ TX_SIZE best_tx = TX_4X4;
const vp9_prob *tx_probs = get_tx_probs2(max_tx_size, xd, &cm->fc.tx_probs);
-
- for (n = TX_4X4; n <= max_tx_size; n++) {
- r[n][1] = r[n][0];
- if (r[n][0] == INT_MAX)
- continue;
- for (m = 0; m <= n - (n == max_tx_size); m++) {
- if (m == n)
- r[n][1] += vp9_cost_zero(tx_probs[m]);
- else
- r[n][1] += vp9_cost_one(tx_probs[m]);
- }
- }
-
assert(skip_prob > 0);
s0 = vp9_cost_bit(skip_prob, 0);
s1 = vp9_cost_bit(skip_prob, 1);
for (n = TX_4X4; n <= max_tx_size; n++) {
+ r[n][1] = r[n][0];
+ if (r[n][0] < INT_MAX) {
+ for (m = 0; m <= n - (n == max_tx_size); m++) {
+ if (m == n)
+ r[n][1] += vp9_cost_zero(tx_probs[m]);
+ else
+ r[n][1] += vp9_cost_one(tx_probs[m]);
+ }
+ }
if (d[n] == INT64_MAX) {
rd[n][0] = rd[n][1] = INT64_MAX;
- continue;
- }
- if (s[n]) {
+ } else if (s[n]) {
rd[n][0] = rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1, d[n]);
} else {
rd[n][0] = RDCOST(x->rdmult, x->rddiv, r[n][0] + s0, d[n]);
rd[n][1] = RDCOST(x->rdmult, x->rddiv, r[n][1] + s0, d[n]);
}
- }
- if (max_tx_size == TX_32X32 &&
- (cm->tx_mode == ALLOW_32X32 ||
- (cm->tx_mode == TX_MODE_SELECT &&
- rd[TX_32X32][1] < rd[TX_16X16][1] && rd[TX_32X32][1] < rd[TX_8X8][1] &&
- rd[TX_32X32][1] < rd[TX_4X4][1]))) {
- mbmi->tx_size = TX_32X32;
- } else if (max_tx_size >= TX_16X16 &&
- (cm->tx_mode == ALLOW_16X16 ||
- cm->tx_mode == ALLOW_32X32 ||
- (cm->tx_mode == TX_MODE_SELECT &&
- rd[TX_16X16][1] < rd[TX_8X8][1] &&
- rd[TX_16X16][1] < rd[TX_4X4][1]))) {
- mbmi->tx_size = TX_16X16;
- } else if (cm->tx_mode == ALLOW_8X8 ||
- cm->tx_mode == ALLOW_16X16 ||
- cm->tx_mode == ALLOW_32X32 ||
- (cm->tx_mode == TX_MODE_SELECT && rd[TX_8X8][1] < rd[TX_4X4][1])) {
- mbmi->tx_size = TX_8X8;
- } else {
- mbmi->tx_size = TX_4X4;
+ if (rd[n][1] < best_rd) {
+ best_tx = n;
+ best_rd = rd[n][1];
+ }
}
+ mbmi->tx_size = cm->tx_mode == TX_MODE_SELECT ?
+ best_tx : MIN(max_tx_size, max_mode_tx_size);
+
*distortion = d[mbmi->tx_size];
*rate = r[mbmi->tx_size][cm->tx_mode == TX_MODE_SELECT];
@@ -805,33 +852,27 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
tx_cache[ALLOW_8X8] = rd[TX_8X8][0];
tx_cache[ALLOW_16X16] = rd[MIN(max_tx_size, TX_16X16)][0];
tx_cache[ALLOW_32X32] = rd[MIN(max_tx_size, TX_32X32)][0];
- if (max_tx_size == TX_32X32 &&
- rd[TX_32X32][1] < rd[TX_16X16][1] && rd[TX_32X32][1] < rd[TX_8X8][1] &&
- rd[TX_32X32][1] < rd[TX_4X4][1])
- tx_cache[TX_MODE_SELECT] = rd[TX_32X32][1];
- else if (max_tx_size >= TX_16X16 &&
- rd[TX_16X16][1] < rd[TX_8X8][1] && rd[TX_16X16][1] < rd[TX_4X4][1])
- tx_cache[TX_MODE_SELECT] = rd[TX_16X16][1];
- else
- tx_cache[TX_MODE_SELECT] = rd[TX_4X4][1] < rd[TX_8X8][1] ?
- rd[TX_4X4][1] : rd[TX_8X8][1];
- if (max_tx_size == TX_32X32 &&
- rd[TX_32X32][1] < rd[TX_16X16][1] &&
- rd[TX_32X32][1] < rd[TX_8X8][1] &&
- rd[TX_32X32][1] < rd[TX_4X4][1]) {
+ if (max_tx_size == TX_32X32 && best_tx == TX_32X32) {
+ tx_cache[TX_MODE_SELECT] = rd[TX_32X32][1];
cpi->tx_stepdown_count[0]++;
- } else if (max_tx_size >= TX_16X16 &&
- rd[TX_16X16][1] < rd[TX_8X8][1] &&
- rd[TX_16X16][1] < rd[TX_4X4][1]) {
+ } else if (max_tx_size >= TX_16X16 && best_tx == TX_16X16) {
+ tx_cache[TX_MODE_SELECT] = rd[TX_16X16][1];
cpi->tx_stepdown_count[max_tx_size - TX_16X16]++;
} else if (rd[TX_8X8][1] < rd[TX_4X4][1]) {
+ tx_cache[TX_MODE_SELECT] = rd[TX_8X8][1];
cpi->tx_stepdown_count[max_tx_size - TX_8X8]++;
} else {
+ tx_cache[TX_MODE_SELECT] = rd[TX_4X4][1];
cpi->tx_stepdown_count[max_tx_size - TX_4X4]++;
}
}
+static int64_t scaled_rd_cost(int rdmult, int rddiv,
+ int rate, int64_t dist, double scale) {
+ return (int64_t) (RDCOST(rdmult, rddiv, rate, dist) * scale);
+}
+
static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
int (*r)[2], int *rate,
int64_t *d, int64_t *distortion,
@@ -842,19 +883,25 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
VP9_COMMON *const cm = &cpi->common;
MACROBLOCKD *const xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
- vp9_prob skip_prob = vp9_get_pred_prob_mbskip(cm, xd);
- int64_t rd[TX_SIZES][2];
+ vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
+ int64_t rd[TX_SIZES][2] = {{INT64_MAX, INT64_MAX},
+ {INT64_MAX, INT64_MAX},
+ {INT64_MAX, INT64_MAX},
+ {INT64_MAX, INT64_MAX}};
int n, m;
int s0, s1;
double scale_rd[TX_SIZES] = {1.73, 1.44, 1.20, 1.00};
- // double scale_r[TX_SIZES] = {2.82, 2.00, 1.41, 1.00};
+ const TX_SIZE max_mode_tx_size = tx_mode_to_biggest_tx_size[cm->tx_mode];
+ int64_t best_rd = INT64_MAX;
+ TX_SIZE best_tx = TX_4X4;
const vp9_prob *tx_probs = get_tx_probs2(max_tx_size, xd, &cm->fc.tx_probs);
-
- // for (n = TX_4X4; n <= max_txfm_size; n++)
- // r[n][0] = (r[n][0] * scale_r[n]);
+ assert(skip_prob > 0);
+ s0 = vp9_cost_bit(skip_prob, 0);
+ s1 = vp9_cost_bit(skip_prob, 1);
for (n = TX_4X4; n <= max_tx_size; n++) {
+ double scale = scale_rd[n];
r[n][1] = r[n][0];
for (m = 0; m <= n - (n == max_tx_size); m++) {
if (m == n)
@@ -862,62 +909,33 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
else
r[n][1] += vp9_cost_one(tx_probs[m]);
}
- }
-
- assert(skip_prob > 0);
- s0 = vp9_cost_bit(skip_prob, 0);
- s1 = vp9_cost_bit(skip_prob, 1);
-
- for (n = TX_4X4; n <= max_tx_size; n++) {
if (s[n]) {
- rd[n][0] = rd[n][1] = RDCOST(x->rdmult, x->rddiv, s1, d[n]);
+ rd[n][0] = rd[n][1] = scaled_rd_cost(x->rdmult, x->rddiv, s1, d[n],
+ scale);
} else {
- rd[n][0] = RDCOST(x->rdmult, x->rddiv, r[n][0] + s0, d[n]);
- rd[n][1] = RDCOST(x->rdmult, x->rddiv, r[n][1] + s0, d[n]);
+ rd[n][0] = scaled_rd_cost(x->rdmult, x->rddiv, r[n][0] + s0, d[n],
+ scale);
+ rd[n][1] = scaled_rd_cost(x->rdmult, x->rddiv, r[n][1] + s0, d[n],
+ scale);
+ }
+ if (rd[n][1] < best_rd) {
+ best_rd = rd[n][1];
+ best_tx = n;
}
- }
- for (n = TX_4X4; n <= max_tx_size; n++) {
- rd[n][0] = (int64_t)(scale_rd[n] * rd[n][0]);
- rd[n][1] = (int64_t)(scale_rd[n] * rd[n][1]);
}
- if (max_tx_size == TX_32X32 &&
- (cm->tx_mode == ALLOW_32X32 ||
- (cm->tx_mode == TX_MODE_SELECT &&
- rd[TX_32X32][1] <= rd[TX_16X16][1] &&
- rd[TX_32X32][1] <= rd[TX_8X8][1] &&
- rd[TX_32X32][1] <= rd[TX_4X4][1]))) {
- mbmi->tx_size = TX_32X32;
- } else if (max_tx_size >= TX_16X16 &&
- (cm->tx_mode == ALLOW_16X16 ||
- cm->tx_mode == ALLOW_32X32 ||
- (cm->tx_mode == TX_MODE_SELECT &&
- rd[TX_16X16][1] <= rd[TX_8X8][1] &&
- rd[TX_16X16][1] <= rd[TX_4X4][1]))) {
- mbmi->tx_size = TX_16X16;
- } else if (cm->tx_mode == ALLOW_8X8 ||
- cm->tx_mode == ALLOW_16X16 ||
- cm->tx_mode == ALLOW_32X32 ||
- (cm->tx_mode == TX_MODE_SELECT &&
- rd[TX_8X8][1] <= rd[TX_4X4][1])) {
- mbmi->tx_size = TX_8X8;
- } else {
- mbmi->tx_size = TX_4X4;
- }
+ mbmi->tx_size = cm->tx_mode == TX_MODE_SELECT ?
+ best_tx : MIN(max_tx_size, max_mode_tx_size);
// Actually encode using the chosen mode if a model was used, but do not
// update the r, d costs
- txfm_rd_in_plane(x, &cpi->rdcost_stack, rate, distortion, skip,
- &sse[mbmi->tx_size], ref_best_rd, 0, bs, mbmi->tx_size);
+ txfm_rd_in_plane(x, rate, distortion, skip,
+ &sse[mbmi->tx_size], ref_best_rd, 0, bs, mbmi->tx_size,
+ cpi->sf.use_fast_coef_costing);
- if (max_tx_size == TX_32X32 &&
- rd[TX_32X32][1] <= rd[TX_16X16][1] &&
- rd[TX_32X32][1] <= rd[TX_8X8][1] &&
- rd[TX_32X32][1] <= rd[TX_4X4][1]) {
+ if (max_tx_size == TX_32X32 && best_tx == TX_32X32) {
cpi->tx_stepdown_count[0]++;
- } else if (max_tx_size >= TX_16X16 &&
- rd[TX_16X16][1] <= rd[TX_8X8][1] &&
- rd[TX_16X16][1] <= rd[TX_4X4][1]) {
+ } else if (max_tx_size >= TX_16X16 && best_tx == TX_16X16) {
cpi->tx_stepdown_count[max_tx_size - TX_16X16]++;
} else if (rd[TX_8X8][1] <= rd[TX_4X4][1]) {
cpi->tx_stepdown_count[max_tx_size - TX_8X8]++;
@@ -926,25 +944,23 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
}
}
-static void super_block_yrd(VP9_COMP *cpi,
- MACROBLOCK *x, int *rate, int64_t *distortion,
- int *skip, int64_t *psse, BLOCK_SIZE bs,
- int64_t txfm_cache[TX_MODES],
- int64_t ref_best_rd) {
+static void inter_super_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate,
+ int64_t *distortion, int *skip,
+ int64_t *psse, BLOCK_SIZE bs,
+ int64_t txfm_cache[TX_MODES],
+ int64_t ref_best_rd) {
int r[TX_SIZES][2], s[TX_SIZES];
int64_t d[TX_SIZES], sse[TX_SIZES];
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
- struct rdcost_block_args *rdcost_stack = &cpi->rdcost_stack;
- const int b_inter_mode = is_inter_block(mbmi);
+ const TX_SIZE max_tx_size = max_txsize_lookup[bs];
+ TX_SIZE tx_size;
assert(bs == mbmi->sb_type);
- if (b_inter_mode)
- vp9_subtract_sby(x, bs);
- if (cpi->sf.tx_size_search_method == USE_LARGESTALL ||
- (cpi->sf.tx_size_search_method != USE_FULL_RD &&
- !b_inter_mode)) {
+ vp9_subtract_plane(x, bs, 0);
+
+ if (cpi->sf.tx_size_search_method == USE_LARGESTALL) {
vpx_memset(txfm_cache, 0, TX_MODES * sizeof(int64_t));
choose_largest_txfm_size(cpi, x, rate, distortion, skip, sse,
ref_best_rd, bs);
@@ -953,36 +969,18 @@ static void super_block_yrd(VP9_COMP *cpi,
return;
}
- if (cpi->sf.tx_size_search_method == USE_LARGESTINTRA_MODELINTER &&
- b_inter_mode) {
- if (bs >= BLOCK_32X32)
- model_rd_for_sb_y_tx(cpi, bs, TX_32X32, x, xd,
- &r[TX_32X32][0], &d[TX_32X32], &s[TX_32X32]);
- if (bs >= BLOCK_16X16)
- model_rd_for_sb_y_tx(cpi, bs, TX_16X16, x, xd,
- &r[TX_16X16][0], &d[TX_16X16], &s[TX_16X16]);
-
- model_rd_for_sb_y_tx(cpi, bs, TX_8X8, x, xd,
- &r[TX_8X8][0], &d[TX_8X8], &s[TX_8X8]);
-
- model_rd_for_sb_y_tx(cpi, bs, TX_4X4, x, xd,
- &r[TX_4X4][0], &d[TX_4X4], &s[TX_4X4]);
-
+ if (cpi->sf.tx_size_search_method == USE_LARGESTINTRA_MODELINTER) {
+ for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size)
+ model_rd_for_sb_y_tx(cpi, bs, tx_size, x, xd,
+ &r[tx_size][0], &d[tx_size], &s[tx_size]);
choose_txfm_size_from_modelrd(cpi, x, r, rate, d, distortion, s,
skip, sse, ref_best_rd, bs);
} else {
- if (bs >= BLOCK_32X32)
- txfm_rd_in_plane(x, rdcost_stack, &r[TX_32X32][0], &d[TX_32X32],
- &s[TX_32X32], &sse[TX_32X32],
- ref_best_rd, 0, bs, TX_32X32);
- if (bs >= BLOCK_16X16)
- txfm_rd_in_plane(x, rdcost_stack, &r[TX_16X16][0], &d[TX_16X16],
- &s[TX_16X16], &sse[TX_16X16],
- ref_best_rd, 0, bs, TX_16X16);
- txfm_rd_in_plane(x, rdcost_stack, &r[TX_8X8][0], &d[TX_8X8], &s[TX_8X8],
- &sse[TX_8X8], ref_best_rd, 0, bs, TX_8X8);
- txfm_rd_in_plane(x, rdcost_stack, &r[TX_4X4][0], &d[TX_4X4], &s[TX_4X4],
- &sse[TX_4X4], ref_best_rd, 0, bs, TX_4X4);
+ for (tx_size = TX_4X4; tx_size <= max_tx_size; ++tx_size)
+ txfm_rd_in_plane(x, &r[tx_size][0], &d[tx_size],
+ &s[tx_size], &sse[tx_size],
+ ref_best_rd, 0, bs, tx_size,
+ cpi->sf.use_fast_coef_costing);
choose_txfm_size_from_rd(cpi, x, r, rate, d, distortion, s,
skip, txfm_cache, bs);
}
@@ -990,6 +988,37 @@ static void super_block_yrd(VP9_COMP *cpi,
*psse = sse[mbmi->tx_size];
}
+static void intra_super_block_yrd(VP9_COMP *cpi, MACROBLOCK *x, int *rate,
+ int64_t *distortion, int *skip,
+ int64_t *psse, BLOCK_SIZE bs,
+ int64_t txfm_cache[TX_MODES],
+ int64_t ref_best_rd) {
+ int64_t sse[TX_SIZES];
+ MACROBLOCKD *xd = &x->e_mbd;
+ MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
+
+ assert(bs == mbmi->sb_type);
+ if (cpi->sf.tx_size_search_method != USE_FULL_RD) {
+ vpx_memset(txfm_cache, 0, TX_MODES * sizeof(int64_t));
+ choose_largest_txfm_size(cpi, x, rate, distortion, skip, sse,
+ ref_best_rd, bs);
+ } else {
+ int r[TX_SIZES][2], s[TX_SIZES];
+ int64_t d[TX_SIZES];
+ TX_SIZE tx_size;
+ for (tx_size = TX_4X4; tx_size <= max_txsize_lookup[bs]; ++tx_size)
+ txfm_rd_in_plane(x, &r[tx_size][0], &d[tx_size],
+ &s[tx_size], &sse[tx_size],
+ ref_best_rd, 0, bs, tx_size,
+ cpi->sf.use_fast_coef_costing);
+ choose_txfm_size_from_rd(cpi, x, r, rate, d, distortion, s,
+ skip, txfm_cache, bs);
+ }
+ if (psse)
+ *psse = sse[mbmi->tx_size];
+}
+
+
static int conditional_skipintra(MB_PREDICTION_MODE mode,
MB_PREDICTION_MODE best_intra_mode) {
if (mode == D117_PRED &&
@@ -1013,26 +1042,23 @@ static int conditional_skipintra(MB_PREDICTION_MODE mode,
static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
MB_PREDICTION_MODE *best_mode,
- int *bmode_costs,
+ const int *bmode_costs,
ENTROPY_CONTEXT *a, ENTROPY_CONTEXT *l,
int *bestrate, int *bestratey,
int64_t *bestdistortion,
BLOCK_SIZE bsize, int64_t rd_thresh) {
MB_PREDICTION_MODE mode;
- MACROBLOCKD *xd = &x->e_mbd;
+ MACROBLOCKD *const xd = &x->e_mbd;
int64_t best_rd = rd_thresh;
- int rate = 0;
- int64_t distortion;
+
struct macroblock_plane *p = &x->plane[0];
struct macroblockd_plane *pd = &xd->plane[0];
const int src_stride = p->src.stride;
const int dst_stride = pd->dst.stride;
- uint8_t *src_init = raster_block_offset_uint8(BLOCK_8X8, ib,
- p->src.buf, src_stride);
- uint8_t *dst_init = raster_block_offset_uint8(BLOCK_8X8, ib,
- pd->dst.buf, dst_stride);
- int16_t *src_diff, *coeff;
-
+ const uint8_t *src_init = &p->src.buf[raster_block_offset(BLOCK_8X8, ib,
+ src_stride)];
+ uint8_t *dst_init = &pd->dst.buf[raster_block_offset(BLOCK_8X8, ib,
+ dst_stride)];
ENTROPY_CONTEXT ta[2], tempa[2];
ENTROPY_CONTEXT tl[2], templ[2];
@@ -1050,6 +1076,8 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
int64_t this_rd;
int ratey = 0;
+ int64_t distortion = 0;
+ int rate = bmode_costs[mode];
if (!(cpi->sf.intra_y_mode_mask[TX_4X4] & (1 << mode)))
continue;
@@ -1061,56 +1089,52 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
continue;
}
- rate = bmode_costs[mode];
- distortion = 0;
-
vpx_memcpy(tempa, ta, sizeof(ta));
vpx_memcpy(templ, tl, sizeof(tl));
for (idy = 0; idy < num_4x4_blocks_high; ++idy) {
for (idx = 0; idx < num_4x4_blocks_wide; ++idx) {
- int64_t ssz;
- const int16_t *scan;
- const int16_t *nb;
- uint8_t *src = src_init + idx * 4 + idy * 4 * src_stride;
- uint8_t *dst = dst_init + idx * 4 + idy * 4 * dst_stride;
const int block = ib + idy * 2 + idx;
- TX_TYPE tx_type;
+ const uint8_t *const src = &src_init[idx * 4 + idy * 4 * src_stride];
+ uint8_t *const dst = &dst_init[idx * 4 + idy * 4 * dst_stride];
+ int16_t *const src_diff = raster_block_offset_int16(BLOCK_8X8, block,
+ p->src_diff);
+ int16_t *const coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
xd->mi_8x8[0]->bmi[block].as_mode = mode;
- src_diff = raster_block_offset_int16(BLOCK_8X8, block, p->src_diff);
- coeff = BLOCK_OFFSET(x->plane[0].coeff, block);
vp9_predict_intra_block(xd, block, 1,
TX_4X4, mode,
x->skip_encode ? src : dst,
x->skip_encode ? src_stride : dst_stride,
- dst, dst_stride);
- vp9_subtract_block(4, 4, src_diff, 8,
- src, src_stride,
- dst, dst_stride);
-
- tx_type = get_tx_type_4x4(PLANE_TYPE_Y_WITH_DC, xd, block);
- get_scan_nb_4x4(tx_type, &scan, &nb);
-
- if (tx_type != DCT_DCT)
- vp9_short_fht4x4(src_diff, coeff, 8, tx_type);
- else
- x->fwd_txm4x4(src_diff, coeff, 8);
-
- vp9_regular_quantize_b_4x4(x, 4, block, scan, get_iscan_4x4(tx_type));
-
- ratey += cost_coeffs(x, 0, block,
- tempa + idx, templ + idy, TX_4X4, scan, nb);
- distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, block),
- 16, &ssz) >> 2;
- if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
- goto next;
-
- if (tx_type != DCT_DCT)
- vp9_iht4x4_16_add(BLOCK_OFFSET(pd->dqcoeff, block),
- dst, pd->dst.stride, tx_type);
- else
- xd->itxm_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, pd->dst.stride,
- 16);
+ dst, dst_stride, idx, idy, 0);
+ vp9_subtract_block(4, 4, src_diff, 8, src, src_stride, dst, dst_stride);
+
+ if (xd->lossless) {
+ const scan_order *so = &vp9_default_scan_orders[TX_4X4];
+ vp9_fwht4x4(src_diff, coeff, 8);
+ vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan);
+ ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4,
+ so->scan, so->neighbors,
+ cpi->sf.use_fast_coef_costing);
+ if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
+ goto next;
+ vp9_iwht4x4_add(BLOCK_OFFSET(pd->dqcoeff, block), dst, dst_stride,
+ p->eobs[block]);
+ } else {
+ int64_t unused;
+ const TX_TYPE tx_type = get_tx_type_4x4(PLANE_TYPE_Y, xd, block);
+ const scan_order *so = &vp9_scan_orders[TX_4X4][tx_type];
+ vp9_fht4x4(src_diff, coeff, 8, tx_type);
+ vp9_regular_quantize_b_4x4(x, 0, block, so->scan, so->iscan);
+ ratey += cost_coeffs(x, 0, block, tempa + idx, templ + idy, TX_4X4,
+ so->scan, so->neighbors,
+ cpi->sf.use_fast_coef_costing);
+ distortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, block),
+ 16, &unused) >> 2;
+ if (RDCOST(x->rdmult, x->rddiv, ratey, distortion) >= best_rd)
+ goto next;
+ vp9_iht4x4_add(tx_type, BLOCK_OFFSET(pd->dqcoeff, block),
+ dst, dst_stride, p->eobs[block]);
+ }
}
}
@@ -1143,14 +1167,12 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
return best_rd;
}
-static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP * const cpi,
- MACROBLOCK * const mb,
- int * const rate,
- int * const rate_y,
- int64_t * const distortion,
+static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP *cpi, MACROBLOCK *mb,
+ int *rate, int *rate_y,
+ int64_t *distortion,
int64_t best_rd) {
int i, j;
- MACROBLOCKD *const xd = &mb->e_mbd;
+ const MACROBLOCKD *const xd = &mb->e_mbd;
MODE_INFO *const mic = xd->mi_8x8[0];
const MODE_INFO *above_mi = xd->mi_8x8[-xd->mode_info_stride];
const MODE_INFO *left_mi = xd->left_available ? xd->mi_8x8[-1] : NULL;
@@ -1163,13 +1185,11 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP * const cpi,
int tot_rate_y = 0;
int64_t total_rd = 0;
ENTROPY_CONTEXT t_above[4], t_left[4];
- int *bmode_costs;
+ const int *bmode_costs = mb->mbmode_cost;
vpx_memcpy(t_above, xd->plane[0].above_context, sizeof(t_above));
vpx_memcpy(t_left, xd->plane[0].left_context, sizeof(t_left));
- bmode_costs = mb->mbmode_cost;
-
// Pick modes for each sub-block (of size 4x4, 4x8, or 8x4) in an 8x8 block.
for (idy = 0; idy < 2; idy += num_4x4_blocks_high) {
for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
@@ -1178,8 +1198,8 @@ static int64_t rd_pick_intra_sub_8x8_y_mode(VP9_COMP * const cpi,
int64_t d = INT64_MAX, this_rd = INT64_MAX;
i = idy * 2 + idx;
if (cpi->common.frame_type == KEY_FRAME) {
- const MB_PREDICTION_MODE A = above_block_mode(mic, above_mi, i);
- const MB_PREDICTION_MODE L = left_block_mode(mic, left_mi, i);
+ const MB_PREDICTION_MODE A = vp9_above_block_mode(mic, above_mi, i);
+ const MB_PREDICTION_MODE L = vp9_left_block_mode(mic, left_mi, i);
bmode_costs = mb->y_mode_costs[A][L];
}
@@ -1244,15 +1264,15 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
continue;
if (cpi->common.frame_type == KEY_FRAME) {
- const MB_PREDICTION_MODE A = above_block_mode(mic, above_mi, 0);
- const MB_PREDICTION_MODE L = left_block_mode(mic, left_mi, 0);
+ const MB_PREDICTION_MODE A = vp9_above_block_mode(mic, above_mi, 0);
+ const MB_PREDICTION_MODE L = vp9_left_block_mode(mic, left_mi, 0);
bmode_costs = x->y_mode_costs[A][L];
}
mic->mbmi.mode = mode;
- super_block_yrd(cpi, x, &this_rate_tokenonly, &this_distortion, &s, NULL,
- bsize, local_tx_cache, best_rd);
+ intra_super_block_yrd(cpi, x, &this_rate_tokenonly, &this_distortion,
+ &s, NULL, bsize, local_tx_cache, best_rd);
if (this_rate_tokenonly == INT_MAX)
continue;
@@ -1287,7 +1307,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
return best_rd;
}
-static void super_block_uvrd(VP9_COMP *const cpi, MACROBLOCK *x,
+static void super_block_uvrd(const VP9_COMP *cpi, MACROBLOCK *x,
int *rate, int64_t *distortion, int *skippable,
int64_t *sse, BLOCK_SIZE bsize,
int64_t ref_best_rd) {
@@ -1301,8 +1321,11 @@ static void super_block_uvrd(VP9_COMP *const cpi, MACROBLOCK *x,
if (ref_best_rd < 0)
goto term;
- if (is_inter_block(mbmi))
- vp9_subtract_sbuv(x, bsize);
+ if (is_inter_block(mbmi)) {
+ int plane;
+ for (plane = 1; plane < MAX_MB_PLANE; ++plane)
+ vp9_subtract_plane(x, bsize, plane);
+ }
*rate = 0;
*distortion = 0;
@@ -1310,8 +1333,9 @@ static void super_block_uvrd(VP9_COMP *const cpi, MACROBLOCK *x,
*skippable = 1;
for (plane = 1; plane < MAX_MB_PLANE; ++plane) {
- txfm_rd_in_plane(x, &cpi->rdcost_stack, &pnrate, &pndist, &pnskip, &pnsse,
- ref_best_rd, plane, bsize, uv_txfm_size);
+ txfm_rd_in_plane(x, &pnrate, &pndist, &pnskip, &pnsse,
+ ref_best_rd, plane, bsize, uv_txfm_size,
+ cpi->sf.use_fast_coef_costing);
if (pnrate == INT_MAX)
goto term;
*rate += pnrate;
@@ -1333,23 +1357,19 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
PICK_MODE_CONTEXT *ctx,
int *rate, int *rate_tokenonly,
int64_t *distortion, int *skippable,
- BLOCK_SIZE bsize) {
+ BLOCK_SIZE bsize, TX_SIZE max_tx_size) {
+ MACROBLOCKD *xd = &x->e_mbd;
MB_PREDICTION_MODE mode;
MB_PREDICTION_MODE mode_selected = DC_PRED;
int64_t best_rd = INT64_MAX, this_rd;
int this_rate_tokenonly, this_rate, s;
int64_t this_distortion, this_sse;
- // int mode_mask = (bsize <= BLOCK_8X8)
- // ? ALL_INTRA_MODES : cpi->sf.intra_uv_mode_mask;
-
- for (mode = DC_PRED; mode <= TM_PRED; mode ++) {
- // if (!(mode_mask & (1 << mode)))
- if (!(cpi->sf.intra_uv_mode_mask[max_uv_txsize_lookup[bsize]]
- & (1 << mode)))
+ for (mode = DC_PRED; mode <= TM_PRED; ++mode) {
+ if (!(cpi->sf.intra_uv_mode_mask[max_tx_size] & (1 << mode)))
continue;
- x->e_mbd.mi_8x8[0]->mbmi.uv_mode = mode;
+ xd->mi_8x8[0]->mbmi.uv_mode = mode;
super_block_uvrd(cpi, x, &this_rate_tokenonly,
&this_distortion, &s, &this_sse, bsize, best_rd);
@@ -1369,12 +1389,12 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (!x->select_txfm_size) {
int i;
struct macroblock_plane *const p = x->plane;
- struct macroblockd_plane *const pd = x->e_mbd.plane;
+ struct macroblockd_plane *const pd = xd->plane;
for (i = 1; i < MAX_MB_PLANE; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][2];
- pd[i].qcoeff = ctx->qcoeff_pbuf[i][2];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][2];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][2];
- pd[i].eobs = ctx->eobs_pbuf[i][2];
+ p[i].eobs = ctx->eobs_pbuf[i][2];
ctx->coeff_pbuf[i][2] = ctx->coeff_pbuf[i][0];
ctx->qcoeff_pbuf[i][2] = ctx->qcoeff_pbuf[i][0];
@@ -1382,39 +1402,35 @@ static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,
ctx->eobs_pbuf[i][2] = ctx->eobs_pbuf[i][0];
ctx->coeff_pbuf[i][0] = p[i].coeff;
- ctx->qcoeff_pbuf[i][0] = pd[i].qcoeff;
+ ctx->qcoeff_pbuf[i][0] = p[i].qcoeff;
ctx->dqcoeff_pbuf[i][0] = pd[i].dqcoeff;
- ctx->eobs_pbuf[i][0] = pd[i].eobs;
+ ctx->eobs_pbuf[i][0] = p[i].eobs;
}
}
}
}
- x->e_mbd.mi_8x8[0]->mbmi.uv_mode = mode_selected;
-
+ xd->mi_8x8[0]->mbmi.uv_mode = mode_selected;
return best_rd;
}
-static int64_t rd_sbuv_dcpred(VP9_COMP *cpi, MACROBLOCK *x,
+static int64_t rd_sbuv_dcpred(const VP9_COMP *cpi, MACROBLOCK *x,
int *rate, int *rate_tokenonly,
int64_t *distortion, int *skippable,
BLOCK_SIZE bsize) {
- int64_t this_rd;
- int64_t this_sse;
+ const VP9_COMMON *cm = &cpi->common;
+ int64_t unused;
x->e_mbd.mi_8x8[0]->mbmi.uv_mode = DC_PRED;
super_block_uvrd(cpi, x, rate_tokenonly, distortion,
- skippable, &this_sse, bsize, INT64_MAX);
- *rate = *rate_tokenonly +
- x->intra_uv_mode_cost[cpi->common.frame_type][DC_PRED];
- this_rd = RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
-
- return this_rd;
+ skippable, &unused, bsize, INT64_MAX);
+ *rate = *rate_tokenonly + x->intra_uv_mode_cost[cm->frame_type][DC_PRED];
+ return RDCOST(x->rdmult, x->rddiv, *rate, *distortion);
}
static void choose_intra_uv_mode(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
- BLOCK_SIZE bsize, int *rate_uv,
- int *rate_uv_tokenonly,
+ BLOCK_SIZE bsize, TX_SIZE max_tx_size,
+ int *rate_uv, int *rate_uv_tokenonly,
int64_t *dist_uv, int *skip_uv,
MB_PREDICTION_MODE *mode_uv) {
MACROBLOCK *const x = &cpi->mb;
@@ -1422,14 +1438,14 @@ static void choose_intra_uv_mode(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
// Use an estimated rd for uv_intra based on DC_PRED if the
// appropriate speed flag is set.
if (cpi->sf.use_uv_intra_rd_estimate) {
- rd_sbuv_dcpred(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv, skip_uv,
- bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize);
+ rd_sbuv_dcpred(cpi, x, rate_uv, rate_uv_tokenonly, dist_uv,
+ skip_uv, bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize);
// Else do a proper rd search for each possible transform size that may
// be considered in the main rd loop.
} else {
rd_pick_intra_sbuv_mode(cpi, x, ctx,
rate_uv, rate_uv_tokenonly, dist_uv, skip_uv,
- bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize);
+ bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize, max_tx_size);
}
*mode_uv = x->e_mbd.mi_8x8[0]->mbmi.uv_mode;
}
@@ -1437,8 +1453,7 @@ static void choose_intra_uv_mode(VP9_COMP *cpi, PICK_MODE_CONTEXT *ctx,
static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
int mode_context) {
MACROBLOCK *const x = &cpi->mb;
- MACROBLOCKD *const xd = &x->e_mbd;
- const int segment_id = xd->mi_8x8[0]->mbmi.segment_id;
+ const int segment_id = x->e_mbd.mi_8x8[0]->mbmi.segment_id;
// Don't account for mode here if segment skip is enabled.
if (!vp9_segfeature_active(&cpi->common.seg, segment_id, SEG_LVL_SKIP)) {
@@ -1449,11 +1464,6 @@ static int cost_mv_ref(VP9_COMP *cpi, MB_PREDICTION_MODE mode,
}
}
-void vp9_set_mbmode_and_mvs(MACROBLOCK *x, MB_PREDICTION_MODE mb, int_mv *mv) {
- x->e_mbd.mi_8x8[0]->mbmi.mode = mb;
- x->e_mbd.mi_8x8[0]->mbmi.mv[0].as_int = mv->as_int;
-}
-
static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bsize,
int_mv *frame_mv,
@@ -1461,79 +1471,66 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
int_mv single_newmv[MAX_REF_FRAMES],
int *rate_mv);
-static int labels2mode(MACROBLOCK *x, int i,
- MB_PREDICTION_MODE this_mode,
- int_mv *this_mv, int_mv *this_second_mv,
+static int labels2mode(VP9_COMP *cpi, MACROBLOCKD *xd, int i,
+ MB_PREDICTION_MODE mode,
+ int_mv this_mv[2],
int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES],
int_mv seg_mvs[MAX_REF_FRAMES],
- int_mv *best_ref_mv,
- int_mv *second_best_ref_mv,
- int *mvjcost, int *mvcost[2], VP9_COMP *cpi) {
- MACROBLOCKD *const xd = &x->e_mbd;
+ int_mv *best_ref_mv[2],
+ const int *mvjcost, int *mvcost[2]) {
MODE_INFO *const mic = xd->mi_8x8[0];
- MB_MODE_INFO *mbmi = &mic->mbmi;
- int cost = 0, thismvcost = 0;
+ const MB_MODE_INFO *const mbmi = &mic->mbmi;
+ int thismvcost = 0;
int idx, idy;
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[mbmi->sb_type];
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[mbmi->sb_type];
- const int has_second_rf = has_second_ref(mbmi);
-
- /* We have to be careful retrieving previously-encoded motion vectors.
- Ones from this macroblock have to be pulled from the BLOCKD array
- as they have not yet made it to the bmi array in our MB_MODE_INFO. */
- MB_PREDICTION_MODE m;
+ const int is_compound = has_second_ref(mbmi);
// the only time we should do costing for new motion vector or mode
// is when we are on a new label (jbb May 08, 2007)
- switch (m = this_mode) {
+ switch (mode) {
case NEWMV:
- this_mv->as_int = seg_mvs[mbmi->ref_frame[0]].as_int;
- thismvcost = vp9_mv_bit_cost(&this_mv->as_mv, &best_ref_mv->as_mv,
+ this_mv[0].as_int = seg_mvs[mbmi->ref_frame[0]].as_int;
+ thismvcost += vp9_mv_bit_cost(&this_mv[0].as_mv, &best_ref_mv[0]->as_mv,
mvjcost, mvcost, MV_COST_WEIGHT_SUB);
- if (has_second_rf) {
- this_second_mv->as_int = seg_mvs[mbmi->ref_frame[1]].as_int;
- thismvcost += vp9_mv_bit_cost(&this_second_mv->as_mv,
- &second_best_ref_mv->as_mv,
+ if (is_compound) {
+ this_mv[1].as_int = seg_mvs[mbmi->ref_frame[1]].as_int;
+ thismvcost += vp9_mv_bit_cost(&this_mv[1].as_mv, &best_ref_mv[1]->as_mv,
mvjcost, mvcost, MV_COST_WEIGHT_SUB);
}
break;
case NEARESTMV:
- this_mv->as_int = frame_mv[NEARESTMV][mbmi->ref_frame[0]].as_int;
- if (has_second_rf)
- this_second_mv->as_int =
- frame_mv[NEARESTMV][mbmi->ref_frame[1]].as_int;
+ this_mv[0].as_int = frame_mv[NEARESTMV][mbmi->ref_frame[0]].as_int;
+ if (is_compound)
+ this_mv[1].as_int = frame_mv[NEARESTMV][mbmi->ref_frame[1]].as_int;
break;
case NEARMV:
- this_mv->as_int = frame_mv[NEARMV][mbmi->ref_frame[0]].as_int;
- if (has_second_rf)
- this_second_mv->as_int =
- frame_mv[NEARMV][mbmi->ref_frame[1]].as_int;
+ this_mv[0].as_int = frame_mv[NEARMV][mbmi->ref_frame[0]].as_int;
+ if (is_compound)
+ this_mv[1].as_int = frame_mv[NEARMV][mbmi->ref_frame[1]].as_int;
break;
case ZEROMV:
- this_mv->as_int = 0;
- if (has_second_rf)
- this_second_mv->as_int = 0;
+ this_mv[0].as_int = 0;
+ if (is_compound)
+ this_mv[1].as_int = 0;
break;
default:
break;
}
- cost = cost_mv_ref(cpi, this_mode,
- mbmi->mode_context[mbmi->ref_frame[0]]);
-
- mic->bmi[i].as_mv[0].as_int = this_mv->as_int;
- if (has_second_rf)
- mic->bmi[i].as_mv[1].as_int = this_second_mv->as_int;
+ mic->bmi[i].as_mv[0].as_int = this_mv[0].as_int;
+ if (is_compound)
+ mic->bmi[i].as_mv[1].as_int = this_mv[1].as_int;
- mic->bmi[i].as_mode = m;
+ mic->bmi[i].as_mode = mode;
for (idy = 0; idy < num_4x4_blocks_high; ++idy)
for (idx = 0; idx < num_4x4_blocks_wide; ++idx)
vpx_memcpy(&mic->bmi[i + idy * 2 + idx],
&mic->bmi[i], sizeof(mic->bmi[i]));
- cost += thismvcost;
- return cost;
+ return cost_mv_ref(cpi, mode, mbmi->mode_context[mbmi->ref_frame[0]]) +
+ thismvcost;
}
static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
@@ -1543,32 +1540,36 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
int *labelyrate,
int64_t *distortion, int64_t *sse,
ENTROPY_CONTEXT *ta,
- ENTROPY_CONTEXT *tl) {
+ ENTROPY_CONTEXT *tl,
+ int mi_row, int mi_col) {
int k;
MACROBLOCKD *xd = &x->e_mbd;
struct macroblockd_plane *const pd = &xd->plane[0];
struct macroblock_plane *const p = &x->plane[0];
MODE_INFO *const mi = xd->mi_8x8[0];
- const BLOCK_SIZE bsize = mi->mbmi.sb_type;
- const int width = plane_block_width(bsize, pd);
- const int height = plane_block_height(bsize, pd);
+ const BLOCK_SIZE plane_bsize = get_plane_block_size(mi->mbmi.sb_type, pd);
+ const int width = 4 * num_4x4_blocks_wide_lookup[plane_bsize];
+ const int height = 4 * num_4x4_blocks_high_lookup[plane_bsize];
int idx, idy;
- uint8_t *const src = raster_block_offset_uint8(BLOCK_8X8, i,
- p->src.buf, p->src.stride);
- uint8_t *const dst = raster_block_offset_uint8(BLOCK_8X8, i,
- pd->dst.buf, pd->dst.stride);
+ const uint8_t *const src = &p->src.buf[raster_block_offset(BLOCK_8X8, i,
+ p->src.stride)];
+ uint8_t *const dst = &pd->dst.buf[raster_block_offset(BLOCK_8X8, i,
+ pd->dst.stride)];
int64_t thisdistortion = 0, thissse = 0;
int thisrate = 0, ref;
+ const scan_order *so = &vp9_default_scan_orders[TX_4X4];
const int is_compound = has_second_ref(&mi->mbmi);
for (ref = 0; ref < 1 + is_compound; ++ref) {
- const uint8_t *pre = raster_block_offset_uint8(BLOCK_8X8, i,
- pd->pre[ref].buf, pd->pre[ref].stride);
+ const uint8_t *pre = &pd->pre[ref].buf[raster_block_offset(BLOCK_8X8, i,
+ pd->pre[ref].stride)];
vp9_build_inter_predictor(pre, pd->pre[ref].stride,
dst, pd->dst.stride,
&mi->bmi[i].as_mv[ref].as_mv,
- &xd->scale_factor[ref],
- width, height, ref, &xd->subpix, MV_PRECISION_Q3);
+ &xd->block_refs[ref]->sf, width, height, ref,
+ xd->interp_kernel, MV_PRECISION_Q3,
+ mi_col * MI_SIZE + 4 * (i % 2),
+ mi_row * MI_SIZE + 4 * (i / 2));
}
vp9_subtract_block(height, width,
@@ -1586,16 +1587,13 @@ static int64_t encode_inter_mb_segment(VP9_COMP *cpi,
coeff = BLOCK_OFFSET(p->coeff, k);
x->fwd_txm4x4(raster_block_offset_int16(BLOCK_8X8, k, p->src_diff),
coeff, 8);
- vp9_regular_quantize_b_4x4(x, 4, k, get_scan_4x4(DCT_DCT),
- get_iscan_4x4(DCT_DCT));
+ vp9_regular_quantize_b_4x4(x, 0, k, so->scan, so->iscan);
thisdistortion += vp9_block_error(coeff, BLOCK_OFFSET(pd->dqcoeff, k),
16, &ssz);
thissse += ssz;
- thisrate += cost_coeffs(x, 0, k,
- ta + (k & 1),
- tl + (k >> 1), TX_4X4,
- vp9_default_scan_4x4,
- vp9_default_scan_4x4_neighbors);
+ thisrate += cost_coeffs(x, 0, k, ta + (k & 1), tl + (k >> 1), TX_4X4,
+ so->scan, so->neighbors,
+ cpi->sf.use_fast_coef_costing);
rd1 = RDCOST(x->rdmult, x->rddiv, thisrate, thisdistortion >> 2);
rd2 = RDCOST(x->rdmult, x->rddiv, 0, thissse >> 2);
rd = MIN(rd1, rd2);
@@ -1624,7 +1622,7 @@ typedef struct {
} SEG_RDSTAT;
typedef struct {
- int_mv *ref_mv, *second_ref_mv;
+ int_mv *ref_mv[2];
int_mv mvp;
int64_t segment_rd;
@@ -1637,13 +1635,11 @@ typedef struct {
int mvthresh;
} BEST_SEG_INFO;
-static INLINE int mv_check_bounds(MACROBLOCK *x, int_mv *mv) {
- int r = 0;
- r |= (mv->as_mv.row >> 3) < x->mv_row_min;
- r |= (mv->as_mv.row >> 3) > x->mv_row_max;
- r |= (mv->as_mv.col >> 3) < x->mv_col_min;
- r |= (mv->as_mv.col >> 3) > x->mv_col_max;
- return r;
+static INLINE int mv_check_bounds(const MACROBLOCK *x, const MV *mv) {
+ return (mv->row >> 3) < x->mv_row_min ||
+ (mv->row >> 3) > x->mv_row_max ||
+ (mv->col >> 3) < x->mv_col_min ||
+ (mv->col >> 3) > x->mv_col_max;
}
static INLINE void mi_buf_shift(MACROBLOCK *x, int i) {
@@ -1651,14 +1647,13 @@ static INLINE void mi_buf_shift(MACROBLOCK *x, int i) {
struct macroblock_plane *const p = &x->plane[0];
struct macroblockd_plane *const pd = &x->e_mbd.plane[0];
- p->src.buf = raster_block_offset_uint8(BLOCK_8X8, i, p->src.buf,
- p->src.stride);
+ p->src.buf = &p->src.buf[raster_block_offset(BLOCK_8X8, i, p->src.stride)];
assert(((intptr_t)pd->pre[0].buf & 0x7) == 0);
- pd->pre[0].buf = raster_block_offset_uint8(BLOCK_8X8, i, pd->pre[0].buf,
- pd->pre[0].stride);
+ pd->pre[0].buf = &pd->pre[0].buf[raster_block_offset(BLOCK_8X8, i,
+ pd->pre[0].stride)];
if (has_second_ref(mbmi))
- pd->pre[1].buf = raster_block_offset_uint8(BLOCK_8X8, i, pd->pre[1].buf,
- pd->pre[1].stride);
+ pd->pre[1].buf = &pd->pre[1].buf[raster_block_offset(BLOCK_8X8, i,
+ pd->pre[1].stride)];
}
static INLINE void mi_buf_restore(MACROBLOCK *x, struct buf_2d orig_src,
@@ -1670,17 +1665,24 @@ static INLINE void mi_buf_restore(MACROBLOCK *x, struct buf_2d orig_src,
x->e_mbd.plane[0].pre[1] = orig_pre[1];
}
+static INLINE int mv_has_subpel(const MV *mv) {
+ return (mv->row & 0x0F) || (mv->col & 0x0F);
+}
+
static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
const TileInfo *const tile,
BEST_SEG_INFO *bsi_buf, int filter_idx,
int_mv seg_mvs[4][MAX_REF_FRAMES],
int mi_row, int mi_col) {
- int i, br = 0, idx, idy;
+ int k, br = 0, idx, idy;
int64_t bd = 0, block_sse = 0;
MB_PREDICTION_MODE this_mode;
- MODE_INFO *mi = x->e_mbd.mi_8x8[0];
+ MACROBLOCKD *xd = &x->e_mbd;
+ VP9_COMMON *cm = &cpi->common;
+ MODE_INFO *mi = xd->mi_8x8[0];
MB_MODE_INFO *const mbmi = &mi->mbmi;
- struct macroblockd_plane *const pd = &x->e_mbd.plane[0];
+ struct macroblock_plane *const p = &x->plane[0];
+ struct macroblockd_plane *const pd = &xd->plane[0];
const int label_count = 4;
int64_t this_segment_rd = 0;
int label_mv_thresh;
@@ -1688,18 +1690,17 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
const BLOCK_SIZE bsize = mbmi->sb_type;
const int num_4x4_blocks_wide = num_4x4_blocks_wide_lookup[bsize];
const int num_4x4_blocks_high = num_4x4_blocks_high_lookup[bsize];
- vp9_variance_fn_ptr_t *v_fn_ptr;
+ vp9_variance_fn_ptr_t *v_fn_ptr = &cpi->fn_ptr[bsize];
ENTROPY_CONTEXT t_above[2], t_left[2];
BEST_SEG_INFO *bsi = bsi_buf + filter_idx;
int mode_idx;
int subpelmv = 1, have_ref = 0;
const int has_second_rf = has_second_ref(mbmi);
+ const int disable_inter_mode_mask = cpi->sf.disable_inter_mode_mask[bsize];
vpx_memcpy(t_above, pd->above_context, sizeof(t_above));
vpx_memcpy(t_left, pd->left_context, sizeof(t_left));
- v_fn_ptr = &cpi->fn_ptr[bsize];
-
// 64 makes this threshold really big effectively
// making it so that we very rarely check mvs on
// segments. setting this to 1 would make mv thresh
@@ -1711,24 +1712,21 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
for (idx = 0; idx < 2; idx += num_4x4_blocks_wide) {
// TODO(jingning,rbultje): rewrite the rate-distortion optimization
// loop for 4x4/4x8/8x4 block coding. to be replaced with new rd loop
- int_mv mode_mv[MB_MODE_COUNT], second_mode_mv[MB_MODE_COUNT];
+ int_mv mode_mv[MB_MODE_COUNT][2];
int_mv frame_mv[MB_MODE_COUNT][MAX_REF_FRAMES];
MB_PREDICTION_MODE mode_selected = ZEROMV;
int64_t best_rd = INT64_MAX;
- i = idy * 2 + idx;
-
- frame_mv[ZEROMV][mbmi->ref_frame[0]].as_int = 0;
- vp9_append_sub8x8_mvs_for_idx(&cpi->common, &x->e_mbd, tile,
- &frame_mv[NEARESTMV][mbmi->ref_frame[0]],
- &frame_mv[NEARMV][mbmi->ref_frame[0]],
- i, 0, mi_row, mi_col);
- if (has_second_rf) {
- frame_mv[ZEROMV][mbmi->ref_frame[1]].as_int = 0;
- vp9_append_sub8x8_mvs_for_idx(&cpi->common, &x->e_mbd, tile,
- &frame_mv[NEARESTMV][mbmi->ref_frame[1]],
- &frame_mv[NEARMV][mbmi->ref_frame[1]],
- i, 1, mi_row, mi_col);
+ const int i = idy * 2 + idx;
+ int ref;
+
+ for (ref = 0; ref < 1 + has_second_rf; ++ref) {
+ const MV_REFERENCE_FRAME frame = mbmi->ref_frame[ref];
+ frame_mv[ZEROMV][frame].as_int = 0;
+ vp9_append_sub8x8_mvs_for_idx(cm, xd, tile, i, ref, mi_row, mi_col,
+ &frame_mv[NEARESTMV][frame],
+ &frame_mv[NEARMV][frame]);
}
+
// search for the best motion vector on this segment
for (this_mode = NEARESTMV; this_mode <= NEWMV; ++this_mode) {
const struct buf_2d orig_src = x->plane[0].src;
@@ -1736,9 +1734,12 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
mode_idx = INTER_OFFSET(this_mode);
bsi->rdstat[i][mode_idx].brdcost = INT64_MAX;
+ if (disable_inter_mode_mask & (1 << mode_idx))
+ continue;
// if we're near/nearest and mv == 0,0, compare to zeromv
- if ((this_mode == NEARMV || this_mode == NEARESTMV ||
+ if (!(disable_inter_mode_mask & (1 << INTER_OFFSET(ZEROMV))) &&
+ (this_mode == NEARMV || this_mode == NEARESTMV ||
this_mode == ZEROMV) &&
frame_mv[this_mode][mbmi->ref_frame[0]].as_int == 0 &&
(!has_second_rf ||
@@ -1783,11 +1784,12 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
// motion search for newmv (single predictor case only)
if (!has_second_rf && this_mode == NEWMV &&
seg_mvs[i][mbmi->ref_frame[0]].as_int == INVALID_MV) {
+ int_mv *const new_mv = &mode_mv[NEWMV][0];
int step_param = 0;
int further_steps;
int thissme, bestsme = INT_MAX;
int sadpb = x->sadperbit4;
- int_mv mvp_full;
+ MV mvp_full;
int max_mv;
/* Is the best so far sufficiently good that we cant justify doing
@@ -1795,7 +1797,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
if (best_rd < label_mv_thresh)
break;
- if (cpi->compressor_speed) {
+ if (cpi->oxcf.mode != MODE_SECONDPASS_BEST &&
+ cpi->oxcf.mode != MODE_BESTQUALITY) {
// use previous block's result as next block's MV predictor.
if (i > 0) {
bsi->mvp.as_int = mi->bmi[i - 1].as_mv[0].as_int;
@@ -1808,7 +1811,7 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
else
max_mv = MAX(abs(bsi->mvp.as_mv.row), abs(bsi->mvp.as_mv.col)) >> 3;
- if (cpi->sf.auto_mv_step_size && cpi->common.show_frame) {
+ if (cpi->sf.auto_mv_step_size && cm->show_frame) {
// Take wtd average of the step_params based on the last frame's
// max mv magnitude and the best ref mvs of the current block for
// the given reference.
@@ -1818,81 +1821,99 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
step_param = cpi->mv_step_param;
}
- mvp_full.as_mv.row = bsi->mvp.as_mv.row >> 3;
- mvp_full.as_mv.col = bsi->mvp.as_mv.col >> 3;
+ mvp_full.row = bsi->mvp.as_mv.row >> 3;
+ mvp_full.col = bsi->mvp.as_mv.col >> 3;
- if (cpi->sf.adaptive_motion_search && cpi->common.show_frame) {
- mvp_full.as_mv.row = x->pred_mv[mbmi->ref_frame[0]].as_mv.row >> 3;
- mvp_full.as_mv.col = x->pred_mv[mbmi->ref_frame[0]].as_mv.col >> 3;
+ if (cpi->sf.adaptive_motion_search && cm->show_frame) {
+ mvp_full.row = x->pred_mv[mbmi->ref_frame[0]].as_mv.row >> 3;
+ mvp_full.col = x->pred_mv[mbmi->ref_frame[0]].as_mv.col >> 3;
step_param = MAX(step_param, 8);
}
further_steps = (MAX_MVSEARCH_STEPS - 1) - step_param;
// adjust src pointer for this block
mi_buf_shift(x, i);
+
+ vp9_set_mv_search_range(x, &bsi->ref_mv[0]->as_mv);
+
if (cpi->sf.search_method == HEX) {
- bestsme = vp9_hex_search(x, &mvp_full.as_mv,
+ bestsme = vp9_hex_search(x, &mvp_full,
step_param,
sadpb, 1, v_fn_ptr, 1,
- &bsi->ref_mv->as_mv,
- &mode_mv[NEWMV].as_mv);
+ &bsi->ref_mv[0]->as_mv,
+ &new_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &new_mv->as_mv,
+ &bsi->ref_mv[0]->as_mv,
+ v_fn_ptr, 1);
} else if (cpi->sf.search_method == SQUARE) {
- bestsme = vp9_square_search(x, &mvp_full.as_mv,
+ bestsme = vp9_square_search(x, &mvp_full,
step_param,
sadpb, 1, v_fn_ptr, 1,
- &bsi->ref_mv->as_mv,
- &mode_mv[NEWMV].as_mv);
+ &bsi->ref_mv[0]->as_mv,
+ &new_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &new_mv->as_mv,
+ &bsi->ref_mv[0]->as_mv,
+ v_fn_ptr, 1);
} else if (cpi->sf.search_method == BIGDIA) {
- bestsme = vp9_bigdia_search(x, &mvp_full.as_mv,
+ bestsme = vp9_bigdia_search(x, &mvp_full,
step_param,
sadpb, 1, v_fn_ptr, 1,
- &bsi->ref_mv->as_mv,
- &mode_mv[NEWMV].as_mv);
+ &bsi->ref_mv[0]->as_mv,
+ &new_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &new_mv->as_mv,
+ &bsi->ref_mv[0]->as_mv,
+ v_fn_ptr, 1);
} else {
bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
sadpb, further_steps, 0, v_fn_ptr,
- bsi->ref_mv, &mode_mv[NEWMV]);
+ &bsi->ref_mv[0]->as_mv,
+ &new_mv->as_mv);
}
// Should we do a full search (best quality only)
- if (cpi->compressor_speed == 0) {
+ if (cpi->oxcf.mode == MODE_BESTQUALITY ||
+ cpi->oxcf.mode == MODE_SECONDPASS_BEST) {
+ int_mv *const best_mv = &mi->bmi[i].as_mv[0];
/* Check if mvp_full is within the range. */
- clamp_mv(&mvp_full.as_mv, x->mv_col_min, x->mv_col_max,
+ clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max,
x->mv_row_min, x->mv_row_max);
-
thissme = cpi->full_search_sad(x, &mvp_full,
sadpb, 16, v_fn_ptr,
x->nmvjointcost, x->mvcost,
- bsi->ref_mv, i);
-
+ &bsi->ref_mv[0]->as_mv,
+ &best_mv->as_mv);
if (thissme < bestsme) {
bestsme = thissme;
- mode_mv[NEWMV].as_int = mi->bmi[i].as_mv[0].as_int;
+ new_mv->as_int = best_mv->as_int;
} else {
- /* The full search result is actually worse so re-instate the
- * previous best vector */
- mi->bmi[i].as_mv[0].as_int = mode_mv[NEWMV].as_int;
+ // The full search result is actually worse so re-instate the
+ // previous best vector
+ best_mv->as_int = new_mv->as_int;
}
}
if (bestsme < INT_MAX) {
int distortion;
- unsigned int sse;
cpi->find_fractional_mv_step(x,
- &mode_mv[NEWMV].as_mv,
- &bsi->ref_mv->as_mv,
- cpi->common.allow_high_precision_mv,
+ &new_mv->as_mv,
+ &bsi->ref_mv[0]->as_mv,
+ cm->allow_high_precision_mv,
x->errorperbit, v_fn_ptr,
- 0, cpi->sf.subpel_iters_per_step,
+ cpi->sf.subpel_force_stop,
+ cpi->sf.subpel_iters_per_step,
x->nmvjointcost, x->mvcost,
- &distortion, &sse);
+ &distortion,
+ &x->pred_sse[mbmi->ref_frame[0]]);
// save motion search result for use in compound prediction
- seg_mvs[i][mbmi->ref_frame[0]].as_int = mode_mv[NEWMV].as_int;
+ seg_mvs[i][mbmi->ref_frame[0]].as_int = new_mv->as_int;
}
if (cpi->sf.adaptive_motion_search)
- x->pred_mv[mbmi->ref_frame[0]].as_int = mode_mv[NEWMV].as_int;
+ x->pred_mv[mbmi->ref_frame[0]].as_int = new_mv->as_int;
// restore src pointers
mi_buf_restore(x, orig_src, orig_pre);
@@ -1923,58 +1944,43 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
}
bsi->rdstat[i][mode_idx].brate =
- labels2mode(x, i, this_mode, &mode_mv[this_mode],
- &second_mode_mv[this_mode], frame_mv, seg_mvs[i],
- bsi->ref_mv, bsi->second_ref_mv, x->nmvjointcost,
- x->mvcost, cpi);
-
-
- bsi->rdstat[i][mode_idx].mvs[0].as_int = mode_mv[this_mode].as_int;
- if (num_4x4_blocks_wide > 1)
- bsi->rdstat[i + 1][mode_idx].mvs[0].as_int =
- mode_mv[this_mode].as_int;
- if (num_4x4_blocks_high > 1)
- bsi->rdstat[i + 2][mode_idx].mvs[0].as_int =
- mode_mv[this_mode].as_int;
- if (has_second_rf) {
- bsi->rdstat[i][mode_idx].mvs[1].as_int =
- second_mode_mv[this_mode].as_int;
+ labels2mode(cpi, xd, i, this_mode, mode_mv[this_mode], frame_mv,
+ seg_mvs[i], bsi->ref_mv, x->nmvjointcost, x->mvcost);
+
+ for (ref = 0; ref < 1 + has_second_rf; ++ref) {
+ bsi->rdstat[i][mode_idx].mvs[ref].as_int =
+ mode_mv[this_mode][ref].as_int;
if (num_4x4_blocks_wide > 1)
- bsi->rdstat[i + 1][mode_idx].mvs[1].as_int =
- second_mode_mv[this_mode].as_int;
+ bsi->rdstat[i + 1][mode_idx].mvs[ref].as_int =
+ mode_mv[this_mode][ref].as_int;
if (num_4x4_blocks_high > 1)
- bsi->rdstat[i + 2][mode_idx].mvs[1].as_int =
- second_mode_mv[this_mode].as_int;
+ bsi->rdstat[i + 2][mode_idx].mvs[ref].as_int =
+ mode_mv[this_mode][ref].as_int;
}
// Trap vectors that reach beyond the UMV borders
- if (mv_check_bounds(x, &mode_mv[this_mode]))
- continue;
- if (has_second_rf &&
- mv_check_bounds(x, &second_mode_mv[this_mode]))
+ if (mv_check_bounds(x, &mode_mv[this_mode][0].as_mv) ||
+ (has_second_rf &&
+ mv_check_bounds(x, &mode_mv[this_mode][1].as_mv)))
continue;
if (filter_idx > 0) {
BEST_SEG_INFO *ref_bsi = bsi_buf;
- subpelmv = (mode_mv[this_mode].as_mv.row & 0x0f) ||
- (mode_mv[this_mode].as_mv.col & 0x0f);
- have_ref = mode_mv[this_mode].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[0].as_int;
- if (has_second_rf) {
- subpelmv |= (second_mode_mv[this_mode].as_mv.row & 0x0f) ||
- (second_mode_mv[this_mode].as_mv.col & 0x0f);
- have_ref &= second_mode_mv[this_mode].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[1].as_int;
+ subpelmv = 0;
+ have_ref = 1;
+
+ for (ref = 0; ref < 1 + has_second_rf; ++ref) {
+ subpelmv |= mv_has_subpel(&mode_mv[this_mode][ref].as_mv);
+ have_ref &= mode_mv[this_mode][ref].as_int ==
+ ref_bsi->rdstat[i][mode_idx].mvs[ref].as_int;
}
if (filter_idx > 1 && !subpelmv && !have_ref) {
ref_bsi = bsi_buf + 1;
- have_ref = mode_mv[this_mode].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[0].as_int;
- if (has_second_rf) {
- have_ref &= second_mode_mv[this_mode].as_int ==
- ref_bsi->rdstat[i][mode_idx].mvs[1].as_int;
- }
+ have_ref = 1;
+ for (ref = 0; ref < 1 + has_second_rf; ++ref)
+ have_ref &= mode_mv[this_mode][ref].as_int ==
+ ref_bsi->rdstat[i][mode_idx].mvs[ref].as_int;
}
if (!subpelmv && have_ref &&
@@ -2003,16 +2009,17 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
&bsi->rdstat[i][mode_idx].bdist,
&bsi->rdstat[i][mode_idx].bsse,
bsi->rdstat[i][mode_idx].ta,
- bsi->rdstat[i][mode_idx].tl);
+ bsi->rdstat[i][mode_idx].tl,
+ mi_row, mi_col);
if (bsi->rdstat[i][mode_idx].brdcost < INT64_MAX) {
bsi->rdstat[i][mode_idx].brdcost += RDCOST(x->rdmult, x->rddiv,
bsi->rdstat[i][mode_idx].brate, 0);
bsi->rdstat[i][mode_idx].brate += bsi->rdstat[i][mode_idx].byrate;
- bsi->rdstat[i][mode_idx].eobs = pd->eobs[i];
+ bsi->rdstat[i][mode_idx].eobs = p->eobs[i];
if (num_4x4_blocks_wide > 1)
- bsi->rdstat[i + 1][mode_idx].eobs = pd->eobs[i + 1];
+ bsi->rdstat[i + 1][mode_idx].eobs = p->eobs[i + 1];
if (num_4x4_blocks_high > 1)
- bsi->rdstat[i + 2][mode_idx].eobs = pd->eobs[i + 2];
+ bsi->rdstat[i + 2][mode_idx].eobs = p->eobs[i + 2];
}
if (bsi->rdstat[i][mode_idx].brdcost < best_rd) {
@@ -2034,10 +2041,9 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
vpx_memcpy(t_above, bsi->rdstat[i][mode_idx].ta, sizeof(t_above));
vpx_memcpy(t_left, bsi->rdstat[i][mode_idx].tl, sizeof(t_left));
- labels2mode(x, i, mode_selected, &mode_mv[mode_selected],
- &second_mode_mv[mode_selected], frame_mv, seg_mvs[i],
- bsi->ref_mv, bsi->second_ref_mv, x->nmvjointcost,
- x->mvcost, cpi);
+ labels2mode(cpi, xd, i, mode_selected, mode_mv[mode_selected],
+ frame_mv, seg_mvs[i], bsi->ref_mv, x->nmvjointcost,
+ x->mvcost);
br += bsi->rdstat[i][mode_idx].brate;
bd += bsi->rdstat[i][mode_idx].bdist;
@@ -2063,8 +2069,8 @@ static void rd_check_segment_txsize(VP9_COMP *cpi, MACROBLOCK *x,
bsi->sse = block_sse;
// update the coding decisions
- for (i = 0; i < 4; ++i)
- bsi->modes[i] = mi->bmi[i].as_mode;
+ for (k = 0; k < 4; ++k)
+ bsi->modes[k] = mi->bmi[k].as_mode;
}
static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
@@ -2091,8 +2097,8 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
vp9_zero(*bsi);
bsi->segment_rd = best_rd;
- bsi->ref_mv = best_ref_mv;
- bsi->second_ref_mv = second_best_ref_mv;
+ bsi->ref_mv[0] = best_ref_mv;
+ bsi->ref_mv[1] = second_best_ref_mv;
bsi->mvp.as_int = best_ref_mv->as_int;
bsi->mvthresh = mvthresh;
@@ -2110,7 +2116,7 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
mi->bmi[i].as_mv[0].as_int = bsi->rdstat[i][mode_idx].mvs[0].as_int;
if (has_second_ref(mbmi))
mi->bmi[i].as_mv[1].as_int = bsi->rdstat[i][mode_idx].mvs[1].as_int;
- xd->plane[0].eobs[i] = bsi->rdstat[i][mode_idx].eobs;
+ x->plane[0].eobs[i] = bsi->rdstat[i][mode_idx].eobs;
mi->bmi[i].as_mode = bsi->modes[i];
}
@@ -2120,7 +2126,7 @@ static int64_t rd_pick_best_mbsegmentation(VP9_COMP *cpi, MACROBLOCK *x,
*returntotrate = bsi->r;
*returndistortion = bsi->d;
*returnyrate = bsi->segment_yrate;
- *skippable = vp9_is_skippable_in_plane(&x->e_mbd, BLOCK_8X8, 0);
+ *skippable = vp9_is_skippable_in_plane(x, BLOCK_8X8, 0);
*psse = bsi->sse;
mbmi->mode = bsi->modes[3];
@@ -2138,7 +2144,7 @@ static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
int best_index = 0;
int best_sad = INT_MAX;
int this_sad = INT_MAX;
- unsigned int max_mv = 0;
+ int max_mv = 0;
uint8_t *src_y_ptr = x->plane[0].src.buf;
uint8_t *ref_y_ptr;
@@ -2148,16 +2154,21 @@ static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
cpi->common.show_frame &&
block_size < cpi->sf.max_partition_size);
+ int_mv pred_mv[3];
+ pred_mv[0] = mbmi->ref_mvs[ref_frame][0];
+ pred_mv[1] = mbmi->ref_mvs[ref_frame][1];
+ pred_mv[2] = x->pred_mv[ref_frame];
+
// Get the sad for each candidate reference mv
for (i = 0; i < num_mv_refs; i++) {
- this_mv.as_int = (i < MAX_MV_REF_CANDIDATES) ?
- mbmi->ref_mvs[ref_frame][i].as_int : x->pred_mv[ref_frame].as_int;
+ this_mv.as_int = pred_mv[i].as_int;
max_mv = MAX(max_mv,
MAX(abs(this_mv.as_mv.row), abs(this_mv.as_mv.col)) >> 3);
- // The list is at an end if we see 0 for a second time.
+ // only need to check zero mv once
if (!this_mv.as_int && zero_seen)
- break;
+ continue;
+
zero_seen = zero_seen || !this_mv.as_int;
row_offset = this_mv.as_mv.row >> 3;
@@ -2179,6 +2190,7 @@ static void mv_pred(VP9_COMP *cpi, MACROBLOCK *x,
// Note the index of the mv that worked best in the reference list.
x->mv_best_ref_index[ref_frame] = best_index;
x->max_mv_context[ref_frame] = max_mv;
+ x->pred_mv_sad[ref_frame] = best_sad;
}
static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id,
@@ -2194,11 +2206,11 @@ static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id,
vpx_memset(ref_costs_comp, 0, MAX_REF_FRAMES * sizeof(*ref_costs_comp));
*comp_mode_p = 128;
} else {
- vp9_prob intra_inter_p = vp9_get_pred_prob_intra_inter(cm, xd);
+ vp9_prob intra_inter_p = vp9_get_intra_inter_prob(cm, xd);
vp9_prob comp_inter_p = 128;
- if (cm->comp_pred_mode == HYBRID_PREDICTION) {
- comp_inter_p = vp9_get_pred_prob_comp_inter_inter(cm, xd);
+ if (cm->reference_mode == REFERENCE_MODE_SELECT) {
+ comp_inter_p = vp9_get_reference_mode_prob(cm, xd);
*comp_mode_p = comp_inter_p;
} else {
*comp_mode_p = 128;
@@ -2206,12 +2218,12 @@ static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id,
ref_costs_single[INTRA_FRAME] = vp9_cost_bit(intra_inter_p, 0);
- if (cm->comp_pred_mode != COMP_PREDICTION_ONLY) {
+ if (cm->reference_mode != COMPOUND_REFERENCE) {
vp9_prob ref_single_p1 = vp9_get_pred_prob_single_ref_p1(cm, xd);
vp9_prob ref_single_p2 = vp9_get_pred_prob_single_ref_p2(cm, xd);
unsigned int base_cost = vp9_cost_bit(intra_inter_p, 1);
- if (cm->comp_pred_mode == HYBRID_PREDICTION)
+ if (cm->reference_mode == REFERENCE_MODE_SELECT)
base_cost += vp9_cost_bit(comp_inter_p, 0);
ref_costs_single[LAST_FRAME] = ref_costs_single[GOLDEN_FRAME] =
@@ -2226,11 +2238,11 @@ static void estimate_ref_frame_costs(VP9_COMP *cpi, int segment_id,
ref_costs_single[GOLDEN_FRAME] = 512;
ref_costs_single[ALTREF_FRAME] = 512;
}
- if (cm->comp_pred_mode != SINGLE_PREDICTION_ONLY) {
+ if (cm->reference_mode != SINGLE_REFERENCE) {
vp9_prob ref_comp_p = vp9_get_pred_prob_comp_ref_p(cm, xd);
unsigned int base_cost = vp9_cost_bit(intra_inter_p, 1);
- if (cm->comp_pred_mode == HYBRID_PREDICTION)
+ if (cm->reference_mode == REFERENCE_MODE_SELECT)
base_cost += vp9_cost_bit(comp_inter_p, 1);
ref_costs_comp[LAST_FRAME] = base_cost + vp9_cost_bit(ref_comp_p, 0);
@@ -2246,7 +2258,7 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
int mode_index,
int_mv *ref_mv,
int_mv *second_ref_mv,
- int64_t comp_pred_diff[NB_PREDICTION_TYPES],
+ int64_t comp_pred_diff[REFERENCE_MODES],
int64_t tx_size_diff[TX_MODES],
int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS]) {
MACROBLOCKD *const xd = &x->e_mbd;
@@ -2257,12 +2269,12 @@ static void store_coding_context(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
ctx->best_mode_index = mode_index;
ctx->mic = *xd->mi_8x8[0];
- ctx->best_ref_mv.as_int = ref_mv->as_int;
- ctx->second_best_ref_mv.as_int = second_ref_mv->as_int;
+ ctx->best_ref_mv[0].as_int = ref_mv->as_int;
+ ctx->best_ref_mv[1].as_int = second_ref_mv->as_int;
- ctx->single_pred_diff = (int)comp_pred_diff[SINGLE_PREDICTION_ONLY];
- ctx->comp_pred_diff = (int)comp_pred_diff[COMP_PREDICTION_ONLY];
- ctx->hybrid_pred_diff = (int)comp_pred_diff[HYBRID_PREDICTION];
+ ctx->single_pred_diff = (int)comp_pred_diff[SINGLE_REFERENCE];
+ ctx->comp_pred_diff = (int)comp_pred_diff[COMPOUND_REFERENCE];
+ ctx->hybrid_pred_diff = (int)comp_pred_diff[REFERENCE_MODE_SELECT];
vpx_memcpy(ctx->tx_rd_diff, tx_size_diff, sizeof(ctx->tx_rd_diff));
vpx_memcpy(ctx->best_filter_diff, best_filter_diff,
@@ -2295,58 +2307,47 @@ static void setup_pred_block(const MACROBLOCKD *xd,
}
}
-static void setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
- const TileInfo *const tile,
- int idx, MV_REFERENCE_FRAME frame_type,
- BLOCK_SIZE block_size,
- int mi_row, int mi_col,
- int_mv frame_nearest_mv[MAX_REF_FRAMES],
- int_mv frame_near_mv[MAX_REF_FRAMES],
- struct buf_2d yv12_mb[4][MAX_MB_PLANE],
- struct scale_factors scale[MAX_REF_FRAMES]) {
- VP9_COMMON *cm = &cpi->common;
- YV12_BUFFER_CONFIG *yv12 = &cm->yv12_fb[cpi->common.ref_frame_map[idx]];
+void vp9_setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
+ const TileInfo *const tile,
+ MV_REFERENCE_FRAME ref_frame,
+ BLOCK_SIZE block_size,
+ int mi_row, int mi_col,
+ int_mv frame_nearest_mv[MAX_REF_FRAMES],
+ int_mv frame_near_mv[MAX_REF_FRAMES],
+ struct buf_2d yv12_mb[4][MAX_MB_PLANE]) {
+ const VP9_COMMON *cm = &cpi->common;
+ const YV12_BUFFER_CONFIG *yv12 = get_ref_frame_buffer(cpi, ref_frame);
MACROBLOCKD *const xd = &x->e_mbd;
- MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
-
- // set up scaling factors
- scale[frame_type] = cpi->common.active_ref_scale[frame_type - 1];
-
- scale[frame_type].sfc->set_scaled_offsets(&scale[frame_type],
- mi_row * MI_SIZE, mi_col * MI_SIZE);
+ MODE_INFO *const mi = xd->mi_8x8[0];
+ int_mv *const candidates = mi->mbmi.ref_mvs[ref_frame];
+ const struct scale_factors *const sf = &cm->frame_refs[ref_frame - 1].sf;
// TODO(jkoleszar): Is the UV buffer ever used here? If so, need to make this
// use the UV scaling factors.
- setup_pred_block(xd, yv12_mb[frame_type], yv12, mi_row, mi_col,
- &scale[frame_type], &scale[frame_type]);
+ setup_pred_block(xd, yv12_mb[ref_frame], yv12, mi_row, mi_col, sf, sf);
// Gets an initial list of candidate vectors from neighbours and orders them
- vp9_find_mv_refs(cm, xd, tile, xd->mi_8x8[0],
- xd->last_mi,
- frame_type,
- mbmi->ref_mvs[frame_type], mi_row, mi_col);
+ vp9_find_mv_refs(cm, xd, tile, mi, ref_frame, candidates, mi_row, mi_col);
// Candidate refinement carried out at encoder and decoder
- vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv,
- mbmi->ref_mvs[frame_type],
- &frame_nearest_mv[frame_type],
- &frame_near_mv[frame_type]);
+ vp9_find_best_ref_mvs(xd, cm->allow_high_precision_mv, candidates,
+ &frame_nearest_mv[ref_frame],
+ &frame_near_mv[ref_frame]);
// Further refinement that is encode side only to test the top few candidates
// in full and choose the best as the centre point for subsequent searches.
// The current implementation doesn't support scaling.
- if (!vp9_is_scaled(scale[frame_type].sfc) && block_size >= BLOCK_8X8)
- mv_pred(cpi, x, yv12_mb[frame_type][0].buf, yv12->y_stride,
- frame_type, block_size);
+ if (!vp9_is_scaled(sf) && block_size >= BLOCK_8X8)
+ mv_pred(cpi, x, yv12_mb[ref_frame][0].buf, yv12->y_stride,
+ ref_frame, block_size);
}
-static YV12_BUFFER_CONFIG *get_scaled_ref_frame(VP9_COMP *cpi, int ref_frame) {
- YV12_BUFFER_CONFIG *scaled_ref_frame = NULL;
- int fb = get_ref_frame_idx(cpi, ref_frame);
- int fb_scale = get_scale_ref_frame_idx(cpi, ref_frame);
- if (cpi->scaled_ref_idx[fb_scale] != cpi->common.ref_frame_map[fb])
- scaled_ref_frame = &cpi->common.yv12_fb[cpi->scaled_ref_idx[fb_scale]];
- return scaled_ref_frame;
+const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi,
+ int ref_frame) {
+ const VP9_COMMON *const cm = &cpi->common;
+ const int ref_idx = cm->ref_frame_map[get_ref_frame_idx(cpi, ref_frame)];
+ const int scaled_idx = cpi->scaled_ref_idx[ref_frame - 1];
+ return (scaled_idx != ref_idx) ? &cm->frame_bufs[scaled_idx].buf : NULL;
}
static INLINE int get_switchable_rate(const MACROBLOCK *x) {
@@ -2369,17 +2370,22 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
int bestsme = INT_MAX;
int further_steps, step_param;
int sadpb = x->sadperbit16;
- int_mv mvp_full;
+ MV mvp_full;
int ref = mbmi->ref_frame[0];
- int_mv ref_mv = mbmi->ref_mvs[ref][0];
- const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
+ MV ref_mv = mbmi->ref_mvs[ref][0].as_mv;
int tmp_col_min = x->mv_col_min;
int tmp_col_max = x->mv_col_max;
int tmp_row_min = x->mv_row_min;
int tmp_row_max = x->mv_row_max;
- YV12_BUFFER_CONFIG *scaled_ref_frame = get_scaled_ref_frame(cpi, ref);
+ const YV12_BUFFER_CONFIG *scaled_ref_frame = vp9_get_scaled_ref_frame(cpi,
+ ref);
+
+ MV pred_mv[3];
+ pred_mv[0] = mbmi->ref_mvs[ref][0].as_mv;
+ pred_mv[1] = mbmi->ref_mvs[ref][1].as_mv;
+ pred_mv[2] = x->pred_mv[ref].as_mv;
if (scaled_ref_frame) {
int i;
@@ -2389,40 +2395,21 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
for (i = 0; i < MAX_MB_PLANE; i++)
backup_yv12[i] = xd->plane[i].pre[0];
- setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
+ vp9_setup_pre_planes(xd, 0, scaled_ref_frame, mi_row, mi_col, NULL);
}
- vp9_clamp_mv_min_max(x, &ref_mv.as_mv);
-
- // Adjust search parameters based on small partitions' result.
- if (x->fast_ms) {
- // && abs(mvp_full.as_mv.row - x->pred_mv.as_mv.row) < 24 &&
- // abs(mvp_full.as_mv.col - x->pred_mv.as_mv.col) < 24) {
- // adjust search range
- step_param = 6;
- if (x->fast_ms > 1)
- step_param = 8;
-
- // Get prediction MV.
- mvp_full.as_int = x->pred_mv[ref].as_int;
+ vp9_set_mv_search_range(x, &ref_mv);
- // Adjust MV sign if needed.
- if (cm->ref_frame_sign_bias[ref]) {
- mvp_full.as_mv.col *= -1;
- mvp_full.as_mv.row *= -1;
- }
+ // Work out the size of the first step in the mv step search.
+ // 0 here is maximum length first step. 1 is MAX >> 1 etc.
+ if (cpi->sf.auto_mv_step_size && cpi->common.show_frame) {
+ // Take wtd average of the step_params based on the last frame's
+ // max mv magnitude and that based on the best ref mvs of the current
+ // block for the given reference.
+ step_param = (vp9_init_search_range(cpi, x->max_mv_context[ref]) +
+ cpi->mv_step_param) >> 1;
} else {
- // Work out the size of the first step in the mv step search.
- // 0 here is maximum length first step. 1 is MAX >> 1 etc.
- if (cpi->sf.auto_mv_step_size && cpi->common.show_frame) {
- // Take wtd average of the step_params based on the last frame's
- // max mv magnitude and that based on the best ref mvs of the current
- // block for the given reference.
- step_param = (vp9_init_search_range(cpi, x->max_mv_context[ref]) +
- cpi->mv_step_param) >> 1;
- } else {
- step_param = cpi->mv_step_param;
- }
+ step_param = cpi->mv_step_param;
}
if (cpi->sf.adaptive_motion_search && bsize < BLOCK_64X64 &&
@@ -2432,39 +2419,78 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
step_param = MAX(step_param, boffset);
}
- mvp_full.as_int = x->mv_best_ref_index[ref] < MAX_MV_REF_CANDIDATES ?
- mbmi->ref_mvs[ref][x->mv_best_ref_index[ref]].as_int :
- x->pred_mv[ref].as_int;
+ if (cpi->sf.adaptive_motion_search) {
+ int bwl = b_width_log2_lookup[bsize];
+ int bhl = b_height_log2_lookup[bsize];
+ int i;
+ int tlevel = x->pred_mv_sad[ref] >> (bwl + bhl + 4);
+
+ if (tlevel < 5)
+ step_param += 2;
- mvp_full.as_mv.col >>= 3;
- mvp_full.as_mv.row >>= 3;
+ for (i = LAST_FRAME; i <= ALTREF_FRAME && cpi->common.show_frame; ++i) {
+ if ((x->pred_mv_sad[ref] >> 3) > x->pred_mv_sad[i]) {
+ x->pred_mv[ref].as_int = 0;
+ tmp_mv->as_int = INVALID_MV;
+
+ if (scaled_ref_frame) {
+ int i;
+ for (i = 0; i < MAX_MB_PLANE; i++)
+ xd->plane[i].pre[0] = backup_yv12[i];
+ }
+ return;
+ }
+ }
+ }
+
+ mvp_full = pred_mv[x->mv_best_ref_index[ref]];
+
+ mvp_full.col >>= 3;
+ mvp_full.row >>= 3;
// Further step/diamond searches as necessary
further_steps = (cpi->sf.max_step_search_steps - 1) - step_param;
- if (cpi->sf.search_method == HEX) {
- bestsme = vp9_hex_search(x, &mvp_full.as_mv,
- step_param,
- sadpb, 1,
- &cpi->fn_ptr[block_size], 1,
- &ref_mv.as_mv, &tmp_mv->as_mv);
+ if (cpi->sf.search_method == FAST_DIAMOND) {
+ bestsme = vp9_fast_dia_search(x, &mvp_full, step_param, sadpb, 0,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &tmp_mv->as_mv, &ref_mv,
+ &cpi->fn_ptr[bsize], 1);
+ } else if (cpi->sf.search_method == FAST_HEX) {
+ bestsme = vp9_fast_hex_search(x, &mvp_full, step_param, sadpb, 0,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &tmp_mv->as_mv, &ref_mv,
+ &cpi->fn_ptr[bsize], 1);
+ } else if (cpi->sf.search_method == HEX) {
+ bestsme = vp9_hex_search(x, &mvp_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &tmp_mv->as_mv, &ref_mv,
+ &cpi->fn_ptr[bsize], 1);
} else if (cpi->sf.search_method == SQUARE) {
- bestsme = vp9_square_search(x, &mvp_full.as_mv,
- step_param,
- sadpb, 1,
- &cpi->fn_ptr[block_size], 1,
- &ref_mv.as_mv, &tmp_mv->as_mv);
+ bestsme = vp9_square_search(x, &mvp_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &tmp_mv->as_mv, &ref_mv,
+ &cpi->fn_ptr[bsize], 1);
} else if (cpi->sf.search_method == BIGDIA) {
- bestsme = vp9_bigdia_search(x, &mvp_full.as_mv,
- step_param,
- sadpb, 1,
- &cpi->fn_ptr[block_size], 1,
- &ref_mv.as_mv, &tmp_mv->as_mv);
+ bestsme = vp9_bigdia_search(x, &mvp_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[bsize], 1,
+ &ref_mv, &tmp_mv->as_mv);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_var(x, &tmp_mv->as_mv, &ref_mv,
+ &cpi->fn_ptr[bsize], 1);
} else {
bestsme = vp9_full_pixel_diamond(cpi, x, &mvp_full, step_param,
sadpb, further_steps, 1,
- &cpi->fn_ptr[block_size],
- &ref_mv, tmp_mv);
+ &cpi->fn_ptr[bsize],
+ &ref_mv, &tmp_mv->as_mv);
}
x->mv_col_min = tmp_col_min;
@@ -2474,16 +2500,16 @@ static void single_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if (bestsme < INT_MAX) {
int dis; /* TODO: use dis in distortion calculation later. */
- unsigned int sse;
- cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv.as_mv,
+ cpi->find_fractional_mv_step(x, &tmp_mv->as_mv, &ref_mv,
cm->allow_high_precision_mv,
x->errorperbit,
- &cpi->fn_ptr[block_size],
- 0, cpi->sf.subpel_iters_per_step,
+ &cpi->fn_ptr[bsize],
+ cpi->sf.subpel_force_stop,
+ cpi->sf.subpel_iters_per_step,
x->nmvjointcost, x->mvcost,
- &dis, &sse);
+ &dis, &x->pred_sse[ref]);
}
- *rate_mv = vp9_mv_bit_cost(&tmp_mv->as_mv, &ref_mv.as_mv,
+ *rate_mv = vp9_mv_bit_cost(&tmp_mv->as_mv, &ref_mv,
x->nmvjointcost, x->mvcost, MV_COST_WEIGHT);
if (cpi->sf.adaptive_motion_search && cpi->common.show_frame)
@@ -2502,13 +2528,13 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
int mi_row, int mi_col,
int_mv single_newmv[MAX_REF_FRAMES],
int *rate_mv) {
- int pw = 4 << b_width_log2(bsize), ph = 4 << b_height_log2(bsize);
+ const int pw = 4 * num_4x4_blocks_wide_lookup[bsize];
+ const int ph = 4 * num_4x4_blocks_high_lookup[bsize];
MACROBLOCKD *xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
const int refs[2] = { mbmi->ref_frame[0],
mbmi->ref_frame[1] < 0 ? 0 : mbmi->ref_frame[1] };
int_mv ref_mv[2];
- const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
int ite, ref;
// Prediction buffer from second frame.
uint8_t *second_pred = vpx_memalign(16, pw * ph * sizeof(uint8_t));
@@ -2517,9 +2543,9 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
struct buf_2d backup_yv12[2][MAX_MB_PLANE];
struct buf_2d scaled_first_yv12 = xd->plane[0].pre[0];
int last_besterr[2] = {INT_MAX, INT_MAX};
- YV12_BUFFER_CONFIG *const scaled_ref_frame[2] = {
- get_scaled_ref_frame(cpi, mbmi->ref_frame[0]),
- get_scaled_ref_frame(cpi, mbmi->ref_frame[1])
+ const YV12_BUFFER_CONFIG *const scaled_ref_frame[2] = {
+ vp9_get_scaled_ref_frame(cpi, mbmi->ref_frame[0]),
+ vp9_get_scaled_ref_frame(cpi, mbmi->ref_frame[1])
};
for (ref = 0; ref < 2; ++ref) {
@@ -2532,11 +2558,10 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
// motion search code to be used without additional modifications.
for (i = 0; i < MAX_MB_PLANE; i++)
backup_yv12[ref][i] = xd->plane[i].pre[ref];
- setup_pre_planes(xd, ref, scaled_ref_frame[ref], mi_row, mi_col, NULL);
+ vp9_setup_pre_planes(xd, ref, scaled_ref_frame[ref], mi_row, mi_col,
+ NULL);
}
- xd->scale_factor[ref].sfc->set_scaled_offsets(&xd->scale_factor[ref],
- mi_row, mi_col);
frame_mv[refs[ref]].as_int = single_newmv[refs[ref]].as_int;
}
@@ -2564,14 +2589,15 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
ref_yv12[!id].stride,
second_pred, pw,
&frame_mv[refs[!id]].as_mv,
- &xd->scale_factor[!id],
+ &xd->block_refs[!id]->sf,
pw, ph, 0,
- &xd->subpix, MV_PRECISION_Q3);
+ xd->interp_kernel, MV_PRECISION_Q3,
+ mi_col * MI_SIZE, mi_row * MI_SIZE);
// Compound motion search on first ref frame.
if (id)
xd->plane[0].pre[0] = ref_yv12[id];
- vp9_clamp_mv_min_max(x, &ref_mv[id].as_mv);
+ vp9_set_mv_search_range(x, &ref_mv[id].as_mv);
// Use mv result from single mode as mvp.
tmp_mv.as_int = frame_mv[refs[id]].as_int;
@@ -2580,12 +2606,15 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
tmp_mv.as_mv.row >>= 3;
// Small-range full-pixel motion search
- bestsme = vp9_refining_search_8p_c(x, &tmp_mv, sadpb,
+ bestsme = vp9_refining_search_8p_c(x, &tmp_mv.as_mv, sadpb,
search_range,
- &cpi->fn_ptr[block_size],
+ &cpi->fn_ptr[bsize],
x->nmvjointcost, x->mvcost,
- &ref_mv[id], second_pred,
+ &ref_mv[id].as_mv, second_pred,
pw, ph);
+ if (bestsme < INT_MAX)
+ bestsme = vp9_get_mvpred_av_var(x, &tmp_mv.as_mv, &ref_mv[id].as_mv,
+ second_pred, &cpi->fn_ptr[bsize], 1);
x->mv_col_min = tmp_col_min;
x->mv_col_max = tmp_col_max;
@@ -2595,13 +2624,12 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
if (bestsme < INT_MAX) {
int dis; /* TODO: use dis in distortion calculation later. */
unsigned int sse;
-
bestsme = cpi->find_fractional_mv_step_comp(
x, &tmp_mv.as_mv,
&ref_mv[id].as_mv,
cpi->common.allow_high_precision_mv,
x->errorperbit,
- &cpi->fn_ptr[block_size],
+ &cpi->fn_ptr[bsize],
0, cpi->sf.subpel_iters_per_step,
x->nmvjointcost, x->mvcost,
&dis, &sse, second_pred,
@@ -2637,6 +2665,16 @@ static void joint_motion_search(VP9_COMP *cpi, MACROBLOCK *x,
vpx_free(second_pred);
}
+static INLINE void restore_dst_buf(MACROBLOCKD *xd,
+ uint8_t *orig_dst[MAX_MB_PLANE],
+ int orig_dst_stride[MAX_MB_PLANE]) {
+ int i;
+ for (i = 0; i < MAX_MB_PLANE; i++) {
+ xd->plane[i].dst.buf = orig_dst[i];
+ xd->plane[i].dst.stride = orig_dst_stride[i];
+ }
+}
+
static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
const TileInfo *const tile,
BLOCK_SIZE bsize,
@@ -2646,7 +2684,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int *rate_y, int64_t *distortion_y,
int *rate_uv, int64_t *distortion_uv,
int *mode_excluded, int *disable_skip,
- INTERPOLATION_TYPE *best_filter,
+ INTERP_FILTER *best_filter,
int_mv (*mode_mv)[MAX_REF_FRAMES],
int mi_row, int mi_col,
int_mv single_newmv[MAX_REF_FRAMES],
@@ -2702,6 +2740,8 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int_mv tmp_mv;
single_motion_search(cpi, x, tile, bsize, mi_row, mi_col,
&tmp_mv, &rate_mv);
+ if (tmp_mv.as_int == INVALID_MV)
+ return INT64_MAX;
*rate2 += rate_mv;
frame_mv[refs[0]].as_int =
xd->mi_8x8[0]->bmi[0].as_mv[0].as_int = tmp_mv.as_int;
@@ -2709,49 +2749,13 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
}
}
- // if we're near/nearest and mv == 0,0, compare to zeromv
- if ((this_mode == NEARMV || this_mode == NEARESTMV || this_mode == ZEROMV) &&
- frame_mv[refs[0]].as_int == 0 &&
- !vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP) &&
- (num_refs == 1 || frame_mv[refs[1]].as_int == 0)) {
- int rfc = mbmi->mode_context[mbmi->ref_frame[0]];
- int c1 = cost_mv_ref(cpi, NEARMV, rfc);
- int c2 = cost_mv_ref(cpi, NEARESTMV, rfc);
- int c3 = cost_mv_ref(cpi, ZEROMV, rfc);
-
- if (this_mode == NEARMV) {
- if (c1 > c3)
- return INT64_MAX;
- } else if (this_mode == NEARESTMV) {
- if (c2 > c3)
- return INT64_MAX;
- } else {
- assert(this_mode == ZEROMV);
- if (num_refs == 1) {
- if ((c3 >= c2 &&
- mode_mv[NEARESTMV][mbmi->ref_frame[0]].as_int == 0) ||
- (c3 >= c1 &&
- mode_mv[NEARMV][mbmi->ref_frame[0]].as_int == 0))
- return INT64_MAX;
- } else {
- if ((c3 >= c2 &&
- mode_mv[NEARESTMV][mbmi->ref_frame[0]].as_int == 0 &&
- mode_mv[NEARESTMV][mbmi->ref_frame[1]].as_int == 0) ||
- (c3 >= c1 &&
- mode_mv[NEARMV][mbmi->ref_frame[0]].as_int == 0 &&
- mode_mv[NEARMV][mbmi->ref_frame[1]].as_int == 0))
- return INT64_MAX;
- }
- }
- }
-
for (i = 0; i < num_refs; ++i) {
cur_mv[i] = frame_mv[refs[i]];
// Clip "next_nearest" so that it does not extend to far out of image
if (this_mode != NEWMV)
clamp_mv2(&cur_mv[i].as_mv, xd);
- if (mv_check_bounds(x, &cur_mv[i]))
+ if (mv_check_bounds(x, &cur_mv[i].as_mv))
return INT64_MAX;
mbmi->mv[i].as_int = cur_mv[i].as_int;
}
@@ -2770,67 +2774,59 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
* are only three options: Last/Golden, ARF/Last or Golden/ARF, or in other
* words if you present them in that order, the second one is always known
* if the first is known */
- *rate2 += cost_mv_ref(cpi, this_mode,
- mbmi->mode_context[mbmi->ref_frame[0]]);
+ *rate2 += cost_mv_ref(cpi, this_mode, mbmi->mode_context[refs[0]]);
- if (!(*mode_excluded)) {
- if (is_comp_pred) {
- *mode_excluded = (cpi->common.comp_pred_mode == SINGLE_PREDICTION_ONLY);
- } else {
- *mode_excluded = (cpi->common.comp_pred_mode == COMP_PREDICTION_ONLY);
- }
- }
+ if (!(*mode_excluded))
+ *mode_excluded = is_comp_pred ? cm->reference_mode == SINGLE_REFERENCE
+ : cm->reference_mode == COMPOUND_REFERENCE;
pred_exists = 0;
// Are all MVs integer pel for Y and UV
- intpel_mv = (mbmi->mv[0].as_mv.row & 15) == 0 &&
- (mbmi->mv[0].as_mv.col & 15) == 0;
+ intpel_mv = !mv_has_subpel(&mbmi->mv[0].as_mv);
if (is_comp_pred)
- intpel_mv &= (mbmi->mv[1].as_mv.row & 15) == 0 &&
- (mbmi->mv[1].as_mv.col & 15) == 0;
+ intpel_mv &= !mv_has_subpel(&mbmi->mv[1].as_mv);
+
// Search for best switchable filter by checking the variance of
// pred error irrespective of whether the filter will be used
- if (cm->mcomp_filter_type != BILINEAR) {
+ cpi->mask_filter_rd = 0;
+ for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
+ cpi->rd_filter_cache[i] = INT64_MAX;
+
+ if (cm->interp_filter != BILINEAR) {
*best_filter = EIGHTTAP;
if (x->source_variance <
cpi->sf.disable_filter_search_var_thresh) {
*best_filter = EIGHTTAP;
- vp9_zero(cpi->rd_filter_cache);
} else {
- int i, newbest;
+ int newbest;
int tmp_rate_sum = 0;
int64_t tmp_dist_sum = 0;
- cpi->rd_filter_cache[SWITCHABLE_FILTERS] = INT64_MAX;
for (i = 0; i < SWITCHABLE_FILTERS; ++i) {
int j;
int64_t rs_rd;
mbmi->interp_filter = i;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
rs = get_switchable_rate(x);
rs_rd = RDCOST(x->rdmult, x->rddiv, rs, 0);
if (i > 0 && intpel_mv) {
- cpi->rd_filter_cache[i] = RDCOST(x->rdmult, x->rddiv,
- tmp_rate_sum, tmp_dist_sum);
+ rd = RDCOST(x->rdmult, x->rddiv, tmp_rate_sum, tmp_dist_sum);
+ cpi->rd_filter_cache[i] = rd;
cpi->rd_filter_cache[SWITCHABLE_FILTERS] =
- MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS],
- cpi->rd_filter_cache[i] + rs_rd);
- rd = cpi->rd_filter_cache[i];
- if (cm->mcomp_filter_type == SWITCHABLE)
+ MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS], rd + rs_rd);
+ if (cm->interp_filter == SWITCHABLE)
rd += rs_rd;
+ cpi->mask_filter_rd = MAX(cpi->mask_filter_rd, rd);
} else {
int rate_sum = 0;
int64_t dist_sum = 0;
- if ((cm->mcomp_filter_type == SWITCHABLE &&
+ if ((cm->interp_filter == SWITCHABLE &&
(!i || best_needs_copy)) ||
- (cm->mcomp_filter_type != SWITCHABLE &&
- (cm->mcomp_filter_type == mbmi->interp_filter ||
+ (cm->interp_filter != SWITCHABLE &&
+ (cm->interp_filter == mbmi->interp_filter ||
(i == 0 && intpel_mv)))) {
- for (j = 0; j < MAX_MB_PLANE; j++) {
- xd->plane[j].dst.buf = orig_dst[j];
- xd->plane[j].dst.stride = orig_dst_stride[j];
- }
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
} else {
for (j = 0; j < MAX_MB_PLANE; j++) {
xd->plane[j].dst.buf = tmp_buf + j * 64 * 64;
@@ -2839,25 +2835,24 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
}
vp9_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
model_rd_for_sb(cpi, bsize, x, xd, &rate_sum, &dist_sum);
- cpi->rd_filter_cache[i] = RDCOST(x->rdmult, x->rddiv,
- rate_sum, dist_sum);
+
+ rd = RDCOST(x->rdmult, x->rddiv, rate_sum, dist_sum);
+ cpi->rd_filter_cache[i] = rd;
cpi->rd_filter_cache[SWITCHABLE_FILTERS] =
- MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS],
- cpi->rd_filter_cache[i] + rs_rd);
- rd = cpi->rd_filter_cache[i];
- if (cm->mcomp_filter_type == SWITCHABLE)
+ MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS], rd + rs_rd);
+ if (cm->interp_filter == SWITCHABLE)
rd += rs_rd;
+ cpi->mask_filter_rd = MAX(cpi->mask_filter_rd, rd);
+
if (i == 0 && intpel_mv) {
tmp_rate_sum = rate_sum;
tmp_dist_sum = dist_sum;
}
}
+
if (i == 0 && cpi->sf.use_rd_breakout && ref_best_rd < INT64_MAX) {
if (rd / 2 > ref_best_rd) {
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].dst.buf = orig_dst[i];
- xd->plane[i].dst.stride = orig_dst_stride[i];
- }
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX;
}
}
@@ -2866,28 +2861,24 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (newbest) {
best_rd = rd;
*best_filter = mbmi->interp_filter;
- if (cm->mcomp_filter_type == SWITCHABLE && i && !intpel_mv)
+ if (cm->interp_filter == SWITCHABLE && i && !intpel_mv)
best_needs_copy = !best_needs_copy;
}
- if ((cm->mcomp_filter_type == SWITCHABLE && newbest) ||
- (cm->mcomp_filter_type != SWITCHABLE &&
- cm->mcomp_filter_type == mbmi->interp_filter)) {
+ if ((cm->interp_filter == SWITCHABLE && newbest) ||
+ (cm->interp_filter != SWITCHABLE &&
+ cm->interp_filter == mbmi->interp_filter)) {
pred_exists = 1;
}
}
-
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].dst.buf = orig_dst[i];
- xd->plane[i].dst.stride = orig_dst_stride[i];
- }
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
}
}
// Set the appropriate filter
- mbmi->interp_filter = cm->mcomp_filter_type != SWITCHABLE ?
- cm->mcomp_filter_type : *best_filter;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
- rs = cm->mcomp_filter_type == SWITCHABLE ? get_switchable_rate(x) : 0;
+ mbmi->interp_filter = cm->interp_filter != SWITCHABLE ?
+ cm->interp_filter : *best_filter;
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
+ rs = cm->interp_filter == SWITCHABLE ? get_switchable_rate(x) : 0;
if (pred_exists) {
if (best_needs_copy) {
@@ -2903,7 +2894,6 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
vp9_build_inter_predictors_sb(xd, mi_row, mi_col, bsize);
}
-
if (cpi->sf.use_rd_breakout && ref_best_rd < INT64_MAX) {
int tmp_rate;
int64_t tmp_dist;
@@ -2912,44 +2902,37 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
// if current pred_error modeled rd is substantially more than the best
// so far, do not bother doing full rd
if (rd / 2 > ref_best_rd) {
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].dst.buf = orig_dst[i];
- xd->plane[i].dst.stride = orig_dst_stride[i];
- }
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX;
}
}
- if (cpi->common.mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
*rate2 += get_switchable_rate(x);
- if (!is_comp_pred && cpi->enable_encode_breakout) {
- if (cpi->active_map_enabled && x->active_ptr[0] == 0)
+ if (!is_comp_pred) {
+ if (!x->in_active_map) {
+ if (psse)
+ *psse = 0;
+ *distortion = 0;
x->skip = 1;
- else if (x->encode_breakout) {
+ } else if (cpi->allow_encode_breakout && x->encode_breakout) {
const BLOCK_SIZE y_size = get_plane_block_size(bsize, &xd->plane[0]);
const BLOCK_SIZE uv_size = get_plane_block_size(bsize, &xd->plane[1]);
unsigned int var, sse;
// Skipping threshold for ac.
unsigned int thresh_ac;
- // The encode_breakout input
- unsigned int encode_breakout = x->encode_breakout << 4;
- unsigned int max_thresh = 36000;
-
+ // Set a maximum for threshold to avoid big PSNR loss in low bitrate case.
// Use extreme low threshold for static frames to limit skipping.
- if (cpi->enable_encode_breakout == 2)
- max_thresh = 128;
+ const unsigned int max_thresh = (cpi->allow_encode_breakout ==
+ ENCODE_BREAKOUT_LIMITED) ? 128 : 36000;
+ // The encode_breakout input
+ const unsigned int min_thresh =
+ MIN(((unsigned int)x->encode_breakout << 4), max_thresh);
// Calculate threshold according to dequant value.
thresh_ac = (xd->plane[0].dequant[1] * xd->plane[0].dequant[1]) / 9;
-
- // Use encode_breakout input if it is bigger than internal threshold.
- if (thresh_ac < encode_breakout)
- thresh_ac = encode_breakout;
-
- // Set a maximum for threshold to avoid big PSNR loss in low bitrate case.
- if (thresh_ac > max_thresh)
- thresh_ac = max_thresh;
+ thresh_ac = clamp(thresh_ac, min_thresh, max_thresh);
var = cpi->fn_ptr[y_size].vf(x->plane[0].src.buf, x->plane[0].src.stride,
xd->plane[0].dst.buf,
@@ -2990,7 +2973,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
x->skip = 1;
// The cost of skip bit needs to be added.
- *rate2 += vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd), 1);
+ *rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
// Scaling factor for SSE from spatial domain to frequency domain
// is 16. Adjust distortion accordingly.
@@ -3012,16 +2995,13 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
int64_t rdcosty = INT64_MAX;
// Y cost and distortion
- super_block_yrd(cpi, x, rate_y, distortion_y, &skippable_y, psse,
- bsize, txfm_cache, ref_best_rd);
+ inter_super_block_yrd(cpi, x, rate_y, distortion_y, &skippable_y, psse,
+ bsize, txfm_cache, ref_best_rd);
if (*rate_y == INT_MAX) {
*rate2 = INT_MAX;
*distortion = INT64_MAX;
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].dst.buf = orig_dst[i];
- xd->plane[i].dst.stride = orig_dst_stride[i];
- }
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX;
}
@@ -3036,10 +3016,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
if (*rate_uv == INT_MAX) {
*rate2 = INT_MAX;
*distortion = INT64_MAX;
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].dst.buf = orig_dst[i];
- xd->plane[i].dst.stride = orig_dst_stride[i];
- }
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
return INT64_MAX;
}
@@ -3049,11 +3026,7 @@ static int64_t handle_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
*skippable = skippable_y && skippable_uv;
}
- for (i = 0; i < MAX_MB_PLANE; i++) {
- xd->plane[i].dst.buf = orig_dst[i];
- xd->plane[i].dst.stride = orig_dst_stride[i];
- }
-
+ restore_dst_buf(xd, orig_dst, orig_dst_stride);
return this_rd; // if 0, this will be re-calculated by caller
}
@@ -3065,9 +3038,9 @@ static void swap_block_ptr(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
for (i = 0; i < max_plane; ++i) {
p[i].coeff = ctx->coeff_pbuf[i][1];
- pd[i].qcoeff = ctx->qcoeff_pbuf[i][1];
+ p[i].qcoeff = ctx->qcoeff_pbuf[i][1];
pd[i].dqcoeff = ctx->dqcoeff_pbuf[i][1];
- pd[i].eobs = ctx->eobs_pbuf[i][1];
+ p[i].eobs = ctx->eobs_pbuf[i][1];
ctx->coeff_pbuf[i][1] = ctx->coeff_pbuf[i][0];
ctx->qcoeff_pbuf[i][1] = ctx->qcoeff_pbuf[i][0];
@@ -3075,9 +3048,9 @@ static void swap_block_ptr(MACROBLOCK *x, PICK_MODE_CONTEXT *ctx,
ctx->eobs_pbuf[i][1] = ctx->eobs_pbuf[i][0];
ctx->coeff_pbuf[i][0] = p[i].coeff;
- ctx->qcoeff_pbuf[i][0] = pd[i].qcoeff;
+ ctx->qcoeff_pbuf[i][0] = p[i].qcoeff;
ctx->dqcoeff_pbuf[i][0] = pd[i].dqcoeff;
- ctx->eobs_pbuf[i][0] = pd[i].eobs;
+ ctx->eobs_pbuf[i][0] = p[i].eobs;
}
}
@@ -3090,9 +3063,11 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int rate_y = 0, rate_uv = 0, rate_y_tokenonly = 0, rate_uv_tokenonly = 0;
int y_skip = 0, uv_skip = 0;
int64_t dist_y = 0, dist_uv = 0, tx_cache[TX_MODES] = { 0 };
+ TX_SIZE max_uv_tx_size;
x->skip_encode = 0;
ctx->skip = 0;
xd->mi_8x8[0]->mbmi.ref_frame[0] = INTRA_FRAME;
+
if (bsize >= BLOCK_8X8) {
if (rd_pick_intra_sby_mode(cpi, x, &rate_y, &rate_y_tokenonly,
&dist_y, &y_skip, bsize, tx_cache,
@@ -3100,8 +3075,9 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
*returnrate = INT_MAX;
return;
}
+ max_uv_tx_size = get_uv_tx_size_impl(xd->mi_8x8[0]->mbmi.tx_size, bsize);
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly,
- &dist_uv, &uv_skip, bsize);
+ &dist_uv, &uv_skip, bsize, max_uv_tx_size);
} else {
y_skip = 0;
if (rd_pick_intra_sub_8x8_y_mode(cpi, x, &rate_y, &rate_y_tokenonly,
@@ -3109,19 +3085,19 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
*returnrate = INT_MAX;
return;
}
+ max_uv_tx_size = get_uv_tx_size_impl(xd->mi_8x8[0]->mbmi.tx_size, bsize);
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv, &rate_uv_tokenonly,
- &dist_uv, &uv_skip, BLOCK_8X8);
+ &dist_uv, &uv_skip, BLOCK_8X8, max_uv_tx_size);
}
if (y_skip && uv_skip) {
*returnrate = rate_y + rate_uv - rate_y_tokenonly - rate_uv_tokenonly +
- vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd), 1);
+ vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
*returndist = dist_y + dist_uv;
vp9_zero(ctx->tx_rd_diff);
} else {
int i;
- *returnrate = rate_y + rate_uv +
- vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd), 0);
+ *returnrate = rate_y + rate_uv + vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0);
*returndist = dist_y + dist_uv;
if (cpi->sf.tx_size_search_method == USE_FULL_RD)
for (i = 0; i < TX_MODES; i++) {
@@ -3143,10 +3119,10 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx,
int64_t best_rd_so_far) {
- VP9_COMMON *cm = &cpi->common;
- MACROBLOCKD *xd = &x->e_mbd;
- MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
- const struct segmentation *seg = &cm->seg;
+ VP9_COMMON *const cm = &cpi->common;
+ MACROBLOCKD *const xd = &x->e_mbd;
+ MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
+ const struct segmentation *const seg = &cm->seg;
const BLOCK_SIZE block_size = get_plane_block_size(bsize, &xd->plane[0]);
MB_PREDICTION_MODE this_mode;
MV_REFERENCE_FRAME ref_frame, second_ref_frame;
@@ -3157,19 +3133,14 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int_mv single_newmv[MAX_REF_FRAMES] = { { 0 } };
static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
VP9_ALT_FLAG };
- int idx_list[4] = {0,
- cpi->lst_fb_idx,
- cpi->gld_fb_idx,
- cpi->alt_fb_idx};
int64_t best_rd = best_rd_so_far;
int64_t best_tx_rd[TX_MODES];
int64_t best_tx_diff[TX_MODES];
- int64_t best_pred_diff[NB_PREDICTION_TYPES];
- int64_t best_pred_rd[NB_PREDICTION_TYPES];
+ int64_t best_pred_diff[REFERENCE_MODES];
+ int64_t best_pred_rd[REFERENCE_MODES];
int64_t best_filter_rd[SWITCHABLE_FILTER_CONTEXTS];
int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS];
MB_MODE_INFO best_mbmode = { 0 };
- int j;
int mode_index, best_mode_index = 0;
unsigned int ref_costs_single[MAX_REF_FRAMES], ref_costs_comp[MAX_REF_FRAMES];
vp9_prob comp_mode_p;
@@ -3177,31 +3148,31 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int64_t best_inter_rd = INT64_MAX;
MB_PREDICTION_MODE best_intra_mode = DC_PRED;
MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME;
- INTERPOLATION_TYPE tmp_best_filter = SWITCHABLE;
+ INTERP_FILTER tmp_best_filter = SWITCHABLE;
int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES];
int64_t dist_uv[TX_SIZES];
int skip_uv[TX_SIZES];
MB_PREDICTION_MODE mode_uv[TX_SIZES];
- struct scale_factors scale_factor[4];
- unsigned int ref_frame_mask = 0;
- unsigned int mode_mask = 0;
int64_t mode_distortions[MB_MODE_COUNT] = {-1};
- int64_t frame_distortions[MAX_REF_FRAMES] = {-1};
int intra_cost_penalty = 20 * vp9_dc_quant(cm->base_qindex, cm->y_dc_delta_q);
const int bws = num_8x8_blocks_wide_lookup[bsize] / 2;
const int bhs = num_8x8_blocks_high_lookup[bsize] / 2;
int best_skip2 = 0;
+ int mode_skip_mask = 0;
+ int mode_skip_start = cpi->sf.mode_skip_start + 1;
+ const int *const rd_threshes = cpi->rd_threshes[segment_id][bsize];
+ const int *const rd_thresh_freq_fact = cpi->rd_thresh_freq_fact[bsize];
+ const int mode_search_skip_flags = cpi->sf.mode_search_skip_flags;
+ const int intra_y_mode_mask =
+ cpi->sf.intra_y_mode_mask[max_txsize_lookup[bsize]];
+ int disable_inter_mode_mask = cpi->sf.disable_inter_mode_mask[bsize];
x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
- // Everywhere the flag is set the error is much higher than its neighbors.
- ctx->frames_with_high_error = 0;
- ctx->modes_with_high_error = 0;
-
estimate_ref_frame_costs(cpi, segment_id, ref_costs_single, ref_costs_comp,
&comp_mode_p);
- for (i = 0; i < NB_PREDICTION_TYPES; ++i)
+ for (i = 0; i < REFERENCE_MODES; ++i)
best_pred_rd[i] = INT64_MAX;
for (i = 0; i < TX_MODES; i++)
best_tx_rd[i] = INT64_MAX;
@@ -3209,51 +3180,106 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
best_filter_rd[i] = INT64_MAX;
for (i = 0; i < TX_SIZES; i++)
rate_uv_intra[i] = INT_MAX;
+ for (i = 0; i < MAX_REF_FRAMES; ++i)
+ x->pred_sse[i] = INT_MAX;
*returnrate = INT_MAX;
- // Create a mask set to 1 for each reference frame used by a smaller
- // resolution.
- if (cpi->sf.use_avoid_tested_higherror) {
- switch (block_size) {
- case BLOCK_64X64:
- for (i = 0; i < 4; i++) {
- for (j = 0; j < 4; j++) {
- ref_frame_mask |= x->mb_context[i][j].frames_with_high_error;
- mode_mask |= x->mb_context[i][j].modes_with_high_error;
- }
- }
- for (i = 0; i < 4; i++) {
- ref_frame_mask |= x->sb32_context[i].frames_with_high_error;
- mode_mask |= x->sb32_context[i].modes_with_high_error;
- }
- break;
- case BLOCK_32X32:
- for (i = 0; i < 4; i++) {
- ref_frame_mask |=
- x->mb_context[x->sb_index][i].frames_with_high_error;
- mode_mask |= x->mb_context[x->sb_index][i].modes_with_high_error;
+ for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
+ x->pred_mv_sad[ref_frame] = INT_MAX;
+ if (cpi->ref_frame_flags & flag_list[ref_frame]) {
+ vp9_setup_buffer_inter(cpi, x, tile,
+ ref_frame, block_size, mi_row, mi_col,
+ frame_mv[NEARESTMV], frame_mv[NEARMV], yv12_mb);
+ }
+ frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
+ frame_mv[ZEROMV][ref_frame].as_int = 0;
+ }
+
+ for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ++ref_frame) {
+ // All modes from vp9_mode_order that use this frame as any ref
+ static const int ref_frame_mask_all[] = {
+ 0x0, 0x123291, 0x25c444, 0x39b722
+ };
+ // Fixed mv modes (NEARESTMV, NEARMV, ZEROMV) from vp9_mode_order that use
+ // this frame as their primary ref
+ static const int ref_frame_mask_fixedmv[] = {
+ 0x0, 0x121281, 0x24c404, 0x080102
+ };
+ if (!(cpi->ref_frame_flags & flag_list[ref_frame])) {
+ // Skip modes for missing references
+ mode_skip_mask |= ref_frame_mask_all[ref_frame];
+ } else if (cpi->sf.reference_masking) {
+ for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
+ // Skip fixed mv modes for poor references
+ if ((x->pred_mv_sad[ref_frame] >> 2) > x->pred_mv_sad[i]) {
+ mode_skip_mask |= ref_frame_mask_fixedmv[ref_frame];
+ break;
}
- break;
- default:
- // Until we handle all block sizes set it to present;
- ref_frame_mask = 0;
- mode_mask = 0;
- break;
+ }
+ }
+ // If the segment reference frame feature is enabled....
+ // then do nothing if the current ref frame is not allowed..
+ if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) &&
+ vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) != (int)ref_frame) {
+ mode_skip_mask |= ref_frame_mask_all[ref_frame];
}
- ref_frame_mask = ~ref_frame_mask;
- mode_mask = ~mode_mask;
}
- for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
- if (cpi->ref_frame_flags & flag_list[ref_frame]) {
- setup_buffer_inter(cpi, x, tile, idx_list[ref_frame], ref_frame,
- block_size, mi_row, mi_col,
- frame_mv[NEARESTMV], frame_mv[NEARMV],
- yv12_mb, scale_factor);
+ // If the segment skip feature is enabled....
+ // then do nothing if the current mode is not allowed..
+ if (vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)) {
+ const int inter_non_zero_mode_mask = 0x1F7F7;
+ mode_skip_mask |= inter_non_zero_mode_mask;
+ }
+
+ // Disable this drop out case if the ref frame
+ // segment level feature is enabled for this segment. This is to
+ // prevent the possibility that we end up unable to pick any mode.
+ if (!vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME)) {
+ // Only consider ZEROMV/ALTREF_FRAME for alt ref frame,
+ // unless ARNR filtering is enabled in which case we want
+ // an unfiltered alternative. We allow near/nearest as well
+ // because they may result in zero-zero MVs but be cheaper.
+ if (cpi->rc.is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) {
+ const int altref_zero_mask =
+ ~((1 << THR_NEARESTA) | (1 << THR_NEARA) | (1 << THR_ZEROA));
+ mode_skip_mask |= altref_zero_mask;
+ if (frame_mv[NEARMV][ALTREF_FRAME].as_int != 0)
+ mode_skip_mask |= (1 << THR_NEARA);
+ if (frame_mv[NEARESTMV][ALTREF_FRAME].as_int != 0)
+ mode_skip_mask |= (1 << THR_NEARESTA);
}
- frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
- frame_mv[ZEROMV][ref_frame].as_int = 0;
+ }
+
+ // TODO(JBB): This is to make up for the fact that we don't have sad
+ // functions that work when the block size reads outside the umv. We
+ // should fix this either by making the motion search just work on
+ // a representative block in the boundary ( first ) and then implement a
+ // function that does sads when inside the border..
+ if ((mi_row + bhs) > cm->mi_rows || (mi_col + bws) > cm->mi_cols) {
+ const int new_modes_mask =
+ (1 << THR_NEWMV) | (1 << THR_NEWG) | (1 << THR_NEWA) |
+ (1 << THR_COMP_NEWLA) | (1 << THR_COMP_NEWGA);
+ mode_skip_mask |= new_modes_mask;
+ }
+
+ if (bsize > cpi->sf.max_intra_bsize) {
+ mode_skip_mask |= 0xFF30808;
+ }
+
+ if (!x->in_active_map) {
+ int mode_index;
+ assert(cpi->ref_frame_flags & VP9_LAST_FLAG);
+ if (frame_mv[NEARESTMV][LAST_FRAME].as_int == 0)
+ mode_index = THR_NEARESTMV;
+ else if (frame_mv[NEARMV][LAST_FRAME].as_int == 0)
+ mode_index = THR_NEARMV;
+ else
+ mode_index = THR_ZEROMV;
+ mode_skip_mask = ~(1 << mode_index);
+ mode_skip_start = MAX_MODES;
+ disable_inter_mode_mask = 0;
}
for (mode_index = 0; mode_index < MAX_MODES; ++mode_index) {
@@ -3267,125 +3293,137 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int64_t tx_cache[TX_MODES];
int i;
int this_skip2 = 0;
- int64_t total_sse = INT_MAX;
+ int64_t total_sse = INT64_MAX;
int early_term = 0;
- for (i = 0; i < TX_MODES; ++i)
- tx_cache[i] = INT64_MAX;
-
- x->skip = 0;
- this_mode = vp9_mode_order[mode_index].mode;
- ref_frame = vp9_mode_order[mode_index].ref_frame;
- second_ref_frame = vp9_mode_order[mode_index].second_ref_frame;
-
// Look at the reference frame of the best mode so far and set the
// skip mask to look at a subset of the remaining modes.
- if (mode_index > cpi->sf.mode_skip_start) {
- if (mode_index == (cpi->sf.mode_skip_start + 1)) {
- switch (vp9_mode_order[best_mode_index].ref_frame) {
- case INTRA_FRAME:
- cpi->mode_skip_mask = 0;
- break;
- case LAST_FRAME:
- cpi->mode_skip_mask = LAST_FRAME_MODE_MASK;
- break;
- case GOLDEN_FRAME:
- cpi->mode_skip_mask = GOLDEN_FRAME_MODE_MASK;
- break;
- case ALTREF_FRAME:
- cpi->mode_skip_mask = ALT_REF_MODE_MASK;
- break;
- case NONE:
- case MAX_REF_FRAMES:
- assert(!"Invalid Reference frame");
- }
+ if (mode_index == mode_skip_start) {
+ switch (vp9_mode_order[best_mode_index].ref_frame[0]) {
+ case INTRA_FRAME:
+ break;
+ case LAST_FRAME:
+ mode_skip_mask |= LAST_FRAME_MODE_MASK;
+ break;
+ case GOLDEN_FRAME:
+ mode_skip_mask |= GOLDEN_FRAME_MODE_MASK;
+ break;
+ case ALTREF_FRAME:
+ mode_skip_mask |= ALT_REF_MODE_MASK;
+ break;
+ case NONE:
+ case MAX_REF_FRAMES:
+ assert(0 && "Invalid Reference frame");
}
- if (cpi->mode_skip_mask & ((int64_t)1 << mode_index))
- continue;
}
-
- // Skip if the current reference frame has been masked off
- if (cpi->sf.reference_masking && !cpi->set_ref_frame_mask &&
- (cpi->ref_frame_mask & (1 << ref_frame)))
+ if (mode_skip_mask & (1 << mode_index))
continue;
// Test best rd so far against threshold for trying this mode.
- if ((best_rd < ((int64_t)cpi->rd_threshes[segment_id][bsize][mode_index] *
- cpi->rd_thresh_freq_fact[bsize][mode_index] >> 5)) ||
- cpi->rd_threshes[segment_id][bsize][mode_index] == INT_MAX)
- continue;
-
- // Do not allow compound prediction if the segment level reference
- // frame feature is in use as in this case there can only be one reference.
- if ((second_ref_frame > INTRA_FRAME) &&
- vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME))
- continue;
+ if (best_rd < ((int64_t)rd_threshes[mode_index] *
+ rd_thresh_freq_fact[mode_index] >> 5) ||
+ rd_threshes[mode_index] == INT_MAX)
+ continue;
- // Skip some checking based on small partitions' result.
- if (x->fast_ms > 1 && !ref_frame)
- continue;
- if (x->fast_ms > 2 && ref_frame != x->subblock_ref)
+ this_mode = vp9_mode_order[mode_index].mode;
+ ref_frame = vp9_mode_order[mode_index].ref_frame[0];
+ if (ref_frame != INTRA_FRAME &&
+ disable_inter_mode_mask & (1 << INTER_OFFSET(this_mode)))
continue;
+ second_ref_frame = vp9_mode_order[mode_index].ref_frame[1];
- if (cpi->sf.use_avoid_tested_higherror && bsize >= BLOCK_8X8) {
- if (!(ref_frame_mask & (1 << ref_frame))) {
+ comp_pred = second_ref_frame > INTRA_FRAME;
+ if (comp_pred) {
+ if ((mode_search_skip_flags & FLAG_SKIP_COMP_BESTINTRA) &&
+ vp9_mode_order[best_mode_index].ref_frame[0] == INTRA_FRAME)
continue;
- }
- if (!(mode_mask & (1 << this_mode))) {
+ if ((mode_search_skip_flags & FLAG_SKIP_COMP_REFMISMATCH) &&
+ ref_frame != best_inter_ref_frame &&
+ second_ref_frame != best_inter_ref_frame)
continue;
- }
- if (second_ref_frame != NONE
- && !(ref_frame_mask & (1 << second_ref_frame))) {
+ mode_excluded = cm->reference_mode == SINGLE_REFERENCE;
+ } else {
+ if (ref_frame != INTRA_FRAME)
+ mode_excluded = cm->reference_mode == COMPOUND_REFERENCE;
+ }
+
+ if (ref_frame == INTRA_FRAME) {
+ if (!(intra_y_mode_mask & (1 << this_mode)))
continue;
+ if (this_mode != DC_PRED) {
+ // Disable intra modes other than DC_PRED for blocks with low variance
+ // Threshold for intra skipping based on source variance
+ // TODO(debargha): Specialize the threshold for super block sizes
+ const unsigned int skip_intra_var_thresh = 64;
+ if ((mode_search_skip_flags & FLAG_SKIP_INTRA_LOWVAR) &&
+ x->source_variance < skip_intra_var_thresh)
+ continue;
+ // Only search the oblique modes if the best so far is
+ // one of the neighboring directional modes
+ if ((mode_search_skip_flags & FLAG_SKIP_INTRA_BESTINTER) &&
+ (this_mode >= D45_PRED && this_mode <= TM_PRED)) {
+ if (vp9_mode_order[best_mode_index].ref_frame[0] > INTRA_FRAME)
+ continue;
+ }
+ if (mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) {
+ if (conditional_skipintra(this_mode, best_intra_mode))
+ continue;
+ }
+ }
+ } else {
+ // TODO(aconverse): Find out if this is still productive then clean up or
+ // remove
+ // if we're near/nearest and mv == 0,0, compare to zeromv
+ if (x->in_active_map &&
+ !(disable_inter_mode_mask & (1 << INTER_OFFSET(ZEROMV))) &&
+ (this_mode == NEARMV || this_mode == NEARESTMV ||
+ this_mode == ZEROMV) &&
+ frame_mv[this_mode][ref_frame].as_int == 0 &&
+ !vp9_segfeature_active(&cm->seg, mbmi->segment_id, SEG_LVL_SKIP) &&
+ (!comp_pred || frame_mv[this_mode][second_ref_frame].as_int == 0)) {
+ int rfc = mbmi->mode_context[ref_frame];
+ int c1 = cost_mv_ref(cpi, NEARMV, rfc);
+ int c2 = cost_mv_ref(cpi, NEARESTMV, rfc);
+ int c3 = cost_mv_ref(cpi, ZEROMV, rfc);
+
+ if (this_mode == NEARMV) {
+ if (c1 > c3)
+ continue;
+ } else if (this_mode == NEARESTMV) {
+ if (c2 > c3)
+ continue;
+ } else {
+ assert(this_mode == ZEROMV);
+ if (!comp_pred) {
+ if ((c3 >= c2 &&
+ frame_mv[NEARESTMV][ref_frame].as_int == 0) ||
+ (c3 >= c1 &&
+ frame_mv[NEARMV][ref_frame].as_int == 0))
+ continue;
+ } else {
+ if ((c3 >= c2 &&
+ frame_mv[NEARESTMV][ref_frame].as_int == 0 &&
+ frame_mv[NEARESTMV][second_ref_frame].as_int == 0) ||
+ (c3 >= c1 &&
+ frame_mv[NEARMV][ref_frame].as_int == 0 &&
+ frame_mv[NEARMV][second_ref_frame].as_int == 0))
+ continue;
+ }
+ }
}
}
+ mbmi->mode = this_mode;
+ mbmi->uv_mode = x->in_active_map ? DC_PRED : this_mode;
mbmi->ref_frame[0] = ref_frame;
mbmi->ref_frame[1] = second_ref_frame;
-
- if (!(ref_frame == INTRA_FRAME
- || (cpi->ref_frame_flags & flag_list[ref_frame]))) {
- continue;
- }
- if (!(second_ref_frame == NONE
- || (cpi->ref_frame_flags & flag_list[second_ref_frame]))) {
- continue;
- }
-
- comp_pred = second_ref_frame > INTRA_FRAME;
- if (comp_pred) {
- if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_COMP_BESTINTRA)
- if (vp9_mode_order[best_mode_index].ref_frame == INTRA_FRAME)
- continue;
- if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_COMP_REFMISMATCH)
- if (ref_frame != best_inter_ref_frame &&
- second_ref_frame != best_inter_ref_frame)
- continue;
- }
-
- set_scale_factors(xd, ref_frame, second_ref_frame, scale_factor);
- mbmi->uv_mode = DC_PRED;
-
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
- mbmi->interp_filter = cm->mcomp_filter_type;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, cm);
-
- if (comp_pred) {
- if (!(cpi->ref_frame_flags & flag_list[second_ref_frame]))
- continue;
- set_scale_factors(xd, ref_frame, second_ref_frame, scale_factor);
-
- mode_excluded = mode_excluded
- ? mode_excluded
- : cm->comp_pred_mode == SINGLE_PREDICTION_ONLY;
- } else {
- if (ref_frame != INTRA_FRAME && second_ref_frame != INTRA_FRAME) {
- mode_excluded =
- mode_excluded ?
- mode_excluded : cm->comp_pred_mode == COMP_PREDICTION_ONLY;
- }
- }
+ mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP
+ : cm->interp_filter;
+ x->skip = 0;
+ set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
// Select prediction reference frames.
for (i = 0; i < MAX_MB_PLANE; i++) {
@@ -3394,46 +3432,8 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
xd->plane[i].pre[1] = yv12_mb[second_ref_frame][i];
}
- // If the segment reference frame feature is enabled....
- // then do nothing if the current ref frame is not allowed..
- if (vp9_segfeature_active(seg, segment_id, SEG_LVL_REF_FRAME) &&
- vp9_get_segdata(seg, segment_id, SEG_LVL_REF_FRAME) !=
- (int)ref_frame) {
- continue;
- // If the segment skip feature is enabled....
- // then do nothing if the current mode is not allowed..
- } else if (vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP) &&
- (this_mode != ZEROMV && ref_frame != INTRA_FRAME)) {
- continue;
- // Disable this drop out case if the ref frame
- // segment level feature is enabled for this segment. This is to
- // prevent the possibility that we end up unable to pick any mode.
- } else if (!vp9_segfeature_active(seg, segment_id,
- SEG_LVL_REF_FRAME)) {
- // Only consider ZEROMV/ALTREF_FRAME for alt ref frame,
- // unless ARNR filtering is enabled in which case we want
- // an unfiltered alternative. We allow near/nearest as well
- // because they may result in zero-zero MVs but be cheaper.
- if (cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0)) {
- if ((this_mode != ZEROMV &&
- !(this_mode == NEARMV &&
- frame_mv[NEARMV][ALTREF_FRAME].as_int == 0) &&
- !(this_mode == NEARESTMV &&
- frame_mv[NEARESTMV][ALTREF_FRAME].as_int == 0)) ||
- ref_frame != ALTREF_FRAME) {
- continue;
- }
- }
- }
- // TODO(JBB): This is to make up for the fact that we don't have sad
- // functions that work when the block size reads outside the umv. We
- // should fix this either by making the motion search just work on
- // a representative block in the boundary ( first ) and then implement a
- // function that does sads when inside the border..
- if (((mi_row + bhs) > cm->mi_rows || (mi_col + bws) > cm->mi_cols) &&
- this_mode == NEWMV) {
- continue;
- }
+ for (i = 0; i < TX_MODES; ++i)
+ tx_cache[i] = INT64_MAX;
#ifdef MODE_TEST_HIT_STATS
// TEST/DEBUG CODE
@@ -3441,44 +3441,19 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
cpi->mode_test_hits[bsize]++;
#endif
-
if (ref_frame == INTRA_FRAME) {
TX_SIZE uv_tx;
- // Disable intra modes other than DC_PRED for blocks with low variance
- // Threshold for intra skipping based on source variance
- // TODO(debargha): Specialize the threshold for super block sizes
- static const unsigned int skip_intra_var_thresh[BLOCK_SIZES] = {
- 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
- };
- if ((cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_LOWVAR) &&
- this_mode != DC_PRED &&
- x->source_variance < skip_intra_var_thresh[mbmi->sb_type])
- continue;
- // Only search the oblique modes if the best so far is
- // one of the neighboring directional modes
- if ((cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_BESTINTER) &&
- (this_mode >= D45_PRED && this_mode <= TM_PRED)) {
- if (vp9_mode_order[best_mode_index].ref_frame > INTRA_FRAME)
- continue;
- }
- mbmi->mode = this_mode;
- if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_INTRA_DIRMISMATCH) {
- if (conditional_skipintra(mbmi->mode, best_intra_mode))
- continue;
- }
-
- super_block_yrd(cpi, x, &rate_y, &distortion_y, &skippable, NULL,
- bsize, tx_cache, best_rd);
+ intra_super_block_yrd(cpi, x, &rate_y, &distortion_y, &skippable, NULL,
+ bsize, tx_cache, best_rd);
if (rate_y == INT_MAX)
continue;
- uv_tx = MIN(mbmi->tx_size, max_uv_txsize_lookup[bsize]);
+ uv_tx = get_uv_tx_size_impl(mbmi->tx_size, bsize);
if (rate_uv_intra[uv_tx] == INT_MAX) {
- choose_intra_uv_mode(cpi, ctx, bsize, &rate_uv_intra[uv_tx],
- &rate_uv_tokenonly[uv_tx],
- &dist_uv[uv_tx], &skip_uv[uv_tx],
- &mode_uv[uv_tx]);
+ choose_intra_uv_mode(cpi, ctx, bsize, uv_tx,
+ &rate_uv_intra[uv_tx], &rate_uv_tokenonly[uv_tx],
+ &dist_uv[uv_tx], &skip_uv[uv_tx], &mode_uv[uv_tx]);
}
rate_uv = rate_uv_tokenonly[uv_tx];
@@ -3491,8 +3466,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
rate2 += intra_cost_penalty;
distortion2 = distortion_y + distortion_uv;
} else {
- mbmi->mode = this_mode;
- compmode_cost = vp9_cost_bit(comp_mode_p, second_ref_frame > INTRA_FRAME);
this_rd = handle_inter_mode(cpi, x, tile, bsize,
tx_cache,
&rate2, &distortion2, &skippable,
@@ -3504,15 +3477,16 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
single_newmv, &total_sse, best_rd);
if (this_rd == INT64_MAX)
continue;
- }
- if (cm->comp_pred_mode == HYBRID_PREDICTION) {
- rate2 += compmode_cost;
+ compmode_cost = vp9_cost_bit(comp_mode_p, comp_pred);
+
+ if (cm->reference_mode == REFERENCE_MODE_SELECT)
+ rate2 += compmode_cost;
}
// Estimate the reference frame signaling cost and add it
// to the rolling cost variable.
- if (second_ref_frame > INTRA_FRAME) {
+ if (comp_pred) {
rate2 += ref_costs_comp[ref_frame];
} else {
rate2 += ref_costs_single[ref_frame];
@@ -3537,9 +3511,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int prob_skip_cost;
// Cost the skip mb case
- vp9_prob skip_prob =
- vp9_get_pred_prob_mbskip(cm, xd);
-
+ vp9_prob skip_prob = vp9_get_skip_prob(cm, xd);
if (skip_prob) {
prob_skip_cost = vp9_cost_bit(skip_prob, 1);
rate2 += prob_skip_cost;
@@ -3549,14 +3521,10 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
if (RDCOST(x->rdmult, x->rddiv, rate_y + rate_uv, distortion2) <
RDCOST(x->rdmult, x->rddiv, 0, total_sse)) {
// Add in the cost of the no skip flag.
- int prob_skip_cost = vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd),
- 0);
- rate2 += prob_skip_cost;
+ rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0);
} else {
// FIXME(rbultje) make this work for splitmv also
- int prob_skip_cost = vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd),
- 1);
- rate2 += prob_skip_cost;
+ rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
distortion2 = total_sse;
assert(total_sse >= 0);
rate2 -= (rate_y + rate_uv);
@@ -3566,32 +3534,29 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
}
} else if (mb_skip_allowed) {
// Add in the cost of the no skip flag.
- int prob_skip_cost = vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd),
- 0);
- rate2 += prob_skip_cost;
+ rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0);
}
// Calculate the final RD estimate for this mode.
this_rd = RDCOST(x->rdmult, x->rddiv, rate2, distortion2);
}
+ if (ref_frame == INTRA_FRAME) {
// Keep record of best intra rd
- if (!is_inter_block(&xd->mi_8x8[0]->mbmi) &&
- this_rd < best_intra_rd) {
- best_intra_rd = this_rd;
- best_intra_mode = xd->mi_8x8[0]->mbmi.mode;
- }
-
- // Keep record of best inter rd with single reference
- if (is_inter_block(&xd->mi_8x8[0]->mbmi) &&
- !has_second_ref(&xd->mi_8x8[0]->mbmi) &&
- !mode_excluded && this_rd < best_inter_rd) {
- best_inter_rd = this_rd;
- best_inter_ref_frame = ref_frame;
+ if (this_rd < best_intra_rd) {
+ best_intra_rd = this_rd;
+ best_intra_mode = mbmi->mode;
+ }
+ } else {
+ // Keep record of best inter rd with single reference
+ if (!comp_pred && !mode_excluded && this_rd < best_inter_rd) {
+ best_inter_rd = this_rd;
+ best_inter_ref_frame = ref_frame;
+ }
}
if (!disable_skip && ref_frame == INTRA_FRAME) {
- for (i = 0; i < NB_PREDICTION_TYPES; ++i)
+ for (i = 0; i < REFERENCE_MODES; ++i)
best_pred_rd[i] = MIN(best_pred_rd[i], this_rd);
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
best_filter_rd[i] = MIN(best_filter_rd[i], this_rd);
@@ -3602,10 +3567,6 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|| distortion2 < mode_distortions[this_mode]) {
mode_distortions[this_mode] = distortion2;
}
- if (frame_distortions[ref_frame] == -1
- || distortion2 < frame_distortions[ref_frame]) {
- frame_distortions[ref_frame] = distortion2;
- }
// Did this mode help.. i.e. is it the new best mode
if (this_rd < best_rd || x->skip) {
@@ -3632,7 +3593,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// TODO(debargha): enhance this test with a better distortion prediction
// based on qp, activity mask and history
- if ((cpi->sf.mode_search_skip_flags & FLAG_EARLY_TERMINATE) &&
+ if ((mode_search_skip_flags & FLAG_EARLY_TERMINATE) &&
(mode_index > MIN_EARLY_TERM_INDEX)) {
const int qstep = xd->plane[0].dequant[1];
// TODO(debargha): Enhance this by specializing for each mode_index
@@ -3651,9 +3612,9 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
/* keep record of best compound/single-only prediction */
if (!disable_skip && ref_frame != INTRA_FRAME) {
- int single_rd, hybrid_rd, single_rate, hybrid_rate;
+ int64_t single_rd, hybrid_rd, single_rate, hybrid_rate;
- if (cm->comp_pred_mode == HYBRID_PREDICTION) {
+ if (cm->reference_mode == REFERENCE_MODE_SELECT) {
single_rate = rate2 - compmode_cost;
hybrid_rate = rate2;
} else {
@@ -3664,40 +3625,39 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
single_rd = RDCOST(x->rdmult, x->rddiv, single_rate, distortion2);
hybrid_rd = RDCOST(x->rdmult, x->rddiv, hybrid_rate, distortion2);
- if (second_ref_frame <= INTRA_FRAME &&
- single_rd < best_pred_rd[SINGLE_PREDICTION_ONLY]) {
- best_pred_rd[SINGLE_PREDICTION_ONLY] = single_rd;
- } else if (second_ref_frame > INTRA_FRAME &&
- single_rd < best_pred_rd[COMP_PREDICTION_ONLY]) {
- best_pred_rd[COMP_PREDICTION_ONLY] = single_rd;
+ if (!comp_pred) {
+ if (single_rd < best_pred_rd[SINGLE_REFERENCE]) {
+ best_pred_rd[SINGLE_REFERENCE] = single_rd;
+ }
+ } else {
+ if (single_rd < best_pred_rd[COMPOUND_REFERENCE]) {
+ best_pred_rd[COMPOUND_REFERENCE] = single_rd;
+ }
}
- if (hybrid_rd < best_pred_rd[HYBRID_PREDICTION])
- best_pred_rd[HYBRID_PREDICTION] = hybrid_rd;
- }
+ if (hybrid_rd < best_pred_rd[REFERENCE_MODE_SELECT])
+ best_pred_rd[REFERENCE_MODE_SELECT] = hybrid_rd;
+
+ /* keep record of best filter type */
+ if (!mode_excluded && cm->interp_filter != BILINEAR) {
+ int64_t ref = cpi->rd_filter_cache[cm->interp_filter == SWITCHABLE ?
+ SWITCHABLE_FILTERS : cm->interp_filter];
+
+ for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
+ int64_t adj_rd;
+ if (ref == INT64_MAX)
+ adj_rd = 0;
+ else if (cpi->rd_filter_cache[i] == INT64_MAX)
+ // when early termination is triggered, the encoder does not have
+ // access to the rate-distortion cost. it only knows that the cost
+ // should be above the maximum valid value. hence it takes the known
+ // maximum plus an arbitrary constant as the rate-distortion cost.
+ adj_rd = cpi->mask_filter_rd - ref + 10;
+ else
+ adj_rd = cpi->rd_filter_cache[i] - ref;
- /* keep record of best filter type */
- if (!mode_excluded && !disable_skip && ref_frame != INTRA_FRAME &&
- cm->mcomp_filter_type != BILINEAR) {
- int64_t ref = cpi->rd_filter_cache[cm->mcomp_filter_type == SWITCHABLE ?
- SWITCHABLE_FILTERS : cm->mcomp_filter_type];
- for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
- int64_t adj_rd;
- // In cases of poor prediction, filter_cache[] can contain really big
- // values, which actually are bigger than this_rd itself. This can
- // cause negative best_filter_rd[] values, which is obviously silly.
- // Therefore, if filter_cache < ref, we do an adjusted calculation.
- if (cpi->rd_filter_cache[i] >= ref) {
- adj_rd = this_rd + cpi->rd_filter_cache[i] - ref;
- } else {
- // FIXME(rbultje) do this for comppsred also
- //
- // To prevent out-of-range computation in
- // adj_rd = cpi->rd_filter_cache[i] * this_rd / ref
- // cpi->rd_filter_cache[i] / ref is converted to a 256 based ratio.
- int tmp = cpi->rd_filter_cache[i] * 256 / ref;
- adj_rd = (this_rd * tmp) >> 8;
+ adj_rd += this_rd;
+ best_filter_rd[i] = MIN(best_filter_rd[i], adj_rd);
}
- best_filter_rd[i] = MIN(best_filter_rd[i], adj_rd);
}
}
@@ -3731,43 +3691,22 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// If we used an estimate for the uv intra rd in the loop above...
if (cpi->sf.use_uv_intra_rd_estimate) {
// Do Intra UV best rd mode selection if best mode choice above was intra.
- if (vp9_mode_order[best_mode_index].ref_frame == INTRA_FRAME) {
- TX_SIZE uv_tx_size = get_uv_tx_size(mbmi);
+ if (vp9_mode_order[best_mode_index].ref_frame[0] == INTRA_FRAME) {
+ TX_SIZE uv_tx_size;
+ *mbmi = best_mbmode;
+ uv_tx_size = get_uv_tx_size(mbmi);
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size],
&rate_uv_tokenonly[uv_tx_size],
&dist_uv[uv_tx_size],
&skip_uv[uv_tx_size],
- bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize);
+ bsize < BLOCK_8X8 ? BLOCK_8X8 : bsize,
+ uv_tx_size);
}
}
- // If we are using reference masking and the set mask flag is set then
- // create the reference frame mask.
- if (cpi->sf.reference_masking && cpi->set_ref_frame_mask)
- cpi->ref_frame_mask = ~(1 << vp9_mode_order[best_mode_index].ref_frame);
-
- // Flag all modes that have a distortion thats > 2x the best we found at
- // this level.
- for (mode_index = 0; mode_index < MB_MODE_COUNT; ++mode_index) {
- if (mode_index == NEARESTMV || mode_index == NEARMV || mode_index == NEWMV)
- continue;
-
- if (mode_distortions[mode_index] > 2 * *returndistortion) {
- ctx->modes_with_high_error |= (1 << mode_index);
- }
- }
-
- // Flag all ref frames that have a distortion thats > 2x the best we found at
- // this level.
- for (ref_frame = INTRA_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
- if (frame_distortions[ref_frame] > 2 * *returndistortion) {
- ctx->frames_with_high_error |= (1 << ref_frame);
- }
- }
-
- assert((cm->mcomp_filter_type == SWITCHABLE) ||
- (cm->mcomp_filter_type == best_mbmode.interp_filter) ||
- (best_mbmode.ref_frame[0] == INTRA_FRAME));
+ assert((cm->interp_filter == SWITCHABLE) ||
+ (cm->interp_filter == best_mbmode.interp_filter) ||
+ !is_inter_block(&best_mbmode));
// Updating rd_thresh_freq_fact[] here means that the different
// partition/block sizes are handled independently based on the best
@@ -3776,16 +3715,13 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// combination that wins out.
if (cpi->sf.adaptive_rd_thresh) {
for (mode_index = 0; mode_index < MAX_MODES; ++mode_index) {
+ int *const fact = &cpi->rd_thresh_freq_fact[bsize][mode_index];
+
if (mode_index == best_mode_index) {
- cpi->rd_thresh_freq_fact[bsize][mode_index] -=
- (cpi->rd_thresh_freq_fact[bsize][mode_index] >> 3);
+ *fact -= (*fact >> 3);
} else {
- cpi->rd_thresh_freq_fact[bsize][mode_index] += RD_THRESH_INC;
- if (cpi->rd_thresh_freq_fact[bsize][mode_index] >
- (cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT)) {
- cpi->rd_thresh_freq_fact[bsize][mode_index] =
- cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT;
- }
+ *fact = MIN(*fact + RD_THRESH_INC,
+ cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT);
}
}
}
@@ -3794,7 +3730,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
*mbmi = best_mbmode;
x->skip |= best_skip2;
- for (i = 0; i < NB_PREDICTION_TYPES; ++i) {
+ for (i = 0; i < REFERENCE_MODES; ++i) {
if (best_pred_rd[i] == INT64_MAX)
best_pred_diff[i] = INT_MIN;
else
@@ -3808,13 +3744,8 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
else
best_filter_diff[i] = best_rd - best_filter_rd[i];
}
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
assert(best_filter_diff[SWITCHABLE_FILTERS] == 0);
- } else {
- vp9_zero(best_filter_diff);
- }
-
- if (!x->skip) {
for (i = 0; i < TX_MODES; i++) {
if (best_tx_rd[i] == INT64_MAX)
best_tx_diff[i] = 0;
@@ -3822,11 +3753,21 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
best_tx_diff[i] = best_rd - best_tx_rd[i];
}
} else {
+ vp9_zero(best_filter_diff);
vp9_zero(best_tx_diff);
}
- set_scale_factors(xd, mbmi->ref_frame[0], mbmi->ref_frame[1],
- scale_factor);
+ if (!x->in_active_map) {
+ assert(mbmi->ref_frame[0] == LAST_FRAME);
+ assert(mbmi->ref_frame[1] == NONE);
+ assert(mbmi->mode == NEARESTMV ||
+ mbmi->mode == NEARMV ||
+ mbmi->mode == ZEROMV);
+ assert(frame_mv[mbmi->mode][LAST_FRAME].as_int == 0);
+ assert(mbmi->mode == mbmi->uv_mode);
+ }
+
+ set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
store_coding_context(x, ctx, best_mode_index,
&mbmi->ref_mvs[mbmi->ref_frame[0]][0],
&mbmi->ref_mvs[mbmi->ref_frame[1] < 0 ? 0 :
@@ -3857,16 +3798,12 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
struct buf_2d yv12_mb[4][MAX_MB_PLANE];
static const int flag_list[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
VP9_ALT_FLAG };
- int idx_list[4] = {0,
- cpi->lst_fb_idx,
- cpi->gld_fb_idx,
- cpi->alt_fb_idx};
int64_t best_rd = best_rd_so_far;
int64_t best_yrd = best_rd_so_far; // FIXME(rbultje) more precise
int64_t best_tx_rd[TX_MODES];
int64_t best_tx_diff[TX_MODES];
- int64_t best_pred_diff[NB_PREDICTION_TYPES];
- int64_t best_pred_rd[NB_PREDICTION_TYPES];
+ int64_t best_pred_diff[REFERENCE_MODES];
+ int64_t best_pred_rd[REFERENCE_MODES];
int64_t best_filter_rd[SWITCHABLE_FILTER_CONTEXTS];
int64_t best_filter_diff[SWITCHABLE_FILTER_CONTEXTS];
MB_MODE_INFO best_mbmode = { 0 };
@@ -3875,19 +3812,17 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
vp9_prob comp_mode_p;
int64_t best_inter_rd = INT64_MAX;
MV_REFERENCE_FRAME best_inter_ref_frame = LAST_FRAME;
- INTERPOLATION_TYPE tmp_best_filter = SWITCHABLE;
+ INTERP_FILTER tmp_best_filter = SWITCHABLE;
int rate_uv_intra[TX_SIZES], rate_uv_tokenonly[TX_SIZES];
int64_t dist_uv[TX_SIZES];
int skip_uv[TX_SIZES];
MB_PREDICTION_MODE mode_uv[TX_SIZES] = { 0 };
- struct scale_factors scale_factor[4];
- unsigned int ref_frame_mask = 0;
- unsigned int mode_mask = 0;
- int intra_cost_penalty = 20 * vp9_dc_quant(cpi->common.base_qindex,
- cpi->common.y_dc_delta_q);
+ int intra_cost_penalty = 20 * vp9_dc_quant(cm->base_qindex, cm->y_dc_delta_q);
int_mv seg_mvs[4][MAX_REF_FRAMES];
b_mode_info best_bmodes[4];
int best_skip2 = 0;
+ int ref_frame_mask = 0;
+ int mode_skip_mask = 0;
x->skip_encode = cpi->sf.skip_encode_frame && x->q_index < QIDX_SKIP_THRESH;
vpx_memset(x->zcoeff_blk[TX_4X4], 0, 4);
@@ -3901,7 +3836,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
estimate_ref_frame_costs(cpi, segment_id, ref_costs_single, ref_costs_comp,
&comp_mode_p);
- for (i = 0; i < NB_PREDICTION_TYPES; ++i)
+ for (i = 0; i < REFERENCE_MODES; ++i)
best_pred_rd[i] = INT64_MAX;
for (i = 0; i < TX_MODES; i++)
best_tx_rd[i] = INT64_MAX;
@@ -3912,26 +3847,28 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
*returnrate = INT_MAX;
- // Create a mask set to 1 for each reference frame used by a smaller
- // resolution.
- if (cpi->sf.use_avoid_tested_higherror) {
- ref_frame_mask = 0;
- mode_mask = 0;
- ref_frame_mask = ~ref_frame_mask;
- mode_mask = ~mode_mask;
- }
-
for (ref_frame = LAST_FRAME; ref_frame <= ALTREF_FRAME; ref_frame++) {
if (cpi->ref_frame_flags & flag_list[ref_frame]) {
- setup_buffer_inter(cpi, x, tile, idx_list[ref_frame], ref_frame,
- block_size, mi_row, mi_col,
- frame_mv[NEARESTMV], frame_mv[NEARMV],
- yv12_mb, scale_factor);
+ vp9_setup_buffer_inter(cpi, x, tile,
+ ref_frame, block_size, mi_row, mi_col,
+ frame_mv[NEARESTMV], frame_mv[NEARMV],
+ yv12_mb);
}
frame_mv[NEWMV][ref_frame].as_int = INVALID_MV;
frame_mv[ZEROMV][ref_frame].as_int = 0;
}
+ for (ref_frame = LAST_FRAME;
+ ref_frame <= ALTREF_FRAME && cpi->sf.reference_masking; ++ref_frame) {
+ int i;
+ for (i = LAST_FRAME; i <= ALTREF_FRAME; ++i) {
+ if ((x->pred_mv_sad[ref_frame] >> 1) > x->pred_mv_sad[i]) {
+ ref_frame_mask |= (1 << ref_frame);
+ break;
+ }
+ }
+ }
+
for (mode_index = 0; mode_index < MAX_REFS; ++mode_index) {
int mode_excluded = 0;
int64_t this_rd = INT64_MAX;
@@ -3950,40 +3887,35 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
tx_cache[i] = INT64_MAX;
x->skip = 0;
- ref_frame = vp9_ref_order[mode_index].ref_frame;
- second_ref_frame = vp9_ref_order[mode_index].second_ref_frame;
+ ref_frame = vp9_ref_order[mode_index].ref_frame[0];
+ second_ref_frame = vp9_ref_order[mode_index].ref_frame[1];
// Look at the reference frame of the best mode so far and set the
// skip mask to look at a subset of the remaining modes.
if (mode_index > 2 && cpi->sf.mode_skip_start < MAX_MODES) {
if (mode_index == 3) {
- switch (vp9_ref_order[best_mode_index].ref_frame) {
+ switch (vp9_ref_order[best_mode_index].ref_frame[0]) {
case INTRA_FRAME:
- cpi->mode_skip_mask = 0;
+ mode_skip_mask = 0;
break;
case LAST_FRAME:
- cpi->mode_skip_mask = 0x0010;
+ mode_skip_mask = 0x0010;
break;
case GOLDEN_FRAME:
- cpi->mode_skip_mask = 0x0008;
+ mode_skip_mask = 0x0008;
break;
case ALTREF_FRAME:
- cpi->mode_skip_mask = 0x0000;
+ mode_skip_mask = 0x0000;
break;
case NONE:
case MAX_REF_FRAMES:
- assert(!"Invalid Reference frame");
+ assert(0 && "Invalid Reference frame");
}
}
- if (cpi->mode_skip_mask & ((int64_t)1 << mode_index))
+ if (mode_skip_mask & (1 << mode_index))
continue;
}
- // Skip if the current reference frame has been masked off
- if (cpi->sf.reference_masking && !cpi->set_ref_frame_mask &&
- (cpi->ref_frame_mask & (1 << ref_frame)))
- continue;
-
// Test best rd so far against threshold for trying this mode.
if ((best_rd <
((int64_t)cpi->rd_thresh_sub8x8[segment_id][bsize][mode_index] *
@@ -4012,7 +3944,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
comp_pred = second_ref_frame > INTRA_FRAME;
if (comp_pred) {
if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_COMP_BESTINTRA)
- if (vp9_ref_order[best_mode_index].ref_frame == INTRA_FRAME)
+ if (vp9_ref_order[best_mode_index].ref_frame[0] == INTRA_FRAME)
continue;
if (cpi->sf.mode_search_skip_flags & FLAG_SKIP_COMP_REFMISMATCH)
if (ref_frame != best_inter_ref_frame &&
@@ -4022,35 +3954,32 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// TODO(jingning, jkoleszar): scaling reference frame not supported for
// sub8x8 blocks.
- if (ref_frame > 0 &&
- vp9_is_scaled(scale_factor[ref_frame].sfc))
+ if (ref_frame > 0 && vp9_is_scaled(&cm->frame_refs[ref_frame - 1].sf))
continue;
if (second_ref_frame > 0 &&
- vp9_is_scaled(scale_factor[second_ref_frame].sfc))
+ vp9_is_scaled(&cm->frame_refs[second_ref_frame - 1].sf))
continue;
- set_scale_factors(xd, ref_frame, second_ref_frame, scale_factor);
+ set_ref_ptrs(cm, xd, ref_frame, second_ref_frame);
mbmi->uv_mode = DC_PRED;
// Evaluate all sub-pel filters irrespective of whether we can use
// them for this frame.
- mbmi->interp_filter = cm->mcomp_filter_type;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, &cpi->common);
+ mbmi->interp_filter = cm->interp_filter == SWITCHABLE ? EIGHTTAP
+ : cm->interp_filter;
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (comp_pred) {
if (!(cpi->ref_frame_flags & flag_list[second_ref_frame]))
continue;
- set_scale_factors(xd, ref_frame, second_ref_frame, scale_factor);
- mode_excluded = mode_excluded
- ? mode_excluded
- : cm->comp_pred_mode == SINGLE_PREDICTION_ONLY;
+ mode_excluded = mode_excluded ? mode_excluded
+ : cm->reference_mode == SINGLE_REFERENCE;
} else {
if (ref_frame != INTRA_FRAME && second_ref_frame != INTRA_FRAME) {
- mode_excluded =
- mode_excluded ?
- mode_excluded : cm->comp_pred_mode == COMP_PREDICTION_ONLY;
+ mode_excluded = mode_excluded ?
+ mode_excluded : cm->reference_mode == COMPOUND_REFERENCE;
}
}
@@ -4081,7 +4010,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// unless ARNR filtering is enabled in which case we want
// an unfiltered alternative. We allow near/nearest as well
// because they may result in zero-zero MVs but be cheaper.
- if (cpi->is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0))
+ if (cpi->rc.is_src_frame_alt_ref && (cpi->oxcf.arnr_max_frames == 0))
continue;
}
@@ -4102,7 +4031,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
distortion2 += distortion_y;
if (rate_uv_intra[TX_4X4] == INT_MAX) {
- choose_intra_uv_mode(cpi, ctx, bsize, &rate_uv_intra[TX_4X4],
+ choose_intra_uv_mode(cpi, ctx, bsize, TX_4X4,
+ &rate_uv_intra[TX_4X4],
&rate_uv_tokenonly[TX_4X4],
&dist_uv[TX_4X4], &skip_uv[TX_4X4],
&mode_uv[TX_4X4]);
@@ -4139,13 +4069,21 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
cpi->rd_thresh_sub8x8[segment_id][bsize][THR_GOLD] : this_rd_thresh;
xd->mi_8x8[0]->mbmi.tx_size = TX_4X4;
- cpi->rd_filter_cache[SWITCHABLE_FILTERS] = INT64_MAX;
- if (cm->mcomp_filter_type != BILINEAR) {
+ cpi->mask_filter_rd = 0;
+ for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i)
+ cpi->rd_filter_cache[i] = INT64_MAX;
+
+ if (cm->interp_filter != BILINEAR) {
tmp_best_filter = EIGHTTAP;
if (x->source_variance <
cpi->sf.disable_filter_search_var_thresh) {
tmp_best_filter = EIGHTTAP;
- vp9_zero(cpi->rd_filter_cache);
+ } else if (cpi->sf.adaptive_pred_interp_filter == 1 &&
+ ctx->pred_interp_filter < SWITCHABLE) {
+ tmp_best_filter = ctx->pred_interp_filter;
+ } else if (cpi->sf.adaptive_pred_interp_filter == 2) {
+ tmp_best_filter = ctx->pred_interp_filter < SWITCHABLE ?
+ ctx->pred_interp_filter : 0;
} else {
for (switchable_filter_index = 0;
switchable_filter_index < SWITCHABLE_FILTERS;
@@ -4153,8 +4091,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
int newbest, rs;
int64_t rs_rd;
mbmi->interp_filter = switchable_filter_index;
- vp9_setup_interp_filters(xd, mbmi->interp_filter, &cpi->common);
-
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
tmp_rd = rd_pick_best_mbsegmentation(cpi, x, tile,
&mbmi->ref_mvs[ref_frame][0],
second_ref,
@@ -4167,23 +4104,25 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
if (tmp_rd == INT64_MAX)
continue;
- cpi->rd_filter_cache[switchable_filter_index] = tmp_rd;
rs = get_switchable_rate(x);
rs_rd = RDCOST(x->rdmult, x->rddiv, rs, 0);
+ cpi->rd_filter_cache[switchable_filter_index] = tmp_rd;
cpi->rd_filter_cache[SWITCHABLE_FILTERS] =
MIN(cpi->rd_filter_cache[SWITCHABLE_FILTERS],
tmp_rd + rs_rd);
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
tmp_rd += rs_rd;
+ cpi->mask_filter_rd = MAX(cpi->mask_filter_rd, tmp_rd);
+
newbest = (tmp_rd < tmp_best_rd);
if (newbest) {
tmp_best_filter = mbmi->interp_filter;
tmp_best_rd = tmp_rd;
}
- if ((newbest && cm->mcomp_filter_type == SWITCHABLE) ||
- (mbmi->interp_filter == cm->mcomp_filter_type &&
- cm->mcomp_filter_type != SWITCHABLE)) {
+ if ((newbest && cm->interp_filter == SWITCHABLE) ||
+ (mbmi->interp_filter == cm->interp_filter &&
+ cm->interp_filter != SWITCHABLE)) {
tmp_best_rdu = tmp_rd;
tmp_best_rate = rate;
tmp_best_ratey = rate_y;
@@ -4193,7 +4132,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
tmp_best_mbmode = *mbmi;
for (i = 0; i < 4; i++) {
tmp_best_bmodes[i] = xd->mi_8x8[0]->bmi[i];
- x->zcoeff_blk[TX_4X4][i] = !xd->plane[0].eobs[i];
+ x->zcoeff_blk[TX_4X4][i] = !x->plane[0].eobs[i];
}
pred_exists = 1;
if (switchable_filter_index == 0 &&
@@ -4212,12 +4151,12 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
}
- if (tmp_best_rdu == INT64_MAX)
+ if (tmp_best_rdu == INT64_MAX && pred_exists)
continue;
- mbmi->interp_filter = (cm->mcomp_filter_type == SWITCHABLE ?
- tmp_best_filter : cm->mcomp_filter_type);
- vp9_setup_interp_filters(xd, mbmi->interp_filter, &cpi->common);
+ mbmi->interp_filter = (cm->interp_filter == SWITCHABLE ?
+ tmp_best_filter : cm->interp_filter);
+ xd->interp_kernel = vp9_get_interp_kernel(mbmi->interp_filter);
if (!pred_exists) {
// Handles the special case when a filter that is not in the
// switchable list (bilinear, 6-tap) is indicated at the frame level
@@ -4233,11 +4172,6 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
if (tmp_rd == INT64_MAX)
continue;
} else {
- if (cpi->common.mcomp_filter_type == SWITCHABLE) {
- int rs = get_switchable_rate(x);
- tmp_best_rdu -= RDCOST(x->rdmult, x->rddiv, rs, 0);
- }
- tmp_rd = tmp_best_rdu;
total_sse = tmp_best_sse;
rate = tmp_best_rate;
rate_y = tmp_best_ratey;
@@ -4251,15 +4185,13 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
rate2 += rate;
distortion2 += distortion;
- if (cpi->common.mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
rate2 += get_switchable_rate(x);
- if (!mode_excluded) {
- if (comp_pred)
- mode_excluded = cpi->common.comp_pred_mode == SINGLE_PREDICTION_ONLY;
- else
- mode_excluded = cpi->common.comp_pred_mode == COMP_PREDICTION_ONLY;
- }
+ if (!mode_excluded)
+ mode_excluded = comp_pred ? cm->reference_mode == SINGLE_REFERENCE
+ : cm->reference_mode == COMPOUND_REFERENCE;
+
compmode_cost = vp9_cost_bit(comp_mode_p, comp_pred);
tmp_best_rdu = best_rd -
@@ -4286,9 +4218,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
}
- if (cpi->common.comp_pred_mode == HYBRID_PREDICTION) {
+ if (cm->reference_mode == REFERENCE_MODE_SELECT)
rate2 += compmode_cost;
- }
// Estimate the reference frame signaling cost and add it
// to the rolling cost variable.
@@ -4311,14 +4242,10 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
if (RDCOST(x->rdmult, x->rddiv, rate_y + rate_uv, distortion2) <
RDCOST(x->rdmult, x->rddiv, 0, total_sse)) {
// Add in the cost of the no skip flag.
- int prob_skip_cost = vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd),
- 0);
- rate2 += prob_skip_cost;
+ rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0);
} else {
// FIXME(rbultje) make this work for splitmv also
- int prob_skip_cost = vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd),
- 1);
- rate2 += prob_skip_cost;
+ rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 1);
distortion2 = total_sse;
assert(total_sse >= 0);
rate2 -= (rate_y + rate_uv);
@@ -4328,9 +4255,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
} else if (mb_skip_allowed) {
// Add in the cost of the no skip flag.
- int prob_skip_cost = vp9_cost_bit(vp9_get_pred_prob_mbskip(cm, xd),
- 0);
- rate2 += prob_skip_cost;
+ rate2 += vp9_cost_bit(vp9_get_skip_prob(cm, xd), 0);
}
// Calculate the final RD estimate for this mode.
@@ -4338,8 +4263,8 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
// Keep record of best inter rd with single reference
- if (xd->mi_8x8[0]->mbmi.ref_frame[0] > INTRA_FRAME &&
- xd->mi_8x8[0]->mbmi.ref_frame[1] == NONE &&
+ if (is_inter_block(&xd->mi_8x8[0]->mbmi) &&
+ !has_second_ref(&xd->mi_8x8[0]->mbmi) &&
!mode_excluded &&
this_rd < best_inter_rd) {
best_inter_rd = this_rd;
@@ -4347,7 +4272,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
}
if (!disable_skip && ref_frame == INTRA_FRAME) {
- for (i = 0; i < NB_PREDICTION_TYPES; ++i)
+ for (i = 0; i < REFERENCE_MODES; ++i)
best_pred_rd[i] = MIN(best_pred_rd[i], this_rd);
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++)
best_filter_rd[i] = MIN(best_filter_rd[i], this_rd);
@@ -4402,9 +4327,9 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
/* keep record of best compound/single-only prediction */
if (!disable_skip && ref_frame != INTRA_FRAME) {
- int single_rd, hybrid_rd, single_rate, hybrid_rate;
+ int64_t single_rd, hybrid_rd, single_rate, hybrid_rate;
- if (cpi->common.comp_pred_mode == HYBRID_PREDICTION) {
+ if (cm->reference_mode == REFERENCE_MODE_SELECT) {
single_rate = rate2 - compmode_cost;
hybrid_rate = rate2;
} else {
@@ -4416,31 +4341,35 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
hybrid_rd = RDCOST(x->rdmult, x->rddiv, hybrid_rate, distortion2);
if (second_ref_frame <= INTRA_FRAME &&
- single_rd < best_pred_rd[SINGLE_PREDICTION_ONLY]) {
- best_pred_rd[SINGLE_PREDICTION_ONLY] = single_rd;
+ single_rd < best_pred_rd[SINGLE_REFERENCE]) {
+ best_pred_rd[SINGLE_REFERENCE] = single_rd;
} else if (second_ref_frame > INTRA_FRAME &&
- single_rd < best_pred_rd[COMP_PREDICTION_ONLY]) {
- best_pred_rd[COMP_PREDICTION_ONLY] = single_rd;
+ single_rd < best_pred_rd[COMPOUND_REFERENCE]) {
+ best_pred_rd[COMPOUND_REFERENCE] = single_rd;
}
- if (hybrid_rd < best_pred_rd[HYBRID_PREDICTION])
- best_pred_rd[HYBRID_PREDICTION] = hybrid_rd;
+ if (hybrid_rd < best_pred_rd[REFERENCE_MODE_SELECT])
+ best_pred_rd[REFERENCE_MODE_SELECT] = hybrid_rd;
}
/* keep record of best filter type */
if (!mode_excluded && !disable_skip && ref_frame != INTRA_FRAME &&
- cm->mcomp_filter_type != BILINEAR) {
- int64_t ref = cpi->rd_filter_cache[cm->mcomp_filter_type == SWITCHABLE ?
- SWITCHABLE_FILTERS : cm->mcomp_filter_type];
+ cm->interp_filter != BILINEAR) {
+ int64_t ref = cpi->rd_filter_cache[cm->interp_filter == SWITCHABLE ?
+ SWITCHABLE_FILTERS : cm->interp_filter];
+ int64_t adj_rd;
for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; i++) {
- int64_t adj_rd;
- // In cases of poor prediction, filter_cache[] can contain really big
- // values, which actually are bigger than this_rd itself. This can
- // cause negative best_filter_rd[] values, which is obviously silly.
- // Therefore, if filter_cache < ref, we do an adjusted calculation.
- if (cpi->rd_filter_cache[i] >= ref)
- adj_rd = this_rd + cpi->rd_filter_cache[i] - ref;
- else // FIXME(rbultje) do this for comppred also
- adj_rd = this_rd - (ref - cpi->rd_filter_cache[i]) * this_rd / ref;
+ if (ref == INT64_MAX)
+ adj_rd = 0;
+ else if (cpi->rd_filter_cache[i] == INT64_MAX)
+ // when early termination is triggered, the encoder does not have
+ // access to the rate-distortion cost. it only knows that the cost
+ // should be above the maximum valid value. hence it takes the known
+ // maximum plus an arbitrary constant as the rate-distortion cost.
+ adj_rd = cpi->mask_filter_rd - ref + 10;
+ else
+ adj_rd = cpi->rd_filter_cache[i] - ref;
+
+ adj_rd += this_rd;
best_filter_rd[i] = MIN(best_filter_rd[i], adj_rd);
}
}
@@ -4479,30 +4408,27 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// If we used an estimate for the uv intra rd in the loop above...
if (cpi->sf.use_uv_intra_rd_estimate) {
// Do Intra UV best rd mode selection if best mode choice above was intra.
- if (vp9_ref_order[best_mode_index].ref_frame == INTRA_FRAME) {
- TX_SIZE uv_tx_size = get_uv_tx_size(mbmi);
+ if (vp9_ref_order[best_mode_index].ref_frame[0] == INTRA_FRAME) {
+ TX_SIZE uv_tx_size;
+ *mbmi = best_mbmode;
+ uv_tx_size = get_uv_tx_size(mbmi);
rd_pick_intra_sbuv_mode(cpi, x, ctx, &rate_uv_intra[uv_tx_size],
&rate_uv_tokenonly[uv_tx_size],
&dist_uv[uv_tx_size],
&skip_uv[uv_tx_size],
- BLOCK_8X8);
+ BLOCK_8X8, uv_tx_size);
}
}
- // If we are using reference masking and the set mask flag is set then
- // create the reference frame mask.
- if (cpi->sf.reference_masking && cpi->set_ref_frame_mask)
- cpi->ref_frame_mask = ~(1 << vp9_ref_order[best_mode_index].ref_frame);
-
if (best_rd == INT64_MAX && bsize < BLOCK_8X8) {
*returnrate = INT_MAX;
- *returndistortion = INT_MAX;
+ *returndistortion = INT64_MAX;
return best_rd;
}
- assert((cm->mcomp_filter_type == SWITCHABLE) ||
- (cm->mcomp_filter_type == best_mbmode.interp_filter) ||
- (best_mbmode.ref_frame[0] == INTRA_FRAME));
+ assert((cm->interp_filter == SWITCHABLE) ||
+ (cm->interp_filter == best_mbmode.interp_filter) ||
+ !is_inter_block(&best_mbmode));
// Updating rd_thresh_freq_fact[] here means that the different
// partition/block sizes are handled independently based on the best
@@ -4511,16 +4437,13 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// combination that wins out.
if (cpi->sf.adaptive_rd_thresh) {
for (mode_index = 0; mode_index < MAX_REFS; ++mode_index) {
+ int *const fact = &cpi->rd_thresh_freq_sub8x8[bsize][mode_index];
+
if (mode_index == best_mode_index) {
- cpi->rd_thresh_freq_sub8x8[bsize][mode_index] -=
- (cpi->rd_thresh_freq_sub8x8[bsize][mode_index] >> 3);
+ *fact -= (*fact >> 3);
} else {
- cpi->rd_thresh_freq_sub8x8[bsize][mode_index] += RD_THRESH_INC;
- if (cpi->rd_thresh_freq_sub8x8[bsize][mode_index] >
- (cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT)) {
- cpi->rd_thresh_freq_sub8x8[bsize][mode_index] =
- cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT;
- }
+ *fact = MIN(*fact + RD_THRESH_INC,
+ cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT);
}
}
}
@@ -4528,7 +4451,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
// macroblock modes
*mbmi = best_mbmode;
x->skip |= best_skip2;
- if (best_mbmode.ref_frame[0] == INTRA_FRAME) {
+ if (!is_inter_block(&best_mbmode)) {
for (i = 0; i < 4; i++)
xd->mi_8x8[0]->bmi[i].as_mode = best_bmodes[i].as_mode;
} else {
@@ -4539,7 +4462,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
mbmi->mv[1].as_int = xd->mi_8x8[0]->bmi[3].as_mv[1].as_int;
}
- for (i = 0; i < NB_PREDICTION_TYPES; ++i) {
+ for (i = 0; i < REFERENCE_MODES; ++i) {
if (best_pred_rd[i] == INT64_MAX)
best_pred_diff[i] = INT_MIN;
else
@@ -4553,7 +4476,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
else
best_filter_diff[i] = best_rd - best_filter_rd[i];
}
- if (cm->mcomp_filter_type == SWITCHABLE)
+ if (cm->interp_filter == SWITCHABLE)
assert(best_filter_diff[SWITCHABLE_FILTERS] == 0);
} else {
vp9_zero(best_filter_diff);
@@ -4570,8 +4493,7 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
vp9_zero(best_tx_diff);
}
- set_scale_factors(xd, mbmi->ref_frame[0], mbmi->ref_frame[1],
- scale_factor);
+ set_ref_ptrs(cm, xd, mbmi->ref_frame[0], mbmi->ref_frame[1]);
store_coding_context(x, ctx, best_mode_index,
&mbmi->ref_mvs[mbmi->ref_frame[0]][0],
&mbmi->ref_mvs[mbmi->ref_frame[1] < 0 ? 0 :
diff --git a/libvpx/vp9/encoder/vp9_rdopt.h b/libvpx/vp9/encoder/vp9_rdopt.h
index 92fb235..6968fa6 100644
--- a/libvpx/vp9/encoder/vp9_rdopt.h
+++ b/libvpx/vp9/encoder/vp9_rdopt.h
@@ -8,24 +8,50 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#ifndef VP9_ENCODER_VP9_RDOPT_H_
#define VP9_ENCODER_VP9_RDOPT_H_
+#include "vp9/encoder/vp9_onyx_int.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RDDIV_BITS 7
#define RDCOST(RM, DM, R, D) \
(((128 + ((int64_t)R) * (RM)) >> 8) + (D << DM))
#define QIDX_SKIP_THRESH 115
+#define MV_COST_WEIGHT 108
+#define MV_COST_WEIGHT_SUB 120
+
+#define INVALID_MV 0x80008000
+
struct TileInfo;
-int vp9_compute_rd_mult(VP9_COMP *cpi, int qindex);
+int vp9_compute_rd_mult(const VP9_COMP *cpi, int qindex);
void vp9_initialize_rd_consts(VP9_COMP *cpi);
void vp9_initialize_me_consts(VP9_COMP *cpi, int qindex);
+void vp9_model_rd_from_var_lapndz(unsigned int var, unsigned int n,
+ unsigned int qstep, int *rate,
+ int64_t *dist);
+
+void vp9_setup_buffer_inter(VP9_COMP *cpi, MACROBLOCK *x,
+ const TileInfo *const tile,
+ MV_REFERENCE_FRAME ref_frame,
+ BLOCK_SIZE block_size,
+ int mi_row, int mi_col,
+ int_mv frame_nearest_mv[MAX_REF_FRAMES],
+ int_mv frame_near_mv[MAX_REF_FRAMES],
+ struct buf_2d yv12_mb[4][MAX_MB_PLANE]);
+
+const YV12_BUFFER_CONFIG *vp9_get_scaled_ref_frame(const VP9_COMP *cpi,
+ int ref_frame);
+
void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
int *r, int64_t *d, BLOCK_SIZE bsize,
PICK_MODE_CONTEXT *ctx, int64_t best_rd);
@@ -50,12 +76,13 @@ int64_t vp9_rd_pick_inter_mode_sub8x8(VP9_COMP *cpi, MACROBLOCK *x,
void vp9_init_me_luts();
-void vp9_set_mbmode_and_mvs(MACROBLOCK *x,
- MB_PREDICTION_MODE mb, int_mv *mv);
+void vp9_get_entropy_contexts(BLOCK_SIZE bsize, TX_SIZE tx_size,
+ const struct macroblockd_plane *pd,
+ ENTROPY_CONTEXT t_above[16],
+ ENTROPY_CONTEXT t_left[16]);
-void vp9_get_entropy_contexts(TX_SIZE tx_size,
- ENTROPY_CONTEXT t_above[16], ENTROPY_CONTEXT t_left[16],
- const ENTROPY_CONTEXT *above, const ENTROPY_CONTEXT *left,
- int num_4x4_w, int num_4x4_h);
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_RDOPT_H_
diff --git a/libvpx/vp9/encoder/vp9_resize.c b/libvpx/vp9/encoder/vp9_resize.c
new file mode 100644
index 0000000..4e6efae
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_resize.c
@@ -0,0 +1,576 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <assert.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vp9/common/vp9_common.h"
+#include "vp9/encoder/vp9_resize.h"
+
+#define FILTER_BITS 7
+
+#define INTERP_TAPS 8
+#define SUBPEL_BITS 5
+#define SUBPEL_MASK ((1 << SUBPEL_BITS) - 1)
+#define INTERP_PRECISION_BITS 32
+
+typedef int16_t interp_kernel[INTERP_TAPS];
+
+// Filters for interpolation (0.5-band) - note this also filters integer pels.
+const interp_kernel vp9_filteredinterp_filters500[(1 << SUBPEL_BITS)] = {
+ {-3, 0, 35, 64, 35, 0, -3, 0},
+ {-3, -1, 34, 64, 36, 1, -3, 0},
+ {-3, -1, 32, 64, 38, 1, -3, 0},
+ {-2, -2, 31, 63, 39, 2, -3, 0},
+ {-2, -2, 29, 63, 41, 2, -3, 0},
+ {-2, -2, 28, 63, 42, 3, -4, 0},
+ {-2, -3, 27, 63, 43, 4, -4, 0},
+ {-2, -3, 25, 62, 45, 5, -4, 0},
+ {-2, -3, 24, 62, 46, 5, -4, 0},
+ {-2, -3, 23, 61, 47, 6, -4, 0},
+ {-2, -3, 21, 60, 49, 7, -4, 0},
+ {-1, -4, 20, 60, 50, 8, -4, -1},
+ {-1, -4, 19, 59, 51, 9, -4, -1},
+ {-1, -4, 17, 58, 52, 10, -4, 0},
+ {-1, -4, 16, 57, 53, 12, -4, -1},
+ {-1, -4, 15, 56, 54, 13, -4, -1},
+ {-1, -4, 14, 55, 55, 14, -4, -1},
+ {-1, -4, 13, 54, 56, 15, -4, -1},
+ {-1, -4, 12, 53, 57, 16, -4, -1},
+ {0, -4, 10, 52, 58, 17, -4, -1},
+ {-1, -4, 9, 51, 59, 19, -4, -1},
+ {-1, -4, 8, 50, 60, 20, -4, -1},
+ {0, -4, 7, 49, 60, 21, -3, -2},
+ {0, -4, 6, 47, 61, 23, -3, -2},
+ {0, -4, 5, 46, 62, 24, -3, -2},
+ {0, -4, 5, 45, 62, 25, -3, -2},
+ {0, -4, 4, 43, 63, 27, -3, -2},
+ {0, -4, 3, 42, 63, 28, -2, -2},
+ {0, -3, 2, 41, 63, 29, -2, -2},
+ {0, -3, 2, 39, 63, 31, -2, -2},
+ {0, -3, 1, 38, 64, 32, -1, -3},
+ {0, -3, 1, 36, 64, 34, -1, -3}
+};
+
+// Filters for interpolation (0.625-band) - note this also filters integer pels.
+const interp_kernel vp9_filteredinterp_filters625[(1 << SUBPEL_BITS)] = {
+ {-1, -8, 33, 80, 33, -8, -1, 0},
+ {-1, -8, 30, 80, 35, -8, -1, 1},
+ {-1, -8, 28, 80, 37, -7, -2, 1},
+ {0, -8, 26, 79, 39, -7, -2, 1},
+ {0, -8, 24, 79, 41, -7, -2, 1},
+ {0, -8, 22, 78, 43, -6, -2, 1},
+ {0, -8, 20, 78, 45, -5, -3, 1},
+ {0, -8, 18, 77, 48, -5, -3, 1},
+ {0, -8, 16, 76, 50, -4, -3, 1},
+ {0, -8, 15, 75, 52, -3, -4, 1},
+ {0, -7, 13, 74, 54, -3, -4, 1},
+ {0, -7, 11, 73, 56, -2, -4, 1},
+ {0, -7, 10, 71, 58, -1, -4, 1},
+ {1, -7, 8, 70, 60, 0, -5, 1},
+ {1, -6, 6, 68, 62, 1, -5, 1},
+ {1, -6, 5, 67, 63, 2, -5, 1},
+ {1, -6, 4, 65, 65, 4, -6, 1},
+ {1, -5, 2, 63, 67, 5, -6, 1},
+ {1, -5, 1, 62, 68, 6, -6, 1},
+ {1, -5, 0, 60, 70, 8, -7, 1},
+ {1, -4, -1, 58, 71, 10, -7, 0},
+ {1, -4, -2, 56, 73, 11, -7, 0},
+ {1, -4, -3, 54, 74, 13, -7, 0},
+ {1, -4, -3, 52, 75, 15, -8, 0},
+ {1, -3, -4, 50, 76, 16, -8, 0},
+ {1, -3, -5, 48, 77, 18, -8, 0},
+ {1, -3, -5, 45, 78, 20, -8, 0},
+ {1, -2, -6, 43, 78, 22, -8, 0},
+ {1, -2, -7, 41, 79, 24, -8, 0},
+ {1, -2, -7, 39, 79, 26, -8, 0},
+ {1, -2, -7, 37, 80, 28, -8, -1},
+ {1, -1, -8, 35, 80, 30, -8, -1},
+};
+
+// Filters for interpolation (0.75-band) - note this also filters integer pels.
+const interp_kernel vp9_filteredinterp_filters750[(1 << SUBPEL_BITS)] = {
+ {2, -11, 25, 96, 25, -11, 2, 0},
+ {2, -11, 22, 96, 28, -11, 2, 0},
+ {2, -10, 19, 95, 31, -11, 2, 0},
+ {2, -10, 17, 95, 34, -12, 2, 0},
+ {2, -9, 14, 94, 37, -12, 2, 0},
+ {2, -8, 12, 93, 40, -12, 1, 0},
+ {2, -8, 9, 92, 43, -12, 1, 1},
+ {2, -7, 7, 91, 46, -12, 1, 0},
+ {2, -7, 5, 90, 49, -12, 1, 0},
+ {2, -6, 3, 88, 52, -12, 0, 1},
+ {2, -5, 1, 86, 55, -12, 0, 1},
+ {2, -5, -1, 84, 58, -11, 0, 1},
+ {2, -4, -2, 82, 61, -11, -1, 1},
+ {2, -4, -4, 80, 64, -10, -1, 1},
+ {1, -3, -5, 77, 67, -9, -1, 1},
+ {1, -3, -6, 75, 70, -8, -2, 1},
+ {1, -2, -7, 72, 72, -7, -2, 1},
+ {1, -2, -8, 70, 75, -6, -3, 1},
+ {1, -1, -9, 67, 77, -5, -3, 1},
+ {1, -1, -10, 64, 80, -4, -4, 2},
+ {1, -1, -11, 61, 82, -2, -4, 2},
+ {1, 0, -11, 58, 84, -1, -5, 2},
+ {1, 0, -12, 55, 86, 1, -5, 2},
+ {1, 0, -12, 52, 88, 3, -6, 2},
+ {0, 1, -12, 49, 90, 5, -7, 2},
+ {0, 1, -12, 46, 91, 7, -7, 2},
+ {1, 1, -12, 43, 92, 9, -8, 2},
+ {0, 1, -12, 40, 93, 12, -8, 2},
+ {0, 2, -12, 37, 94, 14, -9, 2},
+ {0, 2, -12, 34, 95, 17, -10, 2},
+ {0, 2, -11, 31, 95, 19, -10, 2},
+ {0, 2, -11, 28, 96, 22, -11, 2}
+};
+
+// Filters for interpolation (0.875-band) - note this also filters integer pels.
+const interp_kernel vp9_filteredinterp_filters875[(1 << SUBPEL_BITS)] = {
+ {3, -8, 13, 112, 13, -8, 3, 0},
+ {3, -7, 10, 112, 17, -9, 3, -1},
+ {2, -6, 7, 111, 21, -9, 3, -1},
+ {2, -5, 4, 111, 24, -10, 3, -1},
+ {2, -4, 1, 110, 28, -11, 3, -1},
+ {1, -3, -1, 108, 32, -12, 4, -1},
+ {1, -2, -3, 106, 36, -13, 4, -1},
+ {1, -1, -6, 105, 40, -14, 4, -1},
+ {1, -1, -7, 102, 44, -14, 4, -1},
+ {1, 0, -9, 100, 48, -15, 4, -1},
+ {1, 1, -11, 97, 53, -16, 4, -1},
+ {0, 1, -12, 95, 57, -16, 4, -1},
+ {0, 2, -13, 91, 61, -16, 4, -1},
+ {0, 2, -14, 88, 65, -16, 4, -1},
+ {0, 3, -15, 84, 69, -17, 4, 0},
+ {0, 3, -16, 81, 73, -16, 3, 0},
+ {0, 3, -16, 77, 77, -16, 3, 0},
+ {0, 3, -16, 73, 81, -16, 3, 0},
+ {0, 4, -17, 69, 84, -15, 3, 0},
+ {-1, 4, -16, 65, 88, -14, 2, 0},
+ {-1, 4, -16, 61, 91, -13, 2, 0},
+ {-1, 4, -16, 57, 95, -12, 1, 0},
+ {-1, 4, -16, 53, 97, -11, 1, 1},
+ {-1, 4, -15, 48, 100, -9, 0, 1},
+ {-1, 4, -14, 44, 102, -7, -1, 1},
+ {-1, 4, -14, 40, 105, -6, -1, 1},
+ {-1, 4, -13, 36, 106, -3, -2, 1},
+ {-1, 4, -12, 32, 108, -1, -3, 1},
+ {-1, 3, -11, 28, 110, 1, -4, 2},
+ {-1, 3, -10, 24, 111, 4, -5, 2},
+ {-1, 3, -9, 21, 111, 7, -6, 2},
+ {-1, 3, -9, 17, 112, 10, -7, 3}
+};
+
+// Filters for interpolation (full-band) - no filtering for integer pixels
+const interp_kernel vp9_filteredinterp_filters1000[(1 << SUBPEL_BITS)] = {
+ {0, 0, 0, 128, 0, 0, 0, 0},
+ {0, 1, -3, 128, 3, -1, 0, 0},
+ {-1, 2, -6, 127, 7, -2, 1, 0},
+ {-1, 3, -9, 126, 12, -4, 1, 0},
+ {-1, 4, -12, 125, 16, -5, 1, 0},
+ {-1, 4, -14, 123, 20, -6, 2, 0},
+ {-1, 5, -15, 120, 25, -8, 2, 0},
+ {-1, 5, -17, 118, 30, -9, 3, -1},
+ {-1, 6, -18, 114, 35, -10, 3, -1},
+ {-1, 6, -19, 111, 41, -12, 3, -1},
+ {-1, 6, -20, 107, 46, -13, 4, -1},
+ {-1, 6, -21, 103, 52, -14, 4, -1},
+ {-1, 6, -21, 99, 57, -16, 5, -1},
+ {-1, 6, -21, 94, 63, -17, 5, -1},
+ {-1, 6, -20, 89, 68, -18, 5, -1},
+ {-1, 6, -20, 84, 73, -19, 6, -1},
+ {-1, 6, -20, 79, 79, -20, 6, -1},
+ {-1, 6, -19, 73, 84, -20, 6, -1},
+ {-1, 5, -18, 68, 89, -20, 6, -1},
+ {-1, 5, -17, 63, 94, -21, 6, -1},
+ {-1, 5, -16, 57, 99, -21, 6, -1},
+ {-1, 4, -14, 52, 103, -21, 6, -1},
+ {-1, 4, -13, 46, 107, -20, 6, -1},
+ {-1, 3, -12, 41, 111, -19, 6, -1},
+ {-1, 3, -10, 35, 114, -18, 6, -1},
+ {-1, 3, -9, 30, 118, -17, 5, -1},
+ {0, 2, -8, 25, 120, -15, 5, -1},
+ {0, 2, -6, 20, 123, -14, 4, -1},
+ {0, 1, -5, 16, 125, -12, 4, -1},
+ {0, 1, -4, 12, 126, -9, 3, -1},
+ {0, 1, -2, 7, 127, -6, 2, -1},
+ {0, 0, -1, 3, 128, -3, 1, 0}
+};
+
+// Filters for factor of 2 downsampling.
+static const int16_t vp9_down2_symeven_half_filter[] = {56, 12, -3, -1};
+static const int16_t vp9_down2_symodd_half_filter[] = {64, 35, 0, -3};
+
+static const interp_kernel *choose_interp_filter(int inlength, int outlength) {
+ int outlength16 = outlength * 16;
+ if (outlength16 >= inlength * 16)
+ return vp9_filteredinterp_filters1000;
+ else if (outlength16 >= inlength * 13)
+ return vp9_filteredinterp_filters875;
+ else if (outlength16 >= inlength * 11)
+ return vp9_filteredinterp_filters750;
+ else if (outlength16 >= inlength * 9)
+ return vp9_filteredinterp_filters625;
+ else
+ return vp9_filteredinterp_filters500;
+}
+
+static void interpolate(const uint8_t *const input, int inlength,
+ uint8_t *output, int outlength) {
+ const int64_t delta = (((uint64_t)inlength << 32) + outlength / 2) /
+ outlength;
+ const int64_t offset = inlength > outlength ?
+ (((int64_t)(inlength - outlength) << 31) + outlength / 2) / outlength :
+ -(((int64_t)(outlength - inlength) << 31) + outlength / 2) / outlength;
+ uint8_t *optr = output;
+ int x, x1, x2, sum, k, int_pel, sub_pel;
+ int64_t y;
+
+ const interp_kernel *interp_filters =
+ choose_interp_filter(inlength, outlength);
+
+ x = 0;
+ y = offset;
+ while ((y >> INTERP_PRECISION_BITS) < (INTERP_TAPS / 2 - 1)) {
+ x++;
+ y += delta;
+ }
+ x1 = x;
+ x = outlength - 1;
+ y = delta * x + offset;
+ while ((y >> INTERP_PRECISION_BITS) +
+ (int64_t)(INTERP_TAPS / 2) >= inlength) {
+ x--;
+ y -= delta;
+ }
+ x2 = x;
+ if (x1 > x2) {
+ for (x = 0, y = offset; x < outlength; ++x, y += delta) {
+ const int16_t *filter;
+ int_pel = y >> INTERP_PRECISION_BITS;
+ sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK;
+ filter = interp_filters[sub_pel];
+ sum = 0;
+ for (k = 0; k < INTERP_TAPS; ++k) {
+ const int pk = int_pel - INTERP_TAPS / 2 + 1 + k;
+ sum += filter[k] * input[(pk < 0 ? 0 :
+ (pk >= inlength ? inlength - 1 : pk))];
+ }
+ *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
+ }
+ } else {
+ // Initial part.
+ for (x = 0, y = offset; x < x1; ++x, y += delta) {
+ const int16_t *filter;
+ int_pel = y >> INTERP_PRECISION_BITS;
+ sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK;
+ filter = interp_filters[sub_pel];
+ sum = 0;
+ for (k = 0; k < INTERP_TAPS; ++k)
+ sum += filter[k] * input[(int_pel - INTERP_TAPS / 2 + 1 + k < 0 ?
+ 0 :
+ int_pel - INTERP_TAPS / 2 + 1 + k)];
+ *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
+ }
+ // Middle part.
+ for (; x <= x2; ++x, y += delta) {
+ const int16_t *filter;
+ int_pel = y >> INTERP_PRECISION_BITS;
+ sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK;
+ filter = interp_filters[sub_pel];
+ sum = 0;
+ for (k = 0; k < INTERP_TAPS; ++k)
+ sum += filter[k] * input[int_pel - INTERP_TAPS / 2 + 1 + k];
+ *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
+ }
+ // End part.
+ for (; x < outlength; ++x, y += delta) {
+ const int16_t *filter;
+ int_pel = y >> INTERP_PRECISION_BITS;
+ sub_pel = (y >> (INTERP_PRECISION_BITS - SUBPEL_BITS)) & SUBPEL_MASK;
+ filter = interp_filters[sub_pel];
+ sum = 0;
+ for (k = 0; k < INTERP_TAPS; ++k)
+ sum += filter[k] * input[(int_pel - INTERP_TAPS / 2 + 1 + k >=
+ inlength ? inlength - 1 :
+ int_pel - INTERP_TAPS / 2 + 1 + k)];
+ *optr++ = clip_pixel(ROUND_POWER_OF_TWO(sum, FILTER_BITS));
+ }
+ }
+}
+
+static void down2_symeven(const uint8_t *const input, int length,
+ uint8_t *output) {
+ // Actual filter len = 2 * filter_len_half.
+ static const int16_t *filter = vp9_down2_symeven_half_filter;
+ const int filter_len_half = sizeof(vp9_down2_symeven_half_filter) / 2;
+ int i, j;
+ uint8_t *optr = output;
+ int l1 = filter_len_half;
+ int l2 = (length - filter_len_half);
+ l1 += (l1 & 1);
+ l2 += (l2 & 1);
+ if (l1 > l2) {
+ // Short input length.
+ for (i = 0; i < length; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1));
+ for (j = 0; j < filter_len_half; ++j) {
+ sum += (input[(i - j < 0 ? 0 : i - j)] +
+ input[(i + 1 + j >= length ? length - 1 : i + 1 + j)]) *
+ filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ } else {
+ // Initial part.
+ for (i = 0; i < l1; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1));
+ for (j = 0; j < filter_len_half; ++j) {
+ sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + 1 + j]) * filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ // Middle part.
+ for (; i < l2; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1));
+ for (j = 0; j < filter_len_half; ++j) {
+ sum += (input[i - j] + input[i + 1 + j]) * filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ // End part.
+ for (; i < length; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1));
+ for (j = 0; j < filter_len_half; ++j) {
+ sum += (input[i - j] +
+ input[(i + 1 + j >= length ? length - 1 : i + 1 + j)]) *
+ filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ }
+}
+
+static void down2_symodd(const uint8_t *const input, int length,
+ uint8_t *output) {
+ // Actual filter len = 2 * filter_len_half - 1.
+ static const int16_t *filter = vp9_down2_symodd_half_filter;
+ const int filter_len_half = sizeof(vp9_down2_symodd_half_filter) / 2;
+ int i, j;
+ uint8_t *optr = output;
+ int l1 = filter_len_half - 1;
+ int l2 = (length - filter_len_half + 1);
+ l1 += (l1 & 1);
+ l2 += (l2 & 1);
+ if (l1 > l2) {
+ // Short input length.
+ for (i = 0; i < length; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
+ for (j = 1; j < filter_len_half; ++j) {
+ sum += (input[(i - j < 0 ? 0 : i - j)] +
+ input[(i + j >= length ? length - 1 : i + j)]) *
+ filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ } else {
+ // Initial part.
+ for (i = 0; i < l1; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
+ for (j = 1; j < filter_len_half; ++j) {
+ sum += (input[(i - j < 0 ? 0 : i - j)] + input[i + j]) * filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ // Middle part.
+ for (; i < l2; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
+ for (j = 1; j < filter_len_half; ++j) {
+ sum += (input[i - j] + input[i + j]) * filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ // End part.
+ for (; i < length; i += 2) {
+ int sum = (1 << (FILTER_BITS - 1)) + input[i] * filter[0];
+ for (j = 1; j < filter_len_half; ++j) {
+ sum += (input[i - j] + input[(i + j >= length ? length - 1 : i + j)]) *
+ filter[j];
+ }
+ sum >>= FILTER_BITS;
+ *optr++ = clip_pixel(sum);
+ }
+ }
+}
+
+static int get_down2_length(int length, int steps) {
+ int s;
+ for (s = 0; s < steps; ++s)
+ length = (length + 1) >> 1;
+ return length;
+}
+
+int get_down2_steps(int in_length, int out_length) {
+ int steps = 0;
+ int proj_in_length;
+ while ((proj_in_length = get_down2_length(in_length, 1)) >= out_length) {
+ ++steps;
+ in_length = proj_in_length;
+ }
+ return steps;
+}
+
+static void resize_multistep(const uint8_t *const input,
+ int length,
+ uint8_t *output,
+ int olength,
+ uint8_t *buf) {
+ int steps;
+ if (length == olength) {
+ memcpy(output, input, sizeof(uint8_t) * length);
+ return;
+ }
+ steps = get_down2_steps(length, olength);
+
+ if (steps > 0) {
+ int s;
+ uint8_t *out = NULL;
+ uint8_t *tmpbuf = NULL;
+ uint8_t *otmp, *otmp2;
+ int filteredlength = length;
+ if (!tmpbuf) {
+ tmpbuf = (uint8_t *)malloc(sizeof(uint8_t) * length);
+ otmp = tmpbuf;
+ } else {
+ otmp = buf;
+ }
+ otmp2 = otmp + get_down2_length(length, 1);
+ for (s = 0; s < steps; ++s) {
+ const int proj_filteredlength = get_down2_length(filteredlength, 1);
+ const uint8_t *const in = (s == 0 ? input : out);
+ if (s == steps - 1 && proj_filteredlength == olength)
+ out = output;
+ else
+ out = (s & 1 ? otmp2 : otmp);
+ if (filteredlength & 1)
+ down2_symodd(in, filteredlength, out);
+ else
+ down2_symeven(in, filteredlength, out);
+ filteredlength = proj_filteredlength;
+ }
+ if (filteredlength != olength) {
+ interpolate(out, filteredlength, output, olength);
+ }
+ if (tmpbuf)
+ free(tmpbuf);
+ } else {
+ interpolate(input, length, output, olength);
+ }
+}
+
+static void fill_col_to_arr(uint8_t *img, int stride, int len, uint8_t *arr) {
+ int i;
+ uint8_t *iptr = img;
+ uint8_t *aptr = arr;
+ for (i = 0; i < len; ++i, iptr += stride) {
+ *aptr++ = *iptr;
+ }
+}
+
+static void fill_arr_to_col(uint8_t *img, int stride, int len, uint8_t *arr) {
+ int i;
+ uint8_t *iptr = img;
+ uint8_t *aptr = arr;
+ for (i = 0; i < len; ++i, iptr += stride) {
+ *iptr = *aptr++;
+ }
+}
+
+void vp9_resize_plane(const uint8_t *const input,
+ int height,
+ int width,
+ int in_stride,
+ uint8_t *output,
+ int height2,
+ int width2,
+ int out_stride) {
+ int i;
+ uint8_t *intbuf = (uint8_t *)malloc(sizeof(uint8_t) * width2 * height);
+ uint8_t *tmpbuf = (uint8_t *)malloc(sizeof(uint8_t) *
+ (width < height ? height : width));
+ uint8_t *arrbuf = (uint8_t *)malloc(sizeof(uint8_t) * (height + height2));
+ for (i = 0; i < height; ++i)
+ resize_multistep(input + in_stride * i, width,
+ intbuf + width2 * i, width2, tmpbuf);
+ for (i = 0; i < width2; ++i) {
+ fill_col_to_arr(intbuf + i, width2, height, arrbuf);
+ resize_multistep(arrbuf, height, arrbuf + height, height2, tmpbuf);
+ fill_arr_to_col(output + i, out_stride, height2, arrbuf + height);
+ }
+ free(intbuf);
+ free(tmpbuf);
+ free(arrbuf);
+}
+
+void vp9_resize_frame420(const uint8_t *const y,
+ int y_stride,
+ const uint8_t *const u, const uint8_t *const v,
+ int uv_stride,
+ int height, int width,
+ uint8_t *oy, int oy_stride,
+ uint8_t *ou, uint8_t *ov, int ouv_stride,
+ int oheight, int owidth) {
+ vp9_resize_plane(y, height, width, y_stride,
+ oy, oheight, owidth, oy_stride);
+ vp9_resize_plane(u, height / 2, width / 2, uv_stride,
+ ou, oheight / 2, owidth / 2, ouv_stride);
+ vp9_resize_plane(v, height / 2, width / 2, uv_stride,
+ ov, oheight / 2, owidth / 2, ouv_stride);
+}
+
+void vp9_resize_frame422(const uint8_t *const y, int y_stride,
+ const uint8_t *const u, const uint8_t *const v,
+ int uv_stride,
+ int height, int width,
+ uint8_t *oy, int oy_stride,
+ uint8_t *ou, uint8_t *ov, int ouv_stride,
+ int oheight, int owidth) {
+ vp9_resize_plane(y, height, width, y_stride,
+ oy, oheight, owidth, oy_stride);
+ vp9_resize_plane(u, height, width / 2, uv_stride,
+ ou, oheight, owidth / 2, ouv_stride);
+ vp9_resize_plane(v, height, width / 2, uv_stride,
+ ov, oheight, owidth / 2, ouv_stride);
+}
+
+void vp9_resize_frame444(const uint8_t *const y, int y_stride,
+ const uint8_t *const u, const uint8_t *const v,
+ int uv_stride,
+ int height, int width,
+ uint8_t *oy, int oy_stride,
+ uint8_t *ou, uint8_t *ov, int ouv_stride,
+ int oheight, int owidth) {
+ vp9_resize_plane(y, height, width, y_stride,
+ oy, oheight, owidth, oy_stride);
+ vp9_resize_plane(u, height, width, uv_stride,
+ ou, oheight, owidth, ouv_stride);
+ vp9_resize_plane(v, height, width, uv_stride,
+ ov, oheight, owidth, ouv_stride);
+}
diff --git a/libvpx/vp9/encoder/vp9_resize.h b/libvpx/vp9/encoder/vp9_resize.h
new file mode 100644
index 0000000..1818cd4
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_resize.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_ENCODER_VP9_RESIZE_H_
+#define VP9_ENCODER_VP9_RESIZE_H_
+
+#include <stdio.h>
+#include "vpx/vpx_integer.h"
+
+void vp9_resize_plane(const uint8_t *const input,
+ int height,
+ int width,
+ int in_stride,
+ uint8_t *output,
+ int height2,
+ int width2,
+ int out_stride);
+void vp9_resize_frame420(const uint8_t *const y,
+ int y_stride,
+ const uint8_t *const u,
+ const uint8_t *const v,
+ int uv_stride,
+ int height,
+ int width,
+ uint8_t *oy,
+ int oy_stride,
+ uint8_t *ou,
+ uint8_t *ov,
+ int ouv_stride,
+ int oheight,
+ int owidth);
+void vp9_resize_frame422(const uint8_t *const y,
+ int y_stride,
+ const uint8_t *const u,
+ const uint8_t *const v,
+ int uv_stride,
+ int height,
+ int width,
+ uint8_t *oy,
+ int oy_stride,
+ uint8_t *ou,
+ uint8_t *ov,
+ int ouv_stride,
+ int oheight,
+ int owidth);
+void vp9_resize_frame444(const uint8_t *const y,
+ int y_stride,
+ const uint8_t *const u,
+ const uint8_t *const v,
+ int uv_stride,
+ int height,
+ int width,
+ uint8_t *oy,
+ int oy_stride,
+ uint8_t *ou,
+ uint8_t *ov,
+ int ouv_stride,
+ int oheight,
+ int owidth);
+
+#endif // VP9_ENCODER_VP9_RESIZE_H_
diff --git a/libvpx/vp9/encoder/vp9_sad.c b/libvpx/vp9/encoder/vp9_sad.c
new file mode 100644
index 0000000..58c5df4
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_sad.c
@@ -0,0 +1,324 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <stdlib.h>
+
+#include "./vp9_rtcd.h"
+#include "./vpx_config.h"
+
+#include "vpx/vpx_integer.h"
+#include "vp9/encoder/vp9_variance.h"
+
+static INLINE unsigned int sad(const uint8_t *a, int a_stride,
+ const uint8_t *b, int b_stride,
+ int width, int height) {
+ int y, x;
+ unsigned int sad = 0;
+
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++)
+ sad += abs(a[x] - b[x]);
+
+ a += a_stride;
+ b += b_stride;
+ }
+
+ return sad;
+}
+
+#define sad_mxn_func(m, n) \
+unsigned int vp9_sad##m##x##n##_c(const uint8_t *src_ptr, int src_stride, \
+ const uint8_t *ref_ptr, int ref_stride, \
+ unsigned int max_sad) { \
+ return sad(src_ptr, src_stride, ref_ptr, ref_stride, m, n); \
+} \
+unsigned int vp9_sad##m##x##n##_avg_c(const uint8_t *src_ptr, int src_stride, \
+ const uint8_t *ref_ptr, int ref_stride, \
+ const uint8_t *second_pred, \
+ unsigned int max_sad) { \
+ uint8_t comp_pred[m * n]; \
+ comp_avg_pred(comp_pred, second_pred, m, n, ref_ptr, ref_stride); \
+ return sad(src_ptr, src_stride, comp_pred, m, m, n); \
+}
+
+sad_mxn_func(64, 64)
+sad_mxn_func(64, 32)
+sad_mxn_func(32, 64)
+sad_mxn_func(32, 32)
+sad_mxn_func(32, 16)
+sad_mxn_func(16, 32)
+sad_mxn_func(16, 16)
+sad_mxn_func(16, 8)
+sad_mxn_func(8, 16)
+sad_mxn_func(8, 8)
+sad_mxn_func(8, 4)
+sad_mxn_func(4, 8)
+sad_mxn_func(4, 4)
+
+void vp9_sad64x32x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad64x32(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad32x64x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad32x64(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad32x16x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad32x16(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x32x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad16x32(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad64x64x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad64x64(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad32x32x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad32x32(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad64x64x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad64x64(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad32x32x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad32x32(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x16x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad16x16(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x16x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad16x16(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x8x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad16x8(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x8x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad16x8(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x8x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad8x8(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x8x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad8x8(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x16x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad8x16(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x16x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad8x16(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad4x4x3_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 3; ++i)
+ sad_array[i] = vp9_sad4x4(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad4x4x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad4x4(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad64x64x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad64x64(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad32x32x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad32x32(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x16x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad16x16(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad16x8x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad16x8(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x8x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad8x8(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x16x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad8x16(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x4x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad8x4(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad8x4x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad8x4(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad4x8x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad4x8(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad4x8x8_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t *ref_ptr, int ref_stride,
+ uint32_t *sad_array) {
+ int i;
+ for (i = 0; i < 8; ++i)
+ sad_array[i] = vp9_sad4x8(src_ptr, src_stride, ref_ptr + i, ref_stride,
+ 0x7fffffff);
+}
+
+void vp9_sad4x4x4d_c(const uint8_t *src_ptr, int src_stride,
+ const uint8_t* const ref_ptr[], int ref_stride,
+ unsigned int *sad_array) {
+ int i;
+ for (i = 0; i < 4; ++i)
+ sad_array[i] = vp9_sad4x4(src_ptr, src_stride, ref_ptr[i], ref_stride,
+ 0x7fffffff);
+}
diff --git a/libvpx/vp9/encoder/vp9_sad_c.c b/libvpx/vp9/encoder/vp9_sad_c.c
deleted file mode 100644
index 42ddb21..0000000
--- a/libvpx/vp9/encoder/vp9_sad_c.c
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#include <stdlib.h>
-#include "vp9/common/vp9_sadmxn.h"
-#include "vp9/encoder/vp9_variance.h"
-#include "./vpx_config.h"
-#include "vpx/vpx_integer.h"
-#include "./vp9_rtcd.h"
-
-#define sad_mxn_func(m, n) \
-unsigned int vp9_sad##m##x##n##_c(const uint8_t *src_ptr, \
- int src_stride, \
- const uint8_t *ref_ptr, \
- int ref_stride, \
- unsigned int max_sad) { \
- return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, m, n); \
-} \
-unsigned int vp9_sad##m##x##n##_avg_c(const uint8_t *src_ptr, \
- int src_stride, \
- const uint8_t *ref_ptr, \
- int ref_stride, \
- const uint8_t *second_pred, \
- unsigned int max_sad) { \
- uint8_t comp_pred[m * n]; \
- comp_avg_pred(comp_pred, second_pred, m, n, ref_ptr, ref_stride); \
- return sad_mx_n_c(src_ptr, src_stride, comp_pred, m, m, n); \
-}
-
-sad_mxn_func(64, 64)
-sad_mxn_func(64, 32)
-sad_mxn_func(32, 64)
-sad_mxn_func(32, 32)
-sad_mxn_func(32, 16)
-sad_mxn_func(16, 32)
-sad_mxn_func(16, 16)
-sad_mxn_func(16, 8)
-sad_mxn_func(8, 16)
-sad_mxn_func(8, 8)
-sad_mxn_func(8, 4)
-sad_mxn_func(4, 8)
-sad_mxn_func(4, 4)
-
-void vp9_sad64x32x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad64x32(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad64x32(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad64x32(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad64x32(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad32x64x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad32x64(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad32x64(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad32x64(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad32x64(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad32x16x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad32x16(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad32x16(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad32x16(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad32x16(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad16x32x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad16x32(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad16x32(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad16x32(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad16x32(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad64x64x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad64x64(src_ptr, src_stride, ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad64x64(src_ptr, src_stride, ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad64x64(src_ptr, src_stride, ref_ptr + 2, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad32x32x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr, ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 1, ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 2, ref_stride, 0x7fffffff);
-}
-
-void vp9_sad64x64x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad32x32x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad16x16x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr, ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 1, ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 2, ref_stride, 0x7fffffff);
-}
-
-void vp9_sad16x16x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad16x8x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr, ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 1, ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 2, ref_stride, 0x7fffffff);
-}
-
-void vp9_sad16x8x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad8x8x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr, ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 1, ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 2, ref_stride, 0x7fffffff);
-}
-
-void vp9_sad8x8x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad8x16x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr, ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 1, ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 2, ref_stride, 0x7fffffff);
-}
-
-void vp9_sad8x16x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad4x4x3_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr, ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 1, ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 2, ref_stride, 0x7fffffff);
-}
-
-void vp9_sad4x4x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad64x64x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad64x64(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad32x32x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad32x32(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad16x16x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad16x16(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad16x8x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad16x8(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad8x8x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad8x8(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad8x16x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad8x16(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad8x4x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad8x4x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad8x4(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad4x8x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
-
-void vp9_sad4x8x8_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t *ref_ptr,
- int ref_stride,
- uint32_t *sad_array) {
- sad_array[0] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr, ref_stride,
- 0x7fffffff);
- sad_array[1] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 1, ref_stride,
- 0x7fffffff);
- sad_array[2] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 2, ref_stride,
- 0x7fffffff);
- sad_array[3] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 3, ref_stride,
- 0x7fffffff);
- sad_array[4] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 4, ref_stride,
- 0x7fffffff);
- sad_array[5] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 5, ref_stride,
- 0x7fffffff);
- sad_array[6] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 6, ref_stride,
- 0x7fffffff);
- sad_array[7] = vp9_sad4x8(src_ptr, src_stride,
- ref_ptr + 7, ref_stride,
- 0x7fffffff);
-}
-
-void vp9_sad4x4x4d_c(const uint8_t *src_ptr,
- int src_stride,
- const uint8_t* const ref_ptr[],
- int ref_stride,
- unsigned int *sad_array) {
- sad_array[0] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr[0], ref_stride, 0x7fffffff);
- sad_array[1] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr[1], ref_stride, 0x7fffffff);
- sad_array[2] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr[2], ref_stride, 0x7fffffff);
- sad_array[3] = vp9_sad4x4(src_ptr, src_stride,
- ref_ptr[3], ref_stride, 0x7fffffff);
-}
diff --git a/libvpx/vp9/encoder/vp9_segmentation.c b/libvpx/vp9/encoder/vp9_segmentation.c
index 24f011f..fd8fa53 100644
--- a/libvpx/vp9/encoder/vp9_segmentation.c
+++ b/libvpx/vp9/encoder/vp9_segmentation.c
@@ -10,29 +10,26 @@
#include <limits.h>
+
#include "vpx_mem/vpx_mem.h"
-#include "vp9/encoder/vp9_segmentation.h"
+
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_tile_common.h"
-void vp9_enable_segmentation(VP9_PTR ptr) {
- VP9_COMP *cpi = (VP9_COMP *)ptr;
- struct segmentation *const seg = &cpi->common.seg;
+#include "vp9/encoder/vp9_cost.h"
+#include "vp9/encoder/vp9_segmentation.h"
+void vp9_enable_segmentation(struct segmentation *seg) {
seg->enabled = 1;
seg->update_map = 1;
seg->update_data = 1;
}
-void vp9_disable_segmentation(VP9_PTR ptr) {
- VP9_COMP *cpi = (VP9_COMP *)ptr;
- struct segmentation *const seg = &cpi->common.seg;
+void vp9_disable_segmentation(struct segmentation *seg) {
seg->enabled = 0;
}
-void vp9_set_segmentation_map(VP9_PTR ptr,
- unsigned char *segmentation_map) {
- VP9_COMP *cpi = (VP9_COMP *)ptr;
+void vp9_set_segmentation_map(VP9_COMP *cpi, unsigned char *segmentation_map) {
struct segmentation *const seg = &cpi->common.seg;
// Copy in the new segmentation map
@@ -44,12 +41,9 @@ void vp9_set_segmentation_map(VP9_PTR ptr,
seg->update_data = 1;
}
-void vp9_set_segment_data(VP9_PTR ptr,
+void vp9_set_segment_data(struct segmentation *seg,
signed char *feature_data,
unsigned char abs_delta) {
- VP9_COMP *cpi = (VP9_COMP *)ptr;
- struct segmentation *const seg = &cpi->common.seg;
-
seg->abs_delta = abs_delta;
vpx_memcpy(seg->feature_data, feature_data, sizeof(seg->feature_data));
@@ -58,6 +52,15 @@ void vp9_set_segment_data(VP9_PTR ptr,
// vpx_memcpy(cpi->mb.e_mbd.segment_feature_mask, 0,
// sizeof(cpi->mb.e_mbd.segment_feature_mask));
}
+void vp9_disable_segfeature(struct segmentation *seg, int segment_id,
+ SEG_LVL_FEATURES feature_id) {
+ seg->feature_mask[segment_id] &= ~(1 << feature_id);
+}
+
+void vp9_clear_segdata(struct segmentation *seg, int segment_id,
+ SEG_LVL_FEATURES feature_id) {
+ seg->feature_data[segment_id][feature_id] = 0;
+}
// Based on set of segment counts calculate a probability tree
static void calc_segtree_probs(int *segcounts, vp9_prob *segment_tree_probs) {
@@ -149,7 +152,7 @@ static void count_segs(VP9_COMP *cpi, const TileInfo *const tile,
// Store the prediction status for this mb and update counts
// as appropriate
- vp9_set_pred_flag_seg_id(xd, pred_flag);
+ xd->mi_8x8[0]->mbmi.seg_id_predicted = pred_flag;
temporal_predictor_count[pred_context][pred_flag]++;
if (!pred_flag)
@@ -287,3 +290,12 @@ void vp9_choose_segmap_coding_method(VP9_COMP *cpi) {
vpx_memcpy(seg->tree_probs, no_pred_tree, sizeof(no_pred_tree));
}
}
+
+void vp9_reset_segment_features(struct segmentation *seg) {
+ // Set up default state for MB feature flags
+ seg->enabled = 0;
+ seg->update_map = 0;
+ seg->update_data = 0;
+ vpx_memset(seg->tree_probs, 255, sizeof(seg->tree_probs));
+ vp9_clearall_segfeatures(seg);
+}
diff --git a/libvpx/vp9/encoder/vp9_segmentation.h b/libvpx/vp9/encoder/vp9_segmentation.h
index 2183771..66c51a2 100644
--- a/libvpx/vp9/encoder/vp9_segmentation.h
+++ b/libvpx/vp9/encoder/vp9_segmentation.h
@@ -15,12 +15,22 @@
#include "vp9/common/vp9_blockd.h"
#include "vp9/encoder/vp9_onyx_int.h"
-void vp9_enable_segmentation(VP9_PTR ptr);
-void vp9_disable_segmentation(VP9_PTR ptr);
-
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void vp9_enable_segmentation(struct segmentation *seg);
+void vp9_disable_segmentation(struct segmentation *seg);
+
+void vp9_disable_segfeature(struct segmentation *seg,
+ int segment_id,
+ SEG_LVL_FEATURES feature_id);
+void vp9_clear_segdata(struct segmentation *seg,
+ int segment_id,
+ SEG_LVL_FEATURES feature_id);
// Valid values for a segment are 0 to 3
// Segmentation map is arrange as [Rows][Columns]
-void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map);
+void vp9_set_segmentation_map(VP9_COMP *cpi, unsigned char *segmentation_map);
// The values given for each segment can be either deltas (from the default
// value chosen for the frame) or absolute values.
@@ -32,9 +42,15 @@ void vp9_set_segmentation_map(VP9_PTR ptr, unsigned char *segmentation_map);
//
// abs_delta = SEGMENT_DELTADATA (deltas) abs_delta = SEGMENT_ABSDATA (use
// the absolute values given).
-void vp9_set_segment_data(VP9_PTR ptr, signed char *feature_data,
+void vp9_set_segment_data(struct segmentation *seg, signed char *feature_data,
unsigned char abs_delta);
void vp9_choose_segmap_coding_method(VP9_COMP *cpi);
+void vp9_reset_segment_features(struct segmentation *seg);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_SEGMENTATION_H_
diff --git a/libvpx/vp9/encoder/vp9_ssim.c b/libvpx/vp9/encoder/vp9_ssim.c
index a5f18e6..1435191 100644
--- a/libvpx/vp9/encoder/vp9_ssim.c
+++ b/libvpx/vp9/encoder/vp9_ssim.c
@@ -65,12 +65,6 @@ static double similarity(unsigned long sum_s, unsigned long sum_r,
return ssim_n * 1.0 / ssim_d;
}
-static double ssim_16x16(uint8_t *s, int sp, uint8_t *r, int rp) {
- unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0;
- vp9_ssim_parms_16x16(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r,
- &sum_sxr);
- return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 256);
-}
static double ssim_8x8(uint8_t *s, int sp, uint8_t *r, int rp) {
unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0;
vp9_ssim_parms_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r,
diff --git a/libvpx/vp9/encoder/vp9_subexp.c b/libvpx/vp9/encoder/vp9_subexp.c
index 387fc90..9796d64 100644
--- a/libvpx/vp9/encoder/vp9_subexp.c
+++ b/libvpx/vp9/encoder/vp9_subexp.c
@@ -11,34 +11,13 @@
#include "vp9/common/vp9_common.h"
#include "vp9/common/vp9_entropy.h"
-#include "vp9/encoder/vp9_boolhuff.h"
-#include "vp9/encoder/vp9_treewriter.h"
+#include "vp9/encoder/vp9_cost.h"
+#include "vp9/encoder/vp9_writer.h"
-#define vp9_cost_upd ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd)) >> 8)
#define vp9_cost_upd256 ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd)))
static int update_bits[255];
-static int count_uniform(int v, int n) {
- int l = get_unsigned_bits(n);
- int m;
- if (l == 0) return 0;
- m = (1 << l) - n;
- if (v < m)
- return l - 1;
- else
- return l;
-}
-
-static int split_index(int i, int n, int modulus) {
- int max1 = (n - 1 - modulus / 2) / modulus + 1;
- if (i % modulus == modulus / 2)
- i = i / modulus;
- else
- i = max1 + i - (i + modulus - modulus / 2) / modulus;
- return i;
-}
-
static int recenter_nonneg(int v, int m) {
if (v > (m << 1))
return v;
@@ -82,29 +61,16 @@ static int remap_prob(int v, int m) {
return i;
}
-static int count_term_subexp(int word, int k, int num_syms) {
- int count = 0;
- int i = 0;
- int mk = 0;
- while (1) {
- int b = (i ? k + i - 1 : k);
- int a = (1 << b);
- if (num_syms <= mk + 3 * a) {
- count += count_uniform(word - mk, num_syms - mk);
- break;
- } else {
- int t = (word >= mk + a);
- count++;
- if (t) {
- i = i + 1;
- mk += a;
- } else {
- count += b;
- break;
- }
- }
- }
- return count;
+static int count_term_subexp(int word) {
+ if (word < 16)
+ return 5;
+ if (word < 32)
+ return 6;
+ if (word < 64)
+ return 8;
+ if (word < 129)
+ return 10;
+ return 11;
}
static int prob_diff_update_cost(vp9_prob newp, vp9_prob oldp) {
@@ -112,12 +78,9 @@ static int prob_diff_update_cost(vp9_prob newp, vp9_prob oldp) {
return update_bits[delp] * 256;
}
-static void encode_uniform(vp9_writer *w, int v, int n) {
- int l = get_unsigned_bits(n);
- int m;
- if (l == 0)
- return;
- m = (1 << l) - n;
+static void encode_uniform(vp9_writer *w, int v) {
+ const int l = 8;
+ const int m = (1 << l) - 191;
if (v < m) {
vp9_write_literal(w, v, l - 1);
} else {
@@ -126,38 +89,32 @@ static void encode_uniform(vp9_writer *w, int v, int n) {
}
}
-static void encode_term_subexp(vp9_writer *w, int word, int k, int num_syms) {
- int i = 0;
- int mk = 0;
- while (1) {
- int b = (i ? k + i - 1 : k);
- int a = (1 << b);
- if (num_syms <= mk + 3 * a) {
- encode_uniform(w, word - mk, num_syms - mk);
- break;
- } else {
- int t = (word >= mk + a);
- vp9_write_literal(w, t, 1);
- if (t) {
- i = i + 1;
- mk += a;
- } else {
- vp9_write_literal(w, word - mk, b);
- break;
- }
- }
+static INLINE int write_bit_gte(vp9_writer *w, int word, int test) {
+ vp9_write_literal(w, word >= test, 1);
+ return word >= test;
+}
+
+static void encode_term_subexp(vp9_writer *w, int word) {
+ if (!write_bit_gte(w, word, 16)) {
+ vp9_write_literal(w, word, 4);
+ } else if (!write_bit_gte(w, word, 32)) {
+ vp9_write_literal(w, word - 16, 4);
+ } else if (!write_bit_gte(w, word, 64)) {
+ vp9_write_literal(w, word - 32, 5);
+ } else {
+ encode_uniform(w, word - 64);
}
}
void vp9_write_prob_diff_update(vp9_writer *w, vp9_prob newp, vp9_prob oldp) {
const int delp = remap_prob(newp, oldp);
- encode_term_subexp(w, delp, SUBEXP_PARAM, 255);
+ encode_term_subexp(w, delp);
}
void vp9_compute_update_table() {
int i;
for (i = 0; i < 254; i++)
- update_bits[i] = count_term_subexp(i, SUBEXP_PARAM, 255);
+ update_bits[i] = count_term_subexp(i);
}
int vp9_prob_diff_update_savings_search(const unsigned int *ct,
@@ -184,8 +141,7 @@ int vp9_prob_diff_update_savings_search(const unsigned int *ct,
int vp9_prob_diff_update_savings_search_model(const unsigned int *ct,
const vp9_prob *oldp,
vp9_prob *bestp,
- vp9_prob upd,
- int b, int r) {
+ vp9_prob upd) {
int i, old_b, new_b, update_b, savings, bestsavings, step;
int newp;
vp9_prob bestnewp, newplist[ENTROPY_NODES], oldplist[ENTROPY_NODES];
diff --git a/libvpx/vp9/encoder/vp9_subexp.h b/libvpx/vp9/encoder/vp9_subexp.h
index 521c777..8e9c0c6 100644
--- a/libvpx/vp9/encoder/vp9_subexp.h
+++ b/libvpx/vp9/encoder/vp9_subexp.h
@@ -9,8 +9,12 @@
*/
-#ifndef VP9_DECODER_VP9_SUBEXP_H_
-#define VP9_DECODER_VP9_SUBEXP_H_
+#ifndef VP9_ENCODER_VP9_SUBEXP_H_
+#define VP9_ENCODER_VP9_SUBEXP_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
void vp9_compute_update_table();
@@ -29,7 +33,10 @@ int vp9_prob_diff_update_savings_search(const unsigned int *ct,
int vp9_prob_diff_update_savings_search_model(const unsigned int *ct,
const vp9_prob *oldp,
vp9_prob *bestp,
- vp9_prob upd,
- int b, int r);
+ vp9_prob upd);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
-#endif // VP9_DECODER_VP9_SUBEXP_H_
+#endif // VP9_ENCODER_VP9_SUBEXP_H_
diff --git a/libvpx/vp9/encoder/vp9_svc_layercontext.c b/libvpx/vp9/encoder/vp9_svc_layercontext.c
new file mode 100644
index 0000000..eba7bc6
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_svc_layercontext.c
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <math.h>
+
+#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_svc_layercontext.h"
+
+void vp9_init_layer_context(VP9_COMP *const cpi) {
+ const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ int temporal_layer = 0;
+ cpi->svc.spatial_layer_id = 0;
+ cpi->svc.temporal_layer_id = 0;
+ for (temporal_layer = 0; temporal_layer < cpi->svc.number_temporal_layers;
+ ++temporal_layer) {
+ LAYER_CONTEXT *const lc = &cpi->svc.layer_context[temporal_layer];
+ RATE_CONTROL *const lrc = &lc->rc;
+ lrc->avg_frame_qindex[INTER_FRAME] = q_trans[oxcf->worst_allowed_q];
+ lrc->last_q[INTER_FRAME] = q_trans[oxcf->worst_allowed_q];
+ lrc->ni_av_qi = q_trans[oxcf->worst_allowed_q];
+ lrc->total_actual_bits = 0;
+ lrc->total_target_vs_actual = 0;
+ lrc->ni_tot_qi = 0;
+ lrc->tot_q = 0.0;
+ lrc->avg_q = 0.0;
+ lrc->ni_frames = 0;
+ lrc->decimation_count = 0;
+ lrc->decimation_factor = 0;
+ lrc->rate_correction_factor = 1.0;
+ lrc->key_frame_rate_correction_factor = 1.0;
+ lc->target_bandwidth = oxcf->ts_target_bitrate[temporal_layer] *
+ 1000;
+ lrc->buffer_level =
+ vp9_rescale((int)(oxcf->starting_buffer_level),
+ lc->target_bandwidth, 1000);
+ lrc->bits_off_target = lrc->buffer_level;
+ }
+}
+
+// Update the layer context from a change_config() call.
+void vp9_update_layer_context_change_config(VP9_COMP *const cpi,
+ const int target_bandwidth) {
+ const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ const RATE_CONTROL *const rc = &cpi->rc;
+ int temporal_layer = 0;
+ float bitrate_alloc = 1.0;
+ for (temporal_layer = 0; temporal_layer < cpi->svc.number_temporal_layers;
+ ++temporal_layer) {
+ LAYER_CONTEXT *const lc = &cpi->svc.layer_context[temporal_layer];
+ RATE_CONTROL *const lrc = &lc->rc;
+ lc->target_bandwidth = oxcf->ts_target_bitrate[temporal_layer] * 1000;
+ bitrate_alloc = (float)lc->target_bandwidth / (float)target_bandwidth;
+ // Update buffer-related quantities.
+ lc->starting_buffer_level =
+ (int64_t)(oxcf->starting_buffer_level * bitrate_alloc);
+ lc->optimal_buffer_level =
+ (int64_t)(oxcf->optimal_buffer_level * bitrate_alloc);
+ lc->maximum_buffer_size =
+ (int64_t)(oxcf->maximum_buffer_size * bitrate_alloc);
+ lrc->bits_off_target = MIN(lrc->bits_off_target, lc->maximum_buffer_size);
+ lrc->buffer_level = MIN(lrc->buffer_level, lc->maximum_buffer_size);
+ // Update framerate-related quantities.
+ lc->framerate = oxcf->framerate / oxcf->ts_rate_decimator[temporal_layer];
+ lrc->av_per_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
+ lrc->max_frame_bandwidth = rc->max_frame_bandwidth;
+ // Update qp-related quantities.
+ lrc->worst_quality = rc->worst_quality;
+ lrc->best_quality = rc->best_quality;
+ }
+}
+
+void vp9_update_layer_framerate(VP9_COMP *const cpi) {
+ int temporal_layer = cpi->svc.temporal_layer_id;
+ const VP9_CONFIG *const oxcf = &cpi->oxcf;
+ LAYER_CONTEXT *const lc = &cpi->svc.layer_context[temporal_layer];
+ RATE_CONTROL *const lrc = &lc->rc;
+ lc->framerate = oxcf->framerate / oxcf->ts_rate_decimator[temporal_layer];
+ lrc->av_per_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
+ lrc->max_frame_bandwidth = cpi->rc.max_frame_bandwidth;
+ // Update the average layer frame size (non-cumulative per-frame-bw).
+ if (temporal_layer == 0) {
+ lc->avg_frame_size = lrc->av_per_frame_bandwidth;
+ } else {
+ double prev_layer_framerate = oxcf->framerate /
+ oxcf->ts_rate_decimator[temporal_layer - 1];
+ int prev_layer_target_bandwidth =
+ oxcf->ts_target_bitrate[temporal_layer - 1] * 1000;
+ lc->avg_frame_size =
+ (int)((lc->target_bandwidth - prev_layer_target_bandwidth) /
+ (lc->framerate - prev_layer_framerate));
+ }
+}
+
+void vp9_restore_layer_context(VP9_COMP *const cpi) {
+ int temporal_layer = cpi->svc.temporal_layer_id;
+ LAYER_CONTEXT *lc = &cpi->svc.layer_context[temporal_layer];
+ int frame_since_key = cpi->rc.frames_since_key;
+ int frame_to_key = cpi->rc.frames_to_key;
+ cpi->rc = lc->rc;
+ cpi->oxcf.target_bandwidth = lc->target_bandwidth;
+ cpi->oxcf.starting_buffer_level = lc->starting_buffer_level;
+ cpi->oxcf.optimal_buffer_level = lc->optimal_buffer_level;
+ cpi->oxcf.maximum_buffer_size = lc->maximum_buffer_size;
+ cpi->output_framerate = lc->framerate;
+ // Reset the frames_since_key and frames_to_key counters to their values
+ // before the layer restore. Keep these defined for the stream (not layer).
+ cpi->rc.frames_since_key = frame_since_key;
+ cpi->rc.frames_to_key = frame_to_key;
+}
+
+void vp9_save_layer_context(VP9_COMP *const cpi) {
+ int temporal_layer = cpi->svc.temporal_layer_id;
+ LAYER_CONTEXT *lc = &cpi->svc.layer_context[temporal_layer];
+ lc->rc = cpi->rc;
+ lc->target_bandwidth = (int)cpi->oxcf.target_bandwidth;
+ lc->starting_buffer_level = cpi->oxcf.starting_buffer_level;
+ lc->optimal_buffer_level = cpi->oxcf.optimal_buffer_level;
+ lc->maximum_buffer_size = cpi->oxcf.maximum_buffer_size;
+ lc->framerate = cpi->output_framerate;
+}
diff --git a/libvpx/vp9/encoder/vp9_svc_layercontext.h b/libvpx/vp9/encoder/vp9_svc_layercontext.h
new file mode 100644
index 0000000..e81b0b7
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_svc_layercontext.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_
+#define VP9_ENCODER_VP9_SVC_LAYERCONTEXT_H_
+
+#include "vpx/vpx_encoder.h"
+
+#include "vp9/encoder/vp9_ratectrl.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ RATE_CONTROL rc;
+ int target_bandwidth;
+ int64_t starting_buffer_level;
+ int64_t optimal_buffer_level;
+ int64_t maximum_buffer_size;
+ double framerate;
+ int avg_frame_size;
+ struct twopass_rc twopass;
+} LAYER_CONTEXT;
+
+typedef struct {
+ int spatial_layer_id;
+ int temporal_layer_id;
+ int number_spatial_layers;
+ int number_temporal_layers;
+ // Layer context used for rate control in temporal CBR mode or spatial
+ // two pass mode. Defined for temporal or spatial layers for now.
+ // Does not support temporal combined with spatial RC.
+ LAYER_CONTEXT layer_context[MAX(VPX_TS_MAX_LAYERS, VPX_SS_MAX_LAYERS)];
+} SVC;
+
+struct VP9_COMP;
+
+// Initialize layer context data from init_config().
+void vp9_init_layer_context(struct VP9_COMP *const cpi);
+
+// Update the layer context from a change_config() call.
+void vp9_update_layer_context_change_config(struct VP9_COMP *const cpi,
+ const int target_bandwidth);
+
+// Prior to encoding the frame, update framerate-related quantities
+// for the current layer.
+void vp9_update_layer_framerate(struct VP9_COMP *const cpi);
+
+// Prior to encoding the frame, set the layer context, for the current layer
+// to be encoded, to the cpi struct.
+void vp9_restore_layer_context(struct VP9_COMP *const cpi);
+
+// Save the layer context after encoding the frame.
+void vp9_save_layer_context(struct VP9_COMP *const cpi);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_SVC_LAYERCONTEXT_
diff --git a/libvpx/vp9/encoder/vp9_temporal_filter.c b/libvpx/vp9/encoder/vp9_temporal_filter.c
index 2cace03..6233116 100644
--- a/libvpx/vp9/encoder/vp9_temporal_filter.c
+++ b/libvpx/vp9/encoder/vp9_temporal_filter.c
@@ -11,37 +11,46 @@
#include <math.h>
#include <limits.h>
+#include "vp9/common/vp9_alloccommon.h"
#include "vp9/common/vp9_onyxc_int.h"
+#include "vp9/common/vp9_quant_common.h"
#include "vp9/common/vp9_reconinter.h"
-#include "vp9/encoder/vp9_onyx_int.h"
#include "vp9/common/vp9_systemdependent.h"
-#include "vp9/encoder/vp9_quantize.h"
-#include "vp9/common/vp9_alloccommon.h"
-#include "vp9/encoder/vp9_mcomp.h"
+#include "vp9/encoder/vp9_extend.h"
#include "vp9/encoder/vp9_firstpass.h"
-#include "vp9/encoder/vp9_psnr.h"
-#include "vpx_scale/vpx_scale.h"
-#include "vp9/common/vp9_extend.h"
+#include "vp9/encoder/vp9_mcomp.h"
+#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_quantize.h"
#include "vp9/encoder/vp9_ratectrl.h"
-#include "vp9/common/vp9_quant_common.h"
#include "vp9/encoder/vp9_segmentation.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_ports/vpx_timer.h"
+#include "vpx_scale/vpx_scale.h"
#define ALT_REF_MC_ENABLED 1 // dis/enable MC in AltRef filtering
-#define ALT_REF_SUBPEL_ENABLED 1 // dis/enable subpel in MC AltRef filtering
static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
uint8_t *y_mb_ptr,
uint8_t *u_mb_ptr,
uint8_t *v_mb_ptr,
int stride,
+ int uv_block_size,
int mv_row,
int mv_col,
uint8_t *pred,
- struct scale_factors *scale) {
+ struct scale_factors *scale,
+ int x, int y) {
const int which_mv = 0;
MV mv = { mv_row, mv_col };
+ enum mv_precision mv_precision_uv;
+ int uv_stride;
+ if (uv_block_size == 8) {
+ uv_stride = (stride + 1) >> 1;
+ mv_precision_uv = MV_PRECISION_Q4;
+ } else {
+ uv_stride = stride;
+ mv_precision_uv = MV_PRECISION_Q3;
+ }
vp9_build_inter_predictor(y_mb_ptr, stride,
&pred[0], 16,
@@ -49,25 +58,23 @@ static void temporal_filter_predictors_mb_c(MACROBLOCKD *xd,
scale,
16, 16,
which_mv,
- &xd->subpix, MV_PRECISION_Q3);
-
- stride = (stride + 1) >> 1;
+ xd->interp_kernel, MV_PRECISION_Q3, x, y);
- vp9_build_inter_predictor(u_mb_ptr, stride,
- &pred[256], 8,
+ vp9_build_inter_predictor(u_mb_ptr, uv_stride,
+ &pred[256], uv_block_size,
&mv,
scale,
- 8, 8,
+ uv_block_size, uv_block_size,
which_mv,
- &xd->subpix, MV_PRECISION_Q4);
+ xd->interp_kernel, mv_precision_uv, x, y);
- vp9_build_inter_predictor(v_mb_ptr, stride,
- &pred[320], 8,
+ vp9_build_inter_predictor(v_mb_ptr, uv_stride,
+ &pred[512], uv_block_size,
&mv,
scale,
- 8, 8,
+ uv_block_size, uv_block_size,
which_mv,
- &xd->subpix, MV_PRECISION_Q4);
+ xd->interp_kernel, mv_precision_uv, x, y);
}
void vp9_temporal_filter_apply_c(uint8_t *frame1,
@@ -117,25 +124,23 @@ void vp9_temporal_filter_apply_c(uint8_t *frame1,
static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
uint8_t *arf_frame_buf,
uint8_t *frame_ptr_buf,
- int stride,
- int error_thresh) {
+ int stride) {
MACROBLOCK *x = &cpi->mb;
MACROBLOCKD* const xd = &x->e_mbd;
int step_param;
int sadpb = x->sadperbit16;
int bestsme = INT_MAX;
- int_mv best_ref_mv1;
- int_mv best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */
- int_mv *ref_mv;
+ MV best_ref_mv1 = {0, 0};
+ MV best_ref_mv1_full; /* full-pixel value of best_ref_mv1 */
+ MV *ref_mv = &x->e_mbd.mi_8x8[0]->bmi[0].as_mv[0].as_mv;
// Save input state
struct buf_2d src = x->plane[0].src;
struct buf_2d pre = xd->plane[0].pre[0];
- best_ref_mv1.as_int = 0;
- best_ref_mv1_full.as_mv.col = best_ref_mv1.as_mv.col >> 3;
- best_ref_mv1_full.as_mv.row = best_ref_mv1.as_mv.row >> 3;
+ best_ref_mv1_full.col = best_ref_mv1.col >> 3;
+ best_ref_mv1_full.row = best_ref_mv1.row >> 3;
// Setup frame pointers
x->plane[0].src.buf = arf_frame_buf;
@@ -152,21 +157,17 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
/*cpi->sf.search_method == HEX*/
// Ignore mv costing by sending NULL pointer instead of cost arrays
- ref_mv = &x->e_mbd.mi_8x8[0]->bmi[0].as_mv[0];
- bestsme = vp9_hex_search(x, &best_ref_mv1_full.as_mv,
- step_param, sadpb, 1,
- &cpi->fn_ptr[BLOCK_16X16],
- 0, &best_ref_mv1.as_mv, &ref_mv->as_mv);
+ vp9_hex_search(x, &best_ref_mv1_full, step_param, sadpb, 1,
+ &cpi->fn_ptr[BLOCK_16X16], 0, &best_ref_mv1, ref_mv);
-#if ALT_REF_SUBPEL_ENABLED
// Try sub-pixel MC?
// if (bestsme > error_thresh && bestsme < INT_MAX)
{
int distortion;
unsigned int sse;
// Ignore mv costing by sending NULL pointer instead of cost array
- bestsme = cpi->find_fractional_mv_step(x, &ref_mv->as_mv,
- &best_ref_mv1.as_mv,
+ bestsme = cpi->find_fractional_mv_step(x, ref_mv,
+ &best_ref_mv1,
cpi->common.allow_high_precision_mv,
x->errorperbit,
&cpi->fn_ptr[BLOCK_16X16],
@@ -174,7 +175,6 @@ static int temporal_filter_find_matching_mb_c(VP9_COMP *cpi,
NULL, NULL,
&distortion, &sse);
}
-#endif
// Restore input state
x->plane[0].src = src;
@@ -197,24 +197,28 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
int mb_rows = cpi->common.mb_rows;
int mb_y_offset = 0;
int mb_uv_offset = 0;
- DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16 * 16 + 8 * 8 + 8 * 8);
- DECLARE_ALIGNED_ARRAY(16, uint16_t, count, 16 * 16 + 8 * 8 + 8 * 8);
+ DECLARE_ALIGNED_ARRAY(16, unsigned int, accumulator, 16 * 16 * 3);
+ DECLARE_ALIGNED_ARRAY(16, uint16_t, count, 16 * 16 * 3);
MACROBLOCKD *mbd = &cpi->mb.e_mbd;
YV12_BUFFER_CONFIG *f = cpi->frames[alt_ref_index];
uint8_t *dst1, *dst2;
- DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor, 16 * 16 + 8 * 8 + 8 * 8);
+ DECLARE_ALIGNED_ARRAY(16, uint8_t, predictor, 16 * 16 * 3);
+ const int mb_uv_height = 16 >> mbd->plane[1].subsampling_y;
// Save input state
uint8_t* input_buffer[MAX_MB_PLANE];
int i;
+ // TODO(aconverse): Add 4:2:2 support
+ assert(mbd->plane[1].subsampling_x == mbd->plane[1].subsampling_y);
+
for (i = 0; i < MAX_MB_PLANE; i++)
input_buffer[i] = mbd->plane[i].pre[0].buf;
for (mb_row = 0; mb_row < mb_rows; mb_row++) {
#if ALT_REF_MC_ENABLED
// Source frames are extended to 16 pixels. This is different than
- // L/A/G reference frames that have a border of 32 (VP9BORDERINPIXELS)
+ // L/A/G reference frames that have a border of 32 (VP9ENCBORDERINPIXELS)
// A 6/8 tap filter is used for motion search. This requires 2 pixels
// before and 3 pixels after. So the largest Y mv on a border would
// then be 16 - VP9_INTERP_EXTEND. The UV blocks are half the size of the
@@ -233,8 +237,8 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
int i, j, k;
int stride;
- vpx_memset(accumulator, 0, 384 * sizeof(unsigned int));
- vpx_memset(count, 0, 384 * sizeof(uint16_t));
+ vpx_memset(accumulator, 0, 16 * 16 * 3 * sizeof(accumulator[0]));
+ vpx_memset(count, 0, 16 * 16 * 3 * sizeof(count[0]));
#if ALT_REF_MC_ENABLED
cpi->mb.mv_col_min = -((mb_col * 16) + (17 - 2 * VP9_INTERP_EXTEND));
@@ -262,8 +266,7 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
(cpi,
cpi->frames[alt_ref_index]->y_buffer + mb_y_offset,
cpi->frames[frame]->y_buffer + mb_y_offset,
- cpi->frames[frame]->y_stride,
- THRESH_LOW);
+ cpi->frames[frame]->y_stride);
#endif
// Assign higher weight to matching MB if it's error
// score is lower. If not applying MC default behavior
@@ -280,9 +283,11 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
cpi->frames[frame]->u_buffer + mb_uv_offset,
cpi->frames[frame]->v_buffer + mb_uv_offset,
cpi->frames[frame]->y_stride,
+ mb_uv_height,
mbd->mi_8x8[0]->bmi[0].as_mv[0].as_mv.row,
mbd->mi_8x8[0]->bmi[0].as_mv[0].as_mv.col,
- predictor, scale);
+ predictor, scale,
+ mb_col * 16, mb_row * 16);
// Apply the filter (YUV)
vp9_temporal_filter_apply(f->y_buffer + mb_y_offset, f->y_stride,
@@ -290,12 +295,14 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
accumulator, count);
vp9_temporal_filter_apply(f->u_buffer + mb_uv_offset, f->uv_stride,
- predictor + 256, 8, strength, filter_weight,
- accumulator + 256, count + 256);
+ predictor + 256, mb_uv_height, strength,
+ filter_weight, accumulator + 256,
+ count + 256);
vp9_temporal_filter_apply(f->v_buffer + mb_uv_offset, f->uv_stride,
- predictor + 320, 8, strength, filter_weight,
- accumulator + 320, count + 320);
+ predictor + 512, mb_uv_height, strength,
+ filter_weight, accumulator + 512,
+ count + 512);
}
}
@@ -322,9 +329,9 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
dst2 = cpi->alt_ref_buffer.v_buffer;
stride = cpi->alt_ref_buffer.uv_stride;
byte = mb_uv_offset;
- for (i = 0, k = 256; i < 8; i++) {
- for (j = 0; j < 8; j++, k++) {
- int m = k + 64;
+ for (i = 0, k = 256; i < mb_uv_height; i++) {
+ for (j = 0; j < mb_uv_height; j++, k++) {
+ int m = k + 256;
// U
unsigned int pval = accumulator[k] + (count[k] >> 1);
@@ -342,15 +349,15 @@ static void temporal_filter_iterate_c(VP9_COMP *cpi,
byte++;
}
- byte += stride - 8;
+ byte += stride - mb_uv_height;
}
mb_y_offset += 16;
- mb_uv_offset += 8;
+ mb_uv_offset += mb_uv_height;
}
mb_y_offset += 16 * (f->y_stride - mb_cols);
- mb_uv_offset += 8 * (f->uv_stride - mb_cols);
+ mb_uv_offset += mb_uv_height * (f->uv_stride - mb_cols);
}
// Restore input state
@@ -375,9 +382,7 @@ void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
const int num_frames_backward = distance;
const int num_frames_forward = vp9_lookahead_depth(cpi->lookahead)
- (num_frames_backward + 1);
-
- struct scale_factors scale;
- struct scale_factors_common scale_comm;
+ struct scale_factors sf;
switch (blur_type) {
case 1:
@@ -392,7 +397,6 @@ void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
case 2:
// Forward Blur
-
frames_to_blur_forward = num_frames_forward;
if (frames_to_blur_forward >= max_frames)
@@ -437,7 +441,7 @@ void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
#endif
// Setup scaling factors. Scaling on each of the arnr frames is not supported
- vp9_setup_scale_factors_for_frame(&scale, &scale_comm,
+ vp9_setup_scale_factors_for_frame(&sf,
get_frame_new_buffer(cm)->y_crop_width,
get_frame_new_buffer(cm)->y_crop_height,
cm->width, cm->height);
@@ -452,25 +456,27 @@ void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
}
temporal_filter_iterate_c(cpi, frames_to_blur, frames_to_blur_backward,
- strength, &scale);
+ strength, &sf);
}
-void configure_arnr_filter(VP9_COMP *cpi, const unsigned int this_frame,
- const int group_boost) {
+void vp9_configure_arnr_filter(VP9_COMP *cpi,
+ const unsigned int frames_to_arnr,
+ const int group_boost) {
int half_gf_int;
int frames_after_arf;
int frames_bwd = cpi->oxcf.arnr_max_frames - 1;
int frames_fwd = cpi->oxcf.arnr_max_frames - 1;
int q;
- // Define the arnr filter width for this group of frames:
- // We only filter frames that lie within a distance of half
- // the GF interval from the ARF frame. We also have to trap
- // cases where the filter extends beyond the end of clip.
- // Note: this_frame->frame has been updated in the loop
- // so it now points at the ARF frame.
- half_gf_int = cpi->baseline_gf_interval >> 1;
- frames_after_arf = (int)(cpi->twopass.total_stats.count - this_frame - 1);
+ // Define the arnr filter width for this group of frames. We only
+ // filter frames that lie within a distance of half the GF interval
+ // from the ARF frame. We also have to trap cases where the filter
+ // extends beyond the end of the lookahead buffer.
+ // Note: frames_to_arnr parameter is the offset of the arnr
+ // frame from the current frame.
+ half_gf_int = cpi->rc.baseline_gf_interval >> 1;
+ frames_after_arf = vp9_lookahead_depth(cpi->lookahead)
+ - frames_to_arnr - 1;
switch (cpi->oxcf.arnr_type) {
case 1: // Backward filter
@@ -507,11 +513,16 @@ void configure_arnr_filter(VP9_COMP *cpi, const unsigned int this_frame,
cpi->active_arnr_frames = frames_bwd + 1 + frames_fwd;
// Adjust the strength based on active max q
- q = ((int)vp9_convert_qindex_to_q(cpi->active_worst_quality) >> 1);
- if (q > 8) {
+ if (cpi->common.current_video_frame > 1)
+ q = ((int)vp9_convert_qindex_to_q(
+ cpi->rc.avg_frame_qindex[INTER_FRAME]));
+ else
+ q = ((int)vp9_convert_qindex_to_q(
+ cpi->rc.avg_frame_qindex[KEY_FRAME]));
+ if (q > 16) {
cpi->active_arnr_strength = cpi->oxcf.arnr_strength;
} else {
- cpi->active_arnr_strength = cpi->oxcf.arnr_strength - (8 - q);
+ cpi->active_arnr_strength = cpi->oxcf.arnr_strength - ((16 - q) / 2);
if (cpi->active_arnr_strength < 0)
cpi->active_arnr_strength = 0;
}
diff --git a/libvpx/vp9/encoder/vp9_temporal_filter.h b/libvpx/vp9/encoder/vp9_temporal_filter.h
index c5f3b46..3028d78 100644
--- a/libvpx/vp9/encoder/vp9_temporal_filter.h
+++ b/libvpx/vp9/encoder/vp9_temporal_filter.h
@@ -11,8 +11,17 @@
#ifndef VP9_ENCODER_VP9_TEMPORAL_FILTER_H_
#define VP9_ENCODER_VP9_TEMPORAL_FILTER_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance);
-void configure_arnr_filter(VP9_COMP *cpi, const unsigned int this_frame,
- const int group_boost);
+void vp9_configure_arnr_filter(VP9_COMP *cpi,
+ const unsigned int frames_to_arnr,
+ const int group_boost);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_TEMPORAL_FILTER_H_
diff --git a/libvpx/vp9/encoder/vp9_tokenize.c b/libvpx/vp9/encoder/vp9_tokenize.c
index c7336d0..bb5f1c2 100644
--- a/libvpx/vp9/encoder/vp9_tokenize.c
+++ b/libvpx/vp9/encoder/vp9_tokenize.c
@@ -8,23 +8,105 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
+#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
-#include <assert.h>
-#include "vp9/encoder/vp9_onyx_int.h"
-#include "vp9/encoder/vp9_tokenize.h"
+
#include "vpx_mem/vpx_mem.h"
+#include "vp9/common/vp9_entropy.h"
#include "vp9/common/vp9_pred_common.h"
#include "vp9/common/vp9_seg_common.h"
-#include "vp9/common/vp9_entropy.h"
+
+#include "vp9/encoder/vp9_cost.h"
+#include "vp9/encoder/vp9_onyx_int.h"
+#include "vp9/encoder/vp9_tokenize.h"
static TOKENVALUE dct_value_tokens[DCT_MAX_VALUE * 2];
const TOKENVALUE *vp9_dct_value_tokens_ptr;
-static int dct_value_cost[DCT_MAX_VALUE * 2];
-const int *vp9_dct_value_cost_ptr;
+static int16_t dct_value_cost[DCT_MAX_VALUE * 2];
+const int16_t *vp9_dct_value_cost_ptr;
+
+// Array indices are identical to previously-existing CONTEXT_NODE indices
+const vp9_tree_index vp9_coef_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
+ -EOB_TOKEN, 2, // 0 = EOB
+ -ZERO_TOKEN, 4, // 1 = ZERO
+ -ONE_TOKEN, 6, // 2 = ONE
+ 8, 12, // 3 = LOW_VAL
+ -TWO_TOKEN, 10, // 4 = TWO
+ -THREE_TOKEN, -FOUR_TOKEN, // 5 = THREE
+ 14, 16, // 6 = HIGH_LOW
+ -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, // 7 = CAT_ONE
+ 18, 20, // 8 = CAT_THREEFOUR
+ -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, // 9 = CAT_THREE
+ -CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 10 = CAT_FIVE
+};
+
+// Unconstrained Node Tree
+const vp9_tree_index vp9_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)] = {
+ 2, 6, // 0 = LOW_VAL
+ -TWO_TOKEN, 4, // 1 = TWO
+ -THREE_TOKEN, -FOUR_TOKEN, // 2 = THREE
+ 8, 10, // 3 = HIGH_LOW
+ -CATEGORY1_TOKEN, -CATEGORY2_TOKEN, // 4 = CAT_ONE
+ 12, 14, // 5 = CAT_THREEFOUR
+ -CATEGORY3_TOKEN, -CATEGORY4_TOKEN, // 6 = CAT_THREE
+ -CATEGORY5_TOKEN, -CATEGORY6_TOKEN // 7 = CAT_FIVE
+};
+
+static const vp9_prob Pcat1[] = { 159};
+static const vp9_prob Pcat2[] = { 165, 145};
+static const vp9_prob Pcat3[] = { 173, 148, 140};
+static const vp9_prob Pcat4[] = { 176, 155, 140, 135};
+static const vp9_prob Pcat5[] = { 180, 157, 141, 134, 130};
+static const vp9_prob Pcat6[] = {
+ 254, 254, 254, 252, 249, 243, 230, 196, 177, 153, 140, 133, 130, 129
+};
+
+static vp9_tree_index cat1[2], cat2[4], cat3[6], cat4[8], cat5[10], cat6[28];
+
+static void init_bit_tree(vp9_tree_index *p, int n) {
+ int i = 0;
+
+ while (++i < n) {
+ p[0] = p[1] = i << 1;
+ p += 2;
+ }
+
+ p[0] = p[1] = 0;
+}
+
+static void init_bit_trees() {
+ init_bit_tree(cat1, 1);
+ init_bit_tree(cat2, 2);
+ init_bit_tree(cat3, 3);
+ init_bit_tree(cat4, 4);
+ init_bit_tree(cat5, 5);
+ init_bit_tree(cat6, 14);
+}
+
+const vp9_extra_bit vp9_extra_bits[ENTROPY_TOKENS] = {
+ {0, 0, 0, 0}, // ZERO_TOKEN
+ {0, 0, 0, 1}, // ONE_TOKEN
+ {0, 0, 0, 2}, // TWO_TOKEN
+ {0, 0, 0, 3}, // THREE_TOKEN
+ {0, 0, 0, 4}, // FOUR_TOKEN
+ {cat1, Pcat1, 1, 5}, // CATEGORY1_TOKEN
+ {cat2, Pcat2, 2, 7}, // CATEGORY2_TOKEN
+ {cat3, Pcat3, 3, 11}, // CATEGORY3_TOKEN
+ {cat4, Pcat4, 4, 19}, // CATEGORY4_TOKEN
+ {cat5, Pcat5, 5, 35}, // CATEGORY5_TOKEN
+ {cat6, Pcat6, 14, 67}, // CATEGORY6_TOKEN
+ {0, 0, 0, 0} // EOB_TOKEN
+};
+
+struct vp9_token vp9_coef_encodings[ENTROPY_TOKENS];
+
+void vp9_coef_tree_initialize() {
+ init_bit_trees();
+ vp9_tokens_from_tree(vp9_coef_encodings, vp9_coef_tree);
+}
static void fill_value_tokens() {
TOKENVALUE *const t = dct_value_tokens + DCT_MAX_VALUE;
@@ -80,7 +162,6 @@ struct tokenize_b_args {
VP9_COMP *cpi;
MACROBLOCKD *xd;
TOKENEXTRA **tp;
- TX_SIZE tx_size;
uint8_t *token_cache;
};
@@ -88,10 +169,42 @@ static void set_entropy_context_b(int plane, int block, BLOCK_SIZE plane_bsize,
TX_SIZE tx_size, void *arg) {
struct tokenize_b_args* const args = arg;
MACROBLOCKD *const xd = args->xd;
+ struct macroblock_plane *p = &args->cpi->mb.plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
int aoff, loff;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
- set_contexts(xd, pd, plane_bsize, tx_size, pd->eobs[block] > 0, aoff, loff);
+ vp9_set_contexts(xd, pd, plane_bsize, tx_size, p->eobs[block] > 0,
+ aoff, loff);
+}
+
+static INLINE void add_token(TOKENEXTRA **t, const vp9_prob *context_tree,
+ int16_t extra, uint8_t token,
+ uint8_t skip_eob_node,
+ unsigned int *counts) {
+ (*t)->token = token;
+ (*t)->extra = extra;
+ (*t)->context_tree = context_tree;
+ (*t)->skip_eob_node = skip_eob_node;
+ (*t)++;
+ ++counts[token];
+}
+
+static INLINE void add_token_no_extra(TOKENEXTRA **t,
+ const vp9_prob *context_tree,
+ uint8_t token,
+ uint8_t skip_eob_node,
+ unsigned int *counts) {
+ (*t)->token = token;
+ (*t)->context_tree = context_tree;
+ (*t)->skip_eob_node = skip_eob_node;
+ (*t)++;
+ ++counts[token];
+}
+
+static INLINE int get_tx_eob(const struct segmentation *seg, int segment_id,
+ TX_SIZE tx_size) {
+ const int eob_max = 16 << (tx_size << 1);
+ return vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP) ? 0 : eob_max;
}
static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
@@ -101,69 +214,80 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
MACROBLOCKD *xd = args->xd;
TOKENEXTRA **tp = args->tp;
uint8_t *token_cache = args->token_cache;
+ struct macroblock_plane *p = &cpi->mb.plane[plane];
struct macroblockd_plane *pd = &xd->plane[plane];
MB_MODE_INFO *mbmi = &xd->mi_8x8[0]->mbmi;
int pt; /* near block/prev token context index */
- int c = 0, rc = 0;
+ int c;
TOKENEXTRA *t = *tp; /* store tokens starting here */
- const int eob = pd->eobs[block];
+ int eob = p->eobs[block];
const PLANE_TYPE type = pd->plane_type;
- const int16_t *qcoeff_ptr = BLOCK_OFFSET(pd->qcoeff, block);
-
+ const int16_t *qcoeff = BLOCK_OFFSET(p->qcoeff, block);
const int segment_id = mbmi->segment_id;
const int16_t *scan, *nb;
- vp9_coeff_count *const counts = cpi->coef_counts[tx_size];
- vp9_coeff_probs_model *const coef_probs = cpi->common.fc.coef_probs[tx_size];
+ const scan_order *so;
const int ref = is_inter_block(mbmi);
- const uint8_t *const band_translate = get_band_translate(tx_size);
+ unsigned int (*const counts)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
+ cpi->coef_counts[tx_size][type][ref];
+ vp9_prob (*const coef_probs)[COEFF_CONTEXTS][UNCONSTRAINED_NODES] =
+ cpi->common.fc.coef_probs[tx_size][type][ref];
+ unsigned int (*const eob_branch)[COEFF_CONTEXTS] =
+ cpi->common.counts.eob_branch[tx_size][type][ref];
+
+ const uint8_t *const band = get_band_translate(tx_size);
const int seg_eob = get_tx_eob(&cpi->common.seg, segment_id, tx_size);
+
int aoff, loff;
txfrm_block_to_raster_xy(plane_bsize, tx_size, block, &aoff, &loff);
- assert((!type && !plane) || (type && plane));
-
pt = get_entropy_context(tx_size, pd->above_context + aoff,
- pd->left_context + loff);
- get_scan(xd, tx_size, type, block, &scan, &nb);
+ pd->left_context + loff);
+ so = get_scan(xd, tx_size, type, block);
+ scan = so->scan;
+ nb = so->neighbors;
c = 0;
- do {
- const int band = band_translate[c];
- int token;
+ while (c < eob) {
int v = 0;
- rc = scan[c];
- if (c)
- pt = get_coef_context(nb, token_cache, c);
- if (c < eob) {
- v = qcoeff_ptr[rc];
- assert(-DCT_MAX_VALUE <= v && v < DCT_MAX_VALUE);
-
- t->extra = vp9_dct_value_tokens_ptr[v].extra;
- token = vp9_dct_value_tokens_ptr[v].token;
- } else {
- token = DCT_EOB_TOKEN;
- }
+ int skip_eob = 0;
+ v = qcoeff[scan[c]];
- t->token = token;
- t->context_tree = coef_probs[type][ref][band][pt];
- t->skip_eob_node = (c > 0) && (token_cache[scan[c - 1]] == 0);
+ while (!v) {
+ add_token_no_extra(&t, coef_probs[band[c]][pt], ZERO_TOKEN, skip_eob,
+ counts[band[c]][pt]);
+ eob_branch[band[c]][pt] += !skip_eob;
- assert(vp9_coef_encodings[t->token].len - t->skip_eob_node > 0);
-
- ++counts[type][ref][band][pt][token];
- if (!t->skip_eob_node)
- ++cpi->common.counts.eob_branch[tx_size][type][ref][band][pt];
+ skip_eob = 1;
+ token_cache[scan[c]] = 0;
+ ++c;
+ pt = get_coef_context(nb, token_cache, c);
+ v = qcoeff[scan[c]];
+ }
- token_cache[rc] = vp9_pt_energy_class[token];
- ++t;
- } while (c < eob && ++c < seg_eob);
+ add_token(&t, coef_probs[band[c]][pt],
+ vp9_dct_value_tokens_ptr[v].extra,
+ (uint8_t)vp9_dct_value_tokens_ptr[v].token,
+ (uint8_t)skip_eob,
+ counts[band[c]][pt]);
+ eob_branch[band[c]][pt] += !skip_eob;
+
+ token_cache[scan[c]] =
+ vp9_pt_energy_class[vp9_dct_value_tokens_ptr[v].token];
+ ++c;
+ pt = get_coef_context(nb, token_cache, c);
+ }
+ if (c < seg_eob) {
+ add_token_no_extra(&t, coef_probs[band[c]][pt], EOB_TOKEN, 0,
+ counts[band[c]][pt]);
+ ++eob_branch[band[c]][pt];
+ }
*tp = t;
- set_contexts(xd, pd, plane_bsize, tx_size, c > 0, aoff, loff);
+ vp9_set_contexts(xd, pd, plane_bsize, tx_size, c > 0, aoff, loff);
}
struct is_skippable_args {
- MACROBLOCKD *xd;
+ MACROBLOCK *x;
int *skippable;
};
@@ -171,21 +295,14 @@ static void is_skippable(int plane, int block,
BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
void *argv) {
struct is_skippable_args *args = argv;
- args->skippable[0] &= (!args->xd->plane[plane].eobs[block]);
-}
-
-int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE bsize) {
- int result = 1;
- struct is_skippable_args args = {xd, &result};
- foreach_transformed_block(xd, bsize, is_skippable, &args);
- return result;
+ args->skippable[0] &= (!args->x->plane[plane].eobs[block]);
}
-int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE bsize,
- int plane) {
+int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane) {
int result = 1;
- struct is_skippable_args args = {xd, &result};
- foreach_transformed_block_in_plane(xd, bsize, plane, is_skippable, &args);
+ struct is_skippable_args args = {x, &result};
+ vp9_foreach_transformed_block_in_plane(&x->e_mbd, bsize, plane, is_skippable,
+ &args);
return result;
}
@@ -195,15 +312,13 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
MACROBLOCKD *const xd = &cpi->mb.e_mbd;
MB_MODE_INFO *const mbmi = &xd->mi_8x8[0]->mbmi;
TOKENEXTRA *t_backup = *t;
- const int mb_skip_context = vp9_get_pred_context_mbskip(xd);
+ const int ctx = vp9_get_skip_context(xd);
const int skip_inc = !vp9_segfeature_active(&cm->seg, mbmi->segment_id,
SEG_LVL_SKIP);
- struct tokenize_b_args arg = {cpi, xd, t, mbmi->tx_size, cpi->mb.token_cache};
-
- mbmi->skip_coeff = vp9_sb_is_skippable(xd, bsize);
- if (mbmi->skip_coeff) {
+ struct tokenize_b_args arg = {cpi, xd, t, cpi->mb.token_cache};
+ if (mbmi->skip) {
if (!dry_run)
- cm->counts.mbskip[mb_skip_context][1] += skip_inc;
+ cm->counts.skip[ctx][1] += skip_inc;
reset_skip_context(xd, bsize);
if (dry_run)
*t = t_backup;
@@ -211,10 +326,10 @@ void vp9_tokenize_sb(VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
}
if (!dry_run) {
- cm->counts.mbskip[mb_skip_context][0] += skip_inc;
- foreach_transformed_block(xd, bsize, tokenize_b, &arg);
+ cm->counts.skip[ctx][0] += skip_inc;
+ vp9_foreach_transformed_block(xd, bsize, tokenize_b, &arg);
} else {
- foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg);
+ vp9_foreach_transformed_block(xd, bsize, set_entropy_context_b, &arg);
*t = t_backup;
}
}
diff --git a/libvpx/vp9/encoder/vp9_tokenize.h b/libvpx/vp9/encoder/vp9_tokenize.h
index e24e31b..063c0ba 100644
--- a/libvpx/vp9/encoder/vp9_tokenize.h
+++ b/libvpx/vp9/encoder/vp9_tokenize.h
@@ -12,10 +12,18 @@
#define VP9_ENCODER_VP9_TOKENIZE_H_
#include "vp9/common/vp9_entropy.h"
+
#include "vp9/encoder/vp9_block.h"
+#include "vp9/encoder/vp9_treewriter.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
void vp9_tokenize_initialize();
+#define EOSB_TOKEN 127 // Not signalled, encoder only
+
typedef struct {
int16_t token;
int16_t extra;
@@ -28,19 +36,26 @@ typedef struct {
uint8_t skip_eob_node;
} TOKENEXTRA;
-int vp9_sb_is_skippable(MACROBLOCKD *xd, BLOCK_SIZE bsize);
-int vp9_is_skippable_in_plane(MACROBLOCKD *xd, BLOCK_SIZE bsize,
- int plane);
+extern const vp9_tree_index vp9_coef_tree[];
+extern const vp9_tree_index vp9_coef_con_tree[];
+extern struct vp9_token vp9_coef_encodings[];
+
+int vp9_is_skippable_in_plane(MACROBLOCK *x, BLOCK_SIZE bsize, int plane);
+
struct VP9_COMP;
void vp9_tokenize_sb(struct VP9_COMP *cpi, TOKENEXTRA **t, int dry_run,
BLOCK_SIZE bsize);
-extern const int *vp9_dct_value_cost_ptr;
+extern const int16_t *vp9_dct_value_cost_ptr;
/* TODO: The Token field should be broken out into a separate char array to
* improve cache locality, since it's needed for costing when the rest of the
* fields are not.
*/
extern const TOKENVALUE *vp9_dct_value_tokens_ptr;
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_TOKENIZE_H_
diff --git a/libvpx/vp9/encoder/vp9_treewriter.c b/libvpx/vp9/encoder/vp9_treewriter.c
index e4aed53..bb04b40 100644
--- a/libvpx/vp9/encoder/vp9_treewriter.c
+++ b/libvpx/vp9/encoder/vp9_treewriter.c
@@ -10,29 +10,49 @@
#include "vp9/encoder/vp9_treewriter.h"
-static void cost(int *costs, vp9_tree tree, const vp9_prob *probs,
- int i, int c) {
- const vp9_prob prob = probs[i / 2];
- int b;
-
- for (b = 0; b <= 1; ++b) {
- const int cc = c + vp9_cost_bit(prob, b);
- const vp9_tree_index ii = tree[i + b];
-
- if (ii <= 0)
- costs[-ii] = cc;
- else
- cost(costs, tree, probs, ii, cc);
- }
+static void tree2tok(struct vp9_token *tokens, const vp9_tree_index *tree,
+ int i, int v, int l) {
+ v += v;
+ ++l;
+
+ do {
+ const vp9_tree_index j = tree[i++];
+ if (j <= 0) {
+ tokens[-j].value = v;
+ tokens[-j].len = l;
+ } else {
+ tree2tok(tokens, tree, j, v, l);
+ }
+ } while (++v & 1);
}
-void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree) {
- cost(costs, tree, probs, 0, 0);
+void vp9_tokens_from_tree(struct vp9_token *tokens,
+ const vp9_tree_index *tree) {
+ tree2tok(tokens, tree, 0, 0, 0);
}
-void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree) {
- assert(tree[0] <= 0 && tree[1] > 0);
+static unsigned int convert_distribution(unsigned int i, vp9_tree tree,
+ unsigned int branch_ct[][2],
+ const unsigned int num_events[]) {
+ unsigned int left, right;
+
+ if (tree[i] <= 0)
+ left = num_events[-tree[i]];
+ else
+ left = convert_distribution(tree[i], tree, branch_ct, num_events);
+
+ if (tree[i + 1] <= 0)
+ right = num_events[-tree[i + 1]];
+ else
+ right = convert_distribution(tree[i + 1], tree, branch_ct, num_events);
+
+ branch_ct[i >> 1][0] = left;
+ branch_ct[i >> 1][1] = right;
+ return left + right;
+}
- costs[-tree[0]] = vp9_cost_bit(probs[0], 0);
- cost(costs, tree, probs, 2, 0);
+void vp9_tree_probs_from_distribution(vp9_tree tree,
+ unsigned int branch_ct[/* n-1 */][2],
+ const unsigned int num_events[/* n */]) {
+ convert_distribution(0, tree, branch_ct, num_events);
}
diff --git a/libvpx/vp9/encoder/vp9_treewriter.h b/libvpx/vp9/encoder/vp9_treewriter.h
index eeda5cd..4a76d87 100644
--- a/libvpx/vp9/encoder/vp9_treewriter.h
+++ b/libvpx/vp9/encoder/vp9_treewriter.h
@@ -8,47 +8,29 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#ifndef VP9_ENCODER_VP9_TREEWRITER_H_
#define VP9_ENCODER_VP9_TREEWRITER_H_
-/* Trees map alphabets into huffman-like codes suitable for an arithmetic
- bit coder. Timothy S Murphy 11 October 2004 */
-
-#include "vp9/common/vp9_treecoder.h"
-
-#include "vp9/encoder/vp9_boolhuff.h" /* for now */
-
-
-#define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8)
-
-/* Approximate length of an encoded bool in 256ths of a bit at given prob */
+#include "vp9/encoder/vp9_writer.h"
-#define vp9_cost_zero(x) (vp9_prob_cost[x])
-#define vp9_cost_one(x) vp9_cost_zero(vp9_complement(x))
-
-#define vp9_cost_bit(x, b) vp9_cost_zero((b) ? vp9_complement(x) : (x))
-
-/* VP8BC version is scaled by 2^20 rather than 2^8; see bool_coder.h */
-
-
-/* Both of these return bits, not scaled bits. */
-static INLINE unsigned int cost_branch256(const unsigned int ct[2],
- vp9_prob p) {
- return ct[0] * vp9_cost_zero(p) + ct[1] * vp9_cost_one(p);
-}
+#ifdef __cplusplus
+extern "C" {
+#endif
-static INLINE unsigned int cost_branch(const unsigned int ct[2],
- vp9_prob p) {
- return cost_branch256(ct, p) >> 8;
-}
+void vp9_tree_probs_from_distribution(vp9_tree tree,
+ unsigned int branch_ct[ /* n - 1 */ ][2],
+ const unsigned int num_events[ /* n */ ]);
+struct vp9_token {
+ int value;
+ int len;
+};
-static INLINE void treed_write(vp9_writer *w,
- vp9_tree tree, const vp9_prob *probs,
- int bits, int len) {
- vp9_tree_index i = 0;
+void vp9_tokens_from_tree(struct vp9_token*, const vp9_tree_index *);
+static INLINE void vp9_write_tree(vp9_writer *w, const vp9_tree_index *tree,
+ const vp9_prob *probs, int bits, int len,
+ vp9_tree_index i) {
do {
const int bit = (bits >> --len) & 1;
vp9_write(w, bit, probs[i >> 1]);
@@ -56,32 +38,14 @@ static INLINE void treed_write(vp9_writer *w,
} while (len);
}
-static INLINE void write_token(vp9_writer *w, vp9_tree tree,
- const vp9_prob *probs,
- const struct vp9_token *token) {
- treed_write(w, tree, probs, token->value, token->len);
-}
-
-static INLINE int treed_cost(vp9_tree tree, const vp9_prob *probs,
- int bits, int len) {
- int cost = 0;
- vp9_tree_index i = 0;
-
- do {
- const int bit = (bits >> --len) & 1;
- cost += vp9_cost_bit(probs[i >> 1], bit);
- i = tree[i + bit];
- } while (len);
-
- return cost;
-}
-
-static INLINE int cost_token(vp9_tree tree, const vp9_prob *probs,
- const struct vp9_token *token) {
- return treed_cost(tree, probs, token->value, token->len);
+static INLINE void vp9_write_token(vp9_writer *w, const vp9_tree_index *tree,
+ const vp9_prob *probs,
+ const struct vp9_token *token) {
+ vp9_write_tree(w, tree, probs, token->value, token->len, 0);
}
-void vp9_cost_tokens(int *costs, const vp9_prob *probs, vp9_tree tree);
-void vp9_cost_tokens_skip(int *costs, const vp9_prob *probs, vp9_tree tree);
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VP9_ENCODER_VP9_TREEWRITER_H_
diff --git a/libvpx/vp9/encoder/vp9_vaq.c b/libvpx/vp9/encoder/vp9_vaq.c
index 1f9cb87..c71c171 100644
--- a/libvpx/vp9/encoder/vp9_vaq.c
+++ b/libvpx/vp9/encoder/vp9_vaq.c
@@ -19,8 +19,8 @@
#include "vp9/encoder/vp9_segmentation.h"
#include "vp9/common/vp9_systemdependent.h"
-#define ENERGY_MIN (-3)
-#define ENERGY_MAX (3)
+#define ENERGY_MIN (-1)
+#define ENERGY_MAX (1)
#define ENERGY_SPAN (ENERGY_MAX - ENERGY_MIN + 1)
#define ENERGY_IN_BOUNDS(energy)\
assert((energy) >= ENERGY_MIN && (energy) <= ENERGY_MAX)
@@ -44,7 +44,7 @@ unsigned int vp9_vaq_segment_id(int energy) {
double vp9_vaq_rdmult_ratio(int energy) {
ENERGY_IN_BOUNDS(energy);
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
return RDMULT_RATIO(energy);
}
@@ -52,7 +52,7 @@ double vp9_vaq_rdmult_ratio(int energy) {
double vp9_vaq_inv_q_ratio(int energy) {
ENERGY_IN_BOUNDS(energy);
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
return Q_RATIO(-energy);
}
@@ -63,9 +63,9 @@ void vp9_vaq_init() {
assert(ENERGY_SPAN <= MAX_SEGMENTS);
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
- base_ratio = 1.8;
+ base_ratio = 1.5;
for (i = ENERGY_MIN; i <= ENERGY_MAX; i++) {
Q_RATIO(i) = pow(base_ratio, i/3.0);
@@ -75,35 +75,39 @@ void vp9_vaq_init() {
void vp9_vaq_frame_setup(VP9_COMP *cpi) {
VP9_COMMON *cm = &cpi->common;
struct segmentation *seg = &cm->seg;
- int base_q = vp9_convert_qindex_to_q(cm->base_qindex);
- int base_rdmult = vp9_compute_rd_mult(cpi, cm->base_qindex +
- cm->y_dc_delta_q);
+ const double base_q = vp9_convert_qindex_to_q(cm->base_qindex);
+ const int base_rdmult = vp9_compute_rd_mult(cpi, cm->base_qindex +
+ cm->y_dc_delta_q);
int i;
- vp9_enable_segmentation((VP9_PTR)cpi);
- vp9_clearall_segfeatures(seg);
+ if (cm->frame_type == KEY_FRAME ||
+ cpi->refresh_alt_ref_frame ||
+ (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
+ vp9_enable_segmentation(seg);
+ vp9_clearall_segfeatures(seg);
- seg->abs_delta = SEGMENT_DELTADATA;
+ seg->abs_delta = SEGMENT_DELTADATA;
- vp9_clear_system_state(); // __asm emms;
+ vp9_clear_system_state();
- for (i = ENERGY_MIN; i <= ENERGY_MAX; i++) {
- int qindex_delta, segment_rdmult;
+ for (i = ENERGY_MIN; i <= ENERGY_MAX; i++) {
+ int qindex_delta, segment_rdmult;
- if (Q_RATIO(i) == 1) {
- // No need to enable SEG_LVL_ALT_Q for this segment
- RDMULT_RATIO(i) = 1;
- continue;
- }
+ if (Q_RATIO(i) == 1) {
+ // No need to enable SEG_LVL_ALT_Q for this segment
+ RDMULT_RATIO(i) = 1;
+ continue;
+ }
- qindex_delta = vp9_compute_qdelta(cpi, base_q, base_q * Q_RATIO(i));
- vp9_set_segdata(seg, SEGMENT_ID(i), SEG_LVL_ALT_Q, qindex_delta);
- vp9_enable_segfeature(seg, SEGMENT_ID(i), SEG_LVL_ALT_Q);
+ qindex_delta = vp9_compute_qdelta(cpi, base_q, base_q * Q_RATIO(i));
+ vp9_set_segdata(seg, SEGMENT_ID(i), SEG_LVL_ALT_Q, qindex_delta);
+ vp9_enable_segfeature(seg, SEGMENT_ID(i), SEG_LVL_ALT_Q);
- segment_rdmult = vp9_compute_rd_mult(cpi, cm->base_qindex + qindex_delta +
- cm->y_dc_delta_q);
+ segment_rdmult = vp9_compute_rd_mult(cpi, cm->base_qindex + qindex_delta +
+ cm->y_dc_delta_q);
- RDMULT_RATIO(i) = (double) segment_rdmult / base_rdmult;
+ RDMULT_RATIO(i) = (double) segment_rdmult / base_rdmult;
+ }
}
}
@@ -137,11 +141,8 @@ int vp9_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs) {
double energy;
unsigned int var = block_variance(cpi, x, bs);
- vp9_clear_system_state(); // __asm emms;
-
- // if (var <= 1000)
- // return 0;
+ vp9_clear_system_state();
- energy = 0.9*(logf(var + 1) - 10.0);
- return clamp(round(energy), ENERGY_MIN, ENERGY_MAX);
+ energy = 0.9 * (log(var + 1.0) - 10.0);
+ return clamp((int)round(energy), ENERGY_MIN, ENERGY_MAX);
}
diff --git a/libvpx/vp9/encoder/vp9_vaq.h b/libvpx/vp9/encoder/vp9_vaq.h
index dc18b22..c73114a 100644
--- a/libvpx/vp9/encoder/vp9_vaq.h
+++ b/libvpx/vp9/encoder/vp9_vaq.h
@@ -9,11 +9,15 @@
*/
-#ifndef VP9_ENCODER_VP9_CONFIG_VAQ_H_
-#define VP9_ENCODER_VP9_CONFIG_VAQ_H_
+#ifndef VP9_ENCODER_VP9_VAQ_H_
+#define VP9_ENCODER_VP9_VAQ_H_
#include "vp9/encoder/vp9_onyx_int.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
unsigned int vp9_vaq_segment_id(int energy);
double vp9_vaq_rdmult_ratio(int energy);
double vp9_vaq_inv_q_ratio(int energy);
@@ -23,4 +27,8 @@ void vp9_vaq_frame_setup(VP9_COMP *cpi);
int vp9_block_energy(VP9_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bs);
-#endif // VP9_ENCODER_VP9_CONFIG_VAQ_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_VAQ_H_
diff --git a/libvpx/vp9/encoder/vp9_variance_c.c b/libvpx/vp9/encoder/vp9_variance.c
index 8bc3850..8bc3850 100644
--- a/libvpx/vp9/encoder/vp9_variance_c.c
+++ b/libvpx/vp9/encoder/vp9_variance.c
diff --git a/libvpx/vp9/encoder/vp9_variance.h b/libvpx/vp9/encoder/vp9_variance.h
index 2ded97c..3bc2091 100644
--- a/libvpx/vp9/encoder/vp9_variance.h
+++ b/libvpx/vp9/encoder/vp9_variance.h
@@ -12,7 +12,10 @@
#define VP9_ENCODER_VP9_VARIANCE_H_
#include "vpx/vpx_integer.h"
-// #include "./vpx_config.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
void variance(const uint8_t *src_ptr,
int source_stride,
@@ -112,4 +115,8 @@ static void comp_avg_pred(uint8_t *comp_pred, const uint8_t *pred, int width,
ref += ref_stride;
}
}
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // VP9_ENCODER_VP9_VARIANCE_H_
diff --git a/libvpx/vp9/encoder/vp9_write_bit_buffer.h b/libvpx/vp9/encoder/vp9_write_bit_buffer.h
index 6f91cfc..1795e05 100644
--- a/libvpx/vp9/encoder/vp9_write_bit_buffer.h
+++ b/libvpx/vp9/encoder/vp9_write_bit_buffer.h
@@ -8,13 +8,17 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VP9_BIT_WRITE_BUFFER_H_
-#define VP9_BIT_WRITE_BUFFER_H_
+#ifndef VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_
+#define VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_
#include <limits.h>
#include "vpx/vpx_integer.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct vp9_write_bit_buffer {
uint8_t *bit_buffer;
size_t bit_offset;
@@ -25,7 +29,7 @@ static size_t vp9_rb_bytes_written(struct vp9_write_bit_buffer *wb) {
}
static void vp9_wb_write_bit(struct vp9_write_bit_buffer *wb, int bit) {
- const int off = wb->bit_offset;
+ const int off = (int)wb->bit_offset;
const int p = off / CHAR_BIT;
const int q = CHAR_BIT - 1 - off % CHAR_BIT;
if (q == CHAR_BIT -1) {
@@ -45,4 +49,8 @@ static void vp9_wb_write_literal(struct vp9_write_bit_buffer *wb,
}
-#endif // VP9_BIT_WRITE_BUFFER_H_
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_VP9_WRITE_BIT_BUFFER_H_
diff --git a/libvpx/vp9/encoder/vp9_writer.c b/libvpx/vp9/encoder/vp9_writer.c
new file mode 100644
index 0000000..8398fc0
--- /dev/null
+++ b/libvpx/vp9/encoder/vp9_writer.c
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <assert.h>
+#include "vp9/encoder/vp9_writer.h"
+#include "vp9/common/vp9_entropy.h"
+
+void vp9_start_encode(vp9_writer *br, uint8_t *source) {
+ br->lowvalue = 0;
+ br->range = 255;
+ br->value = 0;
+ br->count = -24;
+ br->buffer = source;
+ br->pos = 0;
+ vp9_write_bit(br, 0);
+}
+
+void vp9_stop_encode(vp9_writer *br) {
+ int i;
+
+ for (i = 0; i < 32; i++)
+ vp9_write_bit(br, 0);
+
+ // Ensure there's no ambigous collision with any index marker bytes
+ if ((br->buffer[br->pos - 1] & 0xe0) == 0xc0)
+ br->buffer[br->pos++] = 0;
+}
+
diff --git a/libvpx/vp9/encoder/vp9_boolhuff.h b/libvpx/vp9/encoder/vp9_writer.h
index c3f340d..7f4fa1e 100644
--- a/libvpx/vp9/encoder/vp9_boolhuff.h
+++ b/libvpx/vp9/encoder/vp9_writer.h
@@ -8,19 +8,17 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
-/****************************************************************************
-*
-* Module Title : vp9_boolhuff.h
-*
-* Description : Bool Coder header file.
-*
-****************************************************************************/
-#ifndef VP9_ENCODER_VP9_BOOLHUFF_H_
-#define VP9_ENCODER_VP9_BOOLHUFF_H_
+#ifndef VP9_ENCODER_VP9_WRITER_H_
+#define VP9_ENCODER_VP9_WRITER_H_
#include "vpx_ports/mem.h"
+#include "vp9/common/vp9_prob.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct {
unsigned int lowvalue;
unsigned int range;
@@ -31,16 +29,12 @@ typedef struct {
// Variables used to track bit costs without outputing to the bitstream
unsigned int measure_cost;
- unsigned long bit_counter;
+ uint64_t bit_counter;
} vp9_writer;
-extern const unsigned int vp9_prob_cost[256];
-
void vp9_start_encode(vp9_writer *bc, uint8_t *buffer);
void vp9_stop_encode(vp9_writer *bc);
-DECLARE_ALIGNED(16, extern const unsigned char, vp9_norm[256]);
-
static void vp9_write(vp9_writer *br, int bit, int probability) {
unsigned int split;
int count = br->count;
@@ -48,17 +42,6 @@ static void vp9_write(vp9_writer *br, int bit, int probability) {
unsigned int lowvalue = br->lowvalue;
register unsigned int shift;
-#ifdef ENTROPY_STATS
-#if defined(SECTIONBITS_OUTPUT)
-
- if (bit)
- Sectionbits[active_section] += vp9_prob_cost[255 - probability];
- else
- Sectionbits[active_section] += vp9_prob_cost[probability];
-
-#endif
-#endif
-
split = 1 + (((range - 1) * probability) >> 8);
range = split;
@@ -111,5 +94,10 @@ static void vp9_write_literal(vp9_writer *w, int data, int bits) {
vp9_write_bit(w, 1 & (data >> bit));
}
+#define vp9_write_prob(w, v) vp9_write_literal((w), (v), 8)
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
-#endif // VP9_ENCODER_VP9_BOOLHUFF_H_
+#endif // VP9_ENCODER_VP9_WRITER_H_
diff --git a/libvpx/vp9/encoder/x86/vp9_dct32x32_avx2.c b/libvpx/vp9/encoder/x86/vp9_dct32x32_avx2.c
new file mode 100644
index 0000000..9ea22fe
--- /dev/null
+++ b/libvpx/vp9/encoder/x86/vp9_dct32x32_avx2.c
@@ -0,0 +1,2710 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <immintrin.h> // AVX2
+#include "vp9/common/vp9_idct.h" // for cospi constants
+#include "vpx_ports/mem.h"
+
+#define pair256_set_epi16(a, b) \
+ _mm256_set_epi16(b, a, b, a, b, a, b, a, b, a, b, a, b, a, b, a)
+
+#define pair256_set_epi32(a, b) \
+ _mm256_set_epi32(b, a, b, a, b, a, b, a)
+
+
+
+
+#if FDCT32x32_HIGH_PRECISION
+static INLINE __m256i k_madd_epi32_avx2(__m256i a, __m256i b) {
+ __m256i buf0, buf1;
+ buf0 = _mm256_mul_epu32(a, b);
+ a = _mm256_srli_epi64(a, 32);
+ b = _mm256_srli_epi64(b, 32);
+ buf1 = _mm256_mul_epu32(a, b);
+ return _mm256_add_epi64(buf0, buf1);
+}
+
+static INLINE __m256i k_packs_epi64_avx2(__m256i a, __m256i b) {
+ __m256i buf0 = _mm256_shuffle_epi32(a, _MM_SHUFFLE(0, 0, 2, 0));
+ __m256i buf1 = _mm256_shuffle_epi32(b, _MM_SHUFFLE(0, 0, 2, 0));
+ return _mm256_unpacklo_epi64(buf0, buf1);
+}
+#endif
+
+void FDCT32x32_2D_AVX2(const int16_t *input,
+ int16_t *output_org, int stride) {
+ // Calculate pre-multiplied strides
+ const int str1 = stride;
+ const int str2 = 2 * stride;
+ const int str3 = 2 * stride + str1;
+ // We need an intermediate buffer between passes.
+ DECLARE_ALIGNED(32, int16_t, intermediate[32 * 32]);
+ // Constants
+ // When we use them, in one case, they are all the same. In all others
+ // it's a pair of them that we need to repeat four times. This is done
+ // by constructing the 32 bit constant corresponding to that pair.
+ const __m256i k__cospi_p16_p16 = _mm256_set1_epi16(+cospi_16_64);
+ const __m256i k__cospi_p16_m16 = pair256_set_epi16(+cospi_16_64, -cospi_16_64);
+ const __m256i k__cospi_m08_p24 = pair256_set_epi16(-cospi_8_64, cospi_24_64);
+ const __m256i k__cospi_m24_m08 = pair256_set_epi16(-cospi_24_64, -cospi_8_64);
+ const __m256i k__cospi_p24_p08 = pair256_set_epi16(+cospi_24_64, cospi_8_64);
+ const __m256i k__cospi_p12_p20 = pair256_set_epi16(+cospi_12_64, cospi_20_64);
+ const __m256i k__cospi_m20_p12 = pair256_set_epi16(-cospi_20_64, cospi_12_64);
+ const __m256i k__cospi_m04_p28 = pair256_set_epi16(-cospi_4_64, cospi_28_64);
+ const __m256i k__cospi_p28_p04 = pair256_set_epi16(+cospi_28_64, cospi_4_64);
+ const __m256i k__cospi_m28_m04 = pair256_set_epi16(-cospi_28_64, -cospi_4_64);
+ const __m256i k__cospi_m12_m20 = pair256_set_epi16(-cospi_12_64, -cospi_20_64);
+ const __m256i k__cospi_p30_p02 = pair256_set_epi16(+cospi_30_64, cospi_2_64);
+ const __m256i k__cospi_p14_p18 = pair256_set_epi16(+cospi_14_64, cospi_18_64);
+ const __m256i k__cospi_p22_p10 = pair256_set_epi16(+cospi_22_64, cospi_10_64);
+ const __m256i k__cospi_p06_p26 = pair256_set_epi16(+cospi_6_64, cospi_26_64);
+ const __m256i k__cospi_m26_p06 = pair256_set_epi16(-cospi_26_64, cospi_6_64);
+ const __m256i k__cospi_m10_p22 = pair256_set_epi16(-cospi_10_64, cospi_22_64);
+ const __m256i k__cospi_m18_p14 = pair256_set_epi16(-cospi_18_64, cospi_14_64);
+ const __m256i k__cospi_m02_p30 = pair256_set_epi16(-cospi_2_64, cospi_30_64);
+ const __m256i k__cospi_p31_p01 = pair256_set_epi16(+cospi_31_64, cospi_1_64);
+ const __m256i k__cospi_p15_p17 = pair256_set_epi16(+cospi_15_64, cospi_17_64);
+ const __m256i k__cospi_p23_p09 = pair256_set_epi16(+cospi_23_64, cospi_9_64);
+ const __m256i k__cospi_p07_p25 = pair256_set_epi16(+cospi_7_64, cospi_25_64);
+ const __m256i k__cospi_m25_p07 = pair256_set_epi16(-cospi_25_64, cospi_7_64);
+ const __m256i k__cospi_m09_p23 = pair256_set_epi16(-cospi_9_64, cospi_23_64);
+ const __m256i k__cospi_m17_p15 = pair256_set_epi16(-cospi_17_64, cospi_15_64);
+ const __m256i k__cospi_m01_p31 = pair256_set_epi16(-cospi_1_64, cospi_31_64);
+ const __m256i k__cospi_p27_p05 = pair256_set_epi16(+cospi_27_64, cospi_5_64);
+ const __m256i k__cospi_p11_p21 = pair256_set_epi16(+cospi_11_64, cospi_21_64);
+ const __m256i k__cospi_p19_p13 = pair256_set_epi16(+cospi_19_64, cospi_13_64);
+ const __m256i k__cospi_p03_p29 = pair256_set_epi16(+cospi_3_64, cospi_29_64);
+ const __m256i k__cospi_m29_p03 = pair256_set_epi16(-cospi_29_64, cospi_3_64);
+ const __m256i k__cospi_m13_p19 = pair256_set_epi16(-cospi_13_64, cospi_19_64);
+ const __m256i k__cospi_m21_p11 = pair256_set_epi16(-cospi_21_64, cospi_11_64);
+ const __m256i k__cospi_m05_p27 = pair256_set_epi16(-cospi_5_64, cospi_27_64);
+ const __m256i k__DCT_CONST_ROUNDING = _mm256_set1_epi32(DCT_CONST_ROUNDING);
+ const __m256i kZero = _mm256_set1_epi16(0);
+ const __m256i kOne = _mm256_set1_epi16(1);
+ // Do the two transform/transpose passes
+ int pass;
+ for (pass = 0; pass < 2; ++pass) {
+ // We process sixteen columns (transposed rows in second pass) at a time.
+ int column_start;
+ for (column_start = 0; column_start < 32; column_start += 16) {
+ __m256i step1[32];
+ __m256i step2[32];
+ __m256i step3[32];
+ __m256i out[32];
+ // Stage 1
+ // Note: even though all the loads below are aligned, using the aligned
+ // intrinsic make the code slightly slower.
+ if (0 == pass) {
+ const int16_t *in = &input[column_start];
+ // step1[i] = (in[ 0 * stride] + in[(32 - 1) * stride]) << 2;
+ // Note: the next four blocks could be in a loop. That would help the
+ // instruction cache but is actually slower.
+ {
+ const int16_t *ina = in + 0 * str1;
+ const int16_t *inb = in + 31 * str1;
+ __m256i *step1a = &step1[ 0];
+ __m256i *step1b = &step1[31];
+ const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina));
+ const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1));
+ const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2));
+ const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3));
+ const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3));
+ const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2));
+ const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1));
+ const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb));
+ step1a[ 0] = _mm256_add_epi16(ina0, inb0);
+ step1a[ 1] = _mm256_add_epi16(ina1, inb1);
+ step1a[ 2] = _mm256_add_epi16(ina2, inb2);
+ step1a[ 3] = _mm256_add_epi16(ina3, inb3);
+ step1b[-3] = _mm256_sub_epi16(ina3, inb3);
+ step1b[-2] = _mm256_sub_epi16(ina2, inb2);
+ step1b[-1] = _mm256_sub_epi16(ina1, inb1);
+ step1b[-0] = _mm256_sub_epi16(ina0, inb0);
+ step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2);
+ step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2);
+ step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2);
+ step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2);
+ step1b[-3] = _mm256_slli_epi16(step1b[-3], 2);
+ step1b[-2] = _mm256_slli_epi16(step1b[-2], 2);
+ step1b[-1] = _mm256_slli_epi16(step1b[-1], 2);
+ step1b[-0] = _mm256_slli_epi16(step1b[-0], 2);
+ }
+ {
+ const int16_t *ina = in + 4 * str1;
+ const int16_t *inb = in + 27 * str1;
+ __m256i *step1a = &step1[ 4];
+ __m256i *step1b = &step1[27];
+ const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina));
+ const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1));
+ const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2));
+ const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3));
+ const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3));
+ const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2));
+ const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1));
+ const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb));
+ step1a[ 0] = _mm256_add_epi16(ina0, inb0);
+ step1a[ 1] = _mm256_add_epi16(ina1, inb1);
+ step1a[ 2] = _mm256_add_epi16(ina2, inb2);
+ step1a[ 3] = _mm256_add_epi16(ina3, inb3);
+ step1b[-3] = _mm256_sub_epi16(ina3, inb3);
+ step1b[-2] = _mm256_sub_epi16(ina2, inb2);
+ step1b[-1] = _mm256_sub_epi16(ina1, inb1);
+ step1b[-0] = _mm256_sub_epi16(ina0, inb0);
+ step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2);
+ step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2);
+ step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2);
+ step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2);
+ step1b[-3] = _mm256_slli_epi16(step1b[-3], 2);
+ step1b[-2] = _mm256_slli_epi16(step1b[-2], 2);
+ step1b[-1] = _mm256_slli_epi16(step1b[-1], 2);
+ step1b[-0] = _mm256_slli_epi16(step1b[-0], 2);
+ }
+ {
+ const int16_t *ina = in + 8 * str1;
+ const int16_t *inb = in + 23 * str1;
+ __m256i *step1a = &step1[ 8];
+ __m256i *step1b = &step1[23];
+ const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina));
+ const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1));
+ const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2));
+ const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3));
+ const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3));
+ const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2));
+ const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1));
+ const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb));
+ step1a[ 0] = _mm256_add_epi16(ina0, inb0);
+ step1a[ 1] = _mm256_add_epi16(ina1, inb1);
+ step1a[ 2] = _mm256_add_epi16(ina2, inb2);
+ step1a[ 3] = _mm256_add_epi16(ina3, inb3);
+ step1b[-3] = _mm256_sub_epi16(ina3, inb3);
+ step1b[-2] = _mm256_sub_epi16(ina2, inb2);
+ step1b[-1] = _mm256_sub_epi16(ina1, inb1);
+ step1b[-0] = _mm256_sub_epi16(ina0, inb0);
+ step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2);
+ step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2);
+ step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2);
+ step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2);
+ step1b[-3] = _mm256_slli_epi16(step1b[-3], 2);
+ step1b[-2] = _mm256_slli_epi16(step1b[-2], 2);
+ step1b[-1] = _mm256_slli_epi16(step1b[-1], 2);
+ step1b[-0] = _mm256_slli_epi16(step1b[-0], 2);
+ }
+ {
+ const int16_t *ina = in + 12 * str1;
+ const int16_t *inb = in + 19 * str1;
+ __m256i *step1a = &step1[12];
+ __m256i *step1b = &step1[19];
+ const __m256i ina0 = _mm256_loadu_si256((const __m256i *)(ina));
+ const __m256i ina1 = _mm256_loadu_si256((const __m256i *)(ina + str1));
+ const __m256i ina2 = _mm256_loadu_si256((const __m256i *)(ina + str2));
+ const __m256i ina3 = _mm256_loadu_si256((const __m256i *)(ina + str3));
+ const __m256i inb3 = _mm256_loadu_si256((const __m256i *)(inb - str3));
+ const __m256i inb2 = _mm256_loadu_si256((const __m256i *)(inb - str2));
+ const __m256i inb1 = _mm256_loadu_si256((const __m256i *)(inb - str1));
+ const __m256i inb0 = _mm256_loadu_si256((const __m256i *)(inb));
+ step1a[ 0] = _mm256_add_epi16(ina0, inb0);
+ step1a[ 1] = _mm256_add_epi16(ina1, inb1);
+ step1a[ 2] = _mm256_add_epi16(ina2, inb2);
+ step1a[ 3] = _mm256_add_epi16(ina3, inb3);
+ step1b[-3] = _mm256_sub_epi16(ina3, inb3);
+ step1b[-2] = _mm256_sub_epi16(ina2, inb2);
+ step1b[-1] = _mm256_sub_epi16(ina1, inb1);
+ step1b[-0] = _mm256_sub_epi16(ina0, inb0);
+ step1a[ 0] = _mm256_slli_epi16(step1a[ 0], 2);
+ step1a[ 1] = _mm256_slli_epi16(step1a[ 1], 2);
+ step1a[ 2] = _mm256_slli_epi16(step1a[ 2], 2);
+ step1a[ 3] = _mm256_slli_epi16(step1a[ 3], 2);
+ step1b[-3] = _mm256_slli_epi16(step1b[-3], 2);
+ step1b[-2] = _mm256_slli_epi16(step1b[-2], 2);
+ step1b[-1] = _mm256_slli_epi16(step1b[-1], 2);
+ step1b[-0] = _mm256_slli_epi16(step1b[-0], 2);
+ }
+ } else {
+ int16_t *in = &intermediate[column_start];
+ // step1[i] = in[ 0 * 32] + in[(32 - 1) * 32];
+ // Note: using the same approach as above to have common offset is
+ // counter-productive as all offsets can be calculated at compile
+ // time.
+ // Note: the next four blocks could be in a loop. That would help the
+ // instruction cache but is actually slower.
+ {
+ __m256i in00 = _mm256_loadu_si256((const __m256i *)(in + 0 * 32));
+ __m256i in01 = _mm256_loadu_si256((const __m256i *)(in + 1 * 32));
+ __m256i in02 = _mm256_loadu_si256((const __m256i *)(in + 2 * 32));
+ __m256i in03 = _mm256_loadu_si256((const __m256i *)(in + 3 * 32));
+ __m256i in28 = _mm256_loadu_si256((const __m256i *)(in + 28 * 32));
+ __m256i in29 = _mm256_loadu_si256((const __m256i *)(in + 29 * 32));
+ __m256i in30 = _mm256_loadu_si256((const __m256i *)(in + 30 * 32));
+ __m256i in31 = _mm256_loadu_si256((const __m256i *)(in + 31 * 32));
+ step1[ 0] = _mm256_add_epi16(in00, in31);
+ step1[ 1] = _mm256_add_epi16(in01, in30);
+ step1[ 2] = _mm256_add_epi16(in02, in29);
+ step1[ 3] = _mm256_add_epi16(in03, in28);
+ step1[28] = _mm256_sub_epi16(in03, in28);
+ step1[29] = _mm256_sub_epi16(in02, in29);
+ step1[30] = _mm256_sub_epi16(in01, in30);
+ step1[31] = _mm256_sub_epi16(in00, in31);
+ }
+ {
+ __m256i in04 = _mm256_loadu_si256((const __m256i *)(in + 4 * 32));
+ __m256i in05 = _mm256_loadu_si256((const __m256i *)(in + 5 * 32));
+ __m256i in06 = _mm256_loadu_si256((const __m256i *)(in + 6 * 32));
+ __m256i in07 = _mm256_loadu_si256((const __m256i *)(in + 7 * 32));
+ __m256i in24 = _mm256_loadu_si256((const __m256i *)(in + 24 * 32));
+ __m256i in25 = _mm256_loadu_si256((const __m256i *)(in + 25 * 32));
+ __m256i in26 = _mm256_loadu_si256((const __m256i *)(in + 26 * 32));
+ __m256i in27 = _mm256_loadu_si256((const __m256i *)(in + 27 * 32));
+ step1[ 4] = _mm256_add_epi16(in04, in27);
+ step1[ 5] = _mm256_add_epi16(in05, in26);
+ step1[ 6] = _mm256_add_epi16(in06, in25);
+ step1[ 7] = _mm256_add_epi16(in07, in24);
+ step1[24] = _mm256_sub_epi16(in07, in24);
+ step1[25] = _mm256_sub_epi16(in06, in25);
+ step1[26] = _mm256_sub_epi16(in05, in26);
+ step1[27] = _mm256_sub_epi16(in04, in27);
+ }
+ {
+ __m256i in08 = _mm256_loadu_si256((const __m256i *)(in + 8 * 32));
+ __m256i in09 = _mm256_loadu_si256((const __m256i *)(in + 9 * 32));
+ __m256i in10 = _mm256_loadu_si256((const __m256i *)(in + 10 * 32));
+ __m256i in11 = _mm256_loadu_si256((const __m256i *)(in + 11 * 32));
+ __m256i in20 = _mm256_loadu_si256((const __m256i *)(in + 20 * 32));
+ __m256i in21 = _mm256_loadu_si256((const __m256i *)(in + 21 * 32));
+ __m256i in22 = _mm256_loadu_si256((const __m256i *)(in + 22 * 32));
+ __m256i in23 = _mm256_loadu_si256((const __m256i *)(in + 23 * 32));
+ step1[ 8] = _mm256_add_epi16(in08, in23);
+ step1[ 9] = _mm256_add_epi16(in09, in22);
+ step1[10] = _mm256_add_epi16(in10, in21);
+ step1[11] = _mm256_add_epi16(in11, in20);
+ step1[20] = _mm256_sub_epi16(in11, in20);
+ step1[21] = _mm256_sub_epi16(in10, in21);
+ step1[22] = _mm256_sub_epi16(in09, in22);
+ step1[23] = _mm256_sub_epi16(in08, in23);
+ }
+ {
+ __m256i in12 = _mm256_loadu_si256((const __m256i *)(in + 12 * 32));
+ __m256i in13 = _mm256_loadu_si256((const __m256i *)(in + 13 * 32));
+ __m256i in14 = _mm256_loadu_si256((const __m256i *)(in + 14 * 32));
+ __m256i in15 = _mm256_loadu_si256((const __m256i *)(in + 15 * 32));
+ __m256i in16 = _mm256_loadu_si256((const __m256i *)(in + 16 * 32));
+ __m256i in17 = _mm256_loadu_si256((const __m256i *)(in + 17 * 32));
+ __m256i in18 = _mm256_loadu_si256((const __m256i *)(in + 18 * 32));
+ __m256i in19 = _mm256_loadu_si256((const __m256i *)(in + 19 * 32));
+ step1[12] = _mm256_add_epi16(in12, in19);
+ step1[13] = _mm256_add_epi16(in13, in18);
+ step1[14] = _mm256_add_epi16(in14, in17);
+ step1[15] = _mm256_add_epi16(in15, in16);
+ step1[16] = _mm256_sub_epi16(in15, in16);
+ step1[17] = _mm256_sub_epi16(in14, in17);
+ step1[18] = _mm256_sub_epi16(in13, in18);
+ step1[19] = _mm256_sub_epi16(in12, in19);
+ }
+ }
+ // Stage 2
+ {
+ step2[ 0] = _mm256_add_epi16(step1[0], step1[15]);
+ step2[ 1] = _mm256_add_epi16(step1[1], step1[14]);
+ step2[ 2] = _mm256_add_epi16(step1[2], step1[13]);
+ step2[ 3] = _mm256_add_epi16(step1[3], step1[12]);
+ step2[ 4] = _mm256_add_epi16(step1[4], step1[11]);
+ step2[ 5] = _mm256_add_epi16(step1[5], step1[10]);
+ step2[ 6] = _mm256_add_epi16(step1[6], step1[ 9]);
+ step2[ 7] = _mm256_add_epi16(step1[7], step1[ 8]);
+ step2[ 8] = _mm256_sub_epi16(step1[7], step1[ 8]);
+ step2[ 9] = _mm256_sub_epi16(step1[6], step1[ 9]);
+ step2[10] = _mm256_sub_epi16(step1[5], step1[10]);
+ step2[11] = _mm256_sub_epi16(step1[4], step1[11]);
+ step2[12] = _mm256_sub_epi16(step1[3], step1[12]);
+ step2[13] = _mm256_sub_epi16(step1[2], step1[13]);
+ step2[14] = _mm256_sub_epi16(step1[1], step1[14]);
+ step2[15] = _mm256_sub_epi16(step1[0], step1[15]);
+ }
+ {
+ const __m256i s2_20_0 = _mm256_unpacklo_epi16(step1[27], step1[20]);
+ const __m256i s2_20_1 = _mm256_unpackhi_epi16(step1[27], step1[20]);
+ const __m256i s2_21_0 = _mm256_unpacklo_epi16(step1[26], step1[21]);
+ const __m256i s2_21_1 = _mm256_unpackhi_epi16(step1[26], step1[21]);
+ const __m256i s2_22_0 = _mm256_unpacklo_epi16(step1[25], step1[22]);
+ const __m256i s2_22_1 = _mm256_unpackhi_epi16(step1[25], step1[22]);
+ const __m256i s2_23_0 = _mm256_unpacklo_epi16(step1[24], step1[23]);
+ const __m256i s2_23_1 = _mm256_unpackhi_epi16(step1[24], step1[23]);
+ const __m256i s2_20_2 = _mm256_madd_epi16(s2_20_0, k__cospi_p16_m16);
+ const __m256i s2_20_3 = _mm256_madd_epi16(s2_20_1, k__cospi_p16_m16);
+ const __m256i s2_21_2 = _mm256_madd_epi16(s2_21_0, k__cospi_p16_m16);
+ const __m256i s2_21_3 = _mm256_madd_epi16(s2_21_1, k__cospi_p16_m16);
+ const __m256i s2_22_2 = _mm256_madd_epi16(s2_22_0, k__cospi_p16_m16);
+ const __m256i s2_22_3 = _mm256_madd_epi16(s2_22_1, k__cospi_p16_m16);
+ const __m256i s2_23_2 = _mm256_madd_epi16(s2_23_0, k__cospi_p16_m16);
+ const __m256i s2_23_3 = _mm256_madd_epi16(s2_23_1, k__cospi_p16_m16);
+ const __m256i s2_24_2 = _mm256_madd_epi16(s2_23_0, k__cospi_p16_p16);
+ const __m256i s2_24_3 = _mm256_madd_epi16(s2_23_1, k__cospi_p16_p16);
+ const __m256i s2_25_2 = _mm256_madd_epi16(s2_22_0, k__cospi_p16_p16);
+ const __m256i s2_25_3 = _mm256_madd_epi16(s2_22_1, k__cospi_p16_p16);
+ const __m256i s2_26_2 = _mm256_madd_epi16(s2_21_0, k__cospi_p16_p16);
+ const __m256i s2_26_3 = _mm256_madd_epi16(s2_21_1, k__cospi_p16_p16);
+ const __m256i s2_27_2 = _mm256_madd_epi16(s2_20_0, k__cospi_p16_p16);
+ const __m256i s2_27_3 = _mm256_madd_epi16(s2_20_1, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m256i s2_20_4 = _mm256_add_epi32(s2_20_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_20_5 = _mm256_add_epi32(s2_20_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_21_4 = _mm256_add_epi32(s2_21_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_21_5 = _mm256_add_epi32(s2_21_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_22_4 = _mm256_add_epi32(s2_22_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_22_5 = _mm256_add_epi32(s2_22_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_23_4 = _mm256_add_epi32(s2_23_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_23_5 = _mm256_add_epi32(s2_23_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_24_4 = _mm256_add_epi32(s2_24_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_24_5 = _mm256_add_epi32(s2_24_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_25_4 = _mm256_add_epi32(s2_25_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_25_5 = _mm256_add_epi32(s2_25_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_26_4 = _mm256_add_epi32(s2_26_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_26_5 = _mm256_add_epi32(s2_26_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_27_4 = _mm256_add_epi32(s2_27_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_27_5 = _mm256_add_epi32(s2_27_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_20_6 = _mm256_srai_epi32(s2_20_4, DCT_CONST_BITS);
+ const __m256i s2_20_7 = _mm256_srai_epi32(s2_20_5, DCT_CONST_BITS);
+ const __m256i s2_21_6 = _mm256_srai_epi32(s2_21_4, DCT_CONST_BITS);
+ const __m256i s2_21_7 = _mm256_srai_epi32(s2_21_5, DCT_CONST_BITS);
+ const __m256i s2_22_6 = _mm256_srai_epi32(s2_22_4, DCT_CONST_BITS);
+ const __m256i s2_22_7 = _mm256_srai_epi32(s2_22_5, DCT_CONST_BITS);
+ const __m256i s2_23_6 = _mm256_srai_epi32(s2_23_4, DCT_CONST_BITS);
+ const __m256i s2_23_7 = _mm256_srai_epi32(s2_23_5, DCT_CONST_BITS);
+ const __m256i s2_24_6 = _mm256_srai_epi32(s2_24_4, DCT_CONST_BITS);
+ const __m256i s2_24_7 = _mm256_srai_epi32(s2_24_5, DCT_CONST_BITS);
+ const __m256i s2_25_6 = _mm256_srai_epi32(s2_25_4, DCT_CONST_BITS);
+ const __m256i s2_25_7 = _mm256_srai_epi32(s2_25_5, DCT_CONST_BITS);
+ const __m256i s2_26_6 = _mm256_srai_epi32(s2_26_4, DCT_CONST_BITS);
+ const __m256i s2_26_7 = _mm256_srai_epi32(s2_26_5, DCT_CONST_BITS);
+ const __m256i s2_27_6 = _mm256_srai_epi32(s2_27_4, DCT_CONST_BITS);
+ const __m256i s2_27_7 = _mm256_srai_epi32(s2_27_5, DCT_CONST_BITS);
+ // Combine
+ step2[20] = _mm256_packs_epi32(s2_20_6, s2_20_7);
+ step2[21] = _mm256_packs_epi32(s2_21_6, s2_21_7);
+ step2[22] = _mm256_packs_epi32(s2_22_6, s2_22_7);
+ step2[23] = _mm256_packs_epi32(s2_23_6, s2_23_7);
+ step2[24] = _mm256_packs_epi32(s2_24_6, s2_24_7);
+ step2[25] = _mm256_packs_epi32(s2_25_6, s2_25_7);
+ step2[26] = _mm256_packs_epi32(s2_26_6, s2_26_7);
+ step2[27] = _mm256_packs_epi32(s2_27_6, s2_27_7);
+ }
+
+#if !FDCT32x32_HIGH_PRECISION
+ // dump the magnitude by half, hence the intermediate values are within
+ // the range of 16 bits.
+ if (1 == pass) {
+ __m256i s3_00_0 = _mm256_cmpgt_epi16(kZero,step2[ 0]);
+ __m256i s3_01_0 = _mm256_cmpgt_epi16(kZero,step2[ 1]);
+ __m256i s3_02_0 = _mm256_cmpgt_epi16(kZero,step2[ 2]);
+ __m256i s3_03_0 = _mm256_cmpgt_epi16(kZero,step2[ 3]);
+ __m256i s3_04_0 = _mm256_cmpgt_epi16(kZero,step2[ 4]);
+ __m256i s3_05_0 = _mm256_cmpgt_epi16(kZero,step2[ 5]);
+ __m256i s3_06_0 = _mm256_cmpgt_epi16(kZero,step2[ 6]);
+ __m256i s3_07_0 = _mm256_cmpgt_epi16(kZero,step2[ 7]);
+ __m256i s2_08_0 = _mm256_cmpgt_epi16(kZero,step2[ 8]);
+ __m256i s2_09_0 = _mm256_cmpgt_epi16(kZero,step2[ 9]);
+ __m256i s3_10_0 = _mm256_cmpgt_epi16(kZero,step2[10]);
+ __m256i s3_11_0 = _mm256_cmpgt_epi16(kZero,step2[11]);
+ __m256i s3_12_0 = _mm256_cmpgt_epi16(kZero,step2[12]);
+ __m256i s3_13_0 = _mm256_cmpgt_epi16(kZero,step2[13]);
+ __m256i s2_14_0 = _mm256_cmpgt_epi16(kZero,step2[14]);
+ __m256i s2_15_0 = _mm256_cmpgt_epi16(kZero,step2[15]);
+ __m256i s3_16_0 = _mm256_cmpgt_epi16(kZero,step1[16]);
+ __m256i s3_17_0 = _mm256_cmpgt_epi16(kZero,step1[17]);
+ __m256i s3_18_0 = _mm256_cmpgt_epi16(kZero,step1[18]);
+ __m256i s3_19_0 = _mm256_cmpgt_epi16(kZero,step1[19]);
+ __m256i s3_20_0 = _mm256_cmpgt_epi16(kZero,step2[20]);
+ __m256i s3_21_0 = _mm256_cmpgt_epi16(kZero,step2[21]);
+ __m256i s3_22_0 = _mm256_cmpgt_epi16(kZero,step2[22]);
+ __m256i s3_23_0 = _mm256_cmpgt_epi16(kZero,step2[23]);
+ __m256i s3_24_0 = _mm256_cmpgt_epi16(kZero,step2[24]);
+ __m256i s3_25_0 = _mm256_cmpgt_epi16(kZero,step2[25]);
+ __m256i s3_26_0 = _mm256_cmpgt_epi16(kZero,step2[26]);
+ __m256i s3_27_0 = _mm256_cmpgt_epi16(kZero,step2[27]);
+ __m256i s3_28_0 = _mm256_cmpgt_epi16(kZero,step1[28]);
+ __m256i s3_29_0 = _mm256_cmpgt_epi16(kZero,step1[29]);
+ __m256i s3_30_0 = _mm256_cmpgt_epi16(kZero,step1[30]);
+ __m256i s3_31_0 = _mm256_cmpgt_epi16(kZero,step1[31]);
+
+ step2[ 0] = _mm256_sub_epi16(step2[ 0], s3_00_0);
+ step2[ 1] = _mm256_sub_epi16(step2[ 1], s3_01_0);
+ step2[ 2] = _mm256_sub_epi16(step2[ 2], s3_02_0);
+ step2[ 3] = _mm256_sub_epi16(step2[ 3], s3_03_0);
+ step2[ 4] = _mm256_sub_epi16(step2[ 4], s3_04_0);
+ step2[ 5] = _mm256_sub_epi16(step2[ 5], s3_05_0);
+ step2[ 6] = _mm256_sub_epi16(step2[ 6], s3_06_0);
+ step2[ 7] = _mm256_sub_epi16(step2[ 7], s3_07_0);
+ step2[ 8] = _mm256_sub_epi16(step2[ 8], s2_08_0);
+ step2[ 9] = _mm256_sub_epi16(step2[ 9], s2_09_0);
+ step2[10] = _mm256_sub_epi16(step2[10], s3_10_0);
+ step2[11] = _mm256_sub_epi16(step2[11], s3_11_0);
+ step2[12] = _mm256_sub_epi16(step2[12], s3_12_0);
+ step2[13] = _mm256_sub_epi16(step2[13], s3_13_0);
+ step2[14] = _mm256_sub_epi16(step2[14], s2_14_0);
+ step2[15] = _mm256_sub_epi16(step2[15], s2_15_0);
+ step1[16] = _mm256_sub_epi16(step1[16], s3_16_0);
+ step1[17] = _mm256_sub_epi16(step1[17], s3_17_0);
+ step1[18] = _mm256_sub_epi16(step1[18], s3_18_0);
+ step1[19] = _mm256_sub_epi16(step1[19], s3_19_0);
+ step2[20] = _mm256_sub_epi16(step2[20], s3_20_0);
+ step2[21] = _mm256_sub_epi16(step2[21], s3_21_0);
+ step2[22] = _mm256_sub_epi16(step2[22], s3_22_0);
+ step2[23] = _mm256_sub_epi16(step2[23], s3_23_0);
+ step2[24] = _mm256_sub_epi16(step2[24], s3_24_0);
+ step2[25] = _mm256_sub_epi16(step2[25], s3_25_0);
+ step2[26] = _mm256_sub_epi16(step2[26], s3_26_0);
+ step2[27] = _mm256_sub_epi16(step2[27], s3_27_0);
+ step1[28] = _mm256_sub_epi16(step1[28], s3_28_0);
+ step1[29] = _mm256_sub_epi16(step1[29], s3_29_0);
+ step1[30] = _mm256_sub_epi16(step1[30], s3_30_0);
+ step1[31] = _mm256_sub_epi16(step1[31], s3_31_0);
+
+ step2[ 0] = _mm256_add_epi16(step2[ 0], kOne);
+ step2[ 1] = _mm256_add_epi16(step2[ 1], kOne);
+ step2[ 2] = _mm256_add_epi16(step2[ 2], kOne);
+ step2[ 3] = _mm256_add_epi16(step2[ 3], kOne);
+ step2[ 4] = _mm256_add_epi16(step2[ 4], kOne);
+ step2[ 5] = _mm256_add_epi16(step2[ 5], kOne);
+ step2[ 6] = _mm256_add_epi16(step2[ 6], kOne);
+ step2[ 7] = _mm256_add_epi16(step2[ 7], kOne);
+ step2[ 8] = _mm256_add_epi16(step2[ 8], kOne);
+ step2[ 9] = _mm256_add_epi16(step2[ 9], kOne);
+ step2[10] = _mm256_add_epi16(step2[10], kOne);
+ step2[11] = _mm256_add_epi16(step2[11], kOne);
+ step2[12] = _mm256_add_epi16(step2[12], kOne);
+ step2[13] = _mm256_add_epi16(step2[13], kOne);
+ step2[14] = _mm256_add_epi16(step2[14], kOne);
+ step2[15] = _mm256_add_epi16(step2[15], kOne);
+ step1[16] = _mm256_add_epi16(step1[16], kOne);
+ step1[17] = _mm256_add_epi16(step1[17], kOne);
+ step1[18] = _mm256_add_epi16(step1[18], kOne);
+ step1[19] = _mm256_add_epi16(step1[19], kOne);
+ step2[20] = _mm256_add_epi16(step2[20], kOne);
+ step2[21] = _mm256_add_epi16(step2[21], kOne);
+ step2[22] = _mm256_add_epi16(step2[22], kOne);
+ step2[23] = _mm256_add_epi16(step2[23], kOne);
+ step2[24] = _mm256_add_epi16(step2[24], kOne);
+ step2[25] = _mm256_add_epi16(step2[25], kOne);
+ step2[26] = _mm256_add_epi16(step2[26], kOne);
+ step2[27] = _mm256_add_epi16(step2[27], kOne);
+ step1[28] = _mm256_add_epi16(step1[28], kOne);
+ step1[29] = _mm256_add_epi16(step1[29], kOne);
+ step1[30] = _mm256_add_epi16(step1[30], kOne);
+ step1[31] = _mm256_add_epi16(step1[31], kOne);
+
+ step2[ 0] = _mm256_srai_epi16(step2[ 0], 2);
+ step2[ 1] = _mm256_srai_epi16(step2[ 1], 2);
+ step2[ 2] = _mm256_srai_epi16(step2[ 2], 2);
+ step2[ 3] = _mm256_srai_epi16(step2[ 3], 2);
+ step2[ 4] = _mm256_srai_epi16(step2[ 4], 2);
+ step2[ 5] = _mm256_srai_epi16(step2[ 5], 2);
+ step2[ 6] = _mm256_srai_epi16(step2[ 6], 2);
+ step2[ 7] = _mm256_srai_epi16(step2[ 7], 2);
+ step2[ 8] = _mm256_srai_epi16(step2[ 8], 2);
+ step2[ 9] = _mm256_srai_epi16(step2[ 9], 2);
+ step2[10] = _mm256_srai_epi16(step2[10], 2);
+ step2[11] = _mm256_srai_epi16(step2[11], 2);
+ step2[12] = _mm256_srai_epi16(step2[12], 2);
+ step2[13] = _mm256_srai_epi16(step2[13], 2);
+ step2[14] = _mm256_srai_epi16(step2[14], 2);
+ step2[15] = _mm256_srai_epi16(step2[15], 2);
+ step1[16] = _mm256_srai_epi16(step1[16], 2);
+ step1[17] = _mm256_srai_epi16(step1[17], 2);
+ step1[18] = _mm256_srai_epi16(step1[18], 2);
+ step1[19] = _mm256_srai_epi16(step1[19], 2);
+ step2[20] = _mm256_srai_epi16(step2[20], 2);
+ step2[21] = _mm256_srai_epi16(step2[21], 2);
+ step2[22] = _mm256_srai_epi16(step2[22], 2);
+ step2[23] = _mm256_srai_epi16(step2[23], 2);
+ step2[24] = _mm256_srai_epi16(step2[24], 2);
+ step2[25] = _mm256_srai_epi16(step2[25], 2);
+ step2[26] = _mm256_srai_epi16(step2[26], 2);
+ step2[27] = _mm256_srai_epi16(step2[27], 2);
+ step1[28] = _mm256_srai_epi16(step1[28], 2);
+ step1[29] = _mm256_srai_epi16(step1[29], 2);
+ step1[30] = _mm256_srai_epi16(step1[30], 2);
+ step1[31] = _mm256_srai_epi16(step1[31], 2);
+ }
+#endif
+
+#if FDCT32x32_HIGH_PRECISION
+ if (pass == 0) {
+#endif
+ // Stage 3
+ {
+ step3[0] = _mm256_add_epi16(step2[(8 - 1)], step2[0]);
+ step3[1] = _mm256_add_epi16(step2[(8 - 2)], step2[1]);
+ step3[2] = _mm256_add_epi16(step2[(8 - 3)], step2[2]);
+ step3[3] = _mm256_add_epi16(step2[(8 - 4)], step2[3]);
+ step3[4] = _mm256_sub_epi16(step2[(8 - 5)], step2[4]);
+ step3[5] = _mm256_sub_epi16(step2[(8 - 6)], step2[5]);
+ step3[6] = _mm256_sub_epi16(step2[(8 - 7)], step2[6]);
+ step3[7] = _mm256_sub_epi16(step2[(8 - 8)], step2[7]);
+ }
+ {
+ const __m256i s3_10_0 = _mm256_unpacklo_epi16(step2[13], step2[10]);
+ const __m256i s3_10_1 = _mm256_unpackhi_epi16(step2[13], step2[10]);
+ const __m256i s3_11_0 = _mm256_unpacklo_epi16(step2[12], step2[11]);
+ const __m256i s3_11_1 = _mm256_unpackhi_epi16(step2[12], step2[11]);
+ const __m256i s3_10_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_m16);
+ const __m256i s3_10_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_m16);
+ const __m256i s3_11_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_m16);
+ const __m256i s3_11_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_m16);
+ const __m256i s3_12_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_p16);
+ const __m256i s3_12_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_p16);
+ const __m256i s3_13_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_p16);
+ const __m256i s3_13_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m256i s3_10_4 = _mm256_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_10_5 = _mm256_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_11_4 = _mm256_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_11_5 = _mm256_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_12_4 = _mm256_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_12_5 = _mm256_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_13_4 = _mm256_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_13_5 = _mm256_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_10_6 = _mm256_srai_epi32(s3_10_4, DCT_CONST_BITS);
+ const __m256i s3_10_7 = _mm256_srai_epi32(s3_10_5, DCT_CONST_BITS);
+ const __m256i s3_11_6 = _mm256_srai_epi32(s3_11_4, DCT_CONST_BITS);
+ const __m256i s3_11_7 = _mm256_srai_epi32(s3_11_5, DCT_CONST_BITS);
+ const __m256i s3_12_6 = _mm256_srai_epi32(s3_12_4, DCT_CONST_BITS);
+ const __m256i s3_12_7 = _mm256_srai_epi32(s3_12_5, DCT_CONST_BITS);
+ const __m256i s3_13_6 = _mm256_srai_epi32(s3_13_4, DCT_CONST_BITS);
+ const __m256i s3_13_7 = _mm256_srai_epi32(s3_13_5, DCT_CONST_BITS);
+ // Combine
+ step3[10] = _mm256_packs_epi32(s3_10_6, s3_10_7);
+ step3[11] = _mm256_packs_epi32(s3_11_6, s3_11_7);
+ step3[12] = _mm256_packs_epi32(s3_12_6, s3_12_7);
+ step3[13] = _mm256_packs_epi32(s3_13_6, s3_13_7);
+ }
+ {
+ step3[16] = _mm256_add_epi16(step2[23], step1[16]);
+ step3[17] = _mm256_add_epi16(step2[22], step1[17]);
+ step3[18] = _mm256_add_epi16(step2[21], step1[18]);
+ step3[19] = _mm256_add_epi16(step2[20], step1[19]);
+ step3[20] = _mm256_sub_epi16(step1[19], step2[20]);
+ step3[21] = _mm256_sub_epi16(step1[18], step2[21]);
+ step3[22] = _mm256_sub_epi16(step1[17], step2[22]);
+ step3[23] = _mm256_sub_epi16(step1[16], step2[23]);
+ step3[24] = _mm256_sub_epi16(step1[31], step2[24]);
+ step3[25] = _mm256_sub_epi16(step1[30], step2[25]);
+ step3[26] = _mm256_sub_epi16(step1[29], step2[26]);
+ step3[27] = _mm256_sub_epi16(step1[28], step2[27]);
+ step3[28] = _mm256_add_epi16(step2[27], step1[28]);
+ step3[29] = _mm256_add_epi16(step2[26], step1[29]);
+ step3[30] = _mm256_add_epi16(step2[25], step1[30]);
+ step3[31] = _mm256_add_epi16(step2[24], step1[31]);
+ }
+
+ // Stage 4
+ {
+ step1[ 0] = _mm256_add_epi16(step3[ 3], step3[ 0]);
+ step1[ 1] = _mm256_add_epi16(step3[ 2], step3[ 1]);
+ step1[ 2] = _mm256_sub_epi16(step3[ 1], step3[ 2]);
+ step1[ 3] = _mm256_sub_epi16(step3[ 0], step3[ 3]);
+ step1[ 8] = _mm256_add_epi16(step3[11], step2[ 8]);
+ step1[ 9] = _mm256_add_epi16(step3[10], step2[ 9]);
+ step1[10] = _mm256_sub_epi16(step2[ 9], step3[10]);
+ step1[11] = _mm256_sub_epi16(step2[ 8], step3[11]);
+ step1[12] = _mm256_sub_epi16(step2[15], step3[12]);
+ step1[13] = _mm256_sub_epi16(step2[14], step3[13]);
+ step1[14] = _mm256_add_epi16(step3[13], step2[14]);
+ step1[15] = _mm256_add_epi16(step3[12], step2[15]);
+ }
+ {
+ const __m256i s1_05_0 = _mm256_unpacklo_epi16(step3[6], step3[5]);
+ const __m256i s1_05_1 = _mm256_unpackhi_epi16(step3[6], step3[5]);
+ const __m256i s1_05_2 = _mm256_madd_epi16(s1_05_0, k__cospi_p16_m16);
+ const __m256i s1_05_3 = _mm256_madd_epi16(s1_05_1, k__cospi_p16_m16);
+ const __m256i s1_06_2 = _mm256_madd_epi16(s1_05_0, k__cospi_p16_p16);
+ const __m256i s1_06_3 = _mm256_madd_epi16(s1_05_1, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m256i s1_05_4 = _mm256_add_epi32(s1_05_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_05_5 = _mm256_add_epi32(s1_05_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_06_4 = _mm256_add_epi32(s1_06_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_06_5 = _mm256_add_epi32(s1_06_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_05_6 = _mm256_srai_epi32(s1_05_4, DCT_CONST_BITS);
+ const __m256i s1_05_7 = _mm256_srai_epi32(s1_05_5, DCT_CONST_BITS);
+ const __m256i s1_06_6 = _mm256_srai_epi32(s1_06_4, DCT_CONST_BITS);
+ const __m256i s1_06_7 = _mm256_srai_epi32(s1_06_5, DCT_CONST_BITS);
+ // Combine
+ step1[5] = _mm256_packs_epi32(s1_05_6, s1_05_7);
+ step1[6] = _mm256_packs_epi32(s1_06_6, s1_06_7);
+ }
+ {
+ const __m256i s1_18_0 = _mm256_unpacklo_epi16(step3[18], step3[29]);
+ const __m256i s1_18_1 = _mm256_unpackhi_epi16(step3[18], step3[29]);
+ const __m256i s1_19_0 = _mm256_unpacklo_epi16(step3[19], step3[28]);
+ const __m256i s1_19_1 = _mm256_unpackhi_epi16(step3[19], step3[28]);
+ const __m256i s1_20_0 = _mm256_unpacklo_epi16(step3[20], step3[27]);
+ const __m256i s1_20_1 = _mm256_unpackhi_epi16(step3[20], step3[27]);
+ const __m256i s1_21_0 = _mm256_unpacklo_epi16(step3[21], step3[26]);
+ const __m256i s1_21_1 = _mm256_unpackhi_epi16(step3[21], step3[26]);
+ const __m256i s1_18_2 = _mm256_madd_epi16(s1_18_0, k__cospi_m08_p24);
+ const __m256i s1_18_3 = _mm256_madd_epi16(s1_18_1, k__cospi_m08_p24);
+ const __m256i s1_19_2 = _mm256_madd_epi16(s1_19_0, k__cospi_m08_p24);
+ const __m256i s1_19_3 = _mm256_madd_epi16(s1_19_1, k__cospi_m08_p24);
+ const __m256i s1_20_2 = _mm256_madd_epi16(s1_20_0, k__cospi_m24_m08);
+ const __m256i s1_20_3 = _mm256_madd_epi16(s1_20_1, k__cospi_m24_m08);
+ const __m256i s1_21_2 = _mm256_madd_epi16(s1_21_0, k__cospi_m24_m08);
+ const __m256i s1_21_3 = _mm256_madd_epi16(s1_21_1, k__cospi_m24_m08);
+ const __m256i s1_26_2 = _mm256_madd_epi16(s1_21_0, k__cospi_m08_p24);
+ const __m256i s1_26_3 = _mm256_madd_epi16(s1_21_1, k__cospi_m08_p24);
+ const __m256i s1_27_2 = _mm256_madd_epi16(s1_20_0, k__cospi_m08_p24);
+ const __m256i s1_27_3 = _mm256_madd_epi16(s1_20_1, k__cospi_m08_p24);
+ const __m256i s1_28_2 = _mm256_madd_epi16(s1_19_0, k__cospi_p24_p08);
+ const __m256i s1_28_3 = _mm256_madd_epi16(s1_19_1, k__cospi_p24_p08);
+ const __m256i s1_29_2 = _mm256_madd_epi16(s1_18_0, k__cospi_p24_p08);
+ const __m256i s1_29_3 = _mm256_madd_epi16(s1_18_1, k__cospi_p24_p08);
+ // dct_const_round_shift
+ const __m256i s1_18_4 = _mm256_add_epi32(s1_18_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_18_5 = _mm256_add_epi32(s1_18_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_19_4 = _mm256_add_epi32(s1_19_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_19_5 = _mm256_add_epi32(s1_19_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_20_4 = _mm256_add_epi32(s1_20_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_20_5 = _mm256_add_epi32(s1_20_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_21_4 = _mm256_add_epi32(s1_21_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_21_5 = _mm256_add_epi32(s1_21_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_26_4 = _mm256_add_epi32(s1_26_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_26_5 = _mm256_add_epi32(s1_26_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_27_4 = _mm256_add_epi32(s1_27_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_27_5 = _mm256_add_epi32(s1_27_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_28_4 = _mm256_add_epi32(s1_28_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_28_5 = _mm256_add_epi32(s1_28_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_29_4 = _mm256_add_epi32(s1_29_2, k__DCT_CONST_ROUNDING);
+ const __m256i s1_29_5 = _mm256_add_epi32(s1_29_3, k__DCT_CONST_ROUNDING);
+ const __m256i s1_18_6 = _mm256_srai_epi32(s1_18_4, DCT_CONST_BITS);
+ const __m256i s1_18_7 = _mm256_srai_epi32(s1_18_5, DCT_CONST_BITS);
+ const __m256i s1_19_6 = _mm256_srai_epi32(s1_19_4, DCT_CONST_BITS);
+ const __m256i s1_19_7 = _mm256_srai_epi32(s1_19_5, DCT_CONST_BITS);
+ const __m256i s1_20_6 = _mm256_srai_epi32(s1_20_4, DCT_CONST_BITS);
+ const __m256i s1_20_7 = _mm256_srai_epi32(s1_20_5, DCT_CONST_BITS);
+ const __m256i s1_21_6 = _mm256_srai_epi32(s1_21_4, DCT_CONST_BITS);
+ const __m256i s1_21_7 = _mm256_srai_epi32(s1_21_5, DCT_CONST_BITS);
+ const __m256i s1_26_6 = _mm256_srai_epi32(s1_26_4, DCT_CONST_BITS);
+ const __m256i s1_26_7 = _mm256_srai_epi32(s1_26_5, DCT_CONST_BITS);
+ const __m256i s1_27_6 = _mm256_srai_epi32(s1_27_4, DCT_CONST_BITS);
+ const __m256i s1_27_7 = _mm256_srai_epi32(s1_27_5, DCT_CONST_BITS);
+ const __m256i s1_28_6 = _mm256_srai_epi32(s1_28_4, DCT_CONST_BITS);
+ const __m256i s1_28_7 = _mm256_srai_epi32(s1_28_5, DCT_CONST_BITS);
+ const __m256i s1_29_6 = _mm256_srai_epi32(s1_29_4, DCT_CONST_BITS);
+ const __m256i s1_29_7 = _mm256_srai_epi32(s1_29_5, DCT_CONST_BITS);
+ // Combine
+ step1[18] = _mm256_packs_epi32(s1_18_6, s1_18_7);
+ step1[19] = _mm256_packs_epi32(s1_19_6, s1_19_7);
+ step1[20] = _mm256_packs_epi32(s1_20_6, s1_20_7);
+ step1[21] = _mm256_packs_epi32(s1_21_6, s1_21_7);
+ step1[26] = _mm256_packs_epi32(s1_26_6, s1_26_7);
+ step1[27] = _mm256_packs_epi32(s1_27_6, s1_27_7);
+ step1[28] = _mm256_packs_epi32(s1_28_6, s1_28_7);
+ step1[29] = _mm256_packs_epi32(s1_29_6, s1_29_7);
+ }
+ // Stage 5
+ {
+ step2[4] = _mm256_add_epi16(step1[5], step3[4]);
+ step2[5] = _mm256_sub_epi16(step3[4], step1[5]);
+ step2[6] = _mm256_sub_epi16(step3[7], step1[6]);
+ step2[7] = _mm256_add_epi16(step1[6], step3[7]);
+ }
+ {
+ const __m256i out_00_0 = _mm256_unpacklo_epi16(step1[0], step1[1]);
+ const __m256i out_00_1 = _mm256_unpackhi_epi16(step1[0], step1[1]);
+ const __m256i out_08_0 = _mm256_unpacklo_epi16(step1[2], step1[3]);
+ const __m256i out_08_1 = _mm256_unpackhi_epi16(step1[2], step1[3]);
+ const __m256i out_00_2 = _mm256_madd_epi16(out_00_0, k__cospi_p16_p16);
+ const __m256i out_00_3 = _mm256_madd_epi16(out_00_1, k__cospi_p16_p16);
+ const __m256i out_16_2 = _mm256_madd_epi16(out_00_0, k__cospi_p16_m16);
+ const __m256i out_16_3 = _mm256_madd_epi16(out_00_1, k__cospi_p16_m16);
+ const __m256i out_08_2 = _mm256_madd_epi16(out_08_0, k__cospi_p24_p08);
+ const __m256i out_08_3 = _mm256_madd_epi16(out_08_1, k__cospi_p24_p08);
+ const __m256i out_24_2 = _mm256_madd_epi16(out_08_0, k__cospi_m08_p24);
+ const __m256i out_24_3 = _mm256_madd_epi16(out_08_1, k__cospi_m08_p24);
+ // dct_const_round_shift
+ const __m256i out_00_4 = _mm256_add_epi32(out_00_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_00_5 = _mm256_add_epi32(out_00_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_16_4 = _mm256_add_epi32(out_16_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_16_5 = _mm256_add_epi32(out_16_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_08_4 = _mm256_add_epi32(out_08_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_08_5 = _mm256_add_epi32(out_08_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_24_4 = _mm256_add_epi32(out_24_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_24_5 = _mm256_add_epi32(out_24_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_00_6 = _mm256_srai_epi32(out_00_4, DCT_CONST_BITS);
+ const __m256i out_00_7 = _mm256_srai_epi32(out_00_5, DCT_CONST_BITS);
+ const __m256i out_16_6 = _mm256_srai_epi32(out_16_4, DCT_CONST_BITS);
+ const __m256i out_16_7 = _mm256_srai_epi32(out_16_5, DCT_CONST_BITS);
+ const __m256i out_08_6 = _mm256_srai_epi32(out_08_4, DCT_CONST_BITS);
+ const __m256i out_08_7 = _mm256_srai_epi32(out_08_5, DCT_CONST_BITS);
+ const __m256i out_24_6 = _mm256_srai_epi32(out_24_4, DCT_CONST_BITS);
+ const __m256i out_24_7 = _mm256_srai_epi32(out_24_5, DCT_CONST_BITS);
+ // Combine
+ out[ 0] = _mm256_packs_epi32(out_00_6, out_00_7);
+ out[16] = _mm256_packs_epi32(out_16_6, out_16_7);
+ out[ 8] = _mm256_packs_epi32(out_08_6, out_08_7);
+ out[24] = _mm256_packs_epi32(out_24_6, out_24_7);
+ }
+ {
+ const __m256i s2_09_0 = _mm256_unpacklo_epi16(step1[ 9], step1[14]);
+ const __m256i s2_09_1 = _mm256_unpackhi_epi16(step1[ 9], step1[14]);
+ const __m256i s2_10_0 = _mm256_unpacklo_epi16(step1[10], step1[13]);
+ const __m256i s2_10_1 = _mm256_unpackhi_epi16(step1[10], step1[13]);
+ const __m256i s2_09_2 = _mm256_madd_epi16(s2_09_0, k__cospi_m08_p24);
+ const __m256i s2_09_3 = _mm256_madd_epi16(s2_09_1, k__cospi_m08_p24);
+ const __m256i s2_10_2 = _mm256_madd_epi16(s2_10_0, k__cospi_m24_m08);
+ const __m256i s2_10_3 = _mm256_madd_epi16(s2_10_1, k__cospi_m24_m08);
+ const __m256i s2_13_2 = _mm256_madd_epi16(s2_10_0, k__cospi_m08_p24);
+ const __m256i s2_13_3 = _mm256_madd_epi16(s2_10_1, k__cospi_m08_p24);
+ const __m256i s2_14_2 = _mm256_madd_epi16(s2_09_0, k__cospi_p24_p08);
+ const __m256i s2_14_3 = _mm256_madd_epi16(s2_09_1, k__cospi_p24_p08);
+ // dct_const_round_shift
+ const __m256i s2_09_4 = _mm256_add_epi32(s2_09_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_09_5 = _mm256_add_epi32(s2_09_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_10_4 = _mm256_add_epi32(s2_10_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_10_5 = _mm256_add_epi32(s2_10_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_13_4 = _mm256_add_epi32(s2_13_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_13_5 = _mm256_add_epi32(s2_13_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_14_4 = _mm256_add_epi32(s2_14_2, k__DCT_CONST_ROUNDING);
+ const __m256i s2_14_5 = _mm256_add_epi32(s2_14_3, k__DCT_CONST_ROUNDING);
+ const __m256i s2_09_6 = _mm256_srai_epi32(s2_09_4, DCT_CONST_BITS);
+ const __m256i s2_09_7 = _mm256_srai_epi32(s2_09_5, DCT_CONST_BITS);
+ const __m256i s2_10_6 = _mm256_srai_epi32(s2_10_4, DCT_CONST_BITS);
+ const __m256i s2_10_7 = _mm256_srai_epi32(s2_10_5, DCT_CONST_BITS);
+ const __m256i s2_13_6 = _mm256_srai_epi32(s2_13_4, DCT_CONST_BITS);
+ const __m256i s2_13_7 = _mm256_srai_epi32(s2_13_5, DCT_CONST_BITS);
+ const __m256i s2_14_6 = _mm256_srai_epi32(s2_14_4, DCT_CONST_BITS);
+ const __m256i s2_14_7 = _mm256_srai_epi32(s2_14_5, DCT_CONST_BITS);
+ // Combine
+ step2[ 9] = _mm256_packs_epi32(s2_09_6, s2_09_7);
+ step2[10] = _mm256_packs_epi32(s2_10_6, s2_10_7);
+ step2[13] = _mm256_packs_epi32(s2_13_6, s2_13_7);
+ step2[14] = _mm256_packs_epi32(s2_14_6, s2_14_7);
+ }
+ {
+ step2[16] = _mm256_add_epi16(step1[19], step3[16]);
+ step2[17] = _mm256_add_epi16(step1[18], step3[17]);
+ step2[18] = _mm256_sub_epi16(step3[17], step1[18]);
+ step2[19] = _mm256_sub_epi16(step3[16], step1[19]);
+ step2[20] = _mm256_sub_epi16(step3[23], step1[20]);
+ step2[21] = _mm256_sub_epi16(step3[22], step1[21]);
+ step2[22] = _mm256_add_epi16(step1[21], step3[22]);
+ step2[23] = _mm256_add_epi16(step1[20], step3[23]);
+ step2[24] = _mm256_add_epi16(step1[27], step3[24]);
+ step2[25] = _mm256_add_epi16(step1[26], step3[25]);
+ step2[26] = _mm256_sub_epi16(step3[25], step1[26]);
+ step2[27] = _mm256_sub_epi16(step3[24], step1[27]);
+ step2[28] = _mm256_sub_epi16(step3[31], step1[28]);
+ step2[29] = _mm256_sub_epi16(step3[30], step1[29]);
+ step2[30] = _mm256_add_epi16(step1[29], step3[30]);
+ step2[31] = _mm256_add_epi16(step1[28], step3[31]);
+ }
+ // Stage 6
+ {
+ const __m256i out_04_0 = _mm256_unpacklo_epi16(step2[4], step2[7]);
+ const __m256i out_04_1 = _mm256_unpackhi_epi16(step2[4], step2[7]);
+ const __m256i out_20_0 = _mm256_unpacklo_epi16(step2[5], step2[6]);
+ const __m256i out_20_1 = _mm256_unpackhi_epi16(step2[5], step2[6]);
+ const __m256i out_12_0 = _mm256_unpacklo_epi16(step2[5], step2[6]);
+ const __m256i out_12_1 = _mm256_unpackhi_epi16(step2[5], step2[6]);
+ const __m256i out_28_0 = _mm256_unpacklo_epi16(step2[4], step2[7]);
+ const __m256i out_28_1 = _mm256_unpackhi_epi16(step2[4], step2[7]);
+ const __m256i out_04_2 = _mm256_madd_epi16(out_04_0, k__cospi_p28_p04);
+ const __m256i out_04_3 = _mm256_madd_epi16(out_04_1, k__cospi_p28_p04);
+ const __m256i out_20_2 = _mm256_madd_epi16(out_20_0, k__cospi_p12_p20);
+ const __m256i out_20_3 = _mm256_madd_epi16(out_20_1, k__cospi_p12_p20);
+ const __m256i out_12_2 = _mm256_madd_epi16(out_12_0, k__cospi_m20_p12);
+ const __m256i out_12_3 = _mm256_madd_epi16(out_12_1, k__cospi_m20_p12);
+ const __m256i out_28_2 = _mm256_madd_epi16(out_28_0, k__cospi_m04_p28);
+ const __m256i out_28_3 = _mm256_madd_epi16(out_28_1, k__cospi_m04_p28);
+ // dct_const_round_shift
+ const __m256i out_04_4 = _mm256_add_epi32(out_04_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_04_5 = _mm256_add_epi32(out_04_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_20_4 = _mm256_add_epi32(out_20_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_20_5 = _mm256_add_epi32(out_20_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_12_4 = _mm256_add_epi32(out_12_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_12_5 = _mm256_add_epi32(out_12_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_28_4 = _mm256_add_epi32(out_28_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_28_5 = _mm256_add_epi32(out_28_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_04_6 = _mm256_srai_epi32(out_04_4, DCT_CONST_BITS);
+ const __m256i out_04_7 = _mm256_srai_epi32(out_04_5, DCT_CONST_BITS);
+ const __m256i out_20_6 = _mm256_srai_epi32(out_20_4, DCT_CONST_BITS);
+ const __m256i out_20_7 = _mm256_srai_epi32(out_20_5, DCT_CONST_BITS);
+ const __m256i out_12_6 = _mm256_srai_epi32(out_12_4, DCT_CONST_BITS);
+ const __m256i out_12_7 = _mm256_srai_epi32(out_12_5, DCT_CONST_BITS);
+ const __m256i out_28_6 = _mm256_srai_epi32(out_28_4, DCT_CONST_BITS);
+ const __m256i out_28_7 = _mm256_srai_epi32(out_28_5, DCT_CONST_BITS);
+ // Combine
+ out[ 4] = _mm256_packs_epi32(out_04_6, out_04_7);
+ out[20] = _mm256_packs_epi32(out_20_6, out_20_7);
+ out[12] = _mm256_packs_epi32(out_12_6, out_12_7);
+ out[28] = _mm256_packs_epi32(out_28_6, out_28_7);
+ }
+ {
+ step3[ 8] = _mm256_add_epi16(step2[ 9], step1[ 8]);
+ step3[ 9] = _mm256_sub_epi16(step1[ 8], step2[ 9]);
+ step3[10] = _mm256_sub_epi16(step1[11], step2[10]);
+ step3[11] = _mm256_add_epi16(step2[10], step1[11]);
+ step3[12] = _mm256_add_epi16(step2[13], step1[12]);
+ step3[13] = _mm256_sub_epi16(step1[12], step2[13]);
+ step3[14] = _mm256_sub_epi16(step1[15], step2[14]);
+ step3[15] = _mm256_add_epi16(step2[14], step1[15]);
+ }
+ {
+ const __m256i s3_17_0 = _mm256_unpacklo_epi16(step2[17], step2[30]);
+ const __m256i s3_17_1 = _mm256_unpackhi_epi16(step2[17], step2[30]);
+ const __m256i s3_18_0 = _mm256_unpacklo_epi16(step2[18], step2[29]);
+ const __m256i s3_18_1 = _mm256_unpackhi_epi16(step2[18], step2[29]);
+ const __m256i s3_21_0 = _mm256_unpacklo_epi16(step2[21], step2[26]);
+ const __m256i s3_21_1 = _mm256_unpackhi_epi16(step2[21], step2[26]);
+ const __m256i s3_22_0 = _mm256_unpacklo_epi16(step2[22], step2[25]);
+ const __m256i s3_22_1 = _mm256_unpackhi_epi16(step2[22], step2[25]);
+ const __m256i s3_17_2 = _mm256_madd_epi16(s3_17_0, k__cospi_m04_p28);
+ const __m256i s3_17_3 = _mm256_madd_epi16(s3_17_1, k__cospi_m04_p28);
+ const __m256i s3_18_2 = _mm256_madd_epi16(s3_18_0, k__cospi_m28_m04);
+ const __m256i s3_18_3 = _mm256_madd_epi16(s3_18_1, k__cospi_m28_m04);
+ const __m256i s3_21_2 = _mm256_madd_epi16(s3_21_0, k__cospi_m20_p12);
+ const __m256i s3_21_3 = _mm256_madd_epi16(s3_21_1, k__cospi_m20_p12);
+ const __m256i s3_22_2 = _mm256_madd_epi16(s3_22_0, k__cospi_m12_m20);
+ const __m256i s3_22_3 = _mm256_madd_epi16(s3_22_1, k__cospi_m12_m20);
+ const __m256i s3_25_2 = _mm256_madd_epi16(s3_22_0, k__cospi_m20_p12);
+ const __m256i s3_25_3 = _mm256_madd_epi16(s3_22_1, k__cospi_m20_p12);
+ const __m256i s3_26_2 = _mm256_madd_epi16(s3_21_0, k__cospi_p12_p20);
+ const __m256i s3_26_3 = _mm256_madd_epi16(s3_21_1, k__cospi_p12_p20);
+ const __m256i s3_29_2 = _mm256_madd_epi16(s3_18_0, k__cospi_m04_p28);
+ const __m256i s3_29_3 = _mm256_madd_epi16(s3_18_1, k__cospi_m04_p28);
+ const __m256i s3_30_2 = _mm256_madd_epi16(s3_17_0, k__cospi_p28_p04);
+ const __m256i s3_30_3 = _mm256_madd_epi16(s3_17_1, k__cospi_p28_p04);
+ // dct_const_round_shift
+ const __m256i s3_17_4 = _mm256_add_epi32(s3_17_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_17_5 = _mm256_add_epi32(s3_17_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_18_4 = _mm256_add_epi32(s3_18_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_18_5 = _mm256_add_epi32(s3_18_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_21_4 = _mm256_add_epi32(s3_21_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_21_5 = _mm256_add_epi32(s3_21_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_22_4 = _mm256_add_epi32(s3_22_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_22_5 = _mm256_add_epi32(s3_22_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_17_6 = _mm256_srai_epi32(s3_17_4, DCT_CONST_BITS);
+ const __m256i s3_17_7 = _mm256_srai_epi32(s3_17_5, DCT_CONST_BITS);
+ const __m256i s3_18_6 = _mm256_srai_epi32(s3_18_4, DCT_CONST_BITS);
+ const __m256i s3_18_7 = _mm256_srai_epi32(s3_18_5, DCT_CONST_BITS);
+ const __m256i s3_21_6 = _mm256_srai_epi32(s3_21_4, DCT_CONST_BITS);
+ const __m256i s3_21_7 = _mm256_srai_epi32(s3_21_5, DCT_CONST_BITS);
+ const __m256i s3_22_6 = _mm256_srai_epi32(s3_22_4, DCT_CONST_BITS);
+ const __m256i s3_22_7 = _mm256_srai_epi32(s3_22_5, DCT_CONST_BITS);
+ const __m256i s3_25_4 = _mm256_add_epi32(s3_25_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_25_5 = _mm256_add_epi32(s3_25_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_26_4 = _mm256_add_epi32(s3_26_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_26_5 = _mm256_add_epi32(s3_26_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_29_4 = _mm256_add_epi32(s3_29_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_29_5 = _mm256_add_epi32(s3_29_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_30_4 = _mm256_add_epi32(s3_30_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_30_5 = _mm256_add_epi32(s3_30_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_25_6 = _mm256_srai_epi32(s3_25_4, DCT_CONST_BITS);
+ const __m256i s3_25_7 = _mm256_srai_epi32(s3_25_5, DCT_CONST_BITS);
+ const __m256i s3_26_6 = _mm256_srai_epi32(s3_26_4, DCT_CONST_BITS);
+ const __m256i s3_26_7 = _mm256_srai_epi32(s3_26_5, DCT_CONST_BITS);
+ const __m256i s3_29_6 = _mm256_srai_epi32(s3_29_4, DCT_CONST_BITS);
+ const __m256i s3_29_7 = _mm256_srai_epi32(s3_29_5, DCT_CONST_BITS);
+ const __m256i s3_30_6 = _mm256_srai_epi32(s3_30_4, DCT_CONST_BITS);
+ const __m256i s3_30_7 = _mm256_srai_epi32(s3_30_5, DCT_CONST_BITS);
+ // Combine
+ step3[17] = _mm256_packs_epi32(s3_17_6, s3_17_7);
+ step3[18] = _mm256_packs_epi32(s3_18_6, s3_18_7);
+ step3[21] = _mm256_packs_epi32(s3_21_6, s3_21_7);
+ step3[22] = _mm256_packs_epi32(s3_22_6, s3_22_7);
+ // Combine
+ step3[25] = _mm256_packs_epi32(s3_25_6, s3_25_7);
+ step3[26] = _mm256_packs_epi32(s3_26_6, s3_26_7);
+ step3[29] = _mm256_packs_epi32(s3_29_6, s3_29_7);
+ step3[30] = _mm256_packs_epi32(s3_30_6, s3_30_7);
+ }
+ // Stage 7
+ {
+ const __m256i out_02_0 = _mm256_unpacklo_epi16(step3[ 8], step3[15]);
+ const __m256i out_02_1 = _mm256_unpackhi_epi16(step3[ 8], step3[15]);
+ const __m256i out_18_0 = _mm256_unpacklo_epi16(step3[ 9], step3[14]);
+ const __m256i out_18_1 = _mm256_unpackhi_epi16(step3[ 9], step3[14]);
+ const __m256i out_10_0 = _mm256_unpacklo_epi16(step3[10], step3[13]);
+ const __m256i out_10_1 = _mm256_unpackhi_epi16(step3[10], step3[13]);
+ const __m256i out_26_0 = _mm256_unpacklo_epi16(step3[11], step3[12]);
+ const __m256i out_26_1 = _mm256_unpackhi_epi16(step3[11], step3[12]);
+ const __m256i out_02_2 = _mm256_madd_epi16(out_02_0, k__cospi_p30_p02);
+ const __m256i out_02_3 = _mm256_madd_epi16(out_02_1, k__cospi_p30_p02);
+ const __m256i out_18_2 = _mm256_madd_epi16(out_18_0, k__cospi_p14_p18);
+ const __m256i out_18_3 = _mm256_madd_epi16(out_18_1, k__cospi_p14_p18);
+ const __m256i out_10_2 = _mm256_madd_epi16(out_10_0, k__cospi_p22_p10);
+ const __m256i out_10_3 = _mm256_madd_epi16(out_10_1, k__cospi_p22_p10);
+ const __m256i out_26_2 = _mm256_madd_epi16(out_26_0, k__cospi_p06_p26);
+ const __m256i out_26_3 = _mm256_madd_epi16(out_26_1, k__cospi_p06_p26);
+ const __m256i out_06_2 = _mm256_madd_epi16(out_26_0, k__cospi_m26_p06);
+ const __m256i out_06_3 = _mm256_madd_epi16(out_26_1, k__cospi_m26_p06);
+ const __m256i out_22_2 = _mm256_madd_epi16(out_10_0, k__cospi_m10_p22);
+ const __m256i out_22_3 = _mm256_madd_epi16(out_10_1, k__cospi_m10_p22);
+ const __m256i out_14_2 = _mm256_madd_epi16(out_18_0, k__cospi_m18_p14);
+ const __m256i out_14_3 = _mm256_madd_epi16(out_18_1, k__cospi_m18_p14);
+ const __m256i out_30_2 = _mm256_madd_epi16(out_02_0, k__cospi_m02_p30);
+ const __m256i out_30_3 = _mm256_madd_epi16(out_02_1, k__cospi_m02_p30);
+ // dct_const_round_shift
+ const __m256i out_02_4 = _mm256_add_epi32(out_02_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_02_5 = _mm256_add_epi32(out_02_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_18_4 = _mm256_add_epi32(out_18_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_18_5 = _mm256_add_epi32(out_18_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_10_4 = _mm256_add_epi32(out_10_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_10_5 = _mm256_add_epi32(out_10_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_26_4 = _mm256_add_epi32(out_26_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_26_5 = _mm256_add_epi32(out_26_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_06_4 = _mm256_add_epi32(out_06_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_06_5 = _mm256_add_epi32(out_06_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_22_4 = _mm256_add_epi32(out_22_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_22_5 = _mm256_add_epi32(out_22_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_14_4 = _mm256_add_epi32(out_14_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_14_5 = _mm256_add_epi32(out_14_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_30_4 = _mm256_add_epi32(out_30_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_30_5 = _mm256_add_epi32(out_30_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_02_6 = _mm256_srai_epi32(out_02_4, DCT_CONST_BITS);
+ const __m256i out_02_7 = _mm256_srai_epi32(out_02_5, DCT_CONST_BITS);
+ const __m256i out_18_6 = _mm256_srai_epi32(out_18_4, DCT_CONST_BITS);
+ const __m256i out_18_7 = _mm256_srai_epi32(out_18_5, DCT_CONST_BITS);
+ const __m256i out_10_6 = _mm256_srai_epi32(out_10_4, DCT_CONST_BITS);
+ const __m256i out_10_7 = _mm256_srai_epi32(out_10_5, DCT_CONST_BITS);
+ const __m256i out_26_6 = _mm256_srai_epi32(out_26_4, DCT_CONST_BITS);
+ const __m256i out_26_7 = _mm256_srai_epi32(out_26_5, DCT_CONST_BITS);
+ const __m256i out_06_6 = _mm256_srai_epi32(out_06_4, DCT_CONST_BITS);
+ const __m256i out_06_7 = _mm256_srai_epi32(out_06_5, DCT_CONST_BITS);
+ const __m256i out_22_6 = _mm256_srai_epi32(out_22_4, DCT_CONST_BITS);
+ const __m256i out_22_7 = _mm256_srai_epi32(out_22_5, DCT_CONST_BITS);
+ const __m256i out_14_6 = _mm256_srai_epi32(out_14_4, DCT_CONST_BITS);
+ const __m256i out_14_7 = _mm256_srai_epi32(out_14_5, DCT_CONST_BITS);
+ const __m256i out_30_6 = _mm256_srai_epi32(out_30_4, DCT_CONST_BITS);
+ const __m256i out_30_7 = _mm256_srai_epi32(out_30_5, DCT_CONST_BITS);
+ // Combine
+ out[ 2] = _mm256_packs_epi32(out_02_6, out_02_7);
+ out[18] = _mm256_packs_epi32(out_18_6, out_18_7);
+ out[10] = _mm256_packs_epi32(out_10_6, out_10_7);
+ out[26] = _mm256_packs_epi32(out_26_6, out_26_7);
+ out[ 6] = _mm256_packs_epi32(out_06_6, out_06_7);
+ out[22] = _mm256_packs_epi32(out_22_6, out_22_7);
+ out[14] = _mm256_packs_epi32(out_14_6, out_14_7);
+ out[30] = _mm256_packs_epi32(out_30_6, out_30_7);
+ }
+ {
+ step1[16] = _mm256_add_epi16(step3[17], step2[16]);
+ step1[17] = _mm256_sub_epi16(step2[16], step3[17]);
+ step1[18] = _mm256_sub_epi16(step2[19], step3[18]);
+ step1[19] = _mm256_add_epi16(step3[18], step2[19]);
+ step1[20] = _mm256_add_epi16(step3[21], step2[20]);
+ step1[21] = _mm256_sub_epi16(step2[20], step3[21]);
+ step1[22] = _mm256_sub_epi16(step2[23], step3[22]);
+ step1[23] = _mm256_add_epi16(step3[22], step2[23]);
+ step1[24] = _mm256_add_epi16(step3[25], step2[24]);
+ step1[25] = _mm256_sub_epi16(step2[24], step3[25]);
+ step1[26] = _mm256_sub_epi16(step2[27], step3[26]);
+ step1[27] = _mm256_add_epi16(step3[26], step2[27]);
+ step1[28] = _mm256_add_epi16(step3[29], step2[28]);
+ step1[29] = _mm256_sub_epi16(step2[28], step3[29]);
+ step1[30] = _mm256_sub_epi16(step2[31], step3[30]);
+ step1[31] = _mm256_add_epi16(step3[30], step2[31]);
+ }
+ // Final stage --- outputs indices are bit-reversed.
+ {
+ const __m256i out_01_0 = _mm256_unpacklo_epi16(step1[16], step1[31]);
+ const __m256i out_01_1 = _mm256_unpackhi_epi16(step1[16], step1[31]);
+ const __m256i out_17_0 = _mm256_unpacklo_epi16(step1[17], step1[30]);
+ const __m256i out_17_1 = _mm256_unpackhi_epi16(step1[17], step1[30]);
+ const __m256i out_09_0 = _mm256_unpacklo_epi16(step1[18], step1[29]);
+ const __m256i out_09_1 = _mm256_unpackhi_epi16(step1[18], step1[29]);
+ const __m256i out_25_0 = _mm256_unpacklo_epi16(step1[19], step1[28]);
+ const __m256i out_25_1 = _mm256_unpackhi_epi16(step1[19], step1[28]);
+ const __m256i out_01_2 = _mm256_madd_epi16(out_01_0, k__cospi_p31_p01);
+ const __m256i out_01_3 = _mm256_madd_epi16(out_01_1, k__cospi_p31_p01);
+ const __m256i out_17_2 = _mm256_madd_epi16(out_17_0, k__cospi_p15_p17);
+ const __m256i out_17_3 = _mm256_madd_epi16(out_17_1, k__cospi_p15_p17);
+ const __m256i out_09_2 = _mm256_madd_epi16(out_09_0, k__cospi_p23_p09);
+ const __m256i out_09_3 = _mm256_madd_epi16(out_09_1, k__cospi_p23_p09);
+ const __m256i out_25_2 = _mm256_madd_epi16(out_25_0, k__cospi_p07_p25);
+ const __m256i out_25_3 = _mm256_madd_epi16(out_25_1, k__cospi_p07_p25);
+ const __m256i out_07_2 = _mm256_madd_epi16(out_25_0, k__cospi_m25_p07);
+ const __m256i out_07_3 = _mm256_madd_epi16(out_25_1, k__cospi_m25_p07);
+ const __m256i out_23_2 = _mm256_madd_epi16(out_09_0, k__cospi_m09_p23);
+ const __m256i out_23_3 = _mm256_madd_epi16(out_09_1, k__cospi_m09_p23);
+ const __m256i out_15_2 = _mm256_madd_epi16(out_17_0, k__cospi_m17_p15);
+ const __m256i out_15_3 = _mm256_madd_epi16(out_17_1, k__cospi_m17_p15);
+ const __m256i out_31_2 = _mm256_madd_epi16(out_01_0, k__cospi_m01_p31);
+ const __m256i out_31_3 = _mm256_madd_epi16(out_01_1, k__cospi_m01_p31);
+ // dct_const_round_shift
+ const __m256i out_01_4 = _mm256_add_epi32(out_01_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_01_5 = _mm256_add_epi32(out_01_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_17_4 = _mm256_add_epi32(out_17_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_17_5 = _mm256_add_epi32(out_17_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_09_4 = _mm256_add_epi32(out_09_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_09_5 = _mm256_add_epi32(out_09_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_25_4 = _mm256_add_epi32(out_25_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_25_5 = _mm256_add_epi32(out_25_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_07_4 = _mm256_add_epi32(out_07_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_07_5 = _mm256_add_epi32(out_07_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_23_4 = _mm256_add_epi32(out_23_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_23_5 = _mm256_add_epi32(out_23_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_15_4 = _mm256_add_epi32(out_15_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_15_5 = _mm256_add_epi32(out_15_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_31_4 = _mm256_add_epi32(out_31_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_31_5 = _mm256_add_epi32(out_31_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_01_6 = _mm256_srai_epi32(out_01_4, DCT_CONST_BITS);
+ const __m256i out_01_7 = _mm256_srai_epi32(out_01_5, DCT_CONST_BITS);
+ const __m256i out_17_6 = _mm256_srai_epi32(out_17_4, DCT_CONST_BITS);
+ const __m256i out_17_7 = _mm256_srai_epi32(out_17_5, DCT_CONST_BITS);
+ const __m256i out_09_6 = _mm256_srai_epi32(out_09_4, DCT_CONST_BITS);
+ const __m256i out_09_7 = _mm256_srai_epi32(out_09_5, DCT_CONST_BITS);
+ const __m256i out_25_6 = _mm256_srai_epi32(out_25_4, DCT_CONST_BITS);
+ const __m256i out_25_7 = _mm256_srai_epi32(out_25_5, DCT_CONST_BITS);
+ const __m256i out_07_6 = _mm256_srai_epi32(out_07_4, DCT_CONST_BITS);
+ const __m256i out_07_7 = _mm256_srai_epi32(out_07_5, DCT_CONST_BITS);
+ const __m256i out_23_6 = _mm256_srai_epi32(out_23_4, DCT_CONST_BITS);
+ const __m256i out_23_7 = _mm256_srai_epi32(out_23_5, DCT_CONST_BITS);
+ const __m256i out_15_6 = _mm256_srai_epi32(out_15_4, DCT_CONST_BITS);
+ const __m256i out_15_7 = _mm256_srai_epi32(out_15_5, DCT_CONST_BITS);
+ const __m256i out_31_6 = _mm256_srai_epi32(out_31_4, DCT_CONST_BITS);
+ const __m256i out_31_7 = _mm256_srai_epi32(out_31_5, DCT_CONST_BITS);
+ // Combine
+ out[ 1] = _mm256_packs_epi32(out_01_6, out_01_7);
+ out[17] = _mm256_packs_epi32(out_17_6, out_17_7);
+ out[ 9] = _mm256_packs_epi32(out_09_6, out_09_7);
+ out[25] = _mm256_packs_epi32(out_25_6, out_25_7);
+ out[ 7] = _mm256_packs_epi32(out_07_6, out_07_7);
+ out[23] = _mm256_packs_epi32(out_23_6, out_23_7);
+ out[15] = _mm256_packs_epi32(out_15_6, out_15_7);
+ out[31] = _mm256_packs_epi32(out_31_6, out_31_7);
+ }
+ {
+ const __m256i out_05_0 = _mm256_unpacklo_epi16(step1[20], step1[27]);
+ const __m256i out_05_1 = _mm256_unpackhi_epi16(step1[20], step1[27]);
+ const __m256i out_21_0 = _mm256_unpacklo_epi16(step1[21], step1[26]);
+ const __m256i out_21_1 = _mm256_unpackhi_epi16(step1[21], step1[26]);
+ const __m256i out_13_0 = _mm256_unpacklo_epi16(step1[22], step1[25]);
+ const __m256i out_13_1 = _mm256_unpackhi_epi16(step1[22], step1[25]);
+ const __m256i out_29_0 = _mm256_unpacklo_epi16(step1[23], step1[24]);
+ const __m256i out_29_1 = _mm256_unpackhi_epi16(step1[23], step1[24]);
+ const __m256i out_05_2 = _mm256_madd_epi16(out_05_0, k__cospi_p27_p05);
+ const __m256i out_05_3 = _mm256_madd_epi16(out_05_1, k__cospi_p27_p05);
+ const __m256i out_21_2 = _mm256_madd_epi16(out_21_0, k__cospi_p11_p21);
+ const __m256i out_21_3 = _mm256_madd_epi16(out_21_1, k__cospi_p11_p21);
+ const __m256i out_13_2 = _mm256_madd_epi16(out_13_0, k__cospi_p19_p13);
+ const __m256i out_13_3 = _mm256_madd_epi16(out_13_1, k__cospi_p19_p13);
+ const __m256i out_29_2 = _mm256_madd_epi16(out_29_0, k__cospi_p03_p29);
+ const __m256i out_29_3 = _mm256_madd_epi16(out_29_1, k__cospi_p03_p29);
+ const __m256i out_03_2 = _mm256_madd_epi16(out_29_0, k__cospi_m29_p03);
+ const __m256i out_03_3 = _mm256_madd_epi16(out_29_1, k__cospi_m29_p03);
+ const __m256i out_19_2 = _mm256_madd_epi16(out_13_0, k__cospi_m13_p19);
+ const __m256i out_19_3 = _mm256_madd_epi16(out_13_1, k__cospi_m13_p19);
+ const __m256i out_11_2 = _mm256_madd_epi16(out_21_0, k__cospi_m21_p11);
+ const __m256i out_11_3 = _mm256_madd_epi16(out_21_1, k__cospi_m21_p11);
+ const __m256i out_27_2 = _mm256_madd_epi16(out_05_0, k__cospi_m05_p27);
+ const __m256i out_27_3 = _mm256_madd_epi16(out_05_1, k__cospi_m05_p27);
+ // dct_const_round_shift
+ const __m256i out_05_4 = _mm256_add_epi32(out_05_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_05_5 = _mm256_add_epi32(out_05_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_21_4 = _mm256_add_epi32(out_21_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_21_5 = _mm256_add_epi32(out_21_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_13_4 = _mm256_add_epi32(out_13_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_13_5 = _mm256_add_epi32(out_13_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_29_4 = _mm256_add_epi32(out_29_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_29_5 = _mm256_add_epi32(out_29_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_03_4 = _mm256_add_epi32(out_03_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_03_5 = _mm256_add_epi32(out_03_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_19_4 = _mm256_add_epi32(out_19_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_19_5 = _mm256_add_epi32(out_19_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_11_4 = _mm256_add_epi32(out_11_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_11_5 = _mm256_add_epi32(out_11_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_27_4 = _mm256_add_epi32(out_27_2, k__DCT_CONST_ROUNDING);
+ const __m256i out_27_5 = _mm256_add_epi32(out_27_3, k__DCT_CONST_ROUNDING);
+ const __m256i out_05_6 = _mm256_srai_epi32(out_05_4, DCT_CONST_BITS);
+ const __m256i out_05_7 = _mm256_srai_epi32(out_05_5, DCT_CONST_BITS);
+ const __m256i out_21_6 = _mm256_srai_epi32(out_21_4, DCT_CONST_BITS);
+ const __m256i out_21_7 = _mm256_srai_epi32(out_21_5, DCT_CONST_BITS);
+ const __m256i out_13_6 = _mm256_srai_epi32(out_13_4, DCT_CONST_BITS);
+ const __m256i out_13_7 = _mm256_srai_epi32(out_13_5, DCT_CONST_BITS);
+ const __m256i out_29_6 = _mm256_srai_epi32(out_29_4, DCT_CONST_BITS);
+ const __m256i out_29_7 = _mm256_srai_epi32(out_29_5, DCT_CONST_BITS);
+ const __m256i out_03_6 = _mm256_srai_epi32(out_03_4, DCT_CONST_BITS);
+ const __m256i out_03_7 = _mm256_srai_epi32(out_03_5, DCT_CONST_BITS);
+ const __m256i out_19_6 = _mm256_srai_epi32(out_19_4, DCT_CONST_BITS);
+ const __m256i out_19_7 = _mm256_srai_epi32(out_19_5, DCT_CONST_BITS);
+ const __m256i out_11_6 = _mm256_srai_epi32(out_11_4, DCT_CONST_BITS);
+ const __m256i out_11_7 = _mm256_srai_epi32(out_11_5, DCT_CONST_BITS);
+ const __m256i out_27_6 = _mm256_srai_epi32(out_27_4, DCT_CONST_BITS);
+ const __m256i out_27_7 = _mm256_srai_epi32(out_27_5, DCT_CONST_BITS);
+ // Combine
+ out[ 5] = _mm256_packs_epi32(out_05_6, out_05_7);
+ out[21] = _mm256_packs_epi32(out_21_6, out_21_7);
+ out[13] = _mm256_packs_epi32(out_13_6, out_13_7);
+ out[29] = _mm256_packs_epi32(out_29_6, out_29_7);
+ out[ 3] = _mm256_packs_epi32(out_03_6, out_03_7);
+ out[19] = _mm256_packs_epi32(out_19_6, out_19_7);
+ out[11] = _mm256_packs_epi32(out_11_6, out_11_7);
+ out[27] = _mm256_packs_epi32(out_27_6, out_27_7);
+ }
+#if FDCT32x32_HIGH_PRECISION
+ } else {
+ __m256i lstep1[64], lstep2[64], lstep3[64];
+ __m256i u[32], v[32], sign[16];
+ const __m256i K32One = _mm256_set_epi32(1, 1, 1, 1, 1, 1, 1, 1);
+ // start using 32-bit operations
+ // stage 3
+ {
+ // expanding to 32-bit length priori to addition operations
+ lstep2[ 0] = _mm256_unpacklo_epi16(step2[ 0], kZero);
+ lstep2[ 1] = _mm256_unpackhi_epi16(step2[ 0], kZero);
+ lstep2[ 2] = _mm256_unpacklo_epi16(step2[ 1], kZero);
+ lstep2[ 3] = _mm256_unpackhi_epi16(step2[ 1], kZero);
+ lstep2[ 4] = _mm256_unpacklo_epi16(step2[ 2], kZero);
+ lstep2[ 5] = _mm256_unpackhi_epi16(step2[ 2], kZero);
+ lstep2[ 6] = _mm256_unpacklo_epi16(step2[ 3], kZero);
+ lstep2[ 7] = _mm256_unpackhi_epi16(step2[ 3], kZero);
+ lstep2[ 8] = _mm256_unpacklo_epi16(step2[ 4], kZero);
+ lstep2[ 9] = _mm256_unpackhi_epi16(step2[ 4], kZero);
+ lstep2[10] = _mm256_unpacklo_epi16(step2[ 5], kZero);
+ lstep2[11] = _mm256_unpackhi_epi16(step2[ 5], kZero);
+ lstep2[12] = _mm256_unpacklo_epi16(step2[ 6], kZero);
+ lstep2[13] = _mm256_unpackhi_epi16(step2[ 6], kZero);
+ lstep2[14] = _mm256_unpacklo_epi16(step2[ 7], kZero);
+ lstep2[15] = _mm256_unpackhi_epi16(step2[ 7], kZero);
+ lstep2[ 0] = _mm256_madd_epi16(lstep2[ 0], kOne);
+ lstep2[ 1] = _mm256_madd_epi16(lstep2[ 1], kOne);
+ lstep2[ 2] = _mm256_madd_epi16(lstep2[ 2], kOne);
+ lstep2[ 3] = _mm256_madd_epi16(lstep2[ 3], kOne);
+ lstep2[ 4] = _mm256_madd_epi16(lstep2[ 4], kOne);
+ lstep2[ 5] = _mm256_madd_epi16(lstep2[ 5], kOne);
+ lstep2[ 6] = _mm256_madd_epi16(lstep2[ 6], kOne);
+ lstep2[ 7] = _mm256_madd_epi16(lstep2[ 7], kOne);
+ lstep2[ 8] = _mm256_madd_epi16(lstep2[ 8], kOne);
+ lstep2[ 9] = _mm256_madd_epi16(lstep2[ 9], kOne);
+ lstep2[10] = _mm256_madd_epi16(lstep2[10], kOne);
+ lstep2[11] = _mm256_madd_epi16(lstep2[11], kOne);
+ lstep2[12] = _mm256_madd_epi16(lstep2[12], kOne);
+ lstep2[13] = _mm256_madd_epi16(lstep2[13], kOne);
+ lstep2[14] = _mm256_madd_epi16(lstep2[14], kOne);
+ lstep2[15] = _mm256_madd_epi16(lstep2[15], kOne);
+
+ lstep3[ 0] = _mm256_add_epi32(lstep2[14], lstep2[ 0]);
+ lstep3[ 1] = _mm256_add_epi32(lstep2[15], lstep2[ 1]);
+ lstep3[ 2] = _mm256_add_epi32(lstep2[12], lstep2[ 2]);
+ lstep3[ 3] = _mm256_add_epi32(lstep2[13], lstep2[ 3]);
+ lstep3[ 4] = _mm256_add_epi32(lstep2[10], lstep2[ 4]);
+ lstep3[ 5] = _mm256_add_epi32(lstep2[11], lstep2[ 5]);
+ lstep3[ 6] = _mm256_add_epi32(lstep2[ 8], lstep2[ 6]);
+ lstep3[ 7] = _mm256_add_epi32(lstep2[ 9], lstep2[ 7]);
+ lstep3[ 8] = _mm256_sub_epi32(lstep2[ 6], lstep2[ 8]);
+ lstep3[ 9] = _mm256_sub_epi32(lstep2[ 7], lstep2[ 9]);
+ lstep3[10] = _mm256_sub_epi32(lstep2[ 4], lstep2[10]);
+ lstep3[11] = _mm256_sub_epi32(lstep2[ 5], lstep2[11]);
+ lstep3[12] = _mm256_sub_epi32(lstep2[ 2], lstep2[12]);
+ lstep3[13] = _mm256_sub_epi32(lstep2[ 3], lstep2[13]);
+ lstep3[14] = _mm256_sub_epi32(lstep2[ 0], lstep2[14]);
+ lstep3[15] = _mm256_sub_epi32(lstep2[ 1], lstep2[15]);
+ }
+ {
+ const __m256i s3_10_0 = _mm256_unpacklo_epi16(step2[13], step2[10]);
+ const __m256i s3_10_1 = _mm256_unpackhi_epi16(step2[13], step2[10]);
+ const __m256i s3_11_0 = _mm256_unpacklo_epi16(step2[12], step2[11]);
+ const __m256i s3_11_1 = _mm256_unpackhi_epi16(step2[12], step2[11]);
+ const __m256i s3_10_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_m16);
+ const __m256i s3_10_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_m16);
+ const __m256i s3_11_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_m16);
+ const __m256i s3_11_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_m16);
+ const __m256i s3_12_2 = _mm256_madd_epi16(s3_11_0, k__cospi_p16_p16);
+ const __m256i s3_12_3 = _mm256_madd_epi16(s3_11_1, k__cospi_p16_p16);
+ const __m256i s3_13_2 = _mm256_madd_epi16(s3_10_0, k__cospi_p16_p16);
+ const __m256i s3_13_3 = _mm256_madd_epi16(s3_10_1, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m256i s3_10_4 = _mm256_add_epi32(s3_10_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_10_5 = _mm256_add_epi32(s3_10_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_11_4 = _mm256_add_epi32(s3_11_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_11_5 = _mm256_add_epi32(s3_11_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_12_4 = _mm256_add_epi32(s3_12_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_12_5 = _mm256_add_epi32(s3_12_3, k__DCT_CONST_ROUNDING);
+ const __m256i s3_13_4 = _mm256_add_epi32(s3_13_2, k__DCT_CONST_ROUNDING);
+ const __m256i s3_13_5 = _mm256_add_epi32(s3_13_3, k__DCT_CONST_ROUNDING);
+ lstep3[20] = _mm256_srai_epi32(s3_10_4, DCT_CONST_BITS);
+ lstep3[21] = _mm256_srai_epi32(s3_10_5, DCT_CONST_BITS);
+ lstep3[22] = _mm256_srai_epi32(s3_11_4, DCT_CONST_BITS);
+ lstep3[23] = _mm256_srai_epi32(s3_11_5, DCT_CONST_BITS);
+ lstep3[24] = _mm256_srai_epi32(s3_12_4, DCT_CONST_BITS);
+ lstep3[25] = _mm256_srai_epi32(s3_12_5, DCT_CONST_BITS);
+ lstep3[26] = _mm256_srai_epi32(s3_13_4, DCT_CONST_BITS);
+ lstep3[27] = _mm256_srai_epi32(s3_13_5, DCT_CONST_BITS);
+ }
+ {
+ lstep2[40] = _mm256_unpacklo_epi16(step2[20], kZero);
+ lstep2[41] = _mm256_unpackhi_epi16(step2[20], kZero);
+ lstep2[42] = _mm256_unpacklo_epi16(step2[21], kZero);
+ lstep2[43] = _mm256_unpackhi_epi16(step2[21], kZero);
+ lstep2[44] = _mm256_unpacklo_epi16(step2[22], kZero);
+ lstep2[45] = _mm256_unpackhi_epi16(step2[22], kZero);
+ lstep2[46] = _mm256_unpacklo_epi16(step2[23], kZero);
+ lstep2[47] = _mm256_unpackhi_epi16(step2[23], kZero);
+ lstep2[48] = _mm256_unpacklo_epi16(step2[24], kZero);
+ lstep2[49] = _mm256_unpackhi_epi16(step2[24], kZero);
+ lstep2[50] = _mm256_unpacklo_epi16(step2[25], kZero);
+ lstep2[51] = _mm256_unpackhi_epi16(step2[25], kZero);
+ lstep2[52] = _mm256_unpacklo_epi16(step2[26], kZero);
+ lstep2[53] = _mm256_unpackhi_epi16(step2[26], kZero);
+ lstep2[54] = _mm256_unpacklo_epi16(step2[27], kZero);
+ lstep2[55] = _mm256_unpackhi_epi16(step2[27], kZero);
+ lstep2[40] = _mm256_madd_epi16(lstep2[40], kOne);
+ lstep2[41] = _mm256_madd_epi16(lstep2[41], kOne);
+ lstep2[42] = _mm256_madd_epi16(lstep2[42], kOne);
+ lstep2[43] = _mm256_madd_epi16(lstep2[43], kOne);
+ lstep2[44] = _mm256_madd_epi16(lstep2[44], kOne);
+ lstep2[45] = _mm256_madd_epi16(lstep2[45], kOne);
+ lstep2[46] = _mm256_madd_epi16(lstep2[46], kOne);
+ lstep2[47] = _mm256_madd_epi16(lstep2[47], kOne);
+ lstep2[48] = _mm256_madd_epi16(lstep2[48], kOne);
+ lstep2[49] = _mm256_madd_epi16(lstep2[49], kOne);
+ lstep2[50] = _mm256_madd_epi16(lstep2[50], kOne);
+ lstep2[51] = _mm256_madd_epi16(lstep2[51], kOne);
+ lstep2[52] = _mm256_madd_epi16(lstep2[52], kOne);
+ lstep2[53] = _mm256_madd_epi16(lstep2[53], kOne);
+ lstep2[54] = _mm256_madd_epi16(lstep2[54], kOne);
+ lstep2[55] = _mm256_madd_epi16(lstep2[55], kOne);
+
+ lstep1[32] = _mm256_unpacklo_epi16(step1[16], kZero);
+ lstep1[33] = _mm256_unpackhi_epi16(step1[16], kZero);
+ lstep1[34] = _mm256_unpacklo_epi16(step1[17], kZero);
+ lstep1[35] = _mm256_unpackhi_epi16(step1[17], kZero);
+ lstep1[36] = _mm256_unpacklo_epi16(step1[18], kZero);
+ lstep1[37] = _mm256_unpackhi_epi16(step1[18], kZero);
+ lstep1[38] = _mm256_unpacklo_epi16(step1[19], kZero);
+ lstep1[39] = _mm256_unpackhi_epi16(step1[19], kZero);
+ lstep1[56] = _mm256_unpacklo_epi16(step1[28], kZero);
+ lstep1[57] = _mm256_unpackhi_epi16(step1[28], kZero);
+ lstep1[58] = _mm256_unpacklo_epi16(step1[29], kZero);
+ lstep1[59] = _mm256_unpackhi_epi16(step1[29], kZero);
+ lstep1[60] = _mm256_unpacklo_epi16(step1[30], kZero);
+ lstep1[61] = _mm256_unpackhi_epi16(step1[30], kZero);
+ lstep1[62] = _mm256_unpacklo_epi16(step1[31], kZero);
+ lstep1[63] = _mm256_unpackhi_epi16(step1[31], kZero);
+ lstep1[32] = _mm256_madd_epi16(lstep1[32], kOne);
+ lstep1[33] = _mm256_madd_epi16(lstep1[33], kOne);
+ lstep1[34] = _mm256_madd_epi16(lstep1[34], kOne);
+ lstep1[35] = _mm256_madd_epi16(lstep1[35], kOne);
+ lstep1[36] = _mm256_madd_epi16(lstep1[36], kOne);
+ lstep1[37] = _mm256_madd_epi16(lstep1[37], kOne);
+ lstep1[38] = _mm256_madd_epi16(lstep1[38], kOne);
+ lstep1[39] = _mm256_madd_epi16(lstep1[39], kOne);
+ lstep1[56] = _mm256_madd_epi16(lstep1[56], kOne);
+ lstep1[57] = _mm256_madd_epi16(lstep1[57], kOne);
+ lstep1[58] = _mm256_madd_epi16(lstep1[58], kOne);
+ lstep1[59] = _mm256_madd_epi16(lstep1[59], kOne);
+ lstep1[60] = _mm256_madd_epi16(lstep1[60], kOne);
+ lstep1[61] = _mm256_madd_epi16(lstep1[61], kOne);
+ lstep1[62] = _mm256_madd_epi16(lstep1[62], kOne);
+ lstep1[63] = _mm256_madd_epi16(lstep1[63], kOne);
+
+ lstep3[32] = _mm256_add_epi32(lstep2[46], lstep1[32]);
+ lstep3[33] = _mm256_add_epi32(lstep2[47], lstep1[33]);
+
+ lstep3[34] = _mm256_add_epi32(lstep2[44], lstep1[34]);
+ lstep3[35] = _mm256_add_epi32(lstep2[45], lstep1[35]);
+ lstep3[36] = _mm256_add_epi32(lstep2[42], lstep1[36]);
+ lstep3[37] = _mm256_add_epi32(lstep2[43], lstep1[37]);
+ lstep3[38] = _mm256_add_epi32(lstep2[40], lstep1[38]);
+ lstep3[39] = _mm256_add_epi32(lstep2[41], lstep1[39]);
+ lstep3[40] = _mm256_sub_epi32(lstep1[38], lstep2[40]);
+ lstep3[41] = _mm256_sub_epi32(lstep1[39], lstep2[41]);
+ lstep3[42] = _mm256_sub_epi32(lstep1[36], lstep2[42]);
+ lstep3[43] = _mm256_sub_epi32(lstep1[37], lstep2[43]);
+ lstep3[44] = _mm256_sub_epi32(lstep1[34], lstep2[44]);
+ lstep3[45] = _mm256_sub_epi32(lstep1[35], lstep2[45]);
+ lstep3[46] = _mm256_sub_epi32(lstep1[32], lstep2[46]);
+ lstep3[47] = _mm256_sub_epi32(lstep1[33], lstep2[47]);
+ lstep3[48] = _mm256_sub_epi32(lstep1[62], lstep2[48]);
+ lstep3[49] = _mm256_sub_epi32(lstep1[63], lstep2[49]);
+ lstep3[50] = _mm256_sub_epi32(lstep1[60], lstep2[50]);
+ lstep3[51] = _mm256_sub_epi32(lstep1[61], lstep2[51]);
+ lstep3[52] = _mm256_sub_epi32(lstep1[58], lstep2[52]);
+ lstep3[53] = _mm256_sub_epi32(lstep1[59], lstep2[53]);
+ lstep3[54] = _mm256_sub_epi32(lstep1[56], lstep2[54]);
+ lstep3[55] = _mm256_sub_epi32(lstep1[57], lstep2[55]);
+ lstep3[56] = _mm256_add_epi32(lstep2[54], lstep1[56]);
+ lstep3[57] = _mm256_add_epi32(lstep2[55], lstep1[57]);
+ lstep3[58] = _mm256_add_epi32(lstep2[52], lstep1[58]);
+ lstep3[59] = _mm256_add_epi32(lstep2[53], lstep1[59]);
+ lstep3[60] = _mm256_add_epi32(lstep2[50], lstep1[60]);
+ lstep3[61] = _mm256_add_epi32(lstep2[51], lstep1[61]);
+ lstep3[62] = _mm256_add_epi32(lstep2[48], lstep1[62]);
+ lstep3[63] = _mm256_add_epi32(lstep2[49], lstep1[63]);
+ }
+
+ // stage 4
+ {
+ // expanding to 32-bit length priori to addition operations
+ lstep2[16] = _mm256_unpacklo_epi16(step2[ 8], kZero);
+ lstep2[17] = _mm256_unpackhi_epi16(step2[ 8], kZero);
+ lstep2[18] = _mm256_unpacklo_epi16(step2[ 9], kZero);
+ lstep2[19] = _mm256_unpackhi_epi16(step2[ 9], kZero);
+ lstep2[28] = _mm256_unpacklo_epi16(step2[14], kZero);
+ lstep2[29] = _mm256_unpackhi_epi16(step2[14], kZero);
+ lstep2[30] = _mm256_unpacklo_epi16(step2[15], kZero);
+ lstep2[31] = _mm256_unpackhi_epi16(step2[15], kZero);
+ lstep2[16] = _mm256_madd_epi16(lstep2[16], kOne);
+ lstep2[17] = _mm256_madd_epi16(lstep2[17], kOne);
+ lstep2[18] = _mm256_madd_epi16(lstep2[18], kOne);
+ lstep2[19] = _mm256_madd_epi16(lstep2[19], kOne);
+ lstep2[28] = _mm256_madd_epi16(lstep2[28], kOne);
+ lstep2[29] = _mm256_madd_epi16(lstep2[29], kOne);
+ lstep2[30] = _mm256_madd_epi16(lstep2[30], kOne);
+ lstep2[31] = _mm256_madd_epi16(lstep2[31], kOne);
+
+ lstep1[ 0] = _mm256_add_epi32(lstep3[ 6], lstep3[ 0]);
+ lstep1[ 1] = _mm256_add_epi32(lstep3[ 7], lstep3[ 1]);
+ lstep1[ 2] = _mm256_add_epi32(lstep3[ 4], lstep3[ 2]);
+ lstep1[ 3] = _mm256_add_epi32(lstep3[ 5], lstep3[ 3]);
+ lstep1[ 4] = _mm256_sub_epi32(lstep3[ 2], lstep3[ 4]);
+ lstep1[ 5] = _mm256_sub_epi32(lstep3[ 3], lstep3[ 5]);
+ lstep1[ 6] = _mm256_sub_epi32(lstep3[ 0], lstep3[ 6]);
+ lstep1[ 7] = _mm256_sub_epi32(lstep3[ 1], lstep3[ 7]);
+ lstep1[16] = _mm256_add_epi32(lstep3[22], lstep2[16]);
+ lstep1[17] = _mm256_add_epi32(lstep3[23], lstep2[17]);
+ lstep1[18] = _mm256_add_epi32(lstep3[20], lstep2[18]);
+ lstep1[19] = _mm256_add_epi32(lstep3[21], lstep2[19]);
+ lstep1[20] = _mm256_sub_epi32(lstep2[18], lstep3[20]);
+ lstep1[21] = _mm256_sub_epi32(lstep2[19], lstep3[21]);
+ lstep1[22] = _mm256_sub_epi32(lstep2[16], lstep3[22]);
+ lstep1[23] = _mm256_sub_epi32(lstep2[17], lstep3[23]);
+ lstep1[24] = _mm256_sub_epi32(lstep2[30], lstep3[24]);
+ lstep1[25] = _mm256_sub_epi32(lstep2[31], lstep3[25]);
+ lstep1[26] = _mm256_sub_epi32(lstep2[28], lstep3[26]);
+ lstep1[27] = _mm256_sub_epi32(lstep2[29], lstep3[27]);
+ lstep1[28] = _mm256_add_epi32(lstep3[26], lstep2[28]);
+ lstep1[29] = _mm256_add_epi32(lstep3[27], lstep2[29]);
+ lstep1[30] = _mm256_add_epi32(lstep3[24], lstep2[30]);
+ lstep1[31] = _mm256_add_epi32(lstep3[25], lstep2[31]);
+ }
+ {
+ // to be continued...
+ //
+ const __m256i k32_p16_p16 = pair256_set_epi32(cospi_16_64, cospi_16_64);
+ const __m256i k32_p16_m16 = pair256_set_epi32(cospi_16_64, -cospi_16_64);
+
+ u[0] = _mm256_unpacklo_epi32(lstep3[12], lstep3[10]);
+ u[1] = _mm256_unpackhi_epi32(lstep3[12], lstep3[10]);
+ u[2] = _mm256_unpacklo_epi32(lstep3[13], lstep3[11]);
+ u[3] = _mm256_unpackhi_epi32(lstep3[13], lstep3[11]);
+
+ // TODO(jingning): manually inline k_madd_epi32_avx2_ to further hide
+ // instruction latency.
+ v[ 0] = k_madd_epi32_avx2(u[0], k32_p16_m16);
+ v[ 1] = k_madd_epi32_avx2(u[1], k32_p16_m16);
+ v[ 2] = k_madd_epi32_avx2(u[2], k32_p16_m16);
+ v[ 3] = k_madd_epi32_avx2(u[3], k32_p16_m16);
+ v[ 4] = k_madd_epi32_avx2(u[0], k32_p16_p16);
+ v[ 5] = k_madd_epi32_avx2(u[1], k32_p16_p16);
+ v[ 6] = k_madd_epi32_avx2(u[2], k32_p16_p16);
+ v[ 7] = k_madd_epi32_avx2(u[3], k32_p16_p16);
+
+ u[0] = k_packs_epi64_avx2(v[0], v[1]);
+ u[1] = k_packs_epi64_avx2(v[2], v[3]);
+ u[2] = k_packs_epi64_avx2(v[4], v[5]);
+ u[3] = k_packs_epi64_avx2(v[6], v[7]);
+
+ v[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+
+ lstep1[10] = _mm256_srai_epi32(v[0], DCT_CONST_BITS);
+ lstep1[11] = _mm256_srai_epi32(v[1], DCT_CONST_BITS);
+ lstep1[12] = _mm256_srai_epi32(v[2], DCT_CONST_BITS);
+ lstep1[13] = _mm256_srai_epi32(v[3], DCT_CONST_BITS);
+ }
+ {
+ const __m256i k32_m08_p24 = pair256_set_epi32(-cospi_8_64, cospi_24_64);
+ const __m256i k32_m24_m08 = pair256_set_epi32(-cospi_24_64, -cospi_8_64);
+ const __m256i k32_p24_p08 = pair256_set_epi32(cospi_24_64, cospi_8_64);
+
+ u[ 0] = _mm256_unpacklo_epi32(lstep3[36], lstep3[58]);
+ u[ 1] = _mm256_unpackhi_epi32(lstep3[36], lstep3[58]);
+ u[ 2] = _mm256_unpacklo_epi32(lstep3[37], lstep3[59]);
+ u[ 3] = _mm256_unpackhi_epi32(lstep3[37], lstep3[59]);
+ u[ 4] = _mm256_unpacklo_epi32(lstep3[38], lstep3[56]);
+ u[ 5] = _mm256_unpackhi_epi32(lstep3[38], lstep3[56]);
+ u[ 6] = _mm256_unpacklo_epi32(lstep3[39], lstep3[57]);
+ u[ 7] = _mm256_unpackhi_epi32(lstep3[39], lstep3[57]);
+ u[ 8] = _mm256_unpacklo_epi32(lstep3[40], lstep3[54]);
+ u[ 9] = _mm256_unpackhi_epi32(lstep3[40], lstep3[54]);
+ u[10] = _mm256_unpacklo_epi32(lstep3[41], lstep3[55]);
+ u[11] = _mm256_unpackhi_epi32(lstep3[41], lstep3[55]);
+ u[12] = _mm256_unpacklo_epi32(lstep3[42], lstep3[52]);
+ u[13] = _mm256_unpackhi_epi32(lstep3[42], lstep3[52]);
+ u[14] = _mm256_unpacklo_epi32(lstep3[43], lstep3[53]);
+ u[15] = _mm256_unpackhi_epi32(lstep3[43], lstep3[53]);
+
+ v[ 0] = k_madd_epi32_avx2(u[ 0], k32_m08_p24);
+ v[ 1] = k_madd_epi32_avx2(u[ 1], k32_m08_p24);
+ v[ 2] = k_madd_epi32_avx2(u[ 2], k32_m08_p24);
+ v[ 3] = k_madd_epi32_avx2(u[ 3], k32_m08_p24);
+ v[ 4] = k_madd_epi32_avx2(u[ 4], k32_m08_p24);
+ v[ 5] = k_madd_epi32_avx2(u[ 5], k32_m08_p24);
+ v[ 6] = k_madd_epi32_avx2(u[ 6], k32_m08_p24);
+ v[ 7] = k_madd_epi32_avx2(u[ 7], k32_m08_p24);
+ v[ 8] = k_madd_epi32_avx2(u[ 8], k32_m24_m08);
+ v[ 9] = k_madd_epi32_avx2(u[ 9], k32_m24_m08);
+ v[10] = k_madd_epi32_avx2(u[10], k32_m24_m08);
+ v[11] = k_madd_epi32_avx2(u[11], k32_m24_m08);
+ v[12] = k_madd_epi32_avx2(u[12], k32_m24_m08);
+ v[13] = k_madd_epi32_avx2(u[13], k32_m24_m08);
+ v[14] = k_madd_epi32_avx2(u[14], k32_m24_m08);
+ v[15] = k_madd_epi32_avx2(u[15], k32_m24_m08);
+ v[16] = k_madd_epi32_avx2(u[12], k32_m08_p24);
+ v[17] = k_madd_epi32_avx2(u[13], k32_m08_p24);
+ v[18] = k_madd_epi32_avx2(u[14], k32_m08_p24);
+ v[19] = k_madd_epi32_avx2(u[15], k32_m08_p24);
+ v[20] = k_madd_epi32_avx2(u[ 8], k32_m08_p24);
+ v[21] = k_madd_epi32_avx2(u[ 9], k32_m08_p24);
+ v[22] = k_madd_epi32_avx2(u[10], k32_m08_p24);
+ v[23] = k_madd_epi32_avx2(u[11], k32_m08_p24);
+ v[24] = k_madd_epi32_avx2(u[ 4], k32_p24_p08);
+ v[25] = k_madd_epi32_avx2(u[ 5], k32_p24_p08);
+ v[26] = k_madd_epi32_avx2(u[ 6], k32_p24_p08);
+ v[27] = k_madd_epi32_avx2(u[ 7], k32_p24_p08);
+ v[28] = k_madd_epi32_avx2(u[ 0], k32_p24_p08);
+ v[29] = k_madd_epi32_avx2(u[ 1], k32_p24_p08);
+ v[30] = k_madd_epi32_avx2(u[ 2], k32_p24_p08);
+ v[31] = k_madd_epi32_avx2(u[ 3], k32_p24_p08);
+
+ u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]);
+ u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]);
+ u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]);
+ u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]);
+ u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]);
+ u[ 5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[ 6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[ 7] = k_packs_epi64_avx2(v[14], v[15]);
+ u[ 8] = k_packs_epi64_avx2(v[16], v[17]);
+ u[ 9] = k_packs_epi64_avx2(v[18], v[19]);
+ u[10] = k_packs_epi64_avx2(v[20], v[21]);
+ u[11] = k_packs_epi64_avx2(v[22], v[23]);
+ u[12] = k_packs_epi64_avx2(v[24], v[25]);
+ u[13] = k_packs_epi64_avx2(v[26], v[27]);
+ u[14] = k_packs_epi64_avx2(v[28], v[29]);
+ u[15] = k_packs_epi64_avx2(v[30], v[31]);
+
+ v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING);
+ v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING);
+ v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING);
+ v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING);
+ v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING);
+ v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING);
+ v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING);
+ v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING);
+ v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING);
+ v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ lstep1[36] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS);
+ lstep1[37] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS);
+ lstep1[38] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS);
+ lstep1[39] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS);
+ lstep1[40] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS);
+ lstep1[41] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS);
+ lstep1[42] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS);
+ lstep1[43] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS);
+ lstep1[52] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS);
+ lstep1[53] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS);
+ lstep1[54] = _mm256_srai_epi32(v[10], DCT_CONST_BITS);
+ lstep1[55] = _mm256_srai_epi32(v[11], DCT_CONST_BITS);
+ lstep1[56] = _mm256_srai_epi32(v[12], DCT_CONST_BITS);
+ lstep1[57] = _mm256_srai_epi32(v[13], DCT_CONST_BITS);
+ lstep1[58] = _mm256_srai_epi32(v[14], DCT_CONST_BITS);
+ lstep1[59] = _mm256_srai_epi32(v[15], DCT_CONST_BITS);
+ }
+ // stage 5
+ {
+ lstep2[ 8] = _mm256_add_epi32(lstep1[10], lstep3[ 8]);
+ lstep2[ 9] = _mm256_add_epi32(lstep1[11], lstep3[ 9]);
+ lstep2[10] = _mm256_sub_epi32(lstep3[ 8], lstep1[10]);
+ lstep2[11] = _mm256_sub_epi32(lstep3[ 9], lstep1[11]);
+ lstep2[12] = _mm256_sub_epi32(lstep3[14], lstep1[12]);
+ lstep2[13] = _mm256_sub_epi32(lstep3[15], lstep1[13]);
+ lstep2[14] = _mm256_add_epi32(lstep1[12], lstep3[14]);
+ lstep2[15] = _mm256_add_epi32(lstep1[13], lstep3[15]);
+ }
+ {
+ const __m256i k32_p16_p16 = pair256_set_epi32(cospi_16_64, cospi_16_64);
+ const __m256i k32_p16_m16 = pair256_set_epi32(cospi_16_64, -cospi_16_64);
+ const __m256i k32_p24_p08 = pair256_set_epi32(cospi_24_64, cospi_8_64);
+ const __m256i k32_m08_p24 = pair256_set_epi32(-cospi_8_64, cospi_24_64);
+
+ u[0] = _mm256_unpacklo_epi32(lstep1[0], lstep1[2]);
+ u[1] = _mm256_unpackhi_epi32(lstep1[0], lstep1[2]);
+ u[2] = _mm256_unpacklo_epi32(lstep1[1], lstep1[3]);
+ u[3] = _mm256_unpackhi_epi32(lstep1[1], lstep1[3]);
+ u[4] = _mm256_unpacklo_epi32(lstep1[4], lstep1[6]);
+ u[5] = _mm256_unpackhi_epi32(lstep1[4], lstep1[6]);
+ u[6] = _mm256_unpacklo_epi32(lstep1[5], lstep1[7]);
+ u[7] = _mm256_unpackhi_epi32(lstep1[5], lstep1[7]);
+
+ // TODO(jingning): manually inline k_madd_epi32_avx2_ to further hide
+ // instruction latency.
+ v[ 0] = k_madd_epi32_avx2(u[0], k32_p16_p16);
+ v[ 1] = k_madd_epi32_avx2(u[1], k32_p16_p16);
+ v[ 2] = k_madd_epi32_avx2(u[2], k32_p16_p16);
+ v[ 3] = k_madd_epi32_avx2(u[3], k32_p16_p16);
+ v[ 4] = k_madd_epi32_avx2(u[0], k32_p16_m16);
+ v[ 5] = k_madd_epi32_avx2(u[1], k32_p16_m16);
+ v[ 6] = k_madd_epi32_avx2(u[2], k32_p16_m16);
+ v[ 7] = k_madd_epi32_avx2(u[3], k32_p16_m16);
+ v[ 8] = k_madd_epi32_avx2(u[4], k32_p24_p08);
+ v[ 9] = k_madd_epi32_avx2(u[5], k32_p24_p08);
+ v[10] = k_madd_epi32_avx2(u[6], k32_p24_p08);
+ v[11] = k_madd_epi32_avx2(u[7], k32_p24_p08);
+ v[12] = k_madd_epi32_avx2(u[4], k32_m08_p24);
+ v[13] = k_madd_epi32_avx2(u[5], k32_m08_p24);
+ v[14] = k_madd_epi32_avx2(u[6], k32_m08_p24);
+ v[15] = k_madd_epi32_avx2(u[7], k32_m08_p24);
+
+ u[0] = k_packs_epi64_avx2(v[0], v[1]);
+ u[1] = k_packs_epi64_avx2(v[2], v[3]);
+ u[2] = k_packs_epi64_avx2(v[4], v[5]);
+ u[3] = k_packs_epi64_avx2(v[6], v[7]);
+ u[4] = k_packs_epi64_avx2(v[8], v[9]);
+ u[5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[7] = k_packs_epi64_avx2(v[14], v[15]);
+
+ v[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ v[4] = _mm256_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ v[5] = _mm256_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ v[6] = _mm256_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ v[7] = _mm256_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+
+ u[0] = _mm256_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm256_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm256_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm256_srai_epi32(v[3], DCT_CONST_BITS);
+ u[4] = _mm256_srai_epi32(v[4], DCT_CONST_BITS);
+ u[5] = _mm256_srai_epi32(v[5], DCT_CONST_BITS);
+ u[6] = _mm256_srai_epi32(v[6], DCT_CONST_BITS);
+ u[7] = _mm256_srai_epi32(v[7], DCT_CONST_BITS);
+
+ sign[0] = _mm256_cmpgt_epi32(kZero,u[0]);
+ sign[1] = _mm256_cmpgt_epi32(kZero,u[1]);
+ sign[2] = _mm256_cmpgt_epi32(kZero,u[2]);
+ sign[3] = _mm256_cmpgt_epi32(kZero,u[3]);
+ sign[4] = _mm256_cmpgt_epi32(kZero,u[4]);
+ sign[5] = _mm256_cmpgt_epi32(kZero,u[5]);
+ sign[6] = _mm256_cmpgt_epi32(kZero,u[6]);
+ sign[7] = _mm256_cmpgt_epi32(kZero,u[7]);
+
+ u[0] = _mm256_sub_epi32(u[0], sign[0]);
+ u[1] = _mm256_sub_epi32(u[1], sign[1]);
+ u[2] = _mm256_sub_epi32(u[2], sign[2]);
+ u[3] = _mm256_sub_epi32(u[3], sign[3]);
+ u[4] = _mm256_sub_epi32(u[4], sign[4]);
+ u[5] = _mm256_sub_epi32(u[5], sign[5]);
+ u[6] = _mm256_sub_epi32(u[6], sign[6]);
+ u[7] = _mm256_sub_epi32(u[7], sign[7]);
+
+ u[0] = _mm256_add_epi32(u[0], K32One);
+ u[1] = _mm256_add_epi32(u[1], K32One);
+ u[2] = _mm256_add_epi32(u[2], K32One);
+ u[3] = _mm256_add_epi32(u[3], K32One);
+ u[4] = _mm256_add_epi32(u[4], K32One);
+ u[5] = _mm256_add_epi32(u[5], K32One);
+ u[6] = _mm256_add_epi32(u[6], K32One);
+ u[7] = _mm256_add_epi32(u[7], K32One);
+
+ u[0] = _mm256_srai_epi32(u[0], 2);
+ u[1] = _mm256_srai_epi32(u[1], 2);
+ u[2] = _mm256_srai_epi32(u[2], 2);
+ u[3] = _mm256_srai_epi32(u[3], 2);
+ u[4] = _mm256_srai_epi32(u[4], 2);
+ u[5] = _mm256_srai_epi32(u[5], 2);
+ u[6] = _mm256_srai_epi32(u[6], 2);
+ u[7] = _mm256_srai_epi32(u[7], 2);
+
+ // Combine
+ out[ 0] = _mm256_packs_epi32(u[0], u[1]);
+ out[16] = _mm256_packs_epi32(u[2], u[3]);
+ out[ 8] = _mm256_packs_epi32(u[4], u[5]);
+ out[24] = _mm256_packs_epi32(u[6], u[7]);
+ }
+ {
+ const __m256i k32_m08_p24 = pair256_set_epi32(-cospi_8_64, cospi_24_64);
+ const __m256i k32_m24_m08 = pair256_set_epi32(-cospi_24_64, -cospi_8_64);
+ const __m256i k32_p24_p08 = pair256_set_epi32(cospi_24_64, cospi_8_64);
+
+ u[0] = _mm256_unpacklo_epi32(lstep1[18], lstep1[28]);
+ u[1] = _mm256_unpackhi_epi32(lstep1[18], lstep1[28]);
+ u[2] = _mm256_unpacklo_epi32(lstep1[19], lstep1[29]);
+ u[3] = _mm256_unpackhi_epi32(lstep1[19], lstep1[29]);
+ u[4] = _mm256_unpacklo_epi32(lstep1[20], lstep1[26]);
+ u[5] = _mm256_unpackhi_epi32(lstep1[20], lstep1[26]);
+ u[6] = _mm256_unpacklo_epi32(lstep1[21], lstep1[27]);
+ u[7] = _mm256_unpackhi_epi32(lstep1[21], lstep1[27]);
+
+ v[0] = k_madd_epi32_avx2(u[0], k32_m08_p24);
+ v[1] = k_madd_epi32_avx2(u[1], k32_m08_p24);
+ v[2] = k_madd_epi32_avx2(u[2], k32_m08_p24);
+ v[3] = k_madd_epi32_avx2(u[3], k32_m08_p24);
+ v[4] = k_madd_epi32_avx2(u[4], k32_m24_m08);
+ v[5] = k_madd_epi32_avx2(u[5], k32_m24_m08);
+ v[6] = k_madd_epi32_avx2(u[6], k32_m24_m08);
+ v[7] = k_madd_epi32_avx2(u[7], k32_m24_m08);
+ v[ 8] = k_madd_epi32_avx2(u[4], k32_m08_p24);
+ v[ 9] = k_madd_epi32_avx2(u[5], k32_m08_p24);
+ v[10] = k_madd_epi32_avx2(u[6], k32_m08_p24);
+ v[11] = k_madd_epi32_avx2(u[7], k32_m08_p24);
+ v[12] = k_madd_epi32_avx2(u[0], k32_p24_p08);
+ v[13] = k_madd_epi32_avx2(u[1], k32_p24_p08);
+ v[14] = k_madd_epi32_avx2(u[2], k32_p24_p08);
+ v[15] = k_madd_epi32_avx2(u[3], k32_p24_p08);
+
+ u[0] = k_packs_epi64_avx2(v[0], v[1]);
+ u[1] = k_packs_epi64_avx2(v[2], v[3]);
+ u[2] = k_packs_epi64_avx2(v[4], v[5]);
+ u[3] = k_packs_epi64_avx2(v[6], v[7]);
+ u[4] = k_packs_epi64_avx2(v[8], v[9]);
+ u[5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[7] = k_packs_epi64_avx2(v[14], v[15]);
+
+ u[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm256_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm256_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm256_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm256_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+
+ lstep2[18] = _mm256_srai_epi32(u[0], DCT_CONST_BITS);
+ lstep2[19] = _mm256_srai_epi32(u[1], DCT_CONST_BITS);
+ lstep2[20] = _mm256_srai_epi32(u[2], DCT_CONST_BITS);
+ lstep2[21] = _mm256_srai_epi32(u[3], DCT_CONST_BITS);
+ lstep2[26] = _mm256_srai_epi32(u[4], DCT_CONST_BITS);
+ lstep2[27] = _mm256_srai_epi32(u[5], DCT_CONST_BITS);
+ lstep2[28] = _mm256_srai_epi32(u[6], DCT_CONST_BITS);
+ lstep2[29] = _mm256_srai_epi32(u[7], DCT_CONST_BITS);
+ }
+ {
+ lstep2[32] = _mm256_add_epi32(lstep1[38], lstep3[32]);
+ lstep2[33] = _mm256_add_epi32(lstep1[39], lstep3[33]);
+ lstep2[34] = _mm256_add_epi32(lstep1[36], lstep3[34]);
+ lstep2[35] = _mm256_add_epi32(lstep1[37], lstep3[35]);
+ lstep2[36] = _mm256_sub_epi32(lstep3[34], lstep1[36]);
+ lstep2[37] = _mm256_sub_epi32(lstep3[35], lstep1[37]);
+ lstep2[38] = _mm256_sub_epi32(lstep3[32], lstep1[38]);
+ lstep2[39] = _mm256_sub_epi32(lstep3[33], lstep1[39]);
+ lstep2[40] = _mm256_sub_epi32(lstep3[46], lstep1[40]);
+ lstep2[41] = _mm256_sub_epi32(lstep3[47], lstep1[41]);
+ lstep2[42] = _mm256_sub_epi32(lstep3[44], lstep1[42]);
+ lstep2[43] = _mm256_sub_epi32(lstep3[45], lstep1[43]);
+ lstep2[44] = _mm256_add_epi32(lstep1[42], lstep3[44]);
+ lstep2[45] = _mm256_add_epi32(lstep1[43], lstep3[45]);
+ lstep2[46] = _mm256_add_epi32(lstep1[40], lstep3[46]);
+ lstep2[47] = _mm256_add_epi32(lstep1[41], lstep3[47]);
+ lstep2[48] = _mm256_add_epi32(lstep1[54], lstep3[48]);
+ lstep2[49] = _mm256_add_epi32(lstep1[55], lstep3[49]);
+ lstep2[50] = _mm256_add_epi32(lstep1[52], lstep3[50]);
+ lstep2[51] = _mm256_add_epi32(lstep1[53], lstep3[51]);
+ lstep2[52] = _mm256_sub_epi32(lstep3[50], lstep1[52]);
+ lstep2[53] = _mm256_sub_epi32(lstep3[51], lstep1[53]);
+ lstep2[54] = _mm256_sub_epi32(lstep3[48], lstep1[54]);
+ lstep2[55] = _mm256_sub_epi32(lstep3[49], lstep1[55]);
+ lstep2[56] = _mm256_sub_epi32(lstep3[62], lstep1[56]);
+ lstep2[57] = _mm256_sub_epi32(lstep3[63], lstep1[57]);
+ lstep2[58] = _mm256_sub_epi32(lstep3[60], lstep1[58]);
+ lstep2[59] = _mm256_sub_epi32(lstep3[61], lstep1[59]);
+ lstep2[60] = _mm256_add_epi32(lstep1[58], lstep3[60]);
+ lstep2[61] = _mm256_add_epi32(lstep1[59], lstep3[61]);
+ lstep2[62] = _mm256_add_epi32(lstep1[56], lstep3[62]);
+ lstep2[63] = _mm256_add_epi32(lstep1[57], lstep3[63]);
+ }
+ // stage 6
+ {
+ const __m256i k32_p28_p04 = pair256_set_epi32(cospi_28_64, cospi_4_64);
+ const __m256i k32_p12_p20 = pair256_set_epi32(cospi_12_64, cospi_20_64);
+ const __m256i k32_m20_p12 = pair256_set_epi32(-cospi_20_64, cospi_12_64);
+ const __m256i k32_m04_p28 = pair256_set_epi32(-cospi_4_64, cospi_28_64);
+
+ u[0] = _mm256_unpacklo_epi32(lstep2[ 8], lstep2[14]);
+ u[1] = _mm256_unpackhi_epi32(lstep2[ 8], lstep2[14]);
+ u[2] = _mm256_unpacklo_epi32(lstep2[ 9], lstep2[15]);
+ u[3] = _mm256_unpackhi_epi32(lstep2[ 9], lstep2[15]);
+ u[4] = _mm256_unpacklo_epi32(lstep2[10], lstep2[12]);
+ u[5] = _mm256_unpackhi_epi32(lstep2[10], lstep2[12]);
+ u[6] = _mm256_unpacklo_epi32(lstep2[11], lstep2[13]);
+ u[7] = _mm256_unpackhi_epi32(lstep2[11], lstep2[13]);
+ u[8] = _mm256_unpacklo_epi32(lstep2[10], lstep2[12]);
+ u[9] = _mm256_unpackhi_epi32(lstep2[10], lstep2[12]);
+ u[10] = _mm256_unpacklo_epi32(lstep2[11], lstep2[13]);
+ u[11] = _mm256_unpackhi_epi32(lstep2[11], lstep2[13]);
+ u[12] = _mm256_unpacklo_epi32(lstep2[ 8], lstep2[14]);
+ u[13] = _mm256_unpackhi_epi32(lstep2[ 8], lstep2[14]);
+ u[14] = _mm256_unpacklo_epi32(lstep2[ 9], lstep2[15]);
+ u[15] = _mm256_unpackhi_epi32(lstep2[ 9], lstep2[15]);
+
+ v[0] = k_madd_epi32_avx2(u[0], k32_p28_p04);
+ v[1] = k_madd_epi32_avx2(u[1], k32_p28_p04);
+ v[2] = k_madd_epi32_avx2(u[2], k32_p28_p04);
+ v[3] = k_madd_epi32_avx2(u[3], k32_p28_p04);
+ v[4] = k_madd_epi32_avx2(u[4], k32_p12_p20);
+ v[5] = k_madd_epi32_avx2(u[5], k32_p12_p20);
+ v[6] = k_madd_epi32_avx2(u[6], k32_p12_p20);
+ v[7] = k_madd_epi32_avx2(u[7], k32_p12_p20);
+ v[ 8] = k_madd_epi32_avx2(u[ 8], k32_m20_p12);
+ v[ 9] = k_madd_epi32_avx2(u[ 9], k32_m20_p12);
+ v[10] = k_madd_epi32_avx2(u[10], k32_m20_p12);
+ v[11] = k_madd_epi32_avx2(u[11], k32_m20_p12);
+ v[12] = k_madd_epi32_avx2(u[12], k32_m04_p28);
+ v[13] = k_madd_epi32_avx2(u[13], k32_m04_p28);
+ v[14] = k_madd_epi32_avx2(u[14], k32_m04_p28);
+ v[15] = k_madd_epi32_avx2(u[15], k32_m04_p28);
+
+ u[0] = k_packs_epi64_avx2(v[0], v[1]);
+ u[1] = k_packs_epi64_avx2(v[2], v[3]);
+ u[2] = k_packs_epi64_avx2(v[4], v[5]);
+ u[3] = k_packs_epi64_avx2(v[6], v[7]);
+ u[4] = k_packs_epi64_avx2(v[8], v[9]);
+ u[5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[7] = k_packs_epi64_avx2(v[14], v[15]);
+
+ v[0] = _mm256_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm256_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm256_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm256_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ v[4] = _mm256_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ v[5] = _mm256_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ v[6] = _mm256_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ v[7] = _mm256_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+
+ u[0] = _mm256_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm256_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm256_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm256_srai_epi32(v[3], DCT_CONST_BITS);
+ u[4] = _mm256_srai_epi32(v[4], DCT_CONST_BITS);
+ u[5] = _mm256_srai_epi32(v[5], DCT_CONST_BITS);
+ u[6] = _mm256_srai_epi32(v[6], DCT_CONST_BITS);
+ u[7] = _mm256_srai_epi32(v[7], DCT_CONST_BITS);
+
+ sign[0] = _mm256_cmpgt_epi32(kZero,u[0]);
+ sign[1] = _mm256_cmpgt_epi32(kZero,u[1]);
+ sign[2] = _mm256_cmpgt_epi32(kZero,u[2]);
+ sign[3] = _mm256_cmpgt_epi32(kZero,u[3]);
+ sign[4] = _mm256_cmpgt_epi32(kZero,u[4]);
+ sign[5] = _mm256_cmpgt_epi32(kZero,u[5]);
+ sign[6] = _mm256_cmpgt_epi32(kZero,u[6]);
+ sign[7] = _mm256_cmpgt_epi32(kZero,u[7]);
+
+ u[0] = _mm256_sub_epi32(u[0], sign[0]);
+ u[1] = _mm256_sub_epi32(u[1], sign[1]);
+ u[2] = _mm256_sub_epi32(u[2], sign[2]);
+ u[3] = _mm256_sub_epi32(u[3], sign[3]);
+ u[4] = _mm256_sub_epi32(u[4], sign[4]);
+ u[5] = _mm256_sub_epi32(u[5], sign[5]);
+ u[6] = _mm256_sub_epi32(u[6], sign[6]);
+ u[7] = _mm256_sub_epi32(u[7], sign[7]);
+
+ u[0] = _mm256_add_epi32(u[0], K32One);
+ u[1] = _mm256_add_epi32(u[1], K32One);
+ u[2] = _mm256_add_epi32(u[2], K32One);
+ u[3] = _mm256_add_epi32(u[3], K32One);
+ u[4] = _mm256_add_epi32(u[4], K32One);
+ u[5] = _mm256_add_epi32(u[5], K32One);
+ u[6] = _mm256_add_epi32(u[6], K32One);
+ u[7] = _mm256_add_epi32(u[7], K32One);
+
+ u[0] = _mm256_srai_epi32(u[0], 2);
+ u[1] = _mm256_srai_epi32(u[1], 2);
+ u[2] = _mm256_srai_epi32(u[2], 2);
+ u[3] = _mm256_srai_epi32(u[3], 2);
+ u[4] = _mm256_srai_epi32(u[4], 2);
+ u[5] = _mm256_srai_epi32(u[5], 2);
+ u[6] = _mm256_srai_epi32(u[6], 2);
+ u[7] = _mm256_srai_epi32(u[7], 2);
+
+ out[ 4] = _mm256_packs_epi32(u[0], u[1]);
+ out[20] = _mm256_packs_epi32(u[2], u[3]);
+ out[12] = _mm256_packs_epi32(u[4], u[5]);
+ out[28] = _mm256_packs_epi32(u[6], u[7]);
+ }
+ {
+ lstep3[16] = _mm256_add_epi32(lstep2[18], lstep1[16]);
+ lstep3[17] = _mm256_add_epi32(lstep2[19], lstep1[17]);
+ lstep3[18] = _mm256_sub_epi32(lstep1[16], lstep2[18]);
+ lstep3[19] = _mm256_sub_epi32(lstep1[17], lstep2[19]);
+ lstep3[20] = _mm256_sub_epi32(lstep1[22], lstep2[20]);
+ lstep3[21] = _mm256_sub_epi32(lstep1[23], lstep2[21]);
+ lstep3[22] = _mm256_add_epi32(lstep2[20], lstep1[22]);
+ lstep3[23] = _mm256_add_epi32(lstep2[21], lstep1[23]);
+ lstep3[24] = _mm256_add_epi32(lstep2[26], lstep1[24]);
+ lstep3[25] = _mm256_add_epi32(lstep2[27], lstep1[25]);
+ lstep3[26] = _mm256_sub_epi32(lstep1[24], lstep2[26]);
+ lstep3[27] = _mm256_sub_epi32(lstep1[25], lstep2[27]);
+ lstep3[28] = _mm256_sub_epi32(lstep1[30], lstep2[28]);
+ lstep3[29] = _mm256_sub_epi32(lstep1[31], lstep2[29]);
+ lstep3[30] = _mm256_add_epi32(lstep2[28], lstep1[30]);
+ lstep3[31] = _mm256_add_epi32(lstep2[29], lstep1[31]);
+ }
+ {
+ const __m256i k32_m04_p28 = pair256_set_epi32(-cospi_4_64, cospi_28_64);
+ const __m256i k32_m28_m04 = pair256_set_epi32(-cospi_28_64, -cospi_4_64);
+ const __m256i k32_m20_p12 = pair256_set_epi32(-cospi_20_64, cospi_12_64);
+ const __m256i k32_m12_m20 = pair256_set_epi32(-cospi_12_64,
+ -cospi_20_64);
+ const __m256i k32_p12_p20 = pair256_set_epi32(cospi_12_64, cospi_20_64);
+ const __m256i k32_p28_p04 = pair256_set_epi32(cospi_28_64, cospi_4_64);
+
+ u[ 0] = _mm256_unpacklo_epi32(lstep2[34], lstep2[60]);
+ u[ 1] = _mm256_unpackhi_epi32(lstep2[34], lstep2[60]);
+ u[ 2] = _mm256_unpacklo_epi32(lstep2[35], lstep2[61]);
+ u[ 3] = _mm256_unpackhi_epi32(lstep2[35], lstep2[61]);
+ u[ 4] = _mm256_unpacklo_epi32(lstep2[36], lstep2[58]);
+ u[ 5] = _mm256_unpackhi_epi32(lstep2[36], lstep2[58]);
+ u[ 6] = _mm256_unpacklo_epi32(lstep2[37], lstep2[59]);
+ u[ 7] = _mm256_unpackhi_epi32(lstep2[37], lstep2[59]);
+ u[ 8] = _mm256_unpacklo_epi32(lstep2[42], lstep2[52]);
+ u[ 9] = _mm256_unpackhi_epi32(lstep2[42], lstep2[52]);
+ u[10] = _mm256_unpacklo_epi32(lstep2[43], lstep2[53]);
+ u[11] = _mm256_unpackhi_epi32(lstep2[43], lstep2[53]);
+ u[12] = _mm256_unpacklo_epi32(lstep2[44], lstep2[50]);
+ u[13] = _mm256_unpackhi_epi32(lstep2[44], lstep2[50]);
+ u[14] = _mm256_unpacklo_epi32(lstep2[45], lstep2[51]);
+ u[15] = _mm256_unpackhi_epi32(lstep2[45], lstep2[51]);
+
+ v[ 0] = k_madd_epi32_avx2(u[ 0], k32_m04_p28);
+ v[ 1] = k_madd_epi32_avx2(u[ 1], k32_m04_p28);
+ v[ 2] = k_madd_epi32_avx2(u[ 2], k32_m04_p28);
+ v[ 3] = k_madd_epi32_avx2(u[ 3], k32_m04_p28);
+ v[ 4] = k_madd_epi32_avx2(u[ 4], k32_m28_m04);
+ v[ 5] = k_madd_epi32_avx2(u[ 5], k32_m28_m04);
+ v[ 6] = k_madd_epi32_avx2(u[ 6], k32_m28_m04);
+ v[ 7] = k_madd_epi32_avx2(u[ 7], k32_m28_m04);
+ v[ 8] = k_madd_epi32_avx2(u[ 8], k32_m20_p12);
+ v[ 9] = k_madd_epi32_avx2(u[ 9], k32_m20_p12);
+ v[10] = k_madd_epi32_avx2(u[10], k32_m20_p12);
+ v[11] = k_madd_epi32_avx2(u[11], k32_m20_p12);
+ v[12] = k_madd_epi32_avx2(u[12], k32_m12_m20);
+ v[13] = k_madd_epi32_avx2(u[13], k32_m12_m20);
+ v[14] = k_madd_epi32_avx2(u[14], k32_m12_m20);
+ v[15] = k_madd_epi32_avx2(u[15], k32_m12_m20);
+ v[16] = k_madd_epi32_avx2(u[12], k32_m20_p12);
+ v[17] = k_madd_epi32_avx2(u[13], k32_m20_p12);
+ v[18] = k_madd_epi32_avx2(u[14], k32_m20_p12);
+ v[19] = k_madd_epi32_avx2(u[15], k32_m20_p12);
+ v[20] = k_madd_epi32_avx2(u[ 8], k32_p12_p20);
+ v[21] = k_madd_epi32_avx2(u[ 9], k32_p12_p20);
+ v[22] = k_madd_epi32_avx2(u[10], k32_p12_p20);
+ v[23] = k_madd_epi32_avx2(u[11], k32_p12_p20);
+ v[24] = k_madd_epi32_avx2(u[ 4], k32_m04_p28);
+ v[25] = k_madd_epi32_avx2(u[ 5], k32_m04_p28);
+ v[26] = k_madd_epi32_avx2(u[ 6], k32_m04_p28);
+ v[27] = k_madd_epi32_avx2(u[ 7], k32_m04_p28);
+ v[28] = k_madd_epi32_avx2(u[ 0], k32_p28_p04);
+ v[29] = k_madd_epi32_avx2(u[ 1], k32_p28_p04);
+ v[30] = k_madd_epi32_avx2(u[ 2], k32_p28_p04);
+ v[31] = k_madd_epi32_avx2(u[ 3], k32_p28_p04);
+
+ u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]);
+ u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]);
+ u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]);
+ u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]);
+ u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]);
+ u[ 5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[ 6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[ 7] = k_packs_epi64_avx2(v[14], v[15]);
+ u[ 8] = k_packs_epi64_avx2(v[16], v[17]);
+ u[ 9] = k_packs_epi64_avx2(v[18], v[19]);
+ u[10] = k_packs_epi64_avx2(v[20], v[21]);
+ u[11] = k_packs_epi64_avx2(v[22], v[23]);
+ u[12] = k_packs_epi64_avx2(v[24], v[25]);
+ u[13] = k_packs_epi64_avx2(v[26], v[27]);
+ u[14] = k_packs_epi64_avx2(v[28], v[29]);
+ u[15] = k_packs_epi64_avx2(v[30], v[31]);
+
+ v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING);
+ v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING);
+ v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING);
+ v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING);
+ v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING);
+ v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING);
+ v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING);
+ v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING);
+ v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING);
+ v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ lstep3[34] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS);
+ lstep3[35] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS);
+ lstep3[36] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS);
+ lstep3[37] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS);
+ lstep3[42] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS);
+ lstep3[43] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS);
+ lstep3[44] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS);
+ lstep3[45] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS);
+ lstep3[50] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS);
+ lstep3[51] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS);
+ lstep3[52] = _mm256_srai_epi32(v[10], DCT_CONST_BITS);
+ lstep3[53] = _mm256_srai_epi32(v[11], DCT_CONST_BITS);
+ lstep3[58] = _mm256_srai_epi32(v[12], DCT_CONST_BITS);
+ lstep3[59] = _mm256_srai_epi32(v[13], DCT_CONST_BITS);
+ lstep3[60] = _mm256_srai_epi32(v[14], DCT_CONST_BITS);
+ lstep3[61] = _mm256_srai_epi32(v[15], DCT_CONST_BITS);
+ }
+ // stage 7
+ {
+ const __m256i k32_p30_p02 = pair256_set_epi32(cospi_30_64, cospi_2_64);
+ const __m256i k32_p14_p18 = pair256_set_epi32(cospi_14_64, cospi_18_64);
+ const __m256i k32_p22_p10 = pair256_set_epi32(cospi_22_64, cospi_10_64);
+ const __m256i k32_p06_p26 = pair256_set_epi32(cospi_6_64, cospi_26_64);
+ const __m256i k32_m26_p06 = pair256_set_epi32(-cospi_26_64, cospi_6_64);
+ const __m256i k32_m10_p22 = pair256_set_epi32(-cospi_10_64, cospi_22_64);
+ const __m256i k32_m18_p14 = pair256_set_epi32(-cospi_18_64, cospi_14_64);
+ const __m256i k32_m02_p30 = pair256_set_epi32(-cospi_2_64, cospi_30_64);
+
+ u[ 0] = _mm256_unpacklo_epi32(lstep3[16], lstep3[30]);
+ u[ 1] = _mm256_unpackhi_epi32(lstep3[16], lstep3[30]);
+ u[ 2] = _mm256_unpacklo_epi32(lstep3[17], lstep3[31]);
+ u[ 3] = _mm256_unpackhi_epi32(lstep3[17], lstep3[31]);
+ u[ 4] = _mm256_unpacklo_epi32(lstep3[18], lstep3[28]);
+ u[ 5] = _mm256_unpackhi_epi32(lstep3[18], lstep3[28]);
+ u[ 6] = _mm256_unpacklo_epi32(lstep3[19], lstep3[29]);
+ u[ 7] = _mm256_unpackhi_epi32(lstep3[19], lstep3[29]);
+ u[ 8] = _mm256_unpacklo_epi32(lstep3[20], lstep3[26]);
+ u[ 9] = _mm256_unpackhi_epi32(lstep3[20], lstep3[26]);
+ u[10] = _mm256_unpacklo_epi32(lstep3[21], lstep3[27]);
+ u[11] = _mm256_unpackhi_epi32(lstep3[21], lstep3[27]);
+ u[12] = _mm256_unpacklo_epi32(lstep3[22], lstep3[24]);
+ u[13] = _mm256_unpackhi_epi32(lstep3[22], lstep3[24]);
+ u[14] = _mm256_unpacklo_epi32(lstep3[23], lstep3[25]);
+ u[15] = _mm256_unpackhi_epi32(lstep3[23], lstep3[25]);
+
+ v[ 0] = k_madd_epi32_avx2(u[ 0], k32_p30_p02);
+ v[ 1] = k_madd_epi32_avx2(u[ 1], k32_p30_p02);
+ v[ 2] = k_madd_epi32_avx2(u[ 2], k32_p30_p02);
+ v[ 3] = k_madd_epi32_avx2(u[ 3], k32_p30_p02);
+ v[ 4] = k_madd_epi32_avx2(u[ 4], k32_p14_p18);
+ v[ 5] = k_madd_epi32_avx2(u[ 5], k32_p14_p18);
+ v[ 6] = k_madd_epi32_avx2(u[ 6], k32_p14_p18);
+ v[ 7] = k_madd_epi32_avx2(u[ 7], k32_p14_p18);
+ v[ 8] = k_madd_epi32_avx2(u[ 8], k32_p22_p10);
+ v[ 9] = k_madd_epi32_avx2(u[ 9], k32_p22_p10);
+ v[10] = k_madd_epi32_avx2(u[10], k32_p22_p10);
+ v[11] = k_madd_epi32_avx2(u[11], k32_p22_p10);
+ v[12] = k_madd_epi32_avx2(u[12], k32_p06_p26);
+ v[13] = k_madd_epi32_avx2(u[13], k32_p06_p26);
+ v[14] = k_madd_epi32_avx2(u[14], k32_p06_p26);
+ v[15] = k_madd_epi32_avx2(u[15], k32_p06_p26);
+ v[16] = k_madd_epi32_avx2(u[12], k32_m26_p06);
+ v[17] = k_madd_epi32_avx2(u[13], k32_m26_p06);
+ v[18] = k_madd_epi32_avx2(u[14], k32_m26_p06);
+ v[19] = k_madd_epi32_avx2(u[15], k32_m26_p06);
+ v[20] = k_madd_epi32_avx2(u[ 8], k32_m10_p22);
+ v[21] = k_madd_epi32_avx2(u[ 9], k32_m10_p22);
+ v[22] = k_madd_epi32_avx2(u[10], k32_m10_p22);
+ v[23] = k_madd_epi32_avx2(u[11], k32_m10_p22);
+ v[24] = k_madd_epi32_avx2(u[ 4], k32_m18_p14);
+ v[25] = k_madd_epi32_avx2(u[ 5], k32_m18_p14);
+ v[26] = k_madd_epi32_avx2(u[ 6], k32_m18_p14);
+ v[27] = k_madd_epi32_avx2(u[ 7], k32_m18_p14);
+ v[28] = k_madd_epi32_avx2(u[ 0], k32_m02_p30);
+ v[29] = k_madd_epi32_avx2(u[ 1], k32_m02_p30);
+ v[30] = k_madd_epi32_avx2(u[ 2], k32_m02_p30);
+ v[31] = k_madd_epi32_avx2(u[ 3], k32_m02_p30);
+
+ u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]);
+ u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]);
+ u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]);
+ u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]);
+ u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]);
+ u[ 5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[ 6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[ 7] = k_packs_epi64_avx2(v[14], v[15]);
+ u[ 8] = k_packs_epi64_avx2(v[16], v[17]);
+ u[ 9] = k_packs_epi64_avx2(v[18], v[19]);
+ u[10] = k_packs_epi64_avx2(v[20], v[21]);
+ u[11] = k_packs_epi64_avx2(v[22], v[23]);
+ u[12] = k_packs_epi64_avx2(v[24], v[25]);
+ u[13] = k_packs_epi64_avx2(v[26], v[27]);
+ u[14] = k_packs_epi64_avx2(v[28], v[29]);
+ u[15] = k_packs_epi64_avx2(v[30], v[31]);
+
+ v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING);
+ v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING);
+ v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING);
+ v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING);
+ v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING);
+ v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING);
+ v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING);
+ v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING);
+ v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING);
+ v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ u[ 0] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS);
+ u[ 1] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS);
+ u[ 2] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS);
+ u[ 3] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS);
+ u[ 4] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS);
+ u[ 5] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS);
+ u[ 6] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS);
+ u[ 7] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS);
+ u[ 8] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS);
+ u[ 9] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS);
+ u[10] = _mm256_srai_epi32(v[10], DCT_CONST_BITS);
+ u[11] = _mm256_srai_epi32(v[11], DCT_CONST_BITS);
+ u[12] = _mm256_srai_epi32(v[12], DCT_CONST_BITS);
+ u[13] = _mm256_srai_epi32(v[13], DCT_CONST_BITS);
+ u[14] = _mm256_srai_epi32(v[14], DCT_CONST_BITS);
+ u[15] = _mm256_srai_epi32(v[15], DCT_CONST_BITS);
+
+ v[ 0] = _mm256_cmpgt_epi32(kZero,u[ 0]);
+ v[ 1] = _mm256_cmpgt_epi32(kZero,u[ 1]);
+ v[ 2] = _mm256_cmpgt_epi32(kZero,u[ 2]);
+ v[ 3] = _mm256_cmpgt_epi32(kZero,u[ 3]);
+ v[ 4] = _mm256_cmpgt_epi32(kZero,u[ 4]);
+ v[ 5] = _mm256_cmpgt_epi32(kZero,u[ 5]);
+ v[ 6] = _mm256_cmpgt_epi32(kZero,u[ 6]);
+ v[ 7] = _mm256_cmpgt_epi32(kZero,u[ 7]);
+ v[ 8] = _mm256_cmpgt_epi32(kZero,u[ 8]);
+ v[ 9] = _mm256_cmpgt_epi32(kZero,u[ 9]);
+ v[10] = _mm256_cmpgt_epi32(kZero,u[10]);
+ v[11] = _mm256_cmpgt_epi32(kZero,u[11]);
+ v[12] = _mm256_cmpgt_epi32(kZero,u[12]);
+ v[13] = _mm256_cmpgt_epi32(kZero,u[13]);
+ v[14] = _mm256_cmpgt_epi32(kZero,u[14]);
+ v[15] = _mm256_cmpgt_epi32(kZero,u[15]);
+
+ u[ 0] = _mm256_sub_epi32(u[ 0], v[ 0]);
+ u[ 1] = _mm256_sub_epi32(u[ 1], v[ 1]);
+ u[ 2] = _mm256_sub_epi32(u[ 2], v[ 2]);
+ u[ 3] = _mm256_sub_epi32(u[ 3], v[ 3]);
+ u[ 4] = _mm256_sub_epi32(u[ 4], v[ 4]);
+ u[ 5] = _mm256_sub_epi32(u[ 5], v[ 5]);
+ u[ 6] = _mm256_sub_epi32(u[ 6], v[ 6]);
+ u[ 7] = _mm256_sub_epi32(u[ 7], v[ 7]);
+ u[ 8] = _mm256_sub_epi32(u[ 8], v[ 8]);
+ u[ 9] = _mm256_sub_epi32(u[ 9], v[ 9]);
+ u[10] = _mm256_sub_epi32(u[10], v[10]);
+ u[11] = _mm256_sub_epi32(u[11], v[11]);
+ u[12] = _mm256_sub_epi32(u[12], v[12]);
+ u[13] = _mm256_sub_epi32(u[13], v[13]);
+ u[14] = _mm256_sub_epi32(u[14], v[14]);
+ u[15] = _mm256_sub_epi32(u[15], v[15]);
+
+ v[ 0] = _mm256_add_epi32(u[ 0], K32One);
+ v[ 1] = _mm256_add_epi32(u[ 1], K32One);
+ v[ 2] = _mm256_add_epi32(u[ 2], K32One);
+ v[ 3] = _mm256_add_epi32(u[ 3], K32One);
+ v[ 4] = _mm256_add_epi32(u[ 4], K32One);
+ v[ 5] = _mm256_add_epi32(u[ 5], K32One);
+ v[ 6] = _mm256_add_epi32(u[ 6], K32One);
+ v[ 7] = _mm256_add_epi32(u[ 7], K32One);
+ v[ 8] = _mm256_add_epi32(u[ 8], K32One);
+ v[ 9] = _mm256_add_epi32(u[ 9], K32One);
+ v[10] = _mm256_add_epi32(u[10], K32One);
+ v[11] = _mm256_add_epi32(u[11], K32One);
+ v[12] = _mm256_add_epi32(u[12], K32One);
+ v[13] = _mm256_add_epi32(u[13], K32One);
+ v[14] = _mm256_add_epi32(u[14], K32One);
+ v[15] = _mm256_add_epi32(u[15], K32One);
+
+ u[ 0] = _mm256_srai_epi32(v[ 0], 2);
+ u[ 1] = _mm256_srai_epi32(v[ 1], 2);
+ u[ 2] = _mm256_srai_epi32(v[ 2], 2);
+ u[ 3] = _mm256_srai_epi32(v[ 3], 2);
+ u[ 4] = _mm256_srai_epi32(v[ 4], 2);
+ u[ 5] = _mm256_srai_epi32(v[ 5], 2);
+ u[ 6] = _mm256_srai_epi32(v[ 6], 2);
+ u[ 7] = _mm256_srai_epi32(v[ 7], 2);
+ u[ 8] = _mm256_srai_epi32(v[ 8], 2);
+ u[ 9] = _mm256_srai_epi32(v[ 9], 2);
+ u[10] = _mm256_srai_epi32(v[10], 2);
+ u[11] = _mm256_srai_epi32(v[11], 2);
+ u[12] = _mm256_srai_epi32(v[12], 2);
+ u[13] = _mm256_srai_epi32(v[13], 2);
+ u[14] = _mm256_srai_epi32(v[14], 2);
+ u[15] = _mm256_srai_epi32(v[15], 2);
+
+ out[ 2] = _mm256_packs_epi32(u[0], u[1]);
+ out[18] = _mm256_packs_epi32(u[2], u[3]);
+ out[10] = _mm256_packs_epi32(u[4], u[5]);
+ out[26] = _mm256_packs_epi32(u[6], u[7]);
+ out[ 6] = _mm256_packs_epi32(u[8], u[9]);
+ out[22] = _mm256_packs_epi32(u[10], u[11]);
+ out[14] = _mm256_packs_epi32(u[12], u[13]);
+ out[30] = _mm256_packs_epi32(u[14], u[15]);
+ }
+ {
+ lstep1[32] = _mm256_add_epi32(lstep3[34], lstep2[32]);
+ lstep1[33] = _mm256_add_epi32(lstep3[35], lstep2[33]);
+ lstep1[34] = _mm256_sub_epi32(lstep2[32], lstep3[34]);
+ lstep1[35] = _mm256_sub_epi32(lstep2[33], lstep3[35]);
+ lstep1[36] = _mm256_sub_epi32(lstep2[38], lstep3[36]);
+ lstep1[37] = _mm256_sub_epi32(lstep2[39], lstep3[37]);
+ lstep1[38] = _mm256_add_epi32(lstep3[36], lstep2[38]);
+ lstep1[39] = _mm256_add_epi32(lstep3[37], lstep2[39]);
+ lstep1[40] = _mm256_add_epi32(lstep3[42], lstep2[40]);
+ lstep1[41] = _mm256_add_epi32(lstep3[43], lstep2[41]);
+ lstep1[42] = _mm256_sub_epi32(lstep2[40], lstep3[42]);
+ lstep1[43] = _mm256_sub_epi32(lstep2[41], lstep3[43]);
+ lstep1[44] = _mm256_sub_epi32(lstep2[46], lstep3[44]);
+ lstep1[45] = _mm256_sub_epi32(lstep2[47], lstep3[45]);
+ lstep1[46] = _mm256_add_epi32(lstep3[44], lstep2[46]);
+ lstep1[47] = _mm256_add_epi32(lstep3[45], lstep2[47]);
+ lstep1[48] = _mm256_add_epi32(lstep3[50], lstep2[48]);
+ lstep1[49] = _mm256_add_epi32(lstep3[51], lstep2[49]);
+ lstep1[50] = _mm256_sub_epi32(lstep2[48], lstep3[50]);
+ lstep1[51] = _mm256_sub_epi32(lstep2[49], lstep3[51]);
+ lstep1[52] = _mm256_sub_epi32(lstep2[54], lstep3[52]);
+ lstep1[53] = _mm256_sub_epi32(lstep2[55], lstep3[53]);
+ lstep1[54] = _mm256_add_epi32(lstep3[52], lstep2[54]);
+ lstep1[55] = _mm256_add_epi32(lstep3[53], lstep2[55]);
+ lstep1[56] = _mm256_add_epi32(lstep3[58], lstep2[56]);
+ lstep1[57] = _mm256_add_epi32(lstep3[59], lstep2[57]);
+ lstep1[58] = _mm256_sub_epi32(lstep2[56], lstep3[58]);
+ lstep1[59] = _mm256_sub_epi32(lstep2[57], lstep3[59]);
+ lstep1[60] = _mm256_sub_epi32(lstep2[62], lstep3[60]);
+ lstep1[61] = _mm256_sub_epi32(lstep2[63], lstep3[61]);
+ lstep1[62] = _mm256_add_epi32(lstep3[60], lstep2[62]);
+ lstep1[63] = _mm256_add_epi32(lstep3[61], lstep2[63]);
+ }
+ // stage 8
+ {
+ const __m256i k32_p31_p01 = pair256_set_epi32(cospi_31_64, cospi_1_64);
+ const __m256i k32_p15_p17 = pair256_set_epi32(cospi_15_64, cospi_17_64);
+ const __m256i k32_p23_p09 = pair256_set_epi32(cospi_23_64, cospi_9_64);
+ const __m256i k32_p07_p25 = pair256_set_epi32(cospi_7_64, cospi_25_64);
+ const __m256i k32_m25_p07 = pair256_set_epi32(-cospi_25_64, cospi_7_64);
+ const __m256i k32_m09_p23 = pair256_set_epi32(-cospi_9_64, cospi_23_64);
+ const __m256i k32_m17_p15 = pair256_set_epi32(-cospi_17_64, cospi_15_64);
+ const __m256i k32_m01_p31 = pair256_set_epi32(-cospi_1_64, cospi_31_64);
+
+ u[ 0] = _mm256_unpacklo_epi32(lstep1[32], lstep1[62]);
+ u[ 1] = _mm256_unpackhi_epi32(lstep1[32], lstep1[62]);
+ u[ 2] = _mm256_unpacklo_epi32(lstep1[33], lstep1[63]);
+ u[ 3] = _mm256_unpackhi_epi32(lstep1[33], lstep1[63]);
+ u[ 4] = _mm256_unpacklo_epi32(lstep1[34], lstep1[60]);
+ u[ 5] = _mm256_unpackhi_epi32(lstep1[34], lstep1[60]);
+ u[ 6] = _mm256_unpacklo_epi32(lstep1[35], lstep1[61]);
+ u[ 7] = _mm256_unpackhi_epi32(lstep1[35], lstep1[61]);
+ u[ 8] = _mm256_unpacklo_epi32(lstep1[36], lstep1[58]);
+ u[ 9] = _mm256_unpackhi_epi32(lstep1[36], lstep1[58]);
+ u[10] = _mm256_unpacklo_epi32(lstep1[37], lstep1[59]);
+ u[11] = _mm256_unpackhi_epi32(lstep1[37], lstep1[59]);
+ u[12] = _mm256_unpacklo_epi32(lstep1[38], lstep1[56]);
+ u[13] = _mm256_unpackhi_epi32(lstep1[38], lstep1[56]);
+ u[14] = _mm256_unpacklo_epi32(lstep1[39], lstep1[57]);
+ u[15] = _mm256_unpackhi_epi32(lstep1[39], lstep1[57]);
+
+ v[ 0] = k_madd_epi32_avx2(u[ 0], k32_p31_p01);
+ v[ 1] = k_madd_epi32_avx2(u[ 1], k32_p31_p01);
+ v[ 2] = k_madd_epi32_avx2(u[ 2], k32_p31_p01);
+ v[ 3] = k_madd_epi32_avx2(u[ 3], k32_p31_p01);
+ v[ 4] = k_madd_epi32_avx2(u[ 4], k32_p15_p17);
+ v[ 5] = k_madd_epi32_avx2(u[ 5], k32_p15_p17);
+ v[ 6] = k_madd_epi32_avx2(u[ 6], k32_p15_p17);
+ v[ 7] = k_madd_epi32_avx2(u[ 7], k32_p15_p17);
+ v[ 8] = k_madd_epi32_avx2(u[ 8], k32_p23_p09);
+ v[ 9] = k_madd_epi32_avx2(u[ 9], k32_p23_p09);
+ v[10] = k_madd_epi32_avx2(u[10], k32_p23_p09);
+ v[11] = k_madd_epi32_avx2(u[11], k32_p23_p09);
+ v[12] = k_madd_epi32_avx2(u[12], k32_p07_p25);
+ v[13] = k_madd_epi32_avx2(u[13], k32_p07_p25);
+ v[14] = k_madd_epi32_avx2(u[14], k32_p07_p25);
+ v[15] = k_madd_epi32_avx2(u[15], k32_p07_p25);
+ v[16] = k_madd_epi32_avx2(u[12], k32_m25_p07);
+ v[17] = k_madd_epi32_avx2(u[13], k32_m25_p07);
+ v[18] = k_madd_epi32_avx2(u[14], k32_m25_p07);
+ v[19] = k_madd_epi32_avx2(u[15], k32_m25_p07);
+ v[20] = k_madd_epi32_avx2(u[ 8], k32_m09_p23);
+ v[21] = k_madd_epi32_avx2(u[ 9], k32_m09_p23);
+ v[22] = k_madd_epi32_avx2(u[10], k32_m09_p23);
+ v[23] = k_madd_epi32_avx2(u[11], k32_m09_p23);
+ v[24] = k_madd_epi32_avx2(u[ 4], k32_m17_p15);
+ v[25] = k_madd_epi32_avx2(u[ 5], k32_m17_p15);
+ v[26] = k_madd_epi32_avx2(u[ 6], k32_m17_p15);
+ v[27] = k_madd_epi32_avx2(u[ 7], k32_m17_p15);
+ v[28] = k_madd_epi32_avx2(u[ 0], k32_m01_p31);
+ v[29] = k_madd_epi32_avx2(u[ 1], k32_m01_p31);
+ v[30] = k_madd_epi32_avx2(u[ 2], k32_m01_p31);
+ v[31] = k_madd_epi32_avx2(u[ 3], k32_m01_p31);
+
+ u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]);
+ u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]);
+ u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]);
+ u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]);
+ u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]);
+ u[ 5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[ 6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[ 7] = k_packs_epi64_avx2(v[14], v[15]);
+ u[ 8] = k_packs_epi64_avx2(v[16], v[17]);
+ u[ 9] = k_packs_epi64_avx2(v[18], v[19]);
+ u[10] = k_packs_epi64_avx2(v[20], v[21]);
+ u[11] = k_packs_epi64_avx2(v[22], v[23]);
+ u[12] = k_packs_epi64_avx2(v[24], v[25]);
+ u[13] = k_packs_epi64_avx2(v[26], v[27]);
+ u[14] = k_packs_epi64_avx2(v[28], v[29]);
+ u[15] = k_packs_epi64_avx2(v[30], v[31]);
+
+ v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING);
+ v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING);
+ v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING);
+ v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING);
+ v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING);
+ v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING);
+ v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING);
+ v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING);
+ v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING);
+ v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ u[ 0] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS);
+ u[ 1] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS);
+ u[ 2] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS);
+ u[ 3] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS);
+ u[ 4] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS);
+ u[ 5] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS);
+ u[ 6] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS);
+ u[ 7] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS);
+ u[ 8] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS);
+ u[ 9] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS);
+ u[10] = _mm256_srai_epi32(v[10], DCT_CONST_BITS);
+ u[11] = _mm256_srai_epi32(v[11], DCT_CONST_BITS);
+ u[12] = _mm256_srai_epi32(v[12], DCT_CONST_BITS);
+ u[13] = _mm256_srai_epi32(v[13], DCT_CONST_BITS);
+ u[14] = _mm256_srai_epi32(v[14], DCT_CONST_BITS);
+ u[15] = _mm256_srai_epi32(v[15], DCT_CONST_BITS);
+
+ v[ 0] = _mm256_cmpgt_epi32(kZero,u[ 0]);
+ v[ 1] = _mm256_cmpgt_epi32(kZero,u[ 1]);
+ v[ 2] = _mm256_cmpgt_epi32(kZero,u[ 2]);
+ v[ 3] = _mm256_cmpgt_epi32(kZero,u[ 3]);
+ v[ 4] = _mm256_cmpgt_epi32(kZero,u[ 4]);
+ v[ 5] = _mm256_cmpgt_epi32(kZero,u[ 5]);
+ v[ 6] = _mm256_cmpgt_epi32(kZero,u[ 6]);
+ v[ 7] = _mm256_cmpgt_epi32(kZero,u[ 7]);
+ v[ 8] = _mm256_cmpgt_epi32(kZero,u[ 8]);
+ v[ 9] = _mm256_cmpgt_epi32(kZero,u[ 9]);
+ v[10] = _mm256_cmpgt_epi32(kZero,u[10]);
+ v[11] = _mm256_cmpgt_epi32(kZero,u[11]);
+ v[12] = _mm256_cmpgt_epi32(kZero,u[12]);
+ v[13] = _mm256_cmpgt_epi32(kZero,u[13]);
+ v[14] = _mm256_cmpgt_epi32(kZero,u[14]);
+ v[15] = _mm256_cmpgt_epi32(kZero,u[15]);
+
+ u[ 0] = _mm256_sub_epi32(u[ 0], v[ 0]);
+ u[ 1] = _mm256_sub_epi32(u[ 1], v[ 1]);
+ u[ 2] = _mm256_sub_epi32(u[ 2], v[ 2]);
+ u[ 3] = _mm256_sub_epi32(u[ 3], v[ 3]);
+ u[ 4] = _mm256_sub_epi32(u[ 4], v[ 4]);
+ u[ 5] = _mm256_sub_epi32(u[ 5], v[ 5]);
+ u[ 6] = _mm256_sub_epi32(u[ 6], v[ 6]);
+ u[ 7] = _mm256_sub_epi32(u[ 7], v[ 7]);
+ u[ 8] = _mm256_sub_epi32(u[ 8], v[ 8]);
+ u[ 9] = _mm256_sub_epi32(u[ 9], v[ 9]);
+ u[10] = _mm256_sub_epi32(u[10], v[10]);
+ u[11] = _mm256_sub_epi32(u[11], v[11]);
+ u[12] = _mm256_sub_epi32(u[12], v[12]);
+ u[13] = _mm256_sub_epi32(u[13], v[13]);
+ u[14] = _mm256_sub_epi32(u[14], v[14]);
+ u[15] = _mm256_sub_epi32(u[15], v[15]);
+
+ v[0] = _mm256_add_epi32(u[0], K32One);
+ v[1] = _mm256_add_epi32(u[1], K32One);
+ v[2] = _mm256_add_epi32(u[2], K32One);
+ v[3] = _mm256_add_epi32(u[3], K32One);
+ v[4] = _mm256_add_epi32(u[4], K32One);
+ v[5] = _mm256_add_epi32(u[5], K32One);
+ v[6] = _mm256_add_epi32(u[6], K32One);
+ v[7] = _mm256_add_epi32(u[7], K32One);
+ v[8] = _mm256_add_epi32(u[8], K32One);
+ v[9] = _mm256_add_epi32(u[9], K32One);
+ v[10] = _mm256_add_epi32(u[10], K32One);
+ v[11] = _mm256_add_epi32(u[11], K32One);
+ v[12] = _mm256_add_epi32(u[12], K32One);
+ v[13] = _mm256_add_epi32(u[13], K32One);
+ v[14] = _mm256_add_epi32(u[14], K32One);
+ v[15] = _mm256_add_epi32(u[15], K32One);
+
+ u[0] = _mm256_srai_epi32(v[0], 2);
+ u[1] = _mm256_srai_epi32(v[1], 2);
+ u[2] = _mm256_srai_epi32(v[2], 2);
+ u[3] = _mm256_srai_epi32(v[3], 2);
+ u[4] = _mm256_srai_epi32(v[4], 2);
+ u[5] = _mm256_srai_epi32(v[5], 2);
+ u[6] = _mm256_srai_epi32(v[6], 2);
+ u[7] = _mm256_srai_epi32(v[7], 2);
+ u[8] = _mm256_srai_epi32(v[8], 2);
+ u[9] = _mm256_srai_epi32(v[9], 2);
+ u[10] = _mm256_srai_epi32(v[10], 2);
+ u[11] = _mm256_srai_epi32(v[11], 2);
+ u[12] = _mm256_srai_epi32(v[12], 2);
+ u[13] = _mm256_srai_epi32(v[13], 2);
+ u[14] = _mm256_srai_epi32(v[14], 2);
+ u[15] = _mm256_srai_epi32(v[15], 2);
+
+ out[ 1] = _mm256_packs_epi32(u[0], u[1]);
+ out[17] = _mm256_packs_epi32(u[2], u[3]);
+ out[ 9] = _mm256_packs_epi32(u[4], u[5]);
+ out[25] = _mm256_packs_epi32(u[6], u[7]);
+ out[ 7] = _mm256_packs_epi32(u[8], u[9]);
+ out[23] = _mm256_packs_epi32(u[10], u[11]);
+ out[15] = _mm256_packs_epi32(u[12], u[13]);
+ out[31] = _mm256_packs_epi32(u[14], u[15]);
+ }
+ {
+ const __m256i k32_p27_p05 = pair256_set_epi32(cospi_27_64, cospi_5_64);
+ const __m256i k32_p11_p21 = pair256_set_epi32(cospi_11_64, cospi_21_64);
+ const __m256i k32_p19_p13 = pair256_set_epi32(cospi_19_64, cospi_13_64);
+ const __m256i k32_p03_p29 = pair256_set_epi32(cospi_3_64, cospi_29_64);
+ const __m256i k32_m29_p03 = pair256_set_epi32(-cospi_29_64, cospi_3_64);
+ const __m256i k32_m13_p19 = pair256_set_epi32(-cospi_13_64, cospi_19_64);
+ const __m256i k32_m21_p11 = pair256_set_epi32(-cospi_21_64, cospi_11_64);
+ const __m256i k32_m05_p27 = pair256_set_epi32(-cospi_5_64, cospi_27_64);
+
+ u[ 0] = _mm256_unpacklo_epi32(lstep1[40], lstep1[54]);
+ u[ 1] = _mm256_unpackhi_epi32(lstep1[40], lstep1[54]);
+ u[ 2] = _mm256_unpacklo_epi32(lstep1[41], lstep1[55]);
+ u[ 3] = _mm256_unpackhi_epi32(lstep1[41], lstep1[55]);
+ u[ 4] = _mm256_unpacklo_epi32(lstep1[42], lstep1[52]);
+ u[ 5] = _mm256_unpackhi_epi32(lstep1[42], lstep1[52]);
+ u[ 6] = _mm256_unpacklo_epi32(lstep1[43], lstep1[53]);
+ u[ 7] = _mm256_unpackhi_epi32(lstep1[43], lstep1[53]);
+ u[ 8] = _mm256_unpacklo_epi32(lstep1[44], lstep1[50]);
+ u[ 9] = _mm256_unpackhi_epi32(lstep1[44], lstep1[50]);
+ u[10] = _mm256_unpacklo_epi32(lstep1[45], lstep1[51]);
+ u[11] = _mm256_unpackhi_epi32(lstep1[45], lstep1[51]);
+ u[12] = _mm256_unpacklo_epi32(lstep1[46], lstep1[48]);
+ u[13] = _mm256_unpackhi_epi32(lstep1[46], lstep1[48]);
+ u[14] = _mm256_unpacklo_epi32(lstep1[47], lstep1[49]);
+ u[15] = _mm256_unpackhi_epi32(lstep1[47], lstep1[49]);
+
+ v[ 0] = k_madd_epi32_avx2(u[ 0], k32_p27_p05);
+ v[ 1] = k_madd_epi32_avx2(u[ 1], k32_p27_p05);
+ v[ 2] = k_madd_epi32_avx2(u[ 2], k32_p27_p05);
+ v[ 3] = k_madd_epi32_avx2(u[ 3], k32_p27_p05);
+ v[ 4] = k_madd_epi32_avx2(u[ 4], k32_p11_p21);
+ v[ 5] = k_madd_epi32_avx2(u[ 5], k32_p11_p21);
+ v[ 6] = k_madd_epi32_avx2(u[ 6], k32_p11_p21);
+ v[ 7] = k_madd_epi32_avx2(u[ 7], k32_p11_p21);
+ v[ 8] = k_madd_epi32_avx2(u[ 8], k32_p19_p13);
+ v[ 9] = k_madd_epi32_avx2(u[ 9], k32_p19_p13);
+ v[10] = k_madd_epi32_avx2(u[10], k32_p19_p13);
+ v[11] = k_madd_epi32_avx2(u[11], k32_p19_p13);
+ v[12] = k_madd_epi32_avx2(u[12], k32_p03_p29);
+ v[13] = k_madd_epi32_avx2(u[13], k32_p03_p29);
+ v[14] = k_madd_epi32_avx2(u[14], k32_p03_p29);
+ v[15] = k_madd_epi32_avx2(u[15], k32_p03_p29);
+ v[16] = k_madd_epi32_avx2(u[12], k32_m29_p03);
+ v[17] = k_madd_epi32_avx2(u[13], k32_m29_p03);
+ v[18] = k_madd_epi32_avx2(u[14], k32_m29_p03);
+ v[19] = k_madd_epi32_avx2(u[15], k32_m29_p03);
+ v[20] = k_madd_epi32_avx2(u[ 8], k32_m13_p19);
+ v[21] = k_madd_epi32_avx2(u[ 9], k32_m13_p19);
+ v[22] = k_madd_epi32_avx2(u[10], k32_m13_p19);
+ v[23] = k_madd_epi32_avx2(u[11], k32_m13_p19);
+ v[24] = k_madd_epi32_avx2(u[ 4], k32_m21_p11);
+ v[25] = k_madd_epi32_avx2(u[ 5], k32_m21_p11);
+ v[26] = k_madd_epi32_avx2(u[ 6], k32_m21_p11);
+ v[27] = k_madd_epi32_avx2(u[ 7], k32_m21_p11);
+ v[28] = k_madd_epi32_avx2(u[ 0], k32_m05_p27);
+ v[29] = k_madd_epi32_avx2(u[ 1], k32_m05_p27);
+ v[30] = k_madd_epi32_avx2(u[ 2], k32_m05_p27);
+ v[31] = k_madd_epi32_avx2(u[ 3], k32_m05_p27);
+
+ u[ 0] = k_packs_epi64_avx2(v[ 0], v[ 1]);
+ u[ 1] = k_packs_epi64_avx2(v[ 2], v[ 3]);
+ u[ 2] = k_packs_epi64_avx2(v[ 4], v[ 5]);
+ u[ 3] = k_packs_epi64_avx2(v[ 6], v[ 7]);
+ u[ 4] = k_packs_epi64_avx2(v[ 8], v[ 9]);
+ u[ 5] = k_packs_epi64_avx2(v[10], v[11]);
+ u[ 6] = k_packs_epi64_avx2(v[12], v[13]);
+ u[ 7] = k_packs_epi64_avx2(v[14], v[15]);
+ u[ 8] = k_packs_epi64_avx2(v[16], v[17]);
+ u[ 9] = k_packs_epi64_avx2(v[18], v[19]);
+ u[10] = k_packs_epi64_avx2(v[20], v[21]);
+ u[11] = k_packs_epi64_avx2(v[22], v[23]);
+ u[12] = k_packs_epi64_avx2(v[24], v[25]);
+ u[13] = k_packs_epi64_avx2(v[26], v[27]);
+ u[14] = k_packs_epi64_avx2(v[28], v[29]);
+ u[15] = k_packs_epi64_avx2(v[30], v[31]);
+
+ v[ 0] = _mm256_add_epi32(u[ 0], k__DCT_CONST_ROUNDING);
+ v[ 1] = _mm256_add_epi32(u[ 1], k__DCT_CONST_ROUNDING);
+ v[ 2] = _mm256_add_epi32(u[ 2], k__DCT_CONST_ROUNDING);
+ v[ 3] = _mm256_add_epi32(u[ 3], k__DCT_CONST_ROUNDING);
+ v[ 4] = _mm256_add_epi32(u[ 4], k__DCT_CONST_ROUNDING);
+ v[ 5] = _mm256_add_epi32(u[ 5], k__DCT_CONST_ROUNDING);
+ v[ 6] = _mm256_add_epi32(u[ 6], k__DCT_CONST_ROUNDING);
+ v[ 7] = _mm256_add_epi32(u[ 7], k__DCT_CONST_ROUNDING);
+ v[ 8] = _mm256_add_epi32(u[ 8], k__DCT_CONST_ROUNDING);
+ v[ 9] = _mm256_add_epi32(u[ 9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm256_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm256_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm256_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm256_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm256_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm256_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ u[ 0] = _mm256_srai_epi32(v[ 0], DCT_CONST_BITS);
+ u[ 1] = _mm256_srai_epi32(v[ 1], DCT_CONST_BITS);
+ u[ 2] = _mm256_srai_epi32(v[ 2], DCT_CONST_BITS);
+ u[ 3] = _mm256_srai_epi32(v[ 3], DCT_CONST_BITS);
+ u[ 4] = _mm256_srai_epi32(v[ 4], DCT_CONST_BITS);
+ u[ 5] = _mm256_srai_epi32(v[ 5], DCT_CONST_BITS);
+ u[ 6] = _mm256_srai_epi32(v[ 6], DCT_CONST_BITS);
+ u[ 7] = _mm256_srai_epi32(v[ 7], DCT_CONST_BITS);
+ u[ 8] = _mm256_srai_epi32(v[ 8], DCT_CONST_BITS);
+ u[ 9] = _mm256_srai_epi32(v[ 9], DCT_CONST_BITS);
+ u[10] = _mm256_srai_epi32(v[10], DCT_CONST_BITS);
+ u[11] = _mm256_srai_epi32(v[11], DCT_CONST_BITS);
+ u[12] = _mm256_srai_epi32(v[12], DCT_CONST_BITS);
+ u[13] = _mm256_srai_epi32(v[13], DCT_CONST_BITS);
+ u[14] = _mm256_srai_epi32(v[14], DCT_CONST_BITS);
+ u[15] = _mm256_srai_epi32(v[15], DCT_CONST_BITS);
+
+ v[ 0] = _mm256_cmpgt_epi32(kZero,u[ 0]);
+ v[ 1] = _mm256_cmpgt_epi32(kZero,u[ 1]);
+ v[ 2] = _mm256_cmpgt_epi32(kZero,u[ 2]);
+ v[ 3] = _mm256_cmpgt_epi32(kZero,u[ 3]);
+ v[ 4] = _mm256_cmpgt_epi32(kZero,u[ 4]);
+ v[ 5] = _mm256_cmpgt_epi32(kZero,u[ 5]);
+ v[ 6] = _mm256_cmpgt_epi32(kZero,u[ 6]);
+ v[ 7] = _mm256_cmpgt_epi32(kZero,u[ 7]);
+ v[ 8] = _mm256_cmpgt_epi32(kZero,u[ 8]);
+ v[ 9] = _mm256_cmpgt_epi32(kZero,u[ 9]);
+ v[10] = _mm256_cmpgt_epi32(kZero,u[10]);
+ v[11] = _mm256_cmpgt_epi32(kZero,u[11]);
+ v[12] = _mm256_cmpgt_epi32(kZero,u[12]);
+ v[13] = _mm256_cmpgt_epi32(kZero,u[13]);
+ v[14] = _mm256_cmpgt_epi32(kZero,u[14]);
+ v[15] = _mm256_cmpgt_epi32(kZero,u[15]);
+
+ u[ 0] = _mm256_sub_epi32(u[ 0], v[ 0]);
+ u[ 1] = _mm256_sub_epi32(u[ 1], v[ 1]);
+ u[ 2] = _mm256_sub_epi32(u[ 2], v[ 2]);
+ u[ 3] = _mm256_sub_epi32(u[ 3], v[ 3]);
+ u[ 4] = _mm256_sub_epi32(u[ 4], v[ 4]);
+ u[ 5] = _mm256_sub_epi32(u[ 5], v[ 5]);
+ u[ 6] = _mm256_sub_epi32(u[ 6], v[ 6]);
+ u[ 7] = _mm256_sub_epi32(u[ 7], v[ 7]);
+ u[ 8] = _mm256_sub_epi32(u[ 8], v[ 8]);
+ u[ 9] = _mm256_sub_epi32(u[ 9], v[ 9]);
+ u[10] = _mm256_sub_epi32(u[10], v[10]);
+ u[11] = _mm256_sub_epi32(u[11], v[11]);
+ u[12] = _mm256_sub_epi32(u[12], v[12]);
+ u[13] = _mm256_sub_epi32(u[13], v[13]);
+ u[14] = _mm256_sub_epi32(u[14], v[14]);
+ u[15] = _mm256_sub_epi32(u[15], v[15]);
+
+ v[0] = _mm256_add_epi32(u[0], K32One);
+ v[1] = _mm256_add_epi32(u[1], K32One);
+ v[2] = _mm256_add_epi32(u[2], K32One);
+ v[3] = _mm256_add_epi32(u[3], K32One);
+ v[4] = _mm256_add_epi32(u[4], K32One);
+ v[5] = _mm256_add_epi32(u[5], K32One);
+ v[6] = _mm256_add_epi32(u[6], K32One);
+ v[7] = _mm256_add_epi32(u[7], K32One);
+ v[8] = _mm256_add_epi32(u[8], K32One);
+ v[9] = _mm256_add_epi32(u[9], K32One);
+ v[10] = _mm256_add_epi32(u[10], K32One);
+ v[11] = _mm256_add_epi32(u[11], K32One);
+ v[12] = _mm256_add_epi32(u[12], K32One);
+ v[13] = _mm256_add_epi32(u[13], K32One);
+ v[14] = _mm256_add_epi32(u[14], K32One);
+ v[15] = _mm256_add_epi32(u[15], K32One);
+
+ u[0] = _mm256_srai_epi32(v[0], 2);
+ u[1] = _mm256_srai_epi32(v[1], 2);
+ u[2] = _mm256_srai_epi32(v[2], 2);
+ u[3] = _mm256_srai_epi32(v[3], 2);
+ u[4] = _mm256_srai_epi32(v[4], 2);
+ u[5] = _mm256_srai_epi32(v[5], 2);
+ u[6] = _mm256_srai_epi32(v[6], 2);
+ u[7] = _mm256_srai_epi32(v[7], 2);
+ u[8] = _mm256_srai_epi32(v[8], 2);
+ u[9] = _mm256_srai_epi32(v[9], 2);
+ u[10] = _mm256_srai_epi32(v[10], 2);
+ u[11] = _mm256_srai_epi32(v[11], 2);
+ u[12] = _mm256_srai_epi32(v[12], 2);
+ u[13] = _mm256_srai_epi32(v[13], 2);
+ u[14] = _mm256_srai_epi32(v[14], 2);
+ u[15] = _mm256_srai_epi32(v[15], 2);
+
+ out[ 5] = _mm256_packs_epi32(u[0], u[1]);
+ out[21] = _mm256_packs_epi32(u[2], u[3]);
+ out[13] = _mm256_packs_epi32(u[4], u[5]);
+ out[29] = _mm256_packs_epi32(u[6], u[7]);
+ out[ 3] = _mm256_packs_epi32(u[8], u[9]);
+ out[19] = _mm256_packs_epi32(u[10], u[11]);
+ out[11] = _mm256_packs_epi32(u[12], u[13]);
+ out[27] = _mm256_packs_epi32(u[14], u[15]);
+ }
+ }
+#endif
+ // Transpose the results, do it as four 8x8 transposes.
+ {
+ int transpose_block;
+ int16_t *output_currStep,*output_nextStep;
+ if (0 == pass){
+ output_currStep = &intermediate[column_start * 32];
+ output_nextStep = &intermediate[(column_start + 8) * 32];
+ } else{
+ output_currStep = &output_org[column_start * 32];
+ output_nextStep = &output_org[(column_start + 8) * 32];
+ }
+ for (transpose_block = 0; transpose_block < 4; ++transpose_block) {
+ __m256i *this_out = &out[8 * transpose_block];
+ // 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15
+ // 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
+ // 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
+ // 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
+ // 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
+ // 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
+ // 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
+ // 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
+ const __m256i tr0_0 = _mm256_unpacklo_epi16(this_out[0], this_out[1]);
+ const __m256i tr0_1 = _mm256_unpacklo_epi16(this_out[2], this_out[3]);
+ const __m256i tr0_2 = _mm256_unpackhi_epi16(this_out[0], this_out[1]);
+ const __m256i tr0_3 = _mm256_unpackhi_epi16(this_out[2], this_out[3]);
+ const __m256i tr0_4 = _mm256_unpacklo_epi16(this_out[4], this_out[5]);
+ const __m256i tr0_5 = _mm256_unpacklo_epi16(this_out[6], this_out[7]);
+ const __m256i tr0_6 = _mm256_unpackhi_epi16(this_out[4], this_out[5]);
+ const __m256i tr0_7 = _mm256_unpackhi_epi16(this_out[6], this_out[7]);
+ // 00 20 01 21 02 22 03 23 08 28 09 29 10 30 11 31
+ // 40 60 41 61 42 62 43 63 48 68 49 69 50 70 51 71
+ // 04 24 05 25 06 26 07 27 12 32 13 33 14 34 15 35
+ // 44 64 45 65 46 66 47 67 52 72 53 73 54 74 55 75
+ // 80 100 81 101 82 102 83 103 88 108 89 109 90 110 91 101
+ // 120 140 121 141 122 142 123 143 128 148 129 149 130 150 131 151
+ // 84 104 85 105 86 106 87 107 92 112 93 113 94 114 95 115
+ // 124 144 125 145 126 146 127 147 132 152 133 153 134 154 135 155
+
+ const __m256i tr1_0 = _mm256_unpacklo_epi32(tr0_0, tr0_1);
+ const __m256i tr1_1 = _mm256_unpacklo_epi32(tr0_2, tr0_3);
+ const __m256i tr1_2 = _mm256_unpackhi_epi32(tr0_0, tr0_1);
+ const __m256i tr1_3 = _mm256_unpackhi_epi32(tr0_2, tr0_3);
+ const __m256i tr1_4 = _mm256_unpacklo_epi32(tr0_4, tr0_5);
+ const __m256i tr1_5 = _mm256_unpacklo_epi32(tr0_6, tr0_7);
+ const __m256i tr1_6 = _mm256_unpackhi_epi32(tr0_4, tr0_5);
+ const __m256i tr1_7 = _mm256_unpackhi_epi32(tr0_6, tr0_7);
+ // 00 20 40 60 01 21 41 61 08 28 48 68 09 29 49 69
+ // 04 24 44 64 05 25 45 65 12 32 52 72 13 33 53 73
+ // 02 22 42 62 03 23 43 63 10 30 50 70 11 31 51 71
+ // 06 26 46 66 07 27 47 67 14 34 54 74 15 35 55 75
+ // 80 100 120 140 81 101 121 141 88 108 128 148 89 109 129 149
+ // 84 104 124 144 85 105 125 145 92 112 132 152 93 113 133 153
+ // 82 102 122 142 83 103 123 143 90 110 130 150 91 101 131 151
+ // 86 106 126 146 87 107 127 147 94 114 134 154 95 115 135 155
+ __m256i tr2_0 = _mm256_unpacklo_epi64(tr1_0, tr1_4);
+ __m256i tr2_1 = _mm256_unpackhi_epi64(tr1_0, tr1_4);
+ __m256i tr2_2 = _mm256_unpacklo_epi64(tr1_2, tr1_6);
+ __m256i tr2_3 = _mm256_unpackhi_epi64(tr1_2, tr1_6);
+ __m256i tr2_4 = _mm256_unpacklo_epi64(tr1_1, tr1_5);
+ __m256i tr2_5 = _mm256_unpackhi_epi64(tr1_1, tr1_5);
+ __m256i tr2_6 = _mm256_unpacklo_epi64(tr1_3, tr1_7);
+ __m256i tr2_7 = _mm256_unpackhi_epi64(tr1_3, tr1_7);
+ // 00 20 40 60 80 100 120 140 08 28 48 68 88 108 128 148
+ // 01 21 41 61 81 101 121 141 09 29 49 69 89 109 129 149
+ // 02 22 42 62 82 102 122 142 10 30 50 70 90 110 130 150
+ // 03 23 43 63 83 103 123 143 11 31 51 71 91 101 131 151
+ // 04 24 44 64 84 104 124 144 12 32 52 72 92 112 132 152
+ // 05 25 45 65 85 105 125 145 13 33 53 73 93 113 133 153
+ // 06 26 46 66 86 106 126 146 14 34 54 74 94 114 134 154
+ // 07 27 47 67 87 107 127 147 15 35 55 75 95 115 135 155
+ if (0 == pass) {
+ // output[j] = (output[j] + 1 + (output[j] > 0)) >> 2;
+ // TODO(cd): see quality impact of only doing
+ // output[j] = (output[j] + 1) >> 2;
+ // which would remove the code between here ...
+ __m256i tr2_0_0 = _mm256_cmpgt_epi16(tr2_0, kZero);
+ __m256i tr2_1_0 = _mm256_cmpgt_epi16(tr2_1, kZero);
+ __m256i tr2_2_0 = _mm256_cmpgt_epi16(tr2_2, kZero);
+ __m256i tr2_3_0 = _mm256_cmpgt_epi16(tr2_3, kZero);
+ __m256i tr2_4_0 = _mm256_cmpgt_epi16(tr2_4, kZero);
+ __m256i tr2_5_0 = _mm256_cmpgt_epi16(tr2_5, kZero);
+ __m256i tr2_6_0 = _mm256_cmpgt_epi16(tr2_6, kZero);
+ __m256i tr2_7_0 = _mm256_cmpgt_epi16(tr2_7, kZero);
+ tr2_0 = _mm256_sub_epi16(tr2_0, tr2_0_0);
+ tr2_1 = _mm256_sub_epi16(tr2_1, tr2_1_0);
+ tr2_2 = _mm256_sub_epi16(tr2_2, tr2_2_0);
+ tr2_3 = _mm256_sub_epi16(tr2_3, tr2_3_0);
+ tr2_4 = _mm256_sub_epi16(tr2_4, tr2_4_0);
+ tr2_5 = _mm256_sub_epi16(tr2_5, tr2_5_0);
+ tr2_6 = _mm256_sub_epi16(tr2_6, tr2_6_0);
+ tr2_7 = _mm256_sub_epi16(tr2_7, tr2_7_0);
+ // ... and here.
+ // PS: also change code in vp9/encoder/vp9_dct.c
+ tr2_0 = _mm256_add_epi16(tr2_0, kOne);
+ tr2_1 = _mm256_add_epi16(tr2_1, kOne);
+ tr2_2 = _mm256_add_epi16(tr2_2, kOne);
+ tr2_3 = _mm256_add_epi16(tr2_3, kOne);
+ tr2_4 = _mm256_add_epi16(tr2_4, kOne);
+ tr2_5 = _mm256_add_epi16(tr2_5, kOne);
+ tr2_6 = _mm256_add_epi16(tr2_6, kOne);
+ tr2_7 = _mm256_add_epi16(tr2_7, kOne);
+ tr2_0 = _mm256_srai_epi16(tr2_0, 2);
+ tr2_1 = _mm256_srai_epi16(tr2_1, 2);
+ tr2_2 = _mm256_srai_epi16(tr2_2, 2);
+ tr2_3 = _mm256_srai_epi16(tr2_3, 2);
+ tr2_4 = _mm256_srai_epi16(tr2_4, 2);
+ tr2_5 = _mm256_srai_epi16(tr2_5, 2);
+ tr2_6 = _mm256_srai_epi16(tr2_6, 2);
+ tr2_7 = _mm256_srai_epi16(tr2_7, 2);
+ }
+ // Note: even though all these stores are aligned, using the aligned
+ // intrinsic make the code slightly slower.
+ _mm_storeu_si128((__m128i *)(output_currStep + 0 * 32), _mm256_castsi256_si128(tr2_0));
+ _mm_storeu_si128((__m128i *)(output_currStep + 1 * 32), _mm256_castsi256_si128(tr2_1));
+ _mm_storeu_si128((__m128i *)(output_currStep + 2 * 32), _mm256_castsi256_si128(tr2_2));
+ _mm_storeu_si128((__m128i *)(output_currStep + 3 * 32), _mm256_castsi256_si128(tr2_3));
+ _mm_storeu_si128((__m128i *)(output_currStep + 4 * 32), _mm256_castsi256_si128(tr2_4));
+ _mm_storeu_si128((__m128i *)(output_currStep + 5 * 32), _mm256_castsi256_si128(tr2_5));
+ _mm_storeu_si128((__m128i *)(output_currStep + 6 * 32), _mm256_castsi256_si128(tr2_6));
+ _mm_storeu_si128((__m128i *)(output_currStep + 7 * 32), _mm256_castsi256_si128(tr2_7));
+
+ _mm_storeu_si128((__m128i *)(output_nextStep + 0 * 32), _mm256_extractf128_si256(tr2_0,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 1 * 32), _mm256_extractf128_si256(tr2_1,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 2 * 32), _mm256_extractf128_si256(tr2_2,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 3 * 32), _mm256_extractf128_si256(tr2_3,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 4 * 32), _mm256_extractf128_si256(tr2_4,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 5 * 32), _mm256_extractf128_si256(tr2_5,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 6 * 32), _mm256_extractf128_si256(tr2_6,1));
+ _mm_storeu_si128((__m128i *)(output_nextStep + 7 * 32), _mm256_extractf128_si256(tr2_7,1));
+ // Process next 8x8
+ output_currStep += 8;
+ output_nextStep += 8;
+ }
+ }
+ }
+ }
+} // NOLINT
diff --git a/libvpx/vp9/encoder/x86/vp9_dct_avx2.c b/libvpx/vp9/encoder/x86/vp9_dct_avx2.c
new file mode 100644
index 0000000..b5269ed
--- /dev/null
+++ b/libvpx/vp9/encoder/x86/vp9_dct_avx2.c
@@ -0,0 +1,2592 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <immintrin.h> // AVX2
+#include "vp9/common/vp9_idct.h" // for cospi constants
+#include "vpx_ports/mem.h"
+
+void vp9_fdct4x4_avx2(const int16_t *input, int16_t *output, int stride) {
+ // The 2D transform is done with two passes which are actually pretty
+ // similar. In the first one, we transform the columns and transpose
+ // the results. In the second one, we transform the rows. To achieve that,
+ // as the first pass results are transposed, we transpose the columns (that
+ // is the transposed rows) and transpose the results (so that it goes back
+ // in normal/row positions).
+ int pass;
+ // Constants
+ // When we use them, in one case, they are all the same. In all others
+ // it's a pair of them that we need to repeat four times. This is done
+ // by constructing the 32 bit constant corresponding to that pair.
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1);
+ const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0);
+ const __m128i kOne = _mm_set1_epi16(1);
+ __m128i in0, in1, in2, in3;
+ // Load inputs.
+ {
+ in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
+ in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
+ in2 = _mm_loadl_epi64((const __m128i *)(input + 2 * stride));
+ in3 = _mm_loadl_epi64((const __m128i *)(input + 3 * stride));
+ // x = x << 4
+ in0 = _mm_slli_epi16(in0, 4);
+ in1 = _mm_slli_epi16(in1, 4);
+ in2 = _mm_slli_epi16(in2, 4);
+ in3 = _mm_slli_epi16(in3, 4);
+ // if (i == 0 && input[0]) input[0] += 1;
+ {
+ // The mask will only contain whether the first value is zero, all
+ // other comparison will fail as something shifted by 4 (above << 4)
+ // can never be equal to one. To increment in the non-zero case, we
+ // add the mask and one for the first element:
+ // - if zero, mask = -1, v = v - 1 + 1 = v
+ // - if non-zero, mask = 0, v = v + 0 + 1 = v + 1
+ __m128i mask = _mm_cmpeq_epi16(in0, k__nonzero_bias_a);
+ in0 = _mm_add_epi16(in0, mask);
+ in0 = _mm_add_epi16(in0, k__nonzero_bias_b);
+ }
+ }
+ // Do the two transform/transpose passes
+ for (pass = 0; pass < 2; ++pass) {
+ // Transform 1/2: Add/subtract
+ const __m128i r0 = _mm_add_epi16(in0, in3);
+ const __m128i r1 = _mm_add_epi16(in1, in2);
+ const __m128i r2 = _mm_sub_epi16(in1, in2);
+ const __m128i r3 = _mm_sub_epi16(in0, in3);
+ // Transform 1/2: Interleave to do the multiply by constants which gets us
+ // into 32 bits.
+ const __m128i t0 = _mm_unpacklo_epi16(r0, r1);
+ const __m128i t2 = _mm_unpacklo_epi16(r2, r3);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16);
+ const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16);
+ const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08);
+ const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24);
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
+ const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ // Combine and transpose
+ const __m128i res0 = _mm_packs_epi32(w0, w2);
+ const __m128i res1 = _mm_packs_epi32(w4, w6);
+ // 00 01 02 03 20 21 22 23
+ // 10 11 12 13 30 31 32 33
+ const __m128i tr0_0 = _mm_unpacklo_epi16(res0, res1);
+ const __m128i tr0_1 = _mm_unpackhi_epi16(res0, res1);
+ // 00 10 01 11 02 12 03 13
+ // 20 30 21 31 22 32 23 33
+ in0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ in2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ // 00 10 20 30 01 11 21 31 in0 contains 0 followed by 1
+ // 02 12 22 32 03 13 23 33 in2 contains 2 followed by 3
+ if (0 == pass) {
+ // Extract values in the high part for second pass as transform code
+ // only uses the first four values.
+ in1 = _mm_unpackhi_epi64(in0, in0);
+ in3 = _mm_unpackhi_epi64(in2, in2);
+ } else {
+ // Post-condition output and store it (v + 1) >> 2, taking advantage
+ // of the fact 1/3 are stored just after 0/2.
+ __m128i out01 = _mm_add_epi16(in0, kOne);
+ __m128i out23 = _mm_add_epi16(in2, kOne);
+ out01 = _mm_srai_epi16(out01, 2);
+ out23 = _mm_srai_epi16(out23, 2);
+ _mm_storeu_si128((__m128i *)(output + 0 * 4), out01);
+ _mm_storeu_si128((__m128i *)(output + 2 * 4), out23);
+ }
+ }
+}
+
+static INLINE void load_buffer_4x4_avx2(const int16_t *input, __m128i *in,
+ int stride) {
+ const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1);
+ const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0);
+ __m128i mask;
+
+ in[0] = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
+ in[1] = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
+ in[2] = _mm_loadl_epi64((const __m128i *)(input + 2 * stride));
+ in[3] = _mm_loadl_epi64((const __m128i *)(input + 3 * stride));
+
+ in[0] = _mm_slli_epi16(in[0], 4);
+ in[1] = _mm_slli_epi16(in[1], 4);
+ in[2] = _mm_slli_epi16(in[2], 4);
+ in[3] = _mm_slli_epi16(in[3], 4);
+
+ mask = _mm_cmpeq_epi16(in[0], k__nonzero_bias_a);
+ in[0] = _mm_add_epi16(in[0], mask);
+ in[0] = _mm_add_epi16(in[0], k__nonzero_bias_b);
+}
+
+static INLINE void write_buffer_4x4_avx2(int16_t *output, __m128i *res) {
+ const __m128i kOne = _mm_set1_epi16(1);
+ __m128i in01 = _mm_unpacklo_epi64(res[0], res[1]);
+ __m128i in23 = _mm_unpacklo_epi64(res[2], res[3]);
+ __m128i out01 = _mm_add_epi16(in01, kOne);
+ __m128i out23 = _mm_add_epi16(in23, kOne);
+ out01 = _mm_srai_epi16(out01, 2);
+ out23 = _mm_srai_epi16(out23, 2);
+ _mm_store_si128((__m128i *)(output + 0 * 8), out01);
+ _mm_store_si128((__m128i *)(output + 1 * 8), out23);
+}
+
+static INLINE void transpose_4x4_avx2(__m128i *res) {
+ // Combine and transpose
+ // 00 01 02 03 20 21 22 23
+ // 10 11 12 13 30 31 32 33
+ const __m128i tr0_0 = _mm_unpacklo_epi16(res[0], res[1]);
+ const __m128i tr0_1 = _mm_unpackhi_epi16(res[0], res[1]);
+
+ // 00 10 01 11 02 12 03 13
+ // 20 30 21 31 22 32 23 33
+ res[0] = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ res[2] = _mm_unpackhi_epi32(tr0_0, tr0_1);
+
+ // 00 10 20 30 01 11 21 31
+ // 02 12 22 32 03 13 23 33
+ // only use the first 4 16-bit integers
+ res[1] = _mm_unpackhi_epi64(res[0], res[0]);
+ res[3] = _mm_unpackhi_epi64(res[2], res[2]);
+}
+
+void fdct4_avx2(__m128i *in) {
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+
+ __m128i u[4], v[4];
+ u[0]=_mm_unpacklo_epi16(in[0], in[1]);
+ u[1]=_mm_unpacklo_epi16(in[3], in[2]);
+
+ v[0] = _mm_add_epi16(u[0], u[1]);
+ v[1] = _mm_sub_epi16(u[0], u[1]);
+
+ u[0] = _mm_madd_epi16(v[0], k__cospi_p16_p16); // 0
+ u[1] = _mm_madd_epi16(v[0], k__cospi_p16_m16); // 2
+ u[2] = _mm_madd_epi16(v[1], k__cospi_p08_p24); // 1
+ u[3] = _mm_madd_epi16(v[1], k__cospi_p24_m08); // 3
+
+ v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
+
+ in[0] = _mm_packs_epi32(u[0], u[1]);
+ in[1] = _mm_packs_epi32(u[2], u[3]);
+ transpose_4x4_avx2(in);
+}
+
+void fadst4_avx2(__m128i *in) {
+ const __m128i k__sinpi_p01_p02 = pair_set_epi16(sinpi_1_9, sinpi_2_9);
+ const __m128i k__sinpi_p04_m01 = pair_set_epi16(sinpi_4_9, -sinpi_1_9);
+ const __m128i k__sinpi_p03_p04 = pair_set_epi16(sinpi_3_9, sinpi_4_9);
+ const __m128i k__sinpi_m03_p02 = pair_set_epi16(-sinpi_3_9, sinpi_2_9);
+ const __m128i k__sinpi_p03_p03 = _mm_set1_epi16(sinpi_3_9);
+ const __m128i kZero = _mm_set1_epi16(0);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ __m128i u[8], v[8];
+ __m128i in7 = _mm_add_epi16(in[0], in[1]);
+
+ u[0] = _mm_unpacklo_epi16(in[0], in[1]);
+ u[1] = _mm_unpacklo_epi16(in[2], in[3]);
+ u[2] = _mm_unpacklo_epi16(in7, kZero);
+ u[3] = _mm_unpacklo_epi16(in[2], kZero);
+ u[4] = _mm_unpacklo_epi16(in[3], kZero);
+
+ v[0] = _mm_madd_epi16(u[0], k__sinpi_p01_p02); // s0 + s2
+ v[1] = _mm_madd_epi16(u[1], k__sinpi_p03_p04); // s4 + s5
+ v[2] = _mm_madd_epi16(u[2], k__sinpi_p03_p03); // x1
+ v[3] = _mm_madd_epi16(u[0], k__sinpi_p04_m01); // s1 - s3
+ v[4] = _mm_madd_epi16(u[1], k__sinpi_m03_p02); // -s4 + s6
+ v[5] = _mm_madd_epi16(u[3], k__sinpi_p03_p03); // s4
+ v[6] = _mm_madd_epi16(u[4], k__sinpi_p03_p03);
+
+ u[0] = _mm_add_epi32(v[0], v[1]);
+ u[1] = _mm_sub_epi32(v[2], v[6]);
+ u[2] = _mm_add_epi32(v[3], v[4]);
+ u[3] = _mm_sub_epi32(u[2], u[0]);
+ u[4] = _mm_slli_epi32(v[5], 2);
+ u[5] = _mm_sub_epi32(u[4], v[5]);
+ u[6] = _mm_add_epi32(u[3], u[5]);
+
+ v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+
+ u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
+
+ in[0] = _mm_packs_epi32(u[0], u[2]);
+ in[1] = _mm_packs_epi32(u[1], u[3]);
+ transpose_4x4_avx2(in);
+}
+
+void vp9_fht4x4_avx2(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
+ __m128i in[4];
+
+ switch (tx_type) {
+ case DCT_DCT:
+ vp9_fdct4x4_avx2(input, output, stride);
+ break;
+ case ADST_DCT:
+ load_buffer_4x4_avx2(input, in, stride);
+ fadst4_avx2(in);
+ fdct4_avx2(in);
+ write_buffer_4x4_avx2(output, in);
+ break;
+ case DCT_ADST:
+ load_buffer_4x4_avx2(input, in, stride);
+ fdct4_avx2(in);
+ fadst4_avx2(in);
+ write_buffer_4x4_avx2(output, in);
+ break;
+ case ADST_ADST:
+ load_buffer_4x4_avx2(input, in, stride);
+ fadst4_avx2(in);
+ fadst4_avx2(in);
+ write_buffer_4x4_avx2(output, in);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+void vp9_fdct8x8_avx2(const int16_t *input, int16_t *output, int stride) {
+ int pass;
+ // Constants
+ // When we use them, in one case, they are all the same. In all others
+ // it's a pair of them that we need to repeat four times. This is done
+ // by constructing the 32 bit constant corresponding to that pair.
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64);
+ const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64);
+ const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64);
+ const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ // Load input
+ __m128i in0 = _mm_load_si128((const __m128i *)(input + 0 * stride));
+ __m128i in1 = _mm_load_si128((const __m128i *)(input + 1 * stride));
+ __m128i in2 = _mm_load_si128((const __m128i *)(input + 2 * stride));
+ __m128i in3 = _mm_load_si128((const __m128i *)(input + 3 * stride));
+ __m128i in4 = _mm_load_si128((const __m128i *)(input + 4 * stride));
+ __m128i in5 = _mm_load_si128((const __m128i *)(input + 5 * stride));
+ __m128i in6 = _mm_load_si128((const __m128i *)(input + 6 * stride));
+ __m128i in7 = _mm_load_si128((const __m128i *)(input + 7 * stride));
+ // Pre-condition input (shift by two)
+ in0 = _mm_slli_epi16(in0, 2);
+ in1 = _mm_slli_epi16(in1, 2);
+ in2 = _mm_slli_epi16(in2, 2);
+ in3 = _mm_slli_epi16(in3, 2);
+ in4 = _mm_slli_epi16(in4, 2);
+ in5 = _mm_slli_epi16(in5, 2);
+ in6 = _mm_slli_epi16(in6, 2);
+ in7 = _mm_slli_epi16(in7, 2);
+
+ // We do two passes, first the columns, then the rows. The results of the
+ // first pass are transposed so that the same column code can be reused. The
+ // results of the second pass are also transposed so that the rows (processed
+ // as columns) are put back in row positions.
+ for (pass = 0; pass < 2; pass++) {
+ // To store results of each pass before the transpose.
+ __m128i res0, res1, res2, res3, res4, res5, res6, res7;
+ // Add/subtract
+ const __m128i q0 = _mm_add_epi16(in0, in7);
+ const __m128i q1 = _mm_add_epi16(in1, in6);
+ const __m128i q2 = _mm_add_epi16(in2, in5);
+ const __m128i q3 = _mm_add_epi16(in3, in4);
+ const __m128i q4 = _mm_sub_epi16(in3, in4);
+ const __m128i q5 = _mm_sub_epi16(in2, in5);
+ const __m128i q6 = _mm_sub_epi16(in1, in6);
+ const __m128i q7 = _mm_sub_epi16(in0, in7);
+ // Work on first four results
+ {
+ // Add/subtract
+ const __m128i r0 = _mm_add_epi16(q0, q3);
+ const __m128i r1 = _mm_add_epi16(q1, q2);
+ const __m128i r2 = _mm_sub_epi16(q1, q2);
+ const __m128i r3 = _mm_sub_epi16(q0, q3);
+ // Interleave to do the multiply by constants which gets us into 32bits
+ const __m128i t0 = _mm_unpacklo_epi16(r0, r1);
+ const __m128i t1 = _mm_unpackhi_epi16(r0, r1);
+ const __m128i t2 = _mm_unpacklo_epi16(r2, r3);
+ const __m128i t3 = _mm_unpackhi_epi16(r2, r3);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_p16);
+ const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16);
+ const __m128i u3 = _mm_madd_epi16(t1, k__cospi_p16_m16);
+ const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08);
+ const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p24_p08);
+ const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24);
+ const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m08_p24);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
+ const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING);
+ const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+ // Combine
+ res0 = _mm_packs_epi32(w0, w1);
+ res4 = _mm_packs_epi32(w2, w3);
+ res2 = _mm_packs_epi32(w4, w5);
+ res6 = _mm_packs_epi32(w6, w7);
+ }
+ // Work on next four results
+ {
+ // Interleave to do the multiply by constants which gets us into 32bits
+ const __m128i d0 = _mm_unpacklo_epi16(q6, q5);
+ const __m128i d1 = _mm_unpackhi_epi16(q6, q5);
+ const __m128i e0 = _mm_madd_epi16(d0, k__cospi_p16_m16);
+ const __m128i e1 = _mm_madd_epi16(d1, k__cospi_p16_m16);
+ const __m128i e2 = _mm_madd_epi16(d0, k__cospi_p16_p16);
+ const __m128i e3 = _mm_madd_epi16(d1, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m128i f0 = _mm_add_epi32(e0, k__DCT_CONST_ROUNDING);
+ const __m128i f1 = _mm_add_epi32(e1, k__DCT_CONST_ROUNDING);
+ const __m128i f2 = _mm_add_epi32(e2, k__DCT_CONST_ROUNDING);
+ const __m128i f3 = _mm_add_epi32(e3, k__DCT_CONST_ROUNDING);
+ const __m128i s0 = _mm_srai_epi32(f0, DCT_CONST_BITS);
+ const __m128i s1 = _mm_srai_epi32(f1, DCT_CONST_BITS);
+ const __m128i s2 = _mm_srai_epi32(f2, DCT_CONST_BITS);
+ const __m128i s3 = _mm_srai_epi32(f3, DCT_CONST_BITS);
+ // Combine
+ const __m128i r0 = _mm_packs_epi32(s0, s1);
+ const __m128i r1 = _mm_packs_epi32(s2, s3);
+ // Add/subtract
+ const __m128i x0 = _mm_add_epi16(q4, r0);
+ const __m128i x1 = _mm_sub_epi16(q4, r0);
+ const __m128i x2 = _mm_sub_epi16(q7, r1);
+ const __m128i x3 = _mm_add_epi16(q7, r1);
+ // Interleave to do the multiply by constants which gets us into 32bits
+ const __m128i t0 = _mm_unpacklo_epi16(x0, x3);
+ const __m128i t1 = _mm_unpackhi_epi16(x0, x3);
+ const __m128i t2 = _mm_unpacklo_epi16(x1, x2);
+ const __m128i t3 = _mm_unpackhi_epi16(x1, x2);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p28_p04);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p28_p04);
+ const __m128i u2 = _mm_madd_epi16(t0, k__cospi_m04_p28);
+ const __m128i u3 = _mm_madd_epi16(t1, k__cospi_m04_p28);
+ const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p12_p20);
+ const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p12_p20);
+ const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m20_p12);
+ const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m20_p12);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
+ const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING);
+ const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+ // Combine
+ res1 = _mm_packs_epi32(w0, w1);
+ res7 = _mm_packs_epi32(w2, w3);
+ res5 = _mm_packs_epi32(w4, w5);
+ res3 = _mm_packs_epi32(w6, w7);
+ }
+ // Transpose the 8x8.
+ {
+ // 00 01 02 03 04 05 06 07
+ // 10 11 12 13 14 15 16 17
+ // 20 21 22 23 24 25 26 27
+ // 30 31 32 33 34 35 36 37
+ // 40 41 42 43 44 45 46 47
+ // 50 51 52 53 54 55 56 57
+ // 60 61 62 63 64 65 66 67
+ // 70 71 72 73 74 75 76 77
+ const __m128i tr0_0 = _mm_unpacklo_epi16(res0, res1);
+ const __m128i tr0_1 = _mm_unpacklo_epi16(res2, res3);
+ const __m128i tr0_2 = _mm_unpackhi_epi16(res0, res1);
+ const __m128i tr0_3 = _mm_unpackhi_epi16(res2, res3);
+ const __m128i tr0_4 = _mm_unpacklo_epi16(res4, res5);
+ const __m128i tr0_5 = _mm_unpacklo_epi16(res6, res7);
+ const __m128i tr0_6 = _mm_unpackhi_epi16(res4, res5);
+ const __m128i tr0_7 = _mm_unpackhi_epi16(res6, res7);
+ // 00 10 01 11 02 12 03 13
+ // 20 30 21 31 22 32 23 33
+ // 04 14 05 15 06 16 07 17
+ // 24 34 25 35 26 36 27 37
+ // 40 50 41 51 42 52 43 53
+ // 60 70 61 71 62 72 63 73
+ // 54 54 55 55 56 56 57 57
+ // 64 74 65 75 66 76 67 77
+ const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3);
+ const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3);
+ const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5);
+ const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7);
+ const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5);
+ const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7);
+ // 00 10 20 30 01 11 21 31
+ // 40 50 60 70 41 51 61 71
+ // 02 12 22 32 03 13 23 33
+ // 42 52 62 72 43 53 63 73
+ // 04 14 24 34 05 15 21 36
+ // 44 54 64 74 45 55 61 76
+ // 06 16 26 36 07 17 27 37
+ // 46 56 66 76 47 57 67 77
+ in0 = _mm_unpacklo_epi64(tr1_0, tr1_4);
+ in1 = _mm_unpackhi_epi64(tr1_0, tr1_4);
+ in2 = _mm_unpacklo_epi64(tr1_2, tr1_6);
+ in3 = _mm_unpackhi_epi64(tr1_2, tr1_6);
+ in4 = _mm_unpacklo_epi64(tr1_1, tr1_5);
+ in5 = _mm_unpackhi_epi64(tr1_1, tr1_5);
+ in6 = _mm_unpacklo_epi64(tr1_3, tr1_7);
+ in7 = _mm_unpackhi_epi64(tr1_3, tr1_7);
+ // 00 10 20 30 40 50 60 70
+ // 01 11 21 31 41 51 61 71
+ // 02 12 22 32 42 52 62 72
+ // 03 13 23 33 43 53 63 73
+ // 04 14 24 34 44 54 64 74
+ // 05 15 25 35 45 55 65 75
+ // 06 16 26 36 46 56 66 76
+ // 07 17 27 37 47 57 67 77
+ }
+ }
+ // Post-condition output and store it
+ {
+ // Post-condition (division by two)
+ // division of two 16 bits signed numbers using shifts
+ // n / 2 = (n - (n >> 15)) >> 1
+ const __m128i sign_in0 = _mm_srai_epi16(in0, 15);
+ const __m128i sign_in1 = _mm_srai_epi16(in1, 15);
+ const __m128i sign_in2 = _mm_srai_epi16(in2, 15);
+ const __m128i sign_in3 = _mm_srai_epi16(in3, 15);
+ const __m128i sign_in4 = _mm_srai_epi16(in4, 15);
+ const __m128i sign_in5 = _mm_srai_epi16(in5, 15);
+ const __m128i sign_in6 = _mm_srai_epi16(in6, 15);
+ const __m128i sign_in7 = _mm_srai_epi16(in7, 15);
+ in0 = _mm_sub_epi16(in0, sign_in0);
+ in1 = _mm_sub_epi16(in1, sign_in1);
+ in2 = _mm_sub_epi16(in2, sign_in2);
+ in3 = _mm_sub_epi16(in3, sign_in3);
+ in4 = _mm_sub_epi16(in4, sign_in4);
+ in5 = _mm_sub_epi16(in5, sign_in5);
+ in6 = _mm_sub_epi16(in6, sign_in6);
+ in7 = _mm_sub_epi16(in7, sign_in7);
+ in0 = _mm_srai_epi16(in0, 1);
+ in1 = _mm_srai_epi16(in1, 1);
+ in2 = _mm_srai_epi16(in2, 1);
+ in3 = _mm_srai_epi16(in3, 1);
+ in4 = _mm_srai_epi16(in4, 1);
+ in5 = _mm_srai_epi16(in5, 1);
+ in6 = _mm_srai_epi16(in6, 1);
+ in7 = _mm_srai_epi16(in7, 1);
+ // store results
+ _mm_store_si128((__m128i *)(output + 0 * 8), in0);
+ _mm_store_si128((__m128i *)(output + 1 * 8), in1);
+ _mm_store_si128((__m128i *)(output + 2 * 8), in2);
+ _mm_store_si128((__m128i *)(output + 3 * 8), in3);
+ _mm_store_si128((__m128i *)(output + 4 * 8), in4);
+ _mm_store_si128((__m128i *)(output + 5 * 8), in5);
+ _mm_store_si128((__m128i *)(output + 6 * 8), in6);
+ _mm_store_si128((__m128i *)(output + 7 * 8), in7);
+ }
+}
+
+// load 8x8 array
+static INLINE void load_buffer_8x8_avx2(const int16_t *input, __m128i *in,
+ int stride) {
+ in[0] = _mm_load_si128((const __m128i *)(input + 0 * stride));
+ in[1] = _mm_load_si128((const __m128i *)(input + 1 * stride));
+ in[2] = _mm_load_si128((const __m128i *)(input + 2 * stride));
+ in[3] = _mm_load_si128((const __m128i *)(input + 3 * stride));
+ in[4] = _mm_load_si128((const __m128i *)(input + 4 * stride));
+ in[5] = _mm_load_si128((const __m128i *)(input + 5 * stride));
+ in[6] = _mm_load_si128((const __m128i *)(input + 6 * stride));
+ in[7] = _mm_load_si128((const __m128i *)(input + 7 * stride));
+
+ in[0] = _mm_slli_epi16(in[0], 2);
+ in[1] = _mm_slli_epi16(in[1], 2);
+ in[2] = _mm_slli_epi16(in[2], 2);
+ in[3] = _mm_slli_epi16(in[3], 2);
+ in[4] = _mm_slli_epi16(in[4], 2);
+ in[5] = _mm_slli_epi16(in[5], 2);
+ in[6] = _mm_slli_epi16(in[6], 2);
+ in[7] = _mm_slli_epi16(in[7], 2);
+}
+
+// right shift and rounding
+static INLINE void right_shift_8x8_avx2(__m128i *res, int const bit) {
+ const __m128i kOne = _mm_set1_epi16(1);
+ const int bit_m02 = bit - 2;
+ __m128i sign0 = _mm_srai_epi16(res[0], 15);
+ __m128i sign1 = _mm_srai_epi16(res[1], 15);
+ __m128i sign2 = _mm_srai_epi16(res[2], 15);
+ __m128i sign3 = _mm_srai_epi16(res[3], 15);
+ __m128i sign4 = _mm_srai_epi16(res[4], 15);
+ __m128i sign5 = _mm_srai_epi16(res[5], 15);
+ __m128i sign6 = _mm_srai_epi16(res[6], 15);
+ __m128i sign7 = _mm_srai_epi16(res[7], 15);
+
+ if (bit_m02 >= 0) {
+ __m128i k_const_rounding = _mm_slli_epi16(kOne, bit_m02);
+ res[0] = _mm_add_epi16(res[0], k_const_rounding);
+ res[1] = _mm_add_epi16(res[1], k_const_rounding);
+ res[2] = _mm_add_epi16(res[2], k_const_rounding);
+ res[3] = _mm_add_epi16(res[3], k_const_rounding);
+ res[4] = _mm_add_epi16(res[4], k_const_rounding);
+ res[5] = _mm_add_epi16(res[5], k_const_rounding);
+ res[6] = _mm_add_epi16(res[6], k_const_rounding);
+ res[7] = _mm_add_epi16(res[7], k_const_rounding);
+ }
+
+ res[0] = _mm_sub_epi16(res[0], sign0);
+ res[1] = _mm_sub_epi16(res[1], sign1);
+ res[2] = _mm_sub_epi16(res[2], sign2);
+ res[3] = _mm_sub_epi16(res[3], sign3);
+ res[4] = _mm_sub_epi16(res[4], sign4);
+ res[5] = _mm_sub_epi16(res[5], sign5);
+ res[6] = _mm_sub_epi16(res[6], sign6);
+ res[7] = _mm_sub_epi16(res[7], sign7);
+
+ res[0] = _mm_srai_epi16(res[0], bit);
+ res[1] = _mm_srai_epi16(res[1], bit);
+ res[2] = _mm_srai_epi16(res[2], bit);
+ res[3] = _mm_srai_epi16(res[3], bit);
+ res[4] = _mm_srai_epi16(res[4], bit);
+ res[5] = _mm_srai_epi16(res[5], bit);
+ res[6] = _mm_srai_epi16(res[6], bit);
+ res[7] = _mm_srai_epi16(res[7], bit);
+}
+
+// write 8x8 array
+static INLINE void write_buffer_8x8_avx2(int16_t *output, __m128i *res, int stride) {
+ _mm_store_si128((__m128i *)(output + 0 * stride), res[0]);
+ _mm_store_si128((__m128i *)(output + 1 * stride), res[1]);
+ _mm_store_si128((__m128i *)(output + 2 * stride), res[2]);
+ _mm_store_si128((__m128i *)(output + 3 * stride), res[3]);
+ _mm_store_si128((__m128i *)(output + 4 * stride), res[4]);
+ _mm_store_si128((__m128i *)(output + 5 * stride), res[5]);
+ _mm_store_si128((__m128i *)(output + 6 * stride), res[6]);
+ _mm_store_si128((__m128i *)(output + 7 * stride), res[7]);
+}
+
+// perform in-place transpose
+static INLINE void array_transpose_8x8_avx2(__m128i *in, __m128i *res) {
+ const __m128i tr0_0 = _mm_unpacklo_epi16(in[0], in[1]);
+ const __m128i tr0_1 = _mm_unpacklo_epi16(in[2], in[3]);
+ const __m128i tr0_2 = _mm_unpackhi_epi16(in[0], in[1]);
+ const __m128i tr0_3 = _mm_unpackhi_epi16(in[2], in[3]);
+ const __m128i tr0_4 = _mm_unpacklo_epi16(in[4], in[5]);
+ const __m128i tr0_5 = _mm_unpacklo_epi16(in[6], in[7]);
+ const __m128i tr0_6 = _mm_unpackhi_epi16(in[4], in[5]);
+ const __m128i tr0_7 = _mm_unpackhi_epi16(in[6], in[7]);
+ // 00 10 01 11 02 12 03 13
+ // 20 30 21 31 22 32 23 33
+ // 04 14 05 15 06 16 07 17
+ // 24 34 25 35 26 36 27 37
+ // 40 50 41 51 42 52 43 53
+ // 60 70 61 71 62 72 63 73
+ // 44 54 45 55 46 56 47 57
+ // 64 74 65 75 66 76 67 77
+ const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_4, tr0_5);
+ const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_4, tr0_5);
+ const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_2, tr0_3);
+ const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7);
+ const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_2, tr0_3);
+ const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7);
+ // 00 10 20 30 01 11 21 31
+ // 40 50 60 70 41 51 61 71
+ // 02 12 22 32 03 13 23 33
+ // 42 52 62 72 43 53 63 73
+ // 04 14 24 34 05 15 25 35
+ // 44 54 64 74 45 55 65 75
+ // 06 16 26 36 07 17 27 37
+ // 46 56 66 76 47 57 67 77
+ res[0] = _mm_unpacklo_epi64(tr1_0, tr1_1);
+ res[1] = _mm_unpackhi_epi64(tr1_0, tr1_1);
+ res[2] = _mm_unpacklo_epi64(tr1_2, tr1_3);
+ res[3] = _mm_unpackhi_epi64(tr1_2, tr1_3);
+ res[4] = _mm_unpacklo_epi64(tr1_4, tr1_5);
+ res[5] = _mm_unpackhi_epi64(tr1_4, tr1_5);
+ res[6] = _mm_unpacklo_epi64(tr1_6, tr1_7);
+ res[7] = _mm_unpackhi_epi64(tr1_6, tr1_7);
+ // 00 10 20 30 40 50 60 70
+ // 01 11 21 31 41 51 61 71
+ // 02 12 22 32 42 52 62 72
+ // 03 13 23 33 43 53 63 73
+ // 04 14 24 34 44 54 64 74
+ // 05 15 25 35 45 55 65 75
+ // 06 16 26 36 46 56 66 76
+ // 07 17 27 37 47 57 67 77
+}
+
+void fdct8_avx2(__m128i *in) {
+ // constants
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64);
+ const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64);
+ const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64);
+ const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ __m128i u0, u1, u2, u3, u4, u5, u6, u7;
+ __m128i v0, v1, v2, v3, v4, v5, v6, v7;
+ __m128i s0, s1, s2, s3, s4, s5, s6, s7;
+
+ // stage 1
+ s0 = _mm_add_epi16(in[0], in[7]);
+ s1 = _mm_add_epi16(in[1], in[6]);
+ s2 = _mm_add_epi16(in[2], in[5]);
+ s3 = _mm_add_epi16(in[3], in[4]);
+ s4 = _mm_sub_epi16(in[3], in[4]);
+ s5 = _mm_sub_epi16(in[2], in[5]);
+ s6 = _mm_sub_epi16(in[1], in[6]);
+ s7 = _mm_sub_epi16(in[0], in[7]);
+
+ u0 = _mm_add_epi16(s0, s3);
+ u1 = _mm_add_epi16(s1, s2);
+ u2 = _mm_sub_epi16(s1, s2);
+ u3 = _mm_sub_epi16(s0, s3);
+ // interleave and perform butterfly multiplication/addition
+ v0 = _mm_unpacklo_epi16(u0, u1);
+ v1 = _mm_unpackhi_epi16(u0, u1);
+ v2 = _mm_unpacklo_epi16(u2, u3);
+ v3 = _mm_unpackhi_epi16(u2, u3);
+
+ u0 = _mm_madd_epi16(v0, k__cospi_p16_p16);
+ u1 = _mm_madd_epi16(v1, k__cospi_p16_p16);
+ u2 = _mm_madd_epi16(v0, k__cospi_p16_m16);
+ u3 = _mm_madd_epi16(v1, k__cospi_p16_m16);
+ u4 = _mm_madd_epi16(v2, k__cospi_p24_p08);
+ u5 = _mm_madd_epi16(v3, k__cospi_p24_p08);
+ u6 = _mm_madd_epi16(v2, k__cospi_m08_p24);
+ u7 = _mm_madd_epi16(v3, k__cospi_m08_p24);
+
+ // shift and rounding
+ v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
+ v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING);
+ v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING);
+
+ u0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ u1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ u2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ u3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ u4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ u5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ u6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ u7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+
+ in[0] = _mm_packs_epi32(u0, u1);
+ in[2] = _mm_packs_epi32(u4, u5);
+ in[4] = _mm_packs_epi32(u2, u3);
+ in[6] = _mm_packs_epi32(u6, u7);
+
+ // stage 2
+ // interleave and perform butterfly multiplication/addition
+ u0 = _mm_unpacklo_epi16(s6, s5);
+ u1 = _mm_unpackhi_epi16(s6, s5);
+ v0 = _mm_madd_epi16(u0, k__cospi_p16_m16);
+ v1 = _mm_madd_epi16(u1, k__cospi_p16_m16);
+ v2 = _mm_madd_epi16(u0, k__cospi_p16_p16);
+ v3 = _mm_madd_epi16(u1, k__cospi_p16_p16);
+
+ // shift and rounding
+ u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING);
+ u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING);
+ u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING);
+ u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING);
+
+ v0 = _mm_srai_epi32(u0, DCT_CONST_BITS);
+ v1 = _mm_srai_epi32(u1, DCT_CONST_BITS);
+ v2 = _mm_srai_epi32(u2, DCT_CONST_BITS);
+ v3 = _mm_srai_epi32(u3, DCT_CONST_BITS);
+
+ u0 = _mm_packs_epi32(v0, v1);
+ u1 = _mm_packs_epi32(v2, v3);
+
+ // stage 3
+ s0 = _mm_add_epi16(s4, u0);
+ s1 = _mm_sub_epi16(s4, u0);
+ s2 = _mm_sub_epi16(s7, u1);
+ s3 = _mm_add_epi16(s7, u1);
+
+ // stage 4
+ u0 = _mm_unpacklo_epi16(s0, s3);
+ u1 = _mm_unpackhi_epi16(s0, s3);
+ u2 = _mm_unpacklo_epi16(s1, s2);
+ u3 = _mm_unpackhi_epi16(s1, s2);
+
+ v0 = _mm_madd_epi16(u0, k__cospi_p28_p04);
+ v1 = _mm_madd_epi16(u1, k__cospi_p28_p04);
+ v2 = _mm_madd_epi16(u2, k__cospi_p12_p20);
+ v3 = _mm_madd_epi16(u3, k__cospi_p12_p20);
+ v4 = _mm_madd_epi16(u2, k__cospi_m20_p12);
+ v5 = _mm_madd_epi16(u3, k__cospi_m20_p12);
+ v6 = _mm_madd_epi16(u0, k__cospi_m04_p28);
+ v7 = _mm_madd_epi16(u1, k__cospi_m04_p28);
+
+ // shift and rounding
+ u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING);
+ u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING);
+ u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING);
+ u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING);
+ u4 = _mm_add_epi32(v4, k__DCT_CONST_ROUNDING);
+ u5 = _mm_add_epi32(v5, k__DCT_CONST_ROUNDING);
+ u6 = _mm_add_epi32(v6, k__DCT_CONST_ROUNDING);
+ u7 = _mm_add_epi32(v7, k__DCT_CONST_ROUNDING);
+
+ v0 = _mm_srai_epi32(u0, DCT_CONST_BITS);
+ v1 = _mm_srai_epi32(u1, DCT_CONST_BITS);
+ v2 = _mm_srai_epi32(u2, DCT_CONST_BITS);
+ v3 = _mm_srai_epi32(u3, DCT_CONST_BITS);
+ v4 = _mm_srai_epi32(u4, DCT_CONST_BITS);
+ v5 = _mm_srai_epi32(u5, DCT_CONST_BITS);
+ v6 = _mm_srai_epi32(u6, DCT_CONST_BITS);
+ v7 = _mm_srai_epi32(u7, DCT_CONST_BITS);
+
+ in[1] = _mm_packs_epi32(v0, v1);
+ in[3] = _mm_packs_epi32(v4, v5);
+ in[5] = _mm_packs_epi32(v2, v3);
+ in[7] = _mm_packs_epi32(v6, v7);
+
+ // transpose
+ array_transpose_8x8_avx2(in, in);
+}
+
+void fadst8_avx2(__m128i *in) {
+ // Constants
+ const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64);
+ const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64);
+ const __m128i k__cospi_p10_p22 = pair_set_epi16(cospi_10_64, cospi_22_64);
+ const __m128i k__cospi_p22_m10 = pair_set_epi16(cospi_22_64, -cospi_10_64);
+ const __m128i k__cospi_p18_p14 = pair_set_epi16(cospi_18_64, cospi_14_64);
+ const __m128i k__cospi_p14_m18 = pair_set_epi16(cospi_14_64, -cospi_18_64);
+ const __m128i k__cospi_p26_p06 = pair_set_epi16(cospi_26_64, cospi_6_64);
+ const __m128i k__cospi_p06_m26 = pair_set_epi16(cospi_6_64, -cospi_26_64);
+ const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64);
+ const __m128i k__cospi_m24_p08 = pair_set_epi16(-cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__const_0 = _mm_set1_epi16(0);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+
+ __m128i u0, u1, u2, u3, u4, u5, u6, u7, u8, u9, u10, u11, u12, u13, u14, u15;
+ __m128i v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15;
+ __m128i w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15;
+ __m128i s0, s1, s2, s3, s4, s5, s6, s7;
+ __m128i in0, in1, in2, in3, in4, in5, in6, in7;
+
+ // properly aligned for butterfly input
+ in0 = in[7];
+ in1 = in[0];
+ in2 = in[5];
+ in3 = in[2];
+ in4 = in[3];
+ in5 = in[4];
+ in6 = in[1];
+ in7 = in[6];
+
+ // column transformation
+ // stage 1
+ // interleave and multiply/add into 32-bit integer
+ s0 = _mm_unpacklo_epi16(in0, in1);
+ s1 = _mm_unpackhi_epi16(in0, in1);
+ s2 = _mm_unpacklo_epi16(in2, in3);
+ s3 = _mm_unpackhi_epi16(in2, in3);
+ s4 = _mm_unpacklo_epi16(in4, in5);
+ s5 = _mm_unpackhi_epi16(in4, in5);
+ s6 = _mm_unpacklo_epi16(in6, in7);
+ s7 = _mm_unpackhi_epi16(in6, in7);
+
+ u0 = _mm_madd_epi16(s0, k__cospi_p02_p30);
+ u1 = _mm_madd_epi16(s1, k__cospi_p02_p30);
+ u2 = _mm_madd_epi16(s0, k__cospi_p30_m02);
+ u3 = _mm_madd_epi16(s1, k__cospi_p30_m02);
+ u4 = _mm_madd_epi16(s2, k__cospi_p10_p22);
+ u5 = _mm_madd_epi16(s3, k__cospi_p10_p22);
+ u6 = _mm_madd_epi16(s2, k__cospi_p22_m10);
+ u7 = _mm_madd_epi16(s3, k__cospi_p22_m10);
+ u8 = _mm_madd_epi16(s4, k__cospi_p18_p14);
+ u9 = _mm_madd_epi16(s5, k__cospi_p18_p14);
+ u10 = _mm_madd_epi16(s4, k__cospi_p14_m18);
+ u11 = _mm_madd_epi16(s5, k__cospi_p14_m18);
+ u12 = _mm_madd_epi16(s6, k__cospi_p26_p06);
+ u13 = _mm_madd_epi16(s7, k__cospi_p26_p06);
+ u14 = _mm_madd_epi16(s6, k__cospi_p06_m26);
+ u15 = _mm_madd_epi16(s7, k__cospi_p06_m26);
+
+ // addition
+ w0 = _mm_add_epi32(u0, u8);
+ w1 = _mm_add_epi32(u1, u9);
+ w2 = _mm_add_epi32(u2, u10);
+ w3 = _mm_add_epi32(u3, u11);
+ w4 = _mm_add_epi32(u4, u12);
+ w5 = _mm_add_epi32(u5, u13);
+ w6 = _mm_add_epi32(u6, u14);
+ w7 = _mm_add_epi32(u7, u15);
+ w8 = _mm_sub_epi32(u0, u8);
+ w9 = _mm_sub_epi32(u1, u9);
+ w10 = _mm_sub_epi32(u2, u10);
+ w11 = _mm_sub_epi32(u3, u11);
+ w12 = _mm_sub_epi32(u4, u12);
+ w13 = _mm_sub_epi32(u5, u13);
+ w14 = _mm_sub_epi32(u6, u14);
+ w15 = _mm_sub_epi32(u7, u15);
+
+ // shift and rounding
+ v0 = _mm_add_epi32(w0, k__DCT_CONST_ROUNDING);
+ v1 = _mm_add_epi32(w1, k__DCT_CONST_ROUNDING);
+ v2 = _mm_add_epi32(w2, k__DCT_CONST_ROUNDING);
+ v3 = _mm_add_epi32(w3, k__DCT_CONST_ROUNDING);
+ v4 = _mm_add_epi32(w4, k__DCT_CONST_ROUNDING);
+ v5 = _mm_add_epi32(w5, k__DCT_CONST_ROUNDING);
+ v6 = _mm_add_epi32(w6, k__DCT_CONST_ROUNDING);
+ v7 = _mm_add_epi32(w7, k__DCT_CONST_ROUNDING);
+ v8 = _mm_add_epi32(w8, k__DCT_CONST_ROUNDING);
+ v9 = _mm_add_epi32(w9, k__DCT_CONST_ROUNDING);
+ v10 = _mm_add_epi32(w10, k__DCT_CONST_ROUNDING);
+ v11 = _mm_add_epi32(w11, k__DCT_CONST_ROUNDING);
+ v12 = _mm_add_epi32(w12, k__DCT_CONST_ROUNDING);
+ v13 = _mm_add_epi32(w13, k__DCT_CONST_ROUNDING);
+ v14 = _mm_add_epi32(w14, k__DCT_CONST_ROUNDING);
+ v15 = _mm_add_epi32(w15, k__DCT_CONST_ROUNDING);
+
+ u0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ u1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ u2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ u3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ u4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ u5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ u6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ u7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+ u8 = _mm_srai_epi32(v8, DCT_CONST_BITS);
+ u9 = _mm_srai_epi32(v9, DCT_CONST_BITS);
+ u10 = _mm_srai_epi32(v10, DCT_CONST_BITS);
+ u11 = _mm_srai_epi32(v11, DCT_CONST_BITS);
+ u12 = _mm_srai_epi32(v12, DCT_CONST_BITS);
+ u13 = _mm_srai_epi32(v13, DCT_CONST_BITS);
+ u14 = _mm_srai_epi32(v14, DCT_CONST_BITS);
+ u15 = _mm_srai_epi32(v15, DCT_CONST_BITS);
+
+ // back to 16-bit and pack 8 integers into __m128i
+ in[0] = _mm_packs_epi32(u0, u1);
+ in[1] = _mm_packs_epi32(u2, u3);
+ in[2] = _mm_packs_epi32(u4, u5);
+ in[3] = _mm_packs_epi32(u6, u7);
+ in[4] = _mm_packs_epi32(u8, u9);
+ in[5] = _mm_packs_epi32(u10, u11);
+ in[6] = _mm_packs_epi32(u12, u13);
+ in[7] = _mm_packs_epi32(u14, u15);
+
+ // stage 2
+ s0 = _mm_add_epi16(in[0], in[2]);
+ s1 = _mm_add_epi16(in[1], in[3]);
+ s2 = _mm_sub_epi16(in[0], in[2]);
+ s3 = _mm_sub_epi16(in[1], in[3]);
+ u0 = _mm_unpacklo_epi16(in[4], in[5]);
+ u1 = _mm_unpackhi_epi16(in[4], in[5]);
+ u2 = _mm_unpacklo_epi16(in[6], in[7]);
+ u3 = _mm_unpackhi_epi16(in[6], in[7]);
+
+ v0 = _mm_madd_epi16(u0, k__cospi_p08_p24);
+ v1 = _mm_madd_epi16(u1, k__cospi_p08_p24);
+ v2 = _mm_madd_epi16(u0, k__cospi_p24_m08);
+ v3 = _mm_madd_epi16(u1, k__cospi_p24_m08);
+ v4 = _mm_madd_epi16(u2, k__cospi_m24_p08);
+ v5 = _mm_madd_epi16(u3, k__cospi_m24_p08);
+ v6 = _mm_madd_epi16(u2, k__cospi_p08_p24);
+ v7 = _mm_madd_epi16(u3, k__cospi_p08_p24);
+
+ w0 = _mm_add_epi32(v0, v4);
+ w1 = _mm_add_epi32(v1, v5);
+ w2 = _mm_add_epi32(v2, v6);
+ w3 = _mm_add_epi32(v3, v7);
+ w4 = _mm_sub_epi32(v0, v4);
+ w5 = _mm_sub_epi32(v1, v5);
+ w6 = _mm_sub_epi32(v2, v6);
+ w7 = _mm_sub_epi32(v3, v7);
+
+ v0 = _mm_add_epi32(w0, k__DCT_CONST_ROUNDING);
+ v1 = _mm_add_epi32(w1, k__DCT_CONST_ROUNDING);
+ v2 = _mm_add_epi32(w2, k__DCT_CONST_ROUNDING);
+ v3 = _mm_add_epi32(w3, k__DCT_CONST_ROUNDING);
+ v4 = _mm_add_epi32(w4, k__DCT_CONST_ROUNDING);
+ v5 = _mm_add_epi32(w5, k__DCT_CONST_ROUNDING);
+ v6 = _mm_add_epi32(w6, k__DCT_CONST_ROUNDING);
+ v7 = _mm_add_epi32(w7, k__DCT_CONST_ROUNDING);
+
+ u0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ u1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ u2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ u3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ u4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ u5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ u6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ u7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+
+ // back to 16-bit intergers
+ s4 = _mm_packs_epi32(u0, u1);
+ s5 = _mm_packs_epi32(u2, u3);
+ s6 = _mm_packs_epi32(u4, u5);
+ s7 = _mm_packs_epi32(u6, u7);
+
+ // stage 3
+ u0 = _mm_unpacklo_epi16(s2, s3);
+ u1 = _mm_unpackhi_epi16(s2, s3);
+ u2 = _mm_unpacklo_epi16(s6, s7);
+ u3 = _mm_unpackhi_epi16(s6, s7);
+
+ v0 = _mm_madd_epi16(u0, k__cospi_p16_p16);
+ v1 = _mm_madd_epi16(u1, k__cospi_p16_p16);
+ v2 = _mm_madd_epi16(u0, k__cospi_p16_m16);
+ v3 = _mm_madd_epi16(u1, k__cospi_p16_m16);
+ v4 = _mm_madd_epi16(u2, k__cospi_p16_p16);
+ v5 = _mm_madd_epi16(u3, k__cospi_p16_p16);
+ v6 = _mm_madd_epi16(u2, k__cospi_p16_m16);
+ v7 = _mm_madd_epi16(u3, k__cospi_p16_m16);
+
+ u0 = _mm_add_epi32(v0, k__DCT_CONST_ROUNDING);
+ u1 = _mm_add_epi32(v1, k__DCT_CONST_ROUNDING);
+ u2 = _mm_add_epi32(v2, k__DCT_CONST_ROUNDING);
+ u3 = _mm_add_epi32(v3, k__DCT_CONST_ROUNDING);
+ u4 = _mm_add_epi32(v4, k__DCT_CONST_ROUNDING);
+ u5 = _mm_add_epi32(v5, k__DCT_CONST_ROUNDING);
+ u6 = _mm_add_epi32(v6, k__DCT_CONST_ROUNDING);
+ u7 = _mm_add_epi32(v7, k__DCT_CONST_ROUNDING);
+
+ v0 = _mm_srai_epi32(u0, DCT_CONST_BITS);
+ v1 = _mm_srai_epi32(u1, DCT_CONST_BITS);
+ v2 = _mm_srai_epi32(u2, DCT_CONST_BITS);
+ v3 = _mm_srai_epi32(u3, DCT_CONST_BITS);
+ v4 = _mm_srai_epi32(u4, DCT_CONST_BITS);
+ v5 = _mm_srai_epi32(u5, DCT_CONST_BITS);
+ v6 = _mm_srai_epi32(u6, DCT_CONST_BITS);
+ v7 = _mm_srai_epi32(u7, DCT_CONST_BITS);
+
+ s2 = _mm_packs_epi32(v0, v1);
+ s3 = _mm_packs_epi32(v2, v3);
+ s6 = _mm_packs_epi32(v4, v5);
+ s7 = _mm_packs_epi32(v6, v7);
+
+ // FIXME(jingning): do subtract using bit inversion?
+ in[0] = s0;
+ in[1] = _mm_sub_epi16(k__const_0, s4);
+ in[2] = s6;
+ in[3] = _mm_sub_epi16(k__const_0, s2);
+ in[4] = s3;
+ in[5] = _mm_sub_epi16(k__const_0, s7);
+ in[6] = s5;
+ in[7] = _mm_sub_epi16(k__const_0, s1);
+
+ // transpose
+ array_transpose_8x8_avx2(in, in);
+}
+
+void vp9_fht8x8_avx2(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
+ __m128i in[8];
+
+ switch (tx_type) {
+ case DCT_DCT:
+ vp9_fdct8x8_avx2(input, output, stride);
+ break;
+ case ADST_DCT:
+ load_buffer_8x8_avx2(input, in, stride);
+ fadst8_avx2(in);
+ fdct8_avx2(in);
+ right_shift_8x8_avx2(in, 1);
+ write_buffer_8x8_avx2(output, in, 8);
+ break;
+ case DCT_ADST:
+ load_buffer_8x8_avx2(input, in, stride);
+ fdct8_avx2(in);
+ fadst8_avx2(in);
+ right_shift_8x8_avx2(in, 1);
+ write_buffer_8x8_avx2(output, in, 8);
+ break;
+ case ADST_ADST:
+ load_buffer_8x8_avx2(input, in, stride);
+ fadst8_avx2(in);
+ fadst8_avx2(in);
+ right_shift_8x8_avx2(in, 1);
+ write_buffer_8x8_avx2(output, in, 8);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+void vp9_fdct16x16_avx2(const int16_t *input, int16_t *output, int stride) {
+ // The 2D transform is done with two passes which are actually pretty
+ // similar. In the first one, we transform the columns and transpose
+ // the results. In the second one, we transform the rows. To achieve that,
+ // as the first pass results are transposed, we transpose the columns (that
+ // is the transposed rows) and transpose the results (so that it goes back
+ // in normal/row positions).
+ int pass;
+ // We need an intermediate buffer between passes.
+ DECLARE_ALIGNED_ARRAY(16, int16_t, intermediate, 256);
+ const int16_t *in = input;
+ int16_t *out = intermediate;
+ // Constants
+ // When we use them, in one case, they are all the same. In all others
+ // it's a pair of them that we need to repeat four times. This is done
+ // by constructing the 32 bit constant corresponding to that pair.
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_m24_m08 = pair_set_epi16(-cospi_24_64, -cospi_8_64);
+ const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64);
+ const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64);
+ const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64);
+ const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64);
+ const __m128i k__cospi_p30_p02 = pair_set_epi16(cospi_30_64, cospi_2_64);
+ const __m128i k__cospi_p14_p18 = pair_set_epi16(cospi_14_64, cospi_18_64);
+ const __m128i k__cospi_m02_p30 = pair_set_epi16(-cospi_2_64, cospi_30_64);
+ const __m128i k__cospi_m18_p14 = pair_set_epi16(-cospi_18_64, cospi_14_64);
+ const __m128i k__cospi_p22_p10 = pair_set_epi16(cospi_22_64, cospi_10_64);
+ const __m128i k__cospi_p06_p26 = pair_set_epi16(cospi_6_64, cospi_26_64);
+ const __m128i k__cospi_m10_p22 = pair_set_epi16(-cospi_10_64, cospi_22_64);
+ const __m128i k__cospi_m26_p06 = pair_set_epi16(-cospi_26_64, cospi_6_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ const __m128i kOne = _mm_set1_epi16(1);
+ // Do the two transform/transpose passes
+ for (pass = 0; pass < 2; ++pass) {
+ // We process eight columns (transposed rows in second pass) at a time.
+ int column_start;
+ for (column_start = 0; column_start < 16; column_start += 8) {
+ __m128i in00, in01, in02, in03, in04, in05, in06, in07;
+ __m128i in08, in09, in10, in11, in12, in13, in14, in15;
+ __m128i input0, input1, input2, input3, input4, input5, input6, input7;
+ __m128i step1_0, step1_1, step1_2, step1_3;
+ __m128i step1_4, step1_5, step1_6, step1_7;
+ __m128i step2_1, step2_2, step2_3, step2_4, step2_5, step2_6;
+ __m128i step3_0, step3_1, step3_2, step3_3;
+ __m128i step3_4, step3_5, step3_6, step3_7;
+ __m128i res00, res01, res02, res03, res04, res05, res06, res07;
+ __m128i res08, res09, res10, res11, res12, res13, res14, res15;
+ // Load and pre-condition input.
+ if (0 == pass) {
+ in00 = _mm_load_si128((const __m128i *)(in + 0 * stride));
+ in01 = _mm_load_si128((const __m128i *)(in + 1 * stride));
+ in02 = _mm_load_si128((const __m128i *)(in + 2 * stride));
+ in03 = _mm_load_si128((const __m128i *)(in + 3 * stride));
+ in04 = _mm_load_si128((const __m128i *)(in + 4 * stride));
+ in05 = _mm_load_si128((const __m128i *)(in + 5 * stride));
+ in06 = _mm_load_si128((const __m128i *)(in + 6 * stride));
+ in07 = _mm_load_si128((const __m128i *)(in + 7 * stride));
+ in08 = _mm_load_si128((const __m128i *)(in + 8 * stride));
+ in09 = _mm_load_si128((const __m128i *)(in + 9 * stride));
+ in10 = _mm_load_si128((const __m128i *)(in + 10 * stride));
+ in11 = _mm_load_si128((const __m128i *)(in + 11 * stride));
+ in12 = _mm_load_si128((const __m128i *)(in + 12 * stride));
+ in13 = _mm_load_si128((const __m128i *)(in + 13 * stride));
+ in14 = _mm_load_si128((const __m128i *)(in + 14 * stride));
+ in15 = _mm_load_si128((const __m128i *)(in + 15 * stride));
+ // x = x << 2
+ in00 = _mm_slli_epi16(in00, 2);
+ in01 = _mm_slli_epi16(in01, 2);
+ in02 = _mm_slli_epi16(in02, 2);
+ in03 = _mm_slli_epi16(in03, 2);
+ in04 = _mm_slli_epi16(in04, 2);
+ in05 = _mm_slli_epi16(in05, 2);
+ in06 = _mm_slli_epi16(in06, 2);
+ in07 = _mm_slli_epi16(in07, 2);
+ in08 = _mm_slli_epi16(in08, 2);
+ in09 = _mm_slli_epi16(in09, 2);
+ in10 = _mm_slli_epi16(in10, 2);
+ in11 = _mm_slli_epi16(in11, 2);
+ in12 = _mm_slli_epi16(in12, 2);
+ in13 = _mm_slli_epi16(in13, 2);
+ in14 = _mm_slli_epi16(in14, 2);
+ in15 = _mm_slli_epi16(in15, 2);
+ } else {
+ in00 = _mm_load_si128((const __m128i *)(in + 0 * 16));
+ in01 = _mm_load_si128((const __m128i *)(in + 1 * 16));
+ in02 = _mm_load_si128((const __m128i *)(in + 2 * 16));
+ in03 = _mm_load_si128((const __m128i *)(in + 3 * 16));
+ in04 = _mm_load_si128((const __m128i *)(in + 4 * 16));
+ in05 = _mm_load_si128((const __m128i *)(in + 5 * 16));
+ in06 = _mm_load_si128((const __m128i *)(in + 6 * 16));
+ in07 = _mm_load_si128((const __m128i *)(in + 7 * 16));
+ in08 = _mm_load_si128((const __m128i *)(in + 8 * 16));
+ in09 = _mm_load_si128((const __m128i *)(in + 9 * 16));
+ in10 = _mm_load_si128((const __m128i *)(in + 10 * 16));
+ in11 = _mm_load_si128((const __m128i *)(in + 11 * 16));
+ in12 = _mm_load_si128((const __m128i *)(in + 12 * 16));
+ in13 = _mm_load_si128((const __m128i *)(in + 13 * 16));
+ in14 = _mm_load_si128((const __m128i *)(in + 14 * 16));
+ in15 = _mm_load_si128((const __m128i *)(in + 15 * 16));
+ // x = (x + 1) >> 2
+ in00 = _mm_add_epi16(in00, kOne);
+ in01 = _mm_add_epi16(in01, kOne);
+ in02 = _mm_add_epi16(in02, kOne);
+ in03 = _mm_add_epi16(in03, kOne);
+ in04 = _mm_add_epi16(in04, kOne);
+ in05 = _mm_add_epi16(in05, kOne);
+ in06 = _mm_add_epi16(in06, kOne);
+ in07 = _mm_add_epi16(in07, kOne);
+ in08 = _mm_add_epi16(in08, kOne);
+ in09 = _mm_add_epi16(in09, kOne);
+ in10 = _mm_add_epi16(in10, kOne);
+ in11 = _mm_add_epi16(in11, kOne);
+ in12 = _mm_add_epi16(in12, kOne);
+ in13 = _mm_add_epi16(in13, kOne);
+ in14 = _mm_add_epi16(in14, kOne);
+ in15 = _mm_add_epi16(in15, kOne);
+ in00 = _mm_srai_epi16(in00, 2);
+ in01 = _mm_srai_epi16(in01, 2);
+ in02 = _mm_srai_epi16(in02, 2);
+ in03 = _mm_srai_epi16(in03, 2);
+ in04 = _mm_srai_epi16(in04, 2);
+ in05 = _mm_srai_epi16(in05, 2);
+ in06 = _mm_srai_epi16(in06, 2);
+ in07 = _mm_srai_epi16(in07, 2);
+ in08 = _mm_srai_epi16(in08, 2);
+ in09 = _mm_srai_epi16(in09, 2);
+ in10 = _mm_srai_epi16(in10, 2);
+ in11 = _mm_srai_epi16(in11, 2);
+ in12 = _mm_srai_epi16(in12, 2);
+ in13 = _mm_srai_epi16(in13, 2);
+ in14 = _mm_srai_epi16(in14, 2);
+ in15 = _mm_srai_epi16(in15, 2);
+ }
+ in += 8;
+ // Calculate input for the first 8 results.
+ {
+ input0 = _mm_add_epi16(in00, in15);
+ input1 = _mm_add_epi16(in01, in14);
+ input2 = _mm_add_epi16(in02, in13);
+ input3 = _mm_add_epi16(in03, in12);
+ input4 = _mm_add_epi16(in04, in11);
+ input5 = _mm_add_epi16(in05, in10);
+ input6 = _mm_add_epi16(in06, in09);
+ input7 = _mm_add_epi16(in07, in08);
+ }
+ // Calculate input for the next 8 results.
+ {
+ step1_0 = _mm_sub_epi16(in07, in08);
+ step1_1 = _mm_sub_epi16(in06, in09);
+ step1_2 = _mm_sub_epi16(in05, in10);
+ step1_3 = _mm_sub_epi16(in04, in11);
+ step1_4 = _mm_sub_epi16(in03, in12);
+ step1_5 = _mm_sub_epi16(in02, in13);
+ step1_6 = _mm_sub_epi16(in01, in14);
+ step1_7 = _mm_sub_epi16(in00, in15);
+ }
+ // Work on the first eight values; fdct8(input, even_results);
+ {
+ // Add/subtract
+ const __m128i q0 = _mm_add_epi16(input0, input7);
+ const __m128i q1 = _mm_add_epi16(input1, input6);
+ const __m128i q2 = _mm_add_epi16(input2, input5);
+ const __m128i q3 = _mm_add_epi16(input3, input4);
+ const __m128i q4 = _mm_sub_epi16(input3, input4);
+ const __m128i q5 = _mm_sub_epi16(input2, input5);
+ const __m128i q6 = _mm_sub_epi16(input1, input6);
+ const __m128i q7 = _mm_sub_epi16(input0, input7);
+ // Work on first four results
+ {
+ // Add/subtract
+ const __m128i r0 = _mm_add_epi16(q0, q3);
+ const __m128i r1 = _mm_add_epi16(q1, q2);
+ const __m128i r2 = _mm_sub_epi16(q1, q2);
+ const __m128i r3 = _mm_sub_epi16(q0, q3);
+ // Interleave to do the multiply by constants which gets us
+ // into 32 bits.
+ const __m128i t0 = _mm_unpacklo_epi16(r0, r1);
+ const __m128i t1 = _mm_unpackhi_epi16(r0, r1);
+ const __m128i t2 = _mm_unpacklo_epi16(r2, r3);
+ const __m128i t3 = _mm_unpackhi_epi16(r2, r3);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_p16);
+ const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16);
+ const __m128i u3 = _mm_madd_epi16(t1, k__cospi_p16_m16);
+ const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08);
+ const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p24_p08);
+ const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24);
+ const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m08_p24);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
+ const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING);
+ const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+ // Combine
+ res00 = _mm_packs_epi32(w0, w1);
+ res08 = _mm_packs_epi32(w2, w3);
+ res04 = _mm_packs_epi32(w4, w5);
+ res12 = _mm_packs_epi32(w6, w7);
+ }
+ // Work on next four results
+ {
+ // Interleave to do the multiply by constants which gets us
+ // into 32 bits.
+ const __m128i d0 = _mm_unpacklo_epi16(q6, q5);
+ const __m128i d1 = _mm_unpackhi_epi16(q6, q5);
+ const __m128i e0 = _mm_madd_epi16(d0, k__cospi_p16_m16);
+ const __m128i e1 = _mm_madd_epi16(d1, k__cospi_p16_m16);
+ const __m128i e2 = _mm_madd_epi16(d0, k__cospi_p16_p16);
+ const __m128i e3 = _mm_madd_epi16(d1, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m128i f0 = _mm_add_epi32(e0, k__DCT_CONST_ROUNDING);
+ const __m128i f1 = _mm_add_epi32(e1, k__DCT_CONST_ROUNDING);
+ const __m128i f2 = _mm_add_epi32(e2, k__DCT_CONST_ROUNDING);
+ const __m128i f3 = _mm_add_epi32(e3, k__DCT_CONST_ROUNDING);
+ const __m128i s0 = _mm_srai_epi32(f0, DCT_CONST_BITS);
+ const __m128i s1 = _mm_srai_epi32(f1, DCT_CONST_BITS);
+ const __m128i s2 = _mm_srai_epi32(f2, DCT_CONST_BITS);
+ const __m128i s3 = _mm_srai_epi32(f3, DCT_CONST_BITS);
+ // Combine
+ const __m128i r0 = _mm_packs_epi32(s0, s1);
+ const __m128i r1 = _mm_packs_epi32(s2, s3);
+ // Add/subtract
+ const __m128i x0 = _mm_add_epi16(q4, r0);
+ const __m128i x1 = _mm_sub_epi16(q4, r0);
+ const __m128i x2 = _mm_sub_epi16(q7, r1);
+ const __m128i x3 = _mm_add_epi16(q7, r1);
+ // Interleave to do the multiply by constants which gets us
+ // into 32 bits.
+ const __m128i t0 = _mm_unpacklo_epi16(x0, x3);
+ const __m128i t1 = _mm_unpackhi_epi16(x0, x3);
+ const __m128i t2 = _mm_unpacklo_epi16(x1, x2);
+ const __m128i t3 = _mm_unpackhi_epi16(x1, x2);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p28_p04);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p28_p04);
+ const __m128i u2 = _mm_madd_epi16(t0, k__cospi_m04_p28);
+ const __m128i u3 = _mm_madd_epi16(t1, k__cospi_m04_p28);
+ const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p12_p20);
+ const __m128i u5 = _mm_madd_epi16(t3, k__cospi_p12_p20);
+ const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m20_p12);
+ const __m128i u7 = _mm_madd_epi16(t3, k__cospi_m20_p12);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
+ const __m128i v5 = _mm_add_epi32(u5, k__DCT_CONST_ROUNDING);
+ const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ const __m128i v7 = _mm_add_epi32(u7, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
+ const __m128i w5 = _mm_srai_epi32(v5, DCT_CONST_BITS);
+ const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
+ const __m128i w7 = _mm_srai_epi32(v7, DCT_CONST_BITS);
+ // Combine
+ res02 = _mm_packs_epi32(w0, w1);
+ res14 = _mm_packs_epi32(w2, w3);
+ res10 = _mm_packs_epi32(w4, w5);
+ res06 = _mm_packs_epi32(w6, w7);
+ }
+ }
+ // Work on the next eight values; step1 -> odd_results
+ {
+ // step 2
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step1_5, step1_2);
+ const __m128i t1 = _mm_unpackhi_epi16(step1_5, step1_2);
+ const __m128i t2 = _mm_unpacklo_epi16(step1_4, step1_3);
+ const __m128i t3 = _mm_unpackhi_epi16(step1_4, step1_3);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_m16);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_m16);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_p16_m16);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_p16_m16);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ step2_2 = _mm_packs_epi32(w0, w1);
+ step2_3 = _mm_packs_epi32(w2, w3);
+ }
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step1_5, step1_2);
+ const __m128i t1 = _mm_unpackhi_epi16(step1_5, step1_2);
+ const __m128i t2 = _mm_unpacklo_epi16(step1_4, step1_3);
+ const __m128i t3 = _mm_unpackhi_epi16(step1_4, step1_3);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p16_p16);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_p16_p16);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_p16_p16);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ step2_5 = _mm_packs_epi32(w0, w1);
+ step2_4 = _mm_packs_epi32(w2, w3);
+ }
+ // step 3
+ {
+ step3_0 = _mm_add_epi16(step1_0, step2_3);
+ step3_1 = _mm_add_epi16(step1_1, step2_2);
+ step3_2 = _mm_sub_epi16(step1_1, step2_2);
+ step3_3 = _mm_sub_epi16(step1_0, step2_3);
+ step3_4 = _mm_sub_epi16(step1_7, step2_4);
+ step3_5 = _mm_sub_epi16(step1_6, step2_5);
+ step3_6 = _mm_add_epi16(step1_6, step2_5);
+ step3_7 = _mm_add_epi16(step1_7, step2_4);
+ }
+ // step 4
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step3_1, step3_6);
+ const __m128i t1 = _mm_unpackhi_epi16(step3_1, step3_6);
+ const __m128i t2 = _mm_unpacklo_epi16(step3_2, step3_5);
+ const __m128i t3 = _mm_unpackhi_epi16(step3_2, step3_5);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_m08_p24);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_m08_p24);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_m24_m08);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_m24_m08);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ step2_1 = _mm_packs_epi32(w0, w1);
+ step2_2 = _mm_packs_epi32(w2, w3);
+ }
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step3_1, step3_6);
+ const __m128i t1 = _mm_unpackhi_epi16(step3_1, step3_6);
+ const __m128i t2 = _mm_unpacklo_epi16(step3_2, step3_5);
+ const __m128i t3 = _mm_unpackhi_epi16(step3_2, step3_5);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p24_p08);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p24_p08);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_m08_p24);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_m08_p24);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ step2_6 = _mm_packs_epi32(w0, w1);
+ step2_5 = _mm_packs_epi32(w2, w3);
+ }
+ // step 5
+ {
+ step1_0 = _mm_add_epi16(step3_0, step2_1);
+ step1_1 = _mm_sub_epi16(step3_0, step2_1);
+ step1_2 = _mm_sub_epi16(step3_3, step2_2);
+ step1_3 = _mm_add_epi16(step3_3, step2_2);
+ step1_4 = _mm_add_epi16(step3_4, step2_5);
+ step1_5 = _mm_sub_epi16(step3_4, step2_5);
+ step1_6 = _mm_sub_epi16(step3_7, step2_6);
+ step1_7 = _mm_add_epi16(step3_7, step2_6);
+ }
+ // step 6
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step1_0, step1_7);
+ const __m128i t1 = _mm_unpackhi_epi16(step1_0, step1_7);
+ const __m128i t2 = _mm_unpacklo_epi16(step1_1, step1_6);
+ const __m128i t3 = _mm_unpackhi_epi16(step1_1, step1_6);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p30_p02);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p30_p02);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_p14_p18);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_p14_p18);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ res01 = _mm_packs_epi32(w0, w1);
+ res09 = _mm_packs_epi32(w2, w3);
+ }
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step1_2, step1_5);
+ const __m128i t1 = _mm_unpackhi_epi16(step1_2, step1_5);
+ const __m128i t2 = _mm_unpacklo_epi16(step1_3, step1_4);
+ const __m128i t3 = _mm_unpackhi_epi16(step1_3, step1_4);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p22_p10);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_p22_p10);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_p06_p26);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_p06_p26);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ res05 = _mm_packs_epi32(w0, w1);
+ res13 = _mm_packs_epi32(w2, w3);
+ }
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step1_2, step1_5);
+ const __m128i t1 = _mm_unpackhi_epi16(step1_2, step1_5);
+ const __m128i t2 = _mm_unpacklo_epi16(step1_3, step1_4);
+ const __m128i t3 = _mm_unpackhi_epi16(step1_3, step1_4);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_m10_p22);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_m10_p22);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_m26_p06);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_m26_p06);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ res11 = _mm_packs_epi32(w0, w1);
+ res03 = _mm_packs_epi32(w2, w3);
+ }
+ {
+ const __m128i t0 = _mm_unpacklo_epi16(step1_0, step1_7);
+ const __m128i t1 = _mm_unpackhi_epi16(step1_0, step1_7);
+ const __m128i t2 = _mm_unpacklo_epi16(step1_1, step1_6);
+ const __m128i t3 = _mm_unpackhi_epi16(step1_1, step1_6);
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_m02_p30);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_m02_p30);
+ const __m128i u2 = _mm_madd_epi16(t2, k__cospi_m18_p14);
+ const __m128i u3 = _mm_madd_epi16(t3, k__cospi_m18_p14);
+ // dct_const_round_shift
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // Combine
+ res15 = _mm_packs_epi32(w0, w1);
+ res07 = _mm_packs_epi32(w2, w3);
+ }
+ }
+ // Transpose the results, do it as two 8x8 transposes.
+ {
+ // 00 01 02 03 04 05 06 07
+ // 10 11 12 13 14 15 16 17
+ // 20 21 22 23 24 25 26 27
+ // 30 31 32 33 34 35 36 37
+ // 40 41 42 43 44 45 46 47
+ // 50 51 52 53 54 55 56 57
+ // 60 61 62 63 64 65 66 67
+ // 70 71 72 73 74 75 76 77
+ const __m128i tr0_0 = _mm_unpacklo_epi16(res00, res01);
+ const __m128i tr0_1 = _mm_unpacklo_epi16(res02, res03);
+ const __m128i tr0_2 = _mm_unpackhi_epi16(res00, res01);
+ const __m128i tr0_3 = _mm_unpackhi_epi16(res02, res03);
+ const __m128i tr0_4 = _mm_unpacklo_epi16(res04, res05);
+ const __m128i tr0_5 = _mm_unpacklo_epi16(res06, res07);
+ const __m128i tr0_6 = _mm_unpackhi_epi16(res04, res05);
+ const __m128i tr0_7 = _mm_unpackhi_epi16(res06, res07);
+ // 00 10 01 11 02 12 03 13
+ // 20 30 21 31 22 32 23 33
+ // 04 14 05 15 06 16 07 17
+ // 24 34 25 35 26 36 27 37
+ // 40 50 41 51 42 52 43 53
+ // 60 70 61 71 62 72 63 73
+ // 54 54 55 55 56 56 57 57
+ // 64 74 65 75 66 76 67 77
+ const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3);
+ const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3);
+ const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5);
+ const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7);
+ const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5);
+ const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7);
+ // 00 10 20 30 01 11 21 31
+ // 40 50 60 70 41 51 61 71
+ // 02 12 22 32 03 13 23 33
+ // 42 52 62 72 43 53 63 73
+ // 04 14 24 34 05 15 21 36
+ // 44 54 64 74 45 55 61 76
+ // 06 16 26 36 07 17 27 37
+ // 46 56 66 76 47 57 67 77
+ const __m128i tr2_0 = _mm_unpacklo_epi64(tr1_0, tr1_4);
+ const __m128i tr2_1 = _mm_unpackhi_epi64(tr1_0, tr1_4);
+ const __m128i tr2_2 = _mm_unpacklo_epi64(tr1_2, tr1_6);
+ const __m128i tr2_3 = _mm_unpackhi_epi64(tr1_2, tr1_6);
+ const __m128i tr2_4 = _mm_unpacklo_epi64(tr1_1, tr1_5);
+ const __m128i tr2_5 = _mm_unpackhi_epi64(tr1_1, tr1_5);
+ const __m128i tr2_6 = _mm_unpacklo_epi64(tr1_3, tr1_7);
+ const __m128i tr2_7 = _mm_unpackhi_epi64(tr1_3, tr1_7);
+ // 00 10 20 30 40 50 60 70
+ // 01 11 21 31 41 51 61 71
+ // 02 12 22 32 42 52 62 72
+ // 03 13 23 33 43 53 63 73
+ // 04 14 24 34 44 54 64 74
+ // 05 15 25 35 45 55 65 75
+ // 06 16 26 36 46 56 66 76
+ // 07 17 27 37 47 57 67 77
+ _mm_storeu_si128((__m128i *)(out + 0 * 16), tr2_0);
+ _mm_storeu_si128((__m128i *)(out + 1 * 16), tr2_1);
+ _mm_storeu_si128((__m128i *)(out + 2 * 16), tr2_2);
+ _mm_storeu_si128((__m128i *)(out + 3 * 16), tr2_3);
+ _mm_storeu_si128((__m128i *)(out + 4 * 16), tr2_4);
+ _mm_storeu_si128((__m128i *)(out + 5 * 16), tr2_5);
+ _mm_storeu_si128((__m128i *)(out + 6 * 16), tr2_6);
+ _mm_storeu_si128((__m128i *)(out + 7 * 16), tr2_7);
+ }
+ {
+ // 00 01 02 03 04 05 06 07
+ // 10 11 12 13 14 15 16 17
+ // 20 21 22 23 24 25 26 27
+ // 30 31 32 33 34 35 36 37
+ // 40 41 42 43 44 45 46 47
+ // 50 51 52 53 54 55 56 57
+ // 60 61 62 63 64 65 66 67
+ // 70 71 72 73 74 75 76 77
+ const __m128i tr0_0 = _mm_unpacklo_epi16(res08, res09);
+ const __m128i tr0_1 = _mm_unpacklo_epi16(res10, res11);
+ const __m128i tr0_2 = _mm_unpackhi_epi16(res08, res09);
+ const __m128i tr0_3 = _mm_unpackhi_epi16(res10, res11);
+ const __m128i tr0_4 = _mm_unpacklo_epi16(res12, res13);
+ const __m128i tr0_5 = _mm_unpacklo_epi16(res14, res15);
+ const __m128i tr0_6 = _mm_unpackhi_epi16(res12, res13);
+ const __m128i tr0_7 = _mm_unpackhi_epi16(res14, res15);
+ // 00 10 01 11 02 12 03 13
+ // 20 30 21 31 22 32 23 33
+ // 04 14 05 15 06 16 07 17
+ // 24 34 25 35 26 36 27 37
+ // 40 50 41 51 42 52 43 53
+ // 60 70 61 71 62 72 63 73
+ // 54 54 55 55 56 56 57 57
+ // 64 74 65 75 66 76 67 77
+ const __m128i tr1_0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
+ const __m128i tr1_1 = _mm_unpacklo_epi32(tr0_2, tr0_3);
+ const __m128i tr1_2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
+ const __m128i tr1_3 = _mm_unpackhi_epi32(tr0_2, tr0_3);
+ const __m128i tr1_4 = _mm_unpacklo_epi32(tr0_4, tr0_5);
+ const __m128i tr1_5 = _mm_unpacklo_epi32(tr0_6, tr0_7);
+ const __m128i tr1_6 = _mm_unpackhi_epi32(tr0_4, tr0_5);
+ const __m128i tr1_7 = _mm_unpackhi_epi32(tr0_6, tr0_7);
+ // 00 10 20 30 01 11 21 31
+ // 40 50 60 70 41 51 61 71
+ // 02 12 22 32 03 13 23 33
+ // 42 52 62 72 43 53 63 73
+ // 04 14 24 34 05 15 21 36
+ // 44 54 64 74 45 55 61 76
+ // 06 16 26 36 07 17 27 37
+ // 46 56 66 76 47 57 67 77
+ const __m128i tr2_0 = _mm_unpacklo_epi64(tr1_0, tr1_4);
+ const __m128i tr2_1 = _mm_unpackhi_epi64(tr1_0, tr1_4);
+ const __m128i tr2_2 = _mm_unpacklo_epi64(tr1_2, tr1_6);
+ const __m128i tr2_3 = _mm_unpackhi_epi64(tr1_2, tr1_6);
+ const __m128i tr2_4 = _mm_unpacklo_epi64(tr1_1, tr1_5);
+ const __m128i tr2_5 = _mm_unpackhi_epi64(tr1_1, tr1_5);
+ const __m128i tr2_6 = _mm_unpacklo_epi64(tr1_3, tr1_7);
+ const __m128i tr2_7 = _mm_unpackhi_epi64(tr1_3, tr1_7);
+ // 00 10 20 30 40 50 60 70
+ // 01 11 21 31 41 51 61 71
+ // 02 12 22 32 42 52 62 72
+ // 03 13 23 33 43 53 63 73
+ // 04 14 24 34 44 54 64 74
+ // 05 15 25 35 45 55 65 75
+ // 06 16 26 36 46 56 66 76
+ // 07 17 27 37 47 57 67 77
+ // Store results
+ _mm_store_si128((__m128i *)(out + 8 + 0 * 16), tr2_0);
+ _mm_store_si128((__m128i *)(out + 8 + 1 * 16), tr2_1);
+ _mm_store_si128((__m128i *)(out + 8 + 2 * 16), tr2_2);
+ _mm_store_si128((__m128i *)(out + 8 + 3 * 16), tr2_3);
+ _mm_store_si128((__m128i *)(out + 8 + 4 * 16), tr2_4);
+ _mm_store_si128((__m128i *)(out + 8 + 5 * 16), tr2_5);
+ _mm_store_si128((__m128i *)(out + 8 + 6 * 16), tr2_6);
+ _mm_store_si128((__m128i *)(out + 8 + 7 * 16), tr2_7);
+ }
+ out += 8*16;
+ }
+ // Setup in/out for next pass.
+ in = intermediate;
+ out = output;
+ }
+}
+
+static INLINE void load_buffer_16x16_avx2(const int16_t* input, __m128i *in0,
+ __m128i *in1, int stride) {
+ // load first 8 columns
+ load_buffer_8x8_avx2(input, in0, stride);
+ load_buffer_8x8_avx2(input + 8 * stride, in0 + 8, stride);
+
+ input += 8;
+ // load second 8 columns
+ load_buffer_8x8_avx2(input, in1, stride);
+ load_buffer_8x8_avx2(input + 8 * stride, in1 + 8, stride);
+}
+
+static INLINE void write_buffer_16x16_avx2(int16_t *output, __m128i *in0,
+ __m128i *in1, int stride) {
+ // write first 8 columns
+ write_buffer_8x8_avx2(output, in0, stride);
+ write_buffer_8x8_avx2(output + 8 * stride, in0 + 8, stride);
+ // write second 8 columns
+ output += 8;
+ write_buffer_8x8_avx2(output, in1, stride);
+ write_buffer_8x8_avx2(output + 8 * stride, in1 + 8, stride);
+}
+
+static INLINE void array_transpose_16x16_avx2(__m128i *res0, __m128i *res1) {
+ __m128i tbuf[8];
+ array_transpose_8x8_avx2(res0, res0);
+ array_transpose_8x8_avx2(res1, tbuf);
+ array_transpose_8x8_avx2(res0 + 8, res1);
+ array_transpose_8x8_avx2(res1 + 8, res1 + 8);
+
+ res0[8] = tbuf[0];
+ res0[9] = tbuf[1];
+ res0[10] = tbuf[2];
+ res0[11] = tbuf[3];
+ res0[12] = tbuf[4];
+ res0[13] = tbuf[5];
+ res0[14] = tbuf[6];
+ res0[15] = tbuf[7];
+}
+
+static INLINE void right_shift_16x16_avx2(__m128i *res0, __m128i *res1) {
+ // perform rounding operations
+ right_shift_8x8_avx2(res0, 2);
+ right_shift_8x8_avx2(res0 + 8, 2);
+ right_shift_8x8_avx2(res1, 2);
+ right_shift_8x8_avx2(res1 + 8, 2);
+}
+
+void fdct16_8col_avx2(__m128i *in) {
+ // perform 16x16 1-D DCT for 8 columns
+ __m128i i[8], s[8], p[8], t[8], u[16], v[16];
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64);
+ const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_m24_m08 = pair_set_epi16(-cospi_24_64, -cospi_8_64);
+ const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p28_p04 = pair_set_epi16(cospi_28_64, cospi_4_64);
+ const __m128i k__cospi_m04_p28 = pair_set_epi16(-cospi_4_64, cospi_28_64);
+ const __m128i k__cospi_p12_p20 = pair_set_epi16(cospi_12_64, cospi_20_64);
+ const __m128i k__cospi_m20_p12 = pair_set_epi16(-cospi_20_64, cospi_12_64);
+ const __m128i k__cospi_p30_p02 = pair_set_epi16(cospi_30_64, cospi_2_64);
+ const __m128i k__cospi_p14_p18 = pair_set_epi16(cospi_14_64, cospi_18_64);
+ const __m128i k__cospi_m02_p30 = pair_set_epi16(-cospi_2_64, cospi_30_64);
+ const __m128i k__cospi_m18_p14 = pair_set_epi16(-cospi_18_64, cospi_14_64);
+ const __m128i k__cospi_p22_p10 = pair_set_epi16(cospi_22_64, cospi_10_64);
+ const __m128i k__cospi_p06_p26 = pair_set_epi16(cospi_6_64, cospi_26_64);
+ const __m128i k__cospi_m10_p22 = pair_set_epi16(-cospi_10_64, cospi_22_64);
+ const __m128i k__cospi_m26_p06 = pair_set_epi16(-cospi_26_64, cospi_6_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+
+ // stage 1
+ i[0] = _mm_add_epi16(in[0], in[15]);
+ i[1] = _mm_add_epi16(in[1], in[14]);
+ i[2] = _mm_add_epi16(in[2], in[13]);
+ i[3] = _mm_add_epi16(in[3], in[12]);
+ i[4] = _mm_add_epi16(in[4], in[11]);
+ i[5] = _mm_add_epi16(in[5], in[10]);
+ i[6] = _mm_add_epi16(in[6], in[9]);
+ i[7] = _mm_add_epi16(in[7], in[8]);
+
+ s[0] = _mm_sub_epi16(in[7], in[8]);
+ s[1] = _mm_sub_epi16(in[6], in[9]);
+ s[2] = _mm_sub_epi16(in[5], in[10]);
+ s[3] = _mm_sub_epi16(in[4], in[11]);
+ s[4] = _mm_sub_epi16(in[3], in[12]);
+ s[5] = _mm_sub_epi16(in[2], in[13]);
+ s[6] = _mm_sub_epi16(in[1], in[14]);
+ s[7] = _mm_sub_epi16(in[0], in[15]);
+
+ p[0] = _mm_add_epi16(i[0], i[7]);
+ p[1] = _mm_add_epi16(i[1], i[6]);
+ p[2] = _mm_add_epi16(i[2], i[5]);
+ p[3] = _mm_add_epi16(i[3], i[4]);
+ p[4] = _mm_sub_epi16(i[3], i[4]);
+ p[5] = _mm_sub_epi16(i[2], i[5]);
+ p[6] = _mm_sub_epi16(i[1], i[6]);
+ p[7] = _mm_sub_epi16(i[0], i[7]);
+
+ u[0] = _mm_add_epi16(p[0], p[3]);
+ u[1] = _mm_add_epi16(p[1], p[2]);
+ u[2] = _mm_sub_epi16(p[1], p[2]);
+ u[3] = _mm_sub_epi16(p[0], p[3]);
+
+ v[0] = _mm_unpacklo_epi16(u[0], u[1]);
+ v[1] = _mm_unpackhi_epi16(u[0], u[1]);
+ v[2] = _mm_unpacklo_epi16(u[2], u[3]);
+ v[3] = _mm_unpackhi_epi16(u[2], u[3]);
+
+ u[0] = _mm_madd_epi16(v[0], k__cospi_p16_p16);
+ u[1] = _mm_madd_epi16(v[1], k__cospi_p16_p16);
+ u[2] = _mm_madd_epi16(v[0], k__cospi_p16_m16);
+ u[3] = _mm_madd_epi16(v[1], k__cospi_p16_m16);
+ u[4] = _mm_madd_epi16(v[2], k__cospi_p24_p08);
+ u[5] = _mm_madd_epi16(v[3], k__cospi_p24_p08);
+ u[6] = _mm_madd_epi16(v[2], k__cospi_m08_p24);
+ u[7] = _mm_madd_epi16(v[3], k__cospi_m08_p24);
+
+ v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+
+ u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
+ u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
+ u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
+ u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
+ u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
+
+ in[0] = _mm_packs_epi32(u[0], u[1]);
+ in[4] = _mm_packs_epi32(u[4], u[5]);
+ in[8] = _mm_packs_epi32(u[2], u[3]);
+ in[12] = _mm_packs_epi32(u[6], u[7]);
+
+ u[0] = _mm_unpacklo_epi16(p[5], p[6]);
+ u[1] = _mm_unpackhi_epi16(p[5], p[6]);
+ v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16);
+ v[2] = _mm_madd_epi16(u[0], k__cospi_p16_p16);
+ v[3] = _mm_madd_epi16(u[1], k__cospi_p16_p16);
+
+ u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+
+ u[0] = _mm_packs_epi32(v[0], v[1]);
+ u[1] = _mm_packs_epi32(v[2], v[3]);
+
+ t[0] = _mm_add_epi16(p[4], u[0]);
+ t[1] = _mm_sub_epi16(p[4], u[0]);
+ t[2] = _mm_sub_epi16(p[7], u[1]);
+ t[3] = _mm_add_epi16(p[7], u[1]);
+
+ u[0] = _mm_unpacklo_epi16(t[0], t[3]);
+ u[1] = _mm_unpackhi_epi16(t[0], t[3]);
+ u[2] = _mm_unpacklo_epi16(t[1], t[2]);
+ u[3] = _mm_unpackhi_epi16(t[1], t[2]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_p28_p04);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_p28_p04);
+ v[2] = _mm_madd_epi16(u[2], k__cospi_p12_p20);
+ v[3] = _mm_madd_epi16(u[3], k__cospi_p12_p20);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_m20_p12);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_m20_p12);
+ v[6] = _mm_madd_epi16(u[0], k__cospi_m04_p28);
+ v[7] = _mm_madd_epi16(u[1], k__cospi_m04_p28);
+
+ u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+ v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
+ v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
+ v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
+ v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
+
+ in[2] = _mm_packs_epi32(v[0], v[1]);
+ in[6] = _mm_packs_epi32(v[4], v[5]);
+ in[10] = _mm_packs_epi32(v[2], v[3]);
+ in[14] = _mm_packs_epi32(v[6], v[7]);
+
+ // stage 2
+ u[0] = _mm_unpacklo_epi16(s[2], s[5]);
+ u[1] = _mm_unpackhi_epi16(s[2], s[5]);
+ u[2] = _mm_unpacklo_epi16(s[3], s[4]);
+ u[3] = _mm_unpackhi_epi16(s[3], s[4]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_m16_p16);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_m16_p16);
+ v[2] = _mm_madd_epi16(u[2], k__cospi_m16_p16);
+ v[3] = _mm_madd_epi16(u[3], k__cospi_m16_p16);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_p16_p16);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_p16_p16);
+ v[6] = _mm_madd_epi16(u[0], k__cospi_p16_p16);
+ v[7] = _mm_madd_epi16(u[1], k__cospi_p16_p16);
+
+ u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+ v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
+ v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
+ v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
+ v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
+
+ t[2] = _mm_packs_epi32(v[0], v[1]);
+ t[3] = _mm_packs_epi32(v[2], v[3]);
+ t[4] = _mm_packs_epi32(v[4], v[5]);
+ t[5] = _mm_packs_epi32(v[6], v[7]);
+
+ // stage 3
+ p[0] = _mm_add_epi16(s[0], t[3]);
+ p[1] = _mm_add_epi16(s[1], t[2]);
+ p[2] = _mm_sub_epi16(s[1], t[2]);
+ p[3] = _mm_sub_epi16(s[0], t[3]);
+ p[4] = _mm_sub_epi16(s[7], t[4]);
+ p[5] = _mm_sub_epi16(s[6], t[5]);
+ p[6] = _mm_add_epi16(s[6], t[5]);
+ p[7] = _mm_add_epi16(s[7], t[4]);
+
+ // stage 4
+ u[0] = _mm_unpacklo_epi16(p[1], p[6]);
+ u[1] = _mm_unpackhi_epi16(p[1], p[6]);
+ u[2] = _mm_unpacklo_epi16(p[2], p[5]);
+ u[3] = _mm_unpackhi_epi16(p[2], p[5]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_m08_p24);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_m08_p24);
+ v[2] = _mm_madd_epi16(u[2], k__cospi_m24_m08);
+ v[3] = _mm_madd_epi16(u[3], k__cospi_m24_m08);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_m08_p24);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_m08_p24);
+ v[6] = _mm_madd_epi16(u[0], k__cospi_p24_p08);
+ v[7] = _mm_madd_epi16(u[1], k__cospi_p24_p08);
+
+ u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+ v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
+ v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
+ v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
+ v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
+
+ t[1] = _mm_packs_epi32(v[0], v[1]);
+ t[2] = _mm_packs_epi32(v[2], v[3]);
+ t[5] = _mm_packs_epi32(v[4], v[5]);
+ t[6] = _mm_packs_epi32(v[6], v[7]);
+
+ // stage 5
+ s[0] = _mm_add_epi16(p[0], t[1]);
+ s[1] = _mm_sub_epi16(p[0], t[1]);
+ s[2] = _mm_sub_epi16(p[3], t[2]);
+ s[3] = _mm_add_epi16(p[3], t[2]);
+ s[4] = _mm_add_epi16(p[4], t[5]);
+ s[5] = _mm_sub_epi16(p[4], t[5]);
+ s[6] = _mm_sub_epi16(p[7], t[6]);
+ s[7] = _mm_add_epi16(p[7], t[6]);
+
+ // stage 6
+ u[0] = _mm_unpacklo_epi16(s[0], s[7]);
+ u[1] = _mm_unpackhi_epi16(s[0], s[7]);
+ u[2] = _mm_unpacklo_epi16(s[1], s[6]);
+ u[3] = _mm_unpackhi_epi16(s[1], s[6]);
+ u[4] = _mm_unpacklo_epi16(s[2], s[5]);
+ u[5] = _mm_unpackhi_epi16(s[2], s[5]);
+ u[6] = _mm_unpacklo_epi16(s[3], s[4]);
+ u[7] = _mm_unpackhi_epi16(s[3], s[4]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_p30_p02);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_p30_p02);
+ v[2] = _mm_madd_epi16(u[2], k__cospi_p14_p18);
+ v[3] = _mm_madd_epi16(u[3], k__cospi_p14_p18);
+ v[4] = _mm_madd_epi16(u[4], k__cospi_p22_p10);
+ v[5] = _mm_madd_epi16(u[5], k__cospi_p22_p10);
+ v[6] = _mm_madd_epi16(u[6], k__cospi_p06_p26);
+ v[7] = _mm_madd_epi16(u[7], k__cospi_p06_p26);
+ v[8] = _mm_madd_epi16(u[6], k__cospi_m26_p06);
+ v[9] = _mm_madd_epi16(u[7], k__cospi_m26_p06);
+ v[10] = _mm_madd_epi16(u[4], k__cospi_m10_p22);
+ v[11] = _mm_madd_epi16(u[5], k__cospi_m10_p22);
+ v[12] = _mm_madd_epi16(u[2], k__cospi_m18_p14);
+ v[13] = _mm_madd_epi16(u[3], k__cospi_m18_p14);
+ v[14] = _mm_madd_epi16(u[0], k__cospi_m02_p30);
+ v[15] = _mm_madd_epi16(u[1], k__cospi_m02_p30);
+
+ u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING);
+ u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING);
+ u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING);
+ u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING);
+ u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING);
+ u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING);
+ u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING);
+ u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING);
+ u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+ v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
+ v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
+ v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
+ v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
+ v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS);
+ v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS);
+ v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS);
+ v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS);
+ v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS);
+ v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS);
+ v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS);
+ v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS);
+
+ in[1] = _mm_packs_epi32(v[0], v[1]);
+ in[9] = _mm_packs_epi32(v[2], v[3]);
+ in[5] = _mm_packs_epi32(v[4], v[5]);
+ in[13] = _mm_packs_epi32(v[6], v[7]);
+ in[3] = _mm_packs_epi32(v[8], v[9]);
+ in[11] = _mm_packs_epi32(v[10], v[11]);
+ in[7] = _mm_packs_epi32(v[12], v[13]);
+ in[15] = _mm_packs_epi32(v[14], v[15]);
+}
+
+void fadst16_8col_avx2(__m128i *in) {
+ // perform 16x16 1-D ADST for 8 columns
+ __m128i s[16], x[16], u[32], v[32];
+ const __m128i k__cospi_p01_p31 = pair_set_epi16(cospi_1_64, cospi_31_64);
+ const __m128i k__cospi_p31_m01 = pair_set_epi16(cospi_31_64, -cospi_1_64);
+ const __m128i k__cospi_p05_p27 = pair_set_epi16(cospi_5_64, cospi_27_64);
+ const __m128i k__cospi_p27_m05 = pair_set_epi16(cospi_27_64, -cospi_5_64);
+ const __m128i k__cospi_p09_p23 = pair_set_epi16(cospi_9_64, cospi_23_64);
+ const __m128i k__cospi_p23_m09 = pair_set_epi16(cospi_23_64, -cospi_9_64);
+ const __m128i k__cospi_p13_p19 = pair_set_epi16(cospi_13_64, cospi_19_64);
+ const __m128i k__cospi_p19_m13 = pair_set_epi16(cospi_19_64, -cospi_13_64);
+ const __m128i k__cospi_p17_p15 = pair_set_epi16(cospi_17_64, cospi_15_64);
+ const __m128i k__cospi_p15_m17 = pair_set_epi16(cospi_15_64, -cospi_17_64);
+ const __m128i k__cospi_p21_p11 = pair_set_epi16(cospi_21_64, cospi_11_64);
+ const __m128i k__cospi_p11_m21 = pair_set_epi16(cospi_11_64, -cospi_21_64);
+ const __m128i k__cospi_p25_p07 = pair_set_epi16(cospi_25_64, cospi_7_64);
+ const __m128i k__cospi_p07_m25 = pair_set_epi16(cospi_7_64, -cospi_25_64);
+ const __m128i k__cospi_p29_p03 = pair_set_epi16(cospi_29_64, cospi_3_64);
+ const __m128i k__cospi_p03_m29 = pair_set_epi16(cospi_3_64, -cospi_29_64);
+ const __m128i k__cospi_p04_p28 = pair_set_epi16(cospi_4_64, cospi_28_64);
+ const __m128i k__cospi_p28_m04 = pair_set_epi16(cospi_28_64, -cospi_4_64);
+ const __m128i k__cospi_p20_p12 = pair_set_epi16(cospi_20_64, cospi_12_64);
+ const __m128i k__cospi_p12_m20 = pair_set_epi16(cospi_12_64, -cospi_20_64);
+ const __m128i k__cospi_m28_p04 = pair_set_epi16(-cospi_28_64, cospi_4_64);
+ const __m128i k__cospi_m12_p20 = pair_set_epi16(-cospi_12_64, cospi_20_64);
+ const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_p24_m08 = pair_set_epi16(cospi_24_64, -cospi_8_64);
+ const __m128i k__cospi_m24_p08 = pair_set_epi16(-cospi_24_64, cospi_8_64);
+ const __m128i k__cospi_m16_m16 = _mm_set1_epi16(-cospi_16_64);
+ const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
+ const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_m16_p16 = pair_set_epi16(-cospi_16_64, cospi_16_64);
+ const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ const __m128i kZero = _mm_set1_epi16(0);
+
+ u[0] = _mm_unpacklo_epi16(in[15], in[0]);
+ u[1] = _mm_unpackhi_epi16(in[15], in[0]);
+ u[2] = _mm_unpacklo_epi16(in[13], in[2]);
+ u[3] = _mm_unpackhi_epi16(in[13], in[2]);
+ u[4] = _mm_unpacklo_epi16(in[11], in[4]);
+ u[5] = _mm_unpackhi_epi16(in[11], in[4]);
+ u[6] = _mm_unpacklo_epi16(in[9], in[6]);
+ u[7] = _mm_unpackhi_epi16(in[9], in[6]);
+ u[8] = _mm_unpacklo_epi16(in[7], in[8]);
+ u[9] = _mm_unpackhi_epi16(in[7], in[8]);
+ u[10] = _mm_unpacklo_epi16(in[5], in[10]);
+ u[11] = _mm_unpackhi_epi16(in[5], in[10]);
+ u[12] = _mm_unpacklo_epi16(in[3], in[12]);
+ u[13] = _mm_unpackhi_epi16(in[3], in[12]);
+ u[14] = _mm_unpacklo_epi16(in[1], in[14]);
+ u[15] = _mm_unpackhi_epi16(in[1], in[14]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_p01_p31);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_p01_p31);
+ v[2] = _mm_madd_epi16(u[0], k__cospi_p31_m01);
+ v[3] = _mm_madd_epi16(u[1], k__cospi_p31_m01);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_p05_p27);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_p05_p27);
+ v[6] = _mm_madd_epi16(u[2], k__cospi_p27_m05);
+ v[7] = _mm_madd_epi16(u[3], k__cospi_p27_m05);
+ v[8] = _mm_madd_epi16(u[4], k__cospi_p09_p23);
+ v[9] = _mm_madd_epi16(u[5], k__cospi_p09_p23);
+ v[10] = _mm_madd_epi16(u[4], k__cospi_p23_m09);
+ v[11] = _mm_madd_epi16(u[5], k__cospi_p23_m09);
+ v[12] = _mm_madd_epi16(u[6], k__cospi_p13_p19);
+ v[13] = _mm_madd_epi16(u[7], k__cospi_p13_p19);
+ v[14] = _mm_madd_epi16(u[6], k__cospi_p19_m13);
+ v[15] = _mm_madd_epi16(u[7], k__cospi_p19_m13);
+ v[16] = _mm_madd_epi16(u[8], k__cospi_p17_p15);
+ v[17] = _mm_madd_epi16(u[9], k__cospi_p17_p15);
+ v[18] = _mm_madd_epi16(u[8], k__cospi_p15_m17);
+ v[19] = _mm_madd_epi16(u[9], k__cospi_p15_m17);
+ v[20] = _mm_madd_epi16(u[10], k__cospi_p21_p11);
+ v[21] = _mm_madd_epi16(u[11], k__cospi_p21_p11);
+ v[22] = _mm_madd_epi16(u[10], k__cospi_p11_m21);
+ v[23] = _mm_madd_epi16(u[11], k__cospi_p11_m21);
+ v[24] = _mm_madd_epi16(u[12], k__cospi_p25_p07);
+ v[25] = _mm_madd_epi16(u[13], k__cospi_p25_p07);
+ v[26] = _mm_madd_epi16(u[12], k__cospi_p07_m25);
+ v[27] = _mm_madd_epi16(u[13], k__cospi_p07_m25);
+ v[28] = _mm_madd_epi16(u[14], k__cospi_p29_p03);
+ v[29] = _mm_madd_epi16(u[15], k__cospi_p29_p03);
+ v[30] = _mm_madd_epi16(u[14], k__cospi_p03_m29);
+ v[31] = _mm_madd_epi16(u[15], k__cospi_p03_m29);
+
+ u[0] = _mm_add_epi32(v[0], v[16]);
+ u[1] = _mm_add_epi32(v[1], v[17]);
+ u[2] = _mm_add_epi32(v[2], v[18]);
+ u[3] = _mm_add_epi32(v[3], v[19]);
+ u[4] = _mm_add_epi32(v[4], v[20]);
+ u[5] = _mm_add_epi32(v[5], v[21]);
+ u[6] = _mm_add_epi32(v[6], v[22]);
+ u[7] = _mm_add_epi32(v[7], v[23]);
+ u[8] = _mm_add_epi32(v[8], v[24]);
+ u[9] = _mm_add_epi32(v[9], v[25]);
+ u[10] = _mm_add_epi32(v[10], v[26]);
+ u[11] = _mm_add_epi32(v[11], v[27]);
+ u[12] = _mm_add_epi32(v[12], v[28]);
+ u[13] = _mm_add_epi32(v[13], v[29]);
+ u[14] = _mm_add_epi32(v[14], v[30]);
+ u[15] = _mm_add_epi32(v[15], v[31]);
+ u[16] = _mm_sub_epi32(v[0], v[16]);
+ u[17] = _mm_sub_epi32(v[1], v[17]);
+ u[18] = _mm_sub_epi32(v[2], v[18]);
+ u[19] = _mm_sub_epi32(v[3], v[19]);
+ u[20] = _mm_sub_epi32(v[4], v[20]);
+ u[21] = _mm_sub_epi32(v[5], v[21]);
+ u[22] = _mm_sub_epi32(v[6], v[22]);
+ u[23] = _mm_sub_epi32(v[7], v[23]);
+ u[24] = _mm_sub_epi32(v[8], v[24]);
+ u[25] = _mm_sub_epi32(v[9], v[25]);
+ u[26] = _mm_sub_epi32(v[10], v[26]);
+ u[27] = _mm_sub_epi32(v[11], v[27]);
+ u[28] = _mm_sub_epi32(v[12], v[28]);
+ u[29] = _mm_sub_epi32(v[13], v[29]);
+ u[30] = _mm_sub_epi32(v[14], v[30]);
+ u[31] = _mm_sub_epi32(v[15], v[31]);
+
+ v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+ v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
+ v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+ v[16] = _mm_add_epi32(u[16], k__DCT_CONST_ROUNDING);
+ v[17] = _mm_add_epi32(u[17], k__DCT_CONST_ROUNDING);
+ v[18] = _mm_add_epi32(u[18], k__DCT_CONST_ROUNDING);
+ v[19] = _mm_add_epi32(u[19], k__DCT_CONST_ROUNDING);
+ v[20] = _mm_add_epi32(u[20], k__DCT_CONST_ROUNDING);
+ v[21] = _mm_add_epi32(u[21], k__DCT_CONST_ROUNDING);
+ v[22] = _mm_add_epi32(u[22], k__DCT_CONST_ROUNDING);
+ v[23] = _mm_add_epi32(u[23], k__DCT_CONST_ROUNDING);
+ v[24] = _mm_add_epi32(u[24], k__DCT_CONST_ROUNDING);
+ v[25] = _mm_add_epi32(u[25], k__DCT_CONST_ROUNDING);
+ v[26] = _mm_add_epi32(u[26], k__DCT_CONST_ROUNDING);
+ v[27] = _mm_add_epi32(u[27], k__DCT_CONST_ROUNDING);
+ v[28] = _mm_add_epi32(u[28], k__DCT_CONST_ROUNDING);
+ v[29] = _mm_add_epi32(u[29], k__DCT_CONST_ROUNDING);
+ v[30] = _mm_add_epi32(u[30], k__DCT_CONST_ROUNDING);
+ v[31] = _mm_add_epi32(u[31], k__DCT_CONST_ROUNDING);
+
+ u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
+ u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
+ u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
+ u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
+ u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
+ u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
+ u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
+ u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
+ u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
+ u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
+ u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
+ u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
+ u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
+ u[16] = _mm_srai_epi32(v[16], DCT_CONST_BITS);
+ u[17] = _mm_srai_epi32(v[17], DCT_CONST_BITS);
+ u[18] = _mm_srai_epi32(v[18], DCT_CONST_BITS);
+ u[19] = _mm_srai_epi32(v[19], DCT_CONST_BITS);
+ u[20] = _mm_srai_epi32(v[20], DCT_CONST_BITS);
+ u[21] = _mm_srai_epi32(v[21], DCT_CONST_BITS);
+ u[22] = _mm_srai_epi32(v[22], DCT_CONST_BITS);
+ u[23] = _mm_srai_epi32(v[23], DCT_CONST_BITS);
+ u[24] = _mm_srai_epi32(v[24], DCT_CONST_BITS);
+ u[25] = _mm_srai_epi32(v[25], DCT_CONST_BITS);
+ u[26] = _mm_srai_epi32(v[26], DCT_CONST_BITS);
+ u[27] = _mm_srai_epi32(v[27], DCT_CONST_BITS);
+ u[28] = _mm_srai_epi32(v[28], DCT_CONST_BITS);
+ u[29] = _mm_srai_epi32(v[29], DCT_CONST_BITS);
+ u[30] = _mm_srai_epi32(v[30], DCT_CONST_BITS);
+ u[31] = _mm_srai_epi32(v[31], DCT_CONST_BITS);
+
+ s[0] = _mm_packs_epi32(u[0], u[1]);
+ s[1] = _mm_packs_epi32(u[2], u[3]);
+ s[2] = _mm_packs_epi32(u[4], u[5]);
+ s[3] = _mm_packs_epi32(u[6], u[7]);
+ s[4] = _mm_packs_epi32(u[8], u[9]);
+ s[5] = _mm_packs_epi32(u[10], u[11]);
+ s[6] = _mm_packs_epi32(u[12], u[13]);
+ s[7] = _mm_packs_epi32(u[14], u[15]);
+ s[8] = _mm_packs_epi32(u[16], u[17]);
+ s[9] = _mm_packs_epi32(u[18], u[19]);
+ s[10] = _mm_packs_epi32(u[20], u[21]);
+ s[11] = _mm_packs_epi32(u[22], u[23]);
+ s[12] = _mm_packs_epi32(u[24], u[25]);
+ s[13] = _mm_packs_epi32(u[26], u[27]);
+ s[14] = _mm_packs_epi32(u[28], u[29]);
+ s[15] = _mm_packs_epi32(u[30], u[31]);
+
+ // stage 2
+ u[0] = _mm_unpacklo_epi16(s[8], s[9]);
+ u[1] = _mm_unpackhi_epi16(s[8], s[9]);
+ u[2] = _mm_unpacklo_epi16(s[10], s[11]);
+ u[3] = _mm_unpackhi_epi16(s[10], s[11]);
+ u[4] = _mm_unpacklo_epi16(s[12], s[13]);
+ u[5] = _mm_unpackhi_epi16(s[12], s[13]);
+ u[6] = _mm_unpacklo_epi16(s[14], s[15]);
+ u[7] = _mm_unpackhi_epi16(s[14], s[15]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_p04_p28);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_p04_p28);
+ v[2] = _mm_madd_epi16(u[0], k__cospi_p28_m04);
+ v[3] = _mm_madd_epi16(u[1], k__cospi_p28_m04);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_p20_p12);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_p20_p12);
+ v[6] = _mm_madd_epi16(u[2], k__cospi_p12_m20);
+ v[7] = _mm_madd_epi16(u[3], k__cospi_p12_m20);
+ v[8] = _mm_madd_epi16(u[4], k__cospi_m28_p04);
+ v[9] = _mm_madd_epi16(u[5], k__cospi_m28_p04);
+ v[10] = _mm_madd_epi16(u[4], k__cospi_p04_p28);
+ v[11] = _mm_madd_epi16(u[5], k__cospi_p04_p28);
+ v[12] = _mm_madd_epi16(u[6], k__cospi_m12_p20);
+ v[13] = _mm_madd_epi16(u[7], k__cospi_m12_p20);
+ v[14] = _mm_madd_epi16(u[6], k__cospi_p20_p12);
+ v[15] = _mm_madd_epi16(u[7], k__cospi_p20_p12);
+
+ u[0] = _mm_add_epi32(v[0], v[8]);
+ u[1] = _mm_add_epi32(v[1], v[9]);
+ u[2] = _mm_add_epi32(v[2], v[10]);
+ u[3] = _mm_add_epi32(v[3], v[11]);
+ u[4] = _mm_add_epi32(v[4], v[12]);
+ u[5] = _mm_add_epi32(v[5], v[13]);
+ u[6] = _mm_add_epi32(v[6], v[14]);
+ u[7] = _mm_add_epi32(v[7], v[15]);
+ u[8] = _mm_sub_epi32(v[0], v[8]);
+ u[9] = _mm_sub_epi32(v[1], v[9]);
+ u[10] = _mm_sub_epi32(v[2], v[10]);
+ u[11] = _mm_sub_epi32(v[3], v[11]);
+ u[12] = _mm_sub_epi32(v[4], v[12]);
+ u[13] = _mm_sub_epi32(v[5], v[13]);
+ u[14] = _mm_sub_epi32(v[6], v[14]);
+ u[15] = _mm_sub_epi32(v[7], v[15]);
+
+ v[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ v[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ v[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ v[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ v[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ v[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ v[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ v[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+ v[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
+ v[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
+ v[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ v[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ v[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ v[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ v[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ v[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ u[0] = _mm_srai_epi32(v[0], DCT_CONST_BITS);
+ u[1] = _mm_srai_epi32(v[1], DCT_CONST_BITS);
+ u[2] = _mm_srai_epi32(v[2], DCT_CONST_BITS);
+ u[3] = _mm_srai_epi32(v[3], DCT_CONST_BITS);
+ u[4] = _mm_srai_epi32(v[4], DCT_CONST_BITS);
+ u[5] = _mm_srai_epi32(v[5], DCT_CONST_BITS);
+ u[6] = _mm_srai_epi32(v[6], DCT_CONST_BITS);
+ u[7] = _mm_srai_epi32(v[7], DCT_CONST_BITS);
+ u[8] = _mm_srai_epi32(v[8], DCT_CONST_BITS);
+ u[9] = _mm_srai_epi32(v[9], DCT_CONST_BITS);
+ u[10] = _mm_srai_epi32(v[10], DCT_CONST_BITS);
+ u[11] = _mm_srai_epi32(v[11], DCT_CONST_BITS);
+ u[12] = _mm_srai_epi32(v[12], DCT_CONST_BITS);
+ u[13] = _mm_srai_epi32(v[13], DCT_CONST_BITS);
+ u[14] = _mm_srai_epi32(v[14], DCT_CONST_BITS);
+ u[15] = _mm_srai_epi32(v[15], DCT_CONST_BITS);
+
+ x[0] = _mm_add_epi16(s[0], s[4]);
+ x[1] = _mm_add_epi16(s[1], s[5]);
+ x[2] = _mm_add_epi16(s[2], s[6]);
+ x[3] = _mm_add_epi16(s[3], s[7]);
+ x[4] = _mm_sub_epi16(s[0], s[4]);
+ x[5] = _mm_sub_epi16(s[1], s[5]);
+ x[6] = _mm_sub_epi16(s[2], s[6]);
+ x[7] = _mm_sub_epi16(s[3], s[7]);
+ x[8] = _mm_packs_epi32(u[0], u[1]);
+ x[9] = _mm_packs_epi32(u[2], u[3]);
+ x[10] = _mm_packs_epi32(u[4], u[5]);
+ x[11] = _mm_packs_epi32(u[6], u[7]);
+ x[12] = _mm_packs_epi32(u[8], u[9]);
+ x[13] = _mm_packs_epi32(u[10], u[11]);
+ x[14] = _mm_packs_epi32(u[12], u[13]);
+ x[15] = _mm_packs_epi32(u[14], u[15]);
+
+ // stage 3
+ u[0] = _mm_unpacklo_epi16(x[4], x[5]);
+ u[1] = _mm_unpackhi_epi16(x[4], x[5]);
+ u[2] = _mm_unpacklo_epi16(x[6], x[7]);
+ u[3] = _mm_unpackhi_epi16(x[6], x[7]);
+ u[4] = _mm_unpacklo_epi16(x[12], x[13]);
+ u[5] = _mm_unpackhi_epi16(x[12], x[13]);
+ u[6] = _mm_unpacklo_epi16(x[14], x[15]);
+ u[7] = _mm_unpackhi_epi16(x[14], x[15]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_p08_p24);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_p08_p24);
+ v[2] = _mm_madd_epi16(u[0], k__cospi_p24_m08);
+ v[3] = _mm_madd_epi16(u[1], k__cospi_p24_m08);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_m24_p08);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_m24_p08);
+ v[6] = _mm_madd_epi16(u[2], k__cospi_p08_p24);
+ v[7] = _mm_madd_epi16(u[3], k__cospi_p08_p24);
+ v[8] = _mm_madd_epi16(u[4], k__cospi_p08_p24);
+ v[9] = _mm_madd_epi16(u[5], k__cospi_p08_p24);
+ v[10] = _mm_madd_epi16(u[4], k__cospi_p24_m08);
+ v[11] = _mm_madd_epi16(u[5], k__cospi_p24_m08);
+ v[12] = _mm_madd_epi16(u[6], k__cospi_m24_p08);
+ v[13] = _mm_madd_epi16(u[7], k__cospi_m24_p08);
+ v[14] = _mm_madd_epi16(u[6], k__cospi_p08_p24);
+ v[15] = _mm_madd_epi16(u[7], k__cospi_p08_p24);
+
+ u[0] = _mm_add_epi32(v[0], v[4]);
+ u[1] = _mm_add_epi32(v[1], v[5]);
+ u[2] = _mm_add_epi32(v[2], v[6]);
+ u[3] = _mm_add_epi32(v[3], v[7]);
+ u[4] = _mm_sub_epi32(v[0], v[4]);
+ u[5] = _mm_sub_epi32(v[1], v[5]);
+ u[6] = _mm_sub_epi32(v[2], v[6]);
+ u[7] = _mm_sub_epi32(v[3], v[7]);
+ u[8] = _mm_add_epi32(v[8], v[12]);
+ u[9] = _mm_add_epi32(v[9], v[13]);
+ u[10] = _mm_add_epi32(v[10], v[14]);
+ u[11] = _mm_add_epi32(v[11], v[15]);
+ u[12] = _mm_sub_epi32(v[8], v[12]);
+ u[13] = _mm_sub_epi32(v[9], v[13]);
+ u[14] = _mm_sub_epi32(v[10], v[14]);
+ u[15] = _mm_sub_epi32(v[11], v[15]);
+
+ u[0] = _mm_add_epi32(u[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(u[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(u[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(u[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm_add_epi32(u[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm_add_epi32(u[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm_add_epi32(u[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm_add_epi32(u[7], k__DCT_CONST_ROUNDING);
+ u[8] = _mm_add_epi32(u[8], k__DCT_CONST_ROUNDING);
+ u[9] = _mm_add_epi32(u[9], k__DCT_CONST_ROUNDING);
+ u[10] = _mm_add_epi32(u[10], k__DCT_CONST_ROUNDING);
+ u[11] = _mm_add_epi32(u[11], k__DCT_CONST_ROUNDING);
+ u[12] = _mm_add_epi32(u[12], k__DCT_CONST_ROUNDING);
+ u[13] = _mm_add_epi32(u[13], k__DCT_CONST_ROUNDING);
+ u[14] = _mm_add_epi32(u[14], k__DCT_CONST_ROUNDING);
+ u[15] = _mm_add_epi32(u[15], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+ v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
+ v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
+ v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
+ v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
+ v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS);
+ v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS);
+ v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS);
+ v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS);
+ v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS);
+ v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS);
+ v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS);
+ v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS);
+
+ s[0] = _mm_add_epi16(x[0], x[2]);
+ s[1] = _mm_add_epi16(x[1], x[3]);
+ s[2] = _mm_sub_epi16(x[0], x[2]);
+ s[3] = _mm_sub_epi16(x[1], x[3]);
+ s[4] = _mm_packs_epi32(v[0], v[1]);
+ s[5] = _mm_packs_epi32(v[2], v[3]);
+ s[6] = _mm_packs_epi32(v[4], v[5]);
+ s[7] = _mm_packs_epi32(v[6], v[7]);
+ s[8] = _mm_add_epi16(x[8], x[10]);
+ s[9] = _mm_add_epi16(x[9], x[11]);
+ s[10] = _mm_sub_epi16(x[8], x[10]);
+ s[11] = _mm_sub_epi16(x[9], x[11]);
+ s[12] = _mm_packs_epi32(v[8], v[9]);
+ s[13] = _mm_packs_epi32(v[10], v[11]);
+ s[14] = _mm_packs_epi32(v[12], v[13]);
+ s[15] = _mm_packs_epi32(v[14], v[15]);
+
+ // stage 4
+ u[0] = _mm_unpacklo_epi16(s[2], s[3]);
+ u[1] = _mm_unpackhi_epi16(s[2], s[3]);
+ u[2] = _mm_unpacklo_epi16(s[6], s[7]);
+ u[3] = _mm_unpackhi_epi16(s[6], s[7]);
+ u[4] = _mm_unpacklo_epi16(s[10], s[11]);
+ u[5] = _mm_unpackhi_epi16(s[10], s[11]);
+ u[6] = _mm_unpacklo_epi16(s[14], s[15]);
+ u[7] = _mm_unpackhi_epi16(s[14], s[15]);
+
+ v[0] = _mm_madd_epi16(u[0], k__cospi_m16_m16);
+ v[1] = _mm_madd_epi16(u[1], k__cospi_m16_m16);
+ v[2] = _mm_madd_epi16(u[0], k__cospi_p16_m16);
+ v[3] = _mm_madd_epi16(u[1], k__cospi_p16_m16);
+ v[4] = _mm_madd_epi16(u[2], k__cospi_p16_p16);
+ v[5] = _mm_madd_epi16(u[3], k__cospi_p16_p16);
+ v[6] = _mm_madd_epi16(u[2], k__cospi_m16_p16);
+ v[7] = _mm_madd_epi16(u[3], k__cospi_m16_p16);
+ v[8] = _mm_madd_epi16(u[4], k__cospi_p16_p16);
+ v[9] = _mm_madd_epi16(u[5], k__cospi_p16_p16);
+ v[10] = _mm_madd_epi16(u[4], k__cospi_m16_p16);
+ v[11] = _mm_madd_epi16(u[5], k__cospi_m16_p16);
+ v[12] = _mm_madd_epi16(u[6], k__cospi_m16_m16);
+ v[13] = _mm_madd_epi16(u[7], k__cospi_m16_m16);
+ v[14] = _mm_madd_epi16(u[6], k__cospi_p16_m16);
+ v[15] = _mm_madd_epi16(u[7], k__cospi_p16_m16);
+
+ u[0] = _mm_add_epi32(v[0], k__DCT_CONST_ROUNDING);
+ u[1] = _mm_add_epi32(v[1], k__DCT_CONST_ROUNDING);
+ u[2] = _mm_add_epi32(v[2], k__DCT_CONST_ROUNDING);
+ u[3] = _mm_add_epi32(v[3], k__DCT_CONST_ROUNDING);
+ u[4] = _mm_add_epi32(v[4], k__DCT_CONST_ROUNDING);
+ u[5] = _mm_add_epi32(v[5], k__DCT_CONST_ROUNDING);
+ u[6] = _mm_add_epi32(v[6], k__DCT_CONST_ROUNDING);
+ u[7] = _mm_add_epi32(v[7], k__DCT_CONST_ROUNDING);
+ u[8] = _mm_add_epi32(v[8], k__DCT_CONST_ROUNDING);
+ u[9] = _mm_add_epi32(v[9], k__DCT_CONST_ROUNDING);
+ u[10] = _mm_add_epi32(v[10], k__DCT_CONST_ROUNDING);
+ u[11] = _mm_add_epi32(v[11], k__DCT_CONST_ROUNDING);
+ u[12] = _mm_add_epi32(v[12], k__DCT_CONST_ROUNDING);
+ u[13] = _mm_add_epi32(v[13], k__DCT_CONST_ROUNDING);
+ u[14] = _mm_add_epi32(v[14], k__DCT_CONST_ROUNDING);
+ u[15] = _mm_add_epi32(v[15], k__DCT_CONST_ROUNDING);
+
+ v[0] = _mm_srai_epi32(u[0], DCT_CONST_BITS);
+ v[1] = _mm_srai_epi32(u[1], DCT_CONST_BITS);
+ v[2] = _mm_srai_epi32(u[2], DCT_CONST_BITS);
+ v[3] = _mm_srai_epi32(u[3], DCT_CONST_BITS);
+ v[4] = _mm_srai_epi32(u[4], DCT_CONST_BITS);
+ v[5] = _mm_srai_epi32(u[5], DCT_CONST_BITS);
+ v[6] = _mm_srai_epi32(u[6], DCT_CONST_BITS);
+ v[7] = _mm_srai_epi32(u[7], DCT_CONST_BITS);
+ v[8] = _mm_srai_epi32(u[8], DCT_CONST_BITS);
+ v[9] = _mm_srai_epi32(u[9], DCT_CONST_BITS);
+ v[10] = _mm_srai_epi32(u[10], DCT_CONST_BITS);
+ v[11] = _mm_srai_epi32(u[11], DCT_CONST_BITS);
+ v[12] = _mm_srai_epi32(u[12], DCT_CONST_BITS);
+ v[13] = _mm_srai_epi32(u[13], DCT_CONST_BITS);
+ v[14] = _mm_srai_epi32(u[14], DCT_CONST_BITS);
+ v[15] = _mm_srai_epi32(u[15], DCT_CONST_BITS);
+
+ in[0] = s[0];
+ in[1] = _mm_sub_epi16(kZero, s[8]);
+ in[2] = s[12];
+ in[3] = _mm_sub_epi16(kZero, s[4]);
+ in[4] = _mm_packs_epi32(v[4], v[5]);
+ in[5] = _mm_packs_epi32(v[12], v[13]);
+ in[6] = _mm_packs_epi32(v[8], v[9]);
+ in[7] = _mm_packs_epi32(v[0], v[1]);
+ in[8] = _mm_packs_epi32(v[2], v[3]);
+ in[9] = _mm_packs_epi32(v[10], v[11]);
+ in[10] = _mm_packs_epi32(v[14], v[15]);
+ in[11] = _mm_packs_epi32(v[6], v[7]);
+ in[12] = s[5];
+ in[13] = _mm_sub_epi16(kZero, s[13]);
+ in[14] = s[9];
+ in[15] = _mm_sub_epi16(kZero, s[1]);
+}
+
+void fdct16_avx2(__m128i *in0, __m128i *in1) {
+ fdct16_8col_avx2(in0);
+ fdct16_8col_avx2(in1);
+ array_transpose_16x16_avx2(in0, in1);
+}
+
+void fadst16_avx2(__m128i *in0, __m128i *in1) {
+ fadst16_8col_avx2(in0);
+ fadst16_8col_avx2(in1);
+ array_transpose_16x16_avx2(in0, in1);
+}
+
+void vp9_fht16x16_avx2(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
+ __m128i in0[16], in1[16];
+
+ switch (tx_type) {
+ case DCT_DCT:
+ vp9_fdct16x16_avx2(input, output, stride);
+ break;
+ case ADST_DCT:
+ load_buffer_16x16_avx2(input, in0, in1, stride);
+ fadst16_avx2(in0, in1);
+ right_shift_16x16_avx2(in0, in1);
+ fdct16_avx2(in0, in1);
+ write_buffer_16x16_avx2(output, in0, in1, 16);
+ break;
+ case DCT_ADST:
+ load_buffer_16x16_avx2(input, in0, in1, stride);
+ fdct16_avx2(in0, in1);
+ right_shift_16x16_avx2(in0, in1);
+ fadst16_avx2(in0, in1);
+ write_buffer_16x16_avx2(output, in0, in1, 16);
+ break;
+ case ADST_ADST:
+ load_buffer_16x16_avx2(input, in0, in1, stride);
+ fadst16_avx2(in0, in1);
+ right_shift_16x16_avx2(in0, in1);
+ fadst16_avx2(in0, in1);
+ write_buffer_16x16_avx2(output, in0, in1, 16);
+ break;
+ default:
+ assert(0);
+ break;
+ }
+}
+
+#define FDCT32x32_2D_AVX2 vp9_fdct32x32_rd_avx2
+#define FDCT32x32_HIGH_PRECISION 0
+#include "vp9/encoder/x86/vp9_dct32x32_avx2.c"
+#undef FDCT32x32_2D_AVX2
+#undef FDCT32x32_HIGH_PRECISION
+
+#define FDCT32x32_2D_AVX2 vp9_fdct32x32_avx2
+#define FDCT32x32_HIGH_PRECISION 1
+#include "vp9/encoder/x86/vp9_dct32x32_avx2.c" // NOLINT
+#undef FDCT32x32_2D_AVX2
+#undef FDCT32x32_HIGH_PRECISION
diff --git a/libvpx/vp9/encoder/x86/vp9_dct_sse2.c b/libvpx/vp9/encoder/x86/vp9_dct_sse2.c
index fefca66..6865822 100644
--- a/libvpx/vp9/encoder/x86/vp9_dct_sse2.c
+++ b/libvpx/vp9/encoder/x86/vp9_dct_sse2.c
@@ -13,40 +13,82 @@
#include "vpx_ports/mem.h"
void vp9_fdct4x4_sse2(const int16_t *input, int16_t *output, int stride) {
- // The 2D transform is done with two passes which are actually pretty
- // similar. In the first one, we transform the columns and transpose
- // the results. In the second one, we transform the rows. To achieve that,
- // as the first pass results are transposed, we tranpose the columns (that
- // is the transposed rows) and transpose the results (so that it goes back
- // in normal/row positions).
- int pass;
+ // This 2D transform implements 4 vertical 1D transforms followed
+ // by 4 horizontal 1D transforms. The multiplies and adds are as given
+ // by Chen, Smith and Fralick ('77). The commands for moving the data
+ // around have been minimized by hand.
+ // For the purposes of the comments, the 16 inputs are referred to at i0
+ // through iF (in raster order), intermediate variables are a0, b0, c0
+ // through f, and correspond to the in-place computations mapped to input
+ // locations. The outputs, o0 through oF are labeled according to the
+ // output locations.
+
// Constants
- // When we use them, in one case, they are all the same. In all others
- // it's a pair of them that we need to repeat four times. This is done
- // by constructing the 32 bit constant corresponding to that pair.
- const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
- const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
- const __m128i k__cospi_p24_p08 = pair_set_epi16(cospi_24_64, cospi_8_64);
- const __m128i k__cospi_m08_p24 = pair_set_epi16(-cospi_8_64, cospi_24_64);
+ // These are the coefficients used for the multiplies.
+ // In the comments, pN means cos(N pi /64) and mN is -cos(N pi /64),
+ // where cospi_N_64 = cos(N pi /64)
+ const __m128i k__cospi_A = _mm_setr_epi16(cospi_16_64, cospi_16_64,
+ cospi_16_64, cospi_16_64,
+ cospi_16_64, -cospi_16_64,
+ cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_B = _mm_setr_epi16(cospi_16_64, -cospi_16_64,
+ cospi_16_64, -cospi_16_64,
+ cospi_16_64, cospi_16_64,
+ cospi_16_64, cospi_16_64);
+ const __m128i k__cospi_C = _mm_setr_epi16(cospi_8_64, cospi_24_64,
+ cospi_8_64, cospi_24_64,
+ cospi_24_64, -cospi_8_64,
+ cospi_24_64, -cospi_8_64);
+ const __m128i k__cospi_D = _mm_setr_epi16(cospi_24_64, -cospi_8_64,
+ cospi_24_64, -cospi_8_64,
+ cospi_8_64, cospi_24_64,
+ cospi_8_64, cospi_24_64);
+ const __m128i k__cospi_E = _mm_setr_epi16(cospi_16_64, cospi_16_64,
+ cospi_16_64, cospi_16_64,
+ cospi_16_64, cospi_16_64,
+ cospi_16_64, cospi_16_64);
+ const __m128i k__cospi_F = _mm_setr_epi16(cospi_16_64, -cospi_16_64,
+ cospi_16_64, -cospi_16_64,
+ cospi_16_64, -cospi_16_64,
+ cospi_16_64, -cospi_16_64);
+ const __m128i k__cospi_G = _mm_setr_epi16(cospi_8_64, cospi_24_64,
+ cospi_8_64, cospi_24_64,
+ -cospi_8_64, -cospi_24_64,
+ -cospi_8_64, -cospi_24_64);
+ const __m128i k__cospi_H = _mm_setr_epi16(cospi_24_64, -cospi_8_64,
+ cospi_24_64, -cospi_8_64,
+ -cospi_24_64, cospi_8_64,
+ -cospi_24_64, cospi_8_64);
+
const __m128i k__DCT_CONST_ROUNDING = _mm_set1_epi32(DCT_CONST_ROUNDING);
+ // This second rounding constant saves doing some extra adds at the end
+ const __m128i k__DCT_CONST_ROUNDING2 = _mm_set1_epi32(DCT_CONST_ROUNDING
+ +(DCT_CONST_ROUNDING << 1));
+ const int DCT_CONST_BITS2 = DCT_CONST_BITS+2;
const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1);
const __m128i k__nonzero_bias_b = _mm_setr_epi16(1, 0, 0, 0, 0, 0, 0, 0);
- const __m128i kOne = _mm_set1_epi16(1);
- __m128i in0, in1, in2, in3;
+ __m128i in0, in1;
+
// Load inputs.
{
in0 = _mm_loadl_epi64((const __m128i *)(input + 0 * stride));
in1 = _mm_loadl_epi64((const __m128i *)(input + 1 * stride));
- in2 = _mm_loadl_epi64((const __m128i *)(input + 2 * stride));
- in3 = _mm_loadl_epi64((const __m128i *)(input + 3 * stride));
- // x = x << 4
+ in1 = _mm_unpacklo_epi64(in1, _mm_loadl_epi64((const __m128i *)
+ (input + 2 * stride)));
+ in0 = _mm_unpacklo_epi64(in0, _mm_loadl_epi64((const __m128i *)
+ (input + 3 * stride)));
+ // in0 = [i0 i1 i2 i3 iC iD iE iF]
+ // in1 = [i4 i5 i6 i7 i8 i9 iA iB]
+
+
+ // multiply by 16 to give some extra precision
in0 = _mm_slli_epi16(in0, 4);
in1 = _mm_slli_epi16(in1, 4);
- in2 = _mm_slli_epi16(in2, 4);
- in3 = _mm_slli_epi16(in3, 4);
// if (i == 0 && input[0]) input[0] += 1;
+ // add 1 to the upper left pixel if it is non-zero, which helps reduce
+ // the round-trip error
{
- // The mask will only contain wether the first value is zero, all
+ // The mask will only contain whether the first value is zero, all
// other comparison will fail as something shifted by 4 (above << 4)
// can never be equal to one. To increment in the non-zero case, we
// add the mask and one for the first element:
@@ -57,60 +99,119 @@ void vp9_fdct4x4_sse2(const int16_t *input, int16_t *output, int stride) {
in0 = _mm_add_epi16(in0, k__nonzero_bias_b);
}
}
- // Do the two transform/transpose passes
- for (pass = 0; pass < 2; ++pass) {
- // Transform 1/2: Add/substract
- const __m128i r0 = _mm_add_epi16(in0, in3);
- const __m128i r1 = _mm_add_epi16(in1, in2);
- const __m128i r2 = _mm_sub_epi16(in1, in2);
- const __m128i r3 = _mm_sub_epi16(in0, in3);
- // Transform 1/2: Interleave to do the multiply by constants which gets us
- // into 32 bits.
- const __m128i t0 = _mm_unpacklo_epi16(r0, r1);
- const __m128i t2 = _mm_unpacklo_epi16(r2, r3);
- const __m128i u0 = _mm_madd_epi16(t0, k__cospi_p16_p16);
- const __m128i u2 = _mm_madd_epi16(t0, k__cospi_p16_m16);
- const __m128i u4 = _mm_madd_epi16(t2, k__cospi_p24_p08);
- const __m128i u6 = _mm_madd_epi16(t2, k__cospi_m08_p24);
+ // There are 4 total stages, alternating between an add/subtract stage
+ // followed by an multiply-and-add stage.
+ {
+ // Stage 1: Add/subtract
+
+ // in0 = [i0 i1 i2 i3 iC iD iE iF]
+ // in1 = [i4 i5 i6 i7 i8 i9 iA iB]
+ const __m128i r0 = _mm_unpacklo_epi16(in0, in1);
+ const __m128i r1 = _mm_unpackhi_epi16(in0, in1);
+ // r0 = [i0 i4 i1 i5 i2 i6 i3 i7]
+ // r1 = [iC i8 iD i9 iE iA iF iB]
+ const __m128i r2 = _mm_shuffle_epi32(r0, 0xB4);
+ const __m128i r3 = _mm_shuffle_epi32(r1, 0xB4);
+ // r2 = [i0 i4 i1 i5 i3 i7 i2 i6]
+ // r3 = [iC i8 iD i9 iF iB iE iA]
+
+ const __m128i t0 = _mm_add_epi16(r2, r3);
+ const __m128i t1 = _mm_sub_epi16(r2, r3);
+ // t0 = [a0 a4 a1 a5 a3 a7 a2 a6]
+ // t1 = [aC a8 aD a9 aF aB aE aA]
+
+ // Stage 2: multiply by constants (which gets us into 32 bits).
+ // The constants needed here are:
+ // k__cospi_A = [p16 p16 p16 p16 p16 m16 p16 m16]
+ // k__cospi_B = [p16 m16 p16 m16 p16 p16 p16 p16]
+ // k__cospi_C = [p08 p24 p08 p24 p24 m08 p24 m08]
+ // k__cospi_D = [p24 m08 p24 m08 p08 p24 p08 p24]
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_A);
+ const __m128i u2 = _mm_madd_epi16(t0, k__cospi_B);
+ const __m128i u1 = _mm_madd_epi16(t1, k__cospi_C);
+ const __m128i u3 = _mm_madd_epi16(t1, k__cospi_D);
+ // Then add and right-shift to get back to 16-bit range
const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING);
const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING);
- const __m128i v4 = _mm_add_epi32(u4, k__DCT_CONST_ROUNDING);
- const __m128i v6 = _mm_add_epi32(u6, k__DCT_CONST_ROUNDING);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING);
const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS);
const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS);
- const __m128i w4 = _mm_srai_epi32(v4, DCT_CONST_BITS);
- const __m128i w6 = _mm_srai_epi32(v6, DCT_CONST_BITS);
- // Combine and transpose
- const __m128i res0 = _mm_packs_epi32(w0, w2);
- const __m128i res1 = _mm_packs_epi32(w4, w6);
- // 00 01 02 03 20 21 22 23
- // 10 11 12 13 30 31 32 33
- const __m128i tr0_0 = _mm_unpacklo_epi16(res0, res1);
- const __m128i tr0_1 = _mm_unpackhi_epi16(res0, res1);
- // 00 10 01 11 02 12 03 13
- // 20 30 21 31 22 32 23 33
- in0 = _mm_unpacklo_epi32(tr0_0, tr0_1);
- in2 = _mm_unpackhi_epi32(tr0_0, tr0_1);
- // 00 10 20 30 01 11 21 31 in0 contains 0 followed by 1
- // 02 12 22 32 03 13 23 33 in2 contains 2 followed by 3
- if (0 == pass) {
- // Extract values in the high part for second pass as transform code
- // only uses the first four values.
- in1 = _mm_unpackhi_epi64(in0, in0);
- in3 = _mm_unpackhi_epi64(in2, in2);
- } else {
- // Post-condition output and store it (v + 1) >> 2, taking advantage
- // of the fact 1/3 are stored just after 0/2.
- __m128i out01 = _mm_add_epi16(in0, kOne);
- __m128i out23 = _mm_add_epi16(in2, kOne);
- out01 = _mm_srai_epi16(out01, 2);
- out23 = _mm_srai_epi16(out23, 2);
- _mm_storeu_si128((__m128i *)(output + 0 * 4), out01);
- _mm_storeu_si128((__m128i *)(output + 2 * 4), out23);
- }
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS);
+ // w0 = [b0 b1 b7 b6]
+ // w1 = [b8 b9 bF bE]
+ // w2 = [b4 b5 b3 b2]
+ // w3 = [bC bD bB bA]
+ const __m128i x0 = _mm_packs_epi32(w0, w1);
+ const __m128i x1 = _mm_packs_epi32(w2, w3);
+ // x0 = [b0 b1 b7 b6 b8 b9 bF bE]
+ // x1 = [b4 b5 b3 b2 bC bD bB bA]
+ in0 = _mm_shuffle_epi32(x0, 0xD8);
+ in1 = _mm_shuffle_epi32(x1, 0x8D);
+ // in0 = [b0 b1 b8 b9 b7 b6 bF bE]
+ // in1 = [b3 b2 bB bA b4 b5 bC bD]
+ }
+ {
+ // vertical DCTs finished. Now we do the horizontal DCTs.
+ // Stage 3: Add/subtract
+
+ const __m128i t0 = _mm_add_epi16(in0, in1);
+ const __m128i t1 = _mm_sub_epi16(in0, in1);
+ // t0 = [c0 c1 c8 c9 c4 c5 cC cD]
+ // t1 = [c3 c2 cB cA -c7 -c6 -cF -cE]
+
+ // Stage 4: multiply by constants (which gets us into 32 bits).
+ // The constants needed here are:
+ // k__cospi_E = [p16 p16 p16 p16 p16 p16 p16 p16]
+ // k__cospi_F = [p16 m16 p16 m16 p16 m16 p16 m16]
+ // k__cospi_G = [p08 p24 p08 p24 m08 m24 m08 m24]
+ // k__cospi_H = [p24 m08 p24 m08 m24 p08 m24 p08]
+ const __m128i u0 = _mm_madd_epi16(t0, k__cospi_E);
+ const __m128i u1 = _mm_madd_epi16(t0, k__cospi_F);
+ const __m128i u2 = _mm_madd_epi16(t1, k__cospi_G);
+ const __m128i u3 = _mm_madd_epi16(t1, k__cospi_H);
+ // Then add and right-shift to get back to 16-bit range
+ // but this combines the final right-shift as well to save operations
+ // This unusual rounding operations is to maintain bit-accurate
+ // compatibility with the c version of this function which has two
+ // rounding steps in a row.
+ const __m128i v0 = _mm_add_epi32(u0, k__DCT_CONST_ROUNDING2);
+ const __m128i v1 = _mm_add_epi32(u1, k__DCT_CONST_ROUNDING2);
+ const __m128i v2 = _mm_add_epi32(u2, k__DCT_CONST_ROUNDING2);
+ const __m128i v3 = _mm_add_epi32(u3, k__DCT_CONST_ROUNDING2);
+ const __m128i w0 = _mm_srai_epi32(v0, DCT_CONST_BITS2);
+ const __m128i w1 = _mm_srai_epi32(v1, DCT_CONST_BITS2);
+ const __m128i w2 = _mm_srai_epi32(v2, DCT_CONST_BITS2);
+ const __m128i w3 = _mm_srai_epi32(v3, DCT_CONST_BITS2);
+ // w0 = [o0 o4 o8 oC]
+ // w1 = [o2 o6 oA oE]
+ // w2 = [o1 o5 o9 oD]
+ // w3 = [o3 o7 oB oF]
+ // remember the o's are numbered according to the correct output location
+ const __m128i x0 = _mm_packs_epi32(w0, w1);
+ const __m128i x1 = _mm_packs_epi32(w2, w3);
+ // x0 = [o0 o4 o8 oC o2 o6 oA oE]
+ // x1 = [o1 o5 o9 oD o3 o7 oB oF]
+ const __m128i y0 = _mm_unpacklo_epi16(x0, x1);
+ const __m128i y1 = _mm_unpackhi_epi16(x0, x1);
+ // y0 = [o0 o1 o4 o5 o8 o9 oC oD]
+ // y1 = [o2 o3 o6 o7 oA oB oE oF]
+ in0 = _mm_unpacklo_epi32(y0, y1);
+ // in0 = [o0 o1 o2 o3 o4 o5 o6 o7]
+ in1 = _mm_unpackhi_epi32(y0, y1);
+ // in1 = [o8 o9 oA oB oC oD oE oF]
+ }
+ // Post-condition (v + 1) >> 2 is now incorporated into previous
+ // add and right-shift commands. Only 2 store instructions needed
+ // because we are using the fact that 1/3 are stored just after 0/2.
+ {
+ _mm_storeu_si128((__m128i *)(output + 0 * 4), in0);
+ _mm_storeu_si128((__m128i *)(output + 2 * 4), in1);
}
}
+
static INLINE void load_buffer_4x4(const int16_t *input, __m128i *in,
int stride) {
const __m128i k__nonzero_bias_a = _mm_setr_epi16(0, 1, 1, 1, 1, 1, 1, 1);
@@ -163,7 +264,7 @@ static INLINE void transpose_4x4(__m128i *res) {
res[3] = _mm_unpackhi_epi64(res[2], res[2]);
}
-void fdct4_1d_sse2(__m128i *in) {
+void fdct4_sse2(__m128i *in) {
const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
const __m128i k__cospi_p08_p24 = pair_set_epi16(cospi_8_64, cospi_24_64);
@@ -196,7 +297,7 @@ void fdct4_1d_sse2(__m128i *in) {
transpose_4x4(in);
}
-void fadst4_1d_sse2(__m128i *in) {
+void fadst4_sse2(__m128i *in) {
const __m128i k__sinpi_p01_p02 = pair_set_epi16(sinpi_1_9, sinpi_2_9);
const __m128i k__sinpi_p04_m01 = pair_set_epi16(sinpi_4_9, -sinpi_1_9);
const __m128i k__sinpi_p03_p04 = pair_set_epi16(sinpi_3_9, sinpi_4_9);
@@ -244,32 +345,36 @@ void fadst4_1d_sse2(__m128i *in) {
transpose_4x4(in);
}
-void vp9_short_fht4x4_sse2(const int16_t *input, int16_t *output,
- int stride, int tx_type) {
+void vp9_fht4x4_sse2(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
__m128i in[4];
- load_buffer_4x4(input, in, stride);
+
switch (tx_type) {
- case 0: // DCT_DCT
- fdct4_1d_sse2(in);
- fdct4_1d_sse2(in);
+ case DCT_DCT:
+ vp9_fdct4x4_sse2(input, output, stride);
break;
- case 1: // ADST_DCT
- fadst4_1d_sse2(in);
- fdct4_1d_sse2(in);
+ case ADST_DCT:
+ load_buffer_4x4(input, in, stride);
+ fadst4_sse2(in);
+ fdct4_sse2(in);
+ write_buffer_4x4(output, in);
break;
- case 2: // DCT_ADST
- fdct4_1d_sse2(in);
- fadst4_1d_sse2(in);
+ case DCT_ADST:
+ load_buffer_4x4(input, in, stride);
+ fdct4_sse2(in);
+ fadst4_sse2(in);
+ write_buffer_4x4(output, in);
break;
- case 3: // ADST_ADST
- fadst4_1d_sse2(in);
- fadst4_1d_sse2(in);
- break;
- default:
- assert(0);
+ case ADST_ADST:
+ load_buffer_4x4(input, in, stride);
+ fadst4_sse2(in);
+ fadst4_sse2(in);
+ write_buffer_4x4(output, in);
break;
+ default:
+ assert(0);
+ break;
}
- write_buffer_4x4(output, in);
}
void vp9_fdct8x8_sse2(const int16_t *input, int16_t *output, int stride) {
@@ -313,7 +418,7 @@ void vp9_fdct8x8_sse2(const int16_t *input, int16_t *output, int stride) {
for (pass = 0; pass < 2; pass++) {
// To store results of each pass before the transpose.
__m128i res0, res1, res2, res3, res4, res5, res6, res7;
- // Add/substract
+ // Add/subtract
const __m128i q0 = _mm_add_epi16(in0, in7);
const __m128i q1 = _mm_add_epi16(in1, in6);
const __m128i q2 = _mm_add_epi16(in2, in5);
@@ -324,7 +429,7 @@ void vp9_fdct8x8_sse2(const int16_t *input, int16_t *output, int stride) {
const __m128i q7 = _mm_sub_epi16(in0, in7);
// Work on first four results
{
- // Add/substract
+ // Add/subtract
const __m128i r0 = _mm_add_epi16(q0, q3);
const __m128i r1 = _mm_add_epi16(q1, q2);
const __m128i r2 = _mm_sub_epi16(q1, q2);
@@ -386,7 +491,7 @@ void vp9_fdct8x8_sse2(const int16_t *input, int16_t *output, int stride) {
// Combine
const __m128i r0 = _mm_packs_epi32(s0, s1);
const __m128i r1 = _mm_packs_epi32(s2, s3);
- // Add/substract
+ // Add/subtract
const __m128i x0 = _mm_add_epi16(q4, r0);
const __m128i x1 = _mm_sub_epi16(q4, r0);
const __m128i x2 = _mm_sub_epi16(q7, r1);
@@ -658,7 +763,7 @@ static INLINE void array_transpose_8x8(__m128i *in, __m128i *res) {
// 07 17 27 37 47 57 67 77
}
-void fdct8_1d_sse2(__m128i *in) {
+void fdct8_sse2(__m128i *in) {
// constants
const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
const __m128i k__cospi_p16_m16 = pair_set_epi16(cospi_16_64, -cospi_16_64);
@@ -798,7 +903,7 @@ void fdct8_1d_sse2(__m128i *in) {
array_transpose_8x8(in, in);
}
-void fadst8_1d_sse2(__m128i *in) {
+void fadst8_sse2(__m128i *in) {
// Constants
const __m128i k__cospi_p02_p30 = pair_set_epi16(cospi_2_64, cospi_30_64);
const __m128i k__cospi_p30_m02 = pair_set_epi16(cospi_30_64, -cospi_2_64);
@@ -1028,40 +1133,46 @@ void fadst8_1d_sse2(__m128i *in) {
array_transpose_8x8(in, in);
}
-void vp9_short_fht8x8_sse2(const int16_t *input, int16_t *output,
- int stride, int tx_type) {
+void vp9_fht8x8_sse2(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
__m128i in[8];
- load_buffer_8x8(input, in, stride);
+
switch (tx_type) {
- case 0: // DCT_DCT
- fdct8_1d_sse2(in);
- fdct8_1d_sse2(in);
+ case DCT_DCT:
+ vp9_fdct8x8_sse2(input, output, stride);
break;
- case 1: // ADST_DCT
- fadst8_1d_sse2(in);
- fdct8_1d_sse2(in);
+ case ADST_DCT:
+ load_buffer_8x8(input, in, stride);
+ fadst8_sse2(in);
+ fdct8_sse2(in);
+ right_shift_8x8(in, 1);
+ write_buffer_8x8(output, in, 8);
break;
- case 2: // DCT_ADST
- fdct8_1d_sse2(in);
- fadst8_1d_sse2(in);
+ case DCT_ADST:
+ load_buffer_8x8(input, in, stride);
+ fdct8_sse2(in);
+ fadst8_sse2(in);
+ right_shift_8x8(in, 1);
+ write_buffer_8x8(output, in, 8);
break;
- case 3: // ADST_ADST
- fadst8_1d_sse2(in);
- fadst8_1d_sse2(in);
+ case ADST_ADST:
+ load_buffer_8x8(input, in, stride);
+ fadst8_sse2(in);
+ fadst8_sse2(in);
+ right_shift_8x8(in, 1);
+ write_buffer_8x8(output, in, 8);
break;
default:
assert(0);
break;
}
- right_shift_8x8(in, 1);
- write_buffer_8x8(output, in, 8);
}
void vp9_fdct16x16_sse2(const int16_t *input, int16_t *output, int stride) {
// The 2D transform is done with two passes which are actually pretty
// similar. In the first one, we transform the columns and transpose
// the results. In the second one, we transform the rows. To achieve that,
- // as the first pass results are transposed, we tranpose the columns (that
+ // as the first pass results are transposed, we transpose the columns (that
// is the transposed rows) and transpose the results (so that it goes back
// in normal/row positions).
int pass;
@@ -1216,9 +1327,9 @@ void vp9_fdct16x16_sse2(const int16_t *input, int16_t *output, int stride) {
step1_6 = _mm_sub_epi16(in01, in14);
step1_7 = _mm_sub_epi16(in00, in15);
}
- // Work on the first eight values; fdct8_1d(input, even_results);
+ // Work on the first eight values; fdct8(input, even_results);
{
- // Add/substract
+ // Add/subtract
const __m128i q0 = _mm_add_epi16(input0, input7);
const __m128i q1 = _mm_add_epi16(input1, input6);
const __m128i q2 = _mm_add_epi16(input2, input5);
@@ -1229,7 +1340,7 @@ void vp9_fdct16x16_sse2(const int16_t *input, int16_t *output, int stride) {
const __m128i q7 = _mm_sub_epi16(input0, input7);
// Work on first four results
{
- // Add/substract
+ // Add/subtract
const __m128i r0 = _mm_add_epi16(q0, q3);
const __m128i r1 = _mm_add_epi16(q1, q2);
const __m128i r2 = _mm_sub_epi16(q1, q2);
@@ -1293,7 +1404,7 @@ void vp9_fdct16x16_sse2(const int16_t *input, int16_t *output, int stride) {
// Combine
const __m128i r0 = _mm_packs_epi32(s0, s1);
const __m128i r1 = _mm_packs_epi32(s2, s3);
- // Add/substract
+ // Add/subtract
const __m128i x0 = _mm_add_epi16(q4, r0);
const __m128i x1 = _mm_sub_epi16(q4, r0);
const __m128i x2 = _mm_sub_epi16(q7, r1);
@@ -1730,7 +1841,7 @@ static INLINE void right_shift_16x16(__m128i *res0, __m128i *res1) {
right_shift_8x8(res1 + 8, 2);
}
-void fdct16_1d_8col(__m128i *in) {
+void fdct16_8col(__m128i *in) {
// perform 16x16 1-D DCT for 8 columns
__m128i i[8], s[8], p[8], t[8], u[16], v[16];
const __m128i k__cospi_p16_p16 = _mm_set1_epi16(cospi_16_64);
@@ -2052,7 +2163,7 @@ void fdct16_1d_8col(__m128i *in) {
in[15] = _mm_packs_epi32(v[14], v[15]);
}
-void fadst16_1d_8col(__m128i *in) {
+void fadst16_8col(__m128i *in) {
// perform 16x16 1-D ADST for 8 columns
__m128i s[16], x[16], u[32], v[32];
const __m128i k__cospi_p01_p31 = pair_set_epi16(cospi_1_64, cospi_31_64);
@@ -2522,48 +2633,51 @@ void fadst16_1d_8col(__m128i *in) {
in[15] = _mm_sub_epi16(kZero, s[1]);
}
-void fdct16_1d_sse2(__m128i *in0, __m128i *in1) {
- fdct16_1d_8col(in0);
- fdct16_1d_8col(in1);
+void fdct16_sse2(__m128i *in0, __m128i *in1) {
+ fdct16_8col(in0);
+ fdct16_8col(in1);
array_transpose_16x16(in0, in1);
}
-void fadst16_1d_sse2(__m128i *in0, __m128i *in1) {
- fadst16_1d_8col(in0);
- fadst16_1d_8col(in1);
+void fadst16_sse2(__m128i *in0, __m128i *in1) {
+ fadst16_8col(in0);
+ fadst16_8col(in1);
array_transpose_16x16(in0, in1);
}
-void vp9_short_fht16x16_sse2(const int16_t *input, int16_t *output,
- int stride, int tx_type) {
+void vp9_fht16x16_sse2(const int16_t *input, int16_t *output,
+ int stride, int tx_type) {
__m128i in0[16], in1[16];
- load_buffer_16x16(input, in0, in1, stride);
+
switch (tx_type) {
- case 0: // DCT_DCT
- fdct16_1d_sse2(in0, in1);
- right_shift_16x16(in0, in1);
- fdct16_1d_sse2(in0, in1);
+ case DCT_DCT:
+ vp9_fdct16x16_sse2(input, output, stride);
break;
- case 1: // ADST_DCT
- fadst16_1d_sse2(in0, in1);
+ case ADST_DCT:
+ load_buffer_16x16(input, in0, in1, stride);
+ fadst16_sse2(in0, in1);
right_shift_16x16(in0, in1);
- fdct16_1d_sse2(in0, in1);
+ fdct16_sse2(in0, in1);
+ write_buffer_16x16(output, in0, in1, 16);
break;
- case 2: // DCT_ADST
- fdct16_1d_sse2(in0, in1);
+ case DCT_ADST:
+ load_buffer_16x16(input, in0, in1, stride);
+ fdct16_sse2(in0, in1);
right_shift_16x16(in0, in1);
- fadst16_1d_sse2(in0, in1);
+ fadst16_sse2(in0, in1);
+ write_buffer_16x16(output, in0, in1, 16);
break;
- case 3: // ADST_ADST
- fadst16_1d_sse2(in0, in1);
+ case ADST_ADST:
+ load_buffer_16x16(input, in0, in1, stride);
+ fadst16_sse2(in0, in1);
right_shift_16x16(in0, in1);
- fadst16_1d_sse2(in0, in1);
+ fadst16_sse2(in0, in1);
+ write_buffer_16x16(output, in0, in1, 16);
break;
default:
assert(0);
break;
}
- write_buffer_16x16(output, in0, in1, 16);
}
#define FDCT32x32_2D vp9_fdct32x32_rd_sse2
diff --git a/libvpx/vp9/encoder/x86/vp9_mcomp_x86.h b/libvpx/vp9/encoder/x86/vp9_mcomp_x86.h
index ca80b8b..c15039a 100644
--- a/libvpx/vp9/encoder/x86/vp9_mcomp_x86.h
+++ b/libvpx/vp9/encoder/x86/vp9_mcomp_x86.h
@@ -12,6 +12,10 @@
#ifndef VP9_ENCODER_X86_VP9_MCOMP_X86_H_
#define VP9_ENCODER_X86_VP9_MCOMP_X86_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if HAVE_SSE3
#if !CONFIG_RUNTIME_CPU_DETECT
@@ -36,5 +40,9 @@
#endif
#endif
+#ifdef __cplusplus
+} // extern "C"
#endif
+#endif // VP9_ENCODER_X86_VP9_MCOMP_X86_H_
+
diff --git a/libvpx/vp9/encoder/x86/vp9_quantize_ssse3.asm b/libvpx/vp9/encoder/x86/vp9_quantize_ssse3.asm
index db30660..48ccef8 100644
--- a/libvpx/vp9/encoder/x86/vp9_quantize_ssse3.asm
+++ b/libvpx/vp9/encoder/x86/vp9_quantize_ssse3.asm
@@ -188,7 +188,8 @@ cglobal quantize_%1, 0, %2, 15, coeff, ncoeff, skip, zbin, round, quant, \
pmaxsw m8, m7
pshuflw m7, m8, 0x1
pmaxsw m8, m7
- pextrw [r2], m8, 0
+ pextrw r6, m8, 0
+ mov [r2], r6
RET
; skip-block, i.e. just write all zeroes
@@ -214,5 +215,5 @@ cglobal quantize_%1, 0, %2, 15, coeff, ncoeff, skip, zbin, round, quant, \
%endmacro
INIT_XMM ssse3
-QUANTIZE_FN b, 6
+QUANTIZE_FN b, 7
QUANTIZE_FN b_32x32, 7
diff --git a/libvpx/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c b/libvpx/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c
new file mode 100644
index 0000000..34ed186
--- /dev/null
+++ b/libvpx/vp9/encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c
@@ -0,0 +1,539 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <immintrin.h> // AVX2
+#include "vpx_ports/mem.h"
+#include "vp9/encoder/vp9_variance.h"
+
+DECLARE_ALIGNED(32, static const uint8_t, bilinear_filters_avx2[512]) = {
+ 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0,
+ 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0, 16, 0,
+ 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1,
+ 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1,
+ 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2,
+ 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2,
+ 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3,
+ 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3,
+ 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4,
+ 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4,
+ 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5,
+ 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5,
+ 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6,
+ 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6,
+ 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7,
+ 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9,
+ 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9, 7, 9,
+ 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10,
+ 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10, 6, 10,
+ 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11,
+ 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11, 5, 11,
+ 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12,
+ 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12, 4, 12,
+ 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13,
+ 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13, 3, 13,
+ 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14,
+ 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14, 2, 14,
+ 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15,
+ 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15
+};
+
+#define FILTER_SRC(filter) \
+ /* filter the source */ \
+ exp_src_lo = _mm256_maddubs_epi16(exp_src_lo, filter); \
+ exp_src_hi = _mm256_maddubs_epi16(exp_src_hi, filter); \
+ \
+ /* add 8 to source */ \
+ exp_src_lo = _mm256_add_epi16(exp_src_lo, pw8); \
+ exp_src_hi = _mm256_add_epi16(exp_src_hi, pw8); \
+ \
+ /* divide source by 16 */ \
+ exp_src_lo = _mm256_srai_epi16(exp_src_lo, 4); \
+ exp_src_hi = _mm256_srai_epi16(exp_src_hi, 4);
+
+#define MERGE_WITH_SRC(src_reg, reg) \
+ exp_src_lo = _mm256_unpacklo_epi8(src_reg, reg); \
+ exp_src_hi = _mm256_unpackhi_epi8(src_reg, reg);
+
+#define LOAD_SRC_DST \
+ /* load source and destination */ \
+ src_reg = _mm256_loadu_si256((__m256i const *) (src)); \
+ dst_reg = _mm256_load_si256((__m256i const *) (dst));
+
+#define AVG_NEXT_SRC(src_reg, size_stride) \
+ src_next_reg = _mm256_loadu_si256((__m256i const *) \
+ (src + size_stride)); \
+ /* average between current and next stride source */ \
+ src_reg = _mm256_avg_epu8(src_reg, src_next_reg);
+
+#define MERGE_NEXT_SRC(src_reg, size_stride) \
+ src_next_reg = _mm256_loadu_si256((__m256i const *) \
+ (src + size_stride)); \
+ MERGE_WITH_SRC(src_reg, src_next_reg)
+
+#define CALC_SUM_SSE_INSIDE_LOOP \
+ /* expand each byte to 2 bytes */ \
+ exp_dst_lo = _mm256_unpacklo_epi8(dst_reg, zero_reg); \
+ exp_dst_hi = _mm256_unpackhi_epi8(dst_reg, zero_reg); \
+ /* source - dest */ \
+ exp_src_lo = _mm256_sub_epi16(exp_src_lo, exp_dst_lo); \
+ exp_src_hi = _mm256_sub_epi16(exp_src_hi, exp_dst_hi); \
+ /* caculate sum */ \
+ sum_reg = _mm256_add_epi16(sum_reg, exp_src_lo); \
+ exp_src_lo = _mm256_madd_epi16(exp_src_lo, exp_src_lo); \
+ sum_reg = _mm256_add_epi16(sum_reg, exp_src_hi); \
+ exp_src_hi = _mm256_madd_epi16(exp_src_hi, exp_src_hi); \
+ /* calculate sse */ \
+ sse_reg = _mm256_add_epi32(sse_reg, exp_src_lo); \
+ sse_reg = _mm256_add_epi32(sse_reg, exp_src_hi);
+
+// final calculation to sum and sse
+#define CALC_SUM_AND_SSE \
+ res_cmp = _mm256_cmpgt_epi16(zero_reg, sum_reg); \
+ sse_reg_hi = _mm256_srli_si256(sse_reg, 8); \
+ sum_reg_lo = _mm256_unpacklo_epi16(sum_reg, res_cmp); \
+ sum_reg_hi = _mm256_unpackhi_epi16(sum_reg, res_cmp); \
+ sse_reg = _mm256_add_epi32(sse_reg, sse_reg_hi); \
+ sum_reg = _mm256_add_epi32(sum_reg_lo, sum_reg_hi); \
+ \
+ sse_reg_hi = _mm256_srli_si256(sse_reg, 4); \
+ sum_reg_hi = _mm256_srli_si256(sum_reg, 8); \
+ \
+ sse_reg = _mm256_add_epi32(sse_reg, sse_reg_hi); \
+ sum_reg = _mm256_add_epi32(sum_reg, sum_reg_hi); \
+ *((int*)sse)= _mm_cvtsi128_si32(_mm256_castsi256_si128(sse_reg)) + \
+ _mm_cvtsi128_si32(_mm256_extractf128_si256(sse_reg, 1)); \
+ sum_reg_hi = _mm256_srli_si256(sum_reg, 4); \
+ sum_reg = _mm256_add_epi32(sum_reg, sum_reg_hi); \
+ sum = _mm_cvtsi128_si32(_mm256_castsi256_si128(sum_reg)) + \
+ _mm_cvtsi128_si32(_mm256_extractf128_si256(sum_reg, 1));
+
+
+unsigned int vp9_sub_pixel_variance32xh_avx2(const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ int height,
+ unsigned int *sse) {
+ __m256i src_reg, dst_reg, exp_src_lo, exp_src_hi, exp_dst_lo, exp_dst_hi;
+ __m256i sse_reg, sum_reg, sse_reg_hi, res_cmp, sum_reg_lo, sum_reg_hi;
+ __m256i zero_reg;
+ int i, sum;
+ sum_reg = _mm256_set1_epi16(0);
+ sse_reg = _mm256_set1_epi16(0);
+ zero_reg = _mm256_set1_epi16(0);
+
+ // x_offset = 0 and y_offset = 0
+ if (x_offset == 0) {
+ if (y_offset == 0) {
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ // expend each byte to 2 bytes
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = 0 and y_offset = 8
+ } else if (y_offset == 8) {
+ __m256i src_next_reg;
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, src_stride)
+ // expend each byte to 2 bytes
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = 0 and y_offset = bilin interpolation
+ } else {
+ __m256i filter, pw8, src_next_reg;
+
+ y_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + y_offset));
+ pw8 = _mm256_set1_epi16(8);
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, src_stride)
+ FILTER_SRC(filter)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ }
+ // x_offset = 8 and y_offset = 0
+ } else if (x_offset == 8) {
+ if (y_offset == 0) {
+ __m256i src_next_reg;
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, 1)
+ // expand each byte to 2 bytes
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = 8 and y_offset = 8
+ } else if (y_offset == 8) {
+ __m256i src_next_reg, src_avg;
+ // load source and another source starting from the next
+ // following byte
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ AVG_NEXT_SRC(src_reg, 1)
+ for (i = 0; i < height ; i++) {
+ src_avg = src_reg;
+ src+= src_stride;
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, 1)
+ // average between previous average to current average
+ src_avg = _mm256_avg_epu8(src_avg, src_reg);
+ // expand each byte to 2 bytes
+ MERGE_WITH_SRC(src_avg, zero_reg)
+ // save current source average
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ // x_offset = 8 and y_offset = bilin interpolation
+ } else {
+ __m256i filter, pw8, src_next_reg, src_avg;
+ y_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + y_offset));
+ pw8 = _mm256_set1_epi16(8);
+ // load source and another source starting from the next
+ // following byte
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ AVG_NEXT_SRC(src_reg, 1)
+ for (i = 0; i < height ; i++) {
+ // save current source average
+ src_avg = src_reg;
+ src+= src_stride;
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, 1)
+ MERGE_WITH_SRC(src_avg, src_reg)
+ FILTER_SRC(filter)
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ }
+ // x_offset = bilin interpolation and y_offset = 0
+ } else {
+ if (y_offset == 0) {
+ __m256i filter, pw8, src_next_reg;
+ x_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + x_offset));
+ pw8 = _mm256_set1_epi16(8);
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(filter)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = bilin interpolation and y_offset = 8
+ } else if (y_offset == 8) {
+ __m256i filter, pw8, src_next_reg, src_pack;
+ x_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + x_offset));
+ pw8 = _mm256_set1_epi16(8);
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(filter)
+ // convert each 16 bit to 8 bit to each low and high lane source
+ src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ for (i = 0; i < height ; i++) {
+ src+= src_stride;
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(filter)
+ src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ // average between previous pack to the current
+ src_pack = _mm256_avg_epu8(src_pack, src_reg);
+ MERGE_WITH_SRC(src_pack, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src_pack = src_reg;
+ dst+= dst_stride;
+ }
+ // x_offset = bilin interpolation and y_offset = bilin interpolation
+ } else {
+ __m256i xfilter, yfilter, pw8, src_next_reg, src_pack;
+ x_offset <<= 5;
+ xfilter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + x_offset));
+ y_offset <<= 5;
+ yfilter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + y_offset));
+ pw8 = _mm256_set1_epi16(8);
+ // load source and another source starting from the next
+ // following byte
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ MERGE_NEXT_SRC(src_reg, 1)
+
+ FILTER_SRC(xfilter)
+ // convert each 16 bit to 8 bit to each low and high lane source
+ src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ for (i = 0; i < height ; i++) {
+ src+= src_stride;
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(xfilter)
+ src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ // merge previous pack to current pack source
+ MERGE_WITH_SRC(src_pack, src_reg)
+ // filter the source
+ FILTER_SRC(yfilter)
+ src_pack = src_reg;
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ }
+ }
+ CALC_SUM_AND_SSE
+ return sum;
+}
+
+unsigned int vp9_sub_pixel_avg_variance32xh_avx2(const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ const uint8_t *sec,
+ int sec_stride,
+ int height,
+ unsigned int *sse) {
+ __m256i sec_reg;
+ __m256i src_reg, dst_reg, exp_src_lo, exp_src_hi, exp_dst_lo, exp_dst_hi;
+ __m256i sse_reg, sum_reg, sse_reg_hi, res_cmp, sum_reg_lo, sum_reg_hi;
+ __m256i zero_reg;
+ int i, sum;
+ sum_reg = _mm256_set1_epi16(0);
+ sse_reg = _mm256_set1_epi16(0);
+ zero_reg = _mm256_set1_epi16(0);
+
+ // x_offset = 0 and y_offset = 0
+ if (x_offset == 0) {
+ if (y_offset == 0) {
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_reg = _mm256_avg_epu8(src_reg, sec_reg);
+ sec+= sec_stride;
+ // expend each byte to 2 bytes
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ } else if (y_offset == 8) {
+ __m256i src_next_reg;
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, src_stride)
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_reg = _mm256_avg_epu8(src_reg, sec_reg);
+ sec+= sec_stride;
+ // expend each byte to 2 bytes
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = 0 and y_offset = bilin interpolation
+ } else {
+ __m256i filter, pw8, src_next_reg;
+
+ y_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + y_offset));
+ pw8 = _mm256_set1_epi16(8);
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, src_stride)
+ FILTER_SRC(filter)
+ src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_reg = _mm256_avg_epu8(src_reg, sec_reg);
+ sec+= sec_stride;
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ }
+ // x_offset = 8 and y_offset = 0
+ } else if (x_offset == 8) {
+ if (y_offset == 0) {
+ __m256i src_next_reg;
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, 1)
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_reg = _mm256_avg_epu8(src_reg, sec_reg);
+ sec+= sec_stride;
+ // expand each byte to 2 bytes
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = 8 and y_offset = 8
+ } else if (y_offset == 8) {
+ __m256i src_next_reg, src_avg;
+ // load source and another source starting from the next
+ // following byte
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ AVG_NEXT_SRC(src_reg, 1)
+ for (i = 0; i < height ; i++) {
+ // save current source average
+ src_avg = src_reg;
+ src+= src_stride;
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, 1)
+ // average between previous average to current average
+ src_avg = _mm256_avg_epu8(src_avg, src_reg);
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_avg = _mm256_avg_epu8(src_avg, sec_reg);
+ sec+= sec_stride;
+ // expand each byte to 2 bytes
+ MERGE_WITH_SRC(src_avg, zero_reg)
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ // x_offset = 8 and y_offset = bilin interpolation
+ } else {
+ __m256i filter, pw8, src_next_reg, src_avg;
+ y_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + y_offset));
+ pw8 = _mm256_set1_epi16(8);
+ // load source and another source starting from the next
+ // following byte
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ AVG_NEXT_SRC(src_reg, 1)
+ for (i = 0; i < height ; i++) {
+ // save current source average
+ src_avg = src_reg;
+ src+= src_stride;
+ LOAD_SRC_DST
+ AVG_NEXT_SRC(src_reg, 1)
+ MERGE_WITH_SRC(src_avg, src_reg)
+ FILTER_SRC(filter)
+ src_avg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_avg = _mm256_avg_epu8(src_avg, sec_reg);
+ // expand each byte to 2 bytes
+ MERGE_WITH_SRC(src_avg, zero_reg)
+ sec+= sec_stride;
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ }
+ // x_offset = bilin interpolation and y_offset = 0
+ } else {
+ if (y_offset == 0) {
+ __m256i filter, pw8, src_next_reg;
+ x_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + x_offset));
+ pw8 = _mm256_set1_epi16(8);
+ for (i = 0; i < height ; i++) {
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(filter)
+ src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_reg = _mm256_avg_epu8(src_reg, sec_reg);
+ MERGE_WITH_SRC(src_reg, zero_reg)
+ sec+= sec_stride;
+ CALC_SUM_SSE_INSIDE_LOOP
+ src+= src_stride;
+ dst+= dst_stride;
+ }
+ // x_offset = bilin interpolation and y_offset = 8
+ } else if (y_offset == 8) {
+ __m256i filter, pw8, src_next_reg, src_pack;
+ x_offset <<= 5;
+ filter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + x_offset));
+ pw8 = _mm256_set1_epi16(8);
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(filter)
+ // convert each 16 bit to 8 bit to each low and high lane source
+ src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ for (i = 0; i < height ; i++) {
+ src+= src_stride;
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(filter)
+ src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ // average between previous pack to the current
+ src_pack = _mm256_avg_epu8(src_pack, src_reg);
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_pack = _mm256_avg_epu8(src_pack, sec_reg);
+ sec+= sec_stride;
+ MERGE_WITH_SRC(src_pack, zero_reg)
+ src_pack = src_reg;
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ // x_offset = bilin interpolation and y_offset = bilin interpolation
+ } else {
+ __m256i xfilter, yfilter, pw8, src_next_reg, src_pack;
+ x_offset <<= 5;
+ xfilter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + x_offset));
+ y_offset <<= 5;
+ yfilter = _mm256_load_si256((__m256i const *)
+ (bilinear_filters_avx2 + y_offset));
+ pw8 = _mm256_set1_epi16(8);
+ // load source and another source starting from the next
+ // following byte
+ src_reg = _mm256_loadu_si256((__m256i const *) (src));
+ MERGE_NEXT_SRC(src_reg, 1)
+
+ FILTER_SRC(xfilter)
+ // convert each 16 bit to 8 bit to each low and high lane source
+ src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ for (i = 0; i < height ; i++) {
+ src+= src_stride;
+ LOAD_SRC_DST
+ MERGE_NEXT_SRC(src_reg, 1)
+ FILTER_SRC(xfilter)
+ src_reg = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ // merge previous pack to current pack source
+ MERGE_WITH_SRC(src_pack, src_reg)
+ // filter the source
+ FILTER_SRC(yfilter)
+ src_pack = _mm256_packus_epi16(exp_src_lo, exp_src_hi);
+ sec_reg = _mm256_load_si256((__m256i const *) (sec));
+ src_pack = _mm256_avg_epu8(src_pack, sec_reg);
+ MERGE_WITH_SRC(src_pack, zero_reg)
+ src_pack = src_reg;
+ sec+= sec_stride;
+ CALC_SUM_SSE_INSIDE_LOOP
+ dst+= dst_stride;
+ }
+ }
+ }
+ CALC_SUM_AND_SSE
+ return sum;
+}
diff --git a/libvpx/vp9/encoder/x86/vp9_variance_avx2.c b/libvpx/vp9/encoder/x86/vp9_variance_avx2.c
new file mode 100644
index 0000000..835c519
--- /dev/null
+++ b/libvpx/vp9/encoder/x86/vp9_variance_avx2.c
@@ -0,0 +1,268 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#include "./vpx_config.h"
+
+#include "vp9/encoder/vp9_variance.h"
+#include "vp9/common/vp9_pragmas.h"
+#include "vpx_ports/mem.h"
+
+typedef void (*get_var_avx2) (
+ const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *SSE,
+ int *Sum
+);
+
+void vp9_get16x16var_avx2
+(
+ const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *SSE,
+ int *Sum
+);
+
+void vp9_get32x32var_avx2
+(
+ const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *SSE,
+ int *Sum
+);
+
+unsigned int vp9_sub_pixel_variance32xh_avx2
+(
+ const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ int height,
+ unsigned int *sse
+);
+
+unsigned int vp9_sub_pixel_avg_variance32xh_avx2
+(
+ const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ const uint8_t *sec,
+ int sec_stride,
+ int height,
+ unsigned int *sseptr
+);
+
+static void variance_avx2(const unsigned char *src_ptr, int source_stride,
+ const unsigned char *ref_ptr, int recon_stride,
+ int w, int h, unsigned int *sse, int *sum,
+ get_var_avx2 var_fn, int block_size) {
+ unsigned int sse0;
+ int sum0;
+ int i, j;
+
+ *sse = 0;
+ *sum = 0;
+
+ for (i = 0; i < h; i += 16) {
+ for (j = 0; j < w; j += block_size) {
+ // processing 16 rows horizontally each call
+ var_fn(src_ptr + source_stride * i + j, source_stride,
+ ref_ptr + recon_stride * i + j, recon_stride, &sse0, &sum0);
+ *sse += sse0;
+ *sum += sum0;
+ }
+ }
+}
+
+unsigned int vp9_variance16x16_avx2
+(
+ const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *sse) {
+ unsigned int var;
+ int avg;
+
+ variance_avx2(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16,
+ &var, &avg, vp9_get16x16var_avx2, 16);
+ *sse = var;
+ return (var - (((unsigned int)avg * avg) >> 8));
+}
+
+unsigned int vp9_mse16x16_avx2(
+ const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *sse) {
+ unsigned int sse0;
+ int sum0;
+ vp9_get16x16var_avx2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0,
+ &sum0);
+ *sse = sse0;
+ return sse0;
+}
+
+unsigned int vp9_variance32x32_avx2(const uint8_t *src_ptr,
+ int source_stride,
+ const uint8_t *ref_ptr,
+ int recon_stride,
+ unsigned int *sse) {
+ unsigned int var;
+ int avg;
+
+ // processing 32 elements vertically in parallel
+ variance_avx2(src_ptr, source_stride, ref_ptr, recon_stride, 32, 32,
+ &var, &avg, vp9_get32x32var_avx2, 32);
+ *sse = var;
+ return (var - (((int64_t)avg * avg) >> 10));
+}
+
+unsigned int vp9_variance32x16_avx2(const uint8_t *src_ptr,
+ int source_stride,
+ const uint8_t *ref_ptr,
+ int recon_stride,
+ unsigned int *sse) {
+ unsigned int var;
+ int avg;
+
+ // processing 32 elements vertically in parallel
+ variance_avx2(src_ptr, source_stride, ref_ptr, recon_stride, 32, 16,
+ &var, &avg, vp9_get32x32var_avx2, 32);
+ *sse = var;
+ return (var - (((int64_t)avg * avg) >> 9));
+}
+
+
+unsigned int vp9_variance64x64_avx2(const uint8_t *src_ptr,
+ int source_stride,
+ const uint8_t *ref_ptr,
+ int recon_stride,
+ unsigned int *sse) {
+ unsigned int var;
+ int avg;
+
+ // processing 32 elements vertically in parallel
+ variance_avx2(src_ptr, source_stride, ref_ptr, recon_stride, 64, 64,
+ &var, &avg, vp9_get32x32var_avx2, 32);
+ *sse = var;
+ return (var - (((int64_t)avg * avg) >> 12));
+}
+
+unsigned int vp9_variance64x32_avx2(const uint8_t *src_ptr,
+ int source_stride,
+ const uint8_t *ref_ptr,
+ int recon_stride,
+ unsigned int *sse) {
+ unsigned int var;
+ int avg;
+
+ // processing 32 elements vertically in parallel
+ variance_avx2(src_ptr, source_stride, ref_ptr, recon_stride, 64, 32,
+ &var, &avg, vp9_get32x32var_avx2, 32);
+
+ *sse = var;
+ return (var - (((int64_t)avg * avg) >> 11));
+}
+
+unsigned int vp9_sub_pixel_variance64x64_avx2(const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ unsigned int *sse_ptr) {
+ // processing 32 elements in parallel
+ unsigned int sse;
+ int se = vp9_sub_pixel_variance32xh_avx2(src, src_stride, x_offset,
+ y_offset, dst, dst_stride,
+ 64, &sse);
+ // processing the next 32 elements in parallel
+ unsigned int sse2;
+ int se2 = vp9_sub_pixel_variance32xh_avx2(src + 32, src_stride,
+ x_offset, y_offset,
+ dst + 32, dst_stride,
+ 64, &sse2);
+ se += se2;
+ sse += sse2;
+ *sse_ptr = sse;
+ return sse - (((int64_t)se * se) >> 12);
+}
+
+unsigned int vp9_sub_pixel_variance32x32_avx2(const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ unsigned int *sse_ptr) {
+ // processing 32 element in parallel
+ unsigned int sse;
+ int se = vp9_sub_pixel_variance32xh_avx2(src, src_stride, x_offset,
+ y_offset, dst, dst_stride,
+ 32, &sse);
+ *sse_ptr = sse;
+ return sse - (((int64_t)se * se) >> 10);
+}
+
+unsigned int vp9_sub_pixel_avg_variance64x64_avx2(const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ unsigned int *sseptr,
+ const uint8_t *sec) {
+ // processing 32 elements in parallel
+ unsigned int sse;
+
+ int se = vp9_sub_pixel_avg_variance32xh_avx2(src, src_stride, x_offset,
+ y_offset, dst, dst_stride,
+ sec, 64, 64, &sse);
+ unsigned int sse2;
+ // processing the next 32 elements in parallel
+ int se2 = vp9_sub_pixel_avg_variance32xh_avx2(src + 32, src_stride, x_offset,
+ y_offset, dst + 32, dst_stride,
+ sec + 32, 64, 64, &sse2);
+ se += se2;
+ sse += sse2;
+ *sseptr = sse;
+
+ return sse - (((int64_t)se * se) >> 12);
+}
+
+unsigned int vp9_sub_pixel_avg_variance32x32_avx2(const uint8_t *src,
+ int src_stride,
+ int x_offset,
+ int y_offset,
+ const uint8_t *dst,
+ int dst_stride,
+ unsigned int *sseptr,
+ const uint8_t *sec) {
+ // processing 32 element in parallel
+ unsigned int sse;
+ int se = vp9_sub_pixel_avg_variance32xh_avx2(src, src_stride, x_offset,
+ y_offset, dst, dst_stride,
+ sec, 32, 32, &sse);
+ *sseptr = sse;
+ return sse - (((int64_t)se * se) >> 10);
+}
+
+
diff --git a/libvpx/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c b/libvpx/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c
new file mode 100644
index 0000000..f992328
--- /dev/null
+++ b/libvpx/vp9/encoder/x86/vp9_variance_impl_intrin_avx2.c
@@ -0,0 +1,213 @@
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <immintrin.h> // AVX2
+
+void vp9_get16x16var_avx2(const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *SSE,
+ int *Sum) {
+ __m256i src, src_expand_low, src_expand_high, ref, ref_expand_low;
+ __m256i ref_expand_high, madd_low, madd_high;
+ unsigned int i, src_2strides, ref_2strides;
+ __m256i zero_reg = _mm256_set1_epi16(0);
+ __m256i sum_ref_src = _mm256_set1_epi16(0);
+ __m256i madd_ref_src = _mm256_set1_epi16(0);
+
+ // processing two strides in a 256 bit register reducing the number
+ // of loop stride by half (comparing to the sse2 code)
+ src_2strides = source_stride << 1;
+ ref_2strides = recon_stride << 1;
+ for (i = 0; i < 8; i++) {
+ src = _mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i const *) (src_ptr)));
+ src = _mm256_inserti128_si256(src,
+ _mm_loadu_si128((__m128i const *)(src_ptr+source_stride)), 1);
+
+ ref =_mm256_castsi128_si256(
+ _mm_loadu_si128((__m128i const *) (ref_ptr)));
+ ref = _mm256_inserti128_si256(ref,
+ _mm_loadu_si128((__m128i const *)(ref_ptr+recon_stride)), 1);
+
+ // expanding to 16 bit each lane
+ src_expand_low = _mm256_unpacklo_epi8(src, zero_reg);
+ src_expand_high = _mm256_unpackhi_epi8(src, zero_reg);
+
+ ref_expand_low = _mm256_unpacklo_epi8(ref, zero_reg);
+ ref_expand_high = _mm256_unpackhi_epi8(ref, zero_reg);
+
+ // src-ref
+ src_expand_low = _mm256_sub_epi16(src_expand_low, ref_expand_low);
+ src_expand_high = _mm256_sub_epi16(src_expand_high, ref_expand_high);
+
+ // madd low (src - ref)
+ madd_low = _mm256_madd_epi16(src_expand_low, src_expand_low);
+
+ // add high to low
+ src_expand_low = _mm256_add_epi16(src_expand_low, src_expand_high);
+
+ // madd high (src - ref)
+ madd_high = _mm256_madd_epi16(src_expand_high, src_expand_high);
+
+ sum_ref_src = _mm256_add_epi16(sum_ref_src, src_expand_low);
+
+ // add high to low
+ madd_ref_src = _mm256_add_epi32(madd_ref_src,
+ _mm256_add_epi32(madd_low, madd_high));
+
+ src_ptr+= src_2strides;
+ ref_ptr+= ref_2strides;
+ }
+
+ {
+ __m128i sum_res, madd_res;
+ __m128i expand_sum_low, expand_sum_high, expand_sum;
+ __m128i expand_madd_low, expand_madd_high, expand_madd;
+ __m128i ex_expand_sum_low, ex_expand_sum_high, ex_expand_sum;
+
+ // extract the low lane and add it to the high lane
+ sum_res = _mm_add_epi16(_mm256_castsi256_si128(sum_ref_src),
+ _mm256_extractf128_si256(sum_ref_src, 1));
+
+ madd_res = _mm_add_epi32(_mm256_castsi256_si128(madd_ref_src),
+ _mm256_extractf128_si256(madd_ref_src, 1));
+
+ // padding each 2 bytes with another 2 zeroed bytes
+ expand_sum_low = _mm_unpacklo_epi16(_mm256_castsi256_si128(zero_reg),
+ sum_res);
+ expand_sum_high = _mm_unpackhi_epi16(_mm256_castsi256_si128(zero_reg),
+ sum_res);
+
+ // shifting the sign 16 bits right
+ expand_sum_low = _mm_srai_epi32(expand_sum_low, 16);
+ expand_sum_high = _mm_srai_epi32(expand_sum_high, 16);
+
+ expand_sum = _mm_add_epi32(expand_sum_low, expand_sum_high);
+
+ // expand each 32 bits of the madd result to 64 bits
+ expand_madd_low = _mm_unpacklo_epi32(madd_res,
+ _mm256_castsi256_si128(zero_reg));
+ expand_madd_high = _mm_unpackhi_epi32(madd_res,
+ _mm256_castsi256_si128(zero_reg));
+
+ expand_madd = _mm_add_epi32(expand_madd_low, expand_madd_high);
+
+ ex_expand_sum_low = _mm_unpacklo_epi32(expand_sum,
+ _mm256_castsi256_si128(zero_reg));
+ ex_expand_sum_high = _mm_unpackhi_epi32(expand_sum,
+ _mm256_castsi256_si128(zero_reg));
+
+ ex_expand_sum = _mm_add_epi32(ex_expand_sum_low, ex_expand_sum_high);
+
+ // shift 8 bytes eight
+ madd_res = _mm_srli_si128(expand_madd, 8);
+ sum_res = _mm_srli_si128(ex_expand_sum, 8);
+
+ madd_res = _mm_add_epi32(madd_res, expand_madd);
+ sum_res = _mm_add_epi32(sum_res, ex_expand_sum);
+
+ *((int*)SSE)= _mm_cvtsi128_si32(madd_res);
+
+ *((int*)Sum)= _mm_cvtsi128_si32(sum_res);
+ }
+}
+
+void vp9_get32x32var_avx2(const unsigned char *src_ptr,
+ int source_stride,
+ const unsigned char *ref_ptr,
+ int recon_stride,
+ unsigned int *SSE,
+ int *Sum) {
+ __m256i src, src_expand_low, src_expand_high, ref, ref_expand_low;
+ __m256i ref_expand_high, madd_low, madd_high;
+ unsigned int i;
+ __m256i zero_reg = _mm256_set1_epi16(0);
+ __m256i sum_ref_src = _mm256_set1_epi16(0);
+ __m256i madd_ref_src = _mm256_set1_epi16(0);
+
+ // processing 32 elements in parallel
+ for (i = 0; i < 16; i++) {
+ src = _mm256_loadu_si256((__m256i const *) (src_ptr));
+
+ ref = _mm256_loadu_si256((__m256i const *) (ref_ptr));
+
+ // expanding to 16 bit each lane
+ src_expand_low = _mm256_unpacklo_epi8(src, zero_reg);
+ src_expand_high = _mm256_unpackhi_epi8(src, zero_reg);
+
+ ref_expand_low = _mm256_unpacklo_epi8(ref, zero_reg);
+ ref_expand_high = _mm256_unpackhi_epi8(ref, zero_reg);
+
+ // src-ref
+ src_expand_low = _mm256_sub_epi16(src_expand_low, ref_expand_low);
+ src_expand_high = _mm256_sub_epi16(src_expand_high, ref_expand_high);
+
+ // madd low (src - ref)
+ madd_low = _mm256_madd_epi16(src_expand_low, src_expand_low);
+
+ // add high to low
+ src_expand_low = _mm256_add_epi16(src_expand_low, src_expand_high);
+
+ // madd high (src - ref)
+ madd_high = _mm256_madd_epi16(src_expand_high, src_expand_high);
+
+ sum_ref_src = _mm256_add_epi16(sum_ref_src, src_expand_low);
+
+ // add high to low
+ madd_ref_src = _mm256_add_epi32(madd_ref_src,
+ _mm256_add_epi32(madd_low, madd_high));
+
+ src_ptr+= source_stride;
+ ref_ptr+= recon_stride;
+ }
+
+ {
+ __m256i expand_sum_low, expand_sum_high, expand_sum;
+ __m256i expand_madd_low, expand_madd_high, expand_madd;
+ __m256i ex_expand_sum_low, ex_expand_sum_high, ex_expand_sum;
+
+ // padding each 2 bytes with another 2 zeroed bytes
+ expand_sum_low = _mm256_unpacklo_epi16(zero_reg, sum_ref_src);
+ expand_sum_high = _mm256_unpackhi_epi16(zero_reg, sum_ref_src);
+
+ // shifting the sign 16 bits right
+ expand_sum_low = _mm256_srai_epi32(expand_sum_low, 16);
+ expand_sum_high = _mm256_srai_epi32(expand_sum_high, 16);
+
+ expand_sum = _mm256_add_epi32(expand_sum_low, expand_sum_high);
+
+ // expand each 32 bits of the madd result to 64 bits
+ expand_madd_low = _mm256_unpacklo_epi32(madd_ref_src, zero_reg);
+ expand_madd_high = _mm256_unpackhi_epi32(madd_ref_src, zero_reg);
+
+ expand_madd = _mm256_add_epi32(expand_madd_low, expand_madd_high);
+
+ ex_expand_sum_low = _mm256_unpacklo_epi32(expand_sum, zero_reg);
+ ex_expand_sum_high = _mm256_unpackhi_epi32(expand_sum, zero_reg);
+
+ ex_expand_sum = _mm256_add_epi32(ex_expand_sum_low, ex_expand_sum_high);
+
+ // shift 8 bytes eight
+ madd_ref_src = _mm256_srli_si256(expand_madd, 8);
+ sum_ref_src = _mm256_srli_si256(ex_expand_sum, 8);
+
+ madd_ref_src = _mm256_add_epi32(madd_ref_src, expand_madd);
+ sum_ref_src = _mm256_add_epi32(sum_ref_src, ex_expand_sum);
+
+ // extract the low lane and the high lane and add the results
+ *((int*)SSE)= _mm_cvtsi128_si32(_mm256_castsi256_si128(madd_ref_src)) +
+ _mm_cvtsi128_si32(_mm256_extractf128_si256(madd_ref_src, 1));
+
+ *((int*)Sum)= _mm_cvtsi128_si32(_mm256_castsi256_si128(sum_ref_src)) +
+ _mm_cvtsi128_si32(_mm256_extractf128_si256(sum_ref_src, 1));
+ }
+}
diff --git a/libvpx/vp9/encoder/x86/vp9_variance_mmx.c b/libvpx/vp9/encoder/x86/vp9_variance_mmx.c
index a3d0114..c4d17fc 100644
--- a/libvpx/vp9/encoder/x86/vp9_variance_mmx.c
+++ b/libvpx/vp9/encoder/x86/vp9_variance_mmx.c
@@ -13,7 +13,6 @@
#include "vp9/common/vp9_pragmas.h"
#include "vpx_ports/mem.h"
-extern unsigned int vp9_get_mb_ss_mmx(const int16_t *src_ptr);
extern unsigned int vp9_get8x8var_mmx
(
const unsigned char *src_ptr,
diff --git a/libvpx/vp9/encoder/x86/vp9_variance_sse2.c b/libvpx/vp9/encoder/x86/vp9_variance_sse2.c
index 79e42c4..9e65694 100644
--- a/libvpx/vp9/encoder/x86/vp9_variance_sse2.c
+++ b/libvpx/vp9/encoder/x86/vp9_variance_sse2.c
@@ -24,10 +24,6 @@ extern unsigned int vp9_get4x4var_mmx
int *Sum
);
-unsigned int vp9_get_mb_ss_sse2
-(
- const int16_t *src_ptr
-);
unsigned int vp9_get16x16var_sse2
(
const unsigned char *src_ptr,
diff --git a/libvpx/vp9/exports_enc b/libvpx/vp9/exports_enc
index 25156e8..2a0fef3 100644
--- a/libvpx/vp9/exports_enc
+++ b/libvpx/vp9/exports_enc
@@ -1,4 +1,2 @@
data vpx_codec_vp9_cx_algo
text vpx_codec_vp9_cx
-data vpx_codec_vp9x_cx_algo
-text vpx_codec_vp9x_cx
diff --git a/libvpx/vp9/vp9_common.mk b/libvpx/vp9/vp9_common.mk
index 2dd2bf0..b1ba0b1 100644
--- a/libvpx/vp9/vp9_common.mk
+++ b/libvpx/vp9/vp9_common.mk
@@ -12,20 +12,18 @@ VP9_COMMON_SRCS-yes += vp9_common.mk
VP9_COMMON_SRCS-yes += vp9_iface_common.h
VP9_COMMON_SRCS-yes += common/vp9_pragmas.h
VP9_COMMON_SRCS-yes += common/vp9_ppflags.h
-VP9_COMMON_SRCS-yes += common/vp9_onyx.h
VP9_COMMON_SRCS-yes += common/vp9_alloccommon.c
+VP9_COMMON_SRCS-yes += common/vp9_blockd.c
VP9_COMMON_SRCS-yes += common/vp9_convolve.c
VP9_COMMON_SRCS-yes += common/vp9_convolve.h
VP9_COMMON_SRCS-yes += common/vp9_debugmodes.c
-VP9_COMMON_SRCS-yes += common/vp9_default_coef_probs.h
VP9_COMMON_SRCS-yes += common/vp9_entropy.c
VP9_COMMON_SRCS-yes += common/vp9_entropymode.c
VP9_COMMON_SRCS-yes += common/vp9_entropymv.c
-VP9_COMMON_SRCS-yes += common/vp9_extend.c
VP9_COMMON_SRCS-yes += common/vp9_filter.c
VP9_COMMON_SRCS-yes += common/vp9_filter.h
-VP9_COMMON_SRCS-yes += common/vp9_findnearmv.c
-VP9_COMMON_SRCS-yes += common/generic/vp9_systemdependent.c
+VP9_COMMON_SRCS-yes += common/vp9_frame_buffers.c
+VP9_COMMON_SRCS-yes += common/vp9_frame_buffers.h
VP9_COMMON_SRCS-yes += common/vp9_idct.c
VP9_COMMON_SRCS-yes += common/vp9_alloccommon.h
VP9_COMMON_SRCS-yes += common/vp9_blockd.h
@@ -34,20 +32,19 @@ VP9_COMMON_SRCS-yes += common/vp9_entropy.h
VP9_COMMON_SRCS-yes += common/vp9_entropymode.h
VP9_COMMON_SRCS-yes += common/vp9_entropymv.h
VP9_COMMON_SRCS-yes += common/vp9_enums.h
-VP9_COMMON_SRCS-yes += common/vp9_extend.h
-VP9_COMMON_SRCS-yes += common/vp9_findnearmv.h
VP9_COMMON_SRCS-yes += common/vp9_idct.h
VP9_COMMON_SRCS-yes += common/vp9_loopfilter.h
VP9_COMMON_SRCS-yes += common/vp9_mv.h
VP9_COMMON_SRCS-yes += common/vp9_onyxc_int.h
VP9_COMMON_SRCS-yes += common/vp9_pred_common.h
VP9_COMMON_SRCS-yes += common/vp9_pred_common.c
+VP9_COMMON_SRCS-yes += common/vp9_prob.h
+VP9_COMMON_SRCS-yes += common/vp9_prob.c
VP9_COMMON_SRCS-yes += common/vp9_quant_common.h
VP9_COMMON_SRCS-yes += common/vp9_reconinter.h
VP9_COMMON_SRCS-yes += common/vp9_reconintra.h
VP9_COMMON_SRCS-yes += common/vp9_rtcd.c
-VP9_COMMON_SRCS-yes += common/vp9_rtcd_defs.sh
-VP9_COMMON_SRCS-yes += common/vp9_sadmxn.h
+VP9_COMMON_SRCS-yes += common/vp9_rtcd_defs.pl
VP9_COMMON_SRCS-yes += common/vp9_scale.h
VP9_COMMON_SRCS-yes += common/vp9_scale.c
VP9_COMMON_SRCS-yes += common/vp9_seg_common.h
@@ -56,7 +53,6 @@ VP9_COMMON_SRCS-yes += common/vp9_systemdependent.h
VP9_COMMON_SRCS-yes += common/vp9_textblit.h
VP9_COMMON_SRCS-yes += common/vp9_tile_common.h
VP9_COMMON_SRCS-yes += common/vp9_tile_common.c
-VP9_COMMON_SRCS-yes += common/vp9_treecoder.h
VP9_COMMON_SRCS-yes += common/vp9_loopfilter.c
VP9_COMMON_SRCS-yes += common/vp9_loopfilter_filters.c
VP9_COMMON_SRCS-yes += common/vp9_mvref_common.c
@@ -65,7 +61,6 @@ VP9_COMMON_SRCS-yes += common/vp9_quant_common.c
VP9_COMMON_SRCS-yes += common/vp9_reconinter.c
VP9_COMMON_SRCS-yes += common/vp9_reconintra.c
VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER) += common/vp9_textblit.c
-VP9_COMMON_SRCS-yes += common/vp9_treecoder.c
VP9_COMMON_SRCS-yes += common/vp9_common_data.c
VP9_COMMON_SRCS-yes += common/vp9_common_data.h
VP9_COMMON_SRCS-yes += common/vp9_scan.c
@@ -79,13 +74,17 @@ VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_postproc.h
VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC) += common/vp9_postproc.c
VP9_COMMON_SRCS-$(HAVE_MMX) += common/x86/vp9_loopfilter_mmx.asm
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_subpixel_8t_sse2.asm
+VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_subpixel_bilinear_sse2.asm
VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_8t_ssse3.asm
+VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_bilinear_ssse3.asm
+VP9_COMMON_SRCS-$(HAVE_AVX2) += common/x86/vp9_subpixel_8t_intrin_avx2.c
+VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_subpixel_8t_intrin_ssse3.c
ifeq ($(CONFIG_VP9_POSTPROC),yes)
VP9_COMMON_SRCS-$(HAVE_MMX) += common/x86/vp9_postproc_mmx.asm
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_postproc_sse2.asm
endif
-ifeq ($(USE_X86INC),yes)
+ifeq ($(CONFIG_USE_X86INC),yes)
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_copy_sse2.asm
VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_intrapred_sse2.asm
VP9_COMMON_SRCS-$(HAVE_SSSE3) += common/x86/vp9_intrapred_ssse3.asm
@@ -123,23 +122,26 @@ VP9_COMMON_SRCS-$(HAVE_SSE2) += common/x86/vp9_idct_intrin_sse2.c
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_convolve_neon.c
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct16x16_neon.c
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_loopfilter_16_neon.c
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_convolve8_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_convolve8_avg_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_loopfilter_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_loopfilter_16_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_dc_only_idct_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct4x4_1_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct4x4_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct8x8_1_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct8x8_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct16x16_1_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct16x16_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct32x32_1_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_idct32x32_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_iht4x4_add_neon$(ASM)
-VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_short_iht8x8_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct4x4_1_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct4x4_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct8x8_1_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct8x8_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct16x16_1_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct16x16_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct32x32_1_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_idct32x32_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_iht4x4_add_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_iht8x8_add_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_mb_lpf_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_copy_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_avg_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_save_reg_neon$(ASM)
+VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_reconintra_neon$(ASM)
-$(eval $(call rtcd_h_template,vp9_rtcd,vp9/common/vp9_rtcd_defs.sh))
+$(eval $(call rtcd_h_template,vp9_rtcd,vp9/common/vp9_rtcd_defs.pl))
diff --git a/libvpx/vp9/vp9_cx_iface.c b/libvpx/vp9/vp9_cx_iface.c
index 1942039..2e83260 100644
--- a/libvpx/vp9/vp9_cx_iface.c
+++ b/libvpx/vp9/vp9_cx_iface.c
@@ -17,7 +17,6 @@
#include "vp9/encoder/vp9_onyx_int.h"
#include "vpx/vp8cx.h"
#include "vp9/encoder/vp9_firstpass.h"
-#include "vp9/common/vp9_onyx.h"
#include "vp9/vp9_iface_common.h"
struct vp9_extracfg {
@@ -25,19 +24,19 @@ struct vp9_extracfg {
int cpu_used; /* available cpu percentage in 1/16 */
unsigned int enable_auto_alt_ref;
unsigned int noise_sensitivity;
- unsigned int Sharpness;
+ unsigned int sharpness;
unsigned int static_thresh;
unsigned int tile_columns;
unsigned int tile_rows;
unsigned int arnr_max_frames;
unsigned int arnr_strength;
unsigned int arnr_type;
- unsigned int experimental;
vp8e_tuning tuning;
unsigned int cq_level; /* constrained quality level */
unsigned int rc_max_intra_bitrate_pct;
unsigned int lossless;
unsigned int frame_parallel_decoding_mode;
+ AQ_MODE aq_mode;
};
struct extraconfig_map {
@@ -53,19 +52,19 @@ static const struct extraconfig_map extracfg_map[] = {
0, /* cpu_used */
1, /* enable_auto_alt_ref */
0, /* noise_sensitivity */
- 0, /* Sharpness */
+ 0, /* sharpness */
0, /* static_thresh */
0, /* tile_columns */
0, /* tile_rows */
7, /* arnr_max_frames */
5, /* arnr_strength */
3, /* arnr_type*/
- 0, /* experimental mode */
- 0, /* tuning*/
+ VP8_TUNE_PSNR, /* tuning*/
10, /* cq_level */
0, /* rc_max_intra_bitrate_pct */
0, /* lossless */
0, /* frame_parallel_decoding_mode */
+ NO_AQ, /* aq_mode */
}
}
};
@@ -73,16 +72,16 @@ static const struct extraconfig_map extracfg_map[] = {
struct vpx_codec_alg_priv {
vpx_codec_priv_t base;
vpx_codec_enc_cfg_t cfg;
- struct vp9_extracfg vp8_cfg;
+ struct vp9_extracfg extra_cfg;
VP9_CONFIG oxcf;
- VP9_PTR cpi;
+ VP9_COMP *cpi;
unsigned char *cx_data;
- unsigned int cx_data_sz;
+ size_t cx_data_sz;
unsigned char *pending_cx_data;
- unsigned int pending_cx_data_sz;
+ size_t pending_cx_data_sz;
int pending_frame_count;
- uint32_t pending_frame_sizes[8];
- uint32_t pending_frame_magnitude;
+ size_t pending_frame_sizes[8];
+ size_t pending_frame_magnitude;
vpx_image_t preview_img;
vp8_postproc_cfg_t preview_ppcfg;
vpx_codec_pkt_list_decl(64) pkt_list;
@@ -98,7 +97,7 @@ static VP9_REFFRAME ref_frame_to_vp9_reframe(vpx_ref_frame_type_t frame) {
case VP8_ALTR_FRAME:
return VP9_ALT_FLAG;
}
- assert(!"Invalid Reference Frame");
+ assert(0 && "Invalid Reference Frame");
return VP9_LAST_FLAG;
}
@@ -143,7 +142,7 @@ update_error_state(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
const vpx_codec_enc_cfg_t *cfg,
- const struct vp9_extracfg *vp8_cfg) {
+ const struct vp9_extracfg *extra_cfg) {
RANGE_CHECK(cfg, g_w, 1, 65535); /* 16 bits available */
RANGE_CHECK(cfg, g_h, 1, 65535); /* 16 bits available */
RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000);
@@ -152,11 +151,12 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK_HI(cfg, rc_max_quantizer, 63);
RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer);
- RANGE_CHECK_BOOL(vp8_cfg, lossless);
- if (vp8_cfg->lossless) {
+ RANGE_CHECK_BOOL(extra_cfg, lossless);
+ if (extra_cfg->lossless) {
RANGE_CHECK_HI(cfg, rc_max_quantizer, 0);
RANGE_CHECK_HI(cfg, rc_min_quantizer, 0);
}
+ RANGE_CHECK(extra_cfg, aq_mode, 0, AQ_MODE_COUNT - 1);
RANGE_CHECK_HI(cfg, g_threads, 64);
RANGE_CHECK_HI(cfg, g_lag_in_frames, MAX_LAG_BUFFERS);
@@ -174,6 +174,23 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
RANGE_CHECK(cfg, ss_number_layers, 1,
VPX_SS_MAX_LAYERS); /*Spatial layers max */
+
+ RANGE_CHECK(cfg, ts_number_layers, 1, VPX_TS_MAX_LAYERS);
+ if (cfg->ts_number_layers > 1) {
+ unsigned int i;
+ for (i = 1; i < cfg->ts_number_layers; ++i) {
+ if (cfg->ts_target_bitrate[i] < cfg->ts_target_bitrate[i-1]) {
+ ERROR("ts_target_bitrate entries are not increasing");
+ }
+ }
+ RANGE_CHECK(cfg, ts_rate_decimator[cfg->ts_number_layers-1], 1, 1);
+ for (i = cfg->ts_number_layers-2; i > 0; --i) {
+ if (cfg->ts_rate_decimator[i-1] != 2*cfg->ts_rate_decimator[i]) {
+ ERROR("ts_rate_decimator factors are not powers of 2");
+ }
+ }
+ }
+
/* VP8 does not support a lower bound on the keyframe interval in
* automatic keyframe placement mode.
*/
@@ -182,25 +199,27 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
ERROR("kf_min_dist not supported in auto mode, use 0 "
"or kf_max_dist instead.");
- RANGE_CHECK_BOOL(vp8_cfg, enable_auto_alt_ref);
- RANGE_CHECK(vp8_cfg, cpu_used, -16, 16);
-
- RANGE_CHECK_HI(vp8_cfg, noise_sensitivity, 6);
-
- RANGE_CHECK(vp8_cfg, tile_columns, 0, 6);
- RANGE_CHECK(vp8_cfg, tile_rows, 0, 2);
- RANGE_CHECK_HI(vp8_cfg, Sharpness, 7);
- RANGE_CHECK(vp8_cfg, arnr_max_frames, 0, 15);
- RANGE_CHECK_HI(vp8_cfg, arnr_strength, 6);
- RANGE_CHECK(vp8_cfg, arnr_type, 1, 3);
- RANGE_CHECK(vp8_cfg, cq_level, 0, 63);
+ RANGE_CHECK_BOOL(extra_cfg, enable_auto_alt_ref);
+ RANGE_CHECK(extra_cfg, cpu_used, -16, 16);
+ RANGE_CHECK_HI(extra_cfg, noise_sensitivity, 6);
+ RANGE_CHECK(extra_cfg, tile_columns, 0, 6);
+ RANGE_CHECK(extra_cfg, tile_rows, 0, 2);
+ RANGE_CHECK_HI(extra_cfg, sharpness, 7);
+ RANGE_CHECK(extra_cfg, arnr_max_frames, 0, 15);
+ RANGE_CHECK_HI(extra_cfg, arnr_strength, 6);
+ RANGE_CHECK(extra_cfg, arnr_type, 1, 3);
+ RANGE_CHECK(extra_cfg, cq_level, 0, 63);
+
+ // TODO(yaowu): remove this when ssim tuning is implemented for vp9
+ if (extra_cfg->tuning == VP8_TUNE_SSIM)
+ ERROR("Option --tune=ssim is not currently supported in VP9.");
if (cfg->g_pass == VPX_RC_LAST_PASS) {
size_t packet_sz = sizeof(FIRSTPASS_STATS);
int n_packets = (int)(cfg->rc_twopass_stats_in.sz / packet_sz);
- FIRSTPASS_STATS *stats;
+ const FIRSTPASS_STATS *stats;
- if (!cfg->rc_twopass_stats_in.buf)
+ if (cfg->rc_twopass_stats_in.buf == NULL)
ERROR("rc_twopass_stats_in.buf not set.");
if (cfg->rc_twopass_stats_in.sz % packet_sz)
@@ -209,8 +228,8 @@ static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx,
if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz)
ERROR("rc_twopass_stats_in requires at least two packets.");
- stats = (void *)((char *)cfg->rc_twopass_stats_in.buf
- + (n_packets - 1) * packet_sz);
+ stats =
+ (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1;
if ((int)(stats->count + 0.5) != n_packets - 1)
ERROR("rc_twopass_stats_in missing EOS stats packet");
@@ -241,109 +260,115 @@ static vpx_codec_err_t validate_img(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t set_vp9e_config(VP9_CONFIG *oxcf,
- vpx_codec_enc_cfg_t cfg,
- struct vp9_extracfg vp8_cfg) {
- oxcf->version = cfg.g_profile | (vp8_cfg.experimental ? 0x4 : 0);
- oxcf->width = cfg.g_w;
- oxcf->height = cfg.g_h;
- /* guess a frame rate if out of whack, use 30 */
- oxcf->framerate = (double)(cfg.g_timebase.den)
- / (double)(cfg.g_timebase.num);
-
- if (oxcf->framerate > 180) {
+ const vpx_codec_enc_cfg_t *cfg,
+ const struct vp9_extracfg *extra_cfg) {
+ oxcf->version = cfg->g_profile;
+ oxcf->width = cfg->g_w;
+ oxcf->height = cfg->g_h;
+ // guess a frame rate if out of whack, use 30
+ oxcf->framerate = (double)cfg->g_timebase.den / cfg->g_timebase.num;
+ if (oxcf->framerate > 180)
oxcf->framerate = 30;
- }
- switch (cfg.g_pass) {
+ switch (cfg->g_pass) {
case VPX_RC_ONE_PASS:
- oxcf->Mode = MODE_GOODQUALITY;
+ oxcf->mode = MODE_GOODQUALITY;
break;
case VPX_RC_FIRST_PASS:
- oxcf->Mode = MODE_FIRSTPASS;
+ oxcf->mode = MODE_FIRSTPASS;
break;
case VPX_RC_LAST_PASS:
- oxcf->Mode = MODE_SECONDPASS_BEST;
+ oxcf->mode = MODE_SECONDPASS_BEST;
break;
}
- if (cfg.g_pass == VPX_RC_FIRST_PASS) {
- oxcf->allow_lag = 0;
- oxcf->lag_in_frames = 0;
- } else {
- oxcf->allow_lag = (cfg.g_lag_in_frames) > 0;
- oxcf->lag_in_frames = cfg.g_lag_in_frames;
- }
+ oxcf->lag_in_frames = cfg->g_pass == VPX_RC_FIRST_PASS ? 0
+ : cfg->g_lag_in_frames;
- // VBR only supported for now.
- // CBR code has been deprectated for experimental phase.
- // CQ mode not yet tested
- oxcf->end_usage = USAGE_LOCAL_FILE_PLAYBACK;
- if (cfg.rc_end_usage == VPX_CQ)
- oxcf->end_usage = USAGE_CONSTRAINED_QUALITY;
- else if (cfg.rc_end_usage == VPX_Q)
- oxcf->end_usage = USAGE_CONSTANT_QUALITY;
- else if (cfg.rc_end_usage == VPX_CBR)
+ oxcf->end_usage = USAGE_LOCAL_FILE_PLAYBACK;
+ if (cfg->rc_end_usage == VPX_CQ)
+ oxcf->end_usage = USAGE_CONSTRAINED_QUALITY;
+ else if (cfg->rc_end_usage == VPX_Q)
+ oxcf->end_usage = USAGE_CONSTANT_QUALITY;
+ else if (cfg->rc_end_usage == VPX_CBR)
oxcf->end_usage = USAGE_STREAM_FROM_SERVER;
- oxcf->target_bandwidth = cfg.rc_target_bitrate;
- oxcf->rc_max_intra_bitrate_pct = vp8_cfg.rc_max_intra_bitrate_pct;
+ oxcf->target_bandwidth = cfg->rc_target_bitrate;
+ oxcf->rc_max_intra_bitrate_pct = extra_cfg->rc_max_intra_bitrate_pct;
- oxcf->best_allowed_q = cfg.rc_min_quantizer;
- oxcf->worst_allowed_q = cfg.rc_max_quantizer;
- oxcf->cq_level = vp8_cfg.cq_level;
+ oxcf->best_allowed_q = cfg->rc_min_quantizer;
+ oxcf->worst_allowed_q = cfg->rc_max_quantizer;
+ oxcf->cq_level = extra_cfg->cq_level;
oxcf->fixed_q = -1;
- oxcf->under_shoot_pct = cfg.rc_undershoot_pct;
- oxcf->over_shoot_pct = cfg.rc_overshoot_pct;
+ oxcf->under_shoot_pct = cfg->rc_undershoot_pct;
+ oxcf->over_shoot_pct = cfg->rc_overshoot_pct;
+
+ oxcf->maximum_buffer_size = cfg->rc_buf_sz;
+ oxcf->starting_buffer_level = cfg->rc_buf_initial_sz;
+ oxcf->optimal_buffer_level = cfg->rc_buf_optimal_sz;
+
+ oxcf->drop_frames_water_mark = cfg->rc_dropframe_thresh;
- oxcf->maximum_buffer_size = cfg.rc_buf_sz;
- oxcf->starting_buffer_level = cfg.rc_buf_initial_sz;
- oxcf->optimal_buffer_level = cfg.rc_buf_optimal_sz;
+ oxcf->two_pass_vbrbias = cfg->rc_2pass_vbr_bias_pct;
+ oxcf->two_pass_vbrmin_section = cfg->rc_2pass_vbr_minsection_pct;
+ oxcf->two_pass_vbrmax_section = cfg->rc_2pass_vbr_maxsection_pct;
- oxcf->two_pass_vbrbias = cfg.rc_2pass_vbr_bias_pct;
- oxcf->two_pass_vbrmin_section = cfg.rc_2pass_vbr_minsection_pct;
- oxcf->two_pass_vbrmax_section = cfg.rc_2pass_vbr_maxsection_pct;
+ oxcf->auto_key = cfg->kf_mode == VPX_KF_AUTO &&
+ cfg->kf_min_dist != cfg->kf_max_dist;
- oxcf->auto_key = cfg.kf_mode == VPX_KF_AUTO
- && cfg.kf_min_dist != cfg.kf_max_dist;
- // oxcf->kf_min_dist = cfg.kf_min_dis;
- oxcf->key_freq = cfg.kf_max_dist;
+ oxcf->key_freq = cfg->kf_max_dist;
- // oxcf->delete_first_pass_file = cfg.g_delete_firstpassfile;
- // strcpy(oxcf->first_pass_file, cfg.g_firstpass_file);
+ oxcf->cpu_used = extra_cfg->cpu_used;
+ oxcf->encode_breakout = extra_cfg->static_thresh;
+ oxcf->play_alternate = extra_cfg->enable_auto_alt_ref;
+ oxcf->noise_sensitivity = extra_cfg->noise_sensitivity;
+ oxcf->sharpness = extra_cfg->sharpness;
- oxcf->cpu_used = vp8_cfg.cpu_used;
- oxcf->encode_breakout = vp8_cfg.static_thresh;
- oxcf->play_alternate = vp8_cfg.enable_auto_alt_ref;
- oxcf->noise_sensitivity = vp8_cfg.noise_sensitivity;
- oxcf->Sharpness = vp8_cfg.Sharpness;
+ oxcf->two_pass_stats_in = cfg->rc_twopass_stats_in;
+ oxcf->output_pkt_list = extra_cfg->pkt_list;
- oxcf->two_pass_stats_in = cfg.rc_twopass_stats_in;
- oxcf->output_pkt_list = vp8_cfg.pkt_list;
+ oxcf->arnr_max_frames = extra_cfg->arnr_max_frames;
+ oxcf->arnr_strength = extra_cfg->arnr_strength;
+ oxcf->arnr_type = extra_cfg->arnr_type;
- oxcf->arnr_max_frames = vp8_cfg.arnr_max_frames;
- oxcf->arnr_strength = vp8_cfg.arnr_strength;
- oxcf->arnr_type = vp8_cfg.arnr_type;
+ oxcf->tuning = extra_cfg->tuning;
- oxcf->tuning = vp8_cfg.tuning;
+ oxcf->tile_columns = extra_cfg->tile_columns;
+ oxcf->tile_rows = extra_cfg->tile_rows;
- oxcf->tile_columns = vp8_cfg.tile_columns;
- oxcf->tile_rows = vp8_cfg.tile_rows;
+ oxcf->lossless = extra_cfg->lossless;
- oxcf->lossless = vp8_cfg.lossless;
+ oxcf->error_resilient_mode = cfg->g_error_resilient;
+ oxcf->frame_parallel_decoding_mode = extra_cfg->frame_parallel_decoding_mode;
- oxcf->error_resilient_mode = cfg.g_error_resilient;
- oxcf->frame_parallel_decoding_mode = vp8_cfg.frame_parallel_decoding_mode;
+ oxcf->aq_mode = extra_cfg->aq_mode;
+
+ oxcf->ss_number_layers = cfg->ss_number_layers;
+
+ if (oxcf->ss_number_layers > 1) {
+ vp9_copy(oxcf->ss_target_bitrate, cfg->ss_target_bitrate);
+ } else if (oxcf->ss_number_layers == 1) {
+ oxcf->ss_target_bitrate[0] = (int)oxcf->target_bandwidth;
+ }
+
+ oxcf->ts_number_layers = cfg->ts_number_layers;
+
+ if (oxcf->ts_number_layers > 1) {
+ vp9_copy(oxcf->ts_target_bitrate, cfg->ts_target_bitrate);
+ vp9_copy(oxcf->ts_rate_decimator, cfg->ts_rate_decimator);
+ } else if (oxcf->ts_number_layers == 1) {
+ oxcf->ts_target_bitrate[0] = (int)oxcf->target_bandwidth;
+ oxcf->ts_rate_decimator[0] = 1;
+ }
- oxcf->ss_number_layers = cfg.ss_number_layers;
/*
printf("Current VP9 Settings: \n");
printf("target_bandwidth: %d\n", oxcf->target_bandwidth);
printf("noise_sensitivity: %d\n", oxcf->noise_sensitivity);
- printf("Sharpness: %d\n", oxcf->Sharpness);
+ printf("sharpness: %d\n", oxcf->sharpness);
printf("cpu_used: %d\n", oxcf->cpu_used);
- printf("Mode: %d\n", oxcf->Mode);
- // printf("delete_first_pass_file: %d\n", oxcf->delete_first_pass_file);
+ printf("Mode: %d\n", oxcf->mode);
printf("auto_key: %d\n", oxcf->auto_key);
printf("key_freq: %d\n", oxcf->key_freq);
printf("end_usage: %d\n", oxcf->end_usage);
@@ -358,7 +383,6 @@ static vpx_codec_err_t set_vp9e_config(VP9_CONFIG *oxcf,
printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias);
printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section);
printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section);
- printf("allow_lag: %d\n", oxcf->allow_lag);
printf("lag_in_frames: %d\n", oxcf->lag_in_frames);
printf("play_alternate: %d\n", oxcf->play_alternate);
printf("Version: %d\n", oxcf->Version);
@@ -385,11 +409,11 @@ static vpx_codec_err_t vp9e_set_config(vpx_codec_alg_priv_t *ctx,
if ((cfg->g_lag_in_frames > ctx->cfg.g_lag_in_frames))
ERROR("Cannot increase lag_in_frames");
- res = validate_config(ctx, cfg, &ctx->vp8_cfg);
+ res = validate_config(ctx, cfg, &ctx->extra_cfg);
- if (!res) {
+ if (res == VPX_CODEC_OK) {
ctx->cfg = *cfg;
- set_vp9e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg);
+ set_vp9e_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg);
vp9_change_config(ctx->cpi, &ctx->oxcf);
}
@@ -407,8 +431,7 @@ static vpx_codec_err_t get_param(vpx_codec_alg_priv_t *ctx,
#define MAP(id, var) case id: *(RECAST(id, arg)) = var; break
- if (!arg)
- return VPX_CODEC_INVALID_PARAM;
+ if (arg == NULL) return VPX_CODEC_INVALID_PARAM;
switch (ctrl_id) {
MAP(VP8E_GET_LAST_QUANTIZER, vp9_get_quantizer(ctx->cpi));
@@ -424,34 +447,36 @@ static vpx_codec_err_t get_param(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t set_param(vpx_codec_alg_priv_t *ctx,
int ctrl_id,
va_list args) {
- vpx_codec_err_t res = VPX_CODEC_OK;
- struct vp9_extracfg xcfg = ctx->vp8_cfg;
+ vpx_codec_err_t res = VPX_CODEC_OK;
+ struct vp9_extracfg extra_cfg = ctx->extra_cfg;
#define MAP(id, var) case id: var = CAST(id, args); break;
switch (ctrl_id) {
- MAP(VP8E_SET_CPUUSED, xcfg.cpu_used);
- MAP(VP8E_SET_ENABLEAUTOALTREF, xcfg.enable_auto_alt_ref);
- MAP(VP8E_SET_NOISE_SENSITIVITY, xcfg.noise_sensitivity);
- MAP(VP8E_SET_SHARPNESS, xcfg.Sharpness);
- MAP(VP8E_SET_STATIC_THRESHOLD, xcfg.static_thresh);
- MAP(VP9E_SET_TILE_COLUMNS, xcfg.tile_columns);
- MAP(VP9E_SET_TILE_ROWS, xcfg.tile_rows);
- MAP(VP8E_SET_ARNR_MAXFRAMES, xcfg.arnr_max_frames);
- MAP(VP8E_SET_ARNR_STRENGTH, xcfg.arnr_strength);
- MAP(VP8E_SET_ARNR_TYPE, xcfg.arnr_type);
- MAP(VP8E_SET_TUNING, xcfg.tuning);
- MAP(VP8E_SET_CQ_LEVEL, xcfg.cq_level);
- MAP(VP8E_SET_MAX_INTRA_BITRATE_PCT, xcfg.rc_max_intra_bitrate_pct);
- MAP(VP9E_SET_LOSSLESS, xcfg.lossless);
- MAP(VP9E_SET_FRAME_PARALLEL_DECODING, xcfg.frame_parallel_decoding_mode);
+ MAP(VP8E_SET_CPUUSED, extra_cfg.cpu_used);
+ MAP(VP8E_SET_ENABLEAUTOALTREF, extra_cfg.enable_auto_alt_ref);
+ MAP(VP8E_SET_NOISE_SENSITIVITY, extra_cfg.noise_sensitivity);
+ MAP(VP8E_SET_SHARPNESS, extra_cfg.sharpness);
+ MAP(VP8E_SET_STATIC_THRESHOLD, extra_cfg.static_thresh);
+ MAP(VP9E_SET_TILE_COLUMNS, extra_cfg.tile_columns);
+ MAP(VP9E_SET_TILE_ROWS, extra_cfg.tile_rows);
+ MAP(VP8E_SET_ARNR_MAXFRAMES, extra_cfg.arnr_max_frames);
+ MAP(VP8E_SET_ARNR_STRENGTH, extra_cfg.arnr_strength);
+ MAP(VP8E_SET_ARNR_TYPE, extra_cfg.arnr_type);
+ MAP(VP8E_SET_TUNING, extra_cfg.tuning);
+ MAP(VP8E_SET_CQ_LEVEL, extra_cfg.cq_level);
+ MAP(VP8E_SET_MAX_INTRA_BITRATE_PCT, extra_cfg.rc_max_intra_bitrate_pct);
+ MAP(VP9E_SET_LOSSLESS, extra_cfg.lossless);
+ MAP(VP9E_SET_FRAME_PARALLEL_DECODING,
+ extra_cfg.frame_parallel_decoding_mode);
+ MAP(VP9E_SET_AQ_MODE, extra_cfg.aq_mode);
}
- res = validate_config(ctx, &ctx->cfg, &xcfg);
+ res = validate_config(ctx, &ctx->cfg, &extra_cfg);
- if (!res) {
- ctx->vp8_cfg = xcfg;
- set_vp9e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg);
+ if (res == VPX_CODEC_OK) {
+ ctx->extra_cfg = extra_cfg;
+ set_vp9e_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg);
vp9_change_config(ctx->cpi, &ctx->oxcf);
}
@@ -460,21 +485,16 @@ static vpx_codec_err_t set_param(vpx_codec_alg_priv_t *ctx,
}
-static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx,
- int experimental) {
+static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx) {
vpx_codec_err_t res = VPX_CODEC_OK;
struct vpx_codec_alg_priv *priv;
vpx_codec_enc_cfg_t *cfg;
unsigned int i;
- VP9_PTR optr;
-
- if (!ctx->priv) {
+ if (ctx->priv == NULL) {
priv = calloc(1, sizeof(struct vpx_codec_alg_priv));
- if (!priv) {
- return VPX_CODEC_MEM_ERROR;
- }
+ if (priv == NULL) return VPX_CODEC_MEM_ERROR;
ctx->priv = &priv->base;
ctx->priv->sz = sizeof(*ctx->priv);
@@ -501,37 +521,32 @@ static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx,
extracfg_map[i].usage && extracfg_map[i].usage != cfg->g_usage;
i++) {}
- priv->vp8_cfg = extracfg_map[i].cfg;
- priv->vp8_cfg.pkt_list = &priv->pkt_list.head;
- priv->vp8_cfg.experimental = experimental;
+ priv->extra_cfg = extracfg_map[i].cfg;
+ priv->extra_cfg.pkt_list = &priv->pkt_list.head;
- // TODO(agrange) Check the limits set on this buffer, or the check that is
- // applied in vp9e_encode.
+ // Maximum buffer size approximated based on having multiple ARF.
priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 8;
-// priv->cx_data_sz = priv->cfg.g_w * priv->cfg.g_h * 3 / 2 * 2;
if (priv->cx_data_sz < 4096) priv->cx_data_sz = 4096;
- priv->cx_data = malloc(priv->cx_data_sz);
+ priv->cx_data = (unsigned char *)malloc(priv->cx_data_sz);
- if (!priv->cx_data) {
- return VPX_CODEC_MEM_ERROR;
- }
+ if (priv->cx_data == NULL) return VPX_CODEC_MEM_ERROR;
vp9_initialize_enc();
- res = validate_config(priv, &priv->cfg, &priv->vp8_cfg);
+ res = validate_config(priv, &priv->cfg, &priv->extra_cfg);
- if (!res) {
+ if (res == VPX_CODEC_OK) {
+ VP9_COMP *cpi;
set_vp9e_config(&ctx->priv->alg_priv->oxcf,
- ctx->priv->alg_priv->cfg,
- ctx->priv->alg_priv->vp8_cfg);
- optr = vp9_create_compressor(&ctx->priv->alg_priv->oxcf);
-
- if (!optr)
+ &ctx->priv->alg_priv->cfg,
+ &ctx->priv->alg_priv->extra_cfg);
+ cpi = vp9_create_compressor(&ctx->priv->alg_priv->oxcf);
+ if (cpi == NULL)
res = VPX_CODEC_MEM_ERROR;
else
- ctx->priv->alg_priv->cpi = optr;
+ ctx->priv->alg_priv->cpi = cpi;
}
}
@@ -541,45 +556,41 @@ static vpx_codec_err_t vp9e_common_init(vpx_codec_ctx_t *ctx,
static vpx_codec_err_t vp9e_init(vpx_codec_ctx_t *ctx,
vpx_codec_priv_enc_mr_cfg_t *data) {
- return vp9e_common_init(ctx, 0);
+ return vp9e_common_init(ctx);
}
-
-#if CONFIG_EXPERIMENTAL
-static vpx_codec_err_t vp9e_exp_init(vpx_codec_ctx_t *ctx,
- vpx_codec_priv_enc_mr_cfg_t *data) {
- return vp9e_common_init(ctx, 1);
-}
-#endif
-
-
static vpx_codec_err_t vp9e_destroy(vpx_codec_alg_priv_t *ctx) {
free(ctx->cx_data);
- vp9_remove_compressor(&ctx->cpi);
+ vp9_remove_compressor(ctx->cpi);
free(ctx);
return VPX_CODEC_OK;
}
static void pick_quickcompress_mode(vpx_codec_alg_priv_t *ctx,
- unsigned long duration,
- unsigned long deadline) {
- unsigned int new_qc;
-
- /* Use best quality mode if no deadline is given. */
- if (deadline)
- new_qc = MODE_GOODQUALITY;
- else
- new_qc = MODE_BESTQUALITY;
+ unsigned long duration,
+ unsigned long deadline) {
+ // Use best quality mode if no deadline is given.
+ MODE new_qc = MODE_BESTQUALITY;
+
+ if (deadline) {
+ // Convert duration parameter from stream timebase to microseconds
+ const uint64_t duration_us = (uint64_t)duration * 1000000 *
+ (uint64_t)ctx->cfg.g_timebase.num /
+ (uint64_t)ctx->cfg.g_timebase.den;
+
+ // If the deadline is more that the duration this frame is to be shown,
+ // use good quality mode. Otherwise use realtime mode.
+ new_qc = (deadline > duration_us) ? MODE_GOODQUALITY : MODE_REALTIME;
+ }
if (ctx->cfg.g_pass == VPX_RC_FIRST_PASS)
new_qc = MODE_FIRSTPASS;
else if (ctx->cfg.g_pass == VPX_RC_LAST_PASS)
- new_qc = (new_qc == MODE_BESTQUALITY)
- ? MODE_SECONDPASS_BEST
- : MODE_SECONDPASS;
+ new_qc = (new_qc == MODE_BESTQUALITY) ? MODE_SECONDPASS_BEST
+ : MODE_SECONDPASS;
- if (ctx->oxcf.Mode != new_qc) {
- ctx->oxcf.Mode = new_qc;
+ if (ctx->oxcf.mode != new_qc) {
+ ctx->oxcf.mode = new_qc;
vp9_change_config(ctx->cpi, &ctx->oxcf);
}
}
@@ -613,7 +624,7 @@ static int write_superframe_index(vpx_codec_alg_priv_t *ctx) {
*x++ = marker;
for (i = 0; i < ctx->pending_frame_count; i++) {
- int this_sz = ctx->pending_frame_sizes[i];
+ unsigned int this_sz = (unsigned int)ctx->pending_frame_sizes[i];
for (j = 0; j <= mag; j++) {
*x++ = this_sz & 0xff;
@@ -693,21 +704,18 @@ static vpx_codec_err_t vp9e_encode(vpx_codec_alg_priv_t *ctx,
}
}
- /* Initialize the encoder instance on the first frame*/
- if (!res && ctx->cpi) {
+ /* Initialize the encoder instance on the first frame. */
+ if (res == VPX_CODEC_OK && ctx->cpi != NULL) {
unsigned int lib_flags;
YV12_BUFFER_CONFIG sd;
int64_t dst_time_stamp, dst_end_time_stamp;
- unsigned long size, cx_data_sz;
+ size_t size, cx_data_sz;
unsigned char *cx_data;
/* Set up internal flags */
if (ctx->base.init_flags & VPX_CODEC_USE_PSNR)
((VP9_COMP *)ctx->cpi)->b_calculate_psnr = 1;
- // if (ctx->base.init_flags & VPX_CODEC_USE_OUTPUT_PARTITION)
- // ((VP9_COMP *)ctx->cpi)->output_partition = 1;
-
/* Convert API flags to internal codec lib flags */
lib_flags = (flags & VPX_EFLAG_FORCE_KF) ? FRAMEFLAGS_KEY : 0;
@@ -757,8 +765,8 @@ static vpx_codec_err_t vp9e_encode(vpx_codec_alg_priv_t *ctx,
VP9_COMP *cpi = (VP9_COMP *)ctx->cpi;
/* Pack invisible frames with the next visible frame */
- if (!cpi->common.show_frame) {
- if (!ctx->pending_cx_data)
+ if (cpi->common.show_frame == 0) {
+ if (ctx->pending_cx_data == 0)
ctx->pending_cx_data = cx_data;
ctx->pending_cx_data_sz += size;
ctx->pending_frame_sizes[ctx->pending_frame_count++] = size;
@@ -783,7 +791,7 @@ static vpx_codec_err_t vp9e_encode(vpx_codec_alg_priv_t *ctx,
if (lib_flags & FRAMEFLAGS_KEY)
pkt.data.frame.flags |= VPX_FRAME_IS_KEY;
- if (!cpi->common.show_frame) {
+ if (cpi->common.show_frame == 0) {
pkt.data.frame.flags |= VPX_FRAME_IS_INVISIBLE;
// This timestamp should be as close as possible to the
@@ -857,10 +865,9 @@ static const vpx_codec_cx_pkt_t *vp9e_get_cxdata(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t vp9e_set_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
+ vpx_ref_frame_t *frame = va_arg(args, vpx_ref_frame_t *);
- if (data) {
- vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
+ if (frame != NULL) {
YV12_BUFFER_CONFIG sd;
image2yuvconfig(&frame->img, &sd);
@@ -875,10 +882,9 @@ static vpx_codec_err_t vp9e_set_reference(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t vp9e_copy_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
+ vpx_ref_frame_t *frame = va_arg(args, vpx_ref_frame_t *);
- if (data) {
- vpx_ref_frame_t *frame = (vpx_ref_frame_t *)data;
+ if (frame != NULL) {
YV12_BUFFER_CONFIG sd;
image2yuvconfig(&frame->img, &sd);
@@ -893,13 +899,13 @@ static vpx_codec_err_t vp9e_copy_reference(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t get_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- vp9_ref_frame_t *data = va_arg(args, vp9_ref_frame_t *);
+ vp9_ref_frame_t *frame = va_arg(args, vp9_ref_frame_t *);
- if (data) {
+ if (frame != NULL) {
YV12_BUFFER_CONFIG* fb;
- vp9_get_reference_enc(ctx->cpi, data->idx, &fb);
- yuvconfig2image(&data->img, fb, NULL);
+ vp9_get_reference_enc(ctx->cpi, frame->idx, &fb);
+ yuvconfig2image(&frame->img, fb, NULL);
return VPX_CODEC_OK;
} else {
return VPX_CODEC_INVALID_PARAM;
@@ -910,11 +916,11 @@ static vpx_codec_err_t vp9e_set_previewpp(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
#if CONFIG_VP9_POSTPROC
- vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
+ vp8_postproc_cfg_t *config = va_arg(args, vp8_postproc_cfg_t *);
(void)ctr_id;
- if (data) {
- ctx->preview_ppcfg = *((vp8_postproc_cfg_t *)data);
+ if (config != NULL) {
+ ctx->preview_ppcfg = *config;
return VPX_CODEC_OK;
} else {
return VPX_CODEC_INVALID_PARAM;
@@ -938,7 +944,7 @@ static vpx_image_t *vp9e_get_preview(vpx_codec_alg_priv_t *ctx) {
flags.noise_level = ctx->preview_ppcfg.noise_level;
}
- if (0 == vp9_get_preview_raw_frame(ctx->cpi, &sd, &flags)) {
+ if (vp9_get_preview_raw_frame(ctx->cpi, &sd, &flags) == 0) {
yuvconfig2image(&ctx->preview_img, &sd, NULL);
return &ctx->preview_img;
} else {
@@ -949,7 +955,7 @@ static vpx_image_t *vp9e_get_preview(vpx_codec_alg_priv_t *ctx) {
static vpx_codec_err_t vp9e_update_entropy(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- int update = va_arg(args, int);
+ const int update = va_arg(args, int);
vp9_update_entropy(ctx->cpi, update);
return VPX_CODEC_OK;
}
@@ -957,15 +963,15 @@ static vpx_codec_err_t vp9e_update_entropy(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t vp9e_update_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- int update = va_arg(args, int);
- vp9_update_reference(ctx->cpi, update);
+ const int ref_frame_flags = va_arg(args, int);
+ vp9_update_reference(ctx->cpi, ref_frame_flags);
return VPX_CODEC_OK;
}
static vpx_codec_err_t vp9e_use_reference(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- int reference_flag = va_arg(args, int);
+ const int reference_flag = va_arg(args, int);
vp9_use_as_reference(ctx->cpi, reference_flag);
return VPX_CODEC_OK;
}
@@ -981,27 +987,27 @@ static vpx_codec_err_t vp9e_set_roi_map(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t vp9e_set_activemap(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
- // TODO(yaowu): Need to re-implement and test for VP9.
- return VPX_CODEC_INVALID_PARAM;
-}
+ vpx_active_map_t *const map = va_arg(args, vpx_active_map_t *);
-static vpx_codec_err_t vp9e_set_scalemode(vpx_codec_alg_priv_t *ctx,
- int ctr_id,
- va_list args) {
- vpx_scaling_mode_t *data = va_arg(args, vpx_scaling_mode_t *);
-
- if (data) {
- int res;
- vpx_scaling_mode_t scalemode = *(vpx_scaling_mode_t *)data;
- res = vp9_set_internal_size(ctx->cpi,
- (VPX_SCALING)scalemode.h_scaling_mode,
- (VPX_SCALING)scalemode.v_scaling_mode);
-
- if (!res) {
+ if (map) {
+ if (!vp9_set_active_map(ctx->cpi, map->active_map, map->rows, map->cols))
return VPX_CODEC_OK;
- } else {
+ else
return VPX_CODEC_INVALID_PARAM;
- }
+ } else {
+ return VPX_CODEC_INVALID_PARAM;
+ }
+}
+
+static vpx_codec_err_t vp9e_set_scalemode(vpx_codec_alg_priv_t *ctx,
+ int ctr_id, va_list args) {
+ vpx_scaling_mode_t *const mode = va_arg(args, vpx_scaling_mode_t *);
+
+ if (mode) {
+ const int res = vp9_set_internal_size(ctx->cpi,
+ (VPX_SCALING)mode->h_scaling_mode,
+ (VPX_SCALING)mode->v_scaling_mode);
+ return (res == 0) ? VPX_CODEC_OK : VPX_CODEC_INVALID_PARAM;
} else {
return VPX_CODEC_INVALID_PARAM;
}
@@ -1011,34 +1017,57 @@ static vpx_codec_err_t vp9e_set_svc(vpx_codec_alg_priv_t *ctx, int ctr_id,
va_list args) {
int data = va_arg(args, int);
vp9_set_svc(ctx->cpi, data);
+ // CBR mode for SVC with both temporal and spatial layers not yet supported.
+ if (data == 1 &&
+ ctx->cfg.rc_end_usage == VPX_CBR &&
+ ctx->cfg.ss_number_layers > 1 &&
+ ctx->cfg.ts_number_layers > 1) {
+ return VPX_CODEC_INVALID_PARAM;
+ }
+ return VPX_CODEC_OK;
+}
+
+static vpx_codec_err_t vp9e_set_svc_layer_id(vpx_codec_alg_priv_t *ctx,
+ int ctr_id,
+ va_list args) {
+ vpx_svc_layer_id_t *data = va_arg(args, vpx_svc_layer_id_t *);
+ VP9_COMP *cpi = (VP9_COMP *)ctx->cpi;
+ cpi->svc.spatial_layer_id = data->spatial_layer_id;
+ cpi->svc.temporal_layer_id = data->temporal_layer_id;
+ // Checks on valid layer_id input.
+ if (cpi->svc.temporal_layer_id < 0 ||
+ cpi->svc.temporal_layer_id >= (int)ctx->cfg.ts_number_layers) {
+ return VPX_CODEC_INVALID_PARAM;
+ }
+ if (cpi->svc.spatial_layer_id < 0 ||
+ cpi->svc.spatial_layer_id >= (int)ctx->cfg.ss_number_layers) {
+ return VPX_CODEC_INVALID_PARAM;
+ }
return VPX_CODEC_OK;
}
static vpx_codec_err_t vp9e_set_svc_parameters(vpx_codec_alg_priv_t *ctx,
int ctr_id, va_list args) {
- vpx_svc_parameters_t *data = va_arg(args, vpx_svc_parameters_t *);
- VP9_COMP *cpi = (VP9_COMP *)ctx->cpi;
- vpx_svc_parameters_t params;
+ VP9_COMP *const cpi = ctx->cpi;
+ vpx_svc_parameters_t *const params = va_arg(args, vpx_svc_parameters_t *);
- if (data == NULL) {
+ if (params == NULL)
return VPX_CODEC_INVALID_PARAM;
- }
- params = *(vpx_svc_parameters_t *)data;
+ cpi->svc.spatial_layer_id = params->spatial_layer;
+ cpi->svc.temporal_layer_id = params->temporal_layer;
- cpi->current_layer = params.layer;
- cpi->lst_fb_idx = params.lst_fb_idx;
- cpi->gld_fb_idx = params.gld_fb_idx;
- cpi->alt_fb_idx = params.alt_fb_idx;
+ cpi->lst_fb_idx = params->lst_fb_idx;
+ cpi->gld_fb_idx = params->gld_fb_idx;
+ cpi->alt_fb_idx = params->alt_fb_idx;
- if (vp9_set_size_literal(ctx->cpi, params.width, params.height) != 0) {
+ if (vp9_set_size_literal(ctx->cpi, params->width, params->height) != 0)
return VPX_CODEC_INVALID_PARAM;
- }
- ctx->cfg.rc_max_quantizer = params.max_quantizer;
- ctx->cfg.rc_min_quantizer = params.min_quantizer;
+ ctx->cfg.rc_max_quantizer = params->max_quantizer;
+ ctx->cfg.rc_min_quantizer = params->min_quantizer;
- set_vp9e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg);
+ set_vp9e_config(&ctx->oxcf, &ctx->cfg, &ctx->extra_cfg);
vp9_change_config(ctx->cpi, &ctx->oxcf);
return VPX_CODEC_OK;
@@ -1071,9 +1100,11 @@ static vpx_codec_ctrl_fn_map_t vp9e_ctf_maps[] = {
{VP8E_SET_MAX_INTRA_BITRATE_PCT, set_param},
{VP9E_SET_LOSSLESS, set_param},
{VP9E_SET_FRAME_PARALLEL_DECODING, set_param},
+ {VP9E_SET_AQ_MODE, set_param},
{VP9_GET_REFERENCE, get_reference},
{VP9E_SET_SVC, vp9e_set_svc},
{VP9E_SET_SVC_PARAMETERS, vp9e_set_svc_parameters},
+ {VP9E_SET_SVC_LAYER_ID, vp9e_set_svc_layer_id},
{ -1, NULL},
};
@@ -1124,9 +1155,13 @@ static vpx_codec_enc_cfg_map_t vp9e_usage_cfg_map[] = {
9999, /* kf_max_dist */
VPX_SS_DEFAULT_LAYERS, /* ss_number_layers */
-
+ {0}, /* ss_target_bitrate */
+ 1, /* ts_number_layers */
+ {0}, /* ts_target_bitrate */
+ {0}, /* ts_rate_decimator */
+ 0, /* ts_periodicity */
+ {0}, /* ts_layer_id */
#if VPX_ENCODER_ABI_VERSION == (1 + VPX_CODEC_ABI_VERSION)
- 1, /* g_delete_first_pass_file */
"vp8.fpf" /* first pass filename */
#endif
}
@@ -1164,33 +1199,3 @@ CODEC_INTERFACE(vpx_codec_vp9_cx) = {
vp9e_get_preview,
} /* encoder functions */
};
-
-
-#if CONFIG_EXPERIMENTAL
-
-CODEC_INTERFACE(vpx_codec_vp9x_cx) = {
- "VP8 Experimental Encoder" VERSION_STRING,
- VPX_CODEC_INTERNAL_ABI_VERSION,
- VPX_CODEC_CAP_ENCODER | VPX_CODEC_CAP_PSNR,
- /* vpx_codec_caps_t caps; */
- vp9e_exp_init, /* vpx_codec_init_fn_t init; */
- vp9e_destroy, /* vpx_codec_destroy_fn_t destroy; */
- vp9e_ctf_maps, /* vpx_codec_ctrl_fn_map_t *ctrl_maps; */
- NOT_IMPLEMENTED, /* vpx_codec_get_mmap_fn_t get_mmap; */
- NOT_IMPLEMENTED, /* vpx_codec_set_mmap_fn_t set_mmap; */
- { // NOLINT
- NOT_IMPLEMENTED, /* vpx_codec_peek_si_fn_t peek_si; */
- NOT_IMPLEMENTED, /* vpx_codec_get_si_fn_t get_si; */
- NOT_IMPLEMENTED, /* vpx_codec_decode_fn_t decode; */
- NOT_IMPLEMENTED, /* vpx_codec_frame_get_fn_t frame_get; */
- },
- { // NOLINT
- vp9e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t peek_si; */
- vp9e_encode, /* vpx_codec_encode_fn_t encode; */
- vp9e_get_cxdata, /* vpx_codec_get_cx_data_fn_t frame_get; */
- vp9e_set_config,
- NOT_IMPLEMENTED,
- vp9e_get_preview,
- } /* encoder functions */
-};
-#endif
diff --git a/libvpx/vp9/vp9_dx_iface.c b/libvpx/vp9/vp9_dx_iface.c
index 5dacab4..72701d9 100644
--- a/libvpx/vp9/vp9_dx_iface.c
+++ b/libvpx/vp9/vp9_dx_iface.c
@@ -15,8 +15,8 @@
#include "vpx/vp8dx.h"
#include "vpx/internal/vpx_codec_internal.h"
#include "./vpx_version.h"
-#include "vp9/decoder/vp9_onyxd.h"
-#include "vp9/decoder/vp9_onyxd_int.h"
+#include "vp9/common/vp9_frame_buffers.h"
+#include "vp9/decoder/vp9_decoder.h"
#include "vp9/decoder/vp9_read_bit_buffer.h"
#include "vp9/vp9_iface_common.h"
@@ -25,7 +25,7 @@ typedef vpx_codec_stream_info_t vp9_stream_info_t;
/* Structures for handling memory allocations */
typedef enum {
- VP9_SEG_ALG_PRIV = 256,
+ VP9_SEG_ALG_PRIV = 256,
VP9_SEG_MAX
} mem_seg_id_t;
#define NELEMENTS(x) ((int)(sizeof(x)/sizeof(x[0])))
@@ -45,7 +45,7 @@ struct vpx_codec_alg_priv {
vp9_stream_info_t si;
int defer_alloc;
int decoder_init;
- VP9D_PTR pbi;
+ struct VP9Decompressor *pbi;
int postproc_cfg_set;
vp8_postproc_cfg_t postproc_cfg;
#if CONFIG_POSTPROC_VISUALIZER
@@ -59,6 +59,11 @@ struct vpx_codec_alg_priv {
int img_setup;
int img_avail;
int invert_tile_order;
+
+ // External frame buffer info to save for VP9 common.
+ void *ext_priv; // Private data associated with the external frame buffers.
+ vpx_get_frame_buffer_cb_fn_t get_ext_fb_cb;
+ vpx_release_frame_buffer_cb_fn_t release_ext_fb_cb;
};
static unsigned long priv_sz(const vpx_codec_dec_cfg_t *si,
@@ -75,10 +80,10 @@ static unsigned long priv_sz(const vpx_codec_dec_cfg_t *si,
static void vp9_init_ctx(vpx_codec_ctx_t *ctx, const vpx_codec_mmap_t *mmap) {
int i;
- ctx->priv = mmap->base;
+ ctx->priv = (vpx_codec_priv_t *)mmap->base;
ctx->priv->sz = sizeof(*ctx->priv);
ctx->priv->iface = ctx->iface;
- ctx->priv->alg_priv = mmap->base;
+ ctx->priv->alg_priv = (struct vpx_codec_alg_priv *)mmap->base;
for (i = 0; i < NELEMENTS(ctx->priv->alg_priv->mmaps); i++)
ctx->priv->alg_priv->mmaps[i].id = vp9_mem_req_segs[i].id;
@@ -100,12 +105,11 @@ static void vp9_finalize_mmaps(vpx_codec_alg_priv_t *ctx) {
static vpx_codec_err_t vp9_init(vpx_codec_ctx_t *ctx,
vpx_codec_priv_enc_mr_cfg_t *data) {
- vpx_codec_err_t res = VPX_CODEC_OK;
+ vpx_codec_err_t res = VPX_CODEC_OK;
- /* This function only allocates space for the vpx_codec_alg_priv_t
- * structure. More memory may be required at the time the stream
- * information becomes known.
- */
+ // This function only allocates space for the vpx_codec_alg_priv_t
+ // structure. More memory may be required at the time the stream
+ // information becomes known.
if (!ctx->priv) {
vpx_codec_mmap_t mmap;
@@ -115,12 +119,10 @@ static vpx_codec_err_t vp9_init(vpx_codec_ctx_t *ctx,
mmap.flags = vp9_mem_req_segs[0].flags;
res = vpx_mmap_alloc(&mmap);
-
if (!res) {
vp9_init_ctx(ctx, &mmap);
ctx->priv->alg_priv->defer_alloc = 1;
- /*post processing level initialized to do nothing */
}
}
@@ -140,8 +142,7 @@ static vpx_codec_err_t vp9_destroy(vpx_codec_alg_priv_t *ctx) {
return VPX_CODEC_OK;
}
-static vpx_codec_err_t vp9_peek_si(const uint8_t *data,
- unsigned int data_sz,
+static vpx_codec_err_t vp9_peek_si(const uint8_t *data, unsigned int data_sz,
vpx_codec_stream_info_t *si) {
if (data_sz <= 8) return VPX_CODEC_UNSUP_BITSTREAM;
if (data + data_sz <= data) return VPX_CODEC_INVALID_PARAM;
@@ -152,13 +153,12 @@ static vpx_codec_err_t vp9_peek_si(const uint8_t *data,
{
struct vp9_read_bit_buffer rb = { data, data + data_sz, 0, NULL, NULL };
const int frame_marker = vp9_rb_read_literal(&rb, 2);
- const int version = vp9_rb_read_bit(&rb) | (vp9_rb_read_bit(&rb) << 1);
- if (frame_marker != 0x2) return VPX_CODEC_UNSUP_BITSTREAM;
-#if CONFIG_NON420
+ const int version = vp9_rb_read_bit(&rb);
+ (void) vp9_rb_read_bit(&rb); // unused version bit
+
+ if (frame_marker != VP9_FRAME_MARKER)
+ return VPX_CODEC_UNSUP_BITSTREAM;
if (version > 1) return VPX_CODEC_UNSUP_BITSTREAM;
-#else
- if (version != 0) return VPX_CODEC_UNSUP_BITSTREAM;
-#endif
if (vp9_rb_read_bit(&rb)) { // show an existing frame
return VPX_CODEC_OK;
@@ -205,38 +205,27 @@ static vpx_codec_err_t vp9_peek_si(const uint8_t *data,
static vpx_codec_err_t vp9_get_si(vpx_codec_alg_priv_t *ctx,
vpx_codec_stream_info_t *si) {
- unsigned int sz;
-
- if (si->sz >= sizeof(vp9_stream_info_t))
- sz = sizeof(vp9_stream_info_t);
- else
- sz = sizeof(vpx_codec_stream_info_t);
-
+ const size_t sz = (si->sz >= sizeof(vp9_stream_info_t))
+ ? sizeof(vp9_stream_info_t)
+ : sizeof(vpx_codec_stream_info_t);
memcpy(si, &ctx->si, sz);
- si->sz = sz;
+ si->sz = (unsigned int)sz;
return VPX_CODEC_OK;
}
-static vpx_codec_err_t
-update_error_state(vpx_codec_alg_priv_t *ctx,
- const struct vpx_internal_error_info *error) {
- vpx_codec_err_t res;
-
- if ((res = error->error_code))
- ctx->base.err_detail = error->has_detail
- ? error->detail
- : NULL;
+static vpx_codec_err_t update_error_state(vpx_codec_alg_priv_t *ctx,
+ const struct vpx_internal_error_info *error) {
+ if (error->error_code)
+ ctx->base.err_detail = error->has_detail ? error->detail : NULL;
- return res;
+ return error->error_code;
}
-static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
- const uint8_t **data,
- unsigned int data_sz,
- void *user_priv,
- long deadline) {
+static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
+ const uint8_t **data, unsigned int data_sz,
+ void *user_priv, int64_t deadline) {
vpx_codec_err_t res = VPX_CODEC_OK;
ctx->img_avail = 0;
@@ -284,7 +273,7 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
if (!res) {
VP9D_CONFIG oxcf;
- VP9D_PTR optr;
+ struct VP9Decompressor *optr;
vp9_initialize_dec();
@@ -296,21 +285,40 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
oxcf.inv_tile_order = ctx->invert_tile_order;
optr = vp9_create_decompressor(&oxcf);
- /* If postprocessing was enabled by the application and a
- * configuration has not been provided, default it.
- */
- if (!ctx->postproc_cfg_set
- && (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) {
- ctx->postproc_cfg.post_proc_flag =
- VP8_DEBLOCK | VP8_DEMACROBLOCK;
+ // If postprocessing was enabled by the application and a
+ // configuration has not been provided, default it.
+ if (!ctx->postproc_cfg_set &&
+ (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC)) {
+ ctx->postproc_cfg.post_proc_flag = VP8_DEBLOCK | VP8_DEMACROBLOCK;
ctx->postproc_cfg.deblocking_level = 4;
ctx->postproc_cfg.noise_level = 0;
}
- if (!optr)
+ if (!optr) {
res = VPX_CODEC_ERROR;
- else
+ } else {
+ VP9D_COMP *const pbi = (VP9D_COMP*)optr;
+ VP9_COMMON *const cm = &pbi->common;
+
+ // Set index to not initialized.
+ cm->new_fb_idx = -1;
+
+ if (ctx->get_ext_fb_cb != NULL && ctx->release_ext_fb_cb != NULL) {
+ cm->get_fb_cb = ctx->get_ext_fb_cb;
+ cm->release_fb_cb = ctx->release_ext_fb_cb;
+ cm->cb_priv = ctx->ext_priv;
+ } else {
+ cm->get_fb_cb = vp9_get_frame_buffer;
+ cm->release_fb_cb = vp9_release_frame_buffer;
+
+ if (vp9_alloc_internal_frame_buffers(&cm->int_frame_buffers))
+ vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
+ "Failed to initialize internal frame buffers");
+ cm->cb_priv = &cm->int_frame_buffers;
+ }
+
ctx->pbi = optr;
+ }
}
ctx->decoder_init = 1;
@@ -324,36 +332,35 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
if (ctx->base.init_flags & VPX_CODEC_USE_POSTPROC) {
flags.post_proc_flag =
#if CONFIG_POSTPROC_VISUALIZER
- ((ctx->dbg_color_ref_frame_flag != 0) ?
- VP9D_DEBUG_CLR_FRM_REF_BLKS : 0)
- | ((ctx->dbg_color_mb_modes_flag != 0) ?
- VP9D_DEBUG_CLR_BLK_MODES : 0)
- | ((ctx->dbg_color_b_modes_flag != 0) ?
- VP9D_DEBUG_CLR_BLK_MODES : 0)
- | ((ctx->dbg_display_mv_flag != 0) ?
- VP9D_DEBUG_DRAW_MV : 0)
- |
+ (ctx->dbg_color_ref_frame_flag ? VP9D_DEBUG_CLR_FRM_REF_BLKS : 0) |
+ (ctx->dbg_color_mb_modes_flag ? VP9D_DEBUG_CLR_BLK_MODES : 0) |
+ (ctx->dbg_color_b_modes_flag ? VP9D_DEBUG_CLR_BLK_MODES : 0) |
+ (ctx->dbg_display_mv_flag ? VP9D_DEBUG_DRAW_MV : 0) |
#endif
ctx->postproc_cfg.post_proc_flag;
- flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
- flags.noise_level = ctx->postproc_cfg.noise_level;
+ flags.deblocking_level = ctx->postproc_cfg.deblocking_level;
+ flags.noise_level = ctx->postproc_cfg.noise_level;
#if CONFIG_POSTPROC_VISUALIZER
flags.display_ref_frame_flag = ctx->dbg_color_ref_frame_flag;
flags.display_mb_modes_flag = ctx->dbg_color_mb_modes_flag;
- flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
- flags.display_mv_flag = ctx->dbg_display_mv_flag;
+ flags.display_b_modes_flag = ctx->dbg_color_b_modes_flag;
+ flags.display_mv_flag = ctx->dbg_display_mv_flag;
#endif
}
if (vp9_receive_compressed_data(ctx->pbi, data_sz, data, deadline)) {
- VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi;
+ VP9D_COMP *pbi = (VP9D_COMP*)ctx->pbi;
res = update_error_state(ctx, &pbi->common.error);
}
if (!res && 0 == vp9_get_raw_frame(ctx->pbi, &sd, &time_stamp,
&time_end_stamp, &flags)) {
+ VP9D_COMP *const pbi = (VP9D_COMP*)ctx->pbi;
+ VP9_COMMON *const cm = &pbi->common;
yuvconfig2image(&ctx->img, &sd, user_priv);
+
+ ctx->img.fb_priv = cm->frame_bufs[cm->new_fb_idx].raw_frame_buffer.priv;
ctx->img_avail = 1;
}
}
@@ -361,10 +368,8 @@ static vpx_codec_err_t decode_one(vpx_codec_alg_priv_t *ctx,
return res;
}
-static void parse_superframe_index(const uint8_t *data,
- size_t data_sz,
- uint32_t sizes[8],
- int *count) {
+static void parse_superframe_index(const uint8_t *data, size_t data_sz,
+ uint32_t sizes[8], int *count) {
uint8_t marker;
assert(data_sz);
@@ -401,7 +406,7 @@ static vpx_codec_err_t vp9_decode(vpx_codec_alg_priv_t *ctx,
long deadline) {
const uint8_t *data_start = data;
const uint8_t *data_end = data + data_sz;
- vpx_codec_err_t res = 0;
+ vpx_codec_err_t res = VPX_CODEC_OK;
uint32_t sizes[8];
int frames_this_pts, frame_count = 0;
@@ -452,7 +457,7 @@ static vpx_codec_err_t vp9_decode(vpx_codec_alg_priv_t *ctx,
while (data_start < data_end && *data_start == 0)
data_start++;
- data_sz = data_end - data_start;
+ data_sz = (unsigned int)(data_end - data_start);
} while (data_start < data_end);
return res;
}
@@ -475,11 +480,29 @@ static vpx_image_t *vp9_get_frame(vpx_codec_alg_priv_t *ctx,
return img;
}
-static vpx_codec_err_t vp9_xma_get_mmap(const vpx_codec_ctx_t *ctx,
- vpx_codec_mmap_t *mmap,
- vpx_codec_iter_t *iter) {
- vpx_codec_err_t res;
- const mem_req_t *seg_iter = *iter;
+static vpx_codec_err_t vp9_set_fb_fn(
+ vpx_codec_alg_priv_t *ctx,
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv) {
+ if (cb_get == NULL || cb_release == NULL) {
+ return VPX_CODEC_INVALID_PARAM;
+ } else if (ctx->pbi == NULL) {
+ // If the decoder has already been initialized, do not accept changes to
+ // the frame buffer functions.
+ ctx->get_ext_fb_cb = cb_get;
+ ctx->release_ext_fb_cb = cb_release;
+ ctx->ext_priv = cb_priv;
+ return VPX_CODEC_OK;
+ }
+
+ return VPX_CODEC_ERROR;
+}
+
+static vpx_codec_err_t vp9_xma_get_mmap(const vpx_codec_ctx_t *ctx,
+ vpx_codec_mmap_t *mmap,
+ vpx_codec_iter_t *iter) {
+ vpx_codec_err_t res;
+ const mem_req_t *seg_iter = (const mem_req_t *)*iter;
/* Get address of next segment request */
do {
@@ -508,7 +531,7 @@ static vpx_codec_err_t vp9_xma_get_mmap(const vpx_codec_ctx_t *ctx,
return res;
}
-static vpx_codec_err_t vp9_xma_set_mmap(vpx_codec_ctx_t *ctx,
+static vpx_codec_err_t vp9_xma_set_mmap(vpx_codec_ctx_t *ctx,
const vpx_codec_mmap_t *mmap) {
vpx_codec_err_t res = VPX_CODEC_MEM_ERROR;
int i, done;
@@ -544,8 +567,7 @@ static vpx_codec_err_t vp9_xma_set_mmap(vpx_codec_ctx_t *ctx,
return res;
}
-static vpx_codec_err_t set_reference(vpx_codec_alg_priv_t *ctx,
- int ctr_id,
+static vpx_codec_err_t set_reference(vpx_codec_alg_priv_t *ctx, int ctr_id,
va_list args) {
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
@@ -554,7 +576,6 @@ static vpx_codec_err_t set_reference(vpx_codec_alg_priv_t *ctx,
YV12_BUFFER_CONFIG sd;
image2yuvconfig(&frame->img, &sd);
-
return vp9_set_reference_dec(ctx->pbi,
(VP9_REFFRAME)frame->frame_type, &sd);
} else {
@@ -562,8 +583,7 @@ static vpx_codec_err_t set_reference(vpx_codec_alg_priv_t *ctx,
}
}
-static vpx_codec_err_t copy_reference(vpx_codec_alg_priv_t *ctx,
- int ctr_id,
+static vpx_codec_err_t copy_reference(vpx_codec_alg_priv_t *ctx, int ctr_id,
va_list args) {
vpx_ref_frame_t *data = va_arg(args, vpx_ref_frame_t *);
@@ -580,8 +600,7 @@ static vpx_codec_err_t copy_reference(vpx_codec_alg_priv_t *ctx,
}
}
-static vpx_codec_err_t get_reference(vpx_codec_alg_priv_t *ctx,
- int ctr_id,
+static vpx_codec_err_t get_reference(vpx_codec_alg_priv_t *ctx, int ctr_id,
va_list args) {
vp9_ref_frame_t *data = va_arg(args, vp9_ref_frame_t *);
@@ -596,8 +615,7 @@ static vpx_codec_err_t get_reference(vpx_codec_alg_priv_t *ctx,
}
}
-static vpx_codec_err_t set_postproc(vpx_codec_alg_priv_t *ctx,
- int ctr_id,
+static vpx_codec_err_t set_postproc(vpx_codec_alg_priv_t *ctx, int ctr_id,
va_list args) {
#if CONFIG_VP9_POSTPROC
vp8_postproc_cfg_t *data = va_arg(args, vp8_postproc_cfg_t *);
@@ -614,8 +632,7 @@ static vpx_codec_err_t set_postproc(vpx_codec_alg_priv_t *ctx,
#endif
}
-static vpx_codec_err_t set_dbg_options(vpx_codec_alg_priv_t *ctx,
- int ctrl_id,
+static vpx_codec_err_t set_dbg_options(vpx_codec_alg_priv_t *ctx, int ctrl_id,
va_list args) {
#if CONFIG_POSTPROC_VISUALIZER && CONFIG_POSTPROC
int data = va_arg(args, int);
@@ -636,10 +653,9 @@ static vpx_codec_err_t set_dbg_options(vpx_codec_alg_priv_t *ctx,
}
static vpx_codec_err_t get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
- int ctrl_id,
- va_list args) {
+ int ctrl_id, va_list args) {
int *update_info = va_arg(args, int *);
- VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi;
+ VP9D_COMP *pbi = (VP9D_COMP*)ctx->pbi;
if (update_info) {
*update_info = pbi->refresh_frame_flags;
@@ -652,12 +668,11 @@ static vpx_codec_err_t get_last_ref_updates(vpx_codec_alg_priv_t *ctx,
static vpx_codec_err_t get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
- int ctrl_id,
- va_list args) {
+ int ctrl_id, va_list args) {
int *corrupted = va_arg(args, int *);
if (corrupted) {
- VP9D_COMP *pbi = (VP9D_COMP *)ctx->pbi;
+ VP9D_COMP *pbi = (VP9D_COMP*)ctx->pbi;
if (pbi)
*corrupted = pbi->common.frame_to_show->corrupted;
else
@@ -668,6 +683,24 @@ static vpx_codec_err_t get_frame_corrupted(vpx_codec_alg_priv_t *ctx,
}
}
+static vpx_codec_err_t get_display_size(vpx_codec_alg_priv_t *ctx,
+ int ctrl_id, va_list args) {
+ int *const display_size = va_arg(args, int *);
+
+ if (display_size) {
+ const VP9D_COMP *const pbi = (VP9D_COMP*)ctx->pbi;
+ if (pbi) {
+ display_size[0] = pbi->common.display_width;
+ display_size[1] = pbi->common.display_height;
+ } else {
+ return VPX_CODEC_ERROR;
+ }
+ return VPX_CODEC_OK;
+ } else {
+ return VPX_CODEC_INVALID_PARAM;
+ }
+}
+
static vpx_codec_err_t set_invert_tile_order(vpx_codec_alg_priv_t *ctx,
int ctr_id,
va_list args) {
@@ -686,6 +719,7 @@ static vpx_codec_ctrl_fn_map_t ctf_maps[] = {
{VP8D_GET_LAST_REF_UPDATES, get_last_ref_updates},
{VP8D_GET_FRAME_CORRUPTED, get_frame_corrupted},
{VP9_GET_REFERENCE, get_reference},
+ {VP9D_GET_DISPLAY_SIZE, get_display_size},
{VP9_INVERT_TILE_DECODE_ORDER, set_invert_tile_order},
{ -1, NULL},
};
@@ -697,7 +731,8 @@ static vpx_codec_ctrl_fn_map_t ctf_maps[] = {
CODEC_INTERFACE(vpx_codec_vp9_dx) = {
"WebM Project VP9 Decoder" VERSION_STRING,
VPX_CODEC_INTERNAL_ABI_VERSION,
- VPX_CODEC_CAP_DECODER | VP9_CAP_POSTPROC,
+ VPX_CODEC_CAP_DECODER | VP9_CAP_POSTPROC |
+ VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER,
/* vpx_codec_caps_t caps; */
vp9_init, /* vpx_codec_init_fn_t init; */
vp9_destroy, /* vpx_codec_destroy_fn_t destroy; */
@@ -709,6 +744,7 @@ CODEC_INTERFACE(vpx_codec_vp9_dx) = {
vp9_get_si, /* vpx_codec_get_si_fn_t get_si; */
vp9_decode, /* vpx_codec_decode_fn_t decode; */
vp9_get_frame, /* vpx_codec_frame_get_fn_t frame_get; */
+ vp9_set_fb_fn, /* vpx_codec_set_fb_fn_t set_fb_fn; */
},
{ // NOLINT
/* encoder functions */
diff --git a/libvpx/vp9/vp9_iface_common.h b/libvpx/vp9/vp9_iface_common.h
index ed0122c..58256b2 100644
--- a/libvpx/vp9/vp9_iface_common.h
+++ b/libvpx/vp9/vp9_iface_common.h
@@ -29,7 +29,7 @@ static void yuvconfig2image(vpx_image_t *img, const YV12_BUFFER_CONFIG *yv12,
img->fmt = VPX_IMG_FMT_I420;
}
img->w = yv12->y_stride;
- img->h = ALIGN_POWER_OF_TWO(yv12->y_height + 2 * VP9BORDERINPIXELS, 3);
+ img->h = ALIGN_POWER_OF_TWO(yv12->y_height + 2 * VP9_ENC_BORDER_IN_PIXELS, 3);
img->d_w = yv12->y_crop_width;
img->d_h = yv12->y_crop_height;
img->x_chroma_shift = yv12->uv_width < yv12->y_width;
@@ -75,7 +75,7 @@ static vpx_codec_err_t image2yuvconfig(const vpx_image_t *img,
yv12->border = (img->stride[VPX_PLANE_Y] - img->w) / 2;
#if CONFIG_ALPHA
- // For development purposes, force alpha to hold the same data a Y for now.
+ // For development purposes, force alpha to hold the same data as Y for now.
yv12->alpha_buffer = yv12->y_buffer;
yv12->alpha_width = yv12->y_width;
yv12->alpha_height = yv12->y_height;
diff --git a/libvpx/vp9/vp9cx.mk b/libvpx/vp9/vp9cx.mk
index 0993c6c..b14e7e5 100644
--- a/libvpx/vp9/vp9cx.mk
+++ b/libvpx/vp9/vp9cx.mk
@@ -18,55 +18,60 @@ VP9_CX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no)
VP9_CX_SRCS-yes += vp9_cx_iface.c
VP9_CX_SRCS-yes += encoder/vp9_bitstream.c
-VP9_CX_SRCS-yes += encoder/vp9_boolhuff.c
+VP9_CX_SRCS-yes += encoder/vp9_cost.h
+VP9_CX_SRCS-yes += encoder/vp9_cost.c
VP9_CX_SRCS-yes += encoder/vp9_dct.c
-VP9_CX_SRCS-yes += encoder/vp9_dct.h
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h
-VP9_CX_SRCS-yes += encoder/vp9_encodeintra.c
VP9_CX_SRCS-yes += encoder/vp9_encodemb.c
VP9_CX_SRCS-yes += encoder/vp9_encodemv.c
+VP9_CX_SRCS-yes += encoder/vp9_extend.c
VP9_CX_SRCS-yes += encoder/vp9_firstpass.c
VP9_CX_SRCS-yes += encoder/vp9_block.h
-VP9_CX_SRCS-yes += encoder/vp9_boolhuff.h
+VP9_CX_SRCS-yes += encoder/vp9_writer.h
+VP9_CX_SRCS-yes += encoder/vp9_writer.c
VP9_CX_SRCS-yes += encoder/vp9_write_bit_buffer.h
VP9_CX_SRCS-yes += encoder/vp9_bitstream.h
-VP9_CX_SRCS-yes += encoder/vp9_encodeintra.h
VP9_CX_SRCS-yes += encoder/vp9_encodemb.h
VP9_CX_SRCS-yes += encoder/vp9_encodemv.h
+VP9_CX_SRCS-yes += encoder/vp9_extend.h
VP9_CX_SRCS-yes += encoder/vp9_firstpass.h
VP9_CX_SRCS-yes += encoder/vp9_lookahead.c
VP9_CX_SRCS-yes += encoder/vp9_lookahead.h
VP9_CX_SRCS-yes += encoder/vp9_mcomp.h
-VP9_CX_SRCS-yes += encoder/vp9_modecosts.h
VP9_CX_SRCS-yes += encoder/vp9_onyx_int.h
-VP9_CX_SRCS-yes += encoder/vp9_psnr.h
VP9_CX_SRCS-yes += encoder/vp9_quantize.h
VP9_CX_SRCS-yes += encoder/vp9_ratectrl.h
VP9_CX_SRCS-yes += encoder/vp9_rdopt.h
+VP9_CX_SRCS-yes += encoder/vp9_pickmode.h
+VP9_CX_SRCS-yes += encoder/vp9_svc_layercontext.h
VP9_CX_SRCS-yes += encoder/vp9_tokenize.h
VP9_CX_SRCS-yes += encoder/vp9_treewriter.h
VP9_CX_SRCS-yes += encoder/vp9_variance.h
VP9_CX_SRCS-yes += encoder/vp9_mcomp.c
-VP9_CX_SRCS-yes += encoder/vp9_modecosts.c
VP9_CX_SRCS-yes += encoder/vp9_onyx_if.c
VP9_CX_SRCS-yes += encoder/vp9_picklpf.c
VP9_CX_SRCS-yes += encoder/vp9_picklpf.h
-VP9_CX_SRCS-yes += encoder/vp9_psnr.c
VP9_CX_SRCS-yes += encoder/vp9_quantize.c
VP9_CX_SRCS-yes += encoder/vp9_ratectrl.c
VP9_CX_SRCS-yes += encoder/vp9_rdopt.c
-VP9_CX_SRCS-yes += encoder/vp9_sad_c.c
+VP9_CX_SRCS-yes += encoder/vp9_pickmode.c
+VP9_CX_SRCS-yes += encoder/vp9_sad.c
VP9_CX_SRCS-yes += encoder/vp9_segmentation.c
VP9_CX_SRCS-yes += encoder/vp9_segmentation.h
VP9_CX_SRCS-yes += encoder/vp9_subexp.c
VP9_CX_SRCS-yes += encoder/vp9_subexp.h
+VP9_CX_SRCS-yes += encoder/vp9_svc_layercontext.c
+VP9_CX_SRCS-yes += encoder/vp9_resize.c
+VP9_CX_SRCS-yes += encoder/vp9_resize.h
VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/vp9_ssim.c
VP9_CX_SRCS-yes += encoder/vp9_tokenize.c
VP9_CX_SRCS-yes += encoder/vp9_treewriter.c
-VP9_CX_SRCS-yes += encoder/vp9_variance_c.c
+VP9_CX_SRCS-yes += encoder/vp9_variance.c
VP9_CX_SRCS-yes += encoder/vp9_vaq.c
VP9_CX_SRCS-yes += encoder/vp9_vaq.h
+VP9_CX_SRCS-yes += encoder/vp9_craq.c
+VP9_CX_SRCS-yes += encoder/vp9_craq.h
ifeq ($(CONFIG_VP9_POSTPROC),yes)
VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/vp9_postproc.h
VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += common/vp9_postproc.c
@@ -82,16 +87,19 @@ VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_variance_mmx.c
VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_variance_impl_mmx.asm
VP9_CX_SRCS-$(HAVE_MMX) += encoder/x86/vp9_sad_mmx.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_variance_impl_sse2.asm
+VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_variance_impl_intrin_avx2.c
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_sad4d_sse2.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_subpel_variance_impl_sse2.asm
+VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_subpel_variance_impl_intrin_avx2.c
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_temporal_filter_apply_sse2.asm
VP9_CX_SRCS-$(HAVE_SSE3) += encoder/x86/vp9_sad_sse3.asm
-ifeq ($(USE_X86INC),yes)
+ifeq ($(CONFIG_USE_X86INC),yes)
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_error_sse2.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_sad_sse2.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_subtract_sse2.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_variance_sse2.c
+VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_variance_avx2.c
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_subpel_variance.asm
endif
@@ -105,4 +113,7 @@ VP9_CX_SRCS-$(ARCH_X86_64) += encoder/x86/vp9_ssim_opt.asm
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct_sse2.c
VP9_CX_SRCS-$(HAVE_SSE2) += encoder/x86/vp9_dct32x32_sse2.c
+VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_dct_avx2.c
+VP9_CX_SRCS-$(HAVE_AVX2) += encoder/x86/vp9_dct32x32_avx2.c
+
VP9_CX_SRCS-yes := $(filter-out $(VP9_CX_SRCS_REMOVE-yes),$(VP9_CX_SRCS-yes))
diff --git a/libvpx/vp9/vp9dx.mk b/libvpx/vp9/vp9dx.mk
index 3a27cdd..92ec6fd 100644
--- a/libvpx/vp9/vp9dx.mk
+++ b/libvpx/vp9/vp9dx.mk
@@ -17,21 +17,22 @@ VP9_DX_SRCS_REMOVE-no += $(VP9_COMMON_SRCS_REMOVE-no)
VP9_DX_SRCS-yes += vp9_dx_iface.c
-VP9_DX_SRCS-yes += decoder/vp9_dboolhuff.c
VP9_DX_SRCS-yes += decoder/vp9_decodemv.c
-VP9_DX_SRCS-yes += decoder/vp9_decodframe.c
-VP9_DX_SRCS-yes += decoder/vp9_decodframe.h
+VP9_DX_SRCS-yes += decoder/vp9_decodeframe.c
+VP9_DX_SRCS-yes += decoder/vp9_decodeframe.h
VP9_DX_SRCS-yes += decoder/vp9_detokenize.c
-VP9_DX_SRCS-yes += decoder/vp9_dboolhuff.h
+VP9_DX_SRCS-yes += decoder/vp9_dthread.c
+VP9_DX_SRCS-yes += decoder/vp9_dthread.h
+VP9_DX_SRCS-yes += decoder/vp9_reader.h
+VP9_DX_SRCS-yes += decoder/vp9_reader.c
+VP9_DX_SRCS-yes += decoder/vp9_read_bit_buffer.c
VP9_DX_SRCS-yes += decoder/vp9_read_bit_buffer.h
VP9_DX_SRCS-yes += decoder/vp9_decodemv.h
VP9_DX_SRCS-yes += decoder/vp9_detokenize.h
-VP9_DX_SRCS-yes += decoder/vp9_onyxd.h
-VP9_DX_SRCS-yes += decoder/vp9_onyxd_int.h
+VP9_DX_SRCS-yes += decoder/vp9_decoder.c
+VP9_DX_SRCS-yes += decoder/vp9_decoder.h
VP9_DX_SRCS-yes += decoder/vp9_thread.c
VP9_DX_SRCS-yes += decoder/vp9_thread.h
-VP9_DX_SRCS-yes += decoder/vp9_treereader.h
-VP9_DX_SRCS-yes += decoder/vp9_onyxd_if.c
VP9_DX_SRCS-yes += decoder/vp9_dsubexp.c
VP9_DX_SRCS-yes += decoder/vp9_dsubexp.h
diff --git a/libvpx/vpx/exports_dec b/libvpx/vpx/exports_dec
index ed121f7..3ce1499 100644
--- a/libvpx/vpx/exports_dec
+++ b/libvpx/vpx/exports_dec
@@ -6,4 +6,5 @@ text vpx_codec_get_stream_info
text vpx_codec_peek_stream_info
text vpx_codec_register_put_frame_cb
text vpx_codec_register_put_slice_cb
+text vpx_codec_set_frame_buffer_functions
text vpx_codec_set_mem_map
diff --git a/libvpx/vpx/exports_enc b/libvpx/vpx/exports_enc
index 1d9340c..155faf6 100644
--- a/libvpx/vpx/exports_enc
+++ b/libvpx/vpx/exports_enc
@@ -20,3 +20,6 @@ text vpx_svc_set_keyframe
text vpx_svc_set_options
text vpx_svc_set_quantizers
text vpx_svc_set_scale_factors
+text vpx_svc_get_layer_resolution
+text vpx_svc_get_rc_stats_buffer_size
+text vpx_svc_get_rc_stats_buffer \ No newline at end of file
diff --git a/libvpx/vpx/internal/vpx_codec_internal.h b/libvpx/vpx/internal/vpx_codec_internal.h
index 05fed97..51ca65e 100644
--- a/libvpx/vpx/internal/vpx_codec_internal.h
+++ b/libvpx/vpx/internal/vpx_codec_internal.h
@@ -41,12 +41,15 @@
* Once initialized, the instance is manged using other functions from
* the vpx_codec_* family.
*/
-#ifndef VPX_CODEC_INTERNAL_H
-#define VPX_CODEC_INTERNAL_H
+#ifndef VPX_INTERNAL_VPX_CODEC_INTERNAL_H_
+#define VPX_INTERNAL_VPX_CODEC_INTERNAL_H_
#include "../vpx_decoder.h"
#include "../vpx_encoder.h"
#include <stdarg.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
/*!\brief Current ABI version number
*
@@ -56,7 +59,7 @@
* types, removing or reassigning enums, adding/removing/rearranging
* fields to structures
*/
-#define VPX_CODEC_INTERNAL_ABI_VERSION (4) /**<\hideinitializer*/
+#define VPX_CODEC_INTERNAL_ABI_VERSION (5) /**<\hideinitializer*/
typedef struct vpx_codec_alg_priv vpx_codec_alg_priv_t;
typedef struct vpx_codec_priv_enc_mr_cfg vpx_codec_priv_enc_mr_cfg_t;
@@ -215,6 +218,36 @@ typedef vpx_codec_err_t (*vpx_codec_decode_fn_t)(vpx_codec_alg_priv_t *ctx,
typedef vpx_image_t *(*vpx_codec_get_frame_fn_t)(vpx_codec_alg_priv_t *ctx,
vpx_codec_iter_t *iter);
+/*!\brief Pass in external frame buffers for the decoder to use.
+ *
+ * Registers functions to be called when libvpx needs a frame buffer
+ * to decode the current frame and a function to be called when libvpx does
+ * not internally reference the frame buffer. This set function must
+ * be called before the first call to decode or libvpx will assume the
+ * default behavior of allocating frame buffers internally.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb_get Pointer to the get callback function
+ * \param[in] cb_release Pointer to the release callback function
+ * \param[in] cb_priv Callback's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * External frame buffers will be used by libvpx.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * One or more of the callbacks were NULL.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * using external frame buffers.
+ *
+ * \note
+ * When decoding VP9, the application may be required to pass in at least
+ * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame
+ * buffers.
+ */
+typedef vpx_codec_err_t (*vpx_codec_set_fb_fn_t)(
+ vpx_codec_alg_priv_t *ctx,
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
/*\brief eXternal Memory Allocation memory map get iterator
*
@@ -305,6 +338,7 @@ struct vpx_codec_iface {
vpx_codec_get_si_fn_t get_si; /**< \copydoc ::vpx_codec_get_si_fn_t */
vpx_codec_decode_fn_t decode; /**< \copydoc ::vpx_codec_decode_fn_t */
vpx_codec_get_frame_fn_t get_frame; /**< \copydoc ::vpx_codec_get_frame_fn_t */
+ vpx_codec_set_fb_fn_t set_fb_fn; /**< \copydoc ::vpx_codec_set_fb_fn_t */
} dec;
struct vpx_codec_enc_iface {
vpx_codec_enc_cfg_map_t *cfg_maps; /**< \copydoc ::vpx_codec_enc_cfg_map_t */
@@ -444,6 +478,7 @@ vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list,
#include <stdio.h>
#include <setjmp.h>
+
struct vpx_internal_error_info {
vpx_codec_err_t error_code;
int has_detail;
@@ -500,4 +535,8 @@ vpx_codec_err_t vpx_validate_mmaps(const vpx_codec_stream_info_t *si,
const vpx_codec_mmap_t *mmaps,
const mem_req_t *mem_reqs, int nreqs,
vpx_codec_flags_t init_flags);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // VPX_INTERNAL_VPX_CODEC_INTERNAL_H_
diff --git a/libvpx/vpx/internal/vpx_psnr.h b/libvpx/vpx/internal/vpx_psnr.h
new file mode 100644
index 0000000..07d81bb
--- /dev/null
+++ b/libvpx/vpx/internal/vpx_psnr.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VPX_INTERNAL_VPX_PSNR_H_
+#define VPX_INTERNAL_VPX_PSNR_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// TODO(dkovalev) change vpx_sse_to_psnr signature: double -> int64_t
+
+/*!\brief Converts SSE to PSNR
+ *
+ * Converts sum of squared errros (SSE) to peak signal-to-noise ratio (PNSR).
+ *
+ * \param[in] samples Number of samples
+ * \param[in] peak Max sample value
+ * \param[in] sse Sum of squared errors
+ */
+double vpx_sse_to_psnr(double samples, double peak, double sse);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VPX_INTERNAL_VPX_PSNR_H_
diff --git a/libvpx/vpx/src/svc_encodeframe.c b/libvpx/vpx/src/svc_encodeframe.c
index 57d21dc..d48a761 100644
--- a/libvpx/vpx/src/svc_encodeframe.c
+++ b/libvpx/vpx/src/svc_encodeframe.c
@@ -13,6 +13,8 @@
* VP9 SVC encoding support via libvpx
*/
+#include <assert.h>
+#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -23,11 +25,13 @@
#include "vpx/vp8cx.h"
#include "vpx/vpx_encoder.h"
-#if defined(__MINGW32__) && !defined(MINGW_HAS_SECURE_API)
+#ifdef __MINGW32__
#define strtok_r strtok_s
+#ifndef MINGW_HAS_SECURE_API
// proto from /usr/x86_64-w64-mingw32/include/sec_api/string_s.h
_CRTIMP char *__cdecl strtok_s(char *str, const char *delim, char **context);
-#endif
+#endif /* MINGW_HAS_SECURE_API */
+#endif /* __MINGW32__ */
#ifdef _MSC_VER
#define strdup _strdup
@@ -38,6 +42,7 @@ _CRTIMP char *__cdecl strtok_s(char *str, const char *delim, char **context);
#define SUPERFRAME_SLOTS (8)
#define SUPERFRAME_BUFFER_SIZE (SUPERFRAME_SLOTS * sizeof(uint32_t) + 2)
#define OPTION_BUFFER_SIZE 256
+#define COMPONENTS 4 // psnr & sse statistics maintained for total, y, u, v
static const char *DEFAULT_QUANTIZER_VALUES = "60,53,39,33,27";
static const char *DEFAULT_SCALE_FACTORS = "4/16,5/16,7/16,11/16,16/16";
@@ -45,16 +50,20 @@ static const char *DEFAULT_SCALE_FACTORS = "4/16,5/16,7/16,11/16,16/16";
typedef struct SvcInternal {
char options[OPTION_BUFFER_SIZE]; // set by vpx_svc_set_options
char quantizers[OPTION_BUFFER_SIZE]; // set by vpx_svc_set_quantizers
+ char quantizers_keyframe[OPTION_BUFFER_SIZE]; // set by
+ // vpx_svc_set_quantizers
char scale_factors[OPTION_BUFFER_SIZE]; // set by vpx_svc_set_scale_factors
// values extracted from option, quantizers
int scaling_factor_num[VPX_SS_MAX_LAYERS];
int scaling_factor_den[VPX_SS_MAX_LAYERS];
+ int quantizer_keyframe[VPX_SS_MAX_LAYERS];
int quantizer[VPX_SS_MAX_LAYERS];
// accumulated statistics
- double psnr_in_layer[VPX_SS_MAX_LAYERS];
- uint32_t bytes_in_layer[VPX_SS_MAX_LAYERS];
+ double psnr_sum[VPX_SS_MAX_LAYERS][COMPONENTS]; // total/Y/U/V
+ uint64_t sse_sum[VPX_SS_MAX_LAYERS][COMPONENTS];
+ uint32_t bytes_sum[VPX_SS_MAX_LAYERS];
// codec encoding values
int width; // width of highest layer
@@ -73,6 +82,10 @@ typedef struct SvcInternal {
size_t buffer_size;
void *buffer;
+ char *rc_stats_buf;
+ size_t rc_stats_buf_size;
+ size_t rc_stats_buf_used;
+
char message_buffer[2048];
vpx_codec_ctx_t *codec_ctx;
} SvcInternal;
@@ -95,7 +108,8 @@ struct LayerData {
// create LayerData from encoder output
static struct LayerData *ld_create(void *buf, size_t size) {
- struct LayerData *const layer_data = malloc(sizeof(*layer_data));
+ struct LayerData *const layer_data =
+ (struct LayerData *)malloc(sizeof(*layer_data));
if (layer_data == NULL) {
return NULL;
}
@@ -201,18 +215,18 @@ static void sf_create_index(struct Superframe *sf) {
static SvcInternal *get_svc_internal(SvcContext *svc_ctx) {
if (svc_ctx == NULL) return NULL;
if (svc_ctx->internal == NULL) {
- SvcInternal *const si = malloc(sizeof(*si));
+ SvcInternal *const si = (SvcInternal *)malloc(sizeof(*si));
if (si != NULL) {
memset(si, 0, sizeof(*si));
}
svc_ctx->internal = si;
}
- return svc_ctx->internal;
+ return (SvcInternal *)svc_ctx->internal;
}
static const SvcInternal *get_const_svc_internal(const SvcContext *svc_ctx) {
if (svc_ctx == NULL) return NULL;
- return svc_ctx->internal;
+ return (const SvcInternal *)svc_ctx->internal;
}
static void svc_log_reset(SvcContext *svc_ctx) {
@@ -265,17 +279,23 @@ static vpx_codec_err_t set_option_encoding_mode(SvcContext *svc_ctx,
}
static vpx_codec_err_t parse_quantizer_values(SvcContext *svc_ctx,
- const char *quantizer_values) {
+ const char *quantizer_values,
+ const int is_keyframe) {
char *input_string;
char *token;
const char *delim = ",";
char *save_ptr;
int found = 0;
int i, q;
- int res = VPX_CODEC_OK;
+ vpx_codec_err_t res = VPX_CODEC_OK;
SvcInternal *const si = get_svc_internal(svc_ctx);
if (quantizer_values == NULL || strlen(quantizer_values) == 0) {
+ if (is_keyframe) {
+ // If there non settings for key frame, we will apply settings from
+ // non key frame. So just simply return here.
+ return VPX_CODEC_INVALID_PARAM;
+ }
input_string = strdup(DEFAULT_QUANTIZER_VALUES);
} else {
input_string = strdup(quantizer_values);
@@ -296,7 +316,12 @@ static vpx_codec_err_t parse_quantizer_values(SvcContext *svc_ctx,
} else {
q = 0;
}
- si->quantizer[i + VPX_SS_MAX_LAYERS - svc_ctx->spatial_layers] = q;
+ if (is_keyframe) {
+ si->quantizer_keyframe[i + VPX_SS_MAX_LAYERS - svc_ctx->spatial_layers]
+ = q;
+ } else {
+ si->quantizer[i + VPX_SS_MAX_LAYERS - svc_ctx->spatial_layers] = q;
+ }
}
if (res == VPX_CODEC_OK && found != svc_ctx->spatial_layers) {
svc_log(svc_ctx, SVC_LOG_ERROR,
@@ -322,7 +347,7 @@ static vpx_codec_err_t parse_scale_factors(SvcContext *svc_ctx,
int found = 0;
int i;
int64_t num, den;
- int res = VPX_CODEC_OK;
+ vpx_codec_err_t res = VPX_CODEC_OK;
SvcInternal *const si = get_svc_internal(svc_ctx);
if (scale_factors == NULL || strlen(scale_factors) == 0) {
@@ -381,7 +406,8 @@ static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) {
char *option_name;
char *option_value;
char *input_ptr;
- int res = VPX_CODEC_OK;
+ int is_keyframe_qaunt_set = 0;
+ vpx_codec_err_t res = VPX_CODEC_OK;
if (options == NULL) return VPX_CODEC_OK;
input_string = strdup(options);
@@ -406,8 +432,17 @@ static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) {
res = parse_scale_factors(svc_ctx, option_value);
if (res != VPX_CODEC_OK) break;
} else if (strcmp("quantizers", option_name) == 0) {
- res = parse_quantizer_values(svc_ctx, option_value);
+ res = parse_quantizer_values(svc_ctx, option_value, 0);
+ if (res != VPX_CODEC_OK) break;
+ if (!is_keyframe_qaunt_set) {
+ SvcInternal *const si = get_svc_internal(svc_ctx);
+ memcpy(get_svc_internal(svc_ctx)->quantizer_keyframe, si->quantizer,
+ sizeof(si->quantizer));
+ }
+ } else if (strcmp("quantizers-keyframe", option_name) == 0) {
+ res = parse_quantizer_values(svc_ctx, option_value, 1);
if (res != VPX_CODEC_OK) break;
+ is_keyframe_qaunt_set = 1;
} else {
svc_log(svc_ctx, SVC_LOG_ERROR, "invalid option: %s\n", option_name);
res = VPX_CODEC_INVALID_PARAM;
@@ -430,13 +465,19 @@ vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options) {
}
vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx,
- const char *quantizers) {
+ const char *quantizers,
+ const int is_for_keyframe) {
SvcInternal *const si = get_svc_internal(svc_ctx);
if (svc_ctx == NULL || quantizers == NULL || si == NULL) {
return VPX_CODEC_INVALID_PARAM;
}
- strncpy(si->quantizers, quantizers, sizeof(si->quantizers));
- si->quantizers[sizeof(si->quantizers) - 1] = '\0';
+ if (is_for_keyframe) {
+ strncpy(si->quantizers_keyframe, quantizers, sizeof(si->quantizers));
+ si->quantizers_keyframe[sizeof(si->quantizers_keyframe) - 1] = '\0';
+ } else {
+ strncpy(si->quantizers, quantizers, sizeof(si->quantizers));
+ si->quantizers[sizeof(si->quantizers) - 1] = '\0';
+ }
return VPX_CODEC_OK;
}
@@ -487,9 +528,13 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
// for first frame
si->layers = svc_ctx->spatial_layers;
- res = parse_quantizer_values(svc_ctx, si->quantizers);
+ res = parse_quantizer_values(svc_ctx, si->quantizers, 0);
if (res != VPX_CODEC_OK) return res;
+ res = parse_quantizer_values(svc_ctx, si->quantizers_keyframe, 1);
+ if (res != VPX_CODEC_OK)
+ memcpy(si->quantizer_keyframe, si->quantizer, sizeof(si->quantizer));
+
res = parse_scale_factors(svc_ctx, si->scale_factors);
if (res != VPX_CODEC_OK) return res;
@@ -497,10 +542,39 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
res = parse_options(svc_ctx, si->options);
if (res != VPX_CODEC_OK) return res;
+ // Assign target bitrate for each layer. We calculate the ratio
+ // from the resolution for now.
+ // TODO(Minghai): Optimize the mechanism of allocating bits after
+ // implementing svc two pass rate control.
+ if (si->layers > 1) {
+ int i;
+ float total = 0;
+ float alloc_ratio[VPX_SS_MAX_LAYERS] = {0};
+
+ assert(si->layers <= VPX_SS_MAX_LAYERS);
+ for (i = 0; i < si->layers; ++i) {
+ int pos = i + VPX_SS_MAX_LAYERS - svc_ctx->spatial_layers;
+ if (pos < VPX_SS_MAX_LAYERS && si->scaling_factor_den[pos] > 0) {
+ alloc_ratio[i] = (float)(si->scaling_factor_num[pos] * 1.0 /
+ si->scaling_factor_den[pos]);
+
+ alloc_ratio[i] *= alloc_ratio[i];
+ total += alloc_ratio[i];
+ }
+ }
+
+ for (i = 0; i < si->layers; ++i) {
+ if (total > 0) {
+ enc_cfg->ss_target_bitrate[i] = (unsigned int)
+ (enc_cfg->rc_target_bitrate * alloc_ratio[i] / total);
+ }
+ }
+ }
+
// modify encoder configuration
enc_cfg->ss_number_layers = si->layers;
+ enc_cfg->ts_number_layers = 1; // Temporal layers not used in this encoder.
enc_cfg->kf_mode = VPX_KF_DISABLED;
- enc_cfg->g_pass = VPX_RC_ONE_PASS;
// Lag in frames not currently supported
enc_cfg->g_lag_in_frames = 0;
@@ -584,21 +658,13 @@ static int map_vp8_flags(int svc_flags) {
return flags;
}
-/**
- * Helper to check if the current frame is the first, full resolution dummy.
- */
-static int vpx_svc_dummy_frame(SvcContext *svc_ctx) {
- SvcInternal *const si = get_svc_internal(svc_ctx);
- return svc_ctx->first_frame_full_size == 1 && si->encode_frame_count == 0;
-}
-
static void calculate_enc_frame_flags(SvcContext *svc_ctx) {
vpx_enc_frame_flags_t flags = VPX_EFLAG_FORCE_KF;
SvcInternal *const si = get_svc_internal(svc_ctx);
const int is_keyframe = (si->frame_within_gop == 0);
// keyframe layer zero is identical for all modes
- if ((is_keyframe && si->layer == 0) || vpx_svc_dummy_frame(svc_ctx)) {
+ if (is_keyframe && si->layer == 0) {
si->enc_frame_flags = VPX_EFLAG_FORCE_KF;
return;
}
@@ -699,7 +765,8 @@ static void set_svc_parameters(SvcContext *svc_ctx,
SvcInternal *const si = get_svc_internal(svc_ctx);
memset(&svc_params, 0, sizeof(svc_params));
- svc_params.layer = si->layer;
+ svc_params.temporal_layer = 0;
+ svc_params.spatial_layer = si->layer;
svc_params.flags = si->enc_frame_flags;
layer = si->layer;
@@ -716,8 +783,15 @@ static void set_svc_parameters(SvcContext *svc_ctx,
svc_log(svc_ctx, SVC_LOG_ERROR, "vpx_svc_get_layer_resolution failed\n");
}
layer_index = layer + VPX_SS_MAX_LAYERS - si->layers;
- svc_params.min_quantizer = si->quantizer[layer_index];
- svc_params.max_quantizer = si->quantizer[layer_index];
+
+ if (vpx_svc_is_keyframe(svc_ctx)) {
+ svc_params.min_quantizer = si->quantizer_keyframe[layer_index];
+ svc_params.max_quantizer = si->quantizer_keyframe[layer_index];
+ } else {
+ svc_params.min_quantizer = si->quantizer[layer_index];
+ svc_params.max_quantizer = si->quantizer[layer_index];
+ }
+
svc_params.distance_from_i_frame = si->frame_within_gop;
// Use buffer i for layer i LST
@@ -776,25 +850,28 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
struct LayerData *layer_data;
struct Superframe superframe;
SvcInternal *const si = get_svc_internal(svc_ctx);
- if (svc_ctx == NULL || codec_ctx == NULL || rawimg == NULL || si == NULL) {
+ if (svc_ctx == NULL || codec_ctx == NULL || si == NULL) {
return VPX_CODEC_INVALID_PARAM;
}
memset(&superframe, 0, sizeof(superframe));
svc_log_reset(svc_ctx);
+ si->rc_stats_buf_used = 0;
- si->layers = vpx_svc_dummy_frame(svc_ctx) ? 1 : svc_ctx->spatial_layers;
+ si->layers = svc_ctx->spatial_layers;
if (si->frame_within_gop >= si->kf_dist ||
- si->encode_frame_count == 0 ||
- (si->encode_frame_count == 1 && svc_ctx->first_frame_full_size == 1)) {
+ si->encode_frame_count == 0) {
si->frame_within_gop = 0;
}
si->is_keyframe = (si->frame_within_gop == 0);
si->frame_size = 0;
- svc_log(svc_ctx, SVC_LOG_DEBUG,
- "vpx_svc_encode layers: %d, frame_count: %d, frame_within_gop: %d\n",
- si->layers, si->encode_frame_count, si->frame_within_gop);
+ if (rawimg != NULL) {
+ svc_log(svc_ctx, SVC_LOG_DEBUG,
+ "vpx_svc_encode layers: %d, frame_count: %d, "
+ "frame_within_gop: %d\n", si->layers, si->encode_frame_count,
+ si->frame_within_gop);
+ }
// encode each layer
for (si->layer = 0; si->layer < si->layers; ++si->layer) {
@@ -803,14 +880,12 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
svc_log(svc_ctx, SVC_LOG_DEBUG, "Skip encoding layer %d\n", si->layer);
continue;
}
- calculate_enc_frame_flags(svc_ctx);
- if (vpx_svc_dummy_frame(svc_ctx)) {
- // do not set svc parameters, use normal encode
- svc_log(svc_ctx, SVC_LOG_DEBUG, "encoding full size first frame\n");
- } else {
+ if (rawimg != NULL) {
+ calculate_enc_frame_flags(svc_ctx);
set_svc_parameters(svc_ctx, codec_ctx);
}
+
res = vpx_codec_encode(codec_ctx, rawimg, pts, (uint32_t)duration,
si->enc_frame_flags, deadline);
if (res != VPX_CODEC_OK) {
@@ -822,17 +897,15 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
switch (cx_pkt->kind) {
case VPX_CODEC_CX_FRAME_PKT: {
const uint32_t frame_pkt_size = (uint32_t)(cx_pkt->data.frame.sz);
- if (!vpx_svc_dummy_frame(svc_ctx)) {
- si->bytes_in_layer[si->layer] += frame_pkt_size;
- svc_log(svc_ctx, SVC_LOG_DEBUG,
- "SVC frame: %d, layer: %d, size: %u\n",
- si->encode_frame_count, si->layer, frame_pkt_size);
- }
+ si->bytes_sum[si->layer] += frame_pkt_size;
+ svc_log(svc_ctx, SVC_LOG_DEBUG,
+ "SVC frame: %d, layer: %d, size: %u\n",
+ si->encode_frame_count, si->layer, frame_pkt_size);
layer_data =
ld_create(cx_pkt->data.frame.buf, (size_t)frame_pkt_size);
if (layer_data == NULL) {
svc_log(svc_ctx, SVC_LOG_ERROR, "Error allocating LayerData\n");
- return 0;
+ return VPX_CODEC_OK;
}
ld_list_add(&cx_layer_list, layer_data);
@@ -842,51 +915,82 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
break;
}
case VPX_CODEC_PSNR_PKT: {
- if (!vpx_svc_dummy_frame(svc_ctx)) {
- svc_log(svc_ctx, SVC_LOG_DEBUG,
- "SVC frame: %d, layer: %d, PSNR(Total/Y/U/V): "
- "%2.3f %2.3f %2.3f %2.3f \n",
- si->encode_frame_count, si->layer,
- cx_pkt->data.psnr.psnr[0], cx_pkt->data.psnr.psnr[1],
- cx_pkt->data.psnr.psnr[2], cx_pkt->data.psnr.psnr[3]);
- si->psnr_in_layer[si->layer] += cx_pkt->data.psnr.psnr[0];
+ int i;
+ svc_log(svc_ctx, SVC_LOG_DEBUG,
+ "SVC frame: %d, layer: %d, PSNR(Total/Y/U/V): "
+ "%2.3f %2.3f %2.3f %2.3f \n",
+ si->encode_frame_count, si->layer,
+ cx_pkt->data.psnr.psnr[0], cx_pkt->data.psnr.psnr[1],
+ cx_pkt->data.psnr.psnr[2], cx_pkt->data.psnr.psnr[3]);
+ svc_log(svc_ctx, SVC_LOG_DEBUG,
+ "SVC frame: %d, layer: %d, SSE(Total/Y/U/V): "
+ "%2.3f %2.3f %2.3f %2.3f \n",
+ si->encode_frame_count, si->layer,
+ cx_pkt->data.psnr.sse[0], cx_pkt->data.psnr.sse[1],
+ cx_pkt->data.psnr.sse[2], cx_pkt->data.psnr.sse[3]);
+ for (i = 0; i < COMPONENTS; i++) {
+ si->psnr_sum[si->layer][i] += cx_pkt->data.psnr.psnr[i];
+ si->sse_sum[si->layer][i] += cx_pkt->data.psnr.sse[i];
}
break;
}
+ case VPX_CODEC_STATS_PKT: {
+ size_t new_size = si->rc_stats_buf_used +
+ cx_pkt->data.twopass_stats.sz;
+
+ if (new_size > si->rc_stats_buf_size) {
+ char *p = (char*)realloc(si->rc_stats_buf, new_size);
+ if (p == NULL) {
+ svc_log(svc_ctx, SVC_LOG_ERROR, "Error allocating stats buf\n");
+ break;
+ }
+ si->rc_stats_buf = p;
+ si->rc_stats_buf_size = new_size;
+ }
+
+ memcpy(si->rc_stats_buf + si->rc_stats_buf_used,
+ cx_pkt->data.twopass_stats.buf, cx_pkt->data.twopass_stats.sz);
+ si->rc_stats_buf_used += cx_pkt->data.twopass_stats.sz;
+ break;
+ }
default: {
break;
}
}
}
+ if (rawimg == NULL) {
+ break;
+ }
}
- // add superframe index to layer data list
- if (!vpx_svc_dummy_frame(svc_ctx)) {
+ if (codec_ctx->config.enc->g_pass != VPX_RC_FIRST_PASS) {
+ // add superframe index to layer data list
sf_create_index(&superframe);
layer_data = ld_create(superframe.buffer, superframe.index_size);
ld_list_add(&cx_layer_list, layer_data);
- }
- // get accumulated size of layer data
- si->frame_size = ld_list_get_buffer_size(cx_layer_list);
- if (si->frame_size == 0) return VPX_CODEC_ERROR;
- // all layers encoded, create single buffer with concatenated layers
- if (si->frame_size > si->buffer_size) {
- free(si->buffer);
- si->buffer = malloc(si->frame_size);
- if (si->buffer == NULL) {
+ // get accumulated size of layer data
+ si->frame_size = ld_list_get_buffer_size(cx_layer_list);
+ if (si->frame_size > 0) {
+ // all layers encoded, create single buffer with concatenated layers
+ if (si->frame_size > si->buffer_size) {
+ free(si->buffer);
+ si->buffer = malloc(si->frame_size);
+ if (si->buffer == NULL) {
+ ld_list_free(cx_layer_list);
+ return VPX_CODEC_MEM_ERROR;
+ }
+ si->buffer_size = si->frame_size;
+ }
+ // copy layer data into packet
+ ld_list_copy_to_buffer(cx_layer_list, (uint8_t *)si->buffer);
+
ld_list_free(cx_layer_list);
- return VPX_CODEC_MEM_ERROR;
+
+ svc_log(svc_ctx, SVC_LOG_DEBUG, "SVC frame: %d, kf: %d, size: %d, "
+ "pts: %d\n", si->encode_frame_count, si->is_keyframe,
+ (int)si->frame_size, (int)pts);
}
- si->buffer_size = si->frame_size;
}
- // copy layer data into packet
- ld_list_copy_to_buffer(cx_layer_list, si->buffer);
-
- ld_list_free(cx_layer_list);
-
- svc_log(svc_ctx, SVC_LOG_DEBUG, "SVC frame: %d, kf: %d, size: %d, pts: %d\n",
- si->encode_frame_count, si->is_keyframe, (int)si->frame_size,
- (int)pts);
++si->frame_within_gop;
++si->encode_frame_count;
@@ -929,18 +1033,27 @@ void vpx_svc_set_keyframe(SvcContext *svc_ctx) {
si->frame_within_gop = 0;
}
+static double calc_psnr(double d) {
+ if (d == 0) return 100;
+ return -10.0 * log(d) / log(10.0);
+}
+
// dump accumulated statistics and reset accumulated values
const char *vpx_svc_dump_statistics(SvcContext *svc_ctx) {
int number_of_frames, number_of_keyframes, encode_frame_count;
- int i;
+ int i, j;
uint32_t bytes_total = 0;
+ double scale[COMPONENTS];
+ double psnr[COMPONENTS];
+ double mse[COMPONENTS];
+ double y_scale;
+
SvcInternal *const si = get_svc_internal(svc_ctx);
if (svc_ctx == NULL || si == NULL) return NULL;
svc_log_reset(svc_ctx);
encode_frame_count = si->encode_frame_count;
- if (svc_ctx->first_frame_full_size) encode_frame_count--;
if (si->encode_frame_count <= 0) return vpx_svc_get_message(svc_ctx);
svc_log(svc_ctx, SVC_LOG_INFO, "\n");
@@ -952,12 +1065,36 @@ const char *vpx_svc_dump_statistics(SvcContext *svc_ctx) {
(i == 1 || i == 3)) {
number_of_frames -= number_of_keyframes;
}
- svc_log(svc_ctx, SVC_LOG_INFO, "Layer %d PSNR=[%2.3f], Bytes=[%u]\n", i,
- (double)si->psnr_in_layer[i] / number_of_frames,
- si->bytes_in_layer[i]);
- bytes_total += si->bytes_in_layer[i];
- si->psnr_in_layer[i] = 0;
- si->bytes_in_layer[i] = 0;
+ svc_log(svc_ctx, SVC_LOG_INFO,
+ "Layer %d Average PSNR=[%2.3f, %2.3f, %2.3f, %2.3f], Bytes=[%u]\n",
+ i, (double)si->psnr_sum[i][0] / number_of_frames,
+ (double)si->psnr_sum[i][1] / number_of_frames,
+ (double)si->psnr_sum[i][2] / number_of_frames,
+ (double)si->psnr_sum[i][3] / number_of_frames, si->bytes_sum[i]);
+ // the following psnr calculation is deduced from ffmpeg.c#print_report
+ y_scale = si->width * si->height * 255.0 * 255.0 * number_of_frames;
+ scale[1] = y_scale;
+ scale[2] = scale[3] = y_scale / 4; // U or V
+ scale[0] = y_scale * 1.5; // total
+
+ for (j = 0; j < COMPONENTS; j++) {
+ psnr[j] = calc_psnr(si->sse_sum[i][j] / scale[j]);
+ mse[j] = si->sse_sum[i][j] * 255.0 * 255.0 / scale[j];
+ }
+ svc_log(svc_ctx, SVC_LOG_INFO,
+ "Layer %d Overall PSNR=[%2.3f, %2.3f, %2.3f, %2.3f]\n", i, psnr[0],
+ psnr[1], psnr[2], psnr[3]);
+ svc_log(svc_ctx, SVC_LOG_INFO,
+ "Layer %d Overall MSE=[%2.3f, %2.3f, %2.3f, %2.3f]\n", i, mse[0],
+ mse[1], mse[2], mse[3]);
+
+ bytes_total += si->bytes_sum[i];
+ // clear sums for next time
+ si->bytes_sum[i] = 0;
+ for (j = 0; j < COMPONENTS; ++j) {
+ si->psnr_sum[i][j] = 0;
+ si->sse_sum[i][j] = 0;
+ }
}
// only display statistics once
@@ -975,7 +1112,24 @@ void vpx_svc_release(SvcContext *svc_ctx) {
si = (SvcInternal *)svc_ctx->internal;
if (si != NULL) {
free(si->buffer);
+ if (si->rc_stats_buf) {
+ free(si->rc_stats_buf);
+ }
free(si);
svc_ctx->internal = NULL;
}
}
+
+size_t vpx_svc_get_rc_stats_buffer_size(const SvcContext *svc_ctx) {
+ const SvcInternal *const si = get_const_svc_internal(svc_ctx);
+ if (svc_ctx == NULL || si == NULL) return 0;
+ return si->rc_stats_buf_used;
+}
+
+char *vpx_svc_get_rc_stats_buffer(const SvcContext *svc_ctx) {
+ const SvcInternal *const si = get_const_svc_internal(svc_ctx);
+ if (svc_ctx == NULL || si == NULL) return NULL;
+ return si->rc_stats_buf;
+}
+
+
diff --git a/libvpx/vpx/src/vpx_decoder.c b/libvpx/vpx/src/vpx_decoder.c
index 1f575e0..63fdaf3 100644
--- a/libvpx/vpx/src/vpx_decoder.c
+++ b/libvpx/vpx/src/vpx_decoder.c
@@ -172,7 +172,7 @@ vpx_codec_err_t vpx_codec_register_put_slice_cb(vpx_codec_ctx_t *ctx
if (!ctx || !cb)
res = VPX_CODEC_INVALID_PARAM;
else if (!ctx->iface || !ctx->priv
- || !(ctx->iface->caps & VPX_CODEC_CAP_PUT_FRAME))
+ || !(ctx->iface->caps & VPX_CODEC_CAP_PUT_SLICE))
res = VPX_CODEC_ERROR;
else {
ctx->priv->dec.put_slice_cb.u.put_slice = cb;
@@ -226,3 +226,21 @@ vpx_codec_err_t vpx_codec_set_mem_map(vpx_codec_ctx_t *ctx,
return SAVE_STATUS(ctx, res);
}
+
+vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
+ vpx_codec_ctx_t *ctx, vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv) {
+ vpx_codec_err_t res;
+
+ if (!ctx || !cb_get || !cb_release) {
+ res = VPX_CODEC_INVALID_PARAM;
+ } else if (!ctx->iface || !ctx->priv ||
+ !(ctx->iface->caps & VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER)) {
+ res = VPX_CODEC_ERROR;
+ } else {
+ res = ctx->iface->dec.set_fb_fn(ctx->priv->alg_priv, cb_get, cb_release,
+ cb_priv);
+ }
+
+ return SAVE_STATUS(ctx, res);
+}
diff --git a/libvpx/vpx/src/vpx_encoder.c b/libvpx/vpx/src/vpx_encoder.c
index e0a29cb..ece2d0b 100644
--- a/libvpx/vpx/src/vpx_encoder.c
+++ b/libvpx/vpx/src/vpx_encoder.c
@@ -70,7 +70,7 @@ vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
vpx_codec_flags_t flags,
vpx_rational_t *dsf,
int ver) {
- vpx_codec_err_t res = 0;
+ vpx_codec_err_t res = VPX_CODEC_OK;
if (ver != VPX_ENCODER_ABI_VERSION)
res = VPX_CODEC_ABI_MISMATCH;
@@ -149,6 +149,7 @@ vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx,
cfg++;
dsf++;
}
+ ctx--;
}
}
@@ -206,7 +207,7 @@ vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
unsigned long duration,
vpx_enc_frame_flags_t flags,
unsigned long deadline) {
- vpx_codec_err_t res = 0;
+ vpx_codec_err_t res = VPX_CODEC_OK;
if (!ctx || (img && !duration))
res = VPX_CODEC_INVALID_PARAM;
@@ -254,8 +255,8 @@ vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
}
-const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
- vpx_codec_iter_t *iter) {
+const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
+ vpx_codec_iter_t *iter) {
const vpx_codec_cx_pkt_t *pkt = NULL;
if (ctx) {
@@ -270,32 +271,30 @@ const vpx_codec_cx_pkt_t *vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx,
}
if (pkt && pkt->kind == VPX_CODEC_CX_FRAME_PKT) {
- /* If the application has specified a destination area for the
- * compressed data, and the codec has not placed the data there,
- * and it fits, copy it.
- */
- char *dst_buf = ctx->priv->enc.cx_data_dst_buf.buf;
-
- if (dst_buf
- && pkt->data.raw.buf != dst_buf
- && pkt->data.raw.sz
- + ctx->priv->enc.cx_data_pad_before
- + ctx->priv->enc.cx_data_pad_after
- <= ctx->priv->enc.cx_data_dst_buf.sz) {
- vpx_codec_cx_pkt_t *modified_pkt = &ctx->priv->enc.cx_data_pkt;
-
- memcpy(dst_buf + ctx->priv->enc.cx_data_pad_before,
- pkt->data.raw.buf, pkt->data.raw.sz);
+ // If the application has specified a destination area for the
+ // compressed data, and the codec has not placed the data there,
+ // and it fits, copy it.
+ vpx_codec_priv_t *const priv = ctx->priv;
+ char *const dst_buf = (char *)priv->enc.cx_data_dst_buf.buf;
+
+ if (dst_buf &&
+ pkt->data.raw.buf != dst_buf &&
+ pkt->data.raw.sz + priv->enc.cx_data_pad_before +
+ priv->enc.cx_data_pad_after <= priv->enc.cx_data_dst_buf.sz) {
+ vpx_codec_cx_pkt_t *modified_pkt = &priv->enc.cx_data_pkt;
+
+ memcpy(dst_buf + priv->enc.cx_data_pad_before, pkt->data.raw.buf,
+ pkt->data.raw.sz);
*modified_pkt = *pkt;
modified_pkt->data.raw.buf = dst_buf;
- modified_pkt->data.raw.sz += ctx->priv->enc.cx_data_pad_before
- + ctx->priv->enc.cx_data_pad_after;
+ modified_pkt->data.raw.sz += priv->enc.cx_data_pad_before +
+ priv->enc.cx_data_pad_after;
pkt = modified_pkt;
}
if (dst_buf == pkt->data.raw.buf) {
- ctx->priv->enc.cx_data_dst_buf.buf = dst_buf + pkt->data.raw.sz;
- ctx->priv->enc.cx_data_dst_buf.sz -= pkt->data.raw.sz;
+ priv->enc.cx_data_dst_buf.buf = dst_buf + pkt->data.raw.sz;
+ priv->enc.cx_data_dst_buf.sz -= pkt->data.raw.sz;
}
}
@@ -395,7 +394,7 @@ const vpx_codec_cx_pkt_t *vpx_codec_pkt_list_get(struct vpx_codec_pkt_list *list
*iter = list->pkts;
}
- pkt = (const void *) * iter;
+ pkt = (const vpx_codec_cx_pkt_t *)*iter;
if ((size_t)(pkt - list->pkts) < list->cnt)
*iter = pkt + 1;
diff --git a/libvpx/vpx/src/vpx_psnr.c b/libvpx/vpx/src/vpx_psnr.c
new file mode 100644
index 0000000..05843ac
--- /dev/null
+++ b/libvpx/vpx/src/vpx_psnr.c
@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <math.h>
+
+#include "vpx/internal/vpx_psnr.h"
+
+#define MAX_PSNR 100.0
+
+double vpx_sse_to_psnr(double samples, double peak, double sse) {
+ if (sse > 0.0) {
+ const double psnr = 10.0 * log10(samples * peak * peak / sse);
+ return psnr > MAX_PSNR ? MAX_PSNR : psnr;
+ } else {
+ return MAX_PSNR;
+ }
+}
diff --git a/libvpx/vpx/svc_context.h b/libvpx/vpx/svc_context.h
index f4933f8..5d0fbbd 100644
--- a/libvpx/vpx/svc_context.h
+++ b/libvpx/vpx/svc_context.h
@@ -16,8 +16,8 @@
#ifndef VPX_SVC_CONTEXT_H_
#define VPX_SVC_CONTEXT_H_
-#include "vpx/vp8cx.h"
-#include "vpx/vpx_encoder.h"
+#include "./vp8cx.h"
+#include "./vpx_encoder.h"
#ifdef __cplusplus
extern "C" {
@@ -39,7 +39,6 @@ typedef enum SVC_LOG_LEVEL {
typedef struct {
// public interface to svc_command options
int spatial_layers; // number of layers
- int first_frame_full_size; // set to one to force first frame full size
SVC_ENCODING_MODE encoding_mode; // svc encoding strategy
SVC_LOG_LEVEL log_level; // amount of information to display
int log_print; // when set, printf log messages instead of returning the
@@ -65,7 +64,8 @@ vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options);
* e.g., "60,53,39,33,27"
*/
vpx_codec_err_t vpx_svc_set_quantizers(SvcContext *svc_ctx,
- const char *quantizer_values);
+ const char *quantizer_values,
+ const int is_for_keyframe);
/**
* Set SVC scale factors
@@ -114,6 +114,17 @@ size_t vpx_svc_get_frame_size(const SvcContext *svc_ctx);
void *vpx_svc_get_buffer(const SvcContext *svc_ctx);
/**
+ * return size of two pass rate control stats data to be returned by
+ * vpx_svc_get_rc_stats_buffer
+ */
+size_t vpx_svc_get_rc_stats_buffer_size(const SvcContext *svc_ctx);
+
+/**
+ * return buffer two pass of rate control stats data
+ */
+char *vpx_svc_get_rc_stats_buffer(const SvcContext *svc_ctx);
+
+/**
* return spatial resolution of the specified layer
*/
vpx_codec_err_t vpx_svc_get_layer_resolution(const SvcContext *svc_ctx,
@@ -139,4 +150,4 @@ void vpx_svc_set_keyframe(SvcContext *svc_ctx);
} // extern "C"
#endif
-#endif /* VPX_SVC_CONTEXT_H_ */
+#endif // VPX_SVC_CONTEXT_H_
diff --git a/libvpx/vpx/vp8.h b/libvpx/vpx/vp8.h
index 056fa7a..2a31af6 100644
--- a/libvpx/vpx/vp8.h
+++ b/libvpx/vpx/vp8.h
@@ -27,8 +27,8 @@
/*!\file
* \brief Provides controls common to both the VP8 encoder and decoder.
*/
-#ifndef VP8_H
-#define VP8_H
+#ifndef VPX_VP8_H_
+#define VPX_VP8_H_
#include "./vpx_codec.h"
#include "./vpx_image.h"
@@ -135,4 +135,4 @@ VPX_CTRL_USE_TYPE(VP9_GET_REFERENCE, vp9_ref_frame_t *)
} // extern "C"
#endif
-#endif
+#endif // VPX_VP8_H_
diff --git a/libvpx/vpx/vp8cx.h b/libvpx/vpx/vp8cx.h
index 433cc0d..0b637d4 100644
--- a/libvpx/vpx/vp8cx.h
+++ b/libvpx/vpx/vp8cx.h
@@ -7,15 +7,15 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VP8CX_H
-#define VP8CX_H
+#ifndef VPX_VP8CX_H_
+#define VPX_VP8CX_H_
/*!\defgroup vp8_encoder WebM VP8 Encoder
* \ingroup vp8
*
* @{
*/
-#include "vp8.h"
+#include "./vp8.h"
/*!\file
* \brief Provides definitions for using the VP8 encoder algorithm within the
@@ -38,8 +38,6 @@ extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
/* TODO(jkoleszar): These move to VP9 in a later patch set. */
extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
-extern vpx_codec_iface_t vpx_codec_vp9x_cx_algo;
-extern vpx_codec_iface_t *vpx_codec_vp9x_cx(void);
/*!@} - end algorithm interface member group*/
@@ -193,9 +191,16 @@ enum vp8e_enc_control_id {
VP9E_SET_TILE_COLUMNS,
VP9E_SET_TILE_ROWS,
VP9E_SET_FRAME_PARALLEL_DECODING,
+ VP9E_SET_AQ_MODE,
VP9E_SET_SVC,
- VP9E_SET_SVC_PARAMETERS
+ VP9E_SET_SVC_PARAMETERS,
+ /*!\brief control function to set svc layer for spatial and temporal.
+ * \note Valid ranges: 0..#vpx_codec_enc_cfg::ss_number_layers for spatial
+ * layer and 0..#vpx_codec_enc_cfg::ts_number_layers for
+ * temporal layer.
+ */
+ VP9E_SET_SVC_LAYER_ID
};
/*!\brief vpx 1-D scaling mode
@@ -256,7 +261,7 @@ typedef struct vpx_scaling_mode {
/*!\brief VP8 token partition mode
*
* This defines VP8 partitioning mode for compressed data, i.e., the number of
- * sub-streams in the bitstream. Used for parallelized decoding.
+ * sub-streams in the bitstream. Used for parallelized decoding.
*
*/
@@ -286,7 +291,8 @@ typedef enum {
typedef struct vpx_svc_parameters {
unsigned int width; /**< width of current spatial layer */
unsigned int height; /**< height of current spatial layer */
- int layer; /**< current layer number - 0 = base */
+ int spatial_layer; /**< current spatial layer number - 0 = base */
+ int temporal_layer; /**< current temporal layer number - 0 = base */
int flags; /**< encode frame flags */
int max_quantizer; /**< max quantizer for current layer */
int min_quantizer; /**< min quantizer for current layer */
@@ -296,6 +302,18 @@ typedef struct vpx_svc_parameters {
int alt_fb_idx; /**< alt reference frame frame buffer index */
} vpx_svc_parameters_t;
+/*!\brief vp9 svc layer parameters
+ *
+ * This defines the spatial and temporal layer id numbers for svc encoding.
+ * This is used with the #VP9E_SET_SVC_LAYER_ID control to set the spatial and
+ * temporal layer id for the current frame.
+ *
+ */
+typedef struct vpx_svc_layer_id {
+ int spatial_layer_id; /**< Spatial layer id number. */
+ int temporal_layer_id; /**< Temporal layer id number. */
+} vpx_svc_layer_id_t;
+
/*!\brief VP8 encoder control function parameter type
*
* Defines the data types that VP8E control functions take. Note that
@@ -317,6 +335,7 @@ VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, vpx_svc_parameters_t *)
+VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
@@ -343,9 +362,11 @@ VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int)
VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
+
/*! @} - end defgroup vp8_encoder */
#ifdef __cplusplus
} // extern "C"
#endif
-#endif
+#endif // VPX_VP8CX_H_
diff --git a/libvpx/vpx/vp8dx.h b/libvpx/vpx/vp8dx.h
index d3093c4..bde77c2 100644
--- a/libvpx/vpx/vp8dx.h
+++ b/libvpx/vpx/vp8dx.h
@@ -9,8 +9,6 @@
*/
-#include "vp8.h"
-
/*!\defgroup vp8_decoder WebM VP8 Decoder
* \ingroup vp8
*
@@ -20,13 +18,16 @@
* \brief Provides definitions for using the VP8 algorithm within the vpx Decoder
* interface.
*/
-#ifndef VP8DX_H
-#define VP8DX_H
+#ifndef VPX_VP8DX_H_
+#define VPX_VP8DX_H_
#ifdef __cplusplus
extern "C" {
#endif
+/* Include controls common to both the encoder and decoder */
+#include "./vp8.h"
+
/*!\name Algorithm interface for VP8
*
* This interface provides the capability to decode raw VP8 streams, as would
@@ -41,9 +42,6 @@ extern vpx_codec_iface_t vpx_codec_vp9_dx_algo;
extern vpx_codec_iface_t *vpx_codec_vp9_dx(void);
/*!@} - end algorithm interface member group*/
-/* Include controls common to both the encoder and decoder */
-#include "vp8.h"
-
/*!\enum vp8_dec_control_id
* \brief VP8 decoder control functions
@@ -73,6 +71,9 @@ enum vp8_dec_control_id {
*/
VP8D_SET_DECRYPTOR,
+ /** control function to get the display dimensions for the current frame. */
+ VP9D_GET_DISPLAY_SIZE,
+
/** For testing. */
VP9_INVERT_TILE_DECODE_ORDER,
@@ -105,6 +106,7 @@ VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_UPDATES, int *)
VPX_CTRL_USE_TYPE(VP8D_GET_FRAME_CORRUPTED, int *)
VPX_CTRL_USE_TYPE(VP8D_GET_LAST_REF_USED, int *)
VPX_CTRL_USE_TYPE(VP8D_SET_DECRYPTOR, vp8_decrypt_init *)
+VPX_CTRL_USE_TYPE(VP9D_GET_DISPLAY_SIZE, int *)
VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int)
/*! @} - end defgroup vp8_decoder */
@@ -113,4 +115,4 @@ VPX_CTRL_USE_TYPE(VP9_INVERT_TILE_DECODE_ORDER, int)
} // extern "C"
#endif
-#endif
+#endif // VPX_VP8DX_H_
diff --git a/libvpx/vpx/vpx_codec.h b/libvpx/vpx/vpx_codec.h
index 3ea36d6..03d2dec 100644
--- a/libvpx/vpx/vpx_codec.h
+++ b/libvpx/vpx/vpx_codec.h
@@ -36,15 +36,15 @@
* Once initialized, the instance is manged using other functions from
* the vpx_codec_* family.
*/
-#ifndef VPX_CODEC_H
-#define VPX_CODEC_H
+#ifndef VPX_VPX_CODEC_H_
+#define VPX_VPX_CODEC_H_
#ifdef __cplusplus
extern "C" {
#endif
-#include "vpx_integer.h"
-#include "vpx_image.h"
+#include "./vpx_integer.h"
+#include "./vpx_image.h"
/*!\brief Decorator indicating a function is deprecated */
#ifndef DEPRECATED
@@ -554,5 +554,5 @@ extern "C" {
#ifdef __cplusplus
}
#endif
-#endif
+#endif // VPX_VPX_CODEC_H_
diff --git a/libvpx/vpx/vpx_codec.mk b/libvpx/vpx/vpx_codec.mk
index 549c249..98d1d56 100644
--- a/libvpx/vpx/vpx_codec.mk
+++ b/libvpx/vpx/vpx_codec.mk
@@ -26,6 +26,7 @@ API_DOC_SRCS-$(CONFIG_VP8_DECODER) += vp8dx.h
API_DOC_SRCS-yes += vpx_codec.h
API_DOC_SRCS-yes += vpx_decoder.h
API_DOC_SRCS-yes += vpx_encoder.h
+API_DOC_SRCS-yes += vpx_frame_buffer.h
API_DOC_SRCS-yes += vpx_image.h
API_SRCS-yes += src/vpx_decoder.c
@@ -33,9 +34,12 @@ API_SRCS-yes += vpx_decoder.h
API_SRCS-yes += src/vpx_encoder.c
API_SRCS-yes += vpx_encoder.h
API_SRCS-yes += internal/vpx_codec_internal.h
+API_SRCS-yes += internal/vpx_psnr.h
API_SRCS-yes += src/vpx_codec.c
API_SRCS-yes += src/vpx_image.c
+API_SRCS-yes += src/vpx_psnr.c
API_SRCS-yes += vpx_codec.h
API_SRCS-yes += vpx_codec.mk
+API_SRCS-yes += vpx_frame_buffer.h
API_SRCS-yes += vpx_image.h
API_SRCS-$(BUILD_LIBVPX) += vpx_integer.h
diff --git a/libvpx/vpx/vpx_decoder.h b/libvpx/vpx/vpx_decoder.h
index 2dcd024..ba18328 100644
--- a/libvpx/vpx/vpx_decoder.h
+++ b/libvpx/vpx/vpx_decoder.h
@@ -7,8 +7,8 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VPX_DECODER_H
-#define VPX_DECODER_H
+#ifndef VPX_VPX_DECODER_H_
+#define VPX_VPX_DECODER_H_
/*!\defgroup decoder Decoder Algorithm Interface
* \ingroup codec
@@ -29,7 +29,8 @@
extern "C" {
#endif
-#include "vpx_codec.h"
+#include "./vpx_codec.h"
+#include "./vpx_frame_buffer.h"
/*!\brief Current ABI version number
*
@@ -39,7 +40,7 @@ extern "C" {
* types, removing or reassigning enums, adding/removing/rearranging
* fields to structures
*/
-#define VPX_DECODER_ABI_VERSION (2 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
+#define VPX_DECODER_ABI_VERSION (3 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer*/
/*! \brief Decoder capabilities bitfield
*
@@ -66,6 +67,8 @@ extern "C" {
*/
#define VPX_CODEC_CAP_FRAME_THREADING 0x200000 /**< Can support frame-based
multi-threading */
+#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /**< Can support external
+ frame buffers */
#define VPX_CODEC_USE_POSTPROC 0x10000 /**< Postprocess decoded frame */
#define VPX_CODEC_USE_ERROR_CONCEALMENT 0x20000 /**< Conceal errors in decoded
@@ -326,9 +329,54 @@ extern "C" {
/*!@} - end defgroup cap_put_slice*/
+ /*!\defgroup cap_external_frame_buffer External Frame Buffer Functions
+ *
+ * The following section is required to be implemented for all decoders
+ * that advertise the VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER capability.
+ * Calling this function for codecs that don't advertise this capability
+ * will result in an error code being returned, usually VPX_CODEC_ERROR.
+ *
+ * \note
+ * Currently this only works with VP9.
+ * @{
+ */
+
+ /*!\brief Pass in external frame buffers for the decoder to use.
+ *
+ * Registers functions to be called when libvpx needs a frame buffer
+ * to decode the current frame and a function to be called when libvpx does
+ * not internally reference the frame buffer. This set function must
+ * be called before the first call to decode or libvpx will assume the
+ * default behavior of allocating frame buffers internally.
+ *
+ * \param[in] ctx Pointer to this instance's context
+ * \param[in] cb_get Pointer to the get callback function
+ * \param[in] cb_release Pointer to the release callback function
+ * \param[in] cb_priv Callback's private data
+ *
+ * \retval #VPX_CODEC_OK
+ * External frame buffers will be used by libvpx.
+ * \retval #VPX_CODEC_INVALID_PARAM
+ * One or more of the callbacks were NULL.
+ * \retval #VPX_CODEC_ERROR
+ * Decoder context not initialized, or algorithm not capable of
+ * using external frame buffers.
+ *
+ * \note
+ * When decoding VP9, the application may be required to pass in at least
+ * #VP9_MAXIMUM_REF_BUFFERS + #VPX_MAXIMUM_WORK_BUFFERS external frame
+ * buffers.
+ */
+ vpx_codec_err_t vpx_codec_set_frame_buffer_functions(
+ vpx_codec_ctx_t *ctx,
+ vpx_get_frame_buffer_cb_fn_t cb_get,
+ vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv);
+
+ /*!@} - end defgroup cap_external_frame_buffer */
+
/*!@} - end defgroup decoder*/
#ifdef __cplusplus
}
#endif
-#endif
+#endif // VPX_VPX_DECODER_H_
diff --git a/libvpx/vpx/vpx_encoder.h b/libvpx/vpx/vpx_encoder.h
index 56752cf..2c882c1 100644
--- a/libvpx/vpx/vpx_encoder.h
+++ b/libvpx/vpx/vpx_encoder.h
@@ -7,8 +7,8 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VPX_ENCODER_H
-#define VPX_ENCODER_H
+#ifndef VPX_VPX_ENCODER_H_
+#define VPX_VPX_ENCODER_H_
/*!\defgroup encoder Encoder Algorithm Interface
* \ingroup codec
@@ -29,7 +29,7 @@
extern "C" {
#endif
-#include "vpx_codec.h"
+#include "./vpx_codec.h"
/*! Temporal Scalability: Maximum length of the sequence defining frame
* layer membership
@@ -49,7 +49,7 @@ extern "C" {
#define VPX_SS_MAX_LAYERS 5
/*! Spatial Scalability: Default number of coding layers */
-#define VPX_SS_DEFAULT_LAYERS 3
+#define VPX_SS_DEFAULT_LAYERS 1
/*!\brief Current ABI version number
*
@@ -604,47 +604,55 @@ extern "C" {
* Spatial scalability settings (ss)
*/
- /*!\brief Number of coding layers (spatial)
+ /*!\brief Number of spatial coding layers.
*
- * This value specifies the number of coding layers to be used.
+ * This value specifies the number of spatial coding layers to be used.
*/
unsigned int ss_number_layers;
- /*!\brief Number of coding layers
+ /*!\brief Target bitrate for each spatial layer.
*
- * This value specifies the number of coding layers to be used.
+ * These values specify the target coding bitrate to be used for each
+ * spatial layer.
+ */
+ unsigned int ss_target_bitrate[VPX_SS_MAX_LAYERS];
+
+ /*!\brief Number of temporal coding layers.
+ *
+ * This value specifies the number of temporal layers to be used.
*/
unsigned int ts_number_layers;
- /*!\brief Target bitrate for each layer
+ /*!\brief Target bitrate for each temporal layer.
*
- * These values specify the target coding bitrate for each coding layer.
+ * These values specify the target coding bitrate to be used for each
+ * temporal layer.
*/
unsigned int ts_target_bitrate[VPX_TS_MAX_LAYERS];
- /*!\brief Frame rate decimation factor for each layer
+ /*!\brief Frame rate decimation factor for each temporal layer.
*
* These values specify the frame rate decimation factors to apply
- * to each layer.
+ * to each temporal layer.
*/
unsigned int ts_rate_decimator[VPX_TS_MAX_LAYERS];
- /*!\brief Length of the sequence defining frame layer membership
+ /*!\brief Length of the sequence defining frame temporal layer membership.
*
* This value specifies the length of the sequence that defines the
- * membership of frames to layers. For example, if ts_periodicity=8 then
- * frames are assigned to coding layers with a repeated sequence of
- * length 8.
- */
+ * membership of frames to temporal layers. For example, if the
+ * ts_periodicity = 8, then the frames are assigned to coding layers with a
+ * repeated sequence of length 8.
+ */
unsigned int ts_periodicity;
- /*!\brief Template defining the membership of frames to coding layers
+ /*!\brief Template defining the membership of frames to temporal layers.
*
- * This array defines the membership of frames to coding layers. For a
- * 2-layer encoding that assigns even numbered frames to one layer (0)
- * and odd numbered frames to a second layer (1) with ts_periodicity=8,
- * then ts_layer_id = (0,1,0,1,0,1,0,1).
- */
+ * This array defines the membership of frames to temporal coding layers.
+ * For a 2-layer encoding that assigns even numbered frames to one temporal
+ * layer (0) and odd numbered frames to a second temporal layer (1) with
+ * ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1).
+ */
unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
} vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
@@ -932,5 +940,5 @@ extern "C" {
#ifdef __cplusplus
}
#endif
-#endif
+#endif // VPX_VPX_ENCODER_H_
diff --git a/libvpx/vpx/vpx_frame_buffer.h b/libvpx/vpx/vpx_frame_buffer.h
new file mode 100644
index 0000000..e69df4b
--- /dev/null
+++ b/libvpx/vpx/vpx_frame_buffer.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VPX_VPX_FRAME_BUFFER_H_
+#define VPX_VPX_FRAME_BUFFER_H_
+
+/*!\file
+ * \brief Describes the decoder external frame buffer interface.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "./vpx_integer.h"
+
+/*!\brief The maximum number of work buffers used by libvpx.
+ */
+#define VPX_MAXIMUM_WORK_BUFFERS 1
+
+/*!\brief The maximum number of reference buffers that a VP9 encoder may use.
+ */
+#define VP9_MAXIMUM_REF_BUFFERS 8
+
+/*!\brief External frame buffer
+ *
+ * This structure holds allocated frame buffers used by the decoder.
+ */
+typedef struct vpx_codec_frame_buffer {
+ uint8_t *data; /**< Pointer to the data buffer */
+ size_t size; /**< Size of data in bytes */
+ void *priv; /**< Frame's private data */
+} vpx_codec_frame_buffer_t;
+
+/*!\brief get frame buffer callback prototype
+ *
+ * This callback is invoked by the decoder to retrieve data for the frame
+ * buffer in order for the decode call to complete. The callback must
+ * allocate at least min_size in bytes and assign it to fb->data. Then the
+ * callback must set fb->size to the allocated size. The application does not
+ * need to align the allocated data. The callback is triggered when the
+ * decoder needs a frame buffer to decode a compressed image into. This
+ * function may be called more than once for every call to vpx_codec_decode.
+ * The application may set fb->priv to some data which will be passed
+ * back in the ximage and the release function call. |fb| is guaranteed to
+ * not be NULL. On success the callback must return 0. Any failure the
+ * callback must return a value less than 0.
+ *
+ * \param[in] priv Callback's private data
+ * \param[in] new_size Size in bytes needed by the buffer
+ * \param[in,out] fb Pointer to vpx_codec_frame_buffer_t
+ */
+typedef int (*vpx_get_frame_buffer_cb_fn_t)(
+ void *priv, size_t min_size, vpx_codec_frame_buffer_t *fb);
+
+/*!\brief release frame buffer callback prototype
+ *
+ * This callback is invoked by the decoder when the frame buffer is not
+ * referenced by any other buffers. |fb| is guaranteed to not be NULL. On
+ * success the callback must return 0. Any failure the callback must return
+ * a value less than 0.
+ *
+ * \param[in] priv Callback's private data
+ * \param[in] fb Pointer to vpx_codec_frame_buffer_t
+ */
+typedef int (*vpx_release_frame_buffer_cb_fn_t)(
+ void *priv, vpx_codec_frame_buffer_t *fb);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VPX_VPX_FRAME_BUFFER_H_
diff --git a/libvpx/vpx/vpx_image.h b/libvpx/vpx/vpx_image.h
index c304bac..8d0f4ec 100644
--- a/libvpx/vpx/vpx_image.h
+++ b/libvpx/vpx/vpx_image.h
@@ -13,13 +13,13 @@
* \brief Describes the vpx image descriptor and associated operations
*
*/
+#ifndef VPX_VPX_IMAGE_H_
+#define VPX_VPX_IMAGE_H_
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef VPX_IMAGE_H
-#define VPX_IMAGE_H
-
/*!\brief Current ABI version number
*
* \internal
@@ -28,7 +28,7 @@ extern "C" {
* types, removing or reassigning enums, adding/removing/rearranging
* fields to structures
*/
-#define VPX_IMAGE_ABI_VERSION (1) /**<\hideinitializer*/
+#define VPX_IMAGE_ABI_VERSION (2) /**<\hideinitializer*/
#define VPX_IMG_FMT_PLANAR 0x100 /**< Image is a planar format */
@@ -139,6 +139,8 @@ extern "C" {
unsigned char *img_data; /**< private */
int img_data_owner; /**< private */
int self_allocd; /**< private */
+
+ void *fb_priv; /**< Frame buffer data associated with the image. */
} vpx_image_t; /**< alias for struct vpx_image */
/**\brief Representation of a rectangle on a surface */
@@ -237,7 +239,8 @@ extern "C" {
*/
void vpx_img_free(vpx_image_t *img);
-#endif
#ifdef __cplusplus
-}
+} // extern "C"
#endif
+
+#endif // VPX_VPX_IMAGE_H_
diff --git a/libvpx/vpx/vpx_integer.h b/libvpx/vpx/vpx_integer.h
index 0ccc96c..258618b 100644
--- a/libvpx/vpx/vpx_integer.h
+++ b/libvpx/vpx/vpx_integer.h
@@ -9,8 +9,8 @@
*/
-#ifndef VPX_INTEGER_H
-#define VPX_INTEGER_H
+#ifndef VPX_VPX_INTEGER_H_
+#define VPX_VPX_INTEGER_H_
/* get ptrdiff_t, size_t, wchar_t, NULL */
#include <stddef.h>
@@ -48,10 +48,10 @@ typedef size_t uintptr_t;
#endif
/* VS2010 defines stdint.h, but not inttypes.h */
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && _MSC_VER < 1800
#define PRId64 "I64d"
#else
#include <inttypes.h>
#endif
-#endif
+#endif // VPX_VPX_INTEGER_H_
diff --git a/libvpx/vpx_mem/include/vpx_mem_intrnl.h b/libvpx/vpx_mem/include/vpx_mem_intrnl.h
index 2248ad5..225a3ba 100644
--- a/libvpx/vpx_mem/include/vpx_mem_intrnl.h
+++ b/libvpx/vpx_mem/include/vpx_mem_intrnl.h
@@ -9,8 +9,8 @@
*/
-#ifndef __VPX_MEM_INTRNL_H__
-#define __VPX_MEM_INTRNL_H__
+#ifndef VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
+#define VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
#include "./vpx_config.h"
#ifndef CONFIG_MEM_MANAGER
@@ -92,4 +92,4 @@ this should be a multiple of 4*/
/*returns an addr aligned to the byte boundary specified by align*/
#define align_addr(addr,align) (void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align))
-#endif /*__VPX_MEM_INTRNL_H__*/
+#endif // VPX_MEM_INCLUDE_VPX_MEM_INTRNL_H_
diff --git a/libvpx/vpx_mem/include/vpx_mem_tracker.h b/libvpx/vpx_mem/include/vpx_mem_tracker.h
index 3be0d2d..1335e00 100644
--- a/libvpx/vpx_mem/include/vpx_mem_tracker.h
+++ b/libvpx/vpx_mem/include/vpx_mem_tracker.h
@@ -9,8 +9,8 @@
*/
-#ifndef __VPX_MEM_TRACKER_H__
-#define __VPX_MEM_TRACKER_H__
+#ifndef VPX_MEM_INCLUDE_VPX_MEM_TRACKER_H_
+#define VPX_MEM_INCLUDE_VPX_MEM_TRACKER_H_
/* vpx_mem_tracker version info */
#define vpx_mem_tracker_version "2.5.1.1"
@@ -176,4 +176,4 @@ extern "C" {
}
#endif
-#endif // __VPX_MEM_TRACKER_H__
+#endif // VPX_MEM_INCLUDE_VPX_MEM_TRACKER_H_
diff --git a/libvpx/vpx_mem/memory_manager/include/cavl_if.h b/libvpx/vpx_mem/memory_manager/include/cavl_if.h
index ec6e525..a5ced8b 100644
--- a/libvpx/vpx_mem/memory_manager/include/cavl_if.h
+++ b/libvpx/vpx_mem/memory_manager/include/cavl_if.h
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IF_H_
+#define VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IF_H_
/* Abstract AVL Tree Generic C Package.
** Interface generation header file.
@@ -222,3 +224,5 @@ L_SC void L_(init_iter)(L_(iter) *iter);
#undef L_SC
#undef L_LONG_BIT
#undef L_BIT_ARR_DEFN
+
+#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IF_H_
diff --git a/libvpx/vpx_mem/memory_manager/include/cavl_impl.h b/libvpx/vpx_mem/memory_manager/include/cavl_impl.h
index cf7deb7..8b9ae27 100644
--- a/libvpx/vpx_mem/memory_manager/include/cavl_impl.h
+++ b/libvpx/vpx_mem/memory_manager/include/cavl_impl.h
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IMPL_H_
+#define VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IMPL_H_
/* Abstract AVL Tree Generic C Package.
** Implementation generation header file.
@@ -1146,3 +1148,5 @@ L_SC void L_(decr_iter)(L_(iter) *iter) {
#undef L_SC
#undef L_BALANCE_PARAM_CALL_PREFIX
#undef L_BALANCE_PARAM_DECL_PREFIX
+
+#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_CAVL_IMPL_H_
diff --git a/libvpx/vpx_mem/memory_manager/include/heapmm.h b/libvpx/vpx_mem/memory_manager/include/heapmm.h
index 4934c2d..d584b19 100644
--- a/libvpx/vpx_mem/memory_manager/include/heapmm.h
+++ b/libvpx/vpx_mem/memory_manager/include/heapmm.h
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_HEAPMM_H_
+#define VPX_MEM_MEMORY_MANAGER_INCLUDE_HEAPMM_H_
/* This code is in the public domain.
** Version: 1.1 Author: Walt Karas
@@ -150,3 +152,4 @@ void HMM_UNIQUE(shrink_chunk)(
HMM_UNIQUE(size_bau) num_block_align_units);
#endif /* defined HMM_PROCESS */
+#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_HEAPMM_H_
diff --git a/libvpx/vpx_mem/memory_manager/include/hmm_cnfg.h b/libvpx/vpx_mem/memory_manager/include/hmm_cnfg.h
index 2c3391d..caa8713 100644
--- a/libvpx/vpx_mem/memory_manager/include/hmm_cnfg.h
+++ b/libvpx/vpx_mem/memory_manager/include/hmm_cnfg.h
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_CNFG_H_
+#define VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_CNFG_H_
/* This code is in the public domain.
** Version: 1.1 Author: Walt Karas
@@ -114,3 +116,5 @@ extern unsigned HMM_UNIQUE(fail_line);
/* Put configuration 5 definitions here. */
#endif
+
+#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_CNFG_H_
diff --git a/libvpx/vpx_mem/memory_manager/include/hmm_intrnl.h b/libvpx/vpx_mem/memory_manager/include/hmm_intrnl.h
index 27cefe4..7302aa2 100644
--- a/libvpx/vpx_mem/memory_manager/include/hmm_intrnl.h
+++ b/libvpx/vpx_mem/memory_manager/include/hmm_intrnl.h
@@ -13,8 +13,8 @@
** Version: 1.1 Author: Walt Karas
*/
-#ifndef HMM_INTRNL_H_
-#define HMM_INTRNL_H_
+#ifndef VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_INTRNL_H_
+#define VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_INTRNL_H_
#ifdef __uClinux__
# include <lddk.h>
@@ -156,4 +156,4 @@ int U(audit_block_fail_dummy_return)(void);
#include "cavl_if.h"
-#endif /* Include once. */
+#endif // VPX_MEM_MEMORY_MANAGER_INCLUDE_HMM_INTRNL_H_
diff --git a/libvpx/vpx_mem/vpx_mem.h b/libvpx/vpx_mem/vpx_mem.h
index c7321a9..33686b2 100644
--- a/libvpx/vpx_mem/vpx_mem.h
+++ b/libvpx/vpx_mem/vpx_mem.h
@@ -9,8 +9,8 @@
*/
-#ifndef __VPX_MEM_H__
-#define __VPX_MEM_H__
+#ifndef VPX_MEM_VPX_MEM_H_
+#define VPX_MEM_VPX_MEM_H_
#include "vpx_config.h"
#if defined(__uClinux__)
@@ -170,4 +170,4 @@ extern "C" {
}
#endif
-#endif /* __VPX_MEM_H__ */
+#endif // VPX_MEM_VPX_MEM_H_
diff --git a/libvpx/vpx_ports/arm.h b/libvpx/vpx_ports/arm.h
index 525a764..1e4a8e2 100644
--- a/libvpx/vpx_ports/arm.h
+++ b/libvpx/vpx_ports/arm.h
@@ -9,11 +9,15 @@
*/
-#ifndef VPX_PORTS_ARM_H
-#define VPX_PORTS_ARM_H
+#ifndef VPX_PORTS_ARM_H_
+#define VPX_PORTS_ARM_H_
#include <stdlib.h>
#include "vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*ARMv5TE "Enhanced DSP" instructions.*/
#define HAS_EDSP 0x01
/*ARMv6 "Parallel" or "Media" instructions.*/
@@ -23,5 +27,9 @@
int arm_cpu_caps(void);
+#ifdef __cplusplus
+} // extern "C"
#endif
+#endif // VPX_PORTS_ARM_H_
+
diff --git a/libvpx/vpx_ports/asm_offsets.h b/libvpx/vpx_ports/asm_offsets.h
index d3a3e5a..317bbed 100644
--- a/libvpx/vpx_ports/asm_offsets.h
+++ b/libvpx/vpx_ports/asm_offsets.h
@@ -9,8 +9,8 @@
*/
-#ifndef VPX_PORTS_ASM_OFFSETS_H
-#define VPX_PORTS_ASM_OFFSETS_H
+#ifndef VPX_PORTS_ASM_OFFSETS_H_
+#define VPX_PORTS_ASM_OFFSETS_H_
#include <stddef.h>
@@ -28,4 +28,4 @@
#define END
#endif
-#endif /* VPX_PORTS_ASM_OFFSETS_H */
+#endif // VPX_PORTS_ASM_OFFSETS_H_
diff --git a/libvpx/vpx_ports/config.h b/libvpx/vpx_ports/config.h
index 1abe70d..3c1ab99 100644
--- a/libvpx/vpx_ports/config.h
+++ b/libvpx/vpx_ports/config.h
@@ -7,4 +7,10 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+
+#ifndef VPX_PORTS_CONFIG_H_
+#define VPX_PORTS_CONFIG_H_
+
#include "vpx_config.h"
+
+#endif // VPX_PORTS_CONFIG_H_
diff --git a/libvpx/vpx_ports/emmintrin_compat.h b/libvpx/vpx_ports/emmintrin_compat.h
index 782d603..1617638 100644
--- a/libvpx/vpx_ports/emmintrin_compat.h
+++ b/libvpx/vpx_ports/emmintrin_compat.h
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef VPX_PORTS_EMMINTRIN_COMPAT_H
-#define VPX_PORTS_EMMINTRIN_COMPAT_H
+#ifndef VPX_PORTS_EMMINTRIN_COMPAT_H_
+#define VPX_PORTS_EMMINTRIN_COMPAT_H_
#if defined(__GNUC__) && __GNUC__ < 4
/* From emmintrin.h (gcc 4.5.3) */
@@ -52,4 +52,4 @@ _mm_castsi128_pd(__m128i __A)
}
#endif
-#endif
+#endif // VPX_PORTS_EMMINTRIN_COMPAT_H_
diff --git a/libvpx/vpx_ports/mem.h b/libvpx/vpx_ports/mem.h
index 62b86bb..e91d776 100644
--- a/libvpx/vpx_ports/mem.h
+++ b/libvpx/vpx_ports/mem.h
@@ -9,8 +9,8 @@
*/
-#ifndef VPX_PORTS_MEM_H
-#define VPX_PORTS_MEM_H
+#ifndef VPX_PORTS_MEM_H_
+#define VPX_PORTS_MEM_H_
#include "vpx_config.h"
#include "vpx/vpx_integer.h"
@@ -44,4 +44,4 @@
#define UNINITIALIZED_IS_SAFE(x) x=x
#else
#define UNINITIALIZED_IS_SAFE(x) x
-#endif
+#endif // VPX_PORTS_MEM_H_
diff --git a/libvpx/vpx_ports/mem_ops.h b/libvpx/vpx_ports/mem_ops.h
index 2d44a3a..8c8b526 100644
--- a/libvpx/vpx_ports/mem_ops.h
+++ b/libvpx/vpx_ports/mem_ops.h
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VPX_PORTS_MEM_OPS_H_
+#define VPX_PORTS_MEM_OPS_H_
/* \file
* \brief Provides portable memory access primitives
@@ -220,3 +222,5 @@ static void mem_put_le32(void *vmem, MEM_VALUE_T val) {
mem[2] = (val >> 16) & 0xff;
mem[3] = (val >> 24) & 0xff;
}
+
+#endif // VPX_PORTS_MEM_OPS_H_
diff --git a/libvpx/vpx_ports/mem_ops_aligned.h b/libvpx/vpx_ports/mem_ops_aligned.h
index 0100300..24743c8 100644
--- a/libvpx/vpx_ports/mem_ops_aligned.h
+++ b/libvpx/vpx_ports/mem_ops_aligned.h
@@ -8,6 +8,10 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#ifndef VPX_PORTS_MEM_OPS_ALIGNED_H_
+#define VPX_PORTS_MEM_OPS_ALIGNED_H_
+
+#include "vpx/vpx_integer.h"
/* \file
* \brief Provides portable memory access primitives for operating on aligned
@@ -155,3 +159,5 @@ mem_put_le_aligned_generic(32)
#undef swap_endian_32
#undef swap_endian_16_se
#undef swap_endian_32_se
+
+#endif // VPX_PORTS_MEM_OPS_ALIGNED_H_
diff --git a/libvpx/vpx_ports/vpx_once.h b/libvpx/vpx_ports/vpx_once.h
index 16a735c..182892a 100644
--- a/libvpx/vpx_ports/vpx_once.h
+++ b/libvpx/vpx_ports/vpx_once.h
@@ -7,6 +7,10 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
+
+#ifndef VPX_PORTS_VPX_ONCE_H_
+#define VPX_PORTS_VPX_ONCE_H_
+
#include "vpx_config.h"
#if CONFIG_MULTITHREAD && defined(_WIN32)
@@ -95,3 +99,5 @@ static void once(void (*func)(void))
}
}
#endif
+
+#endif // VPX_PORTS_VPX_ONCE_H_
diff --git a/libvpx/vpx_ports/vpx_ports.mk b/libvpx/vpx_ports/vpx_ports.mk
index e6cb52f..869a204 100644
--- a/libvpx/vpx_ports/vpx_ports.mk
+++ b/libvpx/vpx_ports/vpx_ports.mk
@@ -19,7 +19,6 @@ ifeq ($(ARCH_X86)$(ARCH_X86_64),yes)
PORTS_SRCS-$(BUILD_LIBVPX) += emms.asm
PORTS_SRCS-$(BUILD_LIBVPX) += x86.h
PORTS_SRCS-$(BUILD_LIBVPX) += x86_abi_support.asm
-PORTS_SRCS-$(BUILD_LIBVPX) += x86_cpuid.c
endif
PORTS_SRCS-$(ARCH_ARM) += arm_cpudetect.c
diff --git a/libvpx/vpx_ports/vpx_timer.h b/libvpx/vpx_ports/vpx_timer.h
index cdad9ef..9e2015e 100644
--- a/libvpx/vpx_ports/vpx_timer.h
+++ b/libvpx/vpx_ports/vpx_timer.h
@@ -9,8 +9,8 @@
*/
-#ifndef VPX_TIMER_H
-#define VPX_TIMER_H
+#ifndef VPX_PORTS_VPX_TIMER_H_
+#define VPX_PORTS_VPX_TIMER_H_
#include "vpx/vpx_integer.h"
#if CONFIG_OS_SUPPORT
@@ -114,4 +114,4 @@ vpx_usec_timer_elapsed(struct vpx_usec_timer *t) {
#endif /* CONFIG_OS_SUPPORT */
-#endif
+#endif // VPX_PORTS_VPX_TIMER_H_
diff --git a/libvpx/vpx_ports/x86.h b/libvpx/vpx_ports/x86.h
index 2990583..bc99f89 100644
--- a/libvpx/vpx_ports/x86.h
+++ b/libvpx/vpx_ports/x86.h
@@ -9,11 +9,15 @@
*/
-#ifndef VPX_PORTS_X86_H
-#define VPX_PORTS_X86_H
+#ifndef VPX_PORTS_X86_H_
+#define VPX_PORTS_X86_H_
#include <stdlib.h>
#include "vpx_config.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef enum {
VPX_CPU_UNKNOWN = -1,
VPX_CPU_AMD,
@@ -35,51 +39,63 @@ typedef enum {
#if defined(__GNUC__) && __GNUC__ || defined(__ANDROID__)
#if ARCH_X86_64
-#define cpuid(func,ax,bx,cx,dx)\
+#define cpuid(func, func2, ax, bx, cx, dx)\
__asm__ __volatile__ (\
"cpuid \n\t" \
: "=a" (ax), "=b" (bx), "=c" (cx), "=d" (dx) \
- : "a" (func));
+ : "a" (func), "c" (func2));
#else
-#define cpuid(func,ax,bx,cx,dx)\
+#define cpuid(func, func2, ax, bx, cx, dx)\
__asm__ __volatile__ (\
"mov %%ebx, %%edi \n\t" \
"cpuid \n\t" \
"xchg %%edi, %%ebx \n\t" \
: "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
- : "a" (func));
+ : "a" (func), "c" (func2));
#endif
#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* end __GNUC__ or __ANDROID__*/
#if ARCH_X86_64
-#define cpuid(func,ax,bx,cx,dx)\
+#define cpuid(func, func2, ax, bx, cx, dx)\
asm volatile (\
"xchg %rsi, %rbx \n\t" \
"cpuid \n\t" \
"movl %ebx, %edi \n\t" \
"xchg %rsi, %rbx \n\t" \
: "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
- : "a" (func));
+ : "a" (func), "c" (func2));
#else
-#define cpuid(func,ax,bx,cx,dx)\
+#define cpuid(func, func2, ax, bx, cx, dx)\
asm volatile (\
"pushl %ebx \n\t" \
"cpuid \n\t" \
"movl %ebx, %edi \n\t" \
"popl %ebx \n\t" \
: "=a" (ax), "=D" (bx), "=c" (cx), "=d" (dx) \
- : "a" (func));
+ : "a" (func), "c" (func2));
#endif
#else /* end __SUNPRO__ */
#if ARCH_X86_64
+#if defined(_MSC_VER) && _MSC_VER > 1500
+void __cpuidex(int CPUInfo[4], int info_type, int ecxvalue);
+#pragma intrinsic(__cpuidex)
+#define cpuid(func, func2, a, b, c, d) do {\
+ int regs[4];\
+ __cpuidex(regs, func, func2); \
+ a = regs[0]; b = regs[1]; c = regs[2]; d = regs[3];\
+ } while(0)
+#else
void __cpuid(int CPUInfo[4], int info_type);
#pragma intrinsic(__cpuid)
-#define cpuid(func,a,b,c,d) do{\
+#define cpuid(func, func2, a, b, c, d) do {\
int regs[4];\
- __cpuid(regs,func); a=regs[0]; b=regs[1]; c=regs[2]; d=regs[3];\
- } while(0)
+ __cpuid(regs, func); \
+ a = regs[0]; b = regs[1]; c = regs[2]; d = regs[3];\
+ } while (0)
+#endif
#else
-#define cpuid(func,a,b,c,d)\
+#define cpuid(func, func2, a, b, c, d)\
__asm mov eax, func\
+ __asm mov ecx, func2\
__asm cpuid\
__asm mov a, eax\
__asm mov b, ebx\
@@ -120,13 +136,13 @@ x86_simd_caps(void) {
mask = strtol(env, NULL, 0);
/* Ensure that the CPUID instruction supports extended features */
- cpuid(0, reg_eax, reg_ebx, reg_ecx, reg_edx);
+ cpuid(0, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
if (reg_eax < 1)
return 0;
/* Get the standard feature flags */
- cpuid(1, reg_eax, reg_ebx, reg_ecx, reg_edx);
+ cpuid(1, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
if (reg_edx & BIT(23)) flags |= HAS_MMX;
@@ -142,13 +158,16 @@ x86_simd_caps(void) {
if (reg_ecx & BIT(28)) flags |= HAS_AVX;
+ /* Get the leaf 7 feature flags. Needed to check for AVX2 support */
+ reg_eax = 7;
+ reg_ecx = 0;
+ cpuid(7, 0, reg_eax, reg_ebx, reg_ecx, reg_edx);
+
if (reg_ebx & BIT(5)) flags |= HAS_AVX2;
return flags & mask;
}
-vpx_cpu_t vpx_x86_vendor(void);
-
#if ARCH_X86_64 && defined(_MSC_VER)
unsigned __int64 __rdtsc(void);
#pragma intrinsic(__rdtsc)
@@ -239,5 +258,9 @@ x87_set_double_precision(void) {
extern void vpx_reset_mmx_state(void);
+
+#ifdef __cplusplus
+} // extern "C"
#endif
+#endif // VPX_PORTS_X86_H_
diff --git a/libvpx/vpx_ports/x86_cpuid.c b/libvpx/vpx_ports/x86_cpuid.c
deleted file mode 100644
index fe86cfc..0000000
--- a/libvpx/vpx_ports/x86_cpuid.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <string.h>
-#include "x86.h"
-
-struct cpuid_vendors {
- char vendor_string[12];
- vpx_cpu_t vendor_id;
-};
-
-static struct cpuid_vendors cpuid_vendor_list[VPX_CPU_LAST] = {
- { "AuthenticAMD", VPX_CPU_AMD },
- { "AMDisbetter!", VPX_CPU_AMD_OLD },
- { "CentaurHauls", VPX_CPU_CENTAUR },
- { "CyrixInstead", VPX_CPU_CYRIX },
- { "GenuineIntel", VPX_CPU_INTEL },
- { "NexGenDriven", VPX_CPU_NEXGEN },
- { "Geode by NSC", VPX_CPU_NSC },
- { "RiseRiseRise", VPX_CPU_RISE },
- { "SiS SiS SiS ", VPX_CPU_SIS },
- { "GenuineTMx86", VPX_CPU_TRANSMETA },
- { "TransmetaCPU", VPX_CPU_TRANSMETA_OLD },
- { "UMC UMC UMC ", VPX_CPU_UMC },
- { "VIA VIA VIA ", VPX_CPU_VIA },
-};
-
-vpx_cpu_t vpx_x86_vendor(void) {
- unsigned int reg_eax;
- unsigned int vs[3];
- int i;
-
- /* Get the Vendor String from the CPU */
- cpuid(0, reg_eax, vs[0], vs[2], vs[1]);
-
- for (i = 0; i < VPX_CPU_LAST; i++) {
- if (strncmp((const char *)vs, cpuid_vendor_list[i].vendor_string, 12) == 0)
- return (cpuid_vendor_list[i].vendor_id);
- }
-
- return VPX_CPU_UNKNOWN;
-}
diff --git a/libvpx/vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm b/libvpx/vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm
deleted file mode 100644
index d070a47..0000000
--- a/libvpx/vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm
+++ /dev/null
@@ -1,123 +0,0 @@
-;
-; Copyright (c) 2010 The WebM project authors. All Rights Reserved.
-;
-; Use of this source code is governed by a BSD-style license
-; that can be found in the LICENSE file in the root of the source
-; tree. An additional intellectual property rights grant can be found
-; in the file PATENTS. All contributing project authors may
-; be found in the AUTHORS file in the root of the source tree.
-;
-
-
- EXPORT |vpx_yv12_copy_y_neon|
-
- ARM
- REQUIRE8
- PRESERVE8
-
- INCLUDE vpx_scale_asm_offsets.asm
-
- AREA ||.text||, CODE, READONLY, ALIGN=2
-
-;void vpx_yv12_copy_y_neon(const YV12_BUFFER_CONFIG *src_ybc,
-; YV12_BUFFER_CONFIG *dst_ybc)
-|vpx_yv12_copy_y_neon| PROC
- push {r4 - r11, lr}
- vpush {d8-d15}
-
- ldr r4, [r0, #yv12_buffer_config_y_height]
- ldr r5, [r0, #yv12_buffer_config_y_width]
- ldr r6, [r0, #yv12_buffer_config_y_stride]
- ldr r7, [r1, #yv12_buffer_config_y_stride]
- ldr r2, [r0, #yv12_buffer_config_y_buffer] ;srcptr1
- ldr r3, [r1, #yv12_buffer_config_y_buffer] ;dstptr1
-
- ; copy two rows at one time
- mov lr, r4, lsr #1
-
-cp_src_to_dst_height_loop1
- mov r8, r2
- mov r9, r3
- add r10, r2, r6
- add r11, r3, r7
- movs r12, r5, lsr #7
- ble extra_copy_needed ; y_width < 128
-
-cp_src_to_dst_width_loop1
- vld1.8 {q0, q1}, [r8]!
- vld1.8 {q8, q9}, [r10]!
- vld1.8 {q2, q3}, [r8]!
- vld1.8 {q10, q11}, [r10]!
- vld1.8 {q4, q5}, [r8]!
- vld1.8 {q12, q13}, [r10]!
- vld1.8 {q6, q7}, [r8]!
- vld1.8 {q14, q15}, [r10]!
-
- subs r12, r12, #1
-
- vst1.8 {q0, q1}, [r9]!
- vst1.8 {q8, q9}, [r11]!
- vst1.8 {q2, q3}, [r9]!
- vst1.8 {q10, q11}, [r11]!
- vst1.8 {q4, q5}, [r9]!
- vst1.8 {q12, q13}, [r11]!
- vst1.8 {q6, q7}, [r9]!
- vst1.8 {q14, q15}, [r11]!
-
- bne cp_src_to_dst_width_loop1
-
- subs lr, lr, #1
- add r2, r2, r6, lsl #1
- add r3, r3, r7, lsl #1
-
- bne cp_src_to_dst_height_loop1
-
-extra_copy_needed
- ands r10, r5, #0x7f ;check to see if extra copy is needed
- sub r11, r5, r10
- ldr r2, [r0, #yv12_buffer_config_y_buffer] ;srcptr1
- ldr r3, [r1, #yv12_buffer_config_y_buffer] ;dstptr1
- bne extra_cp_src_to_dst_width1
-end_of_cp_src_to_dst1
-
- vpop {d8 - d15}
- pop {r4-r11, pc}
-
-;=============================
-extra_cp_src_to_dst_width1
- add r2, r2, r11
- add r3, r3, r11
- add r0, r8, r6
- add r11, r9, r7
-
- mov lr, r4, lsr #1
-extra_cp_src_to_dst_height_loop1
- mov r8, r2
- mov r9, r3
- add r0, r8, r6
- add r11, r9, r7
-
- mov r12, r10
-
-extra_cp_src_to_dst_width_loop1
- vld1.8 {q0}, [r8]!
- vld1.8 {q1}, [r0]!
-
- subs r12, r12, #16
-
- vst1.8 {q0}, [r9]!
- vst1.8 {q1}, [r11]!
- bne extra_cp_src_to_dst_width_loop1
-
- subs lr, lr, #1
-
- add r2, r2, r6, lsl #1
- add r3, r3, r7, lsl #1
-
- bne extra_cp_src_to_dst_height_loop1
-
- b end_of_cp_src_to_dst1
-
- ENDP
-
- END
diff --git a/libvpx/vpx_scale/generic/yv12config.c b/libvpx/vpx_scale/generic/yv12config.c
index 7c3f7ec..5e95d31 100644
--- a/libvpx/vpx_scale/generic/yv12config.c
+++ b/libvpx/vpx_scale/generic/yv12config.c
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <assert.h>
+
#include "./vpx_config.h"
#include "vpx_scale/yv12config.h"
#include "vpx_mem/vpx_mem.h"
@@ -19,10 +21,17 @@
/****************************************************************************
*
****************************************************************************/
+#define yv12_align_addr(addr, align) \
+ (void*)(((size_t)(addr) + ((align) - 1)) & (size_t)-(align))
+
int
vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
if (ybf) {
- vpx_free(ybf->buffer_alloc);
+ // If libvpx is using frame buffer callbacks then buffer_alloc_sz must
+ // not be set.
+ if (ybf->buffer_alloc_sz > 0) {
+ vpx_free(ybf->buffer_alloc);
+ }
/* buffer_alloc isn't accessed by most functions. Rather y_buffer,
u_buffer and v_buffer point to buffer_alloc and are used. Clear out
@@ -51,7 +60,7 @@ int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
const int frame_size = yplane_size + 2 * uvplane_size;
if (!ybf->buffer_alloc) {
- ybf->buffer_alloc = vpx_memalign(32, frame_size);
+ ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, frame_size);
ybf->buffer_alloc_sz = frame_size;
}
@@ -108,7 +117,9 @@ int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
if (ybf) {
- vpx_free(ybf->buffer_alloc);
+ if (ybf->buffer_alloc_sz > 0) {
+ vpx_free(ybf->buffer_alloc);
+ }
/* buffer_alloc isn't accessed by most functions. Rather y_buffer,
u_buffer and v_buffer point to buffer_alloc and are used. Clear out
@@ -123,7 +134,10 @@ int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int width, int height,
- int ss_x, int ss_y, int border) {
+ int ss_x, int ss_y, int border,
+ vpx_codec_frame_buffer_t *fb,
+ vpx_get_frame_buffer_cb_fn_t cb,
+ void *cb_priv) {
if (ybf) {
const int aligned_width = (width + 7) & ~7;
const int aligned_height = (height + 7) & ~7;
@@ -148,16 +162,40 @@ int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
#else
const int frame_size = yplane_size + 2 * uvplane_size;
#endif
- if (frame_size > ybf->buffer_alloc_sz) {
+ if (cb != NULL) {
+ const int align_addr_extra_size = 31;
+ const size_t external_frame_size = frame_size + align_addr_extra_size;
+
+ assert(fb != NULL);
+
+ // Allocation to hold larger frame, or first allocation.
+ if (cb(cb_priv, external_frame_size, fb) < 0)
+ return -1;
+
+ if (fb->data == NULL || fb->size < external_frame_size)
+ return -1;
+
+ // This memset is needed for fixing valgrind error from C loop filter
+ // due to access uninitialized memory in frame border. It could be
+ // removed if border is totally removed.
+ vpx_memset(fb->data, 0, fb->size);
+
+ ybf->buffer_alloc = (uint8_t *)yv12_align_addr(fb->data, 32);
+ } else if (frame_size > ybf->buffer_alloc_sz) {
// Allocation to hold larger frame, or first allocation.
if (ybf->buffer_alloc)
vpx_free(ybf->buffer_alloc);
- ybf->buffer_alloc = vpx_memalign(32, frame_size);
+ ybf->buffer_alloc = (uint8_t *)vpx_memalign(32, frame_size);
+ if (!ybf->buffer_alloc)
+ return -1;
+
ybf->buffer_alloc_sz = frame_size;
- }
- if (!ybf->buffer_alloc || ybf->buffer_alloc_sz < frame_size)
- return -1;
+ // This memset is needed for fixing valgrind error from C loop filter
+ // due to access uninitialized memory in frame border. It could be
+ // removed if border is totally removed.
+ vpx_memset(ybf->buffer_alloc, 0, ybf->buffer_alloc_sz);
+ }
/* Only support allocating buffers that have a border that's a multiple
* of 32. The border restriction is required to get 16-byte alignment of
@@ -206,7 +244,8 @@ int vp9_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int ss_x, int ss_y, int border) {
if (ybf) {
vp9_free_frame_buffer(ybf);
- return vp9_realloc_frame_buffer(ybf, width, height, ss_x, ss_y, border);
+ return vp9_realloc_frame_buffer(ybf, width, height, ss_x, ss_y, border,
+ NULL, NULL, NULL);
}
return -2;
}
diff --git a/libvpx/vpx_scale/generic/yv12extend.c b/libvpx/vpx_scale/generic/yv12extend.c
index f2aec2b..7b43eec 100644
--- a/libvpx/vpx_scale/generic/yv12extend.c
+++ b/libvpx/vpx_scale/generic/yv12extend.c
@@ -81,17 +81,14 @@ void vp8_yv12_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) {
}
#if CONFIG_VP9
-static void extend_frame(YV12_BUFFER_CONFIG *const ybf,
- int subsampling_x, int subsampling_y,
- int ext_size) {
- const int c_w = (ybf->y_crop_width + subsampling_x) >> subsampling_x;
- const int c_h = (ybf->y_crop_height + subsampling_y) >> subsampling_y;
- const int c_et = ext_size >> subsampling_y;
- const int c_el = ext_size >> subsampling_x;
- const int c_eb = (ext_size + ybf->y_height - ybf->y_crop_height +
- subsampling_y) >> subsampling_y;
- const int c_er = (ext_size + ybf->y_width - ybf->y_crop_width +
- subsampling_x) >> subsampling_x;
+static void extend_frame(YV12_BUFFER_CONFIG *const ybf, int ext_size) {
+ const int c_w = ybf->uv_crop_width;
+ const int c_h = ybf->uv_crop_height;
+ const int c_ext_size = ext_size >> 1;
+ const int c_et = c_ext_size;
+ const int c_el = c_ext_size;
+ const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height;
+ const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width;
assert(ybf->y_height - ybf->y_crop_height < 16);
assert(ybf->y_width - ybf->y_crop_width < 16);
@@ -111,16 +108,14 @@ static void extend_frame(YV12_BUFFER_CONFIG *const ybf,
c_w, c_h, c_et, c_el, c_eb, c_er);
}
-void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf,
- int subsampling_x, int subsampling_y) {
- extend_frame(ybf, subsampling_x, subsampling_y, ybf->border);
+void vp9_extend_frame_borders_c(YV12_BUFFER_CONFIG *ybf) {
+ extend_frame(ybf, ybf->border);
}
-void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf,
- int subsampling_x, int subsampling_y) {
+void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf) {
const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ?
VP9INNERBORDERINPIXELS : ybf->border;
- extend_frame(ybf, subsampling_x, subsampling_y, inner_bw);
+ extend_frame(ybf, inner_bw);
}
#endif // CONFIG_VP9
diff --git a/libvpx/vpx_scale/mips/dspr2/yv12extend_dspr2.c b/libvpx/vpx_scale/mips/dspr2/yv12extend_dspr2.c
index 2c5cd1a..26558b0 100644
--- a/libvpx/vpx_scale/mips/dspr2/yv12extend_dspr2.c
+++ b/libvpx/vpx_scale/mips/dspr2/yv12extend_dspr2.c
@@ -107,14 +107,13 @@ static void extend_plane(uint8_t *const src, int src_stride,
static void extend_frame(YV12_BUFFER_CONFIG *const ybf,
int subsampling_x, int subsampling_y,
int ext_size) {
- const int c_w = (ybf->y_crop_width + subsampling_x) >> subsampling_x;
- const int c_h = (ybf->y_crop_height + subsampling_y) >> subsampling_y;
- const int c_et = ext_size >> subsampling_y;
- const int c_el = ext_size >> subsampling_x;
- const int c_eb = (ext_size + ybf->y_height - ybf->y_crop_height +
- subsampling_y) >> subsampling_y;
- const int c_er = (ext_size + ybf->y_width - ybf->y_crop_width +
- subsampling_x) >> subsampling_x;
+ const int c_w = ybf->uv_crop_width;
+ const int c_h = ybf->uv_crop_height;
+ const int c_ext_size = ext_size >> 1;
+ const int c_et = c_ext_size;
+ const int c_el = c_ext_size;
+ const int c_eb = c_ext_size + ybf->uv_height - ybf->uv_crop_height;
+ const int c_er = c_ext_size + ybf->uv_width - ybf->uv_crop_width;
assert(ybf->y_height - ybf->y_crop_height < 16);
assert(ybf->y_width - ybf->y_crop_width < 16);
diff --git a/libvpx/vpx_scale/vpx_scale.h b/libvpx/vpx_scale/vpx_scale.h
index 9ddf62e..43fcf9d 100644
--- a/libvpx/vpx_scale/vpx_scale.h
+++ b/libvpx/vpx_scale/vpx_scale.h
@@ -9,8 +9,8 @@
*/
-#ifndef VPXSCALE_H
-#define VPXSCALE_H
+#ifndef VPX_SCALE_VPX_SCALE_H_
+#define VPX_SCALE_VPX_SCALE_H_
#include "vpx_scale/yv12config.h"
@@ -24,4 +24,4 @@ extern void vpx_scale_frame(YV12_BUFFER_CONFIG *src,
unsigned int vratio,
unsigned int interlaced);
-#endif
+#endif // VPX_SCALE_VPX_SCALE_H_
diff --git a/libvpx/vpx_scale/vpx_scale.mk b/libvpx/vpx_scale/vpx_scale.mk
index 50d3e9d..ded8e0b 100644
--- a/libvpx/vpx_scale/vpx_scale.mk
+++ b/libvpx/vpx_scale/vpx_scale.mk
@@ -7,11 +7,10 @@ SCALE_SRCS-yes += generic/yv12extend.c
SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/gen_scalers.c
SCALE_SRCS-yes += vpx_scale_asm_offsets.c
SCALE_SRCS-yes += vpx_scale_rtcd.c
-SCALE_SRCS-yes += vpx_scale_rtcd.sh
+SCALE_SRCS-yes += vpx_scale_rtcd.pl
#neon
SCALE_SRCS-$(HAVE_NEON) += arm/neon/vp8_vpxyv12_copyframe_func_neon$(ASM)
-SCALE_SRCS-$(HAVE_NEON) += arm/neon/vp8_vpxyv12_copy_y_neon$(ASM)
SCALE_SRCS-$(HAVE_NEON) += arm/neon/vp8_vpxyv12_copysrcframe_func_neon$(ASM)
SCALE_SRCS-$(HAVE_NEON) += arm/neon/vp8_vpxyv12_extendframeborders_neon$(ASM)
SCALE_SRCS-$(HAVE_NEON) += arm/neon/yv12extend_arm.c
@@ -24,4 +23,4 @@ SCALE_SRCS-no += $(SCALE_SRCS_REMOVE-yes)
$(eval $(call asm_offsets_template,\
vpx_scale_asm_offsets.asm, vpx_scale/vpx_scale_asm_offsets.c))
-$(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.sh))
+$(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.pl))
diff --git a/libvpx/vpx_scale/vpx_scale_rtcd.pl b/libvpx/vpx_scale/vpx_scale_rtcd.pl
new file mode 100644
index 0000000..8c92570
--- /dev/null
+++ b/libvpx/vpx_scale/vpx_scale_rtcd.pl
@@ -0,0 +1,34 @@
+sub vpx_scale_forward_decls() {
+print <<EOF
+struct yv12_buffer_config;
+EOF
+}
+forward_decls qw/vpx_scale_forward_decls/;
+
+# Scaler functions
+if (vpx_config("CONFIG_SPATIAL_RESAMPLING") eq "yes") {
+ add_proto qw/void vp8_horizontal_line_5_4_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
+ add_proto qw/void vp8_vertical_band_5_4_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
+ add_proto qw/void vp8_horizontal_line_5_3_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
+ add_proto qw/void vp8_vertical_band_5_3_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
+ add_proto qw/void vp8_horizontal_line_2_1_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
+ add_proto qw/void vp8_vertical_band_2_1_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
+ add_proto qw/void vp8_vertical_band_2_1_scale_i/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
+}
+
+add_proto qw/void vp8_yv12_extend_frame_borders/, "struct yv12_buffer_config *ybf";
+specialize qw/vp8_yv12_extend_frame_borders neon/;
+
+add_proto qw/void vp8_yv12_copy_frame/, "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc";
+specialize qw/vp8_yv12_copy_frame neon/;
+
+add_proto qw/void vpx_yv12_copy_y/, "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc";
+
+if (vpx_config("CONFIG_VP9") eq "yes") {
+ add_proto qw/void vp9_extend_frame_borders/, "struct yv12_buffer_config *ybf";
+ specialize qw/vp9_extend_frame_borders dspr2/;
+
+ add_proto qw/void vp9_extend_frame_inner_borders/, "struct yv12_buffer_config *ybf";
+ specialize qw/vp9_extend_frame_inner_borders dspr2/;
+}
+1;
diff --git a/libvpx/vpx_scale/vpx_scale_rtcd.sh b/libvpx/vpx_scale/vpx_scale_rtcd.sh
deleted file mode 100644
index a5faf11..0000000
--- a/libvpx/vpx_scale/vpx_scale_rtcd.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-vpx_scale_forward_decls() {
-cat <<EOF
-struct yv12_buffer_config;
-EOF
-}
-forward_decls vpx_scale_forward_decls
-
-# Scaler functions
-if [ "CONFIG_SPATIAL_RESAMPLING" != "yes" ]; then
- prototype void vp8_horizontal_line_5_4_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
- prototype void vp8_vertical_band_5_4_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
- prototype void vp8_horizontal_line_5_3_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
- prototype void vp8_vertical_band_5_3_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
- prototype void vp8_horizontal_line_2_1_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
- prototype void vp8_vertical_band_2_1_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
- prototype void vp8_vertical_band_2_1_scale_i "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
-fi
-
-prototype void vp8_yv12_extend_frame_borders "struct yv12_buffer_config *ybf"
-specialize vp8_yv12_extend_frame_borders neon
-
-prototype void vp8_yv12_copy_frame "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
-specialize vp8_yv12_copy_frame neon
-
-prototype void vpx_yv12_copy_y "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
-specialize vpx_yv12_copy_y neon
-
-if [ "$CONFIG_VP9" = "yes" ]; then
- prototype void vp9_extend_frame_borders "struct yv12_buffer_config *ybf, int subsampling_x, int subsampling_y"
- specialize vp9_extend_frame_borders dspr2
-
- prototype void vp9_extend_frame_inner_borders "struct yv12_buffer_config *ybf, int subsampling_x, int subsampling_y"
- specialize vp9_extend_frame_inner_borders dspr2
-fi
diff --git a/libvpx/vpx_scale/yv12config.h b/libvpx/vpx_scale/yv12config.h
index 0e950fb..cdde75c 100644
--- a/libvpx/vpx_scale/yv12config.h
+++ b/libvpx/vpx_scale/yv12config.h
@@ -8,69 +8,79 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef YV12_CONFIG_H
-#define YV12_CONFIG_H
+#ifndef VPX_SCALE_YV12CONFIG_H_
+#define VPX_SCALE_YV12CONFIG_H_
#ifdef __cplusplus
extern "C" {
#endif
+#include "vpx/vpx_frame_buffer.h"
#include "vpx/vpx_integer.h"
-#define VP8BORDERINPIXELS 32
-#define VP9INNERBORDERINPIXELS 96
-#define VP9BORDERINPIXELS 160
-#define VP9_INTERP_EXTEND 4
+#define VP8BORDERINPIXELS 32
+#define VP9INNERBORDERINPIXELS 96
+#define VP9_INTERP_EXTEND 4
+#define VP9_ENC_BORDER_IN_PIXELS 160
+#define VP9_DEC_BORDER_IN_PIXELS 32
- typedef struct yv12_buffer_config {
- int y_width;
- int y_height;
- int y_crop_width;
- int y_crop_height;
- int y_stride;
- /* int yinternal_width; */
+typedef struct yv12_buffer_config {
+ int y_width;
+ int y_height;
+ int y_crop_width;
+ int y_crop_height;
+ int y_stride;
- int uv_width;
- int uv_height;
- int uv_crop_width;
- int uv_crop_height;
- int uv_stride;
- /* int uvinternal_width; */
+ int uv_width;
+ int uv_height;
+ int uv_crop_width;
+ int uv_crop_height;
+ int uv_stride;
- int alpha_width;
- int alpha_height;
- int alpha_stride;
+ int alpha_width;
+ int alpha_height;
+ int alpha_stride;
- uint8_t *y_buffer;
- uint8_t *u_buffer;
- uint8_t *v_buffer;
- uint8_t *alpha_buffer;
+ uint8_t *y_buffer;
+ uint8_t *u_buffer;
+ uint8_t *v_buffer;
+ uint8_t *alpha_buffer;
- uint8_t *buffer_alloc;
- int buffer_alloc_sz;
- int border;
- int frame_size;
+ uint8_t *buffer_alloc;
+ int buffer_alloc_sz;
+ int border;
+ int frame_size;
- int corrupted;
- int flags;
- } YV12_BUFFER_CONFIG;
+ int corrupted;
+ int flags;
+} YV12_BUFFER_CONFIG;
- int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
+int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
+ int width, int height, int border);
+int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int width, int height, int border);
- int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
- int width, int height, int border);
- int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf);
+int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf);
- int vp9_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
+int vp9_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
+ int width, int height, int ss_x, int ss_y,
+ int border);
+
+// Updates the yv12 buffer config with the frame buffer. If cb is not
+// NULL, then libvpx is using the frame buffer callbacks to handle memory.
+// If cb is not NULL, libvpx will call cb with minimum size in bytes needed
+// to decode the current frame. If cb is NULL, libvpx will allocate memory
+// internally to decode the current frame. Returns 0 on success. Returns < 0
+// on failure.
+int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
int width, int height, int ss_x, int ss_y,
- int border);
- int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf,
- int width, int height, int ss_x, int ss_y,
- int border);
- int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf);
+ int border,
+ vpx_codec_frame_buffer_t *fb,
+ vpx_get_frame_buffer_cb_fn_t cb,
+ void *cb_priv);
+int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf);
#ifdef __cplusplus
}
#endif
-#endif // YV12_CONFIG_H
+#endif // VPX_SCALE_YV12CONFIG_H_
diff --git a/libvpx/vpxdec.c b/libvpx/vpxdec.c
index 110e4ac..4c37234 100644
--- a/libvpx/vpxdec.c
+++ b/libvpx/vpxdec.c
@@ -8,10 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
-/* This is a simple program that reads ivf files and decodes them
- * using the new interface. Decoded frames are output as YV12 raw.
- */
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
@@ -19,37 +15,34 @@
#include <string.h>
#include <limits.h>
+#include "third_party/libyuv/include/libyuv/scale.h"
+
+#include "./args.h"
+#include "./ivfdec.h"
+
#define VPX_CODEC_DISABLE_COMPAT 1
-#include "vpx_config.h"
+#include "./vpx_config.h"
#include "vpx/vpx_decoder.h"
+#include "vpx_ports/mem_ops.h"
#include "vpx_ports/vpx_timer.h"
+
#if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
#include "vpx/vp8dx.h"
#endif
-#if CONFIG_MD5
-#include "md5_utils.h"
-#endif
-#include "tools_common.h"
-#include "nestegg/include/nestegg/nestegg.h"
-#include "third_party/libyuv/include/libyuv/scale.h"
+
+#include "./md5_utils.h"
+
+#include "./tools_common.h"
+#include "./webmdec.h"
+#include "./y4menc.h"
static const char *exec_name;
-static const struct {
- char const *name;
- const vpx_codec_iface_t *(*iface)(void);
- unsigned int fourcc;
- unsigned int fourcc_mask;
-} ifaces[] = {
-#if CONFIG_VP8_DECODER
- {"vp8", vpx_codec_vp8_dx, VP8_FOURCC_MASK, 0x00FFFFFF},
-#endif
-#if CONFIG_VP9_DECODER
- {"vp9", vpx_codec_vp9_dx, VP9_FOURCC_MASK, 0x00FFFFFF},
-#endif
+struct VpxDecInputContext {
+ struct VpxInputContext *vpx_input_ctx;
+ struct WebmInputContext *webm_ctx;
};
-#include "args.h"
static const arg_def_t looparg = ARG_DEF(NULL, "loops", 1,
"Number of times to decode the file");
static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1,
@@ -83,18 +76,17 @@ static const arg_def_t error_concealment = ARG_DEF(NULL, "error-concealment", 0,
static const arg_def_t scalearg = ARG_DEF("S", "scale", 0,
"Scale output frames uniformly");
+static const arg_def_t fb_arg =
+ ARG_DEF(NULL, "frame-buffers", 1, "Number of frame buffers to use");
-#if CONFIG_MD5
static const arg_def_t md5arg = ARG_DEF(NULL, "md5", 0,
"Compute the MD5 sum of the decoded frame");
-#endif
+
static const arg_def_t *all_args[] = {
&codecarg, &use_yv12, &use_i420, &flipuvarg, &noblitarg,
&progressarg, &limitarg, &skiparg, &postprocarg, &summaryarg, &outputfile,
- &threadsarg, &verbosearg, &scalearg,
-#if CONFIG_MD5
+ &threadsarg, &verbosearg, &scalearg, &fb_arg,
&md5arg,
-#endif
&error_concealment,
NULL
};
@@ -126,6 +118,21 @@ static const arg_def_t *vp8_pp_args[] = {
};
#endif
+static int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst,
+ FilterMode mode) {
+ assert(src->fmt == VPX_IMG_FMT_I420);
+ assert(dst->fmt == VPX_IMG_FMT_I420);
+ return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y],
+ src->planes[VPX_PLANE_U], src->stride[VPX_PLANE_U],
+ src->planes[VPX_PLANE_V], src->stride[VPX_PLANE_V],
+ src->d_w, src->d_h,
+ dst->planes[VPX_PLANE_Y], dst->stride[VPX_PLANE_Y],
+ dst->planes[VPX_PLANE_U], dst->stride[VPX_PLANE_U],
+ dst->planes[VPX_PLANE_V], dst->stride[VPX_PLANE_V],
+ dst->d_w, dst->d_h,
+ mode);
+}
+
void usage_exit() {
int i;
@@ -153,435 +160,216 @@ void usage_exit() {
);
fprintf(stderr, "\nIncluded decoders:\n\n");
- for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
+ for (i = 0; i < get_vpx_decoder_count(); ++i) {
+ const VpxInterface *const decoder = get_vpx_decoder_by_index(i);
fprintf(stderr, " %-6s - %s\n",
- ifaces[i].name,
- vpx_codec_iface_name(ifaces[i].iface()));
+ decoder->name, vpx_codec_iface_name(decoder->interface()));
+ }
exit(EXIT_FAILURE);
}
-static unsigned int mem_get_le16(const void *vmem) {
- unsigned int val;
- const unsigned char *mem = (const unsigned char *)vmem;
-
- val = mem[1] << 8;
- val |= mem[0];
- return val;
-}
-
-static unsigned int mem_get_le32(const void *vmem) {
- unsigned int val;
- const unsigned char *mem = (const unsigned char *)vmem;
+static int raw_read_frame(FILE *infile, uint8_t **buffer,
+ size_t *bytes_read, size_t *buffer_size) {
+ char raw_hdr[RAW_FRAME_HDR_SZ];
+ size_t frame_size = 0;
- val = mem[3] << 24;
- val |= mem[2] << 16;
- val |= mem[1] << 8;
- val |= mem[0];
- return val;
-}
-
-enum file_kind {
- RAW_FILE,
- IVF_FILE,
- WEBM_FILE
-};
-
-struct input_ctx {
- enum file_kind kind;
- FILE *infile;
- nestegg *nestegg_ctx;
- nestegg_packet *pkt;
- unsigned int chunk;
- unsigned int chunks;
- unsigned int video_track;
-};
-
-#define IVF_FRAME_HDR_SZ (sizeof(uint32_t) + sizeof(uint64_t))
-#define RAW_FRAME_HDR_SZ (sizeof(uint32_t))
-static int read_frame(struct input_ctx *input,
- uint8_t **buf,
- size_t *buf_sz,
- size_t *buf_alloc_sz) {
- char raw_hdr[IVF_FRAME_HDR_SZ];
- size_t new_buf_sz;
- FILE *infile = input->infile;
- enum file_kind kind = input->kind;
- if (kind == WEBM_FILE) {
- if (input->chunk >= input->chunks) {
- unsigned int track;
-
- do {
- /* End of this packet, get another. */
- if (input->pkt)
- nestegg_free_packet(input->pkt);
-
- if (nestegg_read_packet(input->nestegg_ctx, &input->pkt) <= 0
- || nestegg_packet_track(input->pkt, &track))
- return 1;
-
- } while (track != input->video_track);
-
- if (nestegg_packet_count(input->pkt, &input->chunks))
- return 1;
- input->chunk = 0;
- }
-
- if (nestegg_packet_data(input->pkt, input->chunk, buf, buf_sz))
- return 1;
- input->chunk++;
-
- return 0;
- }
- /* For both the raw and ivf formats, the frame size is the first 4 bytes
- * of the frame header. We just need to special case on the header
- * size.
- */
- else if (fread(raw_hdr, kind == IVF_FILE
- ? IVF_FRAME_HDR_SZ : RAW_FRAME_HDR_SZ, 1, infile) != 1) {
+ if (fread(raw_hdr, RAW_FRAME_HDR_SZ, 1, infile) != 1) {
if (!feof(infile))
- fprintf(stderr, "Failed to read frame size\n");
-
- new_buf_sz = 0;
+ warn("Failed to read RAW frame size\n");
} else {
- new_buf_sz = mem_get_le32(raw_hdr);
+ const size_t kCorruptFrameThreshold = 256 * 1024 * 1024;
+ const size_t kFrameTooSmallThreshold = 256 * 1024;
+ frame_size = mem_get_le32(raw_hdr);
- if (new_buf_sz > 256 * 1024 * 1024) {
- fprintf(stderr, "Error: Read invalid frame size (%u)\n",
- (unsigned int)new_buf_sz);
- new_buf_sz = 0;
+ if (frame_size > kCorruptFrameThreshold) {
+ warn("Read invalid frame size (%u)\n", (unsigned int)frame_size);
+ frame_size = 0;
}
- if (kind == RAW_FILE && new_buf_sz > 256 * 1024)
- fprintf(stderr, "Warning: Read invalid frame size (%u)"
- " - not a raw file?\n", (unsigned int)new_buf_sz);
-
- if (new_buf_sz > *buf_alloc_sz) {
- uint8_t *new_buf = realloc(*buf, 2 * new_buf_sz);
+ if (frame_size < kFrameTooSmallThreshold) {
+ warn("Warning: Read invalid frame size (%u) - not a raw file?\n",
+ (unsigned int)frame_size);
+ }
+ if (frame_size > *buffer_size) {
+ uint8_t *new_buf = realloc(*buffer, 2 * frame_size);
if (new_buf) {
- *buf = new_buf;
- *buf_alloc_sz = 2 * new_buf_sz;
+ *buffer = new_buf;
+ *buffer_size = 2 * frame_size;
} else {
- fprintf(stderr, "Failed to allocate compressed data buffer\n");
- new_buf_sz = 0;
+ warn("Failed to allocate compressed data buffer\n");
+ frame_size = 0;
}
}
}
- *buf_sz = new_buf_sz;
-
if (!feof(infile)) {
- if (fread(*buf, 1, *buf_sz, infile) != *buf_sz) {
- fprintf(stderr, "Failed to read full frame\n");
+ if (fread(*buffer, 1, frame_size, infile) != frame_size) {
+ warn("Failed to read full frame\n");
return 1;
}
-
- return 0;
- }
-
- return 1;
-}
-
-void *out_open(const char *out_fn, int do_md5) {
- void *out = NULL;
-
- if (do_md5) {
-#if CONFIG_MD5
- MD5Context *md5_ctx = out = malloc(sizeof(MD5Context));
- (void)out_fn;
- MD5Init(md5_ctx);
-#endif
- } else {
- FILE *outfile = out = strcmp("-", out_fn) ? fopen(out_fn, "wb")
- : set_binary_mode(stdout);
-
- if (!outfile) {
- fprintf(stderr, "Failed to output file");
- exit(EXIT_FAILURE);
- }
+ *bytes_read = frame_size;
}
- return out;
+ return 0;
}
-void out_put(void *out, const uint8_t *buf, unsigned int len, int do_md5) {
- if (do_md5) {
-#if CONFIG_MD5
- MD5Update(out, buf, len);
+static int read_frame(struct VpxDecInputContext *input, uint8_t **buf,
+ size_t *bytes_in_buffer, size_t *buffer_size) {
+ switch (input->vpx_input_ctx->file_type) {
+#if CONFIG_WEBM_IO
+ case FILE_TYPE_WEBM:
+ return webm_read_frame(input->webm_ctx,
+ buf, bytes_in_buffer, buffer_size);
#endif
- } else {
- (void) fwrite(buf, 1, len, out);
+ case FILE_TYPE_RAW:
+ return raw_read_frame(input->vpx_input_ctx->file,
+ buf, bytes_in_buffer, buffer_size);
+ case FILE_TYPE_IVF:
+ return ivf_read_frame(input->vpx_input_ctx->file,
+ buf, bytes_in_buffer, buffer_size);
+ default:
+ return 1;
}
}
-void out_close(void *out, const char *out_fn, int do_md5) {
- if (do_md5) {
-#if CONFIG_MD5
- uint8_t md5[16];
- int i;
-
- MD5Final(md5, out);
- free(out);
+static void update_image_md5(const vpx_image_t *img, const int planes[3],
+ MD5Context *md5) {
+ int i, y;
- for (i = 0; i < 16; i++)
- printf("%02x", md5[i]);
+ for (i = 0; i < 3; ++i) {
+ const int plane = planes[i];
+ const unsigned char *buf = img->planes[plane];
+ const int stride = img->stride[plane];
+ const int w = vpx_img_plane_width(img, plane);
+ const int h = vpx_img_plane_height(img, plane);
- printf(" %s\n", out_fn);
-#endif
- } else {
- fclose(out);
+ for (y = 0; y < h; ++y) {
+ MD5Update(md5, buf, w);
+ buf += stride;
+ }
}
}
-unsigned int file_is_ivf(FILE *infile,
- unsigned int *fourcc,
- unsigned int *width,
- unsigned int *height,
- unsigned int *fps_den,
- unsigned int *fps_num) {
- char raw_hdr[32];
- int is_ivf = 0;
-
- if (fread(raw_hdr, 1, 32, infile) == 32) {
- if (raw_hdr[0] == 'D' && raw_hdr[1] == 'K'
- && raw_hdr[2] == 'I' && raw_hdr[3] == 'F') {
- is_ivf = 1;
-
- if (mem_get_le16(raw_hdr + 4) != 0)
- fprintf(stderr, "Error: Unrecognized IVF version! This file may not"
- " decode properly.");
-
- *fourcc = mem_get_le32(raw_hdr + 8);
- *width = mem_get_le16(raw_hdr + 12);
- *height = mem_get_le16(raw_hdr + 14);
- *fps_num = mem_get_le32(raw_hdr + 16);
- *fps_den = mem_get_le32(raw_hdr + 20);
-
- /* Some versions of vpxenc used 1/(2*fps) for the timebase, so
- * we can guess the framerate using only the timebase in this
- * case. Other files would require reading ahead to guess the
- * timebase, like we do for webm.
- */
- if (*fps_num < 1000) {
- /* Correct for the factor of 2 applied to the timebase in the
- * encoder.
- */
- if (*fps_num & 1)*fps_den <<= 1;
- else *fps_num >>= 1;
- } else {
- /* Don't know FPS for sure, and don't have readahead code
- * (yet?), so just default to 30fps.
- */
- *fps_num = 30;
- *fps_den = 1;
- }
- }
- }
+static void write_image_file(const vpx_image_t *img, const int planes[3],
+ FILE *file) {
+ int i, y;
- if (!is_ivf)
- rewind(infile);
+ for (i = 0; i < 3; ++i) {
+ const int plane = planes[i];
+ const unsigned char *buf = img->planes[plane];
+ const int stride = img->stride[plane];
+ const int w = vpx_img_plane_width(img, plane);
+ const int h = vpx_img_plane_height(img, plane);
- return is_ivf;
+ for (y = 0; y < h; ++y) {
+ fwrite(buf, 1, w, file);
+ buf += stride;
+ }
+ }
}
-
-unsigned int file_is_raw(FILE *infile,
- unsigned int *fourcc,
- unsigned int *width,
- unsigned int *height,
- unsigned int *fps_den,
- unsigned int *fps_num) {
- unsigned char buf[32];
+int file_is_raw(struct VpxInputContext *input) {
+ uint8_t buf[32];
int is_raw = 0;
vpx_codec_stream_info_t si;
si.sz = sizeof(si);
- if (fread(buf, 1, 32, infile) == 32) {
+ if (fread(buf, 1, 32, input->file) == 32) {
int i;
- if (mem_get_le32(buf) < 256 * 1024 * 1024)
- for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
- if (!vpx_codec_peek_stream_info(ifaces[i].iface(),
+ if (mem_get_le32(buf) < 256 * 1024 * 1024) {
+ for (i = 0; i < get_vpx_decoder_count(); ++i) {
+ const VpxInterface *const decoder = get_vpx_decoder_by_index(i);
+ if (!vpx_codec_peek_stream_info(decoder->interface(),
buf + 4, 32 - 4, &si)) {
is_raw = 1;
- *fourcc = ifaces[i].fourcc;
- *width = si.w;
- *height = si.h;
- *fps_num = 30;
- *fps_den = 1;
+ input->fourcc = decoder->fourcc;
+ input->width = si.w;
+ input->height = si.h;
+ input->framerate.numerator = 30;
+ input->framerate.denominator = 1;
break;
}
+ }
+ }
}
- rewind(infile);
+ rewind(input->file);
return is_raw;
}
-
-static int
-nestegg_read_cb(void *buffer, size_t length, void *userdata) {
- FILE *f = userdata;
-
- if (fread(buffer, 1, length, f) < length) {
- if (ferror(f))
- return -1;
- if (feof(f))
- return 0;
- }
- return 1;
-}
-
-
-static int
-nestegg_seek_cb(int64_t offset, int whence, void *userdata) {
- switch (whence) {
- case NESTEGG_SEEK_SET:
- whence = SEEK_SET;
- break;
- case NESTEGG_SEEK_CUR:
- whence = SEEK_CUR;
- break;
- case NESTEGG_SEEK_END:
- whence = SEEK_END;
- break;
- };
- return fseek(userdata, (long)offset, whence) ? -1 : 0;
-}
-
-
-static int64_t
-nestegg_tell_cb(void *userdata) {
- return ftell(userdata);
-}
-
-
-static void
-nestegg_log_cb(nestegg *context, unsigned int severity, char const *format,
- ...) {
- va_list ap;
-
- va_start(ap, format);
- vfprintf(stderr, format, ap);
- fprintf(stderr, "\n");
- va_end(ap);
+void show_progress(int frame_in, int frame_out, uint64_t dx_time) {
+ fprintf(stderr,
+ "%d decoded frames/%d showed frames in %"PRId64" us (%.2f fps)\r",
+ frame_in, frame_out, dx_time,
+ (double)frame_out * 1000000.0 / (double)dx_time);
}
+struct ExternalFrameBuffer {
+ uint8_t* data;
+ size_t size;
+ int in_use;
+};
-static int
-webm_guess_framerate(struct input_ctx *input,
- unsigned int *fps_den,
- unsigned int *fps_num) {
- unsigned int i;
- uint64_t tstamp = 0;
-
- /* Check to see if we can seek before we parse any data. */
- if (nestegg_track_seek(input->nestegg_ctx, input->video_track, 0)) {
- fprintf(stderr,
- "WARNING: Failed to guess framerate (no Cues), set to 30fps.\n");
- *fps_num = 30;
- *fps_den = 1;
- return 0;
- }
-
- /* Guess the framerate. Read up to 1 second, or 50 video packets,
- * whichever comes first.
- */
- for (i = 0; tstamp < 1000000000 && i < 50;) {
- nestegg_packet *pkt;
- unsigned int track;
+struct ExternalFrameBufferList {
+ int num_external_frame_buffers;
+ struct ExternalFrameBuffer *ext_fb;
+};
- if (nestegg_read_packet(input->nestegg_ctx, &pkt) <= 0)
+// Callback used by libvpx to request an external frame buffer. |cb_priv|
+// Application private data passed into the set function. |min_size| is the
+// minimum size in bytes needed to decode the next frame. |fb| pointer to the
+// frame buffer.
+int get_vp9_frame_buffer(void *cb_priv, size_t min_size,
+ vpx_codec_frame_buffer_t *fb) {
+ int i;
+ struct ExternalFrameBufferList *const ext_fb_list =
+ (struct ExternalFrameBufferList *)cb_priv;
+ if (ext_fb_list == NULL)
+ return -1;
+
+ // Find a free frame buffer.
+ for (i = 0; i < ext_fb_list->num_external_frame_buffers; ++i) {
+ if (!ext_fb_list->ext_fb[i].in_use)
break;
-
- nestegg_packet_track(pkt, &track);
- if (track == input->video_track) {
- nestegg_packet_tstamp(pkt, &tstamp);
- i++;
- }
-
- nestegg_free_packet(pkt);
}
- if (nestegg_track_seek(input->nestegg_ctx, input->video_track, 0))
- goto fail;
-
- *fps_num = (i - 1) * 1000000;
- *fps_den = (unsigned int)(tstamp / 1000);
- return 0;
-fail:
- nestegg_destroy(input->nestegg_ctx);
- input->nestegg_ctx = NULL;
- rewind(input->infile);
- return 1;
-}
-
-
-static int
-file_is_webm(struct input_ctx *input,
- unsigned int *fourcc,
- unsigned int *width,
- unsigned int *height,
- unsigned int *fps_den,
- unsigned int *fps_num) {
- unsigned int i, n;
- int track_type = -1;
- int codec_id;
-
- nestegg_io io = {nestegg_read_cb, nestegg_seek_cb, nestegg_tell_cb, 0};
- nestegg_video_params params;
-
- io.userdata = input->infile;
- if (nestegg_init(&input->nestegg_ctx, io, NULL))
- goto fail;
-
- if (nestegg_track_count(input->nestegg_ctx, &n))
- goto fail;
+ if (i == ext_fb_list->num_external_frame_buffers)
+ return -1;
- for (i = 0; i < n; i++) {
- track_type = nestegg_track_type(input->nestegg_ctx, i);
-
- if (track_type == NESTEGG_TRACK_VIDEO)
- break;
- else if (track_type < 0)
- goto fail;
- }
+ if (ext_fb_list->ext_fb[i].size < min_size) {
+ free(ext_fb_list->ext_fb[i].data);
+ ext_fb_list->ext_fb[i].data = (uint8_t *)malloc(min_size);
+ if (!ext_fb_list->ext_fb[i].data)
+ return -1;
- codec_id = nestegg_track_codec_id(input->nestegg_ctx, i);
- if (codec_id == NESTEGG_CODEC_VP8) {
- *fourcc = VP8_FOURCC_MASK;
- } else if (codec_id == NESTEGG_CODEC_VP9) {
- *fourcc = VP9_FOURCC_MASK;
- } else {
- fprintf(stderr, "Not VPx video, quitting.\n");
- exit(1);
+ ext_fb_list->ext_fb[i].size = min_size;
}
- input->video_track = i;
-
- if (nestegg_track_video_params(input->nestegg_ctx, i, &params))
- goto fail;
+ fb->data = ext_fb_list->ext_fb[i].data;
+ fb->size = ext_fb_list->ext_fb[i].size;
+ ext_fb_list->ext_fb[i].in_use = 1;
- *fps_den = 0;
- *fps_num = 0;
- *width = params.width;
- *height = params.height;
- return 1;
-fail:
- input->nestegg_ctx = NULL;
- rewind(input->infile);
+ // Set the frame buffer's private data to point at the external frame buffer.
+ fb->priv = &ext_fb_list->ext_fb[i];
return 0;
}
-
-void show_progress(int frame_in, int frame_out, unsigned long dx_time) {
- fprintf(stderr, "%d decoded frames/%d showed frames in %lu us (%.2f fps)\r",
- frame_in, frame_out, dx_time,
- (float)frame_out * 1000000.0 / (float)dx_time);
+// Callback used by libvpx when there are no references to the frame buffer.
+// |cb_priv| user private data passed into the set function. |fb| pointer
+// to the frame buffer.
+int release_vp9_frame_buffer(void *cb_priv,
+ vpx_codec_frame_buffer_t *fb) {
+ struct ExternalFrameBuffer *const ext_fb =
+ (struct ExternalFrameBuffer *)fb->priv;
+ (void)cb_priv;
+ ext_fb->in_use = 0;
+ return 0;
}
-
void generate_filename(const char *pattern, char *out, size_t q_len,
unsigned int d_w, unsigned int d_h,
unsigned int frame_in) {
@@ -661,32 +449,60 @@ void generate_filename(const char *pattern, char *out, size_t q_len,
} while (*p);
}
+static int is_single_file(const char *outfile_pattern) {
+ const char *p = outfile_pattern;
+
+ do {
+ p = strchr(p, '%');
+ if (p && p[1] >= '1' && p[1] <= '9')
+ return 0; // pattern contains sequence number, so it's not unique
+ if (p)
+ p++;
+ } while (p);
+
+ return 1;
+}
+
+static void print_md5(unsigned char digest[16], const char *filename) {
+ int i;
+
+ for (i = 0; i < 16; ++i)
+ printf("%02x", digest[i]);
+ printf(" %s\n", filename);
+}
+
+static FILE *open_outfile(const char *name) {
+ if (strcmp("-", name) == 0) {
+ set_binary_mode(stdout);
+ return stdout;
+ } else {
+ FILE *file = fopen(name, "wb");
+ if (!file)
+ fatal("Failed to output file %s", name);
+ return file;
+ }
+}
int main_loop(int argc, const char **argv_) {
- vpx_codec_ctx_t decoder;
+ vpx_codec_ctx_t decoder;
char *fn = NULL;
int i;
uint8_t *buf = NULL;
- size_t buf_sz = 0, buf_alloc_sz = 0;
+ size_t bytes_in_buffer = 0, buffer_size = 0;
FILE *infile;
- int frame_in = 0, frame_out = 0, flipuv = 0, noblit = 0, do_md5 = 0, progress = 0;
+ int frame_in = 0, frame_out = 0, flipuv = 0, noblit = 0;
+ int do_md5 = 0, progress = 0;
int stop_after = 0, postproc = 0, summary = 0, quiet = 1;
int arg_skip = 0;
int ec_enabled = 0;
- vpx_codec_iface_t *iface = NULL;
- unsigned int fourcc;
- unsigned long dx_time = 0;
+ const VpxInterface *interface = NULL;
+ const VpxInterface *fourcc_interface = NULL;
+ uint64_t dx_time = 0;
struct arg arg;
char **argv, **argi, **argj;
- const char *outfile_pattern = 0;
- char outfile[PATH_MAX];
+
int single_file;
int use_y4m = 1;
- unsigned int width;
- unsigned int height;
- unsigned int fps_den;
- unsigned int fps_num;
- void *out = NULL;
vpx_codec_dec_cfg_t cfg = {0};
#if CONFIG_VP8_DECODER
vp8_postproc_cfg_t vp8_pp_cfg = {0};
@@ -695,13 +511,26 @@ int main_loop(int argc, const char **argv_) {
int vp8_dbg_color_b_modes = 0;
int vp8_dbg_display_mv = 0;
#endif
- struct input_ctx input = {0};
int frames_corrupted = 0;
int dec_flags = 0;
int do_scale = 0;
- int stream_w = 0, stream_h = 0;
vpx_image_t *scaled_img = NULL;
int frame_avail, got_data;
+ int num_external_frame_buffers = 0;
+ struct ExternalFrameBufferList ext_fb_list = {0};
+
+ const char *outfile_pattern = NULL;
+ char outfile_name[PATH_MAX] = {0};
+ FILE *outfile = NULL;
+
+ MD5Context md5_ctx;
+ unsigned char md5_digest[16];
+
+ struct VpxDecInputContext input = {0};
+ struct VpxInputContext vpx_input_ctx = {0};
+ struct WebmInputContext webm_ctx = {0};
+ input.vpx_input_ctx = &vpx_input_ctx;
+ input.webm_ctx = &webm_ctx;
/* Parse command line */
exec_name = argv_[0];
@@ -712,17 +541,9 @@ int main_loop(int argc, const char **argv_) {
arg.argv_step = 1;
if (arg_match(&arg, &codecarg, argi)) {
- int j, k = -1;
-
- for (j = 0; j < sizeof(ifaces) / sizeof(ifaces[0]); j++)
- if (!strcmp(ifaces[j].name, arg.val))
- k = j;
-
- if (k >= 0)
- iface = ifaces[k].iface();
- else
- die("Error: Unrecognized argument (%s) to --codec\n",
- arg.val);
+ interface = get_vpx_decoder_by_name(arg.val);
+ if (!interface)
+ die("Error: Unrecognized argument (%s) to --codec\n", arg.val);
} else if (arg_match(&arg, &looparg, argi)) {
// no-op
} else if (arg_match(&arg, &outputfile, argi))
@@ -755,6 +576,8 @@ int main_loop(int argc, const char **argv_) {
quiet = 0;
else if (arg_match(&arg, &scalearg, argi))
do_scale = 1;
+ else if (arg_match(&arg, &fb_arg, argi))
+ num_external_frame_buffers = arg_parse_uint(&arg);
#if CONFIG_VP8_DECODER
else if (arg_match(&arg, &addnoise_level, argi)) {
@@ -827,8 +650,7 @@ int main_loop(int argc, const char **argv_) {
infile = strcmp(fn, "-") ? fopen(fn, "rb") : set_binary_mode(stdin);
if (!infile) {
- fprintf(stderr, "Failed to open file '%s'",
- strcmp(fn, "-") ? fn : "stdin");
+ fprintf(stderr, "Failed to open file '%s'", strcmp(fn, "-") ? fn : "stdin");
return EXIT_FAILURE;
}
#if CONFIG_OS_SUPPORT
@@ -840,89 +662,67 @@ int main_loop(int argc, const char **argv_) {
return EXIT_FAILURE;
}
#endif
- input.infile = infile;
- if (file_is_ivf(infile, &fourcc, &width, &height, &fps_den,
- &fps_num))
- input.kind = IVF_FILE;
- else if (file_is_webm(&input, &fourcc, &width, &height, &fps_den, &fps_num))
- input.kind = WEBM_FILE;
- else if (file_is_raw(infile, &fourcc, &width, &height, &fps_den, &fps_num))
- input.kind = RAW_FILE;
+ input.vpx_input_ctx->file = infile;
+ if (file_is_ivf(input.vpx_input_ctx))
+ input.vpx_input_ctx->file_type = FILE_TYPE_IVF;
+#if CONFIG_WEBM_IO
+ else if (file_is_webm(input.webm_ctx, input.vpx_input_ctx))
+ input.vpx_input_ctx->file_type = FILE_TYPE_WEBM;
+#endif
+ else if (file_is_raw(input.vpx_input_ctx))
+ input.vpx_input_ctx->file_type = FILE_TYPE_RAW;
else {
fprintf(stderr, "Unrecognized input file type.\n");
+#if !CONFIG_WEBM_IO
+ fprintf(stderr, "vpxdec was built without WebM container support.\n");
+#endif
return EXIT_FAILURE;
}
- /* If the output file is not set or doesn't have a sequence number in
- * it, then we only open it once.
- */
outfile_pattern = outfile_pattern ? outfile_pattern : "-";
- single_file = 1;
- {
- const char *p = outfile_pattern;
- do {
- p = strchr(p, '%');
- if (p && p[1] >= '1' && p[1] <= '9') {
- /* pattern contains sequence number, so it's not unique. */
- single_file = 0;
- break;
- }
- if (p)
- p++;
- } while (p);
- }
+ single_file = is_single_file(outfile_pattern);
- if (single_file && !noblit) {
- generate_filename(outfile_pattern, outfile, sizeof(outfile) - 1,
- width, height, 0);
- out = out_open(outfile, do_md5);
+ if (!noblit && single_file) {
+ generate_filename(outfile_pattern, outfile_name, PATH_MAX,
+ vpx_input_ctx.width, vpx_input_ctx.height, 0);
+ if (do_md5)
+ MD5Init(&md5_ctx);
+ else
+ outfile = open_outfile(outfile_name);
}
if (use_y4m && !noblit) {
- char buffer[128];
-
if (!single_file) {
fprintf(stderr, "YUV4MPEG2 not supported with output patterns,"
" try --i420 or --yv12.\n");
return EXIT_FAILURE;
}
- if (input.kind == WEBM_FILE)
- if (webm_guess_framerate(&input, &fps_den, &fps_num)) {
+#if CONFIG_WEBM_IO
+ if (vpx_input_ctx.file_type == FILE_TYPE_WEBM) {
+ if (webm_guess_framerate(input.webm_ctx, input.vpx_input_ctx)) {
fprintf(stderr, "Failed to guess framerate -- error parsing "
"webm file?\n");
return EXIT_FAILURE;
}
-
-
- /*Note: We can't output an aspect ratio here because IVF doesn't
- store one, and neither does VP8.
- That will have to wait until these tools support WebM natively.*/
- snprintf(buffer, sizeof(buffer), "YUV4MPEG2 W%u H%u F%u:%u I%c ",
- width, height, fps_num, fps_den, 'p');
- out_put(out, (unsigned char *)buffer,
- (unsigned int)strlen(buffer), do_md5);
+ }
+#endif
}
- /* Try to determine the codec from the fourcc. */
- for (i = 0; i < sizeof(ifaces) / sizeof(ifaces[0]); i++)
- if ((fourcc & ifaces[i].fourcc_mask) == ifaces[i].fourcc) {
- vpx_codec_iface_t *ivf_iface = ifaces[i].iface();
+ fourcc_interface = get_vpx_decoder_by_fourcc(vpx_input_ctx.fourcc);
+ if (interface && fourcc_interface && interface != fourcc_interface)
+ warn("Header indicates codec: %s\n", fourcc_interface->name);
+ else
+ interface = fourcc_interface;
- if (iface && iface != ivf_iface)
- fprintf(stderr, "Notice -- IVF header indicates codec: %s\n",
- ifaces[i].name);
- else
- iface = ivf_iface;
-
- break;
- }
+ if (!interface)
+ interface = get_vpx_decoder_by_index(0);
dec_flags = (postproc ? VPX_CODEC_USE_POSTPROC : 0) |
(ec_enabled ? VPX_CODEC_USE_ERROR_CONCEALMENT : 0);
- if (vpx_codec_dec_init(&decoder, iface ? iface : ifaces[0].iface(), &cfg,
- dec_flags)) {
- fprintf(stderr, "Failed to initialize decoder: %s\n", vpx_codec_error(&decoder));
+ if (vpx_codec_dec_init(&decoder, interface->interface(), &cfg, dec_flags)) {
+ fprintf(stderr, "Failed to initialize decoder: %s\n",
+ vpx_codec_error(&decoder));
return EXIT_FAILURE;
}
@@ -963,14 +763,27 @@ int main_loop(int argc, const char **argv_) {
#endif
- if(arg_skip)
- fprintf(stderr, "Skiping first %d frames.\n", arg_skip);
+ if (arg_skip)
+ fprintf(stderr, "Skipping first %d frames.\n", arg_skip);
while (arg_skip) {
- if (read_frame(&input, &buf, &buf_sz, &buf_alloc_sz))
+ if (read_frame(&input, &buf, &bytes_in_buffer, &buffer_size))
break;
arg_skip--;
}
+ if (num_external_frame_buffers > 0) {
+ ext_fb_list.num_external_frame_buffers = num_external_frame_buffers;
+ ext_fb_list.ext_fb = (struct ExternalFrameBuffer *)calloc(
+ num_external_frame_buffers, sizeof(*ext_fb_list.ext_fb));
+ if (vpx_codec_set_frame_buffer_functions(
+ &decoder, get_vp9_frame_buffer, release_vp9_frame_buffer,
+ &ext_fb_list)) {
+ fprintf(stderr, "Failed to configure external frame buffers: %s\n",
+ vpx_codec_error(&decoder));
+ return EXIT_FAILURE;
+ }
+ }
+
frame_avail = 1;
got_data = 0;
@@ -983,24 +796,25 @@ int main_loop(int argc, const char **argv_) {
frame_avail = 0;
if (!stop_after || frame_in < stop_after) {
- if(!read_frame(&input, &buf, &buf_sz, &buf_alloc_sz)) {
+ if (!read_frame(&input, &buf, &bytes_in_buffer, &buffer_size)) {
frame_avail = 1;
frame_in++;
vpx_usec_timer_start(&timer);
- if (vpx_codec_decode(&decoder, buf, (unsigned int)buf_sz, NULL, 0)) {
+ if (vpx_codec_decode(&decoder, buf, (unsigned int)bytes_in_buffer,
+ NULL, 0)) {
const char *detail = vpx_codec_error_detail(&decoder);
- fprintf(stderr, "Failed to decode frame: %s\n",
- vpx_codec_error(&decoder));
+ warn("Failed to decode frame %d: %s",
+ frame_in, vpx_codec_error(&decoder));
if (detail)
- fprintf(stderr, " Additional information: %s\n", detail);
+ warn("Additional information: %s", detail);
goto fail;
}
vpx_usec_timer_mark(&timer);
- dx_time += (unsigned int)vpx_usec_timer_elapsed(&timer);
+ dx_time += vpx_usec_timer_elapsed(&timer);
}
}
@@ -1016,8 +830,7 @@ int main_loop(int argc, const char **argv_) {
dx_time += (unsigned int)vpx_usec_timer_elapsed(&timer);
if (vpx_codec_control(&decoder, VP8D_GET_FRAME_CORRUPTED, &corrupted)) {
- fprintf(stderr, "Failed VP8_GET_FRAME_CORRUPTED: %s\n",
- vpx_codec_error(&decoder));
+ warn("Failed VP8_GET_FRAME_CORRUPTED: %s", vpx_codec_error(&decoder));
goto fail;
}
frames_corrupted += corrupted;
@@ -1025,87 +838,86 @@ int main_loop(int argc, const char **argv_) {
if (progress)
show_progress(frame_in, frame_out, dx_time);
- if (!noblit) {
- if (frame_out == 1 && img && use_y4m) {
- /* Write out the color format to terminate the header line */
- const char *color =
- img->fmt == VPX_IMG_FMT_444A ? "C444alpha\n" :
- img->fmt == VPX_IMG_FMT_I444 ? "C444\n" :
- img->fmt == VPX_IMG_FMT_I422 ? "C422\n" :
- "C420jpeg\n";
-
- out_put(out, (const unsigned char*)color, strlen(color), do_md5);
- }
+ if (!noblit && img) {
+ const int PLANES_YUV[] = {VPX_PLANE_Y, VPX_PLANE_U, VPX_PLANE_V};
+ const int PLANES_YVU[] = {VPX_PLANE_Y, VPX_PLANE_V, VPX_PLANE_U};
+ const int *planes = flipuv ? PLANES_YVU : PLANES_YUV;
if (do_scale) {
- if (img && frame_out == 1) {
- stream_w = img->d_w;
- stream_h = img->d_h;
- scaled_img = vpx_img_alloc(NULL, VPX_IMG_FMT_I420,
- stream_w, stream_h, 16);
+ if (frame_out == 1) {
+ // If the output frames are to be scaled to a fixed display size then
+ // use the width and height specified in the container. If either of
+ // these is set to 0, use the display size set in the first frame
+ // header. If that is unavailable, use the raw decoded size of the
+ // first decoded frame.
+ int display_width = vpx_input_ctx.width;
+ int display_height = vpx_input_ctx.height;
+ if (!display_width || !display_height) {
+ int display_size[2];
+ if (vpx_codec_control(&decoder, VP9D_GET_DISPLAY_SIZE,
+ display_size)) {
+ // As last resort use size of first frame as display size.
+ display_width = img->d_w;
+ display_height = img->d_h;
+ } else {
+ display_width = display_size[0];
+ display_height = display_size[1];
+ }
+ }
+ scaled_img = vpx_img_alloc(NULL, VPX_IMG_FMT_I420, display_width,
+ display_height, 16);
}
- if (img && (img->d_w != stream_w || img->d_h != stream_h)) {
- assert(img->fmt == VPX_IMG_FMT_I420);
- I420Scale(img->planes[VPX_PLANE_Y], img->stride[VPX_PLANE_Y],
- img->planes[VPX_PLANE_U], img->stride[VPX_PLANE_U],
- img->planes[VPX_PLANE_V], img->stride[VPX_PLANE_V],
- img->d_w, img->d_h,
- scaled_img->planes[VPX_PLANE_Y],
- scaled_img->stride[VPX_PLANE_Y],
- scaled_img->planes[VPX_PLANE_U],
- scaled_img->stride[VPX_PLANE_U],
- scaled_img->planes[VPX_PLANE_V],
- scaled_img->stride[VPX_PLANE_V],
- stream_w, stream_h,
- kFilterBox);
+
+ if (img->d_w != scaled_img->d_w || img->d_h != scaled_img->d_h) {
+ vpx_image_scale(img, scaled_img, kFilterBox);
img = scaled_img;
}
}
- if (img) {
- unsigned int y;
- char out_fn[PATH_MAX];
- uint8_t *buf;
- unsigned int c_w =
- img->x_chroma_shift ? (1 + img->d_w) >> img->x_chroma_shift
- : img->d_w;
- unsigned int c_h =
- img->y_chroma_shift ? (1 + img->d_h) >> img->y_chroma_shift
- : img->d_h;
-
- if (!single_file) {
- size_t len = sizeof(out_fn) - 1;
-
- out_fn[len] = '\0';
- generate_filename(outfile_pattern, out_fn, len - 1,
- img->d_w, img->d_h, frame_in);
- out = out_open(out_fn, do_md5);
- } else if (use_y4m)
- out_put(out, (unsigned char *)"FRAME\n", 6, do_md5);
-
- buf = img->planes[VPX_PLANE_Y];
-
- for (y = 0; y < img->d_h; y++) {
- out_put(out, buf, img->d_w, do_md5);
- buf += img->stride[VPX_PLANE_Y];
+ if (single_file) {
+ if (use_y4m) {
+ char buf[Y4M_BUFFER_SIZE] = {0};
+ size_t len = 0;
+ if (frame_out == 1) {
+ // Y4M file header
+ len = y4m_write_file_header(buf, sizeof(buf),
+ vpx_input_ctx.width,
+ vpx_input_ctx.height,
+ &vpx_input_ctx.framerate, img->fmt);
+ if (do_md5) {
+ MD5Update(&md5_ctx, (md5byte *)buf, (unsigned int)len);
+ } else {
+ fputs(buf, outfile);
+ }
+ }
+
+ // Y4M frame header
+ len = y4m_write_frame_header(buf, sizeof(buf));
+ if (do_md5) {
+ MD5Update(&md5_ctx, (md5byte *)buf, (unsigned int)len);
+ } else {
+ fputs(buf, outfile);
+ }
}
- buf = img->planes[flipuv ? VPX_PLANE_V : VPX_PLANE_U];
-
- for (y = 0; y < c_h; y++) {
- out_put(out, buf, c_w, do_md5);
- buf += img->stride[VPX_PLANE_U];
+ if (do_md5) {
+ update_image_md5(img, planes, &md5_ctx);
+ } else {
+ write_image_file(img, planes, outfile);
}
-
- buf = img->planes[flipuv ? VPX_PLANE_U : VPX_PLANE_V];
-
- for (y = 0; y < c_h; y++) {
- out_put(out, buf, c_w, do_md5);
- buf += img->stride[VPX_PLANE_V];
+ } else {
+ generate_filename(outfile_pattern, outfile_name, PATH_MAX,
+ img->d_w, img->d_h, frame_in);
+ if (do_md5) {
+ MD5Init(&md5_ctx);
+ update_image_md5(img, planes, &md5_ctx);
+ MD5Final(md5_digest, &md5_ctx);
+ print_md5(md5_digest, outfile_name);
+ } else {
+ outfile = open_outfile(outfile_name);
+ write_image_file(img, planes, outfile);
+ fclose(outfile);
}
-
- if (!single_file)
- out_close(out, out_fn, do_md5);
}
}
@@ -1124,17 +936,35 @@ int main_loop(int argc, const char **argv_) {
fail:
if (vpx_codec_destroy(&decoder)) {
- fprintf(stderr, "Failed to destroy decoder: %s\n", vpx_codec_error(&decoder));
+ fprintf(stderr, "Failed to destroy decoder: %s\n",
+ vpx_codec_error(&decoder));
return EXIT_FAILURE;
}
- if (single_file && !noblit)
- out_close(out, outfile, do_md5);
+ if (!noblit && single_file) {
+ if (do_md5) {
+ MD5Final(md5_digest, &md5_ctx);
+ print_md5(md5_digest, outfile_name);
+ } else {
+ fclose(outfile);
+ }
+ }
+
+#if CONFIG_WEBM_IO
+ if (input.vpx_input_ctx->file_type == FILE_TYPE_WEBM)
+ webm_free(input.webm_ctx);
+#endif
- if (input.nestegg_ctx)
- nestegg_destroy(input.nestegg_ctx);
- if (input.kind != WEBM_FILE)
+ if (input.vpx_input_ctx->file_type != FILE_TYPE_WEBM)
free(buf);
+
+ if (scaled_img) vpx_img_free(scaled_img);
+
+ for (i = 0; i < ext_fb_list.num_external_frame_buffers; ++i) {
+ free(ext_fb_list.ext_fb[i].data);
+ }
+ free(ext_fb_list.ext_fb);
+
fclose(infile);
free(argv);
diff --git a/libvpx/vpxenc.c b/libvpx/vpxenc.c
index b7897db..1cd5e92 100644
--- a/libvpx/vpxenc.c
+++ b/libvpx/vpxenc.c
@@ -8,34 +8,26 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "./vpxenc.h"
#include "./vpx_config.h"
-#if defined(_WIN32) || defined(__OS2__) || !CONFIG_OS_SUPPORT
-#define USE_POSIX_MMAP 0
-#else
-#define USE_POSIX_MMAP 1
-#endif
-
+#include <assert.h>
+#include <limits.h>
#include <math.h>
+#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
#include <string.h>
-#include <limits.h>
-#include <assert.h>
+
#include "vpx/vpx_encoder.h"
#if CONFIG_DECODERS
#include "vpx/vpx_decoder.h"
#endif
-#if USE_POSIX_MMAP
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <fcntl.h>
-#include <unistd.h>
-#endif
#include "third_party/libyuv/include/libyuv/scale.h"
+#include "./args.h"
+#include "./ivfenc.h"
+#include "./tools_common.h"
#if CONFIG_VP8_ENCODER || CONFIG_VP9_ENCODER
#include "vpx/vp8cx.h"
@@ -44,10 +36,12 @@
#include "vpx/vp8dx.h"
#endif
-#include "./tools_common.h"
+#include "vpx/vpx_integer.h"
#include "vpx_ports/mem_ops.h"
#include "vpx_ports/vpx_timer.h"
+#include "./rate_hist.h"
#include "./vpxstats.h"
+#include "./warnings.h"
#include "./webmenc.h"
#include "./y4minput.h"
@@ -67,24 +61,6 @@ static size_t wrap_fwrite(const void *ptr, size_t size, size_t nmemb,
static const char *exec_name;
-static const struct codec_item {
- char const *name;
- const vpx_codec_iface_t *(*iface)(void);
- const vpx_codec_iface_t *(*dx_iface)(void);
- unsigned int fourcc;
-} codecs[] = {
-#if CONFIG_VP8_ENCODER && CONFIG_VP8_DECODER
- {"vp8", &vpx_codec_vp8_cx, &vpx_codec_vp8_dx, VP8_FOURCC},
-#elif CONFIG_VP8_ENCODER && !CONFIG_VP8_DECODER
- {"vp8", &vpx_codec_vp8_cx, NULL, VP8_FOURCC},
-#endif
-#if CONFIG_VP9_ENCODER && CONFIG_VP9_DECODER
- {"vp9", &vpx_codec_vp9_cx, &vpx_codec_vp9_dx, VP9_FOURCC},
-#elif CONFIG_VP9_ENCODER && !CONFIG_VP9_DECODER
- {"vp9", &vpx_codec_vp9_cx, NULL, VP9_FOURCC},
-#endif
-};
-
static void warn_or_exit_on_errorv(vpx_codec_ctx_t *ctx, int fatal,
const char *s, va_list ap) {
if (ctx->err) {
@@ -118,200 +94,36 @@ static void warn_or_exit_on_error(vpx_codec_ctx_t *ctx, int fatal,
va_end(ap);
}
-enum video_file_type {
- FILE_TYPE_RAW,
- FILE_TYPE_IVF,
- FILE_TYPE_Y4M
-};
-
-struct detect_buffer {
- char buf[4];
- size_t buf_read;
- size_t position;
-};
-
-
-struct input_state {
- char *fn;
- FILE *file;
- off_t length;
- y4m_input y4m;
- struct detect_buffer detect;
- enum video_file_type file_type;
- unsigned int w;
- unsigned int h;
- struct vpx_rational framerate;
- int use_i420;
- int only_i420;
-};
-
-#define IVF_FRAME_HDR_SZ (4+8) /* 4 byte size + 8 byte timestamp */
-static int read_frame(struct input_state *input, vpx_image_t *img) {
- FILE *f = input->file;
- enum video_file_type file_type = input->file_type;
- y4m_input *y4m = &input->y4m;
- struct detect_buffer *detect = &input->detect;
- int plane = 0;
+int read_frame(struct VpxInputContext *input_ctx, vpx_image_t *img) {
+ FILE *f = input_ctx->file;
+ y4m_input *y4m = &input_ctx->y4m;
int shortread = 0;
- if (file_type == FILE_TYPE_Y4M) {
+ if (input_ctx->file_type == FILE_TYPE_Y4M) {
if (y4m_input_fetch_frame(y4m, f, img) < 1)
return 0;
} else {
- if (file_type == FILE_TYPE_IVF) {
- char junk[IVF_FRAME_HDR_SZ];
-
- /* Skip the frame header. We know how big the frame should be. See
- * write_ivf_frame_header() for documentation on the frame header
- * layout.
- */
- (void) fread(junk, 1, IVF_FRAME_HDR_SZ, f);
- }
-
- for (plane = 0; plane < 3; plane++) {
- unsigned char *ptr;
- int w = (plane ? (1 + img->d_w) / 2 : img->d_w);
- int h = (plane ? (1 + img->d_h) / 2 : img->d_h);
- int r;
-
- /* Determine the correct plane based on the image format. The for-loop
- * always counts in Y,U,V order, but this may not match the order of
- * the data on disk.
- */
- switch (plane) {
- case 1:
- ptr = img->planes[img->fmt == VPX_IMG_FMT_YV12 ? VPX_PLANE_V : VPX_PLANE_U];
- break;
- case 2:
- ptr = img->planes[img->fmt == VPX_IMG_FMT_YV12 ? VPX_PLANE_U : VPX_PLANE_V];
- break;
- default:
- ptr = img->planes[plane];
- }
-
- for (r = 0; r < h; r++) {
- size_t needed = w;
- size_t buf_position = 0;
- const size_t left = detect->buf_read - detect->position;
- if (left > 0) {
- const size_t more = (left < needed) ? left : needed;
- memcpy(ptr, detect->buf + detect->position, more);
- buf_position = more;
- needed -= more;
- detect->position += more;
- }
- if (needed > 0) {
- shortread |= (fread(ptr + buf_position, 1, needed, f) < needed);
- }
-
- ptr += img->stride[plane];
- }
- }
+ shortread = read_yuv_frame(input_ctx, img);
}
return !shortread;
}
-
-unsigned int file_is_y4m(FILE *infile,
- y4m_input *y4m,
- char detect[4]) {
+int file_is_y4m(const char detect[4]) {
if (memcmp(detect, "YUV4", 4) == 0) {
return 1;
}
return 0;
}
-#define IVF_FILE_HDR_SZ (32)
-unsigned int file_is_ivf(struct input_state *input,
- unsigned int *fourcc) {
- char raw_hdr[IVF_FILE_HDR_SZ];
- int is_ivf = 0;
- FILE *infile = input->file;
- unsigned int *width = &input->w;
- unsigned int *height = &input->h;
- struct detect_buffer *detect = &input->detect;
-
- if (memcmp(detect->buf, "DKIF", 4) != 0)
- return 0;
-
- /* See write_ivf_file_header() for more documentation on the file header
- * layout.
- */
- if (fread(raw_hdr + 4, 1, IVF_FILE_HDR_SZ - 4, infile)
- == IVF_FILE_HDR_SZ - 4) {
- {
- is_ivf = 1;
-
- if (mem_get_le16(raw_hdr + 4) != 0)
- warn("Unrecognized IVF version! This file may not decode "
- "properly.");
-
- *fourcc = mem_get_le32(raw_hdr + 8);
- }
- }
-
- if (is_ivf) {
- *width = mem_get_le16(raw_hdr + 12);
- *height = mem_get_le16(raw_hdr + 14);
- detect->position = 4;
+int fourcc_is_ivf(const char detect[4]) {
+ if (memcmp(detect, "DKIF", 4) == 0) {
+ return 1;
}
-
- return is_ivf;
-}
-
-
-static void write_ivf_file_header(FILE *outfile,
- const vpx_codec_enc_cfg_t *cfg,
- unsigned int fourcc,
- int frame_cnt) {
- char header[32];
-
- if (cfg->g_pass != VPX_RC_ONE_PASS && cfg->g_pass != VPX_RC_LAST_PASS)
- return;
-
- header[0] = 'D';
- header[1] = 'K';
- header[2] = 'I';
- header[3] = 'F';
- mem_put_le16(header + 4, 0); /* version */
- mem_put_le16(header + 6, 32); /* headersize */
- mem_put_le32(header + 8, fourcc); /* headersize */
- mem_put_le16(header + 12, cfg->g_w); /* width */
- mem_put_le16(header + 14, cfg->g_h); /* height */
- mem_put_le32(header + 16, cfg->g_timebase.den); /* rate */
- mem_put_le32(header + 20, cfg->g_timebase.num); /* scale */
- mem_put_le32(header + 24, frame_cnt); /* length */
- mem_put_le32(header + 28, 0); /* unused */
-
- (void) fwrite(header, 1, 32, outfile);
-}
-
-
-static void write_ivf_frame_header(FILE *outfile,
- const vpx_codec_cx_pkt_t *pkt) {
- char header[12];
- vpx_codec_pts_t pts;
-
- if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
- return;
-
- pts = pkt->data.frame.pts;
- mem_put_le32(header, (int)pkt->data.frame.sz);
- mem_put_le32(header + 4, pts & 0xFFFFFFFF);
- mem_put_le32(header + 8, pts >> 32);
-
- (void) fwrite(header, 1, 12, outfile);
-}
-
-static void write_ivf_frame_size(FILE *outfile, size_t size) {
- char header[4];
- mem_put_le32(header, (int)size);
- (void) fwrite(header, 1, 4, outfile);
+ return 0;
}
-
-
+#if CONFIG_WEBM_IO
/* Murmur hash derived from public domain reference implementation at
* http:// sites.google.com/site/murmurhash/
*/
@@ -358,9 +170,8 @@ static unsigned int murmur(const void *key, int len, unsigned int seed) {
return h;
}
+#endif // CONFIG_WEBM_IO
-
-#include "args.h"
static const arg_def_t debugmode = ARG_DEF("D", "debug", 0,
"Debug mode (makes output deterministic)");
static const arg_def_t outputfile = ARG_DEF("o", "output", 1,
@@ -395,11 +206,7 @@ static const arg_def_t verbosearg = ARG_DEF("v", "verbose", 0,
"Show encoder parameters");
static const arg_def_t psnrarg = ARG_DEF(NULL, "psnr", 0,
"Show PSNR in status line");
-enum TestDecodeFatality {
- TEST_DECODE_OFF,
- TEST_DECODE_FATAL,
- TEST_DECODE_WARN,
-};
+
static const struct arg_enum_list test_decode_enum[] = {
{"off", TEST_DECODE_OFF},
{"fatal", TEST_DECODE_FATAL},
@@ -412,18 +219,30 @@ static const arg_def_t recontest = ARG_DEF_ENUM(NULL, "test-decode", 1,
static const arg_def_t framerate = ARG_DEF(NULL, "fps", 1,
"Stream frame rate (rate/scale)");
static const arg_def_t use_ivf = ARG_DEF(NULL, "ivf", 0,
- "Output IVF (default is WebM)");
+ "Output IVF (default is WebM if WebM IO is enabled)");
static const arg_def_t out_part = ARG_DEF("P", "output-partitions", 0,
"Makes encoder output partitions. Requires IVF output!");
static const arg_def_t q_hist_n = ARG_DEF(NULL, "q-hist", 1,
"Show quantizer histogram (n-buckets)");
static const arg_def_t rate_hist_n = ARG_DEF(NULL, "rate-hist", 1,
"Show rate histogram (n-buckets)");
+static const arg_def_t disable_warnings =
+ ARG_DEF(NULL, "disable-warnings", 0,
+ "Disable warnings about potentially incorrect encode settings.");
+static const arg_def_t disable_warning_prompt =
+ ARG_DEF("y", "disable-warning-prompt", 0,
+ "Display warnings, but do not prompt user to continue.");
+static const arg_def_t experimental_bitstream =
+ ARG_DEF(NULL, "experimental-bitstream", 0,
+ "Allow experimental bitstream features.");
+
+
static const arg_def_t *main_args[] = {
&debugmode,
&outputfile, &codecarg, &passes, &pass_arg, &fpf_name, &limit, &skip,
&deadline, &best_dl, &good_dl, &rt_dl,
- &quietarg, &verbosearg, &psnrarg, &use_ivf, &out_part, &q_hist_n, &rate_hist_n,
+ &quietarg, &verbosearg, &psnrarg, &use_ivf, &out_part, &q_hist_n,
+ &rate_hist_n, &disable_warnings, &disable_warning_prompt,
NULL
};
@@ -532,12 +351,6 @@ static const arg_def_t static_thresh = ARG_DEF(NULL, "static-thresh", 1,
"Motion detection threshold");
static const arg_def_t cpu_used = ARG_DEF(NULL, "cpu-used", 1,
"CPU Used (-16..16)");
-static const arg_def_t token_parts = ARG_DEF(NULL, "token-parts", 1,
- "Number of token partitions to use, log2");
-static const arg_def_t tile_cols = ARG_DEF(NULL, "tile-columns", 1,
- "Number of tile columns to use, log2");
-static const arg_def_t tile_rows = ARG_DEF(NULL, "tile-rows", 1,
- "Number of tile rows to use, log2");
static const arg_def_t auto_altref = ARG_DEF(NULL, "auto-alt-ref", 1,
"Enable automatic alt reference frames");
static const arg_def_t arnr_maxframes = ARG_DEF(NULL, "arnr-maxframes", 1,
@@ -557,13 +370,10 @@ static const arg_def_t cq_level = ARG_DEF(NULL, "cq-level", 1,
"Constant/Constrained Quality level");
static const arg_def_t max_intra_rate_pct = ARG_DEF(NULL, "max-intra-rate", 1,
"Max I-frame bitrate (pct)");
-static const arg_def_t lossless = ARG_DEF(NULL, "lossless", 1, "Lossless mode");
-#if CONFIG_VP9_ENCODER
-static const arg_def_t frame_parallel_decoding = ARG_DEF(
- NULL, "frame-parallel", 1, "Enable frame parallel decodability features");
-#endif
#if CONFIG_VP8_ENCODER
+static const arg_def_t token_parts =
+ ARG_DEF(NULL, "token-parts", 1, "Number of token partitions to use, log2");
static const arg_def_t *vp8_args[] = {
&cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh,
&token_parts, &arnr_maxframes, &arnr_strength, &arnr_type,
@@ -581,11 +391,22 @@ static const int vp8_arg_ctrl_map[] = {
#endif
#if CONFIG_VP9_ENCODER
+static const arg_def_t tile_cols =
+ ARG_DEF(NULL, "tile-columns", 1, "Number of tile columns to use, log2");
+static const arg_def_t tile_rows =
+ ARG_DEF(NULL, "tile-rows", 1, "Number of tile rows to use, log2");
+static const arg_def_t lossless = ARG_DEF(NULL, "lossless", 1, "Lossless mode");
+static const arg_def_t frame_parallel_decoding = ARG_DEF(
+ NULL, "frame-parallel", 1, "Enable frame parallel decodability features");
+static const arg_def_t aq_mode = ARG_DEF(
+ NULL, "aq-mode", 1,
+ "Adaptive q mode (0: off (by default), 1: variance 2: complexity)");
+
static const arg_def_t *vp9_args[] = {
&cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh,
&tile_cols, &tile_rows, &arnr_maxframes, &arnr_strength, &arnr_type,
&tune_ssim, &cq_level, &max_intra_rate_pct, &lossless,
- &frame_parallel_decoding,
+ &frame_parallel_decoding, &aq_mode,
NULL
};
static const int vp9_arg_ctrl_map[] = {
@@ -594,7 +415,7 @@ static const int vp9_arg_ctrl_map[] = {
VP9E_SET_TILE_COLUMNS, VP9E_SET_TILE_ROWS,
VP8E_SET_ARNR_MAXFRAMES, VP8E_SET_ARNR_STRENGTH, VP8E_SET_ARNR_TYPE,
VP8E_SET_TUNING, VP8E_SET_CQ_LEVEL, VP8E_SET_MAX_INTRA_BITRATE_PCT,
- VP9E_SET_LOSSLESS, VP9E_SET_FRAME_PARALLEL_DECODING,
+ VP9E_SET_LOSSLESS, VP9E_SET_FRAME_PARALLEL_DECODING, VP9E_SET_AQ_MODE,
0
};
#endif
@@ -628,304 +449,38 @@ void usage_exit() {
fprintf(stderr, "\nStream timebase (--timebase):\n"
" The desired precision of timestamps in the output, expressed\n"
" in fractional seconds. Default is 1/1000.\n");
- fprintf(stderr, "\n"
- "Included encoders:\n"
- "\n");
+ fprintf(stderr, "\nIncluded encoders:\n\n");
- for (i = 0; i < sizeof(codecs) / sizeof(codecs[0]); i++)
+ for (i = 0; i < get_vpx_encoder_count(); ++i) {
+ const VpxInterface *const encoder = get_vpx_encoder_by_index(i);
fprintf(stderr, " %-6s - %s\n",
- codecs[i].name,
- vpx_codec_iface_name(codecs[i].iface()));
-
- exit(EXIT_FAILURE);
-}
-
-
-#define HIST_BAR_MAX 40
-struct hist_bucket {
- int low, high, count;
-};
-
-
-static int merge_hist_buckets(struct hist_bucket *bucket,
- int *buckets_,
- int max_buckets) {
- int small_bucket = 0, merge_bucket = INT_MAX, big_bucket = 0;
- int buckets = *buckets_;
- int i;
-
- /* Find the extrema for this list of buckets */
- big_bucket = small_bucket = 0;
- for (i = 0; i < buckets; i++) {
- if (bucket[i].count < bucket[small_bucket].count)
- small_bucket = i;
- if (bucket[i].count > bucket[big_bucket].count)
- big_bucket = i;
- }
-
- /* If we have too many buckets, merge the smallest with an adjacent
- * bucket.
- */
- while (buckets > max_buckets) {
- int last_bucket = buckets - 1;
-
- /* merge the small bucket with an adjacent one. */
- if (small_bucket == 0)
- merge_bucket = 1;
- else if (small_bucket == last_bucket)
- merge_bucket = last_bucket - 1;
- else if (bucket[small_bucket - 1].count < bucket[small_bucket + 1].count)
- merge_bucket = small_bucket - 1;
- else
- merge_bucket = small_bucket + 1;
-
- assert(abs(merge_bucket - small_bucket) <= 1);
- assert(small_bucket < buckets);
- assert(big_bucket < buckets);
- assert(merge_bucket < buckets);
-
- if (merge_bucket < small_bucket) {
- bucket[merge_bucket].high = bucket[small_bucket].high;
- bucket[merge_bucket].count += bucket[small_bucket].count;
- } else {
- bucket[small_bucket].high = bucket[merge_bucket].high;
- bucket[small_bucket].count += bucket[merge_bucket].count;
- merge_bucket = small_bucket;
- }
-
- assert(bucket[merge_bucket].low != bucket[merge_bucket].high);
-
- buckets--;
-
- /* Remove the merge_bucket from the list, and find the new small
- * and big buckets while we're at it
- */
- big_bucket = small_bucket = 0;
- for (i = 0; i < buckets; i++) {
- if (i > merge_bucket)
- bucket[i] = bucket[i + 1];
-
- if (bucket[i].count < bucket[small_bucket].count)
- small_bucket = i;
- if (bucket[i].count > bucket[big_bucket].count)
- big_bucket = i;
- }
-
- }
-
- *buckets_ = buckets;
- return bucket[big_bucket].count;
-}
-
-
-static void show_histogram(const struct hist_bucket *bucket,
- int buckets,
- int total,
- int scale) {
- const char *pat1, *pat2;
- int i;
-
- switch ((int)(log(bucket[buckets - 1].high) / log(10)) + 1) {
- case 1:
- case 2:
- pat1 = "%4d %2s: ";
- pat2 = "%4d-%2d: ";
- break;
- case 3:
- pat1 = "%5d %3s: ";
- pat2 = "%5d-%3d: ";
- break;
- case 4:
- pat1 = "%6d %4s: ";
- pat2 = "%6d-%4d: ";
- break;
- case 5:
- pat1 = "%7d %5s: ";
- pat2 = "%7d-%5d: ";
- break;
- case 6:
- pat1 = "%8d %6s: ";
- pat2 = "%8d-%6d: ";
- break;
- case 7:
- pat1 = "%9d %7s: ";
- pat2 = "%9d-%7d: ";
- break;
- default:
- pat1 = "%12d %10s: ";
- pat2 = "%12d-%10d: ";
- break;
+ encoder->name, vpx_codec_iface_name(encoder->interface()));
}
- for (i = 0; i < buckets; i++) {
- int len;
- int j;
- float pct;
-
- pct = (float)(100.0 * bucket[i].count / total);
- len = HIST_BAR_MAX * bucket[i].count / scale;
- if (len < 1)
- len = 1;
- assert(len <= HIST_BAR_MAX);
-
- if (bucket[i].low == bucket[i].high)
- fprintf(stderr, pat1, bucket[i].low, "");
- else
- fprintf(stderr, pat2, bucket[i].low, bucket[i].high);
-
- for (j = 0; j < HIST_BAR_MAX; j++)
- fprintf(stderr, j < len ? "=" : " ");
- fprintf(stderr, "\t%5d (%6.2f%%)\n", bucket[i].count, pct);
- }
-}
-
-
-static void show_q_histogram(const int counts[64], int max_buckets) {
- struct hist_bucket bucket[64];
- int buckets = 0;
- int total = 0;
- int scale;
- int i;
-
-
- for (i = 0; i < 64; i++) {
- if (counts[i]) {
- bucket[buckets].low = bucket[buckets].high = i;
- bucket[buckets].count = counts[i];
- buckets++;
- total += counts[i];
- }
- }
-
- fprintf(stderr, "\nQuantizer Selection:\n");
- scale = merge_hist_buckets(bucket, &buckets, max_buckets);
- show_histogram(bucket, buckets, total, scale);
-}
-
-
-#define RATE_BINS (100)
-struct rate_hist {
- int64_t *pts;
- int *sz;
- int samples;
- int frames;
- struct hist_bucket bucket[RATE_BINS];
- int total;
-};
-
-
-static void init_rate_histogram(struct rate_hist *hist,
- const vpx_codec_enc_cfg_t *cfg,
- const vpx_rational_t *fps) {
- int i;
-
- /* Determine the number of samples in the buffer. Use the file's framerate
- * to determine the number of frames in rc_buf_sz milliseconds, with an
- * adjustment (5/4) to account for alt-refs
- */
- hist->samples = cfg->rc_buf_sz * 5 / 4 * fps->num / fps->den / 1000;
-
- /* prevent division by zero */
- if (hist->samples == 0)
- hist->samples = 1;
-
- hist->pts = calloc(hist->samples, sizeof(*hist->pts));
- hist->sz = calloc(hist->samples, sizeof(*hist->sz));
- for (i = 0; i < RATE_BINS; i++) {
- hist->bucket[i].low = INT_MAX;
- hist->bucket[i].high = 0;
- hist->bucket[i].count = 0;
- }
-}
-
-
-static void destroy_rate_histogram(struct rate_hist *hist) {
- free(hist->pts);
- free(hist->sz);
-}
-
-
-static void update_rate_histogram(struct rate_hist *hist,
- const vpx_codec_enc_cfg_t *cfg,
- const vpx_codec_cx_pkt_t *pkt) {
- int i, idx;
- int64_t now, then, sum_sz = 0, avg_bitrate;
-
- now = pkt->data.frame.pts * 1000
- * (uint64_t)cfg->g_timebase.num / (uint64_t)cfg->g_timebase.den;
-
- idx = hist->frames++ % hist->samples;
- hist->pts[idx] = now;
- hist->sz[idx] = (int)pkt->data.frame.sz;
-
- if (now < cfg->rc_buf_initial_sz)
- return;
-
- then = now;
-
- /* Sum the size over the past rc_buf_sz ms */
- for (i = hist->frames; i > 0 && hist->frames - i < hist->samples; i--) {
- int i_idx = (i - 1) % hist->samples;
-
- then = hist->pts[i_idx];
- if (now - then > cfg->rc_buf_sz)
- break;
- sum_sz += hist->sz[i_idx];
- }
-
- if (now == then)
- return;
-
- avg_bitrate = sum_sz * 8 * 1000 / (now - then);
- idx = (int)(avg_bitrate * (RATE_BINS / 2) / (cfg->rc_target_bitrate * 1000));
- if (idx < 0)
- idx = 0;
- if (idx > RATE_BINS - 1)
- idx = RATE_BINS - 1;
- if (hist->bucket[idx].low > avg_bitrate)
- hist->bucket[idx].low = (int)avg_bitrate;
- if (hist->bucket[idx].high < avg_bitrate)
- hist->bucket[idx].high = (int)avg_bitrate;
- hist->bucket[idx].count++;
- hist->total++;
-}
-
-
-static void show_rate_histogram(struct rate_hist *hist,
- const vpx_codec_enc_cfg_t *cfg,
- int max_buckets) {
- int i, scale;
- int buckets = 0;
-
- for (i = 0; i < RATE_BINS; i++) {
- if (hist->bucket[i].low == INT_MAX)
- continue;
- hist->bucket[buckets++] = hist->bucket[i];
- }
-
- fprintf(stderr, "\nRate (over %dms window):\n", cfg->rc_buf_sz);
- scale = merge_hist_buckets(hist->bucket, &buckets, max_buckets);
- show_histogram(hist->bucket, buckets, hist->total, scale);
+ exit(EXIT_FAILURE);
}
#define mmin(a, b) ((a) < (b) ? (a) : (b))
-static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
+static void find_mismatch(const vpx_image_t *const img1,
+ const vpx_image_t *const img2,
int yloc[4], int uloc[4], int vloc[4]) {
- const unsigned int bsize = 64;
- const unsigned int bsizey = bsize >> img1->y_chroma_shift;
- const unsigned int bsizex = bsize >> img1->x_chroma_shift;
- const int c_w = (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
- const int c_h = (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift;
- unsigned int match = 1;
- unsigned int i, j;
+ const uint32_t bsize = 64;
+ const uint32_t bsizey = bsize >> img1->y_chroma_shift;
+ const uint32_t bsizex = bsize >> img1->x_chroma_shift;
+ const uint32_t c_w =
+ (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
+ const uint32_t c_h =
+ (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift;
+ int match = 1;
+ uint32_t i, j;
yloc[0] = yloc[1] = yloc[2] = yloc[3] = -1;
for (i = 0, match = 1; match && i < img1->d_h; i += bsize) {
for (j = 0; match && j < img1->d_w; j += bsize) {
int k, l;
- int si = mmin(i + bsize, img1->d_h) - i;
- int sj = mmin(j + bsize, img1->d_w) - j;
- for (k = 0; match && k < si; k++)
- for (l = 0; match && l < sj; l++) {
+ const int si = mmin(i + bsize, img1->d_h) - i;
+ const int sj = mmin(j + bsize, img1->d_w) - j;
+ for (k = 0; match && k < si; ++k) {
+ for (l = 0; match && l < sj; ++l) {
if (*(img1->planes[VPX_PLANE_Y] +
(i + k) * img1->stride[VPX_PLANE_Y] + j + l) !=
*(img2->planes[VPX_PLANE_Y] +
@@ -940,6 +495,7 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
break;
}
}
+ }
}
}
@@ -947,10 +503,10 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
for (i = 0, match = 1; match && i < c_h; i += bsizey) {
for (j = 0; match && j < c_w; j += bsizex) {
int k, l;
- int si = mmin(i + bsizey, c_h - i);
- int sj = mmin(j + bsizex, c_w - j);
- for (k = 0; match && k < si; k++)
- for (l = 0; match && l < sj; l++) {
+ const int si = mmin(i + bsizey, c_h - i);
+ const int sj = mmin(j + bsizex, c_w - j);
+ for (k = 0; match && k < si; ++k) {
+ for (l = 0; match && l < sj; ++l) {
if (*(img1->planes[VPX_PLANE_U] +
(i + k) * img1->stride[VPX_PLANE_U] + j + l) !=
*(img2->planes[VPX_PLANE_U] +
@@ -960,21 +516,22 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
uloc[2] = *(img1->planes[VPX_PLANE_U] +
(i + k) * img1->stride[VPX_PLANE_U] + j + l);
uloc[3] = *(img2->planes[VPX_PLANE_U] +
- (i + k) * img2->stride[VPX_PLANE_V] + j + l);
+ (i + k) * img2->stride[VPX_PLANE_U] + j + l);
match = 0;
break;
}
}
+ }
}
}
vloc[0] = vloc[1] = vloc[2] = vloc[3] = -1;
for (i = 0, match = 1; match && i < c_h; i += bsizey) {
for (j = 0; match && j < c_w; j += bsizex) {
int k, l;
- int si = mmin(i + bsizey, c_h - i);
- int sj = mmin(j + bsizex, c_w - j);
- for (k = 0; match && k < si; k++)
- for (l = 0; match && l < sj; l++) {
+ const int si = mmin(i + bsizey, c_h - i);
+ const int sj = mmin(j + bsizex, c_w - j);
+ for (k = 0; match && k < si; ++k) {
+ for (l = 0; match && l < sj; ++l) {
if (*(img1->planes[VPX_PLANE_V] +
(i + k) * img1->stride[VPX_PLANE_V] + j + l) !=
*(img2->planes[VPX_PLANE_V] +
@@ -989,34 +546,37 @@ static void find_mismatch(vpx_image_t *img1, vpx_image_t *img2,
break;
}
}
+ }
}
}
}
-static int compare_img(vpx_image_t *img1, vpx_image_t *img2)
-{
- const int c_w = (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
- const int c_h = (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift;
+static int compare_img(const vpx_image_t *const img1,
+ const vpx_image_t *const img2) {
+ const uint32_t c_w =
+ (img1->d_w + img1->x_chroma_shift) >> img1->x_chroma_shift;
+ const uint32_t c_h =
+ (img1->d_h + img1->y_chroma_shift) >> img1->y_chroma_shift;
+ uint32_t i;
int match = 1;
- unsigned int i;
match &= (img1->fmt == img2->fmt);
- match &= (img1->w == img2->w);
- match &= (img1->h == img2->h);
+ match &= (img1->d_w == img2->d_w);
+ match &= (img1->d_h == img2->d_h);
- for (i = 0; i < img1->d_h; i++)
- match &= (memcmp(img1->planes[VPX_PLANE_Y]+i*img1->stride[VPX_PLANE_Y],
- img2->planes[VPX_PLANE_Y]+i*img2->stride[VPX_PLANE_Y],
+ for (i = 0; i < img1->d_h; ++i)
+ match &= (memcmp(img1->planes[VPX_PLANE_Y] + i * img1->stride[VPX_PLANE_Y],
+ img2->planes[VPX_PLANE_Y] + i * img2->stride[VPX_PLANE_Y],
img1->d_w) == 0);
- for (i = 0; i < c_h; i++)
- match &= (memcmp(img1->planes[VPX_PLANE_U]+i*img1->stride[VPX_PLANE_U],
- img2->planes[VPX_PLANE_U]+i*img2->stride[VPX_PLANE_U],
+ for (i = 0; i < c_h; ++i)
+ match &= (memcmp(img1->planes[VPX_PLANE_U] + i * img1->stride[VPX_PLANE_U],
+ img2->planes[VPX_PLANE_U] + i * img2->stride[VPX_PLANE_U],
c_w) == 0);
- for (i = 0; i < c_h; i++)
- match &= (memcmp(img1->planes[VPX_PLANE_V]+i*img1->stride[VPX_PLANE_U],
- img2->planes[VPX_PLANE_V]+i*img2->stride[VPX_PLANE_U],
+ for (i = 0; i < c_h; ++i)
+ match &= (memcmp(img1->planes[VPX_PLANE_V] + i * img1->stride[VPX_PLANE_V],
+ img2->planes[VPX_PLANE_V] + i * img2->stride[VPX_PLANE_V],
c_w) == 0);
return match;
@@ -1034,29 +594,6 @@ static int compare_img(vpx_image_t *img1, vpx_image_t *img2)
NELEMENTS(vp9_arg_ctrl_map))
#endif
-/* Configuration elements common to all streams */
-struct global_config {
- const struct codec_item *codec;
- int passes;
- int pass;
- int usage;
- int deadline;
- int use_i420;
- int quiet;
- int verbose;
- int limit;
- int skip_frames;
- int show_psnr;
- enum TestDecodeFatality test_decode;
- int have_framerate;
- struct vpx_rational framerate;
- int out_part;
- int debug;
- int show_q_hist_buckets;
- int show_rate_hist_buckets;
-};
-
-
/* Per-stream configuration */
struct stream_config {
struct vpx_codec_enc_cfg cfg;
@@ -1075,7 +612,7 @@ struct stream_state {
struct stream_state *next;
struct stream_config config;
FILE *file;
- struct rate_hist rate_hist;
+ struct rate_hist *rate_hist;
struct EbmlGlobal ebml;
uint32_t hash;
uint64_t psnr_sse_total;
@@ -1109,13 +646,13 @@ void validate_positive_rational(const char *msg,
}
-static void parse_global_config(struct global_config *global, char **argv) {
+static void parse_global_config(struct VpxEncoderConfig *global, char **argv) {
char **argi, **argj;
struct arg arg;
/* Initialize default parameters */
memset(global, 0, sizeof(*global));
- global->codec = codecs;
+ global->codec = get_vpx_encoder_by_index(0);
global->passes = 0;
global->use_i420 = 1;
/* Assign default deadline to good quality */
@@ -1125,18 +662,9 @@ static void parse_global_config(struct global_config *global, char **argv) {
arg.argv_step = 1;
if (arg_match(&arg, &codecarg, argi)) {
- int j, k = -1;
-
- for (j = 0; j < sizeof(codecs) / sizeof(codecs[0]); j++)
- if (!strcmp(codecs[j].name, arg.val))
- k = j;
-
- if (k >= 0)
- global->codec = codecs + k;
- else
- die("Error: Unrecognized argument (%s) to --codec\n",
- arg.val);
-
+ global->codec = get_vpx_encoder_by_name(arg.val);
+ if (!global->codec)
+ die("Error: Unrecognized argument (%s) to --codec\n", arg.val);
} else if (arg_match(&arg, &passes, argi)) {
global->passes = arg_parse_uint(&arg);
@@ -1186,38 +714,48 @@ static void parse_global_config(struct global_config *global, char **argv) {
global->show_q_hist_buckets = arg_parse_uint(&arg);
else if (arg_match(&arg, &rate_hist_n, argi))
global->show_rate_hist_buckets = arg_parse_uint(&arg);
+ else if (arg_match(&arg, &disable_warnings, argi))
+ global->disable_warnings = 1;
+ else if (arg_match(&arg, &disable_warning_prompt, argi))
+ global->disable_warning_prompt = 1;
+ else if (arg_match(&arg, &experimental_bitstream, argi))
+ global->experimental_bitstream = 1;
else
argj++;
}
+ if (global->pass) {
+ /* DWIM: Assume the user meant passes=2 if pass=2 is specified */
+ if (global->pass > global->passes) {
+ warn("Assuming --pass=%d implies --passes=%d\n",
+ global->pass, global->pass);
+ global->passes = global->pass;
+ }
+ }
/* Validate global config */
if (global->passes == 0) {
#if CONFIG_VP9_ENCODER
// Make default VP9 passes = 2 until there is a better quality 1-pass
// encoder
- global->passes = (global->codec->iface == vpx_codec_vp9_cx ? 2 : 1);
+ global->passes = (strcmp(global->codec->name, "vp9") == 0 &&
+ global->deadline != VPX_DL_REALTIME) ? 2 : 1;
#else
global->passes = 1;
#endif
}
- if (global->pass) {
- /* DWIM: Assume the user meant passes=2 if pass=2 is specified */
- if (global->pass > global->passes) {
- warn("Assuming --pass=%d implies --passes=%d\n",
- global->pass, global->pass);
- global->passes = global->pass;
- }
+ if (global->deadline == VPX_DL_REALTIME &&
+ global->passes > 1) {
+ warn("Enforcing one-pass encoding in realtime mode\n");
+ global->passes = 1;
}
}
-void open_input_file(struct input_state *input) {
- unsigned int fourcc;
-
+void open_input_file(struct VpxInputContext *input) {
/* Parse certain options from the input file, if possible */
- input->file = strcmp(input->fn, "-") ? fopen(input->fn, "rb")
- : set_binary_mode(stdin);
+ input->file = strcmp(input->filename, "-")
+ ? fopen(input->filename, "rb") : set_binary_mode(stdin);
if (!input->file)
fatal("Failed to open input file");
@@ -1237,18 +775,18 @@ void open_input_file(struct input_state *input) {
input->detect.position = 0;
if (input->detect.buf_read == 4
- && file_is_y4m(input->file, &input->y4m, input->detect.buf)) {
+ && file_is_y4m(input->detect.buf)) {
if (y4m_input_open(&input->y4m, input->file, input->detect.buf, 4,
input->only_i420) >= 0) {
input->file_type = FILE_TYPE_Y4M;
- input->w = input->y4m.pic_w;
- input->h = input->y4m.pic_h;
- input->framerate.num = input->y4m.fps_n;
- input->framerate.den = input->y4m.fps_d;
+ input->width = input->y4m.pic_w;
+ input->height = input->y4m.pic_h;
+ input->framerate.numerator = input->y4m.fps_n;
+ input->framerate.denominator = input->y4m.fps_d;
input->use_i420 = 0;
} else
fatal("Unsupported Y4M stream.");
- } else if (input->detect.buf_read == 4 && file_is_ivf(input, &fourcc)) {
+ } else if (input->detect.buf_read == 4 && fourcc_is_ivf(input->detect.buf)) {
fatal("IVF is not supported as input.");
} else {
input->file_type = FILE_TYPE_RAW;
@@ -1256,13 +794,13 @@ void open_input_file(struct input_state *input) {
}
-static void close_input_file(struct input_state *input) {
+static void close_input_file(struct VpxInputContext *input) {
fclose(input->file);
if (input->file_type == FILE_TYPE_Y4M)
y4m_input_close(&input->y4m);
}
-static struct stream_state *new_stream(struct global_config *global,
+static struct stream_state *new_stream(struct VpxEncoderConfig *global,
struct stream_state *prev) {
struct stream_state *stream;
@@ -1277,7 +815,7 @@ static struct stream_state *new_stream(struct global_config *global,
vpx_codec_err_t res;
/* Populate encoder configuration */
- res = vpx_codec_enc_config_default(global->codec->iface(),
+ res = vpx_codec_enc_config_default(global->codec->interface(),
&stream->config.cfg,
global->usage);
if (res)
@@ -1297,10 +835,16 @@ static struct stream_state *new_stream(struct global_config *global,
/* Initialize remaining stream parameters */
stream->config.stereo_fmt = STEREO_FORMAT_MONO;
stream->config.write_webm = 1;
+#if CONFIG_WEBM_IO
stream->ebml.last_pts_ms = -1;
+#endif
/* Allows removal of the application version from the EBML tags */
stream->ebml.debug = global->debug;
+
+ /* Default lag_in_frames is 0 in realtime mode */
+ if (global->deadline == VPX_DL_REALTIME)
+ stream->config.cfg.g_lag_in_frames = 0;
}
/* Output files must be specified for each stream */
@@ -1311,7 +855,7 @@ static struct stream_state *new_stream(struct global_config *global,
}
-static int parse_stream_params(struct global_config *global,
+static int parse_stream_params(struct VpxEncoderConfig *global,
struct stream_state *stream,
char **argv) {
char **argi, **argj;
@@ -1321,15 +865,15 @@ static int parse_stream_params(struct global_config *global,
struct stream_config *config = &stream->config;
int eos_mark_found = 0;
- /* Handle codec specific options */
+ // Handle codec specific options
if (0) {
#if CONFIG_VP8_ENCODER
- } else if (global->codec->iface == vpx_codec_vp8_cx) {
+ } else if (strcmp(global->codec->name, "vp8") == 0) {
ctrl_args = vp8_args;
ctrl_args_map = vp8_arg_ctrl_map;
#endif
#if CONFIG_VP9_ENCODER
- } else if (global->codec->iface == vpx_codec_vp9_cx) {
+ } else if (strcmp(global->codec->name, "vp9") == 0) {
ctrl_args = vp9_args;
ctrl_args_map = vp9_arg_ctrl_map;
#endif
@@ -1349,59 +893,63 @@ static int parse_stream_params(struct global_config *global,
continue;
}
- if (0);
- else if (arg_match(&arg, &outputfile, argi))
+ if (0) {
+ } else if (arg_match(&arg, &outputfile, argi)) {
config->out_fn = arg.val;
- else if (arg_match(&arg, &fpf_name, argi))
+ } else if (arg_match(&arg, &fpf_name, argi)) {
config->stats_fn = arg.val;
- else if (arg_match(&arg, &use_ivf, argi))
+ } else if (arg_match(&arg, &use_ivf, argi)) {
config->write_webm = 0;
- else if (arg_match(&arg, &threads, argi))
+ } else if (arg_match(&arg, &threads, argi)) {
config->cfg.g_threads = arg_parse_uint(&arg);
- else if (arg_match(&arg, &profile, argi))
+ } else if (arg_match(&arg, &profile, argi)) {
config->cfg.g_profile = arg_parse_uint(&arg);
- else if (arg_match(&arg, &width, argi))
+ } else if (arg_match(&arg, &width, argi)) {
config->cfg.g_w = arg_parse_uint(&arg);
- else if (arg_match(&arg, &height, argi))
+ } else if (arg_match(&arg, &height, argi)) {
config->cfg.g_h = arg_parse_uint(&arg);
- else if (arg_match(&arg, &stereo_mode, argi))
+ } else if (arg_match(&arg, &stereo_mode, argi)) {
config->stereo_fmt = arg_parse_enum_or_int(&arg);
- else if (arg_match(&arg, &timebase, argi)) {
+ } else if (arg_match(&arg, &timebase, argi)) {
config->cfg.g_timebase = arg_parse_rational(&arg);
validate_positive_rational(arg.name, &config->cfg.g_timebase);
- } else if (arg_match(&arg, &error_resilient, argi))
+ } else if (arg_match(&arg, &error_resilient, argi)) {
config->cfg.g_error_resilient = arg_parse_uint(&arg);
- else if (arg_match(&arg, &lag_in_frames, argi))
+ } else if (arg_match(&arg, &lag_in_frames, argi)) {
config->cfg.g_lag_in_frames = arg_parse_uint(&arg);
- else if (arg_match(&arg, &dropframe_thresh, argi))
+ if (global->deadline == VPX_DL_REALTIME &&
+ config->cfg.g_lag_in_frames != 0) {
+ warn("non-zero %s option ignored in realtime mode.\n", arg.name);
+ config->cfg.g_lag_in_frames = 0;
+ }
+ } else if (arg_match(&arg, &dropframe_thresh, argi)) {
config->cfg.rc_dropframe_thresh = arg_parse_uint(&arg);
- else if (arg_match(&arg, &resize_allowed, argi))
+ } else if (arg_match(&arg, &resize_allowed, argi)) {
config->cfg.rc_resize_allowed = arg_parse_uint(&arg);
- else if (arg_match(&arg, &resize_up_thresh, argi))
+ } else if (arg_match(&arg, &resize_up_thresh, argi)) {
config->cfg.rc_resize_up_thresh = arg_parse_uint(&arg);
- else if (arg_match(&arg, &resize_down_thresh, argi))
+ } else if (arg_match(&arg, &resize_down_thresh, argi)) {
config->cfg.rc_resize_down_thresh = arg_parse_uint(&arg);
- else if (arg_match(&arg, &end_usage, argi))
+ } else if (arg_match(&arg, &end_usage, argi)) {
config->cfg.rc_end_usage = arg_parse_enum_or_int(&arg);
- else if (arg_match(&arg, &target_bitrate, argi))
+ } else if (arg_match(&arg, &target_bitrate, argi)) {
config->cfg.rc_target_bitrate = arg_parse_uint(&arg);
- else if (arg_match(&arg, &min_quantizer, argi))
+ } else if (arg_match(&arg, &min_quantizer, argi)) {
config->cfg.rc_min_quantizer = arg_parse_uint(&arg);
- else if (arg_match(&arg, &max_quantizer, argi))
+ } else if (arg_match(&arg, &max_quantizer, argi)) {
config->cfg.rc_max_quantizer = arg_parse_uint(&arg);
- else if (arg_match(&arg, &undershoot_pct, argi))
+ } else if (arg_match(&arg, &undershoot_pct, argi)) {
config->cfg.rc_undershoot_pct = arg_parse_uint(&arg);
- else if (arg_match(&arg, &overshoot_pct, argi))
+ } else if (arg_match(&arg, &overshoot_pct, argi)) {
config->cfg.rc_overshoot_pct = arg_parse_uint(&arg);
- else if (arg_match(&arg, &buf_sz, argi))
+ } else if (arg_match(&arg, &buf_sz, argi)) {
config->cfg.rc_buf_sz = arg_parse_uint(&arg);
- else if (arg_match(&arg, &buf_initial_sz, argi))
+ } else if (arg_match(&arg, &buf_initial_sz, argi)) {
config->cfg.rc_buf_initial_sz = arg_parse_uint(&arg);
- else if (arg_match(&arg, &buf_optimal_sz, argi))
+ } else if (arg_match(&arg, &buf_optimal_sz, argi)) {
config->cfg.rc_buf_optimal_sz = arg_parse_uint(&arg);
- else if (arg_match(&arg, &bias_pct, argi)) {
- config->cfg.rc_2pass_vbr_bias_pct = arg_parse_uint(&arg);
-
+ } else if (arg_match(&arg, &bias_pct, argi)) {
+ config->cfg.rc_2pass_vbr_bias_pct = arg_parse_uint(&arg);
if (global->passes < 2)
warn("option %s ignored in one-pass mode.\n", arg.name);
} else if (arg_match(&arg, &minsection_pct, argi)) {
@@ -1414,16 +962,15 @@ static int parse_stream_params(struct global_config *global,
if (global->passes < 2)
warn("option %s ignored in one-pass mode.\n", arg.name);
- } else if (arg_match(&arg, &kf_min_dist, argi))
+ } else if (arg_match(&arg, &kf_min_dist, argi)) {
config->cfg.kf_min_dist = arg_parse_uint(&arg);
- else if (arg_match(&arg, &kf_max_dist, argi)) {
+ } else if (arg_match(&arg, &kf_max_dist, argi)) {
config->cfg.kf_max_dist = arg_parse_uint(&arg);
config->have_kf_max_dist = 1;
- } else if (arg_match(&arg, &kf_disabled, argi))
+ } else if (arg_match(&arg, &kf_disabled, argi)) {
config->cfg.kf_mode = VPX_KF_DISABLED;
- else {
+ } else {
int i, match = 0;
-
for (i = 0; ctrl_args[i]; i++) {
if (arg_match(&arg, ctrl_args[i], argi)) {
int j;
@@ -1447,33 +994,37 @@ static int parse_stream_params(struct global_config *global,
}
}
-
if (!match)
argj++;
}
}
-
return eos_mark_found;
}
-#define FOREACH_STREAM(func)\
- do\
- {\
- struct stream_state *stream;\
- \
- for(stream = streams; stream; stream = stream->next)\
- func;\
- }while(0)
+#define FOREACH_STREAM(func) \
+ do { \
+ struct stream_state *stream; \
+ for (stream = streams; stream; stream = stream->next) { \
+ func; \
+ } \
+ } while (0)
-static void validate_stream_config(struct stream_state *stream) {
- struct stream_state *streami;
+static void validate_stream_config(const struct stream_state *stream,
+ const struct VpxEncoderConfig *global) {
+ const struct stream_state *streami;
if (!stream->config.cfg.g_w || !stream->config.cfg.g_h)
fatal("Stream %d: Specify stream dimensions with --width (-w) "
" and --height (-h)", stream->index);
+ if (stream->config.cfg.g_profile != 0 && !global->experimental_bitstream) {
+ fatal("Stream %d: profile %d is experimental and requires the --%s flag",
+ stream->index, stream->config.cfg.g_profile,
+ experimental_bitstream.long_name);
+ }
+
for (streami = stream; streami; streami = streami->next) {
/* All streams require output files */
if (!streami->config.out_fn)
@@ -1516,8 +1067,8 @@ static void set_stream_dimensions(struct stream_state *stream,
}
-static void set_default_kf_interval(struct stream_state *stream,
- struct global_config *global) {
+static void set_default_kf_interval(struct stream_state *stream,
+ struct VpxEncoderConfig *global) {
/* Use a max keyframe interval of 5 seconds, if none was
* specified on the command line.
*/
@@ -1529,17 +1080,17 @@ static void set_default_kf_interval(struct stream_state *stream,
}
-static void show_stream_config(struct stream_state *stream,
- struct global_config *global,
- struct input_state *input) {
+static void show_stream_config(struct stream_state *stream,
+ struct VpxEncoderConfig *global,
+ struct VpxInputContext *input) {
#define SHOW(field) \
fprintf(stderr, " %-28s = %d\n", #field, stream->config.cfg.field)
if (stream->index == 0) {
fprintf(stderr, "Codec: %s\n",
- vpx_codec_iface_name(global->codec->iface()));
- fprintf(stderr, "Source file: %s Format: %s\n", input->fn,
+ vpx_codec_iface_name(global->codec->interface()));
+ fprintf(stderr, "Source file: %s Format: %s\n", input->filename,
input->use_i420 ? "I420" : "YV12");
}
if (stream->next || stream->index)
@@ -1580,8 +1131,12 @@ static void show_stream_config(struct stream_state *stream,
static void open_output_file(struct stream_state *stream,
- struct global_config *global) {
+ struct VpxEncoderConfig *global) {
const char *fn = stream->config.out_fn;
+ const struct vpx_codec_enc_cfg *const cfg = &stream->config.cfg;
+
+ if (cfg->g_pass == VPX_RC_FIRST_PASS)
+ return;
stream->file = strcmp(fn, "-") ? fopen(fn, "wb") : set_binary_mode(stdout);
@@ -1591,27 +1146,40 @@ static void open_output_file(struct stream_state *stream,
if (stream->config.write_webm && fseek(stream->file, 0, SEEK_CUR))
fatal("WebM output to pipes not supported.");
+#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
stream->ebml.stream = stream->file;
- write_webm_file_header(&stream->ebml, &stream->config.cfg,
+ write_webm_file_header(&stream->ebml, cfg,
&global->framerate,
stream->config.stereo_fmt,
global->codec->fourcc);
- } else
- write_ivf_file_header(stream->file, &stream->config.cfg,
- global->codec->fourcc, 0);
+ }
+#endif
+
+ if (!stream->config.write_webm) {
+ ivf_write_file_header(stream->file, cfg, global->codec->fourcc, 0);
+ }
}
static void close_output_file(struct stream_state *stream,
- unsigned int fourcc) {
+ unsigned int fourcc) {
+ const struct vpx_codec_enc_cfg *const cfg = &stream->config.cfg;
+
+ if (cfg->g_pass == VPX_RC_FIRST_PASS)
+ return;
+
+#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
write_webm_file_footer(&stream->ebml, stream->hash);
free(stream->ebml.cue_list);
stream->ebml.cue_list = NULL;
- } else {
+ }
+#endif
+
+ if (!stream->config.write_webm) {
if (!fseek(stream->file, 0, SEEK_SET))
- write_ivf_file_header(stream->file, &stream->config.cfg,
+ ivf_write_file_header(stream->file, &stream->config.cfg,
fourcc,
stream->frames_out);
}
@@ -1620,9 +1188,9 @@ static void close_output_file(struct stream_state *stream,
}
-static void setup_pass(struct stream_state *stream,
- struct global_config *global,
- int pass) {
+static void setup_pass(struct stream_state *stream,
+ struct VpxEncoderConfig *global,
+ int pass) {
if (stream->config.stats_fn) {
if (!stats_open_file(&stream->stats, stream->config.stats_fn,
pass))
@@ -1644,8 +1212,8 @@ static void setup_pass(struct stream_state *stream,
}
-static void initialize_encoder(struct stream_state *stream,
- struct global_config *global) {
+static void initialize_encoder(struct stream_state *stream,
+ struct VpxEncoderConfig *global) {
int i;
int flags = 0;
@@ -1653,7 +1221,7 @@ static void initialize_encoder(struct stream_state *stream,
flags |= global->out_part ? VPX_CODEC_USE_OUTPUT_PARTITION : 0;
/* Construct Encoder Context */
- vpx_codec_enc_init(&stream->encoder, global->codec->iface(),
+ vpx_codec_enc_init(&stream->encoder, global->codec->interface(),
&stream->config.cfg, flags);
ctx_exit_on_error(&stream->encoder, "Failed to initialize encoder");
@@ -1673,16 +1241,17 @@ static void initialize_encoder(struct stream_state *stream,
#if CONFIG_DECODERS
if (global->test_decode != TEST_DECODE_OFF) {
- vpx_codec_dec_init(&stream->decoder, global->codec->dx_iface(), NULL, 0);
+ const VpxInterface *decoder = get_vpx_decoder_by_name(global->codec->name);
+ vpx_codec_dec_init(&stream->decoder, decoder->interface(), NULL, 0);
}
#endif
}
-static void encode_frame(struct stream_state *stream,
- struct global_config *global,
- struct vpx_image *img,
- unsigned int frames_in) {
+static void encode_frame(struct stream_state *stream,
+ struct VpxEncoderConfig *global,
+ struct vpx_image *img,
+ unsigned int frames_in) {
vpx_codec_pts_t frame_start, next_frame_start;
struct vpx_codec_enc_cfg *cfg = &stream->config.cfg;
struct vpx_usec_timer timer;
@@ -1737,9 +1306,9 @@ static void update_quantizer_histogram(struct stream_state *stream) {
}
-static void get_cx_data(struct stream_state *stream,
- struct global_config *global,
- int *got_data) {
+static void get_cx_data(struct stream_state *stream,
+ struct VpxEncoderConfig *global,
+ int *got_data) {
const vpx_codec_cx_pkt_t *pkt;
const struct vpx_codec_enc_cfg *cfg = &stream->config.cfg;
vpx_codec_iter_t iter = NULL;
@@ -1757,7 +1326,8 @@ static void get_cx_data(struct stream_state *stream,
if (!global->quiet)
fprintf(stderr, " %6luF", (unsigned long)pkt->data.frame.sz);
- update_rate_histogram(&stream->rate_hist, cfg, pkt);
+ update_rate_histogram(stream->rate_hist, cfg, pkt);
+#if CONFIG_WEBM_IO
if (stream->config.write_webm) {
/* Update the hash */
if (!stream->ebml.debug)
@@ -1766,19 +1336,21 @@ static void get_cx_data(struct stream_state *stream,
stream->hash);
write_webm_block(&stream->ebml, cfg, pkt);
- } else {
+ }
+#endif
+ if (!stream->config.write_webm) {
if (pkt->data.frame.partition_id <= 0) {
ivf_header_pos = ftello(stream->file);
fsize = pkt->data.frame.sz;
- write_ivf_frame_header(stream->file, pkt);
+ ivf_write_frame_header(stream->file, pkt->data.frame.pts, fsize);
} else {
fsize += pkt->data.frame.sz;
if (!(pkt->data.frame.flags & VPX_FRAME_IS_FRAGMENT)) {
off_t currpos = ftello(stream->file);
fseeko(stream->file, ivf_header_pos, SEEK_SET);
- write_ivf_frame_size(stream->file, fsize);
+ ivf_write_frame_size(stream->file, fsize);
fseeko(stream->file, currpos, SEEK_SET);
}
}
@@ -1792,7 +1364,7 @@ static void get_cx_data(struct stream_state *stream,
#if CONFIG_DECODERS
if (global->test_decode != TEST_DECODE_OFF && !stream->mismatch_seen) {
vpx_codec_decode(&stream->decoder, pkt->data.frame.buf,
- pkt->data.frame.sz, NULL, 0);
+ (unsigned int)pkt->data.frame.sz, NULL, 0);
if (stream->decoder.err) {
warn_or_exit_on_error(&stream->decoder,
global->test_decode == TEST_DECODE_FATAL,
@@ -1841,8 +1413,8 @@ static void show_psnr(struct stream_state *stream) {
return;
fprintf(stderr, "Stream %d PSNR (Overall/Avg/Y/U/V)", stream->index);
- ovpsnr = vp8_mse2psnr((double)stream->psnr_samples_total, 255.0,
- (double)stream->psnr_sse_total);
+ ovpsnr = sse_to_psnr((double)stream->psnr_samples_total, 255.0,
+ (double)stream->psnr_sse_total);
fprintf(stderr, " %.3f", ovpsnr);
for (i = 0; i < 4; i++) {
@@ -1859,14 +1431,14 @@ static float usec_to_fps(uint64_t usec, unsigned int frames) {
static void test_decode(struct stream_state *stream,
enum TestDecodeFatality fatal,
- const struct codec_item *codec) {
+ const VpxInterface *codec) {
vpx_image_t enc_img, dec_img;
if (stream->mismatch_seen)
return;
/* Get the internal reference frame */
- if (codec->fourcc == VP8_FOURCC) {
+ if (strcmp(codec->name, "vp8") == 0) {
struct vpx_ref_frame ref_enc, ref_dec;
int width, height;
@@ -1915,7 +1487,9 @@ static void test_decode(struct stream_state *stream,
static void print_time(const char *label, int64_t etl) {
- int hours, mins, secs;
+ int64_t hours;
+ int64_t mins;
+ int64_t secs;
if (etl >= 0) {
hours = etl / 3600;
@@ -1924,25 +1498,26 @@ static void print_time(const char *label, int64_t etl) {
etl -= mins * 60;
secs = etl;
- fprintf(stderr, "[%3s %2d:%02d:%02d] ",
+ fprintf(stderr, "[%3s %2"PRId64":%02"PRId64": % 02"PRId64"] ",
label, hours, mins, secs);
} else {
fprintf(stderr, "[%3s unknown] ", label);
}
}
+
int main(int argc, const char **argv_) {
- int pass;
- vpx_image_t raw;
- int frame_avail, got_data;
-
- struct input_state input = {0};
- struct global_config global;
- struct stream_state *streams = NULL;
- char **argv, **argi;
- uint64_t cx_time = 0;
- int stream_cnt = 0;
- int res = 0;
+ int pass;
+ vpx_image_t raw;
+ int frame_avail, got_data;
+
+ struct VpxInputContext input = {0};
+ struct VpxEncoderConfig global;
+ struct stream_state *streams = NULL;
+ char **argv, **argi;
+ uint64_t cx_time = 0;
+ int stream_cnt = 0;
+ int res = 0;
exec_name = argv_[0];
@@ -1950,8 +1525,8 @@ int main(int argc, const char **argv_) {
usage_exit();
/* Setup default input stream settings */
- input.framerate.num = 30;
- input.framerate.den = 1;
+ input.framerate.numerator = 30;
+ input.framerate.denominator = 1;
input.use_i420 = 1;
input.only_i420 = 1;
@@ -1962,6 +1537,7 @@ int main(int argc, const char **argv_) {
argv = argv_dup(argc - 1, argv_ + 1);
parse_global_config(&global, argv);
+
{
/* Now parse each stream's parameters. Using a local scope here
* due to the use of 'stream' as loop variable in FOREACH_STREAM
@@ -1982,17 +1558,18 @@ int main(int argc, const char **argv_) {
if (argi[0][0] == '-' && argi[0][1])
die("Error: Unrecognized option %s\n", *argi);
+ FOREACH_STREAM(check_encoder_config(global.disable_warning_prompt,
+ &global, &stream->config.cfg););
+
/* Handle non-option arguments */
- input.fn = argv[0];
+ input.filename = argv[0];
- if (!input.fn)
+ if (!input.filename)
usage_exit();
-#if CONFIG_NON420
/* Decide if other chroma subsamplings than 4:2:0 are supported */
if (global.codec->fourcc == VP9_FOURCC)
input.only_i420 = 0;
-#endif
for (pass = global.pass ? global.pass - 1 : 0; pass < global.passes; pass++) {
int frames_in = 0, seen_frames = 0;
@@ -2005,21 +1582,21 @@ int main(int argc, const char **argv_) {
/* If the input file doesn't specify its w/h (raw files), try to get
* the data from the first stream's configuration.
*/
- if (!input.w || !input.h)
+ if (!input.width || !input.height)
FOREACH_STREAM( {
if (stream->config.cfg.g_w && stream->config.cfg.g_h) {
- input.w = stream->config.cfg.g_w;
- input.h = stream->config.cfg.g_h;
+ input.width = stream->config.cfg.g_w;
+ input.height = stream->config.cfg.g_h;
break;
}
});
/* Update stream configurations from the input file's parameters */
- if (!input.w || !input.h)
+ if (!input.width || !input.height)
fatal("Specify stream dimensions with --width (-w) "
" and --height (-h)");
- FOREACH_STREAM(set_stream_dimensions(stream, input.w, input.h));
- FOREACH_STREAM(validate_stream_config(stream));
+ FOREACH_STREAM(set_stream_dimensions(stream, input.width, input.height));
+ FOREACH_STREAM(validate_stream_config(stream, &global));
/* Ensure that --passes and --pass are consistent. If --pass is set and
* --passes=2, ensure --fpf was set.
@@ -2031,11 +1608,21 @@ int main(int argc, const char **argv_) {
" and --passes=2\n", stream->index, global.pass);
});
+#if !CONFIG_WEBM_IO
+ FOREACH_STREAM({
+ stream->config.write_webm = 0;
+ warn("vpxenc was compiled without WebM container support."
+ "Producing IVF output");
+ });
+#endif
+
/* Use the frame rate from the file only if none was specified
* on the command-line.
*/
- if (!global.have_framerate)
- global.framerate = input.framerate;
+ if (!global.have_framerate) {
+ global.framerate.num = input.framerate.numerator;
+ global.framerate.den = input.framerate.denominator;
+ }
FOREACH_STREAM(set_default_kf_interval(stream, &global));
@@ -2053,11 +1640,11 @@ int main(int argc, const char **argv_) {
vpx_img_alloc(&raw,
input.use_i420 ? VPX_IMG_FMT_I420
: VPX_IMG_FMT_YV12,
- input.w, input.h, 32);
+ input.width, input.height, 32);
- FOREACH_STREAM(init_rate_histogram(&stream->rate_hist,
- &stream->config.cfg,
- &global.framerate));
+ FOREACH_STREAM(stream->rate_hist =
+ init_rate_histogram(&stream->config.cfg,
+ &global.framerate));
}
FOREACH_STREAM(setup_pass(stream, &global, pass));
@@ -2121,7 +1708,7 @@ int main(int argc, const char **argv_) {
int64_t rate;
if (global.limit) {
- int frame_in_lagged = (seen_frames - lagged_count) * 1000;
+ off_t frame_in_lagged = (seen_frames - lagged_count) * 1000;
rate = cx_time ? frame_in_lagged * (int64_t)1000000 / cx_time : 0;
remaining = 1000 * (global.limit - global.skip_frames
@@ -2194,10 +1781,10 @@ int main(int argc, const char **argv_) {
global.show_q_hist_buckets));
if (global.show_rate_hist_buckets)
- FOREACH_STREAM(show_rate_histogram(&stream->rate_hist,
+ FOREACH_STREAM(show_rate_histogram(stream->rate_hist,
&stream->config.cfg,
global.show_rate_hist_buckets));
- FOREACH_STREAM(destroy_rate_histogram(&stream->rate_hist));
+ FOREACH_STREAM(destroy_rate_histogram(stream->rate_hist));
#if CONFIG_INTERNAL_STATS
/* TODO(jkoleszar): This doesn't belong in this executable. Do it for now,
diff --git a/libvpx/vpxenc.h b/libvpx/vpxenc.h
new file mode 100644
index 0000000..a8c3722
--- /dev/null
+++ b/libvpx/vpxenc.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef VPXENC_H_
+#define VPXENC_H_
+
+#include "vpx/vpx_encoder.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum TestDecodeFatality {
+ TEST_DECODE_OFF,
+ TEST_DECODE_FATAL,
+ TEST_DECODE_WARN,
+};
+
+struct VpxInterface;
+
+/* Configuration elements common to all streams. */
+struct VpxEncoderConfig {
+ const struct VpxInterface *codec;
+ int passes;
+ int pass;
+ int usage;
+ int deadline;
+ int use_i420;
+ int quiet;
+ int verbose;
+ int limit;
+ int skip_frames;
+ int show_psnr;
+ enum TestDecodeFatality test_decode;
+ int have_framerate;
+ struct vpx_rational framerate;
+ int out_part;
+ int debug;
+ int show_q_hist_buckets;
+ int show_rate_hist_buckets;
+ int disable_warnings;
+ int disable_warning_prompt;
+ int experimental_bitstream;
+};
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VPXENC_H_
diff --git a/libvpx/vpxstats.c b/libvpx/vpxstats.c
index 70cea3e..5f88f8d 100644
--- a/libvpx/vpxstats.c
+++ b/libvpx/vpxstats.c
@@ -120,16 +120,3 @@ void stats_write(stats_io_t *stats, const void *pkt, size_t len) {
vpx_fixed_buf_t stats_get(stats_io_t *stats) {
return stats->buf;
}
-
-double vp8_mse2psnr(double samples, double peak, double mse) {
- const int kMaxPSNR = 100;
- double psnr = kMaxPSNR;
-
- if (mse > 0.0)
- psnr = 10.0 * log10(peak * peak * samples / mse);
-
- if (psnr > kMaxPSNR)
- psnr = kMaxPSNR;
-
- return psnr;
-}
diff --git a/libvpx/vpxstats.h b/libvpx/vpxstats.h
index 18b3acd..5c9ea34 100644
--- a/libvpx/vpxstats.h
+++ b/libvpx/vpxstats.h
@@ -15,6 +15,10 @@
#include "vpx/vpx_encoder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* This structure is used to abstract the different ways of handling
* first pass statistics
*/
@@ -32,6 +36,8 @@ void stats_close(stats_io_t *stats, int last_pass);
void stats_write(stats_io_t *stats, const void *pkt, size_t len);
vpx_fixed_buf_t stats_get(stats_io_t *stats);
-double vp8_mse2psnr(double samples, double peak, double mse);
+#ifdef __cplusplus
+} // extern "C"
+#endif
#endif // VPXSTATS_H_
diff --git a/libvpx/warnings.c b/libvpx/warnings.c
new file mode 100644
index 0000000..7ac678a
--- /dev/null
+++ b/libvpx/warnings.c
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "./warnings.h"
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vpx/vpx_encoder.h"
+
+#include "./tools_common.h"
+#include "./vpxenc.h"
+
+static const char quantizer_warning_string[] =
+ "Bad quantizer values. Quantizer values should not be equal, and should "
+ "differ by at least 8.";
+static const char lag_in_frames_with_realtime[] =
+ "Lag in frames is ignored when deadline is set to realtime.";
+
+struct WarningListNode {
+ const char *warning_string;
+ struct WarningListNode *next_warning;
+};
+
+struct WarningList {
+ struct WarningListNode *warning_node;
+};
+
+static void add_warning(const char *warning_string,
+ struct WarningList *warning_list) {
+ struct WarningListNode **node = &warning_list->warning_node;
+
+ struct WarningListNode *new_node = malloc(sizeof(*new_node));
+ if (new_node == NULL) {
+ fatal("Unable to allocate warning node.");
+ }
+
+ new_node->warning_string = warning_string;
+ new_node->next_warning = NULL;
+
+ while (*node != NULL)
+ node = &(*node)->next_warning;
+
+ *node = new_node;
+}
+
+static void free_warning_list(struct WarningList *warning_list) {
+ while (warning_list->warning_node != NULL) {
+ struct WarningListNode *const node = warning_list->warning_node;
+ warning_list->warning_node = node->next_warning;
+ free(node);
+ }
+}
+
+static int continue_prompt(int num_warnings) {
+ int c;
+ fprintf(stderr,
+ "%d encoder configuration warning(s). Continue? (y to continue) ",
+ num_warnings);
+ c = getchar();
+ return c == 'y';
+}
+
+static void check_quantizer(int min_q, int max_q,
+ struct WarningList *warning_list) {
+ const int lossless = min_q == 0 && max_q == 0;
+ if (!lossless && (min_q == max_q || abs(max_q - min_q) < 8))
+ add_warning(quantizer_warning_string, warning_list);
+}
+
+static void check_lag_in_frames_realtime_deadline(
+ int lag_in_frames,
+ int deadline,
+ struct WarningList *warning_list) {
+ if (deadline == VPX_DL_REALTIME && lag_in_frames != 0)
+ add_warning(lag_in_frames_with_realtime, warning_list);
+}
+
+void check_encoder_config(int disable_prompt,
+ const struct VpxEncoderConfig *global_config,
+ const struct vpx_codec_enc_cfg *stream_config) {
+ int num_warnings = 0;
+ struct WarningListNode *warning = NULL;
+ struct WarningList warning_list = {0};
+
+ check_quantizer(stream_config->rc_min_quantizer,
+ stream_config->rc_max_quantizer,
+ &warning_list);
+ check_lag_in_frames_realtime_deadline(stream_config->g_lag_in_frames,
+ global_config->deadline,
+ &warning_list);
+ /* Count and print warnings. */
+ for (warning = warning_list.warning_node;
+ warning != NULL;
+ warning = warning->next_warning,
+ ++num_warnings) {
+ warn(warning->warning_string);
+ }
+
+ free_warning_list(&warning_list);
+
+ if (num_warnings) {
+ if (!disable_prompt && !continue_prompt(num_warnings))
+ exit(EXIT_FAILURE);
+ }
+}
diff --git a/libvpx/warnings.h b/libvpx/warnings.h
new file mode 100644
index 0000000..6b8ae67
--- /dev/null
+++ b/libvpx/warnings.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef WARNINGS_H_
+#define WARNINGS_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct vpx_codec_enc_cfg;
+struct VpxEncoderConfig;
+
+/*
+ * Checks config for improperly used settings. Warns user upon encountering
+ * settings that will lead to poor output quality. Prompts user to continue
+ * when warnings are issued.
+ */
+void check_encoder_config(int disable_prompt,
+ const struct VpxEncoderConfig *global_config,
+ const struct vpx_codec_enc_cfg *stream_config);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // WARNINGS_H_
diff --git a/libvpx/webmdec.c b/libvpx/webmdec.c
new file mode 100644
index 0000000..7cacdf9
--- /dev/null
+++ b/libvpx/webmdec.c
@@ -0,0 +1,198 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "./webmdec.h"
+
+#include <stdarg.h>
+
+#include "third_party/nestegg/include/nestegg/nestegg.h"
+
+static int nestegg_read_cb(void *buffer, size_t length, void *userdata) {
+ FILE *f = userdata;
+
+ if (fread(buffer, 1, length, f) < length) {
+ if (ferror(f))
+ return -1;
+ if (feof(f))
+ return 0;
+ }
+ return 1;
+}
+
+static int nestegg_seek_cb(int64_t offset, int whence, void *userdata) {
+ switch (whence) {
+ case NESTEGG_SEEK_SET:
+ whence = SEEK_SET;
+ break;
+ case NESTEGG_SEEK_CUR:
+ whence = SEEK_CUR;
+ break;
+ case NESTEGG_SEEK_END:
+ whence = SEEK_END;
+ break;
+ };
+ return fseek(userdata, (int32_t)offset, whence) ? -1 : 0;
+}
+
+static int64_t nestegg_tell_cb(void *userdata) {
+ return ftell(userdata);
+}
+
+static void nestegg_log_cb(nestegg *context,
+ unsigned int severity,
+ char const *format, ...) {
+ va_list ap;
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ fprintf(stderr, "\n");
+ va_end(ap);
+}
+
+int file_is_webm(struct WebmInputContext *webm_ctx,
+ struct VpxInputContext *vpx_ctx) {
+ uint32_t i, n;
+ int track_type = -1;
+ int codec_id;
+
+ nestegg_io io = {nestegg_read_cb, nestegg_seek_cb, nestegg_tell_cb, 0};
+ nestegg_video_params params;
+
+ io.userdata = vpx_ctx->file;
+ if (nestegg_init(&webm_ctx->nestegg_ctx, io, NULL, -1))
+ goto fail;
+
+ if (nestegg_track_count(webm_ctx->nestegg_ctx, &n))
+ goto fail;
+
+ for (i = 0; i < n; i++) {
+ track_type = nestegg_track_type(webm_ctx->nestegg_ctx, i);
+
+ if (track_type == NESTEGG_TRACK_VIDEO)
+ break;
+ else if (track_type < 0)
+ goto fail;
+ }
+
+ codec_id = nestegg_track_codec_id(webm_ctx->nestegg_ctx, i);
+ if (codec_id == NESTEGG_CODEC_VP8) {
+ vpx_ctx->fourcc = VP8_FOURCC;
+ } else if (codec_id == NESTEGG_CODEC_VP9) {
+ vpx_ctx->fourcc = VP9_FOURCC;
+ } else {
+ fatal("Not VPx video, quitting.\n");
+ }
+
+ webm_ctx->video_track = i;
+
+ if (nestegg_track_video_params(webm_ctx->nestegg_ctx, i, &params))
+ goto fail;
+
+ vpx_ctx->framerate.denominator = 0;
+ vpx_ctx->framerate.numerator = 0;
+ vpx_ctx->width = params.width;
+ vpx_ctx->height = params.height;
+
+ return 1;
+
+ fail:
+ webm_ctx->nestegg_ctx = NULL;
+ rewind(vpx_ctx->file);
+
+ return 0;
+}
+
+int webm_read_frame(struct WebmInputContext *webm_ctx,
+ uint8_t **buffer,
+ size_t *bytes_in_buffer,
+ size_t *buffer_size) {
+ if (webm_ctx->chunk >= webm_ctx->chunks) {
+ uint32_t track;
+
+ do {
+ /* End of this packet, get another. */
+ if (webm_ctx->pkt) {
+ nestegg_free_packet(webm_ctx->pkt);
+ webm_ctx->pkt = NULL;
+ }
+
+ if (nestegg_read_packet(webm_ctx->nestegg_ctx, &webm_ctx->pkt) <= 0 ||
+ nestegg_packet_track(webm_ctx->pkt, &track)) {
+ return 1;
+ }
+ } while (track != webm_ctx->video_track);
+
+ if (nestegg_packet_count(webm_ctx->pkt, &webm_ctx->chunks))
+ return 1;
+
+ webm_ctx->chunk = 0;
+ }
+
+ if (nestegg_packet_data(webm_ctx->pkt, webm_ctx->chunk,
+ buffer, bytes_in_buffer)) {
+ return 1;
+ }
+
+ webm_ctx->chunk++;
+ return 0;
+}
+
+int webm_guess_framerate(struct WebmInputContext *webm_ctx,
+ struct VpxInputContext *vpx_ctx) {
+ uint32_t i;
+ uint64_t tstamp = 0;
+
+ /* Check to see if we can seek before we parse any data. */
+ if (nestegg_track_seek(webm_ctx->nestegg_ctx, webm_ctx->video_track, 0)) {
+ warn("Failed to guess framerate (no Cues), set to 30fps.\n");
+ vpx_ctx->framerate.numerator = 30;
+ vpx_ctx->framerate.denominator = 1;
+ return 0;
+ }
+
+ /* Guess the framerate. Read up to 1 second, or 50 video packets,
+ * whichever comes first.
+ */
+ for (i = 0; tstamp < 1000000000 && i < 50;) {
+ nestegg_packet *pkt;
+ uint32_t track;
+
+ if (nestegg_read_packet(webm_ctx->nestegg_ctx, &pkt) <= 0)
+ break;
+
+ nestegg_packet_track(pkt, &track);
+ if (track == webm_ctx->video_track) {
+ nestegg_packet_tstamp(pkt, &tstamp);
+ ++i;
+ }
+
+ nestegg_free_packet(pkt);
+ }
+
+ if (nestegg_track_seek(webm_ctx->nestegg_ctx, webm_ctx->video_track, 0))
+ goto fail;
+
+ vpx_ctx->framerate.numerator = (i - 1) * 1000000;
+ vpx_ctx->framerate.denominator = (int)(tstamp / 1000);
+ return 0;
+
+ fail:
+ nestegg_destroy(webm_ctx->nestegg_ctx);
+ webm_ctx->nestegg_ctx = NULL;
+ rewind(vpx_ctx->file);
+ return 1;
+}
+
+void webm_free(struct WebmInputContext *webm_ctx) {
+ if (webm_ctx && webm_ctx->nestegg_ctx) {
+ if (webm_ctx->pkt)
+ nestegg_free_packet(webm_ctx->pkt);
+ nestegg_destroy(webm_ctx->nestegg_ctx);
+ }
+}
diff --git a/libvpx/webmdec.h b/libvpx/webmdec.h
new file mode 100644
index 0000000..fa5a52e
--- /dev/null
+++ b/libvpx/webmdec.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+#ifndef WEBMDEC_H_
+#define WEBMDEC_H_
+
+#include "./tools_common.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct nestegg;
+struct nestegg_packet;
+struct VpxInputContext;
+
+struct WebmInputContext {
+ uint32_t chunk;
+ uint32_t chunks;
+ uint32_t video_track;
+ struct nestegg *nestegg_ctx;
+ struct nestegg_packet *pkt;
+};
+
+int file_is_webm(struct WebmInputContext *webm_ctx,
+ struct VpxInputContext *vpx_ctx);
+
+int webm_read_frame(struct WebmInputContext *webm_ctx,
+ uint8_t **buffer,
+ size_t *bytes_in_buffer,
+ size_t *buffer_size);
+
+int webm_guess_framerate(struct WebmInputContext *webm_ctx,
+ struct VpxInputContext *vpx_ctx);
+
+void webm_free(struct WebmInputContext *webm_ctx);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // WEBMDEC_H_
diff --git a/libvpx/webmenc.h b/libvpx/webmenc.h
index f3bc3ec..362aa89 100644
--- a/libvpx/webmenc.h
+++ b/libvpx/webmenc.h
@@ -23,6 +23,10 @@ typedef __int64 off_t;
#include "tools_common.h"
#include "vpx/vpx_encoder.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef off_t EbmlLoc;
struct cue_entry {
@@ -84,4 +88,8 @@ void write_webm_block(struct EbmlGlobal *glob,
void write_webm_file_footer(struct EbmlGlobal *glob, int hash);
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
#endif // WEBMENC_H_
diff --git a/libvpx/y4menc.c b/libvpx/y4menc.c
new file mode 100644
index 0000000..8b1c95e
--- /dev/null
+++ b/libvpx/y4menc.c
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include "./y4menc.h"
+
+int y4m_write_file_header(char *buf, size_t len, int width, int height,
+ const struct VpxRational *framerate,
+ vpx_img_fmt_t fmt) {
+ const char *const color = fmt == VPX_IMG_FMT_444A ? "C444alpha\n" :
+ fmt == VPX_IMG_FMT_I444 ? "C444\n" :
+ fmt == VPX_IMG_FMT_I422 ? "C422\n" :
+ "C420jpeg\n";
+
+ return snprintf(buf, len, "YUV4MPEG2 W%u H%u F%u:%u I%c %s", width, height,
+ framerate->numerator, framerate->denominator, 'p', color);
+}
+
+int y4m_write_frame_header(char *buf, size_t len) {
+ return snprintf(buf, len, "FRAME\n");
+}
diff --git a/libvpx/y4menc.h b/libvpx/y4menc.h
new file mode 100644
index 0000000..0fabf56
--- /dev/null
+++ b/libvpx/y4menc.h
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef Y4MENC_H_
+#define Y4MENC_H_
+
+#include "./tools_common.h"
+
+#include "vpx/vpx_decoder.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define Y4M_BUFFER_SIZE 128
+
+int y4m_write_file_header(char *buf, size_t len, int width, int height,
+ const struct VpxRational *framerate,
+ vpx_img_fmt_t fmt);
+int y4m_write_frame_header(char *buf, size_t len);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // Y4MENC_H_
diff --git a/libvpx/y4minput.c b/libvpx/y4minput.c
index 47f005a..90c5310 100644
--- a/libvpx/y4minput.c
+++ b/libvpx/y4minput.c
@@ -10,10 +10,45 @@
* Based on code from the OggTheora software codec source code,
* Copyright (C) 2002-2010 The Xiph.Org Foundation and contributors.
*/
+#include <errno.h>
#include <stdlib.h>
#include <string.h>
+
+#include "vpx/vpx_integer.h"
#include "y4minput.h"
+// Reads 'size' bytes from 'file' into 'buf' with some fault tolerance.
+// Returns true on success.
+static int file_read(void *buf, size_t size, FILE *file) {
+ const int kMaxRetries = 5;
+ int retry_count = 0;
+ int file_error;
+ size_t len = 0;
+ do {
+ const size_t n = fread((uint8_t*)buf + len, 1, size - len, file);
+ len += n;
+ file_error = ferror(file);
+ if (file_error) {
+ if (errno == EINTR || errno == EAGAIN) {
+ clearerr(file);
+ continue;
+ } else {
+ fprintf(stderr, "Error reading file: %u of %u bytes read, %d: %s\n",
+ (uint32_t)len, (uint32_t)size, errno, strerror(errno));
+ return 0;
+ }
+ }
+ } while (!feof(file) && len < size && ++retry_count < kMaxRetries);
+
+ if (!feof(file) && len != size) {
+ fprintf(stderr, "Error reading file: %u of %u bytes read,"
+ " error: %d, retries: %d, %d: %s\n",
+ (uint32_t)len, (uint32_t)size, file_error, retry_count,
+ errno, strerror(errno));
+ }
+ return len == size;
+}
+
static int y4m_parse_tags(y4m_input *_y4m, char *_tags) {
int got_w;
int got_h;
@@ -670,8 +705,7 @@ int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip,
buffer[i] = *_skip++;
_nskip--;
} else {
- ret = (int)fread(buffer + i, 1, 1, _fin);
- if (ret < 1)return -1;
+ if (!file_read(buffer + i, 1, _fin)) return -1;
}
if (buffer[i] == '\n')break;
}
@@ -853,10 +887,8 @@ int y4m_input_fetch_frame(y4m_input *_y4m, FILE *_fin, vpx_image_t *_img) {
int c_w;
int c_h;
int c_sz;
- int ret;
/*Read and skip the frame header.*/
- ret = (int)fread(frame, 1, 6, _fin);
- if (ret < 6)return 0;
+ if (!file_read(frame, 6, _fin)) return 0;
if (memcmp(frame, "FRAME", 5)) {
fprintf(stderr, "Loss of framing in Y4M input data\n");
return -1;
@@ -864,19 +896,19 @@ int y4m_input_fetch_frame(y4m_input *_y4m, FILE *_fin, vpx_image_t *_img) {
if (frame[5] != '\n') {
char c;
int j;
- for (j = 0; j < 79 && fread(&c, 1, 1, _fin) && c != '\n'; j++);
+ for (j = 0; j < 79 && file_read(&c, 1, _fin) && c != '\n'; j++) {}
if (j == 79) {
fprintf(stderr, "Error parsing Y4M frame header\n");
return -1;
}
}
/*Read the frame data that needs no conversion.*/
- if (fread(_y4m->dst_buf, 1, _y4m->dst_buf_read_sz, _fin) != _y4m->dst_buf_read_sz) {
+ if (!file_read(_y4m->dst_buf, _y4m->dst_buf_read_sz, _fin)) {
fprintf(stderr, "Error reading Y4M frame data.\n");
return -1;
}
/*Read the frame data that does need conversion.*/
- if (fread(_y4m->aux_buf, 1, _y4m->aux_buf_read_sz, _fin) != _y4m->aux_buf_read_sz) {
+ if (!file_read(_y4m->aux_buf, _y4m->aux_buf_read_sz, _fin)) {
fprintf(stderr, "Error reading Y4M frame data.\n");
return -1;
}
diff --git a/libvpx/y4minput.h b/libvpx/y4minput.h
index b2a390c..d53eb65 100644
--- a/libvpx/y4minput.h
+++ b/libvpx/y4minput.h
@@ -10,11 +10,17 @@
* Based on code from the OggTheora software codec source code,
* Copyright (C) 2002-2010 The Xiph.Org Foundation and contributors.
*/
-#if !defined(_y4minput_H)
-# define _y4minput_H (1)
+
+#ifndef Y4MINPUT_H_
+#define Y4MINPUT_H_
+
# include <stdio.h>
# include "vpx/vpx_image.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
typedef struct y4m_input y4m_input;
@@ -60,4 +66,8 @@ int y4m_input_open(y4m_input *_y4m, FILE *_fin, char *_skip, int _nskip,
void y4m_input_close(y4m_input *_y4m);
int y4m_input_fetch_frame(y4m_input *_y4m, FILE *_fin, vpx_image_t *img);
+#ifdef __cplusplus
+} // extern "C"
#endif
+
+#endif // Y4MINPUT_H_